- Go back to using IoErr() to retrieve error codes.
[AROS.git] / test / openlocale.c
blobf35cbab7a20d15dcc189197d960b70135c73bcfd
1 #include <proto/locale.h>
2 #include <proto/exec.h>
3 #include <stdio.h>
4 #include <string.h>
6 #include "clib/test.h"
8 struct LocaleBase * LocaleBase = NULL;
9 struct Locale * locale = NULL;
11 void cleanup()
13 if (locale) CloseLocale(locale);
15 if (LocaleBase) CloseLibrary((struct Library *)LocaleBase);
18 int main(void)
20 LocaleBase = (struct LocaleBase *)OpenLibrary("locale.library",0);
22 if (LocaleBase)
24 int result = 0;
26 locale = OpenLocale("openlocale.prefs");
27 TEST(locale != NULL);
29 /* Expected: name of the prefs file */
30 result = strcmp(locale->loc_LocaleName, "openlocale.prefs");
31 TEST(result == 0);
33 /* Expected: native language name */
34 result = strcmp(locale->loc_LanguageName, "polski.language");
35 TEST(result == 0);
37 /* Expected: native language name */
38 result = strcmp(locale->loc_PrefLanguages[0], "polski");
39 TEST(result == 0);
43 cleanup();
45 return 0;