MCPcopy Create free account
hub / github.com/cvut/qtrvsim / program_loader

Method program_loader

src/machine/programloader.test.cpp:15–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13const char *EXECUTABLE_NAME = "data";
14
15void TestProgramLoader::program_loader() {
16 if (not QFile::exists(EXECUTABLE_NAME)) {
17 QSKIP("Executable is not present, cannot test program loader.");
18 }
19
20 ProgramLoader pl(EXECUTABLE_NAME);
21 Memory m(BIG);
22 pl.to_memory(&m);
23
24 // addi $1, $0, 6
25 // QCOMPARE(Instruction(memory_read_u32(&m, PC_INIT)), Instruction(8, 0, 1, 6));
26 // j (8)0020000 (only 28 bits are used and they are logically shifted left
27 // by 2)
28 // QCOMPARE(Instruction(memory_read_u32(&m, PC_INIT + 4)), Instruction(2, Address(0x20000 >>
29 // 2)));
30 // TODO add some more code to data and do more compares (for example more
31 // sections)
32}
33
34QTEST_APPLESS_MAIN(TestProgramLoader)

Callers

nothing calls this directly

Calls 1

to_memoryMethod · 0.80

Tested by

no test coverage detected