summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-07-30 16:31:52 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-07-30 16:31:52 +0000
commit4303541d803b586a96813152c926e83b425d4557 (patch)
tree19b498f956277ecfb67791fa8542858e368570f6
parent61419a00613066a02ee1dee8649e12dcc2f62466 (diff)
downloadmpfr-4303541d803b586a96813152c926e83b425d4557.tar.gz
[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
-rw-r--r--tests/tversion.c18
1 files changed, 17 insertions, 1 deletions
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 <errno.h>
+
#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;