[systemd-commits] src/test

Thomas H.P. Andersen phomes at kemper.freedesktop.org
Thu Oct 2 19:04:46 PDT 2014


 src/test/test-barrier.c |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 2ad8887a12aeff9108606bb31e1557103a3b95df
Author: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
Date:   Fri Oct 3 03:58:51 2014 +0200

    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.

diff --git a/src/test/test-barrier.c b/src/test/test-barrier.c
index 36f2780..cb75f73 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);                                   \



More information about the systemd-commits mailing list