server/src/kernel/spell_test.c
Enno Rehling c22f49ec36 replace spellid_t with unsigned int
fix finding spells by token
make magic_t an enum
2012-05-09 03:14:54 -07:00

29 lines
611 B
C

#include <util/quicklist.h>
#include <kernel/spell.h>
#include <kernel/magic.h>
#include <cutest/CuTest.h>
#include <tests.h>
#include <stdlib.h>
static void test_register_spell(CuTest * tc)
{
spell * sp;
CuAssertPtrEquals(tc, 0, find_spell("testspell"));
CuAssertPtrEquals(tc, spells, 0);
sp = create_spell("testspell");
sp->magietyp = 5;
register_spell(sp);
CuAssertIntEquals(tc, 1, ql_length(spells));
CuAssertPtrEquals(tc, sp, find_spell("testspell"));
}
CuSuite *get_spell_suite(void)
{
CuSuite *suite = CuSuiteNew();
SUITE_ADD_TEST(suite, test_register_spell);
return suite;
}