Add more RGBFIX tests

This commit is contained in:
Rangi
2025-09-30 17:18:58 -04:00
parent eea277ae9c
commit 85d3b5df58
28 changed files with 89 additions and 17 deletions

View File

@@ -92,14 +92,10 @@ static Usage usage = {
// clang-format on
static void parseByte(uint16_t &output, char name) {
if (musl_optarg[0] == '\0') {
fatal("Argument to option '-%c' may not be empty", name);
}
if (std::optional<uint64_t> value = parseWholeNumber(musl_optarg); !value) {
fatal("Expected number as argument to option '-%c', got \"%s\"", name, musl_optarg);
} else if (value > 0xFF) {
fatal("Argument to option '-%c' is larger than 255: %" PRIu64, name, *value);
fatal("Invalid argument for option '-%c'", name);
} else if (*value > 0xFF) {
fatal("Argument for option '-%c' must be between 0 and 0xFF", name);
} else {
output = *value;
}
@@ -117,9 +113,11 @@ static void initLogo() {
if (strcmp(options.logoFilename, "-")) {
logoFile = fopen(options.logoFilename, "rb");
} else {
// LCOV_EXCL_START
options.logoFilename = "<stdin>";
(void)setmode(STDIN_FILENO, O_BINARY);
logoFile = stdin;
// LCOV_EXCL_STOP
}
if (!logoFile) {
// LCOV_EXCL_START