From: Ulrich Drepper Date: Sun, 21 Nov 1999 06:51:06 +0000 (+0000) Subject: Update. X-Git-Tag: upstream/2.30~26553 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a2236316645f0e4c3c9b286a7f908da786b9726f;p=external%2Fglibc.git Update. * locale/programs/ld-monetary.c (monetary_finish): Don't print individual error message if nothing is defined. --- diff --git a/ChangeLog b/ChangeLog index 72f2a16..cd80029 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 1999-11-20 Ulrich Drepper + * 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 f1b527c..31846b1 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 3bf198a..22943f3 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 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 $?

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

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