summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-01-04 07:31:22 +0100
committerLiang Qi <liang.qi@qt.io>2019-01-04 07:33:14 +0100
commit03039979b5a643f9def38a73e19835bb69384202 (patch)
treee8a9184d5963128f013247ac64ec768d1cbf6911 /tests/auto/corelib
parent9682d217e21a2e88b6de799d79b843bbe0039df1 (diff)
parent4dc2bc323c985bdceb27f096dd6c8e7af657bb6b (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Also blacklist tst_QRawFont::unsupportedWritingSystem() and tst_QGlyphRun::mixedScripts() on windows for now. Conflicts: qmake/generators/makefile.cpp src/corelib/itemmodels/qstringlistmodel.cpp src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp tests/auto/gui/text/qglyphrun/BLACKLIST tests/auto/gui/text/qrawfont/BLACKLIST Task-number: QTBUG-72836 Change-Id: I10fea1493f0ae1a5708e1e48d0a4d7d6b76258b9
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r--tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp20
-rw-r--r--tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp76
2 files changed, 58 insertions, 38 deletions
diff --git a/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp b/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
index 16e5170a47..0b8686560c 100644
--- a/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
@@ -81,6 +81,8 @@ private slots:
void setData_emits_both_roles_data();
void setData_emits_both_roles();
+ void setData_emits_on_change_only();
+
void supportedDragDropActions();
void moveRows_data();
@@ -422,6 +424,24 @@ void tst_QStringListModel::setItemData()
QCOMPARE(dataChangedArguments.at(2).value<QVector<int> >(), changeRoles);
}
+void tst_QStringListModel::setData_emits_on_change_only()
+{
+ QStringListModel model(QStringList{QStringLiteral("one"), QStringLiteral("two")});
+ QSignalSpy dataChangedSpy(&model, &QAbstractItemModel::dataChanged);
+ QVERIFY(dataChangedSpy.isValid());
+ const QModelIndex modelIdx = model.index(0, 0);
+ const QString newStringData = QStringLiteral("test");
+ QVERIFY(model.setData(modelIdx, newStringData));
+ QCOMPARE(dataChangedSpy.count(), 1);
+ const QList<QVariant> spyList = dataChangedSpy.takeFirst();
+ QCOMPARE(spyList.at(0).value<QModelIndex>(), modelIdx);
+ QCOMPARE(spyList.at(1).value<QModelIndex>(), modelIdx);
+ const QVector<int> expectedRoles{Qt::DisplayRole, Qt::EditRole};
+ QCOMPARE(spyList.at(2).value<QVector<int> >(), expectedRoles);
+ QVERIFY(model.setData(modelIdx, newStringData));
+ QVERIFY(dataChangedSpy.isEmpty());
+}
+
void tst_QStringListModel::supportedDragDropActions()
{
QStringListModel model;
diff --git a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
index c23ee3b0ba..c02756d76a 100644
--- a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
+++ b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
@@ -2169,47 +2169,47 @@ void tst_QRegularExpression::wildcard_data()
addRow("*.html", "test.html", 0);
addRow("*.html", "test.htm", -1);
- addRow("bar*", "foobarbaz", 3);
+ addRow("*bar*", "foobarbaz", 0);
addRow("*", "Qt Rocks!", 0);
- addRow(".html", "test.html", 4);
- addRow(".h", "test.cpp", -1);
- addRow(".???l", "test.html", 4);
- addRow("?", "test.html", 0);
- addRow("?m", "test.html", 6);
- addRow("[*]", "test.html", -1);
- addRow("[?]","test.html", -1);
- addRow("[?]","test.h?ml", 6);
- addRow("[[]","test.h[ml", 6);
- addRow("[]]","test.h]ml", 6);
- addRow(".h[a-z]ml", "test.html", 4);
- addRow(".h[A-Z]ml", "test.html", -1);
- addRow(".h[A-Z]ml", "test.hTml", 4);
- addRow(".h[!A-Z]ml", "test.hTml", -1);
- addRow(".h[!A-Z]ml", "test.html", 4);
- addRow(".h[!T]ml", "test.hTml", -1);
- addRow(".h[!T]ml", "test.html", 4);
- addRow(".h[!T]m[!L]", "test.htmL", -1);
- addRow(".h[!T]m[!L]", "test.html", 4);
- addRow(".h[][!]", "test.h]ml", 4);
- addRow(".h[][!]", "test.h[ml", 4);
- addRow(".h[][!]", "test.h!ml", 4);
-
- addRow("foo/*/bar", "Qt/foo/baz/bar", 3);
- addRow("foo/(*)/bar", "Qt/foo/baz/bar", -1);
- addRow("foo/(*)/bar", "Qt/foo/(baz)/bar", 3);
- addRow("foo/?/bar", "Qt/foo/Q/bar", 3);
- addRow("foo/?/bar", "Qt/foo/Qt/bar", -1);
- addRow("foo/(?)/bar", "Qt/foo/Q/bar", -1);
- addRow("foo/(?)/bar", "Qt/foo/(Q)/bar", 3);
+ addRow("*.html", "test.html", 0);
+ addRow("*.h", "test.cpp", -1);
+ addRow("*.???l", "test.html", 0);
+ addRow("*?", "test.html", 0);
+ addRow("*?ml", "test.html", 0);
+ addRow("*[*]", "test.html", -1);
+ addRow("*[?]","test.html", -1);
+ addRow("*[?]ml","test.h?ml", 0);
+ addRow("*[[]ml","test.h[ml", 0);
+ addRow("*[]]ml","test.h]ml", 0);
+ addRow("*.h[a-z]ml", "test.html", 0);
+ addRow("*.h[A-Z]ml", "test.html", -1);
+ addRow("*.h[A-Z]ml", "test.hTml", 0);
+ addRow("*.h[!A-Z]ml", "test.hTml", -1);
+ addRow("*.h[!A-Z]ml", "test.html", 0);
+ addRow("*.h[!T]ml", "test.hTml", -1);
+ addRow("*.h[!T]ml", "test.html", 0);
+ addRow("*.h[!T]m[!L]", "test.htmL", -1);
+ addRow("*.h[!T]m[!L]", "test.html", 0);
+ addRow("*.h[][!]ml", "test.h]ml", 0);
+ addRow("*.h[][!]ml", "test.h[ml", 0);
+ addRow("*.h[][!]ml", "test.h!ml", 0);
+
+ addRow("foo/*/bar", "foo/baz/bar", 0);
+ addRow("foo/(*)/bar", "foo/baz/bar", -1);
+ addRow("foo/(*)/bar", "foo/(baz)/bar", 0);
+ addRow("foo/?/bar", "foo/Q/bar", 0);
+ addRow("foo/?/bar", "foo/Qt/bar", -1);
+ addRow("foo/(?)/bar", "foo/Q/bar", -1);
+ addRow("foo/(?)/bar", "foo/(Q)/bar", 0);
#ifdef Q_OS_WIN
- addRow("foo\\*\\bar", "Qt\\foo\\baz\\bar", 3);
- addRow("foo\\(*)\\bar", "Qt\\foo\\baz\\bar", -1);
- addRow("foo\\(*)\\bar", "Qt\\foo\\(baz)\\bar", 3);
- addRow("foo\\?\\bar", "Qt\\foo\\Q\\bar", 3);
- addRow("foo\\?\\bar", "Qt\\foo\\Qt\\bar", -1);
- addRow("foo\\(?)\\bar", "Qt\\foo\\Q\\bar", -1);
- addRow("foo\\(?)\\bar", "Qt\\foo\\(Q)\\bar", 3);
+ addRow("foo\\*\\bar", "foo\\baz\\bar", 0);
+ addRow("foo\\(*)\\bar", "foo\\baz\\bar", -1);
+ addRow("foo\\(*)\\bar", "foo\\(baz)\\bar", 0);
+ addRow("foo\\?\\bar", "foo\\Q\\bar", 0);
+ addRow("foo\\?\\bar", "foo\\Qt\\bar", -1);
+ addRow("foo\\(?)\\bar", "foo\\Q\\bar", -1);
+ addRow("foo\\(?)\\bar", "foo\\(Q)\\bar", 0);
#endif
}