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

Method testUnreadablePointerNoRead

tests/test_compose.cpp:185–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183 }
184
185 void testUnreadablePointerNoRead() {
186 // No ambient validation — neither M_ERR nor M_PTR0 set
187 NodeTree tree;
188 tree.baseAddress = 0;
189
190 Node root;
191 root.kind = NodeKind::Struct;
192 root.name = "R";
193 root.parentId = 0;
194 int ri = tree.addNode(root);
195 uint64_t rootId = tree.nodes[ri].id;
196
197 Node ptr;
198 ptr.kind = NodeKind::Pointer64;
199 ptr.name = "ptr";
200 ptr.parentId = rootId;
201 ptr.offset = 0;
202 tree.addNode(ptr);
203
204 // Provider with only 4 bytes — not enough for Pointer64 (8 bytes)
205 QByteArray data(4, '\0');
206 BufferProvider prov(data);
207 ComposeResult result = compose(tree, prov);
208
209 // CommandRow + ptr + root footer = 3
210 QCOMPARE(result.meta.size(), 3);
211 // No ambient validation markers
212 QVERIFY(!(result.meta[1].markerMask & (1u << M_ERR)));
213 QVERIFY(!(result.meta[1].markerMask & (1u << M_PTR0)));
214 QCOMPARE(result.meta[1].depth, 1);
215
216 // Line 2 is root footer
217 QCOMPARE(result.meta[2].lineKind, LineKind::Footer);
218 }
219
220 void testFoldLevels() {
221 NodeTree tree;

Callers

nothing calls this directly

Calls 3

composeFunction · 0.85
addNodeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected