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

Method testStringTypes

tests/test_generator.cpp:389–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387 // ── String types ──
388
389 void testStringTypes() {
390 rcx::NodeTree tree;
391 rcx::Node root;
392 root.kind = rcx::NodeKind::Struct;
393 root.name = "Strings";
394 root.structTypeName = "Strings";
395 root.parentId = 0;
396 int ri = tree.addNode(root);
397 uint64_t rootId = tree.nodes[ri].id;
398
399 rcx::Node utf8;
400 utf8.kind = rcx::NodeKind::UTF8;
401 utf8.name = "name";
402 utf8.parentId = rootId;
403 utf8.offset = 0;
404 utf8.strLen = 64;
405 tree.addNode(utf8);
406
407 rcx::Node utf16;
408 utf16.kind = rcx::NodeKind::UTF16;
409 utf16.name = "wname";
410 utf16.parentId = rootId;
411 utf16.offset = 64;
412 utf16.strLen = 32;
413 tree.addNode(utf16);
414
415 QString result = rcx::renderCpp(tree, rootId);
416
417 QVERIFY(result.contains("char name[64];"));
418 QVERIFY(result.contains("wchar_t wname[32];"));
419 }
420
421 // ── Padding node ──
422

Callers

nothing calls this directly

Calls 2

renderCppFunction · 0.85
addNodeMethod · 0.45

Tested by

no test coverage detected