| 369 | } |
| 370 | |
| 371 | void TestQuaZipFile::getFileInfo() |
| 372 | { |
| 373 | QuaZipFileInfo info32; |
| 374 | QuaZipFileInfo64 info64; |
| 375 | QString testFileName = "testZipName.txt"; |
| 376 | QStringList testFiles; |
| 377 | testFiles << testFileName; |
| 378 | QString testZipName = "testZipName.zip"; |
| 379 | QVERIFY(createTestFiles(testFiles)); |
| 380 | QVERIFY(createTestArchive(testZipName, testFiles)); |
| 381 | QuaZipFile testFile; |
| 382 | testFile.setZipName(testZipName); |
| 383 | testFile.setFileName(testFileName); |
| 384 | QVERIFY(testFile.open(QIODevice::ReadOnly)); |
| 385 | QVERIFY(testFile.getFileInfo(&info32)); |
| 386 | QVERIFY(testFile.getFileInfo(&info64)); |
| 387 | QCOMPARE(info32.name, info64.name); |
| 388 | QCOMPARE(info32.versionCreated, info64.versionCreated); |
| 389 | QCOMPARE(info32.versionNeeded, info64.versionNeeded); |
| 390 | QCOMPARE(info32.flags, info64.flags); |
| 391 | QCOMPARE(info32.method, info64.method); |
| 392 | QCOMPARE(info32.dateTime, info64.dateTime); |
| 393 | QCOMPARE(info32.crc, info64.crc); |
| 394 | QCOMPARE(info32.compressedSize, |
| 395 | static_cast<quint32>(info64.compressedSize)); |
| 396 | QCOMPARE(info32.uncompressedSize, |
| 397 | static_cast<quint32>(info64.uncompressedSize)); |
| 398 | QCOMPARE(info32.diskNumberStart, info64.diskNumberStart); |
| 399 | QCOMPARE(info32.internalAttr, info64.internalAttr); |
| 400 | QCOMPARE(info32.externalAttr, info64.externalAttr); |
| 401 | QCOMPARE(info32.comment, info64.comment); |
| 402 | QCOMPARE(info32.extra, info64.extra); |
| 403 | testFile.close(); |
| 404 | removeTestFiles(testFiles); |
| 405 | QDir curDir; |
| 406 | curDir.remove(testZipName); |
| 407 | } |
| 408 | |
| 409 | void TestQuaZipFile::setFileName() |
| 410 | { |
no test coverage detected