From b1ef104866f78ae5bbc1214ae524bad4120ef0e2 Mon Sep 17 00:00:00 2001 From: Heikki Halmet Date: Wed, 31 Oct 2018 09:18:14 +0200 Subject: Blacklist tst_QWindow::exposeEventOnShrink_QTBUG54040 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib87d2820c4dbdf93778997b6df11cc7d8e63cf04 Reviewed-by: Tony Sarajärvi --- tests/auto/gui/kernel/qwindow/BLACKLIST | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/auto') diff --git a/tests/auto/gui/kernel/qwindow/BLACKLIST b/tests/auto/gui/kernel/qwindow/BLACKLIST index e9a0d44ba7..f54865b841 100644 --- a/tests/auto/gui/kernel/qwindow/BLACKLIST +++ b/tests/auto/gui/kernel/qwindow/BLACKLIST @@ -40,6 +40,7 @@ android [exposeEventOnShrink_QTBUG54040] # QTBUG-69155 android +opensuse [initialSize] # QTBUG-69159 android -- cgit v1.2.3 From 00674a1643422de2e56ac23c89174c0ead83eb18 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 25 Sep 2018 15:02:58 +0200 Subject: Treat shorts as int in QVariant::canConvert() Follow the pattern of char and float, and treat shorts as a more generic type in QVariant::canConvert() Task-number: QTBUG-60914 Change-Id: Ib1cc7941ee47cb0fc0098f22f98a03cd6f6b63fe Reviewed-by: Thiago Macieira --- tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp index 0780fb9172..4da34c407e 100644 --- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp +++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp @@ -525,6 +525,12 @@ void tst_QVariant::canConvert_data() var = QVariant::fromValue(-1); QTest::newRow("SChar") << var << N << N << Y << N << Y << N << N << N << N << Y << N << N << Y << N << N << N << Y << N << N << N << N << N << N << N << N << N << Y << N << N << Y << Y; + var = QVariant((short)-3); + QTest::newRow("Short") + << var << N << N << Y << N << Y << N << N << N << N << Y << N << N << Y << N << Y << N << Y << N << N << N << N << N << N << N << N << N << Y << N << N << Y << Y; + var = QVariant((ushort)7); + QTest::newRow("UShort") + << var << N << N << Y << N << Y << N << N << N << N << Y << N << N << Y << N << Y << N << Y << N << N << N << N << N << N << N << N << N << Y << N << N << Y << Y; var = QVariant::fromValue(QJsonValue(QStringLiteral("hello"))); QTest::newRow("JsonValue") << var << N << N << Y << N << N << N << N << N << N << Y << N << N << Y << N << N << Y << Y << Y << N << N << N << N << N << N << N << N << Y << N << N << Y << Y; @@ -563,6 +569,8 @@ void tst_QVariant::toInt_data() QTest::newRow( "char" ) << QVariant::fromValue('a') << int('a') << true; signed char signedChar = -13; QTest::newRow( "signed char" ) << QVariant::fromValue(signedChar) << -13 << true; + QTest::newRow( "short" ) << QVariant::fromValue(short(-7)) << int(-7) << true; + QTest::newRow( "ushort" ) << QVariant::fromValue(ushort(30000)) << 30000 << true; QTest::newRow( "double" ) << QVariant( 3.1415927 ) << 3 << true; QTest::newRow( "float" ) << QVariant( 3.1415927f ) << 3 << true; QTest::newRow( "uint" ) << QVariant( 123u ) << 123 << true; -- cgit v1.2.3 From e3c84b6da1cbef7ed779ba5eec6ae3ed8e4e5d59 Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Tue, 23 Oct 2018 14:17:29 +0800 Subject: QMimeType: Use default key as fallback for comment() property When QMimeProvider parses the shared mime database xml files, it will read the element for mime comment and treat the `xml:lang` attribute as locale language string. When no `xml:lang` attr is provided, QMimeProvider will read the value and treat it as a en_US locale string as the default key. When we call QMimeType::comment(), it will try to get the locale comment string with the default language (QLocale().name()), once it can't find a matched result, it should return the default key (which QMimeProvider set it as en_US locale before) as fallback. Task-number: QTBUG-71314 Change-Id: I444f8159d6f19dfef6338cd79312f608d8f13394 Reviewed-by: David Faure --- .../corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp index 597d51e7e0..9df52887f7 100644 --- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp +++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp @@ -992,6 +992,20 @@ void tst_QMimeDatabase::installNewGlobalMimeType() const QString fooTestFile2 = QLatin1String(RESOURCE_PREFIX "magic-and-hierarchy2.foo"); QCOMPARE(db.mimeTypeForFile(fooTestFile2).name(), QString::fromLatin1("application/vnd.qnx.bar-descriptor")); + // Test if we can use the default comment + { + struct RestoreLocale + { + ~RestoreLocale() { QLocale::setDefault(QLocale::c()); } + } restoreLocale; + + QLocale::setDefault(QLocale("zh_CN")); + QMimeType suseymp = db.mimeTypeForName("text/x-suse-ymp"); + QVERIFY(suseymp.isValid()); + QCOMPARE(suseymp.comment(), + QString::fromLatin1("YaST Meta Package")); + } + // Now test removing the mimetype definitions again for (int i = 0; i < m_additionalMimeFileNames.size(); ++i) QFile::remove(destDir + m_additionalMimeFileNames.at(i)); -- cgit v1.2.3 From 2b682972c2266e52b1510080a56b574e9ffd4db0 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 23 Sep 2018 17:21:21 +0200 Subject: QSqlQuery: add another testcase for bindBool() tst_QSqlQuery::bindBool() did not check if the bool is correctly bound as part of the WHERE statement. Add a new test to query for the bool column and check if there is exactly one row returned. Fixes: QTBUG-38891 Change-Id: I0bd1ceb1b30e50f67f44f5b06d68683195b78b29 Reviewed-by: Andy Shaw --- tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tests/auto') diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp index 4ce1009c90..c4cf2e752f 100644 --- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp @@ -633,13 +633,20 @@ void tst_QSqlQuery::bindBool() QVERIFY_SQL(q, exec()); } - QVERIFY_SQL(q, exec("SELECT id, flag FROM " + tableName)); + QVERIFY_SQL(q, exec("SELECT id, flag FROM " + tableName + " ORDER BY id")); for (int i = 0; i < 2; ++i) { bool flag = i; QVERIFY_SQL(q, next()); QCOMPARE(q.value(0).toInt(), i); QCOMPARE(q.value(1).toBool(), flag); } + QVERIFY_SQL(q, prepare("SELECT flag FROM " + tableName + " WHERE flag = :filter")); + const bool filter = true; + q.bindValue(":filter", filter); + QVERIFY_SQL(q, exec()); + QVERIFY_SQL(q, next()); + QCOMPARE(q.value(0).toBool(), filter); + QFAIL_SQL(q, next()); QVERIFY_SQL(q, exec("DROP TABLE " + tableName)); } -- cgit v1.2.3 From daf9ba91ae19054b5860f87f8f39b518d60cda38 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 18 Oct 2018 15:55:43 +0200 Subject: Stabilize tst_QAccessibilityLinux::testFocus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tests would rely on the window manager giving it focus a bit too much. Change-Id: I1b28def2c95a4f0a9665a7cf6e0c14db03df98d5 Reviewed-by: Jędrzej Nowacki --- tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp b/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp index 47d24ce171..48594b2fa1 100644 --- a/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp +++ b/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp @@ -502,6 +502,8 @@ void tst_QAccessibilityLinux::testSlider() void tst_QAccessibilityLinux::testFocus() { + m_window->activateWindow(); + QVERIFY(QTest::qWaitForWindowActive(m_window)); QLineEdit *lineEdit1 = new QLineEdit(m_window); lineEdit1->setText("lineEdit 1"); QLineEdit *lineEdit2 = new QLineEdit(m_window); -- cgit v1.2.3