Check for SYS/GL during library init. Reason is that
[AROS.git] / test / locale / openlocale.c
blobc36311fc653f264c9ebfbc794ca7274309edb06e
1 /*
2 Copyright © 1995-2016, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <proto/locale.h>
7 #include <proto/exec.h>
8 #include <stdio.h>
9 #include <string.h>
11 #include "../clib/test.h"
13 struct LocaleBase * LocaleBase = NULL;
14 struct Locale * locale = NULL;
16 void cleanup()
18 if (locale) CloseLocale(locale);
20 if (LocaleBase) CloseLibrary((struct Library *)LocaleBase);
23 int main(void)
25 LocaleBase = (struct LocaleBase *)OpenLibrary("locale.library",0);
27 if (LocaleBase)
29 int result = 0;
31 locale = OpenLocale("openlocale.prefs");
32 TEST(locale != NULL);
34 /* Expected: name of the prefs file */
35 result = strcmp(locale->loc_LocaleName, "openlocale.prefs");
36 TEST(result == 0);
38 /* Expected: native language name */
39 result = strcmp(locale->loc_LanguageName, "polski.language");
40 TEST(result == 0);
42 /* Expected: native language name */
43 result = strcmp(locale->loc_PrefLanguages[0], "polski");
44 TEST(result == 0);
48 cleanup();
50 return 0;