| 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 |
nothing calls this directly
no test coverage detected