MCPcopy Create free account
hub / github.com/BehaviorTree/Groot / multipleSubtrees

Method multipleSubtrees

test/editor_test.cpp:405–427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403}
404
405void EditorTest::multipleSubtrees()
406{
407 QString file_xml = readFile(":/test_subtrees_issue_8.xml");
408 main_win->on_actionClear_triggered();
409 main_win->loadFromXML( file_xml );
410
411 auto abs_tree = getAbstractTree("MainTree");
412
413 auto sequence_node = abs_tree.findFirstNode("main_sequence");
414 QVERIFY( sequence_node != nullptr );
415 QCOMPARE( sequence_node->children_index.size(), size_t(2) );
416
417 int index_1 = sequence_node->children_index[0];
418 int index_2 = sequence_node->children_index[1];
419
420 auto first_child = abs_tree.node(index_1);
421 auto second_child = abs_tree.node(index_2);
422
423 QCOMPARE( first_child->instance_name, tr("MoveToPredefinedPoint") );
424 QCOMPARE( second_child->instance_name, tr("SubtreeOne") );
425
426 sleepAndRefresh( 500 );
427}
428
429void EditorTest::editText()
430{

Callers

nothing calls this directly

Calls 4

loadFromXMLMethod · 0.80
findFirstNodeMethod · 0.80
nodeMethod · 0.80

Tested by

no test coverage detected