11#include < gtest/gtest.h>
2+ #include < gmock/gmock.h>
23#include < filesystem>
34#include < string>
45#include < utility>
@@ -83,7 +84,7 @@ static const char* xml_text_subtree_part1 = R"(
8384 <BehaviorTree ID="MainTree">
8485 <Fallback name="root_selector">
8586 <SubTree ID="DoorClosedSubtree" />
86- <Action ID="PassThroughWindow " />
87+ <Action ID="PassThroughDoor " />
8788 </Fallback>
8889 </BehaviorTree>
8990</root> )" ;
@@ -94,11 +95,10 @@ static const char* xml_text_subtree_part2 = R"(
9495 <BehaviorTree ID="DoorClosedSubtree">
9596 <Sequence name="door_sequence">
9697 <Decorator ID="Inverter">
97- <Action ID="IsDoorLocked " />
98+ <Action ID="IsDoorClosed " />
9899 </Decorator>
99100 <Action ID="OpenDoor" />
100101 <Action ID="PassThroughDoor" />
101- <Action ID="CloseDoor" />
102102 </Sequence>
103103 </BehaviorTree>
104104</root> )" ;
@@ -259,7 +259,7 @@ TEST(BehaviorTreeFactory, SubtreeParsingError)
259259 catch (const BT::RuntimeError& e)
260260 {
261261 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 36" ));
263263 }
264264 try
265265 {
@@ -269,7 +269,7 @@ TEST(BehaviorTreeFactory, SubtreeParsingError)
269269 catch (const BT::RuntimeError& e)
270270 {
271271 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 7" ));
273273 }
274274}
275275
0 commit comments