diff options
author | Gael Guennebaud <g.gael@free.fr> | 2018-07-17 15:52:58 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2018-07-17 15:52:58 +0200 |
commit | dff3a92d527fd38c28152ab9259af1904a01f248 (patch) | |
tree | 6184304dd437e20e4d7ad3481b27e3a2e9be3fb0 /test/sparse_basic.cpp | |
parent | 82f0ce27261df3b21037d93d4595655b3df754a6 (diff) |
Remove usage of #if EIGEN_TEST_PART_XX in unit tests that does not require them (splitting can thus be avoided for them)
Diffstat (limited to 'test/sparse_basic.cpp')
-rw-r--r-- | test/sparse_basic.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/test/sparse_basic.cpp b/test/sparse_basic.cpp index bfd61f69f..3691e8dad 100644 --- a/test/sparse_basic.cpp +++ b/test/sparse_basic.cpp @@ -640,6 +640,20 @@ void big_sparse_triplet(Index rows, Index cols, double density) { VERIFY_IS_APPROX(sum, m.sum()); } +template<int> +void bug1105() +{ + // Regression test for bug 1105 + int n = Eigen::internal::random<int>(200,600); + SparseMatrix<std::complex<double>,0, long> mat(n, n); + std::complex<double> val; + + for(int i=0; i<n; ++i) + { + mat.coeffRef(i, i%(n/10)) = val; + VERIFY(mat.data().allocatedSize()<20*n); + } +} EIGEN_DECLARE_TEST(sparse_basic) { @@ -671,18 +685,5 @@ EIGEN_DECLARE_TEST(sparse_basic) CALL_SUBTEST_3((big_sparse_triplet<SparseMatrix<float, RowMajor, int> >(10000, 10000, 0.125))); CALL_SUBTEST_4((big_sparse_triplet<SparseMatrix<double, ColMajor, long int> >(10000, 10000, 0.125))); - // Regression test for bug 1105 -#ifdef EIGEN_TEST_PART_7 - { - int n = Eigen::internal::random<int>(200,600); - SparseMatrix<std::complex<double>,0, long> mat(n, n); - std::complex<double> val; - - for(int i=0; i<n; ++i) - { - mat.coeffRef(i, i%(n/10)) = val; - VERIFY(mat.data().allocatedSize()<20*n); - } - } -#endif + CALL_SUBTEST_7( bug1105<0>() ); } |