Skip to content

Commit 0f26b68

Browse files
committed
Code formatted
1 parent 9858e91 commit 0f26b68

File tree

2 files changed

+32
-35
lines changed

2 files changed

+32
-35
lines changed

src/xml_parsing.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,8 @@ void BT::XMLParser::PImpl::recursivelyCreateSubtree(const std::string& tree_ID,
940940
// check for recursion in behavior tree
941941
if(prefix.find(subtree_ID) != std::string::npos)
942942
{
943-
auto msg = StrCat("Recursive behavior trees are not supported. A cycle was found in ",
943+
auto msg = StrCat("Recursive behavior trees are not supported. A cycle was found "
944+
"in ",
944945
"<Subtree ID=\"", subtree_ID, "\"> with prefix: ", prefix);
945946
throw RuntimeError(msg);
946947
}

tests/gtest_subtree.cpp

Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -732,16 +732,14 @@ TEST(SubTree, RecursiveSubtree)
732732
// clang-format off
733733

734734
static const char* xml_text = R"(
735-
<root BTCPP_format="4" >
736-
737-
<BehaviorTree ID="MainTree">
738-
<Sequence name="root">
739-
<AlwaysSuccess/>
740-
<SubTree ID="MainTree" />
741-
</Sequence>
742-
</BehaviorTree>
743-
744-
</root>
735+
<root BTCPP_format="4" >
736+
<BehaviorTree ID="MainTree">
737+
<Sequence name="root">
738+
<AlwaysSuccess/>
739+
<SubTree ID="MainTree" />
740+
</Sequence>
741+
</BehaviorTree>
742+
</root>
745743
)";
746744

747745
// clang-format on
@@ -757,29 +755,28 @@ TEST(SubTree, RecursiveCycle)
757755
// clang-format off
758756

759757
static const char* xml_text = R"(
760-
<root BTCPP_format="4" main_tree_to_execute="MainTree">
761-
762-
<BehaviorTree ID="MainTree">
763-
<Sequence name="root">
764-
<AlwaysSuccess/>
765-
<SubTree ID="TreeA" />
766-
</Sequence>
767-
</BehaviorTree>
768-
769-
<BehaviorTree ID="TreeA">
770-
<Sequence name="root">
771-
<AlwaysSuccess/>
772-
<SubTree ID="TreeB" />
773-
</Sequence>
774-
</BehaviorTree>
775-
776-
<BehaviorTree ID="TreeB">
777-
<Sequence name="root">
778-
<AlwaysSuccess/>
779-
<SubTree ID="MainTree" />
780-
</Sequence>
781-
</BehaviorTree>
782-
</root>
758+
<root BTCPP_format="4" main_tree_to_execute="MainTree">
759+
<BehaviorTree ID="MainTree">
760+
<Sequence name="root">
761+
<AlwaysSuccess/>
762+
<SubTree ID="TreeA" />
763+
</Sequence>
764+
</BehaviorTree>
765+
766+
<BehaviorTree ID="TreeA">
767+
<Sequence name="root">
768+
<AlwaysSuccess/>
769+
<SubTree ID="TreeB" />
770+
</Sequence>
771+
</BehaviorTree>
772+
773+
<BehaviorTree ID="TreeB">
774+
<Sequence name="root">
775+
<AlwaysSuccess/>
776+
<SubTree ID="MainTree" />
777+
</Sequence>
778+
</BehaviorTree>
779+
</root>
783780
)";
784781

785782
// clang-format on
@@ -789,4 +786,3 @@ TEST(SubTree, RecursiveCycle)
789786

790787
ASSERT_ANY_THROW(auto tree = factory.createTreeFromText(xml_text));
791788
}
792-

0 commit comments

Comments
 (0)