summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-05-07 09:47:19 +0200
committerGitHub <noreply@github.com>2020-05-07 09:47:19 +0200
commit354722dde4716cd41e53af2272b77dfff534aa9f (patch)
tree3cbb85faf75706ebcc389612bf60f51392c80a4b /src/test
parenttree-wide: Workaround -Wnonnull GCC bug (diff)
parentmeson: Do not drop warnings (unused variable) when NDEBUG is defined (diff)
downloadsystemd-354722dde4716cd41e53af2272b77dfff534aa9f.tar.xz
systemd-354722dde4716cd41e53af2272b77dfff534aa9f.zip
Merge pull request #15733 from benjarobin/fix_warn_ndebug
Allow to build without any warning with NDEBUG defined + Bugfix
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-alloc-util.c14
-rw-r--r--src/test/test-fd-util.c8
-rw-r--r--src/test/test-time-util.c2
3 files changed, 12 insertions, 12 deletions
diff --git a/src/test/test-alloc-util.c b/src/test/test-alloc-util.c
index 758b753237..d85f705504 100644
--- a/src/test/test-alloc-util.c
+++ b/src/test/test-alloc-util.c
@@ -99,13 +99,13 @@ static void test_bool_assign(void) {
g = cp; /* cast from pointer */
h = NULL; /* cast from pointer */
- assert(b);
- assert(c);
- assert(d);
- assert(e);
- assert(!f);
- assert(g);
- assert(!h);
+ assert_se(b);
+ assert_se(c);
+ assert_se(d);
+ assert_se(e);
+ assert_se(!f);
+ assert_se(g);
+ assert_se(!h);
}
static int cleanup_counter = 0;
diff --git a/src/test/test-fd-util.c b/src/test/test-fd-util.c
index 713795814d..44c74987c5 100644
--- a/src/test/test-fd-util.c
+++ b/src/test/test-fd-util.c
@@ -233,17 +233,17 @@ static void assert_equal_fd(int fd1, int fd2) {
ssize_t x, y;
x = read(fd1, a, sizeof(a));
- assert(x >= 0);
+ assert_se(x >= 0);
y = read(fd2, b, sizeof(b));
- assert(y >= 0);
+ assert_se(y >= 0);
- assert(x == y);
+ assert_se(x == y);
if (x == 0)
break;
- assert(memcmp(a, b, x) == 0);
+ assert_se(memcmp(a, b, x) == 0);
}
}
diff --git a/src/test/test-time-util.c b/src/test/test-time-util.c
index a422cc8ddc..e3b1f6f8ca 100644
--- a/src/test/test-time-util.c
+++ b/src/test/test-time-util.c
@@ -433,7 +433,7 @@ static void assert_similar(usec_t a, usec_t b) {
else
d = b - a;
- assert(d < 10*USEC_PER_SEC);
+ assert_se(d < 10*USEC_PER_SEC);
}
static void test_usec_shift_clock(void) {