| 239 | } |
| 240 | |
| 241 | void testComputeOffsetCycle() { |
| 242 | rcx::NodeTree tree; |
| 243 | rcx::Node a; a.kind = rcx::NodeKind::Struct; a.name = "A"; a.parentId = 0; a.offset = 10; |
| 244 | int ai = tree.addNode(a); |
| 245 | uint64_t aId = tree.nodes[ai].id; |
| 246 | |
| 247 | rcx::Node b; b.kind = rcx::NodeKind::Struct; b.name = "B"; b.parentId = aId; b.offset = 20; |
| 248 | int bi = tree.addNode(b); |
| 249 | uint64_t bId = tree.nodes[bi].id; |
| 250 | |
| 251 | // Create cycle: A → B → A |
| 252 | tree.nodes[ai].parentId = bId; |
| 253 | tree.invalidateIdCache(); |
| 254 | |
| 255 | // Should not hang |
| 256 | int off = tree.computeOffset(ai); |
| 257 | Q_UNUSED(off); |
| 258 | QVERIFY(true); // reaching here means no hang |
| 259 | } |
| 260 | |
| 261 | void testProviderWrite() { |
| 262 | QByteArray data(16, '\0'); |
nothing calls this directly
no test coverage detected