| 172 | } |
| 173 | |
| 174 | void testSubtreeCycleSafe() { |
| 175 | rcx::NodeTree tree; |
| 176 | rcx::Node a; a.kind = rcx::NodeKind::Struct; a.name = "A"; a.parentId = 0; |
| 177 | int ai = tree.addNode(a); |
| 178 | uint64_t aId = tree.nodes[ai].id; |
| 179 | |
| 180 | // Create a child that points back to A's id as parent — not a cycle per se, |
| 181 | // but test that subtree collection terminates |
| 182 | rcx::Node b; b.kind = rcx::NodeKind::Hex8; b.name = "B"; b.parentId = aId; |
| 183 | tree.addNode(b); |
| 184 | |
| 185 | // Should return both nodes without hanging |
| 186 | auto sub = tree.subtreeIndices(aId); |
| 187 | QCOMPARE(sub.size(), 2); |
| 188 | QVERIFY(sub.contains(0)); |
| 189 | QVERIFY(sub.contains(1)); |
| 190 | } |
| 191 | |
| 192 | void testIsReadableOverflow() { |
| 193 | QByteArray data(16, '\0'); |
nothing calls this directly
no test coverage detected