Skip to content

Commit 77848cb

Browse files
author
Davide Faconti
committed
fix unit test
1 parent c1acda0 commit 77848cb

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/controls/reactive_fallback.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ namespace BT
1818
NodeStatus ReactiveFallback::tick()
1919
{
2020
size_t failure_count = 0;
21-
size_t running_count = 0;
2221

2322
for (size_t index = 0; index < childrenCount(); index++)
2423
{
@@ -29,7 +28,7 @@ NodeStatus ReactiveFallback::tick()
2928
{
3029
case NodeStatus::RUNNING:
3130
{
32-
haltChildren(0);
31+
haltChildren(index+1);
3332
return NodeStatus::RUNNING;
3433
}
3534

tests/gtest_fallback.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ struct SimpleFallbackTest : testing::Test
3838
}
3939
};
4040

41-
struct ParallelOneTest : testing::Test
41+
struct ReactiveFallbackTest : testing::Test
4242
{
4343
BT::ReactiveFallback root;
4444
BT::ConditionTestNode condition_1;
4545
BT::ConditionTestNode condition_2;
4646
BT::AsyncActionTest action_1;
4747

48-
ParallelOneTest()
48+
ReactiveFallbackTest()
4949
: root("root_first")
5050
, condition_1("condition_1")
5151
, condition_2("condition_2")
@@ -55,7 +55,7 @@ struct ParallelOneTest : testing::Test
5555
root.addChild(&condition_2);
5656
root.addChild(&action_1);
5757
}
58-
~ParallelOneTest()
58+
~ReactiveFallbackTest()
5959
{
6060
haltAllActions(&root);
6161
}
@@ -152,7 +152,7 @@ TEST_F(SimpleFallbackTest, ConditionChangeWhileRunning)
152152
ASSERT_EQ(NodeStatus::RUNNING, action.status());
153153
}
154154

155-
TEST_F(ParallelOneTest, Condition1ToTrue)
155+
TEST_F(ReactiveFallbackTest, Condition1ToTrue)
156156
{
157157
condition_1.setBoolean(false);
158158
condition_2.setBoolean(false);
@@ -174,7 +174,7 @@ TEST_F(ParallelOneTest, Condition1ToTrue)
174174
ASSERT_EQ(NodeStatus::IDLE, action_1.status());
175175
}
176176

177-
TEST_F(ParallelOneTest, Condition2ToTrue)
177+
TEST_F(ReactiveFallbackTest, Condition2ToTrue)
178178
{
179179
condition_1.setBoolean(false);
180180
condition_2.setBoolean(false);

0 commit comments

Comments
 (0)