aboutsummaryrefslogtreecommitdiff
path: root/test/stddeque.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/stddeque.cpp')
-rw-r--r--test/stddeque.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/test/stddeque.cpp b/test/stddeque.cpp
index bb4b476f3..ea85ea968 100644
--- a/test/stddeque.cpp
+++ b/test/stddeque.cpp
@@ -15,12 +15,10 @@
template<typename MatrixType>
void check_stddeque_matrix(const MatrixType& m)
{
- typedef typename MatrixType::Index Index;
-
Index rows = m.rows();
Index cols = m.cols();
MatrixType x = MatrixType::Random(rows,cols), y = MatrixType::Random(rows,cols);
- std::deque<MatrixType,Eigen::aligned_allocator<MatrixType> > v(10, MatrixType(rows,cols)), w(20, y);
+ std::deque<MatrixType,Eigen::aligned_allocator<MatrixType> > v(10, MatrixType::Zero(rows,cols)), w(20, y);
v.front() = x;
w.front() = w.back();
VERIFY_IS_APPROX(w.front(), w.back());
@@ -35,7 +33,7 @@ void check_stddeque_matrix(const MatrixType& m)
++wi;
}
- v.resize(21);
+ v.resize(21,MatrixType::Zero(rows,cols));
v.back() = x;
VERIFY_IS_APPROX(v.back(), x);
v.resize(22,y);
@@ -48,8 +46,8 @@ template<typename TransformType>
void check_stddeque_transform(const TransformType&)
{
typedef typename TransformType::MatrixType MatrixType;
- TransformType x(MatrixType::Random()), y(MatrixType::Random());
- std::deque<TransformType,Eigen::aligned_allocator<TransformType> > v(10), w(20, y);
+ TransformType x(MatrixType::Random()), y(MatrixType::Random()), ti=TransformType::Identity();
+ std::deque<TransformType,Eigen::aligned_allocator<TransformType> > v(10,ti), w(20, y);
v.front() = x;
w.front() = w.back();
VERIFY_IS_APPROX(w.front(), w.back());
@@ -64,7 +62,7 @@ void check_stddeque_transform(const TransformType&)
++wi;
}
- v.resize(21);
+ v.resize(21,ti);
v.back() = x;
VERIFY_IS_APPROX(v.back(), x);
v.resize(22,y);
@@ -77,8 +75,8 @@ template<typename QuaternionType>
void check_stddeque_quaternion(const QuaternionType&)
{
typedef typename QuaternionType::Coefficients Coefficients;
- QuaternionType x(Coefficients::Random()), y(Coefficients::Random());
- std::deque<QuaternionType,Eigen::aligned_allocator<QuaternionType> > v(10), w(20, y);
+ QuaternionType x(Coefficients::Random()), y(Coefficients::Random()), qi=QuaternionType::Identity();
+ std::deque<QuaternionType,Eigen::aligned_allocator<QuaternionType> > v(10,qi), w(20, y);
v.front() = x;
w.front() = w.back();
VERIFY_IS_APPROX(w.front(), w.back());
@@ -93,7 +91,7 @@ void check_stddeque_quaternion(const QuaternionType&)
++wi;
}
- v.resize(21);
+ v.resize(21,qi);
v.back() = x;
VERIFY_IS_APPROX(v.back(), x);
v.resize(22,y);
@@ -102,7 +100,7 @@ void check_stddeque_quaternion(const QuaternionType&)
VERIFY_IS_APPROX(v.back(), x);
}
-void test_stddeque()
+EIGEN_DECLARE_TEST(stddeque)
{
// some non vectorizable fixed sizes
CALL_SUBTEST_1(check_stddeque_matrix(Vector2f()));