summaryrefslogtreecommitdiff
path: root/src/journal/test-compress-benchmark.c
diff options
context:
space:
mode:
authorRonny Chevalier <chevalier.ronny@gmail.com>2015-01-22 22:53:42 +0100
committerRonny Chevalier <chevalier.ronny@gmail.com>2015-01-22 23:10:56 +0100
commit0c0cdb06c139b52ff103287f6909b3daa5b2dc54 (patch)
treef904cb032c43691d325b6bb19941a2c115a07416 /src/journal/test-compress-benchmark.c
parent714af6af8a912650f9129f8b056ed92589443060 (diff)
tests: use assert_se instead of assert
Otherwise they can be optimized away with -DNDEBUG
Diffstat (limited to 'src/journal/test-compress-benchmark.c')
-rw-r--r--src/journal/test-compress-benchmark.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/journal/test-compress-benchmark.c b/src/journal/test-compress-benchmark.c
index b3bc3ec2fe..c8e5b76c6c 100644
--- a/src/journal/test-compress-benchmark.c
+++ b/src/journal/test-compress-benchmark.c
@@ -32,7 +32,7 @@ static char* make_buf(size_t count) {
size_t i;
buf = malloc(count);
- assert(buf);
+ assert_se(buf);
for (i = 0; i < count; i++)
buf[i] = 'a' + i % ('z' - 'a' + 1);
@@ -52,7 +52,7 @@ static void test_compress_decompress(const char* label,
text = make_buf(MAX_SIZE);
buf = calloc(MAX_SIZE + 1, 1);
- assert(text && buf);
+ assert_se(text && buf);
n = now(CLOCK_MONOTONIC);
@@ -62,24 +62,24 @@ static void test_compress_decompress(const char* label,
r = compress(text, i, buf, &j);
/* assume compression must be successful except for small inputs */
- assert(r == 0 || (i < 2048 && r == -ENOBUFS));
+ assert_se(r == 0 || (i < 2048 && r == -ENOBUFS));
/* check for overwrites */
- assert(buf[i] == 0);
+ assert_se(buf[i] == 0);
if (r != 0) {
skipped += i;
continue;
}
- assert(j > 0);
+ assert_se(j > 0);
if (j >= i)
log_error("%s \"compressed\" %zu -> %zu", label, i, j);
r = decompress(buf, j, &buf2, &buf2_allocated, &k, 0);
- assert(r == 0);
- assert(buf2_allocated >= k);
- assert(k == i);
+ assert_se(r == 0);
+ assert_se(buf2_allocated >= k);
+ assert_se(k == i);
- assert(memcmp(text, buf2, i) == 0);
+ assert_se(memcmp(text, buf2, i) == 0);
total += i;
compressed += j;