From cb44a003de4f9795f080dcd7481fcc4fc7a1713d Mon Sep 17 00:00:00 2001 From: Nikolay Tverdokhleb Date: Thu, 5 Aug 2021 14:15:41 +0200 Subject: [PATCH] Do not set AnnoyingScalar::dont_throw if not defined EIGEN_TEST_ANNOYING_SCALAR_DONT_THROW. - Because that member is not declared if the macro is defined. (cherry picked from commit f1b899eef7461e1475469b733346c6ebbfae8818) --- test/conservative_resize.cpp | 6 +++++- test/sparse_block.cpp | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/test/conservative_resize.cpp b/test/conservative_resize.cpp index d709e3346..d48eb126f 100644 --- a/test/conservative_resize.cpp +++ b/test/conservative_resize.cpp @@ -115,9 +115,11 @@ template void noncopyable() { typedef Eigen::Matrix VectorType; typedef Eigen::Matrix MatrixType; - + { +#ifndef EIGEN_TEST_ANNOYING_SCALAR_DONT_THROW AnnoyingScalar::dont_throw = true; +#endif int n = 50; VectorType v0(n), v1(n); MatrixType m0(n,n), m1(n,n), m2(n,n); @@ -156,7 +158,9 @@ EIGEN_DECLARE_TEST(conservative_resize) CALL_SUBTEST_4((run_vector_tests >())); CALL_SUBTEST_5((run_vector_tests >())); +#ifndef EIGEN_TEST_ANNOYING_SCALAR_DONT_THROW AnnoyingScalar::dont_throw = true; +#endif CALL_SUBTEST_6(( run_vector_tests() )); CALL_SUBTEST_6(( noncopyable<0>() )); } diff --git a/test/sparse_block.cpp b/test/sparse_block.cpp index f9668102c..b4905b053 100644 --- a/test/sparse_block.cpp +++ b/test/sparse_block.cpp @@ -315,8 +315,9 @@ EIGEN_DECLARE_TEST(sparse_block) CALL_SUBTEST_4(( sparse_block(SparseMatrix(short(r), short(c))) )); CALL_SUBTEST_4(( sparse_block(SparseMatrix(short(r), short(c))) )); - +#ifndef EIGEN_TEST_ANNOYING_SCALAR_DONT_THROW AnnoyingScalar::dont_throw = true; +#endif CALL_SUBTEST_5(( sparse_block(SparseMatrix(r,c)) )); } }