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

Method renameTabs

test/editor_test.cpp:264–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264void EditorTest::renameTabs()
265{
266 QString file_xml = readFile(":/crossdoor_with_subtree.xml");
267 main_win->on_actionClear_triggered();
268 main_win->loadFromXML( file_xml );
269
270 testMessageBox(500, TEST_LOCATION(), [&]()
271 {
272 // Two tabs with same name would exist
273 main_win->onTabRenameRequested( 0 , "DoorClosed" );
274 });
275 testMessageBox(500, TEST_LOCATION(), [&]()
276 {
277 // Two tabs with same name would exist
278 main_win->onTabRenameRequested( 1 , "MainTree" );
279 });
280
281 main_win->onTabRenameRequested( 0 , "MainTree2" );
282 main_win->onTabRenameRequested( 1 , "DoorClosed2" );
283
284 QVERIFY( main_win->getTabByName("MainTree") == nullptr);
285 QVERIFY( main_win->getTabByName("DoorClosed") == nullptr);
286
287 QVERIFY( main_win->getTabByName("MainTree2") != nullptr);
288 QVERIFY( main_win->getTabByName("DoorClosed2") != nullptr);
289
290 sleepAndRefresh( 500 );
291}
292
293void EditorTest::testSubtree()
294{

Callers

nothing calls this directly

Calls 4

loadFromXMLMethod · 0.80
onTabRenameRequestedMethod · 0.80
getTabByNameMethod · 0.80

Tested by

no test coverage detected