summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2014-10-03 03:58:51 +0200
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2014-10-03 04:04:42 +0200
commit2ad8887a12aeff9108606bb31e1557103a3b95df (patch)
treefebb8e1afb65522f6ab9c1ea16817db9bddd7717
parent043f62949e6eb400ad42fd891a957ecf514c35f3 (diff)
test-barrier: add checks after the barrier constructor
Coverity seems to think that we can later end up with the "them" fd having a negative value. Even after a succesful barrier_create. Add some test to verify that the constructor went well. If coverity still complains then it must mean that it thinks the the value is overwritten later.
-rw-r--r--src/test/test-barrier.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/test-barrier.c b/src/test/test-barrier.c
index 36f27809ca..cb75f7314d 100644
--- a/src/test/test-barrier.c
+++ b/src/test/test-barrier.c
@@ -64,6 +64,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); \