mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Add a little more test coverage (#1805)
Format main.cpp files more consistently Add `make format` to run clang-format on everything
This commit is contained in:
@@ -139,18 +139,22 @@ std::optional<std::string> act_ReadFile(std::string const &name, uint32_t maxLen
|
||||
readSize = fileSize;
|
||||
}
|
||||
fseek(file, 0, SEEK_SET);
|
||||
// LCOV_EXCL_START
|
||||
} else if (errno != ESPIPE) {
|
||||
error(
|
||||
"Error determining size of `READFILE` file \"%s\": %s", name.c_str(), strerror(errno)
|
||||
);
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
std::string contents;
|
||||
contents.resize(readSize);
|
||||
|
||||
if (fread(&contents[0], 1, readSize, file) < readSize || ferror(file)) {
|
||||
// LCOV_EXCL_START
|
||||
error("Error reading `READFILE` file \"%s\": %s", name.c_str(), strerror(errno));
|
||||
return "";
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
return contents;
|
||||
|
||||
Reference in New Issue
Block a user