aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-03-15 15:55:29 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-03-15 15:55:29 +0100
commitff306d57f2217a878c6a700915a30dd574522a40 (patch)
tree83cf68959f8b48c0275b9503248e0ec181db9a85 /qtmips_machine
parent064c3f121452f05f6eb2e071b072be475f257818 (diff)
downloadqtmips-ff306d57f2217a878c6a700915a30dd574522a40.tar.gz
qtmips-ff306d57f2217a878c6a700915a30dd574522a40.tar.bz2
qtmips-ff306d57f2217a878c6a700915a30dd574522a40.zip
Make use of QVERIFY_EXCEPTION_THROWN conditional, it is not available on Ubuntu Trusty.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_machine')
-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() {