58 fail_unless(
arch != NULL,
"Can't find 'orc' archetype!");
60 fail_unless(orc != NULL,
"Couldn't create first orc!");
75 fail_unless(
result && strcmp(
result,
"name Orc chief\nspeed 0.500000\n") == 0,
"diff modified obj/clone was %s!",
result);
86 fail_unless(
result && strcmp(
result,
"name Orc chief\nWis 59\nhp 50\nexpmul 8.500000\ndam 168\nspeed 0.500000\n") == 0,
"2n diff modified obj/clone was %s!",
result);
100 fail_unless(empty != NULL,
"Couldn't create empty archetype!");
102 snprintf(expect,
sizeof(expect),
"arch empty_archetype\nend\n");
106 fail_unless(
result && strcmp(
result, expect) == 0,
"object_dump was \"%s\" instead of \"%s\"!",
result, expect);
114 fail_unless(empty->
head != NULL,
"Couldn't create empty archetype as head!");
115 fail_unless(empty->
inv != NULL,
"Couldn't create empty archetype as inv!");
116 fail_unless(empty->
more != NULL,
"Couldn't create empty archetype as more!");
117 fail_unless(empty->
env != NULL,
"Couldn't create empty archetype as env!");
119 snprintf(expect,
sizeof(expect),
"arch empty_archetype\nmore %d\nhead %d\nenv %d\ninv %d\nend\n", empty->
more->
count, empty->
head->
count, empty->
env->
count, empty->
inv->
count);
123 fail_unless(
result && strcmp(
result, expect) == 0,
"object_dump was \"%s\" instead of \"%s\"!",
result, expect);
129 Suite *s = suite_create(
"loader");
130 TCase *tc_core = tcase_create(
"Core");
131 tcase_set_timeout(tc_core, 60);
136 suite_add_tcase(s, tc_core);
137 tcase_add_test(tc_core, test_get_ob_diff);
138 tcase_add_test(tc_core, test_object_dump);
146 SRunner *sr = srunner_create(s);
148 srunner_set_xml(sr, LOGDIR
"/unit/common/loader.xml");
149 srunner_set_log(sr, LOGDIR
"/unit/common/loader.out");
150 srunner_run_all(sr, CK_ENV);
151 nf = srunner_ntests_failed(sr);
153 return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;