| 13 | const char *EXECUTABLE_NAME = "data"; |
| 14 | |
| 15 | void 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 | |
| 34 | QTEST_APPLESS_MAIN(TestProgramLoader) |