]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/test/test-util.c
Drop the text argument from assert_not_reached()
[thirdparty/systemd.git] / src / test / test-util.c
index 0fe7a381c708ee6e827f17a5f3955e799a0c9d75..4d9008ba3394e07abe39c736323ed9f2779a3d46 100644 (file)
@@ -316,12 +316,11 @@ static void test_raw_clone(void) {
 
         errno = 0;
         assert_se(raw_clone(CLONE_FS|CLONE_NEWNS) == -1);
-        assert_se(errno == EINVAL);
+        assert_se(errno == EINVAL || ERRNO_IS_PRIVILEGE(errno)); /* Certain container environments prohibit namespaces to us, don't fail in that case */
 }
 
 static void test_physical_memory(void) {
         uint64_t p;
-        char buf[FORMAT_BYTES_MAX];
 
         log_info("/* %s */", __func__);
 
@@ -330,7 +329,7 @@ static void test_physical_memory(void) {
         assert_se(p < UINT64_MAX);
         assert_se(p % page_size() == 0);
 
-        log_info("Memory: %s (%" PRIu64 ")", format_bytes(buf, sizeof(buf), p), p);
+        log_info("Memory: %s (%" PRIu64 ")", FORMAT_BYTES(p), p);
 }
 
 static void test_physical_memory_scale(void) {
@@ -432,7 +431,7 @@ static void test_foreach_pointer(void) {
                         break;
 
                 default:
-                        assert_not_reached("unexpected index");
+                        assert_not_reached();
                         break;
                 }
 
@@ -481,7 +480,7 @@ static void test_foreach_pointer(void) {
                         break;
 
                 default:
-                        assert_not_reached("unexpected index");
+                        assert_not_reached();
                         break;
                 }