From b982085b4d1b5611521ffdf3f331ad0a2d4161a0 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 11 Apr 2001 05:42:12 +0000 Subject: If we compile RPC thread safe, allow rpcgen to generate thread safe code. --- locale/tst-C-locale.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'locale') diff --git a/locale/tst-C-locale.c b/locale/tst-C-locale.c index 257ee3b347..7bafcc58b7 100644 --- a/locale/tst-C-locale.c +++ b/locale/tst-C-locale.c @@ -24,6 +24,7 @@ #include #include #include +#include static int @@ -386,6 +387,7 @@ run_test (const char *locname) CLASSTEST (upper); CLASSTEST (xdigit); + /* Character mapping tests. */ #define MAPTEST(name) \ if (to##name (c) != __to##name##_l (c, loc)) \ { \ @@ -398,6 +400,46 @@ run_test (const char *locname) MAPTEST (upper); } + /* Character class tests, this time for wide characters. Note that + this only works because we know that the internal encoding is + UCS4. */ + for (c = 0; c < 128; ++c) + { +#define CLASSTEST(name) \ + if (isw##name (c) != __isw##name##_l (c, loc)) \ + { \ + printf ("isw%s('\\%o') != __isw%s_l('\\%o')\n", \ + #name, c, #name, c); \ + result = 1; \ + } + CLASSTEST (alnum); + CLASSTEST (alpha); + CLASSTEST (blank); + CLASSTEST (cntrl); + CLASSTEST (digit); + CLASSTEST (lower); + CLASSTEST (graph); + CLASSTEST (print); + CLASSTEST (punct); + CLASSTEST (space); + CLASSTEST (upper); + CLASSTEST (xdigit); + + /* Character mapping tests. Note that + this only works because we know that the internal encoding is + UCS4. */ +#define MAPTEST(name) \ + if (tow##name (c) != __tow##name##_l (c, loc)) \ + { \ + printf ("tow%s('\\%o') != __tow%s_l('\\%o'): '\\%o' vs '\\%o'\n",\ + #name, c, #name, c, \ + tow##name (c), __tow##name##_l (c, loc)); \ + result = 1; \ + } + MAPTEST (lower); + MAPTEST (upper); + } + __freelocale (loc); } -- cgit 1.4.1