execute(): Enhance debug output.

This commit is contained in:
Gerhard Hoffmann 2024-04-09 14:53:50 +02:00
parent 8d18ae10fe
commit a1327388bc

View File

@ -277,21 +277,24 @@ bool Utils::sameFilesInDirs(QDir const &dir1, QDir const &dir2,
fileNameLst2 << i2.next().fileName(); fileNameLst2 << i2.next().fileName();
} }
QString dirPath1 = dir1.absolutePath();
QString dirPath2 = dir2.absolutePath();
if (fileNameLst1.isEmpty()) { if (fileNameLst1.isEmpty()) {
qCritical() << "DIR1" << dir1.dirName() << " DOES NOT CONTAIN EXPECTED FILES"; qCritical() << "DIR1" << dirPath1 << " DOES NOT CONTAIN EXPECTED FILES";
return false; return false;
} }
if (fileNameLst2.isEmpty()) { if (fileNameLst2.isEmpty()) {
qCritical() << "DIR1" << dir2.dirName() << " DOES NOT CONTAIN EXPECTED FILES"; qCritical() << "DIR1" << dirPath2 << " DOES NOT CONTAIN EXPECTED FILES";
return false; return false;
} }
if (fileNameLst1 != fileNameLst2) { if (fileNameLst1 != fileNameLst2) {
printCriticalErrorMsg(dir1.dirName() + " AND " + dir2.dirName() printCriticalErrorMsg(dirPath1 + " AND " + dirPath2
+ " DIFFER: [" + fileNameLst1.join(',') + "],[" + " DIFFER: [" + fileNameLst1.join(',') + "],["
+ fileNameLst2.join(',') + "]"); + fileNameLst2.join(',') + "]");
return false; return false;
} else { } else {
printInfoMsg(dir1.dirName() + " AND " + dir2.dirName() printInfoMsg(dirPath1 + " AND " + dirPath2
+ " ARE EQUAL: [" + fileNameLst1.join(',') + "]"); + " ARE EQUAL: [" + fileNameLst1.join(',') + "]");
} }
@ -307,21 +310,21 @@ bool Utils::sameFilesInDirs(QDir const &dir1, QDir const &dir2,
} }
if (gitBlobLst1.isEmpty()) { if (gitBlobLst1.isEmpty()) {
qCritical() << "DIR1" << dir1.dirName() << " DOES NOT CONTAIN EXPECTED FILES"; qCritical() << "DIR1" << dirPath1 << " DOES NOT CONTAIN EXPECTED FILES";
return false; return false;
} }
if (gitBlobLst2.isEmpty()) { if (gitBlobLst2.isEmpty()) {
qCritical() << "DIR1" << dir2.dirName() << " DOES NOT CONTAIN EXPECTED FILES"; qCritical() << "DIR1" << dirPath2 << " DOES NOT CONTAIN EXPECTED FILES";
return false; return false;
} }
if (gitBlobLst1 != gitBlobLst2) { if (gitBlobLst1 != gitBlobLst2) {
printCriticalErrorMsg(dir1.dirName() + " AND " + dir2.dirName() printCriticalErrorMsg(dirPath1 + " AND " + dirPath2
+ " DIFFER: [" + gitBlobLst1.join(',') + "],[" + " DIFFER: [" + gitBlobLst1.join(',') + "],["
+ gitBlobLst2.join(',') + "]"); + gitBlobLst2.join(',') + "]");
return false; return false;
} else { } else {
printInfoMsg(dir1.dirName() + " AND " + dir2.dirName() printInfoMsg(dirPath1 + " AND " + dirPath2
+ " CONTAIN SAME GIT-BLOBS FOR FILES: [" + fileNameLst1.join(',') + "]"); + " CONTAIN SAME GIT-BLOBS FOR FILES: [" + fileNameLst1.join(',') + "]");
} }