From a1ae8809d111795dcc977e693668bcfaf776fbbe Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Fri, 20 Apr 2007 01:00:50 +0530 Subject: [tests] Fix spacing around brackets and asterisks. Signed-off-by: Otavio Salvador --- libparted/tests/label.c | 62 ++++++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 29 deletions(-) (limited to 'libparted/tests/label.c') diff --git a/libparted/tests/label.c b/libparted/tests/label.c index 244dd5d..563c4eb 100644 --- a/libparted/tests/label.c +++ b/libparted/tests/label.c @@ -7,65 +7,69 @@ #include "common.h" -static char *temporary_disk; +static char* temporary_disk; -static void create_disk(void) +static void +create_disk (void) { - temporary_disk = _create_disk(20); - fail_if(temporary_disk == NULL, "Failed to create temporary disk"); + temporary_disk = _create_disk (20); + fail_if (temporary_disk == NULL, "Failed to create temporary disk"); } -static void destroy_disk(void) +static void +destroy_disk (void) { - unlink(temporary_disk); - free(temporary_disk); + unlink (temporary_disk); + free (temporary_disk); } /* TEST: Create a disklabel on a simple disk image */ START_TEST (test_create_label) { - PedDevice *dev = ped_device_get(temporary_disk); + PedDevice* dev = ped_device_get (temporary_disk); if (dev == NULL) return; - PedDiskType *type; - PedDisk *disk; + PedDiskType* type; + PedDisk* disk; - for (type = ped_disk_type_get_next(NULL); type; - type = ped_disk_type_get_next(type)) { - if (!_implemented_disk_label(type->name)) + for (type = ped_disk_type_get_next (NULL); type; + type = ped_disk_type_get_next (type)) { + if (!_implemented_disk_label (type->name)) continue; disk = _create_disk_label (dev, type); ped_disk_destroy (disk); /* Try to read the label */ - disk = ped_disk_new(dev); - fail_if(!disk, - "Failed to read the just created label of type: %s", - type->name); - ped_disk_destroy(disk); + disk = ped_disk_new (dev); + fail_if (!disk, + "Failed to read the just created label of type: %s", + type->name); + ped_disk_destroy (disk); } ped_device_destroy (dev); } END_TEST -int main(void) +int +main (void) { int number_failed; - Suite *suite = suite_create("Disk Label"); - TCase *tcase_basic = tcase_create("Create"); + Suite* suite = suite_create ("Disk Label"); + TCase* tcase_basic = tcase_create ("Create"); - tcase_add_checked_fixture(tcase_basic, create_disk, destroy_disk); - tcase_add_test(tcase_basic, test_create_label); - tcase_set_timeout(tcase_basic, 0); /* disable timeout for this tests */ - suite_add_tcase(suite, tcase_basic); + tcase_add_checked_fixture (tcase_basic, create_disk, destroy_disk); + tcase_add_test (tcase_basic, test_create_label); + /* Disable timeout for this test */ + tcase_set_timeout (tcase_basic, 0); + suite_add_tcase (suite, tcase_basic); - SRunner *srunner = srunner_create(suite); - srunner_run_all(srunner, CK_VERBOSE); + SRunner* srunner = srunner_create (suite); + srunner_run_all (srunner, CK_VERBOSE); - number_failed = srunner_ntests_failed(srunner); - srunner_free(srunner); + number_failed = srunner_ntests_failed (srunner); + srunner_free (srunner); return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } -- cgit v1.2.1