summaryrefslogtreecommitdiffstats
path: root/src/test/test-log.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/test-log.c')
-rw-r--r--src/test/test-log.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/test/test-log.c b/src/test/test-log.c
index 97eb5e0..57cab63 100644
--- a/src/test/test-log.c
+++ b/src/test/test-log.c
@@ -13,11 +13,6 @@
#include "strv.h"
#include "tests.h"
-assert_cc(IS_SYNTHETIC_ERRNO(SYNTHETIC_ERRNO(EINVAL)));
-assert_cc(!IS_SYNTHETIC_ERRNO(EINVAL));
-assert_cc(IS_SYNTHETIC_ERRNO(SYNTHETIC_ERRNO(0)));
-assert_cc(!IS_SYNTHETIC_ERRNO(0));
-
#define X10(x) x x x x x x x x x x
#define X100(x) X10(X10(x))
#define X1000(x) X100(X10(x))
@@ -227,6 +222,15 @@ static void test_log_prefix(void) {
int main(int argc, char* argv[]) {
test_setup_logging(LOG_DEBUG);
+ ASSERT_TRUE(IS_SYNTHETIC_ERRNO(SYNTHETIC_ERRNO(EINVAL)));
+ ASSERT_TRUE(IS_SYNTHETIC_ERRNO(SYNTHETIC_ERRNO(-EINVAL)));
+ assert_cc(!IS_SYNTHETIC_ERRNO(EINVAL));
+ assert_cc(!IS_SYNTHETIC_ERRNO(-EINVAL));
+ ASSERT_TRUE(IS_SYNTHETIC_ERRNO(SYNTHETIC_ERRNO(0)));
+ assert_cc(!IS_SYNTHETIC_ERRNO(0));
+ ASSERT_EQ(ERRNO_VALUE(EINVAL), EINVAL);
+ ASSERT_EQ(ERRNO_VALUE(SYNTHETIC_ERRNO(-EINVAL)), EINVAL);
+
test_assert_return_is_critical();
test_file();