From a691312d8794d5516402bb6bb0d3e90c40ba188b Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Wed, 9 Jul 2008 15:05:36 +0000 Subject: Added several tests for locale support (8 bit and multibyte UTF-8) Basically all tests have been taken from glibc. For testing multibyte encoding EUC_JP parts have been commented out and added new section for UTF-8 that is the only multibyte codeset currently supported on uCLibc. Some tests are still failing due to unsupported/missing features, other have been fixed. Signed-off-by: Filippo Arcidiacono Signed-off-by: Carmelo Amoroso --- test/locale/tst-setlocale.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/locale/tst-setlocale.c (limited to 'test/locale/tst-setlocale.c') diff --git a/test/locale/tst-setlocale.c b/test/locale/tst-setlocale.c new file mode 100644 index 000000000..1f8e68d88 --- /dev/null +++ b/test/locale/tst-setlocale.c @@ -0,0 +1,25 @@ +/* Test case by Jakub Jelinek . */ +#include +#include +#include + +int +main (void) +{ + char q[30]; + char *s; + + setlocale (LC_ALL, ""); + printf ("after setlocale (LC_ALL, \"\"): %s\n", setlocale(LC_NUMERIC, NULL)); + + strcpy (q, "de_DE.UTF-8"); + setlocale (LC_NUMERIC, q); + printf ("after setlocale (LC_NUMERIC, \"%s\"): %s\n", + q, setlocale(LC_NUMERIC, NULL)); + + strcpy (q, "de_DE.ISO-8859-1"); + s = setlocale (LC_NUMERIC, NULL); + printf ("after overwriting string: %s\n", s); + + return strcmp (s, "de_DE.UTF-8") != 0; +} -- cgit v1.2.3