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

Function makeSmallBuffer

tests/test_controller.cpp:44–59  ·  view source on GitHub ↗

64-byte buffer with recognizable pattern

Source from the content-addressed store, hash-verified

42
43// 64-byte buffer with recognizable pattern
44static QByteArray makeSmallBuffer() {
45 QByteArray data(64, '\0');
46 // field_u32 at offset 0 = 0xDEADBEEF
47 uint32_t v32 = 0xDEADBEEF;
48 memcpy(data.data() + 0, &v32, 4);
49 // field_float at offset 4 = 3.14f
50 float vf = 3.14f;
51 memcpy(data.data() + 4, &vf, 4);
52 // field_u8 at offset 8 = 0x42
53 data[8] = 0x42;
54 // pad0 at offset 9 = 0x00 0x00 0x00
55 // field_hex at offset 12 = 0xCAFEBABE
56 uint32_t vhex = 0xCAFEBABE;
57 memcpy(data.data() + 12, &vhex, 4);
58 return data;
59}
60
61class TestController : public QObject {
62 Q_OBJECT

Callers 1

initMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected