From 63d7e433f104dd13d015df3a048697fad6d43a55 Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 15 May 2008 14:19:02 +0000 Subject: Added a lot of testcode... and fixed a lot of minor error (-Wall -Werror) --- server/src/queryparser.cc | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'server/src/queryparser.cc') diff --git a/server/src/queryparser.cc b/server/src/queryparser.cc index 38e3037..34c7aa3 100644 --- a/server/src/queryparser.cc +++ b/server/src/queryparser.cc @@ -62,7 +62,9 @@ int QueryParser::readData(char *data, size_t size) return len; } -#ifdef TEST_EXTERNALDATAQUERYPARSER +#ifdef TEST_QUERYPARSER + +#include "queryhandler.h" static std::string loadresultstring(QueryResult &res, std::string group = "") { @@ -84,24 +86,21 @@ static std::string loadresultstring(QueryResult &res, std::string group = "") return s; } -char xml[] = - "\n" - "\n" - " " - " " - " \n" - " " - " " - " \n" - " \n" - " " - " " - " \n" - "\n"; - int main() { - QueryParser e(xml); + TCPSocket s; + s.connect("localhost", 11108); + + QueryHandler qh(&s, "2003791613"); + + Query q1("lensmeter", "lensmeter"); + qh.addQuery(q1); + + std::string res = qh.exec(); + + printf("%s\n", res.c_str()); + + QueryParser e(res); e.parse(); printf("%s\n", loadresultstring(e.result).c_str()); -- cgit v1.2.3