GCC Code Coverage Report


Directory: ./
File: tests/roadmap-1.cc
Date: 2024-12-13 16:14:03
Exec Total Coverage
Lines: 277 278 99.6%
Branches: 975 1920 50.8%

Line Branch Exec Source
1 // Copyright (C) 2014 LAAS-CNRS
2 // Author: Mathieu Geisert
3 //
4
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // 1. Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 //
12 // 2. Redistributions in binary form must reproduce the above copyright
13 // notice, this list of conditions and the following disclaimer in the
14 // documentation and/or other materials provided with the distribution.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
27 // DAMAGE.
28
29 #include <boost/assign.hpp>
30 #include <hpp/core/connected-component.hh>
31 #include <hpp/core/fwd.hh>
32 #include <hpp/core/nearest-neighbor.hh>
33 #include <hpp/core/node.hh>
34 #include <hpp/core/parser/roadmap.hh>
35 #include <hpp/core/path-planner/search-in-roadmap.hh>
36 #include <hpp/core/path-vector.hh>
37 #include <hpp/core/problem.hh>
38 #include <hpp/core/roadmap.hh>
39 #include <hpp/core/steering-method/straight.hh>
40 #include <hpp/core/weighed-distance.hh>
41 #include <hpp/pinocchio/configuration.hh>
42 #include <hpp/pinocchio/device.hh>
43 #include <hpp/pinocchio/joint.hh>
44 #include <hpp/pinocchio/serialization.hh>
45 #include <hpp/pinocchio/urdf/util.hh>
46 #include <hpp/util/debug.hh>
47
48 #define BOOST_TEST_MODULE roadmap - 1
49 #include <boost/test/included/unit_test.hpp>
50
51 using namespace hpp::core;
52 using namespace hpp::pinocchio;
53
54 using hpp::core::steeringMethod::Straight;
55 using hpp::core::steeringMethod::StraightPtr_t;
56
57 BOOST_AUTO_TEST_SUITE(test_hpp_core)
58
59 20 void addEdge(const hpp::core::RoadmapPtr_t& r,
60 const hpp::core::SteeringMethod& sm,
61 const std::vector<NodePtr_t>& nodes, std::size_t i,
62 std::size_t j) {
63
1/2
✓ Branch 4 taken 20 times.
✗ Branch 5 not taken.
40 r->addEdge(nodes[i], nodes[j],
64
3/6
✓ Branch 5 taken 20 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 20 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 20 times.
✗ Branch 12 not taken.
40 sm(nodes[i]->configuration(), nodes[j]->configuration()));
65 20 }
66
67 4 DevicePtr_t createRobot() {
68 std::string urdf(
69 "<robot name='test'>"
70 "<link name='link1'/>"
71 "<link name='link2'/>"
72 "<link name='link3'/>"
73 "<joint name='tx' type='prismatic'>"
74 "<parent link='link1'/>"
75 "<child link='link2'/>"
76 "<limit effort='30' velocity='1.0' lower='-3' upper='3'/>"
77 "</joint>"
78 "<joint name='ty' type='prismatic'>"
79 "<axis xyz='0 1 0'/>"
80 "<parent link='link2'/>"
81 "<child link='link3'/>"
82 "<limit effort='30' velocity='1.0' lower='-3' upper='3'/>"
83 "</joint>"
84
1/2
✓ Branch 2 taken 4 times.
✗ Branch 3 not taken.
4 "</robot>");
85
86
2/4
✓ Branch 2 taken 4 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 4 times.
✗ Branch 6 not taken.
8 DevicePtr_t robot = Device::create("test");
87
5/10
✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 4 times.
✗ Branch 6 not taken.
✓ Branch 9 taken 4 times.
✗ Branch 10 not taken.
✓ Branch 13 taken 4 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 4 times.
✗ Branch 17 not taken.
4 urdf::loadModelFromString(robot, 0, "", "anchor", urdf, "");
88 8 return robot;
89 4 }
90
91
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(Roadmap1) {
92 // Build robot
93
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 DevicePtr_t robot = createRobot();
94
95 // Create steering method
96
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 ProblemPtr_t p = Problem::create(robot);
97
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 StraightPtr_t sm = Straight::create(p);
98 // create roadmap
99 hpp::core::DistancePtr_t distance(
100
3/6
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
4 WeighedDistance::createWithWeight(robot, vector_t::Ones(2)));
101
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 RoadmapPtr_t r = Roadmap::create(distance, robot);
102
103 2 std::vector<NodePtr_t> nodes;
104
105 // nodes [0]
106
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 Configuration_t q(robot->configSize());
107
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 0;
108
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 0;
109 // Set init node
110
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 r->initNode(q);
111
1/2
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
2 nodes.push_back(r->initNode());
112
113 // nodes [1]
114
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 q = Configuration_t(robot->configSize());
115
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 1;
116
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 0;
117
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
2 nodes.push_back(r->addNode(q));
118
119 // nodes [2]
120
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 q = Configuration_t(robot->configSize());
121
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 0.5;
122
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 0.9;
123
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
2 nodes.push_back(r->addNode(q));
124
125 // nodes [3]
126
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 q = Configuration_t(robot->configSize());
127
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = -0.1;
128
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = -0.9;
129
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
2 nodes.push_back(r->addNode(q));
130
131 // nodes [4]
132
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 q = Configuration_t(robot->configSize());
133
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 1.5;
134
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 2.9;
135
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
2 nodes.push_back(r->addNode(q));
136
137 // nodes [5]
138
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 q = Configuration_t(robot->configSize());
139
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 2.5;
140
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 2.9;
141
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
2 nodes.push_back(r->addNode(q));
142
3/6
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
2 r->addGoalNode(nodes[5]->configuration());
143
144
5/10
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
2 BOOST_TEST_MESSAGE(*r);
145
6/12
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 1 times.
2 BOOST_CHECK_EQUAL(r->connectedComponents().size(), 6);
146
2/2
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 1 times.
14 for (std::size_t i = 0; i < nodes.size(); ++i) {
147
2/2
✓ Branch 1 taken 15 times.
✓ Branch 2 taken 6 times.
42 for (std::size_t j = i + 1; j < nodes.size(); ++j) {
148
13/26
✓ Branch 1 taken 15 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 15 times.
✗ Branch 6 not taken.
✓ Branch 10 taken 15 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 15 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 15 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 15 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 15 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 15 times.
✗ Branch 26 not taken.
✓ Branch 29 taken 15 times.
✗ Branch 30 not taken.
✓ Branch 33 taken 15 times.
✗ Branch 34 not taken.
✓ Branch 37 taken 15 times.
✗ Branch 38 not taken.
✓ Branch 40 taken 15 times.
✗ Branch 41 not taken.
✗ Branch 52 not taken.
✓ Branch 53 taken 15 times.
30 BOOST_CHECK_MESSAGE(
149 nodes[i]->connectedComponent() != nodes[j]->connectedComponent(),
150 "nodes " << i << " and " << j << "are in the same"
151 << " connected component");
152 }
153 }
154
7/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
✗ Branch 26 not taken.
✓ Branch 27 taken 1 times.
2 BOOST_CHECK(!r->pathExists());
155 // 0 -> 1
156
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 addEdge(r, *sm, nodes, 0, 1);
157
6/12
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 1 times.
2 BOOST_CHECK_EQUAL(r->connectedComponents().size(), 6);
158
2/2
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 1 times.
14 for (std::size_t i = 0; i < nodes.size(); ++i) {
159
2/2
✓ Branch 1 taken 15 times.
✓ Branch 2 taken 6 times.
42 for (std::size_t j = i + 1; j < nodes.size(); ++j) {
160
13/26
✓ Branch 1 taken 15 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 15 times.
✗ Branch 6 not taken.
✓ Branch 10 taken 15 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 15 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 15 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 15 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 15 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 15 times.
✗ Branch 26 not taken.
✓ Branch 29 taken 15 times.
✗ Branch 30 not taken.
✓ Branch 33 taken 15 times.
✗ Branch 34 not taken.
✓ Branch 37 taken 15 times.
✗ Branch 38 not taken.
✓ Branch 40 taken 15 times.
✗ Branch 41 not taken.
✗ Branch 52 not taken.
✓ Branch 53 taken 15 times.
30 BOOST_CHECK_MESSAGE(
161 nodes[i]->connectedComponent() != nodes[j]->connectedComponent(),
162 "nodes " << i << " and " << j << "are in the same"
163 << " connected component");
164 }
165 }
166
7/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
✗ Branch 26 not taken.
✓ Branch 27 taken 1 times.
2 BOOST_CHECK(!r->pathExists());
167
5/10
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
2 BOOST_TEST_MESSAGE(*r);
168
169 // 1 -> 0
170
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 addEdge(r, *sm, nodes, 1, 0);
171
172
6/12
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 1 times.
2 BOOST_CHECK_EQUAL(r->connectedComponents().size(), 5);
173
8/16
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 1 times.
2 BOOST_CHECK(nodes[0]->connectedComponent() == nodes[1]->connectedComponent());
174
2/2
✓ Branch 1 taken 5 times.
✓ Branch 2 taken 1 times.
12 for (std::size_t i = 1; i < nodes.size(); ++i) {
175
2/2
✓ Branch 1 taken 10 times.
✓ Branch 2 taken 5 times.
30 for (std::size_t j = i + 1; j < nodes.size(); ++j) {
176
13/26
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
✓ Branch 10 taken 10 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 10 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 10 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 10 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 10 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 10 times.
✗ Branch 26 not taken.
✓ Branch 29 taken 10 times.
✗ Branch 30 not taken.
✓ Branch 33 taken 10 times.
✗ Branch 34 not taken.
✓ Branch 37 taken 10 times.
✗ Branch 38 not taken.
✓ Branch 40 taken 10 times.
✗ Branch 41 not taken.
✗ Branch 52 not taken.
✓ Branch 53 taken 10 times.
20 BOOST_CHECK_MESSAGE(
177 nodes[i]->connectedComponent() != nodes[j]->connectedComponent(),
178 "nodes " << i << " and " << j << "are in the same"
179 << " connected component");
180 }
181 }
182
7/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
✗ Branch 26 not taken.
✓ Branch 27 taken 1 times.
2 BOOST_CHECK(!r->pathExists());
183
5/10
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
2 BOOST_TEST_MESSAGE(*r);
184 // 1 -> 2
185
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 addEdge(r, *sm, nodes, 1, 2);
186
6/12
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 1 times.
2 BOOST_CHECK_EQUAL(r->connectedComponents().size(), 5);
187
8/16
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 1 times.
2 BOOST_CHECK(nodes[0]->connectedComponent() == nodes[1]->connectedComponent());
188
2/2
✓ Branch 1 taken 5 times.
✓ Branch 2 taken 1 times.
12 for (std::size_t i = 1; i < nodes.size(); ++i) {
189
2/2
✓ Branch 1 taken 10 times.
✓ Branch 2 taken 5 times.
30 for (std::size_t j = i + 1; j < nodes.size(); ++j) {
190
13/26
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 10 times.
✗ Branch 6 not taken.
✓ Branch 10 taken 10 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 10 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 10 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 10 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 10 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 10 times.
✗ Branch 26 not taken.
✓ Branch 29 taken 10 times.
✗ Branch 30 not taken.
✓ Branch 33 taken 10 times.
✗ Branch 34 not taken.
✓ Branch 37 taken 10 times.
✗ Branch 38 not taken.
✓ Branch 40 taken 10 times.
✗ Branch 41 not taken.
✗ Branch 52 not taken.
✓ Branch 53 taken 10 times.
20 BOOST_CHECK_MESSAGE(
191 nodes[i]->connectedComponent() != nodes[j]->connectedComponent(),
192 "nodes " << i << " and " << j << "are in the same"
193 << " connected component");
194 }
195 }
196
7/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
✗ Branch 26 not taken.
✓ Branch 27 taken 1 times.
2 BOOST_CHECK(!r->pathExists());
197
5/10
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
2 BOOST_TEST_MESSAGE(*r);
198
199 // 2 -> 0
200
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 addEdge(r, *sm, nodes, 2, 0);
201
6/12
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 1 times.
2 BOOST_CHECK_EQUAL(r->connectedComponents().size(), 4);
202
8/16
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 1 times.
2 BOOST_CHECK(nodes[0]->connectedComponent() == nodes[1]->connectedComponent());
203
8/16
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 1 times.
2 BOOST_CHECK(nodes[0]->connectedComponent() == nodes[2]->connectedComponent());
204
2/2
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 1 times.
10 for (std::size_t i = 2; i < nodes.size(); ++i) {
205
2/2
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 4 times.
20 for (std::size_t j = i + 1; j < nodes.size(); ++j) {
206
13/26
✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 6 times.
✗ Branch 6 not taken.
✓ Branch 10 taken 6 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 6 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 6 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 6 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 6 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 6 times.
✗ Branch 26 not taken.
✓ Branch 29 taken 6 times.
✗ Branch 30 not taken.
✓ Branch 33 taken 6 times.
✗ Branch 34 not taken.
✓ Branch 37 taken 6 times.
✗ Branch 38 not taken.
✓ Branch 40 taken 6 times.
✗ Branch 41 not taken.
✗ Branch 52 not taken.
✓ Branch 53 taken 6 times.
12 BOOST_CHECK_MESSAGE(
207 nodes[i]->connectedComponent() != nodes[j]->connectedComponent(),
208 "nodes " << i << " and " << j << "are in the same"
209 << " connected component");
210 }
211 }
212
7/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
✗ Branch 26 not taken.
✓ Branch 27 taken 1 times.
2 BOOST_CHECK(!r->pathExists());
213
5/10
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
2 BOOST_TEST_MESSAGE(*r);
214
215 // 2 -> 3
216
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 addEdge(r, *sm, nodes, 2, 3);
217
6/12
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 1 times.
2 BOOST_CHECK_EQUAL(r->connectedComponents().size(), 4);
218
8/16
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 1 times.
2 BOOST_CHECK(nodes[0]->connectedComponent() == nodes[1]->connectedComponent());
219
8/16
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 1 times.
2 BOOST_CHECK(nodes[0]->connectedComponent() == nodes[2]->connectedComponent());
220
2/2
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 1 times.
10 for (std::size_t i = 2; i < nodes.size(); ++i) {
221
2/2
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 4 times.
20 for (std::size_t j = i + 1; j < nodes.size(); ++j) {
222
13/26
✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 6 times.
✗ Branch 6 not taken.
✓ Branch 10 taken 6 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 6 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 6 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 6 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 6 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 6 times.
✗ Branch 26 not taken.
✓ Branch 29 taken 6 times.
✗ Branch 30 not taken.
✓ Branch 33 taken 6 times.
✗ Branch 34 not taken.
✓ Branch 37 taken 6 times.
✗ Branch 38 not taken.
✓ Branch 40 taken 6 times.
✗ Branch 41 not taken.
✗ Branch 52 not taken.
✓ Branch 53 taken 6 times.
12 BOOST_CHECK_MESSAGE(
223 nodes[i]->connectedComponent() != nodes[j]->connectedComponent(),
224 "nodes " << i << " and " << j << "are in the same"
225 << " connected component");
226 }
227 }
228
7/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
✗ Branch 26 not taken.
✓ Branch 27 taken 1 times.
2 BOOST_CHECK(!r->pathExists());
229
5/10
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
2 BOOST_TEST_MESSAGE(*r);
230
231 // 2 -> 4
232
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 addEdge(r, *sm, nodes, 2, 4);
233
6/12
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 1 times.
2 BOOST_CHECK_EQUAL(r->connectedComponents().size(), 4);
234
8/16
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 1 times.
2 BOOST_CHECK(nodes[0]->connectedComponent() == nodes[1]->connectedComponent());
235
8/16
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 1 times.
2 BOOST_CHECK(nodes[0]->connectedComponent() == nodes[2]->connectedComponent());
236
2/2
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 1 times.
10 for (std::size_t i = 2; i < nodes.size(); ++i) {
237
2/2
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 4 times.
20 for (std::size_t j = i + 1; j < nodes.size(); ++j) {
238
13/26
✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 6 times.
✗ Branch 6 not taken.
✓ Branch 10 taken 6 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 6 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 6 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 6 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 6 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 6 times.
✗ Branch 26 not taken.
✓ Branch 29 taken 6 times.
✗ Branch 30 not taken.
✓ Branch 33 taken 6 times.
✗ Branch 34 not taken.
✓ Branch 37 taken 6 times.
✗ Branch 38 not taken.
✓ Branch 40 taken 6 times.
✗ Branch 41 not taken.
✗ Branch 52 not taken.
✓ Branch 53 taken 6 times.
12 BOOST_CHECK_MESSAGE(
239 nodes[i]->connectedComponent() != nodes[j]->connectedComponent(),
240 "nodes " << i << " and " << j << "are in the same"
241 << " connected component");
242 }
243 }
244
7/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
✗ Branch 26 not taken.
✓ Branch 27 taken 1 times.
2 BOOST_CHECK(!r->pathExists());
245
5/10
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
2 BOOST_TEST_MESSAGE(*r);
246
247 // 3 -> 5
248
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 addEdge(r, *sm, nodes, 3, 5);
249
6/12
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 1 times.
2 BOOST_CHECK_EQUAL(r->connectedComponents().size(), 4);
250
8/16
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 1 times.
2 BOOST_CHECK(nodes[0]->connectedComponent() == nodes[1]->connectedComponent());
251
8/16
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 1 times.
2 BOOST_CHECK(nodes[0]->connectedComponent() == nodes[2]->connectedComponent());
252
2/2
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 1 times.
10 for (std::size_t i = 2; i < nodes.size(); ++i) {
253
2/2
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 4 times.
20 for (std::size_t j = i + 1; j < nodes.size(); ++j) {
254
13/26
✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 6 times.
✗ Branch 6 not taken.
✓ Branch 10 taken 6 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 6 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 6 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 6 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 6 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 6 times.
✗ Branch 26 not taken.
✓ Branch 29 taken 6 times.
✗ Branch 30 not taken.
✓ Branch 33 taken 6 times.
✗ Branch 34 not taken.
✓ Branch 37 taken 6 times.
✗ Branch 38 not taken.
✓ Branch 40 taken 6 times.
✗ Branch 41 not taken.
✗ Branch 52 not taken.
✓ Branch 53 taken 6 times.
12 BOOST_CHECK_MESSAGE(
255 nodes[i]->connectedComponent() != nodes[j]->connectedComponent(),
256 "nodes " << i << " and " << j << "are in the same"
257 << " connected component");
258 }
259 }
260
7/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
✗ Branch 26 not taken.
✓ Branch 27 taken 1 times.
2 BOOST_CHECK(r->pathExists());
261
5/10
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
2 BOOST_TEST_MESSAGE(*r);
262
263 // 4 -> 5
264
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 addEdge(r, *sm, nodes, 4, 5);
265
6/12
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 1 times.
2 BOOST_CHECK_EQUAL(r->connectedComponents().size(), 4);
266
8/16
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 1 times.
2 BOOST_CHECK(nodes[0]->connectedComponent() == nodes[1]->connectedComponent());
267
8/16
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 1 times.
2 BOOST_CHECK(nodes[0]->connectedComponent() == nodes[2]->connectedComponent());
268
2/2
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 1 times.
10 for (std::size_t i = 2; i < nodes.size(); ++i) {
269
2/2
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 4 times.
20 for (std::size_t j = i + 1; j < nodes.size(); ++j) {
270
13/26
✓ Branch 1 taken 6 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 6 times.
✗ Branch 6 not taken.
✓ Branch 10 taken 6 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 6 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 6 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 6 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 6 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 6 times.
✗ Branch 26 not taken.
✓ Branch 29 taken 6 times.
✗ Branch 30 not taken.
✓ Branch 33 taken 6 times.
✗ Branch 34 not taken.
✓ Branch 37 taken 6 times.
✗ Branch 38 not taken.
✓ Branch 40 taken 6 times.
✗ Branch 41 not taken.
✗ Branch 52 not taken.
✓ Branch 53 taken 6 times.
12 BOOST_CHECK_MESSAGE(
271 nodes[i]->connectedComponent() != nodes[j]->connectedComponent(),
272 "nodes " << i << " and " << j << "are in the same"
273 << " connected component");
274 }
275 }
276
7/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
✗ Branch 26 not taken.
✓ Branch 27 taken 1 times.
2 BOOST_CHECK(r->pathExists());
277
5/10
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
2 BOOST_TEST_MESSAGE(*r);
278
279 // 5 -> 0
280
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 addEdge(r, *sm, nodes, 5, 0);
281
6/12
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 1 times.
2 BOOST_CHECK_EQUAL(r->connectedComponents().size(), 1);
282
8/16
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 1 times.
2 BOOST_CHECK(nodes[0]->connectedComponent() == nodes[1]->connectedComponent());
283
8/16
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 1 times.
2 BOOST_CHECK(nodes[0]->connectedComponent() == nodes[2]->connectedComponent());
284
8/16
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 1 times.
2 BOOST_CHECK(nodes[0]->connectedComponent() == nodes[3]->connectedComponent());
285
8/16
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 1 times.
2 BOOST_CHECK(nodes[0]->connectedComponent() == nodes[4]->connectedComponent());
286
8/16
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 1 times.
2 BOOST_CHECK(nodes[0]->connectedComponent() == nodes[5]->connectedComponent());
287
7/14
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
✗ Branch 26 not taken.
✓ Branch 27 taken 1 times.
2 BOOST_CHECK(r->pathExists());
288
5/10
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
2 BOOST_TEST_MESSAGE(*r);
289
290 2 r->resetGoalNodes();
291 // Check pathPlanner::SearchInRoadmap
292
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 0;
293
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 0;
294
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 p->initConfig(q);
295
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 2.5;
296
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 2.9;
297
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 p->addGoalConfig(q);
298 pathPlanner::SearchInRoadmapPtr_t planner(
299
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 pathPlanner::SearchInRoadmap::createWithRoadmap(p, r));
300
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 PathVectorPtr_t pv(planner->solve());
301
6/12
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 1 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 1 times.
2 BOOST_CHECK(pv);
302
6/12
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✗ Branch 24 not taken.
✓ Branch 25 taken 1 times.
2 BOOST_CHECK(pv->numberPaths() == 4);
303
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 0;
304
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 0;
305
9/18
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 1 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 1 times.
✗ Branch 29 not taken.
✗ Branch 35 not taken.
✓ Branch 36 taken 1 times.
2 BOOST_CHECK(pv->pathAtRank(0)->initial() == q);
306
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 1;
307
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 0;
308
9/18
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 1 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 1 times.
✗ Branch 29 not taken.
✗ Branch 35 not taken.
✓ Branch 36 taken 1 times.
2 BOOST_CHECK(pv->pathAtRank(0)->end() == q);
309
9/18
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 1 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 1 times.
✗ Branch 29 not taken.
✗ Branch 35 not taken.
✓ Branch 36 taken 1 times.
2 BOOST_CHECK(pv->pathAtRank(1)->initial() == q);
310
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = .5;
311
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = .9;
312
9/18
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 1 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 1 times.
✗ Branch 29 not taken.
✗ Branch 35 not taken.
✓ Branch 36 taken 1 times.
2 BOOST_CHECK(pv->pathAtRank(1)->end() == q);
313
9/18
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 1 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 1 times.
✗ Branch 29 not taken.
✗ Branch 35 not taken.
✓ Branch 36 taken 1 times.
2 BOOST_CHECK(pv->pathAtRank(2)->initial() == q);
314
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 1.5;
315
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 2.9;
316
9/18
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 1 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 1 times.
✗ Branch 29 not taken.
✗ Branch 35 not taken.
✓ Branch 36 taken 1 times.
2 BOOST_CHECK(pv->pathAtRank(2)->end() == q);
317
9/18
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 1 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 1 times.
✗ Branch 29 not taken.
✗ Branch 35 not taken.
✓ Branch 36 taken 1 times.
2 BOOST_CHECK(pv->pathAtRank(3)->initial() == q);
318
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 2.5;
319
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 2.9;
320
9/18
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 1 times.
✗ Branch 26 not taken.
✓ Branch 28 taken 1 times.
✗ Branch 29 not taken.
✗ Branch 35 not taken.
✓ Branch 36 taken 1 times.
2 BOOST_CHECK(pv->pathAtRank(3)->end() == q);
321
322 // Check that memory if well deallocated.
323 2 std::list<ConnectedComponentWkPtr_t> ccs;
324 2 for (ConnectedComponents_t::const_iterator _cc =
325
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 r->connectedComponents().begin();
326
3/4
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 1 times.
✓ Branch 7 taken 1 times.
4 _cc != r->connectedComponents().end(); ++_cc)
327
1/2
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
2 ccs.push_back(*_cc);
328
329 2 r.reset();
330 2 for (std::list<ConnectedComponentWkPtr_t>::const_iterator _cc = ccs.begin();
331
1/2
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
2 _cc != ccs.begin(); ++_cc) {
332 BOOST_CHECK(!_cc->lock());
333 }
334 2 }
335
336
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(nearestNeighbor) {
337 // Build robot
338
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 DevicePtr_t robot = createRobot();
339
340 // Create steering method
341
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 ProblemPtr_t p = Problem::create(robot);
342
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 StraightPtr_t sm = Straight::create(p);
343 // create roadmap
344 hpp::core::DistancePtr_t distance(
345
3/6
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
4 WeighedDistance::createWithWeight(robot, vector_t::Ones(2)));
346
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 RoadmapPtr_t r = Roadmap::create(distance, robot);
347
348 2 std::vector<NodePtr_t> nodes;
349
350 // nodes [0]
351
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 Configuration_t q(robot->configSize());
352
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 0;
353
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 0;
354
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
2 nodes.push_back(r->addNode(q));
355
356 // nodes [1]
357
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 q = Configuration_t(robot->configSize());
358
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 1;
359
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 0;
360
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
2 nodes.push_back(r->addNode(q));
361
362 // nodes [2]
363
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 q = Configuration_t(robot->configSize());
364
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 0.5;
365
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 0.9;
366
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
2 nodes.push_back(r->addNode(q));
367
368 // nodes [3]
369
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 q = Configuration_t(robot->configSize());
370
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = -0.1;
371
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = -0.9;
372
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
2 nodes.push_back(r->addNode(q));
373
374 // nodes [4]
375
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 q = Configuration_t(robot->configSize());
376
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 1.5;
377
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 2.9;
378
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
2 nodes.push_back(r->addNode(q));
379
380 // nodes [5]
381
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 q = Configuration_t(robot->configSize());
382
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 2.5;
383
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 2.9;
384
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
2 nodes.push_back(r->addNode(q));
385
3/6
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
2 r->addGoalNode(nodes[5]->configuration());
386
387 // nodes [6]
388
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 q = Configuration_t(robot->configSize());
389
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 0;
390
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 0.2;
391
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
2 nodes.push_back(r->addNode(q));
392
3/6
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
2 r->addGoalNode(nodes[6]->configuration());
393
394 // 0 -> 1
395
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 addEdge(r, *sm, nodes, 0, 1);
396 // 1 -> 0
397
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 addEdge(r, *sm, nodes, 1, 0);
398 // 1 -> 2
399
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 addEdge(r, *sm, nodes, 1, 2);
400 // 2 -> 0
401
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 addEdge(r, *sm, nodes, 2, 0);
402 // 0 -> 3
403
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 addEdge(r, *sm, nodes, 0, 3);
404 // 3 -> 2
405
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 addEdge(r, *sm, nodes, 3, 2);
406
407 hpp::pinocchio::value_type dist;
408 using hpp::core::Nodes_t;
409
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 Nodes_t knearest = r->nearestNeighbor()->KnearestSearch(
410
4/8
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
4 nodes[0]->configuration(), nodes[0]->connectedComponent(), 3, dist);
411
2/2
✓ Branch 5 taken 3 times.
✓ Branch 6 taken 1 times.
8 for (Nodes_t::const_iterator it = knearest.begin(); it != knearest.end();
412 6 ++it) {
413
15/30
✓ Branch 2 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 3 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 3 times.
✗ Branch 9 not taken.
✓ Branch 12 taken 3 times.
✗ Branch 13 not taken.
✓ Branch 16 taken 3 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 3 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 3 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 3 times.
✗ Branch 26 not taken.
✓ Branch 30 taken 3 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 3 times.
✗ Branch 34 not taken.
✓ Branch 37 taken 3 times.
✗ Branch 38 not taken.
✓ Branch 40 taken 3 times.
✗ Branch 41 not taken.
✓ Branch 43 taken 3 times.
✗ Branch 44 not taken.
✓ Branch 46 taken 3 times.
✗ Branch 47 not taken.
✓ Branch 49 taken 3 times.
✗ Branch 50 not taken.
6 BOOST_TEST_MESSAGE("q = [" << (*it)->configuration().transpose()
414 << "] - dist : "
415 << (*distance)(nodes[0]->configuration(),
416 (*it)->configuration()));
417 }
418 2 for (std::vector<NodePtr_t>::const_iterator it = nodes.begin();
419
2/2
✓ Branch 3 taken 7 times.
✓ Branch 4 taken 1 times.
16 it != nodes.end(); ++it) {
420
2/4
✓ Branch 2 taken 7 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 7 times.
✗ Branch 6 not taken.
14 Configuration_t q = (*it)->configuration();
421
13/26
✓ Branch 2 taken 7 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 7 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 7 times.
✗ Branch 9 not taken.
✓ Branch 12 taken 7 times.
✗ Branch 13 not taken.
✓ Branch 15 taken 7 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 7 times.
✗ Branch 19 not taken.
✓ Branch 21 taken 7 times.
✗ Branch 22 not taken.
✓ Branch 25 taken 7 times.
✗ Branch 26 not taken.
✓ Branch 29 taken 7 times.
✗ Branch 30 not taken.
✓ Branch 32 taken 7 times.
✗ Branch 33 not taken.
✓ Branch 35 taken 7 times.
✗ Branch 36 not taken.
✓ Branch 38 taken 7 times.
✗ Branch 39 not taken.
✓ Branch 41 taken 7 times.
✗ Branch 42 not taken.
14 BOOST_TEST_MESSAGE("[" << q.transpose() << "] - dist : "
422 << (*distance)(nodes[0]->configuration(), q));
423 14 }
424 2 }
425
426
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(serialization) {
427 // Build robot
428
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 DevicePtr_t robot = createRobot();
429
430 // Create steering method
431
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 ProblemPtr_t p = Problem::create(robot);
432
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 StraightPtr_t sm = Straight::create(p);
433 // create roadmap
434 hpp::core::DistancePtr_t distance(
435
3/6
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
4 WeighedDistance::createWithWeight(robot, vector_t::Ones(2)));
436
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 RoadmapPtr_t r = Roadmap::create(distance, robot);
437
438 2 std::vector<NodePtr_t> nodes;
439
440 // nodes [0]
441
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 Configuration_t q(robot->configSize());
442
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 0;
443
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 0;
444 // Set init node
445
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 r->initNode(q);
446
1/2
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
2 nodes.push_back(r->initNode());
447
448 // nodes [1]
449
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 q = Configuration_t(robot->configSize());
450
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 1;
451
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 0;
452
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
2 nodes.push_back(r->addNode(q));
453
454 // nodes [2]
455
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 q = Configuration_t(robot->configSize());
456
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 0.5;
457
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 0.9;
458
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
2 nodes.push_back(r->addNode(q));
459
460 // nodes [3]
461
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 q = Configuration_t(robot->configSize());
462
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = -0.1;
463
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = -0.9;
464
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
2 nodes.push_back(r->addNode(q));
465
466 // nodes [4]
467
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 q = Configuration_t(robot->configSize());
468
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 1.5;
469
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 2.9;
470
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
2 nodes.push_back(r->addNode(q));
471
472 // nodes [5]
473
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 q = Configuration_t(robot->configSize());
474
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[0] = 2.5;
475
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 q[1] = 2.9;
476
3/6
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
2 nodes.push_back(r->addNode(q));
477
3/6
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
2 r->addGoalNode(nodes[5]->configuration());
478
479 // 1 -> 0
480
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 addEdge(r, *sm, nodes, 0, 1);
481 // 1 -> 2
482
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 addEdge(r, *sm, nodes, 1, 2);
483 // 2 -> 0
484
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 addEdge(r, *sm, nodes, 2, 0);
485 // 3 -> 5
486
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 addEdge(r, *sm, nodes, 3, 5);
487 // 4 -> 5
488
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
2 addEdge(r, *sm, nodes, 4, 5);
489
490
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 std::cout << *r << std::endl;
491
492 // save data to archive
493
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 parser::serializeRoadmap<hpp::serialization::text_oarchive>(
494
1/2
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
4 r, "filename.txt", parser::make_nvp(robot->name(), robot.get()));
495
496
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 parser::serializeRoadmap<hpp::serialization::xml_oarchive>(
497
1/2
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
4 r, "filename.xml", parser::make_nvp(robot->name(), robot.get()));
498
499
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 parser::serializeRoadmap<hpp::serialization::binary_oarchive>(
500
1/2
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
4 r, "filename.bin", parser::make_nvp(robot->name(), robot.get()));
501 2 }
502
503
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(deserialization) {
504
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
2 DevicePtr_t robot = createRobot();
505
506 2 RoadmapPtr_t nr;
507
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 parser::serializeRoadmap<hpp::serialization::text_iarchive>(
508
1/2
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
4 nr, "filename.txt", parser::make_nvp(robot->name(), robot.get()));
509
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 std::cout << *nr << std::endl;
510
511
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 parser::serializeRoadmap<hpp::serialization::xml_iarchive>(
512
1/2
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
4 nr, "filename.xml", parser::make_nvp(robot->name(), robot.get()));
513
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 std::cout << *nr << std::endl;
514
515
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 parser::serializeRoadmap<hpp::serialization::binary_iarchive>(
516
1/2
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
4 nr, "filename.bin", parser::make_nvp(robot->name(), robot.get()));
517
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 std::cout << *nr << std::endl;
518 2 }
519
520 BOOST_AUTO_TEST_SUITE_END()
521