GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: tests/test_constructor.cpp Lines: 23 23 100.0 %
Date: 2023-01-28 11:04:48 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
















4
BOOST_AUTO_TEST_CASE(constructor) {
30
  /*-----------------------CONSTRUCTOR-----------------------------------------*/
31

6
  DynamicPinocchio dynamic_("sot_dynamic_test");
32


2
  BOOST_CHECK_EQUAL(
33
      std::strcmp(
34
          dynamic_.jointPositionSIN.getName().c_str(),
35
          "sotDynamicPinocchio(sot_dynamic_test)::input(vector)::position"),
36
      0);
37


2
  BOOST_CHECK_EQUAL(
38
      std::strcmp(
39
          dynamic_.freeFlyerPositionSIN.getName().c_str(),
40
          "sotDynamicPinocchio(sot_dynamic_test)::input(vector)::ffposition"),
41
      0);
42


2
  BOOST_CHECK_EQUAL(
43
      std::strcmp(
44
          dynamic_.jointVelocitySIN.getName().c_str(),
45
          "sotDynamicPinocchio(sot_dynamic_test)::input(vector)::velocity"),
46
      0);
47


2
  BOOST_CHECK_EQUAL(
48
      std::strcmp(
49
          dynamic_.freeFlyerVelocitySIN.getName().c_str(),
50
          "sotDynamicPinocchio(sot_dynamic_test)::input(vector)::ffvelocity"),
51
      0);
52


2
  BOOST_CHECK_EQUAL(
53
      std::strcmp(
54
          dynamic_.jointAccelerationSIN.getName().c_str(),
55
          "sotDynamicPinocchio(sot_dynamic_test)::input(vector)::acceleration"),
56
      0);
57


2
  BOOST_CHECK_EQUAL(
58
      std::strcmp(dynamic_.freeFlyerAccelerationSIN.getName().c_str(),
59
                  "sotDynamicPinocchio(sot_dynamic_test)::input(vector)::"
60
                  "ffacceleration"),
61
      0);
62


2
  BOOST_CHECK_EQUAL(
63
      std::strcmp(
64
          dynamic_.newtonEulerSINTERN.getName().c_str(),
65
          "sotDynamicPinocchio(sot_dynamic_test)::intern(dummy)::newtoneuler"),
66
      0);
67


2
  BOOST_CHECK_EQUAL(
68
      std::strcmp(dynamic_.zmpSOUT.getName().c_str(),
69
                  "sotDynamicPinocchio(sot_dynamic_test)::output(vector)::zmp"),
70
      0);
71


2
  BOOST_CHECK_EQUAL(
72
      std::strcmp(
73
          dynamic_.JcomSOUT.getName().c_str(),
74
          "sotDynamicPinocchio(sot_dynamic_test)::output(matrix)::Jcom"),
75
      0);
76


2
  BOOST_CHECK_EQUAL(
77
      std::strcmp(dynamic_.comSOUT.getName().c_str(),
78
                  "sotDynamicPinocchio(sot_dynamic_test)::output(vector)::com"),
79
      0);
80


2
  BOOST_CHECK_EQUAL(
81
      std::strcmp(
82
          dynamic_.inertiaSOUT.getName().c_str(),
83
          "sotDynamicPinocchio(sot_dynamic_test)::output(matrix)::inertia"),
84
      0);
85


2
  BOOST_CHECK_EQUAL(
86
      std::strcmp(
87
          dynamic_.footHeightSOUT.getName().c_str(),
88
          "sotDynamicPinocchio(sot_dynamic_test)::output(double)::footHeight"),
89
      0);
90


2
  BOOST_CHECK_EQUAL(
91
      std::strcmp(
92
          dynamic_.upperJlSOUT.getName().c_str(),
93
          "sotDynamicPinocchio(sot_dynamic_test)::output(vector)::upperJl"),
94
      0);
95


2
  BOOST_CHECK_EQUAL(
96
      std::strcmp(
97
          dynamic_.lowerJlSOUT.getName().c_str(),
98
          "sotDynamicPinocchio(sot_dynamic_test)::output(vector)::lowerJl"),
99
      0);
100


2
  BOOST_CHECK_EQUAL(
101
      std::strcmp(
102
          dynamic_.upperVlSOUT.getName().c_str(),
103
          "sotDynamicPinocchio(sot_dynamic_test)::output(vector)::upperVl"),
104
      0);
105


2
  BOOST_CHECK_EQUAL(
106
      std::strcmp(
107
          dynamic_.upperTlSOUT.getName().c_str(),
108
          "sotDynamicPinocchio(sot_dynamic_test)::output(vector)::upperTl"),
109
      0);
110


2
  BOOST_CHECK_EQUAL(std::strcmp(dynamic_.inertiaRotorSOUT.getName().c_str(),
111
                                "sotDynamicPinocchio(sot_dynamic_test)::output("
112
                                "matrix)::inertiaRotor"),
113
                    0);
114


2
  BOOST_CHECK_EQUAL(
115
      std::strcmp(
116
          dynamic_.MomentaSOUT.getName().c_str(),
117
          "sotDynamicPinocchio(sot_dynamic_test)::output(vector)::momenta"),
118
      0);
119


2
  BOOST_CHECK_EQUAL(std::strcmp(dynamic_.AngularMomentumSOUT.getName().c_str(),
120
                                "sotDynamicPinocchio(sot_dynamic_test)::output("
121
                                "vector)::angularmomentum"),
122
                    0);
123


2
  BOOST_CHECK_EQUAL(std::strcmp(dynamic_.dynamicDriftSOUT.getName().c_str(),
124
                                "sotDynamicPinocchio(sot_dynamic_test)::output("
125
                                "vector)::dynamicDrift"),
126
                    0);
127
2
}