@@ -125,7 +125,7 @@ struct ComplexFallbackWithMemoryTest : testing::Test
125
125
TEST_F (SimpleFallbackTest, ConditionTrue)
126
126
{
127
127
// Ticking the root node
128
- condition.setBoolean ( true );
128
+ condition.setExpectedResult (NodeStatus::SUCCESS );
129
129
BT::NodeStatus state = root.executeTick ();
130
130
131
131
ASSERT_EQ (NodeStatus::SUCCESS, state);
@@ -137,14 +137,14 @@ TEST_F(SimpleFallbackTest, ConditionChangeWhileRunning)
137
137
{
138
138
BT::NodeStatus state = BT::NodeStatus::IDLE;
139
139
140
- condition.setBoolean ( false );
140
+ condition.setExpectedResult (NodeStatus::FAILURE );
141
141
state = root.executeTick ();
142
142
143
143
ASSERT_EQ (NodeStatus::RUNNING, state);
144
144
ASSERT_EQ (NodeStatus::FAILURE, condition.status ());
145
145
ASSERT_EQ (NodeStatus::RUNNING, action.status ());
146
146
147
- condition.setBoolean ( true );
147
+ condition.setExpectedResult (NodeStatus::SUCCESS );
148
148
state = root.executeTick ();
149
149
150
150
ASSERT_EQ (NodeStatus::RUNNING, state);
@@ -154,8 +154,8 @@ TEST_F(SimpleFallbackTest, ConditionChangeWhileRunning)
154
154
155
155
TEST_F (ReactiveFallbackTest, Condition1ToTrue)
156
156
{
157
- condition_1.setBoolean ( false );
158
- condition_2.setBoolean ( false );
157
+ condition_1.setExpectedResult (NodeStatus::FAILURE );
158
+ condition_2.setExpectedResult (NodeStatus::FAILURE );
159
159
160
160
BT::NodeStatus state = root.executeTick ();
161
161
@@ -164,7 +164,7 @@ TEST_F(ReactiveFallbackTest, Condition1ToTrue)
164
164
ASSERT_EQ (NodeStatus::FAILURE, condition_2.status ());
165
165
ASSERT_EQ (NodeStatus::RUNNING, action_1.status ());
166
166
167
- condition_1.setBoolean ( true );
167
+ condition_1.setExpectedResult (NodeStatus::SUCCESS );
168
168
169
169
state = root.executeTick ();
170
170
@@ -176,8 +176,8 @@ TEST_F(ReactiveFallbackTest, Condition1ToTrue)
176
176
177
177
TEST_F (ReactiveFallbackTest, Condition2ToTrue)
178
178
{
179
- condition_1.setBoolean ( false );
180
- condition_2.setBoolean ( false );
179
+ condition_1.setExpectedResult (NodeStatus::FAILURE );
180
+ condition_2.setExpectedResult (NodeStatus::FAILURE );
181
181
182
182
BT::NodeStatus state = root.executeTick ();
183
183
@@ -186,7 +186,7 @@ TEST_F(ReactiveFallbackTest, Condition2ToTrue)
186
186
ASSERT_EQ (NodeStatus::FAILURE, condition_2.status ());
187
187
ASSERT_EQ (NodeStatus::RUNNING, action_1.status ());
188
188
189
- condition_2.setBoolean ( true );
189
+ condition_2.setExpectedResult (NodeStatus::SUCCESS );
190
190
191
191
state = root.executeTick ();
192
192
@@ -198,7 +198,7 @@ TEST_F(ReactiveFallbackTest, Condition2ToTrue)
198
198
199
199
TEST_F (SimpleFallbackWithMemoryTest, ConditionFalse)
200
200
{
201
- condition.setBoolean ( false );
201
+ condition.setExpectedResult (NodeStatus::FAILURE );
202
202
BT::NodeStatus state = root.executeTick ();
203
203
204
204
ASSERT_EQ (NodeStatus::RUNNING, state);
@@ -208,14 +208,14 @@ TEST_F(SimpleFallbackWithMemoryTest, ConditionFalse)
208
208
209
209
TEST_F (SimpleFallbackWithMemoryTest, ConditionTurnToTrue)
210
210
{
211
- condition.setBoolean ( false );
211
+ condition.setExpectedResult (NodeStatus::FAILURE );
212
212
BT::NodeStatus state = root.executeTick ();
213
213
214
214
ASSERT_EQ (NodeStatus::RUNNING, state);
215
215
ASSERT_EQ (NodeStatus::FAILURE, condition.status ());
216
216
ASSERT_EQ (NodeStatus::RUNNING, action.status ());
217
217
218
- condition.setBoolean ( true );
218
+ condition.setExpectedResult (NodeStatus::SUCCESS );
219
219
state = root.executeTick ();
220
220
221
221
ASSERT_EQ (NodeStatus::RUNNING, state);
@@ -238,7 +238,7 @@ TEST_F(ComplexFallbackWithMemoryTest, ConditionsTrue)
238
238
239
239
TEST_F (ComplexFallbackWithMemoryTest, Condition1False)
240
240
{
241
- condition_1.setBoolean ( false );
241
+ condition_1.setExpectedResult (NodeStatus::FAILURE );
242
242
BT::NodeStatus state = root.executeTick ();
243
243
244
244
ASSERT_EQ (NodeStatus::SUCCESS, state);
@@ -252,8 +252,8 @@ TEST_F(ComplexFallbackWithMemoryTest, Condition1False)
252
252
253
253
TEST_F (ComplexFallbackWithMemoryTest, ConditionsFalse)
254
254
{
255
- condition_1.setBoolean ( false );
256
- condition_2.setBoolean ( false );
255
+ condition_1.setExpectedResult (NodeStatus::FAILURE );
256
+ condition_2.setExpectedResult (NodeStatus::FAILURE );
257
257
BT::NodeStatus state = root.executeTick ();
258
258
259
259
ASSERT_EQ (NodeStatus::RUNNING, state);
@@ -267,11 +267,11 @@ TEST_F(ComplexFallbackWithMemoryTest, ConditionsFalse)
267
267
268
268
TEST_F (ComplexFallbackWithMemoryTest, Conditions1ToTrue)
269
269
{
270
- condition_1.setBoolean ( false );
271
- condition_2.setBoolean ( false );
270
+ condition_1.setExpectedResult (NodeStatus::FAILURE );
271
+ condition_2.setExpectedResult (NodeStatus::FAILURE );
272
272
BT::NodeStatus state = root.executeTick ();
273
273
274
- condition_1.setBoolean ( true );
274
+ condition_1.setExpectedResult (NodeStatus::SUCCESS );
275
275
state = root.executeTick ();
276
276
277
277
ASSERT_EQ (NodeStatus::RUNNING, state);
@@ -285,11 +285,11 @@ TEST_F(ComplexFallbackWithMemoryTest, Conditions1ToTrue)
285
285
286
286
TEST_F (ComplexFallbackWithMemoryTest, Conditions2ToTrue)
287
287
{
288
- condition_1.setBoolean ( false );
289
- condition_2.setBoolean ( false );
288
+ condition_1.setExpectedResult (NodeStatus::FAILURE );
289
+ condition_2.setExpectedResult (NodeStatus::FAILURE );
290
290
BT::NodeStatus state = root.executeTick ();
291
291
292
- condition_2.setBoolean ( true );
292
+ condition_2.setExpectedResult (NodeStatus::SUCCESS );
293
293
state = root.executeTick ();
294
294
295
295
ASSERT_EQ (NodeStatus::RUNNING, state);
@@ -303,10 +303,10 @@ TEST_F(ComplexFallbackWithMemoryTest, Conditions2ToTrue)
303
303
304
304
TEST_F (ComplexFallbackWithMemoryTest, Action1Failed)
305
305
{
306
- action_1.setBoolean ( false );
307
- action_2.setBoolean ( true );
308
- condition_1.setBoolean ( false );
309
- condition_2.setBoolean ( false );
306
+ action_1.setExpectedResult (NodeStatus::FAILURE );
307
+ action_2.setExpectedResult (NodeStatus::SUCCESS );
308
+ condition_1.setExpectedResult (NodeStatus::FAILURE );
309
+ condition_2.setExpectedResult (NodeStatus::FAILURE );
310
310
311
311
BT::NodeStatus state = root.executeTick ();
312
312
0 commit comments