aboutsummaryrefslogtreecommitdiffstats
path: root/tests/benchmarks
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-04-02 11:00:06 +0200
committerLars Knoll <lars.knoll@qt.io>2020-04-03 21:01:53 +0200
commitcc6c5ae70b1389ed86301bbfc156628e1d3abbcd (patch)
tree41238618977b44c67c796fb34078d6c3084d5e55 /tests/benchmarks
parent55be24d6b6e66bd54168021f5a467ba4da73b2c6 (diff)
Port the remaining tests from QRegExp to QRegularExpression
Change-Id: If258701759c5da206948407feccd94e323af6b36 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/benchmarks')
-rw-r--r--tests/benchmarks/qml/holistic/testtypes.h10
-rw-r--r--tests/benchmarks/qml/js/qjsengine/tst_qjsengine.cpp3
-rw-r--r--tests/benchmarks/qml/js/qjsvalue/tst_qjsvalue.cpp3
3 files changed, 9 insertions, 7 deletions
diff --git a/tests/benchmarks/qml/holistic/testtypes.h b/tests/benchmarks/qml/holistic/testtypes.h
index 55f094ae7e..9d187f35ff 100644
--- a/tests/benchmarks/qml/holistic/testtypes.h
+++ b/tests/benchmarks/qml/holistic/testtypes.h
@@ -43,7 +43,7 @@
#include <QtQml/qjsvalue.h>
#include <QtQml/qqmlscriptstring.h>
#include <QtQml/qqmlcomponent.h>
-#include <QtCore/qregexp.h>
+#include <QtCore/qregularexpression.h>
class MyQmlAttachedObject : public QObject
{
@@ -80,7 +80,7 @@ class MyQmlObject : public QObject
Q_PROPERTY(QObject *objectProperty READ objectProperty WRITE setObjectProperty NOTIFY objectChanged)
Q_PROPERTY(QQmlListProperty<QObject> objectListProperty READ objectListProperty CONSTANT)
Q_PROPERTY(int resettableProperty READ resettableProperty WRITE setResettableProperty RESET resetProperty)
- Q_PROPERTY(QRegExp regExp READ regExp WRITE setRegExp)
+ Q_PROPERTY(QRegularExpression regExp READ regExp WRITE setRegExp)
Q_PROPERTY(int nonscriptable READ nonscriptable WRITE setNonscriptable SCRIPTABLE false)
public:
@@ -130,8 +130,8 @@ public:
void setResettableProperty(int v) { m_resetProperty = v; }
void resetProperty() { m_resetProperty = 13; }
- QRegExp regExp() { return m_regExp; }
- void setRegExp(const QRegExp &regExp) { m_regExp = regExp; }
+ QRegularExpression regExp() { return m_regExp; }
+ void setRegExp(const QRegularExpression &regExp) { m_regExp = regExp; }
int console() const { return 11; }
@@ -173,7 +173,7 @@ private:
QList<QObject *> m_objectQList;
int m_value;
int m_resetProperty;
- QRegExp m_regExp;
+ QRegularExpression m_regExp;
QVariant m_variant;
};
diff --git a/tests/benchmarks/qml/js/qjsengine/tst_qjsengine.cpp b/tests/benchmarks/qml/js/qjsengine/tst_qjsengine.cpp
index cb23d6edbd..dc9d31008f 100644
--- a/tests/benchmarks/qml/js/qjsengine/tst_qjsengine.cpp
+++ b/tests/benchmarks/qml/js/qjsengine/tst_qjsengine.cpp
@@ -29,6 +29,7 @@
#include <qtest.h>
#include <QtQml/qjsvalue.h>
#include <QtQml/qjsengine.h>
+#include <QtCore/qregularexpression.h>
class tst_QJSEngine : public QObject
{
@@ -346,7 +347,7 @@ void tst_QJSEngine::newFunction()
void tst_QJSEngine::newRegExp()
{
newEngine();
- QRegExp re = QRegExp("foo");
+ QRegularExpression re("foo");
QBENCHMARK {
m_engine->toScriptValue(re);
}
diff --git a/tests/benchmarks/qml/js/qjsvalue/tst_qjsvalue.cpp b/tests/benchmarks/qml/js/qjsvalue/tst_qjsvalue.cpp
index 7488d613e5..ec120b9384 100644
--- a/tests/benchmarks/qml/js/qjsvalue/tst_qjsvalue.cpp
+++ b/tests/benchmarks/qml/js/qjsvalue/tst_qjsvalue.cpp
@@ -29,6 +29,7 @@
#include <qtest.h>
#include <QtQml/qjsvalue.h>
#include <QtQml/qjsengine.h>
+#include <QtCore/qregularexpression.h>
class tst_QJSValue : public QObject
{
@@ -645,7 +646,7 @@ void tst_QJSValue::toRegExp()
{
QFETCH(QJSValue, val);
QBENCHMARK {
- qjsvalue_cast<QRegExp>(val);
+ qjsvalue_cast<QRegularExpression>(val);
}
}