GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: tests/test_simpleseqplay.cc Lines: 21 21 100.0 %
Date: 2023-01-29 11:05:01 Branches: 115 226 50.9 %

Line Branch Exec Source
1
#define BOOST_TEST_MODULE simpleseqplay
2
#include <boost/test/output_test_stream.hpp>
3
#include <boost/test/unit_test.hpp>
4
#include <boost/utility/binary.hpp>
5
6
#include "sot/tools/simpleseqplay.hh"
7
8
namespace dg = dynamicgraph;
9
BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
10
11
















4
BOOST_AUTO_TEST_CASE(test_simpleseqplay) {
12

6
  dg::sot::tools::SimpleSeqPlay aSimpleSeqPlay("simpleseqplay");
13
14
4
  dg::Vector initial(32);
15




2
  initial << 0.0, 0.0, -0.411354, 0.859395, -0.448041, -0.001708, 0.0, 0.0,
16



2
      -0.411354, 0.859395, -0.448041, -0.001708, 0.0, 0.006761, 0.25847,
17




2
      0.173046, -0.0002, -0.525366, 0.0, -0.0, 0.1, -0.005, -0.25847, -0.173046,
18




2
      0.0002, -0.525366, 0.0, 0.0, 0.1, -0.005, 0.0, 0.0;
19
2
  aSimpleSeqPlay.currentPostureSIN_.setConstant(initial);
20
21



2
  BOOST_CHECK(aSimpleSeqPlay.waiting());
22
23

2
  aSimpleSeqPlay.load(DATA_DIRECTORY "/test");
24
2
  aSimpleSeqPlay.start();
25



2
  BOOST_CHECK(aSimpleSeqPlay.initializing());
26
27
12402
  for (int i = 0; i < 6200; i++) {
28
12400
    aSimpleSeqPlay.currentPostureSIN_.setTime(i);
29
30
24800
    dg::Vector pos;
31
12400
    aSimpleSeqPlay.postureSOUT_.recompute(i);
32
12400
    pos = aSimpleSeqPlay.postureSOUT_.accessCopy();
33



12400
    BOOST_CHECK_EQUAL(initial.size(), pos.size());
34
35




12400
    BOOST_CHECK(i == 6199 || aSimpleSeqPlay.executing());
36
  }
37



2
  BOOST_CHECK(aSimpleSeqPlay.finished());
38
2
}
39
40
BOOST_AUTO_TEST_SUITE_END()