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

Method testInsertAddsOneNode

tests/test_context_menu.cpp:91–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89 // ── Insert adds exactly one node ──
90
91 void testInsertAddsOneNode() {
92 int before = countNodes();
93 uint64_t rootId = m_doc->tree.nodes[0].id;
94 m_ctrl->insertNode(rootId, 16, NodeKind::Hex64, "inserted");
95 QApplication::processEvents();
96
97 QCOMPARE(countNodes(), before + 1);
98
99 int idx = findNode("inserted");
100 QVERIFY(idx >= 0);
101 QCOMPARE(m_doc->tree.nodes[idx].kind, NodeKind::Hex64);
102 QCOMPARE(m_doc->tree.nodes[idx].offset, 16);
103 QCOMPARE(m_doc->tree.nodes[idx].parentId, rootId);
104 }
105
106 // ── Insert at auto-offset places after last sibling ──
107

Callers

nothing calls this directly

Calls 2

findNodeFunction · 0.85
insertNodeMethod · 0.80

Tested by

no test coverage detected