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/common.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/common.c')
-rw-r--r-- | libparted/tests/common.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libparted/tests/common.c b/libparted/tests/common.c index 2be0e3a..8c42ece 100644 --- a/libparted/tests/common.c +++ b/libparted/tests/common.c @@ -27,7 +27,7 @@ size_t get_sector_size (void) PedExceptionOption _test_exception_handler (PedException* e) { - fail ("Exception of type %s has been raised: %s", + ck_abort_msg("Exception of type %s has been raised: %s", ped_exception_get_type_string (e->type), e->message); @@ -69,10 +69,10 @@ _create_disk_label (PedDevice *dev, PedDiskType *type) /* Create the label */ disk = ped_disk_new_fresh (dev, type); - fail_if (!disk, "Failed to create a label of type: %s", + ck_assert_msg(disk != NULL, "Failed to create a label of type: %s", type->name); - fail_if (!ped_disk_commit(disk), - "Failed to commit label to device"); + ck_assert_msg(ped_disk_commit(disk) != 0, + "Failed to commit label to device"); return disk; } |