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.
This commit is contained in:
Nikolay Tverdokhleb 2021-08-05 14:15:41 +02:00 committed by Nikolay Tverdokhleb
parent 413bc491f1
commit f1b899eef7
2 changed files with 7 additions and 2 deletions

View File

@ -115,9 +115,11 @@ template<int> void noncopyable()
{
typedef Eigen::Matrix<AnnoyingScalar,Dynamic,1> VectorType;
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)) ));
}
}