aboutsummaryrefslogtreecommitdiff
path: root/test/constructor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/constructor.cpp')
-rw-r--r--test/constructor.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/constructor.cpp b/test/constructor.cpp
index eec9e2192..ffd5e802a 100644
--- a/test/constructor.cpp
+++ b/test/constructor.cpp
@@ -20,6 +20,8 @@ template<typename MatrixType> struct Wrapper
inline operator MatrixType& () { return m_mat; }
};
+enum my_sizes { M = 12, N = 7};
+
template<typename MatrixType> void ctor_init1(const MatrixType& m)
{
// Check logic in PlainObjectBase::_init1
@@ -37,7 +39,7 @@ template<typename MatrixType> void ctor_init1(const MatrixType& m)
}
-void test_constructor()
+EIGEN_DECLARE_TEST(constructor)
{
for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST_1( ctor_init1(Matrix<float, 1, 1>()) );
@@ -81,4 +83,16 @@ void test_constructor()
Array<float,3,3> a(123);
VERIFY_IS_EQUAL(a(4), 123.f);
}
+ {
+ MatrixXi m1(M,N);
+ VERIFY_IS_EQUAL(m1.rows(),M);
+ VERIFY_IS_EQUAL(m1.cols(),N);
+ ArrayXXi a1(M,N);
+ VERIFY_IS_EQUAL(a1.rows(),M);
+ VERIFY_IS_EQUAL(a1.cols(),N);
+ VectorXi v1(M);
+ VERIFY_IS_EQUAL(v1.size(),M);
+ ArrayXi a2(M);
+ VERIFY_IS_EQUAL(a2.size(),M);
+ }
}