summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test-asm.cpp20
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);
}