]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: drop unnecessary comparison and use correct assertion macros
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 9 Apr 2025 04:31:42 +0000 (13:31 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 9 Apr 2025 08:16:57 +0000 (17:16 +0900)
Follow-up for 8951706784c0534f821600fda2fb1e89f875f823.
Fixes CID#1608873 and CID#1608874.

src/test/test-memfd-util.c

index 43c5c31193e2cb8902059b3d7dcb68d6652b96da..6366eedc24b646c08bd9d4a547a250e8efa92581 100644 (file)
@@ -30,9 +30,9 @@ TEST(memfd_get_sealed) {
         ASSERT_OK(memfd_get_size(fd, &size));
         ASSERT_EQ(size, new_size / 2);
 
-        ASSERT_OK(memfd_get_sealed(fd) == 0);
-        ASSERT_OK(memfd_set_sealed(fd) >= 0);
-        ASSERT_OK(memfd_get_sealed(fd) > 0);
+        ASSERT_OK_ZERO(memfd_get_sealed(fd));
+        ASSERT_OK(memfd_set_sealed(fd));
+        ASSERT_OK_POSITIVE(memfd_get_sealed(fd));
 }
 
 DEFINE_TEST_MAIN(LOG_DEBUG);