summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* [tests/tests.c] In a comment with a GMP_CHECK_RANDOMIZE value, mentionvlefevre2021-09-071-1/+2
| | | | | | | the SVN revision and date, as this value may no longer be valid in the future (when tests are added or changed). git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14574 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tests.c] Fixed bad_cases when y is ±0 (rare case).vlefevre2021-09-071-6/+27
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14570 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tget_set_d128.c] Removed a useless C99 comment, which makesvlefevre2021-08-231-1/+0
| | | | | | | the MPFR build fail with "i686-w64-mingw32-gcc -std=c89" (e.g. via ./configure --host=i686-w64-mingw32, and -std=c89 in CFLAGS). git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14567 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsprintf.c] In locale_da_DK(), also try da_DK.utf8 (preferably):vlefevre2021-08-231-4/+7
| | | | | | in Debian/unstable, da_DK no longer exists. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14566 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tget_flt.c] Avoid a warning about unused function equal_fltvlefevre2021-08-031-0/+2
| | | | | | when HAVE_SUBNORM_FLT is not defined. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14558 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tget_flt.c] Code style: replaced "… == 0" by "! …" onvlefevre2021-08-031-5/+5
| | | | | | the Boolean _p functions. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14557 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tget_flt.c] Removed bug_icx (duplicate test).vlefevre2021-08-031-22/+0
| | | | | | | | | | What was tested was just mpfr_get_flt on a NaN mpfr_t. But this was already tested in main(). And one gets the same result and error with icx (without -fp-model=strict). Moreover, the old test was correctly protected by "#if !defined(MPFR_ERRDIVZERO)", needed because NaN is defined by 0.0 / 0.0. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14556 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tget_flt.c] In bug_icx: replaced mpfr_set_flt, whose floatvlefevre2021-08-031-5/+1
| | | | | | | argument was yielding an underflow (not portable), by mpfr_set_si_2exp (it is mpfr_get_flt that is tested, not mpfr_set_flt). git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14555 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tget_flt.c] Added FIXME for test added in r14552.vlefevre2021-08-031-0/+2
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14554 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tget_flt.c] Portability correction.vlefevre2021-08-031-3/+5
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14553 280ebfd0-de03-0410-8827-d642c229c3f4
* need -fp-model=strict for icxzimmerma2021-08-031-0/+22
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14552 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tprintf.c] Portability correction (EOF is not necessarily -1).vlefevre2021-06-301-2/+2
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14544 280ebfd0-de03-0410-8827-d642c229c3f4
* Punctuation (missing comma after "however").vlefevre2021-06-211-1/+1
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14542 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tget_d.c] Improved error messages.vlefevre2021-06-031-12/+17
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14537 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tget_d.c] Error message when check_inf_nan() fails for NaN.vlefevre2021-06-031-1/+5
| | | | | | | | Note: With "icx -O2" (at least), 8 tests are now failing with Intel(R) oneAPI DPC++ Compiler 2021.2.0 (2021.2.0.20210317). But no failures when the compiler is invoked as "clang". git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14536 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/data/j1] added more testszimmerma2021-06-011-0/+54
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14532 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tests.c] fixed bug introduced in r13787, which invalidated data_checkzimmerma2021-06-011-1/+1
| | | | | | | in some cases git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14531 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsprintf.c] Cosmetic revert of blank line removal in r14519.vlefevre2021-05-171-0/+1
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14527 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsprintf.c] Similarly to r14514, added tests of native integer 0vlefevre2021-05-171-0/+4
| | | | | | with precision field 0 (also yields a call to buffer_cat with len = 0). git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14520 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsprintf.c] For various test functions, changed the return typevlefevre2021-05-171-14/+8
| | | | | | from int to void (when the value is never used). git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14519 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsprintf.c] Added tests of specifier 'P' with precision field 0.vlefevre2021-05-121-3/+10
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14514 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tstrtofr.c] Check more infinity strings.vlefevre2021-04-261-7/+52
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14506 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tpowr.c] Added generic tests.vlefevre2021-04-241-0/+7
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14504 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsgn.c] Also test in a very reduced exponent range.vlefevre2021-04-231-15/+32
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14498 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tsgn.c] Also test the flags.vlefevre2021-04-231-25/+45
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14497 280ebfd0-de03-0410-8827-d642c229c3f4
* Fixed bug in mpfr_get_str_ndigits.vlefevre2021-04-231-17/+44
| | | | | | | | | | | | * src/get_str.c: use MPFR_SAVE_EXPO_MARK / MPFR_SAVE_EXPO_FREE to fix 2 issues in mpfr_get_str_ndigits: the inexact flag could be raised (bug reported by Pierre Chatelier[*]); undefined behavior in a very reduced exponent range. * tests/tget_str.c: check the above issues in the tests. [*] https://sympa.inria.fr/sympa/arc/mpfr/2021-04/msg00000.html git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14488 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/thypot.c] added one testzimmerma2021-04-021-0/+29
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14485 280ebfd0-de03-0410-8827-d642c229c3f4
* Get rid of obsolescent AC_HEADER_TIME. Cleanup about sys/time.h usage.vlefevre2021-03-181-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | The AC_HEADER_TIME macro is obsolescent in autoconf 2.69 (2012), and autoconf 2.71 (2021) outputs a warning, which makes autogen.sh fail due to "--warnings=all,error", so let's avoid the warnings. This macro defines TIME_WITH_SYS_TIME, used only in tests/tests.c (but actually not needed). We actually have two cases: 1. HAVE_GETTIMEOFDAY is defined: we use gettimeofday(), which needs <sys/time.h>. 2. Otherwise: we use time(), which needs <time.h>. Based on that, we can simplify the condition in tests/tests.c for the inclusion of time-related headers, and we no longer need to check the <sys/time.h> availability. If gettimeofday() is defined but <sys/time.h> is not available (which shouldn't occur), then the current gettimeofday() usage may be incorrect anyway. Changes: * acinclude.m4: - no longer use AC_HEADER_TIME; - no longer check the sys/time.h header. * tests/tests.c: simplify the inclusion of time-related headers. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14479 280ebfd0-de03-0410-8827-d642c229c3f4
* Replaced "intensional" by "intentional" in comments.vlefevre2021-03-163-3/+3
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14477 280ebfd0-de03-0410-8827-d642c229c3f4
* Untabify and remove trailing spaces.vlefevre2021-03-164-9/+9
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14476 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/rec_sqrt.c] replace a call to mpn_mul_n with identical arguments byzimmerma2021-03-166-8/+16
| | | | | | | | a call to mpn_sqr + similar changes in other files (thanks Fredrik Johansson) git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14475 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/trec_sqrt.c] added timing testzimmerma2021-03-161-1/+55
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14474 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/{tset_si.c,tset_sj.c}] Fix when -DMPFR_USE_NO_MACRO is used.vlefevre2021-03-082-12/+16
| | | | | | | | | | | | | | | The mpfr_get_exp() function checks that the argument is a regular number, but the corresponding macro doesn't. The test code was calling mpfr_get_exp() on 0, thus failed with MPFR_USE_NO_MACRO defined. Here, the code was correct with the macro, because the value was not used for the particular case 0. This is fixed by testing 0 earlier (and doing a goto, but the code has fewer tests and should be simpler to understand). Moreover, mpfr_get_exp has been replaced by MPFR_GET_EXP, so that the argument is checked with --enable-assert. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14464 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/{texceptions.c,tset_exp.c}] Forgot to protect the tests withvlefevre2021-03-082-3/+24
| | | | | | casts to "void *", invalid in C++ (completing r14460 and r14461). git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14463 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests] Ignore GCC's -Wc++-compat in the tests that are invalid in C++vlefevre2021-03-084-0/+50
| | | | | | (these tests are enabled only if __cplusplus is not defined). git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14461 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests] In C++, do not cast to "void *" in the tests of macros.vlefevre2021-03-064-9/+15
| | | | | | | | | | | These casts make the build of these tests fail with a C++ compiler. But this means that the use of macros will not introduce any issue concerning the type of the arguments, i.e. with a C++ compiler, the tests are still complete after this change. However, GCC's -Werror=c++-compat still cannot be used. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14460 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tset.c] Added tests of the mpfr_set macro.vlefevre2021-03-061-22/+32
| | | | | | | | Without MPFR_USE_NO_MACRO, the compilation currently fails because the second argument is not converted to mpfr_srcptr when MPFR_SIGN is applied. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14458 280ebfd0-de03-0410-8827-d642c229c3f4
* Added tests of mpfr_copysign, mpfr_setsign and mpfr_signbit macros.vlefevre2021-03-061-6/+23
| | | | | | | Without MPFR_USE_NO_MACRO, the compilation of these tests in tcopysign.c currently fails because some arguments are not converted to mpfr_srcptr. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14456 280ebfd0-de03-0410-8827-d642c229c3f4
* Added tests of mpfr_get_prec and mpfr_get_exp macros.vlefevre2021-03-062-1/+8
| | | | | | | | Without MPFR_USE_NO_MACRO, the compilation of these tests in texceptions.c and tset_exp.c currently fails because the argument is not converted to mpfr_srcptr. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14453 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tisnan.c] Added commented code for testing compilation errors.vlefevre2021-03-061-0/+10
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14450 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tisnan.c] Check that when mpfr_nan_p, mpfr_inf_p, mpfr_number_p,vlefevre2021-03-061-30/+66
| | | | | | | mpfr_zero_p and mpfr_regular_p is implemented as a macro, it behaves like a function. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14448 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/mpfr-test.h] Added mpfr_cmp_si_2exp0 macro (check NaN).vlefevre2021-02-152-3/+5
| | | | | | [tests/tj1.c] Replaced mpfr_cmp_si_2exp by mpfr_cmp_si_2exp0. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14434 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tdigamma.c] Use mpfr_cmp_ui0 to detect NaN.vlefevre2021-02-151-1/+1
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14433 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/jyn_asympt.c] fixed bug when s=0 at the end of the for loopzimmerma2021-02-151-0/+22
| | | | | | | [tests/tj1.c] added corresponding non-regression test git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14431 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/digamma.c] fixed a bug in mpfr_digamma_reflection when the approximationszimmerma2021-02-151-0/+21
| | | | | | | | of Digamma(1-x) and Pi*cot(Pi*x) cancel exactly [tests/tdigamma.c] added corresponding non-regression test git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14430 280ebfd0-de03-0410-8827-d642c229c3f4
* renamed mpfr_compound to mpfr_compound_si, since in C2X, compoundn takeszimmerma2021-02-151-17/+17
| | | | | | | | an intmax_t and not a long, thus we can later implement mpfr_compoundn taking as input an intmax_t git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14429 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/texpm1.c] Improved special tests.vlefevre2021-02-101-24/+30
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14423 280ebfd0-de03-0410-8827-d642c229c3f4
* [tests/tpow.c] Replaced mpfr_cmp_ui by versions that can detect NaN.vlefevre2021-02-091-23/+23
| | | | | | | Note: this is particularly important to check that pow(NaN,0) returns 1, not NaN. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14417 280ebfd0-de03-0410-8827-d642c229c3f4
* added mpfr_powrzimmerma2021-02-092-1/+212
| | | | git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14414 280ebfd0-de03-0410-8827-d642c229c3f4
* added mpfr_pow_uj and mpfr_pow_sjzimmerma2021-02-091-0/+3
| | | | | | | now mpfr_pown is an alias for mpfr_pow_sj git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14412 280ebfd0-de03-0410-8827-d642c229c3f4