X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=test%2Fcomm.cpp;fp=test%2Fcomm.cpp;h=7bd8b242a2ea86d79ffc19ca3ea73765f32d16cc;hp=688cbf010d51c9a46c84a947afdb2b34852ddc60;hb=b592218402bfa779c024da2f32c4c782d52eaf88;hpb=fb3345ada7ea94225b78994fd50e3de693a2a3d5 diff --git a/test/comm.cpp b/test/comm.cpp index 688cbf0..7bd8b24 100644 --- a/test/comm.cpp +++ b/test/comm.cpp @@ -41,20 +41,25 @@ class test_comm : 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 UnixCommToServer() { - pid_t pid; string data; - switch(pid=fork()) + switch(child_pid=fork()) { case -1: { @@ -94,9 +99,7 @@ class test_comm : public TestFixture void UnixCommToServerAndBack() { - pid_t pid; - - switch(pid=fork()) + switch(child_pid=fork()) { case -1: { @@ -166,9 +169,7 @@ class test_comm : public TestFixture void UnixCommToServerAndBackBig() { - pid_t pid; - - switch(pid=fork()) + switch(child_pid=fork()) { case -1: { @@ -229,10 +230,9 @@ class test_comm : public TestFixture void IPCommToServer() { - pid_t pid; string data; - switch(pid=fork()) + switch(child_pid=fork()) { case -1: { @@ -272,9 +272,7 @@ class test_comm : public TestFixture void IPCommToServerAndBack() { - pid_t pid; - - switch(pid=fork()) + switch(child_pid=fork()) { case -1: { @@ -344,9 +342,7 @@ class test_comm : public TestFixture void IPCommToServerAndBackBig() { - pid_t pid; - - switch(pid=fork()) + switch(child_pid=fork()) { case -1: { @@ -406,9 +402,6 @@ class test_comm : public TestFixture } } } // eo IPCommToServerAndBackBig() - - - }; CPPUNIT_TEST_SUITE_REGISTRATION(test_comm);