From 0216d63c88dfd1249259704ce79c6359533481ce Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Mon, 15 Jun 2020 17:44:24 +0200 Subject: [PATCH] test: use plain asserts for coverity It seems like coverity cannot deal with g_assert_cmpint and thus gives us false positives assuming fd could be -1. Use plain asserts for now. I tried to add a modeling file but that didnt work int their web interface. --- tests/bolt-test.c | 3 ++- tests/test-guard.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/bolt-test.c b/tests/bolt-test.c index 61fe03d..00e98d1 100644 --- a/tests/bolt-test.c +++ b/tests/bolt-test.c @@ -30,6 +30,7 @@ #include +#include #include #include #include @@ -117,7 +118,7 @@ notify_socket_new (void) g_assert_nonnull (ns->tmpdir); fd = socket (AF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0); - g_assert_cmpint (fd, >, -1); + assert (fd > -1); /* plain assert for coverity */ ns->socket_path = g_build_filename (ns->tmpdir, "notify_socket", NULL); diff --git a/tests/test-guard.c b/tests/test-guard.c index 81d6fba..72be745 100644 --- a/tests/test-guard.c +++ b/tests/test-guard.c @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -277,7 +278,7 @@ test_guard_recover_dead (TestGuard *tt, gconstpointer user) fd = bolt_guard_monitor (guard, &err); g_assert_no_error (err); - g_assert_cmpint (fd, >, -1); + assert (fd > -1); /* plain assert for coverity */ g_object_unref (guard); /* monitor adds a references */ /* memorize the fifo so we can check it exists