aboutsummaryrefslogtreecommitdiff
path: root/test/stdvector_overload.cpp
diff options
context:
space:
mode:
authorYi Kong <yikong@google.com>2022-02-25 17:02:53 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-02-25 17:02:53 +0000
commitedb0ad5bb04b48aab7dd0978f0475edd3550de7c (patch)
treefb979fb4cf4f8052c8cc66b1ec9516d91fcd859b /test/stdvector_overload.cpp
parent8fd413e275f78a4c240f1442ce5cf77c73a20a55 (diff)
parentbc0f5df265caa21a2120c22453655a7fcc941991 (diff)
downloadeigen-7ecd5586f9218fe07c97ede8e405561aca973d78.tar.gz
Original change: https://android-review.googlesource.com/c/platform/external/eigen/+/1999079 Change-Id: Ife39d10c8b23d3eeb174cd52f462f9d20527ad03
Diffstat (limited to 'test/stdvector_overload.cpp')
-rw-r--r--test/stdvector_overload.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/stdvector_overload.cpp b/test/stdvector_overload.cpp
index 959665954..da04f8a84 100644
--- a/test/stdvector_overload.cpp
+++ b/test/stdvector_overload.cpp
@@ -28,10 +28,10 @@ EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Quaterniond)
template<typename MatrixType>
void check_stdvector_matrix(const MatrixType& m)
{
- typename MatrixType::Index rows = m.rows();
- typename MatrixType::Index cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
MatrixType x = MatrixType::Random(rows,cols), y = MatrixType::Random(rows,cols);
- std::vector<MatrixType> v(10, MatrixType(rows,cols)), w(20, y);
+ std::vector<MatrixType> v(10, MatrixType::Zero(rows,cols)), w(20, y);
v[5] = x;
w[6] = v[5];
VERIFY_IS_APPROX(w[6], v[5]);
@@ -100,8 +100,8 @@ template<typename QuaternionType>
void check_stdvector_quaternion(const QuaternionType&)
{
typedef typename QuaternionType::Coefficients Coefficients;
- QuaternionType x(Coefficients::Random()), y(Coefficients::Random());
- std::vector<QuaternionType> v(10), w(20, y);
+ QuaternionType x(Coefficients::Random()), y(Coefficients::Random()), qi=QuaternionType::Identity();
+ std::vector<QuaternionType> v(10,qi), w(20, y);
v[5] = x;
w[6] = v[5];
VERIFY_IS_APPROX(w[6], v[5]);
@@ -131,7 +131,7 @@ void check_stdvector_quaternion(const QuaternionType&)
}
}
-void test_stdvector_overload()
+EIGEN_DECLARE_TEST(stdvector_overload)
{
// some non vectorizable fixed sizes
CALL_SUBTEST_1(check_stdvector_matrix(Vector2f()));