diff options
author | Brian C. Lane <bcl@redhat.com> | 2023-02-07 09:31:42 -0800 |
---|---|---|
committer | Brian C. Lane <bcl@redhat.com> | 2023-02-07 16:27:25 -0800 |
commit | 7b555132be63172a2d621afcdedfa7797185d3b5 (patch) | |
tree | 557fe0d41b2f601da2c471ada2082662dde5953a /libparted/tests/label.c | |
parent | 9b009985da2e5eee5b5c179acfafab3aa1624f8b (diff) | |
download | parted-7b555132be63172a2d621afcdedfa7797185d3b5.tar.gz |
tests: Fixing libparted test framework usage
The fail and fail_if functions from libcheck are deprecated, replace
them with ck_abort_msg and ck_assert_msg. Note that the logic of assert
is the opposite of fail_if.
Diffstat (limited to 'libparted/tests/label.c')
-rw-r--r-- | libparted/tests/label.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/libparted/tests/label.c b/libparted/tests/label.c index e0d63c7..67b1b07 100644 --- a/libparted/tests/label.c +++ b/libparted/tests/label.c @@ -16,7 +16,7 @@ static void create_disk (void) { temporary_disk = _create_disk (80 * 1024 * 1024); - fail_if (temporary_disk == NULL, "Failed to create temporary disk"); + ck_assert_msg(temporary_disk != NULL, "Failed to create temporary disk"); } static void @@ -72,12 +72,11 @@ START_TEST (test_probe_label) /* Try to probe the disk label. */ probed = ped_disk_probe (dev); - fail_if (!probed, + ck_assert_msg(probed, "Failed to probe the just created label of type: %s", type->name); if (probed && !STREQ (probed->name, type->name)) - fail_if (1, - "Probe returned label of type: %s as type: %s", + ck_abort_msg("Probe returned label of type: %s as type: %s", type->name, probed->name); } ped_device_destroy (dev); @@ -105,12 +104,11 @@ START_TEST (test_read_label) /* Try to read the disk label. */ disk = ped_disk_new (dev); - fail_if (!disk, + ck_assert_msg(disk, "Failed to read the just created label of type: %s", type->name); if (disk && !STREQ (disk->type->name, type->name)) - fail_if (1, - "Read returned label of type: %s as type: %s", + ck_abort_msg("Read returned label of type: %s as type: %s", type->name, disk->type->name); ped_disk_destroy (disk); @@ -138,7 +136,7 @@ START_TEST (test_clone_label) /* Try to clone the disk label. */ PedDisk* clone = ped_disk_duplicate (disk); - fail_if (!clone, + ck_assert_msg(clone, "Failed to clone the just created label of type: %s", type->name); |