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

Method testChangeNodeKind

tests/test_controller.cpp:226–243  ·  view source on GitHub ↗

── Test: changeNodeKind changes type and undo restores ──

Source from the content-addressed store, hash-verified

224
225 // ── Test: changeNodeKind changes type and undo restores ──
226 void testChangeNodeKind() {
227 int idx = -1;
228 for (int i = 0; i < m_doc->tree.nodes.size(); i++) {
229 if (m_doc->tree.nodes[i].name == "field_u32") { idx = i; break; }
230 }
231 QVERIFY(idx >= 0);
232 QCOMPARE(m_doc->tree.nodes[idx].kind, NodeKind::UInt32);
233
234 m_ctrl->changeNodeKind(idx, NodeKind::Float);
235 QApplication::processEvents();
236
237 QCOMPARE(m_doc->tree.nodes[idx].kind, NodeKind::Float);
238
239 // Undo
240 m_doc->undoStack.undo();
241 QApplication::processEvents();
242 QCOMPARE(m_doc->tree.nodes[idx].kind, NodeKind::UInt32);
243 }
244
245 // ── Test: insertNode adds a node, removeNode removes it, undo restores ──
246 void testInsertAndRemoveNode() {

Callers

nothing calls this directly

Calls 3

changeNodeKindMethod · 0.80
sizeMethod · 0.45
undoMethod · 0.45

Tested by

no test coverage detected