| 1214 | void compareImagesPerPixel(PrintDiff& diff, InputStreams& streams); |
| 1215 | |
| 1216 | void read(InputStream& stream, std::size_t offset, void* readDst, std::size_t readSize, std::string_view what) { |
| 1217 | stream->seekg(offset); |
| 1218 | if (stream->fail()) |
| 1219 | fatal(rc::IO_FAILURE, "Failed to seek file to {} \"{}\": {}.", what, stream.str(), errnoMessage()); |
| 1220 | |
| 1221 | stream->read(reinterpret_cast<char*>(readDst), readSize); |
| 1222 | if (stream->eof()) { |
| 1223 | fatal(rc::IO_FAILURE, "Unexpected end of file reading {} from file \"{}\".", what, stream.str()); |
| 1224 | } else if (stream->fail()) { |
| 1225 | fatal(rc::IO_FAILURE, "Failed to read {} from file \"{}\": {}.", what, stream.str(), errnoMessage()); |
| 1226 | } |
| 1227 | } |
| 1228 | |
| 1229 | template <typename T> |
| 1230 | std::vector<T> read(InputStreams& streams, std::size_t offset, std::string_view what) { |
no test coverage detected