Skip to content

Commit 41c1f2e

Browse files
committed
fix warnings
1 parent c74fa94 commit 41c1f2e

20 files changed

+165
-36
lines changed

Diff for: btcpp_logo.png

9.73 KB
Loading

Diff for: btcpp_logo.svg

+128
Loading

Diff for: tests/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
######################################################
22
# TESTS
33

4-
include_directories(include)
4+
include_directories(include ${PROJECT_SOURCE_DIR}/3rdparty)
55

66
set(BT_TESTS
77
src/action_test_node.cpp

Diff for: tests/gtest_factory.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ static const char* xml_text_subtree = R"(
7777

7878
static const char* xml_text_subtree_part1 = R"(
7979
80-
<root>
80+
<root BTCPP_format="4">
8181
<BehaviorTree ID="MainTree">
8282
<Fallback name="root_selector">
8383
<SubTree ID="DoorClosedSubtree" />
@@ -88,7 +88,7 @@ static const char* xml_text_subtree_part1 = R"(
8888

8989
static const char* xml_text_subtree_part2 = R"(
9090
91-
<root>
91+
<root BTCPP_format="4">
9292
<BehaviorTree ID="DoorClosedSubtree">
9393
<Sequence name="door_sequence">
9494
<Decorator ID="Inverter">
@@ -168,7 +168,7 @@ TEST(BehaviorTreeFactory, Subtree)
168168
TEST(BehaviorTreeFactory, Issue7)
169169
{
170170
const std::string xml_text_issue = R"(
171-
<root>
171+
<root BTCPP_format="4">
172172
<BehaviorTree ID="ReceiveGuest">
173173
</BehaviorTree>
174174
</root> )";
@@ -183,7 +183,7 @@ TEST(BehaviorTreeFactory, Issue7)
183183

184184
static const char* xml_ports_subtree = R"(
185185
186-
<root BTCPP_format="4" format="4" main_tree_to_execute="MainTree">
186+
<root BTCPP_format="4" main_tree_to_execute="MainTree">
187187
188188
<BehaviorTree ID="TalkToMe">
189189
<Sequence>

Diff for: tests/gtest_logger_zmq.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ TEST(LoggerZMQ, ZMQLoggerDeletesCleanlyAfterTickingTree)
77
{
88
// GIVEN we create a behavior tree through the BT factory and attach a ZMQ publisher to it
99
static constexpr auto XML = R"(
10-
<root>
10+
<root BTCPP_format="4">
1111
<BehaviorTree>
1212
<SetBlackboard output_key="arg1" value="1" />
1313
</BehaviorTree>
@@ -30,7 +30,7 @@ TEST(LoggerZMQ, ZMQLoggerDeletesCleanlyAfterNotTickingTree)
3030
{
3131
// GIVEN we create a behavior tree through the BT factory and attach a ZMQ publisher to it
3232
static constexpr auto XML = R"(
33-
<root>
33+
<root BTCPP_format="4">
3434
<BehaviorTree>
3535
<SetBlackboard output_key="arg1" value="1" />
3636
</BehaviorTree>

Diff for: tests/gtest_switch.cpp

+15-15
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ struct SwitchTest : testing::Test
4444
BT::NodeConfig simple_switch_config_;
4545

4646
SwitchTest() :
47-
action_1("action_1", milliseconds(100)),
48-
action_42("action_42", milliseconds(100)),
49-
action_def("action_default", milliseconds(100))
47+
action_1("action_1", milliseconds(200)),
48+
action_42("action_42", milliseconds(200)),
49+
action_def("action_default", milliseconds(200))
5050
{
5151
BT::PortsRemapping input;
5252
input.insert(std::make_pair("variable", "{my_var}"));
@@ -78,7 +78,7 @@ TEST_F(SwitchTest, DefaultCase)
7878
ASSERT_EQ(NodeStatus::RUNNING, action_def.status());
7979
ASSERT_EQ(NodeStatus::RUNNING, state);
8080

81-
std::this_thread::sleep_for(milliseconds(110));
81+
std::this_thread::sleep_for(milliseconds(300));
8282
state = root->executeTick();
8383

8484
ASSERT_EQ(NodeStatus::IDLE, action_1.status());
@@ -97,7 +97,7 @@ TEST_F(SwitchTest, Case1)
9797
ASSERT_EQ(NodeStatus::IDLE, action_def.status());
9898
ASSERT_EQ(NodeStatus::RUNNING, state);
9999

100-
std::this_thread::sleep_for(milliseconds(110));
100+
std::this_thread::sleep_for(milliseconds(300));
101101
state = root->executeTick();
102102

103103
ASSERT_EQ(NodeStatus::IDLE, action_1.status());
@@ -116,7 +116,7 @@ TEST_F(SwitchTest, Case2)
116116
ASSERT_EQ(NodeStatus::IDLE, action_def.status());
117117
ASSERT_EQ(NodeStatus::RUNNING, state);
118118

119-
std::this_thread::sleep_for(milliseconds(110));
119+
std::this_thread::sleep_for(milliseconds(300));
120120
state = root->executeTick();
121121

122122
ASSERT_EQ(NodeStatus::IDLE, action_1.status());
@@ -135,7 +135,7 @@ TEST_F(SwitchTest, CaseNone)
135135
ASSERT_EQ(NodeStatus::RUNNING, action_def.status());
136136
ASSERT_EQ(NodeStatus::RUNNING, state);
137137

138-
std::this_thread::sleep_for(milliseconds(110));
138+
std::this_thread::sleep_for(milliseconds(300));
139139
state = root->executeTick();
140140

141141
ASSERT_EQ(NodeStatus::IDLE, action_1.status());
@@ -154,7 +154,7 @@ TEST_F(SwitchTest, CaseSwitchToDefault)
154154
ASSERT_EQ(NodeStatus::IDLE, action_def.status());
155155
ASSERT_EQ(NodeStatus::RUNNING, state);
156156

157-
std::this_thread::sleep_for(milliseconds(10));
157+
std::this_thread::sleep_for(milliseconds(20));
158158
state = root->executeTick();
159159
ASSERT_EQ(NodeStatus::RUNNING, action_1.status());
160160
ASSERT_EQ(NodeStatus::IDLE, action_42.status());
@@ -163,22 +163,22 @@ TEST_F(SwitchTest, CaseSwitchToDefault)
163163

164164
// Switch Node does not feels changes. Only when tick.
165165
// (not reactive)
166-
std::this_thread::sleep_for(milliseconds(10));
166+
std::this_thread::sleep_for(milliseconds(20));
167167
bb->set("my_var", "");
168-
std::this_thread::sleep_for(milliseconds(10));
168+
std::this_thread::sleep_for(milliseconds(20));
169169
ASSERT_EQ(NodeStatus::RUNNING, action_1.status());
170170
ASSERT_EQ(NodeStatus::IDLE, action_42.status());
171171
ASSERT_EQ(NodeStatus::IDLE, action_def.status());
172172
ASSERT_EQ(NodeStatus::RUNNING, root->status());
173173

174-
std::this_thread::sleep_for(milliseconds(10));
174+
std::this_thread::sleep_for(milliseconds(20));
175175
state = root->executeTick();
176176
ASSERT_EQ(NodeStatus::IDLE, action_1.status());
177177
ASSERT_EQ(NodeStatus::IDLE, action_42.status());
178178
ASSERT_EQ(NodeStatus::RUNNING, action_def.status());
179179
ASSERT_EQ(NodeStatus::RUNNING, state);
180180

181-
std::this_thread::sleep_for(milliseconds(110));
181+
std::this_thread::sleep_for(milliseconds(300));
182182
state = root->executeTick();
183183

184184
ASSERT_EQ(NodeStatus::IDLE, action_1.status());
@@ -198,14 +198,14 @@ TEST_F(SwitchTest, CaseSwitchToAction2)
198198
ASSERT_EQ(NodeStatus::RUNNING, state);
199199

200200
bb->set("my_var", "42");
201-
std::this_thread::sleep_for(milliseconds(10));
201+
std::this_thread::sleep_for(milliseconds(20));
202202
state = root->executeTick();
203203
ASSERT_EQ(NodeStatus::IDLE, action_1.status());
204204
ASSERT_EQ(NodeStatus::RUNNING, action_42.status());
205205
ASSERT_EQ(NodeStatus::IDLE, action_def.status());
206206
ASSERT_EQ(NodeStatus::RUNNING, state);
207207

208-
std::this_thread::sleep_for(milliseconds(110));
208+
std::this_thread::sleep_for(milliseconds(300));
209209
state = root->executeTick();
210210

211211
ASSERT_EQ(NodeStatus::IDLE, action_1.status());
@@ -226,7 +226,7 @@ TEST_F(SwitchTest, ActionFailure)
226226
ASSERT_EQ(NodeStatus::IDLE, action_def.status());
227227
ASSERT_EQ(NodeStatus::RUNNING, state);
228228

229-
std::this_thread::sleep_for(milliseconds(110));
229+
std::this_thread::sleep_for(milliseconds(300));
230230
state = root->executeTick();
231231

232232
ASSERT_EQ(NodeStatus::FAILURE, state);

Diff for: tests/gtest_wakeup.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ TEST(WakeUp, BasicTest)
2828
{
2929
static const char* xml_text = R"(
3030
31-
<root>
31+
<root BTCPP_format="4">
3232
<BehaviorTree ID="MainTree">
3333
<FastAction/>
3434
</BehaviorTree>

Diff for: tests/navigation_test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ using namespace BT;
77
// clang-format off
88
static const char* xml_text = R"(
99
10-
<root main_tree_to_execute="BehaviorTree">
10+
<root BTCPP_format="4" main_tree_to_execute="BehaviorTree">
1111
<BehaviorTree ID="BehaviorTree">
1212
<Fallback name="root">
1313

Diff for: tests/trees/child/child/child_child_no_include.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<root main_tree_to_execute = "ChildChildNoInclude">
1+
<root BTCPP_format="4" main_tree_to_execute = "ChildChildNoInclude">
22
<BehaviorTree ID="ChildChildNoInclude">
33
<AlwaysSuccess />
44
</BehaviorTree>

Diff for: tests/trees/child/child_include_child.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<root main_tree_to_execute = "ChildIncludeChild">
1+
<root BTCPP_format="4" main_tree_to_execute = "ChildIncludeChild">
22
<include path="child/child_child_no_include.xml" />
33

44
<BehaviorTree ID="ChildIncludeChild">

Diff for: tests/trees/child/child_include_parent.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<root main_tree_to_execute = "ChildIncludeParent">
1+
<root BTCPP_format="4" main_tree_to_execute = "ChildIncludeParent">
22
<include path="../parent_no_include.xml" />
33

44
<BehaviorTree ID="ChildIncludeParent">

Diff for: tests/trees/child/child_include_sibling.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<root main_tree_to_execute = "ChildIncludeSibling">
1+
<root BTCPP_format="4" main_tree_to_execute = "ChildIncludeSibling">
22
<include path="child_no_include.xml" />
33

44
<BehaviorTree ID="ChildIncludeSibling">

Diff for: tests/trees/child/child_no_include.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<root main_tree_to_execute = "ChildNoInclude">
1+
<root BTCPP_format="4" main_tree_to_execute = "ChildNoInclude">
22
<BehaviorTree ID="ChildNoInclude">
33
<AlwaysSuccess />
44
</BehaviorTree>

Diff for: tests/trees/parent_include_child.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<root main_tree_to_execute = "ParentIncludeChild">
1+
<root BTCPP_format="4" main_tree_to_execute = "ParentIncludeChild">
22
<include path="child/child_no_include.xml" />
33

44
<BehaviorTree ID="ParentIncludeChild">

Diff for: tests/trees/parent_include_child_include_child.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<root main_tree_to_execute = "ParentIncludeChildIncludeChild">
1+
<root BTCPP_format="4" main_tree_to_execute = "ParentIncludeChildIncludeChild">
22
<include path="child/child_include_child.xml" />
33

44
<BehaviorTree ID="ParentIncludeChildIncludeChild">

Diff for: tests/trees/parent_include_child_include_parent.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<root main_tree_to_execute = "ParentIncludeChildIncludeParent">
1+
<root BTCPP_format="4" main_tree_to_execute = "ParentIncludeChildIncludeParent">
22
<include path="child/child_include_parent.xml" />
33

44
<BehaviorTree ID="ParentIncludeChildIncludeParent">

Diff for: tests/trees/parent_include_child_include_sibling.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<root main_tree_to_execute = "ParentIncludeChildIncludeSibling">
1+
<root BTCPP_format="4" main_tree_to_execute = "ParentIncludeChildIncludeSibling">
22
<include path="child/child_include_sibling.xml" />
33

44
<BehaviorTree ID="ParentIncludeChildIncludeSibling">

Diff for: tests/trees/parent_no_include.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<root main_tree_to_execute = "ParentNoInclude">
1+
<root BTCPP_format="4" main_tree_to_execute = "ParentNoInclude">
22
<BehaviorTree ID="ParentNoInclude">
33
<AlwaysSuccess />
44
</BehaviorTree>

Diff for: tools/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.5)
22

3-
include_directories(${CMAKE_SOURCE_DIR}/3rdparty)
3+
include_directories(${PROJECT_SOURCE_DIR}/3rdparty)
44

55
add_executable(bt3_log_cat bt_log_cat.cpp )
66
target_link_libraries(bt3_log_cat ${BEHAVIOR_TREE_LIBRARY} )

Diff for: tools/bt_recorder.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ int main(int argc, char* argv[])
6262
zmq::message_t msg;
6363
try
6464
{
65-
subscriber.recv(update, zmq::recv_flags::none);
65+
auto ret = subscriber.recv(update, zmq::recv_flags::none);
66+
(void)ret;
6667
}
6768
catch (zmq::error_t& e)
6869
{

0 commit comments

Comments
 (0)