forked from github/server
failing test for name_unit.
This commit is contained in:
parent
31b3f2b2de
commit
a7f8ad052d
1 changed files with 19 additions and 0 deletions
|
@ -468,6 +468,24 @@ static void test_renumber_unit(CuTest *tc) {
|
|||
test_cleanup();
|
||||
}
|
||||
|
||||
static void gen_name(unit *u)
|
||||
{
|
||||
unit_setname(u, "Hodor");
|
||||
}
|
||||
|
||||
static void test_name_unit(CuTest *tc) {
|
||||
race *rc;
|
||||
unit * u;
|
||||
|
||||
test_setup();
|
||||
rc = test_create_race("skeleton");
|
||||
u = test_create_unit(test_create_faction(rc), test_create_region(0, 0, 0));
|
||||
rc->generate_name = gen_name;
|
||||
name_unit(u);
|
||||
CuAssertStrEquals(tc, "Hodor", unit_getname(u));
|
||||
test_cleanup();
|
||||
}
|
||||
|
||||
CuSuite *get_unit_suite(void)
|
||||
{
|
||||
CuSuite *suite = CuSuiteNew();
|
||||
|
@ -491,5 +509,6 @@ CuSuite *get_unit_suite(void)
|
|||
SUITE_ADD_TEST(suite, test_inside_building);
|
||||
SUITE_ADD_TEST(suite, test_limited_skills);
|
||||
SUITE_ADD_TEST(suite, test_renumber_unit);
|
||||
SUITE_ADD_TEST(suite, test_name_unit);
|
||||
return suite;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue