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

Method testDuplicateAddsOneNode

tests/test_context_menu.cpp:123–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121 // ── Duplicate creates exactly one copy ──
122
123 void testDuplicateAddsOneNode() {
124 int flagsIdx = findNode("flags");
125 QVERIFY(flagsIdx >= 0);
126 int before = countNodes();
127
128 m_ctrl->duplicateNode(flagsIdx);
129 QApplication::processEvents();
130
131 QCOMPARE(countNodes(), before + 1);
132
133 int copyIdx = findNode("flags_copy");
134 QVERIFY2(copyIdx >= 0, "Expected a node named 'flags_copy'");
135 QCOMPARE(m_doc->tree.nodes[copyIdx].kind, NodeKind::Hex32);
136 QCOMPARE(m_doc->tree.nodes[copyIdx].offset, 16); // flags(12) + 4 = 16
137 }
138
139 // ── Duplicate preserves original node unchanged ──
140

Callers

nothing calls this directly

Calls 2

findNodeFunction · 0.85
duplicateNodeMethod · 0.80

Tested by

no test coverage detected