47 object *first, *second, *third, *owner, *
found;
53 memset(&
pl, 0,
sizeof(
pl));
54 memset(&sock, 0,
sizeof(sock));
63 for (uint8_t i = 0; i < 200; i++) {
69 for (uint8_t i = 0; i < 200; i++) {
78 for (uint8_t i = 0; i < 200; i++) {
84 second->
owner = owner;
86 for (uint8_t i = 0; i < 200; i++) {
93 for (uint8_t i = 0; i < 200; i++) {
100 for (uint8_t i = 0; i < 200; i++) {
105 uint8_t co = 0, cs = 0, ct = 0;
106 for (uint16_t i = 0; i < 2000; i++) {
109 if (
found == owner) {
111 }
else if (
found == second) {
117 FAIL_UNLESS(co != 0,
"Should have found the owner");
124 Suite *s = suite_create(
"monster");
125 TCase *tc_core = tcase_create(
"Core");
130 suite_add_tcase(s, tc_core);
131 tcase_add_test(tc_core, test_monster_find_nearest_enemy);
143 SRunner *sr = srunner_create(s);
148 srunner_set_xml(sr, LOGDIR
"/unit/server/monster.xml");
149 srunner_set_log(sr, LOGDIR
"/unit/server/monster.out");
150 srunner_run_all(sr, CK_ENV);
151 nf = srunner_ntests_failed(sr);
153 return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;