Undo formatting on test suite -- it wasn't right

This commit is contained in:
Patrick J Cherry
2018-02-20 10:13:42 +00:00
parent f47f56d4c4
commit 103bd7ad5b
16 changed files with 1844 additions and 1722 deletions

View File

@@ -4,36 +4,39 @@
#include <check.h>
START_TEST(test_assigns_sock_name)
START_TEST( test_assigns_sock_name )
{
struct flexnbd flexnbd = { 0 };
char csn[] = "foobar";
struct flexnbd flexnbd = {0};
char csn[] = "foobar";
struct control *control = control_create(&flexnbd, csn);
struct control * control = control_create(&flexnbd, csn );
fail_unless(csn == control->socket_name, "Socket name not assigned");
fail_unless( csn == control->socket_name, "Socket name not assigned" );
}
END_TEST
END_TEST Suite * control_suite(void)
Suite *control_suite(void)
{
Suite *s = suite_create("control");
Suite *s = suite_create("control");
TCase *tc_create = tcase_create("create");
TCase *tc_create = tcase_create("create");
tcase_add_test(tc_create, test_assigns_sock_name);
suite_add_tcase(s, tc_create);
tcase_add_test(tc_create, test_assigns_sock_name);
suite_add_tcase( s, tc_create );
return s;
return s;
}
int main(void)
{
int number_failed;
Suite *s = control_suite();
SRunner *sr = srunner_create(s);
srunner_run_all(sr, CK_NORMAL);
number_failed = srunner_ntests_failed(sr);
srunner_free(sr);
return (number_failed == 0) ? 0 : 1;
int number_failed;
Suite *s = control_suite();
SRunner *sr = srunner_create(s);
srunner_run_all(sr, CK_NORMAL);
number_failed = srunner_ntests_failed(sr);
srunner_free(sr);
return (number_failed == 0) ? 0 : 1;
}