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

Method testNodeTree_depth

tests/test_core.cpp:61–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59 }
60
61 void testNodeTree_depth() {
62 rcx::NodeTree tree;
63 rcx::Node a; a.kind = rcx::NodeKind::Struct; a.name = "A"; a.parentId = 0;
64 int ai = tree.addNode(a);
65 uint64_t aId = tree.nodes[ai].id;
66 rcx::Node b; b.kind = rcx::NodeKind::Struct; b.name = "B"; b.parentId = aId;
67 int bi = tree.addNode(b);
68 uint64_t bId = tree.nodes[bi].id;
69 rcx::Node c; c.kind = rcx::NodeKind::Hex8; c.name = "c"; c.parentId = bId;
70 tree.addNode(c);
71
72 QCOMPARE(tree.depthOf(0), 0);
73 QCOMPARE(tree.depthOf(1), 1);
74 QCOMPARE(tree.depthOf(2), 2);
75 }
76
77 void testNodeTree_computeOffset() {
78 rcx::NodeTree tree;

Callers

nothing calls this directly

Calls 2

depthOfMethod · 0.80
addNodeMethod · 0.45

Tested by

no test coverage detected