add tests for monster naming functions (existence only).

This commit is contained in:
Enno Rehling 2016-08-28 17:37:08 +01:00
parent 534708d83e
commit 020ab942ec
3 changed files with 32 additions and 0 deletions

View File

@ -184,6 +184,7 @@ target_link_libraries(eressea
set(TESTS_SRC
monsters.test.c
names.test.c
donations.test.c
wormhole.test.c
alchemy.test.c

30
src/names.test.c Normal file
View File

@ -0,0 +1,30 @@
#include <platform.h>
#include "names.h"
#include <util/functions.h>
#include <CuTest.h>
#include "tests.h"
static void test_names(CuTest * tc)
{
test_cleanup();
register_names();
CuAssertPtrNotNull(tc, get_function("nameundead"));
CuAssertPtrNotNull(tc, get_function("nameskeleton"));
CuAssertPtrNotNull(tc, get_function("namezombie"));
CuAssertPtrNotNull(tc, get_function("nameghoul"));
CuAssertPtrNotNull(tc, get_function("namedragon"));
CuAssertPtrNotNull(tc, get_function("namedracoid"));
CuAssertPtrNotNull(tc, get_function("namegeneric"));
CuAssertPtrNotNull(tc, get_function("describe_braineater"));
test_cleanup();
}
CuSuite *get_names_suite(void)
{
CuSuite *suite = CuSuiteNew();
SUITE_ADD_TEST(suite, test_names);
return suite;
}

View File

@ -111,6 +111,7 @@ int RunAllTests(int argc, char *argv[])
ADD_SUITE(messages);
/* gamecode */
ADD_SUITE(prefix);
ADD_SUITE(names);
ADD_SUITE(battle);
ADD_SUITE(volcano);
ADD_SUITE(donations);