aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/stl_iterators.cpp
diff options
context:
space:
mode:
authorGravatar Eugene Zhulenev <ezhulenev@google.com>2018-10-09 15:36:01 -0700
committerGravatar Eugene Zhulenev <ezhulenev@google.com>2018-10-09 15:36:01 -0700
commitbefcac883de5ba98ca2322c87e56f278c140588d (patch)
tree1082fc83eb9db5bb516e39241ef94feaea6d1e7f /test/stl_iterators.cpp
parentc0ca8a9fa3e03ad7ecb270adfe760a1bff7c0829 (diff)
Hide stl-container detection test under #if
Diffstat (limited to 'test/stl_iterators.cpp')
-rw-r--r--test/stl_iterators.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/stl_iterators.cpp b/test/stl_iterators.cpp
index 75e23b2fb..d8e6e8106 100644
--- a/test/stl_iterators.cpp
+++ b/test/stl_iterators.cpp
@@ -378,12 +378,10 @@ bool IsContainerType(int /* dummy */) { return true; }
template <class C>
bool IsContainerType(long /* dummy */) { return false; }
-#endif // EIGEN_HAS_CXX11
template <typename Scalar, int Rows, int Cols>
void test_stl_container_detection(int rows=Rows, int cols=Cols)
{
-#if EIGEN_HAS_CXX11
typedef Matrix<Scalar,Rows,1> VectorType;
typedef Matrix<Scalar,Rows,Cols,ColMajor> ColMatrixType;
typedef Matrix<Scalar,Rows,Cols,RowMajor> RowMatrixType;
@@ -391,7 +389,7 @@ void test_stl_container_detection(int rows=Rows, int cols=Cols)
ColMatrixType A = ColMatrixType::Random(rows, cols);
RowMatrixType B = RowMatrixType::Random(rows, cols);
- Index i;
+ Index i = 1;
using ColMatrixColType = decltype(A.col(i));
using ColMatrixRowType = decltype(A.row(i));
@@ -408,8 +406,8 @@ void test_stl_container_detection(int rows=Rows, int cols=Cols)
// But the matrix itself is not a valid Stl-style container.
VERIFY_IS_EQUAL(IsContainerType<ColMatrixType>(0), rows == 1 || cols == 1);
VERIFY_IS_EQUAL(IsContainerType<RowMatrixType>(0), rows == 1 || cols == 1);
-#endif
}
+#endif
EIGEN_DECLARE_TEST(stl_iterators)
{
@@ -419,7 +417,9 @@ EIGEN_DECLARE_TEST(stl_iterators)
CALL_SUBTEST_1(( test_stl_iterators<int,Dynamic,Dynamic>(internal::random<int>(5,10), internal::random<int>(5,10)) ));
CALL_SUBTEST_1(( test_stl_iterators<int,Dynamic,Dynamic>(internal::random<int>(10,200), internal::random<int>(10,200)) ));
}
-
+
+#if EIGEN_HAS_CXX11
CALL_SUBTEST_1(( test_stl_container_detection<float,1,1>() ));
CALL_SUBTEST_1(( test_stl_container_detection<float,5,5>() ));
+#endif
}