2016-09-04 21:27:36 +02:00
|
|
|
#include <platform.h>
|
|
|
|
#include "language.h"
|
|
|
|
|
|
|
|
#include <CuTest.h>
|
|
|
|
#include <tests.h>
|
|
|
|
|
2016-09-04 22:07:52 +02:00
|
|
|
extern const char *directions[];
|
|
|
|
|
2016-09-04 21:27:36 +02:00
|
|
|
static void test_language(CuTest *tc)
|
|
|
|
{
|
2016-09-04 22:07:52 +02:00
|
|
|
const char *str;
|
2016-09-04 21:27:36 +02:00
|
|
|
test_setup();
|
2016-09-04 22:07:52 +02:00
|
|
|
default_locale = test_create_locale();
|
|
|
|
str = directions[1];
|
|
|
|
CuAssertStrEquals(tc, str, locale_getstring(default_locale, str));
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2016-09-04 21:27:36 +02:00
|
|
|
}
|
|
|
|
|
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"));
|
2017-12-27 19:58:39 +01:00
|
|
|
test_teardown();
|
2017-01-06 21:08:49 +01:00
|
|
|
}
|
|
|
|
|
2016-09-04 21:27:36 +02: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);
|
2016-09-04 21:27:36 +02:00
|
|
|
return suite;
|
|
|
|
}
|