summaryrefslogtreecommitdiff
path: root/server/src/session.cc
diff options
context:
space:
mode:
authordeva <deva>2009-12-17 12:44:56 +0000
committerdeva <deva>2009-12-17 12:44:56 +0000
commitbe4fc7990b91e1fb053df4a1388f13aaad9772f8 (patch)
treee97d423a64012f4b08212ad98154f7ff2adf1096 /server/src/session.cc
parent8752ec3b024e6642b7ecd24207d3bf4accfe5aba (diff)
Ported to the new test framework.
Diffstat (limited to 'server/src/session.cc')
-rw-r--r--server/src/session.cc26
1 files changed, 12 insertions, 14 deletions
diff --git a/server/src/session.cc b/server/src/session.cc
index 02a78c5..0e8679c 100644
--- a/server/src/session.cc
+++ b/server/src/session.cc
@@ -85,23 +85,21 @@ void Sessions::deleteSession(std::string sessionid)
}
#ifdef TEST_SESSION
+//deps:
+//cflags:
+//libs:
+#include <test.h>
-int main()
-{
- Sessions sessions;
-
- srand(0);
- Session *s1 = sessions.newSession();
- srand(0);
- Session *s2 = sessions.newSession();
+TEST_BEGIN;
+Sessions sessions;
- if(s1->id() == s2->id()) {
- printf("IDs not unique.\n");
- return 1;
- }
+srand(0);
+Session *s1 = sessions.newSession();
+srand(0);
+Session *s2 = sessions.newSession();
- return 0;
+TEST_NOTEQUAL(s1->id(), s2->id(), "Testing if IDs are unique.");
-}
+TEST_END;
#endif/*TEST_SESSION*/