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

Method testSimpleStruct

tests/test_generator.cpp:51–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 // ── Basic struct generation ──
50
51 void testSimpleStruct() {
52 auto tree = makeSimpleStruct();
53 uint64_t rootId = tree.nodes[0].id;
54 QString result = rcx::renderCpp(tree, rootId);
55
56 // Header
57 QVERIFY(result.contains("#pragma once"));
58 QVERIFY(!result.contains("#include <cstdint>"));
59 QVERIFY(!result.contains("#pragma pack"));
60
61 // Struct definition
62 QVERIFY(result.contains("struct Player {"));
63 QVERIFY(result.contains("int32_t health;"));
64 QVERIFY(result.contains("float speed;"));
65 QVERIFY(result.contains("uint64_t id;"));
66 QVERIFY(result.contains("};"));
67
68 // static_assert - struct is 16 bytes (0+4 + 4+4 + 8+8 = 16)
69 QVERIFY(result.contains("static_assert(sizeof(Player) == 0x10"));
70 }
71
72 // ── Padding gap detection ──
73

Callers

nothing calls this directly

Calls 1

renderCppFunction · 0.85

Tested by

no test coverage detected