Skip to content
Snippets Groups Projects
Commit 32515e72 authored by Joris Vaillant's avatar Joris Vaillant Committed by Justin Carpentier
Browse files

core: Fix std_vector unit tests

parent 727fad66
No related branches found
No related tags found
No related merge requests found
......@@ -85,11 +85,15 @@ print("-----------------")
# pprint.pprint(list(l4))
# checkZero(l4)
# TODO fail
l5_copy = std_vector.StdVec_Mat2d(l5)
# Test StdVec_Mat2d that had been registered
# before calling exposeStdVectorEigenSpecificType
# test l5 == l5_copy == l5_py
# Test conversion and tolistl5 == l5_copy == l5_py
l5_copy = std_vector.StdVec_Mat2d(l5)
l5_py = l5_copy.tolist()
# Test l5[0] is zero
l5[0].setZero()
# TODO test
checkAllValues(l5, l5_copy)
checkAllValues(l5, l5_py)
# Test mutable __getitem__
l5[0][:] = 0.0
assert np.allclose(l5[0], 0.0)
......@@ -52,9 +52,10 @@ BOOST_PYTHON_MODULE(std_vector) {
// Test matrix modification
// Mat2d don't have tolist, reserve, mutable __getitem__ and from list
// conversion exposeStdVectorEigenSpecificType must add those methods to Mat2d
// conversion
// exposeStdVectorEigenSpecificType must add those methods to StdVec_Mat2d
bp::class_<std::vector<Eigen::Matrix2d> >("StdVec_Mat2d")
.def(boost::python::vector_indexing_suite<
std::vector<Eigen::Matrix2d> >());
exposeStdVectorEigenSpecificType<Eigen::Matrix3d>("Mat2d");
exposeStdVectorEigenSpecificType<Eigen::Matrix2d>("Mat2d");
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment