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:
Rangi
2025-08-19 15:26:23 -04:00
committed by GitHub
parent f7167d8115
commit 0c4c25b2d2
10 changed files with 140 additions and 42 deletions

View File

@@ -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;