Skip to content

Commit bc5afd0

Browse files
jorisvjcarpent
authored andcommitted
core: add regression tests
1 parent 6858b4e commit bc5afd0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

unittest/std_vector.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ void setZero(std::vector<MatType, Eigen::aligned_allocator<MatType> > &Ms) {
3030
}
3131
}
3232

33+
struct CustomTestStruct {
34+
bool operator==(const CustomTestStruct &) const { return true; }
35+
};
36+
3337
BOOST_PYTHON_MODULE(std_vector) {
3438
namespace bp = boost::python;
3539
using namespace eigenpy;
@@ -58,4 +62,10 @@ BOOST_PYTHON_MODULE(std_vector) {
5862
.def(boost::python::vector_indexing_suite<
5963
std::vector<Eigen::Matrix2d> >());
6064
exposeStdVectorEigenSpecificType<Eigen::Matrix2d>("Mat2d");
65+
66+
// Test API regression:
67+
// Exposing a `std::vector` with documentation doesn't clash with
68+
// exposing a `std::vector` with a visitor
69+
StdVectorPythonVisitor<std::vector<CustomTestStruct> >::expose(
70+
"StdVec_CustomTestStruct", "some documentation");
6171
}

0 commit comments

Comments
 (0)