mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-12 20:36:15 +01: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:
parent
01f78fa7f5
commit
ca7dc0e94c
@ -1,3 +1,9 @@
|
|||||||
|
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)
|
||||||
|
|
||||||
2006-12-19 Matthias Clasen <mclasen@redhat.com>
|
2006-12-19 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* glib/gkeyfile.c (g_key_file_is_key_name): Accept
|
* glib/gkeyfile.c (g_key_file_is_key_name): Accept
|
||||||
|
@ -13,9 +13,6 @@ echo_v ()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
LC_ALL=en_US
|
|
||||||
export LC_ALL
|
|
||||||
|
|
||||||
error_out=/dev/null
|
error_out=/dev/null
|
||||||
if [ "$1" = "-v" ]; then
|
if [ "$1" = "-v" ]; then
|
||||||
verbose=1
|
verbose=1
|
||||||
@ -25,6 +22,9 @@ for I in ${srcdir:-.}/collate/*.in; do
|
|||||||
echo_v "Sorting $I"
|
echo_v "Sorting $I"
|
||||||
name=`basename $I .in`
|
name=`basename $I .in`
|
||||||
./unicode-collate $I > collate.out
|
./unicode-collate $I > collate.out
|
||||||
|
if [ $? -eq 2 ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
diff collate.out ${srcdir:-.}/collate/$name.unicode ||
|
diff collate.out ${srcdir:-.}/collate/$name.unicode ||
|
||||||
fail "unexpected error when using g_utf8_collate() on $I"
|
fail "unexpected error when using g_utf8_collate() on $I"
|
||||||
./unicode-collate --key $I > collate.out
|
./unicode-collate --key $I > collate.out
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <locale.h>
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char *key;
|
const char *key;
|
||||||
@ -38,6 +39,18 @@ int main (int argc, char **argv)
|
|||||||
guint i;
|
guint i;
|
||||||
gboolean do_key = FALSE;
|
gboolean do_key = FALSE;
|
||||||
gboolean do_file = 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)
|
if (argc != 1 && argc != 2 && argc != 3)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user