File tree Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ TreeNodeModels ReadTreeNodesModel(const tinyxml2::XMLElement* root)
91
91
std::function<void (const XMLElement*)> recursiveStep;
92
92
recursiveStep = [&](const XMLElement* node)
93
93
{
94
- auto model = buildTreeNodeModel (node, true );
94
+ auto model = buildTreeNodeModel (node, false );
95
95
models.insert ( {model.registration_ID , model} );
96
96
97
97
for ( const XMLElement* child = node->FirstChildElement ();
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ private slots:
21
21
void modifyCustomModel ();
22
22
void multipleSubtrees ();
23
23
void editText ();
24
+ void loadModelLess ();
24
25
};
25
26
26
27
@@ -47,8 +48,6 @@ void EditorTest::loadFile()
47
48
48
49
QString saved_xml = main_win->saveToXML ();
49
50
50
- std::cout << saved_xml.toStdString () << std::endl;
51
-
52
51
QVERIFY2 ( file_xml.simplified () == saved_xml.simplified (),
53
52
" Loaded and saved XML are not the same" );
54
53
@@ -428,6 +427,24 @@ void EditorTest::editText()
428
427
sleepAndRefresh ( 500 );
429
428
}
430
429
430
+ void EditorTest::loadModelLess ()
431
+ {
432
+ QString file_xml = readFile (" ://simple_without_model.xml" );
433
+ main_win->on_actionClear_triggered ();
434
+ main_win->loadFromXML ( file_xml );
435
+
436
+ auto models = main_win->registeredModels ();
437
+
438
+ QVERIFY ( models.find (" moverobot" ) != models.end () );
439
+
440
+ const auto & moverobot_model = models.at (" moverobot" );
441
+
442
+ QCOMPARE ( moverobot_model.params .size (), size_t (1 ) );
443
+ QCOMPARE ( moverobot_model.params .front ().label , tr (" location" ) );
444
+ QCOMPARE ( moverobot_model.params .front ().value , tr (" 1" ) );
445
+
446
+ }
447
+
431
448
QTEST_MAIN (EditorTest)
432
449
433
450
#include " editor_test.moc"
Original file line number Diff line number Diff line change
1
+ <root main_tree_to_execute =" BehaviorTree" >
2
+
3
+ <BehaviorTree ID =" BehaviorTree" >
4
+ <SequenceStar >
5
+ <Action ID =" moverobot" location =" 1" />
6
+ </SequenceStar >
7
+ </BehaviorTree >
8
+
9
+ </root >
10
+
You can’t perform that action at this time.
0 commit comments