MCPcopy Create free account
hub / github.com/IChooseYou/Reclass / testBatchRemove

Method testBatchRemove

tests/test_context_menu.cpp:347–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345 // ── Batch remove deletes multiple nodes ──
346
347 void testBatchRemove() {
348 int healthIdx = findNode("health");
349 int armorIdx = findNode("armor");
350 QVERIFY(healthIdx >= 0);
351 QVERIFY(armorIdx >= 0);
352 int before = countNodes();
353
354 m_ctrl->batchRemoveNodes({healthIdx, armorIdx});
355 QApplication::processEvents();
356 QCOMPARE(countNodes(), before - 2);
357 QCOMPARE(findNode("health"), -1);
358 QCOMPARE(findNode("armor"), -1);
359
360 // Undo restores both
361 m_doc->undoStack.undo();
362 QApplication::processEvents();
363 QCOMPARE(countNodes(), before);
364 QVERIFY(findNode("health") >= 0);
365 QVERIFY(findNode("armor") >= 0);
366 }
367
368 // ── Insert with invalid parent still works (root-level) ──
369

Callers

nothing calls this directly

Calls 3

findNodeFunction · 0.85
batchRemoveNodesMethod · 0.80
undoMethod · 0.45

Tested by

no test coverage detected