summaryrefslogtreecommitdiffstats
path: root/src/test/test-macro.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-04-11 02:51:49 +0200
committerGitHub <noreply@github.com>2024-04-11 02:51:49 +0200
commit1ae891037edb0f9ab4d4c3c05e4375b2cfec02af (patch)
tree5c22f3f401fff4c6b66f12156fac69299941882b /src/test/test-macro.c
parentMerge pull request #32181 from YHNdnzj/open-file (diff)
parentdocs: Add Tests section to coding style doc (diff)
downloadsystemd-1ae891037edb0f9ab4d4c3c05e4375b2cfec02af.tar.xz
systemd-1ae891037edb0f9ab4d4c3c05e4375b2cfec02af.zip
Merge pull request #32202 from DaanDeMeyer/assert
tests: Improve assertion error messages
Diffstat (limited to 'src/test/test-macro.c')
-rw-r--r--src/test/test-macro.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/test-macro.c b/src/test/test-macro.c
index 6a6e7a0962..05e15c8bdc 100644
--- a/src/test/test-macro.c
+++ b/src/test/test-macro.c
@@ -1114,6 +1114,12 @@ TEST(ASSERT) {
ASSERT_SIGNAL(ASSERT_OK(-1), SIGABRT);
ASSERT_SIGNAL(ASSERT_OK(-ENOANO), SIGABRT);
+ ASSERT_OK_ERRNO(0 >= 0);
+ ASSERT_OK_ERRNO(255 >= 0);
+ ASSERT_OK_ERRNO(printf("Hello world\n"));
+ ASSERT_SIGNAL(ASSERT_OK_ERRNO(-1), SIGABRT);
+ ASSERT_SIGNAL(ASSERT_OK_ERRNO(-ENOANO), SIGABRT);
+
ASSERT_TRUE(true);
ASSERT_TRUE(255);
ASSERT_TRUE(getpid());