From ff306d57f2217a878c6a700915a30dd574522a40 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Fri, 15 Mar 2019 15:55:29 +0100 Subject: Make use of QVERIFY_EXCEPTION_THROWN conditional, it is not available on Ubuntu Trusty. Signed-off-by: Pavel Pisa --- qtmips_machine/tests/testalu.cpp | 2 ++ qtmips_machine/tests/testregisters.cpp | 2 ++ 2 files changed, 4 insertions(+) (limited to 'qtmips_machine/tests') 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, ®s, 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() { -- cgit v1.2.3