mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 10:42:07 +00:00
Add more test coverage
This commit is contained in:
@@ -47,7 +47,9 @@ void act_Elif(int32_t condition) {
|
||||
if (lexer_ReachedELSEBlock()) {
|
||||
fatal("Found `ELIF` after an `ELSE` block");
|
||||
}
|
||||
lexer_SetMode(LEXER_SKIP_TO_ENDC);
|
||||
// This should be redundant, as the lexer will have skipped to `ENDC` since
|
||||
// an `ELIF` after a taken `IF` needs to not evaluate its condition.
|
||||
lexer_SetMode(LEXER_SKIP_TO_ENDC); // LCOV_EXCL_LINE
|
||||
} else if (condition) {
|
||||
lexer_RunIFBlock();
|
||||
} else {
|
||||
@@ -61,7 +63,8 @@ void act_Else() {
|
||||
}
|
||||
if (lexer_RanIFBlock()) {
|
||||
if (lexer_ReachedELSEBlock()) {
|
||||
fatal("Found `ELSE` after an `ELSE` block");
|
||||
// This should be redundant, as the lexer handles this error first.
|
||||
fatal("Found `ELSE` after an `ELSE` block"); // LCOV_EXCL_LINE
|
||||
}
|
||||
lexer_SetMode(LEXER_SKIP_TO_ENDC);
|
||||
} else {
|
||||
|
||||
@@ -406,13 +406,16 @@ static Section *getSection(
|
||||
bank = sectionTypeInfo[type].firstBank;
|
||||
}
|
||||
|
||||
// This should be redundant, as the parser guarantees that `AlignmentSpec` will be valid.
|
||||
if (alignOffset >= alignSize) {
|
||||
// LCOV_EXCL_START
|
||||
error(
|
||||
"Alignment offset (%" PRIu16 ") must be smaller than alignment size (%" PRIu32 ")",
|
||||
alignOffset,
|
||||
alignSize
|
||||
);
|
||||
alignOffset = 0;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
if (org != UINT32_MAX) {
|
||||
|
||||
Reference in New Issue
Block a user