diff options
Diffstat (limited to 'tests/auto')
5 files changed, 33 insertions, 1 deletions
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<signed char>(-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>(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; 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)); 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 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); 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)); } |