diff options
author | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2014-10-04 23:51:45 +0200 |
---|---|---|
committer | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2014-10-04 23:55:35 +0200 |
commit | bdf7026e9557349cd3eeb291c01655d5f2a55db8 (patch) | |
tree | 10d269fed663e99d659c34e2f8e89fe5b3f55ecd /src/test/test-fileio.c | |
parent | 2355af60dc0c0ec2b7fbe69f15a77d980b017b3f (diff) |
test: only use assert_se
The asserts used in the tests should never be allowed to be
optimized away
Diffstat (limited to 'src/test/test-fileio.c')
-rw-r--r-- | src/test/test-fileio.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c index ad65abf426..76a9e8e9c9 100644 --- a/src/test/test-fileio.c +++ b/src/test/test-fileio.c @@ -246,25 +246,25 @@ static void test_status_field(void) { r = get_status_field("/proc/meminfo", "MemTotal:", &p); if (r != -ENOENT) { - assert(r == 0); + assert_se(r == 0); puts(p); assert_se(safe_atollu(p, &total) == 0); } r = get_status_field("/proc/meminfo", "\nBuffers:", &s); if (r != -ENOENT) { - assert(r == 0); + assert_se(r == 0); puts(s); assert_se(safe_atollu(s, &buffers) == 0); } if (p) - assert(buffers < total); + assert_se(buffers < total); /* Seccomp should be a good test for field full of zeros. */ r = get_status_field("/proc/meminfo", "\nSeccomp:", &z); if (r != -ENOENT) { - assert(r == 0); + assert_se(r == 0); puts(z); assert_se(safe_atollu(z, &buffers) == 0); } @@ -283,10 +283,10 @@ static void test_capeff(void) { if (r == -ENOENT || r == -EPERM) return; - assert(r == 0); - assert(*capeff); + assert_se(r == 0); + assert_se(*capeff); p = capeff[strspn(capeff, DIGITS "abcdefABCDEF")]; - assert(!p || isspace(p)); + assert_se(!p || isspace(p)); } } |