mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 07:38:54 +02:00
Silently skip tests if we can't set LC_COLLATE to en_US. (#336438)
2006-12-24 Matthias Clasen <mclasen@redhat.com> * tests/run-collate-tests.sh: * tests/unicode-collate.c: Silently skip tests if we can't set LC_COLLATE to en_US. (#336438)
This commit is contained in:
committed by
Matthias Clasen
parent
01f78fa7f5
commit
ca7dc0e94c
@@ -5,6 +5,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <locale.h>
|
||||
|
||||
typedef struct {
|
||||
const char *key;
|
||||
@@ -38,6 +39,18 @@ int main (int argc, char **argv)
|
||||
guint i;
|
||||
gboolean do_key = FALSE;
|
||||
gboolean do_file = FALSE;
|
||||
gchar *locale;
|
||||
|
||||
/* FIXME: need to modify environment here,
|
||||
* since g_utf8_collate_key calls setlocal (LC_COLLATE, "")
|
||||
*/
|
||||
g_setenv ("LC_ALL", "en_US", TRUE);
|
||||
locale = setlocale (LC_ALL, "");
|
||||
if (locale == NULL || strcmp (locale, "en_US") != 0)
|
||||
{
|
||||
fprintf (stderr, "No suitable locale, skipping test\n");
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (argc != 1 && argc != 2 && argc != 3)
|
||||
{
|
||||
|
Reference in New Issue
Block a user