From: Hannah von Reth Date: Fri, 14 Aug 2020 13:40:14 +0000 (+0200) Subject: Print checksum on mismatch X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~67 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=23f7c51f707656292bbfe1bf63632170c0d61dd1;p=nextcloud-desktop.git Print checksum on mismatch --- diff --git a/src/common/checksums.cpp b/src/common/checksums.cpp index aef426813..60c8c9b77 100644 --- a/src/common/checksums.cpp +++ b/src/common/checksums.cpp @@ -357,7 +357,7 @@ void ValidateChecksumHeader::slotChecksumCalculated(const QByteArray &checksumTy return; } if (checksum != _expectedChecksum) { - emit validationFailed(tr("The downloaded file does not match the checksum, it will be resumed.")); + emit validationFailed(tr("The downloaded file does not match the checksum, it will be resumed. '%1' != '%2'").arg(QString::fromUtf8(_expectedChecksum), QString::fromUtf8(checksum))); return; } emit validated(checksumType, checksum); diff --git a/test/testchecksumvalidator.cpp b/test/testchecksumvalidator.cpp index 5c9c3f37b..93af94bde 100644 --- a/test/testchecksumvalidator.cpp +++ b/test/testchecksumvalidator.cpp @@ -43,7 +43,7 @@ using namespace OCC::Utility; } void slotDownError( const QString& errMsg ) { - QVERIFY(_expectedError == errMsg ); + QCOMPARE(_expectedError, errMsg); _errorSeen = true; } @@ -196,7 +196,7 @@ using namespace OCC::Utility; QTRY_VERIFY(_successDown); - _expectedError = QLatin1String("The downloaded file does not match the checksum, it will be resumed."); + _expectedError = QStringLiteral("The downloaded file does not match the checksum, it will be resumed. '543345' != '%1'").arg(QString::fromUtf8(_expected)); _errorSeen = false; file->seek(0); vali->start(_testfile, "Adler32:543345");