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

Method loadFailed

test/editor_test.cpp:133–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133void EditorTest::loadFailed()
134{
135 QString file_xml = readFile(":/crossdoor_with_subtree.xml");
136 main_win->on_actionClear_triggered();
137 main_win->loadFromXML( file_xml );
138
139 auto tree_A1 = getAbstractTree("MainTree");
140 auto tree_A2 = getAbstractTree("DoorClosed");
141
142 // try to load a bad one
143
144 file_xml = readFile(":/issue_3.xml");
145
146 testMessageBox(400, TEST_LOCATION(), [&]()
147 {
148 // should fail
149 main_win->loadFromXML( file_xml );
150 });
151
152 // nothing should change!
153
154 auto tree_B1 = getAbstractTree("MainTree");
155 auto tree_B2 = getAbstractTree("DoorClosed");
156 QVERIFY2( tree_A1 == tree_B1, "AbsBehaviorTree comparison fails" );
157 QVERIFY2( tree_A2 == tree_B2, "AbsBehaviorTree comparison fails" );
158}
159
160void EditorTest::undoRedo()
161{

Callers

nothing calls this directly

Calls 2

loadFromXMLMethod · 0.80

Tested by

no test coverage detected