| 33 | } |
| 34 | |
| 35 | void testNodeTree_addAndChildren() { |
| 36 | rcx::NodeTree tree; |
| 37 | rcx::Node root; |
| 38 | root.kind = rcx::NodeKind::Struct; |
| 39 | root.name = "Root"; |
| 40 | root.parentId = 0; |
| 41 | int ri = tree.addNode(root); |
| 42 | QCOMPARE(ri, 0); |
| 43 | uint64_t rootId = tree.nodes[ri].id; |
| 44 | |
| 45 | rcx::Node child; |
| 46 | child.kind = rcx::NodeKind::Hex32; |
| 47 | child.name = "field"; |
| 48 | child.parentId = rootId; |
| 49 | child.offset = 0; |
| 50 | tree.addNode(child); |
| 51 | |
| 52 | auto children = tree.childrenOf(rootId); |
| 53 | QCOMPARE(children.size(), 1); |
| 54 | QCOMPARE(children[0], 1); |
| 55 | |
| 56 | auto roots = tree.childrenOf(0); |
| 57 | QCOMPARE(roots.size(), 1); |
| 58 | QCOMPARE(roots[0], 0); |
| 59 | } |
| 60 | |
| 61 | void testNodeTree_depth() { |
| 62 | rcx::NodeTree tree; |
nothing calls this directly
no test coverage detected