1
1
#include < gtest/gtest.h>
2
+ #include < gmock/gmock.h>
2
3
#include < filesystem>
3
4
#include < string>
4
5
#include < utility>
@@ -83,7 +84,7 @@ static const char* xml_text_subtree_part1 = R"(
83
84
<BehaviorTree ID="MainTree">
84
85
<Fallback name="root_selector">
85
86
<SubTree ID="DoorClosedSubtree" />
86
- <Action ID="PassThroughWindow " />
87
+ <Action ID="PassThroughDoor " />
87
88
</Fallback>
88
89
</BehaviorTree>
89
90
</root> )" ;
@@ -94,11 +95,10 @@ static const char* xml_text_subtree_part2 = R"(
94
95
<BehaviorTree ID="DoorClosedSubtree">
95
96
<Sequence name="door_sequence">
96
97
<Decorator ID="Inverter">
97
- <Action ID="IsDoorLocked " />
98
+ <Action ID="IsDoorClosed " />
98
99
</Decorator>
99
100
<Action ID="OpenDoor" />
100
101
<Action ID="PassThroughDoor" />
101
- <Action ID="CloseDoor" />
102
102
</Sequence>
103
103
</BehaviorTree>
104
104
</root> )" ;
@@ -259,7 +259,7 @@ TEST(BehaviorTreeFactory, SubtreeParsingError)
259
259
catch (const BT::RuntimeError& e)
260
260
{
261
261
std::string error_msg = e.what ();
262
- EXPECT_TRUE (error_msg. find (" line 36 " ) != std::string::npos );
262
+ EXPECT_THAT (error_msg, :: testing::HasSubstr (" line 11 " ) );
263
263
}
264
264
try
265
265
{
@@ -269,7 +269,7 @@ TEST(BehaviorTreeFactory, SubtreeParsingError)
269
269
catch (const BT::RuntimeError& e)
270
270
{
271
271
std::string error_msg = e.what ();
272
- EXPECT_TRUE (error_msg. find (" line 7 " ) != std::string::npos );
272
+ EXPECT_THAT (error_msg, :: testing::HasSubstr (" line 5 " ) );
273
273
}
274
274
}
275
275
0 commit comments