54 pl1 = calloc(1,
sizeof(
object));
55 fail_unless(pl1 != NULL,
"memory allocation failure");
56 pl1->
name =
"player1";
58 fail_unless(pl1->
contr != NULL,
"memory allocation failure");
62 pl2 = calloc(1,
sizeof(
object));
63 fail_unless(pl2 != NULL,
"memory allocation failure");
64 pl2->
name =
"player2";
66 fail_unless(pl2->
contr != NULL,
"memory allocation failure");
70 pl3 = calloc(1,
sizeof(
object));
71 fail_unless(pl3 != NULL,
"memory allocation failure");
72 pl3->
name =
"player2";
74 fail_unless(pl3->
contr != NULL,
"memory allocation failure");
79 fail_unless(p1 != NULL,
"party_form failed.");
81 fail_unless(strcmp(p1->
partyname,
"test1") == 0,
"wrong party name");
82 fail_unless(p1 == pl1->
contr->
party,
"player wasn't added to party");
83 fail_unless(strcmp(
party_get_leader(p1),
"player1") == 0,
"wrong party leader");
86 fail_unless(p2 != NULL,
"party_form failed.");
94 fail_unless(p3 != NULL,
"party_form failed");
96 fail_unless(pl3->
contr->
party == p3,
"p3 incorrectly assigned to pl3");
104 Suite *s = suite_create(
"c_party");
105 TCase *tc_core = tcase_create(
"Core");
110 suite_add_tcase(s, tc_core);
111 tcase_add_test(tc_core, test_party);
119 SRunner *sr = srunner_create(s);
121 srunner_set_xml(sr, LOGDIR
"/unit/server/c_party.xml");
122 srunner_set_log(sr, LOGDIR
"/unit/server/c_party.out");
123 srunner_run_all(sr, CK_ENV);
124 nf = srunner_ntests_failed(sr);
126 return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;