GCC Code Coverage Report


Directory: ./
File: include/pinocchio/bindings/python/utils/registration.hpp
Date: 2024-08-27 18:20:05
Exec Total Coverage
Lines: 9 9 100.0%
Branches: 1 18 5.6%

Line Branch Exec Source
1 //
2 // Copyright (c) 2019-2020 INRIA
3 //
4
5 #ifndef __pinocchio_python_utils_registration_hpp__
6 #define __pinocchio_python_utils_registration_hpp__
7
8 #include <eigenpy/registration.hpp>
9
10 namespace pinocchio
11 {
12 namespace python
13 {
14
15 template<typename T>
16 340 inline bool register_symbolic_link_to_registered_type()
17 {
18 namespace bp = boost::python;
19
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 60 times.
340 if (eigenpy::check_registration<T>())
20 {
21 40 const bp::type_info info = bp::type_id<T>();
22
0/2
✗ Branch 1 not taken.
✗ Branch 2 not taken.
40 const bp::converter::registration * reg = bp::converter::registry::query(info);
23
0/4
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
40 bp::handle<> class_obj(bp::borrowed(reg->get_class_object()));
24
0/10
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
40 bp::scope().attr(reg->get_class_object()->tp_name) = bp::object(class_obj);
25 40 return true;
26 40 }
27
28 300 return false;
29 }
30
31 } // namespace python
32 } // namespace pinocchio
33
34 #endif // ifndef __pinocchio_python_utils_registration_hpp__
35