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

Method testExportToFile

tests/test_generator.cpp:570–590  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

568 // ── Export produces valid file content ──
569
570 void testExportToFile() {
571 auto tree = makeSimpleStruct();
572 uint64_t rootId = tree.nodes[0].id;
573 QString text = rcx::renderCpp(tree, rootId);
574
575 QTemporaryFile tmpFile;
576 tmpFile.setAutoRemove(true);
577 QVERIFY(tmpFile.open());
578 tmpFile.write(text.toUtf8());
579 tmpFile.close();
580
581 // Read back and verify
582 QVERIFY(tmpFile.open());
583 QByteArray readBack = tmpFile.readAll();
584 tmpFile.close();
585
586 QString readStr = QString::fromUtf8(readBack);
587 QVERIFY(readStr.contains("#pragma once"));
588 QVERIFY(readStr.contains("struct Player {"));
589 QVERIFY(readStr.contains("static_assert"));
590 }
591
592 // ── Full SDK with no structs (only primitives) ──
593

Callers

nothing calls this directly

Calls 2

renderCppFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected