From f1d8b8044e2dbf207ab98b26f5b9bbdfb7e59382 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 9 Dec 1999 07:52:58 +0000 Subject: Update. * locale/programs/ld-ctype.c (ctype_output): Correct sizes of mapping arrays. (allocate_arrays): Allocate memory for map32. Correctly install default values in it and install defined mappings. * locale/programs/ld-monetary.c (monetary_finish): Provide default value for mon_grouping. --- localedata/tests/test6.c | 138 +++++++++++++++++++++++++++++++++++++++++++++ localedata/tests/test6.cm | 93 ++++++++++++++++++++++++++++++ localedata/tests/test6.def | 20 +++++++ localedata/tests/test6.mne | 113 +++++++++++++++++++++++++++++++++++++ 4 files changed, 364 insertions(+) create mode 100644 localedata/tests/test6.c create mode 100644 localedata/tests/test6.cm create mode 100644 localedata/tests/test6.def create mode 100644 localedata/tests/test6.mne (limited to 'localedata') diff --git a/localedata/tests/test6.c b/localedata/tests/test6.c new file mode 100644 index 0000000000..735b1adde8 --- /dev/null +++ b/localedata/tests/test6.c @@ -0,0 +1,138 @@ +/* Test program for character classes and mappings. + Copyright (C) 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1999. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include +#include + + +int +main (void) +{ + const char lower[] = "abcdefghijklmnopqrstuvwxyz"; + const char upper[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; +#define LEN (sizeof (upper) - 1) + const wchar_t wlower[] = L"abcdefghijklmnopqrstuvwxyz"; + const wchar_t wupper[] = L"ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int i; + int result = 0; + + setlocale (LC_ALL, "test6"); + + for (i = 0; i < LEN; ++i) + { + /* Test basic table handling (basic == not more than 256 characters). + The charmaps swaps the normal lower-upper case meaning of the + ASCII characters used in the source code while the Unicode mapping + in the repertoire map has the normal correspondants. This test + shows the independence of the tables for `char' and `wchar_t' + characters. */ + + if (islower (lower[i])) + { + printf ("islower ('%c') false\n", lower[i]); + result = 1; + } + if (! isupper (lower[i])) + { + printf ("isupper ('%c') false\n", lower[i]); + result = 1; + } + + if (! islower (upper[i])) + { + printf ("islower ('%c') false\n", upper[i]); + result = 1; + } + if (isupper (upper[i])) + { + printf ("isupper ('%c') false\n", upper[i]); + result = 1; + } + + if (toupper (lower[i]) != lower[i]) + { + printf ("toupper ('%c') false\n", lower[i]); + result = 1; + } + if (tolower (lower[i]) != upper[i]) + { + printf ("tolower ('%c') false\n", lower[i]); + result = 1; + } + + if (tolower (upper[i]) != upper[i]) + { + printf ("tolower ('%c') false\n", upper[i]); + result = 1; + } + if (toupper (upper[i]) != lower[i]) + { + printf ("toupper ('%c') false\n", upper[i]); + result = 1; + } + + if (iswlower (wupper[i])) + { + printf ("iswlower (L'%c') false\n", upper[i]); + result = 1; + } + if (! iswupper (wupper[i])) + { + printf ("iswupper (L'%c') false\n", upper[i]); + result = 1; + } + + if (iswupper (wlower[i])) + { + printf ("iswupper (L'%c') false\n", lower[i]); + result = 1; + } + if (! iswlower (wlower[i])) + { + printf ("iswlower (L'%c') false\n", lower[i]); + result = 1; + } + + if (towupper (wlower[i]) != wupper[i]) + { + printf ("towupper ('%c') false\n", lower[i]); + result = 1; + } + if (towlower (wlower[i]) != wlower[i]) + { + printf ("towlower ('%c') false\n", lower[i]); + result = 1; + } + + if (towlower (wupper[i]) != wlower[i]) + { + printf ("towlower ('%c') false\n", upper[i]); + result = 1; + } + if (towupper (wupper[i]) != wupper[i]) + { + printf ("towupper ('%c') false\n", upper[i]); + result = 1; + } + } + + return result; +} diff --git a/localedata/tests/test6.cm b/localedata/tests/test6.cm new file mode 100644 index 0000000000..3711495d86 --- /dev/null +++ b/localedata/tests/test6.cm @@ -0,0 +1,93 @@ + test6 + +CHARMAP + \x09 + \x0A + \x0B + \x0C + \x0D + \x20 + \x20 + \x21 +<"> \x22 +<%> \x25 +<&> \x26 +<'> \x27 +<(> \x28 +<)> \x29 +<*> \x2A +<+> \x2B +<,> \x2C +<-> \x2D +<.> \x2E +<\\> \x2F +<0> \x30 +<1> \x31 +<2> \x32 +<3> \x33 +<4> \x34 +<5> \x35 +<6> \x36 +<7> \x37 +<8> \x38 +<9> \x39 +<:> \x3A +<;> \x3B +<<> \x3C +<=> \x3D +<\>> \x3E + \x3F + \x41 + \x42 + \x43 + \x44 + \x45 + \x46 + \x47 + \x48 + \x49 + \x4A + \x4B + \x4C + \x4D + \x4E + \x4F +

