diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-03-02 14:40:07 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-03-02 14:40:07 +0100 |
commit | 8c04a5e9640df0f1b2f533ee5fa698e2f466ad1f (patch) | |
tree | 32cf896f4a9c926dda04b3b671b29a2662c47aac | |
parent | 310daae53926628f80c08e4415b94b90ad525c8f (diff) | |
parent | 78e92997ed35ddc8bb6f7f6c0a4fffba026d5d8f (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I967eca8f34584fca3a1e5696978e70f620582a2a
-rw-r--r-- | src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java | 8 | ||||
-rw-r--r-- | src/corelib/serialization/qjsonvalue.cpp | 20 | ||||
-rw-r--r-- | src/corelib/tools/qlocale.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qopenglcontext.cpp | 8 | ||||
-rw-r--r-- | tests/auto/corelib/plugin/qlibrary/qlibrary.pro | 3 | ||||
-rw-r--r-- | tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp | 2 | ||||
-rw-r--r-- | tests/auto/corelib/serialization/json/tst_qtjson.cpp | 22 | ||||
-rw-r--r-- | tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 46 | ||||
-rw-r--r-- | tests/auto/corelib/tools/qstringapisymmetry/tst_qstringapisymmetry.cpp | 22 | ||||
-rw-r--r-- | tests/auto/gui/kernel/qwindow/BLACKLIST | 2 | ||||
-rw-r--r-- | tests/auto/opengl/qglthreads/tst_qglthreads.cpp | 133 | ||||
-rw-r--r-- | tests/auto/opengl/qglthreads/tst_qglthreads.h | 1 | ||||
-rw-r--r-- | tests/auto/testlib/selftests/tst_selftests.cpp | 1 | ||||
-rw-r--r-- | tests/auto/widgets/kernel/qapplication/BLACKLIST | 3 |
14 files changed, 131 insertions, 142 deletions
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index 6b8577116e..fa7508921d 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -677,12 +677,13 @@ public class QtActivityDelegate final int timeOut = 30000; // ms until we give up on ping and pong final int maxAttempts = timeOut / napTime; + DataOutputStream outToClient = null; try { LocalSocket connectionFromClient = socket.accept(); debugLog("Debug socket accepted"); BufferedReader inFromClient = new BufferedReader(new InputStreamReader(connectionFromClient.getInputStream())); - DataOutputStream outToClient = new DataOutputStream(connectionFromClient.getOutputStream()); + outToClient = new DataOutputStream(connectionFromClient.getOutputStream()); outToClient.writeBytes("" + android.os.Process.myPid()); for (int i = 0; i < maxAttempts; i++) { @@ -704,6 +705,11 @@ public class QtActivityDelegate } catch (InterruptedException interruptEx) { wasFailure = true; Log.e(QtNative.QtTAG,"Can't start debugger" + interruptEx.getMessage()); + } finally { + try { + if (outToClient != null) + outToClient.close(); + } catch (IOException ignored) { } } } diff --git a/src/corelib/serialization/qjsonvalue.cpp b/src/corelib/serialization/qjsonvalue.cpp index 33707b6ec3..b8051d6228 100644 --- a/src/corelib/serialization/qjsonvalue.cpp +++ b/src/corelib/serialization/qjsonvalue.cpp @@ -40,6 +40,8 @@ #include <qjsonobject.h> #include <qjsonvalue.h> #include <qjsonarray.h> +#include <qurl.h> +#include <quuid.h> #include <qvariant.h> #include <qstringlist.h> #include <qdebug.h> @@ -407,6 +409,20 @@ QJsonValue &QJsonValue::operator =(const QJsonValue &other) \li QMetaType::QVariantHash \endlist \li QJsonValue::Object + + \row + \li + \list + \li QMetaType::QUrl + \endlist + \li QJsonValue::String. The conversion will use QUrl::toString() with flag + QUrl::FullyEncoded, so as to ensure maximum compatibility in parsing the URL + \row + \li + \list + \li QMetaType::QUuid + \endlist + \li QJsonValue::String. Since Qt 5.11, the resulting string will not include braces \endtable For all other QVariant types a conversion to a QString will be attempted. If the returned string @@ -439,6 +455,10 @@ QJsonValue QJsonValue::fromVariant(const QVariant &variant) case QVariant::Hash: return QJsonValue(QJsonObject::fromVariantHash(variant.toHash())); #ifndef QT_BOOTSTRAPPED + case QVariant::Url: + return QJsonValue(variant.toUrl().toString(QUrl::FullyEncoded)); + case QVariant::Uuid: + return variant.toUuid().toString(QUuid::WithoutBraces); case QMetaType::QJsonValue: return variant.toJsonValue(); case QMetaType::QJsonObject: diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index f7a6f35183..09b148ea9e 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -852,6 +852,8 @@ QLocale::QLocale(const QString &name) QLocale::QLocale() : d(*defaultLocalePrivate) { + // Make sure system data is up to date + systemData(); } /*! diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index 6f332c8ad6..4efa5a40f3 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -1005,10 +1005,14 @@ bool QOpenGLContext::makeCurrent(QSurface *surface) || qstrcmp(rendererString, "Mali-T880") == 0 || qstrncmp(rendererString, "Adreno (TM) 2xx", 13) == 0 // Adreno 200, 203, 205 || qstrncmp(rendererString, "Adreno 2xx", 8) == 0 // Same as above but without the '(TM)' - || qstrncmp(rendererString, "Adreno (TM) 30x", 14) == 0 // Adreno 302, 305 - || qstrncmp(rendererString, "Adreno 30x", 9) == 0 // Same as above but without the '(TM)' + || qstrncmp(rendererString, "Adreno (TM) 3xx", 13) == 0 // Adreno 302, 305, 320, 330 + || qstrncmp(rendererString, "Adreno 3xx", 8) == 0 // Same as above but without the '(TM)' || qstrncmp(rendererString, "Adreno (TM) 4xx", 13) == 0 // Adreno 405, 418, 420, 430 || qstrncmp(rendererString, "Adreno 4xx", 8) == 0 // Same as above but without the '(TM)' + || qstrncmp(rendererString, "Adreno (TM) 5xx", 13) == 0 // Adreno 505, 506, 510, 530, 540 + || qstrncmp(rendererString, "Adreno 5xx", 8) == 0 // Same as above but without the '(TM)' + || qstrncmp(rendererString, "Adreno (TM) 6xx", 13) == 0 // Adreno 610, 620, 630 + || qstrncmp(rendererString, "Adreno 6xx", 8) == 0 // Same as above but without the '(TM)' || qstrcmp(rendererString, "GC800 core") == 0 || qstrcmp(rendererString, "GC1000 core") == 0 || strstr(rendererString, "GC2000") != 0 diff --git a/tests/auto/corelib/plugin/qlibrary/qlibrary.pro b/tests/auto/corelib/plugin/qlibrary/qlibrary.pro index 44f791f582..ec230601c4 100644 --- a/tests/auto/corelib/plugin/qlibrary/qlibrary.pro +++ b/tests/auto/corelib/plugin/qlibrary/qlibrary.pro @@ -2,6 +2,9 @@ QT = core TEMPLATE = subdirs tst.depends = lib lib2 +# lib2 has to be installed after lib, so that plain libmylib.so symlink points +# to version 2 as expected by the test +lib2.depends = lib SUBDIRS = lib \ lib2 \ diff --git a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp index 16177bb0b7..72d60d71c7 100644 --- a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp +++ b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp @@ -149,7 +149,7 @@ void tst_QLibrary::version_data() QTest::newRow( "ok00, version 1" ) << "mylib" << 1 << 1; QTest::newRow( "ok00, version 2" ) << "mylib" << 2 << 2; - QTest::newRow( "ok00, default to last version" ) << "mylib" << -1 << 2; + QTest::newRow( "ok00, load without version" ) << "mylib" << -1 << 2; } void tst_QLibrary::version() diff --git a/tests/auto/corelib/serialization/json/tst_qtjson.cpp b/tests/auto/corelib/serialization/json/tst_qtjson.cpp index 1e3604ac9e..99bdd8deb0 100644 --- a/tests/auto/corelib/serialization/json/tst_qtjson.cpp +++ b/tests/auto/corelib/serialization/json/tst_qtjson.cpp @@ -82,6 +82,8 @@ private Q_SLOTS: void fromVariant_data(); void fromVariant(); + void fromVariantSpecial_data(); + void fromVariantSpecial(); void toVariant_data(); void toVariant(); void fromVariantMap(); @@ -1174,6 +1176,26 @@ void tst_QtJson::fromVariant() QCOMPARE(variant.toJsonValue(), jsonvalue); } +void tst_QtJson::fromVariantSpecial_data() +{ + QTest::addColumn<QVariant>("variant"); + QTest::addColumn<QJsonValue>("jsonvalue"); + + // Qt types with special encoding + QTest::newRow("url") << QVariant(QUrl("https://example.com/\xc2\xa9 ")) + << QJsonValue("https://example.com/%C2%A9%20"); + QTest::newRow("uuid") << QVariant(QUuid(0x40c01df6, 0x1ad5, 0x4762, 0x9c, 0xfe, 0xfd, 0xba, 0xfa, 0xb5, 0xde, 0xf8)) + << QJsonValue("40c01df6-1ad5-4762-9cfe-fdbafab5def8"); +} + +void tst_QtJson::fromVariantSpecial() +{ + QFETCH( QVariant, variant ); + QFETCH( QJsonValue, jsonvalue ); + + QCOMPARE(QJsonValue::fromVariant(variant), jsonvalue); +} + void tst_QtJson::toVariant_data() { fromVariant_data(); diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index fc1ac7cf0f..d5e2935d28 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -141,6 +141,8 @@ private slots: void formattedDataSize(); void bcp47Name(); + void systemLocale(); + private: QString m_decimal, m_thousand, m_sdate, m_ldate, m_time; QString m_sysapp; @@ -2641,5 +2643,49 @@ void tst_QLocale::bcp47Name() QCOMPARE(QLocale("sr_Latn_HR").bcp47Name(), QStringLiteral("sr-Latn")); } +class MySystemLocale : public QSystemLocale +{ +public: + MySystemLocale(const QLocale &locale) : m_locale(locale) + { + } + + QVariant query(QueryType /*type*/, QVariant /*in*/) const override + { + return QVariant(); + } + + QLocale fallbackUiLocale() const override + { + return m_locale; + } + +private: + const QLocale m_locale; +}; + +void tst_QLocale::systemLocale() +{ + QLocale originalLocale; + + MySystemLocale *sLocale = new MySystemLocale(QLocale("uk")); + QCOMPARE(QLocale().language(), QLocale::Ukrainian); + QCOMPARE(QLocale::system().language(), QLocale::Ukrainian); + delete sLocale; + + sLocale = new MySystemLocale(QLocale("ca")); + QCOMPARE(QLocale().language(), QLocale::Catalan); + QCOMPARE(QLocale::system().language(), QLocale::Catalan); + delete sLocale; + + sLocale = new MySystemLocale(QLocale("de")); + QCOMPARE(QLocale().language(), QLocale::German); + QCOMPARE(QLocale::system().language(), QLocale::German); + delete sLocale; + + QCOMPARE(QLocale(), originalLocale); + QCOMPARE(QLocale::system(), originalLocale); +} + QTEST_MAIN(tst_QLocale) #include "tst_qlocale.moc" diff --git a/tests/auto/corelib/tools/qstringapisymmetry/tst_qstringapisymmetry.cpp b/tests/auto/corelib/tools/qstringapisymmetry/tst_qstringapisymmetry.cpp index 61d1f86f00..cb1fd9eb7d 100644 --- a/tests/auto/corelib/tools/qstringapisymmetry/tst_qstringapisymmetry.cpp +++ b/tests/auto/corelib/tools/qstringapisymmetry/tst_qstringapisymmetry.cpp @@ -33,6 +33,7 @@ #include <QString> #include <QStringView> #include <QChar> +#include <QScopedArrayPointer> #include <QStringRef> #include <QLatin1String> #include <QVector> @@ -70,6 +71,19 @@ MAKE_ALL(const char*, QChar) #undef MAKE_RELOP // END FIXME +// Return a plain ASCII row name consisting of maximum 16 chars and the +// size for data +static QByteArray rowName(const QByteArray &data) +{ + const int size = data.size(); + QScopedArrayPointer<char> prettyC(QTest::toPrettyCString(data.constData(), qMin(16, size))); + QByteArray result = prettyC.data(); + result += " ("; + result += QByteArray::number(size); + result += ')'; + return result; +} + class tst_QStringApiSymmetry : public QObject { Q_OBJECT @@ -1072,7 +1086,7 @@ void tst_QStringApiSymmetry::toLocal8Bit_data() QString s; for (char c : ba) s += QLatin1Char(c); - QTest::addRow("\"%s\" (%d)", ba.left(16).constData(), ba.size()) << s << ba; + QTest::newRow(rowName(ba).constData()) << s << ba; }; QTest::addRow("null") << QString() << QByteArray(); @@ -1107,7 +1121,7 @@ void tst_QStringApiSymmetry::toLatin1_data() QString s; for (char c : ba) s += QLatin1Char(c); - QTest::addRow("\"%s\" (%d)", ba.left(16).constData(), ba.size()) << s << ba; + QTest::newRow(rowName(ba).constData()) << s << ba; }; QTest::addRow("null") << QString() << QByteArray(); @@ -1140,7 +1154,7 @@ void tst_QStringApiSymmetry::toUtf8_data() auto add = [](const char *u8) { QByteArray ba(u8); QString s = ba; - QTest::addRow("\"%s\" (%d)", ba.left(16).constData(), ba.size()) << s << ba; + QTest::newRow(rowName(ba).constData()) << s << ba; }; QTest::addRow("null") << QString() << QByteArray(); @@ -1178,7 +1192,7 @@ void tst_QStringApiSymmetry::toUcs4_data() s += QLatin1Char(c); ucs4.append(uint(uchar(c))); } - QTest::addRow("\"%s\" (%d)", ba.left(16).constData(), ba.size()) << s << ucs4; + QTest::newRow(rowName(ba).constData()) << s << ucs4; }; QTest::addRow("null") << QString() << QVector<uint>(); diff --git a/tests/auto/gui/kernel/qwindow/BLACKLIST b/tests/auto/gui/kernel/qwindow/BLACKLIST index 05cf1b5a30..5e44747190 100644 --- a/tests/auto/gui/kernel/qwindow/BLACKLIST +++ b/tests/auto/gui/kernel/qwindow/BLACKLIST @@ -21,3 +21,5 @@ osx-10.12 ci [testInputEvents] rhel-7.4 +# QTBUG-66798 +windows diff --git a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp index 90fc4e0f2a..76186f5575 100644 --- a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp +++ b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp @@ -185,139 +185,6 @@ void tst_QGLThreads::swapInThread() QVERIFY(true); } - - - - - - -/* - textureUploadInThread - - The purpose of this testcase is to verify that doing texture uploads in a background - thread is possible and that it works. - */ - -class CreateAndUploadThread : public QThread -{ - Q_OBJECT -public: - CreateAndUploadThread(QGLWidget *shareWidget, QSemaphore *semaphore) - : m_semaphore(semaphore) - { - m_gl = new QGLWidget(0, shareWidget); - moveToThread(this); - - } - - void moveContextToThread() - { - m_gl->context()->moveToThread(this); - } - - ~CreateAndUploadThread() - { - delete m_gl; - } - - void run() { - m_gl->makeCurrent(); - QTime time; - time.start(); - while (time.elapsed() < RUNNING_TIME) { - int width = 400; - int height = 300; - QImage image(width, height, QImage::Format_RGB32); - QPainter p(&image); - p.fillRect(image.rect(), QColor(QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256))); - p.setPen(Qt::red); - p.setFont(QFont("SansSerif", 24)); - p.drawText(image.rect(), Qt::AlignCenter, "This is an autotest"); - p.end(); - m_gl->bindTexture(image, GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption); - - m_semaphore->acquire(1); - - createdAndUploaded(image); - } - } - -signals: - void createdAndUploaded(const QImage &image); - -private: - QGLWidget *m_gl; - QSemaphore *m_semaphore; -}; - -class TextureDisplay : public QGLWidget -{ - Q_OBJECT -public: - TextureDisplay(QSemaphore *semaphore) - : m_semaphore(semaphore) - { - } - - void paintEvent(QPaintEvent *) { - QPainter p(this); - for (int i=0; i<m_images.size(); ++i) { - p.drawImage(m_positions.at(i), m_images.at(i)); - m_positions[i] += QPoint(1, 1); - } - update(); - } - -public slots: - void receiveImage(const QImage &image) { - m_images << image; - m_positions << QPoint(-QRandomGenerator::global()->bounded(width() / 2), -QRandomGenerator::global()->bounded(height() / 2)); - - m_semaphore->release(1); - - if (m_images.size() > 100) { - m_images.takeFirst(); - m_positions.takeFirst(); - } - } - -private: - QList <QImage> m_images; - QList <QPoint> m_positions; - - QSemaphore *m_semaphore; -}; - -void tst_QGLThreads::textureUploadInThread() -{ - if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL)) - QSKIP("No platformsupport for ThreadedOpenGL"); - - // prevent producer thread from queuing up too many images - QSemaphore semaphore(100); - TextureDisplay display(&semaphore); - CreateAndUploadThread thread(&display, &semaphore); - - connect(&thread, SIGNAL(createdAndUploaded(QImage)), &display, SLOT(receiveImage(QImage))); - - display.show(); - QVERIFY(QTest::qWaitForWindowActive(&display)); - - thread.moveContextToThread(); - thread.start(); - - while (thread.isRunning()) { - qApp->processEvents(); - } - - QVERIFY(true); -} - - - - - - /* renderInThread diff --git a/tests/auto/opengl/qglthreads/tst_qglthreads.h b/tests/auto/opengl/qglthreads/tst_qglthreads.h index 037655c60f..e4b496c163 100644 --- a/tests/auto/opengl/qglthreads/tst_qglthreads.h +++ b/tests/auto/opengl/qglthreads/tst_qglthreads.h @@ -39,7 +39,6 @@ public: private slots: void swapInThread(); - void textureUploadInThread(); void renderInThread_data(); void renderInThread(); diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index a9c5d40734..35b8f226ec 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -400,6 +400,7 @@ tst_Selftests::tst_Selftests() void tst_Selftests::initTestCase() { QVERIFY2(tempDir.isValid(), qPrintable(tempDir.errorString())); + qputenv("QT_LOGGING_RULES", QByteArrayLiteral("*.debug=false")); // Silence any debug output //Detect the location of the sub programs QString subProgram = QLatin1String("float/float"); #if defined(Q_OS_WIN) diff --git a/tests/auto/widgets/kernel/qapplication/BLACKLIST b/tests/auto/widgets/kernel/qapplication/BLACKLIST new file mode 100644 index 0000000000..ca0efdff8a --- /dev/null +++ b/tests/auto/widgets/kernel/qapplication/BLACKLIST @@ -0,0 +1,3 @@ +[touchEventPropagation] +# QTBUG-66745 +opensuse |