]> git.ipfire.org Git - pakfire.git/commitdiff
tests: cgroups: Fix return code checks
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 16 Dec 2024 18:30:37 +0000 (18:30 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 16 Dec 2024 18:32:07 +0000 (18:32 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
tests/libpakfire/cgroup.c

index 8e958131601750aed37ecc80bc359061e4bbdbfc..11ae3a4f32e1018d57cf550a7963dbee0dfd16ef 100644 (file)
@@ -56,8 +56,8 @@ static int test_recursive(const struct test* t) {
        int r = EXIT_FAILURE;
 
        // Try to create some invalid cgroups
-       ASSERT(pakfire_cgroup_create(&cgroup, t->ctx, NULL, NULL, 0) == -EINVAL);
-       ASSERT(pakfire_cgroup_create(&cgroup, t->ctx, NULL, "pakfire-test/a/", 0) == -EINVAL);
+       ASSERT_ERROR(pakfire_cgroup_create(&cgroup, t->ctx, NULL, NULL, 0), EINVAL);
+       ASSERT_ERROR(pakfire_cgroup_create(&cgroup, t->ctx, NULL, "pakfire-test/a/", 0), EINVAL);
 
        // Open a new cgroup
        ASSERT_SUCCESS(pakfire_cgroup_create(&cgroup, t->ctx, NULL, "pakfire-test/a/b/c", 0));
@@ -128,7 +128,7 @@ static int test_stats(const struct test* t) {
        }
 
        // Try reading the stats into some invalid space
-       ASSERT_ERRNO(pakfire_cgroup_stat(cgroup, NULL), EINVAL);
+       ASSERT_ERROR(pakfire_cgroup_stat(cgroup, NULL), EINVAL);
 
        // Read the stats
        ASSERT_SUCCESS(pakfire_cgroup_stat(cgroup, &stats));