From 13cb9ab1c5e645d1103254a8ef00273e87f67044 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 30 May 2018 16:29:29 +0200 Subject: PropagateDownload: Don't discard the body of error message We want to keep the body so we can get the message from it (Issue #6459) TestDownload::testErrorMessage did not fail because the FakeErrorReply did not emit readyRead and did not implement bytesAvailable. --- test/syncenginetestutils.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/syncenginetestutils.h') diff --git a/test/syncenginetestutils.h b/test/syncenginetestutils.h index 1a78add5b..3957479d6 100644 --- a/test/syncenginetestutils.h +++ b/test/syncenginetestutils.h @@ -728,6 +728,8 @@ public: setAttribute(QNetworkRequest::HttpStatusCodeAttribute, _httpErrorCode); setError(InternalServerError, "Internal Server Fake Error"); emit metaDataChanged(); + emit readyRead(); + setFinished(true); emit finished(); } @@ -738,6 +740,9 @@ public: _body = _body.mid(max); return max; } + qint64 bytesAvailable() const override { + return _body.size(); + } int _httpErrorCode; QByteArray _body; -- cgit v1.2.3