patch: Add test for international currency formatting
Petter Reinholdtsen
pere@hungry.com
Sun Nov 23 18:05:00 GMT 2003
I'm replying to
<URL:http://sources.redhat.com/ml/libc-alpha/2003-06/msg00257.html>.
[Petter Reinholdtsen, 2003-06-21]
> The current formatting of international currency is broken. Here is a
> test case demonstrating the current output. My next step is to change
> stdlib/strfmon.c to produce the correct result, and update the test
> case to demonstrate it.
>
> At the moment, the values of int_cs_precedes, int_sign_posn and
> int_sep_by_space is ignored by glibc, and the values of cs_precedes,
> sign_posn and sep_by_space is used instead.
>
> Please include in the glibc distribution.
>
> 2003-06-21 Petter Reinholdtsen <pere@hungry.com>
>
> * tst-fmon.data: Add test for international currency
> formatting.
Here is the updated test case, with the correct result. I only
replace the data part of the patch.
These are the same:
> * localedata/tst-fmon.sh: Likewise.
> * localedata/Makefile: Likewise.
> * localedata/tst-fmon-locales/int_tstfmon_n01y12: New file.
> * localedata/tst-fmon-locales/int_tstfmon_n02n40: New file.
> * localedata/tst-fmon-locales/int_tstfmon_n10y31: New file.
> * localedata/tst-fmon-locales/int_tstfmon_n11y41: New file.
> * localedata/tst-fmon-locales/int_tstfmon_n12y11: New file.
> * localedata/tst-fmon-locales/int_tstfmon_n20n32: New file.
> * localedata/tst-fmon-locales/int_tstfmon_n30y20: New file.
> * localedata/tst-fmon-locales/int_tstfmon_n41n00: New file.
> * localedata/tst-fmon-locales/int_tstfmon_y01y10: New file.
> * localedata/tst-fmon-locales/int_tstfmon_y02n22: New file.
> * localedata/tst-fmon-locales/int_tstfmon_y22n42: New file.
> * localedata/tst-fmon-locales/int_tstfmon_y30y21: New file.
> * localedata/tst-fmon-locales/int_tstfmon_y32n31: New file.
> * localedata/tst-fmon-locales/int_tstfmon_y40y00: New file.
> * localedata/tst-fmon-locales/int_tstfmon_y42n21: New file.
Index: localedata/tst-fmon.data
===================================================================
RCS file: /cvs/glibc/libc/localedata/tst-fmon.data,v
retrieving revision 1.10
diff -u -3 -p -u -r1.10 tst-fmon.data
--- localedata/tst-fmon.data 1 Mar 2002 05:20:48 -0000 1.10
+++ localedata/tst-fmon.data 23 Nov 2003 18:02:52 -0000
@@ -236,3 +236,113 @@ tstfmon_y42n21 %11n 123.45 $ +123.45
tstfmon_y42n21 %11n -123.45 123.45 $-
tstfmon_y42n21 %^=*#5n 123.45 $ +**123.45
tstfmon_y42n21 %^=*#5n -123.45 **123.45 $-
+#
+# check all int_cs_precedes/int_sign_posn/int_sep_by_space
+# combinations using special test locales. The six characters after
+# the "_" indicate these three values for positive and then negative
+# quantities.
+#
+int_tstfmon_n01y12 %i 123.45 "123.45 USC"
+int_tstfmon_n01y12 %i -123.45 "- USC123.45"
+int_tstfmon_n01y12 %13i 123.45 " 123.45 USC"
+int_tstfmon_n01y12 %13i -123.45 " - USC123.45"
+int_tstfmon_n01y12 %^=*#5i 123.45 " **123.45 USC"
+int_tstfmon_n01y12 %^=*#5i -123.45 "- USC**123.45"
+#
+int_tstfmon_n02n40 %i 123.45 "123.45USC"
+int_tstfmon_n02n40 %i -123.45 "123.45USC-"
+int_tstfmon_n02n40 %13i 123.45 " 123.45USC"
+int_tstfmon_n02n40 %13i -123.45 " 123.45USC-"
+int_tstfmon_n02n40 %^=*#5i 123.45 "**123.45USC"
+int_tstfmon_n02n40 %^=*#5i -123.45 "**123.45USC-"
+#
+int_tstfmon_n10y31 %i 123.45 "+123.45USC"
+int_tstfmon_n10y31 %i -123.45 "-USC 123.45"
+int_tstfmon_n10y31 %13i 123.45 " +123.45USC"
+int_tstfmon_n10y31 %13i -123.45 " -USC 123.45"
+int_tstfmon_n10y31 %^=*#5i 123.45 " +**123.45USC"
+int_tstfmon_n10y31 %^=*#5i -123.45 "-USC **123.45"
+#
+int_tstfmon_n11y41 %i 123.45 "+123.45 USC"
+int_tstfmon_n11y41 %i -123.45 "USC- 123.45"
+int_tstfmon_n11y41 %13i 123.45 " +123.45 USC"
+int_tstfmon_n11y41 %13i -123.45 " USC- 123.45"
+int_tstfmon_n11y41 %^=*#5i 123.45 " +**123.45 USC"
+int_tstfmon_n11y41 %^=*#5i -123.45 "USC- **123.45"
+#
+int_tstfmon_n12y11 %i 123.45 "+123.45USC"
+int_tstfmon_n12y11 %i -123.45 "-USC 123.45"
+int_tstfmon_n12y11 %13i 123.45 " +123.45USC"
+int_tstfmon_n12y11 %13i -123.45 " -USC 123.45"
+int_tstfmon_n12y11 %^=*#5i 123.45 " +**123.45USC"
+int_tstfmon_n12y11 %^=*#5i -123.45 "-USC **123.45"
+#
+int_tstfmon_n20n32 %i 123.45 "123.45USC+"
+int_tstfmon_n20n32 %i -123.45 "123.45- USC"
+int_tstfmon_n20n32 %13i 123.45 " 123.45USC+"
+int_tstfmon_n20n32 %13i -123.45 " 123.45- USC"
+int_tstfmon_n20n32 %^=*#5i 123.45 "**123.45USC+"
+int_tstfmon_n20n32 %^=*#5i -123.45 "**123.45- USC"
+#
+int_tstfmon_n30y20 %i 123.45 "123.45+USC"
+int_tstfmon_n30y20 %i -123.45 "USC123.45-"
+int_tstfmon_n30y20 %13i 123.45 " 123.45+USC"
+int_tstfmon_n30y20 %13i -123.45 " USC123.45-"
+int_tstfmon_n30y20 %^=*#5i 123.45 " **123.45+USC"
+int_tstfmon_n30y20 %^=*#5i -123.45 "USC**123.45-"
+#
+int_tstfmon_n41n00 %i 123.45 "123.45 USC+"
+int_tstfmon_n41n00 %i -123.45 "(123.45USC)"
+int_tstfmon_n41n00 %13i 123.45 " 123.45 USC+"
+int_tstfmon_n41n00 %13i -123.45 " (123.45USC)"
+int_tstfmon_n41n00 %^=*#5i 123.45 "**123.45 USC+"
+int_tstfmon_n41n00 %^=*#5i -123.45 "(**123.45USC)"
+#
+int_tstfmon_y01y10 %i 123.45 "USC 123.45"
+int_tstfmon_y01y10 %i -123.45 "-USC123.45"
+int_tstfmon_y01y10 %13i 123.45 " USC 123.45"
+int_tstfmon_y01y10 %13i -123.45 " -USC123.45"
+int_tstfmon_y01y10 %^=*#5i 123.45 "USC **123.45"
+int_tstfmon_y01y10 %^=*#5i -123.45 "-USC**123.45"
+#
+int_tstfmon_y02n22 %i 123.45 "USC123.45"
+int_tstfmon_y02n22 %i -123.45 "123.45USC O/D"
+int_tstfmon_y02n22 %12i 123.45 " USC123.45"
+int_tstfmon_y02n22 %12i -123.45 "123.45USC O/D"
+int_tstfmon_y02n22 %^=*#5i 123.45 "USC**123.45"
+int_tstfmon_y02n22 %^=*#5i -123.45 " **123.45USC O/D"
+#
+int_tstfmon_y22n42 %i 123.45 "USC123.45+"
+int_tstfmon_y22n42 %i -123.45 "123.45USC -"
+int_tstfmon_y22n42 %13i 123.45 " USC123.45+"
+int_tstfmon_y22n42 %13i -123.45 " 123.45USC -"
+int_tstfmon_y22n42 %^=*#5i 123.45 "USC**123.45+"
+int_tstfmon_y22n42 %^=*#5i -123.45 " **123.45USC -"
+#
+int_tstfmon_y30y21 %i 123.45 "+USC123.45"
+int_tstfmon_y30y21 %i -123.45 "USC 123.45-"
+int_tstfmon_y30y21 %13i 123.45 " +USC123.45"
+int_tstfmon_y30y21 %13i -123.45 " USC 123.45-"
+int_tstfmon_y30y21 %^=*#5i 123.45 "+USC**123.45"
+int_tstfmon_y30y21 %^=*#5i -123.45 "USC **123.45-"
+#
+int_tstfmon_y32n31 %i 123.45 "+ USC123.45"
+int_tstfmon_y32n31 %i -123.45 "123.45 -USC"
+int_tstfmon_y32n31 %13i 123.45 " + USC123.45"
+int_tstfmon_y32n31 %13i -123.45 " 123.45 -USC"
+int_tstfmon_y32n31 %^=*#5i 123.45 "+ USC**123.45"
+int_tstfmon_y32n31 %^=*#5i -123.45 " **123.45 -USC"
+#
+int_tstfmon_y40y00 %i 123.45 "USC+123.45"
+int_tstfmon_y40y00 %i -123.45 "(USC123.45)"
+int_tstfmon_y40y00 %13i 123.45 " USC+123.45"
+int_tstfmon_y40y00 %13i -123.45 " (USC123.45)"
+int_tstfmon_y40y00 %^=*#5i 123.45 "USC+**123.45"
+int_tstfmon_y40y00 %^=*#5i -123.45 "(USC**123.45)"
+#
+int_tstfmon_y42n21 %i 123.45 "USC +123.45"
+int_tstfmon_y42n21 %i -123.45 "123.45 USC-"
+int_tstfmon_y42n21 %13i 123.45 " USC +123.45"
+int_tstfmon_y42n21 %13i -123.45 " 123.45 USC-"
+int_tstfmon_y42n21 %^=*#5i 123.45 "USC +**123.45"
+int_tstfmon_y42n21 %^=*#5i -123.45 " **123.45 USC-"
More information about the Libc-alpha
mailing list