From 59792ee058455c19c4ff78e113c9d6a0118b1e5a Mon Sep 17 00:00:00 2001 From: Steve Bronder Date: Thu, 14 Sep 2023 17:10:19 -0400 Subject: [PATCH] adds test framework to all mix functions to cleanup memory after they finish --- runTests.py | 25 +--- .../math/mix/core/operator_addition_test.cpp | 13 ++- .../mix/core/operator_divide_equal_test.cpp | 3 +- .../math/mix/core/operator_division_test.cpp | 5 +- .../math/mix/core/operator_equal_test.cpp | 3 +- .../operator_greater_than_or_equal_test.cpp | 3 +- .../mix/core/operator_greater_than_test.cpp | 3 +- .../core/operator_less_than_or_equal_test.cpp | 3 +- .../math/mix/core/operator_less_than_test.cpp | 3 +- .../mix/core/operator_logical_and_test.cpp | 3 +- .../mix/core/operator_logical_or_test.cpp | 3 +- .../mix/core/operator_minus_equal_test.cpp | 3 +- .../mix/core/operator_minus_minus_test.cpp | 9 +- .../mix/core/operator_multiplication_test.cpp | 3 +- .../mix/core/operator_multiply_equal_test.cpp | 3 +- .../math/mix/core/operator_not_equal_test.cpp | 3 +- .../mix/core/operator_plus_equal_test.cpp | 3 +- .../math/mix/core/operator_plus_plus_test.cpp | 9 +- .../mix/core/operator_subtraction_test.cpp | 13 ++- .../mix/core/operator_unary_negative_test.cpp | 3 +- .../math/mix/core/operator_unary_not_test.cpp | 3 +- .../mix/core/operator_unary_plus_test.cpp | 3 +- test/unit/math/mix/core/std_complex_test.cpp | 13 ++- .../math/mix/core/std_numeric_limits_test.cpp | 3 +- test/unit/math/mix/fun/Phi_approx_test.cpp | 5 +- test/unit/math/mix/fun/Phi_test.cpp | 5 +- test/unit/math/mix/fun/abs_test.cpp | 9 +- test/unit/math/mix/fun/accumulator_test.cpp | 11 +- test/unit/math/mix/fun/acos_test.cpp | 5 +- test/unit/math/mix/fun/acosh_test.cpp | 9 +- test/unit/math/mix/fun/add_diag_test.cpp | 3 +- test/unit/math/mix/fun/add_test.cpp | 19 +-- test/unit/math/mix/fun/append_array_test.cpp | 9 +- test/unit/math/mix/fun/append_col_test.cpp | 3 +- test/unit/math/mix/fun/append_row_test.cpp | 3 +- test/unit/math/mix/fun/arg_test.cpp | 3 +- test/unit/math/mix/fun/array_builder_test.cpp | 5 +- test/unit/math/mix/fun/asin_test.cpp | 5 +- test/unit/math/mix/fun/asinh_test.cpp | 5 +- test/unit/math/mix/fun/assign_test.cpp | 41 +++---- test/unit/math/mix/fun/atan2_test.cpp | 7 +- test/unit/math/mix/fun/atan_test.cpp | 5 +- test/unit/math/mix/fun/atanh_test.cpp | 5 +- .../math/mix/fun/bessel_first_kind_test.cpp | 7 +- .../math/mix/fun/bessel_second_kind_test.cpp | 7 +- test/unit/math/mix/fun/beta2_test.cpp | 3 +- test/unit/math/mix/fun/beta_test.cpp | 5 +- .../math/mix/fun/binary_log_loss_test.cpp | 9 +- .../mix/fun/binomial_coefficient_log_test.cpp | 5 +- test/unit/math/mix/fun/block_test.cpp | 3 +- test/unit/math/mix/fun/cbrt_test.cpp | 5 +- test/unit/math/mix/fun/ceil_test.cpp | 5 +- .../mix/fun/cholesky_corr_constrain_test.cpp | 7 +- .../math/mix/fun/cholesky_decompose_test.cpp | 9 +- .../fun/cholesky_factor_constrain_test.cpp | 5 +- test/unit/math/mix/fun/col_test.cpp | 3 +- test/unit/math/mix/fun/cols_test.cpp | 13 ++- .../math/mix/fun/columns_dot_product_test.cpp | 3 +- .../math/mix/fun/columns_dot_self_test.cpp | 3 +- .../mix/fun/complex_schur_decompose_test.cpp | 9 +- test/unit/math/mix/fun/conj_test.cpp | 5 +- test/unit/math/mix/fun/copysign_test.cpp | 3 +- .../unit/math/mix/fun/corr_constrain_test.cpp | 5 +- .../mix/fun/corr_matrix_constrain_test.cpp | 7 +- test/unit/math/mix/fun/cos_test.cpp | 5 +- test/unit/math/mix/fun/cosh_test.cpp | 5 +- test/unit/math/mix/fun/cov_exp_quad_test.cpp | 65 ++++++----- .../mix/fun/cov_matrix_constrain_lkj_test.cpp | 5 +- .../mix/fun/cov_matrix_constrain_test.cpp | 7 +- test/unit/math/mix/fun/crossprod_test.cpp | 3 +- .../mix/fun/csr_matrix_times_vector_test.cpp | 3 +- .../unit/math/mix/fun/cumulative_sum_test.cpp | 3 +- test/unit/math/mix/fun/determinant_test.cpp | 3 +- test/unit/math/mix/fun/diag_matrix_test.cpp | 3 +- .../math/mix/fun/diag_post_multiply_test.cpp | 3 +- .../math/mix/fun/diag_pre_multiply_test.cpp | 3 +- test/unit/math/mix/fun/diagonal_test.cpp | 3 +- test/unit/math/mix/fun/digamma_test.cpp | 5 +- test/unit/math/mix/fun/dims_test.cpp | 5 +- test/unit/math/mix/fun/distance_test.cpp | 3 +- test/unit/math/mix/fun/divide2_test.cpp | 3 +- test/unit/math/mix/fun/divide_test.cpp | 3 +- test/unit/math/mix/fun/dot_product_test.cpp | 3 +- test/unit/math/mix/fun/dot_self_test.cpp | 3 +- .../math/mix/fun/eigen_comparisons_test.cpp | 9 +- .../eigendecompose_identity_complex_test.cpp | 3 +- .../mix/fun/eigendecompose_identity_test.cpp | 3 +- .../math/mix/fun/eigendecompose_sym_test.cpp | 5 +- .../unit/math/mix/fun/eigendecompose_test.cpp | 5 +- .../math/mix/fun/eigenvalues_complex_test.cpp | 3 +- .../math/mix/fun/eigenvalues_sym_test.cpp | 5 +- test/unit/math/mix/fun/eigenvalues_test.cpp | 3 +- .../math/mix/fun/eigenvectors_sym_test.cpp | 5 +- test/unit/math/mix/fun/eigenvectors_test.cpp | 5 +- test/unit/math/mix/fun/elt_divide_test.cpp | 7 +- test/unit/math/mix/fun/elt_multiply_test.cpp | 7 +- test/unit/math/mix/fun/erf_test.cpp | 5 +- test/unit/math/mix/fun/erfc_test.cpp | 5 +- test/unit/math/mix/fun/exp2_test.cpp | 5 +- test/unit/math/mix/fun/exp_test.cpp | 3 +- test/unit/math/mix/fun/expm1_test.cpp | 5 +- test/unit/math/mix/fun/fabs_test.cpp | 5 +- .../math/mix/fun/falling_factorial_test.cpp | 7 +- test/unit/math/mix/fun/fdim_test.cpp | 5 +- test/unit/math/mix/fun/fft_test.cpp | 9 +- test/unit/math/mix/fun/fill_test.cpp | 9 +- test/unit/math/mix/fun/floor_test.cpp | 5 +- test/unit/math/mix/fun/fma_1_test.cpp | 3 +- test/unit/math/mix/fun/fma_2_test.cpp | 3 +- test/unit/math/mix/fun/fma_3_test.cpp | 3 +- test/unit/math/mix/fun/fma_4_test.cpp | 3 +- test/unit/math/mix/fun/fma_5_test.cpp | 3 +- test/unit/math/mix/fun/fmax_test.cpp | 7 +- test/unit/math/mix/fun/fmin_test.cpp | 7 +- test/unit/math/mix/fun/fmod_test.cpp | 5 +- test/unit/math/mix/fun/gamma_p_test.cpp | 7 +- test/unit/math/mix/fun/gamma_q_test.cpp | 5 +- .../math/mix/fun/generalized_inverse_test.cpp | 17 +-- test/unit/math/mix/fun/get_base1_lhs_test.cpp | 29 ++--- test/unit/math/mix/fun/get_base1_test.cpp | 29 ++--- test/unit/math/mix/fun/get_imag_test.cpp | 5 +- test/unit/math/mix/fun/get_real_test.cpp | 5 +- .../math/mix/fun/gp_matern52_cov_test.cpp | 3 +- .../math/mix/fun/gp_periodic_cov_1_test.cpp | 55 ++++----- .../math/mix/fun/gp_periodic_cov_2_test.cpp | 35 +++--- test/unit/math/mix/fun/grad_2F1_test.cpp | 35 +++--- test/unit/math/mix/fun/grad_F32_test.cpp | 61 +++++----- .../math/mix/fun/grad_reg_inc_beta_test.cpp | 11 +- .../math/mix/fun/grad_reg_inc_gamma_test.cpp | 17 +-- test/unit/math/mix/fun/head_test.cpp | 3 +- .../math/mix/fun/hypergeometric_2F1_test.cpp | 7 +- .../math/mix/fun/hypergeometric_3F2_test.cpp | 29 ++--- .../math/mix/fun/hypergeometric_pFq_test.cpp | 3 +- test/unit/math/mix/fun/hypot_test.cpp | 5 +- test/unit/math/mix/fun/i_times_test.cpp | 7 +- .../math/mix/fun/identity_constrain_test.cpp | 3 +- test/unit/math/mix/fun/imag_test.cpp | 3 +- test/unit/math/mix/fun/inc_beta_test.cpp | 5 +- test/unit/math/mix/fun/initialize_test.cpp | 9 +- test/unit/math/mix/fun/inv_Phi_test.cpp | 5 +- test/unit/math/mix/fun/inv_cloglog_test.cpp | 5 +- test/unit/math/mix/fun/inv_erfc_test.cpp | 5 +- test/unit/math/mix/fun/inv_inc_beta_test.cpp | 7 +- test/unit/math/mix/fun/inv_logit_test.cpp | 3 +- test/unit/math/mix/fun/inv_sqrt_test.cpp | 5 +- test/unit/math/mix/fun/inv_square_test.cpp | 5 +- test/unit/math/mix/fun/inv_test.cpp | 5 +- test/unit/math/mix/fun/inverse_spd_test.cpp | 3 +- test/unit/math/mix/fun/inverse_test.cpp | 3 +- test/unit/math/mix/fun/is_any_nan_test.cpp | 4 +- test/unit/math/mix/fun/isfinite_test.cpp | 2 +- test/unit/math/mix/fun/isinf_test.cpp | 3 +- test/unit/math/mix/fun/isnan_test.cpp | 3 +- test/unit/math/mix/fun/isnormal_test.cpp | 2 +- test/unit/math/mix/fun/lambertw_test.cpp | 9 +- .../math/mix/fun/lb_constrain_matvar_test.cpp | 13 ++- test/unit/math/mix/fun/lb_constrain_test.cpp | 21 ++-- test/unit/math/mix/fun/lbeta_test.cpp | 5 +- test/unit/math/mix/fun/ldexp_test.cpp | 5 +- test/unit/math/mix/fun/lgamma_test.cpp | 5 +- test/unit/math/mix/fun/lmgamma_test.cpp | 5 +- test/unit/math/mix/fun/lmultiply1_test.cpp | 3 +- test/unit/math/mix/fun/lmultiply2_test.cpp | 3 +- test/unit/math/mix/fun/lmultiply3_test.cpp | 3 +- test/unit/math/mix/fun/lmultiply_test.cpp | 3 +- test/unit/math/mix/fun/log10_test.cpp | 5 +- test/unit/math/mix/fun/log1m_exp_test.cpp | 5 +- .../math/mix/fun/log1m_inv_logit_test.cpp | 5 +- test/unit/math/mix/fun/log1m_test.cpp | 3 +- test/unit/math/mix/fun/log1p_exp_test.cpp | 3 +- test/unit/math/mix/fun/log1p_test.cpp | 3 +- test/unit/math/mix/fun/log2_test.cpp | 5 +- .../mix/fun/log_determinant_ldlt_test.cpp | 3 +- .../math/mix/fun/log_determinant_spd_test.cpp | 3 +- .../math/mix/fun/log_determinant_test.cpp | 3 +- test/unit/math/mix/fun/log_diff_exp_test.cpp | 5 +- .../mix/fun/log_falling_factorial_test.cpp | 5 +- .../math/mix/fun/log_inv_logit_diff_test.cpp | 5 +- test/unit/math/mix/fun/log_inv_logit_test.cpp | 5 +- test/unit/math/mix/fun/log_mix_part1_test.cpp | 3 +- test/unit/math/mix/fun/log_mix_part2_test.cpp | 3 +- .../log_modified_bessel_first_kind_test.cpp | 5 +- .../mix/fun/log_rising_factorial_test.cpp | 5 +- test/unit/math/mix/fun/log_softmax_test.cpp | 3 +- .../math/mix/fun/log_sum_exp_signed_test.cpp | 3 +- test/unit/math/mix/fun/log_sum_exp_test.cpp | 7 +- test/unit/math/mix/fun/log_test.cpp | 3 +- test/unit/math/mix/fun/logb_test.cpp | 3 +- test/unit/math/mix/fun/logit_test.cpp | 5 +- .../math/mix/fun/lub_constrain_1_test.cpp | 3 +- .../math/mix/fun/lub_constrain_2_test.cpp | 5 +- .../math/mix/fun/lub_constrain_3_test.cpp | 5 +- .../math/mix/fun/lub_constrain_4_test.cpp | 5 +- .../math/mix/fun/lub_constrain_5_test.cpp | 5 +- .../math/mix/fun/lub_constrain_6_test.cpp | 5 +- .../math/mix/fun/lub_constrain_7_test.cpp | 5 +- .../math/mix/fun/lub_constrain_8_test.cpp | 5 +- .../mix/fun/lub_constrain_matvar_test.cpp | 11 +- .../unit/math/mix/fun/matrix_exp_2x2_test.cpp | 3 +- .../math/mix/fun/matrix_exp_multiply_test.cpp | 3 +- .../math/mix/fun/matrix_exp_pade_test.cpp | 3 +- test/unit/math/mix/fun/matrix_exp_test.cpp | 3 +- test/unit/math/mix/fun/matrix_power_test.cpp | 3 +- test/unit/math/mix/fun/max_test.cpp | 3 +- .../math/mix/fun/mdivide_left_ldlt_test.cpp | 3 +- .../math/mix/fun/mdivide_left_spd_test.cpp | 3 +- test/unit/math/mix/fun/mdivide_left_test.cpp | 3 +- .../mix/fun/mdivide_left_tri_low_test.cpp | 3 +- .../math/mix/fun/mdivide_left_tri_test.cpp | 3 +- .../math/mix/fun/mdivide_right_ldlt_test.cpp | 3 +- .../math/mix/fun/mdivide_right_spd_test.cpp | 3 +- test/unit/math/mix/fun/mdivide_right_test.cpp | 3 +- .../mix/fun/mdivide_right_tri_low_test.cpp | 3 +- .../math/mix/fun/mdivide_right_tri_test.cpp | 3 +- test/unit/math/mix/fun/mean_test.cpp | 3 +- test/unit/math/mix/fun/min_test.cpp | 3 +- test/unit/math/mix/fun/minus_test.cpp | 3 +- .../fun/modified_bessel_first_kind_test.cpp | 5 +- .../fun/modified_bessel_second_kind_test.cpp | 5 +- test/unit/math/mix/fun/multiply1_test.cpp | 5 +- test/unit/math/mix/fun/multiply2_test.cpp | 3 +- .../math/mix/fun/multiply_complex_test.cpp | 3 +- test/unit/math/mix/fun/multiply_log1_test.cpp | 3 +- test/unit/math/mix/fun/multiply_log2_test.cpp | 3 +- test/unit/math/mix/fun/multiply_log3_test.cpp | 3 +- ...multiply_lower_tri_self_transpose_test.cpp | 3 +- test/unit/math/mix/fun/multiply_util.hpp | 1 + test/unit/math/mix/fun/norm1_test.cpp | 3 +- test/unit/math/mix/fun/norm2_test.cpp | 3 +- test/unit/math/mix/fun/norm_test.cpp | 3 +- ...set_multiplier_constrain_1_matvar_test.cpp | 7 +- .../offset_multiplier_constrain_1_test.cpp | 13 ++- ...set_multiplier_constrain_2_matvar_test.cpp | 5 +- .../offset_multiplier_constrain_2_test.cpp | 5 +- ...set_multiplier_constrain_3_matvar_test.cpp | 5 +- .../offset_multiplier_constrain_3_test.cpp | 5 +- ...set_multiplier_constrain_4_matvar_test.cpp | 3 +- .../offset_multiplier_constrain_4_test.cpp | 3 +- ...set_multiplier_constrain_5_matvar_test.cpp | 3 +- .../offset_multiplier_constrain_5_test.cpp | 3 +- ...set_multiplier_constrain_6_matvar_test.cpp | 3 +- .../offset_multiplier_constrain_6_test.cpp | 3 +- .../offset_multiplier_constrain_7_test.cpp | 3 +- .../math/mix/fun/operator_addition_test.cpp | 85 +++++++------- .../math/mix/fun/operator_division_test.cpp | 49 ++++---- .../mix/fun/operator_multiplication_test.cpp | 109 +++++++++--------- .../mix/fun/operator_subtraction_test.cpp | 85 +++++++------- .../math/mix/fun/ordered_constrain_test.cpp | 3 +- test/unit/math/mix/fun/owens_t_test.cpp | 9 +- test/unit/math/mix/fun/plus_test.cpp | 3 +- test/unit/math/mix/fun/polar_test.cpp | 3 +- .../fun/positive_ordered_constrain_test.cpp | 3 +- test/unit/math/mix/fun/pow_part1_test.cpp | 5 +- test/unit/math/mix/fun/pow_part2_test.cpp | 7 +- test/unit/math/mix/fun/pow_part3_test.cpp | 3 +- .../math/mix/fun/primitive_value_test.cpp | 5 +- test/unit/math/mix/fun/prod_test.cpp | 3 +- test/unit/math/mix/fun/proj_test.cpp | 3 +- .../unit/math/mix/fun/promote_scalar_test.cpp | 5 +- .../math/mix/fun/pseudo_eigenvalues_test.cpp | 3 +- .../math/mix/fun/pseudo_eigenvectors_test.cpp | 5 +- test/unit/math/mix/fun/qr_Q_test.cpp | 3 +- test/unit/math/mix/fun/qr_R_test.cpp | 3 +- test/unit/math/mix/fun/qr_test.cpp | 3 +- test/unit/math/mix/fun/qr_thin_Q_test.cpp | 3 +- test/unit/math/mix/fun/qr_thin_R_test.cpp | 3 +- test/unit/math/mix/fun/qr_thin_test.cpp | 3 +- .../unit/math/mix/fun/quad_form_diag_test.cpp | 3 +- test/unit/math/mix/fun/quad_form_sym_test.cpp | 5 +- test/unit/math/mix/fun/quad_form_test.cpp | 3 +- test/unit/math/mix/fun/rank_test.cpp | 3 +- test/unit/math/mix/fun/read_corr_L_test.cpp | 5 +- .../math/mix/fun/read_corr_matrix_test.cpp | 5 +- test/unit/math/mix/fun/read_cov_L_test.cpp | 3 +- .../math/mix/fun/read_cov_matrix_test.cpp | 5 +- test/unit/math/mix/fun/real_test.cpp | 3 +- test/unit/math/mix/fun/rep_matrix_test.cpp | 3 +- .../unit/math/mix/fun/rep_row_vector_test.cpp | 3 +- test/unit/math/mix/fun/rep_vector_test.cpp | 3 +- test/unit/math/mix/fun/resize_test.cpp | 37 +++--- test/unit/math/mix/fun/reverse_test.cpp | 7 +- .../math/mix/fun/rising_factorial_test.cpp | 5 +- test/unit/math/mix/fun/round_test.cpp | 3 +- test/unit/math/mix/fun/row_test.cpp | 3 +- .../math/mix/fun/rows_dot_product_test.cpp | 3 +- test/unit/math/mix/fun/rows_dot_self_test.cpp | 3 +- test/unit/math/mix/fun/rows_test.cpp | 7 +- test/unit/math/mix/fun/scalbn_test.cpp | 3 +- .../fun/scale_matrix_exp_multiply_test.cpp | 3 +- test/unit/math/mix/fun/sd_test.cpp | 3 +- test/unit/math/mix/fun/segment_test.cpp | 3 +- test/unit/math/mix/fun/sign_test.cpp | 3 +- test/unit/math/mix/fun/signbit_test.cpp | 3 +- .../math/mix/fun/simplex_constrain_test.cpp | 3 +- test/unit/math/mix/fun/sin_test.cpp | 5 +- .../math/mix/fun/singular_values_test.cpp | 3 +- test/unit/math/mix/fun/sinh_test.cpp | 5 +- test/unit/math/mix/fun/size_test.cpp | 5 +- test/unit/math/mix/fun/softmax_test.cpp | 3 +- test/unit/math/mix/fun/sort_indices_test.cpp | 9 +- test/unit/math/mix/fun/sort_test.cpp | 3 +- test/unit/math/mix/fun/sqrt_test.cpp | 5 +- test/unit/math/mix/fun/square_test.cpp | 3 +- .../math/mix/fun/squared_distance_test.cpp | 5 +- test/unit/math/mix/fun/stan_print_test.cpp | 5 +- test/unit/math/mix/fun/step_test.cpp | 5 +- test/unit/math/mix/fun/sub_col_test.cpp | 3 +- test/unit/math/mix/fun/sub_row_test.cpp | 3 +- test/unit/math/mix/fun/subtract_test.cpp | 19 +-- test/unit/math/mix/fun/sum_test.cpp | 5 +- test/unit/math/mix/fun/svd_U_test.cpp | 3 +- test/unit/math/mix/fun/svd_V_test.cpp | 3 +- test/unit/math/mix/fun/svd_test.cpp | 3 +- .../fun/symmetrize_from_lower_tri_test.cpp | 3 +- .../fun/symmetrize_from_upper_tri_test.cpp | 3 +- test/unit/math/mix/fun/tail_test.cpp | 5 +- test/unit/math/mix/fun/tan_test.cpp | 5 +- test/unit/math/mix/fun/tanh_test.cpp | 5 +- test/unit/math/mix/fun/tcrossprod_test.cpp | 3 +- test/unit/math/mix/fun/tgamma_test.cpp | 5 +- test/unit/math/mix/fun/to_complex_test.cpp | 5 +- test/unit/math/mix/fun/to_fvar_test.cpp | 13 ++- .../fun/trace_gen_inv_quad_form_ldlt_test.cpp | 5 +- .../math/mix/fun/trace_gen_quad_form_test.cpp | 3 +- .../mix/fun/trace_inv_quad_form_ldlt_test.cpp | 3 +- .../math/mix/fun/trace_quad_form_test.cpp | 3 +- test/unit/math/mix/fun/trace_test.cpp | 3 +- test/unit/math/mix/fun/transpose_test.cpp | 3 +- test/unit/math/mix/fun/trigamma_test.cpp | 3 +- test/unit/math/mix/fun/trunc_test.cpp | 3 +- .../math/mix/fun/ub_constrain_matvar_test.cpp | 13 ++- test/unit/math/mix/fun/ub_constrain_test.cpp | 21 ++-- .../mix/fun/unit_vector_constrain_test.cpp | 3 +- test/unit/math/mix/fun/value_of_rec_test.cpp | 7 +- test/unit/math/mix/fun/value_of_test.cpp | 5 +- test/unit/math/mix/fun/variance_test.cpp | 3 +- test/unit/math/mix/functor/autodiff_test.cpp | 16 +-- .../finite_diff_grad_hessian_auto_test.cpp | 2 +- .../finite_diff_gradient_auto_test.cpp | 2 +- .../functor/finite_diff_hessian_auto_test.cpp | 12 +- .../functor/operands_and_partials_test.cpp | 16 +-- .../mix/functor/partials_propagator_test.cpp | 16 +-- .../mix/functor/reduce_sum_part1_test.cpp | 35 +++--- .../mix/functor/reduce_sum_part2_test.cpp | 13 ++- .../mix/functor/reduce_sum_part3_test.cpp | 11 +- .../mix/functor/reduce_sum_part4_test.cpp | 11 +- .../unit/math/mix/functor/reduce_sum_util.hpp | 1 + .../math/mix/meta/require_generics_test.cpp | 1 + .../prob/bernoulli_logit_glm_lpmf_test.cpp | 3 +- .../prob/categorical_logit_glm_lpmf_test.cpp | 3 +- .../math/mix/prob/categorical_logit_test.cpp | 9 +- test/unit/math/mix/prob/categorical_test.cpp | 9 +- test/unit/math/mix/prob/dirichlet_test.cpp | 11 +- .../unit/math/mix/prob/gamma_cdf_log_test.cpp | 3 +- .../math/mix/prob/gaussian_dlm_obs_test.cpp | 9 +- .../mix/prob/inv_wishart_cholesky_test.cpp | 7 +- test/unit/math/mix/prob/inv_wishart_test.cpp | 7 +- test/unit/math/mix/prob/lkj_corr_test.cpp | 13 ++- .../math/mix/prob/matrix_normal_prec_test.cpp | 7 +- .../math/mix/prob/multi_gp_cholesky_test.cpp | 5 +- test/unit/math/mix/prob/multi_gp_test.cpp | 7 +- .../mix/prob/multi_normal_cholesky_test.cpp | 7 +- .../math/mix/prob/multi_normal_prec_test.cpp | 7 +- test/unit/math/mix/prob/multi_normal_test.cpp | 7 +- .../math/mix/prob/multi_student_t_test.cpp | 7 +- .../math/mix/prob/multinomial_logit_test.cpp | 3 +- test/unit/math/mix/prob/multinomial_test.cpp | 5 +- .../prob/neg_binomial_2_log_glm_lpmf_test.cpp | 3 +- .../math/mix/prob/neg_binomial_2_log_test.cpp | 3 +- test/unit/math/mix/prob/neg_binomial_test.cpp | 3 +- .../math/mix/prob/normal_ccdf_log_test.cpp | 3 +- .../math/mix/prob/normal_cdf_log_test.cpp | 3 +- test/unit/math/mix/prob/normal_cdf_test.cpp | 3 +- .../math/mix/prob/normal_id_glm_lpdf_test.cpp | 3 +- test/unit/math/mix/prob/normal_test.cpp | 3 +- .../prob/ordered_logistic_glm_lpmf_test.cpp | 3 +- .../math/mix/prob/ordered_logistic_test.cpp | 13 ++- .../mix/prob/poisson_log_glm_lpmf_test.cpp | 3 +- .../mix/prob/std_normal_ccdf_log_test.cpp | 3 +- .../math/mix/prob/std_normal_cdf_log_test.cpp | 3 +- .../math/mix/prob/std_normal_cdf_test.cpp | 3 +- .../math/mix/prob/std_normal_log_qf_test.cpp | 9 +- test/unit/math/mix/prob/std_normal_test.cpp | 3 +- .../unit/math/mix/prob/von_mises_cdf_test.cpp | 3 +- test/unit/math/mix/prob/von_mises_test.cpp | 11 +- .../math/mix/prob/wishart_cholesky_test.cpp | 7 +- test/unit/math/mix/prob/wishart_test.cpp | 7 +- test/unit/math/mix/util.hpp | 18 +++ test/unit/math/rev/util.hpp | 2 +- 389 files changed, 1526 insertions(+), 1150 deletions(-) create mode 100644 test/unit/math/mix/util.hpp diff --git a/runTests.py b/runTests.py index 7f695c8a4a2..2d4fb5a866c 100755 --- a/runTests.py +++ b/runTests.py @@ -33,32 +33,13 @@ ] jumbo_folders = [ - "test/unit/math/prim/core", - "test/unit/math/prim/err", - "test/unit/math/prim/fun", - "test/unit/math/prim/functor", - "test/unit/math/prim/meta", - "test/unit/math/prim/prob", - "test/unit/math/rev/core", - "test/unit/math/rev/err", - "test/unit/math/rev/fun", - "test/unit/math/rev/functor", - "test/unit/math/rev/meta", - "test/unit/math/rev/prob", - "test/unit/math/fwd/core", - "test/unit/math/fwd/fun", - "test/unit/math/fwd/functor", - "test/unit/math/fwd/meta", - "test/unit/math/fwd/prob", + "test/unit/math/mix/core", "test/unit/math/mix/fun", "test/unit/math/mix/functor", "test/unit/math/mix/meta", - "test/unit/math/mix/prob", - "test/unit/math/opencl/device_functions", - "test/unit/math/opencl/kernel_generator", - "test/unit/math/opencl/prim", - "test/unit/math/opencl/rev", + "test/unit/math/mix/prob" + ] diff --git a/test/unit/math/mix/core/operator_addition_test.cpp b/test/unit/math/mix/core/operator_addition_test.cpp index 5c2a2ad7ca7..ff8e20cf05e 100644 --- a/test/unit/math/mix/core/operator_addition_test.cpp +++ b/test/unit/math/mix/core/operator_addition_test.cpp @@ -1,15 +1,16 @@ #include #include #include +#include -TEST(mathMixCore, operatorAddition) { +TEST_F(mathMix, operatorAddition) { auto f = [](const auto& x1, const auto& x2) { return x1 + x2; }; bool disable_lhs_int = true; stan::test::expect_common_binary(f, disable_lhs_int); stan::test::expect_complex_common_binary(f); } -TEST(mathMixCore, operatorAdditionMatrixSmall) { +TEST_F(mathMix, operatorAdditionMatrixSmall) { // This calls operator+ under the hood auto f = [](const auto& x1, const auto& x2) { return stan::math::add(x1, x2); }; @@ -48,7 +49,7 @@ TEST(mathMixCore, operatorAdditionMatrixSmall) { stan::test::expect_ad_matvar(tols, f, matrix_m11, matrix_m11); } -TEST(mathMixCore, operatorAdditionMatrixZeroSize) { +TEST_F(mathMix, operatorAdditionMatrixZeroSize) { auto f = [](const auto& x1, const auto& x2) { return stan::math::add(x1, x2); }; stan::test::ad_tolerances tols; @@ -79,7 +80,7 @@ TEST(mathMixCore, operatorAdditionMatrixZeroSize) { stan::test::expect_ad_matvar(f, matrix_m00, matrix_m00); } -TEST(mathMixCore, operatorAdditionMatrixNormal) { +TEST_F(mathMix, operatorAdditionMatrixNormal) { auto f = [](const auto& x1, const auto& x2) { return stan::math::add(x1, x2); }; stan::test::ad_tolerances tols; @@ -113,7 +114,7 @@ TEST(mathMixCore, operatorAdditionMatrixNormal) { stan::test::expect_ad_matvar(tols, f, matrix_m, matrix_m); } -TEST(mathMixCore, operatorAdditionMatrixFailures) { +TEST_F(mathMix, operatorAdditionMatrixFailures) { auto f = [](const auto& x1, const auto& x2) { return stan::math::add(x1, x2); }; stan::test::ad_tolerances tols; @@ -139,7 +140,7 @@ TEST(mathMixCore, operatorAdditionMatrixFailures) { stan::test::expect_ad_matvar(tols, f, u, vv); stan::test::expect_ad_matvar(tols, f, rvv, u); } -TEST(mathMixCore, operatorAdditionMatrixLinearAccess) { +TEST_F(mathMix, operatorAdditionMatrixLinearAccess) { Eigen::MatrixXd matrix_m11(3, 3); for (Eigen::Index i = 0; i < matrix_m11.size(); ++i) { matrix_m11(i) = i; diff --git a/test/unit/math/mix/core/operator_divide_equal_test.cpp b/test/unit/math/mix/core/operator_divide_equal_test.cpp index 3d7fc6d1a61..e9f93ba80cb 100644 --- a/test/unit/math/mix/core/operator_divide_equal_test.cpp +++ b/test/unit/math/mix/core/operator_divide_equal_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixCore, operatorDivideEqual) { +TEST_F(mathMix, operatorDivideEqual) { auto f = [](const auto& x1, const auto& x2) { // decltype instead of auto to make following statement legal decltype(x1 + x2) y = x1; diff --git a/test/unit/math/mix/core/operator_division_test.cpp b/test/unit/math/mix/core/operator_division_test.cpp index f279595907b..947ce9a8c92 100644 --- a/test/unit/math/mix/core/operator_division_test.cpp +++ b/test/unit/math/mix/core/operator_division_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixCore, operatorDivision) { +TEST_F(mathMix, operatorDivision) { auto f = [](const auto& x1, const auto& x2) { return x1 / x2; }; bool disable_lhs_int = true; stan::test::expect_common_binary(f, disable_lhs_int); @@ -54,7 +55,7 @@ struct operator_divide_tester { } // namespace test } // namespace stan -TEST(mathMixCore, operatorDivisionVarMat) { +TEST_F(mathMix, operatorDivisionVarMat) { Eigen::MatrixXd mat1(2, 2); mat1 << -2, -1, 0.5, 2.8; Eigen::MatrixXd mat2 = mat1.reverse(); diff --git a/test/unit/math/mix/core/operator_equal_test.cpp b/test/unit/math/mix/core/operator_equal_test.cpp index d3ebdace1b7..88b1cfaea10 100644 --- a/test/unit/math/mix/core/operator_equal_test.cpp +++ b/test/unit/math/mix/core/operator_equal_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixCore, operatorEqual) { +TEST_F(mathMix, operatorEqual) { auto f = [](const auto& x1, const auto& x2) { return x1 == x2; }; stan::test::expect_common_comparison(f); stan::test::expect_complex_common_comparison(f); diff --git a/test/unit/math/mix/core/operator_greater_than_or_equal_test.cpp b/test/unit/math/mix/core/operator_greater_than_or_equal_test.cpp index dfc357b1918..aecf743b0ec 100644 --- a/test/unit/math/mix/core/operator_greater_than_or_equal_test.cpp +++ b/test/unit/math/mix/core/operator_greater_than_or_equal_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixCore, operatorGreaterThanOrEqual) { +TEST_F(mathMix, operatorGreaterThanOrEqual) { auto f = [](const auto& x1, const auto& x2) { return x1 >= x2; }; stan::test::expect_common_comparison(f); } diff --git a/test/unit/math/mix/core/operator_greater_than_test.cpp b/test/unit/math/mix/core/operator_greater_than_test.cpp index 25dade92172..2193015685c 100644 --- a/test/unit/math/mix/core/operator_greater_than_test.cpp +++ b/test/unit/math/mix/core/operator_greater_than_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixCore, operatorGreaterThan) { +TEST_F(mathMix, operatorGreaterThan) { auto f = [](const auto& x1, const auto& x2) { return x1 > x2; }; stan::test::expect_common_comparison(f); } diff --git a/test/unit/math/mix/core/operator_less_than_or_equal_test.cpp b/test/unit/math/mix/core/operator_less_than_or_equal_test.cpp index cbfc06286a6..45df19db3aa 100644 --- a/test/unit/math/mix/core/operator_less_than_or_equal_test.cpp +++ b/test/unit/math/mix/core/operator_less_than_or_equal_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixCore, operatorLessThanOrEqual) { +TEST_F(mathMix, operatorLessThanOrEqual) { auto f = [](const auto& x1, const auto& x2) { return x1 <= x2; }; stan::test::expect_common_comparison(f); } diff --git a/test/unit/math/mix/core/operator_less_than_test.cpp b/test/unit/math/mix/core/operator_less_than_test.cpp index 5805d742a4a..21f9d120bfb 100644 --- a/test/unit/math/mix/core/operator_less_than_test.cpp +++ b/test/unit/math/mix/core/operator_less_than_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixCore, operatorLessThan) { +TEST_F(mathMix, operatorLessThan) { auto f = [](const auto& x1, const auto& x2) { return x1 < x2; }; stan::test::expect_common_comparison(f); } diff --git a/test/unit/math/mix/core/operator_logical_and_test.cpp b/test/unit/math/mix/core/operator_logical_and_test.cpp index 5e68e08b014..84dd6df1bfe 100644 --- a/test/unit/math/mix/core/operator_logical_and_test.cpp +++ b/test/unit/math/mix/core/operator_logical_and_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -24,7 +25,7 @@ void test_logical_and(double x, double y) { EXPECT_EQ(x && y, x && fvar >(y)); } -TEST(AgradMix, logical_and) { +TEST_F(mathMix, logical_and) { std::vector xs; xs.push_back(6.1); xs.push_back(6.1); diff --git a/test/unit/math/mix/core/operator_logical_or_test.cpp b/test/unit/math/mix/core/operator_logical_or_test.cpp index 3e53c865dd8..63197d1013f 100644 --- a/test/unit/math/mix/core/operator_logical_or_test.cpp +++ b/test/unit/math/mix/core/operator_logical_or_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -24,7 +25,7 @@ void test_logical_or(double x, double y) { EXPECT_EQ(x || y, x || fvar >(y)); } -TEST(AgradMix, logical_or) { +TEST_F(mathMix, logical_or) { std::vector xs; xs.push_back(6.1); xs.push_back(6.1); diff --git a/test/unit/math/mix/core/operator_minus_equal_test.cpp b/test/unit/math/mix/core/operator_minus_equal_test.cpp index c017a5eb4cd..0e290f0e2a9 100644 --- a/test/unit/math/mix/core/operator_minus_equal_test.cpp +++ b/test/unit/math/mix/core/operator_minus_equal_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixCore, operatorMinusEqual) { +TEST_F(mathMix, operatorMinusEqual) { auto f = [](const auto& x1, const auto& x2) { decltype(x1 + x2) y = x1; y -= x2; diff --git a/test/unit/math/mix/core/operator_minus_minus_test.cpp b/test/unit/math/mix/core/operator_minus_minus_test.cpp index b9815ac9f9c..796f925fed9 100644 --- a/test/unit/math/mix/core/operator_minus_minus_test.cpp +++ b/test/unit/math/mix/core/operator_minus_minus_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixCore, operatorMinusMinusPre1) { +TEST_F(mathMix, operatorMinusMinusPre1) { // this functor tests that y is right value after operator auto f = [](const auto& x1) { auto y = x1; @@ -11,7 +12,7 @@ TEST(mathMixCore, operatorMinusMinusPre1) { }; stan::test::expect_common_unary(f); } -TEST(mathMixCore, operatorMinusMinusPre2) { +TEST_F(mathMix, operatorMinusMinusPre2) { // this functor tests that value of expression has right value auto f = [](const auto& x1) { auto y = x1; @@ -21,7 +22,7 @@ TEST(mathMixCore, operatorMinusMinusPre2) { stan::test::expect_common_unary(f); } -TEST(mathMixCore, operatorMinusMinusPost1) { +TEST_F(mathMix, operatorMinusMinusPost1) { // this functor tests that y is right value after operator auto f = [](const auto& x1) { auto y = x1; @@ -33,7 +34,7 @@ TEST(mathMixCore, operatorMinusMinusPost1) { stan::test::expect_common_unary(f); } -TEST(mathMixCore, operatorMinusMinusPost2) { +TEST_F(mathMix, operatorMinusMinusPost2) { // this functor tests that value of expression has right value auto f = [](const auto& x1) { auto y = x1; diff --git a/test/unit/math/mix/core/operator_multiplication_test.cpp b/test/unit/math/mix/core/operator_multiplication_test.cpp index 32b553f30d2..4b63e3d85e3 100644 --- a/test/unit/math/mix/core/operator_multiplication_test.cpp +++ b/test/unit/math/mix/core/operator_multiplication_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixCore, operatorMultiplication) { +TEST_F(mathMix, operatorMultiplication) { auto f = [](const auto& x1, const auto& x2) { return x1 * x2; }; bool disable_lhs_int = true; stan::test::expect_common_binary(f, disable_lhs_int); diff --git a/test/unit/math/mix/core/operator_multiply_equal_test.cpp b/test/unit/math/mix/core/operator_multiply_equal_test.cpp index c6303cd2304..8ae780ea85b 100644 --- a/test/unit/math/mix/core/operator_multiply_equal_test.cpp +++ b/test/unit/math/mix/core/operator_multiply_equal_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixCore, operatorMultiplyEqual) { +TEST_F(mathMix, operatorMultiplyEqual) { auto f = [](const auto& x1, const auto& x2) { decltype(x1 + x2) y = x1; y *= x2; diff --git a/test/unit/math/mix/core/operator_not_equal_test.cpp b/test/unit/math/mix/core/operator_not_equal_test.cpp index 0289a031f7c..c9b1e3908ad 100644 --- a/test/unit/math/mix/core/operator_not_equal_test.cpp +++ b/test/unit/math/mix/core/operator_not_equal_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixCore, operatorNotEqual) { +TEST_F(mathMix, operatorNotEqual) { auto f = [](const auto& x1, const auto& x2) { return x1 != x2; }; stan::test::expect_common_comparison(f); stan::test::expect_complex_common_comparison(f); diff --git a/test/unit/math/mix/core/operator_plus_equal_test.cpp b/test/unit/math/mix/core/operator_plus_equal_test.cpp index b3c27281217..ea0e87ebcb5 100644 --- a/test/unit/math/mix/core/operator_plus_equal_test.cpp +++ b/test/unit/math/mix/core/operator_plus_equal_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixCore, operatorPlusEqual) { +TEST_F(mathMix, operatorPlusEqual) { auto f = [](const auto& x1, const auto& x2) { decltype(x1 + x2) y = x1; y += x2; diff --git a/test/unit/math/mix/core/operator_plus_plus_test.cpp b/test/unit/math/mix/core/operator_plus_plus_test.cpp index 5c2b6ed285a..8654b4b1e7d 100644 --- a/test/unit/math/mix/core/operator_plus_plus_test.cpp +++ b/test/unit/math/mix/core/operator_plus_plus_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixCore, operatorPlusPlusPre1) { +TEST_F(mathMix, operatorPlusPlusPre1) { // this functor tests that y is right value after operator auto f = [](const auto& x1) { auto y = x1; @@ -11,7 +12,7 @@ TEST(mathMixCore, operatorPlusPlusPre1) { }; stan::test::expect_common_unary(f); } -TEST(mathMixCore, operatorPlusPlusPre2) { +TEST_F(mathMix, operatorPlusPlusPre2) { // this functor tests that value of expression has right value auto f = [](const auto& x1) { auto y = x1; @@ -21,7 +22,7 @@ TEST(mathMixCore, operatorPlusPlusPre2) { stan::test::expect_common_unary(f); } -TEST(mathMixCore, operatorPlusPlusPost1) { +TEST_F(mathMix, operatorPlusPlusPost1) { // this functor tests that y is right value after operator auto f = [](const auto& x1) { auto y = x1; @@ -33,7 +34,7 @@ TEST(mathMixCore, operatorPlusPlusPost1) { stan::test::expect_common_unary(f); } -TEST(mathMixCore, operatorPlusPlusPost2) { +TEST_F(mathMix, operatorPlusPlusPost2) { // this functor tests that value of expression has right value auto f = [](const auto& x1) { auto y = x1; diff --git a/test/unit/math/mix/core/operator_subtraction_test.cpp b/test/unit/math/mix/core/operator_subtraction_test.cpp index 40065728dea..88f71a94fec 100644 --- a/test/unit/math/mix/core/operator_subtraction_test.cpp +++ b/test/unit/math/mix/core/operator_subtraction_test.cpp @@ -1,13 +1,14 @@ #include +#include -TEST(mathMixCore, operatorSubtraction) { +TEST_F(mathMix, operatorSubtraction) { auto f = [](const auto& x1, const auto& x2) { return x1 - x2; }; bool disable_lhs_int = true; stan::test::expect_common_binary(f, disable_lhs_int); stan::test::expect_complex_common_binary(f); } -TEST(mathMixCore, operatorSubtractionMatrixSmall) { +TEST_F(mathMix, operatorSubtractionMatrixSmall) { // This calls operator- under the hood auto f = [](const auto& x1, const auto& x2) { return stan::math::subtract(x1, x2); @@ -47,7 +48,7 @@ TEST(mathMixCore, operatorSubtractionMatrixSmall) { stan::test::expect_ad_matvar(tols, f, matrix_m11, matrix_m11); } -TEST(mathMixCore, operatorSubtractionMatrixZeroSize) { +TEST_F(mathMix, operatorSubtractionMatrixZeroSize) { auto f = [](const auto& x1, const auto& x2) { return stan::math::subtract(x1, x2); }; @@ -80,7 +81,7 @@ TEST(mathMixCore, operatorSubtractionMatrixZeroSize) { stan::test::expect_ad_matvar(f, matrix_m00, vector_v0); } -TEST(mathMixCore, operatorSubtractionMatrixNormal) { +TEST_F(mathMix, operatorSubtractionMatrixNormal) { auto f = [](const auto& x1, const auto& x2) { return stan::math::subtract(x1, x2); }; @@ -116,7 +117,7 @@ TEST(mathMixCore, operatorSubtractionMatrixNormal) { stan::test::expect_ad_matvar(tols, f, rowvector_rv, matrix_m); } -TEST(mathMixCore, operatorSubtractionMatrixFailures) { +TEST_F(mathMix, operatorSubtractionMatrixFailures) { auto f = [](const auto& x1, const auto& x2) { return stan::math::subtract(x1, x2); }; @@ -144,7 +145,7 @@ TEST(mathMixCore, operatorSubtractionMatrixFailures) { stan::test::expect_ad_matvar(tols, f, rvv, u); } -TEST(mathMixCore, operatorSubtractionMatrixLinearAccess) { +TEST_F(mathMix, operatorSubtractionMatrixLinearAccess) { Eigen::MatrixXd matrix_m11(3, 3); for (Eigen::Index i = 0; i < matrix_m11.size(); ++i) { matrix_m11(i) = i; diff --git a/test/unit/math/mix/core/operator_unary_negative_test.cpp b/test/unit/math/mix/core/operator_unary_negative_test.cpp index 4304dba2215..3264248d673 100644 --- a/test/unit/math/mix/core/operator_unary_negative_test.cpp +++ b/test/unit/math/mix/core/operator_unary_negative_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixCore, operatorUnaryNegative) { +TEST_F(mathMix, operatorUnaryNegative) { auto f = [](const auto& x1) { return -x1; }; stan::test::expect_common_unary(f); stan::test::expect_complex_common(f); diff --git a/test/unit/math/mix/core/operator_unary_not_test.cpp b/test/unit/math/mix/core/operator_unary_not_test.cpp index b6fb1762280..4d21a0cc7c1 100644 --- a/test/unit/math/mix/core/operator_unary_not_test.cpp +++ b/test/unit/math/mix/core/operator_unary_not_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -12,7 +13,7 @@ void test_unary_not(double x) { EXPECT_EQ(!x, !fvar >(x)); } -TEST(AgradMix, unary_not) { +TEST_F(mathMix, unary_not) { test_unary_not(6.1); test_unary_not(0); test_unary_not(-13.2); diff --git a/test/unit/math/mix/core/operator_unary_plus_test.cpp b/test/unit/math/mix/core/operator_unary_plus_test.cpp index 450fa549da7..8742b907442 100644 --- a/test/unit/math/mix/core/operator_unary_plus_test.cpp +++ b/test/unit/math/mix/core/operator_unary_plus_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixCore, operatorUnaryPlus) { +TEST_F(mathMix, operatorUnaryPlus) { auto f = [](const auto& x1) { return +x1; }; stan::test::expect_common_unary(f); stan::test::expect_complex_common(f); diff --git a/test/unit/math/mix/core/std_complex_test.cpp b/test/unit/math/mix/core/std_complex_test.cpp index 23f253b348d..334a357f4a3 100644 --- a/test/unit/math/mix/core/std_complex_test.cpp +++ b/test/unit/math/mix/core/std_complex_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -61,7 +62,7 @@ void test_std_complex_constructor() { test_constructor_init_type(); // NOLINT(runtime/int) } -TEST(mathMixCore, stdComplexConstructor) { +TEST_F(mathMix, stdComplexConstructor) { using stan::math::fvar; using stan::math::var; using stan::test::expect_ad; @@ -105,7 +106,7 @@ void expect_common_for_complex(const F& f) { // it is modified using std::complex or double, then // with the argument. -TEST(mathMixCore, stdComplexOperatorEqual) { +TEST_F(mathMix, stdComplexOperatorEqual) { // operator=(std::complex) auto f = [](const auto& a) { auto b = a; // for auto type @@ -132,7 +133,7 @@ TEST(mathMixCore, stdComplexOperatorEqual) { expect_common_for_complex(g); } -TEST(mathMixCore, stdComplexOperatorPlusEqual) { +TEST_F(mathMix, stdComplexOperatorPlusEqual) { // operator+=(std::complex) auto f = [](const auto& a) { auto b = a; @@ -153,7 +154,7 @@ TEST(mathMixCore, stdComplexOperatorPlusEqual) { expect_common_for_complex(g); } -TEST(mathMixCore, stdComplexOperatorMinusEqual) { +TEST_F(mathMix, stdComplexOperatorMinusEqual) { // operator-=(std::complex) auto f = [](const auto& a) { auto b = a; @@ -174,7 +175,7 @@ TEST(mathMixCore, stdComplexOperatorMinusEqual) { expect_common_for_complex(g); } -TEST(mathMixCore, stdComplexOperatorTimesEqual) { +TEST_F(mathMix, stdComplexOperatorTimesEqual) { // operator-=(std::complex) auto f = [](const auto& a) { auto b = a; @@ -195,7 +196,7 @@ TEST(mathMixCore, stdComplexOperatorTimesEqual) { expect_common_for_complex(g); } -TEST(mathMixCore, stdComplexOperatorDivideEqual) { +TEST_F(mathMix, stdComplexOperatorDivideEqual) { // operator-=(std::complex) auto f = [](const auto& a) { auto b = a; diff --git a/test/unit/math/mix/core/std_numeric_limits_test.cpp b/test/unit/math/mix/core/std_numeric_limits_test.cpp index 9dde1d79f78..63a33f87c4c 100644 --- a/test/unit/math/mix/core/std_numeric_limits_test.cpp +++ b/test/unit/math/mix/core/std_numeric_limits_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(AgradMixNumericLimits, All_Fvar) { +TEST_F(mathMix, All_Fvar) { using stan::math::fvar; using stan::math::INFTY; using stan::math::var; diff --git a/test/unit/math/mix/fun/Phi_approx_test.cpp b/test/unit/math/mix/fun/Phi_approx_test.cpp index b89df1935b7..e1ae8d5f63d 100644 --- a/test/unit/math/mix/fun/Phi_approx_test.cpp +++ b/test/unit/math/mix/fun/Phi_approx_test.cpp @@ -1,12 +1,13 @@ #include +#include -TEST(mathMixMatFun, PhiApprox) { +TEST_F(mathMix, PhiApprox) { auto f = [](const auto& x1) { return stan::math::Phi_approx(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -3.0, 1, 1.3, 3); } -TEST(mathMixMatFun, PhiApprox_varmat) { +TEST_F(mathMix, PhiApprox_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_nonzero_args; diff --git a/test/unit/math/mix/fun/Phi_test.cpp b/test/unit/math/mix/fun/Phi_test.cpp index cc61811f0cd..4aed34933ef 100644 --- a/test/unit/math/mix/fun/Phi_test.cpp +++ b/test/unit/math/mix/fun/Phi_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, Phi) { +TEST_F(mathMix, Phi) { auto f = [](const auto& x1) { return stan::math::Phi(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -27.5, 27.5); @@ -8,7 +9,7 @@ TEST(mathMixMatFun, Phi) { stan::test::expect_unary_vectorized(x); } -TEST(mathMixMatFun, Phi_varmat) { +TEST_F(mathMix, Phi_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_nonzero_args; diff --git a/test/unit/math/mix/fun/abs_test.cpp b/test/unit/math/mix/fun/abs_test.cpp index d62982c3ba5..264f23e9193 100644 --- a/test/unit/math/mix/fun/abs_test.cpp +++ b/test/unit/math/mix/fun/abs_test.cpp @@ -1,10 +1,11 @@ #include +#include #include #include #include #include -TEST(mixFun, absBasics) { +TEST_F(mathMix, absBasics) { using stan::math::abs; int a = abs(1); @@ -29,7 +30,7 @@ using is_complex_and_base_ret = stan::bool_constant< (!stan::is_complex>>::value) || (stan::is_complex>>::value && !stan::is_complex>>::value)>; -TEST(mixFun, abs) { +TEST_F(mathMix, abs) { auto f = [](const auto& x) { auto xx = stan::math::abs(x); static_assert(is_complex_and_base_ret::value, @@ -232,7 +233,7 @@ TEST(mixFun, abs) { amc_t q2{k2, k6}; stan::test::expect_ad(f, q2); } -TEST(mixFun, absReturnType) { +TEST_F(mathMix, absReturnType) { // validate return types not overpromoted to complex by assignability std::complex a = 3; stan::math::var b = abs(a); @@ -244,7 +245,7 @@ TEST(mixFun, absReturnType) { SUCCEED(); } -TEST(mathMixMatFun, abs_varmat) { +TEST_F(mathMix, abs_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_nonzero_args; diff --git a/test/unit/math/mix/fun/accumulator_test.cpp b/test/unit/math/mix/fun/accumulator_test.cpp index 855b92330e2..b9d3fd0e613 100644 --- a/test/unit/math/mix/fun/accumulator_test.cpp +++ b/test/unit/math/mix/fun/accumulator_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -8,7 +9,7 @@ void test_sum(stan::math::accumulator& a, int n) { EXPECT_TRUE((n * (n + 1)) / 2 == a.sum()); } -TEST(AgradMixMatrixAccumulate, fvar_var) { +TEST_F(mathMix, accumulator_fvar_var) { using stan::math::accumulator; using stan::math::fvar; using stan::math::var; @@ -24,7 +25,7 @@ TEST(AgradMixMatrixAccumulate, fvar_var) { test_sum(a, 1000); } -TEST(AgradMixMatrixAccumulate, collection_fvar_var) { +TEST_F(mathMix, accumulator_collection_fvar_var) { using stan::math::accumulator; using stan::math::fvar; using stan::math::matrix_fv; @@ -84,7 +85,7 @@ TEST(AgradMixMatrixAccumulate, collection_fvar_var) { test_sum(a, pos - 1); } -TEST(AgradMixMatrixAccumulate, fvar_fvar_var) { +TEST_F(mathMix, accumulator_fvar_fvar_var) { using stan::math::accumulator; using stan::math::fvar; using stan::math::var; @@ -100,7 +101,7 @@ TEST(AgradMixMatrixAccumulate, fvar_fvar_var) { test_sum(a, 1000); } -TEST(AgradMixMatrixAccumulate, collection_fvar_fvar_var) { +TEST_F(mathMix, accumulator_collection_fvar_fvar_var) { using stan::math::accumulator; using stan::math::fvar; using stan::math::matrix_ffv; @@ -160,7 +161,7 @@ TEST(AgradMixMatrixAccumulate, collection_fvar_fvar_var) { test_sum(a, pos - 1); } -TEST(AgradMixMatrixAccumulate, var_matrix) { +TEST_F(mathMix, accumulator_var_matrix) { auto f = [](const auto& x) { using x_t = decltype(x); stan::math::accumulator> acc; diff --git a/test/unit/math/mix/fun/acos_test.cpp b/test/unit/math/mix/fun/acos_test.cpp index b3a4b9cc436..9d522efdbfe 100644 --- a/test/unit/math/mix/fun/acos_test.cpp +++ b/test/unit/math/mix/fun/acos_test.cpp @@ -1,9 +1,10 @@ #include +#include #include #include #include -TEST(mathMixMatFun, acos) { +TEST_F(mathMix, acos) { using stan::test::expect_unary_vectorized; auto f = [](const auto& x1) { using stan::math::acos; @@ -22,7 +23,7 @@ TEST(mathMixMatFun, acos) { } } -TEST(mathMixMatFun, acos_varmat) { +TEST_F(mathMix, acos_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_nonzero_args; diff --git a/test/unit/math/mix/fun/acosh_test.cpp b/test/unit/math/mix/fun/acosh_test.cpp index 89ffa72873d..9096ed3ff80 100644 --- a/test/unit/math/mix/fun/acosh_test.cpp +++ b/test/unit/math/mix/fun/acosh_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixMatFun, acosh) { +TEST_F(mathMix, acosh) { auto f = [](const auto& x1) { using stan::math::acosh; return acosh(x1); @@ -20,8 +21,8 @@ TEST(mathMixMatFun, acosh) { } } } -/* -TEST(mathMixMatFun, acosh_varmat) { + +TEST_F(mathMix, acosh_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; @@ -38,4 +39,4 @@ TEST(mathMixMatFun, acosh_varmat) { } expect_ad_vector_matvar(f, A); } -*/ + diff --git a/test/unit/math/mix/fun/add_diag_test.cpp b/test/unit/math/mix/fun/add_diag_test.cpp index 8602a4ea48b..873f8d48f7a 100644 --- a/test/unit/math/mix/fun/add_diag_test.cpp +++ b/test/unit/math/mix/fun/add_diag_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, addDiag) { +TEST_F(mathMix, addDiag) { using stan::test::relative_tolerance; auto f = [](const auto& x, const auto& y) { return stan::math::add_diag(x, y); }; diff --git a/test/unit/math/mix/fun/add_test.cpp b/test/unit/math/mix/fun/add_test.cpp index bf163fb3f19..d411e95cbf2 100644 --- a/test/unit/math/mix/fun/add_test.cpp +++ b/test/unit/math/mix/fun/add_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, add_transpose_test) { +TEST_F(mathMix, add_transpose_test) { auto f = [](const auto& x) { return x + x.transpose(); }; Eigen::MatrixXd x(2, 2); @@ -8,7 +9,7 @@ TEST(MathMixMatFun, add_transpose_test) { stan::test::expect_ad_matvar(f, x); } -TEST(MathMixMatFun, add_transpose_test_scalar) { +TEST_F(mathMix, add_transpose_test_scalar) { auto f = [](const auto& y, const auto& x) { return stan::math::add(y, x.block(0, 0, 2, 2)); }; @@ -18,7 +19,7 @@ TEST(MathMixMatFun, add_transpose_test_scalar) { stan::test::expect_ad_matvar(f, 1.0, x); } -TEST(MathMixMatFun, add_1) { +TEST_F(mathMix, add_1) { auto f = [](const auto& x, const auto& y) { return stan::math::add(x, y); }; double d = 2; @@ -45,7 +46,7 @@ TEST(MathMixMatFun, add_1) { stan::test::expect_ad(f, m11, m11b); } -TEST(MathMixMatFun, add_empty) { +TEST_F(mathMix, add_empty) { auto f = [](const auto& x, const auto& y) { return stan::math::add(x, y); }; double d = 2; @@ -66,7 +67,7 @@ TEST(MathMixMatFun, add_empty) { stan::test::expect_ad(f, m00, m00b); } -TEST(MathMixMatFun, add_scalar_mat) { +TEST_F(mathMix, add_scalar_mat) { auto f = [](const auto& x, const auto& y) { return stan::math::add(x, y); }; double d = 2; @@ -93,7 +94,7 @@ TEST(MathMixMatFun, add_scalar_mat) { stan::test::expect_ad(f, m22b, m22b); } -TEST(MathMixMatFun, add_vec_mat) { +TEST_F(mathMix, add_vec_mat) { auto f = [](const auto& x, const auto& y) { return stan::math::add(x, y); }; Eigen::VectorXd v5(5); @@ -108,7 +109,7 @@ TEST(MathMixMatFun, add_vec_mat) { stan::test::expect_ad(f, rv5, rv5b); } -TEST(MathMixMatFun, add_mat_mat) { +TEST_F(mathMix, add_mat_mat) { auto f = [](const auto& x, const auto& y) { return stan::math::add(x, y); }; Eigen::MatrixXd m22c(2, 2); @@ -124,7 +125,7 @@ TEST(MathMixMatFun, add_mat_mat) { stan::test::expect_ad(f, m23, m23b); } -TEST(MathMixMatFun, add_scal) { +TEST_F(mathMix, add_scal) { auto f = [](const auto& x, const auto& y) { return stan::math::add(x, y); }; stan::test::expect_ad(f, 2, 5); @@ -134,7 +135,7 @@ TEST(MathMixMatFun, add_scal) { } // these will throw -TEST(MathMixMatFun, add_throw) { +TEST_F(mathMix, add_throw) { auto f = [](const auto& x, const auto& y) { return stan::math::add(x, y); }; Eigen::VectorXd v1(1); diff --git a/test/unit/math/mix/fun/append_array_test.cpp b/test/unit/math/mix/fun/append_array_test.cpp index 0cf6dd04288..f385aba371a 100644 --- a/test/unit/math/mix/fun/append_array_test.cpp +++ b/test/unit/math/mix/fun/append_array_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -292,7 +293,7 @@ void check() { } } -TEST(MathFunctions, append_array_prim) { +TEST_F(mathMix, append_array_prim) { check(); check(); check(); @@ -302,7 +303,7 @@ TEST(MathFunctions, append_array_prim) { check(); } -TEST(MathFunctions, append_array_rev) { +TEST_F(mathMix, append_array_rev) { check(); check(); check(); @@ -319,7 +320,7 @@ TEST(MathFunctions, append_array_rev) { check(); } -TEST(MathFunctions, append_array_fwd) { +TEST_F(mathMix, append_array_fwd) { check(); check(); check(); @@ -351,7 +352,7 @@ TEST(MathFunctions, append_array_fwd) { check(); } -TEST(MathFunctions, append_array_mix) { +TEST_F(mathMix, append_array_mix) { check(); check(); check(); diff --git a/test/unit/math/mix/fun/append_col_test.cpp b/test/unit/math/mix/fun/append_col_test.cpp index e154b9dec18..c0bca620cc4 100644 --- a/test/unit/math/mix/fun/append_col_test.cpp +++ b/test/unit/math/mix/fun/append_col_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, appendCol) { +TEST_F(mathMix, appendCol) { auto f = [](const auto& x, const auto& y) { return stan::math::append_col(x, y); }; diff --git a/test/unit/math/mix/fun/append_row_test.cpp b/test/unit/math/mix/fun/append_row_test.cpp index f34cd07f5e5..2d6417b4186 100644 --- a/test/unit/math/mix/fun/append_row_test.cpp +++ b/test/unit/math/mix/fun/append_row_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, appendRow) { +TEST_F(mathMix, appendRow) { auto f = [](const auto& x, const auto& y) { return stan::math::append_row(x, y); }; diff --git a/test/unit/math/mix/fun/arg_test.cpp b/test/unit/math/mix/fun/arg_test.cpp index 93c62aa1f09..33b1ced2630 100644 --- a/test/unit/math/mix/fun/arg_test.cpp +++ b/test/unit/math/mix/fun/arg_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(mixScalFun, arg) { +TEST_F(mathMix, arg) { auto f = [](const auto& x) { return arg(x); }; // undefined with 0 in denominator diff --git a/test/unit/math/mix/fun/array_builder_test.cpp b/test/unit/math/mix/fun/array_builder_test.cpp index 8549f0031c3..5a5c8afb161 100644 --- a/test/unit/math/mix/fun/array_builder_test.cpp +++ b/test/unit/math/mix/fun/array_builder_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(AgradMixMatrixArrayBuilder, fvar_var) { +TEST_F(mathMix, array_builder_fvar_var) { using stan::math::array_builder; using stan::math::fvar; using stan::math::var; @@ -55,7 +56,7 @@ TEST(AgradMixMatrixArrayBuilder, fvar_var) { EXPECT_EQ(4, xx[2][1].d_.val()); } -TEST(AgradMixMatrixArrayBuilder, fvar_fvar_var) { +TEST_F(mathMix, array_builder_fvar_fvar_var) { using stan::math::array_builder; using stan::math::fvar; using stan::math::var; diff --git a/test/unit/math/mix/fun/asin_test.cpp b/test/unit/math/mix/fun/asin_test.cpp index c0e8ab844f9..d0686ea14b9 100644 --- a/test/unit/math/mix/fun/asin_test.cpp +++ b/test/unit/math/mix/fun/asin_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixMatFun, asin) { +TEST_F(mathMix, asin) { auto f = [](const auto& x) { using stan::math::asin; return asin(x); @@ -17,7 +18,7 @@ TEST(mathMixMatFun, asin) { } } -TEST(mathMixMatFun, asin_varmat) { +TEST_F(mathMix, asin_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_nonzero_args; diff --git a/test/unit/math/mix/fun/asinh_test.cpp b/test/unit/math/mix/fun/asinh_test.cpp index f64a39f0faf..0ef51bb0107 100644 --- a/test/unit/math/mix/fun/asinh_test.cpp +++ b/test/unit/math/mix/fun/asinh_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(mathMixFun, asinh) { +TEST_F(mathMix, asinh) { auto f = [](const auto& x1) { using stan::math::asinh; return asinh(x1); @@ -18,7 +19,7 @@ TEST(mathMixFun, asinh) { } } -TEST(mathMixMatFun, asinh_varmat) { +TEST_F(mathMix, asinh_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/assign_test.cpp b/test/unit/math/mix/fun/assign_test.cpp index e7b4308c7dc..fc459147459 100644 --- a/test/unit/math/mix/fun/assign_test.cpp +++ b/test/unit/math/mix/fun/assign_test.cpp @@ -1,9 +1,10 @@ #include +#include #include #include #include -TEST(AgradMixMatrixAssign, vector_fvar_var) { +TEST_F(mathMix, vector_fvar_var) { using stan::math::assign; using stan::math::fvar; using stan::math::var; @@ -41,7 +42,7 @@ TEST(AgradMixMatrixAssign, vector_fvar_var) { EXPECT_FLOAT_EQ(0, grads[2]); } -TEST(AgradMixMatrixAssign, eigen_row_vector_fvar_var_to_fvar_var) { +TEST_F(mathMix, eigen_row_vector_fvar_var_to_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::assign; @@ -76,7 +77,7 @@ TEST(AgradMixMatrixAssign, eigen_row_vector_fvar_var_to_fvar_var) { EXPECT_FLOAT_EQ(0, grads[1]); EXPECT_FLOAT_EQ(0, grads[2]); } -TEST(AgradMixMatrixAssign, eigen_row_vector_fvar_var_shape_mismatch) { +TEST_F(mathMix, eigen_row_vector_fvar_var_shape_mismatch) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::assign; @@ -100,7 +101,7 @@ TEST(AgradMixMatrixAssign, eigen_row_vector_fvar_var_shape_mismatch) { EXPECT_THROW(assign(x, zzz), std::invalid_argument); } -TEST(AgradMixMatrixAssign, eigen_matrix_fvar_var_to_fvar_var) { +TEST_F(mathMix, eigen_matrix_fvar_var_to_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::assign; @@ -147,7 +148,7 @@ TEST(AgradMixMatrixAssign, eigen_matrix_fvar_var_to_fvar_var) { EXPECT_FLOAT_EQ(0, grads[5]); } -TEST(AgradMixMatrixAssign, eigen_matrix_fvar_var_shape_mismatch) { +TEST_F(mathMix, eigen_matrix_fvar_var_shape_mismatch) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::assign; @@ -173,7 +174,7 @@ TEST(AgradMixMatrixAssign, eigen_matrix_fvar_var_shape_mismatch) { EXPECT_THROW(assign(zzz, x), std::invalid_argument); } -TEST(AgradMixMatrixAssign, block_fvar_var) { +TEST_F(mathMix, block_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::assign; @@ -193,7 +194,7 @@ TEST(AgradMixMatrixAssign, block_fvar_var) { EXPECT_FLOAT_EQ(1000.0, m(0, 2).val_.val()); } -TEST(AgradMixMatrixAssign, vector_vector_fvar_var) { +TEST_F(mathMix, vector_vector_fvar_var) { using stan::math::assign; using stan::math::fvar; using stan::math::var; @@ -235,7 +236,7 @@ TEST(AgradMixMatrixAssign, vector_vector_fvar_var) { EXPECT_FLOAT_EQ(0, grads[5]); } -TEST(AgradMixMatrixAssign, vector_vector_vector_fvar_var) { +TEST_F(mathMix, vector_vector_vector_fvar_var) { using stan::math::assign; using stan::math::fvar; using stan::math::var; @@ -275,7 +276,7 @@ TEST(AgradMixMatrixAssign, vector_vector_vector_fvar_var) { EXPECT_FLOAT_EQ(0, grads[i]); } -TEST(AgradMixMatrixAssign, vector_eigen_vector_fvar_var) { +TEST_F(mathMix, vector_eigen_vector_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::assign; @@ -310,7 +311,7 @@ TEST(AgradMixMatrixAssign, vector_eigen_vector_fvar_var) { EXPECT_FLOAT_EQ(0, grads[i]); } -TEST(AgradMixMatrixAssign, get_assign_row_fvar_var) { +TEST_F(mathMix, get_assign_row_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::assign; @@ -330,7 +331,7 @@ TEST(AgradMixMatrixAssign, get_assign_row_fvar_var) { EXPECT_FLOAT_EQ(1000.0, m(0, 2).val_.val()); } -TEST(AgradMixMatrixAssign, vector_fvar_fvar_var) { +TEST_F(mathMix, vector_fvar_fvar_var) { using stan::math::assign; using stan::math::fvar; using stan::math::var; @@ -376,7 +377,7 @@ TEST(AgradMixMatrixAssign, vector_fvar_fvar_var) { EXPECT_FLOAT_EQ(0, grads[2]); } -TEST(AgradMixMatrixAssign, eigen_row_vector_fvar_fvar_var_to_fvar_fvar_var) { +TEST_F(mathMix, eigen_row_vector_fvar_fvar_var_to_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::assign; @@ -420,7 +421,7 @@ TEST(AgradMixMatrixAssign, eigen_row_vector_fvar_fvar_var_to_fvar_fvar_var) { EXPECT_FLOAT_EQ(0, grads[2]); } -TEST(AgradMixMatrixAssign, eigen_row_vector_fvar_fvar_var_shape_mismatch) { +TEST_F(mathMix, eigen_row_vector_fvar_fvar_var_shape_mismatch) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::assign; @@ -444,7 +445,7 @@ TEST(AgradMixMatrixAssign, eigen_row_vector_fvar_fvar_var_shape_mismatch) { EXPECT_THROW(assign(x, zzz), std::invalid_argument); } -TEST(AgradMixMatrixAssign, eigen_matrix_fvar_fvar_var_to_fvar_fvar_var) { +TEST_F(mathMix, eigen_matrix_fvar_fvar_var_to_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::assign; @@ -505,7 +506,7 @@ TEST(AgradMixMatrixAssign, eigen_matrix_fvar_fvar_var_to_fvar_fvar_var) { EXPECT_FLOAT_EQ(0, grads[5]); } -TEST(AgradMixMatrixAssign, eigen_matrix_fvar_fvar_var_shape_mismatch) { +TEST_F(mathMix, eigen_matrix_fvar_fvar_var_shape_mismatch) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::assign; @@ -531,7 +532,7 @@ TEST(AgradMixMatrixAssign, eigen_matrix_fvar_fvar_var_shape_mismatch) { EXPECT_THROW(assign(zzz, x), std::invalid_argument); } -TEST(AgradMixMatrixAssign, block_fvar_fvar_var) { +TEST_F(mathMix, block_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::assign; @@ -551,7 +552,7 @@ TEST(AgradMixMatrixAssign, block_fvar_fvar_var) { EXPECT_FLOAT_EQ(1000.0, m(0, 2).val_.val_.val()); } -TEST(AgradMixMatrixAssign, vector_vector_fvar_fvar_var) { +TEST_F(mathMix, vector_vector_fvar_fvar_var) { using stan::math::assign; using stan::math::fvar; using stan::math::var; @@ -597,7 +598,7 @@ TEST(AgradMixMatrixAssign, vector_vector_fvar_fvar_var) { EXPECT_FLOAT_EQ(0, grads[5]); } -TEST(AgradMixMatrixAssign, vector_vector_vector_fvar_fvar_var) { +TEST_F(mathMix, vector_vector_vector_fvar_fvar_var) { using stan::math::assign; using stan::math::fvar; using stan::math::var; @@ -641,7 +642,7 @@ TEST(AgradMixMatrixAssign, vector_vector_vector_fvar_fvar_var) { EXPECT_FLOAT_EQ(0, grads[i]); } -TEST(AgradMixMatrixAssign, vector_eigen_vector_fvar_fvar_var) { +TEST_F(mathMix, vector_eigen_vector_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::assign; @@ -682,7 +683,7 @@ TEST(AgradMixMatrixAssign, vector_eigen_vector_fvar_fvar_var) { EXPECT_FLOAT_EQ(0, grads[i]); } -TEST(AgradMixMatrixAssign, get_assign_row_fvar_fvar_var) { +TEST_F(mathMix, get_assign_row_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::assign; diff --git a/test/unit/math/mix/fun/atan2_test.cpp b/test/unit/math/mix/fun/atan2_test.cpp index f01ef5c626c..cfb1f2debeb 100644 --- a/test/unit/math/mix/fun/atan2_test.cpp +++ b/test/unit/math/mix/fun/atan2_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(mathMixCore, atan2) { +TEST_F(mathMix, atan2_nan) { auto f = [](const auto& x1, const auto& x2) { using stan::math::atan2; return atan2(x1, x2); @@ -17,7 +18,7 @@ TEST(mathMixCore, atan2) { stan::test::expect_ad(f, 0.5, 2.3); } -TEST(mathMixScalFun, atan2) { +TEST_F(mathMix, atan2) { auto f = [](const auto& x1, const auto& x2) { using stan::math::atan2; return atan2(x1, x2); @@ -39,7 +40,7 @@ TEST(mathMixScalFun, atan2) { stan::test::expect_ad_vectorized_binary(f, in1, in2); } -TEST(mathMixScalFun, atan2_varmat) { +TEST_F(mathMix, atan2_varmat) { auto f = [](const auto& x1, const auto& x2) { using stan::math::atan2; return atan2(x1, x2); diff --git a/test/unit/math/mix/fun/atan_test.cpp b/test/unit/math/mix/fun/atan_test.cpp index 432ec6c34f1..708dd54d485 100644 --- a/test/unit/math/mix/fun/atan_test.cpp +++ b/test/unit/math/mix/fun/atan_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(mathMixMatFun, atan) { +TEST_F(mathMix, atan) { auto f = [](const auto& x) { using stan::math::atan; return atan(x); @@ -18,7 +19,7 @@ TEST(mathMixMatFun, atan) { } } -TEST(mathMixMatFun, atan_varmat) { +TEST_F(mathMix, atan_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_nonzero_args; diff --git a/test/unit/math/mix/fun/atanh_test.cpp b/test/unit/math/mix/fun/atanh_test.cpp index 7bd28677354..5e8e6032032 100644 --- a/test/unit/math/mix/fun/atanh_test.cpp +++ b/test/unit/math/mix/fun/atanh_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixMatFun, atanh) { +TEST_F(mathMix, atanh) { auto f = [](const auto& x1) { using stan::math::atanh; return atanh(x1); @@ -15,7 +16,7 @@ TEST(mathMixMatFun, atanh) { } } -TEST(mathMixMatFun, atanh_varmat) { +TEST_F(mathMix, atanh_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/bessel_first_kind_test.cpp b/test/unit/math/mix/fun/bessel_first_kind_test.cpp index 4d81eaefec5..be90cc05a5b 100644 --- a/test/unit/math/mix/fun/bessel_first_kind_test.cpp +++ b/test/unit/math/mix/fun/bessel_first_kind_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, besselFirstKind) { +TEST_F(mathMix, besselFirstKind) { // bind integer arg because can't autodiff through auto f = [](const int x1) { return @@ -14,7 +15,7 @@ TEST(mathMixScalFun, besselFirstKind) { stan::test::expect_ad(f(2), 2.79); } -TEST(mathMixScalFun, besselFirstKind_vec) { +TEST_F(mathMix, besselFirstKind_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::bessel_first_kind; return bessel_first_kind(x1, x2); @@ -30,7 +31,7 @@ TEST(mathMixScalFun, besselFirstKind_vec) { stan::test::expect_ad_vectorized_binary(f, std_std_in1, mat_in2); } -TEST(mathMixScalFun, besselFirstKind_matvec) { +TEST_F(mathMix, besselFirstKind_matvec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::bessel_first_kind; return bessel_first_kind(x1, x2); diff --git a/test/unit/math/mix/fun/bessel_second_kind_test.cpp b/test/unit/math/mix/fun/bessel_second_kind_test.cpp index 20ac4eba54c..e33d70c17e2 100644 --- a/test/unit/math/mix/fun/bessel_second_kind_test.cpp +++ b/test/unit/math/mix/fun/bessel_second_kind_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, besselSecondKind) { +TEST_F(mathMix, besselSecondKind) { // bind integer arg because can't autodiff through auto f = [](const int x1) { return @@ -15,7 +16,7 @@ TEST(mathMixScalFun, besselSecondKind) { stan::test::expect_ad(f(2), 2.79); } -TEST(mathMixScalFun, besselSecondKind_vec) { +TEST_F(mathMix, besselSecondKind_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::bessel_second_kind; return bessel_second_kind(x1, x2); @@ -31,7 +32,7 @@ TEST(mathMixScalFun, besselSecondKind_vec) { stan::test::expect_ad_vectorized_binary(f, std_std_in1, mat_in2); } -TEST(mathMixScalFun, besselSecondKind_matvec) { +TEST_F(mathMix, besselSecondKind_matvec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::bessel_second_kind; return bessel_second_kind(x1, x2); diff --git a/test/unit/math/mix/fun/beta2_test.cpp b/test/unit/math/mix/fun/beta2_test.cpp index 14f3a1c3391..d73e8477094 100644 --- a/test/unit/math/mix/fun/beta2_test.cpp +++ b/test/unit/math/mix/fun/beta2_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixScalFun, beta_varmat_vectorized) { +TEST_F(mathMix, beta_varmat_vectorized) { auto f = [](const auto& x1, const auto& x2) { using stan::math::beta; return beta(x1, x2); diff --git a/test/unit/math/mix/fun/beta_test.cpp b/test/unit/math/mix/fun/beta_test.cpp index dad29034aa0..833b3e89b8e 100644 --- a/test/unit/math/mix/fun/beta_test.cpp +++ b/test/unit/math/mix/fun/beta_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixScalFun, beta) { +TEST_F(mathMix, beta) { auto f = [](const auto& x1, const auto& x2) { using stan::math::beta; return beta(x1, x2); @@ -20,7 +21,7 @@ TEST(mathMixScalFun, beta) { stan::test::expect_ad_vectorized_binary(f, in1, in2); } -TEST(mathMixScalFun, beta_varmat) { +TEST_F(mathMix, beta_varmat) { auto f = [](const auto& x1, const auto& x2) { using stan::math::beta; return beta(x1, x2); diff --git a/test/unit/math/mix/fun/binary_log_loss_test.cpp b/test/unit/math/mix/fun/binary_log_loss_test.cpp index 109cda944ab..0df4547583b 100644 --- a/test/unit/math/mix/fun/binary_log_loss_test.cpp +++ b/test/unit/math/mix/fun/binary_log_loss_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, binaryLogLoss) { +TEST_F(mathMix, binaryLogLoss) { // bind integer arg because can't autodiff auto f = [](int x1) { return [=](const auto& x2) { return stan::math::binary_log_loss(x1, x2); }; @@ -13,7 +14,7 @@ TEST(mathMixScalFun, binaryLogLoss) { } } -TEST(mathMixScalFun, binaryLogLossvec) { +TEST_F(mathMix, binaryLogLossvec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::binary_log_loss; return binary_log_loss(x1, x2); @@ -29,7 +30,7 @@ TEST(mathMixScalFun, binaryLogLossvec) { stan::test::expect_ad_vectorized_binary(f, std_std_in1, mat_in2); } -TEST(mathMixScalFun, binaryLogLossMatVar) { +TEST_F(mathMix, binaryLogLossMatVar) { auto f = [](const auto& x1, const auto& x2) { using stan::math::binary_log_loss; return binary_log_loss(x1, x2); @@ -42,7 +43,7 @@ TEST(mathMixScalFun, binaryLogLossMatVar) { stan::test::expect_ad_matvar(f, std_in1[0], in2); } -TEST(mathMixScalFun, binaryLogLossMatVarVec) { +TEST_F(mathMix, binaryLogLossMatVarVec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::binary_log_loss; return binary_log_loss(x1, x2); diff --git a/test/unit/math/mix/fun/binomial_coefficient_log_test.cpp b/test/unit/math/mix/fun/binomial_coefficient_log_test.cpp index a541aabe02d..47c5fd7f11b 100644 --- a/test/unit/math/mix/fun/binomial_coefficient_log_test.cpp +++ b/test/unit/math/mix/fun/binomial_coefficient_log_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixScalFun, binomialCoefficientLog) { +TEST_F(mathMix, binomialCoefficientLog) { auto f = [](const auto& x1, const auto& x2) { return stan::math::binomial_coefficient_log(x1, x2); }; @@ -13,7 +14,7 @@ TEST(mathMixScalFun, binomialCoefficientLog) { stan::test::expect_common_nonzero_binary(f); } -TEST(mathMixScalFun, binomialCoefficientLog_vec) { +TEST_F(mathMix, binomialCoefficientLog_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::binomial_coefficient_log; return binomial_coefficient_log(x1, x2); diff --git a/test/unit/math/mix/fun/block_test.cpp b/test/unit/math/mix/fun/block_test.cpp index 181a3bcbcce..8fe646d7d72 100644 --- a/test/unit/math/mix/fun/block_test.cpp +++ b/test/unit/math/mix/fun/block_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, block) { +TEST_F(mathMix, block) { auto f = [](int i, int j, int m, int n) { return [=](const auto& y) { return stan::math::block(y, i, j, m, n); }; }; diff --git a/test/unit/math/mix/fun/cbrt_test.cpp b/test/unit/math/mix/fun/cbrt_test.cpp index eb3050d604a..324913d5601 100644 --- a/test/unit/math/mix/fun/cbrt_test.cpp +++ b/test/unit/math/mix/fun/cbrt_test.cpp @@ -1,13 +1,14 @@ #include +#include -TEST(mathMixMatFun, cbrt) { +TEST_F(mathMix, cbrt) { auto f = [](const auto& x1) { return stan::math::cbrt(x1); }; stan::test::expect_common_nonzero_unary_vectorized< stan::test::ScalarSupport::Real>(f); stan::test::expect_unary_vectorized(f, -2.6, -2, 1, 1.3, 3); } -TEST(mathMixMatFun, cbrt_varmat) { +TEST_F(mathMix, cbrt_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_nonzero_args; diff --git a/test/unit/math/mix/fun/ceil_test.cpp b/test/unit/math/mix/fun/ceil_test.cpp index 96586086fd6..cef95e38a1e 100644 --- a/test/unit/math/mix/fun/ceil_test.cpp +++ b/test/unit/math/mix/fun/ceil_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, ceil) { +TEST_F(mathMix, ceil) { auto f = [](const auto& x1) { return stan::math::ceil(x1); }; // can't autodiff ceil through integers for (auto x : stan::test::internal::common_nonzero_args()) @@ -8,7 +9,7 @@ TEST(mathMixMatFun, ceil) { stan::test::expect_unary_vectorized(f, -2.6, -2.1, -0.2, 1.1, 1.51, 3.1); } -TEST(mathMixMatFun, ceilmatvar) { +TEST_F(mathMix, ceilmatvar) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/cholesky_corr_constrain_test.cpp b/test/unit/math/mix/fun/cholesky_corr_constrain_test.cpp index 788848c8c2c..20e81946854 100644 --- a/test/unit/math/mix/fun/cholesky_corr_constrain_test.cpp +++ b/test/unit/math/mix/fun/cholesky_corr_constrain_test.cpp @@ -1,4 +1,5 @@ #include +#include namespace cholesky_corr_constrain_test { // easier than fiddling the quadratic equation @@ -46,7 +47,7 @@ void expect_cholesky_corr_transform(const T& x) { } } // namespace cholesky_corr_constrain_test -TEST(MathMixMatFun, cholesky_corrTransform) { +TEST_F(mathMix, cholesky_corrTransform) { // sizes must be (n choose 2) Eigen::VectorXd v0(0); @@ -65,7 +66,7 @@ TEST(MathMixMatFun, cholesky_corrTransform) { cholesky_corr_constrain_test::expect_cholesky_corr_transform(v6); } -TEST(mathMixMatFun, cholesky_corr_constrain) { +TEST_F(mathMix, cholesky_corr_constrain) { auto f = [](int K) { return [K](const auto& x1) { return stan::math::cholesky_corr_constrain(x1, K); @@ -82,7 +83,7 @@ TEST(mathMixMatFun, cholesky_corr_constrain) { stan::test::expect_ad_matvar(f(3), x2); } -TEST(mathMixMatFun, cholesky_corr_constrain_lp) { +TEST_F(mathMix, cholesky_corr_constrain_lp) { auto f1 = [](int K) { return [K](const auto& x1) { stan::scalar_type_t lp = 0.0; diff --git a/test/unit/math/mix/fun/cholesky_decompose_test.cpp b/test/unit/math/mix/fun/cholesky_decompose_test.cpp index 3413c3e8d74..00e89f45393 100644 --- a/test/unit/math/mix/fun/cholesky_decompose_test.cpp +++ b/test/unit/math/mix/fun/cholesky_decompose_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -31,7 +32,7 @@ void expect_cholesky(const Eigen::MatrixXd& Sigma) { } } // namespace cholesky_decompose_test -TEST(MathMixMatFun, choleskyDecomposeSpecific) { +TEST_F(mathMix, choleskyDecomposeSpecific) { // 1 x 1 matrix; (1 choose 2) + 1 = 1 Eigen::VectorXd x1(1); x1 << 1; @@ -74,7 +75,7 @@ TEST(MathMixMatFun, choleskyDecomposeSpecific) { stan::test::expect_ad_matvar(g, y); } -TEST(MathMixMatFun, choleskyDecomposeGeneral) { +TEST_F(mathMix, choleskyDecomposeGeneral) { // general sizes for (int n = 0; n < 8; ++n) { int dof = (n * (n + 1)) / 2; @@ -91,7 +92,7 @@ TEST(MathMixMatFun, choleskyDecomposeGeneral) { } } -TEST(MathMixMatFun, choleskyDecomposeGeneralBig) { +TEST_F(mathMix, choleskyDecomposeGeneralBig) { // general sizes for (int n : std::vector{12, 13, 20, 40, 50}) { int dof = (n * (n + 1)) / 2; @@ -107,7 +108,7 @@ TEST(MathMixMatFun, choleskyDecomposeGeneralBig) { } // GP covar -TEST(MathMixMatFun, choleskyDecomposeGP) { +TEST_F(mathMix, choleskyDecomposeGP) { for (size_t n = 1; n < 5; ++n) { std::vector xx(n); for (size_t i = 0; i < n; ++i) { diff --git a/test/unit/math/mix/fun/cholesky_factor_constrain_test.cpp b/test/unit/math/mix/fun/cholesky_factor_constrain_test.cpp index 9210fc1f021..3e22e79e941 100644 --- a/test/unit/math/mix/fun/cholesky_factor_constrain_test.cpp +++ b/test/unit/math/mix/fun/cholesky_factor_constrain_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, cholesky_factor_constrain) { +TEST_F(mathMix, cholesky_factor_constrain) { auto f = [](int M, int N) { return [M, N](const auto& x1) { stan::scalar_type_t lp = 0.0; @@ -19,7 +20,7 @@ TEST(mathMixMatFun, cholesky_factor_constrain) { stan::test::expect_ad_matvar(f(5, 3), x2); } -TEST(mathMixMatFun, cholesky_factor_constrain_lp) { +TEST_F(mathMix, cholesky_factor_constrain_lp) { auto f1 = [](int M, int N) { return [M, N](const auto& x1) { stan::scalar_type_t lp = 0.0; diff --git a/test/unit/math/mix/fun/col_test.cpp b/test/unit/math/mix/fun/col_test.cpp index 8e48bcc7976..da0b957e590 100644 --- a/test/unit/math/mix/fun/col_test.cpp +++ b/test/unit/math/mix/fun/col_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, col) { +TEST_F(mathMix, col) { auto f = [](int j) { return [=](const auto& y) { return stan::math::col(y, j); }; }; diff --git a/test/unit/math/mix/fun/cols_test.cpp b/test/unit/math/mix/fun/cols_test.cpp index 872984b1d04..e26e3e4ca8a 100644 --- a/test/unit/math/mix/fun/cols_test.cpp +++ b/test/unit/math/mix/fun/cols_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(AgradMixMatrixCols, vector_fv) { +TEST_F(mathMix, vector_fv) { using stan::math::cols; using stan::math::fvar; using stan::math::row_vector_fv; @@ -21,7 +22,7 @@ TEST(AgradMixMatrixCols, vector_fv) { v.resize(0); EXPECT_EQ(1U, cols(v)); } -TEST(AgradMixMatrixCols, rowvector_fv) { +TEST_F(mathMix, rowvector_fv) { using stan::math::cols; using stan::math::fvar; using stan::math::row_vector_fv; @@ -40,7 +41,7 @@ TEST(AgradMixMatrixCols, rowvector_fv) { rv.resize(0); EXPECT_EQ(0U, cols(rv)); } -TEST(AgradMixMatrixCols, matrix_fv) { +TEST_F(mathMix, matrix_fv) { using stan::math::cols; using stan::math::fvar; using stan::math::matrix_fv; @@ -59,7 +60,7 @@ TEST(AgradMixMatrixCols, matrix_fv) { m.resize(5, 0); EXPECT_EQ(0U, cols(m)); } -TEST(AgradMixFvarFvarMatrix, vector_ffv) { +TEST_F(mathMix, vector_ffv) { using stan::math::cols; using stan::math::fvar; using stan::math::row_vector_ffv; @@ -89,7 +90,7 @@ TEST(AgradMixFvarFvarMatrix, vector_ffv) { v.resize(0); EXPECT_EQ(1U, cols(v)); } -TEST(AgradMixMatrixCols, rowvector_ffv) { +TEST_F(mathMix, rowvector_ffv) { using stan::math::cols; using stan::math::fvar; using stan::math::row_vector_ffv; @@ -118,7 +119,7 @@ TEST(AgradMixMatrixCols, rowvector_ffv) { rv.resize(0); EXPECT_EQ(0U, cols(rv)); } -TEST(AgradMixMatrixCols, matrix_ffv) { +TEST_F(mathMix, matrix_ffv) { using stan::math::cols; using stan::math::fvar; using stan::math::matrix_ffv; diff --git a/test/unit/math/mix/fun/columns_dot_product_test.cpp b/test/unit/math/mix/fun/columns_dot_product_test.cpp index b3fa756b503..f467594edbe 100644 --- a/test/unit/math/mix/fun/columns_dot_product_test.cpp +++ b/test/unit/math/mix/fun/columns_dot_product_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, columnsDotProduct) { +TEST_F(mathMix, columnsDotProduct) { auto f = [](const auto& x, const auto& y) { return stan::math::columns_dot_product(x, y); }; diff --git a/test/unit/math/mix/fun/columns_dot_self_test.cpp b/test/unit/math/mix/fun/columns_dot_self_test.cpp index ca0bff9cbf4..d7e3b87f2b3 100644 --- a/test/unit/math/mix/fun/columns_dot_self_test.cpp +++ b/test/unit/math/mix/fun/columns_dot_self_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, columnsDotSelf) { +TEST_F(mathMix, columnsDotSelf) { auto f = [](const auto& x) { return stan::math::columns_dot_self(x); }; Eigen::MatrixXd a11(1, 1); a11 << 2; diff --git a/test/unit/math/mix/fun/complex_schur_decompose_test.cpp b/test/unit/math/mix/fun/complex_schur_decompose_test.cpp index 8c55eb42d85..9c68b6f220b 100644 --- a/test/unit/math/mix/fun/complex_schur_decompose_test.cpp +++ b/test/unit/math/mix/fun/complex_schur_decompose_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixFun, complexSchurDecomposeT) { +TEST_F(mathMix, complexSchurDecomposeT) { auto f = [](const auto& x) { using stan::math::complex_schur_decompose_t; return complex_schur_decompose_t(x); @@ -15,7 +16,7 @@ TEST(mathMixFun, complexSchurDecomposeT) { EXPECT_THROW(f(a32), std::invalid_argument); } -TEST(mathMixFun, complexSchurDecomposeU) { +TEST_F(mathMix, complexSchurDecomposeU) { auto f = [](const auto& x) { using stan::math::complex_schur_decompose_u; return complex_schur_decompose_u(x); @@ -29,7 +30,7 @@ TEST(mathMixFun, complexSchurDecomposeU) { EXPECT_THROW(f(a32), std::invalid_argument); } -TEST(mathMixFun, complexSchurDecompose) { +TEST_F(mathMix, complexSchurDecompose) { auto f = [](const auto& x) { using stan::math::complex_schur_decompose; return std::get<0>(complex_schur_decompose(x)); @@ -89,7 +90,7 @@ void test_complex_schur_decompose_complex(const Eigen::MatrixXd& x) { EXPECT_MATRIX_COMPLEX_NEAR(value_of_rec(X), value_of_rec(X3), 1e-8); } -TEST(mathMixFun, complexSchurDecomposeIdent) { +TEST_F(mathMix, complexSchurDecomposeIdent) { using d_t = double; using v_t = stan::math::var; using fd_t = stan::math::fvar; diff --git a/test/unit/math/mix/fun/conj_test.cpp b/test/unit/math/mix/fun/conj_test.cpp index 2c753ab862c..8a786c52102 100644 --- a/test/unit/math/mix/fun/conj_test.cpp +++ b/test/unit/math/mix/fun/conj_test.cpp @@ -1,9 +1,10 @@ #include #include +#include #include #include -TEST(mathMixMatFun, conj) { +TEST_F(mathMix, conj) { auto f = [](const auto& x) { return stan::math::conj(x); }; stan::test::expect_complex_common(f); stan::test::expect_unary_vectorized( @@ -33,7 +34,7 @@ void test_vectorized_conj() { } } -TEST(mathMixMatFun, conj_vectorized) { +TEST_F(mathMix, conj_vectorized) { using d_t = double; using v_t = stan::math::var; using fd_t = stan::math::fvar; diff --git a/test/unit/math/mix/fun/copysign_test.cpp b/test/unit/math/mix/fun/copysign_test.cpp index e7b111c994f..f52ba0e4778 100644 --- a/test/unit/math/mix/fun/copysign_test.cpp +++ b/test/unit/math/mix/fun/copysign_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -71,7 +72,7 @@ void expect_copysign() { } } -TEST(mixFun, copysign) { +TEST_F(mathMix, copysign) { using stan::math::fvar; using stan::math::var; expect_copysign(); diff --git a/test/unit/math/mix/fun/corr_constrain_test.cpp b/test/unit/math/mix/fun/corr_constrain_test.cpp index 609062f9f73..4f4bd548366 100644 --- a/test/unit/math/mix/fun/corr_constrain_test.cpp +++ b/test/unit/math/mix/fun/corr_constrain_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, corr_constrain) { +TEST_F(mathMix, corr_constrain) { auto f = [](const auto& x1) { stan::scalar_type_t lp = 0.0; return stan::math::corr_constrain(x1, lp); @@ -29,7 +30,7 @@ TEST(mathMixMatFun, corr_constrain) { stan::test::expect_ad_matvar(f, x6); } -TEST(mathMixMatFun, corr_constrain_lp) { +TEST_F(mathMix, corr_constrain_lp) { auto f1 = [](const auto& x1) { stan::scalar_type_t lp = 0.0; return stan::math::corr_constrain(x1, lp); diff --git a/test/unit/math/mix/fun/corr_matrix_constrain_test.cpp b/test/unit/math/mix/fun/corr_matrix_constrain_test.cpp index 3dba44cd792..2a497cc33bb 100644 --- a/test/unit/math/mix/fun/corr_matrix_constrain_test.cpp +++ b/test/unit/math/mix/fun/corr_matrix_constrain_test.cpp @@ -1,4 +1,5 @@ #include +#include namespace corr_matrix_constrain_test { // easier than fiddling the quadratic equation @@ -46,7 +47,7 @@ void expect_corr_matrix_transform(const T& x) { } } // namespace corr_matrix_constrain_test -TEST(MathMixMatFun, corr_matrixTransform) { +TEST_F(mathMix, corr_matrixTransform) { // sizes must be (n choose 2) Eigen::VectorXd v0(0); @@ -65,7 +66,7 @@ TEST(MathMixMatFun, corr_matrixTransform) { corr_matrix_constrain_test::expect_corr_matrix_transform(v6); } -TEST(mathMixMatFun, corr_matrix_constrain) { +TEST_F(mathMix, corr_matrix_constrain) { auto f = [](int K) { return [K](const auto& x1) { stan::scalar_type_t lp = 0.0; @@ -83,7 +84,7 @@ TEST(mathMixMatFun, corr_matrix_constrain) { stan::test::expect_ad_matvar(f(3), x2); } -TEST(mathMixMatFun, corr_matrix_constrain_lp) { +TEST_F(mathMix, corr_matrix_constrain_lp) { auto f1 = [](int K) { return [K](const auto& x1) { stan::scalar_type_t lp = 0.0; diff --git a/test/unit/math/mix/fun/cos_test.cpp b/test/unit/math/mix/fun/cos_test.cpp index 4070a9d12b5..eec95335c60 100644 --- a/test/unit/math/mix/fun/cos_test.cpp +++ b/test/unit/math/mix/fun/cos_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, cos) { +TEST_F(mathMix, cos) { auto f = [](const auto& x) { using stan::math::cos; return cos(x); @@ -12,7 +13,7 @@ TEST(mathMixMatFun, cos) { stan::test::expect_complex_common(f); } -TEST(mathMixMatFun, cos_varmat) { +TEST_F(mathMix, cos_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_nonzero_args; diff --git a/test/unit/math/mix/fun/cosh_test.cpp b/test/unit/math/mix/fun/cosh_test.cpp index d26dc3053db..123fa00db66 100644 --- a/test/unit/math/mix/fun/cosh_test.cpp +++ b/test/unit/math/mix/fun/cosh_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, cosh) { +TEST_F(mathMix, cosh) { auto f = [](const auto& x1) { using stan::math::cosh; return cosh(x1); @@ -12,7 +13,7 @@ TEST(mathMixMatFun, cosh) { stan::test::expect_complex_common(f); } -TEST(mathMixMatFun, cosh_varmat) { +TEST_F(mathMix, cosh_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/cov_exp_quad_test.cpp b/test/unit/math/mix/fun/cov_exp_quad_test.cpp index a694cc726b6..9de174e5268 100644 --- a/test/unit/math/mix/fun/cov_exp_quad_test.cpp +++ b/test/unit/math/mix/fun/cov_exp_quad_test.cpp @@ -1,9 +1,10 @@ #include +#include #include #include #include -TEST(AgradMixMath, fv_cov_exp_quad1) { +TEST_F(mathMix, fv_cov_exp_quad1) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -81,7 +82,7 @@ TEST(AgradMixMath, fv_cov_exp_quad1) { EXPECT_NO_THROW(cov_exp_quad(x_rvec_fv, sigma_d, l_d)); } -TEST(AgradMixMath, ffv_cov_exp_quad1) { +TEST_F(mathMix, ffv_cov_exp_quad1) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -159,7 +160,7 @@ TEST(AgradMixMath, ffv_cov_exp_quad1) { EXPECT_NO_THROW(cov_exp_quad(x_rvec_ffv, sigma_d, l_d)); } -TEST(AgradMixMath, fv_cov_exp_quad2) { +TEST_F(mathMix, fv_cov_exp_quad2) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -267,7 +268,7 @@ TEST(AgradMixMath, fv_cov_exp_quad2) { EXPECT_NO_THROW(cov_exp_quad(x_rvec_fv, x2_rvec_fv, sigma_d, l_d)); } -TEST(AgradMixMath, ffv_cov_exp_quad2) { +TEST_F(mathMix, ffv_cov_exp_quad2) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -375,7 +376,7 @@ TEST(AgradMixMath, ffv_cov_exp_quad2) { EXPECT_NO_THROW(cov_exp_quad(x_rvec_ffv, x2_rvec_ffv, sigma_d, l_d)); } -TEST(AgradMixMath, fv_cov_exp_quad1_vec_invalid_values) { +TEST_F(mathMix, fv_cov_exp_quad1_vec_invalid_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -486,7 +487,7 @@ TEST(AgradMixMath, fv_cov_exp_quad1_vec_invalid_values) { std::domain_error); } -TEST(AgradMixMath, fv_cov_exp_quad1_vec_nan_values) { +TEST_F(mathMix, fv_cov_exp_quad1_vec_nan_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -596,7 +597,7 @@ TEST(AgradMixMath, fv_cov_exp_quad1_vec_nan_values) { std::domain_error); } -TEST(AgradMixMath, fv_cov_exp_quad1_eigen_vec_invalid_values) { +TEST_F(mathMix, fv_cov_exp_quad1_eigen_vec_invalid_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -717,7 +718,7 @@ TEST(AgradMixMath, fv_cov_exp_quad1_eigen_vec_invalid_values) { std::domain_error); } -TEST(AgradMixMath, fv_cov_exp_quad1_eigen_vec_nan_values) { +TEST_F(mathMix, fv_cov_exp_quad1_eigen_vec_nan_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -838,7 +839,7 @@ TEST(AgradMixMath, fv_cov_exp_quad1_eigen_vec_nan_values) { std::domain_error); } -TEST(AgradMixMath, fv_cov_exp_quad1_eigen_rvec_invalid_values) { +TEST_F(mathMix, fv_cov_exp_quad1_eigen_rvec_invalid_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -959,7 +960,7 @@ TEST(AgradMixMath, fv_cov_exp_quad1_eigen_rvec_invalid_values) { std::domain_error); } -TEST(AgradMixMath, fv_cov_exp_quad1_eigen_rvec_nan_values) { +TEST_F(mathMix, fv_cov_exp_quad1_eigen_rvec_nan_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -1080,7 +1081,7 @@ TEST(AgradMixMath, fv_cov_exp_quad1_eigen_rvec_nan_values) { std::domain_error); } -TEST(AgradMixMath, fv_cov_exp_quad2_vec_invalid_values) { +TEST_F(mathMix, fv_cov_exp_quad2_vec_invalid_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -1548,7 +1549,7 @@ TEST(AgradMixMath, fv_cov_exp_quad2_vec_invalid_values) { std::domain_error); } -TEST(AgradMixMath, fv_cov_exp_quad2_vec_nan_values) { +TEST_F(mathMix, fv_cov_exp_quad2_vec_nan_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -2016,7 +2017,7 @@ TEST(AgradMixMath, fv_cov_exp_quad2_vec_nan_values) { std::domain_error); } -TEST(AgradMixMath, fv_cov_exp_quad2_eigen_vec_invalid_values) { +TEST_F(mathMix, fv_cov_exp_quad2_eigen_vec_invalid_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -2468,7 +2469,7 @@ TEST(AgradMixMath, fv_cov_exp_quad2_eigen_vec_invalid_values) { std::domain_error); } -TEST(AgradMixMath, fv_cov_exp_quad2_eigen_vec_nan_values) { +TEST_F(mathMix, fv_cov_exp_quad2_eigen_vec_nan_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -2920,7 +2921,7 @@ TEST(AgradMixMath, fv_cov_exp_quad2_eigen_vec_nan_values) { std::domain_error); } -TEST(AgradMixMath, fv_cov_exp_quad2_eigen_rvec_invalid_values) { +TEST_F(mathMix, fv_cov_exp_quad2_eigen_rvec_invalid_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -3372,7 +3373,7 @@ TEST(AgradMixMath, fv_cov_exp_quad2_eigen_rvec_invalid_values) { std::domain_error); } -TEST(AgradMixMath, fv_cov_exp_quad2_eigen_rvec_nan_values) { +TEST_F(mathMix, fv_cov_exp_quad2_eigen_rvec_nan_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -3824,7 +3825,7 @@ TEST(AgradMixMath, fv_cov_exp_quad2_eigen_rvec_nan_values) { std::domain_error); } -TEST(AgradMixMath, ffv_cov_exp_quad1_vec_invalid_values) { +TEST_F(mathMix, ffv_cov_exp_quad1_vec_invalid_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -3935,7 +3936,7 @@ TEST(AgradMixMath, ffv_cov_exp_quad1_vec_invalid_values) { std::domain_error); } -TEST(AgradMixMath, ffv_cov_exp_quad1_vec_nan_values) { +TEST_F(mathMix, ffv_cov_exp_quad1_vec_nan_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -4045,7 +4046,7 @@ TEST(AgradMixMath, ffv_cov_exp_quad1_vec_nan_values) { std::domain_error); } -TEST(AgradMixMath, ffv_cov_exp_quad1_eigen_vec_invalid_values) { +TEST_F(mathMix, ffv_cov_exp_quad1_eigen_vec_invalid_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -4166,7 +4167,7 @@ TEST(AgradMixMath, ffv_cov_exp_quad1_eigen_vec_invalid_values) { std::domain_error); } -TEST(AgradMixMath, ffv_cov_exp_quad1_eigen_vec_nan_values) { +TEST_F(mathMix, ffv_cov_exp_quad1_eigen_vec_nan_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -4287,7 +4288,7 @@ TEST(AgradMixMath, ffv_cov_exp_quad1_eigen_vec_nan_values) { std::domain_error); } -TEST(AgradMixMath, ffv_cov_exp_quad1_eigen_rvec_invalid_values) { +TEST_F(mathMix, ffv_cov_exp_quad1_eigen_rvec_invalid_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -4408,7 +4409,7 @@ TEST(AgradMixMath, ffv_cov_exp_quad1_eigen_rvec_invalid_values) { std::domain_error); } -TEST(AgradMixMath, ffv_cov_exp_quad1_eigen_rvec_nan_values) { +TEST_F(mathMix, ffv_cov_exp_quad1_eigen_rvec_nan_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -4529,7 +4530,7 @@ TEST(AgradMixMath, ffv_cov_exp_quad1_eigen_rvec_nan_values) { std::domain_error); } -TEST(AgradMixMath, ffv_cov_exp_quad2_vec_invalid_values) { +TEST_F(mathMix, ffv_cov_exp_quad2_vec_invalid_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -4997,7 +4998,7 @@ TEST(AgradMixMath, ffv_cov_exp_quad2_vec_invalid_values) { std::domain_error); } -TEST(AgradMixMath, ffv_cov_exp_quad2_vec_nan_values) { +TEST_F(mathMix, ffv_cov_exp_quad2_vec_nan_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -5465,7 +5466,7 @@ TEST(AgradMixMath, ffv_cov_exp_quad2_vec_nan_values) { std::domain_error); } -TEST(AgradMixMath, ffv_cov_exp_quad2_eigen_vec_invalid_values) { +TEST_F(mathMix, ffv_cov_exp_quad2_eigen_vec_invalid_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -5917,7 +5918,7 @@ TEST(AgradMixMath, ffv_cov_exp_quad2_eigen_vec_invalid_values) { std::domain_error); } -TEST(AgradMixMath, ffv_cov_exp_quad2_eigen_vec_nan_values) { +TEST_F(mathMix, ffv_cov_exp_quad2_eigen_vec_nan_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -6369,7 +6370,7 @@ TEST(AgradMixMath, ffv_cov_exp_quad2_eigen_vec_nan_values) { std::domain_error); } -TEST(AgradMixMath, ffv_cov_exp_quad2_eigen_rvec_invalid_values) { +TEST_F(mathMix, ffv_cov_exp_quad2_eigen_rvec_invalid_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -6821,7 +6822,7 @@ TEST(AgradMixMath, ffv_cov_exp_quad2_eigen_rvec_invalid_values) { std::domain_error); } -TEST(AgradMixMath, ffv_cov_exp_quad2_eigen_rvec_nan_values) { +TEST_F(mathMix, ffv_cov_exp_quad2_eigen_rvec_nan_values) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -7273,7 +7274,7 @@ TEST(AgradMixMath, ffv_cov_exp_quad2_eigen_rvec_nan_values) { std::domain_error); } -TEST(AgradMixMath, fv_cov_exp_quad2_eigen_vec_dim_error) { +TEST_F(mathMix, fv_cov_exp_quad2_eigen_vec_dim_error) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -7330,7 +7331,7 @@ TEST(AgradMixMath, fv_cov_exp_quad2_eigen_vec_dim_error) { std::invalid_argument); } -TEST(AgradMixMath, fv_cov_exp_quad2_eigen_rvec_dim_error) { +TEST_F(mathMix, fv_cov_exp_quad2_eigen_rvec_dim_error) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -7387,7 +7388,7 @@ TEST(AgradMixMath, fv_cov_exp_quad2_eigen_rvec_dim_error) { std::invalid_argument); } -TEST(AgradMixMath, ffv_cov_exp_quad2_eigen_vec_dim_error) { +TEST_F(mathMix, ffv_cov_exp_quad2_eigen_vec_dim_error) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; @@ -7444,7 +7445,7 @@ TEST(AgradMixMath, ffv_cov_exp_quad2_eigen_vec_dim_error) { std::invalid_argument); } -TEST(AgradMixMath, ffv_cov_exp_quad2_eigen_rvec_dim_error) { +TEST_F(mathMix, ffv_cov_exp_quad2_eigen_rvec_dim_error) { using stan::math::cov_exp_quad; using stan::math::fvar; using stan::math::var; diff --git a/test/unit/math/mix/fun/cov_matrix_constrain_lkj_test.cpp b/test/unit/math/mix/fun/cov_matrix_constrain_lkj_test.cpp index 1ae38872908..39e1a8ee40f 100644 --- a/test/unit/math/mix/fun/cov_matrix_constrain_lkj_test.cpp +++ b/test/unit/math/mix/fun/cov_matrix_constrain_lkj_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, cov_matrix_constrain_lkj) { +TEST_F(mathMix, cov_matrix_constrain_lkj) { auto f = [](int K) { return [K](const auto& x1) { stan::scalar_type_t lp = 0.0; @@ -18,7 +19,7 @@ TEST(mathMixMatFun, cov_matrix_constrain_lkj) { stan::test::expect_ad_matvar(f(3), x2); } -TEST(mathMixMatFun, cov_matrix_constrain_lkj_lp) { +TEST_F(mathMix, cov_matrix_constrain_lkj_lp) { auto f1 = [](int K) { return [K](const auto& x1) { stan::scalar_type_t lp = 0.0; diff --git a/test/unit/math/mix/fun/cov_matrix_constrain_test.cpp b/test/unit/math/mix/fun/cov_matrix_constrain_test.cpp index 7352c9f45b2..678394cc853 100644 --- a/test/unit/math/mix/fun/cov_matrix_constrain_test.cpp +++ b/test/unit/math/mix/fun/cov_matrix_constrain_test.cpp @@ -1,4 +1,5 @@ #include +#include namespace cov_matrix_constrain_test { // easier than fiddling the quadratic equation @@ -47,7 +48,7 @@ void expect_cov_matrix_transform(const T& x) { } } // namespace cov_matrix_constrain_test -TEST(MathMixMatFun, cov_matrixTransform) { +TEST_F(mathMix, cov_matrixTransform) { // sizes must be n + (n choose 2) Eigen::VectorXd v0(0); @@ -74,7 +75,7 @@ TEST(MathMixMatFun, cov_matrixTransform) { cov_matrix_constrain_test::expect_cov_matrix_transform(v10); } -TEST(mathMixMatFun, cov_matrix_constrain) { +TEST_F(mathMix, cov_matrix_constrain) { auto f = [](int K) { return [K](const auto& x1) { stan::scalar_type_t lp = 0.0; @@ -92,7 +93,7 @@ TEST(mathMixMatFun, cov_matrix_constrain) { stan::test::expect_ad_matvar(f(3), x2); } -TEST(mathMixMatFun, cov_matrix_constrain_lp) { +TEST_F(mathMix, cov_matrix_constrain_lp) { auto f1 = [](int K) { return [K](const auto& x1) { stan::scalar_type_t lp = 0.0; diff --git a/test/unit/math/mix/fun/crossprod_test.cpp b/test/unit/math/mix/fun/crossprod_test.cpp index 0f42f174b26..5b2175f1aaa 100644 --- a/test/unit/math/mix/fun/crossprod_test.cpp +++ b/test/unit/math/mix/fun/crossprod_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, crossprod) { +TEST_F(mathMix, crossprod) { auto f = [](const auto& y) { return stan::math::crossprod(y); }; Eigen::MatrixXd t(0, 0); diff --git a/test/unit/math/mix/fun/csr_matrix_times_vector_test.cpp b/test/unit/math/mix/fun/csr_matrix_times_vector_test.cpp index 20c73955243..e2ed4787441 100644 --- a/test/unit/math/mix/fun/csr_matrix_times_vector_test.cpp +++ b/test/unit/math/mix/fun/csr_matrix_times_vector_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, csr_matrix_times_vector) { +TEST_F(mathMix, csr_matrix_times_vector) { auto f = [](const auto& w, const auto& b) { using stan::math::csr_matrix_times_vector; std::vector v{1, 2, 3, 1, 2}; diff --git a/test/unit/math/mix/fun/cumulative_sum_test.cpp b/test/unit/math/mix/fun/cumulative_sum_test.cpp index e049cf17cf8..746fbfe383f 100644 --- a/test/unit/math/mix/fun/cumulative_sum_test.cpp +++ b/test/unit/math/mix/fun/cumulative_sum_test.cpp @@ -1,4 +1,5 @@ #include +#include #include void expect_cumulative_sum(std::vector& x) { @@ -12,7 +13,7 @@ void expect_cumulative_sum(std::vector& x) { stan::test::expect_ad_matvar(f, rv); } -TEST(MathMixMatFun, cumulativeSum) { +TEST_F(mathMix, cumulativeSum) { std::vector a; expect_cumulative_sum(a); diff --git a/test/unit/math/mix/fun/determinant_test.cpp b/test/unit/math/mix/fun/determinant_test.cpp index 05c56e98c78..924a68e7a88 100644 --- a/test/unit/math/mix/fun/determinant_test.cpp +++ b/test/unit/math/mix/fun/determinant_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(MathMixMatFun, determinant) { +TEST_F(mathMix, determinant) { using stan::test::relative_tolerance; auto f = [](const auto& y) { return stan::math::determinant(y); }; diff --git a/test/unit/math/mix/fun/diag_matrix_test.cpp b/test/unit/math/mix/fun/diag_matrix_test.cpp index e78bb8ef2b6..deb393d8705 100644 --- a/test/unit/math/mix/fun/diag_matrix_test.cpp +++ b/test/unit/math/mix/fun/diag_matrix_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, diagMatrix) { +TEST_F(mathMix, diagMatrix) { auto f = [](const auto& y) { return stan::math::diag_matrix(y); }; for (int i = 0; i < 5; ++i) { diff --git a/test/unit/math/mix/fun/diag_post_multiply_test.cpp b/test/unit/math/mix/fun/diag_post_multiply_test.cpp index 011ea2fef2e..18b937fbf18 100644 --- a/test/unit/math/mix/fun/diag_post_multiply_test.cpp +++ b/test/unit/math/mix/fun/diag_post_multiply_test.cpp @@ -1,4 +1,5 @@ #include +#include void expect_diag_post_multiply(const Eigen::MatrixXd& a, const Eigen::VectorXd& v) { @@ -11,7 +12,7 @@ void expect_diag_post_multiply(const Eigen::MatrixXd& a, stan::test::expect_ad(f, a, rv); stan::test::expect_ad_matvar(f, a, rv); } -TEST(MathMixMatFun, diagPostMultiply) { +TEST_F(mathMix, diagPostMultiply) { using stan::test::relative_tolerance; // 0 x 0 diff --git a/test/unit/math/mix/fun/diag_pre_multiply_test.cpp b/test/unit/math/mix/fun/diag_pre_multiply_test.cpp index fa9d96f6cdb..76a13528410 100644 --- a/test/unit/math/mix/fun/diag_pre_multiply_test.cpp +++ b/test/unit/math/mix/fun/diag_pre_multiply_test.cpp @@ -1,4 +1,5 @@ #include +#include #include void expect_diag_pre_multiply(const Eigen::VectorXd& v, @@ -12,7 +13,7 @@ void expect_diag_pre_multiply(const Eigen::VectorXd& v, stan::test::expect_ad(f, rv, a); stan::test::expect_ad_matvar(f, rv, a); } -TEST(MathMixMatFun, diagPreMultiply) { +TEST_F(mathMix, diagPreMultiply) { using stan::test::relative_tolerance; // 0 x 0 Eigen::MatrixXd a00(0, 0); diff --git a/test/unit/math/mix/fun/diagonal_test.cpp b/test/unit/math/mix/fun/diagonal_test.cpp index aa9e8d19d24..f1771ced4a7 100644 --- a/test/unit/math/mix/fun/diagonal_test.cpp +++ b/test/unit/math/mix/fun/diagonal_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, diagonal) { +TEST_F(mathMix, diagonal) { auto f = [](const auto& x) { return stan::math::diagonal(x); }; Eigen::MatrixXd a0(0, 0); diff --git a/test/unit/math/mix/fun/digamma_test.cpp b/test/unit/math/mix/fun/digamma_test.cpp index 6be2d7d85ef..699b78e17a4 100644 --- a/test/unit/math/mix/fun/digamma_test.cpp +++ b/test/unit/math/mix/fun/digamma_test.cpp @@ -1,13 +1,14 @@ #include +#include -TEST(mathMixMatFun, digamma) { +TEST_F(mathMix, digamma) { auto f = [](const auto& x1) { return stan::math::digamma(x1); }; stan::test::expect_common_nonzero_unary_vectorized< stan::test::ScalarSupport::Real>(f); stan::test::expect_unary_vectorized(f, -25, -10.2, -1.2, -1, 2.3, 5.7); } -TEST(mathMixMatFun, digamma_varmat) { +TEST_F(mathMix, digamma_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_nonzero_args; diff --git a/test/unit/math/mix/fun/dims_test.cpp b/test/unit/math/mix/fun/dims_test.cpp index cc596e7d0c7..02d4bb37348 100644 --- a/test/unit/math/mix/fun/dims_test.cpp +++ b/test/unit/math/mix/fun/dims_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(AgradMixMatrixDims, matrix_fv) { +TEST_F(mathMix, matrix_fv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::dims; @@ -59,7 +60,7 @@ TEST(AgradMixMatrixDims, matrix_fv) { EXPECT_EQ(8, dims8[2]); } -TEST(AgradMixMatrixDims, matrix_ffv) { +TEST_F(mathMix, matrix_ffv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::dims; diff --git a/test/unit/math/mix/fun/distance_test.cpp b/test/unit/math/mix/fun/distance_test.cpp index 51a7a6268bc..6a56511800c 100644 --- a/test/unit/math/mix/fun/distance_test.cpp +++ b/test/unit/math/mix/fun/distance_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, distance) { +TEST_F(mathMix, distance) { auto f = [](const auto& x, const auto& y) { return stan::math::distance(x, y); }; diff --git a/test/unit/math/mix/fun/divide2_test.cpp b/test/unit/math/mix/fun/divide2_test.cpp index 8afaef56ec4..664f1405e5a 100644 --- a/test/unit/math/mix/fun/divide2_test.cpp +++ b/test/unit/math/mix/fun/divide2_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, divide_vec_scal) { +TEST_F(mathMix, divide_vec_scal) { auto f = [](const auto& x, const auto& y) { return stan::math::divide(x, y); }; diff --git a/test/unit/math/mix/fun/divide_test.cpp b/test/unit/math/mix/fun/divide_test.cpp index 509168ae332..575771f028f 100644 --- a/test/unit/math/mix/fun/divide_test.cpp +++ b/test/unit/math/mix/fun/divide_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, divide) { +TEST_F(mathMix, divide) { auto f = [](const auto& x, const auto& y) { return stan::math::divide(x, y); }; diff --git a/test/unit/math/mix/fun/dot_product_test.cpp b/test/unit/math/mix/fun/dot_product_test.cpp index 87c4a0618c4..e0fa91ee82a 100644 --- a/test/unit/math/mix/fun/dot_product_test.cpp +++ b/test/unit/math/mix/fun/dot_product_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(mathMixMatFun, dotProduct) { +TEST_F(mathMix, dotProduct) { auto f = [](const auto& x, const auto& y) { return stan::math::dot_product(x, y); }; diff --git a/test/unit/math/mix/fun/dot_self_test.cpp b/test/unit/math/mix/fun/dot_self_test.cpp index 90aa48f3e65..af0521a37b6 100644 --- a/test/unit/math/mix/fun/dot_self_test.cpp +++ b/test/unit/math/mix/fun/dot_self_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, dotSelf) { +TEST_F(mathMix, dotSelf) { auto f = [](const auto& y) { return stan::math::dot_self(y); }; Eigen::VectorXd x0(0); diff --git a/test/unit/math/mix/fun/eigen_comparisons_test.cpp b/test/unit/math/mix/fun/eigen_comparisons_test.cpp index b0bfd6e5682..fa723263c1f 100644 --- a/test/unit/math/mix/fun/eigen_comparisons_test.cpp +++ b/test/unit/math/mix/fun/eigen_comparisons_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -69,16 +70,16 @@ void test_all_comparisons() { [](const auto& a, const auto& b) { return a != b; }); } -TEST(mixFun, eigen_comparisons_var) { test_all_comparisons(); } +TEST_F(mathMix, eigen_comparisons_var) { test_all_comparisons(); } -TEST(mixFun, eigen_comparisons_fvar) { +TEST_F(mathMix, eigen_comparisons_fvar) { test_all_comparisons>(); } -TEST(mixFun, eigen_comparisons_fvar_var) { +TEST_F(mathMix, eigen_comparisons_fvar_var) { test_all_comparisons>(); } -TEST(mixFun, eigen_comparisons_fvar_fvar) { +TEST_F(mathMix, eigen_comparisons_fvar_fvar) { test_all_comparisons>>(); } diff --git a/test/unit/math/mix/fun/eigendecompose_identity_complex_test.cpp b/test/unit/math/mix/fun/eigendecompose_identity_complex_test.cpp index 65be4d32153..607f374136f 100644 --- a/test/unit/math/mix/fun/eigendecompose_identity_complex_test.cpp +++ b/test/unit/math/mix/fun/eigendecompose_identity_complex_test.cpp @@ -1,4 +1,5 @@ #include +#include template void expect_identity_matrix_complex(const T& x) { @@ -32,7 +33,7 @@ void expectComplexEigenvectorsId() { expect_identity_matrix_complex(I2); } -TEST(mathMixFun, eigenvectorsIdComplex) { +TEST_F(mathMix, eigenvectorsIdComplex) { using d_t = double; using v_t = stan::math::var; using fd_t = stan::math::fvar; diff --git a/test/unit/math/mix/fun/eigendecompose_identity_test.cpp b/test/unit/math/mix/fun/eigendecompose_identity_test.cpp index 8a2f99ddc3f..1e64e741c5c 100644 --- a/test/unit/math/mix/fun/eigendecompose_identity_test.cpp +++ b/test/unit/math/mix/fun/eigendecompose_identity_test.cpp @@ -1,4 +1,5 @@ #include +#include template void expect_identity_matrix(const T& x) { @@ -25,7 +26,7 @@ void expectEigenvectorsId() { } } -TEST(mathMixFun, eigenvectorsId) { +TEST_F(mathMix, eigenvectorsId) { using d_t = double; using v_t = stan::math::var; using fd_t = stan::math::fvar; diff --git a/test/unit/math/mix/fun/eigendecompose_sym_test.cpp b/test/unit/math/mix/fun/eigendecompose_sym_test.cpp index ae5db44bbb7..135c0a8a42c 100644 --- a/test/unit/math/mix/fun/eigendecompose_sym_test.cpp +++ b/test/unit/math/mix/fun/eigendecompose_sym_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, eigendecomposeSym) { +TEST_F(mathMix, eigendecomposeSym) { auto g = [](const auto& y) { // eigenvectors // maintain symmetry for finite diffs; ignore if not square @@ -48,7 +49,7 @@ TEST(MathMixMatFun, eigendecomposeSym) { stan::test::expect_ad(g, a33); } -TEST(MathMixMatFun, eigendecomposeSym_varmat) { +TEST_F(mathMix, eigendecomposeSym_varmat) { auto g = [](const auto& y) { // eigenvectors // maintain symmetry for finite diffs; ignore if not square diff --git a/test/unit/math/mix/fun/eigendecompose_test.cpp b/test/unit/math/mix/fun/eigendecompose_test.cpp index 18db5a592c0..3ee1d7d71b5 100644 --- a/test/unit/math/mix/fun/eigendecompose_test.cpp +++ b/test/unit/math/mix/fun/eigendecompose_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixFun, eigendecompose) { +TEST_F(mathMix, eigendecompose) { auto f = [](const auto& x) { using stan::math::eigendecompose; return std::get<0>(eigendecompose(x)); @@ -21,7 +22,7 @@ TEST(mathMixFun, eigendecompose) { EXPECT_THROW(g(a32), std::invalid_argument); } -TEST(mathMixFun, eigendecomposeComplex) { +TEST_F(mathMix, eigendecomposeComplex) { auto f = [](const auto& x) { using stan::math::eigendecompose; return std::get<0>(eigendecompose(stan::math::to_complex(x, 0))); diff --git a/test/unit/math/mix/fun/eigenvalues_complex_test.cpp b/test/unit/math/mix/fun/eigenvalues_complex_test.cpp index 2b7b2fe39ec..2bd92805488 100644 --- a/test/unit/math/mix/fun/eigenvalues_complex_test.cpp +++ b/test/unit/math/mix/fun/eigenvalues_complex_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixFun, eigenvaluesComplex) { +TEST_F(mathMix, eigenvaluesComplex) { auto f = [](const auto& x) { using stan::math::eigenvalues; return eigenvalues(stan::math::to_complex(x, 0)); diff --git a/test/unit/math/mix/fun/eigenvalues_sym_test.cpp b/test/unit/math/mix/fun/eigenvalues_sym_test.cpp index d2940ea59c5..191b698ce5a 100644 --- a/test/unit/math/mix/fun/eigenvalues_sym_test.cpp +++ b/test/unit/math/mix/fun/eigenvalues_sym_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, eigenvaluesSym) { +TEST_F(mathMix, eigenvaluesSym) { auto f = [](const auto& y) { // need to maintain symmetry for finite diffs auto&& y_ref = stan::math::to_ref(y); @@ -36,7 +37,7 @@ TEST(MathMixMatFun, eigenvaluesSym) { stan::test::expect_ad(tols, f, a22); } -TEST(MathMixMatFun, eigenvaluesSym_varmat) { +TEST_F(mathMix, eigenvaluesSym_varmat) { auto f = [](const auto& y) { // need to maintain symmetry for finite diffs auto&& y_ref = stan::math::to_ref(y); diff --git a/test/unit/math/mix/fun/eigenvalues_test.cpp b/test/unit/math/mix/fun/eigenvalues_test.cpp index 0d5c0155064..eee0758e31d 100644 --- a/test/unit/math/mix/fun/eigenvalues_test.cpp +++ b/test/unit/math/mix/fun/eigenvalues_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixFun, eigenvalues) { +TEST_F(mathMix, eigenvalues) { auto f = [](const auto& x) { using stan::math::eigenvalues; return eigenvalues(x); diff --git a/test/unit/math/mix/fun/eigenvectors_sym_test.cpp b/test/unit/math/mix/fun/eigenvectors_sym_test.cpp index b5f3396612f..019df734be3 100644 --- a/test/unit/math/mix/fun/eigenvectors_sym_test.cpp +++ b/test/unit/math/mix/fun/eigenvectors_sym_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, eigenvectorsSym) { +TEST_F(mathMix, eigenvectorsSym) { auto f = [](const auto& y) { // maintain symmetry for finite diffs; ignore if not square if (y.rows() != y.cols()) { @@ -32,7 +33,7 @@ TEST(MathMixMatFun, eigenvectorsSym) { stan::test::expect_ad(tols, f, a33); } -TEST(MathMixMatFun, eigenvectorsSym_varmat) { +TEST_F(mathMix, eigenvectorsSym_varmat) { auto f = [](const auto& y) { // maintain symmetry for finite diffs; ignore if not square if (y.rows() != y.cols()) { diff --git a/test/unit/math/mix/fun/eigenvectors_test.cpp b/test/unit/math/mix/fun/eigenvectors_test.cpp index d0b20a3d523..001c55183e6 100644 --- a/test/unit/math/mix/fun/eigenvectors_test.cpp +++ b/test/unit/math/mix/fun/eigenvectors_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixFun, eigenvectors) { +TEST_F(mathMix, eigenvectors) { auto f = [](const auto& x) { using stan::math::eigenvectors; return eigenvectors(x); @@ -15,7 +16,7 @@ TEST(mathMixFun, eigenvectors) { EXPECT_THROW(f(a32), std::invalid_argument); } -TEST(mathMixFun, eigenvectorsComplex) { +TEST_F(mathMix, eigenvectorsComplex) { auto f = [](const auto& x) { using stan::math::eigenvectors; return eigenvectors(stan::math::to_complex(x, 0)); diff --git a/test/unit/math/mix/fun/elt_divide_test.cpp b/test/unit/math/mix/fun/elt_divide_test.cpp index efca93cdb58..ef81d4bb2a0 100644 --- a/test/unit/math/mix/fun/elt_divide_test.cpp +++ b/test/unit/math/mix/fun/elt_divide_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, elt_divide_transpose_test) { +TEST_F(mathMix, elt_divide_transpose_test) { auto f = [](const auto& x) { auto&& x_ref = stan::math::to_ref(x); return stan::math::elt_divide(x_ref, x_ref.transpose()); @@ -11,7 +12,7 @@ TEST(MathMixMatFun, elt_divide_transpose_test) { stan::test::expect_ad_matvar(f, x); } -TEST(MathMixMatFun, elt_divide_block_test) { +TEST_F(mathMix, elt_divide_block_test) { auto f = [](const auto& y, const auto& x) { return stan::math::elt_divide(y.block(1, 1, 2, 2), x.block(0, 0, 2, 2)); }; @@ -21,7 +22,7 @@ TEST(MathMixMatFun, elt_divide_block_test) { stan::test::expect_ad_matvar(f, x, x); } -TEST(MathMixMatFun, eltDivide) { +TEST_F(mathMix, eltDivide) { auto f = [](const auto& x, const auto& y) { return stan::math::elt_divide(x, y); }; diff --git a/test/unit/math/mix/fun/elt_multiply_test.cpp b/test/unit/math/mix/fun/elt_multiply_test.cpp index effb2a61c42..76dcc42851e 100644 --- a/test/unit/math/mix/fun/elt_multiply_test.cpp +++ b/test/unit/math/mix/fun/elt_multiply_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, elt_multiply_transpose_test) { +TEST_F(mathMix, elt_multiply_transpose_test) { auto f = [](const auto& x) { auto x_ref = stan::math::to_ref(x); return stan::math::elt_multiply(x_ref, x_ref.transpose()); @@ -11,7 +12,7 @@ TEST(MathMixMatFun, elt_multiply_transpose_test) { stan::test::expect_ad_matvar(f, x); } -TEST(MathMixMatFun, elt_multiply_block_test) { +TEST_F(mathMix, elt_multiply_block_test) { auto f = [](const auto& y, const auto& x) { return stan::math::elt_multiply(y.block(1, 1, 2, 2), x.block(0, 0, 2, 2)); }; @@ -21,7 +22,7 @@ TEST(MathMixMatFun, elt_multiply_block_test) { stan::test::expect_ad_matvar(f, x, x); } -TEST(MathMixMatFun, eltMultiply) { +TEST_F(mathMix, eltMultiply) { auto f = [](const auto& x, const auto& y) { return stan::math::elt_multiply(x, y); }; diff --git a/test/unit/math/mix/fun/erf_test.cpp b/test/unit/math/mix/fun/erf_test.cpp index 6a3757be415..8161905e768 100644 --- a/test/unit/math/mix/fun/erf_test.cpp +++ b/test/unit/math/mix/fun/erf_test.cpp @@ -1,12 +1,13 @@ #include +#include -TEST(mathMixMatFun, erf) { +TEST_F(mathMix, erf) { auto f = [](const auto& x1) { return stan::math::erf(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -2, -1, -0.2, 2.6); } -TEST(mathMixMatFun, erfmatvar) { +TEST_F(mathMix, erfmatvar) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/erfc_test.cpp b/test/unit/math/mix/fun/erfc_test.cpp index 8a3d2213ea1..bb4465ce9df 100644 --- a/test/unit/math/mix/fun/erfc_test.cpp +++ b/test/unit/math/mix/fun/erfc_test.cpp @@ -1,12 +1,13 @@ #include +#include -TEST(mathMixMatFun, erfc) { +TEST_F(mathMix, erfc) { auto f = [](const auto& x1) { return stan::math::erfc(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -2.6, -2, -1, -0.2, 1, 1.3, 2.6); } -TEST(mathMixMatFun, erfcmatvar) { +TEST_F(mathMix, erfcmatvar) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/exp2_test.cpp b/test/unit/math/mix/fun/exp2_test.cpp index a711218eb01..a70e8e2b7fb 100644 --- a/test/unit/math/mix/fun/exp2_test.cpp +++ b/test/unit/math/mix/fun/exp2_test.cpp @@ -1,12 +1,13 @@ #include +#include -TEST(mathMixMatFun, exp2) { +TEST_F(mathMix, exp2) { auto f = [](const auto& x1) { return stan::math::exp2(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -15.2, -10, 1, 1.3, 5, 10); } -TEST(mathMixMatFun, exp2matvar) { +TEST_F(mathMix, exp2matvar) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/exp_test.cpp b/test/unit/math/mix/fun/exp_test.cpp index c6b4cb3bea7..ccc2cce3468 100644 --- a/test/unit/math/mix/fun/exp_test.cpp +++ b/test/unit/math/mix/fun/exp_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, exp) { +TEST_F(mathMix, exp) { auto f = [](const auto& x) { using stan::math::exp; return exp(x); diff --git a/test/unit/math/mix/fun/expm1_test.cpp b/test/unit/math/mix/fun/expm1_test.cpp index e09af4827cd..77c682be1e5 100644 --- a/test/unit/math/mix/fun/expm1_test.cpp +++ b/test/unit/math/mix/fun/expm1_test.cpp @@ -1,13 +1,14 @@ #include +#include -TEST(mathMixMatFun, expm1) { +TEST_F(mathMix, expm1) { auto f = [](const auto& x1) { return stan::math::expm1(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -2.6, -2, -0.5, -0.2, 0, 1.0, 1, 1.3, 3); } -TEST(mathMixMatFun, expm1matvar) { +TEST_F(mathMix, expm1matvar) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/fabs_test.cpp b/test/unit/math/mix/fun/fabs_test.cpp index 7f3689ae10f..c8267b7924a 100644 --- a/test/unit/math/mix/fun/fabs_test.cpp +++ b/test/unit/math/mix/fun/fabs_test.cpp @@ -1,12 +1,13 @@ #include +#include -TEST(mathMixMatFun, fabs) { +TEST_F(mathMix, fabs) { auto f = [](const auto& x1) { return stan::math::fabs(x1); }; stan::test::expect_common_nonzero_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -2.6, -2, -0.5, 1.5, 2.0, 3); } -TEST(mathMixMatFun, fabs_varmat) { +TEST_F(mathMix, fabs_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_nonzero_args; diff --git a/test/unit/math/mix/fun/falling_factorial_test.cpp b/test/unit/math/mix/fun/falling_factorial_test.cpp index 026176d0364..2feef47ca65 100644 --- a/test/unit/math/mix/fun/falling_factorial_test.cpp +++ b/test/unit/math/mix/fun/falling_factorial_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, fallingFactorial) { +TEST_F(mathMix, fallingFactorial) { auto f = [](const int x2) { return [=](const auto& x1) { return stan::math::falling_factorial(x1, x2); }; @@ -21,7 +22,7 @@ TEST(mathMixScalFun, fallingFactorial) { stan::test::expect_ad(f(2), std::numeric_limits::quiet_NaN()); } -TEST(mathMixScalFun, fallingFactorial_vec) { +TEST_F(mathMix, fallingFactorial_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::falling_factorial; return falling_factorial(x1, x2); @@ -37,7 +38,7 @@ TEST(mathMixScalFun, fallingFactorial_vec) { stan::test::expect_ad_vectorized_binary(f, mat_in1, std_std_in2); } -TEST(mathMixScalFun, fallingFactorial_matvar) { +TEST_F(mathMix, fallingFactorial_matvar) { auto f = [](const auto& x1, const auto& x2) { using stan::math::falling_factorial; return falling_factorial(x1, x2); diff --git a/test/unit/math/mix/fun/fdim_test.cpp b/test/unit/math/mix/fun/fdim_test.cpp index 667406ab23b..68df5848ee8 100644 --- a/test/unit/math/mix/fun/fdim_test.cpp +++ b/test/unit/math/mix/fun/fdim_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, fdim) { +TEST_F(mathMix, fdim) { auto f = [](const auto& x1, const auto& x2) { return stan::math::fdim(x1, x2); }; stan::test::expect_ad(f, -3.0, 4.0); @@ -22,7 +23,7 @@ TEST(mathMixScalFun, fdim) { stan::test::expect_ad(f, nan, nan); } -TEST(mathMixScalFun, fdim_vec) { +TEST_F(mathMix, fdim_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::fdim; return fdim(x1, x2); diff --git a/test/unit/math/mix/fun/fft_test.cpp b/test/unit/math/mix/fun/fft_test.cpp index 62edc1684df..52d743bad82 100644 --- a/test/unit/math/mix/fun/fft_test.cpp +++ b/test/unit/math/mix/fun/fft_test.cpp @@ -1,4 +1,5 @@ #include +#include void expect_fft(const Eigen::VectorXcd& x) { for (int m = 0; m < x.rows(); ++m) { @@ -10,7 +11,7 @@ void expect_fft(const Eigen::VectorXcd& x) { } } -TEST(mathMixFun, fft) { +TEST_F(mathMix, fft) { using cvec_t = Eigen::VectorXcd; cvec_t x0(0); @@ -49,7 +50,7 @@ void expect_inv_fft(const Eigen::VectorXcd& x) { } } -TEST(mathMixFun, invFft) { +TEST_F(mathMix, invFft) { using cvec_t = Eigen::VectorXcd; cvec_t x0(0); @@ -90,7 +91,7 @@ void expect_fft2(const Eigen::MatrixXcd& x) { } } -TEST(mathMixFun, fft2) { +TEST_F(mathMix, fft2) { using cmat_t = Eigen::MatrixXcd; cmat_t x00(0, 0); @@ -137,7 +138,7 @@ void expect_inv_fft2(const Eigen::MatrixXcd& x) { } } -TEST(mathMixFun, inv_fft2) { +TEST_F(mathMix, inv_fft2) { using cmat_t = Eigen::MatrixXcd; cmat_t x00(0, 0); diff --git a/test/unit/math/mix/fun/fill_test.cpp b/test/unit/math/mix/fun/fill_test.cpp index 1661a461d8e..2969838c9d4 100644 --- a/test/unit/math/mix/fun/fill_test.cpp +++ b/test/unit/math/mix/fun/fill_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(AgradMixMatrixFill, fv) { +TEST_F(mathMix, fv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fill; @@ -44,7 +45,7 @@ TEST(AgradMixMatrixFill, fv) { for (size_t j = 0; j < 2; ++j) EXPECT_FLOAT_EQ(54, d[i][j].val_.val()); } -TEST(AgradMixMatrixFill, fv2) { +TEST_F(mathMix, fv2) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fill; @@ -56,7 +57,7 @@ TEST(AgradMixMatrixFill, fv2) { EXPECT_FLOAT_EQ(3.0, y[0].val_.val()); } -TEST(AgradMixMatrixFill, ffv) { +TEST_F(mathMix, ffv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fill; @@ -98,7 +99,7 @@ TEST(AgradMixMatrixFill, ffv) { for (size_t j = 0; j < 2; ++j) EXPECT_FLOAT_EQ(54, d[i][j].val_.val_.val()); } -TEST(AgradMixMatrixFill, ffv2) { +TEST_F(mathMix, ffv2) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fill; diff --git a/test/unit/math/mix/fun/floor_test.cpp b/test/unit/math/mix/fun/floor_test.cpp index c5ce92c9710..f1d42265167 100644 --- a/test/unit/math/mix/fun/floor_test.cpp +++ b/test/unit/math/mix/fun/floor_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, floor) { +TEST_F(mathMix, floor) { auto f = [](const auto& x1) { return stan::math::floor(x1); }; // can't autodiff floor through integers for (auto x : stan::test::internal::common_nonzero_args()) @@ -9,7 +10,7 @@ TEST(mathMixMatFun, floor) { 179.2); } -TEST(mathMixMatFun, floormatvar) { +TEST_F(mathMix, floormatvar) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/fma_1_test.cpp b/test/unit/math/mix/fun/fma_1_test.cpp index dd2ee71c539..95a938a8d9f 100644 --- a/test/unit/math/mix/fun/fma_1_test.cpp +++ b/test/unit/math/mix/fun/fma_1_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, fma) { +TEST_F(mathMix, fma) { auto f = [](const auto& x1, const auto& x2, const auto& x3) { return stan::math::fma(x1, x2, x3); }; diff --git a/test/unit/math/mix/fun/fma_2_test.cpp b/test/unit/math/mix/fun/fma_2_test.cpp index dfbdaac0e1e..305cc7d2d5d 100644 --- a/test/unit/math/mix/fun/fma_2_test.cpp +++ b/test/unit/math/mix/fun/fma_2_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, fma_vector) { +TEST_F(mathMix, fma_vector) { auto f = [](const auto& x1, const auto& x2, const auto& x3) { auto ret = stan::math::fma(x1, x2, x3).eval(); using ret_t = stan::plain_type_t>; diff --git a/test/unit/math/mix/fun/fma_3_test.cpp b/test/unit/math/mix/fun/fma_3_test.cpp index 87e444f8114..b4d56785c92 100644 --- a/test/unit/math/mix/fun/fma_3_test.cpp +++ b/test/unit/math/mix/fun/fma_3_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, fma_row_vector) { +TEST_F(mathMix, fma_row_vector) { auto f = [](const auto& x1, const auto& x2, const auto& x3) { auto ret = stan::math::fma(x1, x2, x3).eval(); using ret_t = stan::plain_type_t>; diff --git a/test/unit/math/mix/fun/fma_4_test.cpp b/test/unit/math/mix/fun/fma_4_test.cpp index 03b7f4b7912..f302d761bc9 100644 --- a/test/unit/math/mix/fun/fma_4_test.cpp +++ b/test/unit/math/mix/fun/fma_4_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, fma_matrix) { +TEST_F(mathMix, fma_matrix) { auto f = [](const auto& x1, const auto& x2, const auto& x3) { auto ret = stan::math::fma(x1, x2, x3).eval(); using ret_t = stan::plain_type_t>; diff --git a/test/unit/math/mix/fun/fma_5_test.cpp b/test/unit/math/mix/fun/fma_5_test.cpp index 20f1aa13bc8..bb7e47c5202 100644 --- a/test/unit/math/mix/fun/fma_5_test.cpp +++ b/test/unit/math/mix/fun/fma_5_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, fma_matrix_error) { +TEST_F(mathMix, fma_matrix_error) { auto f = [](const auto& x1, const auto& x2, const auto& x3) { return stan::math::fma(x1, x2, x3); }; diff --git a/test/unit/math/mix/fun/fmax_test.cpp b/test/unit/math/mix/fun/fmax_test.cpp index ed0f8fd0b51..55e15349201 100644 --- a/test/unit/math/mix/fun/fmax_test.cpp +++ b/test/unit/math/mix/fun/fmax_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, fmax) { +TEST_F(mathMix, fmax) { auto f = [](const auto& x1, const auto& x2) { return stan::math::fmax(x1, x2); }; stan::test::expect_ad(f, -3.0, 4.0); @@ -18,7 +19,7 @@ TEST(mathMixScalFun, fmax) { stan::test::expect_value(f, 2.0, 2.0); } -TEST(mathMixScalFun, fmax_vec) { +TEST_F(mathMix, fmax_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::fmax; return fmax(x1, x2); @@ -31,7 +32,7 @@ TEST(mathMixScalFun, fmax_vec) { stan::test::expect_ad_vectorized_binary(f, in1, in2); } -TEST(mathMixScalFun, fmax_equal) { +TEST_F(mathMix, fmax_equal) { using stan::math::fmax; using stan::math::fvar; using stan::math::var; diff --git a/test/unit/math/mix/fun/fmin_test.cpp b/test/unit/math/mix/fun/fmin_test.cpp index 52d6b617f6a..18669636f85 100644 --- a/test/unit/math/mix/fun/fmin_test.cpp +++ b/test/unit/math/mix/fun/fmin_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, fmin) { +TEST_F(mathMix, fmin) { auto f = [](const auto& x1, const auto& x2) { return stan::math::fmin(x1, x2); }; stan::test::expect_ad(f, -3.0, 4.0); @@ -19,7 +20,7 @@ TEST(mathMixScalFun, fmin) { stan::test::expect_value(f, 2.0, 2.0); } -TEST(mathMixScalFun, fmin_vec) { +TEST_F(mathMix, fmin_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::fmin; return fmin(x1, x2); @@ -32,7 +33,7 @@ TEST(mathMixScalFun, fmin_vec) { stan::test::expect_ad_vectorized_binary(f, in1, in2); } -TEST(mathMixScalFun, fmin_equal) { +TEST_F(mathMix, fmin_equal) { using stan::math::fmin; using stan::math::fvar; using stan::math::var; diff --git a/test/unit/math/mix/fun/fmod_test.cpp b/test/unit/math/mix/fun/fmod_test.cpp index 91bc8d6cf9c..3acaed529b6 100644 --- a/test/unit/math/mix/fun/fmod_test.cpp +++ b/test/unit/math/mix/fun/fmod_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, fmod) { +TEST_F(mathMix, fmod) { auto f = [](const auto& x1, const auto& x2) { using stan::math::fmod; return fmod(x1, x2); @@ -21,7 +22,7 @@ TEST(mathMixScalFun, fmod) { stan::test::expect_value(f, 2.0, 2.0); } -TEST(mathMixScalFun, fmod_vec) { +TEST_F(mathMix, fmod_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::fmod; return fmod(x1, x2); diff --git a/test/unit/math/mix/fun/gamma_p_test.cpp b/test/unit/math/mix/fun/gamma_p_test.cpp index dedf35b5f5f..cae08239c5a 100644 --- a/test/unit/math/mix/fun/gamma_p_test.cpp +++ b/test/unit/math/mix/fun/gamma_p_test.cpp @@ -1,9 +1,10 @@ #include +#include #include #include #include -TEST(mathMixScalFun, gammaP) { +TEST_F(mathMix, gammaP) { auto f = [](const auto& x1, const auto& x2) { return stan::math::gamma_p(x1, x2); }; @@ -41,7 +42,7 @@ TEST(mathMixScalFun, gammaP) { } // separate tests when a is positive_infinity -TEST(mathMixScalFun, gammaP_pos_inf) { +TEST_F(mathMix, gammaP_pos_inf) { auto g = [](const auto& x) { return stan::math::gamma_p(x(0), x(1)); }; stan::math::vector_d x(2); x << 0.5001, stan::math::positive_infinity(); @@ -93,7 +94,7 @@ TEST(mathMixScalFun, gammaP_pos_inf) { } } -TEST(mathMixScalFun, gammaP_vec) { +TEST_F(mathMix, gammaP_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::gamma_p; return gamma_p(x1, x2); diff --git a/test/unit/math/mix/fun/gamma_q_test.cpp b/test/unit/math/mix/fun/gamma_q_test.cpp index a14705608ad..c3a42ab2c46 100644 --- a/test/unit/math/mix/fun/gamma_q_test.cpp +++ b/test/unit/math/mix/fun/gamma_q_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, gammaQ) { +TEST_F(mathMix, gammaQ) { auto f = [](const auto& x1, const auto& x2) { return stan::math::gamma_q(x1, x2); }; @@ -18,7 +19,7 @@ TEST(mathMixScalFun, gammaQ) { // stan::test::expect_value(f, 8.01006, 2.47579e+215); } -TEST(MathFunctions, gammaQ_vec) { +TEST_F(mathMix, gammaQ_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::gamma_q; return gamma_q(x1, x2); diff --git a/test/unit/math/mix/fun/generalized_inverse_test.cpp b/test/unit/math/mix/fun/generalized_inverse_test.cpp index 98610f02010..0940e270491 100644 --- a/test/unit/math/mix/fun/generalized_inverse_test.cpp +++ b/test/unit/math/mix/fun/generalized_inverse_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(mathMixMatFun, gen_inv_test_1) { +TEST_F(mathMix, gen_inv_test_1) { using stan::test::expect_ad; using stan::test::expect_ad_matvar; @@ -13,7 +14,7 @@ TEST(mathMixMatFun, gen_inv_test_1) { expect_ad_matvar(f, t); } -TEST(mathMixMatFun, gen_inv_test_2) { +TEST_F(mathMix, gen_inv_test_2) { using stan::test::expect_ad; using stan::test::expect_ad_matvar; @@ -25,7 +26,7 @@ TEST(mathMixMatFun, gen_inv_test_2) { expect_ad_matvar(f, u); } -TEST(mathMixMatFun, gen_inv_test_3) { +TEST_F(mathMix, gen_inv_test_3) { using stan::test::expect_ad; using stan::test::expect_ad_matvar; @@ -37,7 +38,7 @@ TEST(mathMixMatFun, gen_inv_test_3) { expect_ad_matvar(f, v); } -TEST(mathMixMatFun, gen_inv_test_4) { +TEST_F(mathMix, gen_inv_test_4) { using stan::test::expect_ad; using stan::test::expect_ad_matvar; @@ -49,7 +50,7 @@ TEST(mathMixMatFun, gen_inv_test_4) { expect_ad_matvar(f, v); } -TEST(mathMixMatFun, gen_inv_test_5) { +TEST_F(mathMix, gen_inv_test_5) { using stan::test::expect_ad; using stan::test::expect_ad_matvar; @@ -61,7 +62,7 @@ TEST(mathMixMatFun, gen_inv_test_5) { expect_ad_matvar(f, s); } -TEST(mathMixMatFun, gen_inv_test_6) { +TEST_F(mathMix, gen_inv_test_6) { using stan::test::expect_ad; using stan::test::expect_ad_matvar; @@ -78,13 +79,13 @@ TEST(mathMixMatFun, gen_inv_test_6) { expect_ad_matvar(f, w); } -TEST(mathMixMatFun, gen_inv_test_8) { +TEST_F(mathMix, gen_inv_test_8) { Eigen::MatrixXd z(2, 2); z << 1, 2, 5, std::numeric_limits::quiet_NaN(); EXPECT_NO_THROW(stan::math::generalized_inverse(z)); } -TEST(mathMixMatFun, gen_inv_test_9) { +TEST_F(mathMix, gen_inv_test_9) { using stan::test::expect_ad; using stan::test::expect_ad_matvar; diff --git a/test/unit/math/mix/fun/get_base1_lhs_test.cpp b/test/unit/math/mix/fun/get_base1_lhs_test.cpp index b5f3639fa22..2e1622d8c94 100644 --- a/test/unit/math/mix/fun/get_base1_lhs_test.cpp +++ b/test/unit/math/mix/fun/get_base1_lhs_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(AgradMixMatrixGetBase1LHS, failing_pre_20_fv) { +TEST_F(mathMix, get_base1_lhs_failing_pre_20_fv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -13,7 +14,7 @@ TEST(AgradMixMatrixGetBase1LHS, failing_pre_20_fv) { fvar z = get_base1_lhs(y, 1, "y", 1); EXPECT_FLOAT_EQ(1, z.val_.val()); } -TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_vec1_fv) { +TEST_F(mathMix, get_base1_lhs_vec1_fv) { using stan::math::fvar; using stan::math::get_base1_lhs; using stan::math::var; @@ -29,7 +30,7 @@ TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_vec1_fv) { EXPECT_THROW(get_base1_lhs(x, 0, "x[0]", 0), std::out_of_range); EXPECT_THROW(get_base1_lhs(x, 3, "x[3]", 0), std::out_of_range); } -TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_vec2_fv) { +TEST_F(mathMix, get_base1_lhs_vec2_fv) { using stan::math::fvar; using stan::math::get_base1_lhs; using stan::math::var; @@ -61,7 +62,7 @@ TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_vec2_fv) { EXPECT_THROW(get_base1_lhs(get_base1_lhs(x, 1, "", -1), 12, "", -1), std::out_of_range); } -TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_matrix_fv) { +TEST_F(mathMix, get_base1_lhs_matrix_fv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -96,7 +97,7 @@ TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_matrix_fv) { EXPECT_THROW(get_base1_lhs(x, 0, 1, "x", 1), std::out_of_range); EXPECT_THROW(get_base1_lhs(x, 1, 0, "x", 1), std::out_of_range); } -TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_vector_fv) { +TEST_F(mathMix, get_base1_lhs_vector_fv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -111,7 +112,7 @@ TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_vector_fv) { EXPECT_THROW(get_base1_lhs(x, 0, "x", 1), std::out_of_range); EXPECT_THROW(get_base1_lhs(x, 100, "x", 1), std::out_of_range); } -TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_row_vector_fv) { +TEST_F(mathMix, get_base1_lhs_row_vector_fv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -126,7 +127,7 @@ TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_row_vector_fv) { EXPECT_THROW(get_base1_lhs(x, 0, "x", 1), std::out_of_range); EXPECT_THROW(get_base1_lhs(x, 100, "x", 1), std::out_of_range); } -TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_8_fv) { +TEST_F(mathMix, get_base1_lhs_8_fv) { using stan::math::fvar; using stan::math::get_base1_lhs; using stan::math::var; @@ -172,7 +173,7 @@ TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_8_fv) { i6 + 1, i7 + 1, i8 + 1, "x8", 1) .val_.val()); } -TEST(AgradMixMatrixGetBase1LHS, failing_pre_20_ffv) { +TEST_F(mathMix, get_base1_lhs_failing_pre_20_ffv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -183,7 +184,7 @@ TEST(AgradMixMatrixGetBase1LHS, failing_pre_20_ffv) { fvar > z = get_base1_lhs(y, 1, "y", 1); EXPECT_FLOAT_EQ(1, z.val_.val_.val()); } -TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_vec1_ffv) { +TEST_F(mathMix, get_base1_lhs_vec1_ffv) { using stan::math::fvar; using stan::math::get_base1_lhs; using stan::math::var; @@ -199,7 +200,7 @@ TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_vec1_ffv) { EXPECT_THROW(get_base1_lhs(x, 0, "x[0]", 0), std::out_of_range); EXPECT_THROW(get_base1_lhs(x, 3, "x[3]", 0), std::out_of_range); } -TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_vec2_ffv) { +TEST_F(mathMix, get_base1_lhs_vec2_ffv) { using stan::math::fvar; using stan::math::get_base1_lhs; using stan::math::var; @@ -231,7 +232,7 @@ TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_vec2_ffv) { EXPECT_THROW(get_base1_lhs(get_base1_lhs(x, 1, "", -1), 12, "", -1), std::out_of_range); } -TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_matrix_ffv) { +TEST_F(mathMix, get_base1_lhs_matrix_ffv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -267,7 +268,7 @@ TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_matrix_ffv) { EXPECT_THROW(get_base1_lhs(x, 0, 1, "x", 1), std::out_of_range); EXPECT_THROW(get_base1_lhs(x, 1, 0, "x", 1), std::out_of_range); } -TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_vector_ffv) { +TEST_F(mathMix, get_base1_lhs_vector_ffv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -282,7 +283,7 @@ TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_vector_ffv) { EXPECT_THROW(get_base1_lhs(x, 0, "x", 1), std::out_of_range); EXPECT_THROW(get_base1_lhs(x, 100, "x", 1), std::out_of_range); } -TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_row_vector_ffv) { +TEST_F(mathMix, get_base1_lhs_row_vector_ffv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -297,7 +298,7 @@ TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_row_vector_ffv) { EXPECT_THROW(get_base1_lhs(x, 0, "x", 1), std::out_of_range); EXPECT_THROW(get_base1_lhs(x, 100, "x", 1), std::out_of_range); } -TEST(AgradMixMatrixGetBase1LHS, get_base1_lhs_8_ffv) { +TEST_F(mathMix, get_base1_lhs_8_ffv) { using stan::math::fvar; using stan::math::get_base1_lhs; using stan::math::var; diff --git a/test/unit/math/mix/fun/get_base1_test.cpp b/test/unit/math/mix/fun/get_base1_test.cpp index d460dd70ad5..44dd5c737b2 100644 --- a/test/unit/math/mix/fun/get_base1_test.cpp +++ b/test/unit/math/mix/fun/get_base1_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(AgradMixMatrixGetBase1, failing_pre_20_fv) { +TEST_F(mathMix, get_base1_failing_pre_20_fv ) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -12,7 +13,7 @@ TEST(AgradMixMatrixGetBase1, failing_pre_20_fv) { y << 1, 2, 3; EXPECT_FLOAT_EQ(1, get_base1(y, 1, "y", 1).val_.val()); } -TEST(AgradMixMatrixGetBase1, get_base1_vec1_fv) { +TEST_F(mathMix, get_base1_vec1_fv) { using stan::math::fvar; using stan::math::get_base1; using stan::math::var; @@ -29,7 +30,7 @@ TEST(AgradMixMatrixGetBase1, get_base1_vec1_fv) { EXPECT_THROW(get_base1(x, 0, "x[0]", 0), std::out_of_range); EXPECT_THROW(get_base1(x, 3, "x[3]", 0), std::out_of_range); } -TEST(AgradMixMatrixGetBase1, get_base1_vec2_fv) { +TEST_F(mathMix, get_base1_vec2_fv) { using stan::math::fvar; using stan::math::get_base1; using stan::math::var; @@ -61,7 +62,7 @@ TEST(AgradMixMatrixGetBase1, get_base1_vec2_fv) { EXPECT_THROW(get_base1(get_base1(x, 1, "", -1), 12, "", -1), std::out_of_range); } -TEST(AgradMixMatrixGetBase1, get_base1_matrix_fv) { +TEST_F(mathMix, get_base1_matrix_fv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -90,7 +91,7 @@ TEST(AgradMixMatrixGetBase1, get_base1_matrix_fv) { EXPECT_THROW(get_base1(x, 0, 1, "x", 1), std::out_of_range); EXPECT_THROW(get_base1(x, 1, 0, "x", 1), std::out_of_range); } -TEST(AgradMixMatrixGetBase1, get_base1_vector_fv) { +TEST_F(mathMix, get_base1_vector_fv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -104,7 +105,7 @@ TEST(AgradMixMatrixGetBase1, get_base1_vector_fv) { EXPECT_THROW(get_base1(x, 0, "x", 1), std::out_of_range); EXPECT_THROW(get_base1(x, 100, "x", 1), std::out_of_range); } -TEST(AgradMixMatrixGetBase1, get_base1_row_vector_fv) { +TEST_F(mathMix, get_base1_row_vector_fv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -118,7 +119,7 @@ TEST(AgradMixMatrixGetBase1, get_base1_row_vector_fv) { EXPECT_THROW(get_base1(x, 0, "x", 1), std::out_of_range); EXPECT_THROW(get_base1(x, 100, "x", 1), std::out_of_range); } -TEST(AgradMixMatrixGetBase1, get_base1_8_fv) { +TEST_F(mathMix, get_base1_8_fv) { using stan::math::fvar; using stan::math::get_base1; using stan::math::var; @@ -165,7 +166,7 @@ TEST(AgradMixMatrixGetBase1, get_base1_8_fv) { .val_.val()); } -TEST(AgradMixMatrixGetBase1, failing_pre_20_ffv) { +TEST_F(mathMix, failing_pre_20_ffv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -175,7 +176,7 @@ TEST(AgradMixMatrixGetBase1, failing_pre_20_ffv) { y << 1, 2, 3; EXPECT_FLOAT_EQ(1, get_base1(y, 1, "y", 1).val_.val_.val()); } -TEST(AgradMixMatrixGetBase1, get_base1_vec1_ffv) { +TEST_F(mathMix, get_base1_vec1_ffv) { using stan::math::fvar; using stan::math::get_base1; using stan::math::var; @@ -192,7 +193,7 @@ TEST(AgradMixMatrixGetBase1, get_base1_vec1_ffv) { EXPECT_THROW(get_base1(x, 0, "x[0]", 0), std::out_of_range); EXPECT_THROW(get_base1(x, 3, "x[3]", 0), std::out_of_range); } -TEST(AgradMixMatrixGetBase1, get_base1_vec2_ffv) { +TEST_F(mathMix, get_base1_vec2_ffv) { using stan::math::fvar; using stan::math::get_base1; using stan::math::var; @@ -225,7 +226,7 @@ TEST(AgradMixMatrixGetBase1, get_base1_vec2_ffv) { EXPECT_THROW(get_base1(get_base1(x, 1, "", -1), 12, "", -1), std::out_of_range); } -TEST(AgradMixMatrixGetBase1, get_base1_matrix_ffv) { +TEST_F(mathMix, get_base1_matrix_ffv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -254,7 +255,7 @@ TEST(AgradMixMatrixGetBase1, get_base1_matrix_ffv) { EXPECT_THROW(get_base1(x, 0, 1, "x", 1), std::out_of_range); EXPECT_THROW(get_base1(x, 1, 0, "x", 1), std::out_of_range); } -TEST(AgradMixMatrixGetBase1, get_base1_vector_ffv) { +TEST_F(mathMix, get_base1_vector_ffv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -269,7 +270,7 @@ TEST(AgradMixMatrixGetBase1, get_base1_vector_ffv) { EXPECT_THROW(get_base1(x, 0, "x", 1), std::out_of_range); EXPECT_THROW(get_base1(x, 100, "x", 1), std::out_of_range); } -TEST(AgradMixMatrixGetBase1, get_base1_row_vector_ffv) { +TEST_F(mathMix, get_base1_row_vector_ffv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -284,7 +285,7 @@ TEST(AgradMixMatrixGetBase1, get_base1_row_vector_ffv) { EXPECT_THROW(get_base1(x, 0, "x", 1), std::out_of_range); EXPECT_THROW(get_base1(x, 100, "x", 1), std::out_of_range); } -TEST(AgradMixMatrixGetBase1, get_base1_8_ffv) { +TEST_F(mathMix, get_base1_8_ffv) { using stan::math::fvar; using stan::math::get_base1; using stan::math::var; diff --git a/test/unit/math/mix/fun/get_imag_test.cpp b/test/unit/math/mix/fun/get_imag_test.cpp index f60f6760e2b..0b4b2c8f799 100644 --- a/test/unit/math/mix/fun/get_imag_test.cpp +++ b/test/unit/math/mix/fun/get_imag_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixMatFun, get_imag) { +TEST_F(mathMix, get_imag) { auto f = [](const auto& z) { return stan::math::get_imag(z); }; stan::test::expect_complex_common(f); } @@ -31,7 +32,7 @@ void test_vectorized_get_imag() { } } } -TEST(mathMixMatFun, get_imag_vectorized) { +TEST_F(mathMix, get_imag_vectorized) { test_vectorized_get_imag(); test_vectorized_get_imag(); test_vectorized_get_imag>(); diff --git a/test/unit/math/mix/fun/get_real_test.cpp b/test/unit/math/mix/fun/get_real_test.cpp index 48a3ea2bb4c..398e5f781fc 100644 --- a/test/unit/math/mix/fun/get_real_test.cpp +++ b/test/unit/math/mix/fun/get_real_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixMatFun, get_real) { +TEST_F(mathMix, get_real) { auto f = [](const auto& z) { return stan::math::get_real(z); }; stan::test::expect_complex_common(f); } @@ -31,7 +32,7 @@ void test_vectorized_get_real() { } } } -TEST(mathMixMatFun, get_real_vectorized) { +TEST_F(mathMix, get_real_vectorized) { test_vectorized_get_real(); test_vectorized_get_real(); test_vectorized_get_real>(); diff --git a/test/unit/math/mix/fun/gp_matern52_cov_test.cpp b/test/unit/math/mix/fun/gp_matern52_cov_test.cpp index 2c14b68298a..b604218840d 100644 --- a/test/unit/math/mix/fun/gp_matern52_cov_test.cpp +++ b/test/unit/math/mix/fun/gp_matern52_cov_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixMatFun, gpMatern52Cov) { +TEST_F(mathMix, gpMatern52Cov) { auto f = [](const auto& x, const auto& sigma, const auto& l) { return stan::math::gp_matern52_cov(x, sigma, l); }; diff --git a/test/unit/math/mix/fun/gp_periodic_cov_1_test.cpp b/test/unit/math/mix/fun/gp_periodic_cov_1_test.cpp index 429dc737da6..9eb2e050a8b 100644 --- a/test/unit/math/mix/fun/gp_periodic_cov_1_test.cpp +++ b/test/unit/math/mix/fun/gp_periodic_cov_1_test.cpp @@ -1,9 +1,10 @@ #include +#include #include #include #include -TEST(AgradMixMath, fv_gp_periodic_cov1) { +TEST_F(mathMix, fv_gp_periodic_cov1) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -107,7 +108,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov1) { EXPECT_NO_THROW(gp_periodic_cov(x_rvec_fv, sigma_d, l_d, p_d)); } -TEST(AgradMixMath, ffv_gp_periodic_cov1) { +TEST_F(mathMix, ffv_gp_periodic_cov1) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -211,7 +212,7 @@ TEST(AgradMixMath, ffv_gp_periodic_cov1) { EXPECT_NO_THROW(gp_periodic_cov(x_rvec_ffv, sigma_d, l_d, p_d)); } -TEST(AgradMixMath, fv_gp_periodic_cov2) { +TEST_F(mathMix, fv_gp_periodic_cov2) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -364,7 +365,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov2) { EXPECT_NO_THROW(gp_periodic_cov(x_rvec_fv, x2_rvec_fv, sigma_d, l_d, p_d)); } -TEST(AgradMixMath, ffv_gp_periodic_cov2) { +TEST_F(mathMix, ffv_gp_periodic_cov2) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -517,7 +518,7 @@ TEST(AgradMixMath, ffv_gp_periodic_cov2) { EXPECT_NO_THROW(gp_periodic_cov(x_rvec_ffv, x2_rvec_ffv, sigma_d, l_d, p_d)); } -TEST(AgradMixMath, fv_gp_periodic_cov1_vec_invalid_values) { +TEST_F(mathMix, fv_gp_periodic_cov1_vec_invalid_values) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -835,7 +836,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov1_vec_invalid_values) { std::domain_error); } -TEST(AgradMixMath, fv_gp_periodic_cov1_vec_nan_values) { +TEST_F(mathMix, fv_gp_periodic_cov1_vec_nan_values) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -1152,7 +1153,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov1_vec_nan_values) { std::domain_error); } -TEST(AgradMixMath, fv_gp_periodic_cov1_eigen_vec_invalid_values) { +TEST_F(mathMix, fv_gp_periodic_cov1_eigen_vec_invalid_values) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -1466,7 +1467,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov1_eigen_vec_invalid_values) { std::domain_error); } -TEST(AgradMixMath, fv_gp_periodic_cov1_eigen_vec_nan_values) { +TEST_F(mathMix, fv_gp_periodic_cov1_eigen_vec_nan_values) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -1780,7 +1781,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov1_eigen_vec_nan_values) { std::domain_error); } -TEST(AgradMixMath, fv_gp_periodic_cov1_eigen_rvec_invalid_values) { +TEST_F(mathMix, fv_gp_periodic_cov1_eigen_rvec_invalid_values) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -2094,7 +2095,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov1_eigen_rvec_invalid_values) { std::domain_error); } -TEST(AgradMixMath, fv_gp_periodic_cov1_eigen_rvec_nan_values) { +TEST_F(mathMix, fv_gp_periodic_cov1_eigen_rvec_nan_values) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -2408,7 +2409,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov1_eigen_rvec_nan_values) { std::domain_error); } -TEST(AgradMixMath, fv_gp_periodic_cov2_vec_invalid_values_1) { +TEST_F(mathMix, fv_gp_periodic_cov2_vec_invalid_values_1) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -3171,7 +3172,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov2_vec_invalid_values_1) { std::domain_error); } -TEST(AgradMixMath, fv_gp_periodic_cov2_vec_invalid_values_2) { +TEST_F(mathMix, fv_gp_periodic_cov2_vec_invalid_values_2) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -3830,7 +3831,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov2_vec_invalid_values_2) { std::domain_error); } -TEST(AgradMixMath, fv_gp_periodic_cov2_vec_nan_values_1) { +TEST_F(mathMix, fv_gp_periodic_cov2_vec_nan_values_1) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -4593,7 +4594,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov2_vec_nan_values_1) { std::domain_error); } -TEST(AgradMixMath, fv_gp_periodic_cov2_vec_nan_values_2) { +TEST_F(mathMix, fv_gp_periodic_cov2_vec_nan_values_2) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -5252,7 +5253,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov2_vec_nan_values_2) { std::domain_error); } -TEST(AgradMixMath, fv_gp_periodic_cov2_eigen_vec_invalid_values_1) { +TEST_F(mathMix, fv_gp_periodic_cov2_eigen_vec_invalid_values_1) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -5999,7 +6000,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov2_eigen_vec_invalid_values_1) { std::domain_error); } -TEST(AgradMixMath, fv_gp_periodic_cov2_eigen_vec_invalid_values_2) { +TEST_F(mathMix, fv_gp_periodic_cov2_eigen_vec_invalid_values_2) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -6642,7 +6643,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov2_eigen_vec_invalid_values_2) { std::domain_error); } -TEST(AgradMixMath, fv_gp_periodic_cov2_eigen_vec_nan_values_1) { +TEST_F(mathMix, fv_gp_periodic_cov2_eigen_vec_nan_values_1) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -7389,7 +7390,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov2_eigen_vec_nan_values_1) { std::domain_error); } -TEST(AgradMixMath, fv_gp_periodic_cov2_eigen_vec_nan_values_2) { +TEST_F(mathMix, fv_gp_periodic_cov2_eigen_vec_nan_values_2) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -8032,7 +8033,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov2_eigen_vec_nan_values_2) { std::domain_error); } -TEST(AgradMixMath, fv_gp_periodic_cov2_eigen_rvec_invalid_values_1) { +TEST_F(mathMix, fv_gp_periodic_cov2_eigen_rvec_invalid_values_1) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -8779,7 +8780,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov2_eigen_rvec_invalid_values_1) { std::domain_error); } -TEST(AgradMixMath, fv_gp_periodic_cov2_eigen_rvec_invalid_values_2) { +TEST_F(mathMix, fv_gp_periodic_cov2_eigen_rvec_invalid_values_2) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -9422,7 +9423,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov2_eigen_rvec_invalid_values_2) { std::domain_error); } -TEST(AgradMixMath, fv_gp_periodic_cov2_eigen_rvec_nan_values_1) { +TEST_F(mathMix, fv_gp_periodic_cov2_eigen_rvec_nan_values_1) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -10169,7 +10170,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov2_eigen_rvec_nan_values_1) { std::domain_error); } -TEST(AgradMixMath, fv_gp_periodic_cov2_eigen_rvec_nan_values_2) { +TEST_F(mathMix, fv_gp_periodic_cov2_eigen_rvec_nan_values_2) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -10812,7 +10813,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov2_eigen_rvec_nan_values_2) { std::domain_error); } -TEST(AgradMixMath, ffv_gp_periodic_cov1_vec_invalid_values) { +TEST_F(mathMix, ffv_gp_periodic_cov1_vec_invalid_values) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -11130,7 +11131,7 @@ TEST(AgradMixMath, ffv_gp_periodic_cov1_vec_invalid_values) { std::domain_error); } -TEST(AgradMixMath, ffv_gp_periodic_cov1_vec_nan_values) { +TEST_F(mathMix, ffv_gp_periodic_cov1_vec_nan_values) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -11447,7 +11448,7 @@ TEST(AgradMixMath, ffv_gp_periodic_cov1_vec_nan_values) { std::domain_error); } -TEST(AgradMixMath, ffv_gp_periodic_cov1_eigen_vec_invalid_values) { +TEST_F(mathMix, ffv_gp_periodic_cov1_eigen_vec_invalid_values) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -11761,7 +11762,7 @@ TEST(AgradMixMath, ffv_gp_periodic_cov1_eigen_vec_invalid_values) { std::domain_error); } -TEST(AgradMixMath, ffv_gp_periodic_cov1_eigen_vec_nan_values) { +TEST_F(mathMix, ffv_gp_periodic_cov1_eigen_vec_nan_values) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -12075,7 +12076,7 @@ TEST(AgradMixMath, ffv_gp_periodic_cov1_eigen_vec_nan_values) { std::domain_error); } -TEST(AgradMixMath, ffv_gp_periodic_cov1_eigen_rvec_invalid_values) { +TEST_F(mathMix, ffv_gp_periodic_cov1_eigen_rvec_invalid_values) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; diff --git a/test/unit/math/mix/fun/gp_periodic_cov_2_test.cpp b/test/unit/math/mix/fun/gp_periodic_cov_2_test.cpp index 7661467c70c..d3807a1d496 100644 --- a/test/unit/math/mix/fun/gp_periodic_cov_2_test.cpp +++ b/test/unit/math/mix/fun/gp_periodic_cov_2_test.cpp @@ -1,9 +1,10 @@ #include +#include #include #include #include -TEST(AgradMixMath, ffv_gp_periodic_cov1_eigen_rvec_nan_values) { +TEST_F(mathMix, ffv_gp_periodic_cov1_eigen_rvec_nan_values) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -317,7 +318,7 @@ TEST(AgradMixMath, ffv_gp_periodic_cov1_eigen_rvec_nan_values) { std::domain_error); } -TEST(AgradMixMath, ffv_gp_periodic_cov2_vec_invalid_values_1) { +TEST_F(mathMix, ffv_gp_periodic_cov2_vec_invalid_values_1) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -1080,7 +1081,7 @@ TEST(AgradMixMath, ffv_gp_periodic_cov2_vec_invalid_values_1) { std::domain_error); } -TEST(AgradMixMath, ffv_gp_periodic_cov2_vec_invalid_values_2) { +TEST_F(mathMix, ffv_gp_periodic_cov2_vec_invalid_values_2) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -1739,7 +1740,7 @@ TEST(AgradMixMath, ffv_gp_periodic_cov2_vec_invalid_values_2) { std::domain_error); } -TEST(AgradMixMath, ffv_gp_periodic_cov2_vec_nan_values_1) { +TEST_F(mathMix, ffv_gp_periodic_cov2_vec_nan_values_1) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -2502,7 +2503,7 @@ TEST(AgradMixMath, ffv_gp_periodic_cov2_vec_nan_values_1) { std::domain_error); } -TEST(AgradMixMath, ffv_gp_periodic_cov2_vec_nan_values_2) { +TEST_F(mathMix, ffv_gp_periodic_cov2_vec_nan_values_2) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -3162,7 +3163,7 @@ TEST(AgradMixMath, ffv_gp_periodic_cov2_vec_nan_values_2) { std::domain_error); } -TEST(AgradMixMath, ffv_gp_periodic_cov2_eigen_vec_invalid_values_1) { +TEST_F(mathMix, ffv_gp_periodic_cov2_eigen_vec_invalid_values_1) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -3855,7 +3856,7 @@ TEST(AgradMixMath, ffv_gp_periodic_cov2_eigen_vec_invalid_values_1) { std::domain_error); } -TEST(AgradMixMath, ffv_gp_periodic_cov2_eigen_vec_invalid_values_2) { +TEST_F(mathMix, ffv_gp_periodic_cov2_eigen_vec_invalid_values_2) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -4552,7 +4553,7 @@ TEST(AgradMixMath, ffv_gp_periodic_cov2_eigen_vec_invalid_values_2) { std::domain_error); } -TEST(AgradMixMath, ffv_gp_periodic_cov2_eigen_vec_nan_values_1) { +TEST_F(mathMix, ffv_gp_periodic_cov2_eigen_vec_nan_values_1) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -5245,7 +5246,7 @@ TEST(AgradMixMath, ffv_gp_periodic_cov2_eigen_vec_nan_values_1) { std::domain_error); } -TEST(AgradMixMath, ffv_gp_periodic_cov2_eigen_vec_nan_values_2) { +TEST_F(mathMix, ffv_gp_periodic_cov2_eigen_vec_nan_values_2) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -5942,7 +5943,7 @@ TEST(AgradMixMath, ffv_gp_periodic_cov2_eigen_vec_nan_values_2) { std::domain_error); } -TEST(AgradMixMath, ffv_gp_periodic_cov2_eigen_rvec_invalid_values_1) { +TEST_F(mathMix, ffv_gp_periodic_cov2_eigen_rvec_invalid_values_1) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -6689,7 +6690,7 @@ TEST(AgradMixMath, ffv_gp_periodic_cov2_eigen_rvec_invalid_values_1) { std::domain_error); } -TEST(AgradMixMath, ffv_gp_periodic_cov2_eigen_rvec_invalid_values_2) { +TEST_F(mathMix, ffv_gp_periodic_cov2_eigen_rvec_invalid_values_2) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -7332,7 +7333,7 @@ TEST(AgradMixMath, ffv_gp_periodic_cov2_eigen_rvec_invalid_values_2) { std::domain_error); } -TEST(AgradMixMath, ffv_gp_periodic_cov2_eigen_rvec_nan_values_1) { +TEST_F(mathMix, ffv_gp_periodic_cov2_eigen_rvec_nan_values_1) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -8079,7 +8080,7 @@ TEST(AgradMixMath, ffv_gp_periodic_cov2_eigen_rvec_nan_values_1) { std::domain_error); } -TEST(AgradMixMath, ffv_gp_periodic_cov2_eigen_rvec_nan_values_2) { +TEST_F(mathMix, ffv_gp_periodic_cov2_eigen_rvec_nan_values_2) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -8722,7 +8723,7 @@ TEST(AgradMixMath, ffv_gp_periodic_cov2_eigen_rvec_nan_values_2) { std::domain_error); } -TEST(AgradMixMath, fv_gp_periodic_cov2_eigen_vec_dim_error) { +TEST_F(mathMix, fv_gp_periodic_cov2_eigen_vec_dim_error) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -8805,7 +8806,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov2_eigen_vec_dim_error) { std::invalid_argument); } -TEST(AgradMixMath, fv_gp_periodic_cov2_eigen_rvec_dim_error) { +TEST_F(mathMix, fv_gp_periodic_cov2_eigen_rvec_dim_error) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -8888,7 +8889,7 @@ TEST(AgradMixMath, fv_gp_periodic_cov2_eigen_rvec_dim_error) { std::invalid_argument); } -TEST(AgradMixMath, ffv_gp_periodic_cov2_eigen_vec_dim_error) { +TEST_F(mathMix, ffv_gp_periodic_cov2_eigen_vec_dim_error) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; @@ -8971,7 +8972,7 @@ TEST(AgradMixMath, ffv_gp_periodic_cov2_eigen_vec_dim_error) { std::invalid_argument); } -TEST(AgradMixMath, ffv_gp_periodic_cov2_eigen_rvec_dim_error) { +TEST_F(mathMix, ffv_gp_periodic_cov2_eigen_rvec_dim_error) { using stan::math::fvar; using stan::math::gp_periodic_cov; using stan::math::var; diff --git a/test/unit/math/mix/fun/grad_2F1_test.cpp b/test/unit/math/mix/fun/grad_2F1_test.cpp index 14d15a5f773..889109f4712 100644 --- a/test/unit/math/mix/fun/grad_2F1_test.cpp +++ b/test/unit/math/mix/fun/grad_2F1_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(ProbInternalMath, grad2F1_zero_z) { +TEST_F(mathMix, grad2F1_zero_z) { using stan::math::fvar; using stan::math::var; fvar a1 = 3.70975; @@ -24,7 +25,7 @@ TEST(ProbInternalMath, grad2F1_zero_z) { EXPECT_FLOAT_EQ(0, std::get<2>(grad_tuple).d_); } -TEST(ProbInternalMath, grad2F1_fnegative_z) { +TEST_F(mathMix, grad2F1_fnegative_z) { using stan::math::fvar; fvar a = 3.70975; @@ -42,7 +43,7 @@ TEST(ProbInternalMath, grad2F1_fnegative_z) { EXPECT_NEAR(0.0677809985598383, std::get<2>(grad_tuple), 1e-9); } -TEST(ProbInternalMath, grad2F1_fd1) { +TEST_F(mathMix, grad2F1_fd1) { using stan::math::fvar; fvar a = 2; @@ -58,7 +59,7 @@ TEST(ProbInternalMath, grad2F1_fd1) { EXPECT_NEAR(0.85137603960998, std::get<1>(grad_tuple).val_, 1e-8); EXPECT_NEAR(-0.4617734352303, std::get<2>(grad_tuple).val_, 1e-8); } -TEST(ProbInternalMath, grad2F1_fd2) { +TEST_F(mathMix, grad2F1_fd2) { using stan::math::fvar; fvar a = 2; @@ -75,7 +76,7 @@ TEST(ProbInternalMath, grad2F1_fd2) { EXPECT_NEAR(0.434904696493189, std::get<1>(grad_tuple).d_, 1e-8); } -TEST(ProbInternalMath, grad2F1_fd3) { +TEST_F(mathMix, grad2F1_fd3) { using stan::math::fvar; fvar a = 2; @@ -91,7 +92,7 @@ TEST(ProbInternalMath, grad2F1_fd3) { EXPECT_NEAR(-0.46177343523032, std::get<2>(grad_tuple).val_, 1e-8); EXPECT_NEAR(0.574406330443730, std::get<2>(grad_tuple).d_, 1e-8); } -TEST(ProbInternalMath, grad2F1_ffd1) { +TEST_F(mathMix, grad2F1_ffd1) { using stan::math::fvar; fvar > a = 2; @@ -106,7 +107,7 @@ TEST(ProbInternalMath, grad2F1_ffd1) { EXPECT_NEAR(0.851376039609984, std::get<1>(grad_tuple).val_.val_, 1e-8); EXPECT_NEAR(-0.46177343523032, std::get<2>(grad_tuple).val_.val_, 1e-8); } -TEST(ProbInternalMath, grad2F1_ffd2) { +TEST_F(mathMix, grad2F1_ffd2) { using stan::math::fvar; fvar > a = 2; @@ -122,7 +123,7 @@ TEST(ProbInternalMath, grad2F1_ffd2) { EXPECT_NEAR(-0.461773435230326, std::get<2>(grad_tuple).val_.val_, 1e-8); } -TEST(ProbInternalMath, grad2F1_ffd3) { +TEST_F(mathMix, grad2F1_ffd3) { using stan::math::fvar; fvar > a = 2; @@ -138,7 +139,7 @@ TEST(ProbInternalMath, grad2F1_ffd3) { EXPECT_NEAR(0.574406330443730, std::get<2>(grad_tuple).d_.val_, 1e-8); } -TEST(ProbInternalMath, grad2F1_fv1) { +TEST_F(mathMix, grad2F1_fv1) { using stan::math::fvar; using stan::math::var; @@ -154,7 +155,7 @@ TEST(ProbInternalMath, grad2F1_fv1) { EXPECT_NEAR(0.851376039609984, std::get<1>(grad_tuple).val_.val(), 1e-8); EXPECT_NEAR(-0.46177343523032, std::get<2>(grad_tuple).val_.val(), 1e-8); } -TEST(ProbInternalMath, grad2F1_fv2) { +TEST_F(mathMix, grad2F1_fv2) { using stan::math::fvar; using stan::math::var; @@ -170,7 +171,7 @@ TEST(ProbInternalMath, grad2F1_fv2) { EXPECT_NEAR(0.434904696493189, std::get<1>(grad_tuple).d_.val(), 1e-8); EXPECT_NEAR(-0.46177343523032, std::get<2>(grad_tuple).val_.val(), 1e-8); } -TEST(ProbInternalMath, grad2F1_fv3) { +TEST_F(mathMix, grad2F1_fv3) { using stan::math::fvar; using stan::math::var; @@ -187,7 +188,7 @@ TEST(ProbInternalMath, grad2F1_fv3) { EXPECT_NEAR(0.574406330443730, std::get<2>(grad_tuple).d_.val(), 1e-8); } -TEST(ProbInternalMath, grad2F1_fv_1stderiv1) { +TEST_F(mathMix, grad2F1_fv_1stderiv1) { using stan::math::fvar; using stan::math::var; @@ -204,7 +205,7 @@ TEST(ProbInternalMath, grad2F1_fv_1stderiv1) { std::get<0>(grad_tuple).val_.grad(y1, grad1); EXPECT_NEAR(0.163714876516383, grad1[0], 1e-8); } -TEST(ProbInternalMath, grad2F1_fv_1stderiv2) { +TEST_F(mathMix, grad2F1_fv_1stderiv2) { using stan::math::fvar; using stan::math::var; @@ -221,7 +222,7 @@ TEST(ProbInternalMath, grad2F1_fv_1stderiv2) { std::get<1>(grad_tuple).val_.grad(y1, grad1); EXPECT_NEAR(0.434904696493189, grad1[0], 1e-8); } -TEST(ProbInternalMath, grad2F1_fv_1stderiv3) { +TEST_F(mathMix, grad2F1_fv_1stderiv3) { using stan::math::fvar; using stan::math::var; @@ -239,7 +240,7 @@ TEST(ProbInternalMath, grad2F1_fv_1stderiv3) { EXPECT_NEAR(0.574406330443730, grad1[0], 1e-8); } -TEST(ProbInternalMath, grad2F1_fv_2ndderiv1) { +TEST_F(mathMix, grad2F1_fv_2ndderiv1) { using stan::math::fvar; using stan::math::var; @@ -257,7 +258,7 @@ TEST(ProbInternalMath, grad2F1_fv_2ndderiv1) { EXPECT_NEAR(0.064256527613079, grad1[0], 1e-8); } -TEST(ProbInternalMath, grad2F1_fv_2ndderiv2) { +TEST_F(mathMix, grad2F1_fv_2ndderiv2) { using stan::math::fvar; using stan::math::var; @@ -275,7 +276,7 @@ TEST(ProbInternalMath, grad2F1_fv_2ndderiv2) { EXPECT_NEAR(0.222160462864892, grad1[0], 1e-8); } -TEST(ProbInternalMath, grad2F1_fv_2ndderiv3) { +TEST_F(mathMix, grad2F1_fv_2ndderiv3) { using stan::math::fvar; using stan::math::var; diff --git a/test/unit/math/mix/fun/grad_F32_test.cpp b/test/unit/math/mix/fun/grad_F32_test.cpp index 99adad20585..ee9d2af4505 100644 --- a/test/unit/math/mix/fun/grad_F32_test.cpp +++ b/test/unit/math/mix/fun/grad_F32_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(ProbInternalMath, gradF32_fd1) { +TEST_F(mathMix, gradF32_fd1) { using stan::math::fvar; fvar a = 1.0; @@ -32,7 +33,7 @@ TEST(ProbInternalMath, gradF32_fd1) { g[0].d_, 1e-5); } -TEST(ProbInternalMath, gradF32_fd2) { +TEST_F(mathMix, gradF32_fd2) { using stan::math::fvar; fvar a = 1.0; @@ -62,7 +63,7 @@ TEST(ProbInternalMath, gradF32_fd2) { g[1].d_, 1e-5); } -TEST(ProbInternalMath, gradF32_fd3) { +TEST_F(mathMix, gradF32_fd3) { using stan::math::fvar; fvar a = 1.0; @@ -90,7 +91,7 @@ TEST(ProbInternalMath, gradF32_fd3) { EXPECT_NEAR(0.90986472078762437, g[2].d_, 1e-5); } -TEST(ProbInternalMath, gradF32_fd4) { +TEST_F(mathMix, gradF32_fd4) { using stan::math::fvar; fvar a = 1.0; @@ -119,7 +120,7 @@ TEST(ProbInternalMath, gradF32_fd4) { EXPECT_NEAR(1.047024959065504556655904003595645684444382378830047020988218, g[3].d_, 1e-5); } -TEST(ProbInternalMath, gradF32_fd5) { +TEST_F(mathMix, gradF32_fd5) { using stan::math::fvar; fvar a = 1.0; @@ -148,7 +149,7 @@ TEST(ProbInternalMath, gradF32_fd5) { EXPECT_NEAR(0.415359887777218792995404669803015764396172842233556866773418, g[4].d_, 1e-5); } -TEST(ProbInternalMath, gradF32_fd6) { +TEST_F(mathMix, gradF32_fd6) { using stan::math::fvar; fvar a = 1.0; @@ -178,7 +179,7 @@ TEST(ProbInternalMath, gradF32_fd6) { g[5].d_, 1e-5); } -TEST(ProbInternalMath, gradF32_ffd_2ndderiv1) { +TEST_F(mathMix, gradF32_ffd_2ndderiv1) { using stan::math::fvar; fvar > a = 1.0; @@ -208,7 +209,7 @@ TEST(ProbInternalMath, gradF32_ffd_2ndderiv1) { g[0].d_.val_, 1e-5); } -TEST(ProbInternalMath, gradF32_ffd_2ndderiv2) { +TEST_F(mathMix, gradF32_ffd_2ndderiv2) { using stan::math::fvar; fvar > a = 1.0; @@ -238,7 +239,7 @@ TEST(ProbInternalMath, gradF32_ffd_2ndderiv2) { g[1].d_.val_, 1e-5); } -TEST(ProbInternalMath, gradF32_ffd_2ndderiv3) { +TEST_F(mathMix, gradF32_ffd_2ndderiv3) { using stan::math::fvar; fvar > a = 1.0; @@ -266,7 +267,7 @@ TEST(ProbInternalMath, gradF32_ffd_2ndderiv3) { EXPECT_NEAR(0.90986472078762437, g[2].d_.val_, 1e-5); } -TEST(ProbInternalMath, gradF32_ffd_2ndderiv4) { +TEST_F(mathMix, gradF32_ffd_2ndderiv4) { using stan::math::fvar; fvar > a = 1.0; @@ -295,7 +296,7 @@ TEST(ProbInternalMath, gradF32_ffd_2ndderiv4) { EXPECT_NEAR(1.047024959065504556655904003595645684444382378830047020988218, g[3].d_.val_, 1e-5); } -TEST(ProbInternalMath, gradF32_ffd_2ndderiv5) { +TEST_F(mathMix, gradF32_ffd_2ndderiv5) { using stan::math::fvar; fvar > a = 1.0; @@ -324,7 +325,7 @@ TEST(ProbInternalMath, gradF32_ffd_2ndderiv5) { EXPECT_NEAR(0.415359887777218792995404669803015764396172842233556866773418, g[4].d_.val_, 1e-5); } -TEST(ProbInternalMath, gradF32_ffd_2ndderiv6) { +TEST_F(mathMix, gradF32_ffd_2ndderiv6) { using stan::math::fvar; fvar > a = 1.0; @@ -354,7 +355,7 @@ TEST(ProbInternalMath, gradF32_ffd_2ndderiv6) { g[5].d_.val_, 1e-5); } -TEST(ProbInternalMath, gradF32_ffd_3rdderiv1) { +TEST_F(mathMix, gradF32_ffd_3rdderiv1) { using stan::math::fvar; fvar > a = 1.0; @@ -384,7 +385,7 @@ TEST(ProbInternalMath, gradF32_ffd_3rdderiv1) { EXPECT_NEAR(65.599396543196708101135082478886528455, g[0].d_.d_, 1e-5); } -TEST(ProbInternalMath, gradF32_ffd_3rdderiv2) { +TEST_F(mathMix, gradF32_ffd_3rdderiv2) { using stan::math::fvar; fvar > a = 1.0; @@ -414,7 +415,7 @@ TEST(ProbInternalMath, gradF32_ffd_3rdderiv2) { EXPECT_NEAR(0.074524365399251673905543999863038234, g[1].d_.d_, 1e-5); } -TEST(ProbInternalMath, gradF32_ffd_3rdderiv3) { +TEST_F(mathMix, gradF32_ffd_3rdderiv3) { using stan::math::fvar; fvar > a = 1.0; @@ -443,7 +444,7 @@ TEST(ProbInternalMath, gradF32_ffd_3rdderiv3) { EXPECT_NEAR(-0.4025421605307411, g[2].d_.d_, 1e-5); } -TEST(ProbInternalMath, gradF32_ffd_3rdderiv4) { +TEST_F(mathMix, gradF32_ffd_3rdderiv4) { using stan::math::fvar; fvar > a = 1.0; @@ -472,7 +473,7 @@ TEST(ProbInternalMath, gradF32_ffd_3rdderiv4) { EXPECT_NEAR(-0.505769456958641747831864908555691738, g[3].d_.d_, 1e-5); } -TEST(ProbInternalMath, gradF32_ffd_3rdderiv5) { +TEST_F(mathMix, gradF32_ffd_3rdderiv5) { using stan::math::fvar; fvar > a = 1.0; @@ -501,7 +502,7 @@ TEST(ProbInternalMath, gradF32_ffd_3rdderiv5) { EXPECT_NEAR(0.143334459434983770772868891143925349, g[4].d_.d_, 1e-5); } -TEST(ProbInternalMath, gradF32_ffd_3rdderiv6) { +TEST_F(mathMix, gradF32_ffd_3rdderiv6) { using stan::math::fvar; fvar > a = 1.0; @@ -531,7 +532,7 @@ TEST(ProbInternalMath, gradF32_ffd_3rdderiv6) { EXPECT_NEAR(3464.701930495754952696665090654133564817, g[5].d_.d_, 1e-5); } -TEST(ProbInternalMath, gradF32_fv_1stderiv1) { +TEST_F(mathMix, gradF32_fv_1stderiv1) { using stan::math::fvar; using stan::math::var; @@ -568,7 +569,7 @@ TEST(ProbInternalMath, gradF32_fv_1stderiv1) { grad1[0], 1e-5); } -TEST(ProbInternalMath, gradF32_fv_1stderiv2) { +TEST_F(mathMix, gradF32_fv_1stderiv2) { using stan::math::fvar; using stan::math::var; @@ -605,7 +606,7 @@ TEST(ProbInternalMath, gradF32_fv_1stderiv2) { grad1[0], 1e-5); } -TEST(ProbInternalMath, gradF32_fv_1stderiv3) { +TEST_F(mathMix, gradF32_fv_1stderiv3) { using stan::math::fvar; using stan::math::var; @@ -639,7 +640,7 @@ TEST(ProbInternalMath, gradF32_fv_1stderiv3) { g[2].val_.grad(y1, grad1); EXPECT_NEAR(0.90986472078762437, grad1[0], 1e-5); } -TEST(ProbInternalMath, gradF32_fv_1stderiv4) { +TEST_F(mathMix, gradF32_fv_1stderiv4) { using stan::math::fvar; using stan::math::var; @@ -675,7 +676,7 @@ TEST(ProbInternalMath, gradF32_fv_1stderiv4) { EXPECT_NEAR(1.047024959065504556655904003595645684444382378830047020988218, grad1[0], 1e-5); } -TEST(ProbInternalMath, gradF32_fv_1stderiv5) { +TEST_F(mathMix, gradF32_fv_1stderiv5) { using stan::math::fvar; using stan::math::var; @@ -711,7 +712,7 @@ TEST(ProbInternalMath, gradF32_fv_1stderiv5) { EXPECT_NEAR(0.415359887777218792995404669803015764396172842233556866773418, grad1[0], 1e-5); } -TEST(ProbInternalMath, gradF32_fv_1stderiv6) { +TEST_F(mathMix, gradF32_fv_1stderiv6) { using stan::math::fvar; using stan::math::var; @@ -748,7 +749,7 @@ TEST(ProbInternalMath, gradF32_fv_1stderiv6) { grad1[0], 1e-5); } -TEST(ProbInternalMath, gradF32_fv_2ndderiv1) { +TEST_F(mathMix, gradF32_fv_2ndderiv1) { using stan::math::fvar; using stan::math::var; @@ -784,7 +785,7 @@ TEST(ProbInternalMath, gradF32_fv_2ndderiv1) { EXPECT_NEAR(65.599396543196708101135082478886528455, grad1[0], 1e-5); } -TEST(ProbInternalMath, gradF32_fv_2ndderiv2) { +TEST_F(mathMix, gradF32_fv_2ndderiv2) { using stan::math::fvar; using stan::math::var; @@ -820,7 +821,7 @@ TEST(ProbInternalMath, gradF32_fv_2ndderiv2) { EXPECT_NEAR(0.074524365399251673905543999863038234, grad1[0], 1e-5); } -TEST(ProbInternalMath, gradF32_fv_2ndderiv3) { +TEST_F(mathMix, gradF32_fv_2ndderiv3) { using stan::math::fvar; using stan::math::var; @@ -854,7 +855,7 @@ TEST(ProbInternalMath, gradF32_fv_2ndderiv3) { g[2].d_.grad(y1, grad1); EXPECT_NEAR(-0.4025421605307411, grad1[0], 1e-5); } -TEST(ProbInternalMath, gradF32_fv_2ndderiv4) { +TEST_F(mathMix, gradF32_fv_2ndderiv4) { using stan::math::fvar; using stan::math::var; @@ -889,7 +890,7 @@ TEST(ProbInternalMath, gradF32_fv_2ndderiv4) { g[3].d_.grad(y1, grad1); EXPECT_NEAR(-0.505769456958641747831864908555691738, grad1[0], 1e-5); } -TEST(ProbInternalMath, gradF32_fv_2ndderiv5) { +TEST_F(mathMix, gradF32_fv_2ndderiv5) { using stan::math::fvar; using stan::math::var; @@ -924,7 +925,7 @@ TEST(ProbInternalMath, gradF32_fv_2ndderiv5) { g[4].d_.grad(y1, grad1); EXPECT_NEAR(0.143334459434983770772868891143925349, grad1[0], 1e-5); } -TEST(ProbInternalMath, gradF32_fv_2ndderiv6) { +TEST_F(mathMix, gradF32_fv_2ndderiv6) { using stan::math::fvar; using stan::math::var; diff --git a/test/unit/math/mix/fun/grad_reg_inc_beta_test.cpp b/test/unit/math/mix/fun/grad_reg_inc_beta_test.cpp index e6613d43ea1..3b81defc08a 100644 --- a/test/unit/math/mix/fun/grad_reg_inc_beta_test.cpp +++ b/test/unit/math/mix/fun/grad_reg_inc_beta_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(ProbInternalMath, grad_reg_inc_beta_fv) { +TEST_F(mathMix, grad_reg_inc_beta_fv) { using stan::math::digamma; using stan::math::exp; using stan::math::fvar; @@ -29,7 +30,7 @@ TEST(ProbInternalMath, grad_reg_inc_beta_fv) { EXPECT_NEAR(0.306495375042422864944011633197968575202046200428315551199, g_b.val_.val(), 1e-6); } -TEST(ProbInternalMath, grad_reg_inc_beta_fv_1stDeriv1) { +TEST_F(mathMix, grad_reg_inc_beta_fv_1stDeriv1) { using stan::math::digamma; using stan::math::exp; using stan::math::fvar; @@ -58,7 +59,7 @@ TEST(ProbInternalMath, grad_reg_inc_beta_fv_1stDeriv1) { EXPECT_FLOAT_EQ(0.33583548212738989400284958327902414335945097838423129, grad1[0]); } -TEST(ProbInternalMath, grad_reg_inc_beta_fv_1stDeriv2) { +TEST_F(mathMix, grad_reg_inc_beta_fv_1stDeriv2) { using stan::math::digamma; using stan::math::exp; using stan::math::fvar; @@ -86,7 +87,7 @@ TEST(ProbInternalMath, grad_reg_inc_beta_fv_1stDeriv2) { g_b.val_.grad(y1, grad1); EXPECT_NEAR(-0.156565690737548079304827886, grad1[0], 1e-6); } -TEST(ProbInternalMath, grad_reg_inc_beta_fv_2ndDeriv1) { +TEST_F(mathMix, grad_reg_inc_beta_fv_2ndDeriv1) { using stan::math::digamma; using stan::math::exp; using stan::math::fvar; @@ -115,7 +116,7 @@ TEST(ProbInternalMath, grad_reg_inc_beta_fv_2ndDeriv1) { EXPECT_FLOAT_EQ(-0.30772293970781581317390510390046098438962772318921, grad1[0]); } -TEST(ProbInternalMath, grad_reg_inc_beta_fv_2ndDeriv2) { +TEST_F(mathMix, grad_reg_inc_beta_fv_2ndDeriv2) { using stan::math::digamma; using stan::math::exp; using stan::math::fvar; diff --git a/test/unit/math/mix/fun/grad_reg_inc_gamma_test.cpp b/test/unit/math/mix/fun/grad_reg_inc_gamma_test.cpp index 87bd0b1240a..243fb538fec 100644 --- a/test/unit/math/mix/fun/grad_reg_inc_gamma_test.cpp +++ b/test/unit/math/mix/fun/grad_reg_inc_gamma_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(ProbInternalMath, gradRegIncGamma_typical) { +TEST_F(mathMix, gradRegIncGamma_typical) { double a = 0.5; double b = 1.0; double g = 1.77245; @@ -11,7 +12,7 @@ TEST(ProbInternalMath, gradRegIncGamma_typical) { EXPECT_FLOAT_EQ(0.38984156, stan::math::grad_reg_inc_gamma(a, b, g, dig)); } -TEST(ProbInternalMath, gradRegIncGamma_infLoopInVersion2_0_1) { +TEST_F(mathMix, gradRegIncGamma_infLoopInVersion2_0_1) { double a = 8.01006; double b = 2.47579e+215; double g = 5143.28; @@ -20,7 +21,7 @@ TEST(ProbInternalMath, gradRegIncGamma_infLoopInVersion2_0_1) { EXPECT_FLOAT_EQ(0, stan::math::grad_reg_inc_gamma(a, b, g, dig)); } -TEST(ProbInternalMath, gradRegIncGamma_largeZ) { +TEST_F(mathMix, gradRegIncGamma_largeZ) { double a = 3; double z = 48; double g = 2.0; @@ -30,7 +31,7 @@ TEST(ProbInternalMath, gradRegIncGamma_largeZ) { stan::math::grad_reg_inc_gamma(a, z, g, dig)); } -TEST(ProbInternalMath, gradRegIncGamma_fd) { +TEST_F(mathMix, gradRegIncGamma_fd) { using stan::math::fvar; fvar a = 0.5; @@ -41,7 +42,7 @@ TEST(ProbInternalMath, gradRegIncGamma_fd) { EXPECT_FLOAT_EQ(0.38984156, stan::math::grad_reg_inc_gamma(a, b, g, dig).val()); } -TEST(ProbInternalMath, gradRegIncGamma_ffd) { +TEST_F(mathMix, gradRegIncGamma_ffd) { using stan::math::fvar; fvar > a = 0.5; @@ -53,7 +54,7 @@ TEST(ProbInternalMath, gradRegIncGamma_ffd) { stan::math::grad_reg_inc_gamma(a, b, g, dig).val_.val_); } -TEST(ProbInternalMath, gradRegIncGamma_fv) { +TEST_F(mathMix, gradRegIncGamma_fv) { using stan::math::digamma; using stan::math::fvar; using stan::math::var; @@ -67,7 +68,7 @@ TEST(ProbInternalMath, gradRegIncGamma_fv) { stan::math::grad_reg_inc_gamma(a, b, g, dig).val_.val()); } -TEST(ProbInternalMath, gradRegIncGamma_fv_1stderiv) { +TEST_F(mathMix, gradRegIncGamma_fv_1stderiv) { using stan::math::digamma; using stan::math::fvar; using stan::math::tgamma; @@ -88,7 +89,7 @@ TEST(ProbInternalMath, gradRegIncGamma_fv_1stderiv) { EXPECT_NEAR(0.2134999674954450667, grad1[0], 1e-6); } -TEST(ProbInternalMath, gradRegIncGamma_fv_2ndderiv) { +TEST_F(mathMix, gradRegIncGamma_fv_2ndderiv) { using stan::math::digamma; using stan::math::fvar; using stan::math::tgamma; diff --git a/test/unit/math/mix/fun/head_test.cpp b/test/unit/math/mix/fun/head_test.cpp index 46671852af3..2621f185faf 100644 --- a/test/unit/math/mix/fun/head_test.cpp +++ b/test/unit/math/mix/fun/head_test.cpp @@ -1,4 +1,5 @@ #include +#include #include template @@ -13,7 +14,7 @@ void expect_head(const T& x, int n) { stan::test::expect_ad(f(n), rv); } -TEST(MathMixMatFun, head) { +TEST_F(mathMix, head) { std::vector a{}; expect_head(a, 0); expect_head(a, 1); diff --git a/test/unit/math/mix/fun/hypergeometric_2F1_test.cpp b/test/unit/math/mix/fun/hypergeometric_2F1_test.cpp index bc6d13e4a98..0c1d9a86104 100644 --- a/test/unit/math/mix/fun/hypergeometric_2F1_test.cpp +++ b/test/unit/math/mix/fun/hypergeometric_2F1_test.cpp @@ -1,7 +1,8 @@ #include #include +#include -TEST(mathMixScalFun, hypergeometric2F1_1) { +TEST_F(mathMix, hypergeometric2F1_1) { using stan::math::fvar; fvar a1 = 3.70975; fvar a2 = 1; @@ -20,7 +21,7 @@ TEST(mathMixScalFun, hypergeometric2F1_1) { res.d_); } -TEST(mathMixScalFun, hypergeometric2F1_2) { +TEST_F(mathMix, hypergeometric2F1_2) { using stan::math::fvar; using stan::math::var; fvar a1 = 2; @@ -37,7 +38,7 @@ TEST(mathMixScalFun, hypergeometric2F1_2) { EXPECT_FLOAT_EQ(2.77777777777778, z.val().adj()); } -TEST(mathMixScalFun, hypergeometric2F1_3_euler) { +TEST_F(mathMix, hypergeometric2F1_3_euler) { using stan::math::fvar; fvar a1 = 1; fvar a2 = 1; diff --git a/test/unit/math/mix/fun/hypergeometric_3F2_test.cpp b/test/unit/math/mix/fun/hypergeometric_3F2_test.cpp index 5151dd53df2..06a741194dd 100644 --- a/test/unit/math/mix/fun/hypergeometric_3F2_test.cpp +++ b/test/unit/math/mix/fun/hypergeometric_3F2_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(ProbInternalMath, F32_fd) { +TEST_F(mathMix, F32_fd) { using stan::math::fvar; fvar a = 1.0; @@ -17,7 +18,7 @@ TEST(ProbInternalMath, F32_fd) { stan::math::hypergeometric_3F2({a, b, c}, {d, e}, z).val_); } -TEST(ProbInternalMath, F32_ffd) { +TEST_F(mathMix, F32_ffd) { using stan::math::fvar; fvar > a = 1.0; @@ -31,7 +32,7 @@ TEST(ProbInternalMath, F32_ffd) { 11.28915378492300834453857665243661995978358572684678329916652, stan::math::hypergeometric_3F2({a, b, c}, {d, e}, z).val_.val_); } -TEST(ProbInternalMath, F32_fv_1stderiv1) { +TEST_F(mathMix, F32_fv_1stderiv1) { using stan::math::fvar; using stan::math::var; @@ -55,7 +56,7 @@ TEST(ProbInternalMath, F32_fv_1stderiv1) { EXPECT_NEAR(22.95829816018250585416491584581112223816561212219172212450836, grad1[0], 1e-5); } -TEST(ProbInternalMath, F32_fv_1stderiv2) { +TEST_F(mathMix, F32_fv_1stderiv2) { using stan::math::fvar; using stan::math::var; @@ -79,7 +80,7 @@ TEST(ProbInternalMath, F32_fv_1stderiv2) { EXPECT_NEAR(1.740056451478897241488082512854205170874142224663970334770766, grad1[0], 1e-5); } -TEST(ProbInternalMath, F32_fv_1stderiv3) { +TEST_F(mathMix, F32_fv_1stderiv3) { using stan::math::fvar; using stan::math::var; @@ -102,7 +103,7 @@ TEST(ProbInternalMath, F32_fv_1stderiv3) { z1.val_.grad(y1, grad1); EXPECT_NEAR(-2.6052400424887519, grad1[0], 1e-5); } -TEST(ProbInternalMath, F32_fv_1stderiv4) { +TEST_F(mathMix, F32_fv_1stderiv4) { using stan::math::fvar; using stan::math::var; @@ -126,7 +127,7 @@ TEST(ProbInternalMath, F32_fv_1stderiv4) { EXPECT_NEAR(-2.69297893625022464634137707353872105148995696636392529052847, grad1[0], 1e-5); } -TEST(ProbInternalMath, F32_fv_1stderiv5) { +TEST_F(mathMix, F32_fv_1stderiv5) { using stan::math::fvar; using stan::math::var; @@ -151,7 +152,7 @@ TEST(ProbInternalMath, F32_fv_1stderiv5) { grad1[0], 1e-5); } -TEST(ProbInternalMath, F32_fv_1stderiv6) { +TEST_F(mathMix, F32_fv_1stderiv6) { using stan::math::fvar; using stan::math::var; @@ -176,7 +177,7 @@ TEST(ProbInternalMath, F32_fv_1stderiv6) { grad1[0], 1e-5); } -TEST(ProbInternalMath, F32_fv_2ndderiv1) { +TEST_F(mathMix, F32_fv_2ndderiv1) { using stan::math::fvar; using stan::math::var; @@ -201,7 +202,7 @@ TEST(ProbInternalMath, F32_fv_2ndderiv1) { grad1[0], 1e-5); } -TEST(ProbInternalMath, F32_fv_2ndderiv2) { +TEST_F(mathMix, F32_fv_2ndderiv2) { using stan::math::fvar; using stan::math::var; @@ -225,7 +226,7 @@ TEST(ProbInternalMath, F32_fv_2ndderiv2) { EXPECT_NEAR(0.342454543339724329115552426438001592723143365030924900588111, grad1[0], 1e-5); } -TEST(ProbInternalMath, F32_fv_2ndderiv3) { +TEST_F(mathMix, F32_fv_2ndderiv3) { using stan::math::fvar; using stan::math::var; @@ -248,7 +249,7 @@ TEST(ProbInternalMath, F32_fv_2ndderiv3) { z1.d_.grad(y1, grad1); EXPECT_NEAR(0.90986472078762437, grad1[0], 1e-5); } -TEST(ProbInternalMath, F32_fv_2ndderiv4) { +TEST_F(mathMix, F32_fv_2ndderiv4) { using stan::math::fvar; using stan::math::var; @@ -268,7 +269,7 @@ TEST(ProbInternalMath, F32_fv_2ndderiv4) { EXPECT_NEAR(1.047024959065504556655904003595645684444382378830047020988218, grad1[0], 1e-5); } -TEST(ProbInternalMath, F32_fv_2ndderiv5) { +TEST_F(mathMix, F32_fv_2ndderiv5) { using stan::math::fvar; using stan::math::var; @@ -289,7 +290,7 @@ TEST(ProbInternalMath, F32_fv_2ndderiv5) { grad1[0], 1e-5); } -TEST(ProbInternalMath, F32_fv_2ndderiv6) { +TEST_F(mathMix, F32_fv_2ndderiv6) { using stan::math::fvar; using stan::math::var; diff --git a/test/unit/math/mix/fun/hypergeometric_pFq_test.cpp b/test/unit/math/mix/fun/hypergeometric_pFq_test.cpp index f11971c8fbc..e2455162899 100644 --- a/test/unit/math/mix/fun/hypergeometric_pFq_test.cpp +++ b/test/unit/math/mix/fun/hypergeometric_pFq_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mixScalFun, grad_2F2_ffv) { +TEST_F(mathMix, grad_2F2_ffv) { using stan::math::fvar; using stan::math::hypergeometric_pFq; using stan::math::var; diff --git a/test/unit/math/mix/fun/hypot_test.cpp b/test/unit/math/mix/fun/hypot_test.cpp index 2bc9a9e0c69..6df9f66a8c3 100644 --- a/test/unit/math/mix/fun/hypot_test.cpp +++ b/test/unit/math/mix/fun/hypot_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixScalFun, hypot) { +TEST_F(mathMix, hypot) { auto f = [](const auto& x1, const auto& x2) { return stan::math::hypot(x1, x2); }; @@ -12,7 +13,7 @@ TEST(mathMixScalFun, hypot) { stan::test::expect_ad(f, 3.0, 6.0); } -TEST(mathMixScalFun, hypot_vec) { +TEST_F(mathMix, hypot_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::hypot; return hypot(x1, x2); diff --git a/test/unit/math/mix/fun/i_times_test.cpp b/test/unit/math/mix/fun/i_times_test.cpp index 5234906194d..c8a48f87faa 100644 --- a/test/unit/math/mix/fun/i_times_test.cpp +++ b/test/unit/math/mix/fun/i_times_test.cpp @@ -1,16 +1,17 @@ #include +#include -TEST(matPrimFun, iTimes) { +TEST_F(mathMix, iTimes) { auto f = [](const auto& x) { return stan::math::i_times(x); }; stan::test::expect_complex_common(f); } -TEST(matPrimFun, negITimes) { +TEST_F(mathMix, negITimes) { auto f = [](const auto& x) { return stan::math::neg_i_times(x); }; stan::test::expect_complex_common(f); } -TEST(matPrimFun, complexNegate) { +TEST_F(mathMix, complexNegate) { auto f = [](const auto& x) { return stan::math::complex_negate(x); }; stan::test::expect_complex_common(f); } diff --git a/test/unit/math/mix/fun/identity_constrain_test.cpp b/test/unit/math/mix/fun/identity_constrain_test.cpp index c1fd9ccee33..d86cb3df2ba 100644 --- a/test/unit/math/mix/fun/identity_constrain_test.cpp +++ b/test/unit/math/mix/fun/identity_constrain_test.cpp @@ -1,4 +1,5 @@ #include +#include #include namespace identity_constrain_test { @@ -28,7 +29,7 @@ void expect_identity_constrain(double x) { stan::test::expect_ad(f3, x); } -TEST(mathMixScalFun, identityConstrain) { +TEST_F(mathMix, identityConstrain) { expect_identity_constrain(-1); expect_identity_constrain(2.1); } diff --git a/test/unit/math/mix/fun/imag_test.cpp b/test/unit/math/mix/fun/imag_test.cpp index 195cb6f5c65..f0cfe5f817b 100644 --- a/test/unit/math/mix/fun/imag_test.cpp +++ b/test/unit/math/mix/fun/imag_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, imag) { +TEST_F(mathMix, imag) { auto f = [](const auto& z) { return imag(z); }; stan::test::expect_complex_common(f); } diff --git a/test/unit/math/mix/fun/inc_beta_test.cpp b/test/unit/math/mix/fun/inc_beta_test.cpp index 4f00deab729..3c8da850e53 100644 --- a/test/unit/math/mix/fun/inc_beta_test.cpp +++ b/test/unit/math/mix/fun/inc_beta_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, inc_beta) { +TEST_F(mathMix, inc_beta) { auto f = [](const auto& x1, const auto& x2, const auto& x3) { return stan::math::inc_beta(x1, x2, x3); }; @@ -28,7 +29,7 @@ TEST(mathMixScalFun, inc_beta) { stan::test::expect_ad(f, nan, nan, nan); } -TEST(mathMixScalFun, inc_beta_vec) { +TEST_F(mathMix, inc_beta_vec) { auto f = [](const auto& x1, const auto& x2, const auto& x3) { return stan::math::inc_beta(x1, x2, x3); }; diff --git a/test/unit/math/mix/fun/initialize_test.cpp b/test/unit/math/mix/fun/initialize_test.cpp index 7a5cfb87145..cecca6ec7fc 100644 --- a/test/unit/math/mix/fun/initialize_test.cpp +++ b/test/unit/math/mix/fun/initialize_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(AgradMixMatrixInitialize, fv) { +TEST_F(mathMix, fv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -44,7 +45,7 @@ TEST(AgradMixMatrixInitialize, fv) { for (size_t j = 0; j < 2; ++j) EXPECT_FLOAT_EQ(54, d[i][j].val_.val()); } -TEST(AgradMixMatrixInitialize, fv2) { +TEST_F(mathMix, fv2) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -56,7 +57,7 @@ TEST(AgradMixMatrixInitialize, fv2) { EXPECT_FLOAT_EQ(3.0, y[0].val_.val()); } -TEST(AgradMixMatrixInitialize, ffv) { +TEST_F(mathMix, ffv) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -98,7 +99,7 @@ TEST(AgradMixMatrixInitialize, ffv) { for (size_t j = 0; j < 2; ++j) EXPECT_FLOAT_EQ(54, d[i][j].val_.val_.val()); } -TEST(AgradMixMatrixInitialize, ffv2) { +TEST_F(mathMix, ffv2) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; diff --git a/test/unit/math/mix/fun/inv_Phi_test.cpp b/test/unit/math/mix/fun/inv_Phi_test.cpp index 1eaf1b8ff68..841433cbfec 100644 --- a/test/unit/math/mix/fun/inv_Phi_test.cpp +++ b/test/unit/math/mix/fun/inv_Phi_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, invPhi) { +TEST_F(mathMix, invPhi) { auto f = [](const auto& x1) { return stan::math::inv_Phi(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, 0.02425, 0.97575); // breakpoints @@ -8,7 +9,7 @@ TEST(mathMixMatFun, invPhi) { 2.0); } -TEST(mathMixMatFun, invPhi_varmat) { +TEST_F(mathMix, invPhi_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/inv_cloglog_test.cpp b/test/unit/math/mix/fun/inv_cloglog_test.cpp index 19dc4eabc96..c64a110a7f5 100644 --- a/test/unit/math/mix/fun/inv_cloglog_test.cpp +++ b/test/unit/math/mix/fun/inv_cloglog_test.cpp @@ -1,12 +1,13 @@ #include +#include -TEST(mathMixMatFun, invCLogLog) { +TEST_F(mathMix, invCLogLog) { auto f = [](const auto& x1) { return stan::math::inv_cloglog(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -2.6, -2, -1.2, -0.2, 0.5, 1.3); } -TEST(mathMixMatFun, invcloglog_varmat) { +TEST_F(mathMix, invcloglog_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/inv_erfc_test.cpp b/test/unit/math/mix/fun/inv_erfc_test.cpp index 92ebc6d2bba..71e5f86bbc0 100644 --- a/test/unit/math/mix/fun/inv_erfc_test.cpp +++ b/test/unit/math/mix/fun/inv_erfc_test.cpp @@ -1,12 +1,13 @@ #include +#include -TEST(mathMixMatFun, inv_erfc) { +TEST_F(mathMix, inv_erfc) { auto f = [](const auto& x1) { return stan::math::inv_erfc(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -2.6, -2, -1, -0.2, 1, 1.3, 2.6); } -TEST(mathMixMatFun, inv_erfcmatvar) { +TEST_F(mathMix, inv_erfcmatvar) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/inv_inc_beta_test.cpp b/test/unit/math/mix/fun/inv_inc_beta_test.cpp index c4105c77979..100aa9ce19d 100644 --- a/test/unit/math/mix/fun/inv_inc_beta_test.cpp +++ b/test/unit/math/mix/fun/inv_inc_beta_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(ProbInternalMath, inv_inc_beta_fv1) { +TEST_F(mathMix, inv_inc_beta_fv1) { using stan::math::fvar; using stan::math::inv_inc_beta; using stan::math::var; @@ -57,7 +58,7 @@ TEST(ProbInternalMath, inv_inc_beta_fv1) { EXPECT_FLOAT_EQ(b_v.val_.adj(), -0.122532267934); } -TEST(ProbInternalMath, inv_inc_beta_fv2) { +TEST_F(mathMix, inv_inc_beta_fv2) { using stan::math::fvar; using stan::math::inv_inc_beta; using stan::math::var; @@ -76,7 +77,7 @@ TEST(ProbInternalMath, inv_inc_beta_fv2) { EXPECT_FLOAT_EQ(p.val_.val_.adj(), 0.530989359806); } -TEST(mathMixScalFun, inv_inc_beta_vec) { +TEST_F(mathMix, inv_inc_beta_vec) { auto f = [](const auto& x1, const auto& x2, const auto& x3) { return stan::math::inc_beta(x1, x2, x3); }; diff --git a/test/unit/math/mix/fun/inv_logit_test.cpp b/test/unit/math/mix/fun/inv_logit_test.cpp index 8fee66f7eeb..8ec15c8d4c0 100644 --- a/test/unit/math/mix/fun/inv_logit_test.cpp +++ b/test/unit/math/mix/fun/inv_logit_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, invLogit) { +TEST_F(mathMix, invLogit) { auto f = [](const auto& x1) { return stan::math::inv_logit(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -2.6, -2, -1.2, -0.2, 0.5, 1, 1.3, 1.5, diff --git a/test/unit/math/mix/fun/inv_sqrt_test.cpp b/test/unit/math/mix/fun/inv_sqrt_test.cpp index d7a90961f80..7249b326d11 100644 --- a/test/unit/math/mix/fun/inv_sqrt_test.cpp +++ b/test/unit/math/mix/fun/inv_sqrt_test.cpp @@ -1,13 +1,14 @@ #include +#include -TEST(mathMixMatFun, invSqrt) { +TEST_F(mathMix, invSqrt) { auto f = [](const auto& x1) { return stan::math::inv_sqrt(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -2.6, -2, -1.2, -0.2, 0.5, 1, 1.3, 1.5, 3, 10.2); } -TEST(mathMixMatFun, invsqrt_varmat) { +TEST_F(mathMix, invsqrt_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/inv_square_test.cpp b/test/unit/math/mix/fun/inv_square_test.cpp index c86ad25dfd7..263f67d219d 100644 --- a/test/unit/math/mix/fun/inv_square_test.cpp +++ b/test/unit/math/mix/fun/inv_square_test.cpp @@ -1,12 +1,13 @@ #include +#include -TEST(mathMixMatFun, invSquare) { +TEST_F(mathMix, invSquare) { auto f = [](const auto& x1) { return stan::math::inv_square(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -2.6, -2, -0.2, 1, 1.3, 3); } -TEST(mathMixMatFun, invsquare_varmat) { +TEST_F(mathMix, invsquare_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/inv_test.cpp b/test/unit/math/mix/fun/inv_test.cpp index 65ba8443b8d..56f1f8e89ab 100644 --- a/test/unit/math/mix/fun/inv_test.cpp +++ b/test/unit/math/mix/fun/inv_test.cpp @@ -1,12 +1,13 @@ #include +#include -TEST(mathMixMatFun, inv) { +TEST_F(mathMix, inv) { auto f = [](const auto& x1) { return stan::math::inv(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -2.6, -2, -0.2, 1.3, 3); } -TEST(mathMixMatFun, inv_varmat) { +TEST_F(mathMix, inv_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/inverse_spd_test.cpp b/test/unit/math/mix/fun/inverse_spd_test.cpp index 08ae1485b6f..db5b2096474 100644 --- a/test/unit/math/mix/fun/inverse_spd_test.cpp +++ b/test/unit/math/mix/fun/inverse_spd_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, inverseSpd) { +TEST_F(mathMix, inverseSpd) { auto f = [](const auto& x) { if (x.rows() != x.cols()) return stan::math::inverse_spd(x); diff --git a/test/unit/math/mix/fun/inverse_test.cpp b/test/unit/math/mix/fun/inverse_test.cpp index 77ce5bac0a5..5fe3fc5d926 100644 --- a/test/unit/math/mix/fun/inverse_test.cpp +++ b/test/unit/math/mix/fun/inverse_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixMatFun, inverse) { +TEST_F(mathMix, inverse) { auto f = [](const auto& x) { return stan::math::inverse(x); }; Eigen::MatrixXd t(0, 0); diff --git a/test/unit/math/mix/fun/is_any_nan_test.cpp b/test/unit/math/mix/fun/is_any_nan_test.cpp index f911d668a66..cbfeb1f61d8 100644 --- a/test/unit/math/mix/fun/is_any_nan_test.cpp +++ b/test/unit/math/mix/fun/is_any_nan_test.cpp @@ -3,7 +3,7 @@ #include #include -TEST(AgradMixIsAnyNan, Fvar) { +TEST_F(mathMix, is_any_nan_Fvar) { using stan::math::fvar; using stan::math::is_any_nan; using stan::math::var; @@ -28,7 +28,7 @@ TEST(AgradMixIsAnyNan, Fvar) { EXPECT_FALSE(is_any_nan(fv_dbl, fv_inf, 6, min)); } -TEST(AgradMixIsAnyNan, FvarFvar) { +TEST_F(mathMix, is_any_nan_FvarFvar) { using stan::math::fvar; using stan::math::is_any_nan; using stan::math::var; diff --git a/test/unit/math/mix/fun/isfinite_test.cpp b/test/unit/math/mix/fun/isfinite_test.cpp index ef1f8dc8bd4..a2375bd0e5c 100644 --- a/test/unit/math/mix/fun/isfinite_test.cpp +++ b/test/unit/math/mix/fun/isfinite_test.cpp @@ -20,7 +20,7 @@ void expect_isfinite() { EXPECT_TRUE(isfinite(T(-1.0))); } -TEST(mixFun, isfinite) { +TEST_F(mathMix, isfinite) { using stan::math::fvar; using stan::math::var; expect_isfinite(); diff --git a/test/unit/math/mix/fun/isinf_test.cpp b/test/unit/math/mix/fun/isinf_test.cpp index 86d9f5a4d55..d2b6fa81c3e 100644 --- a/test/unit/math/mix/fun/isinf_test.cpp +++ b/test/unit/math/mix/fun/isinf_test.cpp @@ -1,4 +1,5 @@ #include +#include #include template @@ -20,7 +21,7 @@ void expect_isinf() { EXPECT_FALSE(isinf(T(-1.0))); } -TEST(mixFun, isinf) { +TEST_F(mathMix, isinf) { expect_isinf(); expect_isinf(); expect_isinf(); diff --git a/test/unit/math/mix/fun/isnan_test.cpp b/test/unit/math/mix/fun/isnan_test.cpp index 6470dce1a3c..2347bdf1b4e 100644 --- a/test/unit/math/mix/fun/isnan_test.cpp +++ b/test/unit/math/mix/fun/isnan_test.cpp @@ -1,4 +1,5 @@ #include +#include #include template @@ -20,7 +21,7 @@ void expect_isnan() { EXPECT_FALSE(isnan(T(-1.0))); } -TEST(mixFun, isnan) { +TEST_F(mathMix, isnan) { expect_isnan(); expect_isnan(); expect_isnan(); diff --git a/test/unit/math/mix/fun/isnormal_test.cpp b/test/unit/math/mix/fun/isnormal_test.cpp index e345e45042a..cacf7d537f3 100644 --- a/test/unit/math/mix/fun/isnormal_test.cpp +++ b/test/unit/math/mix/fun/isnormal_test.cpp @@ -20,7 +20,7 @@ void expect_isnormal() { EXPECT_TRUE(isnormal(T(-1.0))); } -TEST(mixFun, isnormal) { +TEST_F(mathMix, isnormal) { using stan::math::fvar; using stan::math::var; expect_isnormal(); diff --git a/test/unit/math/mix/fun/lambertw_test.cpp b/test/unit/math/mix/fun/lambertw_test.cpp index 7b5b4213e56..f7e1cf46dbb 100644 --- a/test/unit/math/mix/fun/lambertw_test.cpp +++ b/test/unit/math/mix/fun/lambertw_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(mathMixMatFun, lambert_w0) { +TEST_F(mathMix, lambert_w0) { auto f = [](const auto& x1) { using stan::math::lambert_w0; return lambert_w0(x1); @@ -15,7 +16,7 @@ TEST(mathMixMatFun, lambert_w0) { stan::math::recover_memory(); } -TEST(mathMixMatFun, lambert_w0_varmat) { +TEST_F(mathMix, lambert_w0_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; @@ -33,7 +34,7 @@ TEST(mathMixMatFun, lambert_w0_varmat) { expect_ad_vector_matvar(f, A); } -TEST(mathMixMatFun, lambert_wm1) { +TEST_F(mathMix, lambert_wm1) { auto f = [](const auto& x1) { using stan::math::lambert_wm1; return lambert_wm1(x1); @@ -47,7 +48,7 @@ TEST(mathMixMatFun, lambert_wm1) { stan::math::recover_memory(); } -TEST(mathMixMatFun, lambert_wm1_varmat) { +TEST_F(mathMix, lambert_wm1_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/lb_constrain_matvar_test.cpp b/test/unit/math/mix/fun/lb_constrain_matvar_test.cpp index 61ba6939963..158db6964ec 100644 --- a/test/unit/math/mix/fun/lb_constrain_matvar_test.cpp +++ b/test/unit/math/mix/fun/lb_constrain_matvar_test.cpp @@ -1,4 +1,5 @@ #include +#include #include namespace lb_constrain_test { @@ -60,7 +61,7 @@ void expect_vec_matvar(const T1& x, const T2& lb) { } } // namespace lb_constrain_test -TEST(mathMixMatFun, lb_matvar_constrain) { +TEST_F(mathMix, lb_matvar_constrain) { using stan::scalar_type_t; using stan::math::lb_constrain; using stan::math::promote_scalar_t; @@ -76,7 +77,7 @@ TEST(mathMixMatFun, lb_matvar_constrain) { lb_constrain_test::expect_matvar(A, lbd); } -TEST(mathMixMatFun, lb_matvar_constrain_neg_inf) { +TEST_F(mathMix, lb_matvar_constrain_neg_inf) { Eigen::MatrixXd A(2, 2); A << 5.0, 2.0, 4.0, -2.0; Eigen::MatrixXd lbm(2, 2); @@ -87,7 +88,7 @@ TEST(mathMixMatFun, lb_matvar_constrain_neg_inf) { // matrix[], matrix // matrix[], real -TEST(mathMixMatFun, lb_stdvec_mat_mat_constrain_matvar) { +TEST_F(mathMix, lb_stdvec_mat_mat_constrain_matvar) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.0, 0.005; Eigen::MatrixXd lbm_inner(2, 3); @@ -104,7 +105,7 @@ TEST(mathMixMatFun, lb_stdvec_mat_mat_constrain_matvar) { lb_constrain_test::expect_vec_matvar(A, lbd); } -TEST(mathMixMatFun, lb_stdvec_mat_mat_constrain_matvar_neg_inf) { +TEST_F(mathMix, lb_stdvec_mat_mat_constrain_matvar_neg_inf) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.0, 0.005; Eigen::MatrixXd lbm_inner(2, 3); @@ -119,7 +120,7 @@ TEST(mathMixMatFun, lb_stdvec_mat_mat_constrain_matvar_neg_inf) { } // matrix[], matrix[] -TEST(mathMixMatFun, lb_stdvec_mat_constrain_matvar) { +TEST_F(mathMix, lb_stdvec_mat_constrain_matvar) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.0, 0.005; Eigen::MatrixXd lbm_inner(2, 3); @@ -143,7 +144,7 @@ TEST(mathMixMatFun, lb_stdvec_mat_constrain_matvar) { lb_constrain_test::expect_vec_matvar(A, lbm_bad2); } -TEST(mathMixMatFun, lb_stdvec_mat_constrain_matvar_neg_inf) { +TEST_F(mathMix, lb_stdvec_mat_constrain_matvar_neg_inf) { Eigen::MatrixXd A_inner(2, 2); A_inner << 5.0, 2.0, 4.0, -2.0; Eigen::MatrixXd lbm_inner(2, 2); diff --git a/test/unit/math/mix/fun/lb_constrain_test.cpp b/test/unit/math/mix/fun/lb_constrain_test.cpp index 562418f69e6..efba1bedb41 100644 --- a/test/unit/math/mix/fun/lb_constrain_test.cpp +++ b/test/unit/math/mix/fun/lb_constrain_test.cpp @@ -1,4 +1,5 @@ #include +#include #include namespace lb_constrain_test { @@ -65,19 +66,19 @@ void expect_vec(const T1& x, const T2& lb) { } // namespace lb_constrain_test // real, real -TEST(mathMixScalFun, lbConstrain) { +TEST_F(mathMix, lbConstrain) { lb_constrain_test::expect(-1, 2); lb_constrain_test::expect(2, 4); } -TEST(mathMixScalFun, lbConstrain_neg_inf) { +TEST_F(mathMix, lbConstrain_neg_inf) { lb_constrain_test::expect(-1, stan::math::NEGATIVE_INFTY); lb_constrain_test::expect(2, stan::math::NEGATIVE_INFTY); } // matrix, matrix // matrix, real -TEST(mathMixMatFun, lb_mat_constrain) { +TEST_F(mathMix, lb_mat_constrain) { Eigen::MatrixXd A(2, 3); A << 5.0, 2.0, 4.0, -2.0, 0.0, 0.005; Eigen::MatrixXd lbm(2, 3); @@ -90,7 +91,7 @@ TEST(mathMixMatFun, lb_mat_constrain) { lb_constrain_test::expect(A, lbd); } -TEST(mathMixMatFun, lb_mat_constrain_neg_inf) { +TEST_F(mathMix, lb_mat_constrain_neg_inf) { Eigen::MatrixXd A(2, 3); A << 5.0, 2.0, 4.0, -2.0, 0.0, 0.005; Eigen::MatrixXd lbm(2, 3); @@ -101,7 +102,7 @@ TEST(mathMixMatFun, lb_mat_constrain_neg_inf) { // real[], real // real[], real[] -TEST(mathMixMatFun, lb_stdvec_constrain) { +TEST_F(mathMix, lb_stdvec_constrain) { std::vector A{5.0, 2.0, 4.0, -2.0}; std::vector lbm{7.0, 5.0, 6.0, 100.0}; std::vector lbm_bad{7.0, 5.0, 6.0}; @@ -111,7 +112,7 @@ TEST(mathMixMatFun, lb_stdvec_constrain) { lb_constrain_test::expect(A, lbd); } -TEST(mathMixMatFun, lb_stdvec_constrain_neg_inf) { +TEST_F(mathMix, lb_stdvec_constrain_neg_inf) { std::vector A{5.0, 2.0, 4.0, -2.0}; std::vector lbm{7.0, 5.0, stan::math::NEGATIVE_INFTY, 100.0}; lb_constrain_test::expect(A, lbm); @@ -120,7 +121,7 @@ TEST(mathMixMatFun, lb_stdvec_constrain_neg_inf) { // matrix[], matrix // matrix[], real -TEST(mathMixMatFun, lb_stdvec_mat_mat_constrain) { +TEST_F(mathMix, lb_stdvec_mat_mat_constrain) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.0, 0.005; Eigen::MatrixXd lbm_inner(2, 3); @@ -137,7 +138,7 @@ TEST(mathMixMatFun, lb_stdvec_mat_mat_constrain) { lb_constrain_test::expect_vec(A, lbd); } -TEST(mathMixMatFun, lb_stdvec_mat_mat_constrain_neg_inf) { +TEST_F(mathMix, lb_stdvec_mat_mat_constrain_neg_inf) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.0, 0.005; Eigen::MatrixXd lbm_inner(2, 3); @@ -152,7 +153,7 @@ TEST(mathMixMatFun, lb_stdvec_mat_mat_constrain_neg_inf) { } // matrix[], matrix[] -TEST(mathMixMatFun, lb_stdvec_mat_constrain) { +TEST_F(mathMix, lb_stdvec_mat_constrain) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.0, 0.005; Eigen::MatrixXd lbm_inner(2, 3); @@ -176,7 +177,7 @@ TEST(mathMixMatFun, lb_stdvec_mat_constrain) { lb_constrain_test::expect_vec(A, lbm_bad2); } -TEST(mathMixMatFun, lb_stdvec_mat_constrain_neg_inf) { +TEST_F(mathMix, lb_stdvec_mat_constrain_neg_inf) { Eigen::MatrixXd A_inner(2, 2); A_inner << 5.0, 2.0, 4.0, -2.0; Eigen::MatrixXd lbm_inner(2, 2); diff --git a/test/unit/math/mix/fun/lbeta_test.cpp b/test/unit/math/mix/fun/lbeta_test.cpp index 6d4a5b73a52..cdc3eebb533 100644 --- a/test/unit/math/mix/fun/lbeta_test.cpp +++ b/test/unit/math/mix/fun/lbeta_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixScalFun, lbeta) { +TEST_F(mathMix, lbeta) { auto f = [](const auto& x1, const auto& x2) { using stan::math::lbeta; return lbeta(x1, x2); @@ -17,7 +18,7 @@ TEST(mathMixScalFun, lbeta) { stan::test::expect_ad(f, 12.3, 4.8); } -TEST(mathMixScalFun, lbeta_vec) { +TEST_F(mathMix, lbeta_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::lbeta; return lbeta(x1, x2); diff --git a/test/unit/math/mix/fun/ldexp_test.cpp b/test/unit/math/mix/fun/ldexp_test.cpp index 9dde899903d..65969d1c195 100644 --- a/test/unit/math/mix/fun/ldexp_test.cpp +++ b/test/unit/math/mix/fun/ldexp_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixScalFun, ldexp) { +TEST_F(mathMix, ldexp) { auto f = [](const auto& x1) { return stan::math::ldexp(x1, 5); }; stan::test::expect_ad(f, 3.1); @@ -10,7 +11,7 @@ TEST(mathMixScalFun, ldexp) { stan::test::expect_ad(f, stan::math::NOT_A_NUMBER); } -TEST(mathMixScalFun, ldexp_vec) { +TEST_F(mathMix, ldexp_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::ldexp; return ldexp(x1, x2); diff --git a/test/unit/math/mix/fun/lgamma_test.cpp b/test/unit/math/mix/fun/lgamma_test.cpp index f5f42691a6e..fb32b1f670c 100644 --- a/test/unit/math/mix/fun/lgamma_test.cpp +++ b/test/unit/math/mix/fun/lgamma_test.cpp @@ -1,13 +1,14 @@ #include +#include -TEST(mathMixMatFun, lgamma) { +TEST_F(mathMix, lgamma) { auto f = [](const auto& x1) { return stan::math::lgamma(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -2.6, -2, -0.2, 1, 1.3, 3, 3.7, 10, 22); } -TEST(mathMixMatFun, lgamma_varmat) { +TEST_F(mathMix, lgamma_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/lmgamma_test.cpp b/test/unit/math/mix/fun/lmgamma_test.cpp index edbbab20a9a..880d2bfee23 100644 --- a/test/unit/math/mix/fun/lmgamma_test.cpp +++ b/test/unit/math/mix/fun/lmgamma_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, lmgamma) { +TEST_F(mathMix, lmgamma) { auto f = [](int x1) { return [=](const auto& x2) { return stan::math::hypot(x1, x2); }; }; @@ -9,7 +10,7 @@ TEST(mathMixScalFun, lmgamma) { stan::test::expect_ad(f(3), std::numeric_limits::quiet_NaN()); } -TEST(mathMixScalFun, lmgamma_vec) { +TEST_F(mathMix, lmgamma_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::lmgamma; return lmgamma(x1, x2); diff --git a/test/unit/math/mix/fun/lmultiply1_test.cpp b/test/unit/math/mix/fun/lmultiply1_test.cpp index 1f86441e551..3c9b9b80400 100644 --- a/test/unit/math/mix/fun/lmultiply1_test.cpp +++ b/test/unit/math/mix/fun/lmultiply1_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, lmultiply1) { +TEST_F(mathMix, lmultiply1) { auto f = [](const auto& x1, const auto& x2) { return stan::math::lmultiply(x1, x2); }; diff --git a/test/unit/math/mix/fun/lmultiply2_test.cpp b/test/unit/math/mix/fun/lmultiply2_test.cpp index 000f89d8c78..41bbe9bc8b0 100644 --- a/test/unit/math/mix/fun/lmultiply2_test.cpp +++ b/test/unit/math/mix/fun/lmultiply2_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, lmultiply2_vec) { +TEST_F(mathMix, lmultiply2_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::lmultiply; return lmultiply(x1, x2); diff --git a/test/unit/math/mix/fun/lmultiply3_test.cpp b/test/unit/math/mix/fun/lmultiply3_test.cpp index 9b48faf2a15..477ab2aa6cf 100644 --- a/test/unit/math/mix/fun/lmultiply3_test.cpp +++ b/test/unit/math/mix/fun/lmultiply3_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, lmultiply3_vec) { +TEST_F(mathMix, lmultiply3_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::lmultiply; return lmultiply(x1, x2); diff --git a/test/unit/math/mix/fun/lmultiply_test.cpp b/test/unit/math/mix/fun/lmultiply_test.cpp index 562a6b5739f..a9ff6bc3da1 100644 --- a/test/unit/math/mix/fun/lmultiply_test.cpp +++ b/test/unit/math/mix/fun/lmultiply_test.cpp @@ -1,9 +1,10 @@ #include +#include #include #include #include -TEST(mathMixScalFun, lmultiply) { +TEST_F(mathMix, lmultiply) { auto f = [](const auto& x1, const auto& x2) { return stan::math::lmultiply(x1, x2); }; diff --git a/test/unit/math/mix/fun/log10_test.cpp b/test/unit/math/mix/fun/log10_test.cpp index 6b33ea92f4d..63927dfdee9 100644 --- a/test/unit/math/mix/fun/log10_test.cpp +++ b/test/unit/math/mix/fun/log10_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixMatFun, log10) { +TEST_F(mathMix, log10) { auto f = [](const auto& x1) { using stan::math::log10; return log10(x1); @@ -26,7 +27,7 @@ TEST(mathMixMatFun, log10) { // (negative real and zero imaginary illegal) } -TEST(mathMixMatFun, log10_varmat) { +TEST_F(mathMix, log10_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/log1m_exp_test.cpp b/test/unit/math/mix/fun/log1m_exp_test.cpp index ee8ed0b798e..6a58eb3ab46 100644 --- a/test/unit/math/mix/fun/log1m_exp_test.cpp +++ b/test/unit/math/mix/fun/log1m_exp_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, log1m_exp) { +TEST_F(mathMix, log1m_exp) { auto f = [](const auto& x1) { return stan::math::log1m_exp(x1); }; stan::test::expect_common_nonzero_unary_vectorized< stan::test::ScalarSupport::Real>(f); @@ -8,7 +9,7 @@ TEST(mathMixMatFun, log1m_exp) { 3); } -TEST(mathMixMatFun, log1m_exp_varmat) { +TEST_F(mathMix, log1m_exp_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/log1m_inv_logit_test.cpp b/test/unit/math/mix/fun/log1m_inv_logit_test.cpp index 175ead491ac..898adeb0de2 100644 --- a/test/unit/math/mix/fun/log1m_inv_logit_test.cpp +++ b/test/unit/math/mix/fun/log1m_inv_logit_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, log1mInvLogit) { +TEST_F(mathMix, log1mInvLogit) { auto f = [](const auto& x1) { return stan::math::log1m_inv_logit(x1); }; stan::test::expect_common_nonzero_unary_vectorized< stan::test::ScalarSupport::Real>(f); @@ -8,7 +9,7 @@ TEST(mathMixMatFun, log1mInvLogit) { 3, 5); } -TEST(mathMixMatFun, log1minvlogit_varmat) { +TEST_F(mathMix, log1minvlogit_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/log1m_test.cpp b/test/unit/math/mix/fun/log1m_test.cpp index 288cb52c6e0..cf2552cd143 100644 --- a/test/unit/math/mix/fun/log1m_test.cpp +++ b/test/unit/math/mix/fun/log1m_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, log1m) { +TEST_F(mathMix, log1m) { auto f = [](const auto& x1) { return stan::math::log1m(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -21.5, -21, -1, 0.9, 3); diff --git a/test/unit/math/mix/fun/log1p_exp_test.cpp b/test/unit/math/mix/fun/log1p_exp_test.cpp index 9641c036c0e..0c5df82d7cd 100644 --- a/test/unit/math/mix/fun/log1p_exp_test.cpp +++ b/test/unit/math/mix/fun/log1p_exp_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, log1pExp) { +TEST_F(mathMix, log1pExp) { auto f = [](const auto& x1) { return stan::math::log1p_exp(x1); }; stan::test::expect_common_nonzero_unary_vectorized< stan::test::ScalarSupport::Real>(f); diff --git a/test/unit/math/mix/fun/log1p_test.cpp b/test/unit/math/mix/fun/log1p_test.cpp index 7893731846c..4cf9cbf8e3a 100644 --- a/test/unit/math/mix/fun/log1p_test.cpp +++ b/test/unit/math/mix/fun/log1p_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, log1p) { +TEST_F(mathMix, log1p) { auto f = [](const auto& x1) { return stan::math::log1p(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -2, -.99, -0.5, 0.5, 7.2, 1000); diff --git a/test/unit/math/mix/fun/log2_test.cpp b/test/unit/math/mix/fun/log2_test.cpp index e57f2f3c603..c41d6274fbd 100644 --- a/test/unit/math/mix/fun/log2_test.cpp +++ b/test/unit/math/mix/fun/log2_test.cpp @@ -1,13 +1,14 @@ #include +#include -TEST(mathMixMatFun, log2) { +TEST_F(mathMix, log2) { auto f = [](const auto& x1) { return stan::math::log2(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -0.2, 1e-3, 1, 1.3, 3, 3.7, 10, 10.2, 1e6); } -TEST(mathMixMatFun, log2_varmat) { +TEST_F(mathMix, log2_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/log_determinant_ldlt_test.cpp b/test/unit/math/mix/fun/log_determinant_ldlt_test.cpp index 235e6fa8b06..ccd7edcf479 100644 --- a/test/unit/math/mix/fun/log_determinant_ldlt_test.cpp +++ b/test/unit/math/mix/fun/log_determinant_ldlt_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, logDeterminantLdlt) { +TEST_F(mathMix, logDeterminantLdlt) { auto f = [](const auto& x) { auto&& x_ref = stan::math::to_ref(x); auto x_sym = stan::math::multiply(0.5, x_ref + x_ref.transpose()); diff --git a/test/unit/math/mix/fun/log_determinant_spd_test.cpp b/test/unit/math/mix/fun/log_determinant_spd_test.cpp index 7fd1421a569..5a4341c983e 100644 --- a/test/unit/math/mix/fun/log_determinant_spd_test.cpp +++ b/test/unit/math/mix/fun/log_determinant_spd_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, logDeterminantSpd) { +TEST_F(mathMix, logDeterminantSpd) { auto f = [](const auto& x) { auto&& x_ref = stan::math::to_ref(x); auto z = stan::math::multiply(x_ref + x_ref.transpose(), 0.5); diff --git a/test/unit/math/mix/fun/log_determinant_test.cpp b/test/unit/math/mix/fun/log_determinant_test.cpp index 58c783c470a..28503c77a8a 100644 --- a/test/unit/math/mix/fun/log_determinant_test.cpp +++ b/test/unit/math/mix/fun/log_determinant_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, logDeterminant) { +TEST_F(mathMix, logDeterminant) { auto f = [](const auto& x) { return stan::math::log_determinant(x); }; Eigen::MatrixXd m00(0, 0); diff --git a/test/unit/math/mix/fun/log_diff_exp_test.cpp b/test/unit/math/mix/fun/log_diff_exp_test.cpp index 450a2a99973..4f19a64b0d1 100644 --- a/test/unit/math/mix/fun/log_diff_exp_test.cpp +++ b/test/unit/math/mix/fun/log_diff_exp_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, logDiffExp) { +TEST_F(mathMix, logDiffExp) { auto f = [](const auto& x1, const auto& x2) { return stan::math::log_diff_exp(x1, x2); }; @@ -28,7 +29,7 @@ TEST(mathMixScalFun, logDiffExp) { stan::test::expect_ad(f, nan, nan); } -TEST(mathMixScalFun, logDiffExp_vec) { +TEST_F(mathMix, logDiffExp_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::log_diff_exp; return log_diff_exp(x1, x2); diff --git a/test/unit/math/mix/fun/log_falling_factorial_test.cpp b/test/unit/math/mix/fun/log_falling_factorial_test.cpp index 4c94c8cc663..35e133823d1 100644 --- a/test/unit/math/mix/fun/log_falling_factorial_test.cpp +++ b/test/unit/math/mix/fun/log_falling_factorial_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, logFallingFactorial) { +TEST_F(mathMix, logFallingFactorial) { auto f = [](const auto& x1, const auto& x2) { return stan::math::log_falling_factorial(x1, x2); }; @@ -27,7 +28,7 @@ TEST(mathMixScalFun, logFallingFactorial) { stan::test::expect_ad(f, nan, nan); } -TEST(mathMixScalFun, logFallingFactorial_vec) { +TEST_F(mathMix, logFallingFactorial_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::log_falling_factorial; return log_falling_factorial(x1, x2); diff --git a/test/unit/math/mix/fun/log_inv_logit_diff_test.cpp b/test/unit/math/mix/fun/log_inv_logit_diff_test.cpp index c5c4f31f474..3ea02dcecb5 100644 --- a/test/unit/math/mix/fun/log_inv_logit_diff_test.cpp +++ b/test/unit/math/mix/fun/log_inv_logit_diff_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, logInvLogitDiff) { +TEST_F(mathMix, logInvLogitDiff) { auto f = [](const auto& x1, const auto& x2) { return stan::math::log_inv_logit_diff(x1, x2); }; @@ -16,7 +17,7 @@ TEST(mathMixScalFun, logInvLogitDiff) { stan::test::expect_ad(f, nan, nan); } -TEST(mathMixScalFun, logInvLogitDiff_vec) { +TEST_F(mathMix, logInvLogitDiff_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::log_inv_logit_diff; return log_inv_logit_diff(x1, x2); diff --git a/test/unit/math/mix/fun/log_inv_logit_test.cpp b/test/unit/math/mix/fun/log_inv_logit_test.cpp index f94478e21c9..ae4c72882b2 100644 --- a/test/unit/math/mix/fun/log_inv_logit_test.cpp +++ b/test/unit/math/mix/fun/log_inv_logit_test.cpp @@ -1,12 +1,13 @@ #include +#include -TEST(mathMixMatFun, logInvLogit) { +TEST_F(mathMix, logInvLogit) { auto f = [](const auto& x1) { return stan::math::log_inv_logit(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -1.0, -0.5, 0.5, 1.3, 5); } -TEST(mathMixMatFun, logInvLogitVarMat) { +TEST_F(mathMix, logInvLogitVarMat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_nonzero_args; diff --git a/test/unit/math/mix/fun/log_mix_part1_test.cpp b/test/unit/math/mix/fun/log_mix_part1_test.cpp index e7cee02a9f6..c99337831e4 100644 --- a/test/unit/math/mix/fun/log_mix_part1_test.cpp +++ b/test/unit/math/mix/fun/log_mix_part1_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(mathMixScalFun, logMix) { +TEST_F(mathMix, log_mix) { auto f = [](const auto& x1, const auto& x2, const auto& x3) { return stan::math::log_mix(x1, x2, x3); }; diff --git a/test/unit/math/mix/fun/log_mix_part2_test.cpp b/test/unit/math/mix/fun/log_mix_part2_test.cpp index ac6643dc1d7..5541988a400 100644 --- a/test/unit/math/mix/fun/log_mix_part2_test.cpp +++ b/test/unit/math/mix/fun/log_mix_part2_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -66,7 +67,7 @@ void expect_log_mix(const std::vector& p, stan::test::expect_ad(tols, f, p_rv, ds_rv); } -TEST(mathMixMatFun, logMix) { +TEST_F(mathMix, logMix) { std::vector u1{0.999}; // using 1 overflows with finite diffs std::vector v1{-1.3}; expect_log_mix(u1, v1); diff --git a/test/unit/math/mix/fun/log_modified_bessel_first_kind_test.cpp b/test/unit/math/mix/fun/log_modified_bessel_first_kind_test.cpp index 92da019dd43..d1152b72ace 100644 --- a/test/unit/math/mix/fun/log_modified_bessel_first_kind_test.cpp +++ b/test/unit/math/mix/fun/log_modified_bessel_first_kind_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, logModifiedBesselFirstKind) { +TEST_F(mathMix, logModifiedBesselFirstKind) { auto f = [](const auto& x1, const auto& x2) { return stan::math::log_modified_bessel_first_kind(x1, x2); }; @@ -15,7 +16,7 @@ TEST(mathMixScalFun, logModifiedBesselFirstKind) { stan::test::expect_ad(f, x1, x2); } -TEST(mathMixScalFun, logModifiedBesselFirstKind_vec) { +TEST_F(mathMix, logModifiedBesselFirstKind_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::log_modified_bessel_first_kind; return log_modified_bessel_first_kind(x1, x2); diff --git a/test/unit/math/mix/fun/log_rising_factorial_test.cpp b/test/unit/math/mix/fun/log_rising_factorial_test.cpp index de05648d605..cff9ff22903 100644 --- a/test/unit/math/mix/fun/log_rising_factorial_test.cpp +++ b/test/unit/math/mix/fun/log_rising_factorial_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, logRisingFactorial) { +TEST_F(mathMix, logRisingFactorial) { auto f = [](const auto& x1, const auto& x2) { return stan::math::log_rising_factorial(x1, x2); }; @@ -26,7 +27,7 @@ TEST(mathMixScalFun, logRisingFactorial) { stan::test::expect_ad(f, nan, nan); } -TEST(mathMixScalFun, logRisingFactorial_vec) { +TEST_F(mathMix, logRisingFactorial_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::log_rising_factorial; return log_rising_factorial(x1, x2); diff --git a/test/unit/math/mix/fun/log_softmax_test.cpp b/test/unit/math/mix/fun/log_softmax_test.cpp index 5d8915fea10..3851fea4891 100644 --- a/test/unit/math/mix/fun/log_softmax_test.cpp +++ b/test/unit/math/mix/fun/log_softmax_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, logSoftmax) { +TEST_F(mathMix, logSoftmax) { auto f = [](const auto& x) { return stan::math::log_softmax(x); }; // Column Vectors Eigen::VectorXd x0(0); // error case diff --git a/test/unit/math/mix/fun/log_sum_exp_signed_test.cpp b/test/unit/math/mix/fun/log_sum_exp_signed_test.cpp index efb4b2ea30e..1634076eb86 100644 --- a/test/unit/math/mix/fun/log_sum_exp_signed_test.cpp +++ b/test/unit/math/mix/fun/log_sum_exp_signed_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(mathMixScalFun, logSumExp_signed) { +TEST_F(mathMix, logSumExp_signed) { auto f = [](const int x1_sign, const int x2_sign) { return [=](const auto& x1, const auto& x2) { stan::return_type_t ret_val; diff --git a/test/unit/math/mix/fun/log_sum_exp_test.cpp b/test/unit/math/mix/fun/log_sum_exp_test.cpp index 05f1ed378ce..2f0d5a602e2 100644 --- a/test/unit/math/mix/fun/log_sum_exp_test.cpp +++ b/test/unit/math/mix/fun/log_sum_exp_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(mathMixScalFun, logSumExp) { +TEST_F(mathMix, log_sum_exp_scalar) { auto f = [](const auto& x1, const auto& x2) { return stan::math::log_sum_exp(x1, x2); }; @@ -40,7 +41,7 @@ TEST(mathMixScalFun, logSumExp) { stan::test::expect_value(f, 1000.0, 10.0); } -TEST(MathMixMatFun, logSumExp) { +TEST_F(mathMix, log_sum_exp_matrix) { auto f = [](const auto& x) { return stan::math::log_sum_exp(x); }; Eigen::VectorXd x0(0); @@ -97,7 +98,7 @@ TEST(MathMixMatFun, logSumExp) { stan::test::expect_ad(tols, f, ststx); } -TEST(mathMixScalFun, logSumExp_vec) { +TEST_F(mathMix, logSumExp_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::log_sum_exp; return log_sum_exp(x1, x2); diff --git a/test/unit/math/mix/fun/log_test.cpp b/test/unit/math/mix/fun/log_test.cpp index f6b4e5b8871..67d4562e5f0 100644 --- a/test/unit/math/mix/fun/log_test.cpp +++ b/test/unit/math/mix/fun/log_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixMatFun, log) { +TEST_F(mathMix, log) { auto f = [](const auto& x1) { using stan::math::log; return log(x1); diff --git a/test/unit/math/mix/fun/logb_test.cpp b/test/unit/math/mix/fun/logb_test.cpp index 840ee6f3d47..a6dac24f502 100644 --- a/test/unit/math/mix/fun/logb_test.cpp +++ b/test/unit/math/mix/fun/logb_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -21,7 +22,7 @@ void expect_all_logb(double x) { expect_logb>>(x); } -TEST(mathMixMatFun, logb) { +TEST_F(mathMix, logb) { double inf = std::numeric_limits::infinity(); double nan = std::numeric_limits::quiet_NaN(); for (double x : std::vector{-inf, -2.3, 0, 1, 2, 3.9, inf, nan}) { diff --git a/test/unit/math/mix/fun/logit_test.cpp b/test/unit/math/mix/fun/logit_test.cpp index a43bb4978ca..90833fb3634 100644 --- a/test/unit/math/mix/fun/logit_test.cpp +++ b/test/unit/math/mix/fun/logit_test.cpp @@ -1,12 +1,13 @@ #include +#include -TEST(mathMixMatFun, logit) { +TEST_F(mathMix, logit) { auto f = [](const auto& x1) { return stan::math::logit(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -1.2, -0.5, 0.01, 0.5, 0.99, 1.5); } -TEST(mathMixMatFun, logit_varmat) { +TEST_F(mathMix, logit_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/fun/lub_constrain_1_test.cpp b/test/unit/math/mix/fun/lub_constrain_1_test.cpp index 04c7466dd87..4cd4d3c4165 100644 --- a/test/unit/math/mix/fun/lub_constrain_1_test.cpp +++ b/test/unit/math/mix/fun/lub_constrain_1_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixMatFun, lub_constrain_scalars) { +TEST_F(mathMix, lub_constrain_scalars) { double x1 = 0.7; double x2 = -38.1; double lb = -2.0; diff --git a/test/unit/math/mix/fun/lub_constrain_2_test.cpp b/test/unit/math/mix/fun/lub_constrain_2_test.cpp index 16368c0048e..0c9725d40ff 100644 --- a/test/unit/math/mix/fun/lub_constrain_2_test.cpp +++ b/test/unit/math/mix/fun/lub_constrain_2_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixMatFun, lub_constrain_vector_scalar_scalar) { +TEST_F(mathMix, lub_constrain_vector_scalar_scalar) { Eigen::MatrixXd x1(1, 1); x1 << 0.7; Eigen::MatrixXd x2(1, 1); @@ -26,7 +27,7 @@ TEST(mathMixMatFun, lub_constrain_vector_scalar_scalar) { lub_constrain_tests::expect(x2, lb_inf, ub_inf); } -TEST(mathMixMatFun, lub_constrain_vector_vector_scalar) { +TEST_F(mathMix, lub_constrain_vector_vector_scalar) { Eigen::MatrixXd x1(2, 2); x1 << 5.0, 2.0, 4.0, 5.0; Eigen::MatrixXd x2(2, 2); diff --git a/test/unit/math/mix/fun/lub_constrain_3_test.cpp b/test/unit/math/mix/fun/lub_constrain_3_test.cpp index e2fca238fde..79967555a43 100644 --- a/test/unit/math/mix/fun/lub_constrain_3_test.cpp +++ b/test/unit/math/mix/fun/lub_constrain_3_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixMatFun, lub_constrain_vector_scalar_vector) { +TEST_F(mathMix, lub_constrain_vector_scalar_vector) { Eigen::MatrixXd x1(2, 2); x1 << 5.0, 2.0, 4.0, 5.0; Eigen::MatrixXd x2(2, 2); @@ -30,7 +31,7 @@ TEST(mathMixMatFun, lub_constrain_vector_scalar_vector) { lub_constrain_tests::expect(x2, lb_inf, ub); } -TEST(mathMixMatFun, lub_constrain_vector_vector_vector) { +TEST_F(mathMix, lub_constrain_vector_vector_vector) { Eigen::MatrixXd x1(2, 2); x1 << 5.0, 2.0, 4.0, 5.0; Eigen::MatrixXd x2(2, 2); diff --git a/test/unit/math/mix/fun/lub_constrain_4_test.cpp b/test/unit/math/mix/fun/lub_constrain_4_test.cpp index 077e6bfda98..a56dadad154 100644 --- a/test/unit/math/mix/fun/lub_constrain_4_test.cpp +++ b/test/unit/math/mix/fun/lub_constrain_4_test.cpp @@ -1,10 +1,11 @@ #include +#include #include // real[], real[], real[] // real[], real, real[] // real[], real[], real -TEST(mathMixMatFun, lub_stdvec_constrain) { +TEST_F(mathMix, lub_stdvec_constrain) { std::vector A{5.0, 2.0, 4.0, -2.0}; std::vector lbm{-3.0, 3.0, -6.0, 6.0}; std::vector ubm{-1.0, 5.0, 0.0, 38.0}; @@ -16,7 +17,7 @@ TEST(mathMixMatFun, lub_stdvec_constrain) { lub_constrain_tests::expect_vec(A, lbm, ubd); } -TEST(mathMixMatFun, lub_stdvec_constrain_neg_inf) { +TEST_F(mathMix, lub_stdvec_constrain_neg_inf) { std::vector A{5.0, 2.0, 4.0, -2.0}; std::vector lbm{stan::math::NEGATIVE_INFTY, 3.0, stan::math::NEGATIVE_INFTY, 6.0}; diff --git a/test/unit/math/mix/fun/lub_constrain_5_test.cpp b/test/unit/math/mix/fun/lub_constrain_5_test.cpp index b1934ddbf04..63ca19ba1b9 100644 --- a/test/unit/math/mix/fun/lub_constrain_5_test.cpp +++ b/test/unit/math/mix/fun/lub_constrain_5_test.cpp @@ -1,4 +1,5 @@ #include +#include #include // array matrix[], array matrix[], array matrix[] @@ -10,7 +11,7 @@ // array matrix[], matrix[], real // array matrix[], real, matrix[] // array matrix[], real, real -TEST(mathMixMatFun, lub_stdvec_mat_scalar_constrain) { +TEST_F(mathMix, lub_stdvec_mat_scalar_constrain) { Eigen::MatrixXd A_inner(2, 3); // swapping 0.0000001 for 0 causes a failure for the hessian? A_inner << 5.0, 2.0, 4.0, -2.0, 0.0000001, 0.1; @@ -29,7 +30,7 @@ TEST(mathMixMatFun, lub_stdvec_mat_scalar_constrain) { lub_constrain_tests::expect_vec(A, lb_scal, ub_scal); } -TEST(mathMixMatFun, lub_stdvec_mat_scalar_constrain_infty) { +TEST_F(mathMix, lub_stdvec_mat_scalar_constrain_infty) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.05, 0.1; Eigen::MatrixXd lb_inner(2, 3); diff --git a/test/unit/math/mix/fun/lub_constrain_6_test.cpp b/test/unit/math/mix/fun/lub_constrain_6_test.cpp index 504bb67095b..026882379f0 100644 --- a/test/unit/math/mix/fun/lub_constrain_6_test.cpp +++ b/test/unit/math/mix/fun/lub_constrain_6_test.cpp @@ -1,4 +1,5 @@ #include +#include #include // array matrix[], array matrix[], array matrix[] @@ -10,7 +11,7 @@ // array matrix[], matrix[], real // array matrix[], real, matrix[] // array matrix[], real, real -TEST(mathMixMatFun, lub_stdvec_lb_mat_ub_vec_constrain) { +TEST_F(mathMix, lub_stdvec_lb_mat_ub_vec_constrain) { Eigen::MatrixXd A_inner(2, 3); // swapping 0.0000001 for 0 causes a failure for the hessian? A_inner << 5.0, 2.0, 4.0, -2.0, 0.0000001, 0.1; @@ -26,7 +27,7 @@ TEST(mathMixMatFun, lub_stdvec_lb_mat_ub_vec_constrain) { lub_constrain_tests::expect_vec(A, lb_inner, ub_inner); } -TEST(mathMixMatFun, lub_stdvec_lb_mat_ub_vec_constrain_infty) { +TEST_F(mathMix, lub_stdvec_lb_mat_ub_vec_constrain_infty) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.05, 0.1; Eigen::MatrixXd lb_inner(2, 3); diff --git a/test/unit/math/mix/fun/lub_constrain_7_test.cpp b/test/unit/math/mix/fun/lub_constrain_7_test.cpp index 8c097445b3d..955b44de28c 100644 --- a/test/unit/math/mix/fun/lub_constrain_7_test.cpp +++ b/test/unit/math/mix/fun/lub_constrain_7_test.cpp @@ -1,4 +1,5 @@ #include +#include #include // array matrix[], array matrix[], array matrix[] @@ -10,7 +11,7 @@ // array matrix[], matrix[], real // array matrix[], real, matrix[] // array matrix[], real, real -TEST(mathMixMatFun, lub_stdvec_lb_vec_ub_mat_constrain) { +TEST_F(mathMix, lub_stdvec_lb_vec_ub_mat_constrain) { Eigen::MatrixXd A_inner(2, 3); // swapping 0.0000001 for 0 causes a failure for the hessian? A_inner << 5.0, 2.0, 4.0, -2.0, 0.0000001, 0.1; @@ -26,7 +27,7 @@ TEST(mathMixMatFun, lub_stdvec_lb_vec_ub_mat_constrain) { lub_constrain_tests::expect_vec(A, lb_vec, ub_inner); } -TEST(mathMixMatFun, lub_stdvec_lb_vec_ub_mat_constrain_infty) { +TEST_F(mathMix, lub_stdvec_lb_vec_ub_mat_constrain_infty) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.05, 0.1; Eigen::MatrixXd lb_inner(2, 3); diff --git a/test/unit/math/mix/fun/lub_constrain_8_test.cpp b/test/unit/math/mix/fun/lub_constrain_8_test.cpp index 3e18bfa2602..7c6400d8ccf 100644 --- a/test/unit/math/mix/fun/lub_constrain_8_test.cpp +++ b/test/unit/math/mix/fun/lub_constrain_8_test.cpp @@ -1,4 +1,5 @@ #include +#include #include // array matrix[], array matrix[], array matrix[] @@ -10,7 +11,7 @@ // array matrix[], matrix[], real // array matrix[], real, matrix[] // array matrix[], real, real -TEST(mathMixMatFun, lub_stdvec_mat_scalar1_constrain) { +TEST_F(mathMix, lub_stdvec_mat_scalar1_constrain) { Eigen::MatrixXd A_inner(2, 3); // swapping 0.0000001 for 0 causes a failure for the hessian? A_inner << 5.0, 2.0, 4.0, -2.0, 0.0000001, 0.1; @@ -28,7 +29,7 @@ TEST(mathMixMatFun, lub_stdvec_mat_scalar1_constrain) { lub_constrain_tests::expect_vec(A, lb_scal, ub_vec); } -TEST(mathMixMatFun, lub_stdvec_mat_scalar1_constrain_infty) { +TEST_F(mathMix, lub_stdvec_mat_scalar1_constrain_infty) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.05, 0.1; Eigen::MatrixXd lb_inner(2, 3); diff --git a/test/unit/math/mix/fun/lub_constrain_matvar_test.cpp b/test/unit/math/mix/fun/lub_constrain_matvar_test.cpp index f202e4af27b..d7ce110e3ba 100644 --- a/test/unit/math/mix/fun/lub_constrain_matvar_test.cpp +++ b/test/unit/math/mix/fun/lub_constrain_matvar_test.cpp @@ -1,4 +1,5 @@ #include +#include namespace lub_constrain_tests { template @@ -29,7 +30,7 @@ void expect_matvar(const T1& x, const T2& lb, const T3& ub) { } } // namespace lub_constrain_tests -TEST(mathMixMatFun, lub_constrain_scalars_matvar) { +TEST_F(mathMix, lub_constrain_scalars_matvar) { double x1 = 0.7; double x2 = -38.1; double lb = -2.0; @@ -53,7 +54,7 @@ TEST(mathMixMatFun, lub_constrain_scalars_matvar) { lub_constrain_tests::expect_matvar(x2, lb_inf, ub_inf); } -TEST(mathMixMatFun, lub_constrain_vector_scalar_scalar_matvar) { +TEST_F(mathMix, lub_constrain_vector_scalar_scalar_matvar) { Eigen::MatrixXd x1(1, 1); x1 << 0.7; Eigen::MatrixXd x2(1, 1); @@ -80,7 +81,7 @@ TEST(mathMixMatFun, lub_constrain_vector_scalar_scalar_matvar) { lub_constrain_tests::expect_matvar(x2, lb_inf, ub_inf); } -TEST(mathMixMatFun, lub_constrain_vector_vector_scalar_matvar) { +TEST_F(mathMix, lub_constrain_vector_vector_scalar_matvar) { Eigen::MatrixXd x1(2, 2); x1 << 5.0, 2.0, 4.0, 5.0; Eigen::MatrixXd x2(2, 2); @@ -106,7 +107,7 @@ TEST(mathMixMatFun, lub_constrain_vector_vector_scalar_matvar) { lub_constrain_tests::expect_matvar(x2, lb, ub_inf); } -TEST(mathMixMatFun, lub_constrain_vector_scalar_vector_matvar) { +TEST_F(mathMix, lub_constrain_vector_scalar_vector_matvar) { Eigen::MatrixXd x1(2, 2); x1 << 5.0, 2.0, 4.0, 5.0; Eigen::MatrixXd x2(2, 2); @@ -135,7 +136,7 @@ TEST(mathMixMatFun, lub_constrain_vector_scalar_vector_matvar) { lub_constrain_tests::expect_matvar(x2, lb_inf, ub); } -TEST(mathMixMatFun, lub_constrain_vector_vector_vector_matvar) { +TEST_F(mathMix, lub_constrain_vector_vector_vector_matvar) { Eigen::MatrixXd x1(2, 2); x1 << 5.0, 2.0, 4.0, 5.0; Eigen::MatrixXd x2(2, 2); diff --git a/test/unit/math/mix/fun/matrix_exp_2x2_test.cpp b/test/unit/math/mix/fun/matrix_exp_2x2_test.cpp index fb11afc1122..7f59ae1645f 100644 --- a/test/unit/math/mix/fun/matrix_exp_2x2_test.cpp +++ b/test/unit/math/mix/fun/matrix_exp_2x2_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, matrixExp2x2) { +TEST_F(mathMix, matrixExp2x2) { auto f = [](const auto& x) { return stan::math::matrix_exp_2x2(x); }; // example from Moler & Van Loan, 2003 diff --git a/test/unit/math/mix/fun/matrix_exp_multiply_test.cpp b/test/unit/math/mix/fun/matrix_exp_multiply_test.cpp index 2babb51e35c..95c6ad9e25c 100644 --- a/test/unit/math/mix/fun/matrix_exp_multiply_test.cpp +++ b/test/unit/math/mix/fun/matrix_exp_multiply_test.cpp @@ -1,4 +1,5 @@ #include +#include auto f_idx(int i, int j) { return [=](const auto& x, const auto& y) { @@ -15,7 +16,7 @@ void expect_matrix_exp_multiply(int m, int n) { stan::test::expect_ad(f, a, b); } -TEST(MathMixMatFun, matrixExpMultiply) { +TEST_F(mathMix, matrixExpMultiply) { auto f = [](const auto& x, auto& y) { return stan::math::matrix_exp_multiply(x, y); }; diff --git a/test/unit/math/mix/fun/matrix_exp_pade_test.cpp b/test/unit/math/mix/fun/matrix_exp_pade_test.cpp index 5854823a638..8200c280c31 100644 --- a/test/unit/math/mix/fun/matrix_exp_pade_test.cpp +++ b/test/unit/math/mix/fun/matrix_exp_pade_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, matrixExpPade) { +TEST_F(mathMix, matrixExpPade) { using stan::test::relative_tolerance; auto f = [](const auto& x) { return stan::math::matrix_exp_pade(x); }; diff --git a/test/unit/math/mix/fun/matrix_exp_test.cpp b/test/unit/math/mix/fun/matrix_exp_test.cpp index 07eb2d8c723..043393cf557 100644 --- a/test/unit/math/mix/fun/matrix_exp_test.cpp +++ b/test/unit/math/mix/fun/matrix_exp_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, matrixExp) { +TEST_F(mathMix, matrixExp) { using stan::test::relative_tolerance; auto f = [](const auto& x) { return stan::math::matrix_exp(x); }; diff --git a/test/unit/math/mix/fun/matrix_power_test.cpp b/test/unit/math/mix/fun/matrix_power_test.cpp index 4a62d8f1dff..55c19b46dac 100644 --- a/test/unit/math/mix/fun/matrix_power_test.cpp +++ b/test/unit/math/mix/fun/matrix_power_test.cpp @@ -1,9 +1,10 @@ #include #include +#include #include #include -TEST(MathMatrixPower, ad_tests) { +TEST_F(mathMix, ad_tests) { using Eigen::MatrixXd; using stan::math::matrix_power; using stan::test::expect_ad; diff --git a/test/unit/math/mix/fun/max_test.cpp b/test/unit/math/mix/fun/max_test.cpp index f450e8be8b7..5997dbc270a 100644 --- a/test/unit/math/mix/fun/max_test.cpp +++ b/test/unit/math/mix/fun/max_test.cpp @@ -1,4 +1,5 @@ #include +#include #include template @@ -15,7 +16,7 @@ void expect_max(const T& m) { stan::test::expect_ad(f, m); } -TEST(MathMixMatFun, max) { +TEST_F(mathMix, max) { Eigen::MatrixXd a(0, 0); expect_max(a); diff --git a/test/unit/math/mix/fun/mdivide_left_ldlt_test.cpp b/test/unit/math/mix/fun/mdivide_left_ldlt_test.cpp index 091054b1eae..0b21f76905b 100644 --- a/test/unit/math/mix/fun/mdivide_left_ldlt_test.cpp +++ b/test/unit/math/mix/fun/mdivide_left_ldlt_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, mdivideLeftLdlt) { +TEST_F(mathMix, mdivideLeftLdlt) { auto f = [](const auto& x, const auto& y) { auto&& x_ref = stan::math::to_ref(x); auto x_sym = stan::math::multiply(0.5, x_ref + x_ref.transpose()); diff --git a/test/unit/math/mix/fun/mdivide_left_spd_test.cpp b/test/unit/math/mix/fun/mdivide_left_spd_test.cpp index 9015da05188..b3a9561e3fd 100644 --- a/test/unit/math/mix/fun/mdivide_left_spd_test.cpp +++ b/test/unit/math/mix/fun/mdivide_left_spd_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, mdivideLeftSpd) { +TEST_F(mathMix, mdivideLeftSpd) { auto f = [](const auto& x, const auto& y) { if (x.rows() != x.cols()) return stan::math::mdivide_left_spd(x, y); diff --git a/test/unit/math/mix/fun/mdivide_left_test.cpp b/test/unit/math/mix/fun/mdivide_left_test.cpp index 026e939bca4..ad0e5c6de29 100644 --- a/test/unit/math/mix/fun/mdivide_left_test.cpp +++ b/test/unit/math/mix/fun/mdivide_left_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, mdivideLeft) { +TEST_F(mathMix, mdivideLeft) { auto f = [](const auto& x, const auto& y) { return stan::math::mdivide_left(x, y); }; diff --git a/test/unit/math/mix/fun/mdivide_left_tri_low_test.cpp b/test/unit/math/mix/fun/mdivide_left_tri_low_test.cpp index 1b2f7ac754d..7d15271a5a8 100644 --- a/test/unit/math/mix/fun/mdivide_left_tri_low_test.cpp +++ b/test/unit/math/mix/fun/mdivide_left_tri_low_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, mdivideLeftTriLow) { +TEST_F(mathMix, mdivideLeftTriLow) { auto f = [](const auto& x, const auto& y) { // no need to symmetrize because only uses view return stan::math::mdivide_left_tri_low(x, y); diff --git a/test/unit/math/mix/fun/mdivide_left_tri_test.cpp b/test/unit/math/mix/fun/mdivide_left_tri_test.cpp index b27656a8d58..23e618bd9a4 100644 --- a/test/unit/math/mix/fun/mdivide_left_tri_test.cpp +++ b/test/unit/math/mix/fun/mdivide_left_tri_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, mdivideLeftTri) { +TEST_F(mathMix, mdivideLeftTri) { auto f = [](const auto& x, const auto& y) { return stan::math::mdivide_left_tri(x, y); }; diff --git a/test/unit/math/mix/fun/mdivide_right_ldlt_test.cpp b/test/unit/math/mix/fun/mdivide_right_ldlt_test.cpp index c377a8e51d6..d3e0d786759 100644 --- a/test/unit/math/mix/fun/mdivide_right_ldlt_test.cpp +++ b/test/unit/math/mix/fun/mdivide_right_ldlt_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, mdivideRightLdlt) { +TEST_F(mathMix, mdivideRightLdlt) { using stan::test::relative_tolerance; auto f = [](const auto& x, const auto& y) { auto&& y_ref = stan::math::to_ref(y); diff --git a/test/unit/math/mix/fun/mdivide_right_spd_test.cpp b/test/unit/math/mix/fun/mdivide_right_spd_test.cpp index 02c8e8d7536..2161a91ccc9 100644 --- a/test/unit/math/mix/fun/mdivide_right_spd_test.cpp +++ b/test/unit/math/mix/fun/mdivide_right_spd_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, mdivideRightSpd) { +TEST_F(mathMix, mdivideRightSpd) { auto f = [](const auto& x, const auto& y) { if (y.rows() != y.cols()) return stan::math::mdivide_right_spd(x, y); diff --git a/test/unit/math/mix/fun/mdivide_right_test.cpp b/test/unit/math/mix/fun/mdivide_right_test.cpp index 37af6ed4180..0cb493ea6e0 100644 --- a/test/unit/math/mix/fun/mdivide_right_test.cpp +++ b/test/unit/math/mix/fun/mdivide_right_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, mdivideRight) { +TEST_F(mathMix, mdivideRight) { auto f = [](const auto& x, const auto& y) { return stan::math::mdivide_right(x, y); }; diff --git a/test/unit/math/mix/fun/mdivide_right_tri_low_test.cpp b/test/unit/math/mix/fun/mdivide_right_tri_low_test.cpp index 4d9d727e4c4..b8c83df2c29 100644 --- a/test/unit/math/mix/fun/mdivide_right_tri_low_test.cpp +++ b/test/unit/math/mix/fun/mdivide_right_tri_low_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, mdivideRightTriLow) { +TEST_F(mathMix, mdivideRightTriLow) { auto f = [](const auto& x, const auto& y) { // no need to symmetrize because only uses view return stan::math::mdivide_right_tri_low(x, y); diff --git a/test/unit/math/mix/fun/mdivide_right_tri_test.cpp b/test/unit/math/mix/fun/mdivide_right_tri_test.cpp index c6eaffe7ec7..4f6ffb50f99 100644 --- a/test/unit/math/mix/fun/mdivide_right_tri_test.cpp +++ b/test/unit/math/mix/fun/mdivide_right_tri_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, mdivideRightTri) { +TEST_F(mathMix, mdivideRightTri) { auto f = [](const auto& x, const auto& y) { return stan::math::mdivide_right_tri(x, y); }; diff --git a/test/unit/math/mix/fun/mean_test.cpp b/test/unit/math/mix/fun/mean_test.cpp index a770fb1245a..6a39a91b375 100644 --- a/test/unit/math/mix/fun/mean_test.cpp +++ b/test/unit/math/mix/fun/mean_test.cpp @@ -1,4 +1,5 @@ #include +#include template void expect_mean(const T& m) { @@ -14,7 +15,7 @@ void expect_mean(const T& m) { stan::test::expect_ad(f, m); } -TEST(MathMixMatFun, mean) { +TEST_F(mathMix, mean) { Eigen::MatrixXd a(0, 0); expect_mean(a); diff --git a/test/unit/math/mix/fun/min_test.cpp b/test/unit/math/mix/fun/min_test.cpp index e7e024ea204..fd4765f42ab 100644 --- a/test/unit/math/mix/fun/min_test.cpp +++ b/test/unit/math/mix/fun/min_test.cpp @@ -1,4 +1,5 @@ #include +#include #include template @@ -15,7 +16,7 @@ void expect_min(const T& m) { stan::test::expect_ad(f, m); } -TEST(MathMixMatFun, min) { +TEST_F(mathMix, min) { Eigen::MatrixXd a(0, 0); expect_min(a); diff --git a/test/unit/math/mix/fun/minus_test.cpp b/test/unit/math/mix/fun/minus_test.cpp index 356ebb82068..bfceac01ecd 100644 --- a/test/unit/math/mix/fun/minus_test.cpp +++ b/test/unit/math/mix/fun/minus_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, minus) { +TEST_F(mathMix, minus) { auto f = [](const auto& x) { return stan::math::minus(x); }; double x = 10; diff --git a/test/unit/math/mix/fun/modified_bessel_first_kind_test.cpp b/test/unit/math/mix/fun/modified_bessel_first_kind_test.cpp index c04775ae733..b0fd29bdfe5 100644 --- a/test/unit/math/mix/fun/modified_bessel_first_kind_test.cpp +++ b/test/unit/math/mix/fun/modified_bessel_first_kind_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, modifiedBesselFirstKind) { +TEST_F(mathMix, modifiedBesselFirstKind) { // bind integer arg because can't autodiff through auto f = [](const int x1) { return [=](const auto& x2) { @@ -20,7 +21,7 @@ TEST(mathMixScalFun, modifiedBesselFirstKind) { stan::test::expect_ad(f(8), 3); } -TEST(mathMixScalFun, modifiedBesselFirstKind_vec) { +TEST_F(mathMix, modifiedBesselFirstKind_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::modified_bessel_first_kind; return modified_bessel_first_kind(x1, x2); diff --git a/test/unit/math/mix/fun/modified_bessel_second_kind_test.cpp b/test/unit/math/mix/fun/modified_bessel_second_kind_test.cpp index d92b6794d9c..d6f222b5ff6 100644 --- a/test/unit/math/mix/fun/modified_bessel_second_kind_test.cpp +++ b/test/unit/math/mix/fun/modified_bessel_second_kind_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, modifiedBesselSecondKind) { +TEST_F(mathMix, modifiedBesselSecondKind) { auto f = [](const int x1) { return [=](const auto& x2) { return stan::math::modified_bessel_second_kind(x1, x2); @@ -15,7 +16,7 @@ TEST(mathMixScalFun, modifiedBesselSecondKind) { stan::test::expect_ad(f(1), std::numeric_limits::quiet_NaN()); } -TEST(mathMixScalFun, modifiedBesselSecondKind_vec) { +TEST_F(mathMix, modifiedBesselSecondKind_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::modified_bessel_second_kind; return modified_bessel_second_kind(x1, x2); diff --git a/test/unit/math/mix/fun/multiply1_test.cpp b/test/unit/math/mix/fun/multiply1_test.cpp index 46cc5988319..0904ffa0d38 100644 --- a/test/unit/math/mix/fun/multiply1_test.cpp +++ b/test/unit/math/mix/fun/multiply1_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixMatFun, multiply) { +TEST_F(mathMix, multiply) { auto f = [](const auto& x, const auto& y) { return stan::math::multiply(x, y); }; @@ -128,7 +129,7 @@ TEST(mathMixMatFun, multiply) { // can't compile mismatched dimensions, so no tests } -TEST(mathMix, multiplicationPatterns1) { +TEST_F(mathMix, multiplicationPatterns1) { using stan::math::fvar; using stan::math::var; instantiate_multiply(); diff --git a/test/unit/math/mix/fun/multiply2_test.cpp b/test/unit/math/mix/fun/multiply2_test.cpp index 9c09a74ff76..9442f027ceb 100644 --- a/test/unit/math/mix/fun/multiply2_test.cpp +++ b/test/unit/math/mix/fun/multiply2_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMix, multiplicationPatterns2) { +TEST_F(mathMix, multiplicationPatterns2) { using stan::math::fvar; using stan::math::var; instantiate_multiply>>(); diff --git a/test/unit/math/mix/fun/multiply_complex_test.cpp b/test/unit/math/mix/fun/multiply_complex_test.cpp index f994dc8f664..d69d9eaeae8 100644 --- a/test/unit/math/mix/fun/multiply_complex_test.cpp +++ b/test/unit/math/mix/fun/multiply_complex_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMix, complexMultiply) { +TEST_F(mathMix, complexMultiply) { auto f = [](const auto& x, const auto& y) { return stan::math::multiply(x, y); }; double d_scalar = 1.0; diff --git a/test/unit/math/mix/fun/multiply_log1_test.cpp b/test/unit/math/mix/fun/multiply_log1_test.cpp index ba8e1336f01..a858346a581 100644 --- a/test/unit/math/mix/fun/multiply_log1_test.cpp +++ b/test/unit/math/mix/fun/multiply_log1_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, multiplyLog) { +TEST_F(mathMix, multiplyLog) { auto f = [](const auto& x1, const auto& x2) { return stan::math::multiply_log(x1, x2); }; diff --git a/test/unit/math/mix/fun/multiply_log2_test.cpp b/test/unit/math/mix/fun/multiply_log2_test.cpp index a124be21bdb..b498b4971f8 100644 --- a/test/unit/math/mix/fun/multiply_log2_test.cpp +++ b/test/unit/math/mix/fun/multiply_log2_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, multiplyLog2_vec) { +TEST_F(mathMix, multiplyLog2_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::multiply_log; return multiply_log(x1, x2); diff --git a/test/unit/math/mix/fun/multiply_log3_test.cpp b/test/unit/math/mix/fun/multiply_log3_test.cpp index 3e4f29b073f..d05ccf5467c 100644 --- a/test/unit/math/mix/fun/multiply_log3_test.cpp +++ b/test/unit/math/mix/fun/multiply_log3_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, multiplyLog3_vec) { +TEST_F(mathMix, multiplyLog3_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::multiply_log; return multiply_log(x1, x2); diff --git a/test/unit/math/mix/fun/multiply_lower_tri_self_transpose_test.cpp b/test/unit/math/mix/fun/multiply_lower_tri_self_transpose_test.cpp index e53fd697a16..99b3c6387e1 100644 --- a/test/unit/math/mix/fun/multiply_lower_tri_self_transpose_test.cpp +++ b/test/unit/math/mix/fun/multiply_lower_tri_self_transpose_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, multiplyLowerTriSelfTranspose) { +TEST_F(mathMix, multiplyLowerTriSelfTranspose) { auto f = [](const auto& x) { return stan::math::multiply_lower_tri_self_transpose(x); }; diff --git a/test/unit/math/mix/fun/multiply_util.hpp b/test/unit/math/mix/fun/multiply_util.hpp index cda507842c6..d039e11f00a 100644 --- a/test/unit/math/mix/fun/multiply_util.hpp +++ b/test/unit/math/mix/fun/multiply_util.hpp @@ -1,6 +1,7 @@ #ifndef TEST_UNIT_MATH_MIX_FUN_MULTIPLY_UTIL_HPP #define TEST_UNIT_MATH_MIX_FUN_MULTIPLY_UTIL_HPP #include +#include template void instantiate_multiply() { diff --git a/test/unit/math/mix/fun/norm1_test.cpp b/test/unit/math/mix/fun/norm1_test.cpp index 17e3c6cc6d0..d0957058c29 100644 --- a/test/unit/math/mix/fun/norm1_test.cpp +++ b/test/unit/math/mix/fun/norm1_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, norm1) { +TEST_F(mathMix, norm1) { auto f = [](const auto& y) { return stan::math::norm1(y); }; Eigen::VectorXd x0(0); diff --git a/test/unit/math/mix/fun/norm2_test.cpp b/test/unit/math/mix/fun/norm2_test.cpp index 43e515cd3fa..cae14e4884a 100644 --- a/test/unit/math/mix/fun/norm2_test.cpp +++ b/test/unit/math/mix/fun/norm2_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, norm2) { +TEST_F(mathMix, norm2) { auto f = [](const auto& y) { return stan::math::norm2(y); }; Eigen::VectorXd x0(0); diff --git a/test/unit/math/mix/fun/norm_test.cpp b/test/unit/math/mix/fun/norm_test.cpp index 9fec91afb6d..72766bbd2c3 100644 --- a/test/unit/math/mix/fun/norm_test.cpp +++ b/test/unit/math/mix/fun/norm_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(mixScalFun, norm) { +TEST_F(mathMix, norm) { auto f = [](const auto& x) { return norm(x); }; stan::test::expect_complex_common(f); } diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_1_matvar_test.cpp b/test/unit/math/mix/fun/offset_multiplier_constrain_1_matvar_test.cpp index c3e123c5de5..fcbec514001 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_1_matvar_test.cpp +++ b/test/unit/math/mix/fun/offset_multiplier_constrain_1_matvar_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixMatFun, offset_multiplier_constrain_matvar_scalars) { +TEST_F(mathMix, offset_multiplier_constrain_matvar_scalars) { double x1 = 0.7; double x2 = -38.1; double mu = -2.0; @@ -10,7 +11,7 @@ TEST(mathMixMatFun, offset_multiplier_constrain_matvar_scalars) { offset_multiplier_constrain_tests::expect_matvar(x2, mu, sigma); } -TEST(mathMixMatFun, offset_multiplier_constrain_matvar_vector_scalar_scalar) { +TEST_F(mathMix, offset_multiplier_constrain_matvar_vector_scalar_scalar) { Eigen::MatrixXd x1(1, 1); x1 << 0.7; Eigen::MatrixXd x2(1, 1); @@ -21,7 +22,7 @@ TEST(mathMixMatFun, offset_multiplier_constrain_matvar_vector_scalar_scalar) { offset_multiplier_constrain_tests::expect_matvar(x2, mu, sigma); } -TEST(mathMixMatFun, offset_multiplier_constrain_matvar_vector_vector_scalar) { +TEST_F(mathMix, offset_multiplier_constrain_matvar_vector_vector_scalar) { Eigen::MatrixXd x1(2, 2); x1 << 5.0, 2.0, 4.0, 5.0; Eigen::MatrixXd x2(2, 2); diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_1_test.cpp b/test/unit/math/mix/fun/offset_multiplier_constrain_1_test.cpp index 7d15bd66bd6..70bdded08fc 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_1_test.cpp +++ b/test/unit/math/mix/fun/offset_multiplier_constrain_1_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -/* -TEST(mathMixMatFun, offset_multiplier_constrain_scalars) { + +TEST_F(mathMix, offset_multiplier_constrain_scalars) { double x1 = 0.7; double x2 = -38.1; double mu = -2.0; @@ -10,7 +11,7 @@ TEST(mathMixMatFun, offset_multiplier_constrain_scalars) { offset_multiplier_constrain_tests::expect(x2, mu, sigma); } -TEST(mathMixMatFun, offset_multiplier_constrain_vector_scalar_scalar) { +TEST_F(mathMix, offset_multiplier_constrain_vector_scalar_scalar) { Eigen::MatrixXd x1(1, 1); x1 << 0.7; Eigen::MatrixXd x2(1, 1); @@ -20,8 +21,8 @@ TEST(mathMixMatFun, offset_multiplier_constrain_vector_scalar_scalar) { offset_multiplier_constrain_tests::expect(x1, mu, sigma); offset_multiplier_constrain_tests::expect(x2, mu, sigma); } -*/ -TEST(mathMixMatFun, offset_multiplier_constrain_vector_vector_scalar) { + +TEST_F(mathMix, offset_multiplier_constrain_vector_vector_scalar) { Eigen::MatrixXd x1(2, 2); x1 << 5.0, 2.0, 4.0, 5.0; Eigen::MatrixXd x2(2, 2); @@ -30,5 +31,5 @@ TEST(mathMixMatFun, offset_multiplier_constrain_vector_vector_scalar) { mu << -3.0, 5.0, -6.0, 6.0; double sigma = 13.5; offset_multiplier_constrain_tests::expect(x1, mu, sigma); - // offset_multiplier_constrain_tests::expect(x2, mu, sigma); + offset_multiplier_constrain_tests::expect(x2, mu, sigma); } diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_2_matvar_test.cpp b/test/unit/math/mix/fun/offset_multiplier_constrain_2_matvar_test.cpp index 7f0232eef66..dfd73875d73 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_2_matvar_test.cpp +++ b/test/unit/math/mix/fun/offset_multiplier_constrain_2_matvar_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixMatFun, offset_multiplier_constrain_matvar_vector_scalar_vector) { +TEST_F(mathMix, offset_multiplier_constrain_matvar_vector_scalar_vector) { Eigen::MatrixXd x1(2, 2); x1 << 5.0, 2.0, 4.0, 5.0; Eigen::MatrixXd x2(2, 2); @@ -14,7 +15,7 @@ TEST(mathMixMatFun, offset_multiplier_constrain_matvar_vector_scalar_vector) { offset_multiplier_constrain_tests::expect_matvar(x2, mu, sigma); } -TEST(mathMixMatFun, offset_multiplier_constrain_matvar_vector_vector_vector) { +TEST_F(mathMix, offset_multiplier_constrain_matvar_vector_vector_vector) { Eigen::MatrixXd x1(2, 2); x1 << 5.0, 2.0, 4.0, 5.0; Eigen::MatrixXd x2(2, 2); diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_2_test.cpp b/test/unit/math/mix/fun/offset_multiplier_constrain_2_test.cpp index c62a0747501..8bdfca27262 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_2_test.cpp +++ b/test/unit/math/mix/fun/offset_multiplier_constrain_2_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixMatFun, offset_multiplier_constrain_vector_scalar_vector) { +TEST_F(mathMix, offset_multiplier_constrain_vector_scalar_vector) { Eigen::MatrixXd x1(2, 2); x1 << 5.0, 2.0, 4.0, 5.0; Eigen::MatrixXd x2(2, 2); @@ -14,7 +15,7 @@ TEST(mathMixMatFun, offset_multiplier_constrain_vector_scalar_vector) { offset_multiplier_constrain_tests::expect(x2, mu, sigma); } -TEST(mathMixMatFun, offset_multiplier_constrain_vector_vector_vector) { +TEST_F(mathMix, offset_multiplier_constrain_vector_vector_vector) { Eigen::MatrixXd x1(2, 2); x1 << 5.0, 2.0, 4.0, 5.0; Eigen::MatrixXd x2(2, 2); diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_3_matvar_test.cpp b/test/unit/math/mix/fun/offset_multiplier_constrain_3_matvar_test.cpp index 764c84c0a1b..0343281cfa6 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_3_matvar_test.cpp +++ b/test/unit/math/mix/fun/offset_multiplier_constrain_3_matvar_test.cpp @@ -1,9 +1,10 @@ #include +#include #include // array[] matrix, matrix, array[] matrix // array[] matrix, matrix, matrix -TEST(mathMixMatFun, +TEST_F(mathMix, offset_multiplier_matvar_stdvec_mu_mat_sigma_vec_constrain) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.0, 0.1; @@ -22,7 +23,7 @@ TEST(mathMixMatFun, // array[] matrix, array[] matrix, array[] matrix // array[] matrix, array[] matrix, matrix -TEST(mathMixMatFun, +TEST_F(mathMix, offset_multiplier_matvar_stdvec_mu_vec_sigma_mat_constrain) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.0, 0.1; diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_3_test.cpp b/test/unit/math/mix/fun/offset_multiplier_constrain_3_test.cpp index 28089aacc8a..73594764de2 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_3_test.cpp +++ b/test/unit/math/mix/fun/offset_multiplier_constrain_3_test.cpp @@ -1,9 +1,10 @@ #include +#include #include // array[] matrix, matrix, array[] matrix // array[] matrix, matrix, matrix -TEST(mathMixMatFun, offset_multiplier_stdvec_mu_mat_sigma_vec_constrain) { +TEST_F(mathMix, offset_multiplier_stdvec_mu_mat_sigma_vec_constrain) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.0, 0.1; Eigen::MatrixXd mu_inner(2, 3); @@ -20,7 +21,7 @@ TEST(mathMixMatFun, offset_multiplier_stdvec_mu_mat_sigma_vec_constrain) { // array[] matrix, array[] matrix, array[] matrix // array[] matrix, array[] matrix, matrix -TEST(mathMixMatFun, offset_multiplier_stdvec_mu_vec_sigma_mat_constrain) { +TEST_F(mathMix, offset_multiplier_stdvec_mu_vec_sigma_mat_constrain) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.0, 0.1; Eigen::MatrixXd mu_inner(2, 3); diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_4_matvar_test.cpp b/test/unit/math/mix/fun/offset_multiplier_constrain_4_matvar_test.cpp index 79c0c36867e..4edf8ea9c27 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_4_matvar_test.cpp +++ b/test/unit/math/mix/fun/offset_multiplier_constrain_4_matvar_test.cpp @@ -1,10 +1,11 @@ #include +#include #include // real[], real[], real[] // real[], real, real[] // real[], real[], real -TEST(mathMixMatFun, offset_multiplier_constrain_matvar_stdvec_constrain) { +TEST_F(mathMix, offset_multiplier_constrain_matvar_stdvec_constrain) { std::vector A{5.0, 2.0, 4.0, -2.0}; std::vector mum{-3.0, 3.0, -6.0, 6.0}; std::vector sigmam{-1.0, 5.0, 0.0, 38.0}; diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_4_test.cpp b/test/unit/math/mix/fun/offset_multiplier_constrain_4_test.cpp index fb37442f6f0..3b190115b74 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_4_test.cpp +++ b/test/unit/math/mix/fun/offset_multiplier_constrain_4_test.cpp @@ -1,10 +1,11 @@ #include +#include #include // real[], real[], real[] // real[], real, real[] // real[], real[], real -TEST(mathMixMatFun, offset_multiplier_stdvec_constrain) { +TEST_F(mathMix, offset_multiplier_stdvec_constrain) { std::vector A{5.0, 2.0, 4.0, -2.0}; std::vector mum{-3.0, 3.0, -6.0, 6.0}; std::vector sigmam{-1.0, 5.0, 0.0, 38.0}; diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_5_matvar_test.cpp b/test/unit/math/mix/fun/offset_multiplier_constrain_5_matvar_test.cpp index e47b579f2ed..696e48b8946 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_5_matvar_test.cpp +++ b/test/unit/math/mix/fun/offset_multiplier_constrain_5_matvar_test.cpp @@ -1,9 +1,10 @@ #include +#include #include // array[] matrix, array[] matrix, real // array[] matrix, real, array[] matrix -TEST(mathMixMatFun, offset_multiplier_matvar_stdvec_mat_scalar1_constrain) { +TEST_F(mathMix, offset_multiplier_matvar_stdvec_mat_scalar1_constrain) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.0, 0.1; Eigen::MatrixXd mu_inner(2, 3); diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_5_test.cpp b/test/unit/math/mix/fun/offset_multiplier_constrain_5_test.cpp index 610a2f9de11..224e720e632 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_5_test.cpp +++ b/test/unit/math/mix/fun/offset_multiplier_constrain_5_test.cpp @@ -1,9 +1,10 @@ #include +#include #include // array[] matrix, array[] matrix, real // array[] matrix, real, array[] matrix -TEST(mathMixMatFun, offset_multiplier_stdvec_mat_scalar1_constrain) { +TEST_F(mathMix, offset_multiplier_stdvec_mat_scalar1_constrain) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.0, 0.1; Eigen::MatrixXd mu_inner(2, 3); diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_6_matvar_test.cpp b/test/unit/math/mix/fun/offset_multiplier_constrain_6_matvar_test.cpp index b65f76bb0c7..1d5bd3ef38d 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_6_matvar_test.cpp +++ b/test/unit/math/mix/fun/offset_multiplier_constrain_6_matvar_test.cpp @@ -1,10 +1,11 @@ #include +#include #include // array[] matrix, matrix, real // array[] matrix, real, matrix // array[] matrix, real, real -TEST(mathMixMatFun, offset_multiplier_matvar_stdvec_mat_scalar_constrain) { +TEST_F(mathMix, offset_multiplier_matvar_stdvec_mat_scalar_constrain) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.0, 0.1; Eigen::MatrixXd mu_inner(2, 3); diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_6_test.cpp b/test/unit/math/mix/fun/offset_multiplier_constrain_6_test.cpp index 190d01f0c81..fe981ce2d97 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_6_test.cpp +++ b/test/unit/math/mix/fun/offset_multiplier_constrain_6_test.cpp @@ -1,10 +1,11 @@ #include +#include #include // array[] matrix, matrix, real // array[] matrix, real, matrix // array[] matrix, real, real -TEST(mathMixMatFun, offset_multiplier_stdvec_mat_scalar_constrain) { +TEST_F(mathMix, offset_multiplier_stdvec_mat_scalar_constrain) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.0, 0.1; Eigen::MatrixXd mu_inner(2, 3); diff --git a/test/unit/math/mix/fun/offset_multiplier_constrain_7_test.cpp b/test/unit/math/mix/fun/offset_multiplier_constrain_7_test.cpp index 775b77d7d9d..85b413021a1 100644 --- a/test/unit/math/mix/fun/offset_multiplier_constrain_7_test.cpp +++ b/test/unit/math/mix/fun/offset_multiplier_constrain_7_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, offset_multiplier_consistent_sizes) { +TEST_F(mathMix, offset_multiplier_consistent_sizes) { auto f = [](const auto& x1, const auto& x2, const auto& x3) { stan::return_type_t lp = 0; return stan::math::offset_multiplier_constrain(x1, x2, x3, lp); diff --git a/test/unit/math/mix/fun/operator_addition_test.cpp b/test/unit/math/mix/fun/operator_addition_test.cpp index c76c052b981..ba399c57f7d 100644 --- a/test/unit/math/mix/fun/operator_addition_test.cpp +++ b/test/unit/math/mix/fun/operator_addition_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(AgradMixMatrixOperatorAddition, fv_scalar_matrix_1stDeriv) { +TEST_F(mathMix, operator_addition_fv_scalar_matrix_1stDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::matrix_fv; @@ -44,7 +45,7 @@ TEST(AgradMixMatrixOperatorAddition, fv_scalar_matrix_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, fv_scalar_matrix_2ndDeriv) { +TEST_F(mathMix, operator_addition_fv_scalar_matrix_2ndDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::matrix_fv; @@ -67,7 +68,7 @@ TEST(AgradMixMatrixOperatorAddition, fv_scalar_matrix_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, fv_scalar_vector_1stDeriv) { +TEST_F(mathMix, operator_addition_fv_scalar_vector_1stDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::vector_fv; @@ -109,7 +110,7 @@ TEST(AgradMixMatrixOperatorAddition, fv_scalar_vector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, fv_scalar_vector_2ndDeriv) { +TEST_F(mathMix, operator_addition_fv_scalar_vector_2ndDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::vector_fv; @@ -132,7 +133,7 @@ TEST(AgradMixMatrixOperatorAddition, fv_scalar_vector_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, fv_scalar_rowvector_1stDeriv) { +TEST_F(mathMix, operator_addition_fv_scalar_rowvector_1stDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::row_vector_fv; @@ -174,7 +175,7 @@ TEST(AgradMixMatrixOperatorAddition, fv_scalar_rowvector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, fv_scalar_rowvector_2ndDeriv) { +TEST_F(mathMix, operator_addition_fv_scalar_rowvector_2ndDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::row_vector_fv; @@ -198,7 +199,7 @@ TEST(AgradMixMatrixOperatorAddition, fv_scalar_rowvector_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, fv_vector_vector_1stDeriv) { +TEST_F(mathMix, operator_addition_fv_vector_vector_1stDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::vector_d; @@ -280,7 +281,7 @@ TEST(AgradMixMatrixOperatorAddition, fv_vector_vector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, fv_vector_vector_2ndDeriv) { +TEST_F(mathMix, operator_addition_fv_vector_vector_2ndDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::vector_d; @@ -318,7 +319,7 @@ TEST(AgradMixMatrixOperatorAddition, fv_vector_vector_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, fv_vector_vector_exception) { +TEST_F(mathMix, operator_addition_fv_vector_vector_exception) { using stan::math::add; using stan::math::fvar; using stan::math::vector_d; @@ -332,7 +333,7 @@ TEST(AgradMixMatrixOperatorAddition, fv_vector_vector_exception) { EXPECT_THROW(add(d1, v2), std::invalid_argument); EXPECT_THROW(add(v1, v2), std::invalid_argument); } -TEST(AgradMixMatrixOperatorAddition, fv_rowvector_rowvector_1stDeriv) { +TEST_F(mathMix, operator_addition_fv_rowvector_rowvector_1stDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::row_vector_d; @@ -411,7 +412,7 @@ TEST(AgradMixMatrixOperatorAddition, fv_rowvector_rowvector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, fv_rowvector_rowvector_2ndDeriv) { +TEST_F(mathMix, operator_addition_fv_rowvector_rowvector_2ndDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::row_vector_d; @@ -447,7 +448,7 @@ TEST(AgradMixMatrixOperatorAddition, fv_rowvector_rowvector_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, fv_rowvector_rowvector_exception) { +TEST_F(mathMix, operator_addition_fv_rowvector_rowvector_exception) { using stan::math::add; using stan::math::fvar; using stan::math::row_vector_d; @@ -462,7 +463,7 @@ TEST(AgradMixMatrixOperatorAddition, fv_rowvector_rowvector_exception) { EXPECT_THROW(add(v1, d2), std::invalid_argument); EXPECT_THROW(add(v1, v2), std::invalid_argument); } -TEST(AgradMixMatrixOperatorAddition, fv_matrix_matrix_1stDeriv) { +TEST_F(mathMix, operator_addition_fv_matrix_matrix_1stDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::matrix_d; @@ -532,7 +533,7 @@ TEST(AgradMixMatrixOperatorAddition, fv_matrix_matrix_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, fv_matrix_matrix_2ndDeriv) { +TEST_F(mathMix, operator_addition_fv_matrix_matrix_2ndDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::matrix_d; @@ -566,7 +567,7 @@ TEST(AgradMixMatrixOperatorAddition, fv_matrix_matrix_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, fv_matrix_matrix_exception) { +TEST_F(mathMix, operator_addition_fv_matrix_matrix_exception) { using stan::math::add; using stan::math::fvar; using stan::math::matrix_d; @@ -580,7 +581,7 @@ TEST(AgradMixMatrixOperatorAddition, fv_matrix_matrix_exception) { EXPECT_THROW(add(v1, d2), std::invalid_argument); EXPECT_THROW(add(v1, v2), std::invalid_argument); } -TEST(AgradMixMatrixOperatorAddition, ffv_scalar_matrix_1stDeriv) { +TEST_F(mathMix, operator_addition_ffv_scalar_matrix_1stDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::matrix_ffv; @@ -622,7 +623,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_scalar_matrix_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_scalar_matrix_2ndDeriv_1) { +TEST_F(mathMix, operator_addition_ffv_scalar_matrix_2ndDeriv_1) { using stan::math::add; using stan::math::fvar; using stan::math::matrix_ffv; @@ -645,7 +646,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_scalar_matrix_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_scalar_matrix_2ndDeriv_2) { +TEST_F(mathMix, operator_addition_ffv_scalar_matrix_2ndDeriv_2) { using stan::math::add; using stan::math::fvar; using stan::math::matrix_ffv; @@ -668,7 +669,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_scalar_matrix_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_scalar_matrix_3rdDeriv) { +TEST_F(mathMix, operator_addition_ffv_scalar_matrix_3rdDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::matrix_ffv; @@ -695,7 +696,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_scalar_matrix_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_scalar_vector_1stDeriv) { +TEST_F(mathMix, operator_addition_ffv_scalar_vector_1stDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::vector_ffv; @@ -737,7 +738,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_scalar_vector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_scalar_vector_2ndDeriv_1) { +TEST_F(mathMix, operator_addition_ffv_scalar_vector_2ndDeriv_1) { using stan::math::add; using stan::math::fvar; using stan::math::vector_ffv; @@ -760,7 +761,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_scalar_vector_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_scalar_vector_2ndDeriv_2) { +TEST_F(mathMix, operator_addition_ffv_scalar_vector_2ndDeriv_2) { using stan::math::add; using stan::math::fvar; using stan::math::vector_ffv; @@ -783,7 +784,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_scalar_vector_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_scalar_vector_3rdDeriv) { +TEST_F(mathMix, operator_addition_ffv_scalar_vector_3rdDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::vector_ffv; @@ -810,7 +811,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_scalar_vector_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_scalar_rowvector_1stDeriv) { +TEST_F(mathMix, operator_addition_ffv_scalar_rowvector_1stDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::row_vector_ffv; @@ -852,7 +853,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_scalar_rowvector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_scalar_rowvector_2ndDeriv_1) { +TEST_F(mathMix, operator_addition_ffv_scalar_rowvector_2ndDeriv_1) { using stan::math::add; using stan::math::fvar; using stan::math::row_vector_ffv; @@ -876,7 +877,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_scalar_rowvector_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_scalar_rowvector_2ndDeriv_2) { +TEST_F(mathMix, operator_addition_ffv_scalar_rowvector_2ndDeriv_2) { using stan::math::add; using stan::math::fvar; using stan::math::row_vector_ffv; @@ -900,7 +901,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_scalar_rowvector_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_scalar_rowvector_3rdDeriv) { +TEST_F(mathMix, operator_addition_ffv_scalar_rowvector_3rdDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::row_vector_ffv; @@ -928,7 +929,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_scalar_rowvector_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_vector_vector_1stDeriv) { +TEST_F(mathMix, operator_addition_ffv_vector_vector_1stDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::vector_d; @@ -1010,7 +1011,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_vector_vector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_vector_vector_2ndDeriv_1) { +TEST_F(mathMix, operator_addition_ffv_vector_vector_2ndDeriv_1) { using stan::math::add; using stan::math::fvar; using stan::math::vector_d; @@ -1048,7 +1049,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_vector_vector_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_vector_vector_2ndDeriv_2) { +TEST_F(mathMix, operator_addition_ffv_vector_vector_2ndDeriv_2) { using stan::math::add; using stan::math::fvar; using stan::math::vector_d; @@ -1086,7 +1087,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_vector_vector_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_vector_vector_3rdDeriv) { +TEST_F(mathMix, operator_addition_ffv_vector_vector_3rdDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::vector_d; @@ -1134,7 +1135,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_vector_vector_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_vector_vector_exception) { +TEST_F(mathMix, operator_addition_ffv_vector_vector_exception) { using stan::math::add; using stan::math::fvar; using stan::math::vector_d; @@ -1148,7 +1149,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_vector_vector_exception) { EXPECT_THROW(add(d1, v2), std::invalid_argument); EXPECT_THROW(add(v1, v2), std::invalid_argument); } -TEST(AgradMixMatrixOperatorAddition, ffv_rowvector_rowvector_1stDeriv) { +TEST_F(mathMix, operator_addition_ffv_rowvector_rowvector_1stDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::row_vector_d; @@ -1227,7 +1228,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_rowvector_rowvector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_rowvector_rowvector_2ndDeriv_1) { +TEST_F(mathMix, operator_addition_ffv_rowvector_rowvector_2ndDeriv_1) { using stan::math::add; using stan::math::fvar; using stan::math::row_vector_d; @@ -1263,7 +1264,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_rowvector_rowvector_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_rowvector_rowvector_2ndDeriv_2) { +TEST_F(mathMix, operator_addition_ffv_rowvector_rowvector_2ndDeriv_2) { using stan::math::add; using stan::math::fvar; using stan::math::row_vector_d; @@ -1299,7 +1300,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_rowvector_rowvector_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_rowvector_rowvector_3rdDeriv) { +TEST_F(mathMix, operator_addition_ffv_rowvector_rowvector_3rdDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::row_vector_d; @@ -1345,7 +1346,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_rowvector_rowvector_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_rowvector_rowvector_exception) { +TEST_F(mathMix, operator_addition_ffv_rowvector_rowvector_exception) { using stan::math::add; using stan::math::fvar; using stan::math::row_vector_d; @@ -1360,7 +1361,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_rowvector_rowvector_exception) { EXPECT_THROW(add(v1, d2), std::invalid_argument); EXPECT_THROW(add(v1, v2), std::invalid_argument); } -TEST(AgradMixMatrixOperatorAddition, ffv_matrix_matrix_1stDeriv) { +TEST_F(mathMix, operator_addition_ffv_matrix_matrix_1stDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::matrix_d; @@ -1431,7 +1432,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_matrix_matrix_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_matrix_matrix_2ndDeriv_1) { +TEST_F(mathMix, operator_addition_ffv_matrix_matrix_2ndDeriv_1) { using stan::math::add; using stan::math::fvar; using stan::math::matrix_d; @@ -1466,7 +1467,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_matrix_matrix_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_matrix_matrix_2ndDeriv_2) { +TEST_F(mathMix, operator_addition_ffv_matrix_matrix_2ndDeriv_2) { using stan::math::add; using stan::math::fvar; using stan::math::matrix_d; @@ -1501,7 +1502,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_matrix_matrix_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_matrix_matrix_3rdDeriv) { +TEST_F(mathMix, operator_addition_ffv_matrix_matrix_3rdDeriv) { using stan::math::add; using stan::math::fvar; using stan::math::matrix_d; @@ -1544,7 +1545,7 @@ TEST(AgradMixMatrixOperatorAddition, ffv_matrix_matrix_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorAddition, ffv_matrix_matrix_exception) { +TEST_F(mathMix, operator_addition_ffv_matrix_matrix_exception) { using stan::math::add; using stan::math::fvar; using stan::math::matrix_d; diff --git a/test/unit/math/mix/fun/operator_division_test.cpp b/test/unit/math/mix/fun/operator_division_test.cpp index f26a4391f16..8d670cb263a 100644 --- a/test/unit/math/mix/fun/operator_division_test.cpp +++ b/test/unit/math/mix/fun/operator_division_test.cpp @@ -1,9 +1,10 @@ #include +#include #include #include #include -TEST(AgradMixMatrixOperatorDivision, fv_scalar_1stDeriv) { +TEST_F(mathMix, operator_division_fv_scalar_1stDeriv) { using stan::math::divide; using stan::math::fvar; using stan::math::var; @@ -60,7 +61,7 @@ TEST(AgradMixMatrixOperatorDivision, fv_scalar_1stDeriv) { EXPECT_FLOAT_EQ(-0.5, h[0]); } -TEST(AgradMixMatrixOperatorDivision, fv_scalar_2ndDeriv) { +TEST_F(mathMix, operator_division_fv_scalar_2ndDeriv) { using stan::math::divide; using stan::math::fvar; using stan::math::var; @@ -76,7 +77,7 @@ TEST(AgradMixMatrixOperatorDivision, fv_scalar_2ndDeriv) { divide(v1, d2).d_.grad(q, h); EXPECT_FLOAT_EQ(0, h[0]); } -TEST(AgradMixMatrixOperatorDivision, fv_vector_1stDeriv) { +TEST_F(mathMix, operator_division_fv_vector_1stDeriv) { using stan::math::divide; using stan::math::fvar; using stan::math::var; @@ -179,7 +180,7 @@ TEST(AgradMixMatrixOperatorDivision, fv_vector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorDivision, fv_vector_2ndDeriv) { +TEST_F(mathMix, operator_division_fv_vector_2ndDeriv) { using stan::math::divide; using stan::math::fvar; using stan::math::var; @@ -205,7 +206,7 @@ TEST(AgradMixMatrixOperatorDivision, fv_vector_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorDivision, fv_rowvector_1stDeriv) { +TEST_F(mathMix, operator_division_fv_rowvector_1stDeriv) { using stan::math::divide; using stan::math::fvar; using stan::math::row_vector_d; @@ -307,7 +308,7 @@ TEST(AgradMixMatrixOperatorDivision, fv_rowvector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorDivision, fv_rowvector_2ndDeriv) { +TEST_F(mathMix, operator_division_fv_rowvector_2ndDeriv) { using stan::math::divide; using stan::math::fvar; using stan::math::row_vector_d; @@ -334,7 +335,7 @@ TEST(AgradMixMatrixOperatorDivision, fv_rowvector_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorDivision, fv_matrix_1stDeriv) { +TEST_F(mathMix, operator_division_fv_matrix_1stDeriv) { using stan::math::divide; using stan::math::fvar; using stan::math::matrix_d; @@ -460,7 +461,7 @@ TEST(AgradMixMatrixOperatorDivision, fv_matrix_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorDivision, fv_matrix_2ndDeriv) { +TEST_F(mathMix, operator_division_fv_matrix_2ndDeriv) { using stan::math::divide; using stan::math::fvar; using stan::math::matrix_d; @@ -490,7 +491,7 @@ TEST(AgradMixMatrixOperatorDivision, fv_matrix_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorDivision, ffv_scalar_1stDeriv) { +TEST_F(mathMix, operator_division_ffv_scalar_1stDeriv) { using stan::math::divide; using stan::math::fvar; using stan::math::var; @@ -546,7 +547,7 @@ TEST(AgradMixMatrixOperatorDivision, ffv_scalar_1stDeriv) { divide(v1, d2).val_.val().grad(q, h); EXPECT_FLOAT_EQ(-0.5, h[0]); } -TEST(AgradMixMatrixOperatorDivision, ffv_scalar_2ndDeriv_1) { +TEST_F(mathMix, operator_division_ffv_scalar_2ndDeriv_1) { using stan::math::divide; using stan::math::fvar; using stan::math::var; @@ -562,7 +563,7 @@ TEST(AgradMixMatrixOperatorDivision, ffv_scalar_2ndDeriv_1) { divide(v1, d2).val().d_.grad(q, h); EXPECT_FLOAT_EQ(0, h[0]); } -TEST(AgradMixMatrixOperatorDivision, ffv_scalar_2ndDeriv_2) { +TEST_F(mathMix, operator_division_ffv_scalar_2ndDeriv_2) { using stan::math::divide; using stan::math::fvar; using stan::math::var; @@ -578,7 +579,7 @@ TEST(AgradMixMatrixOperatorDivision, ffv_scalar_2ndDeriv_2) { divide(v1, d2).d_.val().grad(q, h); EXPECT_FLOAT_EQ(0, h[0]); } -TEST(AgradMixMatrixOperatorDivision, ffv_scalar_3rdDeriv) { +TEST_F(mathMix, operator_division_ffv_scalar_3rdDeriv) { using stan::math::divide; using stan::math::fvar; using stan::math::var; @@ -595,7 +596,7 @@ TEST(AgradMixMatrixOperatorDivision, ffv_scalar_3rdDeriv) { divide(v1, d2).d_.d_.grad(q, h); EXPECT_FLOAT_EQ(0, h[0]); } -TEST(AgradMixMatrixOperatorDivision, ffv_vector_1stDeriv) { +TEST_F(mathMix, operator_division_ffv_vector_1stDeriv) { using stan::math::divide; using stan::math::fvar; using stan::math::var; @@ -701,7 +702,7 @@ TEST(AgradMixMatrixOperatorDivision, ffv_vector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorDivision, ffv_vector_2ndDeriv_1) { +TEST_F(mathMix, operator_division_ffv_vector_2ndDeriv_1) { using stan::math::divide; using stan::math::fvar; using stan::math::var; @@ -728,7 +729,7 @@ TEST(AgradMixMatrixOperatorDivision, ffv_vector_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorDivision, ffv_vector_2ndDeriv_2) { +TEST_F(mathMix, operator_division_ffv_vector_2ndDeriv_2) { using stan::math::divide; using stan::math::fvar; using stan::math::var; @@ -755,7 +756,7 @@ TEST(AgradMixMatrixOperatorDivision, ffv_vector_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorDivision, ffv_vector_3rdDeriv) { +TEST_F(mathMix, operator_division_ffv_vector_3rdDeriv) { using stan::math::divide; using stan::math::fvar; using stan::math::var; @@ -786,7 +787,7 @@ TEST(AgradMixMatrixOperatorDivision, ffv_vector_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorDivision, ffv_rowvector_1stDeriv) { +TEST_F(mathMix, operator_division_ffv_rowvector_1stDeriv) { using stan::math::divide; using stan::math::fvar; using stan::math::row_vector_d; @@ -891,7 +892,7 @@ TEST(AgradMixMatrixOperatorDivision, ffv_rowvector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorDivision, ffv_rowvector_2ndDeriv_1) { +TEST_F(mathMix, operator_division_ffv_rowvector_2ndDeriv_1) { using stan::math::divide; using stan::math::fvar; using stan::math::row_vector_d; @@ -919,7 +920,7 @@ TEST(AgradMixMatrixOperatorDivision, ffv_rowvector_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorDivision, ffv_rowvector_2ndDeriv_2) { +TEST_F(mathMix, operator_division_ffv_rowvector_2ndDeriv_2) { using stan::math::divide; using stan::math::fvar; using stan::math::row_vector_d; @@ -947,7 +948,7 @@ TEST(AgradMixMatrixOperatorDivision, ffv_rowvector_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorDivision, ffv_rowvector_3rdDeriv) { +TEST_F(mathMix, operator_division_ffv_rowvector_3rdDeriv) { using stan::math::divide; using stan::math::fvar; using stan::math::row_vector_d; @@ -979,7 +980,7 @@ TEST(AgradMixMatrixOperatorDivision, ffv_rowvector_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorDivision, ffv_matrix_1stDeriv) { +TEST_F(mathMix, operator_division_ffv_matrix_1stDeriv) { using stan::math::divide; using stan::math::fvar; using stan::math::matrix_d; @@ -1105,7 +1106,7 @@ TEST(AgradMixMatrixOperatorDivision, ffv_matrix_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorDivision, ffv_matrix_2ndDeriv_1) { +TEST_F(mathMix, operator_division_ffv_matrix_2ndDeriv_1) { using stan::math::divide; using stan::math::fvar; using stan::math::matrix_d; @@ -1136,7 +1137,7 @@ TEST(AgradMixMatrixOperatorDivision, ffv_matrix_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorDivision, ffv_matrix_2ndDeriv_2) { +TEST_F(mathMix, operator_division_ffv_matrix_2ndDeriv_2) { using stan::math::divide; using stan::math::fvar; using stan::math::matrix_d; @@ -1167,7 +1168,7 @@ TEST(AgradMixMatrixOperatorDivision, ffv_matrix_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorDivision, ffv_matrix_3rdDeriv) { +TEST_F(mathMix, operator_division_ffv_matrix_3rdDeriv) { using stan::math::divide; using stan::math::fvar; using stan::math::matrix_d; diff --git a/test/unit/math/mix/fun/operator_multiplication_test.cpp b/test/unit/math/mix/fun/operator_multiplication_test.cpp index a0b9c64af77..676006e41a9 100644 --- a/test/unit/math/mix/fun/operator_multiplication_test.cpp +++ b/test/unit/math/mix/fun/operator_multiplication_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(AgradMixMatrixOperatorMultiplication, fv_vector_scalar_1stDeriv) { +TEST_F(mathMix, operator_multiplication_fv_vector_scalar_1stDeriv) { using stan::math::fvar; using stan::math::multiply; using stan::math::var; @@ -79,7 +80,7 @@ TEST(AgradMixMatrixOperatorMultiplication, fv_vector_scalar_1stDeriv) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, fv_vector_scalar_2ndDeriv) { +TEST_F(mathMix, operator_multiplication_fv_vector_scalar_2ndDeriv) { using stan::math::fvar; using stan::math::multiply; using stan::math::var; @@ -108,7 +109,7 @@ TEST(AgradMixMatrixOperatorMultiplication, fv_vector_scalar_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, fv_rowvector_scalar_1stDeriv) { +TEST_F(mathMix, operator_multiplication_fv_rowvector_scalar_1stDeriv) { using stan::math::fvar; using stan::math::multiply; using stan::math::row_vector_d; @@ -185,7 +186,7 @@ TEST(AgradMixMatrixOperatorMultiplication, fv_rowvector_scalar_1stDeriv) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, fv_rowvector_scalar_2ndDeriv) { +TEST_F(mathMix, operator_multiplication_fv_rowvector_scalar_2ndDeriv) { using stan::math::fvar; using stan::math::multiply; using stan::math::row_vector_d; @@ -213,7 +214,7 @@ TEST(AgradMixMatrixOperatorMultiplication, fv_rowvector_scalar_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, fv_matrix_scalar_1stDeriv) { +TEST_F(mathMix, operator_multiplication_fv_matrix_scalar_1stDeriv) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_fv; @@ -305,7 +306,7 @@ TEST(AgradMixMatrixOperatorMultiplication, fv_matrix_scalar_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, fv_matrix_scalar_2ndDeriv) { +TEST_F(mathMix, operator_multiplication_fv_matrix_scalar_2ndDeriv) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_fv; @@ -335,7 +336,7 @@ TEST(AgradMixMatrixOperatorMultiplication, fv_matrix_scalar_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, fv_rowvector_vector_1stDeriv) { +TEST_F(mathMix, operator_multiplication_fv_rowvector_vector_1stDeriv) { using stan::math::fvar; using stan::math::multiply; using stan::math::row_vector_d; @@ -380,7 +381,7 @@ TEST(AgradMixMatrixOperatorMultiplication, fv_rowvector_vector_1stDeriv) { EXPECT_THROW(multiply(v1, d2), std::invalid_argument); EXPECT_THROW(multiply(d1, v2), std::invalid_argument); } -TEST(AgradMixMatrixOperatorMultiplication, fv_rowvector_vector_2ndDeriv) { +TEST_F(mathMix, operator_multiplication_fv_rowvector_vector_2ndDeriv) { using stan::math::fvar; using stan::math::multiply; using stan::math::row_vector_d; @@ -412,7 +413,7 @@ TEST(AgradMixMatrixOperatorMultiplication, fv_rowvector_vector_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, fv_vector_rowvector_1stDeriv) { +TEST_F(mathMix, operator_multiplication_fv_vector_rowvector_1stDeriv) { using stan::math::fvar; using stan::math::matrix_fv; using stan::math::multiply; @@ -511,7 +512,7 @@ TEST(AgradMixMatrixOperatorMultiplication, fv_vector_rowvector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, fv_vector_rowvector_2ndDeriv) { +TEST_F(mathMix, operator_multiplication_fv_vector_rowvector_2ndDeriv) { using stan::math::fvar; using stan::math::matrix_fv; using stan::math::multiply; @@ -547,7 +548,7 @@ TEST(AgradMixMatrixOperatorMultiplication, fv_vector_rowvector_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, fv_matrix_vector_1stDeriv) { +TEST_F(mathMix, operator_multiplication_fv_matrix_vector_1stDeriv) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_fv; @@ -611,7 +612,7 @@ TEST(AgradMixMatrixOperatorMultiplication, fv_matrix_vector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, fv_matrix_vector_2ndDeriv) { +TEST_F(mathMix, operator_multiplication_fv_matrix_vector_2ndDeriv) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_fv; @@ -650,7 +651,7 @@ TEST(AgradMixMatrixOperatorMultiplication, fv_matrix_vector_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, fv_matrix_vector_exception) { +TEST_F(mathMix, operator_multiplication_fv_matrix_vector_exception) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_fv; @@ -667,7 +668,7 @@ TEST(AgradMixMatrixOperatorMultiplication, fv_matrix_vector_exception) { EXPECT_THROW(multiply(v1, d2), std::invalid_argument); EXPECT_THROW(multiply(d1, v2), std::invalid_argument); } -TEST(AgradMixMatrixOperatorMultiplication, fv_rowvector_matrix_1stDeriv) { +TEST_F(mathMix, operator_multiplication_fv_rowvector_matrix_1stDeriv) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_fv; @@ -726,7 +727,7 @@ TEST(AgradMixMatrixOperatorMultiplication, fv_rowvector_matrix_1stDeriv) { EXPECT_FLOAT_EQ(4, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, fv_rowvector_matrix_2ndDeriv) { +TEST_F(mathMix, operator_multiplication_fv_rowvector_matrix_2ndDeriv) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_fv; @@ -767,7 +768,7 @@ TEST(AgradMixMatrixOperatorMultiplication, fv_rowvector_matrix_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, fv_rowvector_matrix_exception) { +TEST_F(mathMix, operator_multiplication_fv_rowvector_matrix_exception) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_fv; @@ -784,7 +785,7 @@ TEST(AgradMixMatrixOperatorMultiplication, fv_rowvector_matrix_exception) { EXPECT_THROW(multiply(v1, d2), std::invalid_argument); EXPECT_THROW(multiply(d1, v2), std::invalid_argument); } -TEST(AgradMixMatrixOperatorMultiplication, fv_matrix_matrix_1stDeriv) { +TEST_F(mathMix, operator_multiplication_fv_matrix_matrix_1stDeriv) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_fv; @@ -854,7 +855,7 @@ TEST(AgradMixMatrixOperatorMultiplication, fv_matrix_matrix_1stDeriv) { EXPECT_FLOAT_EQ(24, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, fv_matrix_matrix_2ndDeriv) { +TEST_F(mathMix, operator_multiplication_fv_matrix_matrix_2ndDeriv) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_fv; @@ -894,7 +895,7 @@ TEST(AgradMixMatrixOperatorMultiplication, fv_matrix_matrix_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, fv_matrix_matrix_exception) { +TEST_F(mathMix, operator_multiplication_fv_matrix_matrix_exception) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_fv; @@ -910,7 +911,7 @@ TEST(AgradMixMatrixOperatorMultiplication, fv_matrix_matrix_exception) { EXPECT_THROW(multiply(v1, d2), std::invalid_argument); EXPECT_THROW(multiply(d1, v2), std::invalid_argument); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_vector_scalar_1stDeriv) { +TEST_F(mathMix, operator_multiplication_ffv_vector_scalar_1stDeriv) { using stan::math::fvar; using stan::math::multiply; using stan::math::var; @@ -988,7 +989,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_vector_scalar_1stDeriv) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_vector_scalar_2ndDeriv_1) { +TEST_F(mathMix, operator_multiplication_ffv_vector_scalar_2ndDeriv_1) { using stan::math::fvar; using stan::math::multiply; using stan::math::var; @@ -1017,7 +1018,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_vector_scalar_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_vector_scalar_2ndDeriv_2) { +TEST_F(mathMix, operator_multiplication_ffv_vector_scalar_2ndDeriv_2) { using stan::math::fvar; using stan::math::multiply; using stan::math::var; @@ -1046,7 +1047,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_vector_scalar_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_vector_scalar_3rdDeriv) { +TEST_F(mathMix, operator_multiplication_ffv_vector_scalar_3rdDeriv) { using stan::math::fvar; using stan::math::multiply; using stan::math::var; @@ -1080,7 +1081,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_vector_scalar_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_scalar_1stDeriv) { +TEST_F(mathMix, operator_multiplication_ffv_rowvector_scalar_1stDeriv) { using stan::math::fvar; using stan::math::multiply; using stan::math::row_vector_d; @@ -1158,7 +1159,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_scalar_1stDeriv) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_scalar_2ndDeriv_1) { +TEST_F(mathMix, operator_multiplication_ffv_rowvector_scalar_2ndDeriv_1) { using stan::math::fvar; using stan::math::multiply; using stan::math::row_vector_d; @@ -1187,7 +1188,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_scalar_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_scalar_2ndDeriv_2) { +TEST_F(mathMix, operator_multiplication_ffv_rowvector_scalar_2ndDeriv_2) { using stan::math::fvar; using stan::math::multiply; using stan::math::row_vector_d; @@ -1216,7 +1217,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_scalar_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_scalar_3rdDeriv) { +TEST_F(mathMix, operator_multiplication_ffv_rowvector_scalar_3rdDeriv) { using stan::math::fvar; using stan::math::multiply; using stan::math::row_vector_d; @@ -1249,7 +1250,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_scalar_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_scalar_1stDeriv) { +TEST_F(mathMix, operator_multiplication_ffv_matrix_scalar_1stDeriv) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -1341,7 +1342,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_scalar_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_scalar_2ndDeriv_1) { +TEST_F(mathMix, operator_multiplication_ffv_matrix_scalar_2ndDeriv_1) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -1371,7 +1372,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_scalar_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_scalar_2ndDeriv_2) { +TEST_F(mathMix, operator_multiplication_ffv_matrix_scalar_2ndDeriv_2) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -1401,7 +1402,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_scalar_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_scalar_3rdDeriv) { +TEST_F(mathMix, operator_multiplication_ffv_matrix_scalar_3rdDeriv) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -1436,7 +1437,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_scalar_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_vector_1stDeriv) { +TEST_F(mathMix, operator_multiplication_ffv_rowvector_vector_1stDeriv) { using stan::math::fvar; using stan::math::multiply; using stan::math::row_vector_d; @@ -1482,7 +1483,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_vector_1stDeriv) { EXPECT_THROW(multiply(v1, d2), std::invalid_argument); EXPECT_THROW(multiply(d1, v2), std::invalid_argument); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_vector_2ndDeriv_1) { +TEST_F(mathMix, operator_multiplication_ffv_rowvector_vector_2ndDeriv_1) { using stan::math::fvar; using stan::math::multiply; using stan::math::row_vector_d; @@ -1515,7 +1516,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_vector_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_vector_2ndDeriv_2) { +TEST_F(mathMix, operator_multiplication_ffv_rowvector_vector_2ndDeriv_2) { using stan::math::fvar; using stan::math::multiply; using stan::math::row_vector_d; @@ -1548,7 +1549,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_vector_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_vector_3rdDeriv) { +TEST_F(mathMix, operator_multiplication_ffv_rowvector_vector_3rdDeriv) { using stan::math::fvar; using stan::math::multiply; using stan::math::row_vector_d; @@ -1587,7 +1588,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_vector_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_vector_rowvector_1stDeriv) { +TEST_F(mathMix, operator_multiplication_ffv_vector_rowvector_1stDeriv) { using stan::math::fvar; using stan::math::matrix_ffv; using stan::math::multiply; @@ -1687,7 +1688,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_vector_rowvector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_vector_rowvector_2ndDeriv_1) { +TEST_F(mathMix, operator_multiplication_ffv_vector_rowvector_2ndDeriv_1) { using stan::math::fvar; using stan::math::matrix_ffv; using stan::math::multiply; @@ -1724,7 +1725,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_vector_rowvector_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_vector_rowvector_2ndDeriv_2) { +TEST_F(mathMix, operator_multiplication_ffv_vector_rowvector_2ndDeriv_2) { using stan::math::fvar; using stan::math::matrix_ffv; using stan::math::multiply; @@ -1761,7 +1762,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_vector_rowvector_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_vector_rowvector_3rdDeriv) { +TEST_F(mathMix, operator_multiplication_ffv_vector_rowvector_3rdDeriv) { using stan::math::fvar; using stan::math::matrix_ffv; using stan::math::multiply; @@ -1804,7 +1805,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_vector_rowvector_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[1]); EXPECT_FLOAT_EQ(0, h[2]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_vector_1stDeriv) { +TEST_F(mathMix, operator_multiplication_ffv_matrix_vector_1stDeriv) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -1868,7 +1869,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_vector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_vector_2ndDeriv_1) { +TEST_F(mathMix, operator_multiplication_ffv_matrix_vector_2ndDeriv_1) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -1907,7 +1908,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_vector_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_vector_2ndDeriv_2) { +TEST_F(mathMix, operator_multiplication_ffv_matrix_vector_2ndDeriv_2) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -1946,7 +1947,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_vector_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_vector_3rdDeriv) { +TEST_F(mathMix, operator_multiplication_ffv_matrix_vector_3rdDeriv) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -1993,7 +1994,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_vector_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_vector_exception) { +TEST_F(mathMix, operator_multiplication_ffv_matrix_vector_exception) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -2010,7 +2011,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_vector_exception) { EXPECT_THROW(multiply(v1, d2), std::invalid_argument); EXPECT_THROW(multiply(d1, v2), std::invalid_argument); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_matrix_1stDeriv) { +TEST_F(mathMix, operator_multiplication_ffv_rowvector_matrix_1stDeriv) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -2069,7 +2070,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_matrix_1stDeriv) { EXPECT_FLOAT_EQ(4, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_matrix_2ndDeriv_1) { +TEST_F(mathMix, operator_multiplication_ffv_rowvector_matrix_2ndDeriv_1) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -2110,7 +2111,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_matrix_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_matrix_2ndDeriv_2) { +TEST_F(mathMix, operator_multiplication_ffv_rowvector_matrix_2ndDeriv_2) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -2151,7 +2152,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_matrix_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_matrix_3rdDeriv) { +TEST_F(mathMix, operator_multiplication_ffv_rowvector_matrix_3rdDeriv) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -2201,7 +2202,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_matrix_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_matrix_exception) { +TEST_F(mathMix, operator_multiplication_ffv_rowvector_matrix_exception) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -2218,7 +2219,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_rowvector_matrix_exception) { EXPECT_THROW(multiply(v1, d2), std::invalid_argument); EXPECT_THROW(multiply(d1, v2), std::invalid_argument); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_matrix_1stDeriv) { +TEST_F(mathMix, operator_multiplication_ffv_matrix_matrix_1stDeriv) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -2288,7 +2289,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_matrix_1stDeriv) { EXPECT_FLOAT_EQ(24, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_matrix_2ndDeriv_1) { +TEST_F(mathMix, operator_multiplication_ffv_matrix_matrix_2ndDeriv_1) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -2328,7 +2329,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_matrix_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_matrix_2ndDeriv_2) { +TEST_F(mathMix, operator_multiplication_ffv_matrix_matrix_2ndDeriv_2) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -2368,7 +2369,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_matrix_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_matrix_3rdDeriv) { +TEST_F(mathMix, operator_multiplication_ffv_matrix_matrix_3rdDeriv) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -2420,7 +2421,7 @@ TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_matrix_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorMultiplication, ffv_matrix_matrix_exception) { +TEST_F(mathMix, operator_multiplication_ffv_matrix_matrix_exception) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; diff --git a/test/unit/math/mix/fun/operator_subtraction_test.cpp b/test/unit/math/mix/fun/operator_subtraction_test.cpp index f3a89809ba8..ed092aca909 100644 --- a/test/unit/math/mix/fun/operator_subtraction_test.cpp +++ b/test/unit/math/mix/fun/operator_subtraction_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(AgradMixMatrixOperatorSubtraction, fv_scalar_matrix_1stDeriv) { +TEST_F(mathMix, operator_subtraction_fv_scalar_matrix_1stDeriv) { using stan::math::fvar; using stan::math::matrix_fv; using stan::math::subtract; @@ -44,7 +45,7 @@ TEST(AgradMixMatrixOperatorSubtraction, fv_scalar_matrix_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, fv_scalar_matrix_2ndDeriv) { +TEST_F(mathMix, operator_subtraction_fv_scalar_matrix_2ndDeriv) { using stan::math::fvar; using stan::math::matrix_fv; using stan::math::subtract; @@ -67,7 +68,7 @@ TEST(AgradMixMatrixOperatorSubtraction, fv_scalar_matrix_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, fv_scalar_vector_1stDeriv) { +TEST_F(mathMix, operator_subtraction_fv_scalar_vector_1stDeriv) { using stan::math::fvar; using stan::math::subtract; using stan::math::vector_fv; @@ -109,7 +110,7 @@ TEST(AgradMixMatrixOperatorSubtraction, fv_scalar_vector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, fv_scalar_vector_2ndDeriv) { +TEST_F(mathMix, operator_subtraction_fv_scalar_vector_2ndDeriv) { using stan::math::fvar; using stan::math::subtract; using stan::math::vector_fv; @@ -132,7 +133,7 @@ TEST(AgradMixMatrixOperatorSubtraction, fv_scalar_vector_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, fv_scalar_rowvector_1stDeriv) { +TEST_F(mathMix, operator_subtraction_fv_scalar_rowvector_1stDeriv) { using stan::math::fvar; using stan::math::row_vector_fv; using stan::math::subtract; @@ -174,7 +175,7 @@ TEST(AgradMixMatrixOperatorSubtraction, fv_scalar_rowvector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, fv_scalar_rowvector_2ndDeriv) { +TEST_F(mathMix, operator_subtraction_fv_scalar_rowvector_2ndDeriv) { using stan::math::fvar; using stan::math::row_vector_fv; using stan::math::subtract; @@ -197,7 +198,7 @@ TEST(AgradMixMatrixOperatorSubtraction, fv_scalar_rowvector_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, fv_vector_vector_1stDeriv) { +TEST_F(mathMix, operator_subtraction_fv_vector_vector_1stDeriv) { using stan::math::fvar; using stan::math::subtract; using stan::math::vector_d; @@ -278,7 +279,7 @@ TEST(AgradMixMatrixOperatorSubtraction, fv_vector_vector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, fv_vector_vector_2ndDeriv) { +TEST_F(mathMix, operator_subtraction_fv_vector_vector_2ndDeriv) { using stan::math::fvar; using stan::math::subtract; using stan::math::vector_d; @@ -315,7 +316,7 @@ TEST(AgradMixMatrixOperatorSubtraction, fv_vector_vector_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, fv_vector_vector_exception) { +TEST_F(mathMix, operator_subtraction_fv_vector_vector_exception) { using stan::math::fvar; using stan::math::subtract; using stan::math::vector_d; @@ -330,7 +331,7 @@ TEST(AgradMixMatrixOperatorSubtraction, fv_vector_vector_exception) { EXPECT_THROW(subtract(d1, v2), std::invalid_argument); EXPECT_THROW(subtract(v1, v2), std::invalid_argument); } -TEST(AgradMixMatrixOperatorSubtraction, fv_rowvector_rowvector_1stDeriv) { +TEST_F(mathMix, operator_subtraction_fv_rowvector_rowvector_1stDeriv) { using stan::math::fvar; using stan::math::row_vector_d; using stan::math::row_vector_fv; @@ -411,7 +412,7 @@ TEST(AgradMixMatrixOperatorSubtraction, fv_rowvector_rowvector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, fv_rowvector_rowvector_2ndDeriv) { +TEST_F(mathMix, operator_subtraction_fv_rowvector_rowvector_2ndDeriv) { using stan::math::fvar; using stan::math::row_vector_d; using stan::math::row_vector_fv; @@ -448,7 +449,7 @@ TEST(AgradMixMatrixOperatorSubtraction, fv_rowvector_rowvector_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, fv_rowvector_rowvector_exception) { +TEST_F(mathMix, operator_subtraction_fv_rowvector_rowvector_exception) { using stan::math::fvar; using stan::math::row_vector_d; using stan::math::row_vector_fv; @@ -463,7 +464,7 @@ TEST(AgradMixMatrixOperatorSubtraction, fv_rowvector_rowvector_exception) { EXPECT_THROW(subtract(v1, d2), std::invalid_argument); EXPECT_THROW(subtract(v1, v2), std::invalid_argument); } -TEST(AgradMixMatrixOperatorSubtraction, fv_matrix_matrix_1stDeriv) { +TEST_F(mathMix, operator_subtraction_fv_matrix_matrix_1stDeriv) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_fv; @@ -536,7 +537,7 @@ TEST(AgradMixMatrixOperatorSubtraction, fv_matrix_matrix_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, fv_matrix_matrix_2ndDeriv) { +TEST_F(mathMix, operator_subtraction_fv_matrix_matrix_2ndDeriv) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_fv; @@ -573,7 +574,7 @@ TEST(AgradMixMatrixOperatorSubtraction, fv_matrix_matrix_2ndDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, fv_matrix_matrix_exception) { +TEST_F(mathMix, operator_subtraction_fv_matrix_matrix_exception) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_fv; @@ -587,7 +588,7 @@ TEST(AgradMixMatrixOperatorSubtraction, fv_matrix_matrix_exception) { EXPECT_THROW(subtract(v1, d2), std::invalid_argument); EXPECT_THROW(subtract(v1, v2), std::invalid_argument); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_matrix_1stDeriv) { +TEST_F(mathMix, operator_subtraction_ffv_scalar_matrix_1stDeriv) { using stan::math::fvar; using stan::math::matrix_ffv; using stan::math::subtract; @@ -629,7 +630,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_matrix_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_matrix_2ndDeriv_1) { +TEST_F(mathMix, operator_subtraction_ffv_scalar_matrix_2ndDeriv_1) { using stan::math::fvar; using stan::math::matrix_ffv; using stan::math::subtract; @@ -652,7 +653,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_matrix_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_matrix_2ndDeriv_2) { +TEST_F(mathMix, operator_subtraction_ffv_scalar_matrix_2ndDeriv_2) { using stan::math::fvar; using stan::math::matrix_ffv; using stan::math::subtract; @@ -675,7 +676,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_matrix_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_matrix_3rdDeriv) { +TEST_F(mathMix, operator_subtraction_ffv_scalar_matrix_3rdDeriv) { using stan::math::fvar; using stan::math::matrix_ffv; using stan::math::subtract; @@ -702,7 +703,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_matrix_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_vector_1stDeriv) { +TEST_F(mathMix, operator_subtraction_ffv_scalar_vector_1stDeriv) { using stan::math::fvar; using stan::math::subtract; using stan::math::vector_ffv; @@ -744,7 +745,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_vector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_vector_2ndDeriv_1) { +TEST_F(mathMix, operator_subtraction_ffv_scalar_vector_2ndDeriv_1) { using stan::math::fvar; using stan::math::subtract; using stan::math::vector_ffv; @@ -767,7 +768,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_vector_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_vector_2ndDeriv_2) { +TEST_F(mathMix, operator_subtraction_ffv_scalar_vector_2ndDeriv_2) { using stan::math::fvar; using stan::math::subtract; using stan::math::vector_ffv; @@ -790,7 +791,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_vector_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_vector_3rdDeriv) { +TEST_F(mathMix, operator_subtraction_ffv_scalar_vector_3rdDeriv) { using stan::math::fvar; using stan::math::subtract; using stan::math::vector_ffv; @@ -817,7 +818,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_vector_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_rowvector_1stDeriv) { +TEST_F(mathMix, operator_subtraction_ffv_scalar_rowvector_1stDeriv) { using stan::math::fvar; using stan::math::row_vector_ffv; using stan::math::subtract; @@ -859,7 +860,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_rowvector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_rowvector_2ndDeriv_1) { +TEST_F(mathMix, operator_subtraction_ffv_scalar_rowvector_2ndDeriv_1) { using stan::math::fvar; using stan::math::row_vector_ffv; using stan::math::subtract; @@ -882,7 +883,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_rowvector_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_rowvector_2ndDeriv_2) { +TEST_F(mathMix, operator_subtraction_ffv_scalar_rowvector_2ndDeriv_2) { using stan::math::fvar; using stan::math::row_vector_ffv; using stan::math::subtract; @@ -905,7 +906,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_rowvector_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_rowvector_3rdDeriv) { +TEST_F(mathMix, operator_subtraction_ffv_scalar_rowvector_3rdDeriv) { using stan::math::fvar; using stan::math::row_vector_ffv; using stan::math::subtract; @@ -932,7 +933,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_scalar_rowvector_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_vector_vector_1stDeriv) { +TEST_F(mathMix, operator_subtraction_ffv_vector_vector_1stDeriv) { using stan::math::fvar; using stan::math::subtract; using stan::math::vector_d; @@ -1013,7 +1014,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_vector_vector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_vector_vector_2ndDeriv_1) { +TEST_F(mathMix, operator_subtraction_ffv_vector_vector_2ndDeriv_1) { using stan::math::fvar; using stan::math::subtract; using stan::math::vector_d; @@ -1050,7 +1051,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_vector_vector_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_vector_vector_2ndDeriv_2) { +TEST_F(mathMix, operator_subtraction_ffv_vector_vector_2ndDeriv_2) { using stan::math::fvar; using stan::math::subtract; using stan::math::vector_d; @@ -1087,7 +1088,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_vector_vector_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_vector_vector_3rdDeriv) { +TEST_F(mathMix, operator_subtraction_ffv_vector_vector_3rdDeriv) { using stan::math::fvar; using stan::math::subtract; using stan::math::vector_d; @@ -1134,7 +1135,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_vector_vector_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_vector_vector_exception) { +TEST_F(mathMix, operator_subtraction_ffv_vector_vector_exception) { using stan::math::fvar; using stan::math::subtract; using stan::math::vector_d; @@ -1149,7 +1150,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_vector_vector_exception) { EXPECT_THROW(subtract(d1, v2), std::invalid_argument); EXPECT_THROW(subtract(v1, v2), std::invalid_argument); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_rowvector_rowvector_1stDeriv) { +TEST_F(mathMix, operator_subtraction_ffv_rowvector_rowvector_1stDeriv) { using stan::math::fvar; using stan::math::row_vector_d; using stan::math::row_vector_ffv; @@ -1230,7 +1231,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_rowvector_rowvector_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_rowvector_rowvector_2ndDeriv_1) { +TEST_F(mathMix, operator_subtraction_ffv_rowvector_rowvector_2ndDeriv_1) { using stan::math::fvar; using stan::math::row_vector_d; using stan::math::row_vector_ffv; @@ -1267,7 +1268,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_rowvector_rowvector_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_rowvector_rowvector_2ndDeriv_2) { +TEST_F(mathMix, operator_subtraction_ffv_rowvector_rowvector_2ndDeriv_2) { using stan::math::fvar; using stan::math::row_vector_d; using stan::math::row_vector_ffv; @@ -1304,7 +1305,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_rowvector_rowvector_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_rowvector_rowvector_3rdDeriv) { +TEST_F(mathMix, operator_subtraction_ffv_rowvector_rowvector_3rdDeriv) { using stan::math::fvar; using stan::math::row_vector_d; using stan::math::row_vector_ffv; @@ -1351,7 +1352,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_rowvector_rowvector_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_rowvector_rowvector_exception) { +TEST_F(mathMix, operator_subtraction_ffv_rowvector_rowvector_exception) { using stan::math::fvar; using stan::math::row_vector_d; using stan::math::row_vector_ffv; @@ -1366,7 +1367,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_rowvector_rowvector_exception) { EXPECT_THROW(subtract(v1, d2), std::invalid_argument); EXPECT_THROW(subtract(v1, v2), std::invalid_argument); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_matrix_matrix_1stDeriv) { +TEST_F(mathMix, operator_subtraction_ffv_matrix_matrix_1stDeriv) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -1440,7 +1441,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_matrix_matrix_1stDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_matrix_matrix_2ndDeriv_1) { +TEST_F(mathMix, operator_subtraction_ffv_matrix_matrix_2ndDeriv_1) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -1478,7 +1479,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_matrix_matrix_2ndDeriv_1) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_matrix_matrix_2ndDeriv_2) { +TEST_F(mathMix, operator_subtraction_ffv_matrix_matrix_2ndDeriv_2) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -1516,7 +1517,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_matrix_matrix_2ndDeriv_2) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_matrix_matrix_3rdDeriv) { +TEST_F(mathMix, operator_subtraction_ffv_matrix_matrix_3rdDeriv) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; @@ -1562,7 +1563,7 @@ TEST(AgradMixMatrixOperatorSubtraction, ffv_matrix_matrix_3rdDeriv) { EXPECT_FLOAT_EQ(0, h[2]); EXPECT_FLOAT_EQ(0, h[3]); } -TEST(AgradMixMatrixOperatorSubtraction, ffv_matrix_matrix_exception) { +TEST_F(mathMix, operator_subtraction_ffv_matrix_matrix_exception) { using stan::math::fvar; using stan::math::matrix_d; using stan::math::matrix_ffv; diff --git a/test/unit/math/mix/fun/ordered_constrain_test.cpp b/test/unit/math/mix/fun/ordered_constrain_test.cpp index 91596c3c785..8a7133e9ce0 100644 --- a/test/unit/math/mix/fun/ordered_constrain_test.cpp +++ b/test/unit/math/mix/fun/ordered_constrain_test.cpp @@ -1,4 +1,5 @@ #include +#include namespace ordered_constrain_test { template @@ -32,7 +33,7 @@ void expect_ordered_transform(const T& x) { } } // namespace ordered_constrain_test -TEST(MathMixMatFun, orderedTransform) { +TEST_F(mathMix, orderedTransform) { Eigen::VectorXd v0(0); ordered_constrain_test::expect_ordered_transform(v0); diff --git a/test/unit/math/mix/fun/owens_t_test.cpp b/test/unit/math/mix/fun/owens_t_test.cpp index ace6a7b260c..687e86039ff 100644 --- a/test/unit/math/mix/fun/owens_t_test.cpp +++ b/test/unit/math/mix/fun/owens_t_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, owensT) { +TEST_F(mathMix, owensT) { auto f = [](const auto& x1, const auto& x2) { return stan::math::owens_t(x1, x2); }; @@ -15,7 +16,7 @@ TEST(mathMixScalFun, owensT) { stan::test::expect_ad(f, nan, nan); } -TEST(mathMixScalFun, owensT_varmat) { +TEST_F(mathMix, owensT_varmat) { auto f = [](const auto& x1, const auto& x2) { return stan::math::owens_t(x1, x2); }; @@ -30,7 +31,7 @@ TEST(mathMixScalFun, owensT_varmat) { stan::test::expect_ad_matvar(f, scal, vec); } -TEST(mathMixScalFun, owensT_vec) { +TEST_F(mathMix, owensT_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::owens_t; return owens_t(x1, x2); @@ -43,7 +44,7 @@ TEST(mathMixScalFun, owensT_vec) { stan::test::expect_ad_vectorized_binary(f, in1, in2); } -TEST(mathMixScalFun, owensT_vec_matvar) { +TEST_F(mathMix, owensT_vec_matvar) { auto f = [](const auto& x1, const auto& x2) { using stan::math::owens_t; return owens_t(x1, x2); diff --git a/test/unit/math/mix/fun/plus_test.cpp b/test/unit/math/mix/fun/plus_test.cpp index 90a167cdb22..e32aed0c5b3 100644 --- a/test/unit/math/mix/fun/plus_test.cpp +++ b/test/unit/math/mix/fun/plus_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, plus) { +TEST_F(mathMix, plus) { auto f = [](const auto& x) { return stan::math::plus(x); }; double x = 10; diff --git a/test/unit/math/mix/fun/polar_test.cpp b/test/unit/math/mix/fun/polar_test.cpp index f1a1a8805b9..03c64ba94ca 100644 --- a/test/unit/math/mix/fun/polar_test.cpp +++ b/test/unit/math/mix/fun/polar_test.cpp @@ -1,9 +1,10 @@ #include +#include #include #include #include -TEST(mathMixFun, polar) { +TEST_F(mathMix, polar) { auto f = [](const auto& r, const auto& theta) { using stan::math::polar; auto y = polar(r, theta); diff --git a/test/unit/math/mix/fun/positive_ordered_constrain_test.cpp b/test/unit/math/mix/fun/positive_ordered_constrain_test.cpp index c43d25df693..7a7cb6fb39f 100644 --- a/test/unit/math/mix/fun/positive_ordered_constrain_test.cpp +++ b/test/unit/math/mix/fun/positive_ordered_constrain_test.cpp @@ -1,4 +1,5 @@ #include +#include namespace positive_ordered_constrain_test { template @@ -32,7 +33,7 @@ void expect_positive_ordered_transform(const T& x) { } } // namespace positive_ordered_constrain_test -TEST(MathMixMatFun, positiveOrderedTransform) { +TEST_F(mathMix, positiveOrderedTransform) { Eigen::VectorXd v0(0); positive_ordered_constrain_test::expect_positive_ordered_transform(v0); diff --git a/test/unit/math/mix/fun/pow_part1_test.cpp b/test/unit/math/mix/fun/pow_part1_test.cpp index f97b645a8ec..4a226e273d6 100644 --- a/test/unit/math/mix/fun/pow_part1_test.cpp +++ b/test/unit/math/mix/fun/pow_part1_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -22,7 +23,7 @@ void expect_arith_instantiate() { } // this one's been tricky to instantiate, so test all instances -TEST(mathMixScalFun, powInstantiations) { +TEST_F(mathMix, powInstantiations) { using stan::math::fvar; using stan::math::var; expect_arith_instantiate(); @@ -33,7 +34,7 @@ TEST(mathMixScalFun, powInstantiations) { expect_arith_instantiate>>(); } -TEST(mathMixScalFun, pow) { +TEST_F(mathMix, pow) { auto f = [](const auto& x1, const auto& x2) { using stan::math::pow; return pow(x1, x2); diff --git a/test/unit/math/mix/fun/pow_part2_test.cpp b/test/unit/math/mix/fun/pow_part2_test.cpp index 6fb46d08e2d..d957d079403 100644 --- a/test/unit/math/mix/fun/pow_part2_test.cpp +++ b/test/unit/math/mix/fun/pow_part2_test.cpp @@ -1,9 +1,10 @@ #include +#include #include #include #include -TEST(mathMixFun, complexPow) { +TEST_F(mathMix, complexPow) { auto f = [](const auto& x1, const auto& x2) { using stan::math::pow; return pow(x1, x2); @@ -48,7 +49,7 @@ TEST(mathMixFun, complexPow) { stan::test::expect_ad_vectorized_binary(tols, f, din1, din2); } -TEST(mathMixFun, powIntAmbiguityTest) { +TEST_F(mathMix, powIntAmbiguityTest) { using stan::math::pow; // included to check ambiguities using stan::math::var; using std::complex; @@ -94,7 +95,7 @@ TEST(mathMixFun, powIntAmbiguityTest) { e = e + 0; } -TEST(mathMixFun, powIntAmbiguityTestFvar) { +TEST_F(mathMix, powIntAmbiguityTestFvar) { using stan::math::fvar; using stan::math::pow; // included to check ambiguities using std::complex; diff --git a/test/unit/math/mix/fun/pow_part3_test.cpp b/test/unit/math/mix/fun/pow_part3_test.cpp index 7549e0ce648..57bf7552aba 100644 --- a/test/unit/math/mix/fun/pow_part3_test.cpp +++ b/test/unit/math/mix/fun/pow_part3_test.cpp @@ -1,9 +1,10 @@ #include +#include #include #include #include -TEST(mathMixScalFun, pow_varmat) { +TEST_F(mathMix, pow_varmat) { auto f = [](const auto& x1, const auto& x2) { using stan::math::pow; using std::pow; diff --git a/test/unit/math/mix/fun/primitive_value_test.cpp b/test/unit/math/mix/fun/primitive_value_test.cpp index 2f0846d7b2e..5928370e18e 100644 --- a/test/unit/math/mix/fun/primitive_value_test.cpp +++ b/test/unit/math/mix/fun/primitive_value_test.cpp @@ -1,9 +1,10 @@ #include +#include #include #include #include -TEST(AgradMix, primitiveValueRevNested) { +TEST_F(mathMix, primitiveValueRevNested) { using stan::math::fvar; using stan::math::primitive_value; using stan::math::var; @@ -16,7 +17,7 @@ TEST(AgradMix, primitiveValueRevNested) { EXPECT_EQ(3, primitive_value(3)); } -TEST(AgradMix, primitiveValueNanRevNested) { +TEST_F(mathMix, primitiveValueNanRevNested) { using stan::math::fvar; using stan::math::primitive_value; using stan::math::var; diff --git a/test/unit/math/mix/fun/prod_test.cpp b/test/unit/math/mix/fun/prod_test.cpp index 4326e18ceff..4b100c666bc 100644 --- a/test/unit/math/mix/fun/prod_test.cpp +++ b/test/unit/math/mix/fun/prod_test.cpp @@ -1,4 +1,5 @@ #include +#include #include template @@ -14,7 +15,7 @@ void expect_prod(const T& m) { stan::test::expect_ad(f, m); } -TEST(mathMixMatFun, prod) { +TEST_F(mathMix, prod) { Eigen::MatrixXd m00(0, 0); Eigen::MatrixXd m11(1, 1); m11 << 2; diff --git a/test/unit/math/mix/fun/proj_test.cpp b/test/unit/math/mix/fun/proj_test.cpp index ea0006cbc7c..45e5be3148a 100644 --- a/test/unit/math/mix/fun/proj_test.cpp +++ b/test/unit/math/mix/fun/proj_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(mixScalFun, proj) { +TEST_F(mathMix, proj) { auto f = [](const auto& x) { return proj(x); }; stan::test::expect_complex_common(f); } diff --git a/test/unit/math/mix/fun/promote_scalar_test.cpp b/test/unit/math/mix/fun/promote_scalar_test.cpp index f49637881ea..f70b1e1590f 100644 --- a/test/unit/math/mix/fun/promote_scalar_test.cpp +++ b/test/unit/math/mix/fun/promote_scalar_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -66,7 +67,7 @@ void test_promote_scalar() { stan::math::test::expect_same_value_of_rec(tester, result); } -TEST(mixFun, promote_scalar_tuple) { +TEST_F(mathMix, promote_scalar_tuple) { using stan::math::fvar; using stan::math::var; test_promote_scalar(); @@ -95,7 +96,7 @@ void test_promote_scalar_basic() { stan::math::test::expect_same_value_of_rec(x, z); } -TEST(mixFun, promote_scalar_tuple_basic) { +TEST_F(mathMix, promote_scalar_tuple_basic) { using stan::math::fvar; using stan::math::var; test_promote_scalar_basic(); diff --git a/test/unit/math/mix/fun/pseudo_eigenvalues_test.cpp b/test/unit/math/mix/fun/pseudo_eigenvalues_test.cpp index 9b3c48192a7..85d53e08336 100644 --- a/test/unit/math/mix/fun/pseudo_eigenvalues_test.cpp +++ b/test/unit/math/mix/fun/pseudo_eigenvalues_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixFun, pseudoEigenvalues) { +TEST_F(mathMix, pseudoEigenvalues) { auto f = [](const auto& x) { using stan::math::pseudo_eigenvalues; return pseudo_eigenvalues(x); diff --git a/test/unit/math/mix/fun/pseudo_eigenvectors_test.cpp b/test/unit/math/mix/fun/pseudo_eigenvectors_test.cpp index f8695e2dd8a..5cbbca660ba 100644 --- a/test/unit/math/mix/fun/pseudo_eigenvectors_test.cpp +++ b/test/unit/math/mix/fun/pseudo_eigenvectors_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixFun, pseudoEigenvectors) { +TEST_F(mathMix, pseudoEigenvectors) { auto f = [](const auto& x) { using stan::math::pseudo_eigenvectors; return pseudo_eigenvectors(x); @@ -36,7 +37,7 @@ void test_pseudo_eigendecomposition() { } } -TEST(mathMixFun, pseudoEigenVectors) { +TEST_F(mathMix, pseudoEigenVectors) { using d_t = double; using v_t = stan::math::var; using fd_t = stan::math::fvar; diff --git a/test/unit/math/mix/fun/qr_Q_test.cpp b/test/unit/math/mix/fun/qr_Q_test.cpp index 0ac7afbc35c..603016cb705 100644 --- a/test/unit/math/mix/fun/qr_Q_test.cpp +++ b/test/unit/math/mix/fun/qr_Q_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, qrQ) { +TEST_F(mathMix, qrQ) { auto f = [](const auto& x) { return stan::math::qr_Q(x); }; Eigen::MatrixXd a(0, 0); diff --git a/test/unit/math/mix/fun/qr_R_test.cpp b/test/unit/math/mix/fun/qr_R_test.cpp index e502f26f0ae..6c1be057afb 100644 --- a/test/unit/math/mix/fun/qr_R_test.cpp +++ b/test/unit/math/mix/fun/qr_R_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, qrR) { +TEST_F(mathMix, qrR) { auto f = [](const auto& x) { return stan::math::qr_R(x); }; Eigen::MatrixXd a(0, 0); diff --git a/test/unit/math/mix/fun/qr_test.cpp b/test/unit/math/mix/fun/qr_test.cpp index a3f7b1b8baf..7a3cd1d7236 100644 --- a/test/unit/math/mix/fun/qr_test.cpp +++ b/test/unit/math/mix/fun/qr_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, qr) { +TEST_F(mathMix, qr) { auto f = [](const auto& x) { return std::get<0>(stan::math::qr(x)); }; auto g = [](const auto& x) { return std::get<1>(stan::math::qr(x)); }; diff --git a/test/unit/math/mix/fun/qr_thin_Q_test.cpp b/test/unit/math/mix/fun/qr_thin_Q_test.cpp index 30fbdaa3030..90be73bae48 100644 --- a/test/unit/math/mix/fun/qr_thin_Q_test.cpp +++ b/test/unit/math/mix/fun/qr_thin_Q_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, qrThinQ) { +TEST_F(mathMix, qrThinQ) { auto f = [](const auto& x) { return stan::math::qr_thin_Q(x); }; Eigen::MatrixXd a(0, 0); diff --git a/test/unit/math/mix/fun/qr_thin_R_test.cpp b/test/unit/math/mix/fun/qr_thin_R_test.cpp index c7a3cf7dbfe..0319f2bc1cb 100644 --- a/test/unit/math/mix/fun/qr_thin_R_test.cpp +++ b/test/unit/math/mix/fun/qr_thin_R_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, qrThinR) { +TEST_F(mathMix, qrThinR) { auto f = [](const auto& x) { return stan::math::qr_thin_R(x); }; Eigen::MatrixXd a(0, 0); diff --git a/test/unit/math/mix/fun/qr_thin_test.cpp b/test/unit/math/mix/fun/qr_thin_test.cpp index caeaa48a54e..b9a02267e6e 100644 --- a/test/unit/math/mix/fun/qr_thin_test.cpp +++ b/test/unit/math/mix/fun/qr_thin_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, qr_thin) { +TEST_F(mathMix, qr_thin) { auto f = [](const auto& x) { return std::get<0>(stan::math::qr_thin(x)); }; auto g = [](const auto& x) { return std::get<1>(stan::math::qr_thin(x)); }; diff --git a/test/unit/math/mix/fun/quad_form_diag_test.cpp b/test/unit/math/mix/fun/quad_form_diag_test.cpp index 2d526b4c102..1fdf25e6dd6 100644 --- a/test/unit/math/mix/fun/quad_form_diag_test.cpp +++ b/test/unit/math/mix/fun/quad_form_diag_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, quadFormDiag) { +TEST_F(mathMix, quadFormDiag) { using stan::test::relative_tolerance; auto f = [](const auto& x, const auto& y) { diff --git a/test/unit/math/mix/fun/quad_form_sym_test.cpp b/test/unit/math/mix/fun/quad_form_sym_test.cpp index 1c454db07da..a43094bd63e 100644 --- a/test/unit/math/mix/fun/quad_form_sym_test.cpp +++ b/test/unit/math/mix/fun/quad_form_sym_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, quadFormSym) { +TEST_F(mathMix, quadFormSym) { auto f = [](const auto& x, const auto& y) { auto&& x_ref = stan::math::to_ref(x); // symmetrize the input matrix @@ -66,7 +67,7 @@ TEST(MathMixMatFun, quadFormSym) { stan::test::expect_ad(g, u, v); } -TEST(MathMixMatFun, quad_form_sym_2095) { +TEST_F(mathMix, quad_form_sym_2095) { Eigen::Matrix av(2, 2); Eigen::Matrix bv(2, 2); diff --git a/test/unit/math/mix/fun/quad_form_test.cpp b/test/unit/math/mix/fun/quad_form_test.cpp index f51d6309604..4af4a1098d0 100644 --- a/test/unit/math/mix/fun/quad_form_test.cpp +++ b/test/unit/math/mix/fun/quad_form_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, quadForm) { +TEST_F(mathMix, quadForm) { using stan::test::relative_tolerance; auto f = [](const auto& x, const auto& y) { return stan::math::quad_form(x, y); diff --git a/test/unit/math/mix/fun/rank_test.cpp b/test/unit/math/mix/fun/rank_test.cpp index 9d15638b47b..7efb819ab56 100644 --- a/test/unit/math/mix/fun/rank_test.cpp +++ b/test/unit/math/mix/fun/rank_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -71,7 +72,7 @@ void test_rank_int() { EXPECT_THROW(rank(z, 2), std::out_of_range); } -TEST(AgradMixMatrixRank, rank) { +TEST_F(mathMix, rank) { using stan::math::fvar; using stan::math::rank; using stan::math::var; diff --git a/test/unit/math/mix/fun/read_corr_L_test.cpp b/test/unit/math/mix/fun/read_corr_L_test.cpp index 62b25a9931c..f710d7ff16c 100644 --- a/test/unit/math/mix/fun/read_corr_L_test.cpp +++ b/test/unit/math/mix/fun/read_corr_L_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, read_corr_L) { +TEST_F(mathMix, read_corr_L) { auto f = [](int K) { return [K](const auto& x1) { return stan::math::read_corr_L(x1, K); }; }; @@ -15,7 +16,7 @@ TEST(mathMixMatFun, read_corr_L) { stan::test::expect_ad_matvar(f(3), x2); } -TEST(mathMixMatFun, read_corr_L_lp) { +TEST_F(mathMix, read_corr_L_lp) { auto f1 = [](int K) { return [K](const auto& x1) { stan::scalar_type_t lp = 0.0; diff --git a/test/unit/math/mix/fun/read_corr_matrix_test.cpp b/test/unit/math/mix/fun/read_corr_matrix_test.cpp index 0b602560f8c..d43afeb472b 100644 --- a/test/unit/math/mix/fun/read_corr_matrix_test.cpp +++ b/test/unit/math/mix/fun/read_corr_matrix_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, read_corr_matrix) { +TEST_F(mathMix, read_corr_matrix) { auto f = [](int K) { return [K](const auto& x1) { return stan::math::read_corr_matrix(x1, K); }; }; @@ -15,7 +16,7 @@ TEST(mathMixMatFun, read_corr_matrix) { stan::test::expect_ad_matvar(f(3), x2); } -TEST(mathMixMatFun, read_corr_matrix_lp) { +TEST_F(mathMix, read_corr_matrix_lp) { auto f1 = [](int K) { return [K](const auto& x1) { stan::scalar_type_t lp = 0.0; diff --git a/test/unit/math/mix/fun/read_cov_L_test.cpp b/test/unit/math/mix/fun/read_cov_L_test.cpp index 62b2843dc49..e5f6e6fbbea 100644 --- a/test/unit/math/mix/fun/read_cov_L_test.cpp +++ b/test/unit/math/mix/fun/read_cov_L_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, read_cov_L_lp) { +TEST_F(mathMix, read_cov_L_lp) { auto f1 = [](int K) { Eigen::VectorXd rx2 = (Eigen::VectorXd::Random(K).array() + 2.0).matrix(); return [K, rx2](const auto& x1) { diff --git a/test/unit/math/mix/fun/read_cov_matrix_test.cpp b/test/unit/math/mix/fun/read_cov_matrix_test.cpp index d85aa3e3483..a290ac15474 100644 --- a/test/unit/math/mix/fun/read_cov_matrix_test.cpp +++ b/test/unit/math/mix/fun/read_cov_matrix_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, read_cov_matrix) { +TEST_F(mathMix, read_cov_matrix) { auto f = [](int K) { Eigen::VectorXd rx2 = (Eigen::VectorXd::Random(K).array() + 2.0).matrix(); return [K, rx2](const auto& x1) { @@ -25,7 +26,7 @@ TEST(mathMixMatFun, read_cov_matrix) { stan::test::expect_ad_matvar(f(3), x2); } -TEST(mathMixMatFun, read_cov_matrix_lp) { +TEST_F(mathMix, read_cov_matrix_lp) { auto f1 = [](int K) { Eigen::VectorXd rx2 = (Eigen::VectorXd::Random(K).array() + 2.0).matrix(); return [K, rx2](const auto& x1) { diff --git a/test/unit/math/mix/fun/real_test.cpp b/test/unit/math/mix/fun/real_test.cpp index 94be5b39e52..42fda5a4971 100644 --- a/test/unit/math/mix/fun/real_test.cpp +++ b/test/unit/math/mix/fun/real_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, real) { +TEST_F(mathMix, real) { auto f = [](const auto& z) { return real(z); }; stan::test::expect_complex_common(f); } diff --git a/test/unit/math/mix/fun/rep_matrix_test.cpp b/test/unit/math/mix/fun/rep_matrix_test.cpp index 293330b793f..340f1022d60 100644 --- a/test/unit/math/mix/fun/rep_matrix_test.cpp +++ b/test/unit/math/mix/fun/rep_matrix_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, repMatrix) { +TEST_F(mathMix, repMatrix) { // y is scalar auto f = [](int m, int n) { return [=](const auto& y) { diff --git a/test/unit/math/mix/fun/rep_row_vector_test.cpp b/test/unit/math/mix/fun/rep_row_vector_test.cpp index 48fe3872111..4419e32a602 100644 --- a/test/unit/math/mix/fun/rep_row_vector_test.cpp +++ b/test/unit/math/mix/fun/rep_row_vector_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, repRowVector) { +TEST_F(mathMix, repRowVector) { auto f = [](int n) { return [=](const auto& y) { return stan::math::rep_row_vector(y, n); }; }; diff --git a/test/unit/math/mix/fun/rep_vector_test.cpp b/test/unit/math/mix/fun/rep_vector_test.cpp index 52a7d5b29b8..a4ee849fbab 100644 --- a/test/unit/math/mix/fun/rep_vector_test.cpp +++ b/test/unit/math/mix/fun/rep_vector_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, repVector) { +TEST_F(mathMix, repVector) { auto f = [](int n) { return [=](const auto& y) { return stan::math::rep_vector(y, n); }; }; diff --git a/test/unit/math/mix/fun/resize_test.cpp b/test/unit/math/mix/fun/resize_test.cpp index 0738b30e95f..5e7d513224b 100644 --- a/test/unit/math/mix/fun/resize_test.cpp +++ b/test/unit/math/mix/fun/resize_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(AgradMixMatrixResize, fvar_var) { +TEST_F(mathMix, resize_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -11,7 +12,7 @@ TEST(AgradMixMatrixResize, fvar_var) { std::vector dims; stan::math::resize(x, dims); } -TEST(AgradMixMatrixResize, svec_fvar_var) { +TEST_F(mathMix, resize_svec_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -28,7 +29,7 @@ TEST(AgradMixMatrixResize, svec_fvar_var) { stan::math::resize(y, dims); EXPECT_EQ(2U, y.size()); } -TEST(AgradMixMatrixResize, vec_fvar_var) { +TEST_F(mathMix, resize_vec_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -46,7 +47,7 @@ TEST(AgradMixMatrixResize, vec_fvar_var) { stan::math::resize(v, dims); EXPECT_EQ(3, v.size()); } -TEST(AgradMixMatrixResize, rvec_fvar_var) { +TEST_F(mathMix, resize_rvec_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -64,7 +65,7 @@ TEST(AgradMixMatrixResize, rvec_fvar_var) { stan::math::resize(rv, dims); EXPECT_EQ(3, rv.size()); } -TEST(AgradMixMatrixResize, mat_fvar_var) { +TEST_F(mathMix, resize_mat_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -80,7 +81,7 @@ TEST(AgradMixMatrixResize, mat_fvar_var) { EXPECT_EQ(7, m.rows()); EXPECT_EQ(17, m.cols()); } -TEST(AgradMixMatrixResize, svec_svec_fvar_var) { +TEST_F(mathMix, resize_svec_svec_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -100,7 +101,7 @@ TEST(AgradMixMatrixResize, svec_svec_fvar_var) { EXPECT_EQ(3U, xx.size()); EXPECT_EQ(7U, xx[1].size()); } -TEST(AgradMixMatrixResize, svec_v_fvar_var) { +TEST_F(mathMix, resize_svec_v_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -121,7 +122,7 @@ TEST(AgradMixMatrixResize, svec_v_fvar_var) { EXPECT_EQ(3U, xx.size()); EXPECT_EQ(7, xx[1].size()); } -TEST(AgradMixMatrixResize, svec_rv_fvar_var) { +TEST_F(mathMix, resize_svec_rv_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -142,7 +143,7 @@ TEST(AgradMixMatrixResize, svec_rv_fvar_var) { EXPECT_EQ(3U, xx.size()); EXPECT_EQ(7, xx[1].size()); } -TEST(AgradMixMatrixResize, svec_svec_matrix_fvar_var) { +TEST_F(mathMix, resize_svec_svec_matrix_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -159,7 +160,7 @@ TEST(AgradMixMatrixResize, svec_svec_matrix_fvar_var) { EXPECT_EQ(6, mm[1][2].rows()); EXPECT_EQ(3, mm[3][4].cols()); } -TEST(AgradMixMatrixResize, fvar_fvar_var) { +TEST_F(mathMix, resize_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -168,7 +169,7 @@ TEST(AgradMixMatrixResize, fvar_fvar_var) { std::vector dims; stan::math::resize(x, dims); } -TEST(AgradMixMatrixResize, svec_fvar_fvar_var) { +TEST_F(mathMix, resize_svec_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -185,7 +186,7 @@ TEST(AgradMixMatrixResize, svec_fvar_fvar_var) { stan::math::resize(y, dims); EXPECT_EQ(2U, y.size()); } -TEST(AgradMixMatrixResize, vec_fvar_fvar_var) { +TEST_F(mathMix, resize_vec_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -203,7 +204,7 @@ TEST(AgradMixMatrixResize, vec_fvar_fvar_var) { stan::math::resize(v, dims); EXPECT_EQ(3, v.size()); } -TEST(AgradMixMatrixResize, rvec_fvar_fvar_var) { +TEST_F(mathMix, resize_rvec_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -221,7 +222,7 @@ TEST(AgradMixMatrixResize, rvec_fvar_fvar_var) { stan::math::resize(rv, dims); EXPECT_EQ(3, rv.size()); } -TEST(AgradMixMatrixResize, mat_fvar_fvar_var) { +TEST_F(mathMix, resize_mat_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -237,7 +238,7 @@ TEST(AgradMixMatrixResize, mat_fvar_fvar_var) { EXPECT_EQ(7, m.rows()); EXPECT_EQ(17, m.cols()); } -TEST(AgradMixMatrixResize, svec_svec_fvar_fvar_var) { +TEST_F(mathMix, resize_svec_svec_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -257,7 +258,7 @@ TEST(AgradMixMatrixResize, svec_svec_fvar_fvar_var) { EXPECT_EQ(3U, xx.size()); EXPECT_EQ(7U, xx[1].size()); } -TEST(AgradMixMatrixResize, svec_v_fvar_fvar_var) { +TEST_F(mathMix, resize_svec_v_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -278,7 +279,7 @@ TEST(AgradMixMatrixResize, svec_v_fvar_fvar_var) { EXPECT_EQ(3U, xx.size()); EXPECT_EQ(7, xx[1].size()); } -TEST(AgradMixMatrixResize, svec_rv_fvar_fvar_var) { +TEST_F(mathMix, resize_svec_rv_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -299,7 +300,7 @@ TEST(AgradMixMatrixResize, svec_rv_fvar_fvar_var) { EXPECT_EQ(3U, xx.size()); EXPECT_EQ(7, xx[1].size()); } -TEST(AgradMixMatrixResize, svec_svec_matrix_fvar_fvar_var) { +TEST_F(mathMix, resize_svec_svec_matrix_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; diff --git a/test/unit/math/mix/fun/reverse_test.cpp b/test/unit/math/mix/fun/reverse_test.cpp index c27bde50d6e..ec036352b41 100644 --- a/test/unit/math/mix/fun/reverse_test.cpp +++ b/test/unit/math/mix/fun/reverse_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, reverse_vector) { +TEST_F(mathMix, reverse_vector) { auto f = [](const auto& x) { return stan::math::reverse(x); }; // 0 x 0 @@ -19,7 +20,7 @@ TEST(MathMixMatFun, reverse_vector) { stan::test::expect_ad(f, x); } -TEST(MathMixMatFun, reverse_row_vector) { +TEST_F(mathMix, reverse_row_vector) { auto f = [](const auto& x) { return stan::math::reverse(x); }; // 0 x 0 @@ -37,7 +38,7 @@ TEST(MathMixMatFun, reverse_row_vector) { stan::test::expect_ad(f, x); } -TEST(MathMixMatFun, reverse_array) { +TEST_F(mathMix, reverse_array) { auto f = [](const auto& x) { return stan::math::reverse(x); }; // 0 x 0 diff --git a/test/unit/math/mix/fun/rising_factorial_test.cpp b/test/unit/math/mix/fun/rising_factorial_test.cpp index 6e798ca7e81..25b30ae7a12 100644 --- a/test/unit/math/mix/fun/rising_factorial_test.cpp +++ b/test/unit/math/mix/fun/rising_factorial_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, risingFactorial) { +TEST_F(mathMix, risingFactorial) { auto f = [](const int x2) { return [=](const auto& x1) { return stan::math::rising_factorial(x1, x2); }; }; @@ -22,7 +23,7 @@ TEST(mathMixScalFun, risingFactorial) { stan::test::expect_ad(f(2), std::numeric_limits::quiet_NaN()); } -TEST(mathMixScalFun, risingFactorial_vec) { +TEST_F(mathMix, risingFactorial_vec) { auto f = [](const auto& x1, const auto& x2) { using stan::math::rising_factorial; return rising_factorial(x1, x2); diff --git a/test/unit/math/mix/fun/round_test.cpp b/test/unit/math/mix/fun/round_test.cpp index e0537ef794f..4d34b89a18c 100644 --- a/test/unit/math/mix/fun/round_test.cpp +++ b/test/unit/math/mix/fun/round_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, round) { +TEST_F(mathMix, round) { auto f = [](const auto& x1) { return stan::math::round(x1); }; // can't autodiff round through integers for (auto x : stan::test::internal::common_nonzero_args()) diff --git a/test/unit/math/mix/fun/row_test.cpp b/test/unit/math/mix/fun/row_test.cpp index 22c73682770..1f7fc471412 100644 --- a/test/unit/math/mix/fun/row_test.cpp +++ b/test/unit/math/mix/fun/row_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, row) { +TEST_F(mathMix, row) { auto f = [](int i) { return [=](const auto& y) { return stan::math::row(y, i); }; }; diff --git a/test/unit/math/mix/fun/rows_dot_product_test.cpp b/test/unit/math/mix/fun/rows_dot_product_test.cpp index 37e4c8060a8..912292ea59a 100644 --- a/test/unit/math/mix/fun/rows_dot_product_test.cpp +++ b/test/unit/math/mix/fun/rows_dot_product_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, rowsDotProduct) { +TEST_F(mathMix, rowsDotProduct) { auto f = [](const auto& x, const auto& y) { return stan::math::rows_dot_product(x, y); }; diff --git a/test/unit/math/mix/fun/rows_dot_self_test.cpp b/test/unit/math/mix/fun/rows_dot_self_test.cpp index 4693dba707c..b0c4b5c0ad5 100644 --- a/test/unit/math/mix/fun/rows_dot_self_test.cpp +++ b/test/unit/math/mix/fun/rows_dot_self_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, rowsDotSelf) { +TEST_F(mathMix, rowsDotSelf) { auto f = [](const auto& x) { return stan::math::rows_dot_self(x); }; Eigen::MatrixXd a00(0, 0); diff --git a/test/unit/math/mix/fun/rows_test.cpp b/test/unit/math/mix/fun/rows_test.cpp index 7abdfda18c6..6ee01d1d62a 100644 --- a/test/unit/math/mix/fun/rows_test.cpp +++ b/test/unit/math/mix/fun/rows_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(AgradMixMatrixRows, ffd_vector) { +TEST_F(mathMix, ffd_vector) { using stan::math::row_vector_ffd; using stan::math::rows; using stan::math::vector_ffd; @@ -14,7 +15,7 @@ TEST(AgradMixMatrixRows, ffd_vector) { v.resize(0); EXPECT_EQ(0U, rows(v)); } -TEST(AgradMixMatrixRows, ffd_rowvector) { +TEST_F(mathMix, ffd_rowvector) { using stan::math::row_vector_ffd; using stan::math::rows; @@ -25,7 +26,7 @@ TEST(AgradMixMatrixRows, ffd_rowvector) { rv.resize(0); EXPECT_EQ(1U, rows(rv)); } -TEST(AgradMixMatrixRows, ffd_matrix) { +TEST_F(mathMix, ffd_matrix) { using stan::math::matrix_ffd; using stan::math::rows; diff --git a/test/unit/math/mix/fun/scalbn_test.cpp b/test/unit/math/mix/fun/scalbn_test.cpp index e02da4c82a4..e6ee74dc548 100644 --- a/test/unit/math/mix/fun/scalbn_test.cpp +++ b/test/unit/math/mix/fun/scalbn_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -23,7 +24,7 @@ void expect_all_scalbn(double x) { expect_scalbn>>(x); } -TEST(mathMixMatFun, scalbn) { +TEST_F(mathMix, scalbn) { double inf = std::numeric_limits::infinity(); double nan = std::numeric_limits::quiet_NaN(); for (double x : std::vector{2.3, inf, nan}) { diff --git a/test/unit/math/mix/fun/scale_matrix_exp_multiply_test.cpp b/test/unit/math/mix/fun/scale_matrix_exp_multiply_test.cpp index f8b03a30bac..837fb2d26f8 100644 --- a/test/unit/math/mix/fun/scale_matrix_exp_multiply_test.cpp +++ b/test/unit/math/mix/fun/scale_matrix_exp_multiply_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, scaleMatrixExpMultiply) { +TEST_F(mathMix, scaleMatrixExpMultiply) { using stan::test::relative_tolerance; auto f = [](const auto& t, const auto& a, const auto& b) { return stan::math::scale_matrix_exp_multiply(t, a, b); diff --git a/test/unit/math/mix/fun/sd_test.cpp b/test/unit/math/mix/fun/sd_test.cpp index 2ef3b6c5aa3..8d3ccaf5431 100644 --- a/test/unit/math/mix/fun/sd_test.cpp +++ b/test/unit/math/mix/fun/sd_test.cpp @@ -1,4 +1,5 @@ #include +#include template void expect_sd(const T& m, const stan::test::ad_tolerances& tols @@ -36,7 +37,7 @@ void expect_sd(const T& m, const stan::test::ad_tolerances& tols stan::test::expect_ad_matvar(tols, f, stm); } -TEST(MathMixMatFun, sd) { +TEST_F(mathMix, sd) { Eigen::MatrixXd a(0, 0); expect_sd(a); diff --git a/test/unit/math/mix/fun/segment_test.cpp b/test/unit/math/mix/fun/segment_test.cpp index a30b9ec5084..7cc83eadb30 100644 --- a/test/unit/math/mix/fun/segment_test.cpp +++ b/test/unit/math/mix/fun/segment_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, segment) { +TEST_F(mathMix, segment) { auto f = [](int i, int n) { return [=](const auto& y) { return stan::math::segment(y, i, n); }; }; diff --git a/test/unit/math/mix/fun/sign_test.cpp b/test/unit/math/mix/fun/sign_test.cpp index 7c3edf836ee..0cf78a977ed 100644 --- a/test/unit/math/mix/fun/sign_test.cpp +++ b/test/unit/math/mix/fun/sign_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixScalFun, sign) { +TEST_F(mathMix, sign) { auto f = [](const auto& x) { return stan::math::sign(x); }; stan::test::expect_ad(f, -13.2); diff --git a/test/unit/math/mix/fun/signbit_test.cpp b/test/unit/math/mix/fun/signbit_test.cpp index 357c9d72121..9b652b58ae2 100644 --- a/test/unit/math/mix/fun/signbit_test.cpp +++ b/test/unit/math/mix/fun/signbit_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -21,7 +22,7 @@ void expect_signbit() { EXPECT_TRUE(signbit(T(-1.0))); } -TEST(mixFun, signbit) { +TEST_F(mathMix, signbit) { using stan::math::fvar; using stan::math::var; expect_signbit(); diff --git a/test/unit/math/mix/fun/simplex_constrain_test.cpp b/test/unit/math/mix/fun/simplex_constrain_test.cpp index 355657c0ade..021db588ccd 100644 --- a/test/unit/math/mix/fun/simplex_constrain_test.cpp +++ b/test/unit/math/mix/fun/simplex_constrain_test.cpp @@ -1,4 +1,5 @@ #include +#include namespace simplex_constrain_test { template @@ -32,7 +33,7 @@ void expect_simplex_transform(const T& x) { } } // namespace simplex_constrain_test -TEST(MathMixMatFun, simplexTransform) { +TEST_F(mathMix, simplexTransform) { Eigen::VectorXd v0(0); simplex_constrain_test::expect_simplex_transform(v0); diff --git a/test/unit/math/mix/fun/sin_test.cpp b/test/unit/math/mix/fun/sin_test.cpp index 813b7b12752..4def8d2a905 100644 --- a/test/unit/math/mix/fun/sin_test.cpp +++ b/test/unit/math/mix/fun/sin_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, sin) { +TEST_F(mathMix, sin) { auto f = [](const auto& x1) { using stan::math::sin; return sin(x1); @@ -12,7 +13,7 @@ TEST(mathMixMatFun, sin) { stan::test::expect_complex_common(f); } -TEST(mathMixMatFun, sin_varmat) { +TEST_F(mathMix, sin_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_nonzero_args; diff --git a/test/unit/math/mix/fun/singular_values_test.cpp b/test/unit/math/mix/fun/singular_values_test.cpp index 5829d5425e3..70eb9b39351 100644 --- a/test/unit/math/mix/fun/singular_values_test.cpp +++ b/test/unit/math/mix/fun/singular_values_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, singularValues) { +TEST_F(mathMix, singularValues) { auto f = [](const auto& x) { return stan::math::singular_values(x); }; Eigen::MatrixXd m00(0, 0); diff --git a/test/unit/math/mix/fun/sinh_test.cpp b/test/unit/math/mix/fun/sinh_test.cpp index 5bc5834fa42..ee8d9fb2136 100644 --- a/test/unit/math/mix/fun/sinh_test.cpp +++ b/test/unit/math/mix/fun/sinh_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, sinh) { +TEST_F(mathMix, sinh) { auto f = [](const auto& x) { using stan::math::sinh; return sinh(x); @@ -13,7 +14,7 @@ TEST(mathMixMatFun, sinh) { stan::test::expect_complex_common(f); } -TEST(mathMixMatFun, sinh_varmat) { +TEST_F(mathMix, sinh_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_nonzero_args; diff --git a/test/unit/math/mix/fun/size_test.cpp b/test/unit/math/mix/fun/size_test.cpp index 77250b22e86..83b55777a84 100644 --- a/test/unit/math/mix/fun/size_test.cpp +++ b/test/unit/math/mix/fun/size_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(AgradMixMatrixSize, fvar_var) { +TEST_F(mathMix, size_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -41,7 +42,7 @@ TEST(AgradMixMatrixSize, fvar_var) { EXPECT_EQ(14, stan::math::size(g)); } -TEST(AgradMixMatrixSize, fvar_fvar_var) { +TEST_F(mathMix, size_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; diff --git a/test/unit/math/mix/fun/softmax_test.cpp b/test/unit/math/mix/fun/softmax_test.cpp index bf748824173..82584ab77f2 100644 --- a/test/unit/math/mix/fun/softmax_test.cpp +++ b/test/unit/math/mix/fun/softmax_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, softmax) { +TEST_F(mathMix, softmax) { using stan::test::expect_ad_matvar; auto f = [](const auto& x) { return stan::math::softmax(x); }; diff --git a/test/unit/math/mix/fun/sort_indices_test.cpp b/test/unit/math/mix/fun/sort_indices_test.cpp index a3ce18d88c8..63fdc5fb1b4 100644 --- a/test/unit/math/mix/fun/sort_indices_test.cpp +++ b/test/unit/math/mix/fun/sort_indices_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -194,7 +195,7 @@ void test_sort_indices_desc4(Eigen::Matrix val) { EXPECT_FALSE(x_sorted.data()[i] == x.data()[j]); } -TEST(AgradMixSortIndices, var) { +TEST_F(mathMix, var) { std::vector a; a.push_back(1); a.push_back(2); @@ -250,7 +251,7 @@ TEST(AgradMixSortIndices, var) { test_sort_indices_desc2(vec6); } -TEST(AgradMixSortIndices, fv_no_thrown) { +TEST_F(mathMix, fv_no_thrown) { using stan::math::fvar; using stan::math::sort_indices_asc; using stan::math::sort_indices_desc; @@ -266,7 +267,7 @@ TEST(AgradMixSortIndices, fv_no_thrown) { EXPECT_NO_THROW(sort_indices_desc(vec2)); } -TEST(AgradMixSortIndices, ffv_sort) { +TEST_F(mathMix, ffv_sort) { using stan::math::fvar; using stan::math::sort_indices_asc; using stan::math::sort_indices_desc; @@ -326,7 +327,7 @@ TEST(AgradMixSortIndices, ffv_sort) { test_sort_indices_desc4(vec6); } -TEST(AgradMixSortIndices, ffv_no_thrown) { +TEST_F(mathMix, ffv_no_thrown) { using stan::math::fvar; using stan::math::sort_indices_asc; using stan::math::sort_indices_desc; diff --git a/test/unit/math/mix/fun/sort_test.cpp b/test/unit/math/mix/fun/sort_test.cpp index ad786a567e3..ed239a8e324 100644 --- a/test/unit/math/mix/fun/sort_test.cpp +++ b/test/unit/math/mix/fun/sort_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -22,7 +23,7 @@ void expect_sort(const std::vector& sv, stan::test::expect_ad(tols, f_desc, rv); } -TEST(MathMixMatFun, sort_asc_and_sort_desc) { +TEST_F(mathMix, sort_asc_and_sort_desc) { std::vector a; expect_sort(a); diff --git a/test/unit/math/mix/fun/sqrt_test.cpp b/test/unit/math/mix/fun/sqrt_test.cpp index 1e10b53c566..c192319a431 100644 --- a/test/unit/math/mix/fun/sqrt_test.cpp +++ b/test/unit/math/mix/fun/sqrt_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixMatFun, sqrt) { +TEST_F(mathMix, sqrt) { auto f = [](const auto& x1) { using stan::math::sqrt; return sqrt(x1); @@ -19,7 +20,7 @@ TEST(mathMixMatFun, sqrt) { } } -TEST(mathMixMatFun, sqrt_varmat) { +TEST_F(mathMix, sqrt_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_nonzero_args; diff --git a/test/unit/math/mix/fun/square_test.cpp b/test/unit/math/mix/fun/square_test.cpp index 5577bcda7a0..78b98620265 100644 --- a/test/unit/math/mix/fun/square_test.cpp +++ b/test/unit/math/mix/fun/square_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, square) { +TEST_F(mathMix, square) { auto f = [](const auto& x1) { return stan::math::square(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -2.6, -1.0, -0.5, -0.2, 0.5, 1.3, 3, 5, diff --git a/test/unit/math/mix/fun/squared_distance_test.cpp b/test/unit/math/mix/fun/squared_distance_test.cpp index 29822f54c0b..a90149c3657 100644 --- a/test/unit/math/mix/fun/squared_distance_test.cpp +++ b/test/unit/math/mix/fun/squared_distance_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(mathMixScalFun, squaredDistance) { +TEST_F(mathMix, squaredDistance_nan) { auto f = [](const auto& x1, const auto& x2) { return stan::math::squared_distance(x1, x2); }; @@ -40,7 +41,7 @@ void expect_squared_distance(const std::vector& sv1, stan::test::expect_ad_matvar(tols, f, rv1, v2); } -TEST(MathMixMatFun, squaredDistance) { +TEST_F(mathMix, squaredDistance_matrix) { std::vector a0; std::vector b0; expect_squared_distance(a0, b0); diff --git a/test/unit/math/mix/fun/stan_print_test.cpp b/test/unit/math/mix/fun/stan_print_test.cpp index da01c636a4e..e21e51c2302 100644 --- a/test/unit/math/mix/fun/stan_print_test.cpp +++ b/test/unit/math/mix/fun/stan_print_test.cpp @@ -1,11 +1,12 @@ #include +#include #include #include #include #include #include -TEST(AgradMixMatrixStanPrint, fvar_var) { +TEST_F(mathMix, print_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -49,7 +50,7 @@ TEST(AgradMixMatrixStanPrint, fvar_var) { EXPECT_EQ("[[1,1],[1,1]]", output.str()); } -TEST(AgradMixMatrixStanPrint, fvar_fvar_var) { +TEST_F(mathMix, print_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; diff --git a/test/unit/math/mix/fun/step_test.cpp b/test/unit/math/mix/fun/step_test.cpp index 2eae9c62e16..314863e6b54 100644 --- a/test/unit/math/mix/fun/step_test.cpp +++ b/test/unit/math/mix/fun/step_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(mathMixScalFun, step) { +TEST_F(mathMix, step) { auto f = [](const auto& x) { return stan::math::step(x); }; stan::test::expect_common_prim([](auto x) { return x < 0.0 ? 0 : 1; }, f); @@ -10,7 +11,7 @@ TEST(mathMixScalFun, step) { stan::test::expect_ad(f, std::numeric_limits::quiet_NaN()); } -TEST(mathMixMatFun, step_varmat) { +TEST_F(mathMix, step_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_nonzero_args; diff --git a/test/unit/math/mix/fun/sub_col_test.cpp b/test/unit/math/mix/fun/sub_col_test.cpp index e67d7ef136e..7fa220fad00 100644 --- a/test/unit/math/mix/fun/sub_col_test.cpp +++ b/test/unit/math/mix/fun/sub_col_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, subCol) { +TEST_F(mathMix, subCol) { auto f = [](int i, int j, int k) { return [=](const auto& y) { return stan::math::sub_col(y, i, j, k); }; }; diff --git a/test/unit/math/mix/fun/sub_row_test.cpp b/test/unit/math/mix/fun/sub_row_test.cpp index 3c08db5790c..c03937e9d8c 100644 --- a/test/unit/math/mix/fun/sub_row_test.cpp +++ b/test/unit/math/mix/fun/sub_row_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, subRow) { +TEST_F(mathMix, subRow) { auto f = [](int i, int j, int k) { return [=](const auto& y) { return stan::math::sub_row(y, i, j, k); }; }; diff --git a/test/unit/math/mix/fun/subtract_test.cpp b/test/unit/math/mix/fun/subtract_test.cpp index 64634b6203a..e1d2a280e3a 100644 --- a/test/unit/math/mix/fun/subtract_test.cpp +++ b/test/unit/math/mix/fun/subtract_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, subtract_transpose_test) { +TEST_F(mathMix, subtract_transpose_test) { auto f = [](const auto& x) { return x - x.transpose(); }; Eigen::MatrixXd x(2, 2); @@ -8,7 +9,7 @@ TEST(MathMixMatFun, subtract_transpose_test) { stan::test::expect_ad_matvar(f, x); } -TEST(MathMixMatFun, subtract_block_test) { +TEST_F(mathMix, subtract_block_test) { auto f = [](const auto& y, const auto& x) { return stan::math::subtract(y, x.block(0, 0, 2, 2)); }; @@ -18,7 +19,7 @@ TEST(MathMixMatFun, subtract_block_test) { stan::test::expect_ad_matvar(f, 1.0, x); } -TEST(MathMixMatFun, subtract_1) { +TEST_F(mathMix, subtract_1) { auto f = [](const auto& x, const auto& y) { return stan::math::subtract(x, y); }; @@ -46,7 +47,7 @@ TEST(MathMixMatFun, subtract_1) { stan::test::expect_ad(f, m11, m11b); } -TEST(MathMixMatFun, subtract_scal) { +TEST_F(mathMix, subtract_scal) { auto f = [](const auto& x, const auto& y) { return stan::math::subtract(x, y); }; @@ -56,7 +57,7 @@ TEST(MathMixMatFun, subtract_scal) { stan::test::expect_ad(f, 2.0, 5.0); } -TEST(MathMixMatFun, subtract_empty) { +TEST_F(mathMix, subtract_empty) { auto f = [](const auto& x, const auto& y) { return stan::math::subtract(x, y); }; @@ -78,7 +79,7 @@ TEST(MathMixMatFun, subtract_empty) { stan::test::expect_ad(f, m00, m00b); } -TEST(MathMixMatFun, subtract_scalar_mat) { +TEST_F(mathMix, subtract_scalar_mat) { auto f = [](const auto& x, const auto& y) { return stan::math::subtract(x, y); }; @@ -106,7 +107,7 @@ TEST(MathMixMatFun, subtract_scalar_mat) { stan::test::expect_ad(f, m22b, m22b); } -TEST(MathMixMatFun, subtract_vec_mat) { +TEST_F(mathMix, subtract_vec_mat) { auto f = [](const auto& x, const auto& y) { return stan::math::subtract(x, y); }; @@ -122,7 +123,7 @@ TEST(MathMixMatFun, subtract_vec_mat) { stan::test::expect_ad(f, rv5, rv5b); } -TEST(MathMixMatFun, subtract_mat_mat) { +TEST_F(mathMix, subtract_mat_mat) { auto f = [](const auto& x, const auto& y) { return stan::math::subtract(x, y); }; @@ -140,7 +141,7 @@ TEST(MathMixMatFun, subtract_mat_mat) { } // these will throw -TEST(MathMixMatFun, subtract_throw) { +TEST_F(mathMix, subtract_throw) { auto f = [](const auto& x, const auto& y) { return stan::math::subtract(x, y); }; diff --git a/test/unit/math/mix/fun/sum_test.cpp b/test/unit/math/mix/fun/sum_test.cpp index 7bbeb075346..807107ee8f3 100644 --- a/test/unit/math/mix/fun/sum_test.cpp +++ b/test/unit/math/mix/fun/sum_test.cpp @@ -1,4 +1,5 @@ #include +#include #include template @@ -17,7 +18,7 @@ void expect_sum(const T& m) { expect_ad_matvar(f, rv); } -TEST(MathMixMatFun, sum) { +TEST_F(mathMix, sum) { Eigen::MatrixXd v00(0, 0); expect_sum(v00); @@ -42,4 +43,4 @@ TEST(MathMixMatFun, sum) { expect_sum(v32); } -TEST(MathMixMatFun, sum_matvar) {} +TEST_F(mathMix, sum_matvar) {} diff --git a/test/unit/math/mix/fun/svd_U_test.cpp b/test/unit/math/mix/fun/svd_U_test.cpp index dfc3e31465f..6a2a94416a6 100644 --- a/test/unit/math/mix/fun/svd_U_test.cpp +++ b/test/unit/math/mix/fun/svd_U_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, svd_U) { +TEST_F(mathMix, svd_U) { auto f = [](const auto& x) { return stan::math::svd_U(x); }; Eigen::MatrixXd m00(0, 0); diff --git a/test/unit/math/mix/fun/svd_V_test.cpp b/test/unit/math/mix/fun/svd_V_test.cpp index f9b0bea2798..e7368440cde 100644 --- a/test/unit/math/mix/fun/svd_V_test.cpp +++ b/test/unit/math/mix/fun/svd_V_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, svd_V) { +TEST_F(mathMix, svd_V) { auto f = [](const auto& x) { return stan::math::svd_V(x); }; Eigen::MatrixXd m00(0, 0); diff --git a/test/unit/math/mix/fun/svd_test.cpp b/test/unit/math/mix/fun/svd_test.cpp index 4304af7868a..361753c7dfd 100644 --- a/test/unit/math/mix/fun/svd_test.cpp +++ b/test/unit/math/mix/fun/svd_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(MathMixMatFun, svd) { +TEST_F(mathMix, svd) { auto f = [](const auto& x) { return std::get<0>(stan::math::svd(x)); }; auto g = [](const auto& x) { return std::get<1>(stan::math::svd(x)); }; auto h = [](const auto& x) { return std::get<2>(stan::math::svd(x)); }; diff --git a/test/unit/math/mix/fun/symmetrize_from_lower_tri_test.cpp b/test/unit/math/mix/fun/symmetrize_from_lower_tri_test.cpp index e500d5ffc8d..a7a63971120 100644 --- a/test/unit/math/mix/fun/symmetrize_from_lower_tri_test.cpp +++ b/test/unit/math/mix/fun/symmetrize_from_lower_tri_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, symmetrize_from_lower_tri) { +TEST_F(mathMix, symmetrize_from_lower_tri) { auto f = [](const auto& x) { return stan::math::symmetrize_from_lower_tri(x); }; diff --git a/test/unit/math/mix/fun/symmetrize_from_upper_tri_test.cpp b/test/unit/math/mix/fun/symmetrize_from_upper_tri_test.cpp index 084a578efeb..2c8e2a563b2 100644 --- a/test/unit/math/mix/fun/symmetrize_from_upper_tri_test.cpp +++ b/test/unit/math/mix/fun/symmetrize_from_upper_tri_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, symmetrize_from_upper_tri) { +TEST_F(mathMix, symmetrize_from_upper_tri) { auto f = [](const auto& x) { return stan::math::symmetrize_from_upper_tri(x); }; diff --git a/test/unit/math/mix/fun/tail_test.cpp b/test/unit/math/mix/fun/tail_test.cpp index ccb7febd42e..67c61a8c5d3 100644 --- a/test/unit/math/mix/fun/tail_test.cpp +++ b/test/unit/math/mix/fun/tail_test.cpp @@ -1,4 +1,5 @@ #include +#include #include template @@ -13,7 +14,7 @@ void expect_tail(const T& x, int n) { stan::test::expect_ad(f(n), rv); } -TEST(MathMixMatFun, tail) { +TEST_F(mathMix, tail) { std::vector a{}; expect_tail(a, 0); expect_tail(a, 1); @@ -29,7 +30,7 @@ TEST(MathMixMatFun, tail) { } } -TEST(MathMixMatFun, tailEig) { +TEST_F(mathMix, tailEig) { Eigen::VectorXd a(0); expect_tail(a, 0); expect_tail(a, 1); diff --git a/test/unit/math/mix/fun/tan_test.cpp b/test/unit/math/mix/fun/tan_test.cpp index 21e060bb8ea..39d31e039ab 100644 --- a/test/unit/math/mix/fun/tan_test.cpp +++ b/test/unit/math/mix/fun/tan_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, tan) { +TEST_F(mathMix, tan) { auto f = [](const auto& x) { using stan::math::tan; return tan(x); @@ -12,7 +13,7 @@ TEST(mathMixMatFun, tan) { stan::test::expect_complex_common(f); } -TEST(mathMixMatFun, tan_varmat) { +TEST_F(mathMix, tan_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_nonzero_args; diff --git a/test/unit/math/mix/fun/tanh_test.cpp b/test/unit/math/mix/fun/tanh_test.cpp index d9e4ad5d567..58a357a9aa1 100644 --- a/test/unit/math/mix/fun/tanh_test.cpp +++ b/test/unit/math/mix/fun/tanh_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, tanh) { +TEST_F(mathMix, tanh) { auto f = [](const auto& x1) { using stan::math::tanh; return tanh(x1); @@ -13,7 +14,7 @@ TEST(mathMixMatFun, tanh) { stan::test::expect_complex_common(f); } -TEST(mathMixMatFun, tanh_varmat) { +TEST_F(mathMix, tanh_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_nonzero_args; diff --git a/test/unit/math/mix/fun/tcrossprod_test.cpp b/test/unit/math/mix/fun/tcrossprod_test.cpp index d95595c5399..6c51094348c 100644 --- a/test/unit/math/mix/fun/tcrossprod_test.cpp +++ b/test/unit/math/mix/fun/tcrossprod_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, tcrossprod) { +TEST_F(mathMix, tcrossprod) { using stan::test::relative_tolerance; auto f = [](const auto& y) { return stan::math::tcrossprod(y); }; diff --git a/test/unit/math/mix/fun/tgamma_test.cpp b/test/unit/math/mix/fun/tgamma_test.cpp index ae994184955..e92fd3d996f 100644 --- a/test/unit/math/mix/fun/tgamma_test.cpp +++ b/test/unit/math/mix/fun/tgamma_test.cpp @@ -1,12 +1,13 @@ #include +#include -TEST(mathMixMatFun, tgamma) { +TEST_F(mathMix, tgamma) { auto f = [](const auto& x1) { return stan::math::tgamma(x1); }; stan::test::expect_common_unary_vectorized(f); stan::test::expect_unary_vectorized(f, -2.6, -1.2, -0.5, 0.5, 1.5, 3.5); } -TEST(mathMixMatFun, tgamma_varmat) { +TEST_F(mathMix, tgamma_varmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_nonzero_args; diff --git a/test/unit/math/mix/fun/to_complex_test.cpp b/test/unit/math/mix/fun/to_complex_test.cpp index acec1e94bd8..769177f6c11 100644 --- a/test/unit/math/mix/fun/to_complex_test.cpp +++ b/test/unit/math/mix/fun/to_complex_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST(mathMixMatFun, to_complex) { +TEST_F(mathMix, to_complex) { auto f0 = []() { return stan::math::to_complex(); }; auto f1 = [](const auto& x) { return stan::math::to_complex(x); }; auto f2 = [](const auto& x, const auto& y) { @@ -13,7 +14,7 @@ TEST(mathMixMatFun, to_complex) { stan::test::expect_common_binary(f2); } -TEST(mathMixMatFun, to_complex_vectorized) { +TEST_F(mathMix, to_complex_vectorized) { auto f = [](const auto& x, const auto& y) { return stan::math::to_complex(x, y); }; diff --git a/test/unit/math/mix/fun/to_fvar_test.cpp b/test/unit/math/mix/fun/to_fvar_test.cpp index f20dfb64604..02d0faffb76 100644 --- a/test/unit/math/mix/fun/to_fvar_test.cpp +++ b/test/unit/math/mix/fun/to_fvar_test.cpp @@ -1,8 +1,9 @@ #include +#include #include #include -TEST(AgradMixMatrixToFvar, fv_vector) { +TEST_F(mathMix, to_fvarfv_vector) { using stan::math::vector_d; using stan::math::vector_fv; @@ -26,7 +27,7 @@ TEST(AgradMixMatrixToFvar, fv_vector) { EXPECT_FLOAT_EQ(1, out(3).d_.val()); EXPECT_FLOAT_EQ(1, out(4).d_.val()); } -TEST(AgradMixMatrixToFvar, fv_rowvector) { +TEST_F(mathMix, to_fvarfv_rowvector) { using stan::math::row_vector_d; using stan::math::row_vector_fv; @@ -50,7 +51,7 @@ TEST(AgradMixMatrixToFvar, fv_rowvector) { EXPECT_FLOAT_EQ(1, output(3).d_.val()); EXPECT_FLOAT_EQ(1, output(4).d_.val()); } -TEST(AgradMixMatrixToFvar, fv_matrix_matrix) { +TEST_F(mathMix, to_fvarfv_matrix_matrix) { using stan::math::matrix_d; using stan::math::matrix_fd; using stan::math::matrix_fv; @@ -82,7 +83,7 @@ TEST(AgradMixMatrixToFvar, fv_matrix_matrix) { EXPECT_FLOAT_EQ(17, output(2, 1).d_.val()); EXPECT_FLOAT_EQ(18, output(2, 2).d_.val()); } -TEST(AgradMixMatrixToFvar, ffv_vector) { +TEST_F(mathMix, to_fvarffv_vector) { using stan::math::vector_d; using stan::math::vector_ffv; @@ -106,7 +107,7 @@ TEST(AgradMixMatrixToFvar, ffv_vector) { EXPECT_FLOAT_EQ(1, out(3).d_.val().val()); EXPECT_FLOAT_EQ(1, out(4).d_.val().val()); } -TEST(AgradMixMatrixToFvar, ffv_rowvector) { +TEST_F(mathMix, to_fvarffv_rowvector) { using stan::math::row_vector_d; using stan::math::row_vector_ffv; @@ -130,7 +131,7 @@ TEST(AgradMixMatrixToFvar, ffv_rowvector) { EXPECT_FLOAT_EQ(1, output(3).d_.val().val()); EXPECT_FLOAT_EQ(1, output(4).d_.val().val()); } -TEST(AgradMixMatrixToFvar, ffv_matrix_matrix) { +TEST_F(mathMix, to_fvarffv_matrix_matrix) { using stan::math::matrix_ffv; using stan::math::matrix_fv; diff --git a/test/unit/math/mix/fun/trace_gen_inv_quad_form_ldlt_test.cpp b/test/unit/math/mix/fun/trace_gen_inv_quad_form_ldlt_test.cpp index c7a455e8086..5faf2a0d007 100644 --- a/test/unit/math/mix/fun/trace_gen_inv_quad_form_ldlt_test.cpp +++ b/test/unit/math/mix/fun/trace_gen_inv_quad_form_ldlt_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, traceGenInvQuadForm) { +TEST_F(mathMix, traceGenInvQuadForm) { auto f = [](const auto& c, const auto& a, const auto& b) { auto&& a_ref = stan::math::to_ref(a); auto x_sym = stan::math::multiply(0.5, a_ref + a_ref.transpose()); @@ -75,7 +76,7 @@ TEST(mathMixMatFun, traceGenInvQuadForm) { stan::math::recover_memory(); } -TEST(mathMixMatFun, traceGenInvQuadForm_vec) { +TEST_F(mathMix, traceGenInvQuadForm_vec) { auto f = [](const auto& c, const auto& a, const auto& b) { auto&& a_ref = stan::math::to_ref(a); auto x_sym = stan::math::multiply(0.5, a_ref + a_ref.transpose()).eval(); diff --git a/test/unit/math/mix/fun/trace_gen_quad_form_test.cpp b/test/unit/math/mix/fun/trace_gen_quad_form_test.cpp index 6410cbfa119..57137dc1fb0 100644 --- a/test/unit/math/mix/fun/trace_gen_quad_form_test.cpp +++ b/test/unit/math/mix/fun/trace_gen_quad_form_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, traceGenQuadForm) { +TEST_F(mathMix, traceGenQuadForm) { using stan::test::relative_tolerance; auto f = [](const auto& x1, const auto& x2, const auto& x3) { return stan::math::trace_gen_quad_form(x1, x2, x3); diff --git a/test/unit/math/mix/fun/trace_inv_quad_form_ldlt_test.cpp b/test/unit/math/mix/fun/trace_inv_quad_form_ldlt_test.cpp index 8fb69bd3cef..0b0d7b0091e 100644 --- a/test/unit/math/mix/fun/trace_inv_quad_form_ldlt_test.cpp +++ b/test/unit/math/mix/fun/trace_inv_quad_form_ldlt_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, traceInvQuadFormLdlt) { +TEST_F(mathMix, traceInvQuadFormLdlt) { auto f = [](const auto& x, const auto& y) { auto&& x_ref = stan::math::to_ref(x); auto x_sym = stan::math::multiply(0.5, x_ref + x_ref.transpose()); diff --git a/test/unit/math/mix/fun/trace_quad_form_test.cpp b/test/unit/math/mix/fun/trace_quad_form_test.cpp index 8661911f5bb..0ff66f57eb5 100644 --- a/test/unit/math/mix/fun/trace_quad_form_test.cpp +++ b/test/unit/math/mix/fun/trace_quad_form_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, traceQuadForm) { +TEST_F(mathMix, traceQuadForm) { auto f = [](const auto& x, const auto& y) { return stan::math::trace_quad_form(x, y); }; diff --git a/test/unit/math/mix/fun/trace_test.cpp b/test/unit/math/mix/fun/trace_test.cpp index 2e1b3163024..54c9d8f305f 100644 --- a/test/unit/math/mix/fun/trace_test.cpp +++ b/test/unit/math/mix/fun/trace_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(MathMixMatFun, trace) { +TEST_F(mathMix, trace) { auto f = [](const auto& x) { return stan::math::trace(x); }; Eigen::MatrixXd a(0, 0); diff --git a/test/unit/math/mix/fun/transpose_test.cpp b/test/unit/math/mix/fun/transpose_test.cpp index 25d0069969c..cd59a667088 100644 --- a/test/unit/math/mix/fun/transpose_test.cpp +++ b/test/unit/math/mix/fun/transpose_test.cpp @@ -1,4 +1,5 @@ #include +#include void expect_transpose(const Eigen::MatrixXd& m) { auto f = [](const auto& x) { return stan::math::transpose(x); }; @@ -9,7 +10,7 @@ void expect_transpose(const Eigen::MatrixXd& m) { stan::test::expect_ad(f, rv); } -TEST(MathMixMatFun, transpose) { +TEST_F(mathMix, transpose) { Eigen::MatrixXd a(0, 0); expect_transpose(a); diff --git a/test/unit/math/mix/fun/trigamma_test.cpp b/test/unit/math/mix/fun/trigamma_test.cpp index 71bcc8f68c0..913aa095509 100644 --- a/test/unit/math/mix/fun/trigamma_test.cpp +++ b/test/unit/math/mix/fun/trigamma_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, trigamma) { +TEST_F(mathMix, trigamma) { using stan::math::trigamma; using stan::test::ad_tolerances; using stan::test::expect_unary_vectorized; diff --git a/test/unit/math/mix/fun/trunc_test.cpp b/test/unit/math/mix/fun/trunc_test.cpp index ea1f9698143..04794fcc456 100644 --- a/test/unit/math/mix/fun/trunc_test.cpp +++ b/test/unit/math/mix/fun/trunc_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST(mathMixMatFun, trunc) { +TEST_F(mathMix, trunc) { auto f = [](const auto& x1) { return stan::math::trunc(x1); }; // can't diff trunc through integers for (auto x : stan::test::internal::common_nonzero_args()) diff --git a/test/unit/math/mix/fun/ub_constrain_matvar_test.cpp b/test/unit/math/mix/fun/ub_constrain_matvar_test.cpp index 5efcfbe6cda..261f403d859 100644 --- a/test/unit/math/mix/fun/ub_constrain_matvar_test.cpp +++ b/test/unit/math/mix/fun/ub_constrain_matvar_test.cpp @@ -1,4 +1,5 @@ #include +#include #include namespace ub_constrain_test { @@ -60,7 +61,7 @@ void expect_vec_matvar(const T1& x, const T2& ub) { } } // namespace ub_constrain_test -TEST(mathMixMatFun, ub_matvar_constrain) { +TEST_F(mathMix, ub_matvar_constrain) { using stan::scalar_type_t; using stan::math::promote_scalar_t; using stan::math::ub_constrain; @@ -76,7 +77,7 @@ TEST(mathMixMatFun, ub_matvar_constrain) { ub_constrain_test::expect_matvar(A, ubd); } -TEST(mathMixMatFun, ub_matvar_constrain_neg_inf) { +TEST_F(mathMix, ub_matvar_constrain_neg_inf) { Eigen::MatrixXd A(2, 2); A << 5.0, 2.0, 4.0, -2.0; Eigen::MatrixXd ubm(2, 2); @@ -87,7 +88,7 @@ TEST(mathMixMatFun, ub_matvar_constrain_neg_inf) { // matrix[], matrix // matrix[], real -TEST(mathMixMatFun, ub_stdvec_mat_mat_constrain_matvar) { +TEST_F(mathMix, ub_stdvec_mat_mat_constrain_matvar) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.0, 0.005; Eigen::MatrixXd ubm_inner(2, 3); @@ -104,7 +105,7 @@ TEST(mathMixMatFun, ub_stdvec_mat_mat_constrain_matvar) { ub_constrain_test::expect_vec_matvar(A, ubd); } -TEST(mathMixMatFun, ub_stdvec_mat_mat_constrain_matvar_neg_inf) { +TEST_F(mathMix, ub_stdvec_mat_mat_constrain_matvar_neg_inf) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.0, 0.005; Eigen::MatrixXd ubm_inner(2, 3); @@ -119,7 +120,7 @@ TEST(mathMixMatFun, ub_stdvec_mat_mat_constrain_matvar_neg_inf) { } // matrix[], matrix[] -TEST(mathMixMatFun, ub_stdvec_mat_constrain_matvar) { +TEST_F(mathMix, ub_stdvec_mat_constrain_matvar) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.0, 0.005; Eigen::MatrixXd ubm_inner(2, 3); @@ -143,7 +144,7 @@ TEST(mathMixMatFun, ub_stdvec_mat_constrain_matvar) { ub_constrain_test::expect_vec_matvar(A, ubm_bad2); } -TEST(mathMixMatFun, ub_stdvec_mat_constrain_matvar_neg_inf) { +TEST_F(mathMix, ub_stdvec_mat_constrain_matvar_neg_inf) { Eigen::MatrixXd A_inner(2, 2); A_inner << 5.0, 2.0, 4.0, -2.0; Eigen::MatrixXd ubm_inner(2, 2); diff --git a/test/unit/math/mix/fun/ub_constrain_test.cpp b/test/unit/math/mix/fun/ub_constrain_test.cpp index f3a4f18b569..492c5cf3580 100644 --- a/test/unit/math/mix/fun/ub_constrain_test.cpp +++ b/test/unit/math/mix/fun/ub_constrain_test.cpp @@ -1,4 +1,5 @@ #include +#include #include namespace ub_constrain_test { @@ -62,19 +63,19 @@ void expect_vec(const T1& x, const T2& ub) { } // namespace ub_constrain_test // real, real -TEST(mathMixScalFun, ubConstrain) { +TEST_F(mathMix, ubConstrain) { ub_constrain_test::expect(-1, 2); ub_constrain_test::expect(2, 4); } -TEST(mathMixScalFun, ubConstrain_inf) { +TEST_F(mathMix, ubConstrain_inf) { ub_constrain_test::expect(-1, stan::math::INFTY); ub_constrain_test::expect(2, stan::math::INFTY); } // matrix, matrix // matrix, real -TEST(mathMixMatFun, ub_mat_constrain) { +TEST_F(mathMix, ub_mat_constrain) { Eigen::MatrixXd A(2, 3); A << 5.0, 2.0, 4.0, -2.0, 0.0, 0.005; Eigen::MatrixXd ubm(2, 3); @@ -87,7 +88,7 @@ TEST(mathMixMatFun, ub_mat_constrain) { ub_constrain_test::expect(A, ubd); } -TEST(mathMixMatFun, ub_mat_constrain_inf) { +TEST_F(mathMix, ub_mat_constrain_inf) { Eigen::MatrixXd A(2, 3); A << 5.0, 2.0, 4.0, -2.0, 0.0, 0.005; Eigen::MatrixXd ubm(2, 3); @@ -98,7 +99,7 @@ TEST(mathMixMatFun, ub_mat_constrain_inf) { // real[], real // real[], real[] -TEST(mathMixMatFun, ub_stdvec_constrain) { +TEST_F(mathMix, ub_stdvec_constrain) { std::vector A{5.0, 2.0, 4.0, -2.0}; std::vector ubm{7.0, 5.0, 6.0, 100.0}; std::vector ubm_bad{7.0, 5.0, 6.0}; @@ -108,7 +109,7 @@ TEST(mathMixMatFun, ub_stdvec_constrain) { ub_constrain_test::expect(A, ubd); } -TEST(mathMixMatFun, ub_stdvec_constrain_inf) { +TEST_F(mathMix, ub_stdvec_constrain_inf) { std::vector A{5.0, 2.0, 4.0, -2.0}; std::vector ubm{7.0, 5.0, stan::math::INFTY, 100.0}; ub_constrain_test::expect(A, ubm); @@ -117,7 +118,7 @@ TEST(mathMixMatFun, ub_stdvec_constrain_inf) { // matrix[], matrix // matrix[], real -TEST(mathMixMatFun, ub_stdvec_mat_mat_constrain) { +TEST_F(mathMix, ub_stdvec_mat_mat_constrain) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.0, 0.005; Eigen::MatrixXd ubm_inner(2, 3); @@ -134,7 +135,7 @@ TEST(mathMixMatFun, ub_stdvec_mat_mat_constrain) { ub_constrain_test::expect_vec(A, ubd); } -TEST(mathMixMatFun, ub_stdvec_mat_mat_constrain_inf) { +TEST_F(mathMix, ub_stdvec_mat_mat_constrain_inf) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 0.5, 1.0; Eigen::MatrixXd ubm_inner(2, 3); @@ -149,7 +150,7 @@ TEST(mathMixMatFun, ub_stdvec_mat_mat_constrain_inf) { } // matrix[], matrix[] -TEST(mathMixMatFun, ub_stdvec_mat_constrain) { +TEST_F(mathMix, ub_stdvec_mat_constrain) { Eigen::MatrixXd A_inner(2, 3); A_inner << 5.0, 2.0, 4.0, -2.0, 1.0, 1.00; Eigen::MatrixXd ubm_inner(2, 3); @@ -173,7 +174,7 @@ TEST(mathMixMatFun, ub_stdvec_mat_constrain) { ub_constrain_test::expect_vec(A, ubm_bad2); } -TEST(mathMixMatFun, ub_stdvec_mat_constrain_neg_inf) { +TEST_F(mathMix, ub_stdvec_mat_constrain_neg_inf) { Eigen::MatrixXd A_inner(2, 2); A_inner << 5.0, 2.0, 4.0, -2.0; Eigen::MatrixXd ubm_inner(2, 2); diff --git a/test/unit/math/mix/fun/unit_vector_constrain_test.cpp b/test/unit/math/mix/fun/unit_vector_constrain_test.cpp index cd26807db3a..a97ad4eb9da 100644 --- a/test/unit/math/mix/fun/unit_vector_constrain_test.cpp +++ b/test/unit/math/mix/fun/unit_vector_constrain_test.cpp @@ -1,4 +1,5 @@ #include +#include #include namespace unit_vector_constrain_test { @@ -43,7 +44,7 @@ void expect_unit_vector_constrain(const T& x) { } } // namespace unit_vector_constrain_test -TEST(MathMixMatFun, unitVectorConstrain) { +TEST_F(mathMix, unitVectorConstrain) { Eigen::VectorXd v0; unit_vector_constrain_test::expect_unit_vector_constrain(v0); diff --git a/test/unit/math/mix/fun/value_of_rec_test.cpp b/test/unit/math/mix/fun/value_of_rec_test.cpp index 4cd0e0f3e37..e93b2890cba 100644 --- a/test/unit/math/mix/fun/value_of_rec_test.cpp +++ b/test/unit/math/mix/fun/value_of_rec_test.cpp @@ -1,9 +1,10 @@ #include +#include #include #include #include -TEST(AgradMix, value_of_rec) { +TEST_F(mathMix, value_of_rec_scalar) { using stan::math::fvar; using stan::math::value_of_rec; using stan::math::var; @@ -17,7 +18,7 @@ TEST(AgradMix, value_of_rec) { EXPECT_FLOAT_EQ(5.0, value_of_rec(fffffv_a)); } -TEST(MathMatrixMixArr, value_of_rec) { +TEST_F(mathMix, value_of_rec_vector) { using stan::math::fvar; using stan::math::value_of_rec; using stan::math::var; @@ -41,7 +42,7 @@ TEST(MathMatrixMixArr, value_of_rec) { EXPECT_FLOAT_EQ(a[i].val_.val_.val(), d_a[i]); } -TEST(AgradMixMatrix, value_of_rec) { +TEST_F(mathMix, value_of_rec_reps) { using stan::math::fvar; using stan::math::value_of_rec; using stan::math::var; diff --git a/test/unit/math/mix/fun/value_of_test.cpp b/test/unit/math/mix/fun/value_of_test.cpp index 7ac1f6fe360..67ff3749270 100644 --- a/test/unit/math/mix/fun/value_of_test.cpp +++ b/test/unit/math/mix/fun/value_of_test.cpp @@ -1,9 +1,10 @@ #include +#include #include #include #include -TEST(MathMatrixMixArr, value_of) { +TEST_F(mathMix, value_of_fvar) { using stan::math::fvar; using stan::math::value_of; using stan::math::var; @@ -26,7 +27,7 @@ TEST(MathMatrixMixArr, value_of) { EXPECT_FLOAT_EQ(a[i].val_.val_.val(), d_a[i].val_.val()); } -TEST(AgradMixMatrix, value_of) { +TEST_F(mathMix, value_of_vector) { using stan::math::fvar; using stan::math::value_of; using stan::math::var; diff --git a/test/unit/math/mix/fun/variance_test.cpp b/test/unit/math/mix/fun/variance_test.cpp index f4f26364eb0..e15b78b8ec9 100644 --- a/test/unit/math/mix/fun/variance_test.cpp +++ b/test/unit/math/mix/fun/variance_test.cpp @@ -1,4 +1,5 @@ #include +#include #include void expect_variance(const Eigen::MatrixXd& m) { @@ -20,7 +21,7 @@ void expect_variance(const Eigen::MatrixXd& m) { stan::test::expect_ad_matvar(tols, f, rv); } -TEST(MathMixMatFun, variance) { +TEST_F(mathMix, variance) { Eigen::MatrixXd a(0, 0); expect_variance(a); diff --git a/test/unit/math/mix/functor/autodiff_test.cpp b/test/unit/math/mix/functor/autodiff_test.cpp index 8a26dceb70b..8d4350ae9f8 100644 --- a/test/unit/math/mix/functor/autodiff_test.cpp +++ b/test/unit/math/mix/functor/autodiff_test.cpp @@ -42,7 +42,7 @@ struct norm_functor { } }; -TEST(MixFunctor, derivative) { +TEST_F(mathMix, func_derivative) { fun0 f; double x = 7; double fx; @@ -52,7 +52,7 @@ TEST(MixFunctor, derivative) { EXPECT_FLOAT_EQ(d, 5 * 3 * 7 * 7); } -TEST(MixFunctor, partialDerivative) { +TEST_F(mathMix, func_partialDerivative) { fun1 f; Matrix x(2); x << 5, 7; @@ -70,7 +70,7 @@ TEST(MixFunctor, partialDerivative) { EXPECT_FLOAT_EQ(5 * 5 + 3 * 2 * 7, d2); } -TEST(MixFunctor, gradientDotVector) { +TEST_F(mathMix, func_gradientDotVector) { using stan::math::var; fun1 f; Matrix x(2); @@ -88,7 +88,7 @@ TEST(MixFunctor, gradientDotVector) { EXPECT_FLOAT_EQ(grad_fx_dot_v_expected, grad_fx_dot_v); } -TEST(MixFunctor, hessianTimesVector) { +TEST_F(mathMix, func_hessianTimesVector) { using stan::math::hessian_times_vector; fun1 f; @@ -110,7 +110,7 @@ TEST(MixFunctor, hessianTimesVector) { EXPECT_FLOAT_EQ(2 * x(0) * v(0) + 6 * v(1), Hv(1)); } -TEST(MixFunctor, jacobian) { +TEST_F(mathMix, func_jacobian) { using stan::math::jacobian; fun2 f; @@ -144,7 +144,7 @@ TEST(MixFunctor, jacobian) { EXPECT_FLOAT_EQ(6, J_rev(1, 1)); } -TEST(MixFunctor, hessian) { +TEST_F(mathMix, func_hessian) { fun1 f; Matrix x(2); x << 5, 7; @@ -186,7 +186,7 @@ TEST(MixFunctor, hessian) { EXPECT_FLOAT_EQ(2 * 3, H2(1, 1)); } -TEST(MixFunctor, GradientTraceMatrixTimesHessian) { +TEST_F(mathMix, func_GradientTraceMatrixTimesHessian) { Matrix M(2, 2); M << 11, 13, 17, 23; fun1 f; @@ -200,7 +200,7 @@ TEST(MixFunctor, GradientTraceMatrixTimesHessian) { EXPECT_FLOAT_EQ(22, grad_tr_MH(1)); } -TEST(MixFunctor, GradientHessian) { +TEST_F(mathMix, func_GradientHessian) { norm_functor log_normal_density; third_order_mixed mixed_third_poly; diff --git a/test/unit/math/mix/functor/finite_diff_grad_hessian_auto_test.cpp b/test/unit/math/mix/functor/finite_diff_grad_hessian_auto_test.cpp index cecc05b8e7a..6d634643521 100644 --- a/test/unit/math/mix/functor/finite_diff_grad_hessian_auto_test.cpp +++ b/test/unit/math/mix/functor/finite_diff_grad_hessian_auto_test.cpp @@ -35,7 +35,7 @@ void test_grad_hessian_finite_diff(const std::string& msg, const F& f, } } -TEST(MixMatFunctor, FiniteDiffGradHessianAuto) { +TEST_F(mathMix, func_FiniteDiffGradHessianAuto) { auto norm_fun = [](const auto& x) { return stan::math::normal_lpdf(x(0), x(1), x(2)); }; Eigen::VectorXd x(3); diff --git a/test/unit/math/mix/functor/finite_diff_gradient_auto_test.cpp b/test/unit/math/mix/functor/finite_diff_gradient_auto_test.cpp index e288331aae0..5de20b94085 100644 --- a/test/unit/math/mix/functor/finite_diff_gradient_auto_test.cpp +++ b/test/unit/math/mix/functor/finite_diff_gradient_auto_test.cpp @@ -19,7 +19,7 @@ void expect_match_autodiff(const F& f, Eigen::VectorXd x) { stan::test::relative_tolerance(1e-7, 1e-9)); } -TEST(MathMixMatFunctor, FiniteDiffGradientAuto) { +TEST_F(mathMix, FiniteDiffGradientAuto) { auto norm_fun = [](const auto& x) { return stan::math::normal_lpdf(x(0), x(1), x(2)); }; diff --git a/test/unit/math/mix/functor/finite_diff_hessian_auto_test.cpp b/test/unit/math/mix/functor/finite_diff_hessian_auto_test.cpp index 90d2a6c009a..255881f34f0 100644 --- a/test/unit/math/mix/functor/finite_diff_hessian_auto_test.cpp +++ b/test/unit/math/mix/functor/finite_diff_hessian_auto_test.cpp @@ -21,7 +21,7 @@ struct sum_functor { } }; -TEST(AgradFiniteDiff, gradient) { +TEST_F(mathMix, func_gradient) { using Eigen::Dynamic; using Eigen::Matrix; @@ -57,7 +57,7 @@ TEST(AgradFiniteDiff, gradient) { } } -TEST(AgradFiniteDiff, hessian) { +TEST_F(mathMix, func_hessian) { using Eigen::Dynamic; using Eigen::Matrix; third_order_mixed f; @@ -110,7 +110,7 @@ TEST(AgradFiniteDiff, hessian) { } } -TEST(AgradFiniteDiff, gradHessianResizingTest) { +TEST_F(mathMix, func_gradHessianResizingTest) { // failed in 2.19 before grad_hess_fx.clear() was added norm_functor f; Eigen::VectorXd x(3); @@ -126,7 +126,7 @@ TEST(AgradFiniteDiff, gradHessianResizingTest) { EXPECT_EQ(x.size(), hess.cols()); } -TEST(AgradFiniteDiff, grad_hessian) { +TEST_F(mathMix, func_grad_hessian) { using Eigen::Dynamic; using Eigen::Matrix; norm_functor norm; @@ -188,7 +188,7 @@ TEST(AgradFiniteDiff, grad_hessian) { } } -TEST(AgradFiniteDiff, gradientZeroOneArg) { +TEST_F(mathMix, func_gradientZeroOneArg) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::sum; @@ -223,7 +223,7 @@ TEST(AgradFiniteDiff, gradientZeroOneArg) { f_z_grad_sum); } -TEST(AgradFiniteDiff, hessianZeroOneArg) { +TEST_F(mathMix, func_hessianZeroOneArg) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::sum; diff --git a/test/unit/math/mix/functor/operands_and_partials_test.cpp b/test/unit/math/mix/functor/operands_and_partials_test.cpp index 013cf4c431f..35501a2dd17 100644 --- a/test/unit/math/mix/functor/operands_and_partials_test.cpp +++ b/test/unit/math/mix/functor/operands_and_partials_test.cpp @@ -2,7 +2,7 @@ #include #include -TEST(MathMetaMix, OperandsAndPartialsUniMixMat) { +TEST_F(mathMix, func_OperandsAndPartialsUniMixMat) { using stan::math::fvar; using stan::math::operands_and_partials; using stan::math::var; @@ -45,7 +45,7 @@ TEST(MathMetaMix, OperandsAndPartialsUniMixMat) { EXPECT_FLOAT_EQ(0.0, gradient[3]); } -TEST(MathMetaMix, OperandsAndPartialsUniMixMat_dbl) { +TEST_F(mathMix, func_OperandsAndPartialsUniMixMat_dbl) { using stan::is_constant_all; using stan::math::fvar; using stan::math::operands_and_partials; @@ -93,7 +93,7 @@ TEST(MathMetaMix, OperandsAndPartialsUniMixMat_dbl) { EXPECT_FLOAT_EQ(0.0, gradient[3]); } -TEST(MathMetaMix, OperandsAndPartialsMultiMix) { +TEST_F(mathMix, func_OperandsAndPartialsMultiMix) { using stan::math::fvar; using stan::math::operands_and_partials; using stan::math::var; @@ -155,7 +155,7 @@ TEST(MathMetaMix, OperandsAndPartialsMultiMix) { EXPECT_FLOAT_EQ(0.0, gradient[3]); } -TEST(MathMetaMix, OperandsAndPartialsMultiMix_dbl) { +TEST_F(mathMix, func_OperandsAndPartialsMultiMix_dbl) { using stan::math::fvar; using stan::math::operands_and_partials; using stan::math::var; @@ -221,7 +221,7 @@ TEST(MathMetaMix, OperandsAndPartialsMultiMix_dbl) { EXPECT_FLOAT_EQ(0.0, gradient[3]); } -TEST(MathMetaMix, OperandsAndPartialsMultiStdMix) { +TEST_F(mathMix, func_OperandsAndPartialsMultiStdMix) { using stan::math::fvar; using stan::math::operands_and_partials; using stan::math::var; @@ -287,7 +287,7 @@ TEST(MathMetaMix, OperandsAndPartialsMultiStdMix) { EXPECT_FLOAT_EQ(0.0, gradient[3]); } -TEST(MathMetaMix, OperandsAndPartialsMultiStdMix_dbl) { +TEST_F(mathMix, func_OperandsAndPartialsMultiStdMix_dbl) { using stan::math::fvar; using stan::math::operands_and_partials; using stan::math::var; @@ -357,7 +357,7 @@ TEST(MathMetaMix, OperandsAndPartialsMultiStdMix_dbl) { EXPECT_FLOAT_EQ(0.0, gradient[3]); } -TEST(MathMetaMix, OperandsAndPartialsMultiMixInt) { +TEST_F(mathMix, func_OperandsAndPartialsMultiMixInt) { using stan::math::operands_and_partials; typedef Eigen::Matrix uni_mat_t; @@ -386,7 +386,7 @@ TEST(MathMetaMix, OperandsAndPartialsMultiMixInt) { EXPECT_FLOAT_EQ(10.0, v); } -TEST(MathMetaMix, OperandsAndPartialsMultiMixInt_dbl) { +TEST_F(mathMix, func_OperandsAndPartialsMultiMixInt_dbl) { using stan::math::operands_and_partials; typedef Eigen::Matrix uni_mat_t; diff --git a/test/unit/math/mix/functor/partials_propagator_test.cpp b/test/unit/math/mix/functor/partials_propagator_test.cpp index 78a8de1057a..cf05d9ab5de 100644 --- a/test/unit/math/mix/functor/partials_propagator_test.cpp +++ b/test/unit/math/mix/functor/partials_propagator_test.cpp @@ -2,7 +2,7 @@ #include #include -TEST(MathMetaMix, PartialsPropagatorUniMixMat) { +TEST_F(mathMix, func_PartialsPropagatorUniMixMat) { using stan::math::fvar; using stan::math::make_partials_propagator; using stan::math::var; @@ -45,7 +45,7 @@ TEST(MathMetaMix, PartialsPropagatorUniMixMat) { EXPECT_FLOAT_EQ(0.0, gradient[3]); } -TEST(MathMetaMix, PartialsPropagatorUniMixMat_dbl) { +TEST_F(mathMix, func_PartialsPropagatorUniMixMat_dbl) { using stan::is_constant_all; using stan::math::fvar; using stan::math::make_partials_propagator; @@ -91,7 +91,7 @@ TEST(MathMetaMix, PartialsPropagatorUniMixMat_dbl) { EXPECT_FLOAT_EQ(0.0, gradient[3]); } -TEST(MathMetaMix, PartialsPropagatorMultiMix) { +TEST_F(mathMix, func_PartialsPropagatorMultiMix) { using stan::math::fvar; using stan::math::make_partials_propagator; using stan::math::var; @@ -153,7 +153,7 @@ TEST(MathMetaMix, PartialsPropagatorMultiMix) { EXPECT_FLOAT_EQ(0.0, gradient[3]); } -TEST(MathMetaMix, PartialsPropagatorMultiMix_dbl) { +TEST_F(mathMix, func_PartialsPropagatorMultiMix_dbl) { using stan::math::fvar; using stan::math::make_partials_propagator; using stan::math::var; @@ -218,7 +218,7 @@ TEST(MathMetaMix, PartialsPropagatorMultiMix_dbl) { EXPECT_FLOAT_EQ(0.0, gradient[3]); } -TEST(MathMetaMix, PartialsPropagatorMultiStdMix) { +TEST_F(mathMix, func_PartialsPropagatorMultiStdMix) { using stan::math::fvar; using stan::math::make_partials_propagator; using stan::math::var; @@ -284,7 +284,7 @@ TEST(MathMetaMix, PartialsPropagatorMultiStdMix) { EXPECT_FLOAT_EQ(0.0, gradient[3]); } -TEST(MathMetaMix, PartialsPropagatorMultiStdMix_dbl) { +TEST_F(mathMix, func_PartialsPropagatorMultiStdMix_dbl) { using stan::math::fvar; using stan::math::make_partials_propagator; using stan::math::var; @@ -353,7 +353,7 @@ TEST(MathMetaMix, PartialsPropagatorMultiStdMix_dbl) { EXPECT_FLOAT_EQ(0.0, gradient[3]); } -TEST(MathMetaMix, PartialsPropagatorMultiMixInt) { +TEST_F(mathMix, func_PartialsPropagatorMultiMixInt) { using stan::math::make_partials_propagator; typedef Eigen::Matrix uni_mat_t; @@ -382,7 +382,7 @@ TEST(MathMetaMix, PartialsPropagatorMultiMixInt) { EXPECT_FLOAT_EQ(10.0, v); } -TEST(MathMetaMix, PartialsPropagatorMultiMixInt_dbl) { +TEST_F(mathMix, func_PartialsPropagatorMultiMixInt_dbl) { using stan::math::make_partials_propagator; typedef Eigen::Matrix uni_mat_t; diff --git a/test/unit/math/mix/functor/reduce_sum_part1_test.cpp b/test/unit/math/mix/functor/reduce_sum_part1_test.cpp index ad219f26182..f22218cccb9 100644 --- a/test/unit/math/mix/functor/reduce_sum_part1_test.cpp +++ b/test/unit/math/mix/functor/reduce_sum_part1_test.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -8,7 +9,7 @@ // Reduce sum tests are broken up into four files to avoid windows compiler // error -TEST_F(AgradRev, reduce_sum_grainsize_static) { +TEST_F(mathMix, reduce_sum_grainsize_static) { using stan::math::test::get_new_msg; using stan::math::test::sum_lpdf; @@ -33,7 +34,7 @@ TEST_F(AgradRev, reduce_sum_grainsize_static) { stan::test::expect_ad(f4, data); } -TEST_F(AgradRev, reduce_sum_grainsize) { +TEST_F(mathMix, reduce_sum_grainsize) { using stan::math::test::get_new_msg; using stan::math::test::sum_lpdf; auto f1 = [](auto&& data) { @@ -57,7 +58,7 @@ TEST_F(AgradRev, reduce_sum_grainsize) { stan::test::expect_ad(f4, data); } -TEST_F(AgradRev, reduce_sum_std_vector_zero_length) { +TEST_F(mathMix, reduce_sum_std_vector_zero_length) { using stan::math::test::reduce_sum_static_sum_lpdf; using stan::math::test::reduce_sum_sum_lpdf; @@ -67,7 +68,7 @@ TEST_F(AgradRev, reduce_sum_std_vector_zero_length) { stan::test::expect_ad(reduce_sum_sum_lpdf, data); } -TEST_F(AgradRev, reduce_sum_std_vector_double_slice) { +TEST_F(mathMix, reduce_sum_std_vector_double_slice) { using stan::math::test::reduce_sum_static_sum_lpdf; using stan::math::test::reduce_sum_sum_lpdf; @@ -77,7 +78,7 @@ TEST_F(AgradRev, reduce_sum_std_vector_double_slice) { stan::test::expect_ad(reduce_sum_sum_lpdf, data); } -TEST_F(AgradRev, reduce_sum_std_vector_std_vector_double_slice) { +TEST_F(mathMix, reduce_sum_std_vector_std_vector_double_slice) { using stan::math::test::reduce_sum_static_sum_lpdf; using stan::math::test::reduce_sum_sum_lpdf; @@ -87,7 +88,7 @@ TEST_F(AgradRev, reduce_sum_std_vector_std_vector_double_slice) { stan::test::expect_ad(reduce_sum_sum_lpdf, data); } -TEST_F(AgradRev, reduce_sum_std_vector_eigen_vector_double_slice) { +TEST_F(mathMix, reduce_sum_std_vector_eigen_vector_double_slice) { using stan::math::test::reduce_sum_static_sum_lpdf; using stan::math::test::reduce_sum_sum_lpdf; @@ -97,7 +98,7 @@ TEST_F(AgradRev, reduce_sum_std_vector_eigen_vector_double_slice) { stan::test::expect_ad(reduce_sum_sum_lpdf, data); } -TEST_F(AgradRev, reduce_sum_std_vector_eigen_row_vector_double_slice) { +TEST_F(mathMix, reduce_sum_std_vector_eigen_row_vector_double_slice) { using stan::math::test::reduce_sum_static_sum_lpdf; using stan::math::test::reduce_sum_sum_lpdf; @@ -107,7 +108,7 @@ TEST_F(AgradRev, reduce_sum_std_vector_eigen_row_vector_double_slice) { stan::test::expect_ad(reduce_sum_sum_lpdf, data); } -TEST_F(AgradRev, reduce_sum_std_vector_eigen_matrix_double_slice) { +TEST_F(mathMix, reduce_sum_std_vector_eigen_matrix_double_slice) { using stan::math::test::reduce_sum_static_sum_lpdf; using stan::math::test::reduce_sum_sum_lpdf; @@ -117,7 +118,7 @@ TEST_F(AgradRev, reduce_sum_std_vector_eigen_matrix_double_slice) { stan::test::expect_ad(reduce_sum_sum_lpdf, data); } -TEST_F(AgradRev, reduce_sum_std_vector_std_vector_std_vector_double_slice) { +TEST_F(mathMix, reduce_sum_std_vector_std_vector_std_vector_double_slice) { using stan::math::test::reduce_sum_static_sum_lpdf; using stan::math::test::reduce_sum_sum_lpdf; @@ -128,7 +129,7 @@ TEST_F(AgradRev, reduce_sum_std_vector_std_vector_std_vector_double_slice) { stan::test::expect_ad(reduce_sum_sum_lpdf, data); } -TEST_F(AgradRev, reduce_sum_std_vector_std_vector_eigen_vector_double_slice) { +TEST_F(mathMix, reduce_sum_std_vector_std_vector_eigen_vector_double_slice) { using stan::math::test::reduce_sum_static_sum_lpdf; using stan::math::test::reduce_sum_sum_lpdf; @@ -139,7 +140,7 @@ TEST_F(AgradRev, reduce_sum_std_vector_std_vector_eigen_vector_double_slice) { stan::test::expect_ad(reduce_sum_sum_lpdf, data); } -TEST_F(AgradRev, +TEST_F(mathMix, reduce_sum_std_vector_std_vector_eigen_row_vector_double_slice) { using stan::math::test::reduce_sum_static_sum_lpdf; using stan::math::test::reduce_sum_sum_lpdf; @@ -151,7 +152,7 @@ TEST_F(AgradRev, stan::test::expect_ad(reduce_sum_sum_lpdf, data); } -TEST_F(AgradRev, reduce_sum_std_vector_std_vector_eigen_matrix_double_slice) { +TEST_F(mathMix, reduce_sum_std_vector_std_vector_eigen_matrix_double_slice) { using stan::math::test::reduce_sum_static_sum_lpdf; using stan::math::test::reduce_sum_sum_lpdf; @@ -162,7 +163,7 @@ TEST_F(AgradRev, reduce_sum_std_vector_std_vector_eigen_matrix_double_slice) { stan::test::expect_ad(reduce_sum_sum_lpdf, data); } -TEST(StanMath_reduce_sum_static, start_end_slice) { +TEST_F(mathMix, func_start_end_slice) { using stan::math::test::get_new_msg; using stan::math::test::start_end_lpdf; auto start_end_static = [](auto&& arg) { @@ -181,7 +182,7 @@ TEST(StanMath_reduce_sum_static, start_end_slice) { stan::test::expect_ad(start_end_static, data); } -TEST_F(AgradRev, reduce_sum_int_arg) { +TEST_F(mathMix, reduce_sum_int_arg) { using stan::math::test::reduce_sum_static_sum_lpdf; using stan::math::test::reduce_sum_sum_lpdf; std::vector data(2, 1.0); @@ -193,7 +194,7 @@ TEST_F(AgradRev, reduce_sum_int_arg) { [&](auto&& data) { return reduce_sum_sum_lpdf(data, arg); }, data); } -TEST_F(AgradRev, reduce_sum_std_vector_int_arg) { +TEST_F(mathMix, reduce_sum_std_vector_int_arg) { using stan::math::test::reduce_sum_static_sum_lpdf; using stan::math::test::reduce_sum_sum_lpdf; std::vector data(2, 10.0); @@ -205,12 +206,12 @@ TEST_F(AgradRev, reduce_sum_std_vector_int_arg) { [&](auto&& data) { return reduce_sum_sum_lpdf(data, arg); }, data); } -TEST_F(AgradRev, reduce_sum_double_arg) { +TEST_F(mathMix, reduce_sum_double_arg) { stan::math::test::expect_ad_reduce_sum_lpdf(std::vector(2, 10.0), 5.0); } -TEST_F(AgradRev, reduce_sum_std_vector_double_arg) { +TEST_F(mathMix, reduce_sum_std_vector_double_arg) { stan::math::test::expect_ad_reduce_sum_lpdf(std::vector(2, 10.0), std::vector(2, 10.0)); } diff --git a/test/unit/math/mix/functor/reduce_sum_part2_test.cpp b/test/unit/math/mix/functor/reduce_sum_part2_test.cpp index 16a9c7b4b2d..09b840659cd 100644 --- a/test/unit/math/mix/functor/reduce_sum_part2_test.cpp +++ b/test/unit/math/mix/functor/reduce_sum_part2_test.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -9,41 +10,41 @@ // Reduce sum tests are broken up into four files to avoid windows compiler // error -TEST_F(AgradRev, reduce_sum_eigen_vector_arg) { +TEST_F(mathMix, reduce_sum_eigen_vector_arg) { std::vector data(2, 10.0); Eigen::VectorXd arg = Eigen::VectorXd::Ones(2); stan::math::test::expect_ad_reduce_sum_lpdf(data, arg); } -TEST_F(AgradRev, reduce_sum_eigen_row_vector_arg) { +TEST_F(mathMix, reduce_sum_eigen_row_vector_arg) { std::vector data(2, 10.0); Eigen::RowVectorXd arg = Eigen::RowVectorXd::Ones(2); stan::math::test::expect_ad_reduce_sum_lpdf(data, arg); } -TEST_F(AgradRev, reduce_sum_eigen_matrix_arg) { +TEST_F(mathMix, reduce_sum_eigen_matrix_arg) { std::vector data(2, 10.0); Eigen::MatrixXd arg = Eigen::MatrixXd::Ones(2, 2); stan::math::test::expect_ad_reduce_sum_lpdf(data, arg); } -TEST_F(AgradRev, reduce_sum_std_vector_std_vector_double_arg) { +TEST_F(mathMix, reduce_sum_std_vector_std_vector_double_arg) { std::vector data(2, 10.0); std::vector> arg(2, std::vector(2, 10.0)); stan::math::test::expect_ad_reduce_sum_lpdf(data, arg); } -TEST_F(AgradRev, reduce_sum_std_vector_eigen_vector_arg) { +TEST_F(mathMix, reduce_sum_std_vector_eigen_vector_arg) { std::vector data(2, 10.0); std::vector arg(2, Eigen::VectorXd::Ones(2)); stan::math::test::expect_ad_reduce_sum_lpdf(data, arg); } -TEST_F(AgradRev, reduce_sum_std_vector_eigen_row_vector_arg) { +TEST_F(mathMix, reduce_sum_std_vector_eigen_row_vector_arg) { std::vector data(2, 10.0); std::vector arg(2, Eigen::RowVectorXd::Ones(2)); diff --git a/test/unit/math/mix/functor/reduce_sum_part3_test.cpp b/test/unit/math/mix/functor/reduce_sum_part3_test.cpp index 1999ce0d871..faa46f37df2 100644 --- a/test/unit/math/mix/functor/reduce_sum_part3_test.cpp +++ b/test/unit/math/mix/functor/reduce_sum_part3_test.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -9,7 +10,7 @@ // Reduce sum tests are broken up into four files to avoid windows compiler // error -TEST_F(AgradRev, reduce_sum_eigen_three_args1) { +TEST_F(mathMix, reduce_sum_eigen_three_args1) { using stan::math::test::reduce_sum_int_sum_lpdf; using stan::math::test::reduce_sum_static_int_sum_lpdf; Eigen::VectorXd arg1 = Eigen::VectorXd::Ones(2); @@ -20,7 +21,7 @@ TEST_F(AgradRev, reduce_sum_eigen_three_args1) { stan::test::expect_ad(reduce_sum_int_sum_lpdf, arg1, arg2, arg3); } -TEST_F(AgradRev, reduce_sum_eigen_three_args2) { +TEST_F(mathMix, reduce_sum_eigen_three_args2) { using stan::math::test::reduce_sum_int_sum_lpdf; using stan::math::test::reduce_sum_static_int_sum_lpdf; double arg1 = 1.0; @@ -31,7 +32,7 @@ TEST_F(AgradRev, reduce_sum_eigen_three_args2) { stan::test::expect_ad(reduce_sum_int_sum_lpdf, arg1, arg2, arg3); } -TEST_F(AgradRev, reduce_sum_eigen_three_args3) { +TEST_F(mathMix, reduce_sum_eigen_three_args3) { using stan::math::test::reduce_sum_int_sum_lpdf; using stan::math::test::reduce_sum_static_int_sum_lpdf; double arg1 = 1.0; @@ -42,7 +43,7 @@ TEST_F(AgradRev, reduce_sum_eigen_three_args3) { stan::test::expect_ad(reduce_sum_int_sum_lpdf, arg1, arg2, arg3); } -TEST_F(AgradRev, reduce_sum_eigen_three_args_with_ints1) { +TEST_F(mathMix, reduce_sum_eigen_three_args_with_ints1) { using stan::math::test::reduce_sum_int_sum_lpdf; using stan::math::test::reduce_sum_static_int_sum_lpdf; Eigen::VectorXd arg1 = Eigen::VectorXd::Ones(2); @@ -64,7 +65,7 @@ TEST_F(AgradRev, reduce_sum_eigen_three_args_with_ints1) { arg1, arg2, arg3); } -TEST_F(AgradRev, reduce_sum_eigen_three_args_with_ints2) { +TEST_F(mathMix, reduce_sum_eigen_three_args_with_ints2) { using stan::math::test::reduce_sum_int_sum_lpdf; using stan::math::test::reduce_sum_static_int_sum_lpdf; double arg1 = 1.0; diff --git a/test/unit/math/mix/functor/reduce_sum_part4_test.cpp b/test/unit/math/mix/functor/reduce_sum_part4_test.cpp index 95d7ccf2fa7..6a7d49d42e6 100644 --- a/test/unit/math/mix/functor/reduce_sum_part4_test.cpp +++ b/test/unit/math/mix/functor/reduce_sum_part4_test.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -9,7 +10,7 @@ // Reduce sum tests are broken up into four files to avoid windows compiler // error -TEST_F(AgradRev, reduce_sum_eigen_three_args_with_ints3) { +TEST_F(mathMix, reduce_sum_eigen_three_args_with_ints3) { using stan::math::test::reduce_sum_int_sum_lpdf; using stan::math::test::reduce_sum_static_int_sum_lpdf; double arg1 = 1.0; @@ -31,7 +32,7 @@ TEST_F(AgradRev, reduce_sum_eigen_three_args_with_ints3) { arg1, arg2, arg3); } -TEST_F(AgradRev, reduce_sum_eigen_three_args_with_doubles1) { +TEST_F(mathMix, reduce_sum_eigen_three_args_with_doubles1) { using stan::math::test::reduce_sum_static_sum_lpdf; using stan::math::test::reduce_sum_sum_lpdf; Eigen::VectorXd arg1 = Eigen::VectorXd::Ones(2); @@ -54,7 +55,7 @@ TEST_F(AgradRev, reduce_sum_eigen_three_args_with_doubles1) { arg1, arg2, arg3); } -TEST_F(AgradRev, reduce_sum_eigen_three_args_with_doubles2) { +TEST_F(mathMix, reduce_sum_eigen_three_args_with_doubles2) { using stan::math::test::reduce_sum_static_sum_lpdf; using stan::math::test::reduce_sum_sum_lpdf; double arg1 = 1.0; @@ -78,7 +79,7 @@ TEST_F(AgradRev, reduce_sum_eigen_three_args_with_doubles2) { arg1, arg2, arg3); } -TEST_F(AgradRev, reduce_sum_eigen_three_args_with_doubles3) { +TEST_F(mathMix, reduce_sum_eigen_three_args_with_doubles3) { using stan::math::test::reduce_sum_static_sum_lpdf; using stan::math::test::reduce_sum_sum_lpdf; double arg1 = 1.0; @@ -103,7 +104,7 @@ TEST_F(AgradRev, reduce_sum_eigen_three_args_with_doubles3) { } #ifdef STAN_THREADS -TEST_F(AgradRev, reduce_sum_static_check) { +TEST_F(mathMix, reduce_sum_static_check) { using stan::math::test::get_new_msg; using stan::math::test::static_check_lpdf; diff --git a/test/unit/math/mix/functor/reduce_sum_util.hpp b/test/unit/math/mix/functor/reduce_sum_util.hpp index 9d70fe1054c..866f10420c4 100644 --- a/test/unit/math/mix/functor/reduce_sum_util.hpp +++ b/test/unit/math/mix/functor/reduce_sum_util.hpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include diff --git a/test/unit/math/mix/meta/require_generics_test.cpp b/test/unit/math/mix/meta/require_generics_test.cpp index 1ee313cc201..0b773496e4e 100644 --- a/test/unit/math/mix/meta/require_generics_test.cpp +++ b/test/unit/math/mix/meta/require_generics_test.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include diff --git a/test/unit/math/mix/prob/bernoulli_logit_glm_lpmf_test.cpp b/test/unit/math/mix/prob/bernoulli_logit_glm_lpmf_test.cpp index fd29b24989e..c4dd21378af 100644 --- a/test/unit/math/mix/prob/bernoulli_logit_glm_lpmf_test.cpp +++ b/test/unit/math/mix/prob/bernoulli_logit_glm_lpmf_test.cpp @@ -1,7 +1,8 @@ #include #include +#include -TEST_F(AgradRev, mathMixScalFun_bernoulli_logit_glm_lpmf) { +TEST_F(mathMix, mathMixScalFun_bernoulli_logit_glm_lpmf) { auto f = [](const auto y) { return [=](const auto& x, const auto& alpha, const auto& beta) { return stan::math::bernoulli_logit_glm_lpmf(y, x, alpha, beta); diff --git a/test/unit/math/mix/prob/categorical_logit_glm_lpmf_test.cpp b/test/unit/math/mix/prob/categorical_logit_glm_lpmf_test.cpp index 68de98a2cd8..041dcb8bc8a 100644 --- a/test/unit/math/mix/prob/categorical_logit_glm_lpmf_test.cpp +++ b/test/unit/math/mix/prob/categorical_logit_glm_lpmf_test.cpp @@ -1,7 +1,8 @@ #include #include +#include -TEST_F(AgradRev, mathMixScalFun_categorical_logit_glm_lpmf) { +TEST_F(mathMix, mathMixScalFun_categorical_logit_glm_lpmf) { auto f = [](const auto y) { return [=](const auto& x, const auto& alpha, const auto& beta) { return stan::math::categorical_logit_glm_lpmf(y, x, alpha, beta); diff --git a/test/unit/math/mix/prob/categorical_logit_test.cpp b/test/unit/math/mix/prob/categorical_logit_test.cpp index 7ef56a77e43..2d36a0aa953 100644 --- a/test/unit/math/mix/prob/categorical_logit_test.cpp +++ b/test/unit/math/mix/prob/categorical_logit_test.cpp @@ -1,10 +1,11 @@ #include #include +#include #include #include #include -TEST_F(AgradRev, ProbDistributionsCategoricalLogit_fvar_var) { +TEST_F(mathMix, ProbDistributionsCategoricalLogit_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -29,7 +30,7 @@ TEST_F(AgradRev, ProbDistributionsCategoricalLogit_fvar_var) { stan::math::categorical_logit_log(3, theta).d_.val()); } -TEST_F(AgradRev, ProbDistributionsCategoricalLogit_fvar_var_vectorized) { +TEST_F(mathMix, ProbDistributionsCategoricalLogit_fvar_var_vectorized) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -58,7 +59,7 @@ TEST_F(AgradRev, ProbDistributionsCategoricalLogit_fvar_var_vectorized) { stan::math::categorical_logit_log(ms, theta).d_.val()); } -TEST_F(AgradRev, ProbDistributionsCategoricalLogit_fvar_fvar_var) { +TEST_F(mathMix, ProbDistributionsCategoricalLogit_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -83,7 +84,7 @@ TEST_F(AgradRev, ProbDistributionsCategoricalLogit_fvar_fvar_var) { stan::math::categorical_logit_log(3, theta).d_.val_.val()); } -TEST_F(AgradRev, ProbDistributionsCategoricalLogit_fvar_fvar_var_vectorized) { +TEST_F(mathMix, ProbDistributionsCategoricalLogit_fvar_fvar_var_vectorized) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; diff --git a/test/unit/math/mix/prob/categorical_test.cpp b/test/unit/math/mix/prob/categorical_test.cpp index 07677308496..67902a5537c 100644 --- a/test/unit/math/mix/prob/categorical_test.cpp +++ b/test/unit/math/mix/prob/categorical_test.cpp @@ -1,11 +1,12 @@ #include #include +#include #include #include #include #include -TEST_F(AgradRev, ProbDistributionsCategorical_fvar_var) { +TEST_F(mathMix, ProbDistributionsCategorical_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -25,7 +26,7 @@ TEST_F(AgradRev, ProbDistributionsCategorical_fvar_var) { EXPECT_FLOAT_EQ(1.0 / 0.5, stan::math::categorical_log(2, theta).d_.val()); EXPECT_FLOAT_EQ(1.0 / 0.2, stan::math::categorical_log(3, theta).d_.val()); } -TEST_F(AgradRev, ProbDistributionsCategorical_fvar_var_vector) { +TEST_F(mathMix, ProbDistributionsCategorical_fvar_var_vector) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -46,7 +47,7 @@ TEST_F(AgradRev, ProbDistributionsCategorical_fvar_var_vector) { stan::math::categorical_log(xs, theta).d_.val()); } -TEST_F(AgradRev, ProbDistributionsCategorical_fvar_fvar_var) { +TEST_F(mathMix, ProbDistributionsCategorical_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -69,7 +70,7 @@ TEST_F(AgradRev, ProbDistributionsCategorical_fvar_fvar_var) { EXPECT_FLOAT_EQ(1.0 / 0.2, stan::math::categorical_log(3, theta).d_.val_.val()); } -TEST_F(AgradRev, ProbDistributionsCategorical_fvar_fvar_var_vector) { +TEST_F(mathMix, ProbDistributionsCategorical_fvar_fvar_var_vector) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; diff --git a/test/unit/math/mix/prob/dirichlet_test.cpp b/test/unit/math/mix/prob/dirichlet_test.cpp index 67738c72b6e..51d4a69fa93 100644 --- a/test/unit/math/mix/prob/dirichlet_test.cpp +++ b/test/unit/math/mix/prob/dirichlet_test.cpp @@ -1,4 +1,5 @@ #include +#include namespace dirichlet_test { template @@ -16,7 +17,7 @@ auto vectorize_softmax(const T& y) { } } // namespace dirichlet_test -TEST_F(AgradRev, ProbDistributions_dirichlet) { +TEST_F(mathMix, ProbDistributions_dirichlet) { auto f = [](const auto& y, const auto& alpha) { auto y_simplex = dirichlet_test::vectorize_softmax(y); auto lp = stan::math::dirichlet_lpdf(y_simplex, alpha); @@ -36,7 +37,7 @@ TEST_F(AgradRev, ProbDistributions_dirichlet) { stan::test::expect_ad(f, vs, vs); } -TEST_F(AgradRev, ProbDistributions_fvar_var) { +TEST_F(mathMix, ProbDistributions_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -70,7 +71,7 @@ TEST_F(AgradRev, ProbDistributions_fvar_var) { stan::math::dirichlet_log(theta2, alpha2).d_.val()); } -TEST_F(AgradRev, ProbDistributions_fvar_varVectorized) { +TEST_F(mathMix, ProbDistributions_fvar_varVectorized) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::dirichlet_log; @@ -126,7 +127,7 @@ TEST_F(AgradRev, ProbDistributions_fvar_varVectorized) { EXPECT_FLOAT_EQ(result.d().val().sum(), out.d_.val()); } -TEST_F(AgradRev, ProbDistributions_fvar_fvar_var) { +TEST_F(mathMix, ProbDistributions_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -161,7 +162,7 @@ TEST_F(AgradRev, ProbDistributions_fvar_fvar_var) { stan::math::dirichlet_log(theta2, alpha2).d_.val_.val()); } -TEST_F(AgradRev, ProbDistributions_fvar_fvar_varVectorized) { +TEST_F(mathMix, ProbDistributions_fvar_fvar_varVectorized) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::dirichlet_log; diff --git a/test/unit/math/mix/prob/gamma_cdf_log_test.cpp b/test/unit/math/mix/prob/gamma_cdf_log_test.cpp index 185bc13c450..8e8555dda03 100644 --- a/test/unit/math/mix/prob/gamma_cdf_log_test.cpp +++ b/test/unit/math/mix/prob/gamma_cdf_log_test.cpp @@ -1,7 +1,8 @@ #include #include +#include -TEST_F(AgradRev, mathMixScalFun_gamma_lcdf) { +TEST_F(mathMix, mathMixScalFun_gamma_lcdf) { auto f = [](const auto& y, const auto& alpha, const auto& beta) { return stan::math::gamma_lcdf(y, alpha, beta); }; diff --git a/test/unit/math/mix/prob/gaussian_dlm_obs_test.cpp b/test/unit/math/mix/prob/gaussian_dlm_obs_test.cpp index 186ddcd15dd..46759a3dae1 100644 --- a/test/unit/math/mix/prob/gaussian_dlm_obs_test.cpp +++ b/test/unit/math/mix/prob/gaussian_dlm_obs_test.cpp @@ -1,8 +1,9 @@ #include #include +#include #include -TEST_F(AgradRev, ProbDistributionsGaussianDLM_LoglikeUU_fvar_var) { +TEST_F(mathMix, ProbDistributionsGaussianDLM_LoglikeUU_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using Eigen::MatrixXd; @@ -35,7 +36,7 @@ TEST_F(AgradRev, ProbDistributionsGaussianDLM_LoglikeUU_fvar_var) { EXPECT_FLOAT_EQ(-3.8427677, lp_ref.d_.val()); } -TEST_F(AgradRev, ProbDistributionsGaussianDLM_LoglikeMM_fvar_var) { +TEST_F(mathMix, ProbDistributionsGaussianDLM_LoglikeMM_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using Eigen::MatrixXd; @@ -88,7 +89,7 @@ TEST_F(AgradRev, ProbDistributionsGaussianDLM_LoglikeMM_fvar_var) { EXPECT_NEAR(18.89044287309947, lp_ref.d_.val(), 1e-4); } -TEST_F(AgradRev, ProbDistributionsGaussianDLM_LoglikeUU_fvar_fvar_var) { +TEST_F(mathMix, ProbDistributionsGaussianDLM_LoglikeUU_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using Eigen::MatrixXd; @@ -126,7 +127,7 @@ TEST_F(AgradRev, ProbDistributionsGaussianDLM_LoglikeUU_fvar_fvar_var) { EXPECT_FLOAT_EQ(-3.8427677, lp_ref.d_.val_.val()); } -TEST_F(AgradRev, ProbDistributionsGaussianDLM_LoglikeMM_fvar_fvar_var) { +TEST_F(mathMix, ProbDistributionsGaussianDLM_LoglikeMM_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using Eigen::MatrixXd; diff --git a/test/unit/math/mix/prob/inv_wishart_cholesky_test.cpp b/test/unit/math/mix/prob/inv_wishart_cholesky_test.cpp index 04556b5efaa..1324f82e982 100644 --- a/test/unit/math/mix/prob/inv_wishart_cholesky_test.cpp +++ b/test/unit/math/mix/prob/inv_wishart_cholesky_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST_F(AgradRev, ProbDistributionsInvWishartCholesky_matvar) { +TEST_F(mathMix, ProbDistributionsInvWishartCholesky_matvar) { auto f = [](const auto& L_Y, const auto& dof, const auto& L_S) { return stan::math::inv_wishart_cholesky_lpdf(L_Y, dof, L_S); }; @@ -34,7 +35,7 @@ TEST_F(AgradRev, ProbDistributionsInvWishartCholesky_matvar) { stan::test::expect_ad_matvar(f, L_Y11, dof, L_S00); } -TEST_F(AgradRev, ProbDistributionsInvWishartCholesky_fvar_var) { +TEST_F(mathMix, ProbDistributionsInvWishartCholesky_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -69,7 +70,7 @@ TEST_F(AgradRev, ProbDistributionsInvWishartCholesky_fvar_var) { stan::math::recover_memory(); } -TEST_F(AgradRev, ProbDistributionsInvWishartCholesky_fvar_fvar_var) { +TEST_F(mathMix, ProbDistributionsInvWishartCholesky_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; diff --git a/test/unit/math/mix/prob/inv_wishart_test.cpp b/test/unit/math/mix/prob/inv_wishart_test.cpp index 240cd2ac246..8ca523b449c 100644 --- a/test/unit/math/mix/prob/inv_wishart_test.cpp +++ b/test/unit/math/mix/prob/inv_wishart_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST_F(AgradRev, ProbDistributionsInvWishart_matvar) { +TEST_F(mathMix, ProbDistributionsInvWishart_matvar) { auto f = [](const auto& y, const auto& dof, const auto& sigma) { auto&& y_ref = stan::math::to_ref(y); auto y_sym = stan::math::multiply(0.5, y_ref + y_ref.transpose()); @@ -37,7 +38,7 @@ TEST_F(AgradRev, ProbDistributionsInvWishart_matvar) { stan::test::expect_ad_matvar(f, y11, dof, Sigma00); } -TEST_F(AgradRev, ProbDistributionsInvWishart_fvar_var) { +TEST_F(mathMix, ProbDistributionsInvWishart_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -69,7 +70,7 @@ TEST_F(AgradRev, ProbDistributionsInvWishart_fvar_var) { stan::math::recover_memory(); } -TEST_F(AgradRev, ProbDistributionsInvWishart_fvar_fvar_var) { +TEST_F(mathMix, ProbDistributionsInvWishart_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; diff --git a/test/unit/math/mix/prob/lkj_corr_test.cpp b/test/unit/math/mix/prob/lkj_corr_test.cpp index aa023d4f4ad..aba519ea930 100644 --- a/test/unit/math/mix/prob/lkj_corr_test.cpp +++ b/test/unit/math/mix/prob/lkj_corr_test.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -7,7 +8,7 @@ #include #include -TEST_F(AgradRev, ProbDistributionsLkjCorr_fvar_var) { +TEST_F(mathMix, ProbDistributionsLkjCorr_fvar_var) { using stan::math::fvar; using stan::math::var; boost::random::mt19937 rng; @@ -29,7 +30,7 @@ TEST_F(AgradRev, ProbDistributionsLkjCorr_fvar_var) { EXPECT_FLOAT_EQ(f.d_.val(), stan::math::lkj_corr_log(Sigma, eta).d_.val()); } -TEST_F(AgradRev, ProbDistributionsLkjCorrCholesky_fvar_var) { +TEST_F(mathMix, ProbDistributionsLkjCorrCholesky_fvar_var) { using stan::math::fvar; using stan::math::var; boost::random::mt19937 rng; @@ -52,7 +53,7 @@ TEST_F(AgradRev, ProbDistributionsLkjCorrCholesky_fvar_var) { EXPECT_FLOAT_EQ(3, stan::math::lkj_corr_cholesky_log(Sigma, eta).d_.val()); } -TEST_F(AgradRev, ProbDistributionsLkjCorr_fvar_fvar_var) { +TEST_F(mathMix, ProbDistributionsLkjCorr_fvar_fvar_var) { using stan::math::fvar; using stan::math::var; boost::random::mt19937 rng; @@ -76,7 +77,7 @@ TEST_F(AgradRev, ProbDistributionsLkjCorr_fvar_fvar_var) { stan::math::lkj_corr_log(Sigma, eta).d_.val_.val()); } -TEST_F(AgradRev, ProbDistributionsLkjCorrCholesky_fvar_fvar_var) { +TEST_F(mathMix, ProbDistributionsLkjCorrCholesky_fvar_fvar_var) { using stan::math::fvar; using stan::math::var; boost::random::mt19937 rng; @@ -102,7 +103,7 @@ TEST_F(AgradRev, ProbDistributionsLkjCorrCholesky_fvar_fvar_var) { stan::math::lkj_corr_cholesky_log(Sigma, eta).d_.val_.val()); } -TEST_F(AgradRev, ProbDistributionsLkjCorrCholesky_hessian) { +TEST_F(mathMix, ProbDistributionsLkjCorrCholesky_hessian) { int dim_mat = 3; Eigen::Matrix x1(dim_mat); Eigen::Matrix x2(1); @@ -163,7 +164,7 @@ TEST_F(AgradRev, ProbDistributionsLkjCorrCholesky_hessian) { EXPECT_FLOAT_EQ(fx_hess_1, fx_hess_ad_1); } -TEST_F(AgradRev, ProbDistributionsLkjCorrCholesky_grad_hessian) { +TEST_F(mathMix, ProbDistributionsLkjCorrCholesky_grad_hessian) { int dim_mat = 3; Eigen::Matrix x1(dim_mat); Eigen::Matrix x2(1); diff --git a/test/unit/math/mix/prob/matrix_normal_prec_test.cpp b/test/unit/math/mix/prob/matrix_normal_prec_test.cpp index 914c641735b..92a2ca544d7 100644 --- a/test/unit/math/mix/prob/matrix_normal_prec_test.cpp +++ b/test/unit/math/mix/prob/matrix_normal_prec_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST_F(AgradRev, ProbDistributionsMatrixNormal_matvar) { +TEST_F(mathMix, ProbDistributionsMatrixNormal_matvar) { auto f = [](const auto& y, const auto& mu, const auto& sigma, const auto& D) { auto&& sigma_ref = stan::math::to_ref(sigma); auto sigma_sym @@ -73,7 +74,7 @@ TEST_F(AgradRev, ProbDistributionsMatrixNormal_matvar) { stan::test::expect_ad_matvar(f, y1, mu1, Sigma00, D11); } -TEST_F(AgradRev, ProbDistributionsMatrixNormal_fvar_var) { +TEST_F(mathMix, ProbDistributionsMatrixNormal_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -111,7 +112,7 @@ TEST_F(AgradRev, ProbDistributionsMatrixNormal_fvar_var) { stan::math::recover_memory(); } -TEST_F(AgradRev, ProbDistributionsMatrixNormal_fvar_fvar_var) { +TEST_F(mathMix, ProbDistributionsMatrixNormal_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; diff --git a/test/unit/math/mix/prob/multi_gp_cholesky_test.cpp b/test/unit/math/mix/prob/multi_gp_cholesky_test.cpp index c4c65272ce3..aea54171501 100644 --- a/test/unit/math/mix/prob/multi_gp_cholesky_test.cpp +++ b/test/unit/math/mix/prob/multi_gp_cholesky_test.cpp @@ -1,8 +1,9 @@ #include #include +#include #include -TEST_F(AgradRev, ProbDistributionsMultiGPCholesky_fvar_var) { +TEST_F(mathMix, ProbDistributionsMultiGPCholesky_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -49,7 +50,7 @@ TEST_F(AgradRev, ProbDistributionsMultiGPCholesky_fvar_var) { stan::math::recover_memory(); } -TEST_F(AgradRev, ProbDistributionsMultiGPCholesky_fvar_fvar_var) { +TEST_F(mathMix, ProbDistributionsMultiGPCholesky_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; diff --git a/test/unit/math/mix/prob/multi_gp_test.cpp b/test/unit/math/mix/prob/multi_gp_test.cpp index 0a46655e28e..736e188922a 100644 --- a/test/unit/math/mix/prob/multi_gp_test.cpp +++ b/test/unit/math/mix/prob/multi_gp_test.cpp @@ -1,8 +1,9 @@ #include #include #include +#include -TEST_F(AgradRev, ProbDistributionsMultiGP_matvar) { +TEST_F(mathMix, ProbDistributionsMultiGP_matvar) { auto f = [](const auto& y, const auto& sigma, const auto& w) { auto sigma_ref = stan::math::to_ref(sigma); auto sigma_sym @@ -48,7 +49,7 @@ TEST_F(AgradRev, ProbDistributionsMultiGP_matvar) { stan::test::expect_ad(f, y22, Sigma00, w0); } -TEST_F(AgradRev, ProbDistributionsMultiGP_fvar_var) { +TEST_F(mathMix, ProbDistributionsMultiGP_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -92,7 +93,7 @@ TEST_F(AgradRev, ProbDistributionsMultiGP_fvar_var) { stan::math::recover_memory(); } -TEST_F(AgradRev, ProbDistributionsMultiGP_fvar_fvar_var) { +TEST_F(mathMix, ProbDistributionsMultiGP_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; diff --git a/test/unit/math/mix/prob/multi_normal_cholesky_test.cpp b/test/unit/math/mix/prob/multi_normal_cholesky_test.cpp index b72de8f6590..721f9b3868d 100644 --- a/test/unit/math/mix/prob/multi_normal_cholesky_test.cpp +++ b/test/unit/math/mix/prob/multi_normal_cholesky_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST_F(AgradRev, ProbDistributionsMultiNormalCholesky_matvar) { +TEST_F(mathMix, ProbDistributionsMultiNormalCholesky_matvar) { auto f = [](const auto& y, const auto& mu, const auto& sigma) { auto&& sigma_ref = stan::math::to_ref(sigma); auto sigma_sym @@ -47,7 +48,7 @@ TEST_F(AgradRev, ProbDistributionsMultiNormalCholesky_matvar) { stan::test::expect_ad_matvar(f, y1, mu1, Sigma00); } -TEST_F(AgradRev, ProbDistributionsMultiNormalCholesky_fvar_var) { +TEST_F(mathMix, ProbDistributionsMultiNormalCholesky_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -75,7 +76,7 @@ TEST_F(AgradRev, ProbDistributionsMultiNormalCholesky_fvar_var) { stan::math::multi_normal_cholesky_log(y, mu, L).d_.val()); } -TEST_F(AgradRev, ProbDistributionsMultiNormalCholesky_fvar_fvar_var) { +TEST_F(mathMix, ProbDistributionsMultiNormalCholesky_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; diff --git a/test/unit/math/mix/prob/multi_normal_prec_test.cpp b/test/unit/math/mix/prob/multi_normal_prec_test.cpp index 8706e6d5cfe..1f87278f090 100644 --- a/test/unit/math/mix/prob/multi_normal_prec_test.cpp +++ b/test/unit/math/mix/prob/multi_normal_prec_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST_F(AgradRev, ProbDistributionsMultiNormalPrec_matvar) { +TEST_F(mathMix, ProbDistributionsMultiNormalPrec_matvar) { auto f = [](const auto& y, const auto& mu, const auto& sigma) { auto&& sigma_ref = stan::math::to_ref(sigma); auto inv_sigma_sym @@ -39,7 +40,7 @@ TEST_F(AgradRev, ProbDistributionsMultiNormalPrec_matvar) { stan::test::expect_ad_matvar(f, y1, mu1, InvSigma00); } -TEST_F(AgradRev, ProbDistributionsMultiNormalPrec_fvar_var) { +TEST_F(mathMix, ProbDistributionsMultiNormalPrec_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -69,7 +70,7 @@ TEST_F(AgradRev, ProbDistributionsMultiNormalPrec_fvar_var) { stan::math::recover_memory(); } -TEST_F(AgradRev, ProbDistributionsMultiNormalPrec_fvar_fvar_var) { +TEST_F(mathMix, ProbDistributionsMultiNormalPrec_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; diff --git a/test/unit/math/mix/prob/multi_normal_test.cpp b/test/unit/math/mix/prob/multi_normal_test.cpp index 21e57be711a..34213858312 100644 --- a/test/unit/math/mix/prob/multi_normal_test.cpp +++ b/test/unit/math/mix/prob/multi_normal_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST_F(AgradRev, ProbDistributionsMultiNormal_matvar) { +TEST_F(mathMix, ProbDistributionsMultiNormal_matvar) { auto f = [](const auto& y, const auto& mu, const auto& sigma) { auto&& sigma_ref = stan::math::to_ref(sigma); @@ -50,7 +51,7 @@ TEST_F(AgradRev, ProbDistributionsMultiNormal_matvar) { stan::test::expect_ad_matvar(f, y1, mu1, Sigma00); } -TEST_F(AgradRev, ProbDistributionsMultiNormal_fvar_var) { +TEST_F(mathMix, ProbDistributionsMultiNormal_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -77,7 +78,7 @@ TEST_F(AgradRev, ProbDistributionsMultiNormal_fvar_var) { stan::math::recover_memory(); } -TEST_F(AgradRev, ProbDistributionsMultiNormal_fvar_fvar_var) { +TEST_F(mathMix, ProbDistributionsMultiNormal_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; diff --git a/test/unit/math/mix/prob/multi_student_t_test.cpp b/test/unit/math/mix/prob/multi_student_t_test.cpp index f630ba8ab9e..f8176a50a92 100644 --- a/test/unit/math/mix/prob/multi_student_t_test.cpp +++ b/test/unit/math/mix/prob/multi_student_t_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST_F(AgradRev, ProbDistributionsMultiStudentT_matvar) { +TEST_F(mathMix, ProbDistributionsMultiStudentT_matvar) { auto f = [](const auto& y, const auto& nu, const auto& mu, const auto& sigma) { auto&& sigma_ref = stan::math::to_ref(sigma); @@ -64,7 +65,7 @@ TEST_F(AgradRev, ProbDistributionsMultiStudentT_matvar) { stan::test::expect_ad_matvar(f, y1, nu, mu1, Sigma00); } -TEST_F(AgradRev, ProbDistributionsMultiStudentT_fvar_var) { +TEST_F(mathMix, ProbDistributionsMultiStudentT_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -93,7 +94,7 @@ TEST_F(AgradRev, ProbDistributionsMultiStudentT_fvar_var) { stan::math::recover_memory(); } -TEST_F(AgradRev, ProbDistributionsMultiStudentT_fvar_fvar_var) { +TEST_F(mathMix, ProbDistributionsMultiStudentT_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; diff --git a/test/unit/math/mix/prob/multinomial_logit_test.cpp b/test/unit/math/mix/prob/multinomial_logit_test.cpp index 1c6e54767f4..733c4dfe144 100644 --- a/test/unit/math/mix/prob/multinomial_logit_test.cpp +++ b/test/unit/math/mix/prob/multinomial_logit_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST_F(AgradRev, mathMixScalFun_multinomialLogit) { +TEST_F(mathMix, mathMixScalFun_multinomialLogit) { std::vector ns{0, 1, 2, 3}; Eigen::VectorXd beta(4); beta << 0.1, 0.1, 0.5, 0.3; diff --git a/test/unit/math/mix/prob/multinomial_test.cpp b/test/unit/math/mix/prob/multinomial_test.cpp index 9cb81c0f6f2..c30e19c6809 100644 --- a/test/unit/math/mix/prob/multinomial_test.cpp +++ b/test/unit/math/mix/prob/multinomial_test.cpp @@ -1,11 +1,12 @@ #include #include +#include #include #include #include #include -TEST_F(AgradRev, ProbDistributionsMultinomial_fvar_var) { +TEST_F(mathMix, ProbDistributionsMultinomial_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -23,7 +24,7 @@ TEST_F(AgradRev, ProbDistributionsMultinomial_fvar_var) { EXPECT_FLOAT_EQ(17.666666, stan::math::multinomial_log(ns, theta).d_.val()); } -TEST_F(AgradRev, ProbDistributionsMultinomial_fvar_fvar_var) { +TEST_F(mathMix, ProbDistributionsMultinomial_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; diff --git a/test/unit/math/mix/prob/neg_binomial_2_log_glm_lpmf_test.cpp b/test/unit/math/mix/prob/neg_binomial_2_log_glm_lpmf_test.cpp index 5934aaf04b2..e97b9db635f 100644 --- a/test/unit/math/mix/prob/neg_binomial_2_log_glm_lpmf_test.cpp +++ b/test/unit/math/mix/prob/neg_binomial_2_log_glm_lpmf_test.cpp @@ -1,7 +1,8 @@ #include #include +#include -TEST_F(AgradRev, mathMixScalFun_neg_binomial_2_log_glm_lpmf) { +TEST_F(mathMix, mathMixScalFun_neg_binomial_2_log_glm_lpmf) { auto f = [](const auto y, const auto& x) { return [=](const auto& alpha, const auto& beta, const auto& phi) { return stan::math::neg_binomial_2_log_glm_lpmf(y, x, alpha, beta, phi); diff --git a/test/unit/math/mix/prob/neg_binomial_2_log_test.cpp b/test/unit/math/mix/prob/neg_binomial_2_log_test.cpp index 2ef7f77b49d..da61b14a1d1 100644 --- a/test/unit/math/mix/prob/neg_binomial_2_log_test.cpp +++ b/test/unit/math/mix/prob/neg_binomial_2_log_test.cpp @@ -1,9 +1,10 @@ #include #include +#include #include #include -TEST_F(AgradRev, mathMixScalFun_neg_binomial_2_log_lpmf_derivatives) { +TEST_F(mathMix, mathMixScalFun_neg_binomial_2_log_lpmf_derivatives) { auto f1 = [](const auto& eta, const auto& phi) { return stan::math::neg_binomial_2_log_lpmf(0, eta, phi); }; diff --git a/test/unit/math/mix/prob/neg_binomial_test.cpp b/test/unit/math/mix/prob/neg_binomial_test.cpp index 7d69ade8b1c..77ff70e6bc1 100644 --- a/test/unit/math/mix/prob/neg_binomial_test.cpp +++ b/test/unit/math/mix/prob/neg_binomial_test.cpp @@ -1,9 +1,10 @@ #include #include +#include #include #include -TEST_F(AgradRev, mathMixScalFun_neg_binomial_lpmf_derivatives) { +TEST_F(mathMix, mathMixScalFun_neg_binomial_lpmf_derivatives) { auto f = [](const int y) { return [=](const auto& alpha, const auto& beta) { return stan::math::neg_binomial_lpmf(y, alpha, beta); diff --git a/test/unit/math/mix/prob/normal_ccdf_log_test.cpp b/test/unit/math/mix/prob/normal_ccdf_log_test.cpp index e573e7da289..4cf51f7c2b6 100644 --- a/test/unit/math/mix/prob/normal_ccdf_log_test.cpp +++ b/test/unit/math/mix/prob/normal_ccdf_log_test.cpp @@ -1,7 +1,8 @@ #include #include +#include -TEST_F(AgradRev, mathMixScalFun_normal_lccdf) { +TEST_F(mathMix, mathMixScalFun_normal_lccdf) { auto f = [](const double mu, const double sigma) { return [=](const auto& y) { return stan::math::normal_lccdf(y, mu, sigma); }; diff --git a/test/unit/math/mix/prob/normal_cdf_log_test.cpp b/test/unit/math/mix/prob/normal_cdf_log_test.cpp index 7a737c87c77..b33d2f3b5bb 100644 --- a/test/unit/math/mix/prob/normal_cdf_log_test.cpp +++ b/test/unit/math/mix/prob/normal_cdf_log_test.cpp @@ -1,7 +1,8 @@ #include #include +#include -TEST_F(AgradRev, mathMixScalFun_normal_lcdf) { +TEST_F(mathMix, mathMixScalFun_normal_lcdf) { auto f = [](const double mu, const double sigma) { return [=](const auto& y) { return stan::math::normal_lcdf(y, mu, sigma); }; }; diff --git a/test/unit/math/mix/prob/normal_cdf_test.cpp b/test/unit/math/mix/prob/normal_cdf_test.cpp index a73594c447f..ee08276a4a7 100644 --- a/test/unit/math/mix/prob/normal_cdf_test.cpp +++ b/test/unit/math/mix/prob/normal_cdf_test.cpp @@ -1,7 +1,8 @@ #include #include +#include -TEST_F(AgradRev, mathMixScalFun_normal_cdf) { +TEST_F(mathMix, mathMixScalFun_normal_cdf) { auto f = [](const double mu, const double sigma) { return [=](const auto& y) { return stan::math::normal_cdf(y, mu, sigma); }; }; diff --git a/test/unit/math/mix/prob/normal_id_glm_lpdf_test.cpp b/test/unit/math/mix/prob/normal_id_glm_lpdf_test.cpp index f38537c3c08..22ec8fbad0a 100644 --- a/test/unit/math/mix/prob/normal_id_glm_lpdf_test.cpp +++ b/test/unit/math/mix/prob/normal_id_glm_lpdf_test.cpp @@ -1,7 +1,8 @@ #include #include +#include -TEST_F(AgradRev, mathMixScalFun_normal_id_glm_lpdf) { +TEST_F(mathMix, mathMixScalFun_normal_id_glm_lpdf) { auto f = [](const auto& y, const auto& x) { return [=](const auto& alpha, const auto& beta, const auto& sigma) { return stan::math::normal_id_glm_lpdf(y, x, alpha, beta, sigma); diff --git a/test/unit/math/mix/prob/normal_test.cpp b/test/unit/math/mix/prob/normal_test.cpp index 029c9ada73d..709d621c492 100644 --- a/test/unit/math/mix/prob/normal_test.cpp +++ b/test/unit/math/mix/prob/normal_test.cpp @@ -1,7 +1,8 @@ #include #include +#include -TEST_F(AgradRev, mathMixScalFun_normal_lpdf) { +TEST_F(mathMix, mathMixScalFun_normal_lpdf) { auto f = [](const double mu, const double sigma) { return [=](const auto& y) { return stan::math::normal_lpdf(y, mu, sigma); }; }; diff --git a/test/unit/math/mix/prob/ordered_logistic_glm_lpmf_test.cpp b/test/unit/math/mix/prob/ordered_logistic_glm_lpmf_test.cpp index b4791cdbed5..eefcf88aea4 100644 --- a/test/unit/math/mix/prob/ordered_logistic_glm_lpmf_test.cpp +++ b/test/unit/math/mix/prob/ordered_logistic_glm_lpmf_test.cpp @@ -1,7 +1,8 @@ #include #include +#include -TEST_F(AgradRev, mathMixScalFun_ordered_logistic_glm_lpmf) { +TEST_F(mathMix, mathMixScalFun_ordered_logistic_glm_lpmf) { auto f = [](const auto y) { return [=](const auto& x, const auto& beta, const auto& cutpoints) { return stan::math::ordered_logistic_glm_lpmf(y, x, beta, cutpoints); diff --git a/test/unit/math/mix/prob/ordered_logistic_test.cpp b/test/unit/math/mix/prob/ordered_logistic_test.cpp index c749d754223..a3d972c2635 100644 --- a/test/unit/math/mix/prob/ordered_logistic_test.cpp +++ b/test/unit/math/mix/prob/ordered_logistic_test.cpp @@ -1,10 +1,11 @@ #include #include +#include #include #include #include -TEST_F(AgradRev, ProbDistributionsOrdLog_fv_fv) { +TEST_F(mathMix, ProbDistributionsOrdLog_fv_fv) { using stan::math::fvar; using stan::math::ordered_logistic_lpmf; using stan::math::var; @@ -55,7 +56,7 @@ TEST_F(AgradRev, ProbDistributionsOrdLog_fv_fv) { EXPECT_FLOAT_EQ(c_ffv[2].d_.val_.adj(), 0.0); } -TEST_F(AgradRev, ProbDistributionsOrdLog_fv_d) { +TEST_F(mathMix, ProbDistributionsOrdLog_fv_d) { using stan::math::fvar; using stan::math::ordered_logistic_lpmf; using stan::math::var; @@ -123,7 +124,7 @@ TEST_F(AgradRev, ProbDistributionsOrdLog_fv_d) { EXPECT_FLOAT_EQ(c_ffv[2].d_.val_.adj(), 0.0); } -TEST_F(AgradRev, ProbDistributionsOrdLog_fv_fv_vec) { +TEST_F(mathMix, ProbDistributionsOrdLog_fv_fv_vec) { using stan::math::fvar; using stan::math::ordered_logistic_lpmf; using stan::math::var; @@ -188,7 +189,7 @@ TEST_F(AgradRev, ProbDistributionsOrdLog_fv_fv_vec) { EXPECT_FLOAT_EQ(c_ffv[2].d_.val_.adj(), 0.557132795804491); } -TEST_F(AgradRev, ProbDistributionsOrdLog_fv_d_vec) { +TEST_F(mathMix, ProbDistributionsOrdLog_fv_d_vec) { using stan::math::fvar; using stan::math::ordered_logistic_lpmf; using stan::math::var; @@ -271,7 +272,7 @@ TEST_F(AgradRev, ProbDistributionsOrdLog_fv_d_vec) { EXPECT_FLOAT_EQ(c_ffv[2].d_.val_.adj(), 1.20737912023631); } -TEST_F(AgradRev, ProbDistributionsOrdLog_fv_fv_stvec) { +TEST_F(mathMix, ProbDistributionsOrdLog_fv_fv_stvec) { using stan::math::fvar; using stan::math::ordered_logistic_lpmf; using stan::math::var; @@ -399,7 +400,7 @@ TEST_F(AgradRev, ProbDistributionsOrdLog_fv_fv_stvec) { EXPECT_FLOAT_EQ(std_c_ffv[3][2].d_.val_.adj(), -0.497500020833125); } -TEST_F(AgradRev, ProbDistributionsOrdLog_fv_d_stvec) { +TEST_F(mathMix, ProbDistributionsOrdLog_fv_d_stvec) { using stan::math::fvar; using stan::math::ordered_logistic_lpmf; using stan::math::var; diff --git a/test/unit/math/mix/prob/poisson_log_glm_lpmf_test.cpp b/test/unit/math/mix/prob/poisson_log_glm_lpmf_test.cpp index 87292183450..e703e263ad0 100644 --- a/test/unit/math/mix/prob/poisson_log_glm_lpmf_test.cpp +++ b/test/unit/math/mix/prob/poisson_log_glm_lpmf_test.cpp @@ -1,7 +1,8 @@ #include #include +#include -TEST_F(AgradRev, mathMixScalFun_poisson_log_glm_lpmf) { +TEST_F(mathMix, mathMixScalFun_poisson_log_glm_lpmf) { auto f = [](const auto y) { return [=](const auto& x, const auto& alpha, const auto& beta) { return stan::math::poisson_log_glm_lpmf(y, x, alpha, beta); diff --git a/test/unit/math/mix/prob/std_normal_ccdf_log_test.cpp b/test/unit/math/mix/prob/std_normal_ccdf_log_test.cpp index 3c2b01d395a..ffb3cd4d818 100644 --- a/test/unit/math/mix/prob/std_normal_ccdf_log_test.cpp +++ b/test/unit/math/mix/prob/std_normal_ccdf_log_test.cpp @@ -1,7 +1,8 @@ #include #include +#include -TEST_F(AgradRev, mathMixScalFun_std_normal_lccdf) { +TEST_F(mathMix, mathMixScalFun_std_normal_lccdf) { auto f = [](const auto& y) { return stan::math::std_normal_lccdf(y); }; stan::test::expect_ad(f, -50.0); diff --git a/test/unit/math/mix/prob/std_normal_cdf_log_test.cpp b/test/unit/math/mix/prob/std_normal_cdf_log_test.cpp index 7f566f3452f..65ca9910c6f 100644 --- a/test/unit/math/mix/prob/std_normal_cdf_log_test.cpp +++ b/test/unit/math/mix/prob/std_normal_cdf_log_test.cpp @@ -1,7 +1,8 @@ #include #include +#include -TEST_F(AgradRev, mathMixScalFun_std_normal_lcdf) { +TEST_F(mathMix, mathMixScalFun_std_normal_lcdf) { auto f = [](const auto& y) { return stan::math::std_normal_lcdf(y); }; stan::test::expect_ad(f, -50.0); diff --git a/test/unit/math/mix/prob/std_normal_cdf_test.cpp b/test/unit/math/mix/prob/std_normal_cdf_test.cpp index f19e47d5d81..b209c6895ba 100644 --- a/test/unit/math/mix/prob/std_normal_cdf_test.cpp +++ b/test/unit/math/mix/prob/std_normal_cdf_test.cpp @@ -1,7 +1,8 @@ #include #include +#include -TEST_F(AgradRev, mathMixScalFun_std_normal_cdf) { +TEST_F(mathMix, mathMixScalFun_std_normal_cdf) { auto f = [](const auto& y) { return stan::math::std_normal_cdf(y); }; stan::test::expect_ad(f, -50.0); diff --git a/test/unit/math/mix/prob/std_normal_log_qf_test.cpp b/test/unit/math/mix/prob/std_normal_log_qf_test.cpp index 1ae44dd9c27..2d9096c825d 100644 --- a/test/unit/math/mix/prob/std_normal_log_qf_test.cpp +++ b/test/unit/math/mix/prob/std_normal_log_qf_test.cpp @@ -2,9 +2,10 @@ #include #include #include +#include #include -TEST_F(AgradRev, mathMixLogFun_stdNormalLogQf) { +TEST_F(mathMix, mathMixLogFun_stdNormalLogQf) { auto f = [](const auto& x1) { return stan::math::std_normal_log_qf(x1); }; stan::test::expect_ad(f, -100.25); stan::test::expect_unary_vectorized( @@ -14,7 +15,7 @@ TEST_F(AgradRev, mathMixLogFun_stdNormalLogQf) { stan::test::expect_unary_vectorized(f, log(0.02425), log(0.97575)); } -TEST_F(AgradRev, mathMixScalLogFun_stdNormalLogQfInt) { +TEST_F(mathMix, mathMixScalLogFun_stdNormalLogQfInt) { auto f = [](const auto& x1) { return stan::math::std_normal_log_qf(x1); }; int y = 1; stan::test::expect_ad(f, y); @@ -22,7 +23,7 @@ TEST_F(AgradRev, mathMixScalLogFun_stdNormalLogQfInt) { stan::test::expect_ad(f, y); } -TEST_F(AgradRev, mathMixZeroLogFun_stdNormalLogQfZero) { +TEST_F(mathMix, mathMixZeroLogFun_stdNormalLogQfZero) { auto f = [](const auto& x1) { return stan::math::std_normal_log_qf(x1); }; int y_int = 0; stan::test::expect_ad(f, y_int); @@ -31,7 +32,7 @@ TEST_F(AgradRev, mathMixZeroLogFun_stdNormalLogQfZero) { stan::test::expect_ad(f, y); } -TEST_F(AgradRev, mathMixMatFunLog_stdNormalLogQfVarmat) { +TEST_F(mathMix, mathMixMatFunLog_stdNormalLogQfVarmat) { using stan::math::vec_concat; using stan::test::expect_ad_vector_matvar; using stan::test::internal::common_args; diff --git a/test/unit/math/mix/prob/std_normal_test.cpp b/test/unit/math/mix/prob/std_normal_test.cpp index 22a3483409a..edc76f56e1c 100644 --- a/test/unit/math/mix/prob/std_normal_test.cpp +++ b/test/unit/math/mix/prob/std_normal_test.cpp @@ -1,7 +1,8 @@ #include #include +#include -TEST_F(AgradRev, mathMixScalFun_std_normal) { +TEST_F(mathMix, mathMixScalFun_std_normal) { auto f = [](const auto& y) { return stan::math::std_normal_lpdf(y); }; stan::test::expect_ad(f, -0.3); diff --git a/test/unit/math/mix/prob/von_mises_cdf_test.cpp b/test/unit/math/mix/prob/von_mises_cdf_test.cpp index 2f5630e3341..dbb0e23c867 100644 --- a/test/unit/math/mix/prob/von_mises_cdf_test.cpp +++ b/test/unit/math/mix/prob/von_mises_cdf_test.cpp @@ -1,7 +1,8 @@ #include +#include #include -TEST_F(AgradRev, mathMixScalFun_von_mises_cdf) { +TEST_F(mathMix, mathMixScalFun_von_mises_cdf) { auto f = [](const auto& x, const auto& mu, const auto& k) { return stan::math::von_mises_cdf(x, mu, k); }; diff --git a/test/unit/math/mix/prob/von_mises_test.cpp b/test/unit/math/mix/prob/von_mises_test.cpp index 86997839a1a..03263e4c643 100644 --- a/test/unit/math/mix/prob/von_mises_test.cpp +++ b/test/unit/math/mix/prob/von_mises_test.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -23,7 +24,7 @@ std::vector test_von_mises_lpdf(double y, double mu, double kappa) { return grad; } -TEST_F(AgradRev, ProbAgradDistributionsVonMises_derivatives) { +TEST_F(mathMix, ProbAgradDistributionsVonMises_derivatives) { using stan::math::fvar; using stan::math::von_mises_lpdf; @@ -40,7 +41,7 @@ TEST_F(AgradRev, ProbAgradDistributionsVonMises_derivatives) { EXPECT_NO_THROW(von_mises_lpdf(0, 1, kappa2)); } -TEST_F(AgradRev, ProbAgradDistributionsVonMises_FvarVar_1stDeriv) { +TEST_F(mathMix, ProbAgradDistributionsVonMises_FvarVar_1stDeriv) { using stan::math::fvar; using stan::math::var; using stan::math::von_mises_lpdf; @@ -57,7 +58,7 @@ TEST_F(AgradRev, ProbAgradDistributionsVonMises_FvarVar_1stDeriv) { EXPECT_FLOAT_EQ(0, g[0]); } -TEST_F(AgradRev, ProbAgradDistributionsVonMises_FvarVar_2ndDeriv1) { +TEST_F(mathMix, ProbAgradDistributionsVonMises_FvarVar_2ndDeriv1) { using stan::math::fvar; using stan::math::var; using stan::math::von_mises_lpdf; @@ -73,7 +74,7 @@ TEST_F(AgradRev, ProbAgradDistributionsVonMises_FvarVar_2ndDeriv1) { EXPECT_FLOAT_EQ(0, g[0]); } -TEST_F(AgradRev, ProbAgradDistributionsVonMises_FvarVar_2ndDeriv2) { +TEST_F(mathMix, ProbAgradDistributionsVonMises_FvarVar_2ndDeriv2) { using stan::math::fvar; using stan::math::var; using stan::math::von_mises_lpdf; @@ -92,7 +93,7 @@ TEST_F(AgradRev, ProbAgradDistributionsVonMises_FvarVar_2ndDeriv2) { // This test once failed sanitizer checks -- nothing explicitly tested in the // code itself -TEST_F(AgradRev, ProbAgradDistributionsVonMises_sanitizer_error_fixed) { +TEST_F(mathMix, ProbAgradDistributionsVonMises_sanitizer_error_fixed) { using stan::math::var; double y = boost::math::constants::third_pi(); double mu = boost::math::constants::sixth_pi(); diff --git a/test/unit/math/mix/prob/wishart_cholesky_test.cpp b/test/unit/math/mix/prob/wishart_cholesky_test.cpp index fc47988d445..5bc771a6bd2 100644 --- a/test/unit/math/mix/prob/wishart_cholesky_test.cpp +++ b/test/unit/math/mix/prob/wishart_cholesky_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST_F(AgradRev, ProbDistributionsWishartCholesky_matvar) { +TEST_F(mathMix, ProbDistributionsWishartCholesky_matvar) { auto f = [](const auto& L_Y, const auto& dof, const auto& L_S) { return stan::math::wishart_cholesky_lpdf(L_Y, dof, L_S); }; @@ -34,7 +35,7 @@ TEST_F(AgradRev, ProbDistributionsWishartCholesky_matvar) { stan::test::expect_ad_matvar(f, L_Y11, dof, L_S00); } -TEST_F(AgradRev, ProbDistributionsWishartCholesky_fvar_var) { +TEST_F(mathMix, ProbDistributionsWishartCholesky_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -67,7 +68,7 @@ TEST_F(AgradRev, ProbDistributionsWishartCholesky_fvar_var) { stan::math::recover_memory(); } -TEST_F(AgradRev, ProbDistributionsWishartCholesky_fvar_fvar_var) { +TEST_F(mathMix, ProbDistributionsWishartCholesky_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; diff --git a/test/unit/math/mix/prob/wishart_test.cpp b/test/unit/math/mix/prob/wishart_test.cpp index 7fd45e9c618..2e05cbfbdff 100644 --- a/test/unit/math/mix/prob/wishart_test.cpp +++ b/test/unit/math/mix/prob/wishart_test.cpp @@ -1,6 +1,7 @@ #include +#include -TEST_F(AgradRev, ProbDistributionsWishart_matvar) { +TEST_F(mathMix, ProbDistributionsWishart_matvar) { auto f = [](const auto& y, const auto& dof, const auto& sigma) { auto&& y_ref = stan::math::to_ref(y); auto y_sym = stan::math::multiply(0.5, y_ref + y_ref.transpose()); @@ -38,7 +39,7 @@ TEST_F(AgradRev, ProbDistributionsWishart_matvar) { stan::test::expect_ad_matvar(f, y11, dof, Sigma00); } -TEST_F(AgradRev, ProbDistributionsWishart_fvar_var) { +TEST_F(mathMix, ProbDistributionsWishart_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; @@ -65,7 +66,7 @@ TEST_F(AgradRev, ProbDistributionsWishart_fvar_var) { stan::math::recover_memory(); } -TEST_F(AgradRev, ProbDistributionsWishart_fvar_fvar_var) { +TEST_F(mathMix, ProbDistributionsWishart_fvar_fvar_var) { using Eigen::Dynamic; using Eigen::Matrix; using stan::math::fvar; diff --git a/test/unit/math/mix/util.hpp b/test/unit/math/mix/util.hpp new file mode 100644 index 00000000000..36369777b5a --- /dev/null +++ b/test/unit/math/mix/util.hpp @@ -0,0 +1,18 @@ +#ifndef STAN_TEST_UNIT_MATH_MIX_UTIL_HPP +#define STAN_TEST_UNIT_MATH_MIX_UTIL_HPP + +#include +#include + +struct mathMix : public testing::Test { + void SetUp() { + // make sure memory's clean before starting each test + stan::math::recover_memory(); + } + void TearDown() { + // make sure memory's clean after each test + stan::math::recover_memory(); + } +}; + +#endif diff --git a/test/unit/math/rev/util.hpp b/test/unit/math/rev/util.hpp index 3725aa1da0b..1810c4085e1 100644 --- a/test/unit/math/rev/util.hpp +++ b/test/unit/math/rev/util.hpp @@ -5,7 +5,7 @@ #include #include -struct AgradRev : public testing::Test { +struct MathMix : public testing::Test { void SetUp() { // make sure memory's clean before starting each test stan::math::recover_memory();