mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Add more RGBLINK tests (#1639)
This commit is contained in:
@@ -239,7 +239,7 @@ static void readPatch(
|
|||||||
tryReadLong(
|
tryReadLong(
|
||||||
nodeID,
|
nodeID,
|
||||||
file,
|
file,
|
||||||
"%s: Unable to read \"%s\"'s patch #%" PRIu32 "'s node ID: %s",
|
"%s: Cannot read \"%s\"'s patch #%" PRIu32 "'s node ID: %s",
|
||||||
fileName,
|
fileName,
|
||||||
sectName.c_str(),
|
sectName.c_str(),
|
||||||
i
|
i
|
||||||
@@ -248,7 +248,7 @@ static void readPatch(
|
|||||||
tryReadLong(
|
tryReadLong(
|
||||||
patch.lineNo,
|
patch.lineNo,
|
||||||
file,
|
file,
|
||||||
"%s: Unable to read \"%s\"'s patch #%" PRIu32 "'s line number: %s",
|
"%s: Cannot read \"%s\"'s patch #%" PRIu32 "'s line number: %s",
|
||||||
fileName,
|
fileName,
|
||||||
sectName.c_str(),
|
sectName.c_str(),
|
||||||
i
|
i
|
||||||
@@ -256,7 +256,7 @@ static void readPatch(
|
|||||||
tryReadLong(
|
tryReadLong(
|
||||||
patch.offset,
|
patch.offset,
|
||||||
file,
|
file,
|
||||||
"%s: Unable to read \"%s\"'s patch #%" PRIu32 "'s offset: %s",
|
"%s: Cannot read \"%s\"'s patch #%" PRIu32 "'s offset: %s",
|
||||||
fileName,
|
fileName,
|
||||||
sectName.c_str(),
|
sectName.c_str(),
|
||||||
i
|
i
|
||||||
@@ -264,7 +264,7 @@ static void readPatch(
|
|||||||
tryReadLong(
|
tryReadLong(
|
||||||
patch.pcSectionID,
|
patch.pcSectionID,
|
||||||
file,
|
file,
|
||||||
"%s: Unable to read \"%s\"'s patch #%" PRIu32 "'s PC offset: %s",
|
"%s: Cannot read \"%s\"'s patch #%" PRIu32 "'s PC offset: %s",
|
||||||
fileName,
|
fileName,
|
||||||
sectName.c_str(),
|
sectName.c_str(),
|
||||||
i
|
i
|
||||||
@@ -272,7 +272,7 @@ static void readPatch(
|
|||||||
tryReadLong(
|
tryReadLong(
|
||||||
patch.pcOffset,
|
patch.pcOffset,
|
||||||
file,
|
file,
|
||||||
"%s: Unable to read \"%s\"'s patch #%" PRIu32 "'s PC offset: %s",
|
"%s: Cannot read \"%s\"'s patch #%" PRIu32 "'s PC offset: %s",
|
||||||
fileName,
|
fileName,
|
||||||
sectName.c_str(),
|
sectName.c_str(),
|
||||||
i
|
i
|
||||||
@@ -281,7 +281,7 @@ static void readPatch(
|
|||||||
PatchType,
|
PatchType,
|
||||||
type,
|
type,
|
||||||
file,
|
file,
|
||||||
"%s: Unable to read \"%s\"'s patch #%" PRIu32 "'s type: %s",
|
"%s: Cannot read \"%s\"'s patch #%" PRIu32 "'s type: %s",
|
||||||
fileName,
|
fileName,
|
||||||
sectName.c_str(),
|
sectName.c_str(),
|
||||||
i
|
i
|
||||||
@@ -290,7 +290,7 @@ static void readPatch(
|
|||||||
tryReadLong(
|
tryReadLong(
|
||||||
rpnSize,
|
rpnSize,
|
||||||
file,
|
file,
|
||||||
"%s: Unable to read \"%s\"'s patch #%" PRIu32 "'s RPN size: %s",
|
"%s: Cannot read \"%s\"'s patch #%" PRIu32 "'s RPN size: %s",
|
||||||
fileName,
|
fileName,
|
||||||
sectName.c_str(),
|
sectName.c_str(),
|
||||||
i
|
i
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ static void doSanityChecks(Section §ion) {
|
|||||||
error(
|
error(
|
||||||
nullptr,
|
nullptr,
|
||||||
0,
|
0,
|
||||||
"%s: ROMX sections must be in bank 1 (if any) with option -t",
|
"Section \"%s\" has type ROMX, which must be in bank 1 (if any) with option `-t`",
|
||||||
section.name.c_str()
|
section.name.c_str()
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -270,7 +270,7 @@ static void doSanityChecks(Section §ion) {
|
|||||||
error(
|
error(
|
||||||
nullptr,
|
nullptr,
|
||||||
0,
|
0,
|
||||||
"%s: WRAMX sections must be in bank 1 with options -w or -d",
|
"Section \"%s\" has type WRAMX, which must be in bank 1 with options `-w` or `-d`",
|
||||||
section.name.c_str()
|
section.name.c_str()
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -278,7 +278,12 @@ static void doSanityChecks(Section §ion) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isDmgMode && section.type == SECTTYPE_VRAM && section.bank == 1) {
|
if (isDmgMode && section.type == SECTTYPE_VRAM && section.bank == 1) {
|
||||||
error(nullptr, 0, "%s: VRAM bank 1 can't be used with option -d", section.name.c_str());
|
error(
|
||||||
|
nullptr,
|
||||||
|
0,
|
||||||
|
"Section \"%s\" has type VRAM, which must be in bank 0 with option `-d`",
|
||||||
|
section.name.c_str()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if alignment is reasonable, this is important to avoid UB
|
// Check if alignment is reasonable, this is important to avoid UB
|
||||||
@@ -292,7 +297,7 @@ static void doSanityChecks(Section §ion) {
|
|||||||
error(
|
error(
|
||||||
nullptr,
|
nullptr,
|
||||||
0,
|
0,
|
||||||
"%s: %s sections cannot be aligned to $%04x bytes",
|
"Section \"%s\" has type %s, which cannot be aligned to $%04x bytes",
|
||||||
section.name.c_str(),
|
section.name.c_str(),
|
||||||
sectionTypeInfo[section.type].name.c_str(),
|
sectionTypeInfo[section.type].name.c_str(),
|
||||||
section.alignMask + 1
|
section.alignMask + 1
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
error: test: ROMX sections must be in bank 1 (if any) with option -t
|
error: Section "test" has type ROMX, which must be in bank 1 (if any) with option `-t`
|
||||||
Linking failed with 1 error
|
Linking failed with 1 error
|
||||||
|
|||||||
3
test/link/invalid-ram-types-d.out
Normal file
3
test/link/invalid-ram-types-d.out
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
error: Section "test1" has type WRAMX, which must be in bank 1 with options `-w` or `-d`
|
||||||
|
error: Section "test2" has type VRAM, which must be in bank 0 with option `-d`
|
||||||
|
Linking failed with 2 errors
|
||||||
5
test/link/invalid-ram-types.asm
Normal file
5
test/link/invalid-ram-types.asm
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
SECTION "test1", WRAMX, BANK[2]
|
||||||
|
db
|
||||||
|
|
||||||
|
SECTION "test2", VRAM, BANK[1]
|
||||||
|
db
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
error: v1: VRAM bank 1 can't be used with option -d
|
error: Section "v1" has type VRAM, which must be in bank 0 with option `-d`
|
||||||
Linking failed with 1 error
|
Linking failed with 1 error
|
||||||
|
|||||||
Reference in New Issue
Block a user