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

Method testComputeOffsetLarge

tests/test_core.cpp:281–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

279 }
280
281 void testComputeOffsetLarge() {
282 // Verify computeOffset returns int64_t that doesn't overflow
283 rcx::NodeTree tree;
284 rcx::Node root; root.kind = rcx::NodeKind::Struct; root.name = "R";
285 root.parentId = 0; root.offset = 0;
286 int ri = tree.addNode(root);
287 uint64_t rootId = tree.nodes[ri].id;
288
289 rcx::Node child; child.kind = rcx::NodeKind::Hex8; child.name = "f";
290 child.parentId = rootId; child.offset = 0x7FFFFFFF; // max int32
291 tree.addNode(child);
292
293 int64_t off = tree.computeOffset(1);
294 QCOMPARE(off, (int64_t)0x7FFFFFFF);
295 }
296
297 void testKindMetaCompleteness() {
298 // Every NodeKind enum value must have a KindMeta entry

Callers

nothing calls this directly

Calls 2

computeOffsetMethod · 0.80
addNodeMethod · 0.45

Tested by

no test coverage detected