|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From 52754725e185f1331f821d85ed2ef78fb92af1fe Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: Filipe Brandenburger <filbranden@google.com>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Mon, 25 Aug 2014 22:05:02 -0700
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] test-compress: make sure asserts with side effects use
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
assert_se()
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Otherwise the test fails when built with CPPFLAGS='-DNDEBUG' which disables
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
assertions.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Tested:
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- make check TESTS='test-compress' CPPFLAGS='-DNDEBUG'
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/journal/test-compress.c | 4 ++--
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/journal/test-compress.c b/src/journal/test-compress.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index f5f5f8df39..026d630ac2 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/journal/test-compress.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/journal/test-compress.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -145,11 +145,11 @@ static void test_compress_stream(int compression,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
assert_se((dst = mkostemp_safe(pattern, O_RDWR|O_CLOEXEC)) >= 0);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- assert(compress(src, dst, -1) == 0);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ assert_se(compress(src, dst, -1) == 0);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (cat) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
assert_se(asprintf(&cmd, "%s %s | diff %s -", cat, pattern, srcfile) > 0);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- assert(system(cmd) == 0);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ assert_se(system(cmd) == 0);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
log_debug("/* test decompression */");
|