From 400925d81cc92de52efe6cad6dcc33794262119c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 14 Feb 2006 02:48:22 +0000 Subject: grab a bunch of tests from glibc --- test/string/bug-strcoll1.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/string/bug-strcoll1.c (limited to 'test/string/bug-strcoll1.c') diff --git a/test/string/bug-strcoll1.c b/test/string/bug-strcoll1.c new file mode 100644 index 000000000..b6510d926 --- /dev/null +++ b/test/string/bug-strcoll1.c @@ -0,0 +1,24 @@ +#include +#include +#include + +int +main (void) +{ + const char t1[] = "0-0-0-0-0-0-0-0-0-0.COM"; + const char t2[] = "00000-00000.COM"; + int res1; + int res2; + + setlocale (LC_ALL, "en_US.ISO-8859-1"); + + res1 = strcoll (t1, t2); + printf ("strcoll (\"%s\", \"%s\") = %d\n", t1, t2, res1); + res2 = strcoll (t2, t1); + printf ("strcoll (\"%s\", \"%s\") = %d\n", t2, t1, res2); + + return ((res1 == 0 && res2 != 0) + || (res1 != 0 && res2 == 0) + || (res1 < 0 && res2 < 0) + || (res1 > 0 && res2 > 0)); +} -- cgit v1.2.3