From a2236316645f0e4c3c9b286a7f908da786b9726f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 21 Nov 1999 06:51:06 +0000 Subject: Update. * locale/programs/ld-monetary.c (monetary_finish): Don't print individual error message if nothing is defined. --- localedata/ChangeLog | 5 ++ localedata/Makefile | 10 +-- localedata/tests/trans.def | 159 +++++++++++++++++++++++++++++++++++++++++++++ localedata/tst-trans.c | 49 ++++++++++++++ localedata/tst-trans.sh | 36 ++++++++++ 5 files changed, 255 insertions(+), 4 deletions(-) create mode 100644 localedata/tests/trans.def create mode 100644 localedata/tst-trans.c create mode 100755 localedata/tst-trans.sh (limited to 'localedata') diff --git a/localedata/ChangeLog b/localedata/ChangeLog index ec2a562..d02f77a 100644 --- a/localedata/ChangeLog +++ b/localedata/ChangeLog @@ -1,5 +1,10 @@ 1999-11-20 Ulrich Drepper + * tst-trans.c: New file. + * tst-trans.sh: New file. + * tests/trans.def: New file. + * Makefile: Add rules for character mapping tests. + * tests/test1.def: Correct ellipsis syntax. 1999-11-17 Ulrich Drepper diff --git a/localedata/Makefile b/localedata/Makefile index fc588e1..6433e37 100644 --- a/localedata/Makefile +++ b/localedata/Makefile @@ -35,7 +35,7 @@ locales := $(filter-out $(addprefix locales/, CVS RCS SCCS %~), \ repertoiremaps := $(filter-out $(addprefix repertoiremaps/, CVS RCS SCCS %~), \ $(wildcard repertoiremaps/*)) -test-srcs := collate-test xfrm-test tst-fmon tst-rpmatch +test-srcs := collate-test xfrm-test tst-fmon tst-rpmatch tst-trans test-input := de_DE.ISO-8859-1 da_DK.ISO-8859-1 fr_CA,2.13.ISO-8859-1 \ hr_HR.ISO-8859-2 # once it is fixed: cs_CZ.ISO-8859-2 test-input-data = $(addsuffix .in, $(basename $(test-input))) @@ -46,7 +46,7 @@ ld-test-srcs := $(addprefix tests/,$(addsuffix .cm,$(ld-test-names)) \ $(addsuffix .def,$(ld-test-names))) generated := $(test-input) $(test-output) -generated-dirs := $(basename $(test-input)) en_US $(ld-test-names) +generated-dirs := $(basename $(test-input)) en_US $(ld-test-names) tt_TT distribute := CHECKSUMS README SUPPORTED ChangeLog \ $(charmaps) $(locales) $(repertoiremaps) \ @@ -71,8 +71,8 @@ $(inst_i18ndir)/repertoiremaps/%: repertoiremaps/% $(+force); $(do-install) ifeq (no,$(cross-compiling)) ifeq (yes,$(build-shared)) -.PHONY: do-collate-test do-tst-fmon do-tst-locale do-tst-rpmatch -#tests: do-collate-test do-tst-fmon do-tst-locale do-tst-rpmatch +.PHONY: do-collate-test do-tst-fmon do-tst-locale do-tst-rpmatch do-tst-trans +tests: do-collate-test do-tst-fmon do-tst-locale do-tst-rpmatch do-tst-trans do-collate-test: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \ $(test-input-data) $(SHELL) -e $< $(common-objpfx) $(test-input) @@ -82,6 +82,8 @@ do-tst-locale: tst-locale.sh $(ld-test-srcs) $(SHELL) -e $< $(common-objpfx) do-tst-rpmatch: tst-rpmatch.sh $(objpfx)tst-rpmatch do-tst-fmon $(SHELL) -e $< $(common-objpfx) +do-tst-trans: tst-trans.sh $(objpfx)tst-trans + $(SHELL) -e $< $(common-objpfx) endif endif diff --git a/localedata/tests/trans.def b/localedata/tests/trans.def new file mode 100644 index 0000000..2f2ac61 --- /dev/null +++ b/localedata/tests/trans.def @@ -0,0 +1,159 @@ +escape_char / +comment_char % +repertoiremap mnemonic.ds + +LC_CTYPE + +digit <0>;<1>;<2>;<3>;<4>;/ + <5>;<6>;<7>;<8>;<9> + +xdigit <0>;<1>;<2>;<3>;<4>;/ + <5>;<6>;<7>;<8>;<9>;/ + ;;;;;;/ + ;;;;; + +blank ;; + +space ;;;;/ + ;; + +upper ;;;;;;;/ + ;;;;;;;/ + ;

