aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-02 16:57:42 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-02 16:57:42 +0100
commitd82cd16b55e57420a9df2fd5da5402d4701a9091 (patch)
treee67847e3cae5d616bd2c399b82cea5cc50cd4ec6 /qtmips_machine
parentb1f0e4fcc83c7692f4b066fcc026d77a051c1d7d (diff)
downloadqtmips-d82cd16b55e57420a9df2fd5da5402d4701a9091.tar.gz
qtmips-d82cd16b55e57420a9df2fd5da5402d4701a9091.tar.bz2
qtmips-d82cd16b55e57420a9df2fd5da5402d4701a9091.zip
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 <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_machine')
-rw-r--r--qtmips_machine/tests/testalu.cpp2
1 files changed, 1 insertions, 1 deletions
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 \