summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-04-16 12:04:34 +0200
committerLars Knoll <lars.knoll@nokia.com>2012-04-16 12:04:34 +0200
commit9bd032355163d92cda5e7e59ecd21214b131f187 (patch)
tree002fa12558505683143c7eb08949a3d225bf0712 /tests/auto/corelib
parentd037d25c3d5236623371cf051aaf6a9e59792ba7 (diff)
parent41673c45dde2eb95ee21dd918235218399f2be2c (diff)
Merge remote-tracking branch 'origin/master' into api_changes
Conflicts: configure src/corelib/io/qurl.cpp src/gui/kernel/qwindow.cpp src/tools/moc/generator.cpp src/widgets/kernel/qwidget_qpa.cpp src/widgets/styles/qstyle.h src/widgets/widgets/qtabbar.cpp tests/auto/corelib/codecs/utf8/tst_utf8.cpp Change-Id: Ia457228d6f684ec8184e13e8fcc9d25857b1751e
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r--tests/auto/corelib/codecs/utf8/tst_utf8.cpp32
-rw-r--r--tests/auto/corelib/io/qfile/test/test.pro2
-rw-r--r--tests/auto/corelib/io/qiodevice/qiodevice.pro2
-rw-r--r--tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp6
-rw-r--r--tests/auto/corelib/io/qtextstream/test/test.pro2
-rw-r--r--tests/auto/corelib/json/tst_qtjson.cpp48
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp14
-rw-r--r--tests/auto/corelib/tools/qchar/tst_qchar.cpp42
-rw-r--r--tests/auto/corelib/tools/qlocale/test/test.pro1
-rw-r--r--tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp111
10 files changed, 243 insertions, 17 deletions
diff --git a/tests/auto/corelib/codecs/utf8/tst_utf8.cpp b/tests/auto/corelib/codecs/utf8/tst_utf8.cpp
index 07ea4c4545..e513b2cea2 100644
--- a/tests/auto/corelib/codecs/utf8/tst_utf8.cpp
+++ b/tests/auto/corelib/codecs/utf8/tst_utf8.cpp
@@ -233,6 +233,38 @@ void tst_Utf8::nonCharacters_data()
QTest::addColumn<QByteArray>("utf8");
QTest::addColumn<QString>("utf16");
+ // Unicode has a couple of "non-characters" that one can use internally,
+ // but are not allowed to be used for text interchange.
+ //
+ // Those are the last two entries each Unicode Plane (U+FFFE, U+FFFF,
+ // U+1FFFE, U+1FFFF, etc.) as well as the entries between U+FDD0 and
+ // U+FDEF (inclusive)
+
+ // U+FDD0 through U+FDEF
+ for (int i = 0; i < 32; ++i) {
+ char utf8[] = { char(0357), char(0267), char(0220 + i), 0 };
+ QString utf16 = QChar(0xfdd0 + i);
+ QTest::newRow(qPrintable(QString::number(0xfdd0 + i, 16))) << QByteArray(utf8) << utf16;
+ }
+
+ // the last two in Planes 1 through 16
+ for (uint plane = 1; plane <= 16; ++plane) {
+ for (uint lower = 0xfffe; lower < 0x10000; ++lower) {
+ uint ucs4 = (plane << 16) | lower;
+ char utf8[] = { char(0xf0 | uchar(ucs4 >> 18)),
+ char(0x80 | (uchar(ucs4 >> 12) & 0x3f)),
+ char(0x80 | (uchar(ucs4 >> 6) & 0x3f)),
+ char(0x80 | (uchar(ucs4) & 0x3f)),
+ 0 };
+ ushort utf16[] = { QChar::highSurrogate(ucs4), QChar::lowSurrogate(ucs4), 0 };
+
+ QTest::newRow(qPrintable(QString::number(ucs4, 16))) << QByteArray(utf8) << QString::fromUtf16(utf16);
+ }
+ }
+
+ QTest::newRow("fffe") << QByteArray("\xEF\xBF\xBE") << QString(QChar(0xfffe));
+ QTest::newRow("ffff") << QByteArray("\xEF\xBF\xBF") << QString(QChar(0xffff));
+
extern void loadNonCharactersRows();
loadNonCharactersRows();
}
diff --git a/tests/auto/corelib/io/qfile/test/test.pro b/tests/auto/corelib/io/qfile/test/test.pro
index dab5e4a3a5..676762da81 100644
--- a/tests/auto/corelib/io/qfile/test/test.pro
+++ b/tests/auto/corelib/io/qfile/test/test.pro
@@ -10,5 +10,3 @@ TESTDATA += ../dosfile.txt ../noendofline.txt ../testfile.txt \
../resources/file1.ext1
win32: LIBS+=-lole32 -luuid
-
-mac*:CONFIG+=insignificant_test
diff --git a/tests/auto/corelib/io/qiodevice/qiodevice.pro b/tests/auto/corelib/io/qiodevice/qiodevice.pro
index a8295ec79b..c98e3fb8c3 100644
--- a/tests/auto/corelib/io/qiodevice/qiodevice.pro
+++ b/tests/auto/corelib/io/qiodevice/qiodevice.pro
@@ -5,5 +5,3 @@ SOURCES = tst_qiodevice.cpp
TESTDATA += tst_qiodevice.cpp
MOC_DIR=tmp
-
-mac: CONFIG += insignificant_test # QTBUG-22766
diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
index 9b1d5c0b68..29f6fe9da4 100644
--- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
+++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
@@ -49,7 +49,7 @@
#include <sys/types.h>
#endif
-#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_BLACKBERRY)
#define Q_XDG_PLATFORM
#endif
@@ -239,12 +239,16 @@ void tst_qstandardpaths::testDataLocation()
{
// On all platforms, DataLocation should be GenericDataLocation / organization name / app name
// This allows one app to access the data of another app.
+ // Blackberry OS is an exception to this case, owing to the fact that
+ // applications are sandboxed.
+#ifndef Q_OS_BLACKBERRY
const QString base = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
QCOMPARE(QStandardPaths::writableLocation(QStandardPaths::DataLocation), base + "/tst_qstandardpaths");
QCoreApplication::instance()->setOrganizationName("Qt");
QCOMPARE(QStandardPaths::writableLocation(QStandardPaths::DataLocation), base + "/Qt/tst_qstandardpaths");
QCoreApplication::instance()->setApplicationName("QtTest");
QCOMPARE(QStandardPaths::writableLocation(QStandardPaths::DataLocation), base + "/Qt/QtTest");
+#endif
#ifdef Q_XDG_PLATFORM
setDefaultLocations();
diff --git a/tests/auto/corelib/io/qtextstream/test/test.pro b/tests/auto/corelib/io/qtextstream/test/test.pro
index 577f52972d..93fb6d232f 100644
--- a/tests/auto/corelib/io/qtextstream/test/test.pro
+++ b/tests/auto/corelib/io/qtextstream/test/test.pro
@@ -19,5 +19,3 @@ TESTDATA += \
../qtextstream.qrc \
../tst_qtextstream.cpp \
../resources
-
-mac: CONFIG += insignificant_test # QTBUG-22767
diff --git a/tests/auto/corelib/json/tst_qtjson.cpp b/tests/auto/corelib/json/tst_qtjson.cpp
index 4ab4b78da1..bf6a58a24b 100644
--- a/tests/auto/corelib/json/tst_qtjson.cpp
+++ b/tests/auto/corelib/json/tst_qtjson.cpp
@@ -123,6 +123,8 @@ private Q_SLOTS:
void testTrailingComma();
void testDetachBug();
+
+ void valueEquals();
private:
QString testDataDir;
};
@@ -1845,5 +1847,51 @@ void TestQtJson::testDetachBug()
QCOMPARE(local.keys().size(), 1);
}
+void TestQtJson::valueEquals()
+{
+ QVERIFY(QJsonValue() == QJsonValue());
+ QVERIFY(QJsonValue() != QJsonValue(QJsonValue::Undefined));
+ QVERIFY(QJsonValue() != QJsonValue(true));
+ QVERIFY(QJsonValue() != QJsonValue(1.));
+ QVERIFY(QJsonValue() != QJsonValue(QJsonArray()));
+ QVERIFY(QJsonValue() != QJsonValue(QJsonObject()));
+
+ QVERIFY(QJsonValue(true) == QJsonValue(true));
+ QVERIFY(QJsonValue(true) != QJsonValue(false));
+ QVERIFY(QJsonValue(true) != QJsonValue(QJsonValue::Undefined));
+ QVERIFY(QJsonValue(true) != QJsonValue());
+ QVERIFY(QJsonValue(true) != QJsonValue(1.));
+ QVERIFY(QJsonValue(true) != QJsonValue(QJsonArray()));
+ QVERIFY(QJsonValue(true) != QJsonValue(QJsonObject()));
+
+ QVERIFY(QJsonValue(1.) == QJsonValue(1.));
+ QVERIFY(QJsonValue(1.) != QJsonValue(2.));
+ QVERIFY(QJsonValue(1.) != QJsonValue(QJsonValue::Undefined));
+ QVERIFY(QJsonValue(1.) != QJsonValue());
+ QVERIFY(QJsonValue(1.) != QJsonValue(true));
+ QVERIFY(QJsonValue(1.) != QJsonValue(QJsonArray()));
+ QVERIFY(QJsonValue(1.) != QJsonValue(QJsonObject()));
+
+ QVERIFY(QJsonValue(QJsonArray()) == QJsonValue(QJsonArray()));
+ QJsonArray nonEmptyArray;
+ nonEmptyArray.append(true);
+ QVERIFY(QJsonValue(QJsonArray()) != nonEmptyArray);
+ QVERIFY(QJsonValue(QJsonArray()) != QJsonValue(QJsonValue::Undefined));
+ QVERIFY(QJsonValue(QJsonArray()) != QJsonValue());
+ QVERIFY(QJsonValue(QJsonArray()) != QJsonValue(true));
+ QVERIFY(QJsonValue(QJsonArray()) != QJsonValue(1.));
+ QVERIFY(QJsonValue(QJsonArray()) != QJsonValue(QJsonObject()));
+
+ QVERIFY(QJsonValue(QJsonObject()) == QJsonValue(QJsonObject()));
+ QJsonObject nonEmptyObject;
+ nonEmptyObject.insert("Key", true);
+ QVERIFY(QJsonValue(QJsonObject()) != nonEmptyObject);
+ QVERIFY(QJsonValue(QJsonObject()) != QJsonValue(QJsonValue::Undefined));
+ QVERIFY(QJsonValue(QJsonObject()) != QJsonValue());
+ QVERIFY(QJsonValue(QJsonObject()) != QJsonValue(true));
+ QVERIFY(QJsonValue(QJsonObject()) != QJsonValue(1.));
+ QVERIFY(QJsonValue(QJsonObject()) != QJsonValue(QJsonArray()));
+}
+
QTEST_MAIN(TestQtJson)
#include "tst_qtjson.moc"
diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
index 90d20843e3..f429af7ce2 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
@@ -4850,6 +4850,8 @@ signals:
int returnInt(int);
void returnVoid(int);
CustomType returnCustomType(int);
+
+ QObject *returnPointer();
public slots:
QVariant returnVariantSlot(int i) { return i; }
QString returnStringSlot(int i) { return QString::number(i); }
@@ -4858,6 +4860,8 @@ public slots:
void returnVoidSlot() {}
int return23() { return 23; }
QString returnHello() { return QStringLiteral("hello"); }
+ QObject *returnThisSlot1() { return this; }
+ ReturnValue *returnThisSlot2() { return this; }
public:
struct VariantFunctor {
QVariant operator()(int i) { return i; }
@@ -4910,6 +4914,7 @@ void tst_QObject::returnValue()
QCOMPARE(emit r.returnInt(45), int());
emit r.returnVoid(45);
QCOMPARE((emit r.returnCustomType(45)).value(), CustomType().value());
+ QCOMPARE((emit r.returnPointer()), static_cast<QObject *>(0));
}
{ // connected to a slot returning the same type
CheckInstanceCount checker;
@@ -4922,6 +4927,8 @@ void tst_QObject::returnValue()
QCOMPARE(emit r.returnInt(45), int(45));
QVERIFY(connect(&r, &ReturnValue::returnCustomType, &receiver, &ReturnValue::returnCustomTypeSlot, type));
QCOMPARE((emit r.returnCustomType(45)).value(), CustomType(45).value());
+ QVERIFY(connect(&r, &ReturnValue::returnPointer, &receiver, &ReturnValue::returnThisSlot1, type));
+ QCOMPARE((emit r.returnPointer()), static_cast<QObject *>(&receiver));
}
if (!isBlockingQueued) { // connected to simple functions or functor
CheckInstanceCount checker;
@@ -4950,6 +4957,8 @@ void tst_QObject::returnValue()
QCOMPARE((emit r.returnCustomType(48)).value(), CustomType(48).value());
QVERIFY(connect(&r, &ReturnValue::returnVoid, &receiver, &ReturnValue::returnCustomTypeSlot, type));
emit r.returnVoid(48);
+ QVERIFY(connect(&r, &ReturnValue::returnPointer, &receiver, &ReturnValue::returnThisSlot2, type));
+ QCOMPARE((emit r.returnPointer()), static_cast<QObject *>(&receiver));
}
if (!isBlockingQueued) { // connected to functor with different type
CheckInstanceCount checker;
@@ -4974,6 +4983,8 @@ void tst_QObject::returnValue()
QCOMPARE(emit r.returnInt(45), int());
QVERIFY(connect(&r, &ReturnValue::returnCustomType, &receiver, &ReturnValue::returnVoidSlot, type));
QCOMPARE((emit r.returnCustomType(45)).value(), CustomType().value());
+ QVERIFY(connect(&r, &ReturnValue::returnPointer, &receiver, &ReturnValue::returnVoidSlot, type));
+ QCOMPARE((emit r.returnPointer()), static_cast<QObject *>(0));
}
if (!isBlockingQueued) {
// queued connection should not forward the return value
@@ -4987,6 +4998,9 @@ void tst_QObject::returnValue()
QCOMPARE(emit r.returnInt(45), int());
QVERIFY(connect(&r, &ReturnValue::returnCustomType, &receiver, &ReturnValue::returnCustomTypeSlot, Qt::QueuedConnection));
QCOMPARE((emit r.returnCustomType(45)).value(), CustomType().value());
+ QVERIFY(connect(&r, &ReturnValue::returnPointer, &receiver, &ReturnValue::returnThisSlot1, Qt::QueuedConnection));
+ QCOMPARE((emit r.returnPointer()), static_cast<QObject *>(0));
+
QCoreApplication::processEvents();
QVERIFY(connect(&r, &ReturnValue::returnVariant, &receiver, &ReturnValue::returnStringSlot, Qt::QueuedConnection));
diff --git a/tests/auto/corelib/tools/qchar/tst_qchar.cpp b/tests/auto/corelib/tools/qchar/tst_qchar.cpp
index e72af11fbb..14c43d0088 100644
--- a/tests/auto/corelib/tools/qchar/tst_qchar.cpp
+++ b/tests/auto/corelib/tools/qchar/tst_qchar.cpp
@@ -77,6 +77,7 @@ private slots:
void joining();
void combiningClass();
void digitValue();
+ void mirroredChar();
void decomposition();
void lineBreakClass();
void normalization_data();
@@ -523,6 +524,29 @@ void tst_QChar::digitValue()
QVERIFY(QChar::digitValue((ushort)0x1040) == 0);
QVERIFY(QChar::digitValue((uint)0x1049) == 9);
QVERIFY(QChar::digitValue((uint)0x1040) == 0);
+
+ QVERIFY(QChar::digitValue((ushort)0xd800) == -1);
+ QVERIFY(QChar::digitValue((uint)UNICODE_LAST_CODEPOINT + 1) == -1);
+}
+
+void tst_QChar::mirroredChar()
+{
+ QVERIFY(QChar(0x169B).hasMirrored());
+ QVERIFY(QChar(0x169B).mirroredChar() == QChar(0x169C));
+ QVERIFY(QChar(0x169C).hasMirrored());
+ QVERIFY(QChar(0x169C).mirroredChar() == QChar(0x169B));
+
+ QVERIFY(QChar(0x301A).hasMirrored());
+ QVERIFY(QChar(0x301A).mirroredChar() == QChar(0x301B));
+ QVERIFY(QChar(0x301B).hasMirrored());
+ QVERIFY(QChar(0x301B).mirroredChar() == QChar(0x301A));
+
+ if (QChar::currentUnicodeVersion() <= QChar::Unicode_5_0) {
+ QVERIFY(!QChar(0x201C).hasMirrored());
+ QVERIFY(QChar(0x201C).mirroredChar() != QChar(0x201D));
+ QVERIFY(!QChar(0x201D).hasMirrored());
+ QVERIFY(QChar(0x201D).mirroredChar() != QChar(0x201C));
+ }
}
void tst_QChar::decomposition()
@@ -540,10 +564,10 @@ void tst_QChar::decomposition()
{
QString str;
- str += QChar( (0x1D157 - 0x10000) / 0x400 + 0xd800 );
- str += QChar( ((0x1D157 - 0x10000) % 0x400) + 0xdc00 );
- str += QChar( (0x1D165 - 0x10000) / 0x400 + 0xd800 );
- str += QChar( ((0x1D165 - 0x10000) % 0x400) + 0xdc00 );
+ str += QChar(QChar::highSurrogate(0x1D157));
+ str += QChar(QChar::lowSurrogate(0x1D157));
+ str += QChar(QChar::highSurrogate(0x1D165));
+ str += QChar(QChar::lowSurrogate(0x1D165));
QVERIFY(QChar::decomposition(0x1D15e) == str);
}
@@ -626,14 +650,12 @@ void tst_QChar::normalization_data()
for (int j = 0; j < c.size(); ++j) {
bool ok;
uint uc = c.at(j).toInt(&ok, 16);
- if (uc < 0x10000)
+ if (!QChar::requiresSurrogates(uc)) {
columns[i].append(QChar(uc));
- else {
+ } else {
// convert to utf16
- ushort high = QChar::highSurrogate(uc);
- ushort low = QChar::lowSurrogate(uc);
- columns[i].append(QChar(high));
- columns[i].append(QChar(low));
+ columns[i].append(QChar(QChar::highSurrogate(uc)));
+ columns[i].append(QChar(QChar::lowSurrogate(uc)));
}
}
}
diff --git a/tests/auto/corelib/tools/qlocale/test/test.pro b/tests/auto/corelib/tools/qlocale/test/test.pro
index 24dcc0638a..28e127e307 100644
--- a/tests/auto/corelib/tools/qlocale/test/test.pro
+++ b/tests/auto/corelib/tools/qlocale/test/test.pro
@@ -17,3 +17,4 @@ load(testcase) # for target.path and installTestHelperApp()
installTestHelperApp("../syslocaleapp/syslocaleapp",syslocaleapp,syslocaleapp)
mac: CONFIG += insignificant_test # QTBUG-22769
+win32:CONFIG+= insignificant_test # QTBUG-25284
diff --git a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
index a4c04d6207..f1de1722e2 100644
--- a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
+++ b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
@@ -637,6 +637,52 @@ void tst_QRegularExpression::normalMatch_data()
<< 0
<< QRegularExpression::MatchOptions(QRegularExpression::AnchoredMatchOption)
<< m;
+
+ // ***
+
+ m.clear();
+ m.isValid = true; m.hasMatch = true;
+ m.captured << "678";
+ QTest::newRow("negativeoffset01") << QRegularExpression("\\d+")
+ << "abc123def678ghi"
+ << -6
+ << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
+ << m;
+
+ m.clear();
+ m.isValid = true; m.hasMatch = true;
+ m.captured << "678";
+ QTest::newRow("negativeoffset02") << QRegularExpression("\\d+")
+ << "abc123def678ghi"
+ << -8
+ << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
+ << m;
+
+ m.clear();
+ m.isValid = true; m.hasMatch = true;
+ m.captured << "678ghi" << "678" << "ghi";
+ QTest::newRow("negativeoffset03") << QRegularExpression("(\\d+)(\\w+)")
+ << "abc123def678ghi"
+ << -8
+ << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
+ << m;
+
+ m.clear();
+ m.isValid = true;
+ QTest::newRow("negativeoffset04") << QRegularExpression("\\d+")
+ << "abc123def678ghi"
+ << -3
+ << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
+ << m;
+
+ m.clear();
+ m.isValid = true; m.hasMatch = true;
+ m.captured << "678";
+ QTest::newRow("negativeoffset05") << QRegularExpression("^\\d+", QRegularExpression::MultilineOption)
+ << "a\nbc123\ndef\n678gh\ni"
+ << -10
+ << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
+ << m;
}
@@ -959,6 +1005,31 @@ void tst_QRegularExpression::globalMatch_data()
matchList.clear();
m.clear();
m.isValid = true; m.hasMatch = true;
+ m.captured = QStringList() << "ACA""GTG""CGA""AAA";
+ matchList << m;
+ m.captured = QStringList() << "AAA";
+ matchList << m;
+ m.captured = QStringList() << "AAG""GAA""AAG""AAA";
+ matchList << m;
+ m.captured = QStringList() << "AAA";
+ matchList << m;
+ QTest::newRow("globalmatch03") << QRegularExpression("\\G(?:\\w\\w\\w)*?AAA")
+ << "ACA""GTG""CGA""AAA""AAA""AAG""GAA""AAG""AAA""AAA"
+ << 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
+ << QRegularExpression::NormalMatch
+ << QRegularExpression::MatchOptions(QRegularExpression::AnchoredMatchOption)
+ << matchList;
+
+ matchList.clear();
+ m.clear();
+ m.isValid = true; m.hasMatch = true;
m.captured = QStringList() << "";
matchList << m;
m.captured = QStringList() << "c";
@@ -1103,6 +1174,46 @@ void tst_QRegularExpression::globalMatch_data()
<< QRegularExpression::NormalMatch
<< QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
<< matchList;
+
+ matchList.clear();
+ m.clear();
+ m.isValid = true; m.hasMatch = true;
+ m.captured = QStringList() << "ABC";
+ matchList << m;
+ m.captured = QStringList() << "";
+ matchList << m;
+ m.captured = QStringList() << "DEF";
+ matchList << m;
+ m.captured = QStringList() << "";
+ matchList << m;
+ m.captured = QStringList() << "GHI";
+ matchList << m;
+ m.captured = QStringList() << "";
+ 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
+ << QRegularExpression::NormalMatch
+ << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
+ << matchList;
+
+ matchList.clear();
+ m.clear();
+ m.isValid = true; m.hasMatch = true;
+ m.captured = QStringList() << QString::fromUtf8("ABC""\xc3\x80");
+ matchList << m;
+ m.captured = QStringList() << "";
+ matchList << m;
+ m.captured = QStringList() << QString::fromUtf8("\xc3\x80""DEF""\xc3\x80");
+ matchList << m;
+ m.captured = QStringList() << "";
+ 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
+ << QRegularExpression::NormalMatch
+ << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption)
+ << matchList;
}
void tst_QRegularExpression::globalMatch()