\x70 + \x71 + \x72 + \x73 + \x74 + \x75 + \x76 + \x77 + \x78 + \x79 + \x7A +END CHARMAP diff --git a/localedata/tests/test6.def b/localedata/tests/test6.def new file mode 100644 index 0000000000..f8f88b3296 --- /dev/null +++ b/localedata/tests/test6.def @@ -0,0 +1,20 @@ +LC_CTYPE + +lower ;;;;;;;;;;;;;;;

;; \ + ;;;;;;;; +upper ;;;;;;;;;;;;;;;

;; \ + ;;;;;;;; + +tolower (,);(,);(,);(,);(,);(,); \ + (,);(,);(,);(,);(,);(,); \ + (,);(,);(,);(

,

);(,);(,); \ + (,);(,);(,);(,);(,);(,); \ + (,);(,) + +toupper (,);(,);(,);(,);(,);(,); \ + (,);(,);(,);(,);(,);(,); \ + (,);(,);(,);(

,

);(,);(,); \ + (,);(,);(,);(,);(,);(,); \ + (,);(,) + +END LC_CTYPE diff --git a/localedata/tests/test6.mne b/localedata/tests/test6.mne new file mode 100644 index 0000000000..bb1218569d --- /dev/null +++ b/localedata/tests/test6.mne @@ -0,0 +1,113 @@ + HORIZONTAL TABULATION + LINE FEED + VERTICAL TABULATION + FORM FEED + CARRIAGE RETURN + SPACE + SPACE + EXCLAMATION MARK +<"> QUOTATION MARK + NUMBER SIGN + DOLLAR SIGN + DOLLAR SIGN +<%> PERCENT SIGN +<&> AMPERSAND +<'> APOSTROPHE +<(> LEFT PARENTHESIS +<)> RIGHT PARENTHESIS +<*> ASTERISK +<+> PLUS SIGN +<,> COMMA +<-> HYPHEN-MINUS +<.> FULL STOP + SOLIDUS +<0> DIGIT ZERO +<1> DIGIT ONE +<2> DIGIT TWO +<3> DIGIT THREE +<4> DIGIT FOUR +<5> DIGIT FIVE +<6> DIGIT SIX +<7> DIGIT SEVEN +<8> DIGIT EIGHT +<9> DIGIT NINE +<:> COLON +<;> SEMICOLON +<<> LESS-THAN SIGN +<=> EQUALS SIGN +<\>> GREATER-THAN SIGN + QUESTION MARK +<@> COMMERCIAL AT + LATIN CAPITAL LETTER A + LATIN CAPITAL LETTER B + LATIN CAPITAL LETTER C + LATIN CAPITAL LETTER D + LATIN CAPITAL LETTER E + LATIN CAPITAL LETTER F + LATIN CAPITAL LETTER G + LATIN CAPITAL LETTER H + LATIN CAPITAL LETTER I + LATIN CAPITAL LETTER J + LATIN CAPITAL LETTER K + LATIN CAPITAL LETTER L + LATIN CAPITAL LETTER M + LATIN CAPITAL LETTER N + LATIN CAPITAL LETTER O +

LATIN CAPITAL LETTER P + LATIN CAPITAL LETTER Q + LATIN CAPITAL LETTER R + LATIN CAPITAL LETTER S + LATIN CAPITAL LETTER T + LATIN CAPITAL LETTER U + LATIN CAPITAL LETTER V + LATIN CAPITAL LETTER W + LATIN CAPITAL LETTER X + LATIN CAPITAL LETTER Y + LATIN CAPITAL LETTER Z +<<(> LEFT SQUARE BRACKET + LEFT SQUARE BRACKET + REVERSE SOLIDUS + REVERSE SOLIDUS + REVERSE SOLIDUS +<)\>> RIGHT SQUARE BRACKET + RIGHT SQUARE BRACKET +<'\>> CIRCUMFLEX ACCENT + CIRCUMFLEX ACCENT + CIRCUMFLEX ACCENT +<_> LOW LINE + LOW LINE + LOW LINE +<'!> GRAVE ACCENT + GRAVE ACCENT + LATIN SMALL LETTER A + LATIN SMALL LETTER B + LATIN SMALL LETTER C + LATIN SMALL LETTER D + LATIN SMALL LETTER E + LATIN SMALL LETTER F + LATIN SMALL LETTER G + LATIN SMALL LETTER H + LATIN SMALL LETTER I + LATIN SMALL LETTER J + LATIN SMALL LETTER K + LATIN SMALL LETTER L + LATIN SMALL LETTER M + LATIN SMALL LETTER N + LATIN SMALL LETTER O +

LATIN SMALL LETTER P + LATIN SMALL LETTER Q + LATIN SMALL LETTER R + LATIN SMALL LETTER S + LATIN SMALL LETTER T + LATIN SMALL LETTER U + LATIN SMALL LETTER V + LATIN SMALL LETTER W + LATIN SMALL LETTER X + LATIN SMALL LETTER Y + LATIN SMALL LETTER Z +<(!> LEFT CURLY BRACKET + VERTICAL LINE + VERTICAL LINE + RIGHT CURLY BRACKET +<'?> TILDE +

DELETE -- cgit 1.4.1

\x50 + \x51 + \x52 + \x53 + \x54 + \x55 + \x56 + \x57 + \x58 + \x59 + \x5A +<_> \x5F + \x61 + \x62 + \x63 + \x64 + \x65 + \x66 + \x67 + \x68 + \x69 + \x6A + \x6B + \x6C + \x6D + \x6E + \x6F +