GCC Code Coverage Report


Directory: ./
File: tests/test_constructor.cpp
Date: 2024-11-28 11:10:33
Exec Total Coverage
Lines: 23 23 100.0%
Branches: 135 270 50.0%

Line Branch Exec Source
1
2 /*--------STD-------------*/
3 #include <sstream>
4
5 /*-----------BOOST TEST SUITE-------------*/
6 #define BOOST_TEST_MODULE sot_dynamic_constructor
7 #include <boost/test/floating_point_comparison.hpp>
8 #include <boost/test/output_test_stream.hpp>
9 #include <boost/test/unit_test.hpp>
10
11 /*-----------SOT DYNAMIC ------------*/
12 #include <sot/dynamic-pinocchio/dynamic-pinocchio.h>
13
14 #include <sot/core/debug.hh>
15
16 /*-----------DYNAMIC GRAPH ------------*/
17 #include <dynamic-graph/linear-algebra.h>
18
19 #include <sot/core/exception-abstract.hh>
20
21 /*-----------PINOCCHIO-------------*/
22 #include <pinocchio/multibody/model.hpp>
23 #include <pinocchio/parsers/urdf.hpp>
24
25 using namespace dynamicgraph::sot;
26
27 /* ----- TEST SIGNAL CLASS -----*/
28
29
33/66
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 27 taken 1 times.
✗ Branch 28 not taken.
✓ Branch 30 taken 1 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 36 taken 1 times.
✗ Branch 37 not taken.
✓ Branch 41 taken 1 times.
✗ Branch 42 not taken.
✓ Branch 45 taken 1 times.
✗ Branch 46 not taken.
✓ Branch 48 taken 1 times.
✗ Branch 49 not taken.
✓ Branch 52 taken 1 times.
✗ Branch 53 not taken.
✓ Branch 55 taken 1 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 1 times.
✗ Branch 62 not taken.
✓ Branch 66 taken 1 times.
✗ Branch 67 not taken.
✓ Branch 70 taken 1 times.
✗ Branch 71 not taken.
✓ Branch 73 taken 1 times.
✗ Branch 74 not taken.
✓ Branch 77 taken 1 times.
✗ Branch 78 not taken.
✓ Branch 80 taken 1 times.
✗ Branch 81 not taken.
✓ Branch 83 taken 1 times.
✗ Branch 84 not taken.
✓ Branch 86 taken 1 times.
✗ Branch 87 not taken.
✓ Branch 91 taken 1 times.
✗ Branch 92 not taken.
✓ Branch 95 taken 1 times.
✗ Branch 96 not taken.
✓ Branch 98 taken 1 times.
✗ Branch 99 not taken.
✓ Branch 102 taken 1 times.
✗ Branch 103 not taken.
✓ Branch 105 taken 1 times.
✗ Branch 106 not taken.
✓ Branch 108 taken 1 times.
✗ Branch 109 not taken.
✓ Branch 111 taken 1 times.
✗ Branch 112 not taken.
✓ Branch 116 taken 1 times.
✗ Branch 117 not taken.
4 BOOST_AUTO_TEST_CASE(constructor) {
30 /*-----------------------CONSTRUCTOR-----------------------------------------*/
31
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
4 DynamicPinocchio dynamic_("sot_dynamic_test");
32
5/10
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 times.
2 BOOST_CHECK_EQUAL(
33 std::strcmp(
34 dynamic_.jointPositionSIN.getName().c_str(),
35 "sotDynamicPinocchio(sot_dynamic_test)::input(vector)::position"),
36 0);
37
5/10
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 times.
2 BOOST_CHECK_EQUAL(
38 std::strcmp(
39 dynamic_.freeFlyerPositionSIN.getName().c_str(),
40 "sotDynamicPinocchio(sot_dynamic_test)::input(vector)::ffposition"),
41 0);
42
5/10
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 times.
2 BOOST_CHECK_EQUAL(
43 std::strcmp(
44 dynamic_.jointVelocitySIN.getName().c_str(),
45 "sotDynamicPinocchio(sot_dynamic_test)::input(vector)::velocity"),
46 0);
47
5/10
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 times.
2 BOOST_CHECK_EQUAL(
48 std::strcmp(
49 dynamic_.freeFlyerVelocitySIN.getName().c_str(),
50 "sotDynamicPinocchio(sot_dynamic_test)::input(vector)::ffvelocity"),
51 0);
52
5/10
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 times.
2 BOOST_CHECK_EQUAL(
53 std::strcmp(
54 dynamic_.jointAccelerationSIN.getName().c_str(),
55 "sotDynamicPinocchio(sot_dynamic_test)::input(vector)::acceleration"),
56 0);
57
5/10
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 times.
2 BOOST_CHECK_EQUAL(
58 std::strcmp(dynamic_.freeFlyerAccelerationSIN.getName().c_str(),
59 "sotDynamicPinocchio(sot_dynamic_test)::input(vector)::"
60 "ffacceleration"),
61 0);
62
5/10
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 times.
2 BOOST_CHECK_EQUAL(
63 std::strcmp(
64 dynamic_.newtonEulerSINTERN.getName().c_str(),
65 "sotDynamicPinocchio(sot_dynamic_test)::intern(dummy)::newtoneuler"),
66 0);
67
5/10
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 times.
2 BOOST_CHECK_EQUAL(
68 std::strcmp(dynamic_.zmpSOUT.getName().c_str(),
69 "sotDynamicPinocchio(sot_dynamic_test)::output(vector)::zmp"),
70 0);
71
5/10
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 times.
2 BOOST_CHECK_EQUAL(
72 std::strcmp(
73 dynamic_.JcomSOUT.getName().c_str(),
74 "sotDynamicPinocchio(sot_dynamic_test)::output(matrix)::Jcom"),
75 0);
76
5/10
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 times.
2 BOOST_CHECK_EQUAL(
77 std::strcmp(dynamic_.comSOUT.getName().c_str(),
78 "sotDynamicPinocchio(sot_dynamic_test)::output(vector)::com"),
79 0);
80
5/10
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 times.
2 BOOST_CHECK_EQUAL(
81 std::strcmp(
82 dynamic_.inertiaSOUT.getName().c_str(),
83 "sotDynamicPinocchio(sot_dynamic_test)::output(matrix)::inertia"),
84 0);
85
5/10
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 times.
2 BOOST_CHECK_EQUAL(
86 std::strcmp(
87 dynamic_.footHeightSOUT.getName().c_str(),
88 "sotDynamicPinocchio(sot_dynamic_test)::output(double)::footHeight"),
89 0);
90
5/10
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 times.
2 BOOST_CHECK_EQUAL(
91 std::strcmp(
92 dynamic_.upperJlSOUT.getName().c_str(),
93 "sotDynamicPinocchio(sot_dynamic_test)::output(vector)::upperJl"),
94 0);
95
5/10
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 times.
2 BOOST_CHECK_EQUAL(
96 std::strcmp(
97 dynamic_.lowerJlSOUT.getName().c_str(),
98 "sotDynamicPinocchio(sot_dynamic_test)::output(vector)::lowerJl"),
99 0);
100
5/10
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 times.
2 BOOST_CHECK_EQUAL(
101 std::strcmp(
102 dynamic_.upperVlSOUT.getName().c_str(),
103 "sotDynamicPinocchio(sot_dynamic_test)::output(vector)::upperVl"),
104 0);
105
5/10
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 times.
2 BOOST_CHECK_EQUAL(
106 std::strcmp(
107 dynamic_.upperTlSOUT.getName().c_str(),
108 "sotDynamicPinocchio(sot_dynamic_test)::output(vector)::upperTl"),
109 0);
110
5/10
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 times.
2 BOOST_CHECK_EQUAL(std::strcmp(dynamic_.inertiaRotorSOUT.getName().c_str(),
111 "sotDynamicPinocchio(sot_dynamic_test)::output("
112 "matrix)::inertiaRotor"),
113 0);
114
5/10
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 times.
2 BOOST_CHECK_EQUAL(
115 std::strcmp(
116 dynamic_.MomentaSOUT.getName().c_str(),
117 "sotDynamicPinocchio(sot_dynamic_test)::output(vector)::momenta"),
118 0);
119
5/10
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 times.
2 BOOST_CHECK_EQUAL(std::strcmp(dynamic_.AngularMomentumSOUT.getName().c_str(),
120 "sotDynamicPinocchio(sot_dynamic_test)::output("
121 "vector)::angularmomentum"),
122 0);
123
5/10
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 1 times.
2 BOOST_CHECK_EQUAL(std::strcmp(dynamic_.dynamicDriftSOUT.getName().c_str(),
124 "sotDynamicPinocchio(sot_dynamic_test)::output("
125 "vector)::dynamicDrift"),
126 0);
127 2 }
128