diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2017-05-22 09:13:33 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2017-05-22 09:13:33 +0000 |
commit | 715eed074a8dc2f33ef09816189f56536a07736a (patch) | |
tree | 4ffcb5a0859f27c15e4af7887d95ab896a6ed2af | |
parent | 188e16e75eeb00f8e09825257565f400e940b5ef (diff) | |
download | mpfr-715eed074a8dc2f33ef09816189f56536a07736a.tar.gz |
[tests/tsprintf.c] Do more tests in the da_DK locale (these are the
only tests for which the thousands separator is not empty).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@11512 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | tests/tsprintf.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/tests/tsprintf.c b/tests/tsprintf.c index 76892f4b0..17d5a43fe 100644 --- a/tests/tsprintf.c +++ b/tests/tsprintf.c @@ -900,13 +900,24 @@ locale_da_DK (void) check_sprintf (" 000000018.993.474,61279296875", "%' 030.19RG", x); check_sprintf (" 00000000000018.993.474,612793", "%' 030RF", x); - mpfr_set_ui (x, 50, MPFR_RNDN); +#define T1 "000" +#define T2 ".000" +#define S1 T1 T1 T1 T1 T1 T1 T1 T1 T1 T1 T1 T1 T1 T1 T1 T1 +#define S2 T2 T2 T2 T2 T2 T2 T2 T2 T2 T2 T2 T2 T2 T2 T2 T2 "," + + mpfr_set_ui (x, 48, MPFR_RNDN); mpfr_exp10 (x, x, MPFR_RNDN); - check_sprintf ("100000000000000000000000000000000000000000000000000", "%.0Rf", - x); -#define S "100.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000," - check_sprintf (S, "%'#.0Rf", x); - check_sprintf (S "0000", "%'.4Rf", x); + check_sprintf ("1" S1, "%.0Rf", x); + check_sprintf ("1" S2, "%'#.0Rf", x); + check_sprintf ("1" S2 "0000", "%'.4Rf", x); + mpfr_mul_ui (x, x, 10, MPFR_RNDN); + check_sprintf ("10" S1, "%.0Rf", x); + check_sprintf ("10" S2, "%'#.0Rf", x); + check_sprintf ("10" S2 "0000", "%'.4Rf", x); + mpfr_mul_ui (x, x, 10, MPFR_RNDN); + check_sprintf ("100" S1, "%.0Rf", x); + check_sprintf ("100" S2, "%'#.0Rf", x); + check_sprintf ("100" S2 "0000", "%'.4Rf", x); mpfr_clear (x); return 0; |