X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=test%2Fcallback.cpp;h=257da83c8e7ee4f56028ae998b624edaf33f1931;hp=bc951b958fe0d838299ee4bce6ccb5a8cd70636b;hb=393e7b700efffc748e593661b365ead414a341c1;hpb=af84dfb53a739a0c8c343d9172f1847fa908906d diff --git a/test/callback.cpp b/test/callback.cpp index bc951b9..257da83 100644 --- a/test/callback.cpp +++ b/test/callback.cpp @@ -44,6 +44,8 @@ class test_callback : public TestFixture std::vector callback_done; + pid_t child_pid; + public: void setUp() @@ -54,6 +56,10 @@ class test_callback : public TestFixture void tearDown() { callback_done.clear(); + + // make sure the server-child is dead before the next test runs + kill(child_pid,SIGKILL); + sleep(1); } void callback_func(callback_event_type ev, int conn_id) @@ -67,9 +73,7 @@ class test_callback : public TestFixture void ServerNewConnCallback() { - pid_t pid; - - switch(pid=fork()) + switch(child_pid=fork()) { case -1: { @@ -128,9 +132,7 @@ class test_callback : public TestFixture void ServerConnClosedCallback() { - pid_t pid; - - switch(pid=fork()) + switch(child_pid=fork()) { case -1: { @@ -189,9 +191,7 @@ class test_callback : public TestFixture void ServerConnDeletedCallback() { - pid_t pid; - - switch(pid=fork()) + switch(child_pid=fork()) { case -1: { @@ -253,9 +253,7 @@ class test_callback : public TestFixture void ServerCallbackOrder() { - pid_t pid; - - switch(pid=fork()) + switch(child_pid=fork()) { case -1: { @@ -336,9 +334,7 @@ class test_callback : public TestFixture void ClientConnClosedCallback() { - pid_t pid; - - switch(pid=fork()) + switch(child_pid=fork()) { case -1: { @@ -390,9 +386,7 @@ class test_callback : public TestFixture void ClientConnDeletedCallback() { - pid_t pid; - - switch(pid=fork()) + switch(child_pid=fork()) { case -1: {