aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/tests
diff options
context:
space:
mode:
Diffstat (limited to 'qtmips_machine/tests')
-rw-r--r--qtmips_machine/tests/testalu.cpp2
-rw-r--r--qtmips_machine/tests/testregisters.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/qtmips_machine/tests/testalu.cpp b/qtmips_machine/tests/testalu.cpp
index 4edd92a..02dc065 100644
--- a/qtmips_machine/tests/testalu.cpp
+++ b/qtmips_machine/tests/testalu.cpp
@@ -313,7 +313,9 @@ void MachineTests::alu_except() {
QFETCH(std::uint32_t, t);
Registers regs;
+#ifdef QVERIFY_EXCEPTION_THROWN
// Only runtime exception is expected as any other exception is a bug
QVERIFY_EXCEPTION_THROWN(alu_operate((enum AluOp)op, s , t, 0, 0, &regs, discard, excause),
QtMipsExceptionRuntime);
+#endif
}
diff --git a/qtmips_machine/tests/testregisters.cpp b/qtmips_machine/tests/testregisters.cpp
index 2e62c56..5cffe1e 100644
--- a/qtmips_machine/tests/testregisters.cpp
+++ b/qtmips_machine/tests/testregisters.cpp
@@ -71,8 +71,10 @@ void MachineTests::registers_pc() {
QCOMPARE(r.pc_jmp(0xC), (unsigned)0x8002000C);
r.pc_abs_jmp(0x80020100);
QCOMPARE(r.read_pc(), (unsigned)0x80020100);
+#ifdef QVERIFY_EXCEPTION_THROWN
QVERIFY_EXCEPTION_THROWN(r.pc_jmp(0x1), QtMipsExceptionUnalignedJump);
QVERIFY_EXCEPTION_THROWN(r.pc_abs_jmp(0x80020101), QtMipsExceptionUnalignedJump);
+#endif
}
void MachineTests::registers_compare() {