Skip to content

Commit 29be912

Browse files
committed
[ASM] Improve ValueParser test
1 parent 11e0db8 commit 29be912

13 files changed

+413
-369
lines changed

src/value_parser.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Value ValueParser::eval(
105105
const auto start = scan.skipSpaces();
106106
const auto value = _eval(scan, error, symtab, delim);
107107
if (scan.str() == start.str())
108-
error.setErrorIf(start, GARBAGE_AT_END);
108+
error.setErrorIf(start, NOT_AN_EXPECTED);
109109
return value;
110110
}
111111

test/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ endef
8484
$(eval $(foreach a,$(ARCHS),$(call test-rule,$(a))))
8585

8686
# make rule for testing expression.
87-
EXPRS = base motorola intel national fairchild zilog
87+
EXPRS = base fairchild intel motorola national zilog
8888
define test-expr # expr
8989
test_expr_$(1): test_expr_$(1).o $$(OBJS_expr) $$(OBJS_test)
9090
$$(CXX) -o $$@ $$(CXXFLAGS) $$^

test/test_asm_ins8060.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ static void test_error() {
290290
ERUS("LD (P3)", "P3)", 0xC0, 0x00);
291291
ERUS("LD (E)", "E)", 0xC0, 0x00);
292292
ERRT("LD 1(E)", UNKNOWN_OPERAND, "1(E)");
293-
ERRT("LDI #1", GARBAGE_AT_END, "#1");
293+
ERRT("LDI #1", NOT_AN_EXPECTED, "#1");
294294
ERRT("LD 1(P3 ;comment", MISSING_CLOSING_PAREN, " ;comment");
295295
}
296296

test/test_asm_ins8070.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,9 @@ static void test_undef() {
446446
}
447447

448448
static void test_error() {
449-
ERRT("LD A,@@1,P3", GARBAGE_AT_END, "@1,P3");
450-
ERRT("LD A,@#1", GARBAGE_AT_END, "#1");
451-
ERRT("LD A,@=1", GARBAGE_AT_END, "=1");
449+
ERRT("LD A,@@1,P3", NOT_AN_EXPECTED, "@1,P3");
450+
ERRT("LD A,@#1", NOT_AN_EXPECTED, "#1");
451+
ERRT("LD A,@=1", NOT_AN_EXPECTED, "=1");
452452
ERRT("LD A,1(P3)", MISSING_COMMA, "1(P3)"); // SC/MP style
453453
ERRT("LD A,@1(P3)", MISSING_COMMA, "@1(P3)"); // SC/MP style
454454
ERRT("LD A,1,EA", REGISTER_NOT_ALLOWED, "EA");

test/test_asm_tms7000.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -385,13 +385,13 @@ void test_error() {
385385
ERRT("CLR R000 ; comment", UNDEFINED_SYMBOL, "R000 ; comment", 0xD5, 0x00);
386386
ERRT("CLR R256 ; comment", UNDEFINED_SYMBOL, "R256 ; comment", 0xD5, 0x00);
387387
ERRT("CLR R ; comment", UNDEFINED_SYMBOL, "R ; comment", 0xD5, 0x00);
388-
ERRT("CLR > D6 ; comment", GARBAGE_AT_END, "> D6 ; comment");
388+
ERRT("CLR > D6 ; comment", NOT_AN_EXPECTED, "> D6 ; comment");
389389

390390
ERRT("ANDP A, P132X", OPERAND_NOT_ALLOWED, "A, P132X");
391391
ERRT("ANDP A, P000", OPERAND_NOT_ALLOWED, "A, P000");
392392
ERRT("ANDP A, P256", OPERAND_NOT_ALLOWED, "A, P256");
393393
ERRT("ANDP A, P", OPERAND_NOT_ALLOWED, "A, P");
394-
ERRT("ANDP A, > 184", GARBAGE_AT_END, "> 184");
394+
ERRT("ANDP A, > 184", NOT_AN_EXPECTED, "> 184");
395395

396396
ERRT("MOVD %>A9AA(A), R171", REGISTER_NOT_ALLOWED, "A), R171");
397397
ERRT("MOVD %>A9AA(R3), R171", REGISTER_NOT_ALLOWED, "R3), R171");

0 commit comments

Comments
 (0)