mirror of
https://github.com/znc/znc.git
synced 2026-08-09 10:23:14 +02:00
Switch integration test to qt6 (#1916)
Keep using Qt5 for Cygwin and CodeQL * CI: upgrade ubuntu
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <QRegularExpression>
|
||||
#include "znctest.h"
|
||||
|
||||
#ifndef ZNC_BIN_DIR
|
||||
@@ -119,6 +120,12 @@ std::unique_ptr<QNetworkReply> ZNCTest::HandleHttp(QNetworkReply* reply) {
|
||||
std::cout << "Got HTTP reply" << std::endl;
|
||||
loop.quit();
|
||||
});
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||
QObject::connect(reply, &QNetworkReply::errorOccurred,
|
||||
[&](QNetworkReply::NetworkError e) {
|
||||
ADD_FAILURE() << reply->errorString().toStdString();
|
||||
});
|
||||
#else
|
||||
QObject::connect(
|
||||
reply,
|
||||
static_cast<void (QNetworkReply::*)(QNetworkReply::NetworkError)>(
|
||||
@@ -126,6 +133,7 @@ std::unique_ptr<QNetworkReply> ZNCTest::HandleHttp(QNetworkReply* reply) {
|
||||
[&](QNetworkReply::NetworkError e) {
|
||||
ADD_FAILURE() << reply->errorString().toStdString();
|
||||
});
|
||||
#endif
|
||||
QTimer::singleShot(30000 /* msec */, &loop, [&]() {
|
||||
ADD_FAILURE() << "connection timeout";
|
||||
loop.quit();
|
||||
@@ -160,7 +168,7 @@ void ZNCTest::InstallModule(QString name, QString content) {
|
||||
QStringList lines = content.split("\n");
|
||||
int maxoffset = -1;
|
||||
for (const QString& line : lines) {
|
||||
int nonspace = line.indexOf(QRegExp("\\S"));
|
||||
int nonspace = line.indexOf(QRegularExpression("\\S"));
|
||||
if (nonspace == -1) continue;
|
||||
if (nonspace < maxoffset || maxoffset == -1) maxoffset = nonspace;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user