server/src/util/language.test.c

36 lines
794 B
C
Raw Normal View History

#include <platform.h>
#include "language.h"
#include <CuTest.h>
#include <tests.h>
extern const char *directions[];
static void test_language(CuTest *tc)
{
const char *str;
test_setup();
default_locale = test_create_locale();
str = directions[1];
CuAssertStrEquals(tc, str, locale_getstring(default_locale, str));
test_teardown();
}
2017-01-06 21:08:49 +01:00
static void test_make_locales(CuTest *tc)
{
test_setup();
make_locales("aa,bb,cc");
CuAssertPtrNotNull(tc, get_locale("aa"));
CuAssertPtrNotNull(tc, get_locale("bb"));
CuAssertPtrNotNull(tc, get_locale("cc"));
test_teardown();
2017-01-06 21:08:49 +01:00
}
CuSuite *get_language_suite(void)
{
CuSuite *suite = CuSuiteNew();
SUITE_ADD_TEST(suite, test_language);
2017-01-06 21:08:49 +01:00
SUITE_ADD_TEST(suite, test_make_locales);
return suite;
}