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

Method operators

lib/QuaZip/qztest/testquazipdir.cpp:294–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294void TestQuaZipDir::operators()
295{
296 QString zipName = "zipDirOperators.zip";
297 QStringList fileNames;
298 fileNames << "dir/test.txt" << "root.txt";
299 if (!createTestFiles(fileNames)) {
300 QFAIL("Couldn't create test files");
301 }
302 if (!createTestArchive(zipName, fileNames)) {
303 QFAIL("Couldn't create test archive");
304 }
305 removeTestFiles(fileNames);
306 QuaZip zip(zipName);
307 QDir curDir;
308 QVERIFY(zip.open(QuaZip::mdUnzip));
309 QuaZipDir dir(&zip, "dir");
310 QuaZipDir dir2 = dir; // Copy constructor
311 QCOMPARE(dir2.path(), QString::fromLatin1("dir"));
312 dir2.cdUp();
313 QCOMPARE(dir2.path(), QString::fromLatin1(""));
314 QCOMPARE(dir.path(), QString::fromLatin1("dir"));
315 dir2 = dir; // operator=()
316 QCOMPARE(dir2.path(), QString::fromLatin1("dir"));
317 QVERIFY(dir2 == dir); // opertor==
318 dir.cd("/");
319 QCOMPARE(dir[0], QString::fromLatin1("dir/"));
320 QCOMPARE(dir[1], QString::fromLatin1("root.txt"));
321 zip.close();
322 curDir.remove(zipName);
323}
324
325void TestQuaZipDir::filePath()
326{

Callers

nothing calls this directly

Calls 9

createTestFilesFunction · 0.85
createTestArchiveFunction · 0.85
removeTestFilesFunction · 0.85
cdUpMethod · 0.80
openMethod · 0.45
pathMethod · 0.45
cdMethod · 0.45
closeMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected