summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2017-05-22 08:56:55 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2017-05-22 08:56:55 +0000
commit188e16e75eeb00f8e09825257565f400e940b5ef (patch)
treee1b7bd25564b740fda1bd926dd3868ca9d1c32f7
parent376588411219c0b6fe7bf1777c4a190b03557234 (diff)
downloadmpfr-188e16e75eeb00f8e09825257565f400e940b5ef.tar.gz
[tests/tsprintf.c] Do more tests involving check_sprintf() in a loop
(to test mpfr_snprintf with size = 0 more often), and call mixed() later in order to get failures without the use of %n first. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@11511 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--tests/tsprintf.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/tests/tsprintf.c b/tests/tsprintf.c
index c8189b430..76892f4b0 100644
--- a/tests/tsprintf.c
+++ b/tests/tsprintf.c
@@ -877,7 +877,6 @@ locale_da_DK (void)
{
mpfr_prec_t p = 128;
mpfr_t x;
- int k;
if (setlocale (LC_ALL, "da_DK") == 0 ||
localeconv()->decimal_point[0] != ',' ||
@@ -905,12 +904,9 @@ locale_da_DK (void)
mpfr_exp10 (x, x, MPFR_RNDN);
check_sprintf ("100000000000000000000000000000000000000000000000000", "%.0Rf",
x);
- for (k = 0; k < 40; k++)
- {
#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 (S, "%'#.0Rf", x);
+ check_sprintf (S "0000", "%'.4Rf", x);
mpfr_clear (x);
return 0;
@@ -1391,6 +1387,7 @@ int
main (int argc, char **argv)
{
char *locale;
+ int k;
tests_start_mpfr ();
@@ -1400,24 +1397,30 @@ main (int argc, char **argv)
#endif
bug20111102 ();
- native_types ();
- hexadecimal ();
- binary ();
- decimal ();
- mixed ();
- check_emax ();
- check_emin ();
- test20161214 ();
- bug21056 ();
- snprintf_size ();
+
+ for (k = 0; k < 40; k++)
+ {
+ native_types ();
+ hexadecimal ();
+ binary ();
+ decimal ();
#if defined(HAVE_LOCALE_H) && defined(HAVE_SETLOCALE)
#if MPFR_LCONV_DPTS
- locale_da_DK ();
+ locale_da_DK ();
/* Avoid a warning by doing the setlocale outside of this #if */
#endif
- setlocale (LC_ALL, locale);
+ setlocale (LC_ALL, locale);
#endif
+ }
+
+ check_emax ();
+ check_emin ();
+ test20161214 ();
+ bug21056 ();
+ snprintf_size ();
+
+ mixed ();
if (getenv ("MPFR_CHECK_LIBC_PRINTF"))
{