X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=test%2Fcmdgroup.cpp;h=314e28d45ead688b3f88db3667d2d65403a2d16f;hp=fc5952b92ab58440eef570b4ce2426df17aee909;hb=393e7b700efffc748e593661b365ead414a341c1;hpb=539b09c0c1819f9394e5a0ae8b3df3687715fa7c diff --git a/test/cmdgroup.cpp b/test/cmdgroup.cpp index fc5952b..314e28d 100644 --- a/test/cmdgroup.cpp +++ b/test/cmdgroup.cpp @@ -167,19 +167,23 @@ class test_cmdgroup : 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 GroupOk() { - pid_t pid; - - switch(pid=fork()) + switch(child_pid=fork()) { case -1: { @@ -206,7 +210,7 @@ class test_cmdgroup : public TestFixture // wait till server is up sleep(1); socket_client_connection sc("./socket"); - command_client cc(sc); + command_client cc(&sc); result_container rc; cc.send_command(new testfunc4a_cmd("hello"),rc); @@ -220,9 +224,7 @@ class test_cmdgroup : public TestFixture void WrongGroup() { - pid_t pid; - - switch(pid=fork()) + switch(child_pid=fork()) { case -1: { @@ -249,7 +251,7 @@ class test_cmdgroup : public TestFixture // wait till server is up sleep(1); socket_client_connection sc("./socket"); - command_client cc(sc); + command_client cc(&sc); result_container rc; cc.send_command(new testfunc4a_cmd("hello"),rc);