50 fail_unless(
get_firstparty() == NULL,
"firstparty should be NULL!");
52 pl = calloc(1,
sizeof(
object));
54 fail_unless(pl != NULL,
"memory allocation failure");
56 fail_unless(pl->
contr != NULL,
"memory allocation failure");
61 fail_unless(p1 != NULL,
"form_party failed.");
63 fail_unless(strcmp(p1->
partyname,
"test1") == 0,
"wrong party name");
64 fail_unless(p1 == pl->
contr->
party,
"player wasn't added to party");
65 fail_unless(strcmp(p1->
partyleader,
"player") == 0,
"wrong party leader");
68 fail_unless(p2 != NULL,
"form_party failed.");
69 fail_unless(
get_firstparty()->next == p2,
"party incorrectly linked");
76 fail_unless(p3 != NULL,
"form_party failed");
77 fail_unless(
get_firstparty()->next == p3,
"party p3 incorrectly linked");
78 fail_unless(pl->
contr->
party == p3,
"p3 incorrectly assigned to pl");
86 Suite *s = suite_create(
"c_party");
87 TCase *tc_core = tcase_create(
"Core");
92 suite_add_tcase(s, tc_core);
93 tcase_add_test(tc_core, test_party);
101 SRunner *sr = srunner_create(s);
103 srunner_set_xml(sr, LOGDIR
"/unit/server/c_party.xml");
104 srunner_set_log(sr, LOGDIR
"/unit/server/c_party.out");
105 srunner_run_all(sr, CK_ENV);
106 nf = srunner_ntests_failed(sr);
108 return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
END_TEST Suite * c_party_suite(void)
void remove_party(partylist *target_party)
void obsolete_parties(void)
partylist * get_firstparty(void)
partylist * form_party(object *op, const char *params)
EXTERN player * first_player