X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Ftest%2Ftest-barrier.c;h=2d109a30e7f8ecf9ec3d6b3bb0ccfa2e0161c45b;hb=adfe5671ef794099068038dfccbf1eb5134433c8;hp=ac9dd04b991f6d585e325ae28710f2605e6ca1ee;hpb=cf347234ae78630dd4aad8907f027965e7fb9040;p=elogind.git diff --git a/src/test/test-barrier.c b/src/test/test-barrier.c index ac9dd04b9..2d109a30e 100644 --- a/src/test/test-barrier.c +++ b/src/test/test-barrier.c @@ -28,15 +28,12 @@ * increase it at the slightly cost of lengthen test-duration on other machines. */ -#include #include -#include #include #include #include #include "barrier.h" -#include "def.h" #include "util.h" /* 20ms to test deadlocks; All timings use multiples of this constant as @@ -64,6 +61,10 @@ static void sleep_for(usec_t usecs) { pid_t pid1, pid2; \ \ assert_se(barrier_create(&b) >= 0); \ + assert_se(b.me > 0); \ + assert_se(b.them > 0); \ + assert_se(b.pipe[0] > 0); \ + assert_se(b.pipe[1] > 0); \ \ pid1 = fork(); \ assert_se(pid1 >= 0); \ @@ -176,7 +177,7 @@ TEST_BARRIER(test_barrier_wait_next_twice, set_alarm(BASE_TIME * 10); assert_se(barrier_place(&b)); assert_se(barrier_place(&b)); - sleep_for(BASE_TIME * 2); + sleep_for(BASE_TIME * 4); }), TEST_BARRIER_WAIT_SUCCESS(pid2)); @@ -201,7 +202,7 @@ TEST_BARRIER(test_barrier_wait_next_twice_local, set_alarm(BASE_TIME * 10); assert_se(barrier_place(&b)); assert_se(barrier_place(&b)); - sleep_for(BASE_TIME * 2); + sleep_for(BASE_TIME * 4); }), TEST_BARRIER_WAIT_SUCCESS(pid2));