summaryrefslogtreecommitdiffstats
path: root/src/test/test-macro.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-16 18:27:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-16 18:27:01 +0000
commit0acda3abb713d13ee9c7778766a1fff5bbfdd87e (patch)
treeabc5d8e66d598a5dc1fd96c99f7ca09adb063205 /src/test/test-macro.c
parentReleasing progress-linux version 256.4-3~progress7.99u1. (diff)
downloadsystemd-0acda3abb713d13ee9c7778766a1fff5bbfdd87e.tar.xz
systemd-0acda3abb713d13ee9c7778766a1fff5bbfdd87e.zip
Merging upstream version 256.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/test-macro.c')
-rw-r--r--src/test/test-macro.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/test-macro.c b/src/test/test-macro.c
index 9e2875d..3d5b0cf 100644
--- a/src/test/test-macro.c
+++ b/src/test/test-macro.c
@@ -4,6 +4,7 @@
#include <sys/stat.h>
#include "errno-util.h"
+#include "id128-util.h"
#include "log.h"
#include "macro.h"
#include "tests.h"
@@ -1122,6 +1123,11 @@ TEST(ASSERT) {
ASSERT_SIGNAL(ASSERT_OK_ERRNO(-1), SIGABRT);
ASSERT_SIGNAL(ASSERT_OK_ERRNO(-ENOANO), SIGABRT);
+ ASSERT_FAIL(-ENOENT);
+ ASSERT_FAIL(-EPERM);
+ ASSERT_SIGNAL(ASSERT_FAIL(0), SIGABRT);
+ ASSERT_SIGNAL(ASSERT_FAIL(255), SIGABRT);
+
ASSERT_ERROR(-ENOENT, ENOENT);
ASSERT_ERROR(RET_NERRNO(mkdir("/i/will/fail/with/enoent", 666)), ENOENT);
ASSERT_SIGNAL(ASSERT_ERROR(0, ENOENT), SIGABRT);
@@ -1181,6 +1187,15 @@ TEST(ASSERT) {
ASSERT_LT(-1, 1);
ASSERT_SIGNAL(ASSERT_LT(0, 0), SIGABRT);
ASSERT_SIGNAL(ASSERT_LT(1, -1), SIGABRT);
+
+ ASSERT_EQ_ID128(SD_ID128_NULL, SD_ID128_NULL);
+ ASSERT_NE_ID128(SD_ID128_MAKE(51,df,0b,4b,c3,b0,4c,97,80,e2,99,b9,8c,a3,73,b8),
+ SD_ID128_MAKE(f0,3d,aa,eb,1c,33,4b,43,a7,32,17,29,44,bf,77,2e));
+ ASSERT_SIGNAL(
+ ASSERT_EQ_ID128(SD_ID128_MAKE(51,df,0b,4b,c3,b0,4c,97,80,e2,99,b9,8c,a3,73,b8),
+ SD_ID128_MAKE(f0,3d,aa,eb,1c,33,4b,43,a7,32,17,29,44,bf,77,2e)),
+ SIGABRT);
+ ASSERT_SIGNAL(ASSERT_NE_ID128(SD_ID128_NULL, SD_ID128_NULL), SIGABRT);
}
DEFINE_TEST_MAIN(LOG_INFO);