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

Method setFileNameCodec

lib/QuaZip/qztest/testquazip.cpp:176–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176void TestQuaZip::setFileNameCodec()
177{
178 QFETCH(QString, zipName);
179 QFETCH(QStringList, fileNames);
180 QFETCH(QByteArray, encoding);
181 fileNames.sort();
182 QDir curDir;
183 if (curDir.exists(zipName)) {
184 if (!curDir.remove(zipName))
185 QFAIL("Can't remove zip file");
186 }
187 if (!createTestFiles(fileNames)) {
188 QFAIL("Can't create test file");
189 }
190 if (!createTestArchive(zipName, fileNames,
191 QTextCodec::codecForName(encoding))) {
192 QFAIL("Can't create test archive");
193 }
194 QuaZip testZip(zipName);
195 QVERIFY(testZip.open(QuaZip::mdUnzip));
196 QStringList fileList = testZip.getFileNameList();
197 fileList.sort();
198 QVERIFY(fileList[0] != fileNames[0]);
199 testZip.close();
200 testZip.setFileNameCodec(encoding);
201 QVERIFY(testZip.open(QuaZip::mdUnzip));
202 fileList = testZip.getFileNameList();
203 fileList.sort();
204 QCOMPARE(fileList, fileNames);
205 testZip.close();
206 // clean up
207 removeTestFiles(fileNames);
208 curDir.remove(zipName);
209}
210
211void TestQuaZip::setOsCode_data()
212{

Callers 2

zipUnzipMethod · 0.45
createTestArchiveFunction · 0.45

Calls 8

createTestFilesFunction · 0.85
createTestArchiveFunction · 0.85
removeTestFilesFunction · 0.85
existsMethod · 0.80
getFileNameListMethod · 0.80
removeMethod · 0.45
openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected