88 fail_unless(
list,
"Must get a list");
90 fail_unless(
list->ob == second,
"Second must be first in list");
91 fail_unless(
list->next != NULL,
"List must have a second item");
92 fail_unless(
list->next->ob ==
ob,
"Ob must be the second on the list");
93 fail_unless(
list->next->next == NULL,
"List must not have a third item");
101 fail_unless(
ob->owner == owner);
104 fail_unless(
list,
"Must get a list of owner's friends");
105 fail_unless(
list->ob ==
ob,
"Ob Must be first in list");
113 fail_unless(
ob->owner == owner);
117 fail_unless(
list,
"Must get a list of owner's friends");
118 fail_unless(
list->ob ==
ob,
"Ob Must be first in list");
119 fail_unless(
list->next == NULL,
"There must be only one item on the list");
147 Suite *s = suite_create(
"friend");
148 TCase *tc_core = tcase_create(
"Core");
153 suite_add_tcase(s, tc_core);
154 tcase_add_test(tc_core, test_basic);
155 tcase_add_test(tc_core, test_clean_friendly_list_count);
156 tcase_add_test(tc_core, test_clean_friendly_list_freed);
157 tcase_add_test(tc_core, test_clean_friendly_list_not_friendly);
158 tcase_add_test(tc_core, test_get_friends_of_null);
159 tcase_add_test(tc_core, test_get_friends_of_owner);
160 tcase_add_test(tc_core, test_get_friends_of_owner_only);
161 tcase_add_test(tc_core, test_get_next_friend_none);
162 tcase_add_test(tc_core, test_get_next_friend_single);
163 tcase_add_test(tc_core, test_get_next_friend_two);
171 SRunner *sr = srunner_create(s);
173 srunner_set_fork_status(sr, CK_NOFORK);
174 srunner_set_xml(sr, LOGDIR
"/unit/common/friend.xml");
175 srunner_set_log(sr, LOGDIR
"/unit/common/friend.out");
176 srunner_run_all(sr, CK_ENV);
177 nf = srunner_ntests_failed(sr);
179 return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;