Commit aececa3
authored
test: round-trip decompressZip check in CompressManySmallFilesToZip (#5958)
* test: round-trip decompressZip check in CompressManySmallFilesToZip
After compressing the generated 20 .bin + 20 .json source files to
many.zip, also decompress the archive into a fresh temp folder and
verify every original file is recovered byte-for-byte. The existing
size-envelope check only proves the zip is present and not pathological;
a byte-level round-trip compare catches the kinds of regressions that
have shown up on this path before (wrong compression method byte on an
entry, CRC-vs-data mismatch, off-by-one in a local file header, entry
truncation) and would otherwise require a real reader -- 7-Zip / Python
zipfile -- to detect.
The loop walks srcFolder recursively, mirrors each regular file's
relative path into the decompressed tree, asserts presence and size
parity, then byte-compares content. The final EXPECT confirms all
numBinaryFiles + numJsonFiles entries (default 40) were actually seen.
No changes to the sphere test -- it checks a single .mrmesh file that
MeshLib's own loader already round-trips in other tests.
* test: iterate with DirectoryRecursive instead of std::filesystem iterator
Match the style already used in MRZip.cpp. Unlike the std library's
recursive_directory_iterator, MRMesh's DirectoryRecursive accepts an
error_code at construction and saves errors into it rather than
throwing, so the loop cannot raise std::filesystem_error on a
transient permission glitch, a removed file, etc.
No behavioural change for the happy path; same iteration order, same
directory_entry values, same is_regular_file / relative calls.1 parent 775f1fc commit aececa3
1 file changed
Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
197 | 242 | | |
198 | 243 | | |
199 | 244 | | |
0 commit comments