diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2017-12-01 15:04:21 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2017-12-01 15:04:21 +0000 |
commit | 8651d829f8522f9cf8c0619fce152ef3c4eeddf8 (patch) | |
tree | dfea7447b7b64c92ca33767e944459d9386cfc5e /tests/tests.c | |
parent | 1172c68375c186209def8b8ba46238c16293ecb0 (diff) | |
download | mpfr-8651d829f8522f9cf8c0619fce152ef3c4eeddf8.tar.gz |
Solved an output issue on AIX due to the use of setbuf() after output
in tversion. Indeed, this is disallowed by ISO C.
* doc/README.dev: added a note about tests_start_mpfr and this issue.
* tests/tests.c: moved test_version() after setbuf().
* tests/tversion.c: moved tests_start_mpfr() earlier, before any
printf().
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@11877 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tests.c')
-rw-r--r-- | tests/tests.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/tests.c b/tests/tests.c index 766e576b1..3b9d32922 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -137,7 +137,8 @@ void (*dummy_func)(mpfr_srcptr) = mpfr_dump; of "make check") but a different library that is already installed, i.e. any test result would be meaningless; in such a case, we exit immediately with an error (exit status = 1). - Return value: 0 for no errors, 1 in case of any non-fatal error. */ + Return value: 0 for no errors, 1 in case of any non-fatal error. + Note: If the return value is 0, no data must be sent to stdout. */ int test_version (void) { @@ -248,11 +249,13 @@ test_version (void) void tests_start_mpfr (void) { - test_version (); - - /* don't buffer, so output is not lost if a test causes a segv etc */ + /* Don't buffer, so output is not lost if a test causes a segv, etc. + Warning! No operations must have already been done on stdout + (this is a requirement of ISO C, and this is important on AIX). */ setbuf (stdout, NULL); + test_version (); + #if defined HAVE_LOCALE_H && defined HAVE_SETLOCALE /* Added on 2005-07-09. This allows to test MPFR under various locales. New bugs will probably be found, in particular with |