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

Method testNullPointerMarker

tests/test_compose.cpp:122–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120 }
121
122 void testNullPointerMarker() {
123 NodeTree tree;
124 tree.baseAddress = 0;
125
126 Node root;
127 root.kind = NodeKind::Struct;
128 root.name = "R";
129 root.parentId = 0;
130 int ri = tree.addNode(root);
131 uint64_t rootId = tree.nodes[ri].id;
132
133 Node ptr;
134 ptr.kind = NodeKind::Pointer64;
135 ptr.name = "ptr";
136 ptr.parentId = rootId;
137 ptr.offset = 0;
138 tree.addNode(ptr);
139
140 // Provider with zeros (null ptr)
141 QByteArray data(64, '\0');
142 BufferProvider prov(data);
143 ComposeResult result = compose(tree, prov);
144
145 // CommandRow + ptr + root footer = 3
146 QCOMPARE(result.meta.size(), 3);
147 // No ambient validation markers — M_PTR0 is no longer set
148 QVERIFY(!(result.meta[1].markerMask & (1u << M_PTR0)));
149 QCOMPARE(result.meta[1].depth, 1);
150
151 // Line 2 is root footer
152 QCOMPARE(result.meta[2].lineKind, LineKind::Footer);
153 }
154
155 void testCollapsedStruct() {
156 NodeTree tree;

Callers

nothing calls this directly

Calls 3

composeFunction · 0.85
addNodeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected