/** * @dataProvider setupData */ void KArchiveTest::testTarReadWrite() { QFETCH(QString, fileName); // testCreateTar must have been run first. KTar tar(fileName); QVERIFY(tar.open(QIODevice::ReadWrite)); testReadWrite(&tar); testFileData(&tar); QVERIFY(tar.close()); // Reopen it and check it { KTar tar(fileName); QVERIFY(tar.open(QIODevice::ReadOnly)); testFileData( &tar ); const KArchiveDirectory* dir = tar.directory(); const KArchiveEntry* e = dir->entry("newfile"); QVERIFY(e && e->isFile()); const KArchiveFile* f = (KArchiveFile*)e; QCOMPARE(f->data().size(), 8); } // NOTE This is the last test for this dataset. so cleanup here QFile::remove(fileName); }
void KArchiveTest::testZipFileData() { // testCreateZip must have been run first. KZip zip(s_zipFileName); QVERIFY(zip.open( QIODevice::ReadOnly)); testFileData(&zip); QVERIFY(zip.close()); }
/** * @dataProvider setupData */ void KArchiveTest::testTarFileData() { QFETCH(QString, fileName); // testCreateTar must have been run first. KTar tar(fileName); QVERIFY(tar.open(QIODevice::ReadOnly)); testFileData(&tar); QVERIFY(tar.close()); }
/** * @dataProvider setupData */ void KArchiveTest::test7ZipFileData() { QFETCH(QString, fileName); // testCreate7Zip must have been run first. K7Zip k7zip(fileName); QVERIFY(k7zip.open(QIODevice::ReadOnly)); testFileData(&k7zip); QVERIFY(k7zip.close()); }