From d82cd16b55e57420a9df2fd5da5402d4701a9091 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Sat, 2 Feb 2019 16:57:42 +0100 Subject: Correct ALU test for SUB exception. The operation 3 - 4 = 1 is legal integer arithmetic operation. Changed to 0x80000003 - 4 = 0x7fffffff 2147483651 - 4 = 2147483647 which overflows. Signed-off-by: Pavel Pisa --- qtmips_machine/tests/testalu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qtmips_machine') diff --git a/qtmips_machine/tests/testalu.cpp b/qtmips_machine/tests/testalu.cpp index a701b64..819837f 100644 --- a/qtmips_machine/tests/testalu.cpp +++ b/qtmips_machine/tests/testalu.cpp @@ -202,7 +202,7 @@ void MachineTests::alu_except_data() { << (std::uint32_t)0x8fffffff \ << (std::uint32_t)0x90000000; QTest::newRow("SUB") << (std::uint8_t)ALU_OP_SUB \ - << (std::uint32_t)3 \ + << (std::uint32_t)0x80000003 \ << (std::uint32_t)4; // Just test that we can throw unsupported ALU operation QTest::newRow("?") << (std::uint8_t)ALU_OP_LAST \ -- cgit v1.2.3