2016-08-28 18:37:08 +02:00
|
|
|
#include <platform.h>
|
|
|
|
|
|
|
|
#include "names.h"
|
|
|
|
|
2016-08-28 19:08:52 +02:00
|
|
|
#include <util/language.h>
|
2016-08-28 18:37:08 +02:00
|
|
|
#include <util/functions.h>
|
|
|
|
|
|
|
|
#include <CuTest.h>
|
|
|
|
#include "tests.h"
|
|
|
|
|
|
|
|
static void test_names(CuTest * tc)
|
|
|
|
{
|
2016-08-28 19:08:52 +02:00
|
|
|
name_func foo;
|
2016-08-28 18:37:08 +02:00
|
|
|
test_cleanup();
|
|
|
|
register_names();
|
2016-08-28 19:08:52 +02:00
|
|
|
default_locale = test_create_locale();
|
|
|
|
locale_setstring(default_locale, "undead_prefix_0", "Kleine");
|
|
|
|
locale_setstring(default_locale, "undead_name_0", "Graue");
|
|
|
|
locale_setstring(default_locale, "undead_postfix_0", "Kobolde");
|
|
|
|
CuAssertPtrNotNull(tc, foo = (name_func)get_function("nameundead"));
|
|
|
|
CuAssertStrEquals(tc, "Kleine Graue Kobolde", foo(NULL));
|
2016-08-28 18:37:08 +02:00
|
|
|
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;
|
|
|
|
}
|