57 fail_unless(floor != NULL,
"can't find archetype battleground");
60 fail_unless(floor != NULL,
"can't find archetype battleground");
64 fail_unless(deplete != NULL,
"can't find archetype %s",
ARCH_DEPLETION);
67 fail_unless(
victim != NULL,
"couldn't create kobold");
68 fail_unless(
victim->inv == NULL,
"kobold shouldn't have an inventory");
70 victim->stats.maxhp = 5000;
75 fail_unless(
hitter != NULL,
"couldn't create sword");
83 for (test = 0; test < 100; test++) {
85 fail_unless(
victim->stats.hp ==
victim->stats.maxhp,
"victim should have %d hp and not %d.",
victim->stats.maxhp,
victim->stats.hp);
87 fail_unless(
victim->inv == NULL,
"kobold shouldn't have an inventory after attacked");
96 fail_unless(
victim->stats.hp !=
victim->stats.maxhp,
"victim shouldn't have %d hp",
victim->stats.hp);
103 fail_unless(
ob,
"wrong archetype human_player");
104 fail_unless(
ob->type ==
PLAYER,
"archetype isn't a player");
119 Suite *s = suite_create(
"attack");
120 TCase *tc_core = tcase_create(
"Core");
125 suite_add_tcase(s, tc_core);
126 tcase_add_test(tc_core, test_hit_player);
127 tcase_add_test(tc_core, test_fix_object_confused);
135 SRunner *sr = srunner_create(s);
144 srunner_set_xml(sr, LOGDIR
"/unit/server/attack.xml");
145 srunner_set_log(sr, LOGDIR
"/unit/server/attack.out");
146 srunner_run_all(sr, CK_ENV);
147 nf = srunner_ntests_failed(sr);
149 return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;