7 #include <CUnit/CUnit.h>
11 #include "test_process.h"
13 void test_wait_for_death(void)
19 execl("/bin/true", "/bin/true", NULL
);
23 CU_ASSERT(!wait_for_death(pid
, 0, 2000));
24 CU_ASSERT(wait_for_death(pid
, 0, 20000));
27 void test_ensure_death(void)
32 signal(SIGTERM
, SIG_IGN
);
33 signal(SIGHUP
, SIG_IGN
);
34 execl("/bin/true", "/bin/true", NULL
);
40 CU_ASSERT(waitpid(pid
, NULL
, WNOHANG
) < 0);
41 CU_ASSERT(errno
== ECHILD
);
44 CU_TestInfo process_tests
[] = {
45 { "test_wait_for_death", test_wait_for_death
},
46 { "test_ensure_death", test_ensure_death
},