Skip to content

Commit 87fd888

Browse files
author
Davide Faconti
committed
added unit test. Issue #7
1 parent face793 commit 87fd888

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

gtest/gtest_factory.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,27 @@ TEST(BehaviorTreeFactory, Subtree)
183183

184184
ASSERT_EQ(decorator->child()->name(), "IsDoorLocked");
185185
}
186+
187+
TEST(BehaviorTreeFactory, Issue7)
188+
{
189+
const std::string xml_text_issue = R"(
190+
<root>
191+
<BehaviorTree ID="ReceiveGuest">
192+
</BehaviorTree>
193+
</root> )";
194+
195+
BT::BehaviorTreeFactory factory;
196+
BT::XMLParser parser(factory);
197+
parser.loadFromText(xml_text_issue);
198+
199+
std::vector<std::string> errors;
200+
bool res = parser.verifyXML(errors);
201+
202+
for (const std::string& str : errors)
203+
{
204+
std::cout << str << std::endl;
205+
}
206+
207+
ASSERT_EQ(res, false);
208+
ASSERT_EQ(errors.size(), 1);
209+
}

0 commit comments

Comments
 (0)