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

Method makeTwoRootTree

tests/test_new_features.cpp:47–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45 }
46
47 NodeTree makeTwoRootTree() {
48 NodeTree tree;
49 tree.baseAddress = 0;
50
51 // Root struct A
52 Node a;
53 a.kind = NodeKind::Struct;
54 a.name = "Alpha";
55 a.structTypeName = "Alpha";
56 a.parentId = 0;
57 a.offset = 0;
58 int ai = tree.addNode(a);
59 uint64_t aId = tree.nodes[ai].id;
60
61 Node af;
62 af.kind = NodeKind::UInt32;
63 af.name = "flagsA";
64 af.parentId = aId;
65 af.offset = 0;
66 tree.addNode(af);
67
68 // Root struct B
69 Node b;
70 b.kind = NodeKind::Struct;
71 b.name = "Bravo";
72 b.structTypeName = "Bravo";
73 b.parentId = 0;
74 b.offset = 0x100;
75 int bi = tree.addNode(b);
76 uint64_t bId = tree.nodes[bi].id;
77
78 Node bf;
79 bf.kind = NodeKind::UInt64;
80 bf.name = "flagsB";
81 bf.parentId = bId;
82 bf.offset = 0;
83 tree.addNode(bf);
84
85 return tree;
86 }
87
88 NodeTree makeRichTree() {
89 NodeTree tree;

Callers

nothing calls this directly

Calls 1

addNodeMethod · 0.45

Tested by

no test coverage detected