From 4303541d803b586a96813152c926e83b425d4557 Mon Sep 17 00:00:00 2001 From: vlefevre Date: Mon, 30 Jul 2018 16:31:52 +0000 Subject: [tests/tversion.c] Try to detect missing output from the first printf with i586-mingw32msvc-gcc -D__USE_MINGW_ANSI_STDIO and run under Wine. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/4.0@12968 280ebfd0-de03-0410-8827-d642c229c3f4 --- tests/tversion.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/tversion.c b/tests/tversion.c index 01f755c79..8f6c072e7 100644 --- a/tests/tversion.c +++ b/tests/tversion.c @@ -25,6 +25,8 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., # include "config.h" #endif +#include + #include "mpfr-intmax.h" #include "mpfr-test.h" @@ -40,9 +42,17 @@ main (void) tests_start_mpfr (); + errno = 0; + /*********************** MPFR version and patches ************************/ - printf ("[tversion] MPFR %s\n", MPFR_VERSION_STRING); + /* With i586-mingw32msvc-gcc -D__USE_MINGW_ANSI_STDIO and run under Wine, + the following line is not output. Let's try to detect the error. */ + if (printf ("[tversion] MPFR %s\n", MPFR_VERSION_STRING) < 0) + { + perror ("tversion (first printf)"); + err = 1; + } if (strcmp (mpfr_get_patches (), "") != 0) printf ("[tversion] MPFR patches: %s\n", mpfr_get_patches ()); @@ -409,6 +419,12 @@ main (void) /*************************************************************************/ + if (errno != 0) + { + perror ("tversion"); + err = 1; + } + tests_end_mpfr (); return err; -- cgit v1.2.1