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

Method testExcessiveUndos

tests/test_validation.cpp:1136–1156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1134 // ── Multiple undos past the beginning don't crash ──
1135
1136 void testExcessiveUndos() {
1137 int idx = findNode(m_doc->tree, "field_u32");
1138 QVERIFY(idx >= 0);
1139
1140 m_ctrl->setNodeValue(idx, 0, "42");
1141 QApplication::processEvents();
1142 QCOMPARE(m_doc->undoStack.count(), 1);
1143
1144 // Undo once (valid)
1145 m_doc->undoStack.undo();
1146 // Undo 50 more times (all no-ops, should not crash)
1147 for (int i = 0; i < 50; i++)
1148 m_doc->undoStack.undo();
1149 QApplication::processEvents();
1150
1151 // Redo 50 times past the end
1152 m_doc->undoStack.redo();
1153 for (int i = 0; i < 50; i++)
1154 m_doc->undoStack.redo();
1155 QApplication::processEvents();
1156 }
1157};
1158
1159QTEST_MAIN(TestValidationController)

Callers

nothing calls this directly

Calls 4

findNodeFunction · 0.85
setNodeValueMethod · 0.80
undoMethod · 0.45
redoMethod · 0.45

Tested by

no test coverage detected