Format code using clang-format

This commit is contained in:
Luis Ángel San Martín
2019-05-30 19:46:37 +02:00
parent e0eb94e3ae
commit e3ec56aa43
356 changed files with 19824 additions and 21874 deletions

View File

@ -9,7 +9,6 @@
using namespace std;
//This program uses PROTOS Genome Test Suite c10-archive [0] for testing the CompressedArchive wrapper files support
//It tests the following formats: RAR, ZIP, TAR
//Arter downloading c10-archive-r1.iso, open it and full extract RAR_TAR.BZ2, ZIP_TAR.BZ2, TAR_TAR.BZ2 files into a folder
@ -19,8 +18,7 @@ using namespace std;
//
int main(int argc, char *argv[])
{
if(argc < 2)
{
if (argc < 2) {
cout << "Usage: compressed_archive_test PATH" << endl;
return 0;
}
@ -30,7 +28,9 @@ int main(int argc, char *argv[])
QString s(argv[1]);
QStringList supportedFormats;
supportedFormats << "rar"<< "zip" << "tar";
supportedFormats << "rar"
<< "zip"
<< "tar";
QElapsedTimer timer;
timer.start();
@ -38,8 +38,7 @@ int main(int argc, char *argv[])
quint32 totalFiles = 0;
foreach (QString format, supportedFormats) {
QDir rootDir(s);
if(!rootDir.cd(format))
{
if (!rootDir.cd(format)) {
cout << "Folder for format '" << format.toStdString() << "' not found" << endl;
continue;
}
@ -48,38 +47,34 @@ int main(int argc, char *argv[])
QFileInfoList files = rootDir.entryInfoList();
quint32 totalFormat = 0;
quint32 errors = 0;
quint64 init = timer.elapsed();
quint64 init = timer.elapsed();
foreach(QFileInfo fileInfo, files)
{
foreach (QFileInfo fileInfo, files) {
totalFiles++;
totalFormat++;
CompressedArchive archive(fileInfo.filePath());
if(!archive.isValid())
if (!archive.isValid())
errors++;
else
{
else {
int i = archive.getNumFiles();
cerr << i;
QList<QString> filenames = archive.getFileNames();
if (!filenames.isEmpty())
{
cerr << archive.getFileNames().at(0).toStdString();
}
QList<QString> filenames = archive.getFileNames();
if (!filenames.isEmpty()) {
cerr << archive.getFileNames().at(0).toStdString();
}
}
}
}
quint64 end = timer.elapsed();
cout << "Format '" << format.toStdString() <<"'" << endl;
cout << "Format '" << format.toStdString() << "'" << endl;
cout << "Total files : " << totalFormat << endl;
cout << "Errors : " << errors << endl;
cout << "Elapsed time : " << (end - init) / 1000 <<"s" << endl;
cout << "Elapsed time : " << (end - init) / 1000 << "s" << endl;
cout << endl;
}
cout << endl;
cout << "Total time : " << timer.elapsed() / 1000 <<"s" <<endl;
cout << "Total time : " << timer.elapsed() / 1000 << "s" << endl;
cout << endl;
//return app.exec();