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

Method testStableNodeIds

tests/test_core.cpp:145–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143 }
144
145 void testStableNodeIds() {
146 rcx::NodeTree tree;
147 rcx::Node a; a.kind = rcx::NodeKind::Struct; a.name = "A"; a.parentId = 0;
148 int ai = tree.addNode(a);
149 QCOMPARE(tree.nodes[ai].id, (uint64_t)1);
150
151 rcx::Node b; b.kind = rcx::NodeKind::Hex32; b.name = "B"; b.parentId = tree.nodes[ai].id;
152 int bi = tree.addNode(b);
153 QCOMPARE(tree.nodes[bi].id, (uint64_t)2);
154
155 QCOMPARE(tree.indexOfId(1), 0);
156 QCOMPARE(tree.indexOfId(2), 1);
157 QCOMPARE(tree.indexOfId(99), -1);
158 }
159
160 void testByteSizeDynamic() {
161 rcx::Node n;

Callers

nothing calls this directly

Calls 2

indexOfIdMethod · 0.80
addNodeMethod · 0.45

Tested by

no test coverage detected