summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordeva <deva>2008-07-22 12:05:11 +0000
committerdeva <deva>2008-07-22 12:05:11 +0000
commit42512d40ef93f0f85d107a7dc6d58973f93a1d95 (patch)
treeb7379e64a75ef1a821aaa80a47f382e6ec2137c3
parent28d39474e6c0c14bd12716a9e20ad0469cd17cc6 (diff)
Updated testcode
-rw-r--r--server/src/Makefile.am6
-rw-r--r--server/src/luaquerymapper.cc10
2 files changed, 9 insertions, 7 deletions
diff --git a/server/src/Makefile.am b/server/src/Makefile.am
index 594bfdb..6e197c2 100644
--- a/server/src/Makefile.am
+++ b/server/src/Makefile.am
@@ -67,13 +67,13 @@ test_clean:
rm -f $(TESTFILES)
test_queryhandler: queryhandler.cc
- @../../tools/test queryhandler.cc tcpsocket.cc exception.cc uid.cc log.cc
+ @../../tools/test queryhandler.cc tcpsocket.cc exception.cc log.cc
test_queryparser: queryparser.cc
- @../../tools/test queryparser.cc queryhandler.cc tcpsocket.cc exception.cc uid.cc log.cc saxparser.cc -lexpat
+ @../../tools/test queryparser.cc queryhandler.cc tcpsocket.cc exception.cc log.cc saxparser.cc -lexpat
test_luaquerymapper: luaquerymapper.cc
- @../../tools/test luaquerymapper.cc queryparser.cc queryhandler.cc tcpsocket.cc exception.cc uid.cc log.cc saxparser.cc -lexpat $(LUA_LIBS)
+ @../../tools/test luaquerymapper.cc queryparser.cc queryhandler.cc tcpsocket.cc exception.cc log.cc saxparser.cc -lexpat $(LUA_LIBS)
test_templateparser: templateparser.cc
@../../tools/test templateparser.cc saxparser.cc exception.cc log.cc -lexpat -DXML="\"../xml\""
diff --git a/server/src/luaquerymapper.cc b/server/src/luaquerymapper.cc
index 5b66a35..acd6b26 100644
--- a/server/src/luaquerymapper.cc
+++ b/server/src/luaquerymapper.cc
@@ -170,11 +170,13 @@ int main()
LUAQueryMapper mapper(e.result);
- std::string luamap = "return right.sphere";
- printf("%s : %s\n", luamap.c_str(), mapper.map(luamap).c_str());
+ std::string luamap = "return right.sphere, 0";
+ Value value = mapper.map(luamap);
+ printf("%s : %s, %lu\n", luamap.c_str(), value.value.c_str(), value.timestamp);
- luamap = "return math.sin(right.cyl) * 2";
- printf("%s : %s\n", luamap.c_str(), mapper.map(luamap).c_str());
+ luamap = "return math.sin(right.cyl) * 2, 0";
+ value = mapper.map(luamap);
+ printf("%s : %s, %lu\n", luamap.c_str(), value.value.c_str(), value.timestamp);
return 0;
}