From a330eed2eb7c19c21570fd40c96a96d3a27dc3c4 Mon Sep 17 00:00:00 2001 From: conrad Date: Wed, 5 May 2021 11:50:02 +1000 Subject: [PATCH] force evaluation of expression --- tests2/fn_trans.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests2/fn_trans.cpp b/tests2/fn_trans.cpp index 345fec9d..eabd7630 100644 --- a/tests2/fn_trans.cpp +++ b/tests2/fn_trans.cpp @@ -157,8 +157,9 @@ TEST_CASE("fn_trans_1") REQUIRE( abs( sum(A.col(1).t()) - accu_A_col1_t ) == Approx(0.0) ); REQUIRE( abs( sum(A.row(1).t()) - accu_A_row1_t ) == Approx(0.0) ); - - REQUIRE_THROWS( A + A.t() ); + + mat B; + REQUIRE_THROWS( B = A + A.t() ); } @@ -286,8 +287,10 @@ TEST_CASE("fn_trans_2") REQUIRE( accu(abs( (C.row(1).st() + conj(C_row1_t)) - conj(2*C_row1_t))) == Approx(0.0) ); // - - REQUIRE_THROWS( C + C.t() ); + + cx_mat D; + + REQUIRE_THROWS( D = C + C.t() ); }