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/disk.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/disk.c')
-rw-r--r-- | libparted/tests/disk.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libparted/tests/disk.c b/libparted/tests/disk.c index 62d20c1..f7b16a5 100644 --- a/libparted/tests/disk.c +++ b/libparted/tests/disk.c @@ -14,7 +14,7 @@ static void create_disk (void) { temporary_disk = _create_disk (get_sector_size () * 4 * 10 * 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,8 +72,8 @@ START_TEST (test_duplicate) part = ped_disk_get_partition (disk, *i); part_dup = ped_disk_get_partition (disk_dup, *i); - fail_if (part->geom.start != part_dup->geom.start || - part->geom.end != part_dup->geom.end, + ck_assert_msg(part->geom.start == part_dup->geom.start && + part->geom.end == part_dup->geom.end, "Duplicated partition %d doesn't match. " "Details are start: %d/%d end: %d/%d\n", *i, part->geom.start, part_dup->geom.start, |