| 305 | } |
| 306 | |
| 307 | void TestQuaZip::testQIODeviceAPI() |
| 308 | { |
| 309 | QString zipName = "qiodevice_api.zip"; |
| 310 | QStringList fileNames; |
| 311 | fileNames << "test.txt"; |
| 312 | QDir curDir; |
| 313 | if (curDir.exists(zipName)) { |
| 314 | if (!curDir.remove(zipName)) |
| 315 | QFAIL("Can't remove zip file"); |
| 316 | } |
| 317 | if (!createTestFiles(fileNames)) { |
| 318 | QFAIL("Can't create test file"); |
| 319 | } |
| 320 | if (!createTestArchive(zipName, fileNames)) { |
| 321 | QFAIL("Can't create test archive"); |
| 322 | } |
| 323 | QBuffer buffer; |
| 324 | if (!createTestArchive(&buffer, fileNames, NULL)) { |
| 325 | QFAIL("Can't create test archive"); |
| 326 | } |
| 327 | QFile diskFile(zipName); |
| 328 | QVERIFY(diskFile.open(QIODevice::ReadOnly)); |
| 329 | QByteArray bufferArray = buffer.buffer(); |
| 330 | QByteArray fileArray = diskFile.readAll(); |
| 331 | diskFile.close(); |
| 332 | QCOMPARE(bufferArray.size(), fileArray.size()); |
| 333 | QCOMPARE(bufferArray, fileArray); |
| 334 | curDir.remove(zipName); |
| 335 | } |
| 336 | |
| 337 | void TestQuaZip::setZipName() |
| 338 | { |
nothing calls this directly
no test coverage detected