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)
This commit is contained in:
Nikolay Tverdokhleb 2021-08-05 14:15:41 +02:00 committed by Rasmus Munk Larsen
parent 13d7658c5d
commit cb44a003de
2 changed files with 7 additions and 2 deletions

View File

@ -117,7 +117,9 @@ template<int> void noncopyable()
typedef Eigen::Matrix<AnnoyingScalar,Dynamic,Dynamic> 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<std::complex<float> >()));
CALL_SUBTEST_5((run_vector_tests<std::complex<double> >()));
#ifndef EIGEN_TEST_ANNOYING_SCALAR_DONT_THROW
AnnoyingScalar::dont_throw = true;
#endif
CALL_SUBTEST_6(( run_vector_tests<AnnoyingScalar>() ));
CALL_SUBTEST_6(( noncopyable<0>() ));
}

View File

@ -315,8 +315,9 @@ EIGEN_DECLARE_TEST(sparse_block)
CALL_SUBTEST_4(( sparse_block(SparseMatrix<double,ColMajor,short int>(short(r), short(c))) ));
CALL_SUBTEST_4(( sparse_block(SparseMatrix<double,RowMajor,short int>(short(r), short(c))) ));
#ifndef EIGEN_TEST_ANNOYING_SCALAR_DONT_THROW
AnnoyingScalar::dont_throw = true;
#endif
CALL_SUBTEST_5(( sparse_block(SparseMatrix<AnnoyingScalar>(r,c)) ));
}
}