MCPcopy Create free account
hub / github.com/comaps/comaps / CreateAndTestZip

Function CreateAndTestZip

libs/coding/coding_tests/zip_creator_test.cpp:16–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14namespace
15{
16void CreateAndTestZip(std::string const & filePath, std::string const & zipPath)
17{
18 TEST(CreateZipFromFiles({filePath}, zipPath, CompressionLevel::DefaultCompression), ());
19
20 ZipFileReader::FileList files;
21 ZipFileReader::FilesList(zipPath, files);
22 TEST_EQUAL(files[0].second, FileReader(filePath).Size(), ());
23
24 std::string const unzippedFile = "unzipped.tmp";
25 ZipFileReader::UnzipFile(zipPath, files[0].first, unzippedFile);
26
27 TEST(base::IsEqualFiles(filePath, unzippedFile), ());
28 TEST(base::DeleteFileX(filePath), ());
29 TEST(base::DeleteFileX(zipPath), ());
30 TEST(base::DeleteFileX(unzippedFile), ());
31}
32
33void CreateAndTestZip(std::vector<std::string> const & files, std::string const & zipPath, CompressionLevel compression)
34{

Callers 1

UNIT_TESTFunction · 0.85

Calls 7

TESTFunction · 0.85
CreateZipFromFilesFunction · 0.85
IsEqualFilesFunction · 0.85
DeleteFileXFunction · 0.85
FileReaderClass · 0.50
SizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected