| 319 | // ── Insert struct at root then add children ── |
| 320 | |
| 321 | void testInsertStructAndChildren() { |
| 322 | int before = countNodes(); |
| 323 | |
| 324 | m_ctrl->insertNode(0, -1, NodeKind::Struct, "NewClass"); |
| 325 | QApplication::processEvents(); |
| 326 | QCOMPARE(countNodes(), before + 1); |
| 327 | |
| 328 | int structIdx = findNode("NewClass"); |
| 329 | QVERIFY(structIdx >= 0); |
| 330 | uint64_t structId = m_doc->tree.nodes[structIdx].id; |
| 331 | |
| 332 | m_ctrl->insertNode(structId, 0, NodeKind::Int32, "x"); |
| 333 | m_ctrl->insertNode(structId, -1, NodeKind::Int32, "y"); |
| 334 | QApplication::processEvents(); |
| 335 | QCOMPARE(countNodes(), before + 3); |
| 336 | |
| 337 | int xIdx = findNode("x"); |
| 338 | int yIdx = findNode("y"); |
| 339 | QVERIFY(xIdx >= 0); |
| 340 | QVERIFY(yIdx >= 0); |
| 341 | QCOMPARE(m_doc->tree.nodes[xIdx].parentId, structId); |
| 342 | QCOMPARE(m_doc->tree.nodes[yIdx].parentId, structId); |
| 343 | } |
| 344 | |
| 345 | // ── Batch remove deletes multiple nodes ── |
| 346 |
nothing calls this directly
no test coverage detected