diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-11-20 10:59:18 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-11-20 10:59:18 +0100 |
commit | 7250bbe5ae2d2ee6b0334bc462aab73f7d8dac0e (patch) | |
tree | b910e778baa3e2434215abbb50e45e64aa92970c /tests | |
parent | 05faf77202d0f8762160f135e714961d2c456cca (diff) |
Assembler bugfixes - tests run successfully now
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-asm.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/test-asm.cpp b/tests/test-asm.cpp index f4a1a2c..019f89c 100644 --- a/tests/test-asm.cpp +++ b/tests/test-asm.cpp @@ -178,22 +178,34 @@ TEST_F(AsmParseTest, parse_op_3) { } TEST_F(AsmParseTest, parse_op_4) { - std::vector<std::shared_ptr<Chunk>> chunks4{parseAsm("add [edi], 3")}; + std::vector<std::shared_ptr<Chunk>> chunks4{parseAsm("add [rdi], 3")}; ASSERT_EQ(chunks4.size(), 1); } +TEST_F(AsmParseTest, parse_op_4_error) { + ASSERT_THROW(parseAsm("add [edi], 3"), std::runtime_error); +} + TEST_F(AsmParseTest, parse_op_5) { - std::vector<std::shared_ptr<Chunk>> chunks5{parseAsm("add byte ptr [edi], 3")}; + std::vector<std::shared_ptr<Chunk>> chunks5{parseAsm("add byte ptr [rdi], 3")}; ASSERT_EQ(chunks5.size(), 1); } +TEST_F(AsmParseTest, parse_op_5_error) { + ASSERT_THROW(parseAsm("add byte ptr [edi], 3"), std::runtime_error); +} + TEST_F(AsmParseTest, parse_op_6) { - std::vector<std::shared_ptr<Chunk>> chunks6{parseAsm("add dword ptr[edi], 3")}; + std::vector<std::shared_ptr<Chunk>> chunks6{parseAsm("add dword ptr[rdi], 3")}; ASSERT_EQ(chunks6.size(), 1); } +TEST_F(AsmParseTest, parse_op_6_error) { + ASSERT_THROW(parseAsm("add dword ptr[al], 3"), std::runtime_error); +} + TEST_F(AsmParseTest, parse_op_7) { - std::vector<std::shared_ptr<Chunk>> chunks7{parseAsm("add qword ptr[edi], 3")}; + std::vector<std::shared_ptr<Chunk>> chunks7{parseAsm("add qword ptr[rdi], 3")}; ASSERT_EQ(chunks7.size(), 1); } |