2 * Copyright 2018 Red Hat, Inc.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * See the included COPYING file for more information.
14 #define TEST_LOCALE "fr_FR.UTF-8@latin:en_US.UTF-8"
16 const gchar
*TEST_RESULT
[] = {
33 const gchar
*TEST_TABLE
[] = {
42 test_language_names_with_category (void)
44 const gchar
* const *language_names
= NULL
;
47 for (i
= 0; TEST_TABLE
[i
]; ++i
)
49 g_test_message ("Test %" G_GSIZE_FORMAT
, i
);
50 g_assert_true (g_setenv (TEST_TABLE
[i
], TEST_LOCALE
, TRUE
));
51 language_names
= g_get_language_names_with_category ("LC_CTYPE");
52 g_assert_cmpuint (g_strv_length ((gchar
**)language_names
), ==, g_strv_length ((gchar
**)TEST_RESULT
));
54 for (j
= 0; language_names
[j
]; ++j
)
56 g_assert_cmpstr (language_names
[j
], ==, TEST_RESULT
[j
]);
58 g_unsetenv (TEST_TABLE
[i
]);
63 main (int argc
, char *argv
[])
65 g_test_init (&argc
, &argv
, NULL
);
67 g_test_bug_base ("http://bugs.gnome.org/");
69 g_test_add_func ("/charset/language_names_with_category", test_language_names_with_category
);