int main (int argc, char *argv[]) { schro_init(); check_output (SCHRO_WAVELET_DAUBECHIES_9_7, 1); check_output (SCHRO_WAVELET_DAUBECHIES_9_7, 0); check_output (SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7, 1); check_output (SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7, 0); check_output (SCHRO_WAVELET_LE_GALL_5_3, 1); check_output (SCHRO_WAVELET_LE_GALL_5_3, 0); check_output (SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7, 1); check_output (SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7, 0); check_endpoints (SCHRO_WAVELET_DAUBECHIES_9_7, 1); check_endpoints (SCHRO_WAVELET_DAUBECHIES_9_7, 0); check_endpoints (SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7, 1); check_endpoints (SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7, 0); check_endpoints (SCHRO_WAVELET_LE_GALL_5_3, 1); check_endpoints (SCHRO_WAVELET_LE_GALL_5_3, 0); check_endpoints (SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7, 1); check_endpoints (SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7, 0); check_constant (SCHRO_WAVELET_DAUBECHIES_9_7); check_constant (SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7); check_constant (SCHRO_WAVELET_LE_GALL_5_3); check_constant (SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7); check_random (SCHRO_WAVELET_DAUBECHIES_9_7); check_random (SCHRO_WAVELET_DESLAURIERS_DUBUC_9_7); check_random (SCHRO_WAVELET_LE_GALL_5_3); check_random (SCHRO_WAVELET_DESLAURIERS_DUBUC_13_7); return 0; }
int main (int argc, char **argv) { tests_start (); check_random (argc, argv); tests_end (); exit (0); }
int main (void) { tests_start (); check_mem (); check_random (); tests_end (); exit (0); }
int main (void) { tests_start (); check_onebit (); check_data (); check_random (); tests_end (); exit (0); }
int main (int argc, char *argv[]) { tests_start (); check_tstbit (); check_random (argc, argv); check_single (); tests_end (); exit (0); }
int main (void) { tests_start (); mp_trace_base = -16; check_data (); check_random (); tests_end (); exit (0); }
int main (int argc, char *argv[]) { int N; tests_start_mpfr (); /* with no argument: prints to /dev/null, tprintf N: prints N tests to stdout */ if (argc == 1) { N = 1000; stdout_redirect = 1; if (freopen ("/dev/null", "w", stdout) == NULL) { /* We failed to open this device, try with a dummy file */ if (freopen ("mpfrtest.txt", "w", stdout) == NULL) { /* Output the error message to stderr since it is not a message about a wrong result in MPFR. Anyway the stdandard output may have changed. */ fprintf (stderr, "Can't open /dev/null or a temporary file\n"); exit (1); } } } else { stdout_redirect = 0; N = atoi (argv[1]); } check_invalid_format (); check_special (); check_mixed (); /* expensive tests */ if (getenv ("MPFR_CHECK_LARGEMEM") != NULL) check_long_string(); check_random (N); test_locale (); if (stdout_redirect) { if ((fflush (stdout) == EOF) || (fclose (stdout) == -1)) perror ("main"); } tests_end_mpfr (); return 0; }
int main (int argc, char *argv[]) { tests_start (); mp_trace_base = -16; check_data (); check_data_inplace_ui (); check_random (argc, argv); tests_end (); exit (0); }
int main (void) { mpfr_prec_t p; tests_start_mpfr (); check_special (); for (p = 2 ; p < 200 ; p++) check_random (p); tests_end_mpfr (); return 0; }
int main (int argc, char *argv[]) { tests_start (); mp_trace_base = -16; check_clr_extend (); check_com_negs (); check_tstbit (); check_random (argc, argv); check_single (); tests_end (); exit (0); }
int main (int argc, char **argv) { struct mpfi_function_t i_atanh; mpfi_fun_init_II (&i_atanh, mpfi_atanh, mpfr_atanh); test_start (); check_data (&i_atanh, "atanh.dat"); check_random (&i_atanh, 2, 1000, 10); test_end (); mpfi_fun_clear (&i_atanh); return 0; }
int main (int argc, char *argv[]) { int reps = 100; tests_start (); if (argc == 2) reps = atoi (argv[1]); check_data (); check_random (reps); tests_end (); exit (0); }
int main (int argc, char *argv[]) { long reps = 10000; if (argc == 2) reps = strtol (argv[1], 0, 0); tests_start (); check_data (); check_random (reps); tests_end (); exit (0); }
int main (int argc, char **argv) { struct mpfi_function_t i_mul_z; mpfi_fun_init_IIZ (&i_mul_z, mpfi_mul_z, mpfr_mul_z); test_start (); check_data (&i_mul_z, "mul_z.dat"); check_random (&i_mul_z, 2, 1000, 10); check_overflow (); test_end (); mpfi_fun_clear (&i_mul_z); return 0; }
int main (int argc, char **argv) { struct mpfi_function_t i_hypot; mpfi_fun_init_III (&i_hypot, mpfi_hypot, mpfr_hypot); test_start (); check_data (&i_hypot, "hypot.dat"); check_random (&i_hypot, 2, 1000, 10); test_end (); mpfi_fun_clear (&i_hypot); return 0; }
int main (int argc, char **argv) { struct mpfi_function_t i_add_fr; test_start (); mpfi_fun_init_IIR (&i_add_fr, mpfi_add_fr, mpfr_add); check_data (&i_add_fr, "add_fr.dat"); check_overflow (); check_random (&i_add_fr, 2, 1000, 10); test_end (); mpfi_fun_clear (&i_add_fr); return 0; }
int main (int argc, char **argv) { struct mpfi_function_t i_div_2si; mpfi_fun_init_IIS (&i_div_2si, mpfi_div_2si, mpfr_div_2si); test_start (); check_data (&i_div_2si, "div_2si.dat"); check_random (&i_div_2si, 2, 1000, 10); test_end (); mpfi_fun_clear (&i_div_2si); return 0; }
int main (int argc, char **argv) { int n_tests; tests_start (); mp_trace_base = -16; check_tests (); n_tests = 500; if (argc == 2) n_tests = atoi (argv[1]); check_random (n_tests); tests_end (); exit (0); }
int main (int argc, char **argv) { struct mpfi_function_t i_cos; mpfi_fun_init_II (&i_cos, mpfi_cos, mpfr_cos); mpfi_restrict_random (&i_cos, restrict_domain); test_start (); check_data (&i_cos, "cos.dat"); check_random (&i_cos, 2, 1000, 10); test_end (); mpfi_fun_clear (&i_cos); return 0; }
int main (void) { mpfr_prec_t p; tests_start_mpfr (); check_special (); for (p = 2; p < 200; p++) check_random (p); test_generic (2, 200, 15); data_check ("data/sqr", mpfr_sqr, "mpfr_sqr"); bad_cases (mpfr_sqr, mpfr_sqrt, "mpfr_sqr", 8, -256, 255, 4, 128, 800, 50); tests_end_mpfr (); return 0; }
int main (int argc, char *argv[]) { FILE *fout; int N; tests_start_mpfr (); /* with no argument: prints to /dev/null, tfprintf N: prints N tests to stdout */ if (argc == 1) { N = 1000; fout = fopen ("/dev/null", "w"); /* If we failed to open this device, try with a dummy file */ if (fout == NULL) { fout = fopen ("mpfrtest.txt", "w"); if (fout == NULL) { printf ("Can't open /dev/null or a temporary file\n"); exit (1); } } } else { fout = stdout; N = atoi (argv[1]); } check_special (fout); check_mixed (fout); check_random (fout, N); bug_20090316 (fout); fclose (fout); tests_end_mpfr (); return 0; }
int main (int argc, char *argv[]) { int h; if (argc == 5) { check_random (atoi (argv[1]), atoi (argv[2]), atoi (argv[3]), (mpfr_rnd_t) atoi (argv[4])); return 0; } tests_start_mpfr (); if (argc != 1) { fprintf (stderr, "Usage: tsum\n tsum n k prec rnd\n"); exit (1); } check_simple (); check_special (); check_more_special (); for (h = 0; h <= 64; h++) check1 (h); check2 (); check3 (); check4 (); bug20131027 (); bug20150327 (); bug20160315 (); generic_tests (); check_extreme (); cancel (); check_overflow (); check_underflow (); check_coverage (); tests_end_mpfr (); return 0; }
int main (int argc, char **argv) { int reps = 5000; /* dummy call to drag in refmpn.o for testing mpz/n_pow_ui.c with refmpn_mul_2 */ refmpn_zero_p (NULL, (mp_size_t) 0); tests_start (); mp_trace_base = -16; if (argc == 2) reps = atoi (argv[1]); check_various (); check_random (reps); tests_end (); exit (0); }
int main (int argc, char **argv) { static const struct { struct pair_t left; unsigned long n; struct pair_t right; } data[] = { { {"0","1"}, 0, {"0","1"} }, { {"0","1"}, 1, {"0","1"} }, { {"0","1"}, 2, {"0","1"} }, { {"1","1"}, 0, {"1","1"} }, { {"1","1"}, 1, {"2","1"} }, { {"1","1"}, 2, {"4","1"} }, { {"1","1"}, 3, {"8","1"} }, { {"1","1"}, 31, {"0x80000000","1"} }, { {"1","1"}, 32, {"0x100000000","1"} }, { {"1","1"}, 33, {"0x200000000","1"} }, { {"1","1"}, 63, {"0x8000000000000000","1"} }, { {"1","1"}, 64, {"0x10000000000000000","1"} }, { {"1","1"}, 65, {"0x20000000000000000","1"} }, { {"1","1"}, 95, {"0x800000000000000000000000","1"} }, { {"1","1"}, 96, {"0x1000000000000000000000000","1"} }, { {"1","1"}, 97, {"0x2000000000000000000000000","1"} }, { {"1","1"}, 127, {"0x80000000000000000000000000000000","1"} }, { {"1","1"}, 128, {"0x100000000000000000000000000000000","1"} }, { {"1","1"}, 129, {"0x200000000000000000000000000000000","1"} }, { {"1","2"}, 31, {"0x40000000","1"} }, { {"1","2"}, 32, {"0x80000000","1"} }, { {"1","2"}, 33, {"0x100000000","1"} }, { {"1","2"}, 63, {"0x4000000000000000","1"} }, { {"1","2"}, 64, {"0x8000000000000000","1"} }, { {"1","2"}, 65, {"0x10000000000000000","1"} }, { {"1","2"}, 95, {"0x400000000000000000000000","1"} }, { {"1","2"}, 96, {"0x800000000000000000000000","1"} }, { {"1","2"}, 97, {"0x1000000000000000000000000","1"} }, { {"1","2"}, 127, {"0x40000000000000000000000000000000","1"} }, { {"1","2"}, 128, {"0x80000000000000000000000000000000","1"} }, { {"1","2"}, 129, {"0x100000000000000000000000000000000","1"} }, { {"1","0x80000000"}, 30, {"1","2"} }, { {"1","0x80000000"}, 31, {"1","1"} }, { {"1","0x80000000"}, 32, {"2","1"} }, { {"1","0x80000000"}, 33, {"4","1"} }, { {"1","0x80000000"}, 62, {"0x80000000","1"} }, { {"1","0x80000000"}, 63, {"0x100000000","1"} }, { {"1","0x80000000"}, 64, {"0x200000000","1"} }, { {"1","0x80000000"}, 94, {"0x8000000000000000","1"} }, { {"1","0x80000000"}, 95, {"0x10000000000000000","1"} }, { {"1","0x80000000"}, 96, {"0x20000000000000000","1"} }, { {"1","0x80000000"}, 126, {"0x800000000000000000000000","1"} }, { {"1","0x80000000"}, 127, {"0x1000000000000000000000000","1"} }, { {"1","0x80000000"}, 128, {"0x2000000000000000000000000","1"} }, { {"1","0x100000000"}, 1, {"1","0x80000000"} }, { {"1","0x100000000"}, 2, {"1","0x40000000"} }, { {"1","0x100000000"}, 3, {"1","0x20000000"} }, { {"1","0x10000000000000000"}, 1, {"1","0x8000000000000000"} }, { {"1","0x10000000000000000"}, 2, {"1","0x4000000000000000"} }, { {"1","0x10000000000000000"}, 3, {"1","0x2000000000000000"} }, }; void (*fun) (mpq_ptr, mpq_srcptr, unsigned long); const struct pair_t *p_start, *p_want; const char *name; mpq_t sep, got, want; mpq_ptr q; int i, muldiv, sign, overlap; tests_start (); mpq_init (sep); mpq_init (got); mpq_init (want); for (i = 0; i < numberof (data); i++) { for (muldiv = 0; muldiv < 2; muldiv++) { if (muldiv == 0) { fun = mpq_mul_2exp; name = "mpq_mul_2exp"; p_start = &data[i].left; p_want = &data[i].right; } else { fun = mpq_div_2exp; name = "mpq_div_2exp"; p_start = &data[i].right; p_want = &data[i].left; } for (sign = 0; sign <= 1; sign++) { mpz_set_str_or_abort (mpq_numref(want), p_want->num, 0); mpz_set_str_or_abort (mpq_denref(want), p_want->den, 0); if (sign) mpq_neg (want, want); for (overlap = 0; overlap <= 1; overlap++) { q = overlap ? got : sep; /* initial garbage in "got" */ mpq_set_ui (got, 123L, 456L); mpz_set_str_or_abort (mpq_numref(q), p_start->num, 0); mpz_set_str_or_abort (mpq_denref(q), p_start->den, 0); if (sign) mpq_neg (q, q); (*fun) (got, q, data[i].n); MPQ_CHECK_FORMAT (got); if (! mpq_equal (got, want)) { printf ("%s wrong at data[%d], sign %d, overlap %d\n", name, i, sign, overlap); printf (" num \"%s\"\n", p_start->num); printf (" den \"%s\"\n", p_start->den); printf (" n %lu\n", data[i].n); printf (" got "); mpq_out_str (stdout, 16, got); printf (" (hex)\n"); printf (" want "); mpq_out_str (stdout, 16, want); printf (" (hex)\n"); abort (); } } } } } check_random (); mpq_clear (sep); mpq_clear (got); mpq_clear (want); tests_end (); exit (0); }