Skip to content

Commit ca62090

Browse files
committed
Add unit test multiple_registration
+ currently produces a wonderful 36 errors :D
1 parent 3b7cdb7 commit ca62090

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

unittest/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ endmacro(ADD_LIB_UNIT_TEST)
3030

3131
add_dependencies(build_tests ${PYWRAP})
3232
add_lib_unit_test(matrix)
33+
add_lib_unit_test(multiple_registration)
3334
if(BUILD_TESTING_SCIPY)
3435
find_scipy()
3536
add_lib_unit_test(sparse_matrix)
@@ -101,6 +102,8 @@ endif()
101102
add_lib_unit_test(bind_virtual_factory)
102103

103104
add_python_lib_unit_test("py-matrix" "unittest/python/test_matrix.py")
105+
add_python_lib_unit_test("py-multiple-registration"
106+
"unittest/python/test_multiple_registration.py")
104107

105108
add_python_lib_unit_test("py-tensor" "unittest/python/test_tensor.py")
106109
add_python_lib_unit_test("py-geometry" "unittest/python/test_geometry.py")

unittest/multiple_registration.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include "eigenpy/registration.hpp"
2+
#include <cstdio>
3+
4+
namespace bp = boost::python;
5+
6+
class X {
7+
public:
8+
X() {}
9+
void operator()() { printf("DOOT\n"); }
10+
};
11+
12+
class X_wrapper : public X, bp::wrapper<X> {
13+
public:
14+
static void expose() {
15+
if (!eigenpy::register_symbolic_link_to_registered_type<X>()) {
16+
bp::class_<X>("X", bp::init<>()).def("__call__", &X::operator());
17+
}
18+
}
19+
};
20+
21+
BOOST_PYTHON_MODULE(multiple_registration) {
22+
X_wrapper::expose();
23+
X_wrapper::expose();
24+
X_wrapper::expose();
25+
X_wrapper::expose();
26+
X_wrapper::expose();
27+
X_wrapper::expose();
28+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import multiple_registration # noqa

0 commit comments

Comments
 (0)