;;;;;;/ + ;;;; + +alpha ;;;;;;;/ + ;;;;;;;/ + ;

;;;;;;/ + ;;;;;;;/ + ;;;;;;;/ + ;;;;;;

;/ + ;;;;;;;/ + ;; + +cntrl ;;;;;;/ + ;;;;;;/ + ;;;;

;;/ + ;;;;;;/ + ;;;;;;/ + ;;
;;;;/ + ;;;;;;/ + ;;;;;;/ + ;;;;;;/ + ;;;;;;/ + ;;;; + +punct ;<">;;;<%>;<&>;<'>;/ + <(>;<)>;<*>;<+>;<,>;<->;<.>;/ + ;<:>;<;>;<<>;<=>;>;;/ + ;<<(>;;<)/>>;<'/>> + +tolower (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (

,

,

);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,) + +charconv test + +test (,);(,) +END LC_CTYPE + +LC_COLLATE +copy "en_DK" +END LC_COLLATE + +LC_TIME +copy "en_DK" +END LC_TIME + +LC_NUMERIC +copy "en_DK" +END LC_NUMERIC + +LC_MONETARY +copy "en_DK" +END LC_MONETARY + +LC_MESSAGES +copy "en_DK" +END LC_MESSAGES + +LC_PAPER +height 297 +width 210 +END LC_PAPER + +LC_NAME +name_fmt "<%>

<%><%><%><%><%><%>" +END LC_NAME + +LC_ADDRESS +postal_fmt "<%><%><%><%><%><%><%><%><%>/ +<%><%><%><%><%>/ +<%><-><%><%><%><%><%>" +END LC_ADDRESS + +LC_TELEPHONE +tel_int_fmt "<+><%><%><%>" +END LC_TELEPHONE + +LC_MEASUREMENT +measurement 1 +END LC_MEASUREMENT + +LC_IDENTIFICATION +END LC_IDENTIFICATION diff --git a/localedata/tst-trans.c b/localedata/tst-trans.c new file mode 100644 index 0000000..03a64de --- /dev/null +++ b/localedata/tst-trans.c @@ -0,0 +1,49 @@ +/* Test program for user-defined character maps. + Copyright (C) 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper . + + 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) +{ + wctrans_t t; + wint_t wch; + int errors = 0; + + setlocale (LC_ALL, ""); + + t = wctrans ("test"); + if (t == (wctrans_t) 0) + exit (1); + + wch = towctrans (L'A', t); + printf ("towctrans (L'A', t) = %c\n", wch); + if (wch != L'B') + errors = 1; + + wch = towctrans (L'B', t); + printf ("towctrans (L'B', t) = %c\n", wch); + if (wch != L'C') + errors = 1; + + return errors; +} diff --git a/localedata/tst-trans.sh b/localedata/tst-trans.sh new file mode 100755 index 0000000..d65d1ab --- /dev/null +++ b/localedata/tst-trans.sh @@ -0,0 +1,36 @@ +#! /bin/sh +# Test character mapping definitions. +# Copyright (C) 1999 Free Software Foundation, Inc. +# This file is part of the GNU C Library. +# +# 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. + +common_objpfx=$1 + +# Generate the necessary locale data. +I18NPATH=. \ +${common_objpfx}elf/ld-linux --library-path $common_objpfx \ +${common_objpfx}locale/localedef --quiet \ +-i tests/trans.def -f ISO-8859-1 -u mnemonic.ds \ +${common_objpfx}localedata/tt_TT || +exit 1 + +# Run the test program. +LOCPATH=${common_objpfx}localedata LC_ALL=tt_TT \ +${common_objpfx}elf/ld-linux --library-path $common_objpfx \ +${common_objpfx}localedata/tst-trans + +exit $? -- cgit v1.1

);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,) + +toupper (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (,);/ + (

;;;;;;/ + ;;;; + +lower ;;;;;;;/ + ;;;;;;;/ + ;