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

Method testPrimitiveArrayCollapsed

tests/test_compose.cpp:1089–1121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1087 }
1088
1089 void testPrimitiveArrayCollapsed() {
1090 // Collapsed primitive array should show NO element lines
1091 NodeTree tree;
1092 tree.baseAddress = 0;
1093
1094 Node root;
1095 root.kind = NodeKind::Struct;
1096 root.name = "Root";
1097 root.parentId = 0;
1098 int ri = tree.addNode(root);
1099 uint64_t rootId = tree.nodes[ri].id;
1100
1101 Node arr;
1102 arr.kind = NodeKind::Array;
1103 arr.name = "data";
1104 arr.parentId = rootId;
1105 arr.offset = 0;
1106 arr.elementKind = NodeKind::UInt16;
1107 arr.arrayLen = 8;
1108 arr.collapsed = true;
1109 tree.addNode(arr);
1110
1111 NullProvider prov;
1112 ComposeResult result = compose(tree, prov);
1113
1114 // No field lines at depth >= 2 (no synthesized elements)
1115 int elemFields = 0;
1116 for (int i = 0; i < result.meta.size(); i++) {
1117 if (result.meta[i].lineKind == LineKind::Field && result.meta[i].depth >= 2)
1118 elemFields++;
1119 }
1120 QCOMPARE(elemFields, 0);
1121 }
1122
1123 void testStructArrayStillUsesChildren() {
1124 // Struct array with manual children should still render child nodes, not synthesize

Callers

nothing calls this directly

Calls 3

composeFunction · 0.85
addNodeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected