mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Increase RGBASM test coverage
This commit is contained in:
@@ -337,7 +337,7 @@ bool fstk_FileError(std::string const &path, char const *functionName) {
|
||||
if (options.missingIncludeState == GEN_EXIT) {
|
||||
verbosePrint(
|
||||
VERB_NOTICE,
|
||||
"Aborting (-MG) on `%s` file \"%s\": %s\n",
|
||||
"Aborting due to '-MG' on `%s` file \"%s\": %s\n",
|
||||
functionName,
|
||||
path.c_str(),
|
||||
strerror(errno)
|
||||
|
||||
@@ -159,15 +159,10 @@ static void writeRpn(std::vector<uint8_t> &rpnexpr, std::vector<uint8_t> const &
|
||||
case RPN_SYM:
|
||||
// The symbol name is always written expanded
|
||||
sym = sym_FindExactSymbol(getSymName());
|
||||
if (sym->isConstant()) {
|
||||
rpnexpr[rpnptr++] = RPN_CONST;
|
||||
value = sym->getConstantValue();
|
||||
} else {
|
||||
rpnexpr[rpnptr++] = RPN_SYM;
|
||||
registerUnregisteredSymbol(*sym); // Ensure that `sym->ID` is set
|
||||
value = sym->ID;
|
||||
}
|
||||
registerUnregisteredSymbol(*sym); // Ensure that `sym->ID` is set
|
||||
value = sym->ID;
|
||||
|
||||
rpnexpr[rpnptr++] = RPN_SYM;
|
||||
rpnexpr[rpnptr++] = value & 0xFF;
|
||||
rpnexpr[rpnptr++] = value >> 8;
|
||||
rpnexpr[rpnptr++] = value >> 16;
|
||||
|
||||
@@ -351,11 +351,8 @@ uint32_t Symbol::getConstantValue() const {
|
||||
}
|
||||
|
||||
if (sym_IsPC(this)) {
|
||||
if (!getSection()) {
|
||||
error("PC has no value outside of a section");
|
||||
} else {
|
||||
error("PC does not have a constant value; the current section is not fixed");
|
||||
}
|
||||
assume(getSection()); // There's no way to reach here from outside of a section
|
||||
error("PC does not have a constant value; the current section is not fixed");
|
||||
} else {
|
||||
error("`%s` does not have a constant value", name.c_str());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user