summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDamien Caliste <dcaliste@free.fr>2020-09-11 16:10:14 +0200
committerChris Adams <chris.adams@qinetic.com.au>2021-04-08 10:38:21 +1000
commitf0ef94dffec934ff0ff88eff5e247e04c14488b0 (patch)
tree0d42199a414c9b09092fdd526441a4df434fd0ee /tests
parent252d75198008377ec1b779b3c3b860612507e35d (diff)
Replace deprecated QRegExp by QRegularExpression in src/libraries
Change-Id: I51d2a292275f100f1250ae46c223098b6fedfd11 Reviewed-by: Christopher Adams <chris.adams@jolla.com> Reviewed-by: David Llewellyn-Jones <david.llewellyn-jones@jolla.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/tst_crypto/tst_crypto.cpp3
-rw-r--r--tests/tst_longstream/tst_longstream.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/tst_crypto/tst_crypto.cpp b/tests/tst_crypto/tst_crypto.cpp
index a99e568c..d6bf3c9b 100644
--- a/tests/tst_crypto/tst_crypto.cpp
+++ b/tests/tst_crypto/tst_crypto.cpp
@@ -38,6 +38,7 @@
#include <QtTest>
#include <QObject>
#include <QFile>
+#include <QRegularExpression>
#ifndef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 64
@@ -387,7 +388,7 @@ void tst_Crypto::sign()
// Check signed message output.
// Replace the random boundary strings with a fixed one for comparison.
- QRegExp rx("qmf:[^=]+==");
+ QRegularExpression rx("qmf:[^=]+==");
QString signedMsg = QString(msg.toRfc2822());
signedMsg.replace(rx, "testingtestingtesting");
QFile f2(QStringLiteral("%1/%2").arg(QCoreApplication::applicationDirPath(),
diff --git a/tests/tst_longstream/tst_longstream.cpp b/tests/tst_longstream/tst_longstream.cpp
index 714302c1..26d042f7 100644
--- a/tests/tst_longstream/tst_longstream.cpp
+++ b/tests/tst_longstream/tst_longstream.cpp
@@ -36,6 +36,7 @@
#include <private/longstream_p.h>
#include <ctype.h>
#include <QDir>
+#include <QRegularExpression>
/*
This class primarily tests that LongStream class correctly stores messages.
@@ -68,7 +69,7 @@ void tst_LongStream::test_new_stream()
QString filename = ls.fileName();
QVERIFY(filename.indexOf("longstream") != -1);
- QVERIFY(filename.indexOf(QRegExp("longstream\\.\\S{6,6}$")) != -1);
+ QVERIFY(filename.indexOf(QRegularExpression("longstream\\.\\S{6,6}$")) != -1);
// new data
QString data("This is a new message to be stored in LongStream for testing purpose."