From db44a85be6164a51b964169cd25a35b8252ee042 Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 7 Aug 2009 12:25:42 +0000 Subject: Make the server and queryhandlerpracro test scripts use the new testdb interface. --- server/src/Makefile.am | 10 ++++++---- server/src/queryhandlerpracro.cc | 2 +- server/src/server.cc | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'server') diff --git a/server/src/Makefile.am b/server/src/Makefile.am index 399d7fa..eb52775 100644 --- a/server/src/Makefile.am +++ b/server/src/Makefile.am @@ -139,7 +139,7 @@ BASICFLAGS = -I.. -DHAVE_CONFIG_H $(CONFIG_CXXFLAGS) $(CONFIG_LIBS) PARSERFILES = saxparser.cc PARSERFLAGS = -lexpat -DBFILES = database.cc pracrodao.cc pracrodaopgsql.cc +DBFILES = database.cc pracrodao.cc pracrodaopgsql.cc pracrodaotest.cc DBFLAGS = $(PQXX_LIBS) $(PQXX_CXXFLAGS) test: $(TESTFILES) @@ -159,9 +159,10 @@ TEST_WIDGETGENERATOR_FILES = \ widgetgenerator.cc \ xml_encode_decode.cc \ luaquerymapper.cc \ - $(BASICFILES) + $(BASICFILES) \ + $(DBFILES) test_widgetgenerator: $(TEST_WIDGETGENERATOR_FILES) - @../../tools/test $(TEST_WIDGETGENERATOR_FILES) $(BASICFLAGS) $(LUA_LIBS) + @../../tools/test $(TEST_WIDGETGENERATOR_FILES) $(BASICFLAGS) $(LUA_LIBS) $(DBFLAGS) TEST_CONFIGURATIONPARSER_FILES = \ configurationparser.cc \ @@ -292,7 +293,8 @@ TEST_SERVER_FILES = \ transactionparser.cc \ widgetgenerator.cc \ database.cc \ - pracrodao.cc \ + pracrodao.cc \ + pracrodaotest.cc \ pracrodaopgsql.cc \ luaresume.cc \ macroparser.cc \ diff --git a/server/src/queryhandlerpracro.cc b/server/src/queryhandlerpracro.cc index e58e8c4..e26de0c 100644 --- a/server/src/queryhandlerpracro.cc +++ b/server/src/queryhandlerpracro.cc @@ -67,7 +67,7 @@ QueryResult QueryHandlerPracro::exec(Query &query) int main() { - Database db("pgsql", Conf::database_addr, "", Conf::database_user, Conf::database_passwd, ""); + Database db("testdb", Conf::database_addr, "", Conf::database_user, Conf::database_passwd, ""); QueryHandlerPracro qh(db, "2003791613"); diff --git a/server/src/server.cc b/server/src/server.cc index a47eb28..a5a4880 100644 --- a/server/src/server.cc +++ b/server/src/server.cc @@ -445,6 +445,7 @@ int main() { Conf::xml_basedir = "../xml/"; Conf::server_port = 32100; // Make sure wo don't interrupt an already running server. + Conf::database_backend = "testdb"; pid_t pid = fork(); switch(pid) { -- cgit v1.2.3