From db144840aba95affb3a6b5b2536059f49f0677ff Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 17 Feb 2011 11:00:14 +0000 Subject: Rewrite of all old tests to new unittest framework. Also some work on testdb; more to come... --- server/src/tcpsocket.cc | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'server/src/tcpsocket.cc') diff --git a/server/src/tcpsocket.cc b/server/src/tcpsocket.cc index 70722ed..b54b581 100644 --- a/server/src/tcpsocket.cc +++ b/server/src/tcpsocket.cc @@ -367,9 +367,19 @@ std::string TCPSocket::dstaddr() } #ifdef TEST_TCPSOCKET +//deps: exception.cc debug.cc log.cc +//cflags: -I.. +//libs: +#include -int main() -{ +#define PORT 12346 + +TEST_BEGIN; + +// TODO: Put some testcode here (see test.h for usable macros). +TEST_TRUE(false, "No tests yet!"); + +/* char buf[32]; switch(fork()) { @@ -381,7 +391,7 @@ int main() try { TCPSocket client; sleep(1); // We need to wait for the listen socket to be created. - client.connect("localhost", 12345); + client.connect("localhost", PORT); sprintf(buf, "hello"); client.write(buf, sizeof(buf)); printf("Sent: [%s]\n", buf); @@ -394,7 +404,7 @@ int main() default: // parent try { TCPSocket listen_sock; - listen_sock.listen(12345); + listen_sock.listen(PORT); TCPSocket *sock = listen_sock.accept(); sock->read(buf, sizeof(buf)); printf("Got: [%s]\n", buf); @@ -406,8 +416,8 @@ int main() } break; } +*/ - return 0; -} +TEST_END; #endif/*TEST_TCPSOCKET*/ -- cgit v1.2.3