MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / atEnd

Method atEnd

lib/QuaZip/qztest/testquazipfile.cpp:241–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241void TestQuaZipFile::atEnd()
242{
243 QFETCH(QString, zipName);
244 QFETCH(QStringList, fileNames);
245 QFETCH(int, size);
246 QDir curDir;
247 if (!createTestFiles(fileNames, size)) {
248 QFAIL("Couldn't create test files");
249 }
250 if (!JlCompress::compressDir(zipName, "tmp")) {
251 QFAIL("Couldn't create test archive");
252 }
253 QuaZip testZip(zipName);
254 QVERIFY(testZip.open(QuaZip::mdUnzip));
255 foreach (QString fileName, fileNames) {
256 QFileInfo fileInfo("tmp/" + fileName);
257 QVERIFY(testZip.setCurrentFile(fileName));
258 QuaZipFile zipFile(&testZip);
259 QVERIFY(zipFile.open(QIODevice::ReadOnly));
260 QCOMPARE(zipFile.atEnd(), false);
261 QCOMPARE(zipFile.read(1).size(), 1);
262 QCOMPARE(zipFile.atEnd(), false);
263 QCOMPARE(zipFile.read(fileInfo.size() - 1).size(),
264 static_cast<int>(fileInfo.size() - 1));
265 QCOMPARE(zipFile.atEnd(), true);
266 }
267 removeTestFiles(fileNames);
268 testZip.close();
269 curDir.remove(zipName);
270}
271
272void TestQuaZipFile::posRead_data()
273{

Callers 3

foreachFunction · 0.45
readManyMethod · 0.45
foreachFunction · 0.45

Calls 5

createTestFilesFunction · 0.85
removeTestFilesFunction · 0.85
openMethod · 0.45
closeMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected