]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: shorten a bit
authorDavid Tardon <dtardon@redhat.com>
Fri, 27 Jan 2023 08:47:24 +0000 (09:47 +0100)
committerDavid Tardon <dtardon@redhat.com>
Fri, 21 Apr 2023 14:29:15 +0000 (16:29 +0200)
src/test/test-bitmap.c

index 655b823c7fbf646d0b29aeaf3c063186b2023fd8..6a84508b12da34a5d3bfefe857eeb7d7db782902 100644 (file)
@@ -10,8 +10,7 @@ int main(int argc, const char *argv[]) {
         assert_se(b);
 
         assert_se(bitmap_ensure_allocated(&b) == 0);
-        bitmap_free(b);
-        b = NULL;
+        b = bitmap_free(b);
         assert_se(bitmap_ensure_allocated(&b) == 0);
 
         assert_se(bitmap_isset(b, 0) == false);
@@ -89,13 +88,11 @@ int main(int argc, const char *argv[]) {
         bitmap_clear(b);
         assert_se(bitmap_isclear(b) == true);
         assert_se(bitmap_equal(b, b2) == false);
-        bitmap_free(b2);
-        b2 = NULL;
+        b2 = bitmap_free(b2);
 
         assert_se(bitmap_set(b, UINT_MAX) == -ERANGE);
 
-        bitmap_free(b);
-        b = NULL;
+        b = bitmap_free(b);
         assert_se(bitmap_ensure_allocated(&b) == 0);
         assert_se(bitmap_ensure_allocated(&b2) == 0);