X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=test%2Freconnect.cpp;fp=test%2Freconnect.cpp;h=394ba25e6102cb7fb0eee8a3c14091807fb89e31;hp=9e64a8e3919c6ef0a9e589e345982dea58da32bf;hb=b592218402bfa779c024da2f32c4c782d52eaf88;hpb=fb3345ada7ea94225b78994fd50e3de693a2a3d5 diff --git a/test/reconnect.cpp b/test/reconnect.cpp index 9e64a8e..394ba25 100644 --- a/test/reconnect.cpp +++ b/test/reconnect.cpp @@ -52,13 +52,19 @@ class test_reconnect : public TestFixture CPPUNIT_TEST_SUITE_END(); + pid_t child_pid; + public: void setUp() { } void tearDown() - { } + { + // make sure the server-child is dead before the next test runs + kill(child_pid,SIGKILL); + sleep(1); + } void send_raw_socket(string hello_string, socket_server* ss, int conn_id) { @@ -71,9 +77,7 @@ class test_reconnect : public TestFixture void simple_reconnect() { - pid_t pid; - - switch(pid=fork()) + switch(child_pid=fork()) { case -1: { @@ -144,9 +148,7 @@ class test_reconnect : public TestFixture void reconnect_with_close() { - pid_t pid; - - switch(pid=fork()) + switch(child_pid=fork()) { case -1: { @@ -222,9 +224,7 @@ class test_reconnect : public TestFixture void reconnect_buffer_complete() { - pid_t pid; - - switch(pid=fork()) + switch(child_pid=fork()) { case -1: { @@ -290,11 +290,9 @@ class test_reconnect : public TestFixture void reconnect_buffer_several_complete() { - pid_t pid; - const int packets=3; - switch(pid=fork()) + switch(child_pid=fork()) { case -1: { @@ -380,9 +378,7 @@ class test_reconnect : public TestFixture void reconnect_buffer_no_incomplete1() { - pid_t pid; - - switch(pid=fork()) + switch(child_pid=fork()) { case -1: { @@ -458,9 +454,7 @@ class test_reconnect : public TestFixture void reconnect_buffer_no_incomplete2() { - pid_t pid; - - switch(pid=fork()) + switch(child_pid=fork()) { case -1: {