diff --git a/src/bugzillaintegration/libbugzilla/autotests/attachmenttest.cpp b/src/bugzillaintegration/libbugzilla/autotests/attachmenttest.cpp --- a/src/bugzillaintegration/libbugzilla/autotests/attachmenttest.cpp +++ b/src/bugzillaintegration/libbugzilla/autotests/attachmenttest.cpp @@ -42,7 +42,9 @@ { Q_ASSERT(!m_fixture.isEmpty()); QFile file(m_fixture); - Q_ASSERT(file.open(QFile::ReadOnly | QFile::Text)); + if (!file.open(QFile::ReadOnly | QFile::Text)) { + return {}; + } QTextStream in(&file); return in.readAll().toUtf8(); } @@ -63,6 +65,8 @@ virtual APIJob *get(const QString &path, const QUrlQuery &query = QUrlQuery()) const override { + Q_UNUSED(path) + Q_UNUSED(query) Q_ASSERT_X(false, "get", qUtf8Printable(QStringLiteral("unmapped: %1; %2").arg(path, query.toString()))); return nullptr; @@ -72,6 +76,7 @@ const QByteArray &data, const QUrlQuery &query = QUrlQuery()) const override { + Q_UNUSED(query); if (path == "/bug/1/attachment") { QJsonParseError error; QJsonDocument::fromJson(data, &error); @@ -87,6 +92,8 @@ const QByteArray &, const QUrlQuery &query = QUrlQuery()) const override { + Q_UNUSED(path) + Q_UNUSED(query) Q_ASSERT_X(false, "put", qUtf8Printable(QStringLiteral("unmapped: %1; %2").arg(path, query.toString()))); return nullptr; diff --git a/src/bugzillaintegration/libbugzilla/autotests/bugtest.cpp b/src/bugzillaintegration/libbugzilla/autotests/bugtest.cpp --- a/src/bugzillaintegration/libbugzilla/autotests/bugtest.cpp +++ b/src/bugzillaintegration/libbugzilla/autotests/bugtest.cpp @@ -67,7 +67,9 @@ { Q_ASSERT(!m_fixture.isEmpty()); QFile file(m_fixture); - Q_ASSERT(file.open(QFile::ReadOnly | QFile::Text)); + if (!file.open(QFile::ReadOnly | QFile::Text)) { + return {}; + } QTextStream in(&file); return in.readAll().toUtf8(); } diff --git a/src/bugzillaintegration/libbugzilla/autotests/bugzillatest.cpp b/src/bugzillaintegration/libbugzilla/autotests/bugzillatest.cpp --- a/src/bugzillaintegration/libbugzilla/autotests/bugzillatest.cpp +++ b/src/bugzillaintegration/libbugzilla/autotests/bugzillatest.cpp @@ -42,7 +42,9 @@ { Q_ASSERT(!m_fixture.isEmpty()); QFile file(m_fixture); - Q_ASSERT(file.open(QFile::ReadOnly | QFile::Text)); + if (!file.open(QFile::ReadOnly | QFile::Text)) { + return {}; + } QTextStream in(&file); return in.readAll().toUtf8(); } diff --git a/src/bugzillaintegration/libbugzilla/autotests/commenttest.cpp b/src/bugzillaintegration/libbugzilla/autotests/commenttest.cpp --- a/src/bugzillaintegration/libbugzilla/autotests/commenttest.cpp +++ b/src/bugzillaintegration/libbugzilla/autotests/commenttest.cpp @@ -42,7 +42,9 @@ { Q_ASSERT(!m_fixture.isEmpty()); QFile file(m_fixture); - Q_ASSERT(file.open(QFile::ReadOnly | QFile::Text)); + if (!file.open(QFile::ReadOnly | QFile::Text)) { + return {}; + } QTextStream in(&file); return in.readAll().toUtf8(); } @@ -78,6 +80,8 @@ const QByteArray &, const QUrlQuery &query = QUrlQuery()) const override { + Q_UNUSED(path); + Q_UNUSED(query); Q_ASSERT_X(false, "post", qUtf8Printable(QStringLiteral("unmapped: %1; %2").arg(path, query.toString()))); return nullptr; @@ -87,6 +91,8 @@ const QByteArray &, const QUrlQuery &query = QUrlQuery()) const override { + Q_UNUSED(path); + Q_UNUSED(query); Q_ASSERT_X(false, "put", qUtf8Printable(QStringLiteral("unmapped: %1; %2").arg(path, query.toString()))); return nullptr; diff --git a/src/bugzillaintegration/libbugzilla/autotests/connectiontest.cpp b/src/bugzillaintegration/libbugzilla/autotests/connectiontest.cpp --- a/src/bugzillaintegration/libbugzilla/autotests/connectiontest.cpp +++ b/src/bugzillaintegration/libbugzilla/autotests/connectiontest.cpp @@ -80,7 +80,7 @@ // passed along! if (httpBlob.startsWith("GET /hi?informal=yes")) { QFile file(QFINDTESTDATA("data/hi.http")); - Q_ASSERT(file.open(QFile::ReadOnly | QFile::Text)); + file.open(QFile::ReadOnly | QFile::Text); socket->write(file.readAll()); socket->waitForBytesWritten(); socket->disconnect(); @@ -115,7 +115,7 @@ QString httpBlob = socket->readAll(); qDebug() << httpBlob; QFile file(QFINDTESTDATA("data/error.http")); - QVERIFY(file.open(QFile::ReadOnly | QFile::Text)); + file.open(QFile::ReadOnly | QFile::Text); socket->write(file.readAll()); socket->waitForBytesWritten(); socket->disconnect(); @@ -159,7 +159,7 @@ parts.contains("Content-Length: 12") && parts.contains("hello there!")) { QFile file(QFINDTESTDATA("data/put.http")); - QVERIFY(file.open(QFile::ReadOnly | QFile::Text)); + file.open(QFile::ReadOnly | QFile::Text); QByteArray ret = file.readAll(); ret.replace("\n", "\r\n"); qDebug() << ret; @@ -178,7 +178,7 @@ quint16 port; portMutex.lock(); QTimer::singleShot(0, server, [server, &portMutex, &portCondition, &port]() { - Q_ASSERT(server->listen(QHostAddress::LocalHost, 0)); + server->listen(QHostAddress::LocalHost, 0); QMutexLocker locker(&portMutex); port = server->serverPort(); portCondition.wakeAll(); diff --git a/src/bugzillaintegration/libbugzilla/autotests/producttest.cpp b/src/bugzillaintegration/libbugzilla/autotests/producttest.cpp --- a/src/bugzillaintegration/libbugzilla/autotests/producttest.cpp +++ b/src/bugzillaintegration/libbugzilla/autotests/producttest.cpp @@ -41,7 +41,9 @@ { Q_ASSERT(!m_fixture.isEmpty()); QFile file(m_fixture); - Q_ASSERT(file.open(QFile::ReadOnly | QFile::Text)); + if (!file.open(QFile::ReadOnly | QFile::Text)) { + return {}; + } QTextStream in(&file); return in.readAll().toUtf8(); } @@ -62,6 +64,8 @@ virtual APIJob *get(const QString &path, const QUrlQuery &query = QUrlQuery()) const override { + Q_UNUSED(path); + Q_UNUSED(query); if (path == "/product/dragonplayer") { return new JobDouble { QFINDTESTDATA("data/product.dragonplayer.json") }; }