summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* [tests/memory.c] Call "fflush (NULL)" before abort() in order to flushvlefevre2021-01-141-0/+10
| | | | | | | | | | | all the output streams, in particular the log file (when there is one), so that setting MPFR_LOG_FLUSH (which may be inefficient) is not needed to debug tests that end with a memory error. This fixes a regression with glibc 2.27+: the streams are no longer flushed by abort(), as permitted by POSIX; see the abort(3) man page. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14258 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tcosu.c] Added tests that give a reduced argument equal to 0.vlefevre2021-01-141-0/+12
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14254 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tcosu.c] increase nmax in test_generic callzimmerma2021-01-143-3/+3
| | | | | | | | [tests/tsinu.c] likewise [tests/ttanu.c] likewise git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14252 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/{tcosu.c,tsinu.c,ttanu.c}] For the generic tests, no needvlefevre2021-01-133-24/+0
| | | | | | | to reduce emax any longer, now that the fast range reduction has been implemented. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14251 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsinu.c] Added tests where x/u is a "big" integer, so thatvlefevre2021-01-131-0/+12
| | | | | | the reduced argument is 0 (exactly). git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14241 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsinu.c] Added a test on a large input such that x mod u may needvlefevre2021-01-131-1/+9
| | | | | | more precision than x. This will be important to test range reduction. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14240 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/{tcosu.c,tsinu.c,ttanu.c}] C90 compatibility for the tests withvlefevre2021-01-123-74/+74
| | | | | | | large inputs (added in r14236). Also avoid the hardcoded size by using the numberof() macro. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14237 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tcosu.c] added hard-coded tests with large inputszimmerma2021-01-123-0/+127
| | | | | | | | [tests/tsinu.c] likewise [tests/ttanu.c] likewise git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14236 280ebfd0-de03-0410-8827-d642c229c3f4
* Copyright notice update: added 2021 withvlefevre2021-01-03198-198/+198
| | | | | | | | perl -pi -e 's/ (\d{4}-)?(2020)(?= Free Software)/ " ".($1||"$2-").($2+1)/e' **/*(^/) under zsh. Removed 2020 from the example in the doc/README.dev file. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14229 280ebfd0-de03-0410-8827-d642c229c3f4
* Optimize mpfr_abs, mpfr_copysign and mpfr_setsign in the case of reusedvlefevre2020-12-201-7/+22
| | | | | | | | argument, like what was already done for mpfr_neg: one can just set the sign and handle NaN instead of calling mpfr_set4. Completed tests/tcopysign.c to test with a reused argument. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14227 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tgeneric.c] Removed the use of __func__ as it is not supportedvlefevre2020-12-171-2/+1
| | | | | | by ISO C90 (it was not really useful here, though). git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14224 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tcosu.c] Increased the maximum precision for test_generic andvlefevre2020-12-171-1/+5
| | | | | | added a comment about this. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14223 280ebfd0-de03-0410-8827-d642c229c3f4
* For the generic tests, output the number of normal cases and the totalvlefevre2020-12-171-0/+4
| | | | | | | if the MPFR_TGENERIC_STAT environment variable is defined. Added description to the README.dev file. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14221 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tcosu.c] Increased the number of generic tests. This should makevlefevre2020-12-171-1/+1
| | | | | | the warning "Too few normal cases in generic tests" much less common. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14220 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests]vlefevre2020-12-172-0/+443
| | | | | | | | * Added data/tan2pi: hardest-to-round cases of tanu with u = 1 in double precision, interval [0,1/4]. * ttanu.c: test tan2pi values with u = 1. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14219 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/ttanu.c] C89 compatibility.vlefevre2020-12-171-2/+2
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14218 280ebfd0-de03-0410-8827-d642c229c3f4
* added new function mpfr_tanuzimmerma2020-12-162-1/+219
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14210 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/sinu.c] fixed compiler warningzimmerma2020-12-151-0/+20
| | | | | | | | [src/cosu.c] deal with other exact cases [tests/tcosu.c] added tests for other exact cases git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14207 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsinu.c] added more testszimmerma2020-12-151-0/+15
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14204 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/sinu.c] fixed case where 2xpi/u is +/-pi/6 mod pizimmerma2020-12-151-0/+5
| | | | | | | [tests/tsinu.c] added corresponding test case git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14203 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests]vlefevre2020-12-154-0/+840
| | | | | | | | * Added data/{cos2pi,sin2pi}: hardest-to-round cases of cosu and sinu with u = 1 in double precision, interval [0,1/2]. * tcosu.c, tsinu.c: test cos2pi and sin2pi values with u = 1. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14202 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tests.c] test5rm(): mention test5rm in the error message.vlefevre2020-12-151-1/+2
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14201 280ebfd0-de03-0410-8827-d642c229c3f4
* added new function mpfr_cosuzimmerma2020-12-152-7/+181
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14199 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsinu.c] fixed typos in commentszimmerma2020-12-151-8/+8
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14197 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsinu.c] Added a FIXME concerning the size of the exponent.vlefevre2020-12-141-3/+6
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14186 280ebfd0-de03-0410-8827-d642c229c3f4
* added mpfr_sinu (work in progress)zimmerma2020-12-142-1/+172
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14181 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/talloc-cache.c] Check that malloc() doesn't return a null pointervlefevre2020-10-281-0/+4
| | | | | | (in order to avoid an error with GCC's -fanalyzer, dev version). git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14173 280ebfd0-de03-0410-8827-d642c229c3f4
* Fixed the formatted output functions (mpfr_printf, etc.) in the casevlefevre2020-10-071-5/+8
| | | | | | | | | | the precision consists only of a period. * doc/mpfr.texi: correction and clarifications (be closer to ISO C); note the change in Section "API Compatibility". * src/vasprintf.c: fixed the bug. * tests/tsprintf.c: update. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14155 280ebfd0-de03-0410-8827-d642c229c3f4
* Added tests/gen-printf-dot-prec Perl script to generate a .c filevlefevre2020-10-071-0/+103
| | | | | | | | | showing printf and mpfr_printf output with: * a missing precision field; * a precision field with just a period ("."); * a precision field with an explicit precision 0 (".0"). git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14152 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tset_z_2exp.c] Fixed typo detected by GCC.vlefevre2020-09-271-1/+1
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14150 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tset_z_2exp.c] Added some tests in a reduced exponent range.vlefevre2020-09-271-25/+68
| | | | | | | | | Note: Due to an incorrect change in set_z_2exp.c r14145, various tests are failing with mini-gmp (for which mpfr_set_z_2exp is used more often because a long does not fit into a limb) in unusual exponent ranges. So such tests were obviously missing in tset_z_2exp.c before this commit. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14148 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tset_z_2exp.c] Test a result.vlefevre2020-09-251-0/+8
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14144 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tset_z_2exp.c] Added another test that fails with justvlefevre2020-09-241-3/+27
| | | | | | | | "-m32 -fsanitize=undefined -fno-sanitize-recover". This corresponds to what is described in the FIXME in src/set_z_2exp.c (about the modified tnrandom.c test yielding an integer overflow). git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14141 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tset_z_2exp.c] Added a test that triggers an integer overflowvlefevre2020-09-241-0/+27
| | | | | | | | | | in set_z_2exp.c with MPFR_CHECK_LARGEMEM=1 when MPFR is compiled with "-m32 -fsanitize=undefined -fno-sanitize-recover -D_MPFR_EXP_FORMAT=4" in CFLAGS: set_z_2exp.c:71:26: runtime error: signed integer overflow: 134217726 * 32 cannot be represented in type 'long int' git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14140 280ebfd0-de03-0410-8827-d642c229c3f4
* For consistency, changed "C89" to "C90" in comments of *.{c,h} files.vlefevre2020-09-162-9/+9
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14130 280ebfd0-de03-0410-8827-d642c229c3f4
* Renamed some .c files for consistency:vlefevre2020-09-152-1/+1
| | | | | | | | | src/get_z_exp.c → src/get_z_2exp.c src/set_z_exp.c → src/set_z_2exp.c tests/tset_z_exp.c → tests/tset_z_2exp.c and updated src/Makefile.am and tests/Makefile.am files. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14125 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tests.c] Added a note about tests done in "src/init2.c".vlefevre2020-09-151-0/+7
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14122 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tget_z.c] Updated comment to mention that mpfr_get_z_2exp isvlefevre2020-09-151-1/+1
| | | | | | tested by this file. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14120 280ebfd0-de03-0410-8827-d642c229c3f4
* Updated URLs.vlefevre2020-09-102-4/+4
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@14110 280ebfd0-de03-0410-8827-d642c229c3f4
* [src,tests] Consistency: in prototypes, changedvlefevre2020-08-2114-23/+23
| | | | | | | | | const mpfr_t to mpfr_srcptr mpfr_t to mpfr_ptr (except for mpfr_t *), as this is equivalent (the array is converted to a pointer) and the mpfr_srcptr/mpfr_ptr form is the usual one. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@14103 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsprintf.c] Replaced another occurrence of the code triggeringvlefevre2020-08-201-1/+1
| | | | | | | the warning "adding 'int' to a string does not append to the string [-Wstring-plus-int]" with Clang (at least with 3.5 and above). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@14100 280ebfd0-de03-0410-8827-d642c229c3f4
* fixed a compiler warning found by Clang 10.0.1 on armv8-a (Samsung S8zimmerma2020-08-201-1/+1
| | | | | | | | | | | aarch64-unknown-linux-android): tsprintf.c:1613:27: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int] strcat (buf, ",0" + (j % 3 != 0)); ~~~~~^~~~~~~~~~~~~~ git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@14099 280ebfd0-de03-0410-8827-d642c229c3f4
* fixed a compiler warning found by Clang 10.0.1 on armv8-a (Samsung S8zimmerma2020-08-201-1/+1
| | | | | | | | | | | | | | aarch64-unknown-linux-android): ./tgeneric.c:208:40: warning: implicit conversion from 'mp_limb_t' (aka 'unsigned long') to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Wimplicit-int-float-conversion] (double) randlimb () / MPFR_LIMB_MAX; ~ ^~~~~~~~~~~~~ ../src/mpfr-impl.h:1277:28: note: expanded from macro 'MPFR_LIMB_MAX' #define MPFR_LIMB_MAX ((mp_limb_t) -1) ^~~~~~~~~~~~~~ git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@14098 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tset_ld.c] Improved an error message.vlefevre2020-07-151-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@14083 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tests.c] Simplified the d_trace and ld_trace functions:vlefevre2020-07-131-16/+10
| | | | | | | we do not need a union (with its potentional padding) as there are no aliasing issues with unsigned char. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@14082 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tset_ld.c] Fixed mpfr_out_str usage in error messagesvlefevre2020-07-131-6/+7
| | | | | | (see the change in r12520). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@14081 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tget_ld_2exp.c] Corrected a function call in an error message.vlefevre2020-07-131-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@14080 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tversion.c] "Compiler:" line: detect TCC (__TINYC__ macro).vlefevre2020-07-131-0/+7
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@14078 280ebfd0-de03-0410-8827-d642c229c3f4
* [doc/README.dev] In the MPFR_CHECK_EXPENSIVE description, say thatvlefevre2020-07-101-0/+2
| | | | | | | | --enable-assert=full should not be used (too expensive, not needed). [tests/tjn.c] Added a related comment for the expensive bug20200703 test (which may take more than 1 hour with --enable-assert=full). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@14060 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tjn.c] Corrected indentation.vlefevre2020-07-101-2/+2
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@14059 280ebfd0-de03-0410-8827-d642c229c3f4