From 62ee62dda3bc12dba901a5913440159a64a8e0e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albin=20Ahlb=C3=A4ck?= Date: Tue, 17 Oct 2023 15:29:34 +0200 Subject: [PATCH] Debloat rest of current implemented test/main.c --- src/acb/test/main.c | 188 +------------- src/acb_calc/test/main.c | 52 +--- src/acb_dirichlet/test/main.c | 142 +---------- src/arb/test/main.c | 448 +--------------------------------- src/fmpq_poly/test/main.c | 228 +---------------- src/fmpz/test/main.c | 378 +--------------------------- src/fmpz_mat/test/main.c | 232 +----------------- src/fmpz_poly/test/main.c | 396 +----------------------------- src/nmod_poly/test/main.c | 284 +-------------------- src/test/main.c | 74 +----- src/ulong_extras/test/main.c | 228 +---------------- 11 files changed, 22 insertions(+), 2628 deletions(-) diff --git a/src/acb/test/main.c b/src/acb/test/main.c index 314d66e108..af3bc312dd 100644 --- a/src/acb/test/main.c +++ b/src/acb/test/main.c @@ -87,7 +87,7 @@ /* Array of test functions ***************************************************/ -int (*test_functions[])(void) = +test_struct tests[] = { TEST_FUNCTION(acb_acos), TEST_FUNCTION(acb_acosh), @@ -162,190 +162,6 @@ int (*test_functions[])(void) = TEST_FUNCTION(acb_zeta) }; -char acb_acos_name[] = "acb_acos"; -char acb_acosh_name[] = "acb_acosh"; -char acb_agm1_name[] = "acb_agm1"; -char acb_agm_name[] = "acb_agm"; -char acb_approx_dot_name[] = "acb_approx_dot"; -char acb_asin_name[] = "acb_asin"; -char acb_asinh_name[] = "acb_asinh"; -char acb_atan_name[] = "acb_atan"; -char acb_atanh_name[] = "acb_atanh"; -char acb_barnes_g_name[] = "acb_barnes_g"; -char acb_bernoulli_poly_ui_name[] = "acb_bernoulli_poly_ui"; -char acb_chebyshev_t_ui_name[] = "acb_chebyshev_t_ui"; -char acb_chebyshev_u_ui_name[] = "acb_chebyshev_u_ui"; -char acb_cos_pi_name[] = "acb_cos_pi"; -char acb_cot_name[] = "acb_cot"; -char acb_coth_name[] = "acb_coth"; -char acb_cot_pi_name[] = "acb_cot_pi"; -char acb_csc_name[] = "acb_csc"; -char acb_csch_name[] = "acb_csch"; -char acb_csc_pi_name[] = "acb_csc_pi"; -char acb_csgn_name[] = "acb_csgn"; -char acb_digamma_name[] = "acb_digamma"; -char acb_div_name[] = "acb_div"; -char acb_dot_name[] = "acb_dot"; -char acb_dot_fmpz_name[] = "acb_dot_fmpz"; -char acb_dot_si_name[] = "acb_dot_si"; -char acb_dot_siui_name[] = "acb_dot_siui"; -char acb_dot_ui_name[] = "acb_dot_ui"; -char acb_dot_uiui_name[] = "acb_dot_uiui"; -char acb_exp_name[] = "acb_exp"; -char acb_exp_invexp_name[] = "acb_exp_invexp"; -char acb_expm1_name[] = "acb_expm1"; -char acb_exp_pi_i_name[] = "acb_exp_pi_i"; -char acb_gamma_name[] = "acb_gamma"; -char acb_get_abs_lbound_arf_name[] = "acb_get_abs_lbound_arf"; -char acb_get_abs_ubound_arf_name[] = "acb_get_abs_ubound_arf"; -char acb_get_mag_name[] = "acb_get_mag"; -char acb_get_mag_lower_name[] = "acb_get_mag_lower"; -char acb_inv_name[] = "acb_inv"; -char acb_lambertw_name[] = "acb_lambertw"; -char acb_lgamma_name[] = "acb_lgamma"; -char acb_log1p_name[] = "acb_log1p"; -char acb_log_name[] = "acb_log"; -char acb_log_sin_pi_name[] = "acb_log_sin_pi"; -char acb_mul_name[] = "acb_mul"; -char acb_mul_naive_name[] = "acb_mul_naive"; -char acb_polygamma_name[] = "acb_polygamma"; -char acb_pow_name[] = "acb_pow"; -char acb_pow_fmpz_name[] = "acb_pow_fmpz"; -char acb_quadratic_roots_fmpz_name[] = "acb_quadratic_roots_fmpz"; -char acb_rel_accuracy_bits_name[] = "acb_rel_accuracy_bits"; -char acb_rgamma_name[] = "acb_rgamma"; -char acb_rising2_ui_name[] = "acb_rising2_ui"; -char acb_rising_ui_name[] = "acb_rising_ui"; -char acb_rising_ui_get_mag_name[] = "acb_rising_ui_get_mag"; -char acb_root_ui_name[] = "acb_root_ui"; -char acb_rsqrt_name[] = "acb_rsqrt"; -char acb_sec_name[] = "acb_sec"; -char acb_sech_name[] = "acb_sech"; -char acb_sgn_name[] = "acb_sgn"; -char acb_sinc_name[] = "acb_sinc"; -char acb_sin_cos_name[] = "acb_sin_cos"; -char acb_sinc_pi_name[] = "acb_sinc_pi"; -char acb_sinh_cosh_name[] = "acb_sinh_cosh"; -char acb_sin_pi_name[] = "acb_sin_pi"; -char acb_sqrt_name[] = "acb_sqrt"; -char acb_tan_name[] = "acb_tan"; -char acb_tanh_name[] = "acb_tanh"; -char acb_tan_pi_name[] = "acb_tan_pi"; -char acb_vec_unit_roots_name[] = "acb_vec_unit_roots"; -char acb_zeta_name[] = "acb_zeta"; - -char * test_names[] = -{ - acb_acos_name, - acb_acosh_name, - acb_agm1_name, - acb_agm_name, - acb_approx_dot_name, - acb_asin_name, - acb_asinh_name, - acb_atan_name, - acb_atanh_name, - acb_barnes_g_name, - acb_bernoulli_poly_ui_name, - acb_chebyshev_t_ui_name, - acb_chebyshev_u_ui_name, - acb_cos_pi_name, - acb_cot_name, - acb_coth_name, - acb_cot_pi_name, - acb_csc_name, - acb_csch_name, - acb_csc_pi_name, - acb_csgn_name, - acb_digamma_name, - acb_div_name, - acb_dot_name, - acb_dot_fmpz_name, - acb_dot_si_name, - acb_dot_siui_name, - acb_dot_ui_name, - acb_dot_uiui_name, - acb_exp_name, - acb_exp_invexp_name, - acb_expm1_name, - acb_exp_pi_i_name, - acb_gamma_name, - acb_get_abs_lbound_arf_name, - acb_get_abs_ubound_arf_name, - acb_get_mag_name, - acb_get_mag_lower_name, - acb_inv_name, - acb_lambertw_name, - acb_lgamma_name, - acb_log1p_name, - acb_log_name, - acb_log_sin_pi_name, - acb_mul_name, - acb_mul_naive_name, - acb_polygamma_name, - acb_pow_name, - acb_pow_fmpz_name, - acb_quadratic_roots_fmpz_name, - acb_rel_accuracy_bits_name, - acb_rgamma_name, - acb_rising2_ui_name, - acb_rising_ui_name, - acb_rising_ui_get_mag_name, - acb_root_ui_name, - acb_rsqrt_name, - acb_sec_name, - acb_sech_name, - acb_sgn_name, - acb_sinc_name, - acb_sin_cos_name, - acb_sinc_pi_name, - acb_sinh_cosh_name, - acb_sin_pi_name, - acb_sqrt_name, - acb_tan_name, - acb_tanh_name, - acb_tan_pi_name, - acb_vec_unit_roots_name, - acb_zeta_name -}; - /* main function *************************************************************/ -#define NUMBER_OF_TESTS (sizeof(test_functions) / sizeof(int (*)(void))) - -int -main(int argc, char ** argv) -{ - int ix, jx; - - if (argc < 2) - { - for (ix = 0; ix < NUMBER_OF_TESTS; ix++) - if (test_functions[ix]()) - flint_abort(); - } - else - { - for (ix = 1; ix < argc; ix++) - { - for (jx = 0; jx < NUMBER_OF_TESTS; jx++) - { - /* If argument equals to test name, run it */ - if (strcmp(argv[ix], test_names[jx]) == 0) - { - if (test_functions[jx]()) - flint_abort(); - break; - } - } - - if (jx == NUMBER_OF_TESTS) - { - fprintf(stderr, "Error: Could not find test function for %s\n", argv[ix]); - flint_abort(); - } - } - } - - return 0; -} +TEST_MAIN(tests) diff --git a/src/acb_calc/test/main.c b/src/acb_calc/test/main.c index aef0577c5e..92bc9319e2 100644 --- a/src/acb_calc/test/main.c +++ b/src/acb_calc/test/main.c @@ -19,61 +19,13 @@ /* Array of test functions ***************************************************/ -int (*test_functions[])(void) = +test_struct tests[] = { TEST_FUNCTION(acb_calc_cauchy_bound), TEST_FUNCTION(acb_calc_integrate), TEST_FUNCTION(acb_calc_integrate_taylor) }; -char acb_calc_cauchy_bound_name[] = "acb_calc_cauchy_bound"; -char acb_calc_integrate_name[] = "acb_calc_integrate"; -char acb_calc_integrate_taylor_name[] = "acb_calc_integrate_taylor"; - -char * test_names[] = -{ - acb_calc_cauchy_bound_name, - acb_calc_integrate_name, - acb_calc_integrate_taylor_name -}; - /* main function *************************************************************/ -#define NUMBER_OF_TESTS (sizeof(test_functions) / sizeof(int (*)(void))) - -int -main(int argc, char ** argv) -{ - int ix, jx; - - if (argc < 2) - { - for (ix = 0; ix < NUMBER_OF_TESTS; ix++) - if (test_functions[ix]()) - flint_abort(); - } - else - { - for (ix = 1; ix < argc; ix++) - { - for (jx = 0; jx < NUMBER_OF_TESTS; jx++) - { - /* If argument equals to test name, run it */ - if (strcmp(argv[ix], test_names[jx]) == 0) - { - if (test_functions[jx]()) - flint_abort(); - break; - } - } - - if (jx == NUMBER_OF_TESTS) - { - fprintf(stderr, "Error: Could not find test function for %s\n", argv[ix]); - flint_abort(); - } - } - } - - return 0; -} +TEST_MAIN(tests) diff --git a/src/acb_dirichlet/test/main.c b/src/acb_dirichlet/test/main.c index 8dd291ec4f..3418b23055 100644 --- a/src/acb_dirichlet/test/main.c +++ b/src/acb_dirichlet/test/main.c @@ -64,7 +64,7 @@ /* Array of test functions ***************************************************/ -int (*test_functions[])(void) = +test_struct tests[] = { TEST_FUNCTION(acb_dirichlet_backlund_s_bound), TEST_FUNCTION(acb_dirichlet_backlund_s), @@ -116,144 +116,6 @@ int (*test_functions[])(void) = TEST_FUNCTION(acb_dirichlet_zeta_zeros) }; -char acb_dirichlet_backlund_s_bound_name[] = "acb_dirichlet_backlund_s_bound"; -char acb_dirichlet_backlund_s_name[] = "acb_dirichlet_backlund_s"; -char acb_dirichlet_backlund_s_gram_name[] = "acb_dirichlet_backlund_s_gram"; -char acb_dirichlet_chi_name[] = "acb_dirichlet_chi"; -char acb_dirichlet_dft_name[] = "acb_dirichlet_dft"; -char acb_dirichlet_eta_name[] = "acb_dirichlet_eta"; -char acb_dirichlet_euler_product_real_ui_name[] = "acb_dirichlet_euler_product_real_ui"; -char acb_dirichlet_gauss_name[] = "acb_dirichlet_gauss"; -char acb_dirichlet_gram_point_name[] = "acb_dirichlet_gram_point"; -char acb_dirichlet_hardy_theta_series_name[] = "acb_dirichlet_hardy_theta_series"; -char acb_dirichlet_hardy_z_name[] = "acb_dirichlet_hardy_z"; -char acb_dirichlet_hardy_z_series_name[] = "acb_dirichlet_hardy_z_series"; -char acb_dirichlet_hardy_z_zero_name[] = "acb_dirichlet_hardy_z_zero"; -char acb_dirichlet_hardy_z_zeros_name[] = "acb_dirichlet_hardy_z_zeros"; -char acb_dirichlet_hurwitz_name[] = "acb_dirichlet_hurwitz"; -char acb_dirichlet_hurwitz_precomp_name[] = "acb_dirichlet_hurwitz_precomp"; -char acb_dirichlet_isolate_hardy_z_zero_name[] = "acb_dirichlet_isolate_hardy_z_zero"; -char acb_dirichlet_jacobi_name[] = "acb_dirichlet_jacobi"; -char acb_dirichlet_l_name[] = "acb_dirichlet_l"; -char acb_dirichlet_lerch_phi_name[] = "acb_dirichlet_lerch_phi"; -char acb_dirichlet_l_euler_product_name[] = "acb_dirichlet_l_euler_product"; -char acb_dirichlet_l_fmpq_afe_name[] = "acb_dirichlet_l_fmpq_afe"; -char acb_dirichlet_l_fmpq_name[] = "acb_dirichlet_l_fmpq"; -char acb_dirichlet_l_hurwitz_name[] = "acb_dirichlet_l_hurwitz"; -char acb_dirichlet_l_jet_name[] = "acb_dirichlet_l_jet"; -char acb_dirichlet_l_series_name[] = "acb_dirichlet_l_series"; -char acb_dirichlet_l_vec_hurwitz_name[] = "acb_dirichlet_l_vec_hurwitz"; -char acb_dirichlet_platt_beta_name[] = "acb_dirichlet_platt_beta"; -char acb_dirichlet_platt_hardy_z_zeros_name[] = "acb_dirichlet_platt_hardy_z_zeros"; -char acb_dirichlet_platt_local_hardy_z_zeros_name[] = "acb_dirichlet_platt_local_hardy_z_zeros"; -char acb_dirichlet_platt_multieval_name[] = "acb_dirichlet_platt_multieval"; -char acb_dirichlet_platt_multieval_threaded_name[] = "acb_dirichlet_platt_multieval_threaded"; -char acb_dirichlet_platt_ws_interpolation_name[] = "acb_dirichlet_platt_ws_interpolation"; -char acb_dirichlet_platt_zeta_zeros_name[] = "acb_dirichlet_platt_zeta_zeros"; -char acb_dirichlet_powsum_smooth_name[] = "acb_dirichlet_powsum_smooth"; -char acb_dirichlet_roots_name[] = "acb_dirichlet_roots"; -char acb_dirichlet_stieltjes_name[] = "acb_dirichlet_stieltjes"; -char acb_dirichlet_thetanull_name[] = "acb_dirichlet_thetanull"; -char acb_dirichlet_turing_method_bound_name[] = "acb_dirichlet_turing_method_bound"; -char acb_dirichlet_xi_name[] = "acb_dirichlet_xi"; -char acb_dirichlet_zeta_bound_name[] = "acb_dirichlet_zeta_bound"; -char acb_dirichlet_zeta_jet_rs_name[] = "acb_dirichlet_zeta_jet_rs"; -char acb_dirichlet_zeta_nzeros_name[] = "acb_dirichlet_zeta_nzeros"; -char acb_dirichlet_zeta_nzeros_gram_name[] = "acb_dirichlet_zeta_nzeros_gram"; -char acb_dirichlet_zeta_rs_name[] = "acb_dirichlet_zeta_rs"; -char acb_dirichlet_zeta_rs_r_name[] = "acb_dirichlet_zeta_rs_r"; -char acb_dirichlet_zeta_zero_name[] = "acb_dirichlet_zeta_zero"; -char acb_dirichlet_zeta_zeros_name[] = "acb_dirichlet_zeta_zeros"; - -char * test_names[] = -{ - acb_dirichlet_backlund_s_bound_name, - acb_dirichlet_backlund_s_name, - acb_dirichlet_backlund_s_gram_name, - acb_dirichlet_chi_name, - acb_dirichlet_dft_name, - acb_dirichlet_eta_name, - acb_dirichlet_euler_product_real_ui_name, - acb_dirichlet_gauss_name, - acb_dirichlet_gram_point_name, - acb_dirichlet_hardy_theta_series_name, - acb_dirichlet_hardy_z_name, - acb_dirichlet_hardy_z_series_name, - acb_dirichlet_hardy_z_zero_name, - acb_dirichlet_hardy_z_zeros_name, - acb_dirichlet_hurwitz_name, - acb_dirichlet_hurwitz_precomp_name, - acb_dirichlet_isolate_hardy_z_zero_name, - acb_dirichlet_jacobi_name, - acb_dirichlet_l_name, - acb_dirichlet_lerch_phi_name, - acb_dirichlet_l_euler_product_name, - acb_dirichlet_l_fmpq_afe_name, - acb_dirichlet_l_fmpq_name, - acb_dirichlet_l_hurwitz_name, - acb_dirichlet_l_jet_name, - acb_dirichlet_l_series_name, - acb_dirichlet_l_vec_hurwitz_name, - acb_dirichlet_platt_beta_name, - acb_dirichlet_platt_hardy_z_zeros_name, - acb_dirichlet_platt_local_hardy_z_zeros_name, - acb_dirichlet_platt_multieval_name, - acb_dirichlet_platt_multieval_threaded_name, - acb_dirichlet_platt_ws_interpolation_name, - acb_dirichlet_platt_zeta_zeros_name, - acb_dirichlet_powsum_smooth_name, - acb_dirichlet_roots_name, - acb_dirichlet_stieltjes_name, - acb_dirichlet_thetanull_name, - acb_dirichlet_turing_method_bound_name, - acb_dirichlet_xi_name, - acb_dirichlet_zeta_bound_name, - acb_dirichlet_zeta_jet_rs_name, - acb_dirichlet_zeta_nzeros_name, - acb_dirichlet_zeta_nzeros_gram_name, - acb_dirichlet_zeta_rs_name, - acb_dirichlet_zeta_rs_r_name, - acb_dirichlet_zeta_zero_name, - acb_dirichlet_zeta_zeros_name -}; - /* main function *************************************************************/ -#define NUMBER_OF_TESTS (sizeof(test_functions) / sizeof(int (*)(void))) - -int -main(int argc, char ** argv) -{ - int ix, jx; - - if (argc < 2) - { - for (ix = 0; ix < NUMBER_OF_TESTS; ix++) - if (test_functions[ix]()) - flint_abort(); - } - else - { - for (ix = 1; ix < argc; ix++) - { - for (jx = 0; jx < NUMBER_OF_TESTS; jx++) - { - /* If argument equals to test name, run it */ - if (strcmp(argv[ix], test_names[jx]) == 0) - { - if (test_functions[jx]()) - flint_abort(); - break; - } - } - - if (jx == NUMBER_OF_TESTS) - { - fprintf(stderr, "Error: Could not find test function for %s\n", argv[ix]); - flint_abort(); - } - } - } - - return 0; -} +TEST_MAIN(tests) diff --git a/src/arb/test/main.c b/src/arb/test/main.c index 5f03e4d962..60ef3eba27 100644 --- a/src/arb/test/main.c +++ b/src/arb/test/main.c @@ -217,7 +217,7 @@ /* Array of test functions ***************************************************/ -int (*test_functions[])(void) = +test_struct tests[] = { TEST_FUNCTION(arb_acos), TEST_FUNCTION(arb_acosh), @@ -422,450 +422,6 @@ int (*test_functions[])(void) = TEST_FUNCTION(arb_zeta_ui_vec) }; -char arb_acos_name[] = "arb_acos"; -char arb_acosh_name[] = "arb_acosh"; -char arb_add_arf_name[] = "arb_add_arf"; -char arb_add_name[] = "arb_add"; -char arb_add_error_name[] = "arb_add_error"; -char arb_add_fmpz_2exp_name[] = "arb_add_fmpz_2exp"; -char arb_add_fmpz_name[] = "arb_add_fmpz"; -char arb_addmul_arf_name[] = "arb_addmul_arf"; -char arb_addmul_name[] = "arb_addmul"; -char arb_addmul_fmpz_name[] = "arb_addmul_fmpz"; -char arb_addmul_si_name[] = "arb_addmul_si"; -char arb_addmul_ui_name[] = "arb_addmul_ui"; -char arb_add_si_name[] = "arb_add_si"; -char arb_add_ui_name[] = "arb_add_ui"; -char arb_agm_name[] = "arb_agm"; -char arb_approx_dot_name[] = "arb_approx_dot"; -char arb_asin_name[] = "arb_asin"; -char arb_asinh_name[] = "arb_asinh"; -char arb_atan2_name[] = "arb_atan2"; -char arb_atan_arf_bb_name[] = "arb_atan_arf_bb"; -char arb_atan_arf_name[] = "arb_atan_arf"; -char arb_atan_arf_newton_name[] = "arb_atan_arf_newton"; -char arb_atan_name[] = "arb_atan"; -char arb_atan_frac_bsplit_name[] = "arb_atan_frac_bsplit"; -char arb_atan_gauss_primes_vec_bsplit_name[] = "arb_atan_gauss_primes_vec_bsplit"; -char arb_atanh_name[] = "arb_atanh"; -char arb_atan_newton_name[] = "arb_atan_newton"; -char arb_atan_sum_bs_powtab_name[] = "arb_atan_sum_bs_powtab"; -char arb_atan_tab_name[] = "arb_atan_tab"; -char arb_atan_taylor_rs_name[] = "arb_atan_taylor_rs"; -char arb_bell_fmpz_name[] = "arb_bell_fmpz"; -char arb_bell_sum_taylor_name[] = "arb_bell_sum_taylor"; -char arb_bernoulli_poly_ui_name[] = "arb_bernoulli_poly_ui"; -char arb_bernoulli_ui_name[] = "arb_bernoulli_ui"; -char arb_can_round_mpfr_name[] = "arb_can_round_mpfr"; -char arb_ceil_name[] = "arb_ceil"; -char arb_chebyshev_t_ui_name[] = "arb_chebyshev_t_ui"; -char arb_chebyshev_u_ui_name[] = "arb_chebyshev_u_ui"; -char arb_const_apery_name[] = "arb_const_apery"; -char arb_const_catalan_name[] = "arb_const_catalan"; -char arb_const_e_name[] = "arb_const_e"; -char arb_const_euler_name[] = "arb_const_euler"; -char arb_const_glaisher_name[] = "arb_const_glaisher"; -char arb_const_khinchin_name[] = "arb_const_khinchin"; -char arb_const_log10_name[] = "arb_const_log10"; -char arb_const_log2_name[] = "arb_const_log2"; -char arb_const_pi_name[] = "arb_const_pi"; -char arb_contains_arf_name[] = "arb_contains_arf"; -char arb_contains_name[] = "arb_contains"; -char arb_contains_fmpq_name[] = "arb_contains_fmpq"; -char arb_contains_int_name[] = "arb_contains_int"; -char arb_contains_interior_name[] = "arb_contains_interior"; -char arb_cos_name[] = "arb_cos"; -char arb_cosh_name[] = "arb_cosh"; -char arb_cos_pi_name[] = "arb_cos_pi"; -char arb_cos_pi_fmpq_algebraic_name[] = "arb_cos_pi_fmpq_algebraic"; -char arb_cos_pi_fmpq_name[] = "arb_cos_pi_fmpq"; -char arb_coth_name[] = "arb_coth"; -char arb_cot_pi_name[] = "arb_cot_pi"; -char arb_csc_name[] = "arb_csc"; -char arb_csch_name[] = "arb_csch"; -char arb_csc_pi_name[] = "arb_csc_pi"; -char arb_digamma_name[] = "arb_digamma"; -char arb_digits_round_inplace_name[] = "arb_digits_round_inplace"; -char arb_div_2expm1_ui_name[] = "arb_div_2expm1_ui"; -char arb_div_arf_name[] = "arb_div_arf"; -char arb_div_name[] = "arb_div"; -char arb_div_fmpz_name[] = "arb_div_fmpz"; -char arb_div_newton_name[] = "arb_div_newton"; -char arb_div_si_name[] = "arb_div_si"; -char arb_div_ui_name[] = "arb_div_ui"; -char arb_dot_name[] = "arb_dot"; -char arb_dot_fmpz_name[] = "arb_dot_fmpz"; -char arb_dot_si_name[] = "arb_dot_si"; -char arb_dot_siui_name[] = "arb_dot_siui"; -char arb_dot_ui_name[] = "arb_dot_ui"; -char arb_dot_uiui_name[] = "arb_dot_uiui"; -char arb_doublefac_ui_name[] = "arb_doublefac_ui"; -char arb_dump_file_name[] = "arb_dump_file"; -char arb_dump_str_name[] = "arb_dump_str"; -char arb_euler_number_fmpz_name[] = "arb_euler_number_fmpz"; -char arb_euler_number_ui_name[] = "arb_euler_number_ui"; -char arb_exp_arf_bb_name[] = "arb_exp_arf_bb"; -char arb_exp_arf_rs_generic_name[] = "arb_exp_arf_rs_generic"; -char arb_exp_name[] = "arb_exp"; -char arb_exp_invexp_name[] = "arb_exp_invexp"; -char arb_expm1_name[] = "arb_expm1"; -char arb_exp_sum_bs_powtab_name[] = "arb_exp_sum_bs_powtab"; -char arb_exp_tab_name[] = "arb_exp_tab"; -char arb_exp_taylor_rs_name[] = "arb_exp_taylor_rs"; -char arb_fac_ui_name[] = "arb_fac_ui"; -char arb_fib_name[] = "arb_fib"; -char arb_floor_name[] = "arb_floor"; -char arb_fma_name[] = "arb_fma"; -char arb_gamma_name[] = "arb_gamma"; -char arb_gamma_fmpq_name[] = "arb_gamma_fmpq"; -char arb_get_abs_lbound_arf_name[] = "arb_get_abs_lbound_arf"; -char arb_get_fmpz_mid_rad_10exp_name[] = "arb_get_fmpz_mid_rad_10exp"; -char arb_get_interval_arf_name[] = "arb_get_interval_arf"; -char arb_get_interval_fmpz_2exp_name[] = "arb_get_interval_fmpz_2exp"; -char arb_get_interval_mpfr_name[] = "arb_get_interval_mpfr"; -char arb_get_lbound_arf_name[] = "arb_get_lbound_arf"; -char arb_get_mag_name[] = "arb_get_mag"; -char arb_get_mag_lower_name[] = "arb_get_mag_lower"; -char arb_get_mag_lower_nonnegative_name[] = "arb_get_mag_lower_nonnegative"; -char arb_get_mpn_fixed_mod_log2_name[] = "arb_get_mpn_fixed_mod_log2"; -char arb_get_mpn_fixed_mod_pi4_name[] = "arb_get_mpn_fixed_mod_pi4"; -char arb_get_rand_fmpq_name[] = "arb_get_rand_fmpq"; -char arb_get_str_name[] = "arb_get_str"; -char arb_get_unique_fmpz_name[] = "arb_get_unique_fmpz"; -char arb_hurwitz_zeta_name[] = "arb_hurwitz_zeta"; -char arb_intersection_name[] = "arb_intersection"; -char arb_lambertw_name[] = "arb_lambertw"; -char arb_lgamma_name[] = "arb_lgamma"; -char arb_log1p_name[] = "arb_log1p"; -char arb_log_arf_name[] = "arb_log_arf"; -char arb_log_base_ui_name[] = "arb_log_base_ui"; -char arb_log_name[] = "arb_log"; -char arb_log_hypot_name[] = "arb_log_hypot"; -char arb_log_newton_name[] = "arb_log_newton"; -char arb_log_primes_vec_bsplit_name[] = "arb_log_primes_vec_bsplit"; -char arb_log_tab_name[] = "arb_log_tab"; -char arb_log_ui_from_prev_name[] = "arb_log_ui_from_prev"; -char arb_max_name[] = "arb_max"; -char arb_min_name[] = "arb_min"; -char arb_minmax_name[] = "arb_minmax"; -char arb_mul_arf_name[] = "arb_mul_arf"; -char arb_mul_name[] = "arb_mul"; -char arb_mul_fmpz_name[] = "arb_mul_fmpz"; -char arb_mul_more_name[] = "arb_mul_more"; -char arb_mul_si_name[] = "arb_mul_si"; -char arb_mul_ui_name[] = "arb_mul_ui"; -char arb_nonnegative_abs_name[] = "arb_nonnegative_abs"; -char arb_overlaps_name[] = "arb_overlaps"; -char arb_partitions_fmpz_name[] = "arb_partitions_fmpz"; -char arb_pos_times_posinf_name[] = "arb_pos_times_posinf"; -char arb_pow_name[] = "arb_pow"; -char arb_power_sum_vec_name[] = "arb_power_sum_vec"; -char arb_pow_fmpq_name[] = "arb_pow_fmpq"; -char arb_pow_fmpz_name[] = "arb_pow_fmpz"; -char arb_primorial_name[] = "arb_primorial"; -char arb_rgamma_name[] = "arb_rgamma"; -char arb_richcmp_name[] = "arb_richcmp"; -char arb_rising2_ui_name[] = "arb_rising2_ui"; -char arb_rising_ui_name[] = "arb_rising_ui"; -char arb_root_ui_name[] = "arb_root_ui"; -char arb_rsqrt_name[] = "arb_rsqrt"; -char arb_sec_name[] = "arb_sec"; -char arb_sech_name[] = "arb_sech"; -char arb_set_interval_arf_name[] = "arb_set_interval_arf"; -char arb_set_interval_mag_name[] = "arb_set_interval_mag"; -char arb_set_interval_mpfr_name[] = "arb_set_interval_mpfr"; -char arb_set_interval_neg_pos_mag_name[] = "arb_set_interval_neg_pos_mag"; -char arb_set_str_name[] = "arb_set_str"; -char arb_sgn_name[] = "arb_sgn"; -char arb_sin_name[] = "arb_sin"; -char arb_sinc_name[] = "arb_sinc"; -char arb_sin_cos_arf_bb_name[] = "arb_sin_cos_arf_bb"; -char arb_sin_cos_arf_generic_name[] = "arb_sin_cos_arf_generic"; -char arb_sin_cos_name[] = "arb_sin_cos"; -char arb_sin_cos_generic_name[] = "arb_sin_cos_generic"; -char arb_sin_cos_pi_name[] = "arb_sin_cos_pi"; -char arb_sin_cos_pi_fmpq_algebraic_name[] = "arb_sin_cos_pi_fmpq_algebraic"; -char arb_sin_cos_pi_fmpq_name[] = "arb_sin_cos_pi_fmpq"; -char arb_sin_cos_tab_name[] = "arb_sin_cos_tab"; -char arb_sin_cos_taylor_rs_name[] = "arb_sin_cos_taylor_rs"; -char arb_sinc_pi_name[] = "arb_sinc_pi"; -char arb_sinh_name[] = "arb_sinh"; -char arb_sinh_cosh_name[] = "arb_sinh_cosh"; -char arb_sin_pi_name[] = "arb_sin_pi"; -char arb_sin_pi_fmpq_algebraic_name[] = "arb_sin_pi_fmpq_algebraic"; -char arb_sin_pi_fmpq_name[] = "arb_sin_pi_fmpq"; -char arb_special_name[] = "arb_special"; -char arb_sqrt1pm1_name[] = "arb_sqrt1pm1"; -char arb_sqrt_name[] = "arb_sqrt"; -char arb_sqrt_newton_name[] = "arb_sqrt_newton"; -char arb_sqrtpos_name[] = "arb_sqrtpos"; -char arb_sub_arf_name[] = "arb_sub_arf"; -char arb_sub_name[] = "arb_sub"; -char arb_sub_fmpz_name[] = "arb_sub_fmpz"; -char arb_submul_arf_name[] = "arb_submul_arf"; -char arb_submul_name[] = "arb_submul"; -char arb_submul_fmpz_name[] = "arb_submul_fmpz"; -char arb_submul_si_name[] = "arb_submul_si"; -char arb_submul_ui_name[] = "arb_submul_ui"; -char arb_sub_si_name[] = "arb_sub_si"; -char arb_sub_ui_name[] = "arb_sub_ui"; -char arb_tanh_name[] = "arb_tanh"; -char arb_tan_pi_name[] = "arb_tan_pi"; -char arb_trim_name[] = "arb_trim"; -char arb_ui_pow_ui_name[] = "arb_ui_pow_ui"; -char arb_union_name[] = "arb_union"; -char arb_urandom_name[] = "arb_urandom"; -char arb_zeta_name[] = "arb_zeta"; -char arb_zeta_ui_asymp_name[] = "arb_zeta_ui_asymp"; -char arb_zeta_ui_bernoulli_name[] = "arb_zeta_ui_bernoulli"; -char arb_zeta_ui_borwein_bsplit_name[] = "arb_zeta_ui_borwein_bsplit"; -char arb_zeta_ui_name[] = "arb_zeta_ui"; -char arb_zeta_ui_euler_product_name[] = "arb_zeta_ui_euler_product"; -char arb_zeta_ui_vec_borwein_name[] = "arb_zeta_ui_vec_borwein"; -char arb_zeta_ui_vec_name[] = "arb_zeta_ui_vec"; - -char * test_names[] = -{ - arb_acos_name, - arb_acosh_name, - arb_add_arf_name, - arb_add_name, - arb_add_error_name, - arb_add_fmpz_2exp_name, - arb_add_fmpz_name, - arb_addmul_arf_name, - arb_addmul_name, - arb_addmul_fmpz_name, - arb_addmul_si_name, - arb_addmul_ui_name, - arb_add_si_name, - arb_add_ui_name, - arb_agm_name, - arb_approx_dot_name, - arb_asin_name, - arb_asinh_name, - arb_atan2_name, - arb_atan_arf_bb_name, - arb_atan_arf_name, - arb_atan_arf_newton_name, - arb_atan_name, - arb_atan_frac_bsplit_name, - arb_atan_gauss_primes_vec_bsplit_name, - arb_atanh_name, - arb_atan_newton_name, - arb_atan_sum_bs_powtab_name, - arb_atan_tab_name, - arb_atan_taylor_rs_name, - arb_bell_fmpz_name, - arb_bell_sum_taylor_name, - arb_bernoulli_poly_ui_name, - arb_bernoulli_ui_name, - arb_can_round_mpfr_name, - arb_ceil_name, - arb_chebyshev_t_ui_name, - arb_chebyshev_u_ui_name, - arb_const_apery_name, - arb_const_catalan_name, - arb_const_e_name, - arb_const_euler_name, - arb_const_glaisher_name, - arb_const_khinchin_name, - arb_const_log10_name, - arb_const_log2_name, - arb_const_pi_name, - arb_contains_arf_name, - arb_contains_name, - arb_contains_fmpq_name, - arb_contains_int_name, - arb_contains_interior_name, - arb_cos_name, - arb_cosh_name, - arb_cos_pi_name, - arb_cos_pi_fmpq_algebraic_name, - arb_cos_pi_fmpq_name, - arb_coth_name, - arb_cot_pi_name, - arb_csc_name, - arb_csch_name, - arb_csc_pi_name, - arb_digamma_name, - arb_digits_round_inplace_name, - arb_div_2expm1_ui_name, - arb_div_arf_name, - arb_div_name, - arb_div_fmpz_name, - arb_div_newton_name, - arb_div_si_name, - arb_div_ui_name, - arb_dot_name, - arb_dot_fmpz_name, - arb_dot_si_name, - arb_dot_siui_name, - arb_dot_ui_name, - arb_dot_uiui_name, - arb_doublefac_ui_name, - arb_dump_file_name, - arb_dump_str_name, - arb_euler_number_fmpz_name, - arb_euler_number_ui_name, - arb_exp_arf_bb_name, - arb_exp_arf_rs_generic_name, - arb_exp_name, - arb_exp_invexp_name, - arb_expm1_name, - arb_exp_sum_bs_powtab_name, - arb_exp_tab_name, - arb_exp_taylor_rs_name, - arb_fac_ui_name, - arb_fib_name, - arb_floor_name, - arb_fma_name, - arb_gamma_name, - arb_gamma_fmpq_name, - arb_get_abs_lbound_arf_name, - arb_get_fmpz_mid_rad_10exp_name, - arb_get_interval_arf_name, - arb_get_interval_fmpz_2exp_name, - arb_get_interval_mpfr_name, - arb_get_lbound_arf_name, - arb_get_mag_name, - arb_get_mag_lower_name, - arb_get_mag_lower_nonnegative_name, - arb_get_mpn_fixed_mod_log2_name, - arb_get_mpn_fixed_mod_pi4_name, - arb_get_rand_fmpq_name, - arb_get_str_name, - arb_get_unique_fmpz_name, - arb_hurwitz_zeta_name, - arb_intersection_name, - arb_lambertw_name, - arb_lgamma_name, - arb_log1p_name, - arb_log_arf_name, - arb_log_base_ui_name, - arb_log_name, - arb_log_hypot_name, - arb_log_newton_name, - arb_log_primes_vec_bsplit_name, - arb_log_tab_name, - arb_log_ui_from_prev_name, - arb_max_name, - arb_min_name, - arb_minmax_name, - arb_mul_arf_name, - arb_mul_name, - arb_mul_fmpz_name, - arb_mul_more_name, - arb_mul_si_name, - arb_mul_ui_name, - arb_nonnegative_abs_name, - arb_overlaps_name, - arb_partitions_fmpz_name, - arb_pos_times_posinf_name, - arb_pow_name, - arb_power_sum_vec_name, - arb_pow_fmpq_name, - arb_pow_fmpz_name, - arb_primorial_name, - arb_rgamma_name, - arb_richcmp_name, - arb_rising2_ui_name, - arb_rising_ui_name, - arb_root_ui_name, - arb_rsqrt_name, - arb_sec_name, - arb_sech_name, - arb_set_interval_arf_name, - arb_set_interval_mag_name, - arb_set_interval_mpfr_name, - arb_set_interval_neg_pos_mag_name, - arb_set_str_name, - arb_sgn_name, - arb_sin_name, - arb_sinc_name, - arb_sin_cos_arf_bb_name, - arb_sin_cos_arf_generic_name, - arb_sin_cos_name, - arb_sin_cos_generic_name, - arb_sin_cos_pi_name, - arb_sin_cos_pi_fmpq_algebraic_name, - arb_sin_cos_pi_fmpq_name, - arb_sin_cos_tab_name, - arb_sin_cos_taylor_rs_name, - arb_sinc_pi_name, - arb_sinh_name, - arb_sinh_cosh_name, - arb_sin_pi_name, - arb_sin_pi_fmpq_algebraic_name, - arb_sin_pi_fmpq_name, - arb_special_name, - arb_sqrt1pm1_name, - arb_sqrt_name, - arb_sqrt_newton_name, - arb_sqrtpos_name, - arb_sub_arf_name, - arb_sub_name, - arb_sub_fmpz_name, - arb_submul_arf_name, - arb_submul_name, - arb_submul_fmpz_name, - arb_submul_si_name, - arb_submul_ui_name, - arb_sub_si_name, - arb_sub_ui_name, - arb_tanh_name, - arb_tan_pi_name, - arb_trim_name, - arb_ui_pow_ui_name, - arb_union_name, - arb_urandom_name, - arb_zeta_name, - arb_zeta_ui_asymp_name, - arb_zeta_ui_bernoulli_name, - arb_zeta_ui_borwein_bsplit_name, - arb_zeta_ui_name, - arb_zeta_ui_euler_product_name, - arb_zeta_ui_vec_borwein_name, - arb_zeta_ui_vec_name -}; - /* main function *************************************************************/ -#define NUMBER_OF_TESTS (sizeof(test_functions) / sizeof(int (*)(void))) - -int -main(int argc, char ** argv) -{ - int ix, jx; - - if (argc < 2) - { - for (ix = 0; ix < NUMBER_OF_TESTS; ix++) - if (test_functions[ix]()) - flint_abort(); - } - else - { - for (ix = 1; ix < argc; ix++) - { - for (jx = 0; jx < NUMBER_OF_TESTS; jx++) - { - /* If argument equals to test name, run it */ - if (strcmp(argv[ix], test_names[jx]) == 0) - { - if (test_functions[jx]()) - flint_abort(); - break; - } - } - - if (jx == NUMBER_OF_TESTS) - { - fprintf(stderr, "Error: Could not find test function for %s\n", argv[ix]); - flint_abort(); - } - } - } - - return 0; -} +TEST_MAIN(tests) diff --git a/src/fmpq_poly/test/main.c b/src/fmpq_poly/test/main.c index 415d9d2060..09d7167b57 100644 --- a/src/fmpq_poly/test/main.c +++ b/src/fmpq_poly/test/main.c @@ -112,7 +112,7 @@ /* Array of test functions ***************************************************/ -int (*test_functions[])(void) = +test_struct tests[] = { TEST_FUNCTION(fmpq_poly_add), TEST_FUNCTION(fmpq_poly_add_series), @@ -207,230 +207,6 @@ int (*test_functions[])(void) = TEST_FUNCTION(fmpq_poly_zero) }; -char fmpq_poly_add_name[] = "fmpq_poly_add"; -char fmpq_poly_add_series_name[] = "fmpq_poly_add_series"; -char fmpq_poly_add_sub_fmpq_name[] = "fmpq_poly_add_sub_fmpq"; -char fmpq_poly_add_sub_fmpz_name[] = "fmpq_poly_add_sub_fmpz"; -char fmpq_poly_add_sub_si_name[] = "fmpq_poly_add_sub_si"; -char fmpq_poly_asinh_series_name[] = "fmpq_poly_asinh_series"; -char fmpq_poly_asin_series_name[] = "fmpq_poly_asin_series"; -char fmpq_poly_atanh_series_name[] = "fmpq_poly_atanh_series"; -char fmpq_poly_atan_series_name[] = "fmpq_poly_atan_series"; -char fmpq_poly_cmp_name[] = "fmpq_poly_cmp"; -char fmpq_poly_compose_name[] = "fmpq_poly_compose"; -char fmpq_poly_compose_series_brent_kung_name[] = "fmpq_poly_compose_series_brent_kung"; -char fmpq_poly_compose_series_name[] = "fmpq_poly_compose_series"; -char fmpq_poly_compose_series_horner_name[] = "fmpq_poly_compose_series_horner"; -char fmpq_poly_content_name[] = "fmpq_poly_content"; -char fmpq_poly_cosh_series_name[] = "fmpq_poly_cosh_series"; -char fmpq_poly_cos_series_name[] = "fmpq_poly_cos_series"; -char fmpq_poly_derivative_name[] = "fmpq_poly_derivative"; -char fmpq_poly_div_name[] = "fmpq_poly_div"; -char fmpq_poly_divides_name[] = "fmpq_poly_divides"; -char fmpq_poly_divrem_name[] = "fmpq_poly_divrem"; -char fmpq_poly_div_series_name[] = "fmpq_poly_div_series"; -char fmpq_poly_equal_trunc_name[] = "fmpq_poly_equal_trunc"; -char fmpq_poly_evaluate_fmpq_name[] = "fmpq_poly_evaluate_fmpq"; -char fmpq_poly_evaluate_fmpz_name[] = "fmpq_poly_evaluate_fmpz"; -char fmpq_poly_exp_expinv_series_name[] = "fmpq_poly_exp_expinv_series"; -char fmpq_poly_exp_series_name[] = "fmpq_poly_exp_series"; -char fmpq_poly_gcd_name[] = "fmpq_poly_gcd"; -char fmpq_poly_gegenbauer_c_name[] = "fmpq_poly_gegenbauer_c"; -char fmpq_poly_get_nmod_poly_name[] = "fmpq_poly_get_nmod_poly"; -char fmpq_poly_get_set_coeff_fmpq_name[] = "fmpq_poly_get_set_coeff_fmpq"; -char fmpq_poly_get_set_coeff_fmpz_name[] = "fmpq_poly_get_set_coeff_fmpz"; -char fmpq_poly_get_set_coeff_si_name[] = "fmpq_poly_get_set_coeff_si"; -char fmpq_poly_get_set_coeff_ui_name[] = "fmpq_poly_get_set_coeff_ui"; -char fmpq_poly_get_set_str_name[] = "fmpq_poly_get_set_str"; -char fmpq_poly_get_slice_name[] = "fmpq_poly_get_slice"; -char fmpq_poly_init_realloc_clear_name[] = "fmpq_poly_init_realloc_clear"; -char fmpq_poly_integral_name[] = "fmpq_poly_integral"; -char fmpq_poly_interpolate_fmpz_vec_name[] = "fmpq_poly_interpolate_fmpz_vec"; -char fmpq_poly_inv_name[] = "fmpq_poly_inv"; -char fmpq_poly_inv_series_newton_name[] = "fmpq_poly_inv_series_newton"; -char fmpq_poly_invsqrt_series_name[] = "fmpq_poly_invsqrt_series"; -char fmpq_poly_is_squarefree_name[] = "fmpq_poly_is_squarefree"; -char fmpq_poly_laguerre_l_name[] = "fmpq_poly_laguerre_l"; -char fmpq_poly_lcm_name[] = "fmpq_poly_lcm"; -char fmpq_poly_legendre_p_name[] = "fmpq_poly_legendre_p"; -char fmpq_poly_log_series_name[] = "fmpq_poly_log_series"; -char fmpq_poly_make_monic_name[] = "fmpq_poly_make_monic"; -char fmpq_poly_mul_name[] = "fmpq_poly_mul"; -char fmpq_poly_mullow_name[] = "fmpq_poly_mullow"; -char fmpq_poly_neg_name[] = "fmpq_poly_neg"; -char fmpq_poly_nth_derivative_name[] = "fmpq_poly_nth_derivative"; -char fmpq_poly_pow_name[] = "fmpq_poly_pow"; -char fmpq_poly_power_sums_name[] = "fmpq_poly_power_sums"; -char fmpq_poly_pow_trunc_name[] = "fmpq_poly_pow_trunc"; -char fmpq_poly_primitive_part_name[] = "fmpq_poly_primitive_part"; -char fmpq_poly_print_read_name[] = "fmpq_poly_print_read"; -char fmpq_poly_rem_name[] = "fmpq_poly_rem"; -char fmpq_poly_remove_name[] = "fmpq_poly_remove"; -char fmpq_poly_rem_powers_precomp_name[] = "fmpq_poly_rem_powers_precomp"; -char fmpq_poly_rescale_name[] = "fmpq_poly_rescale"; -char fmpq_poly_resultant_name[] = "fmpq_poly_resultant"; -char fmpq_poly_resultant_div_name[] = "fmpq_poly_resultant_div"; -char fmpq_poly_reverse_name[] = "fmpq_poly_reverse"; -char fmpq_poly_revert_series_name[] = "fmpq_poly_revert_series"; -char fmpq_poly_revert_series_lagrange_name[] = "fmpq_poly_revert_series_lagrange"; -char fmpq_poly_revert_series_lagrange_fast_name[] = "fmpq_poly_revert_series_lagrange_fast"; -char fmpq_poly_revert_series_newton_name[] = "fmpq_poly_revert_series_newton"; -char fmpq_poly_scalar_div_fmpq_name[] = "fmpq_poly_scalar_div_fmpq"; -char fmpq_poly_scalar_div_fmpz_name[] = "fmpq_poly_scalar_div_fmpz"; -char fmpq_poly_scalar_div_si_name[] = "fmpq_poly_scalar_div_si"; -char fmpq_poly_scalar_div_ui_name[] = "fmpq_poly_scalar_div_ui"; -char fmpq_poly_scalar_mul_fmpq_name[] = "fmpq_poly_scalar_mul_fmpq"; -char fmpq_poly_scalar_mul_fmpz_name[] = "fmpq_poly_scalar_mul_fmpz"; -char fmpq_poly_scalar_mul_si_name[] = "fmpq_poly_scalar_mul_si"; -char fmpq_poly_scalar_mul_ui_name[] = "fmpq_poly_scalar_mul_ui"; -char fmpq_poly_set_equal_name[] = "fmpq_poly_set_equal"; -char fmpq_poly_set_trunc_name[] = "fmpq_poly_set_trunc"; -char fmpq_poly_shift_left_right_name[] = "fmpq_poly_shift_left_right"; -char fmpq_poly_sin_cos_series_name[] = "fmpq_poly_sin_cos_series"; -char fmpq_poly_sinh_cosh_series_name[] = "fmpq_poly_sinh_cosh_series"; -char fmpq_poly_sinh_series_name[] = "fmpq_poly_sinh_series"; -char fmpq_poly_sin_series_name[] = "fmpq_poly_sin_series"; -char fmpq_poly_sqrt_series_name[] = "fmpq_poly_sqrt_series"; -char fmpq_poly_sub_name[] = "fmpq_poly_sub"; -char fmpq_poly_sub_series_name[] = "fmpq_poly_sub_series"; -char fmpq_poly_swap_name[] = "fmpq_poly_swap"; -char fmpq_poly_tanh_series_name[] = "fmpq_poly_tanh_series"; -char fmpq_poly_tan_series_name[] = "fmpq_poly_tan_series"; -char fmpq_poly_xgcd_name[] = "fmpq_poly_xgcd"; -char fmpq_poly_zero_name[] = "fmpq_poly_zero"; - -char * test_names[] = -{ - fmpq_poly_add_name, - fmpq_poly_add_series_name, - fmpq_poly_add_sub_fmpq_name, - fmpq_poly_add_sub_fmpz_name, - fmpq_poly_add_sub_si_name, - fmpq_poly_asinh_series_name, - fmpq_poly_asin_series_name, - fmpq_poly_atanh_series_name, - fmpq_poly_atan_series_name, - fmpq_poly_cmp_name, - fmpq_poly_compose_name, - fmpq_poly_compose_series_brent_kung_name, - fmpq_poly_compose_series_name, - fmpq_poly_compose_series_horner_name, - fmpq_poly_content_name, - fmpq_poly_cosh_series_name, - fmpq_poly_cos_series_name, - fmpq_poly_derivative_name, - fmpq_poly_div_name, - fmpq_poly_divides_name, - fmpq_poly_divrem_name, - fmpq_poly_div_series_name, - fmpq_poly_equal_trunc_name, - fmpq_poly_evaluate_fmpq_name, - fmpq_poly_evaluate_fmpz_name, - fmpq_poly_exp_expinv_series_name, - fmpq_poly_exp_series_name, - fmpq_poly_gcd_name, - fmpq_poly_gegenbauer_c_name, - fmpq_poly_get_nmod_poly_name, - fmpq_poly_get_set_coeff_fmpq_name, - fmpq_poly_get_set_coeff_fmpz_name, - fmpq_poly_get_set_coeff_si_name, - fmpq_poly_get_set_coeff_ui_name, - fmpq_poly_get_set_str_name, - fmpq_poly_get_slice_name, - fmpq_poly_init_realloc_clear_name, - fmpq_poly_integral_name, - fmpq_poly_interpolate_fmpz_vec_name, - fmpq_poly_inv_name, - fmpq_poly_inv_series_newton_name, - fmpq_poly_invsqrt_series_name, - fmpq_poly_is_squarefree_name, - fmpq_poly_laguerre_l_name, - fmpq_poly_lcm_name, - fmpq_poly_legendre_p_name, - fmpq_poly_log_series_name, - fmpq_poly_make_monic_name, - fmpq_poly_mul_name, - fmpq_poly_mullow_name, - fmpq_poly_neg_name, - fmpq_poly_nth_derivative_name, - fmpq_poly_pow_name, - fmpq_poly_power_sums_name, - fmpq_poly_pow_trunc_name, - fmpq_poly_primitive_part_name, - fmpq_poly_print_read_name, - fmpq_poly_rem_name, - fmpq_poly_remove_name, - fmpq_poly_rem_powers_precomp_name, - fmpq_poly_rescale_name, - fmpq_poly_resultant_name, - fmpq_poly_resultant_div_name, - fmpq_poly_reverse_name, - fmpq_poly_revert_series_name, - fmpq_poly_revert_series_lagrange_name, - fmpq_poly_revert_series_lagrange_fast_name, - fmpq_poly_revert_series_newton_name, - fmpq_poly_scalar_div_fmpq_name, - fmpq_poly_scalar_div_fmpz_name, - fmpq_poly_scalar_div_si_name, - fmpq_poly_scalar_div_ui_name, - fmpq_poly_scalar_mul_fmpq_name, - fmpq_poly_scalar_mul_fmpz_name, - fmpq_poly_scalar_mul_si_name, - fmpq_poly_scalar_mul_ui_name, - fmpq_poly_set_equal_name, - fmpq_poly_set_trunc_name, - fmpq_poly_shift_left_right_name, - fmpq_poly_sin_cos_series_name, - fmpq_poly_sinh_cosh_series_name, - fmpq_poly_sinh_series_name, - fmpq_poly_sin_series_name, - fmpq_poly_sqrt_series_name, - fmpq_poly_sub_name, - fmpq_poly_sub_series_name, - fmpq_poly_swap_name, - fmpq_poly_tanh_series_name, - fmpq_poly_tan_series_name, - fmpq_poly_xgcd_name, - fmpq_poly_zero_name -}; - /* main function *************************************************************/ -#define NUMBER_OF_TESTS (sizeof(test_functions) / sizeof(int (*)(void))) - -int -main(int argc, char ** argv) -{ - int ix, jx; - - if (argc < 2) - { - for (ix = 0; ix < NUMBER_OF_TESTS; ix++) - if (test_functions[ix]()) - flint_abort(); - } - else - { - for (ix = 1; ix < argc; ix++) - { - for (jx = 0; jx < NUMBER_OF_TESTS; jx++) - { - /* If argument equals to test name, run it */ - if (strcmp(argv[ix], test_names[jx]) == 0) - { - if (test_functions[jx]()) - flint_abort(); - break; - } - } - - if (jx == NUMBER_OF_TESTS) - { - fprintf(stderr, "Error: Could not find test function for %s\n", argv[ix]); - flint_abort(); - } - } - } - - return 0; -} +TEST_MAIN(tests) diff --git a/src/fmpz/test/main.c b/src/fmpz/test/main.c index 3e29c80405..684424877b 100644 --- a/src/fmpz/test/main.c +++ b/src/fmpz/test/main.c @@ -189,7 +189,7 @@ /* Array of test functions ***************************************************/ -int (*test_functions[])(void) = +test_struct tests[] = { TEST_FUNCTION(fmpz_abs), TEST_FUNCTION(fmpz_abs_fits_ui), @@ -359,380 +359,6 @@ int (*test_functions[])(void) = TEST_FUNCTION(fmpz_xor) }; -char fmpz_abs_name[] = "fmpz_abs"; -char fmpz_abs_fits_ui_name[] = "fmpz_abs_fits_ui"; -char fmpz_abs_lbound_ui_2exp_name[] = "fmpz_abs_lbound_ui_2exp"; -char fmpz_abs_ubound_ui_2exp_name[] = "fmpz_abs_ubound_ui_2exp"; -char fmpz_add_name[] = "fmpz_add"; -char fmpz_addmul_name[] = "fmpz_addmul"; -char fmpz_addmul_si_name[] = "fmpz_addmul_si"; -char fmpz_addmul_ui_name[] = "fmpz_addmul_ui"; -char fmpz_add_ui_name[] = "fmpz_add_ui"; -char fmpz_and_name[] = "fmpz_and"; -char fmpz_bin_uiui_name[] = "fmpz_bin_uiui"; -char fmpz_bit_pack_name[] = "fmpz_bit_pack"; -char fmpz_bits_name[] = "fmpz_bits"; -char fmpz_cdiv_q_2exp_name[] = "fmpz_cdiv_q_2exp"; -char fmpz_cdiv_q_name[] = "fmpz_cdiv_q"; -char fmpz_cdiv_qr_name[] = "fmpz_cdiv_qr"; -char fmpz_cdiv_q_si_name[] = "fmpz_cdiv_q_si"; -char fmpz_cdiv_q_ui_name[] = "fmpz_cdiv_q_ui"; -char fmpz_cdiv_r_2exp_name[] = "fmpz_cdiv_r_2exp"; -char fmpz_cdiv_ui_name[] = "fmpz_cdiv_ui"; -char fmpz_clog_name[] = "fmpz_clog"; -char fmpz_clog_ui_name[] = "fmpz_clog_ui"; -char fmpz_cmp2abs_name[] = "fmpz_cmp2abs"; -char fmpz_cmpabs_name[] = "fmpz_cmpabs"; -char fmpz_cmp_name[] = "fmpz_cmp"; -char fmpz_cmp_si_name[] = "fmpz_cmp_si"; -char fmpz_cmp_ui_name[] = "fmpz_cmp_ui"; -char fmpz_comb_init_clear_name[] = "fmpz_comb_init_clear"; -char fmpz_combit_name[] = "fmpz_combit"; -char fmpz_complement_name[] = "fmpz_complement"; -char fmpz_CRT_name[] = "fmpz_CRT"; -char fmpz_CRT_ui_name[] = "fmpz_CRT_ui"; -char fmpz_divexact2_uiui_name[] = "fmpz_divexact2_uiui"; -char fmpz_divexact_name[] = "fmpz_divexact"; -char fmpz_divexact_si_name[] = "fmpz_divexact_si"; -char fmpz_divexact_ui_name[] = "fmpz_divexact_ui"; -char fmpz_divides_name[] = "fmpz_divides"; -char fmpz_divides_mod_list_name[] = "fmpz_divides_mod_list"; -char fmpz_divisible_name[] = "fmpz_divisible"; -char fmpz_divisible_si_name[] = "fmpz_divisible_si"; -char fmpz_divisor_in_residue_class_lenstra_name[] = "fmpz_divisor_in_residue_class_lenstra"; -char fmpz_divisor_sigma_name[] = "fmpz_divisor_sigma"; -char fmpz_div_newton_name[] = "fmpz_div_newton"; -char fmpz_dlog_name[] = "fmpz_dlog"; -char fmpz_equal_name[] = "fmpz_equal"; -char fmpz_equal_si_name[] = "fmpz_equal_si"; -char fmpz_equal_ui_name[] = "fmpz_equal_ui"; -char fmpz_euler_phi_name[] = "fmpz_euler_phi"; -char fmpz_fac_ui_name[] = "fmpz_fac_ui"; -char fmpz_fdiv_q_2exp_name[] = "fmpz_fdiv_q_2exp"; -char fmpz_fdiv_q_name[] = "fmpz_fdiv_q"; -char fmpz_fdiv_qr_name[] = "fmpz_fdiv_qr"; -char fmpz_fdiv_qr_preinvn_name[] = "fmpz_fdiv_qr_preinvn"; -char fmpz_fdiv_q_si_name[] = "fmpz_fdiv_q_si"; -char fmpz_fdiv_q_ui_name[] = "fmpz_fdiv_q_ui"; -char fmpz_fdiv_r_2exp_name[] = "fmpz_fdiv_r_2exp"; -char fmpz_fdiv_r_name[] = "fmpz_fdiv_r"; -char fmpz_fdiv_ui_name[] = "fmpz_fdiv_ui"; -char fmpz_fib_ui_name[] = "fmpz_fib_ui"; -char fmpz_fits_si_name[] = "fmpz_fits_si"; -char fmpz_flog_name[] = "fmpz_flog"; -char fmpz_flog_ui_name[] = "fmpz_flog_ui"; -char fmpz_fmma_name[] = "fmpz_fmma"; -char fmpz_fmms_name[] = "fmpz_fmms"; -char fmpz_fmpz_name[] = "fmpz_fmpz"; -char fmpz_cleanup_name[] = "fmpz_cleanup"; -char fmpz_stress_name[] = "fmpz_stress"; -char fmpz_gcd3_name[] = "fmpz_gcd3"; -char fmpz_gcd_name[] = "fmpz_gcd"; -char fmpz_gcdinv_name[] = "fmpz_gcdinv"; -char fmpz_gcd_ui_name[] = "fmpz_gcd_ui"; -char fmpz_get_d_2exp_name[] = "fmpz_get_d_2exp"; -char fmpz_get_d_name[] = "fmpz_get_d"; -char fmpz_get_mpf_name[] = "fmpz_get_mpf"; -char fmpz_get_mpfr_name[] = "fmpz_get_mpfr"; -char fmpz_get_mpn_name[] = "fmpz_get_mpn"; -char fmpz_get_mpz_name[] = "fmpz_get_mpz"; -char fmpz_get_nmod_name[] = "fmpz_get_nmod"; -char fmpz_get_set_ui_array_name[] = "fmpz_get_set_ui_array"; -char fmpz_get_si_name[] = "fmpz_get_si"; -char fmpz_get_str_name[] = "fmpz_get_str"; -char fmpz_get_ui_name[] = "fmpz_get_ui"; -char fmpz_init2_name[] = "fmpz_init2"; -char fmpz_init_set_name[] = "fmpz_init_set"; -char fmpz_init_set_readonly_name[] = "fmpz_init_set_readonly"; -char fmpz_init_set_ui_name[] = "fmpz_init_set_ui"; -char fmpz_invmod_name[] = "fmpz_invmod"; -char fmpz_is_even_name[] = "fmpz_is_even"; -char fmpz_is_perfect_power_name[] = "fmpz_is_perfect_power"; -char fmpz_is_prime_name[] = "fmpz_is_prime"; -char fmpz_is_prime_morrison_name[] = "fmpz_is_prime_morrison"; -char fmpz_is_prime_pocklington_name[] = "fmpz_is_prime_pocklington"; -char fmpz_is_prime_pseudosquare_name[] = "fmpz_is_prime_pseudosquare"; -char fmpz_is_probabprime_BPSW_name[] = "fmpz_is_probabprime_BPSW"; -char fmpz_is_probabprime_lucas_name[] = "fmpz_is_probabprime_lucas"; -char fmpz_is_square_name[] = "fmpz_is_square"; -char fmpz_is_strong_probabprime_name[] = "fmpz_is_strong_probabprime"; -char fmpz_jacobi_name[] = "fmpz_jacobi"; -char fmpz_kronecker_name[] = "fmpz_kronecker"; -char fmpz_lcm_name[] = "fmpz_lcm"; -char fmpz_mod_name[] = "fmpz_mod"; -char fmpz_mod_ui_name[] = "fmpz_mod_ui"; -char fmpz_moebius_mu_name[] = "fmpz_moebius_mu"; -char fmpz_mpz_init_set_readonly_name[] = "fmpz_mpz_init_set_readonly"; -char fmpz_mul_2exp_name[] = "fmpz_mul_2exp"; -char fmpz_mul2_uiui_name[] = "fmpz_mul2_uiui"; -char fmpz_mul_name[] = "fmpz_mul"; -char fmpz_mul_si_name[] = "fmpz_mul_si"; -char fmpz_mul_si_tdiv_q_2exp_name[] = "fmpz_mul_si_tdiv_q_2exp"; -char fmpz_mul_tdiv_q_2exp_name[] = "fmpz_mul_tdiv_q_2exp"; -char fmpz_multi_CRT_multi_mod_name[] = "fmpz_multi_CRT_multi_mod"; -char fmpz_multi_CRT_ui_name[] = "fmpz_multi_CRT_ui"; -char fmpz_mul_ui_name[] = "fmpz_mul_ui"; -char fmpz_ndiv_qr_name[] = "fmpz_ndiv_qr"; -char fmpz_neg_name[] = "fmpz_neg"; -char fmpz_neg_ui_name[] = "fmpz_neg_ui"; -char fmpz_neg_uiui_name[] = "fmpz_neg_uiui"; -char fmpz_nextprime_name[] = "fmpz_nextprime"; -char fmpz_or_name[] = "fmpz_or"; -char fmpz_out_inp_raw_name[] = "fmpz_out_inp_raw"; -char fmpz_popcnt_name[] = "fmpz_popcnt"; -char fmpz_powm_name[] = "fmpz_powm"; -char fmpz_powm_ui_name[] = "fmpz_powm_ui"; -char fmpz_pow_ui_name[] = "fmpz_pow_ui"; -char fmpz_primorial_name[] = "fmpz_primorial"; -char fmpz_print_read_name[] = "fmpz_print_read"; -char fmpz_randprime_name[] = "fmpz_randprime"; -char fmpz_remove_name[] = "fmpz_remove"; -char fmpz_rfac_ui_name[] = "fmpz_rfac_ui"; -char fmpz_rfac_uiui_name[] = "fmpz_rfac_uiui"; -char fmpz_root_name[] = "fmpz_root"; -char fmpz_setbit_name[] = "fmpz_setbit"; -char fmpz_set_name[] = "fmpz_set"; -char fmpz_set_d_2exp_name[] = "fmpz_set_d_2exp"; -char fmpz_set_signed_ui_array_name[] = "fmpz_set_signed_ui_array"; -char fmpz_set_signed_uiui_name[] = "fmpz_set_signed_uiui"; -char fmpz_set_signed_uiuiui_name[] = "fmpz_set_signed_uiuiui"; -char fmpz_set_str_name[] = "fmpz_set_str"; -char fmpz_set_ui_smod_name[] = "fmpz_set_ui_smod"; -char fmpz_set_uiui_name[] = "fmpz_set_uiui"; -char fmpz_sgn_name[] = "fmpz_sgn"; -char fmpz_size_name[] = "fmpz_size"; -char fmpz_sizeinbase_name[] = "fmpz_sizeinbase"; -char fmpz_smod_name[] = "fmpz_smod"; -char fmpz_sqrt_name[] = "fmpz_sqrt"; -char fmpz_sqrtmod_name[] = "fmpz_sqrtmod"; -char fmpz_sqrtrem_name[] = "fmpz_sqrtrem"; -char fmpz_sub_name[] = "fmpz_sub"; -char fmpz_submul_name[] = "fmpz_submul"; -char fmpz_submul_si_name[] = "fmpz_submul_si"; -char fmpz_submul_ui_name[] = "fmpz_submul_ui"; -char fmpz_sub_ui_name[] = "fmpz_sub_ui"; -char fmpz_swap_name[] = "fmpz_swap"; -char fmpz_tdiv_q_2exp_name[] = "fmpz_tdiv_q_2exp"; -char fmpz_tdiv_q_name[] = "fmpz_tdiv_q"; -char fmpz_tdiv_qr_name[] = "fmpz_tdiv_qr"; -char fmpz_tdiv_q_si_name[] = "fmpz_tdiv_q_si"; -char fmpz_tdiv_q_ui_name[] = "fmpz_tdiv_q_ui"; -char fmpz_tdiv_r_2exp_name[] = "fmpz_tdiv_r_2exp"; -char fmpz_tdiv_ui_name[] = "fmpz_tdiv_ui"; -char fmpz_tstbit_name[] = "fmpz_tstbit"; -char fmpz_val2_name[] = "fmpz_val2"; -char fmpz_xgcd_name[] = "fmpz_xgcd"; -char fmpz_xgcd_canonical_bezout_name[] = "fmpz_xgcd_canonical_bezout"; -char fmpz_xgcd_partial_name[] = "fmpz_xgcd_partial"; -char fmpz_xor_name[] = "fmpz_xor"; - -char * test_names[] = -{ - fmpz_abs_name, - fmpz_abs_fits_ui_name, - fmpz_abs_lbound_ui_2exp_name, - fmpz_abs_ubound_ui_2exp_name, - fmpz_add_name, - fmpz_addmul_name, - fmpz_addmul_si_name, - fmpz_addmul_ui_name, - fmpz_add_ui_name, - fmpz_and_name, - fmpz_bin_uiui_name, - fmpz_bit_pack_name, - fmpz_bits_name, - fmpz_cdiv_q_2exp_name, - fmpz_cdiv_q_name, - fmpz_cdiv_qr_name, - fmpz_cdiv_q_si_name, - fmpz_cdiv_q_ui_name, - fmpz_cdiv_r_2exp_name, - fmpz_cdiv_ui_name, - fmpz_clog_name, - fmpz_clog_ui_name, - fmpz_cmp2abs_name, - fmpz_cmpabs_name, - fmpz_cmp_name, - fmpz_cmp_si_name, - fmpz_cmp_ui_name, - fmpz_comb_init_clear_name, - fmpz_combit_name, - fmpz_complement_name, - fmpz_CRT_name, - fmpz_CRT_ui_name, - fmpz_divexact2_uiui_name, - fmpz_divexact_name, - fmpz_divexact_si_name, - fmpz_divexact_ui_name, - fmpz_divides_name, - fmpz_divides_mod_list_name, - fmpz_divisible_name, - fmpz_divisible_si_name, - fmpz_divisor_in_residue_class_lenstra_name, - fmpz_divisor_sigma_name, - fmpz_div_newton_name, - fmpz_dlog_name, - fmpz_equal_name, - fmpz_equal_si_name, - fmpz_equal_ui_name, - fmpz_euler_phi_name, - fmpz_fac_ui_name, - fmpz_fdiv_q_2exp_name, - fmpz_fdiv_q_name, - fmpz_fdiv_qr_name, - fmpz_fdiv_qr_preinvn_name, - fmpz_fdiv_q_si_name, - fmpz_fdiv_q_ui_name, - fmpz_fdiv_r_2exp_name, - fmpz_fdiv_r_name, - fmpz_fdiv_ui_name, - fmpz_fib_ui_name, - fmpz_fits_si_name, - fmpz_flog_name, - fmpz_flog_ui_name, - fmpz_fmma_name, - fmpz_fmms_name, - fmpz_fmpz_name, - fmpz_cleanup_name, - fmpz_stress_name, - fmpz_gcd3_name, - fmpz_gcd_name, - fmpz_gcdinv_name, - fmpz_gcd_ui_name, - fmpz_get_d_2exp_name, - fmpz_get_d_name, - fmpz_get_mpf_name, - fmpz_get_mpfr_name, - fmpz_get_mpn_name, - fmpz_get_mpz_name, - fmpz_get_nmod_name, - fmpz_get_set_ui_array_name, - fmpz_get_si_name, - fmpz_get_str_name, - fmpz_get_ui_name, - fmpz_init2_name, - fmpz_init_set_name, - fmpz_init_set_readonly_name, - fmpz_init_set_ui_name, - fmpz_invmod_name, - fmpz_is_even_name, - fmpz_is_perfect_power_name, - fmpz_is_prime_name, - fmpz_is_prime_morrison_name, - fmpz_is_prime_pocklington_name, - fmpz_is_prime_pseudosquare_name, - fmpz_is_probabprime_BPSW_name, - fmpz_is_probabprime_lucas_name, - fmpz_is_square_name, - fmpz_is_strong_probabprime_name, - fmpz_jacobi_name, - fmpz_kronecker_name, - fmpz_lcm_name, - fmpz_mod_name, - fmpz_mod_ui_name, - fmpz_moebius_mu_name, - fmpz_mpz_init_set_readonly_name, - fmpz_mul_2exp_name, - fmpz_mul2_uiui_name, - fmpz_mul_name, - fmpz_mul_si_name, - fmpz_mul_si_tdiv_q_2exp_name, - fmpz_mul_tdiv_q_2exp_name, - fmpz_multi_CRT_multi_mod_name, - fmpz_multi_CRT_ui_name, - fmpz_mul_ui_name, - fmpz_ndiv_qr_name, - fmpz_neg_name, - fmpz_neg_ui_name, - fmpz_neg_uiui_name, - fmpz_nextprime_name, - fmpz_or_name, - fmpz_out_inp_raw_name, - fmpz_popcnt_name, - fmpz_powm_name, - fmpz_powm_ui_name, - fmpz_pow_ui_name, - fmpz_primorial_name, - fmpz_print_read_name, - fmpz_randprime_name, - fmpz_remove_name, - fmpz_rfac_ui_name, - fmpz_rfac_uiui_name, - fmpz_root_name, - fmpz_setbit_name, - fmpz_set_name, - fmpz_set_d_2exp_name, - fmpz_set_signed_ui_array_name, - fmpz_set_signed_uiui_name, - fmpz_set_signed_uiuiui_name, - fmpz_set_str_name, - fmpz_set_ui_smod_name, - fmpz_set_uiui_name, - fmpz_sgn_name, - fmpz_size_name, - fmpz_sizeinbase_name, - fmpz_smod_name, - fmpz_sqrt_name, - fmpz_sqrtmod_name, - fmpz_sqrtrem_name, - fmpz_sub_name, - fmpz_submul_name, - fmpz_submul_si_name, - fmpz_submul_ui_name, - fmpz_sub_ui_name, - fmpz_swap_name, - fmpz_tdiv_q_2exp_name, - fmpz_tdiv_q_name, - fmpz_tdiv_qr_name, - fmpz_tdiv_q_si_name, - fmpz_tdiv_q_ui_name, - fmpz_tdiv_r_2exp_name, - fmpz_tdiv_ui_name, - fmpz_tstbit_name, - fmpz_val2_name, - fmpz_xgcd_name, - fmpz_xgcd_canonical_bezout_name, - fmpz_xgcd_partial_name, - fmpz_xor_name -}; - /* main function *************************************************************/ -#define NUMBER_OF_TESTS (sizeof(test_functions) / sizeof(int (*)(void))) - -int -main(int argc, char ** argv) -{ - int ix, jx; - - if (argc < 2) - { - for (ix = 0; ix < NUMBER_OF_TESTS; ix++) - if (test_functions[ix]()) - flint_abort(); - } - else - { - for (ix = 1; ix < argc; ix++) - { - for (jx = 0; jx < NUMBER_OF_TESTS; jx++) - { - /* If argument equals to test name, run it */ - if (strcmp(argv[ix], test_names[jx]) == 0) - { - if (test_functions[jx]()) - flint_abort(); - break; - } - } - - if (jx == NUMBER_OF_TESTS) - { - fprintf(stderr, "Error: Could not find test function for %s\n", argv[ix]); - flint_abort(); - } - } - } - - return 0; -} +TEST_MAIN(tests) diff --git a/src/fmpz_mat/test/main.c b/src/fmpz_mat/test/main.c index e4d9193e3e..3e1bebc948 100644 --- a/src/fmpz_mat/test/main.c +++ b/src/fmpz_mat/test/main.c @@ -114,7 +114,7 @@ /* Array of test functions ***************************************************/ -int (*test_functions[])(void) = +test_struct tests[] = { TEST_FUNCTION(fmpz_mat_add_sub), TEST_FUNCTION(fmpz_mat_can_solve_fflu), @@ -211,234 +211,6 @@ int (*test_functions[])(void) = TEST_FUNCTION(fmpz_mat_zero) }; -char fmpz_mat_add_sub_name[] = "fmpz_mat_add_sub"; -char fmpz_mat_can_solve_fflu_name[] = "fmpz_mat_can_solve_fflu"; -char fmpz_mat_can_solve_multi_mod_den_name[] = "fmpz_mat_can_solve_multi_mod_den"; -char fmpz_mat_charpoly_berkowitz_name[] = "fmpz_mat_charpoly_berkowitz"; -char fmpz_mat_charpoly_name[] = "fmpz_mat_charpoly"; -char fmpz_mat_chol_d_name[] = "fmpz_mat_chol_d"; -char fmpz_mat_col_partition_name[] = "fmpz_mat_col_partition"; -char fmpz_mat_concat_horizontal_name[] = "fmpz_mat_concat_horizontal"; -char fmpz_mat_concat_vertical_name[] = "fmpz_mat_concat_vertical"; -char fmpz_mat_content_name[] = "fmpz_mat_content"; -char fmpz_mat_CRT_ui_name[] = "fmpz_mat_CRT_ui"; -char fmpz_mat_CRT_ui_unsigned_name[] = "fmpz_mat_CRT_ui_unsigned"; -char fmpz_mat_det_bound_name[] = "fmpz_mat_det_bound"; -char fmpz_mat_det_name[] = "fmpz_mat_det"; -char fmpz_mat_det_divisor_name[] = "fmpz_mat_det_divisor"; -char fmpz_mat_det_modular_accelerated_name[] = "fmpz_mat_det_modular_accelerated"; -char fmpz_mat_det_modular_name[] = "fmpz_mat_det_modular"; -char fmpz_mat_entry_name[] = "fmpz_mat_entry"; -char fmpz_mat_equal_name[] = "fmpz_mat_equal"; -char fmpz_mat_fmpz_vec_mul_name[] = "fmpz_mat_fmpz_vec_mul"; -char fmpz_mat_get_d_mat_name[] = "fmpz_mat_get_d_mat"; -char fmpz_mat_get_d_mat_transpose_name[] = "fmpz_mat_get_d_mat_transpose"; -char fmpz_mat_get_nmod_mat_name[] = "fmpz_mat_get_nmod_mat"; -char fmpz_mat_gram_name[] = "fmpz_mat_gram"; -char fmpz_mat_hadamard_name[] = "fmpz_mat_hadamard"; -char fmpz_mat_hnf_name[] = "fmpz_mat_hnf"; -char fmpz_mat_hnf_classical_name[] = "fmpz_mat_hnf_classical"; -char fmpz_mat_hnf_minors_name[] = "fmpz_mat_hnf_minors"; -char fmpz_mat_hnf_minors_transform_name[] = "fmpz_mat_hnf_minors_transform"; -char fmpz_mat_hnf_modular_name[] = "fmpz_mat_hnf_modular"; -char fmpz_mat_hnf_modular_eldiv_name[] = "fmpz_mat_hnf_modular_eldiv"; -char fmpz_mat_hnf_pernet_stein_name[] = "fmpz_mat_hnf_pernet_stein"; -char fmpz_mat_hnf_transform_name[] = "fmpz_mat_hnf_transform"; -char fmpz_mat_hnf_xgcd_name[] = "fmpz_mat_hnf_xgcd"; -char fmpz_mat_howell_form_mod_name[] = "fmpz_mat_howell_form_mod"; -char fmpz_mat_init_clear_name[] = "fmpz_mat_init_clear"; -char fmpz_mat_inv_name[] = "fmpz_mat_inv"; -char fmpz_mat_invert_rows_cols_name[] = "fmpz_mat_invert_rows_cols"; -char fmpz_mat_is_empty_name[] = "fmpz_mat_is_empty"; -char fmpz_mat_is_one_name[] = "fmpz_mat_is_one"; -char fmpz_mat_is_square_name[] = "fmpz_mat_is_square"; -char fmpz_mat_is_zero_name[] = "fmpz_mat_is_zero"; -char fmpz_mat_kronecker_product_name[] = "fmpz_mat_kronecker_product"; -char fmpz_mat_lll_original_name[] = "fmpz_mat_lll_original"; -char fmpz_mat_lll_storjohann_name[] = "fmpz_mat_lll_storjohann"; -char fmpz_mat_max_bits_name[] = "fmpz_mat_max_bits"; -char fmpz_mat_minpoly_name[] = "fmpz_mat_minpoly"; -char fmpz_mat_mul_blas_name[] = "fmpz_mat_mul_blas"; -char fmpz_mat_mul_name[] = "fmpz_mat_mul"; -char fmpz_mat_mul_classical_name[] = "fmpz_mat_mul_classical"; -char fmpz_mat_mul_double_word_name[] = "fmpz_mat_mul_double_word"; -char fmpz_mat_mul_fft_name[] = "fmpz_mat_mul_fft"; -char fmpz_mat_mul_fmpz_vec_name[] = "fmpz_mat_mul_fmpz_vec"; -char fmpz_mat_mul_multi_mod_name[] = "fmpz_mat_mul_multi_mod"; -char fmpz_mat_mul_small_name[] = "fmpz_mat_mul_small"; -char fmpz_mat_mul_strassen_name[] = "fmpz_mat_mul_strassen"; -char fmpz_mat_multi_CRT_ui_name[] = "fmpz_mat_multi_CRT_ui"; -char fmpz_mat_multi_CRT_ui_unsigned_name[] = "fmpz_mat_multi_CRT_ui_unsigned"; -char fmpz_mat_nullspace_name[] = "fmpz_mat_nullspace"; -char fmpz_mat_one_name[] = "fmpz_mat_one"; -char fmpz_mat_pow_name[] = "fmpz_mat_pow"; -char fmpz_mat_print_read_name[] = "fmpz_mat_print_read"; -char fmpz_mat_rank_name[] = "fmpz_mat_rank"; -char fmpz_mat_rref_name[] = "fmpz_mat_rref"; -char fmpz_mat_rref_fflu_name[] = "fmpz_mat_rref_fflu"; -char fmpz_mat_rref_mod_name[] = "fmpz_mat_rref_mod"; -char fmpz_mat_rref_mul_name[] = "fmpz_mat_rref_mul"; -char fmpz_mat_scalar_addmul_fmpz_name[] = "fmpz_mat_scalar_addmul_fmpz"; -char fmpz_mat_scalar_addmul_nmod_mat_fmpz_name[] = "fmpz_mat_scalar_addmul_nmod_mat_fmpz"; -char fmpz_mat_scalar_addmul_nmod_mat_ui_name[] = "fmpz_mat_scalar_addmul_nmod_mat_ui"; -char fmpz_mat_scalar_addmul_si_name[] = "fmpz_mat_scalar_addmul_si"; -char fmpz_mat_scalar_addmul_ui_name[] = "fmpz_mat_scalar_addmul_ui"; -char fmpz_mat_scalar_mod_fmpz_name[] = "fmpz_mat_scalar_mod_fmpz"; -char fmpz_mat_scalar_mul_2exp_name[] = "fmpz_mat_scalar_mul_2exp"; -char fmpz_mat_scalar_mul_fmpz_name[] = "fmpz_mat_scalar_mul_fmpz"; -char fmpz_mat_scalar_mul_si_name[] = "fmpz_mat_scalar_mul_si"; -char fmpz_mat_scalar_mul_ui_name[] = "fmpz_mat_scalar_mul_ui"; -char fmpz_mat_scalar_smod_name[] = "fmpz_mat_scalar_smod"; -char fmpz_mat_snf_diagonal_name[] = "fmpz_mat_snf_diagonal"; -char fmpz_mat_snf_iliopoulos_name[] = "fmpz_mat_snf_iliopoulos"; -char fmpz_mat_snf_kannan_bachem_name[] = "fmpz_mat_snf_kannan_bachem"; -char fmpz_mat_solve_bound_name[] = "fmpz_mat_solve_bound"; -char fmpz_mat_solve_name[] = "fmpz_mat_solve"; -char fmpz_mat_solve_cramer_name[] = "fmpz_mat_solve_cramer"; -char fmpz_mat_solve_dixon_name[] = "fmpz_mat_solve_dixon"; -char fmpz_mat_solve_dixon_den_name[] = "fmpz_mat_solve_dixon_den"; -char fmpz_mat_solve_fflu_name[] = "fmpz_mat_solve_fflu"; -char fmpz_mat_solve_multi_mod_den_name[] = "fmpz_mat_solve_multi_mod_den"; -char fmpz_mat_sqr_name[] = "fmpz_mat_sqr"; -char fmpz_mat_trace_name[] = "fmpz_mat_trace"; -char fmpz_mat_transpose_name[] = "fmpz_mat_transpose"; -char fmpz_mat_window_init_clear_name[] = "fmpz_mat_window_init_clear"; -char fmpz_mat_zero_name[] = "fmpz_mat_zero"; - -char * test_names[] = -{ - fmpz_mat_add_sub_name, - fmpz_mat_can_solve_fflu_name, - fmpz_mat_can_solve_multi_mod_den_name, - fmpz_mat_charpoly_berkowitz_name, - fmpz_mat_charpoly_name, - fmpz_mat_chol_d_name, - fmpz_mat_col_partition_name, - fmpz_mat_concat_horizontal_name, - fmpz_mat_concat_vertical_name, - fmpz_mat_content_name, - fmpz_mat_CRT_ui_name, - fmpz_mat_CRT_ui_unsigned_name, - fmpz_mat_det_bound_name, - fmpz_mat_det_name, - fmpz_mat_det_divisor_name, - fmpz_mat_det_modular_accelerated_name, - fmpz_mat_det_modular_name, - fmpz_mat_entry_name, - fmpz_mat_equal_name, - fmpz_mat_fmpz_vec_mul_name, - fmpz_mat_get_d_mat_name, - fmpz_mat_get_d_mat_transpose_name, - fmpz_mat_get_nmod_mat_name, - fmpz_mat_gram_name, - fmpz_mat_hadamard_name, - fmpz_mat_hnf_name, - fmpz_mat_hnf_classical_name, - fmpz_mat_hnf_minors_name, - fmpz_mat_hnf_minors_transform_name, - fmpz_mat_hnf_modular_name, - fmpz_mat_hnf_modular_eldiv_name, - fmpz_mat_hnf_pernet_stein_name, - fmpz_mat_hnf_transform_name, - fmpz_mat_hnf_xgcd_name, - fmpz_mat_howell_form_mod_name, - fmpz_mat_init_clear_name, - fmpz_mat_inv_name, - fmpz_mat_invert_rows_cols_name, - fmpz_mat_is_empty_name, - fmpz_mat_is_one_name, - fmpz_mat_is_square_name, - fmpz_mat_is_zero_name, - fmpz_mat_kronecker_product_name, - fmpz_mat_lll_original_name, - fmpz_mat_lll_storjohann_name, - fmpz_mat_max_bits_name, - fmpz_mat_minpoly_name, - fmpz_mat_mul_blas_name, - fmpz_mat_mul_name, - fmpz_mat_mul_classical_name, - fmpz_mat_mul_double_word_name, - fmpz_mat_mul_fft_name, - fmpz_mat_mul_fmpz_vec_name, - fmpz_mat_mul_multi_mod_name, - fmpz_mat_mul_small_name, - fmpz_mat_mul_strassen_name, - fmpz_mat_multi_CRT_ui_name, - fmpz_mat_multi_CRT_ui_unsigned_name, - fmpz_mat_nullspace_name, - fmpz_mat_one_name, - fmpz_mat_pow_name, - fmpz_mat_print_read_name, - fmpz_mat_rank_name, - fmpz_mat_rref_name, - fmpz_mat_rref_fflu_name, - fmpz_mat_rref_mod_name, - fmpz_mat_rref_mul_name, - fmpz_mat_scalar_addmul_fmpz_name, - fmpz_mat_scalar_addmul_nmod_mat_fmpz_name, - fmpz_mat_scalar_addmul_nmod_mat_ui_name, - fmpz_mat_scalar_addmul_si_name, - fmpz_mat_scalar_addmul_ui_name, - fmpz_mat_scalar_mod_fmpz_name, - fmpz_mat_scalar_mul_2exp_name, - fmpz_mat_scalar_mul_fmpz_name, - fmpz_mat_scalar_mul_si_name, - fmpz_mat_scalar_mul_ui_name, - fmpz_mat_scalar_smod_name, - fmpz_mat_snf_diagonal_name, - fmpz_mat_snf_iliopoulos_name, - fmpz_mat_snf_kannan_bachem_name, - fmpz_mat_solve_bound_name, - fmpz_mat_solve_name, - fmpz_mat_solve_cramer_name, - fmpz_mat_solve_dixon_name, - fmpz_mat_solve_dixon_den_name, - fmpz_mat_solve_fflu_name, - fmpz_mat_solve_multi_mod_den_name, - fmpz_mat_sqr_name, - fmpz_mat_trace_name, - fmpz_mat_transpose_name, - fmpz_mat_window_init_clear_name, - fmpz_mat_zero_name -}; - /* main function *************************************************************/ -#define NUMBER_OF_TESTS (sizeof(test_functions) / sizeof(int (*)(void))) - -int -main(int argc, char ** argv) -{ - int ix, jx; - - if (argc < 2) - { - for (ix = 0; ix < NUMBER_OF_TESTS; ix++) - if (test_functions[ix]()) - flint_abort(); - } - else - { - for (ix = 1; ix < argc; ix++) - { - for (jx = 0; jx < NUMBER_OF_TESTS; jx++) - { - /* If argument equals to test name, run it */ - if (strcmp(argv[ix], test_names[jx]) == 0) - { - if (test_functions[jx]()) - flint_abort(); - break; - } - } - - if (jx == NUMBER_OF_TESTS) - { - fprintf(stderr, "Error: Could not find test function for %s\n", argv[ix]); - flint_abort(); - } - } - } - - return 0; -} +TEST_MAIN(tests) diff --git a/src/fmpz_poly/test/main.c b/src/fmpz_poly/test/main.c index 2fe9bac898..6155bbc42f 100644 --- a/src/fmpz_poly/test/main.c +++ b/src/fmpz_poly/test/main.c @@ -198,7 +198,7 @@ /* Array of test functions ***************************************************/ -int (*test_functions[])(void) = +test_struct tests[] = { TEST_FUNCTION(fmpz_poly_2norm_normalised_bits), TEST_FUNCTION(fmpz_poly_add), @@ -377,398 +377,6 @@ int (*test_functions[])(void) = TEST_FUNCTION(fmpz_poly_zero_coeffs) }; -char fmpz_poly_2norm_normalised_bits_name[] = "fmpz_poly_2norm_normalised_bits"; -char fmpz_poly_add_name[] = "fmpz_poly_add"; -char fmpz_poly_add_series_name[] = "fmpz_poly_add_series"; -char fmpz_poly_add_sub_fmpz_name[] = "fmpz_poly_add_sub_fmpz"; -char fmpz_poly_add_sub_si_name[] = "fmpz_poly_add_sub_si"; -char fmpz_poly_bit_pack_name[] = "fmpz_poly_bit_pack"; -char fmpz_poly_bound_roots_name[] = "fmpz_poly_bound_roots"; -char fmpz_poly_chebyshev_t_name[] = "fmpz_poly_chebyshev_t"; -char fmpz_poly_chebyshev_u_name[] = "fmpz_poly_chebyshev_u"; -char fmpz_poly_CLD_bound_name[] = "fmpz_poly_CLD_bound"; -char fmpz_poly_compose_name[] = "fmpz_poly_compose"; -char fmpz_poly_compose_divconquer_name[] = "fmpz_poly_compose_divconquer"; -char fmpz_poly_compose_horner_name[] = "fmpz_poly_compose_horner"; -char fmpz_poly_compose_series_brent_kung_name[] = "fmpz_poly_compose_series_brent_kung"; -char fmpz_poly_compose_series_name[] = "fmpz_poly_compose_series"; -char fmpz_poly_compose_series_horner_name[] = "fmpz_poly_compose_series_horner"; -char fmpz_poly_content_name[] = "fmpz_poly_content"; -char fmpz_poly_cos_minpoly_name[] = "fmpz_poly_cos_minpoly"; -char fmpz_poly_CRT_ui_name[] = "fmpz_poly_CRT_ui"; -char fmpz_poly_CRT_ui_unsigned_name[] = "fmpz_poly_CRT_ui_unsigned"; -char fmpz_poly_cyclotomic_name[] = "fmpz_poly_cyclotomic"; -char fmpz_poly_deflate_name[] = "fmpz_poly_deflate"; -char fmpz_poly_derivative_name[] = "fmpz_poly_derivative"; -char fmpz_poly_discriminant_name[] = "fmpz_poly_discriminant"; -char fmpz_poly_div_basecase_name[] = "fmpz_poly_div_basecase"; -char fmpz_poly_div_divconquer_name[] = "fmpz_poly_div_divconquer"; -char fmpz_poly_divhigh_smodp_name[] = "fmpz_poly_divhigh_smodp"; -char fmpz_poly_divides_name[] = "fmpz_poly_divides"; -char fmpz_poly_divlow_smodp_name[] = "fmpz_poly_divlow_smodp"; -char fmpz_poly_div_preinv_name[] = "fmpz_poly_div_preinv"; -char fmpz_poly_divrem_basecase_name[] = "fmpz_poly_divrem_basecase"; -char fmpz_poly_divrem_name[] = "fmpz_poly_divrem"; -char fmpz_poly_divrem_divconquer_name[] = "fmpz_poly_divrem_divconquer"; -char fmpz_poly_divrem_preinv_name[] = "fmpz_poly_divrem_preinv"; -char fmpz_poly_div_root_name[] = "fmpz_poly_div_root"; -char fmpz_poly_div_series_basecase_name[] = "fmpz_poly_div_series_basecase"; -char fmpz_poly_div_series_name[] = "fmpz_poly_div_series"; -char fmpz_poly_div_series_divconquer_name[] = "fmpz_poly_div_series_divconquer"; -char fmpz_poly_equal_fmpz_name[] = "fmpz_poly_equal_fmpz"; -char fmpz_poly_equal_trunc_name[] = "fmpz_poly_equal_trunc"; -char fmpz_poly_eta_qexp_name[] = "fmpz_poly_eta_qexp"; -char fmpz_poly_eulerian_polynomial_name[] = "fmpz_poly_eulerian_polynomial"; -char fmpz_poly_evaluate_divconquer_fmpq_name[] = "fmpz_poly_evaluate_divconquer_fmpq"; -char fmpz_poly_evaluate_divconquer_fmpz_name[] = "fmpz_poly_evaluate_divconquer_fmpz"; -char fmpz_poly_evaluate_fmpq_name[] = "fmpz_poly_evaluate_fmpq"; -char fmpz_poly_evaluate_fmpz_name[] = "fmpz_poly_evaluate_fmpz"; -char fmpz_poly_evaluate_horner_d_2exp_name[] = "fmpz_poly_evaluate_horner_d_2exp"; -char fmpz_poly_evaluate_horner_fmpq_name[] = "fmpz_poly_evaluate_horner_fmpq"; -char fmpz_poly_evaluate_horner_fmpz_name[] = "fmpz_poly_evaluate_horner_fmpz"; -char fmpz_poly_evaluate_mod_name[] = "fmpz_poly_evaluate_mod"; -char fmpz_poly_fibonacci_name[] = "fmpz_poly_fibonacci"; -char fmpz_poly_gcd_name[] = "fmpz_poly_gcd"; -char fmpz_poly_gcd_heuristic_name[] = "fmpz_poly_gcd_heuristic"; -char fmpz_poly_gcd_modular_name[] = "fmpz_poly_gcd_modular"; -char fmpz_poly_gcd_subresultant_name[] = "fmpz_poly_gcd_subresultant"; -char fmpz_poly_get_coeff_ptr_name[] = "fmpz_poly_get_coeff_ptr"; -char fmpz_poly_get_nmod_poly_name[] = "fmpz_poly_get_nmod_poly"; -char fmpz_poly_get_set_coeff_fmpz_name[] = "fmpz_poly_get_set_coeff_fmpz"; -char fmpz_poly_get_set_coeff_si_name[] = "fmpz_poly_get_set_coeff_si"; -char fmpz_poly_get_set_coeff_ui_name[] = "fmpz_poly_get_set_coeff_ui"; -char fmpz_poly_get_set_str_name[] = "fmpz_poly_get_set_str"; -char fmpz_poly_get_str_name[] = "fmpz_poly_get_str"; -char fmpz_poly_get_str_pretty_name[] = "fmpz_poly_get_str_pretty"; -char fmpz_poly_hensel_lift_name[] = "fmpz_poly_hensel_lift"; -char fmpz_poly_hensel_lift_once_name[] = "fmpz_poly_hensel_lift_once"; -char fmpz_poly_hensel_lift_without_only_inverse_name[] = "fmpz_poly_hensel_lift_without_only_inverse"; -char fmpz_poly_hensel_start_continue_lift_name[] = "fmpz_poly_hensel_start_continue_lift"; -char fmpz_poly_hermite_h_name[] = "fmpz_poly_hermite_h"; -char fmpz_poly_hermite_he_name[] = "fmpz_poly_hermite_he"; -char fmpz_poly_inflate_name[] = "fmpz_poly_inflate"; -char fmpz_poly_init_realloc_clear_name[] = "fmpz_poly_init_realloc_clear"; -char fmpz_poly_interpolate_fmpz_vec_name[] = "fmpz_poly_interpolate_fmpz_vec"; -char fmpz_poly_inv_series_basecase_name[] = "fmpz_poly_inv_series_basecase"; -char fmpz_poly_inv_series_name[] = "fmpz_poly_inv_series"; -char fmpz_poly_inv_series_newton_name[] = "fmpz_poly_inv_series_newton"; -char fmpz_poly_is_cyclotomic_name[] = "fmpz_poly_is_cyclotomic"; -char fmpz_poly_is_squarefree_name[] = "fmpz_poly_is_squarefree"; -char fmpz_poly_lcm_name[] = "fmpz_poly_lcm"; -char fmpz_poly_legendre_pt_name[] = "fmpz_poly_legendre_pt"; -char fmpz_poly_mul_name[] = "fmpz_poly_mul"; -char fmpz_poly_mul_classical_name[] = "fmpz_poly_mul_classical"; -char fmpz_poly_mulhigh_classical_name[] = "fmpz_poly_mulhigh_classical"; -char fmpz_poly_mulhigh_karatsuba_n_name[] = "fmpz_poly_mulhigh_karatsuba_n"; -char fmpz_poly_mulhigh_n_name[] = "fmpz_poly_mulhigh_n"; -char fmpz_poly_mul_karatsuba_name[] = "fmpz_poly_mul_karatsuba"; -char fmpz_poly_mul_KS_name[] = "fmpz_poly_mul_KS"; -char fmpz_poly_mullow_name[] = "fmpz_poly_mullow"; -char fmpz_poly_mullow_classical_name[] = "fmpz_poly_mullow_classical"; -char fmpz_poly_mullow_karatsuba_n_name[] = "fmpz_poly_mullow_karatsuba_n"; -char fmpz_poly_mullow_KS_name[] = "fmpz_poly_mullow_KS"; -char fmpz_poly_mullow_SS_name[] = "fmpz_poly_mullow_SS"; -char fmpz_poly_mullow_SS_precache_name[] = "fmpz_poly_mullow_SS_precache"; -char fmpz_poly_mulmid_classical_name[] = "fmpz_poly_mulmid_classical"; -char fmpz_poly_mul_SS_name[] = "fmpz_poly_mul_SS"; -char fmpz_poly_mul_SS_precache_name[] = "fmpz_poly_mul_SS_precache"; -char fmpz_poly_neg_name[] = "fmpz_poly_neg"; -char fmpz_poly_newton_to_monomial_name[] = "fmpz_poly_newton_to_monomial"; -char fmpz_poly_nth_derivative_name[] = "fmpz_poly_nth_derivative"; -char fmpz_poly_num_real_roots_name[] = "fmpz_poly_num_real_roots"; -char fmpz_poly_num_real_roots_sturm_name[] = "fmpz_poly_num_real_roots_sturm"; -char fmpz_poly_pow_addchains_name[] = "fmpz_poly_pow_addchains"; -char fmpz_poly_pow_binexp_name[] = "fmpz_poly_pow_binexp"; -char fmpz_poly_pow_binomial_name[] = "fmpz_poly_pow_binomial"; -char fmpz_poly_pow_name[] = "fmpz_poly_pow"; -char fmpz_poly_power_sums_name[] = "fmpz_poly_power_sums"; -char fmpz_poly_pow_multinomial_name[] = "fmpz_poly_pow_multinomial"; -char fmpz_poly_pow_trunc_name[] = "fmpz_poly_pow_trunc"; -char fmpz_poly_primitive_part_name[] = "fmpz_poly_primitive_part"; -char fmpz_poly_print_read_name[] = "fmpz_poly_print_read"; -char fmpz_poly_print_read_pretty_name[] = "fmpz_poly_print_read_pretty"; -char fmpz_poly_product_roots_fmpq_vec_name[] = "fmpz_poly_product_roots_fmpq_vec"; -char fmpz_poly_product_roots_fmpz_vec_name[] = "fmpz_poly_product_roots_fmpz_vec"; -char fmpz_poly_pseudo_div_name[] = "fmpz_poly_pseudo_div"; -char fmpz_poly_pseudo_divrem_basecase_name[] = "fmpz_poly_pseudo_divrem_basecase"; -char fmpz_poly_pseudo_divrem_cohen_name[] = "fmpz_poly_pseudo_divrem_cohen"; -char fmpz_poly_pseudo_divrem_divconquer_name[] = "fmpz_poly_pseudo_divrem_divconquer"; -char fmpz_poly_pseudo_rem_name[] = "fmpz_poly_pseudo_rem"; -char fmpz_poly_pseudo_rem_cohen_name[] = "fmpz_poly_pseudo_rem_cohen"; -char fmpz_poly_randtest_no_real_root_name[] = "fmpz_poly_randtest_no_real_root"; -char fmpz_poly_rem_basecase_name[] = "fmpz_poly_rem_basecase"; -char fmpz_poly_remove_name[] = "fmpz_poly_remove"; -char fmpz_poly_remove_content_2exp_name[] = "fmpz_poly_remove_content_2exp"; -char fmpz_poly_rem_powers_precomp_name[] = "fmpz_poly_rem_powers_precomp"; -char fmpz_poly_resultant_name[] = "fmpz_poly_resultant"; -char fmpz_poly_resultant_euclidean_name[] = "fmpz_poly_resultant_euclidean"; -char fmpz_poly_resultant_modular_name[] = "fmpz_poly_resultant_modular"; -char fmpz_poly_resultant_modular_div_name[] = "fmpz_poly_resultant_modular_div"; -char fmpz_poly_reverse_name[] = "fmpz_poly_reverse"; -char fmpz_poly_revert_series_name[] = "fmpz_poly_revert_series"; -char fmpz_poly_revert_series_lagrange_name[] = "fmpz_poly_revert_series_lagrange"; -char fmpz_poly_revert_series_lagrange_fast_name[] = "fmpz_poly_revert_series_lagrange_fast"; -char fmpz_poly_revert_series_newton_name[] = "fmpz_poly_revert_series_newton"; -char fmpz_poly_scalar_abs_name[] = "fmpz_poly_scalar_abs"; -char fmpz_poly_scalar_addmul_fmpz_name[] = "fmpz_poly_scalar_addmul_fmpz"; -char fmpz_poly_scalar_addmul_si_name[] = "fmpz_poly_scalar_addmul_si"; -char fmpz_poly_scalar_addmul_ui_name[] = "fmpz_poly_scalar_addmul_ui"; -char fmpz_poly_scalar_mul_fmpz_name[] = "fmpz_poly_scalar_mul_fmpz"; -char fmpz_poly_scalar_mul_si_name[] = "fmpz_poly_scalar_mul_si"; -char fmpz_poly_scalar_mul_ui_name[] = "fmpz_poly_scalar_mul_ui"; -char fmpz_poly_scalar_submul_fmpz_name[] = "fmpz_poly_scalar_submul_fmpz"; -char fmpz_poly_scale_2exp_name[] = "fmpz_poly_scale_2exp"; -char fmpz_poly_set_equal_name[] = "fmpz_poly_set_equal"; -char fmpz_poly_set_fmpz_equal_name[] = "fmpz_poly_set_fmpz_equal"; -char fmpz_poly_set_si_equal_name[] = "fmpz_poly_set_si_equal"; -char fmpz_poly_set_trunc_name[] = "fmpz_poly_set_trunc"; -char fmpz_poly_set_ui_equal_name[] = "fmpz_poly_set_ui_equal"; -char fmpz_poly_shift_left_right_name[] = "fmpz_poly_shift_left_right"; -char fmpz_poly_signature_name[] = "fmpz_poly_signature"; -char fmpz_poly_sqr_name[] = "fmpz_poly_sqr"; -char fmpz_poly_sqr_classical_name[] = "fmpz_poly_sqr_classical"; -char fmpz_poly_sqr_karatsuba_name[] = "fmpz_poly_sqr_karatsuba"; -char fmpz_poly_sqr_KS_name[] = "fmpz_poly_sqr_KS"; -char fmpz_poly_sqrlow_name[] = "fmpz_poly_sqrlow"; -char fmpz_poly_sqrlow_classical_name[] = "fmpz_poly_sqrlow_classical"; -char fmpz_poly_sqrlow_karatsuba_n_name[] = "fmpz_poly_sqrlow_karatsuba_n"; -char fmpz_poly_sqrlow_KS_name[] = "fmpz_poly_sqrlow_KS"; -char fmpz_poly_sqrt_name[] = "fmpz_poly_sqrt"; -char fmpz_poly_sqrt_classical_name[] = "fmpz_poly_sqrt_classical"; -char fmpz_poly_sqrt_divconquer_name[] = "fmpz_poly_sqrt_divconquer"; -char fmpz_poly_sqrt_KS_name[] = "fmpz_poly_sqrt_KS"; -char fmpz_poly_sqrtrem_classical_name[] = "fmpz_poly_sqrtrem_classical"; -char fmpz_poly_sqrtrem_divconquer_name[] = "fmpz_poly_sqrtrem_divconquer"; -char fmpz_poly_sqrt_series_name[] = "fmpz_poly_sqrt_series"; -char fmpz_poly_sub_name[] = "fmpz_poly_sub"; -char fmpz_poly_sub_series_name[] = "fmpz_poly_sub_series"; -char fmpz_poly_swap_name[] = "fmpz_poly_swap"; -char fmpz_poly_swinnerton_dyer_name[] = "fmpz_poly_swinnerton_dyer"; -char fmpz_poly_taylor_shift_name[] = "fmpz_poly_taylor_shift"; -char fmpz_poly_taylor_shift_divconquer_name[] = "fmpz_poly_taylor_shift_divconquer"; -char fmpz_poly_taylor_shift_horner_name[] = "fmpz_poly_taylor_shift_horner"; -char fmpz_poly_taylor_shift_multi_mod_threaded_name[] = "fmpz_poly_taylor_shift_multi_mod_threaded"; -char fmpz_poly_theta_qexp_name[] = "fmpz_poly_theta_qexp"; -char fmpz_poly_xgcd_modular_name[] = "fmpz_poly_xgcd_modular"; -char fmpz_poly_zero_name[] = "fmpz_poly_zero"; -char fmpz_poly_zero_coeffs_name[] = "fmpz_poly_zero_coeffs"; - -char * test_names[] = -{ - fmpz_poly_2norm_normalised_bits_name, - fmpz_poly_add_name, - fmpz_poly_add_series_name, - fmpz_poly_add_sub_fmpz_name, - fmpz_poly_add_sub_si_name, - fmpz_poly_bit_pack_name, - fmpz_poly_bound_roots_name, - fmpz_poly_chebyshev_t_name, - fmpz_poly_chebyshev_u_name, - fmpz_poly_CLD_bound_name, - fmpz_poly_compose_name, - fmpz_poly_compose_divconquer_name, - fmpz_poly_compose_horner_name, - fmpz_poly_compose_series_brent_kung_name, - fmpz_poly_compose_series_name, - fmpz_poly_compose_series_horner_name, - fmpz_poly_content_name, - fmpz_poly_cos_minpoly_name, - fmpz_poly_CRT_ui_name, - fmpz_poly_CRT_ui_unsigned_name, - fmpz_poly_cyclotomic_name, - fmpz_poly_deflate_name, - fmpz_poly_derivative_name, - fmpz_poly_discriminant_name, - fmpz_poly_div_basecase_name, - fmpz_poly_div_divconquer_name, - fmpz_poly_divhigh_smodp_name, - fmpz_poly_divides_name, - fmpz_poly_divlow_smodp_name, - fmpz_poly_div_preinv_name, - fmpz_poly_divrem_basecase_name, - fmpz_poly_divrem_name, - fmpz_poly_divrem_divconquer_name, - fmpz_poly_divrem_preinv_name, - fmpz_poly_div_root_name, - fmpz_poly_div_series_basecase_name, - fmpz_poly_div_series_name, - fmpz_poly_div_series_divconquer_name, - fmpz_poly_equal_fmpz_name, - fmpz_poly_equal_trunc_name, - fmpz_poly_eta_qexp_name, - fmpz_poly_eulerian_polynomial_name, - fmpz_poly_evaluate_divconquer_fmpq_name, - fmpz_poly_evaluate_divconquer_fmpz_name, - fmpz_poly_evaluate_fmpq_name, - fmpz_poly_evaluate_fmpz_name, - fmpz_poly_evaluate_horner_d_2exp_name, - fmpz_poly_evaluate_horner_fmpq_name, - fmpz_poly_evaluate_horner_fmpz_name, - fmpz_poly_evaluate_mod_name, - fmpz_poly_fibonacci_name, - fmpz_poly_gcd_name, - fmpz_poly_gcd_heuristic_name, - fmpz_poly_gcd_modular_name, - fmpz_poly_gcd_subresultant_name, - fmpz_poly_get_coeff_ptr_name, - fmpz_poly_get_nmod_poly_name, - fmpz_poly_get_set_coeff_fmpz_name, - fmpz_poly_get_set_coeff_si_name, - fmpz_poly_get_set_coeff_ui_name, - fmpz_poly_get_set_str_name, - fmpz_poly_get_str_name, - fmpz_poly_get_str_pretty_name, - fmpz_poly_hensel_lift_name, - fmpz_poly_hensel_lift_once_name, - fmpz_poly_hensel_lift_without_only_inverse_name, - fmpz_poly_hensel_start_continue_lift_name, - fmpz_poly_hermite_h_name, - fmpz_poly_hermite_he_name, - fmpz_poly_inflate_name, - fmpz_poly_init_realloc_clear_name, - fmpz_poly_interpolate_fmpz_vec_name, - fmpz_poly_inv_series_basecase_name, - fmpz_poly_inv_series_name, - fmpz_poly_inv_series_newton_name, - fmpz_poly_is_cyclotomic_name, - fmpz_poly_is_squarefree_name, - fmpz_poly_lcm_name, - fmpz_poly_legendre_pt_name, - fmpz_poly_mul_name, - fmpz_poly_mul_classical_name, - fmpz_poly_mulhigh_classical_name, - fmpz_poly_mulhigh_karatsuba_n_name, - fmpz_poly_mulhigh_n_name, - fmpz_poly_mul_karatsuba_name, - fmpz_poly_mul_KS_name, - fmpz_poly_mullow_name, - fmpz_poly_mullow_classical_name, - fmpz_poly_mullow_karatsuba_n_name, - fmpz_poly_mullow_KS_name, - fmpz_poly_mullow_SS_name, - fmpz_poly_mullow_SS_precache_name, - fmpz_poly_mulmid_classical_name, - fmpz_poly_mul_SS_name, - fmpz_poly_mul_SS_precache_name, - fmpz_poly_neg_name, - fmpz_poly_newton_to_monomial_name, - fmpz_poly_nth_derivative_name, - fmpz_poly_num_real_roots_name, - fmpz_poly_num_real_roots_sturm_name, - fmpz_poly_pow_addchains_name, - fmpz_poly_pow_binexp_name, - fmpz_poly_pow_binomial_name, - fmpz_poly_pow_name, - fmpz_poly_power_sums_name, - fmpz_poly_pow_multinomial_name, - fmpz_poly_pow_trunc_name, - fmpz_poly_primitive_part_name, - fmpz_poly_print_read_name, - fmpz_poly_print_read_pretty_name, - fmpz_poly_product_roots_fmpq_vec_name, - fmpz_poly_product_roots_fmpz_vec_name, - fmpz_poly_pseudo_div_name, - fmpz_poly_pseudo_divrem_basecase_name, - fmpz_poly_pseudo_divrem_cohen_name, - fmpz_poly_pseudo_divrem_divconquer_name, - fmpz_poly_pseudo_rem_name, - fmpz_poly_pseudo_rem_cohen_name, - fmpz_poly_randtest_no_real_root_name, - fmpz_poly_rem_basecase_name, - fmpz_poly_remove_name, - fmpz_poly_remove_content_2exp_name, - fmpz_poly_rem_powers_precomp_name, - fmpz_poly_resultant_name, - fmpz_poly_resultant_euclidean_name, - fmpz_poly_resultant_modular_name, - fmpz_poly_resultant_modular_div_name, - fmpz_poly_reverse_name, - fmpz_poly_revert_series_name, - fmpz_poly_revert_series_lagrange_name, - fmpz_poly_revert_series_lagrange_fast_name, - fmpz_poly_revert_series_newton_name, - fmpz_poly_scalar_abs_name, - fmpz_poly_scalar_addmul_fmpz_name, - fmpz_poly_scalar_addmul_si_name, - fmpz_poly_scalar_addmul_ui_name, - fmpz_poly_scalar_mul_fmpz_name, - fmpz_poly_scalar_mul_si_name, - fmpz_poly_scalar_mul_ui_name, - fmpz_poly_scalar_submul_fmpz_name, - fmpz_poly_scale_2exp_name, - fmpz_poly_set_equal_name, - fmpz_poly_set_fmpz_equal_name, - fmpz_poly_set_si_equal_name, - fmpz_poly_set_trunc_name, - fmpz_poly_set_ui_equal_name, - fmpz_poly_shift_left_right_name, - fmpz_poly_signature_name, - fmpz_poly_sqr_name, - fmpz_poly_sqr_classical_name, - fmpz_poly_sqr_karatsuba_name, - fmpz_poly_sqr_KS_name, - fmpz_poly_sqrlow_name, - fmpz_poly_sqrlow_classical_name, - fmpz_poly_sqrlow_karatsuba_n_name, - fmpz_poly_sqrlow_KS_name, - fmpz_poly_sqrt_name, - fmpz_poly_sqrt_classical_name, - fmpz_poly_sqrt_divconquer_name, - fmpz_poly_sqrt_KS_name, - fmpz_poly_sqrtrem_classical_name, - fmpz_poly_sqrtrem_divconquer_name, - fmpz_poly_sqrt_series_name, - fmpz_poly_sub_name, - fmpz_poly_sub_series_name, - fmpz_poly_swap_name, - fmpz_poly_swinnerton_dyer_name, - fmpz_poly_taylor_shift_name, - fmpz_poly_taylor_shift_divconquer_name, - fmpz_poly_taylor_shift_horner_name, - fmpz_poly_taylor_shift_multi_mod_threaded_name, - fmpz_poly_theta_qexp_name, - fmpz_poly_xgcd_modular_name, - fmpz_poly_zero_name, - fmpz_poly_zero_coeffs_name -}; - /* main function *************************************************************/ -#define NUMBER_OF_TESTS (sizeof(test_functions) / sizeof(int (*)(void))) - -int -main(int argc, char ** argv) -{ - int ix, jx; - - if (argc < 2) - { - for (ix = 0; ix < NUMBER_OF_TESTS; ix++) - if (test_functions[ix]()) - flint_abort(); - } - else - { - for (ix = 1; ix < argc; ix++) - { - for (jx = 0; jx < NUMBER_OF_TESTS; jx++) - { - /* If argument equals to test name, run it */ - if (strcmp(argv[ix], test_names[jx]) == 0) - { - if (test_functions[jx]()) - flint_abort(); - break; - } - } - - if (jx == NUMBER_OF_TESTS) - { - fprintf(stderr, "Error: Could not find test function for %s\n", argv[ix]); - flint_abort(); - } - } - } - - return 0; -} +TEST_MAIN(tests) diff --git a/src/nmod_poly/test/main.c b/src/nmod_poly/test/main.c index d845536d7c..2c295dafed 100644 --- a/src/nmod_poly/test/main.c +++ b/src/nmod_poly/test/main.c @@ -135,7 +135,7 @@ /* Array of test functions ***************************************************/ -int (*test_functions[])(void) = +test_struct tests[] = { TEST_FUNCTION(nmod_poly_add), TEST_FUNCTION(nmod_poly_add_series), @@ -258,286 +258,6 @@ int (*test_functions[])(void) = TEST_FUNCTION(nmod_poly_xgcd_hgcd) }; -char nmod_poly_add_name[] = "nmod_poly_add"; -char nmod_poly_add_series_name[] = "nmod_poly_add_series"; -char nmod_poly_asinh_series_name[] = "nmod_poly_asinh_series"; -char nmod_poly_asin_series_name[] = "nmod_poly_asin_series"; -char nmod_poly_atanh_series_name[] = "nmod_poly_atanh_series"; -char nmod_poly_atan_series_name[] = "nmod_poly_atan_series"; -char nmod_poly_berlekamp_massey_name[] = "nmod_poly_berlekamp_massey"; -char nmod_poly_bit_pack_name[] = "nmod_poly_bit_pack"; -char nmod_poly_compose_name[] = "nmod_poly_compose"; -char nmod_poly_compose_horner_name[] = "nmod_poly_compose_horner"; -char nmod_poly_compose_mod_brent_kung_name[] = "nmod_poly_compose_mod_brent_kung"; -char nmod_poly_compose_mod_brent_kung_precomp_preinv_name[] = "nmod_poly_compose_mod_brent_kung_precomp_preinv"; -char nmod_poly_compose_mod_brent_kung_precomp_preinv_threaded_name[] = "nmod_poly_compose_mod_brent_kung_precomp_preinv_threaded"; -char nmod_poly_compose_mod_brent_kung_preinv_name[] = "nmod_poly_compose_mod_brent_kung_preinv"; -char nmod_poly_compose_mod_brent_kung_vec_preinv_name[] = "nmod_poly_compose_mod_brent_kung_vec_preinv"; -char nmod_poly_compose_mod_brent_kung_vec_preinv_threaded_name[] = "nmod_poly_compose_mod_brent_kung_vec_preinv_threaded"; -char nmod_poly_compose_mod_name[] = "nmod_poly_compose_mod"; -char nmod_poly_compose_mod_horner_name[] = "nmod_poly_compose_mod_horner"; -char nmod_poly_compose_series_name[] = "nmod_poly_compose_series"; -char nmod_poly_cosh_series_name[] = "nmod_poly_cosh_series"; -char nmod_poly_cos_series_name[] = "nmod_poly_cos_series"; -char nmod_poly_deflate_name[] = "nmod_poly_deflate"; -char nmod_poly_derivative_name[] = "nmod_poly_derivative"; -char nmod_poly_discriminant_name[] = "nmod_poly_discriminant"; -char nmod_poly_div_name[] = "nmod_poly_div"; -char nmod_poly_divides_name[] = "nmod_poly_divides"; -char nmod_poly_divides_classical_name[] = "nmod_poly_divides_classical"; -char nmod_poly_div_newton_n_preinv_name[] = "nmod_poly_div_newton_n_preinv"; -char nmod_poly_divrem_basecase_name[] = "nmod_poly_divrem_basecase"; -char nmod_poly_divrem_name[] = "nmod_poly_divrem"; -char nmod_poly_divrem_newton_n_preinv_name[] = "nmod_poly_divrem_newton_n_preinv"; -char nmod_poly_div_root_name[] = "nmod_poly_div_root"; -char nmod_poly_div_series_basecase_name[] = "nmod_poly_div_series_basecase"; -char nmod_poly_div_series_name[] = "nmod_poly_div_series"; -char nmod_poly_equal_trunc_name[] = "nmod_poly_equal_trunc"; -char nmod_poly_evaluate_mat_horner_name[] = "nmod_poly_evaluate_mat_horner"; -char nmod_poly_evaluate_mat_paterson_stockmeyer_name[] = "nmod_poly_evaluate_mat_paterson_stockmeyer"; -char nmod_poly_evaluate_nmod_name[] = "nmod_poly_evaluate_nmod"; -char nmod_poly_evaluate_nmod_vec_fast_name[] = "nmod_poly_evaluate_nmod_vec_fast"; -char nmod_poly_exp_series_name[] = "nmod_poly_exp_series"; -char nmod_poly_find_distinct_nonzero_roots_name[] = "nmod_poly_find_distinct_nonzero_roots"; -char nmod_poly_fread_print_name[] = "nmod_poly_fread_print"; -char nmod_poly_gcd_name[] = "nmod_poly_gcd"; -char nmod_poly_gcd_euclidean_name[] = "nmod_poly_gcd_euclidean"; -char nmod_poly_gcd_hgcd_name[] = "nmod_poly_gcd_hgcd"; -char nmod_poly_gcdinv_name[] = "nmod_poly_gcdinv"; -char nmod_poly_get_set_coeff_ui_name[] = "nmod_poly_get_set_coeff_ui"; -char nmod_poly_get_set_str_name[] = "nmod_poly_get_set_str"; -char nmod_poly_hgcd_name[] = "nmod_poly_hgcd"; -char nmod_poly_inflate_name[] = "nmod_poly_inflate"; -char nmod_poly_init_realloc_clear_name[] = "nmod_poly_init_realloc_clear"; -char nmod_poly_integral_name[] = "nmod_poly_integral"; -char nmod_poly_interpolate_nmod_vec_barycentric_name[] = "nmod_poly_interpolate_nmod_vec_barycentric"; -char nmod_poly_interpolate_nmod_vec_name[] = "nmod_poly_interpolate_nmod_vec"; -char nmod_poly_interpolate_nmod_vec_fast_name[] = "nmod_poly_interpolate_nmod_vec_fast"; -char nmod_poly_interpolate_nmod_vec_newton_name[] = "nmod_poly_interpolate_nmod_vec_newton"; -char nmod_poly_invmod_name[] = "nmod_poly_invmod"; -char nmod_poly_inv_series_basecase_name[] = "nmod_poly_inv_series_basecase"; -char nmod_poly_inv_series_newton_name[] = "nmod_poly_inv_series_newton"; -char nmod_poly_invsqrt_series_name[] = "nmod_poly_invsqrt_series"; -char nmod_poly_log_series_name[] = "nmod_poly_log_series"; -char nmod_poly_make_monic_name[] = "nmod_poly_make_monic"; -char nmod_poly_mul_name[] = "nmod_poly_mul"; -char nmod_poly_mul_classical_name[] = "nmod_poly_mul_classical"; -char nmod_poly_mulhigh_name[] = "nmod_poly_mulhigh"; -char nmod_poly_mulhigh_classical_name[] = "nmod_poly_mulhigh_classical"; -char nmod_poly_mul_KS2_name[] = "nmod_poly_mul_KS2"; -char nmod_poly_mul_KS4_name[] = "nmod_poly_mul_KS4"; -char nmod_poly_mul_KS_name[] = "nmod_poly_mul_KS"; -char nmod_poly_mullow_name[] = "nmod_poly_mullow"; -char nmod_poly_mullow_classical_name[] = "nmod_poly_mullow_classical"; -char nmod_poly_mullow_KS_name[] = "nmod_poly_mullow_KS"; -char nmod_poly_mulmod_name[] = "nmod_poly_mulmod"; -char nmod_poly_mulmod_preinv_name[] = "nmod_poly_mulmod_preinv"; -char nmod_poly_multi_crt_name[] = "nmod_poly_multi_crt"; -char nmod_poly_neg_name[] = "nmod_poly_neg"; -char nmod_poly_pow_binexp_name[] = "nmod_poly_pow_binexp"; -char nmod_poly_pow_name[] = "nmod_poly_pow"; -char nmod_poly_powers_mod_bsgs_name[] = "nmod_poly_powers_mod_bsgs"; -char nmod_poly_powers_mod_naive_name[] = "nmod_poly_powers_mod_naive"; -char nmod_poly_power_sums_name[] = "nmod_poly_power_sums"; -char nmod_poly_power_sums_naive_name[] = "nmod_poly_power_sums_naive"; -char nmod_poly_power_sums_schoenhage_name[] = "nmod_poly_power_sums_schoenhage"; -char nmod_poly_powmod_fmpz_binexp_name[] = "nmod_poly_powmod_fmpz_binexp"; -char nmod_poly_powmod_fmpz_binexp_preinv_name[] = "nmod_poly_powmod_fmpz_binexp_preinv"; -char nmod_poly_powmod_ui_binexp_name[] = "nmod_poly_powmod_ui_binexp"; -char nmod_poly_powmod_ui_binexp_preinv_name[] = "nmod_poly_powmod_ui_binexp_preinv"; -char nmod_poly_powmod_x_fmpz_preinv_name[] = "nmod_poly_powmod_x_fmpz_preinv"; -char nmod_poly_powmod_x_ui_preinv_name[] = "nmod_poly_powmod_x_ui_preinv"; -char nmod_poly_pow_trunc_binexp_name[] = "nmod_poly_pow_trunc_binexp"; -char nmod_poly_pow_trunc_name[] = "nmod_poly_pow_trunc"; -char nmod_poly_product_roots_nmod_vec_name[] = "nmod_poly_product_roots_nmod_vec"; -char nmod_poly_rem_name[] = "nmod_poly_rem"; -char nmod_poly_resultant_name[] = "nmod_poly_resultant"; -char nmod_poly_resultant_euclidean_name[] = "nmod_poly_resultant_euclidean"; -char nmod_poly_resultant_hgcd_name[] = "nmod_poly_resultant_hgcd"; -char nmod_poly_reverse_name[] = "nmod_poly_reverse"; -char nmod_poly_revert_series_name[] = "nmod_poly_revert_series"; -char nmod_poly_revert_series_lagrange_name[] = "nmod_poly_revert_series_lagrange"; -char nmod_poly_revert_series_lagrange_fast_name[] = "nmod_poly_revert_series_lagrange_fast"; -char nmod_poly_revert_series_newton_name[] = "nmod_poly_revert_series_newton"; -char nmod_poly_scalar_addmul_nmod_name[] = "nmod_poly_scalar_addmul_nmod"; -char nmod_poly_scalar_mul_nmod_name[] = "nmod_poly_scalar_mul_nmod"; -char nmod_poly_set_trunc_name[] = "nmod_poly_set_trunc"; -char nmod_poly_shift_left_right_name[] = "nmod_poly_shift_left_right"; -char nmod_poly_sinh_series_name[] = "nmod_poly_sinh_series"; -char nmod_poly_sin_series_name[] = "nmod_poly_sin_series"; -char nmod_poly_sqrt_name[] = "nmod_poly_sqrt"; -char nmod_poly_sqrt_series_name[] = "nmod_poly_sqrt_series"; -char nmod_poly_sub_name[] = "nmod_poly_sub"; -char nmod_poly_sub_series_name[] = "nmod_poly_sub_series"; -char nmod_poly_tanh_series_name[] = "nmod_poly_tanh_series"; -char nmod_poly_tan_series_name[] = "nmod_poly_tan_series"; -char nmod_poly_taylor_shift_name[] = "nmod_poly_taylor_shift"; -char nmod_poly_taylor_shift_convolution_name[] = "nmod_poly_taylor_shift_convolution"; -char nmod_poly_taylor_shift_horner_name[] = "nmod_poly_taylor_shift_horner"; -char nmod_poly_xgcd_name[] = "nmod_poly_xgcd"; -char nmod_poly_xgcd_euclidean_name[] = "nmod_poly_xgcd_euclidean"; -char nmod_poly_xgcd_hgcd_name[] = "nmod_poly_xgcd_hgcd"; - -char * test_names[] = -{ - nmod_poly_add_name, - nmod_poly_add_series_name, - nmod_poly_asinh_series_name, - nmod_poly_asin_series_name, - nmod_poly_atanh_series_name, - nmod_poly_atan_series_name, - nmod_poly_berlekamp_massey_name, - nmod_poly_bit_pack_name, - nmod_poly_compose_name, - nmod_poly_compose_horner_name, - nmod_poly_compose_mod_brent_kung_name, - nmod_poly_compose_mod_brent_kung_precomp_preinv_name, - nmod_poly_compose_mod_brent_kung_precomp_preinv_threaded_name, - nmod_poly_compose_mod_brent_kung_preinv_name, - nmod_poly_compose_mod_brent_kung_vec_preinv_name, - nmod_poly_compose_mod_brent_kung_vec_preinv_threaded_name, - nmod_poly_compose_mod_name, - nmod_poly_compose_mod_horner_name, - nmod_poly_compose_series_name, - nmod_poly_cosh_series_name, - nmod_poly_cos_series_name, - nmod_poly_deflate_name, - nmod_poly_derivative_name, - nmod_poly_discriminant_name, - nmod_poly_div_name, - nmod_poly_divides_name, - nmod_poly_divides_classical_name, - nmod_poly_div_newton_n_preinv_name, - nmod_poly_divrem_basecase_name, - nmod_poly_divrem_name, - nmod_poly_divrem_newton_n_preinv_name, - nmod_poly_div_root_name, - nmod_poly_div_series_basecase_name, - nmod_poly_div_series_name, - nmod_poly_equal_trunc_name, - nmod_poly_evaluate_mat_horner_name, - nmod_poly_evaluate_mat_paterson_stockmeyer_name, - nmod_poly_evaluate_nmod_name, - nmod_poly_evaluate_nmod_vec_fast_name, - nmod_poly_exp_series_name, - nmod_poly_find_distinct_nonzero_roots_name, - nmod_poly_fread_print_name, - nmod_poly_gcd_name, - nmod_poly_gcd_euclidean_name, - nmod_poly_gcd_hgcd_name, - nmod_poly_gcdinv_name, - nmod_poly_get_set_coeff_ui_name, - nmod_poly_get_set_str_name, - nmod_poly_hgcd_name, - nmod_poly_inflate_name, - nmod_poly_init_realloc_clear_name, - nmod_poly_integral_name, - nmod_poly_interpolate_nmod_vec_barycentric_name, - nmod_poly_interpolate_nmod_vec_name, - nmod_poly_interpolate_nmod_vec_fast_name, - nmod_poly_interpolate_nmod_vec_newton_name, - nmod_poly_invmod_name, - nmod_poly_inv_series_basecase_name, - nmod_poly_inv_series_newton_name, - nmod_poly_invsqrt_series_name, - nmod_poly_log_series_name, - nmod_poly_make_monic_name, - nmod_poly_mul_name, - nmod_poly_mul_classical_name, - nmod_poly_mulhigh_name, - nmod_poly_mulhigh_classical_name, - nmod_poly_mul_KS2_name, - nmod_poly_mul_KS4_name, - nmod_poly_mul_KS_name, - nmod_poly_mullow_name, - nmod_poly_mullow_classical_name, - nmod_poly_mullow_KS_name, - nmod_poly_mulmod_name, - nmod_poly_mulmod_preinv_name, - nmod_poly_multi_crt_name, - nmod_poly_neg_name, - nmod_poly_pow_binexp_name, - nmod_poly_pow_name, - nmod_poly_powers_mod_bsgs_name, - nmod_poly_powers_mod_naive_name, - nmod_poly_power_sums_name, - nmod_poly_power_sums_naive_name, - nmod_poly_power_sums_schoenhage_name, - nmod_poly_powmod_fmpz_binexp_name, - nmod_poly_powmod_fmpz_binexp_preinv_name, - nmod_poly_powmod_ui_binexp_name, - nmod_poly_powmod_ui_binexp_preinv_name, - nmod_poly_powmod_x_fmpz_preinv_name, - nmod_poly_powmod_x_ui_preinv_name, - nmod_poly_pow_trunc_binexp_name, - nmod_poly_pow_trunc_name, - nmod_poly_product_roots_nmod_vec_name, - nmod_poly_rem_name, - nmod_poly_resultant_name, - nmod_poly_resultant_euclidean_name, - nmod_poly_resultant_hgcd_name, - nmod_poly_reverse_name, - nmod_poly_revert_series_name, - nmod_poly_revert_series_lagrange_name, - nmod_poly_revert_series_lagrange_fast_name, - nmod_poly_revert_series_newton_name, - nmod_poly_scalar_addmul_nmod_name, - nmod_poly_scalar_mul_nmod_name, - nmod_poly_set_trunc_name, - nmod_poly_shift_left_right_name, - nmod_poly_sinh_series_name, - nmod_poly_sin_series_name, - nmod_poly_sqrt_name, - nmod_poly_sqrt_series_name, - nmod_poly_sub_name, - nmod_poly_sub_series_name, - nmod_poly_tanh_series_name, - nmod_poly_tan_series_name, - nmod_poly_taylor_shift_name, - nmod_poly_taylor_shift_convolution_name, - nmod_poly_taylor_shift_horner_name, - nmod_poly_xgcd_name, - nmod_poly_xgcd_euclidean_name, - nmod_poly_xgcd_hgcd_name -}; - /* main function *************************************************************/ -#define NUMBER_OF_TESTS (sizeof(test_functions) / sizeof(int (*)(void))) - -int -main(int argc, char ** argv) -{ - int ix, jx; - - if (argc < 2) - { - for (ix = 0; ix < NUMBER_OF_TESTS; ix++) - if (test_functions[ix]()) - flint_abort(); - } - else - { - for (ix = 1; ix < argc; ix++) - { - for (jx = 0; jx < NUMBER_OF_TESTS; jx++) - { - /* If argument equals to test name, run it */ - if (strcmp(argv[ix], test_names[jx]) == 0) - { - if (test_functions[jx]()) - flint_abort(); - break; - } - } - - if (jx == NUMBER_OF_TESTS) - { - fprintf(stderr, "Error: Could not find test function for %s\n", argv[ix]); - flint_abort(); - } - } - } - - return 0; -} +TEST_MAIN(tests) diff --git a/src/test/main.c b/src/test/main.c index d34a3ee5b1..b38496953e 100644 --- a/src/test/main.c +++ b/src/test/main.c @@ -30,7 +30,7 @@ /* Array of test functions ***************************************************/ -int (*test_functions[])(void) = +test_struct tests[] = { TEST_FUNCTION(add_ssaaaa), TEST_FUNCTION(add_sssaaaaaa), @@ -48,76 +48,6 @@ int (*test_functions[])(void) = TEST_FUNCTION(umul_ppmm) }; -char add_ssaaaa_name[] = "add_ssaaaa"; -char add_sssaaaaaa_name[] = "add_sssaaaaaa"; -char add_ssssaaaaaaaa_name[] = "add_ssssaaaaaaaa"; -char byte_swap_name[] = "byte_swap"; -char flint_clz_name[] = "flint_clz"; -char flint_ctz_name[] = "flint_ctz"; -char invert_limb_name[] = "invert_limb"; -char sdiv_qrnnd_name[] = "sdiv_qrnnd"; -char smul_ppmm_name[] = "smul_ppmm"; -char sub_dddmmmsss_name[] = "sub_dddmmmsss"; -char sub_ddmmss_name[] = "sub_ddmmss"; -char udiv_qrnnd_name[] = "udiv_qrnnd"; -char udiv_qrnnd_preinv_name[] = "udiv_qrnnd_preinv"; -char umul_ppmm_name[] = "umul_ppmm"; - -char * test_names[] = -{ - add_ssaaaa_name, - add_sssaaaaaa_name, - add_ssssaaaaaaaa_name, - byte_swap_name, - flint_clz_name, - flint_ctz_name, - invert_limb_name, - sdiv_qrnnd_name, - smul_ppmm_name, - sub_dddmmmsss_name, - sub_ddmmss_name, - udiv_qrnnd_name, - udiv_qrnnd_preinv_name, - umul_ppmm_name -}; - /* main function *************************************************************/ -#define NUMBER_OF_TESTS (sizeof(test_functions) / sizeof(int (*)(void))) - -int -main(int argc, char ** argv) -{ - int ix, jx; - - if (argc < 2) - { - for (ix = 0; ix < NUMBER_OF_TESTS; ix++) - if (test_functions[ix]()) - flint_abort(); - } - else - { - for (ix = 1; ix < argc; ix++) - { - for (jx = 0; jx < NUMBER_OF_TESTS; jx++) - { - /* If argument equals to test name, run it */ - if (strcmp(argv[ix], test_names[jx]) == 0) - { - if (test_functions[jx]()) - flint_abort(); - break; - } - } - - if (jx == NUMBER_OF_TESTS) - { - fprintf(stderr, "Error: Could not find test function for %s\n", argv[ix]); - flint_abort(); - } - } - } - - return 0; -} +TEST_MAIN(tests) diff --git a/src/ulong_extras/test/main.c b/src/ulong_extras/test/main.c index e8605d3c46..ffb6b3cc38 100644 --- a/src/ulong_extras/test/main.c +++ b/src/ulong_extras/test/main.c @@ -107,7 +107,7 @@ /* Array of test functions ***************************************************/ -int (*test_functions[])(void) = +test_struct tests[] = { TEST_FUNCTION(n_addmod), TEST_FUNCTION(n_cbrt_binary_search), @@ -202,230 +202,6 @@ int (*test_functions[])(void) = TEST_FUNCTION(n_xgcd) }; -char n_addmod_name[] = "n_addmod"; -char n_cbrt_binary_search_name[] = "n_cbrt_binary_search"; -char n_cbrt_name[] = "n_cbrt"; -char n_cbrt_chebyshev_approx_name[] = "n_cbrt_chebyshev_approx"; -char n_cbrt_newton_iteration_name[] = "n_cbrt_newton_iteration"; -char n_cbrtrem_name[] = "n_cbrtrem"; -char n_clog_2exp_name[] = "n_clog_2exp"; -char n_clog_name[] = "n_clog"; -char compute_primes_name[] = "compute_primes"; -char n_CRT_name[] = "n_CRT"; -char n_discrete_log_bsgs_name[] = "n_discrete_log_bsgs"; -char n_div2_preinv_name[] = "n_div2_preinv"; -char n_divides_name[] = "n_divides"; -char n_divrem2_precomp_name[] = "n_divrem2_precomp"; -char n_divrem2_preinv_name[] = "n_divrem2_preinv"; -char n_euler_phi_name[] = "n_euler_phi"; -char n_factor_name[] = "n_factor"; -char n_factor_ecm_name[] = "n_factor_ecm"; -char n_factorial_fast_mod2_preinv_name[] = "n_factorial_fast_mod2_preinv"; -char n_factorial_mod2_preinv_name[] = "n_factorial_mod2_preinv"; -char n_factor_lehman_name[] = "n_factor_lehman"; -char n_factor_one_line_name[] = "n_factor_one_line"; -char n_factor_partial_name[] = "n_factor_partial"; -char n_factor_pollard_brent_name[] = "n_factor_pollard_brent"; -char n_factor_power235_name[] = "n_factor_power235"; -char n_factor_pp1_name[] = "n_factor_pp1"; -char n_factor_SQUFOF_name[] = "n_factor_SQUFOF"; -char n_factor_trial_name[] = "n_factor_trial"; -char n_factor_trial_partial_name[] = "n_factor_trial_partial"; -char n_factor_trial_range_name[] = "n_factor_trial_range"; -char n_flog_name[] = "n_flog"; -char n_gcd_name[] = "n_gcd"; -char n_gcdinv_name[] = "n_gcdinv"; -char n_invmod_name[] = "n_invmod"; -char n_is_oddprime_binary_name[] = "n_is_oddprime_binary"; -char n_is_oddprime_small_name[] = "n_is_oddprime_small"; -char n_is_perfect_power235_name[] = "n_is_perfect_power235"; -char n_is_perfect_power_name[] = "n_is_perfect_power"; -char n_is_prime_name[] = "n_is_prime"; -char n_is_prime_pocklington_name[] = "n_is_prime_pocklington"; -char n_is_prime_pseudosquare_name[] = "n_is_prime_pseudosquare"; -char n_is_probabprime_BPSW_name[] = "n_is_probabprime_BPSW"; -char n_is_probabprime_name[] = "n_is_probabprime"; -char n_is_probabprime_fermat_name[] = "n_is_probabprime_fermat"; -char n_is_probabprime_fibonacci_name[] = "n_is_probabprime_fibonacci"; -char n_is_probabprime_lucas_name[] = "n_is_probabprime_lucas"; -char n_is_square_name[] = "n_is_square"; -char n_is_squarefree_name[] = "n_is_squarefree"; -char n_is_strong_probabprime2_preinv_name[] = "n_is_strong_probabprime2_preinv"; -char n_is_strong_probabprime_precomp_name[] = "n_is_strong_probabprime_precomp"; -char n_jacobi_name[] = "n_jacobi"; -char n_lll_mod_preinv_name[] = "n_lll_mod_preinv"; -char n_ll_mod_preinv_name[] = "n_ll_mod_preinv"; -char n_mod2_precomp_name[] = "n_mod2_precomp"; -char n_mod2_preinv_name[] = "n_mod2_preinv"; -char n_mod_precomp_name[] = "n_mod_precomp"; -char n_moebius_mu_name[] = "n_moebius_mu"; -char n_mulmod2_name[] = "n_mulmod2"; -char n_mulmod2_preinv_name[] = "n_mulmod2_preinv"; -char n_mulmod_precomp_name[] = "n_mulmod_precomp"; -char n_mulmod_preinv_name[] = "n_mulmod_preinv"; -char n_mulmod_shoup_name[] = "n_mulmod_shoup"; -char n_nextprime_name[] = "n_nextprime"; -char n_nth_prime_bounds_name[] = "n_nth_prime_bounds"; -char n_urandint_name[] = "n_urandint"; -char n_pow_name[] = "n_pow"; -char n_powmod2_name[] = "n_powmod2"; -char n_powmod2_preinv_name[] = "n_powmod2_preinv"; -char n_powmod2_ui_preinv_name[] = "n_powmod2_ui_preinv"; -char n_powmod_name[] = "n_powmod"; -char n_powmod_precomp_name[] = "n_powmod_precomp"; -char n_powmod_ui_precomp_name[] = "n_powmod_ui_precomp"; -char n_powmod_ui_preinv_name[] = "n_powmod_ui_preinv"; -char n_prime_pi_bounds_name[] = "n_prime_pi_bounds"; -char n_prime_pi_name[] = "n_prime_pi"; -char n_primes_name[] = "n_primes"; -char n_primes_jump_after_name[] = "n_primes_jump_after"; -char n_primitive_root_prime_name[] = "n_primitive_root_prime"; -char n_remove2_precomp_name[] = "n_remove2_precomp"; -char n_remove_name[] = "n_remove"; -char n_revbin_name[] = "n_revbin"; -char n_root_name[] = "n_root"; -char n_rootrem_name[] = "n_rootrem"; -char n_sizeinbase_name[] = "n_sizeinbase"; -char n_sqrt_name[] = "n_sqrt"; -char n_sqrtmod_name[] = "n_sqrtmod"; -char n_sqrtmodn_name[] = "n_sqrtmodn"; -char n_sqrtmod_primepow_name[] = "n_sqrtmod_primepow"; -char n_sqrtrem_name[] = "n_sqrtrem"; -char n_submod_name[] = "n_submod"; -char n_xgcd_name[] = "n_xgcd"; - -char * test_names[] = -{ - n_addmod_name, - n_cbrt_binary_search_name, - n_cbrt_name, - n_cbrt_chebyshev_approx_name, - n_cbrt_newton_iteration_name, - n_cbrtrem_name, - n_clog_2exp_name, - n_clog_name, - compute_primes_name, - n_CRT_name, - n_discrete_log_bsgs_name, - n_div2_preinv_name, - n_divides_name, - n_divrem2_precomp_name, - n_divrem2_preinv_name, - n_euler_phi_name, - n_factor_name, - n_factor_ecm_name, - n_factorial_fast_mod2_preinv_name, - n_factorial_mod2_preinv_name, - n_factor_lehman_name, - n_factor_one_line_name, - n_factor_partial_name, - n_factor_pollard_brent_name, - n_factor_power235_name, - n_factor_pp1_name, - n_factor_SQUFOF_name, - n_factor_trial_name, - n_factor_trial_partial_name, - n_factor_trial_range_name, - n_flog_name, - n_gcd_name, - n_gcdinv_name, - n_invmod_name, - n_is_oddprime_binary_name, - n_is_oddprime_small_name, - n_is_perfect_power235_name, - n_is_perfect_power_name, - n_is_prime_name, - n_is_prime_pocklington_name, - n_is_prime_pseudosquare_name, - n_is_probabprime_BPSW_name, - n_is_probabprime_name, - n_is_probabprime_fermat_name, - n_is_probabprime_fibonacci_name, - n_is_probabprime_lucas_name, - n_is_square_name, - n_is_squarefree_name, - n_is_strong_probabprime2_preinv_name, - n_is_strong_probabprime_precomp_name, - n_jacobi_name, - n_lll_mod_preinv_name, - n_ll_mod_preinv_name, - n_mod2_precomp_name, - n_mod2_preinv_name, - n_mod_precomp_name, - n_moebius_mu_name, - n_mulmod2_name, - n_mulmod2_preinv_name, - n_mulmod_precomp_name, - n_mulmod_preinv_name, - n_mulmod_shoup_name, - n_nextprime_name, - n_nth_prime_bounds_name, - n_urandint_name, - n_pow_name, - n_powmod2_name, - n_powmod2_preinv_name, - n_powmod2_ui_preinv_name, - n_powmod_name, - n_powmod_precomp_name, - n_powmod_ui_precomp_name, - n_powmod_ui_preinv_name, - n_prime_pi_bounds_name, - n_prime_pi_name, - n_primes_name, - n_primes_jump_after_name, - n_primitive_root_prime_name, - n_remove2_precomp_name, - n_remove_name, - n_revbin_name, - n_root_name, - n_rootrem_name, - n_sizeinbase_name, - n_sqrt_name, - n_sqrtmod_name, - n_sqrtmodn_name, - n_sqrtmod_primepow_name, - n_sqrtrem_name, - n_submod_name, - n_xgcd_name -}; - /* main function *************************************************************/ -#define NUMBER_OF_TESTS (sizeof(test_functions) / sizeof(int (*)(void))) - -int -main(int argc, char ** argv) -{ - int ix, jx; - - if (argc < 2) - { - for (ix = 0; ix < NUMBER_OF_TESTS; ix++) - if (test_functions[ix]()) - flint_abort(); - } - else - { - for (ix = 1; ix < argc; ix++) - { - for (jx = 0; jx < NUMBER_OF_TESTS; jx++) - { - /* If argument equals to test name, run it */ - if (strcmp(argv[ix], test_names[jx]) == 0) - { - if (test_functions[jx]()) - flint_abort(); - break; - } - } - - if (jx == NUMBER_OF_TESTS) - { - fprintf(stderr, "Error: Could not find test function for %s\n", argv[ix]); - flint_abort(); - } - } - } - - return 0; -} +TEST_MAIN(tests)