diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | locale/programs/ld-monetary.c | 5 | ||||
-rw-r--r-- | locale/programs/ld-numeric.c | 5 | ||||
-rw-r--r-- | localedata/ChangeLog | 5 | ||||
-rw-r--r-- | localedata/Makefile | 10 | ||||
-rw-r--r-- | localedata/tests/trans.def | 159 | ||||
-rw-r--r-- | localedata/tst-trans.c | 49 | ||||
-rwxr-xr-x | localedata/tst-trans.sh | 36 |
8 files changed, 264 insertions, 8 deletions
@@ -1,5 +1,8 @@ 1999-11-20 Ulrich Drepper <drepper@cygnus.com> + * locale/programs/ld-monetary.c (monetary_finish): Don't print + individual error message if nothing is defined. + * locale/programs/ld-time.c (time_startup): Test for lr being nonzero, not time. diff --git a/locale/programs/ld-monetary.c b/locale/programs/ld-monetary.c index f1b527c79a..31846b11cf 100644 --- a/locale/programs/ld-monetary.c +++ b/locale/programs/ld-monetary.c @@ -216,7 +216,7 @@ monetary_finish (struct localedef_t *locale, struct charmap_t *charmap) { if (strlen (monetary->int_curr_symbol) != 4) { - if (!be_quiet) + if (! be_quiet && ! nothing) error (0, 0, _("\ %s: value of field `int_curr_symbol' has wrong length"), "LC_MONETARY"); @@ -250,7 +250,8 @@ not correspond to a valid name in ISO 4217"), if (monetary->cat == -2 && ! be_quiet && ! nothing) \ error (0, 0, _("%s: field `%s' not defined"), \ "LC_MONETARY", #cat); \ - else if ((monetary->cat < min || monetary->cat > max) && !be_quiet) \ + else if ((monetary->cat < min || monetary->cat > max) && !be_quiet \ + && !nothing) \ error (0, 0, _("\ %s: value for field `%s' must be in range %d...%d"), \ "LC_MONETARY", #cat, min, max) diff --git a/locale/programs/ld-numeric.c b/locale/programs/ld-numeric.c index 3bf198aba5..22943f30ee 100644 --- a/locale/programs/ld-numeric.c +++ b/locale/programs/ld-numeric.c @@ -116,8 +116,9 @@ numeric_finish (struct localedef_t *locale, struct charmap_t *charmap) != "". */ if (numeric->decimal_point == NULL) { - error (0, 0, _("%s: field `%s' not defined"), - "LC_NUMERIC", "decimal_point"); + if (! be_quiet && ! nothing) + error (0, 0, _("%s: field `%s' not defined"), + "LC_NUMERIC", "decimal_point"); numeric->decimal_point = "."; } else if (numeric->decimal_point[0] == '\0' && ! be_quiet && ! nothing) diff --git a/localedata/ChangeLog b/localedata/ChangeLog index ec2a562a16..d02f77af2e 100644 --- a/localedata/ChangeLog +++ b/localedata/ChangeLog @@ -1,5 +1,10 @@ 1999-11-20 Ulrich Drepper <drepper@cygnus.com> + * 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 <drepper@cygnus.com> diff --git a/localedata/Makefile b/localedata/Makefile index fc588e1f43..6433e374ea 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 0000000000..2f2ac61b96 --- /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>;/ + <A>;<B>;<C>;<D>;<E>;<F>;/ + <a>;<b>;<c>;<d>;<e>;<f> + +blank <SP>;<HT>;<NS> + +space <SP>;<LF>;<VT>;<FF>;/ + <CR>;<HT>;<NS> + +upper <A>;<B>;<C>;<D>;<E>;<F>;<G>;/ + <H>;<I>;<J>;<K>;<L>;<M>;<N>;/ + <O>;<P>;<Q>;<R>;<S>;<T>;<U>;/ + <V>;<W>;<X>;<Y>;<Z> + +lower <a>;<b>;<c>;<d>;<e>;<f>;<g>;/ + <h>;<i>;<j>;<k>;<l>;<m>;<n>;/ + <o>;<p>;<q>;<r>;<s>;<t>;<u>;/ + <v>;<w>;<x>;<y>;<z> + +alpha <A>;<B>;<C>;<D>;<E>;<F>;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(<b>,<B>);/ + (<c>,<C>);/ + (<d>,<D>);/ + (<e>,<E>);/ + (<f>,<F>);/ + (<g>,<G>);/ + (<h>,<H>);/ + (<i>,<I>);/ + (<j>,<J>);/ + (<k>,<K>);/ + (<l>,<L>);/ + (<m>,<M>);/ + (<n>,<N>);/ + (<o>,<O>);/ + (<p>,<P>);/ + (<q>,<Q>);/ + (<r>,<R>);/ + (<s>,<S>);/ + (<t>,<T>);/ + (<u>,<U>);/ + (<v>,<V>);/ + (<w>,<W>);/ + (<x>,<X>);/ + (<y>,<Y>);/ + (<z>,<Z>) + +charconv test + +test (<A>,<B>);(<B>,<C>) +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 "<%><p><%><t><%><g><%><t><%><m><%><t><%><f>" +END LC_NAME + +LC_ADDRESS +postal_fmt "<%><a><%><N><%><f><%><N><%><d><%><N><%><b><%><N><%>/ +<%><s><SP><%><h><SP><%><e><SP><%><r><%><N>/ +<%><C><-><%><z><SP><%><T><%><N><%><c><%><N>" +END LC_ADDRESS + +LC_TELEPHONE +tel_int_fmt "<+><%><c><SP><%><a><SP><%><l>" +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 0000000000..03a64de690 --- /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 <drepper@cygnus.com>. + + 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 <locale.h> +#include <stdio.h> +#include <wctype.h> + +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 0000000000..d65d1abe0f --- /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 $? |