| 23 | #include <dlib/zip.h> |
| 24 | |
| 25 | static bool ReadFile(const char* relative_path, std::string* out) |
| 26 | { |
| 27 | char path[1024]; |
| 28 | dmTestUtil::MakeHostPath(path, sizeof(path), relative_path); |
| 29 | |
| 30 | FILE* file = fopen(path, "rb"); |
| 31 | if (file == 0) |
| 32 | return false; |
| 33 | |
| 34 | fseek(file, 0, SEEK_END); |
| 35 | long file_size = ftell(file); |
| 36 | fseek(file, 0, SEEK_SET); |
| 37 | |
| 38 | out->resize(file_size > 0 ? (size_t)file_size : 0); |
| 39 | size_t read = 0; |
| 40 | if (file_size > 0) |
| 41 | read = fread(&(*out)[0], 1, out->size(), file); |
| 42 | |
| 43 | fclose(file); |
| 44 | return read == out->size(); |
| 45 | } |
| 46 | |
| 47 | static const char* ExpectedNames[] = { |
| 48 | "dir/", |
no test coverage detected