| 131 | } |
| 132 | |
| 133 | void 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 | |
| 160 | void EditorTest::undoRedo() |
| 161 | { |
nothing calls this directly
no test coverage detected