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

Method testCollapsedStruct

tests/test_compose.cpp:155–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153 }
154
155 void testCollapsedStruct() {
156 NodeTree tree;
157 tree.baseAddress = 0;
158
159 Node root;
160 root.kind = NodeKind::Struct;
161 root.name = "Root";
162 root.parentId = 0;
163 root.collapsed = true;
164 int ri = tree.addNode(root);
165 uint64_t rootId = tree.nodes[ri].id;
166
167 Node f;
168 f.kind = NodeKind::Hex32;
169 f.name = "field";
170 f.parentId = rootId;
171 f.offset = 0;
172 tree.addNode(f);
173
174 NullProvider prov;
175 ComposeResult result = compose(tree, prov);
176
177 // Collapsed root: isRootHeader overrides collapse, so children + footer still render
178 // CommandRow + field + root footer = 3
179 QCOMPARE(result.meta.size(), 3);
180 QCOMPARE(result.meta[1].lineKind, LineKind::Field);
181 QCOMPARE(result.meta[1].depth, 1);
182 QCOMPARE(result.meta[2].lineKind, LineKind::Footer);
183 }
184
185 void testUnreadablePointerNoRead() {
186 // No ambient validation — neither M_ERR nor M_PTR0 set

Callers

nothing calls this directly

Calls 3

composeFunction · 0.85
addNodeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected