14 { "C", "TRANSLIT", "translit", 0 },
15 { "de_DE.ISO-8859-1", "TRANSLIT", "translit", 0 },
16 { "de_DE.ISO-8859-1", "TRANSLIT", "trÄnslit", -1 },
17 { "de_DE.UTF-8", "TRANSLIT", "translit", 0 },
18 { "de_DE.ISO-8859-1", "ä", "Ä", 1 }
20 #define ntests (sizeof (tests) / sizeof (tests[0]))
28 locale_t loc = newlocale (1 << LC_ALL, "C", NULL);
30 for (cnt = 0; cnt < ntests; ++cnt)
34 if (setlocale (LC_ALL, tests[cnt].locale) == NULL)
36 printf ("cannot set locale \"%s\": %m\n", tests[cnt].locale);
41 printf ("\nstrcasecmp_l (\"%s\", \"%s\", loc)\n",
42 tests[cnt].str1, tests[cnt].str2);
44 r = strcasecmp_l (tests[cnt].str1, tests[cnt].str2, loc);
45 if (tests[cnt].result == 0)
49 printf ("\"%s\" and \"%s\" expected to be the same, result %d\n",
50 tests[cnt].str1, tests[cnt].str2, r);
54 else if (tests[cnt].result < 0)
58 printf ("\"%s\" expected to be smaller than \"%s\", result %d\n",
59 tests[cnt].str1, tests[cnt].str2, r);
67 printf ("\"%s\" expected to be larger than \"%s\", result %d\n",
68 tests[cnt].str1, tests[cnt].str2, r);