Skip to content

Commit 85d3b5d

Browse files
committed
Add more RGBFIX tests
1 parent eea277a commit 85d3b5d

28 files changed

+89
-17
lines changed

src/fix/main.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,10 @@ static Usage usage = {
9292
// clang-format on
9393

9494
static void parseByte(uint16_t &output, char name) {
95-
if (musl_optarg[0] == '\0') {
96-
fatal("Argument to option '-%c' may not be empty", name);
97-
}
98-
9995
if (std::optional<uint64_t> value = parseWholeNumber(musl_optarg); !value) {
100-
fatal("Expected number as argument to option '-%c', got \"%s\"", name, musl_optarg);
101-
} else if (value > 0xFF) {
102-
fatal("Argument to option '-%c' is larger than 255: %" PRIu64, name, *value);
96+
fatal("Invalid argument for option '-%c'", name);
97+
} else if (*value > 0xFF) {
98+
fatal("Argument for option '-%c' must be between 0 and 0xFF", name);
10399
} else {
104100
output = *value;
105101
}
@@ -117,9 +113,11 @@ static void initLogo() {
117113
if (strcmp(options.logoFilename, "-")) {
118114
logoFile = fopen(options.logoFilename, "rb");
119115
} else {
116+
// LCOV_EXCL_START
120117
options.logoFilename = "<stdin>";
121118
(void)setmode(STDIN_FILENO, O_BINARY);
122119
logoFile = stdin;
120+
// LCOV_EXCL_STOP
123121
}
124122
if (!logoFile) {
125123
// LCOV_EXCL_START

test/fix/bad-custom-logo.1bpp

8 Bytes
Binary file not shown.

test/fix/bad-custom-logo.err

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FATAL: "bad-custom-logo.1bpp" is not 48 bytes

test/fix/bad-custom-logo.flags

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-L ./bad-custom-logo.1bpp

test/fix/deprecated-overwrite.bin

1.14 MB
Binary file not shown.

test/fix/deprecated-overwrite.err

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
warning: '-O' is deprecated; use '-Wno-overwrite' instead [-Wobsolete]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-O -v

test/fix/deprecated-overwrite.gb

1.14 MB
Binary file not shown.

test/fix/disable-warnings.bin

456 Bytes
Binary file not shown.

test/fix/disable-warnings.flags

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-w -m mbc3+ram -r 0
2+
The "-w" suppresses "-Wmbc" and "-Woverwrite" warnings

0 commit comments

Comments
 (0)