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

Function CreateAndTestZipWithFolder

libs/coding/coding_tests/zip_creator_test.cpp:52–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52void CreateAndTestZipWithFolder(std::vector<std::string> const & files, std::vector<std::string> const & filesInArchive,
53 std::string const & zipPath, CompressionLevel compression)
54{
55 TEST(CreateZipFromFiles(files, filesInArchive, zipPath, compression), ());
56
57 ZipFileReader::FileList fileList;
58 ZipFileReader::FilesList(zipPath, fileList);
59 std::string const unzippedFile = "unzipped.tmp";
60 for (size_t i = 0; i < files.size(); ++i)
61 {
62 TEST_EQUAL(fileList[i].second, FileReader(files[i]).Size(), ());
63
64 ZipFileReader::UnzipFile(zipPath, fileList[i].first, unzippedFile);
65
66 TEST(base::IsEqualFiles(files[i], unzippedFile), ());
67 TEST(base::DeleteFileX(unzippedFile), ());
68 }
69 TEST(base::DeleteFileX(zipPath), ());
70}
71
72std::vector<CompressionLevel> GetCompressionLevels()
73{

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