broaden the fumbe-lookup tests a bit, make sure prefixes don't match.

This commit is contained in:
Enno Rehling 2017-04-30 04:28:07 +02:00
parent 1885831204
commit 3052628251
1 changed files with 11 additions and 5 deletions

View File

@ -86,18 +86,24 @@ static void test_spellref(CuTest *tc)
test_cleanup(); test_cleanup();
} }
void my_fumble(const struct castorder *co) { void fumble_foo(const struct castorder *co) {
UNUSED_ARG(co);
}
void fumble_bar(const struct castorder *co) {
UNUSED_ARG(co); UNUSED_ARG(co);
} }
static void test_fumbles(CuTest *tc) static void test_fumbles(CuTest *tc)
{ {
test_setup(); test_setup();
CuAssertTrue(tc, NULL==get_fumble("hodor")); CuAssertTrue(tc, NULL==get_fumble("foo"));
add_fumble("hodor", my_fumble); add_fumble("foone", fumble_foo);
CuAssertTrue(tc, my_fumble==get_fumble("hodor")); add_fumble("foozle", fumble_bar);
CuAssertTrue(tc, fumble_foo==get_fumble("foone"));
CuAssertTrue(tc, fumble_bar==get_fumble("foozle"));
CuAssertTrue(tc, NULL==get_fumble("foo"));
test_cleanup(); test_cleanup();
CuAssertTrue(tc, NULL==get_fumble("hodor"));
} }
CuSuite *get_spell_suite(void) CuSuite *get_spell_suite(void)