| 182 | } |
| 183 | |
| 184 | void 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 | |
| 210 | void TestJlCompress::compressDir_data() |
| 211 | { |
nothing calls this directly
no test coverage detected