summaryrefslogtreecommitdiff
path: root/server/src/sessionserialiser.cc
diff options
context:
space:
mode:
authordeva <deva>2011-02-17 11:00:14 +0000
committerdeva <deva>2011-02-17 11:00:14 +0000
commitdb144840aba95affb3a6b5b2536059f49f0677ff (patch)
tree1c397a20aa5745c6bbb5dee6a4409f58c4542e87 /server/src/sessionserialiser.cc
parentc8651b8c89673300477ab86962640c93216ea306 (diff)
Rewrite of all old tests to new unittest framework. Also some work on testdb; more to come...
Diffstat (limited to 'server/src/sessionserialiser.cc')
-rw-r--r--server/src/sessionserialiser.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/server/src/sessionserialiser.cc b/server/src/sessionserialiser.cc
index b20e4c4..99f880b 100644
--- a/server/src/sessionserialiser.cc
+++ b/server/src/sessionserialiser.cc
@@ -242,8 +242,8 @@ Session *SessionSerialiser::findFromTupple(const std::string &patientid,
}
#ifdef TEST_SESSIONSERIALISER
-//deps: session.cc journal.cc debug.cc configuration.cc mutex.cc journal_commit.cc sessionparser.cc saxparser.cc xml_encode_decode.cc database.cc pracrodaopgsql.cc pracrodaotest.cc pracrodao.cc journal_uploadserver.cc log.cc
-//cflags: -I.. $(PTHREAD_CFLAGS) $(EXPAT_CFLAGS) $(PQXX_CFLAGS)
+//deps: session.cc journal.cc debug.cc configuration.cc mutex.cc journal_commit.cc sessionparser.cc saxparser.cc xml_encode_decode.cc database.cc pracrodaopgsql.cc pracrodaotest.cc pracrodao.cc journal_uploadserver.cc log.cc environment.cc semaphore.cc artefact.cc macrolist.cc templatelist.cc entitylist.cc inotify.cc versionstr.cc exception.cc macroheaderparser.cc templateheaderparser.cc
+//cflags: -I.. $(PTHREAD_CFLAGS) $(EXPAT_CFLAGS) $(PQXX_CFLAGS) -DWITHOUT_ARTEFACT
//libs: $(PTHREAD_LIBS) $(EXPAT_LIBS) $(PQXX_LIBS)
#include "test.h"
@@ -260,6 +260,8 @@ std::string xml;
debug_parse("+all");
+Environment env;
+
{
FILE *fp = fopen("/tmp/"PRE".42", "w");
fclose(fp);
@@ -276,12 +278,12 @@ debug_parse("+all");
}
{
- Session session(SID, PID, TID);
+ Session session(&env, SID, PID, TID);
Journal *j = session.journal();
j->addEntry("some text", "macro1", 0);
j->addEntry("some more text", "macro2", 2);
j->addEntry("yet some more text", "macro3", 1);
- SessionSerialiser s(SPATH);
+ SessionSerialiser s(&env, SPATH);
xml = s.saveStr(&session);
s.loadStr(xml);
std::string xml2 = s.saveStr(&session);
@@ -289,12 +291,12 @@ debug_parse("+all");
}
{
- Session session(SID, PID, TID);
+ Session session(&env, SID, PID, TID);
Journal *j = session.journal();
j->addEntry("some text", "macro1", 0);
j->addEntry("some more text", "macro2", 2);
j->addEntry("yet some more text", "macro3", 1);
- SessionSerialiser s(SPATH);
+ SessionSerialiser s(&env, SPATH);
xml = s.saveStr(&session);
}
/*
@@ -307,12 +309,12 @@ debug_parse("+all");
}
*/
{
- Session session(SID, PID, TID);
+ Session session(&env, SID, PID, TID);
Journal *j = session.journal();
j->addEntry("some text", "macro1", 0);
j->addEntry("some more text", "macro2", 2);
j->addEntry("yet some more text", "macro3", 1);
- SessionSerialiser s(SPATH);
+ SessionSerialiser s(&env, SPATH);
s.save(&session);
}
/*
@@ -326,8 +328,8 @@ debug_parse("+all");
*/
{
- Session session(SID, PID, TID);
- SessionSerialiser s(SPATH);
+ Session session(&env, SID, PID, TID);
+ SessionSerialiser s(&env, SPATH);
s.save(&session);
Session *s1 = s.findFromTupple(PID, TID);
TEST_NOTEQUAL(s1, NULL, "Found it?");