MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / compressFiles

Method compressFiles

lib/QuaZip/qztest/testjlcompress.cpp:184–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184void TestJlCompress::compressFiles()
185{
186 QFETCH(QString, zipName);
187 QFETCH(QStringList, fileNames);
188 QDir curDir;
189 if (curDir.exists(zipName)) {
190 if (!curDir.remove(zipName))
191 QFAIL("Can't remove zip file");
192 }
193 if (!createTestFiles(fileNames)) {
194 QFAIL("Can't create test files");
195 }
196 QStringList realNamesList, shortNamesList;
197 foreach (QString fileName, fileNames) {
198 QString realName = "tmp/" + fileName;
199 realNamesList += realName;
200 shortNamesList += QFileInfo(realName).fileName();
201 }
202 QVERIFY(JlCompress::compressFiles(zipName, realNamesList));
203 // get the file list and check it
204 QStringList fileList = JlCompress::getFileList(zipName);
205 QCOMPARE(fileList, shortNamesList);
206 removeTestFiles(fileNames);
207 curDir.remove(zipName);
208}
209
210void TestJlCompress::compressDir_data()
211{

Callers

nothing calls this directly

Calls 4

createTestFilesFunction · 0.85
removeTestFilesFunction · 0.85
existsMethod · 0.80
removeMethod · 0.45

Tested by

no test coverage detected