summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarcel Krems <m.krems@software-vision.eu>2020-08-25 01:33:00 +0200
committerMarcel Krems <m.krems@software-vision.eu>2020-08-28 02:22:10 +0200
commit257285553fffdb0d9246b3b0a1072f2092f9c0a2 (patch)
treefc579da833a3fcf09a14bfa6f0e6e1cf6a3faaf9 /tests
parent4d5a048d96f1161e2059315d0fe350fdcebb2e05 (diff)
Use qsizetype in QRegularExpression
PCRE2 already uses size_t which we can now make full use of. Change-Id: Icb5efd5c6ef27f2e31a9780bf62f5671ddc603cd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/text/qregularexpression/tst_qregularexpression.cpp152
1 files changed, 76 insertions, 76 deletions
diff --git a/tests/auto/corelib/text/qregularexpression/tst_qregularexpression.cpp b/tests/auto/corelib/text/qregularexpression/tst_qregularexpression.cpp
index dbe77be1f5..a986223a87 100644
--- a/tests/auto/corelib/text/qregularexpression/tst_qregularexpression.cpp
+++ b/tests/auto/corelib/text/qregularexpression/tst_qregularexpression.cpp
@@ -214,9 +214,9 @@ void consistencyCheck(const QRegularExpressionMatch &match)
QVERIFY(match.lastCapturedIndex() == 0);
for (int i = 0; i <= match.lastCapturedIndex(); ++i) {
- int startPos = match.capturedStart(i);
- int endPos = match.capturedEnd(i);
- int length = match.capturedLength(i);
+ qsizetype startPos = match.capturedStart(i);
+ qsizetype endPos = match.capturedEnd(i);
+ qsizetype length = match.capturedLength(i);
QString captured = match.captured(i);
QStringView capturedView = match.capturedView(i);
@@ -300,7 +300,7 @@ template<typename QREMatch, typename QREMatchFunc, typename Subject, typename Re
static void testMatchImpl(const QRegularExpression &regexp,
QREMatchFunc matchingMethod,
const Subject &subject,
- int offset,
+ qsizetype offset,
QRegularExpression::MatchType matchType,
QRegularExpression::MatchOptions matchOptions,
const Result &result)
@@ -334,7 +334,7 @@ static void testMatch(const QRegularExpression &regexp,
QREMatchFuncForString matchingMethodForString,
QREMatchFuncForStringRef matchingMethodForStringRef,
const QString &subject,
- int offset,
+ qsizetype offset,
QRegularExpression::MatchType matchType,
QRegularExpression::MatchOptions matchOptions,
const Result &result)
@@ -352,10 +352,10 @@ static void testMatch(const QRegularExpression &regexp,
result);
}
-typedef QRegularExpressionMatch (QRegularExpression::*QREMatchStringPMF)(const QString &, int, QRegularExpression::MatchType, QRegularExpression::MatchOptions) const;
-typedef QRegularExpressionMatch (QRegularExpression::*QREMatchStringViewPMF)(QStringView, int, QRegularExpression::MatchType, QRegularExpression::MatchOptions) const;
-typedef QRegularExpressionMatchIterator (QRegularExpression::*QREGlobalMatchStringPMF)(const QString &, int, QRegularExpression::MatchType, QRegularExpression::MatchOptions) const;
-typedef QRegularExpressionMatchIterator (QRegularExpression::*QREGlobalMatchStringViewPMF)(QStringView, int, QRegularExpression::MatchType, QRegularExpression::MatchOptions) const;
+typedef QRegularExpressionMatch (QRegularExpression::*QREMatchStringPMF)(const QString &, qsizetype, QRegularExpression::MatchType, QRegularExpression::MatchOptions) const;
+typedef QRegularExpressionMatch (QRegularExpression::*QREMatchStringViewPMF)(QStringView, qsizetype, QRegularExpression::MatchType, QRegularExpression::MatchOptions) const;
+typedef QRegularExpressionMatchIterator (QRegularExpression::*QREGlobalMatchStringPMF)(const QString &, qsizetype, QRegularExpression::MatchType, QRegularExpression::MatchOptions) const;
+typedef QRegularExpressionMatchIterator (QRegularExpression::*QREGlobalMatchStringViewPMF)(QStringView, qsizetype, QRegularExpression::MatchType, QRegularExpression::MatchOptions) const;
void tst_QRegularExpression::provideRegularExpressions()
{
@@ -626,19 +626,19 @@ void tst_QRegularExpression::normalMatch_data()
{
QTest::addColumn<QRegularExpression>("regexp");
QTest::addColumn<QString>("subject");
- QTest::addColumn<int>("offset");
+ QTest::addColumn<qsizetype>("offset");
QTest::addColumn<QRegularExpression::MatchOptions>("matchOptions");
QTest::addColumn<Match>("match");
Match m;
- int offset = 0;
+ qsizetype offset = 0;
m.clear();
m.isValid = true; m.hasMatch = true;
m.captured << "string" << "string";
QTest::newRow("match01") << QRegularExpression("(\\bstring\\b)")
<< "a string"
- << 0
+ << qsizetype(0)
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -647,7 +647,7 @@ void tst_QRegularExpression::normalMatch_data()
m.captured << "a string" << "a" << "string";
QTest::newRow("match02") << QRegularExpression("(\\w+) (\\w+)")
<< "a string"
- << 0
+ << qsizetype(0)
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -658,7 +658,7 @@ void tst_QRegularExpression::normalMatch_data()
m.namedCaptured["noun"] = "string";
QTest::newRow("match03") << QRegularExpression("(?<article>\\w+) (?<noun>\\w+)")
<< "a string"
- << 0
+ << qsizetype(0)
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -667,7 +667,7 @@ void tst_QRegularExpression::normalMatch_data()
m.captured << " string" << QString() << "string";
QTest::newRow("match04") << QRegularExpression("(\\w+)? (\\w+)")
<< " string"
- << 0
+ << qsizetype(0)
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -676,7 +676,7 @@ void tst_QRegularExpression::normalMatch_data()
m.captured << " string" << QString("") << "string";
QTest::newRow("match05") << QRegularExpression("(\\w*) (\\w+)")
<< " string"
- << 0
+ << qsizetype(0)
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -684,7 +684,7 @@ void tst_QRegularExpression::normalMatch_data()
m.isValid = true; m.hasMatch = true;
m.captured << "c123def" << "c12" << "3" << "def";
offset = 2;
- for (int i = 0; i <= offset; ++i) {
+ for (qsizetype i = 0; i <= offset; ++i) {
QTest::newRow(("match06-offset" + QByteArray::number(i)).constData())
<< QRegularExpression("(\\w*)(\\d+)(\\w*)")
<< QStringLiteral("abc123def").mid(offset - i)
@@ -697,7 +697,7 @@ void tst_QRegularExpression::normalMatch_data()
m.isValid = true; m.hasMatch = true;
m.captured << QString("");
offset = 9;
- for (int i = 0; i <= offset; ++i) {
+ for (qsizetype i = 0; i <= offset; ++i) {
QTest::newRow(("match07-offset" + QByteArray::number(i)).constData())
<< QRegularExpression("\\w*")
<< QStringLiteral("abc123def").mid(offset - i)
@@ -711,7 +711,7 @@ void tst_QRegularExpression::normalMatch_data()
m.captured << QString("a string") << QString("a string") << QString("");
QTest::newRow("match08") << QRegularExpression("(.*)(.*)")
<< "a string"
- << 0
+ << qsizetype(0)
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -720,7 +720,7 @@ void tst_QRegularExpression::normalMatch_data()
m.captured << QString("a string") << QString("") << QString("a string");
QTest::newRow("match09") << QRegularExpression("(.*?)(.*)")
<< "a string"
- << 0
+ << qsizetype(0)
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -735,7 +735,7 @@ void tst_QRegularExpression::normalMatch_data()
m.namedCaptured["nonexisting3"] = QString();
QTest::newRow("match10") << QRegularExpression("(?<article>\\w+) (?<noun>\\w+)")
<< "a string"
- << 0
+ << qsizetype(0)
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -746,7 +746,7 @@ void tst_QRegularExpression::normalMatch_data()
m.namedCaptured["nonexisting"] = QString();
QTest::newRow("match11") << QRegularExpression("(?<digits>\\d*)")
<< "abcde"
- << 0
+ << qsizetype(0)
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -758,7 +758,7 @@ void tst_QRegularExpression::normalMatch_data()
QTest::newRow("match12")
<< QRegularExpression("\\Bbcd\\B")
<< "abcde"
- << 1
+ << qsizetype(1)
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -768,14 +768,14 @@ void tst_QRegularExpression::normalMatch_data()
m.isValid = true;
QTest::newRow("nomatch01") << QRegularExpression("\\d+")
<< "a string"
- << 0
+ << qsizetype(0)
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
m.clear();
m.isValid = true;
offset = 1;
- for (int i = 0; i <= offset; ++i) {
+ for (qsizetype i = 0; i <= offset; ++i) {
QTest::newRow(("nomatch02-offset" + QByteArray::number(i)).constData())
<< QRegularExpression("(\\w+) (\\w+)")
<< QStringLiteral("a string").mid(offset - i)
@@ -787,7 +787,7 @@ void tst_QRegularExpression::normalMatch_data()
m.clear();
m.isValid = true;
offset = 9;
- for (int i = 0; i <= offset; ++i) {
+ for (qsizetype i = 0; i <= offset; ++i) {
QTest::newRow(("nomatch03-offset" + QByteArray::number(i)).constData())
<< QRegularExpression("\\w+")
<< QStringLiteral("abc123def").mid(offset - i)
@@ -802,7 +802,7 @@ void tst_QRegularExpression::normalMatch_data()
m.isValid = true;
QTest::newRow("anchoredmatch01") << QRegularExpression("\\d+")
<< "abc123def"
- << 0
+ << qsizetype(0)
<< QRegularExpression::MatchOptions(QRegularExpression::AnchorAtOffsetMatchOption)
<< m;
@@ -813,7 +813,7 @@ void tst_QRegularExpression::normalMatch_data()
m.captured << "678";
QTest::newRow("negativeoffset01") << QRegularExpression("\\d+")
<< "abc123def678ghi"
- << -6
+ << qsizetype(-6)
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -822,7 +822,7 @@ void tst_QRegularExpression::normalMatch_data()
m.captured << "678";
QTest::newRow("negativeoffset02") << QRegularExpression("\\d+")
<< "abc123def678ghi"
- << -8
+ << qsizetype(-8)
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -831,7 +831,7 @@ void tst_QRegularExpression::normalMatch_data()
m.captured << "678ghi" << "678" << "ghi";
QTest::newRow("negativeoffset03") << QRegularExpression("(\\d+)(\\w+)")
<< "abc123def678ghi"
- << -8
+ << qsizetype(-8)
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -839,7 +839,7 @@ void tst_QRegularExpression::normalMatch_data()
m.isValid = true;
QTest::newRow("negativeoffset04") << QRegularExpression("\\d+")
<< "abc123def678ghi"
- << -3
+ << qsizetype(-3)
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -848,7 +848,7 @@ void tst_QRegularExpression::normalMatch_data()
m.captured << "678";
QTest::newRow("negativeoffset05") << QRegularExpression("^\\d+", QRegularExpression::MultilineOption)
<< "a\nbc123\ndef\n678gh\ni"
- << -10
+ << qsizetype(-10)
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
}
@@ -858,7 +858,7 @@ void tst_QRegularExpression::normalMatch()
{
QFETCH(QRegularExpression, regexp);
QFETCH(QString, subject);
- QFETCH(int, offset);
+ QFETCH(qsizetype, offset);
QFETCH(QRegularExpression::MatchOptions, matchOptions);
QFETCH(Match, match);
@@ -876,20 +876,20 @@ void tst_QRegularExpression::partialMatch_data()
{
QTest::addColumn<QRegularExpression>("regexp");
QTest::addColumn<QString>("subject");
- QTest::addColumn<int>("offset");
+ QTest::addColumn<qsizetype>("offset");
QTest::addColumn<QRegularExpression::MatchType>("matchType");
QTest::addColumn<QRegularExpression::MatchOptions>("matchOptions");
QTest::addColumn<Match>("match");
Match m;
- int offset = 0;
+ qsizetype offset = 0;
m.clear();
m.isValid = true; m.hasPartialMatch = true;
m.captured << "str";
QTest::newRow("softmatch01") << QRegularExpression("string")
<< "a str"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferCompleteMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -899,7 +899,7 @@ void tst_QRegularExpression::partialMatch_data()
m.captured << " str";
QTest::newRow("softmatch02") << QRegularExpression("\\bstring\\b")
<< "a str"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferCompleteMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -909,7 +909,7 @@ void tst_QRegularExpression::partialMatch_data()
m.captured << " str";
QTest::newRow("softmatch03") << QRegularExpression("(\\bstring\\b)")
<< "a str"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferCompleteMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -919,7 +919,7 @@ void tst_QRegularExpression::partialMatch_data()
m.captured << "8 Dec 19";
QTest::newRow("softmatch04") << QRegularExpression("^(\\d{1,2}) (\\w{3}) (\\d{4})$")
<< "8 Dec 19"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferCompleteMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -929,7 +929,7 @@ void tst_QRegularExpression::partialMatch_data()
m.captured << "8 Dec 1985" << "8" << "Dec" << "1985";
QTest::newRow("softmatch05") << QRegularExpression("^(\\d{1,2}) (\\w{3}) (\\d{4})$")
<< "8 Dec 1985"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferCompleteMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -939,7 +939,7 @@ void tst_QRegularExpression::partialMatch_data()
m.captured << "def";
QTest::newRow("softmatch06") << QRegularExpression("abc\\w+X|def")
<< "abcdef"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferCompleteMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -949,7 +949,7 @@ void tst_QRegularExpression::partialMatch_data()
m.captured << "abcdef";
QTest::newRow("softmatch07") << QRegularExpression("abc\\w+X|defY")
<< "abcdef"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferCompleteMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -958,7 +958,7 @@ void tst_QRegularExpression::partialMatch_data()
m.isValid = true; m.hasPartialMatch = true;
m.captured << "def";
offset = 1;
- for (int i = 0; i <= offset; ++i) {
+ for (qsizetype i = 0; i <= offset; ++i) {
QTest::newRow(("softmatch08-offset" + QByteArray::number(i)).constData())
<< QRegularExpression("abc\\w+X|defY")
<< QStringLiteral("abcdef").mid(offset - i)
@@ -975,7 +975,7 @@ void tst_QRegularExpression::partialMatch_data()
m.captured << "str";
QTest::newRow("hardmatch01") << QRegularExpression("string")
<< "a str"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferFirstMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -985,7 +985,7 @@ void tst_QRegularExpression::partialMatch_data()
m.captured << " str";
QTest::newRow("hardmatch02") << QRegularExpression("\\bstring\\b")
<< "a str"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferFirstMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -995,7 +995,7 @@ void tst_QRegularExpression::partialMatch_data()
m.captured << " str";
QTest::newRow("hardmatch03") << QRegularExpression("(\\bstring\\b)")
<< "a str"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferFirstMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -1005,7 +1005,7 @@ void tst_QRegularExpression::partialMatch_data()
m.captured << "8 Dec 19";
QTest::newRow("hardmatch04") << QRegularExpression("^(\\d{1,2}) (\\w{3}) (\\d{4})$")
<< "8 Dec 19"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferFirstMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -1015,7 +1015,7 @@ void tst_QRegularExpression::partialMatch_data()
m.captured << "8 Dec 1985";
QTest::newRow("hardmatch05") << QRegularExpression("^(\\d{1,2}) (\\w{3}) (\\d{4})$")
<< "8 Dec 1985"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferFirstMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -1025,7 +1025,7 @@ void tst_QRegularExpression::partialMatch_data()
m.captured << "abcdef";
QTest::newRow("hardmatch06") << QRegularExpression("abc\\w+X|def")
<< "abcdef"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferFirstMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -1035,7 +1035,7 @@ void tst_QRegularExpression::partialMatch_data()
m.captured << "abcdef";
QTest::newRow("hardmatch07") << QRegularExpression("abc\\w+X|defY")
<< "abcdef"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferFirstMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -1044,7 +1044,7 @@ void tst_QRegularExpression::partialMatch_data()
m.isValid = true; m.hasPartialMatch = true;
m.captured << "def";
offset = 1;
- for (int i = 0; i <= offset; ++i) {
+ for (qsizetype i = 0; i <= offset; ++i) {
QTest::newRow(("hardmatch08-offset" + QByteArray::number(i)).constData())
<< QRegularExpression("abc\\w+X|defY")
<< QStringLiteral("abcdef").mid(offset - i)
@@ -1059,7 +1059,7 @@ void tst_QRegularExpression::partialMatch_data()
m.captured << "ab";
QTest::newRow("hardmatch09") << QRegularExpression("abc|ab")
<< "ab"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferFirstMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -1069,7 +1069,7 @@ void tst_QRegularExpression::partialMatch_data()
m.captured << "abc";
QTest::newRow("hardmatch10") << QRegularExpression("abc(def)?")
<< "abc"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferFirstMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -1079,7 +1079,7 @@ void tst_QRegularExpression::partialMatch_data()
m.captured << "abc";
QTest::newRow("hardmatch11") << QRegularExpression("(abc)*")
<< "abc"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferFirstMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -1091,7 +1091,7 @@ void tst_QRegularExpression::partialMatch_data()
m.isValid = true;
QTest::newRow("nomatch01") << QRegularExpression("abc\\w+X|defY")
<< "123456"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferCompleteMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -1100,7 +1100,7 @@ void tst_QRegularExpression::partialMatch_data()
m.isValid = true;
QTest::newRow("nomatch02") << QRegularExpression("abc\\w+X|defY")
<< "123456"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferFirstMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -1109,7 +1109,7 @@ void tst_QRegularExpression::partialMatch_data()
m.isValid = true;
QTest::newRow("nomatch03") << QRegularExpression("abc\\w+X|defY")
<< "ab123"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferCompleteMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -1118,7 +1118,7 @@ void tst_QRegularExpression::partialMatch_data()
m.isValid = true;
QTest::newRow("nomatch04") << QRegularExpression("abc\\w+X|defY")
<< "ab123"
- << 0
+ << qsizetype(0)
<< QRegularExpression::PartialPreferFirstMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< m;
@@ -1129,7 +1129,7 @@ void tst_QRegularExpression::partialMatch()
{
QFETCH(QRegularExpression, regexp);
QFETCH(QString, subject);
- QFETCH(int, offset);
+ QFETCH(qsizetype, offset);
QFETCH(QRegularExpression::MatchType, matchType);
QFETCH(QRegularExpression::MatchOptions, matchOptions);
QFETCH(Match, match);
@@ -1148,7 +1148,7 @@ void tst_QRegularExpression::globalMatch_data()
{
QTest::addColumn<QRegularExpression>("regexp");
QTest::addColumn<QString>("subject");
- QTest::addColumn<int>("offset");
+ QTest::addColumn<qsizetype>("offset");
QTest::addColumn<QRegularExpression::MatchType>("matchType");
QTest::addColumn<QRegularExpression::MatchOptions>("matchOptions");
QTest::addColumn<QList<Match> >("matchList");
@@ -1167,7 +1167,7 @@ void tst_QRegularExpression::globalMatch_data()
matchList << m;
QTest::newRow("globalmatch01") << QRegularExpression("\\w+")
<< "the quick fox"
- << 0
+ << qsizetype(0)
<< QRegularExpression::NormalMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< matchList;
@@ -1183,7 +1183,7 @@ void tst_QRegularExpression::globalMatch_data()
matchList << m;
QTest::newRow("globalmatch02") << QRegularExpression("(\\w+?)(\\w+)")
<< "the quick fox"
- << 0
+ << qsizetype(0)
<< QRegularExpression::NormalMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< matchList;
@@ -1201,14 +1201,14 @@ void tst_QRegularExpression::globalMatch_data()
matchList << m;
QTest::newRow("globalmatch03") << QRegularExpression("\\G(?:\\w\\w\\w)*?AAA")
<< "ACA""GTG""CGA""AAA""AAA""AAG""GAA""AAG""AAA""AAA"
- << 0
+ << qsizetype(0)
<< QRegularExpression::NormalMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< matchList;
QTest::newRow("globalmatch04") << QRegularExpression("(?:\\w\\w\\w)*?AAA")
<< "ACA""GTG""CGA""AAA""AAA""AAG""GAA""AAG""AAA""AAA"
- << 0
+ << qsizetype(0)
<< QRegularExpression::NormalMatch
<< QRegularExpression::MatchOptions(QRegularExpression::AnchorAtOffsetMatchOption)
<< matchList;
@@ -1233,7 +1233,7 @@ void tst_QRegularExpression::globalMatch_data()
QTest::newRow("globalmatch_emptycaptures01") << QRegularExpression("a*b*|c")
<< "ccaabbd"
- << 0
+ << qsizetype(0)
<< QRegularExpression::NormalMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< matchList;
@@ -1256,7 +1256,7 @@ void tst_QRegularExpression::globalMatch_data()
QTest::newRow("globalmatch_emptycaptures02") << QRegularExpression(".*")
<< "the\nquick\nfox"
- << 0
+ << qsizetype(0)
<< QRegularExpression::NormalMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< matchList;
@@ -1281,7 +1281,7 @@ void tst_QRegularExpression::globalMatch_data()
QTest::newRow("globalmatch_emptycaptures03") << QRegularExpression(".*")
<< "the\nquick\nfox\n"
- << 0
+ << qsizetype(0)
<< QRegularExpression::NormalMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< matchList;
@@ -1304,7 +1304,7 @@ void tst_QRegularExpression::globalMatch_data()
QTest::newRow("globalmatch_emptycaptures04") << QRegularExpression("(*CRLF).*")
<< "the\r\nquick\r\nfox"
- << 0
+ << qsizetype(0)
<< QRegularExpression::NormalMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< matchList;
@@ -1329,7 +1329,7 @@ void tst_QRegularExpression::globalMatch_data()
QTest::newRow("globalmatch_emptycaptures05") << QRegularExpression("(*CRLF).*")
<< "the\r\nquick\r\nfox\r\n"
- << 0
+ << qsizetype(0)
<< QRegularExpression::NormalMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< matchList;
@@ -1356,7 +1356,7 @@ void tst_QRegularExpression::globalMatch_data()
QTest::newRow("globalmatch_emptycaptures06") << QRegularExpression("(*ANYCRLF).*")
<< "the\r\nquick\nfox\rjumped"
- << 0
+ << qsizetype(0)
<< QRegularExpression::NormalMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< matchList;
@@ -1378,7 +1378,7 @@ void tst_QRegularExpression::globalMatch_data()
matchList << m;
QTest::newRow("globalmatch_emptycaptures07") << QRegularExpression("[\\x{0000}-\\x{FFFF}]*")
<< QString::fromUtf8("ABC""\xf0\x9d\x85\x9d""DEF""\xf0\x9d\x85\x9e""GHI")
- << 0
+ << qsizetype(0)
<< QRegularExpression::NormalMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< matchList;
@@ -1396,7 +1396,7 @@ void tst_QRegularExpression::globalMatch_data()
matchList << m;
QTest::newRow("globalmatch_emptycaptures08") << QRegularExpression("[\\x{0000}-\\x{FFFF}]*")
<< QString::fromUtf8("ABC""\xc3\x80""\xf0\x9d\x85\x9d""\xc3\x80""DEF""\xc3\x80")
- << 0
+ << qsizetype(0)
<< QRegularExpression::NormalMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< matchList;
@@ -1406,7 +1406,7 @@ void tst_QRegularExpression::globalMatch()
{
QFETCH(QRegularExpression, regexp);
QFETCH(QString, subject);
- QFETCH(int, offset);
+ QFETCH(qsizetype, offset);
QFETCH(QRegularExpression::MatchType, matchType);
QFETCH(QRegularExpression::MatchOptions, matchOptions);
QFETCH(QList<Match>, matchList);
@@ -2185,9 +2185,9 @@ void tst_QRegularExpression::wildcard_data()
{
QTest::addColumn<QString>("pattern");
QTest::addColumn<QString>("string");
- QTest::addColumn<int>("foundIndex");
+ QTest::addColumn<qsizetype>("foundIndex");
- auto addRow = [](const char *pattern, const char *string, int foundIndex) {
+ auto addRow = [](const char *pattern, const char *string, qsizetype foundIndex) {
QTest::newRow(pattern) << pattern << string << foundIndex;
};
@@ -2241,7 +2241,7 @@ void tst_QRegularExpression::wildcard()
{
QFETCH(QString, pattern);
QFETCH(QString, string);
- QFETCH(int, foundIndex);
+ QFETCH(qsizetype, foundIndex);
QRegularExpression re(QRegularExpression::wildcardToRegularExpression(pattern));
QRegularExpressionMatch match = re.match(string);