| 50 | } |
| 51 | |
| 52 | void TestJlCompress::compressFile() |
| 53 | { |
| 54 | QFETCH(QString, zipName); |
| 55 | QFETCH(QString, fileName); |
| 56 | QDir curDir; |
| 57 | if (curDir.exists(zipName)) { |
| 58 | if (!curDir.remove(zipName)) |
| 59 | QFAIL("Can't remove zip file"); |
| 60 | } |
| 61 | if (!createTestFiles(QStringList() << fileName)) { |
| 62 | QFAIL("Can't create test file"); |
| 63 | } |
| 64 | QVERIFY(JlCompress::compressFile(zipName, "tmp/" + fileName)); |
| 65 | // get the file list and check it |
| 66 | QStringList fileList = JlCompress::getFileList(zipName); |
| 67 | QCOMPARE(fileList.count(), 1); |
| 68 | QVERIFY(fileList[0] == fileName); |
| 69 | // now test the QIODevice* overload of getFileList() |
| 70 | QFile zipFile(zipName); |
| 71 | QVERIFY(zipFile.open(QIODevice::ReadOnly)); |
| 72 | fileList = JlCompress::getFileList(zipName); |
| 73 | QCOMPARE(fileList.count(), 1); |
| 74 | QVERIFY(fileList[0] == fileName); |
| 75 | zipFile.close(); |
| 76 | removeTestFiles(QStringList() << fileName); |
| 77 | curDir.remove(zipName); |
| 78 | } |
| 79 | |
| 80 | void TestJlCompress::compressFileOptions_data() |
| 81 | { |
nothing calls this directly
no test coverage detected