From f0c0585c8fc70f00bf8a9050cea981171d90ac1c Mon Sep 17 00:00:00 2001 From: Rok Cesnovar Date: Mon, 22 Jun 2020 14:37:57 +0200 Subject: [PATCH] fix develop issue --- test/unit/math/opencl/matrix_cl_test.cpp | 8 +- test/unit/math/prim/meta/ref_type_test.cpp | 88 +++++++++++----------- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/test/unit/math/opencl/matrix_cl_test.cpp b/test/unit/math/opencl/matrix_cl_test.cpp index e228d2f2223..49831e051ca 100644 --- a/test/unit/math/opencl/matrix_cl_test.cpp +++ b/test/unit/math/opencl/matrix_cl_test.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include @@ -35,18 +35,18 @@ TEST(MathMatrixCL, matrix_cl_value) { col_major << 1, 2, 3, 4, 5, 6, 7, 8, 9; stan::math::matrix_cl cl_from_col_major(col_major); Eigen::MatrixXd res = stan::math::from_matrix_cl(cl_from_col_major); - expect_matrix_eq(col_major, res); + EXPECT_MATRIX_EQ(col_major, res); Eigen::Map map(col_major.data(), 3, 3); stan::math::matrix_cl cl_from_map(map); res = stan::math::from_matrix_cl(cl_from_map); - expect_matrix_eq(col_major, res); + EXPECT_MATRIX_EQ(col_major, res); Eigen::Matrix row_major(3, 3); row_major << 1, 2, 3, 4, 5, 6, 7, 8, 9; stan::math::matrix_cl cl_from_row_major(row_major); res = stan::math::from_matrix_cl(cl_from_row_major); - expect_matrix_eq(row_major, res); + EXPECT_MATRIX_EQ(row_major, res); } TEST(MathMatrixCL, assignment) { diff --git a/test/unit/math/prim/meta/ref_type_test.cpp b/test/unit/math/prim/meta/ref_type_test.cpp index edf77933cf7..7077af4c7dd 100644 --- a/test/unit/math/prim/meta/ref_type_test.cpp +++ b/test/unit/math/prim/meta/ref_type_test.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include TEST(MathMetaPrim, ref_type_non_eigen) { @@ -18,14 +18,14 @@ TEST(MathMetaPrim, ref_type_non_eigen) { ref_type_t> c_ref1 = c; ref_type_t&> c_ref2 = c; - expect_std_vector_eq(a_ref1, a); - expect_std_vector_eq(a_ref2, a); - expect_std_vector_eq(a_ref3, a); + EXPECT_STD_VECTOR_FLOAT_EQ(a_ref1, a); + EXPECT_STD_VECTOR_FLOAT_EQ(a_ref2, a); + EXPECT_STD_VECTOR_FLOAT_EQ(a_ref3, a); EXPECT_EQ(b_ref1, b); EXPECT_EQ(b_ref2, b); EXPECT_EQ(b_ref3, b); - expect_std_vector_eq(c_ref1, c); - expect_std_vector_eq(c_ref2, c); + EXPECT_STD_VECTOR_FLOAT_EQ(c_ref1, c); + EXPECT_STD_VECTOR_FLOAT_EQ(c_ref2, c); EXPECT_TRUE(std::is_lvalue_reference>::value); EXPECT_TRUE(std::is_lvalue_reference>::value); EXPECT_FALSE(std::is_reference>::value); @@ -57,17 +57,17 @@ TEST(MathMetaPrim, ref_type_eigen_directly_accessible) { ref_type_t&> c_ref2 = c; ref_type_t&&> c_ref3 = std::move(c2); - expect_matrix_eq(a_ref1, a); - expect_matrix_eq(a_ref2, a); - expect_matrix_eq(a_ref3, a); + EXPECT_MATRIX_EQ(a_ref1, a); + EXPECT_MATRIX_EQ(a_ref2, a); + EXPECT_MATRIX_EQ(a_ref3, a); - expect_matrix_eq(b_ref1, b); - expect_matrix_eq(b_ref2, b); - expect_matrix_eq(b_ref3, b); + EXPECT_MATRIX_EQ(b_ref1, b); + EXPECT_MATRIX_EQ(b_ref2, b); + EXPECT_MATRIX_EQ(b_ref3, b); - expect_matrix_eq(c_ref1, c); - expect_matrix_eq(c_ref2, c); - expect_matrix_eq(c_ref3, c); + EXPECT_MATRIX_EQ(c_ref1, c); + EXPECT_MATRIX_EQ(c_ref2, c); + EXPECT_MATRIX_EQ(c_ref3, c); EXPECT_TRUE((std::is_same>::value)); EXPECT_TRUE((std::is_same>::value)); EXPECT_TRUE((std::is_same>::value)); @@ -87,9 +87,9 @@ TEST(MathMetaPrim, ref_type_eigen_expression) { ref_type_t a_ref3 = m * 3; Eigen::MatrixXd a_eval = a; - expect_matrix_eq(a_ref1, a_eval); - expect_matrix_eq(a_ref2, a_eval); - expect_matrix_eq(a_ref3, a_eval); + EXPECT_MATRIX_EQ(a_ref1, a_eval); + EXPECT_MATRIX_EQ(a_ref2, a_eval); + EXPECT_MATRIX_EQ(a_ref3, a_eval); EXPECT_TRUE(( std::is_same, ref_type_t>::value)); @@ -115,14 +115,14 @@ TEST(MathMetaPrim, ref_type_for_opencl_for_opencl_non_eigen) { ref_type_for_opencl_t> c_ref1 = c; ref_type_for_opencl_t&> c_ref2 = c; - expect_std_vector_eq(a_ref1, a); - expect_std_vector_eq(a_ref2, a); - expect_std_vector_eq(a_ref3, a); + EXPECT_STD_VECTOR_FLOAT_EQ(a_ref1, a); + EXPECT_STD_VECTOR_FLOAT_EQ(a_ref2, a); + EXPECT_STD_VECTOR_FLOAT_EQ(a_ref3, a); EXPECT_EQ(b_ref1, b); EXPECT_EQ(b_ref2, b); EXPECT_EQ(b_ref3, b); - expect_std_vector_eq(c_ref1, c); - expect_std_vector_eq(c_ref2, c); + EXPECT_STD_VECTOR_FLOAT_EQ(c_ref1, c); + EXPECT_STD_VECTOR_FLOAT_EQ(c_ref2, c); EXPECT_TRUE(std::is_lvalue_reference>::value); EXPECT_TRUE(std::is_lvalue_reference>::value); EXPECT_FALSE(std::is_reference>::value); @@ -155,17 +155,17 @@ TEST(MathMetaPrim, ref_type_for_opencl_eigen_contiguous) { ref_type_for_opencl_t c_ref2 = c; ref_type_for_opencl_t c_ref3 = std::move(c2); - expect_matrix_eq(a_ref1, a); - expect_matrix_eq(a_ref2, a); - expect_matrix_eq(a_ref3, a); + EXPECT_MATRIX_EQ(a_ref1, a); + EXPECT_MATRIX_EQ(a_ref2, a); + EXPECT_MATRIX_EQ(a_ref3, a); - expect_matrix_eq(b_ref1, b); - expect_matrix_eq(b_ref2, b); - expect_matrix_eq(b_ref3, b); + EXPECT_MATRIX_EQ(b_ref1, b); + EXPECT_MATRIX_EQ(b_ref2, b); + EXPECT_MATRIX_EQ(b_ref3, b); - expect_matrix_eq(c_ref1, c); - expect_matrix_eq(c_ref2, c); - expect_matrix_eq(c_ref3, c); + EXPECT_MATRIX_EQ(c_ref1, c); + EXPECT_MATRIX_EQ(c_ref2, c); + EXPECT_MATRIX_EQ(c_ref3, c); EXPECT_TRUE( (std::is_same>::value)); EXPECT_TRUE( @@ -203,17 +203,17 @@ TEST(MathMetaPrim, ref_type_for_opencl_eigen_non_contiguous) { ref_type_for_opencl_t&> c_ref2 = c; ref_type_for_opencl_t&&> c_ref3 = std::move(c2); - expect_matrix_eq(a_ref1, a); - expect_matrix_eq(a_ref2, a); - expect_matrix_eq(a_ref3, a); + EXPECT_MATRIX_EQ(a_ref1, a); + EXPECT_MATRIX_EQ(a_ref2, a); + EXPECT_MATRIX_EQ(a_ref3, a); - expect_matrix_eq(b_ref1, b); - expect_matrix_eq(b_ref2, b); - expect_matrix_eq(b_ref3, b); + EXPECT_MATRIX_EQ(b_ref1, b); + EXPECT_MATRIX_EQ(b_ref2, b); + EXPECT_MATRIX_EQ(b_ref3, b); - expect_matrix_eq(c_ref1, c); - expect_matrix_eq(c_ref2, c); - expect_matrix_eq(c_ref3, c); + EXPECT_MATRIX_EQ(c_ref1, c); + EXPECT_MATRIX_EQ(c_ref2, c); + EXPECT_MATRIX_EQ(c_ref3, c); EXPECT_TRUE((std::is_same>::value)); EXPECT_TRUE((std::is_same a_ref3 = m * 3; Eigen::MatrixXd a_eval = a; - expect_matrix_eq(a_ref1, a_eval); - expect_matrix_eq(a_ref2, a_eval); - expect_matrix_eq(a_ref3, a_eval); + EXPECT_MATRIX_EQ(a_ref1, a_eval); + EXPECT_MATRIX_EQ(a_ref2, a_eval); + EXPECT_MATRIX_EQ(a_ref3, a_eval); EXPECT_TRUE((std::is_same, ref_type_for_opencl_t>::value));