summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/auto.pro4
-rw-r--r--tests/auto/cmake/CMakeLists.txt1
-rw-r--r--tests/auto/cmake/test_add_big_resource/CMakeLists.txt13
-rw-r--r--tests/auto/cmake/test_add_big_resource/myobject.cpp (renamed from tests/auto/corelib/tools/qregularexpression/forceoptimize/tst_qregularexpression_forceoptimize.cpp)23
-rw-r--r--tests/auto/cmake/test_add_big_resource/myobject.h (renamed from tests/auto/corelib/tools/qregularexpression/defaultoptimize/tst_qregularexpression_defaultoptimize.cpp)19
-rw-r--r--tests/auto/cmake/test_add_big_resource/resource_file.txt1
-rw-r--r--tests/auto/cmake/test_add_big_resource/resource_file2.txt1
-rw-r--r--tests/auto/cmake/test_add_big_resource/test_add_big_resource.qrc6
-rw-r--r--tests/auto/cmake/test_add_big_resource/test_add_big_resource2.qrc6
-rw-r--r--tests/auto/cmake/test_opengl_lib/CMakeLists.txt14
-rw-r--r--tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp2
-rw-r--r--tests/auto/corelib/animation/qparallelanimationgroup/BLACKLIST1
-rw-r--r--tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST1
-rw-r--r--tests/auto/corelib/codecs/qtextcodec/echo/echo.pro4
-rw-r--r--tests/auto/corelib/codecs/qtextcodec/qtextcodec.pro3
-rw-r--r--tests/auto/corelib/codecs/qtextcodec/test.pro6
-rw-r--r--tests/auto/corelib/codecs/qtextcodec/test/test.pro13
-rw-r--r--tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp9
-rw-r--r--tests/auto/corelib/codecs/utf8/tst_utf8.cpp15
-rw-r--r--tests/auto/corelib/codecs/utf8/utf8data.cpp30
-rw-r--r--tests/auto/corelib/global/qflags/tst_qflags.cpp24
-rw-r--r--tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp6
-rw-r--r--tests/auto/corelib/global/qlogging/app/app.pro11
-rw-r--r--tests/auto/corelib/global/qlogging/test/test.pro16
-rw-r--r--tests/auto/corelib/global/qlogging/tst_qlogging.cpp27
-rw-r--r--tests/auto/corelib/global/qrandomgenerator/tst_qrandomgenerator.cpp2
-rw-r--r--tests/auto/corelib/global/qtendian/tst_qtendian.cpp176
-rw-r--r--tests/auto/corelib/io/qdebug/tst_qdebug.cpp16
-rw-r--r--tests/auto/corelib/io/qdir/tst_qdir.cpp1
-rw-r--r--tests/auto/corelib/io/qfile/.gitignore8
-rw-r--r--tests/auto/corelib/io/qfile/qfile.pro3
-rw-r--r--tests/auto/corelib/io/qfile/stdinprocess/main.cpp2
-rw-r--r--tests/auto/corelib/io/qfile/stdinprocess/stdinprocess.pro6
-rw-r--r--tests/auto/corelib/io/qfile/test.pro26
-rw-r--r--tests/auto/corelib/io/qfile/test/test.pro25
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp49
-rw-r--r--tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp42
-rw-r--r--tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp3
-rw-r--r--tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp7
-rw-r--r--tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp2
-rw-r--r--tests/auto/corelib/io/qresourceengine/qresourceengine.pro27
-rw-r--r--tests/auto/corelib/io/qresourceengine/qresourceengine_test.pro33
-rw-r--r--tests/auto/corelib/io/qresourceengine/staticplugin/.gitignore1
-rw-r--r--tests/auto/corelib/io/qresourceengine/staticplugin/main.cpp9
-rw-r--r--tests/auto/corelib/io/qresourceengine/staticplugin/staticplugin.json1
-rw-r--r--tests/auto/corelib/io/qresourceengine/staticplugin/staticplugin.pro8
-rw-r--r--tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp14
-rw-r--r--tests/auto/corelib/io/qsettings/qsettings.pro2
-rw-r--r--tests/auto/corelib/io/qsettings/tst_qsettings.cpp6
-rw-r--r--tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp2
-rw-r--r--tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp2
-rw-r--r--tests/auto/corelib/io/qurl/tst_qurl.cpp52
-rw-r--r--tests/auto/corelib/itemmodels/itemmodels.pro7
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel/.gitignore1
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel/qsortfilterproxymodel.pro9
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp (renamed from tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp)511
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h189
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel_regexp/.gitignore1
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel_regexp/qsortfilterproxymodel_regexp.pro16
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel_regexp/tst_qsortfilterproxymodel_regexp.cpp69
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel_regularexpression/.gitignore1
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel_regularexpression/qsortfilterproxymodel_regularexpression.pro16
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel_regularexpression/tst_qsortfilterproxymodel_regularexpression.cpp (renamed from tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.h)67
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp4
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h2
-rw-r--r--tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST1
-rw-r--r--tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST3
-rw-r--r--tests/auto/corelib/kernel/qmetaenum/tst_qmetaenum.cpp23
-rw-r--r--tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp42
-rw-r--r--tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp2
-rw-r--r--tests/auto/corelib/kernel/qmetatype/qmetatype.pro2
-rw-r--r--tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp247
-rw-r--r--tests/auto/corelib/kernel/qmetatype/tst_qmetatype.h18
-rw-r--r--tests/auto/corelib/kernel/qobject/.gitignore8
-rw-r--r--tests/auto/corelib/kernel/qobject/qobject.pro8
-rw-r--r--tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro7
-rw-r--r--tests/auto/corelib/kernel/qobject/test.pro (renamed from tests/auto/corelib/kernel/qobject/test/test.pro)6
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp85
-rw-r--r--tests/auto/corelib/kernel/qsharedmemory/producerconsumer/main.cpp (renamed from tests/auto/corelib/kernel/qsharedmemory/sharedmemoryhelper/main.cpp)0
-rw-r--r--tests/auto/corelib/kernel/qsharedmemory/producerconsumer/producerconsumer.pro5
-rw-r--r--tests/auto/corelib/kernel/qsharedmemory/qsharedmemory.pro4
-rw-r--r--tests/auto/corelib/kernel/qsharedmemory/sharedmemoryhelper/sharedmemoryhelper.pro17
-rw-r--r--tests/auto/corelib/kernel/qsharedmemory/test.pro8
-rw-r--r--tests/auto/corelib/kernel/qsharedmemory/test/test.pro18
-rw-r--r--tests/auto/corelib/kernel/qsharedmemory/tst_qsharedmemory.cpp (renamed from tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp)20
-rw-r--r--tests/auto/corelib/kernel/qsystemsemaphore/acquirerelease/acquirerelease.pro5
-rw-r--r--tests/auto/corelib/kernel/qsystemsemaphore/acquirerelease/main.cpp (renamed from tests/auto/corelib/kernel/qsystemsemaphore/systemsemaphorehelper/main.cpp)0
-rw-r--r--tests/auto/corelib/kernel/qsystemsemaphore/qsystemsemaphore.pro2
-rw-r--r--tests/auto/corelib/kernel/qsystemsemaphore/systemsemaphorehelper/systemsemaphorehelper.pro17
-rw-r--r--tests/auto/corelib/kernel/qsystemsemaphore/test.pro7
-rw-r--r--tests/auto/corelib/kernel/qsystemsemaphore/test/test.pro17
-rw-r--r--tests/auto/corelib/kernel/qsystemsemaphore/tst_qsystemsemaphore.cpp (renamed from tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp)17
-rw-r--r--tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp29
-rw-r--r--tests/auto/corelib/kernel/qtranslator/android_testdata.qrc1
-rw-r--r--tests/auto/corelib/kernel/qtranslator/hellotr_empty.qm1
-rw-r--r--tests/auto/corelib/kernel/qtranslator/hellotr_empty.ts3
-rw-r--r--tests/auto/corelib/kernel/qtranslator/qtranslator.pro2
-rw-r--r--tests/auto/corelib/kernel/qtranslator/qtranslator.qrc1
-rw-r--r--tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp58
-rw-r--r--tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp8
-rw-r--r--tests/auto/corelib/kernel/qwineventnotifier/tst_qwineventnotifier.cpp21
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/magic-and-hierarchy.foo3
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/magic-and-hierarchy.xml21
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/magic-and-hierarchy2.foo3
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/testdata.qrc3
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp21
-rw-r--r--tests/auto/corelib/plugin/plugin.pro3
-rw-r--r--tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp64
-rw-r--r--tests/auto/corelib/plugin/qplugin/tst_qplugin.pro2
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.h2
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp39
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/utf8_data.json17
-rw-r--r--tests/auto/corelib/serialization/qcborstreamreader/qcborstreamreader.pro11
-rw-r--r--tests/auto/corelib/serialization/qcborstreamreader/tst_qcborstreamreader.cpp1091
-rw-r--r--tests/auto/corelib/serialization/qcborstreamwriter/qcborstreamwriter.pro8
-rw-r--r--tests/auto/corelib/serialization/qcborstreamwriter/tst_qcborstreamwriter.cpp313
-rw-r--r--tests/auto/corelib/serialization/qcborvalue/qcborvalue.pro11
-rw-r--r--tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp1695
-rw-r--r--tests/auto/corelib/serialization/qcborvalue_json/qcborvalue_json.pro7
-rw-r--r--tests/auto/corelib/serialization/qcborvalue_json/tst_qcborvalue_json.cpp348
-rw-r--r--tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp63
-rw-r--r--tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp12
-rw-r--r--tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp32
-rw-r--r--tests/auto/corelib/serialization/serialization.pro4
-rw-r--r--tests/auto/corelib/thread/qfuture/tst_qfuture.cpp4
-rw-r--r--tests/auto/corelib/thread/qsemaphore/BLACKLIST2
-rw-r--r--tests/auto/corelib/thread/qthreadonce/qthreadonce.cpp3
-rw-r--r--tests/auto/corelib/thread/qthreadonce/qthreadonce.h4
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/crashonexit/crashonexit.pro10
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/test/test.pro17
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp22
-rw-r--r--tests/auto/corelib/thread/thread.pro39
-rw-r--r--tests/auto/corelib/tools/collections/tst_collections.cpp4
-rw-r--r--tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp129
-rw-r--r--tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp24
-rw-r--r--tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp11
-rw-r--r--tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp5
-rw-r--r--tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp5
-rw-r--r--tests/auto/corelib/tools/qlocale/tst_qlocale.cpp695
-rw-r--r--tests/auto/corelib/tools/qmacautoreleasepool/qmacautoreleasepool.pro1
-rw-r--r--tests/auto/corelib/tools/qmakearray/qmakearray.pro4
-rw-r--r--tests/auto/corelib/tools/qmakearray/tst_qmakearray.cpp103
-rw-r--r--tests/auto/corelib/tools/qregularexpression/alwaysoptimize/alwaysoptimize.pro7
-rw-r--r--tests/auto/corelib/tools/qregularexpression/defaultoptimize/defaultoptimize.pro7
-rw-r--r--tests/auto/corelib/tools/qregularexpression/forceoptimize/forceoptimize.pro8
-rw-r--r--tests/auto/corelib/tools/qregularexpression/qregularexpression.pro7
-rw-r--r--tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp293
-rw-r--r--tests/auto/corelib/tools/qscopeguard/qscopeguard.pro4
-rw-r--r--tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp85
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/externaltests.cpp20
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring.cpp99
-rw-r--r--tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp9
-rw-r--r--tests/auto/corelib/tools/qstringview/tst_qstringview.cpp20
-rw-r--r--tests/auto/corelib/tools/qtimeline/BLACKLIST2
-rw-r--r--tests/auto/corelib/tools/qtimezone/qtimezone.pro2
-rw-r--r--tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp25
-rw-r--r--tests/auto/corelib/tools/tools.pro1
-rw-r--r--tests/auto/dbus/qdbusinterface/qdbusinterface/qdbusinterface.pro9
-rw-r--r--tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp10
-rw-r--r--tests/auto/dbus/qdbusinterface/tst_qdbusinterface.cpp27
-rw-r--r--tests/auto/gui/gui.pro2
-rw-r--r--tests/auto/gui/image/qimage/images/jpeg_exif_utf8_comment.jpgbin0 -> 705 bytes
-rw-r--r--tests/auto/gui/image/qimage/qimage.pro3
-rw-r--r--tests/auto/gui/image/qimage/tst_qimage.cpp224
-rw-r--r--tests/auto/gui/image/qimagereader/images/basn0g16.pngbin0 -> 167 bytes
-rw-r--r--tests/auto/gui/image/qimagereader/images/basn2c16.pngbin0 -> 302 bytes
-rw-r--r--tests/auto/gui/image/qimagereader/images/basn4a16.pngbin0 -> 2206 bytes
-rw-r--r--tests/auto/gui/image/qimagereader/images/basn6a16.pngbin0 -> 3435 bytes
-rw-r--r--tests/auto/gui/image/qimagereader/images/kollada-16bpc.pngbin0 -> 24360 bytes
-rw-r--r--tests/auto/gui/image/qimagereader/images/tbwn0g16.pngbin0 -> 1313 bytes
-rw-r--r--tests/auto/gui/image/qimagereader/qimagereader.pro3
-rw-r--r--tests/auto/gui/image/qimagereader/qimagereader.qrc69
-rw-r--r--tests/auto/gui/image/qimagereader/tst_qimagereader.cpp10
-rw-r--r--tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp1
-rw-r--r--tests/auto/gui/image/qpicture/qpicture.pro1
-rw-r--r--tests/auto/gui/image/qpicture/tst_qpicture.cpp38
-rw-r--r--tests/auto/gui/image/qpixmap/tst_qpixmap.cpp22
-rw-r--r--tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp3
-rw-r--r--tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp12
-rw-r--r--tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp26
-rw-r--r--tests/auto/gui/kernel/qguiapplication/BLACKLIST4
-rw-r--r--tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp6
-rw-r--r--tests/auto/gui/kernel/qpalette/tst_qpalette.cpp3
-rw-r--r--tests/auto/gui/kernel/qtouchevent/qtouchevent.pro1
-rw-r--r--tests/auto/gui/kernel/qwindow/BLACKLIST3
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp122
-rw-r--r--tests/auto/gui/painting/qbrush/tst_qbrush.cpp21
-rw-r--r--tests/auto/gui/painting/qcolor/tst_qcolor.cpp20
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp63
-rw-r--r--tests/auto/gui/qopengl/tst_qopengl.cpp79
-rw-r--r--tests/auto/gui/text/qcssparser/tst_qcssparser.cpp6
-rw-r--r--tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp24
-rw-r--r--tests/auto/gui/text/qglyphrun/BLACKLIST3
-rw-r--r--tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp3
-rw-r--r--tests/auto/gui/text/qstatictext/tst_qstatictext.cpp62
-rw-r--r--tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp10
-rw-r--r--tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp12
-rw-r--r--tests/auto/gui/text/qtextdocumentlayout/tst_qtextdocumentlayout.cpp7
-rw-r--r--tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp4
-rw-r--r--tests/auto/gui/util/qdoublevalidator/tst_qdoublevalidator.cpp8
-rw-r--r--tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp8
-rw-r--r--tests/auto/gui/util/qtexturefilereader/qtexturefilereader.pro5
-rw-r--r--tests/auto/gui/util/qtexturefilereader/qtexturefilereader.qrc7
-rw-r--r--tests/auto/gui/util/qtexturefilereader/texturefiles/car.ktxbin0 -> 11908 bytes
-rw-r--r--tests/auto/gui/util/qtexturefilereader/texturefiles/car_mips.ktxbin0 -> 8088 bytes
-rw-r--r--tests/auto/gui/util/qtexturefilereader/texturefiles/pattern.pkmbin0 -> 2064 bytes
-rw-r--r--tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp111
-rw-r--r--tests/auto/gui/util/util.pro2
-rw-r--r--tests/auto/network-settings.h61
-rw-r--r--tests/auto/network/access/hpack/hpack.pro4
-rw-r--r--tests/auto/network/access/hsts/hsts.pro2
-rw-r--r--tests/auto/network/access/http2/http2.pro2
-rw-r--r--tests/auto/network/access/http2/http2srv.cpp32
-rw-r--r--tests/auto/network/access/http2/http2srv.h4
-rw-r--r--tests/auto/network/access/http2/tst_http2.cpp19
-rw-r--r--tests/auto/network/access/qnetworkreply/certs/qt-test-net-cacert.pem16
-rw-r--r--tests/auto/network/access/qnetworkreply/test/test.pro3
-rw-r--r--tests/auto/network/access/qnetworkreply/testserver_index.html3
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp557
-rw-r--r--tests/auto/network/access/qnetworkrequest/tst_qnetworkrequest.cpp96
-rw-r--r--tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp4
-rw-r--r--tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp3
-rw-r--r--tests/auto/network/ssl/qdtls/certs/bogus-ca.crt20
-rw-r--r--tests/auto/network/ssl/qdtls/certs/bogus-ca.key27
-rw-r--r--tests/auto/network/ssl/qdtls/certs/bogus-client.crt19
-rw-r--r--tests/auto/network/ssl/qdtls/certs/bogus-client.key27
-rw-r--r--tests/auto/network/ssl/qdtls/certs/bogus-server.crt19
-rw-r--r--tests/auto/network/ssl/qdtls/certs/bogus-server.key27
-rw-r--r--tests/auto/network/ssl/qdtls/certs/fake-login.live.com.key15
-rw-r--r--tests/auto/network/ssl/qdtls/certs/fake-login.live.com.pem19
-rw-r--r--tests/auto/network/ssl/qdtls/certs/fluke.cert75
-rw-r--r--tests/auto/network/ssl/qdtls/certs/fluke.key15
-rw-r--r--tests/auto/network/ssl/qdtls/certs/ss-srv-cert.pem18
-rw-r--r--tests/auto/network/ssl/qdtls/certs/ss-srv-key.pem18
-rw-r--r--tests/auto/network/ssl/qdtls/qdtls.pro16
-rw-r--r--tests/auto/network/ssl/qdtls/tst_qdtls.cpp1324
-rw-r--r--tests/auto/network/ssl/qdtlscookie/qdtlscookie.pro15
-rw-r--r--tests/auto/network/ssl/qdtlscookie/tst_qdtlscookie.cpp478
-rw-r--r--tests/auto/network/ssl/qpassworddigestor/qpassworddigestor.pro4
-rw-r--r--tests/auto/network/ssl/qpassworddigestor/tst_qpassworddigestor.cpp171
-rw-r--r--tests/auto/network/ssl/qsslcertificate/qsslcertificate.pro1
-rw-r--r--tests/auto/network/ssl/qsslcipher/qsslcipher.pro1
-rw-r--r--tests/auto/network/ssl/qssldiffiehellmanparameters/qssldiffiehellmanparameters.pro1
-rw-r--r--tests/auto/network/ssl/qsslellipticcurve/qsslellipticcurve.pro1
-rw-r--r--tests/auto/network/ssl/qsslerror/qsslerror.pro1
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-MD5-DES.derbin0 -> 243 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-MD5-DES.pem8
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-MD5-RC2-64.derbin0 -> 243 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-MD5-RC2-64.pem8
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-SHA1-DES.derbin0 -> 243 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-SHA1-DES.pem8
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-SHA1-RC2-64.derbin0 -> 243 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-SHA1-RC2-64.pem8
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes128-hmacWithSHA1.derbin0 -> 290 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes128-hmacWithSHA1.pem9
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes128-hmacWithSHA256.derbin0 -> 304 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes128-hmacWithSHA256.pem9
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes256-hmacWithSHA1.derbin0 -> 290 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes256-hmacWithSHA1.pem9
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes256-hmacWithSHA256.derbin0 -> 304 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes256-hmacWithSHA256.pem9
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-des3-hmacWithSHA1.derbin0 -> 281 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-des3-hmacWithSHA1.pem8
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-des3-hmacWithSHA256.derbin0 -> 295 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-des3-hmacWithSHA256.pem9
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-2DES.derbin0 -> 244 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-2DES.pem8
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-3DES.derbin0 -> 244 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-3DES.pem8
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-128.derbin0 -> 244 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-128.pem8
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-40.derbin0 -> 244 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-40.pem8
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-128.derbin0 -> 237 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-128.pem7
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-40.derbin0 -> 237 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-40.pem7
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-rc2-hmacWithSHA1.derbin0 -> 289 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-rc2-hmacWithSHA1.pem9
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-rc2-hmacWithSHA256.derbin0 -> 303 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-rc2-hmacWithSHA256.pem9
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8.derbin0 -> 201 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8.pem7
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-MD5-DES.derbin0 -> 163 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-MD5-DES.pem6
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-MD5-RC2-64.derbin0 -> 163 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-MD5-RC2-64.pem6
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-SHA1-DES.derbin0 -> 163 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-SHA1-DES.pem6
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-SHA1-RC2-64.derbin0 -> 163 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-SHA1-RC2-64.pem6
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes128-hmacWithSHA1.derbin0 -> 209 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes128-hmacWithSHA1.pem7
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes128-hmacWithSHA256.derbin0 -> 223 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes128-hmacWithSHA256.pem7
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes256-hmacWithSHA1.derbin0 -> 209 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes256-hmacWithSHA1.pem7
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes256-hmacWithSHA256.derbin0 -> 223 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes256-hmacWithSHA256.pem7
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-des3-hmacWithSHA1.derbin0 -> 200 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-des3-hmacWithSHA1.pem7
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-des3-hmacWithSHA256.derbin0 -> 214 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-des3-hmacWithSHA256.pem7
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-2DES.derbin0 -> 164 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-2DES.pem6
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-3DES.derbin0 -> 164 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-3DES.pem6
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC2-128.derbin0 -> 164 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC2-128.pem6
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC2-40.derbin0 -> 164 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC2-40.pem6
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC4-128.derbin0 -> 157 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC4-128.pem6
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC4-40.derbin0 -> 157 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC4-40.pem6
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-rc2-hmacWithSHA1.derbin0 -> 208 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-rc2-hmacWithSHA1.pem7
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-rc2-hmacWithSHA256.derbin0 -> 222 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-rc2-hmacWithSHA256.pem7
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8.derbin0 -> 122 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8.pem5
-rwxr-xr-xtests/auto/network/ssl/qsslkey/keys/genkeys.sh55
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-MD5-DES.derbin0 -> 389 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-MD5-DES.pem11
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-MD5-RC2-64.derbin0 -> 389 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-MD5-RC2-64.pem11
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-SHA1-DES.derbin0 -> 389 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-SHA1-DES.pem11
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-SHA1-RC2-64.derbin0 -> 389 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-SHA1-RC2-64.pem11
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes128-hmacWithSHA1.derbin0 -> 435 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes128-hmacWithSHA1.pem12
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes128-hmacWithSHA256.derbin0 -> 449 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes128-hmacWithSHA256.pem12
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes256-hmacWithSHA1.derbin0 -> 435 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes256-hmacWithSHA1.pem12
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes256-hmacWithSHA256.derbin0 -> 449 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes256-hmacWithSHA256.pem12
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-des3-hmacWithSHA1.derbin0 -> 426 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-des3-hmacWithSHA1.pem11
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-des3-hmacWithSHA256.derbin0 -> 440 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-des3-hmacWithSHA256.pem12
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-2DES.derbin0 -> 390 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-2DES.pem11
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-3DES.derbin0 -> 390 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-3DES.pem11
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-128.derbin0 -> 390 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-128.pem11
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-40.derbin0 -> 390 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-40.pem11
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-128.derbin0 -> 384 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-128.pem10
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-40.derbin0 -> 384 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-40.pem10
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-rc2-hmacWithSHA1.derbin0 -> 426 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-rc2-hmacWithSHA1.pem11
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-rc2-hmacWithSHA256.derbin0 -> 440 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-rc2-hmacWithSHA256.pem12
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8.derbin0 -> 345 bytes
-rw-r--r--tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8.pem10
-rw-r--r--tests/auto/network/ssl/qsslkey/qsslkey.pro1
-rw-r--r--tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp52
-rw-r--r--tests/auto/network/ssl/qsslsocket/qsslsocket.pro1
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp111
-rw-r--r--tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro1
-rw-r--r--tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro1
-rw-r--r--tests/auto/network/ssl/ssl.pro11
-rw-r--r--tests/auto/opengl/qgl/BLACKLIST1
-rw-r--r--tests/auto/opengl/qglthreads/tst_qglthreads.cpp7
-rw-r--r--tests/auto/other/gestures/BLACKLIST12
-rw-r--r--tests/auto/other/lancelot/paintcommands.cpp49
-rw-r--r--tests/auto/other/lancelot/paintcommands.h2
-rw-r--r--tests/auto/other/lancelot/scripts/gradientxform_object.qps15
-rw-r--r--tests/auto/other/lancelot/scripts/image_dpr.qps43
-rw-r--r--tests/auto/other/macnativeevents/macnativeevents.pro2
-rw-r--r--tests/auto/other/other.pro8
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp4
-rw-r--r--tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp55
-rw-r--r--tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm4
-rw-r--r--tests/auto/other/qfocusevent/BLACKLIST1
-rw-r--r--tests/auto/other/qfocusevent/tst_qfocusevent.cpp5
-rw-r--r--tests/auto/printsupport/dialogs/qabstractprintdialog/tst_qabstractprintdialog.cpp3
-rw-r--r--tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp4
-rw-r--r--tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp20
-rw-r--r--tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp64
-rw-r--r--tests/auto/sql/kernel/qsqlresult/qsqlresult.pro2
-rw-r--r--tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp2
-rw-r--r--tests/auto/sql/models/qsqlrelationaldelegate/qsqlrelationaldelegate.pro5
-rw-r--r--tests/auto/sql/models/qsqlrelationaldelegate/tst_qsqlrelationaldelegate.cpp170
-rw-r--r--tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp47
-rw-r--r--tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp62
-rw-r--r--tests/auto/testlib/selftests/expected_assert.tap16
-rw-r--r--tests/auto/testlib/selftests/expected_badxml.tap61
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibcounting.tap17
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibeventcounter.tap15
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibtickcounter.tap9
-rw-r--r--tests/auto/testlib/selftests/expected_benchlibwalltime.tap11
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.lightxml36
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.tap456
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.teamcity16
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.txt20
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.xml36
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.xunitxml18
-rw-r--r--tests/auto/testlib/selftests/expected_commandlinedata.tap20
-rw-r--r--tests/auto/testlib/selftests/expected_counting.tap118
-rw-r--r--tests/auto/testlib/selftests/expected_crashes_4.txt7
-rw-r--r--tests/auto/testlib/selftests/expected_datatable.tap183
-rw-r--r--tests/auto/testlib/selftests/expected_datetime.tap46
-rw-r--r--tests/auto/testlib/selftests/expected_exceptionthrow.tap14
-rw-r--r--tests/auto/testlib/selftests/expected_expectfail.tap96
-rw-r--r--tests/auto/testlib/selftests/expected_failcleanup.tap20
-rw-r--r--tests/auto/testlib/selftests/expected_failinit.tap19
-rw-r--r--tests/auto/testlib/selftests/expected_failinitdata.tap18
-rw-r--r--tests/auto/testlib/selftests/expected_fetchbogus.tap15
-rw-r--r--tests/auto/testlib/selftests/expected_findtestdata.tap10
-rw-r--r--tests/auto/testlib/selftests/expected_float.tap82
-rw-r--r--tests/auto/testlib/selftests/expected_globaldata.tap52
-rw-r--r--tests/auto/testlib/selftests/expected_keyboard.lightxml18
-rw-r--r--tests/auto/testlib/selftests/expected_keyboard.tap9
-rw-r--r--tests/auto/testlib/selftests/expected_keyboard.teamcity8
-rw-r--r--tests/auto/testlib/selftests/expected_keyboard.txt7
-rw-r--r--tests/auto/testlib/selftests/expected_keyboard.xml21
-rw-r--r--tests/auto/testlib/selftests/expected_keyboard.xunitxml12
-rw-r--r--tests/auto/testlib/selftests/expected_longstring.tap23
-rw-r--r--tests/auto/testlib/selftests/expected_maxwarnings.tap2011
-rw-r--r--tests/auto/testlib/selftests/expected_pairdiagnostics.tap32
-rw-r--r--tests/auto/testlib/selftests/expected_singleskip.tap9
-rw-r--r--tests/auto/testlib/selftests/expected_skip.tap13
-rw-r--r--tests/auto/testlib/selftests/expected_skipcleanup.tap9
-rw-r--r--tests/auto/testlib/selftests/expected_skipinit.tap8
-rw-r--r--tests/auto/testlib/selftests/expected_skipinitdata.tap7
-rw-r--r--tests/auto/testlib/selftests/expected_sleep.tap9
-rw-r--r--tests/auto/testlib/selftests/expected_strcmp.tap87
-rw-r--r--tests/auto/testlib/selftests/expected_subtest.tap68
-rw-r--r--tests/auto/testlib/selftests/expected_tuplediagnostics.lightxml34
-rw-r--r--tests/auto/testlib/selftests/expected_tuplediagnostics.tap33
-rw-r--r--tests/auto/testlib/selftests/expected_tuplediagnostics.teamcity14
-rw-r--r--tests/auto/testlib/selftests/expected_tuplediagnostics.txt15
-rw-r--r--tests/auto/testlib/selftests/expected_tuplediagnostics.xml37
-rw-r--r--tests/auto/testlib/selftests/expected_tuplediagnostics.xunitxml22
-rw-r--r--tests/auto/testlib/selftests/expected_verbose1.tap118
-rw-r--r--tests/auto/testlib/selftests/expected_verbose2.tap136
-rw-r--r--tests/auto/testlib/selftests/expected_verifyexceptionthrown.tap53
-rw-r--r--tests/auto/testlib/selftests/expected_warnings.tap42
-rw-r--r--tests/auto/testlib/selftests/expected_xunit.tap44
-rwxr-xr-xtests/auto/testlib/selftests/generate_expected_output.py28
-rw-r--r--tests/auto/testlib/selftests/keyboard/keyboard.pro7
-rw-r--r--tests/auto/testlib/selftests/keyboard/tst_keyboard.cpp88
-rw-r--r--tests/auto/testlib/selftests/selftests.pri8
-rw-r--r--tests/auto/testlib/selftests/selftests.qrc219
-rw-r--r--tests/auto/testlib/selftests/test/test.pro4
-rw-r--r--tests/auto/testlib/selftests/tst_selftests.cpp395
-rw-r--r--tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp (renamed from tests/auto/corelib/tools/qregularexpression/alwaysoptimize/tst_qregularexpression_alwaysoptimize.cpp)36
-rw-r--r--tests/auto/testlib/selftests/tuplediagnostics/tuplediagnostics.pro6
-rw-r--r--tests/auto/testserver.pri109
-rw-r--r--tests/auto/tools/moc/cxx11-enums.h7
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp34
-rw-r--r--tests/auto/tools/qmakelib/evaltest.cpp72
-rw-r--r--tests/auto/tools/uic/baseline/Dialog_with_Buttons_Bottom.ui.h4
-rw-r--r--tests/auto/tools/uic/baseline/Dialog_with_Buttons_Right.ui.h4
-rw-r--r--tests/auto/tools/uic/baseline/Dialog_without_Buttons.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/Main_Window.ui.h8
-rw-r--r--tests/auto/tools/uic/baseline/Widget.ui.h10
-rw-r--r--tests/auto/tools/uic/baseline/addlinkdialog.ui.h18
-rw-r--r--tests/auto/tools/uic/baseline/addtorrentform.ui.h48
-rw-r--r--tests/auto/tools/uic/baseline/authenticationdialog.ui.h20
-rw-r--r--tests/auto/tools/uic/baseline/backside.ui.h30
-rw-r--r--tests/auto/tools/uic/baseline/batchtranslation.ui.h34
-rw-r--r--tests/auto/tools/uic/baseline/bookmarkdialog.ui.h32
-rw-r--r--tests/auto/tools/uic/baseline/bookwindow.ui.h36
-rw-r--r--tests/auto/tools/uic/baseline/browserwidget.ui.h26
-rw-r--r--tests/auto/tools/uic/baseline/bug18156QTreeWidget.ui.h8
-rw-r--r--tests/auto/tools/uic/baseline/buttongroup.ui.h56
-rw-r--r--tests/auto/tools/uic/baseline/calculator.ui.h58
-rw-r--r--tests/auto/tools/uic/baseline/calculatorform.ui.h38
-rw-r--r--tests/auto/tools/uic/baseline/certificateinfo.ui.h20
-rw-r--r--tests/auto/tools/uic/baseline/chatdialog.ui.h16
-rw-r--r--tests/auto/tools/uic/baseline/chatmainwindow.ui.h32
-rw-r--r--tests/auto/tools/uic/baseline/chatsetnickname.ui.h16
-rw-r--r--tests/auto/tools/uic/baseline/config.ui.h104
-rw-r--r--tests/auto/tools/uic/baseline/connectdialog.ui.h28
-rw-r--r--tests/auto/tools/uic/baseline/controller.ui.h14
-rw-r--r--tests/auto/tools/uic/baseline/cookies.ui.h16
-rw-r--r--tests/auto/tools/uic/baseline/cookiesexceptions.ui.h36
-rw-r--r--tests/auto/tools/uic/baseline/default.ui.h52
-rw-r--r--tests/auto/tools/uic/baseline/dialog.ui.h10
-rw-r--r--tests/auto/tools/uic/baseline/downloaditem.ui.h22
-rw-r--r--tests/auto/tools/uic/baseline/downloads.ui.h12
-rw-r--r--tests/auto/tools/uic/baseline/embeddeddialog.ui.h20
-rw-r--r--tests/auto/tools/uic/baseline/enumnostdset.ui.h4
-rw-r--r--tests/auto/tools/uic/baseline/filespage.ui.h12
-rw-r--r--tests/auto/tools/uic/baseline/filternamedialog.ui.h12
-rw-r--r--tests/auto/tools/uic/baseline/filterpage.ui.h18
-rw-r--r--tests/auto/tools/uic/baseline/finddialog.ui.h32
-rw-r--r--tests/auto/tools/uic/baseline/form.ui.h20
-rw-r--r--tests/auto/tools/uic/baseline/formwindowsettings.ui.h56
-rw-r--r--tests/auto/tools/uic/baseline/generalpage.ui.h12
-rw-r--r--tests/auto/tools/uic/baseline/gridalignment.ui.h12
-rw-r--r--tests/auto/tools/uic/baseline/gridpanel.ui.h26
-rw-r--r--tests/auto/tools/uic/baseline/helpdialog.ui.h60
-rw-r--r--tests/auto/tools/uic/baseline/history.ui.h16
-rw-r--r--tests/auto/tools/uic/baseline/icontheme.ui.h20
-rw-r--r--tests/auto/tools/uic/baseline/idbased.ui.h6
-rw-r--r--tests/auto/tools/uic/baseline/identifierpage.ui.h12
-rw-r--r--tests/auto/tools/uic/baseline/imagedialog.ui.h36
-rw-r--r--tests/auto/tools/uic/baseline/inputpage.ui.h12
-rw-r--r--tests/auto/tools/uic/baseline/installdialog.ui.h26
-rw-r--r--tests/auto/tools/uic/baseline/languagesdialog.ui.h26
-rw-r--r--tests/auto/tools/uic/baseline/listwidgeteditor.ui.h28
-rw-r--r--tests/auto/tools/uic/baseline/mainwindow.ui.h88
-rw-r--r--tests/auto/tools/uic/baseline/mydialog.ui.h8
-rw-r--r--tests/auto/tools/uic/baseline/myform.ui.h26
-rw-r--r--tests/auto/tools/uic/baseline/newactiondialog.ui.h24
-rw-r--r--tests/auto/tools/uic/baseline/newdynamicpropertydialog.ui.h18
-rw-r--r--tests/auto/tools/uic/baseline/newform.ui.h16
-rw-r--r--tests/auto/tools/uic/baseline/orderdialog.ui.h18
-rw-r--r--tests/auto/tools/uic/baseline/outputpage.ui.h12
-rw-r--r--tests/auto/tools/uic/baseline/pagefold.ui.h56
-rw-r--r--tests/auto/tools/uic/baseline/paletteeditor.ui.h32
-rw-r--r--tests/auto/tools/uic/baseline/passworddialog.ui.h20
-rw-r--r--tests/auto/tools/uic/baseline/pathpage.ui.h16
-rw-r--r--tests/auto/tools/uic/baseline/phrasebookbox.ui.h32
-rw-r--r--tests/auto/tools/uic/baseline/pixmapfunction.ui47
-rw-r--r--tests/auto/tools/uic/baseline/pixmapfunction.ui.h74
-rw-r--r--tests/auto/tools/uic/baseline/plugindialog.ui.h14
-rw-r--r--tests/auto/tools/uic/baseline/preferencesdialog.ui.h36
-rw-r--r--tests/auto/tools/uic/baseline/previewconfigurationwidget.ui.h26
-rw-r--r--tests/auto/tools/uic/baseline/previewdialogbase.ui.h26
-rw-r--r--tests/auto/tools/uic/baseline/previewwidget.ui.h42
-rw-r--r--tests/auto/tools/uic/baseline/proxy.ui.h18
-rw-r--r--tests/auto/tools/uic/baseline/qfiledialog.ui.h54
-rw-r--r--tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h86
-rw-r--r--tests/auto/tools/uic/baseline/qprintpropertieswidget.ui.h18
-rw-r--r--tests/auto/tools/uic/baseline/qprintsettingsoutput.ui.h66
-rw-r--r--tests/auto/tools/uic/baseline/qprintwidget.ui.h32
-rw-r--r--tests/auto/tools/uic/baseline/qsqlconnectiondialog.ui.h42
-rw-r--r--tests/auto/tools/uic/baseline/qtgradientdialog.ui.h8
-rw-r--r--tests/auto/tools/uic/baseline/qtgradienteditor.ui.h188
-rw-r--r--tests/auto/tools/uic/baseline/qtgradientview.ui.h16
-rw-r--r--tests/auto/tools/uic/baseline/qtgradientviewdialog.ui.h8
-rw-r--r--tests/auto/tools/uic/baseline/qtresourceeditordialog.ui.h32
-rw-r--r--tests/auto/tools/uic/baseline/qttoolbardialog.ui.h36
-rw-r--r--tests/auto/tools/uic/baseline/qttrid.ui.h56
-rw-r--r--tests/auto/tools/uic/baseline/querywidget.ui.h36
-rw-r--r--tests/auto/tools/uic/baseline/remotecontrol.ui.h56
-rw-r--r--tests/auto/tools/uic/baseline/saveformastemplate.ui.h18
-rw-r--r--tests/auto/tools/uic/baseline/settings.ui.h34
-rw-r--r--tests/auto/tools/uic/baseline/signalslotdialog.ui.h30
-rw-r--r--tests/auto/tools/uic/baseline/sslclient.ui.h36
-rw-r--r--tests/auto/tools/uic/baseline/sslerrors.ui.h16
-rw-r--r--tests/auto/tools/uic/baseline/statistics.ui.h42
-rw-r--r--tests/auto/tools/uic/baseline/stringlisteditor.ui.h32
-rw-r--r--tests/auto/tools/uic/baseline/stylesheeteditor.ui.h18
-rw-r--r--tests/auto/tools/uic/baseline/tabbedbrowser.ui.h28
-rw-r--r--tests/auto/tools/uic/baseline/tablewidgeteditor.ui.h66
-rw-r--r--tests/auto/tools/uic/baseline/tetrixwindow.ui.h30
-rw-r--r--tests/auto/tools/uic/baseline/textfinder.ui.h14
-rw-r--r--tests/auto/tools/uic/baseline/topicchooser.ui.h20
-rw-r--r--tests/auto/tools/uic/baseline/translatedialog.ui.h34
-rw-r--r--tests/auto/tools/uic/baseline/translation/Dialog_without_Buttons_tr.h2
-rw-r--r--tests/auto/tools/uic/baseline/translationsettings.ui.h18
-rw-r--r--tests/auto/tools/uic/baseline/treewidgeteditor.ui.h56
-rw-r--r--tests/auto/tools/uic/baseline/trpreviewtool.ui.h38
-rw-r--r--tests/auto/tools/uic/baseline/validators.ui.h86
-rw-r--r--tests/auto/tools/uic/baseline/wateringconfigdialog.ui.h46
-rw-r--r--tests/auto/widgets/dialogs/dialogs.pro1
-rw-r--r--tests/auto/widgets/dialogs/qcolordialog/qcolordialog.pro2
-rw-r--r--tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp6
-rw-r--r--tests/auto/widgets/dialogs/qdialog/BLACKLIST2
-rw-r--r--tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp11
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp96
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog2/BLACKLIST2
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp79
-rw-r--r--tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp9
-rw-r--r--tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp3
-rw-r--r--tests/auto/widgets/effects/qgraphicseffect/BLACKLIST3
-rw-r--r--tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp4
-rw-r--r--tests/auto/widgets/graphicsview/graphicsview.pro2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp65
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsproxywidget/qgraphicsproxywidget.pro1
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp128
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST12
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp42
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp3
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp26
-rw-r--r--tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp9
-rw-r--r--tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp18
-rw-r--r--tests/auto/widgets/itemviews/qheaderview/BLACKLIST3
-rw-r--r--tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp72
-rw-r--r--tests/auto/widgets/itemviews/qitemdelegate/BLACKLIST1
-rw-r--r--tests/auto/widgets/itemviews/qitemview/BLACKLIST2
-rw-r--r--tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp31
-rw-r--r--tests/auto/widgets/itemviews/qlistview/qlistview.pro1
-rw-r--r--tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp86
-rw-r--r--tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp21
-rw-r--r--tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp64
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/BLACKLIST2
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp11
-rw-r--r--tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp66
-rw-r--r--tests/auto/widgets/kernel/qapplication/BLACKLIST1
-rw-r--r--tests/auto/widgets/kernel/qapplication/desktopsettingsaware/desktopsettingsaware.pro12
-rw-r--r--tests/auto/widgets/kernel/qapplication/modal/modal.pro12
-rw-r--r--tests/auto/widgets/kernel/qapplication/test/test.pro26
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp56
-rw-r--r--tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp20
-rw-r--r--tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp3
-rw-r--r--tests/auto/widgets/kernel/qgesturerecognizer/BLACKLIST2
-rw-r--r--tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp2
-rw-r--r--tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp12
-rw-r--r--tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp7
-rw-r--r--tests/auto/widgets/kernel/qwidget/BLACKLIST39
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp193
-rw-r--r--tests/auto/widgets/kernel/qwidget_window/BLACKLIST3
-rw-r--r--tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp133
-rw-r--r--tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp12
-rw-r--r--tests/auto/widgets/styles/qstyle/tst_qstyle.cpp10
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/images/testimage.pngbin299 -> 300 bytes
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/images/testimage@2x.pngbin0 -> 318 bytes
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/resources.qrc1
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp88
-rw-r--r--tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp9
-rw-r--r--tests/auto/widgets/widgets/qabstractscrollarea/tst_qabstractscrollarea.cpp4
-rw-r--r--tests/auto/widgets/widgets/qcalendarwidget/tst_qcalendarwidget.cpp7
-rw-r--r--tests/auto/widgets/widgets/qcombobox/qcombobox.pro3
-rw-r--r--tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp57
-rw-r--r--tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp632
-rw-r--r--tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp23
-rw-r--r--tests/auto/widgets/widgets/qdoublespinbox/BLACKLIST2
-rw-r--r--tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp635
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp91
-rw-r--r--tests/auto/widgets/widgets/qmainwindow/BLACKLIST2
-rw-r--r--tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp10
-rw-r--r--tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp29
-rw-r--r--tests/auto/widgets/widgets/qmdisubwindow/qmdisubwindow.pro2
-rw-r--r--tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp40
-rw-r--r--tests/auto/widgets/widgets/qmenu/BLACKLIST2
-rw-r--r--tests/auto/widgets/widgets/qmenu/qmenu.pro2
-rw-r--r--tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp181
-rw-r--r--tests/auto/widgets/widgets/qmenubar/BLACKLIST3
-rw-r--r--tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp7
-rw-r--r--tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp3
-rw-r--r--tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp3
-rw-r--r--tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp2
-rw-r--r--tests/auto/widgets/widgets/qsizegrip/BLACKLIST2
-rw-r--r--tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp11
-rw-r--r--tests/auto/widgets/widgets/qspinbox/BLACKLIST3
-rw-r--r--tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp589
-rw-r--r--tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp6
-rw-r--r--tests/auto/widgets/widgets/qstatusbar/tst_qstatusbar.cpp3
-rw-r--r--tests/auto/widgets/widgets/qtextbrowser/qtextbrowser.pro2
-rw-r--r--tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp40
-rw-r--r--tests/auto/widgets/widgets/qtextedit/qtextedit.pro2
-rw-r--r--tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp6
-rw-r--r--tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp3
-rw-r--r--tests/auto/widgets/widgets/widgets.pro2
658 files changed, 21725 insertions, 4173 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index fbd89e4045..9eb741edac 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -23,12 +23,12 @@ uikit: SUBDIRS = corelib gui
cross_compile: SUBDIRS -= tools cmake installed_cmake
else:!qtConfig(process): SUBDIRS -= tools
-!qtHaveModule(opengl): SUBDIRS -= opengl
+winrt|!qtHaveModule(opengl): SUBDIRS -= opengl
!qtHaveModule(gui): SUBDIRS -= gui
!qtHaveModule(widgets): SUBDIRS -= widgets
!qtHaveModule(printsupport): SUBDIRS -= printsupport
!qtHaveModule(concurrent): SUBDIRS -= concurrent
-!qtHaveModule(network): SUBDIRS -= network
+winrt|!qtHaveModule(network): SUBDIRS -= network
!qtHaveModule(dbus): SUBDIRS -= dbus
!qtHaveModule(xml): SUBDIRS -= xml
!qtHaveModule(sql): SUBDIRS -= sql
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index 7f685b0338..51d0d2879e 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -146,6 +146,7 @@ endif()
expect_pass(test_interface_link_libraries)
expect_pass(test_moc_macro_target)
+expect_pass(test_add_big_resource)
if (NOT CMAKE_VERSION VERSION_LESS 3.8)
# With earlier CMake versions, this test would simply run moc multiple times and lead to:
diff --git a/tests/auto/cmake/test_add_big_resource/CMakeLists.txt b/tests/auto/cmake/test_add_big_resource/CMakeLists.txt
new file mode 100644
index 0000000000..f928b11278
--- /dev/null
+++ b/tests/auto/cmake/test_add_big_resource/CMakeLists.txt
@@ -0,0 +1,13 @@
+
+cmake_minimum_required(VERSION 2.8)
+
+project(test_add_big_resource)
+
+find_package(Qt5Core REQUIRED)
+
+qt5_wrap_cpp(moc_files myobject.h)
+
+qt5_add_big_resources(rcc_files "test_add_big_resource.qrc" "test_add_big_resource2.qrc")
+
+add_executable(myobject myobject.cpp ${moc_files} ${rcc_files})
+target_link_libraries(myobject ${Qt5Core_LIBRARIES})
diff --git a/tests/auto/corelib/tools/qregularexpression/forceoptimize/tst_qregularexpression_forceoptimize.cpp b/tests/auto/cmake/test_add_big_resource/myobject.cpp
index 38a3a64fa3..5d320b8592 100644
--- a/tests/auto/corelib/tools/qregularexpression/forceoptimize/tst_qregularexpression_forceoptimize.cpp
+++ b/tests/auto/cmake/test_add_big_resource/myobject.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
+** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -26,14 +26,19 @@
**
****************************************************************************/
-#include <QtTest/QtTest>
-#include "../tst_qregularexpression.h"
+#include "myobject.h"
-class tst_QRegularExpression_ForceOptimize : public tst_QRegularExpression
+MyObject::MyObject(QObject *parent)
+ : QObject(parent)
{
- Q_OBJECT
-};
+ emit someSignal();
+}
-QTEST_APPLESS_MAIN(tst_QRegularExpression_ForceOptimize)
-
-#include "tst_qregularexpression_forceoptimize.moc"
+int main(int argc, char **argv)
+{
+ MyObject myObject;
+ // Compile error if the resource file was not created.
+ Q_INIT_RESOURCE(test_add_big_resource);
+ Q_INIT_RESOURCE(test_add_big_resource2);
+ return 0;
+}
diff --git a/tests/auto/corelib/tools/qregularexpression/defaultoptimize/tst_qregularexpression_defaultoptimize.cpp b/tests/auto/cmake/test_add_big_resource/myobject.h
index a815c6cab9..b6fbce32cd 100644
--- a/tests/auto/corelib/tools/qregularexpression/defaultoptimize/tst_qregularexpression_defaultoptimize.cpp
+++ b/tests/auto/cmake/test_add_big_resource/myobject.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2012 Giuseppe D'Angelo <dangelog@gmail.com>.
+** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com>
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -26,14 +26,19 @@
**
****************************************************************************/
-#include <QtTest/QtTest>
-#include "../tst_qregularexpression.h"
+#ifndef MYOBJECT_H
+#define MYOBJECT_H
-class tst_QRegularExpression_DefaultOptimize : public tst_QRegularExpression
+#include <QObject>
+
+class MyObject : public QObject
{
Q_OBJECT
-};
+public:
+ MyObject(QObject *parent = 0);
-QTEST_APPLESS_MAIN(tst_QRegularExpression_DefaultOptimize)
+signals:
+ void someSignal();
+};
-#include "tst_qregularexpression_defaultoptimize.moc"
+#endif
diff --git a/tests/auto/cmake/test_add_big_resource/resource_file.txt b/tests/auto/cmake/test_add_big_resource/resource_file.txt
new file mode 100644
index 0000000000..2c604a4f18
--- /dev/null
+++ b/tests/auto/cmake/test_add_big_resource/resource_file.txt
@@ -0,0 +1 @@
+Ken sent me.
diff --git a/tests/auto/cmake/test_add_big_resource/resource_file2.txt b/tests/auto/cmake/test_add_big_resource/resource_file2.txt
new file mode 100644
index 0000000000..2c604a4f18
--- /dev/null
+++ b/tests/auto/cmake/test_add_big_resource/resource_file2.txt
@@ -0,0 +1 @@
+Ken sent me.
diff --git a/tests/auto/cmake/test_add_big_resource/test_add_big_resource.qrc b/tests/auto/cmake/test_add_big_resource/test_add_big_resource.qrc
new file mode 100644
index 0000000000..00a17f541f
--- /dev/null
+++ b/tests/auto/cmake/test_add_big_resource/test_add_big_resource.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+ <file>resource_file.txt</file>
+</qresource>
+</RCC>
+
diff --git a/tests/auto/cmake/test_add_big_resource/test_add_big_resource2.qrc b/tests/auto/cmake/test_add_big_resource/test_add_big_resource2.qrc
new file mode 100644
index 0000000000..e21cc5e138
--- /dev/null
+++ b/tests/auto/cmake/test_add_big_resource/test_add_big_resource2.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+ <file>resource_file2.txt</file>
+</qresource>
+</RCC>
+
diff --git a/tests/auto/cmake/test_opengl_lib/CMakeLists.txt b/tests/auto/cmake/test_opengl_lib/CMakeLists.txt
index d9adb5a980..d2304a4183 100644
--- a/tests/auto/cmake/test_opengl_lib/CMakeLists.txt
+++ b/tests/auto/cmake/test_opengl_lib/CMakeLists.txt
@@ -8,11 +8,25 @@ find_package(Qt5Gui REQUIRED)
include_directories(${Qt5Gui_INCLUDE_DIRS} ${Qt5Gui_OPENGL_INCLUDE_DIRS} )
add_definitions(${Qt5Gui_DEFINITIONS})
+get_property(QtGui_enabled_features TARGET Qt5::Gui PROPERTY INTERFACE_QT_ENABLED_FEATURES)
+list(LENGTH QtGui_enabled_features _QtGui_enabled_featuresSize)
+if (_QtGui_enabled_featuresSize LESS 1)
+ message(SEND_ERROR "The INTERFACE_QT_ENABLED_FEATURES property of Qt5::Gui is empty!")
+endif()
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Gui_EXECUTABLE_COMPILE_FLAGS}")
if (${Qt5Gui_OPENGL_IMPLEMENTATION} STREQUAL GLESv2)
+ list(FIND QtGui_enabled_features "opengles2" _opengles2Index)
+ if(_opengles2Index EQUAL -1)
+ message(SEND_ERROR "The INTERFACE_QT_ENABLED_FEATURES property of Qt5::Gui does not contain the opengles2 feature!")
+ endif()
add_definitions(-DGL_IMPLEMENTATION_GLES2)
elseif (${Qt5Gui_OPENGL_IMPLEMENTATION} STREQUAL GL)
+ list(FIND QtGui_enabled_features "opengl" _openglIndex)
+ if(_openglIndex EQUAL -1)
+ message(SEND_ERROR "The INTERFACE_QT_ENABLED_FEATURES property of Qt5::Gui does not contain the opengl feature!")
+ endif()
add_definitions(-DGL_IMPLEMENTATION_GL)
else()
message(SEND_ERROR "Qt5Gui_OPENGL_IMPLEMENTATION does not contain valid data.")
diff --git a/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp b/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp
index f539f012df..b864b065e6 100644
--- a/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp
+++ b/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp
@@ -2379,7 +2379,7 @@ void tst_QtConcurrentMap::stlContainers()
InstanceCounter ic_fn(const InstanceCounter & ic)
{
return InstanceCounter(ic);
-};
+}
// Verify that held results are deleted when a future is
// assigned over with operator ==
diff --git a/tests/auto/corelib/animation/qparallelanimationgroup/BLACKLIST b/tests/auto/corelib/animation/qparallelanimationgroup/BLACKLIST
index fe1d5bd968..b5b37b4498 100644
--- a/tests/auto/corelib/animation/qparallelanimationgroup/BLACKLIST
+++ b/tests/auto/corelib/animation/qparallelanimationgroup/BLACKLIST
@@ -1,2 +1,3 @@
[deleteChildrenWithRunningGroup]
osx-10.12
+osx-10.13
diff --git a/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST b/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST
index 2a31afd735..4c999ff88f 100644
--- a/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST
+++ b/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST
@@ -3,5 +3,6 @@ windows
[finishWithUncontrolledAnimation]
windows
osx-10.12
+osx-10.13
[groupWithZeroDurationAnimations]
osx
diff --git a/tests/auto/corelib/codecs/qtextcodec/echo/echo.pro b/tests/auto/corelib/codecs/qtextcodec/echo/echo.pro
index bf791ffc61..512da8939b 100644
--- a/tests/auto/corelib/codecs/qtextcodec/echo/echo.pro
+++ b/tests/auto/corelib/codecs/qtextcodec/echo/echo.pro
@@ -1,6 +1,4 @@
SOURCES += main.cpp
QT = core
-CONFIG -= app_bundle debug_and_release_target
-CONFIG += console
-
+load(qt_test_helper)
diff --git a/tests/auto/corelib/codecs/qtextcodec/qtextcodec.pro b/tests/auto/corelib/codecs/qtextcodec/qtextcodec.pro
index 302d887fc7..15de02a42d 100644
--- a/tests/auto/corelib/codecs/qtextcodec/qtextcodec.pro
+++ b/tests/auto/corelib/codecs/qtextcodec/qtextcodec.pro
@@ -1,2 +1,3 @@
TEMPLATE = subdirs
-SUBDIRS = test echo
+SUBDIRS = test.pro
+unix: SUBDIRS += echo
diff --git a/tests/auto/corelib/codecs/qtextcodec/test.pro b/tests/auto/corelib/codecs/qtextcodec/test.pro
new file mode 100644
index 0000000000..7505c5ad51
--- /dev/null
+++ b/tests/auto/corelib/codecs/qtextcodec/test.pro
@@ -0,0 +1,6 @@
+CONFIG += testcase
+QT = core testlib
+SOURCES = tst_qtextcodec.cpp
+
+TARGET = tst_qtextcodec
+TESTDATA += *.txt
diff --git a/tests/auto/corelib/codecs/qtextcodec/test/test.pro b/tests/auto/corelib/codecs/qtextcodec/test/test.pro
deleted file mode 100644
index e0a1bbd88e..0000000000
--- a/tests/auto/corelib/codecs/qtextcodec/test/test.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-CONFIG += testcase
-QT = core testlib
-SOURCES = ../tst_qtextcodec.cpp
-
-TARGET = ../tst_qtextcodec
-win32 {
- CONFIG(debug, debug|release) {
- TARGET = ../../debug/tst_qtextcodec
- } else {
- TARGET = ../../release/tst_qtextcodec
- }
-}
-TESTDATA += ../*.txt
diff --git a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
index f8f9387abb..6cadebfd7f 100644
--- a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
+++ b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
@@ -2092,7 +2092,7 @@ void tst_QTextCodec::toLocal8Bit()
QSKIP("No qprocess support", SkipAll);
#else
QProcess process;
- process.start("echo/echo");
+ process.start("echo_helper");
QString string(QChar(0x410));
process.write((const char*)string.utf16(), string.length()*2);
@@ -2429,7 +2429,7 @@ void tst_QTextCodec::userCodec()
QVERIFY(!QTextCodec::availableCodecs().contains("UserCodec"));
QVERIFY(!QTextCodec::codecForName("UserCodec"));
- QTextCodec *codec = new UserCodec;
+ UserCodec *codec = new UserCodec;
executedOnce = true;
QList<QByteArray> availableCodecs = QTextCodec::availableCodecs();
@@ -2448,6 +2448,11 @@ void tst_QTextCodec::userCodec()
pcodec = QTextCodec::codecForMib(5000);
QCOMPARE(pcodec, codec);
+
+ delete codec;
+
+ pcodec = QTextCodec::codecForName("UserCodec");
+ QCOMPARE(pcodec, nullptr);
}
struct DontCrashAtExit {
diff --git a/tests/auto/corelib/codecs/utf8/tst_utf8.cpp b/tests/auto/corelib/codecs/utf8/tst_utf8.cpp
index 8f78aa937c..9ce1748e72 100644
--- a/tests/auto/corelib/codecs/utf8/tst_utf8.cpp
+++ b/tests/auto/corelib/codecs/utf8/tst_utf8.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Copyright (C) 2016 Intel Corporation.
+** Copyright (C) 2018 The Qt Company Ltd.
+** Copyright (C) 2018 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -71,7 +71,7 @@ void tst_Utf8::initTestCase()
// is the locale UTF-8?
if (QString(QChar(QChar::ReplacementCharacter)).toLocal8Bit() == "\xEF\xBF\xBD") {
QTest::newRow("localecodec") << true;
- qDebug() << "locale is utf8";
+ qInfo() << "locale is utf8";
}
}
@@ -227,6 +227,15 @@ void tst_Utf8::invalidUtf8()
// GNU libc's iconv is known to accept U+FFFF and U+FFFE encoded as UTF-8
// OS X's iconv is known to accept those, plus surrogates and codepoints above U+10FFFF
if (!useLocale)
+ QVERIFY(decoder->hasFailure() || decoder->needsMoreData());
+ else if (!decoder->hasFailure() && !decoder->needsMoreData())
+ qWarning("System codec does not report failure when it should. Should report bug upstream.");
+
+ // add a continuation character and test that we don't accidentally use it
+ // (buffer overrun)
+ utf8 += char(0x80 | 0x3f);
+ decoder->toUnicode(utf8.constData(), utf8.size() - 1);
+ if (!useLocale)
QVERIFY(decoder->hasFailure());
else if (!decoder->hasFailure())
qWarning("System codec does not report failure when it should. Should report bug upstream.");
diff --git a/tests/auto/corelib/codecs/utf8/utf8data.cpp b/tests/auto/corelib/codecs/utf8/utf8data.cpp
index 2267dc8514..221e1d5579 100644
--- a/tests/auto/corelib/codecs/utf8/utf8data.cpp
+++ b/tests/auto/corelib/codecs/utf8/utf8data.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2018 The Qt Company Ltd.
+** Copyright (C) 2018 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -29,15 +30,24 @@
void loadInvalidUtf8Rows()
{
- QTest::newRow("1char") << QByteArray("\x80");
- QTest::newRow("2chars-1") << QByteArray("\xC2\xC0");
- QTest::newRow("2chars-2") << QByteArray("\xC3\xDF");
- QTest::newRow("2chars-3") << QByteArray("\xC7\xF0");
- QTest::newRow("3chars-1") << QByteArray("\xE0\xA0\xC0");
- QTest::newRow("3chars-2") << QByteArray("\xE0\xC0\xA0");
- QTest::newRow("4chars-1") << QByteArray("\xF0\x90\x80\xC0");
- QTest::newRow("4chars-2") << QByteArray("\xF0\x90\xC0\x80");
- QTest::newRow("4chars-3") << QByteArray("\xF0\xC0\x80\x80");
+ // Wrong continuations
+ QTest::newRow("bad-continuation-1char") << QByteArray("\x80");
+ QTest::newRow("bad-continuation-2chars-1") << QByteArray("\xC2\xC0");
+ QTest::newRow("bad-continuation-2chars-2") << QByteArray("\xC3\xDF");
+ QTest::newRow("bad-continuation-2chars-3") << QByteArray("\xC7\xF0");
+ QTest::newRow("bad-continuation-3chars-1") << QByteArray("\xE0\xA0\xC0");
+ QTest::newRow("bad-continuation-3chars-2") << QByteArray("\xE0\xC0\xA0");
+ QTest::newRow("bad-continuation-4chars-1") << QByteArray("\xF0\x90\x80\xC0");
+ QTest::newRow("bad-continuation-4chars-2") << QByteArray("\xF0\x90\xC0\x80");
+ QTest::newRow("bad-continuation-4chars-3") << QByteArray("\xF0\xC0\x80\x80");
+
+ // Too short
+ QTest::newRow("too-short-2chars") << QByteArray("\xC2");
+ QTest::newRow("too-short-3chars-1") << QByteArray("\xE0");
+ QTest::newRow("too-short-3chars-2") << QByteArray("\xE0\xA0");
+ QTest::newRow("too-short-4chars-1") << QByteArray("\xF0");
+ QTest::newRow("too-short-4chars-2") << QByteArray("\xF0\x90");
+ QTest::newRow("too-short-4chars-3") << QByteArray("\xF0\x90\x80");
// Surrogate pairs must now be present either
// U+D800: 1101 10 0000 00 0000
diff --git a/tests/auto/corelib/global/qflags/tst_qflags.cpp b/tests/auto/corelib/global/qflags/tst_qflags.cpp
index 2f1b56629a..72b086350e 100644
--- a/tests/auto/corelib/global/qflags/tst_qflags.cpp
+++ b/tests/auto/corelib/global/qflags/tst_qflags.cpp
@@ -39,6 +39,7 @@ private slots:
void classEnum();
void initializerLists();
void testSetFlags();
+ void adl();
};
void tst_QFlags::testFlag() const
@@ -120,7 +121,7 @@ void tst_QFlags::constExpr()
QVERIFY(verifyConstExpr<uint(Qt::MouseButtons(Qt::RightButton) & 0xff)>(Qt::RightButton));
QVERIFY(verifyConstExpr<uint(Qt::MouseButtons(Qt::RightButton) | 0xff)>(0xff));
- QVERIFY(!verifyConstExpr<Qt::RightButton>(!Qt::MouseButtons(Qt::LeftButton)));
+ QVERIFY(!verifyConstExpr<Qt::RightButton>(~Qt::MouseButtons(Qt::LeftButton)));
#if defined(__cpp_constexpr) && __cpp_constexpr-0 >= 201304
QVERIFY(verifyConstExpr<uint(testRelaxedConstExpr())>(Qt::MiddleButton));
@@ -304,6 +305,27 @@ void tst_QFlags::testSetFlags()
QVERIFY(!flags.testFlag(MyStrictEnum::StrictFour));
}
+namespace SomeNS {
+enum Foo { Foo_A = 1 << 0, Foo_B = 1 << 1, Foo_C = 1 << 2 };
+
+Q_DECLARE_FLAGS(Foos, Foo)
+Q_DECLARE_OPERATORS_FOR_FLAGS(Foos);
+
+Qt::Alignment alignment()
+{
+ // Checks that the operator| works, despite there is another operator| in this namespace.
+ return Qt::AlignLeft | Qt::AlignTop;
+}
+}
+
+void tst_QFlags::adl()
+{
+ SomeNS::Foos fl = SomeNS::Foo_B | SomeNS::Foo_C;
+ QVERIFY(fl & SomeNS::Foo_B);
+ QVERIFY(!(fl & SomeNS::Foo_A));
+ QCOMPARE(SomeNS::alignment(), Qt::AlignLeft | Qt::AlignTop);
+}
+
// (statically) check QTypeInfo for QFlags instantiations:
enum MyEnum { Zero, One, Two, Four=4 };
Q_DECLARE_FLAGS( MyFlags, MyEnum )
diff --git a/tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp b/tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp
index f02e902468..544cb1bf07 100644
--- a/tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp
+++ b/tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp
@@ -160,8 +160,10 @@ void tst_QGetPutEnv::intValue_data()
// some repetition from what is tested in getSetCheck()
QTest::newRow("empty") << QByteArray() << 0 << false;
- QTest::newRow("spaces-heading") << QByteArray(" 1") << 1 << true;
- QTest::newRow("spaces-trailing") << QByteArray("1 ") << 0 << false;
+ QTest::newRow("spaces-heading") << QByteArray(" \n\r\t1") << 1 << true;
+ QTest::newRow("spaces-trailing") << QByteArray("1 \n\r\t") << 1 << true;
+ QTest::newRow("junk-heading") << QByteArray("x1") << 0 << false;
+ QTest::newRow("junk-trailing") << QByteArray("1x") << 0 << false;
#define ROW(x, i, b) \
QTest::newRow(#x) << QByteArray(#x) << (i) << (b)
diff --git a/tests/auto/corelib/global/qlogging/app/app.pro b/tests/auto/corelib/global/qlogging/app/app.pro
index 30751d89ec..b90b685749 100644
--- a/tests/auto/corelib/global/qlogging/app/app.pro
+++ b/tests/auto/corelib/global/qlogging/app/app.pro
@@ -1,6 +1,15 @@
TEMPLATE = app
-TARGET = app
+debug_and_release {
+ CONFIG(debug, debug|release) {
+ TARGET = ../debug/helper
+ } else {
+ TARGET = ../release/helper
+ }
+} else {
+ TARGET = ../helper
+}
+
QT = core
DESTDIR = ./
diff --git a/tests/auto/corelib/global/qlogging/test/test.pro b/tests/auto/corelib/global/qlogging/test/test.pro
index b48bf82cf9..91896d4494 100644
--- a/tests/auto/corelib/global/qlogging/test/test.pro
+++ b/tests/auto/corelib/global/qlogging/test/test.pro
@@ -1,11 +1,21 @@
CONFIG += testcase
-CONFIG -= debug_and_release_target
qtConfig(c++11): CONFIG += c++11
qtConfig(c++14): CONFIG += c++14
-TARGET = ../tst_qlogging
+debug_and_release {
+ CONFIG(debug, debug|release) {
+ TARGET = ../../debug/tst_qlogging
+ !android:!winrt: TEST_HELPER_INSTALLS = ../debug/helper
+ } else {
+ TARGET = ../../release/tst_qlogging
+ !android:!winrt: TEST_HELPER_INSTALLS = ../release/helper
+ }
+} else {
+ TARGET = ../tst_qlogging
+ !android:!winrt: TEST_HELPER_INSTALLS = ../helper
+}
+
QT = core testlib
SOURCES = ../tst_qlogging.cpp
DEFINES += QT_MESSAGELOGCONTEXT
-!android:!winrt: TEST_HELPER_INSTALLS = ../app/app
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
index e7a3748c30..d3ed1a6d0d 100644
--- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
+++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
@@ -64,7 +64,6 @@ private slots:
void formatLogMessage();
private:
- QString m_appDir;
QStringList m_baseEnvironment;
};
@@ -101,14 +100,6 @@ tst_qmessagehandler::tst_qmessagehandler()
void tst_qmessagehandler::initTestCase()
{
#if QT_CONFIG(process)
-# ifdef Q_OS_ANDROID
- m_appDir = QCoreApplication::applicationDirPath();
-# else // !android
- m_appDir = QFINDTESTDATA("app");
-# endif
- QVERIFY2(!m_appDir.isEmpty(), qPrintable(
- QString::fromLatin1("Couldn't find helper app dir starting from %1.").arg(QDir::currentPath())));
-
m_baseEnvironment = QProcess::systemEnvironment();
for (int i = 0; i < m_baseEnvironment.count(); ++i) {
if (m_baseEnvironment.at(i).startsWith("QT_MESSAGE_PATTERN=")) {
@@ -806,7 +797,7 @@ void tst_qmessagehandler::qMessagePattern_data()
#ifndef QT_NO_DEBUG
QTest::newRow("backtrace") << "[%{backtrace}] %{message}" << true << (QList<QByteArray>()
// MyClass::qt_static_metacall is explicitly marked as hidden in the Q_OBJECT macro
- << "[MyClass::myFunction|MyClass::mySlot1|?app?|" QT_NAMESPACE_STR "QMetaMethod::invoke|" QT_NAMESPACE_STR "QMetaObject::invokeMethod] from_a_function 34");
+ << "[MyClass::myFunction|MyClass::mySlot1|?helper?|" QT_NAMESPACE_STR "QMetaMethod::invoke|" QT_NAMESPACE_STR "QMetaObject::invokeMethod] from_a_function 34");
#endif
QTest::newRow("backtrace depth,separator") << "[%{backtrace depth=2 separator=\"\n\"}] %{message}" << true << (QList<QByteArray>()
@@ -830,10 +821,10 @@ void tst_qmessagehandler::qMessagePattern()
QFETCH(QList<QByteArray>, expected);
QProcess process;
-#ifdef Q_OS_ANDROID
- const QString appExe = m_appDir + "/libapp.so";
-#else // !android
- const QString appExe = m_appDir + "/app";
+#ifndef Q_OS_ANDROID
+ const QString appExe(QLatin1String("helper"));
+#else
+ const QString appExe(QCoreApplication::applicationDirPath() + QLatin1String("/libhelper.so"));
#endif
//
@@ -880,10 +871,10 @@ void tst_qmessagehandler::setMessagePattern()
//
QProcess process;
-#ifdef Q_OS_ANDROID
- const QString appExe = m_appDir + "/libapp.so";
-#else // !android
- const QString appExe = m_appDir + "/app";
+#ifndef Q_OS_ANDROID
+ const QString appExe(QLatin1String("helper"));
+#else
+ const QString appExe(QCoreApplication::applicationDirPath() + QLatin1String("/libhelper.so"));
#endif
// make sure there is no QT_MESSAGE_PATTERN in the environment
diff --git a/tests/auto/corelib/global/qrandomgenerator/tst_qrandomgenerator.cpp b/tests/auto/corelib/global/qrandomgenerator/tst_qrandomgenerator.cpp
index 7a6842d144..7c04611823 100644
--- a/tests/auto/corelib/global/qrandomgenerator/tst_qrandomgenerator.cpp
+++ b/tests/auto/corelib/global/qrandomgenerator/tst_qrandomgenerator.cpp
@@ -52,7 +52,7 @@
// values chosen at random
static const quint32 RandomValue32 = 0x4d1169f1U;
static const quint64 RandomValue64 = Q_UINT64_C(0x3ce63161b998aa91);
-static const double RandomValueFP = double(0.3010463714599609f);
+static const double RandomValueFP = double(0.3010463714599609);
static void setRNGControl(uint v)
{
diff --git a/tests/auto/corelib/global/qtendian/tst_qtendian.cpp b/tests/auto/corelib/global/qtendian/tst_qtendian.cpp
index 6934818dcf..2345bb39c1 100644
--- a/tests/auto/corelib/global/qtendian/tst_qtendian.cpp
+++ b/tests/auto/corelib/global/qtendian/tst_qtendian.cpp
@@ -39,9 +39,17 @@ class tst_QtEndian: public QObject
private slots:
void fromBigEndian();
void fromLittleEndian();
+ void fromBigEndianRegion_data();
+ void fromBigEndianRegion();
+ void fromLittleEndianRegion_data() { fromBigEndianRegion_data(); }
+ void fromLittleEndianRegion();
void toBigEndian();
void toLittleEndian();
+ void toBigEndianRegion_data() { fromBigEndianRegion_data(); }
+ void toBigEndianRegion();
+ void toLittleEndianRegion_data() { fromBigEndianRegion_data(); }
+ void toLittleEndianRegion();
void endianIntegers_data();
void endianIntegers();
@@ -56,18 +64,58 @@ struct TestData
quint16 data16;
quint8 data8;
+ float dataFloat;
+ double dataDouble;
+
quint8 reserved;
};
+template <typename T> T getData(const TestData &d);
+template <> quint8 getData(const TestData &d) { return d.data8; }
+template <> quint16 getData(const TestData &d) { return d.data16; }
+template <> quint32 getData(const TestData &d) { return d.data32; }
+template <> quint64 getData(const TestData &d) { return d.data64; }
+template <> float getData(const TestData &d) { return d.dataFloat; }
+
union RawTestData
{
uchar rawData[sizeof(TestData)];
TestData data;
};
-static const TestData inNativeEndian = { Q_UINT64_C(0x0123456789abcdef), 0x00c0ffee, 0xcafe, 0xcf, '\0' };
-static const RawTestData inBigEndian = { "\x01\x23\x45\x67\x89\xab\xcd\xef" "\x00\xc0\xff\xee" "\xca\xfe" "\xcf" };
-static const RawTestData inLittleEndian = { "\xef\xcd\xab\x89\x67\x45\x23\x01" "\xee\xff\xc0\x00" "\xfe\xca" "\xcf" };
+template <typename Float>
+Float int2Float(typename QIntegerForSizeof<Float>::Unsigned i)
+{
+ Float result = 0;
+ memcpy(reinterpret_cast<char *>(&result), reinterpret_cast<const char *>(&i), sizeof (Float));
+ return result;
+}
+
+static const TestData inNativeEndian = {
+ Q_UINT64_C(0x0123456789abcdef),
+ 0x00c0ffee,
+ 0xcafe,
+ 0xcf,
+ int2Float<float>(0x00c0ffeeU),
+ int2Float<double>(Q_UINT64_C(0x0123456789abcdef)),
+ '\0'
+};
+static const RawTestData inBigEndian = {
+ "\x01\x23\x45\x67\x89\xab\xcd\xef"
+ "\x00\xc0\xff\xee"
+ "\xca\xfe"
+ "\xcf"
+ "\x00\xc0\xff\xee"
+ "\x01\x23\x45\x67\x89\xab\xcd\xef"
+};
+static const RawTestData inLittleEndian = {
+ "\xef\xcd\xab\x89\x67\x45\x23\x01"
+ "\xee\xff\xc0\x00"
+ "\xfe\xca"
+ "\xcf"
+ "\xee\xff\xc0\x00"
+ "\xef\xcd\xab\x89\x67\x45\x23\x01"
+};
#define EXPAND_ENDIAN_TEST(endian) \
do { \
@@ -108,6 +156,106 @@ void tst_QtEndian::fromLittleEndian()
#undef ENDIAN_TEST
+template <typename T>
+void transformRegion_template(T (*transformOne)(T), void (*transformRegion)(const void *, qsizetype, void *))
+{
+ enum { Size = 64 };
+ T source[Size];
+ T dest[Size];
+ T expected = transformOne(getData<T>(inNativeEndian));
+ std::fill_n(source, +Size, getData<T>(inNativeEndian));
+ memset(dest, 0, sizeof(dest));
+
+ auto checkBounds = [&](int from) {
+ for ( ; from < Size; ++from)
+ QCOMPARE(dest[from], T(0));
+ };
+
+ transformRegion(source, 1, dest);
+ QCOMPARE(dest[0], expected);
+ checkBounds(1);
+ memset(dest, 0, sizeof(T));
+
+ transformRegion(source, 2, dest);
+ QCOMPARE(dest[0], expected);
+ QCOMPARE(dest[1], expected);
+ checkBounds(2);
+ memset(dest, 0, sizeof(T) * 2);
+
+ transformRegion(source, 3, dest);
+ QCOMPARE(dest[0], expected);
+ QCOMPARE(dest[1], expected);
+ QCOMPARE(dest[2], expected);
+ checkBounds(3);
+ memset(dest, 0, sizeof(T) * 3);
+
+ transformRegion(source, 4, dest);
+ QCOMPARE(dest[0], expected);
+ QCOMPARE(dest[1], expected);
+ QCOMPARE(dest[2], expected);
+ QCOMPARE(dest[3], expected);
+ checkBounds(4);
+ memset(dest, 0, sizeof(T) * 4);
+
+ transformRegion(source, 8, dest);
+ for (int i = 0; i < 8; ++i)
+ QCOMPARE(dest[i], expected);
+ checkBounds(8);
+ memset(dest, 0, sizeof(T) * 8);
+
+ transformRegion(source, 16, dest);
+ for (int i = 0; i < 16; ++i)
+ QCOMPARE(dest[i], expected);
+ checkBounds(16);
+ memset(dest, 0, sizeof(T) * 16);
+
+ transformRegion(source, 32, dest);
+ for (int i = 0; i < 32; ++i)
+ QCOMPARE(dest[i], expected);
+ checkBounds(32);
+ memset(dest, 0, sizeof(T) * 32);
+
+ transformRegion(source, 64, dest);
+ for (int i = 0; i < 64; ++i)
+ QCOMPARE(dest[i], expected);
+
+ // check transforming in-place
+ memcpy(dest, source, sizeof(dest));
+ transformRegion(dest, 64, dest);
+ for (int i = 0; i < 64; ++i)
+ QCOMPARE(dest[i], expected);
+}
+
+void tst_QtEndian::fromBigEndianRegion_data()
+{
+ QTest::addColumn<int>("size");
+ QTest::newRow("1") << 1;
+ QTest::newRow("2") << 2;
+ QTest::newRow("4") << 4;
+ QTest::newRow("8") << 8;
+}
+
+void tst_QtEndian::fromBigEndianRegion()
+{
+ QFETCH(int, size);
+ switch (size) {
+ case 1: return transformRegion_template<quint8>(qFromBigEndian<quint8>, qFromBigEndian<quint8>);
+ case 2: return transformRegion_template<quint16>(qFromBigEndian<quint16>, qFromBigEndian<quint16>);
+ case 4: return transformRegion_template<quint32>(qFromBigEndian<quint32>, qFromBigEndian<quint32>);
+ case 8: return transformRegion_template<quint64>(qFromBigEndian<quint64>, qFromBigEndian<quint64>);
+ }
+}
+
+void tst_QtEndian::fromLittleEndianRegion()
+{
+ QFETCH(int, size);
+ switch (size) {
+ case 1: return transformRegion_template<quint8>(qFromLittleEndian<quint8>, qFromLittleEndian<quint8>);
+ case 2: return transformRegion_template<quint16>(qFromLittleEndian<quint16>, qFromLittleEndian<quint16>);
+ case 4: return transformRegion_template<quint32>(qFromLittleEndian<quint32>, qFromLittleEndian<quint32>);
+ case 8: return transformRegion_template<quint64>(qFromLittleEndian<quint64>, qFromLittleEndian<quint64>);
+ }
+}
#define ENDIAN_TEST(endian, type, size) \
do { \
@@ -135,6 +283,28 @@ void tst_QtEndian::toLittleEndian()
#undef ENDIAN_TEST
+void tst_QtEndian::toBigEndianRegion()
+{
+ QFETCH(int, size);
+ switch (size) {
+ case 1: return transformRegion_template<quint8>(qToBigEndian<quint8>, qToBigEndian<quint8>);
+ case 2: return transformRegion_template<quint16>(qToBigEndian<quint16>, qToBigEndian<quint16>);
+ case 4: return transformRegion_template<quint32>(qToBigEndian<quint32>, qToBigEndian<quint32>);
+ case 8: return transformRegion_template<quint64>(qToBigEndian<quint64>, qToBigEndian<quint64>);
+ }
+}
+
+void tst_QtEndian::toLittleEndianRegion()
+{
+ QFETCH(int, size);
+ switch (size) {
+ case 1: return transformRegion_template<quint8>(qToLittleEndian<quint8>, qToLittleEndian<quint8>);
+ case 2: return transformRegion_template<quint16>(qToLittleEndian<quint16>, qToLittleEndian<quint16>);
+ case 4: return transformRegion_template<quint32>(qToLittleEndian<quint32>, qToLittleEndian<quint32>);
+ case 8: return transformRegion_template<quint64>(qToLittleEndian<quint64>, qToLittleEndian<quint64>);
+ }
+}
+
void tst_QtEndian::endianIntegers_data()
{
QTest::addColumn<int>("val");
diff --git a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
index b43ea7cfa5..7b8b1df166 100644
--- a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
+++ b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
@@ -38,6 +38,13 @@
class tst_QDebug: public QObject
{
Q_OBJECT
+public:
+ enum EnumType { EnumValue1 = 1, EnumValue2 = 2 };
+ enum FlagType { EnumFlag1 = 1, EnumFlag2 = 2 };
+ Q_ENUM(EnumType)
+ Q_DECLARE_FLAGS(Flags, FlagType)
+ Q_FLAG(Flags)
+
private slots:
void assignment() const;
void warningWithoutDebug() const;
@@ -637,6 +644,15 @@ void tst_QDebug::qDebugQFlags() const
QCOMPARE(s_line, line);
QCOMPARE(QString::fromLatin1(s_function), function);
+ // Test the output of QFlags with an enum not declared with Q_DECLARE_FLAGS and Q_FLAGS
+ QFlags<EnumType> flags2(EnumValue2);
+ qDebug() << flags2;
+ QCOMPARE(s_msg, QString::fromLatin1("QFlags<tst_QDebug::EnumType>(EnumValue2)"));
+
+ // A now for one that was fully declared
+ tst_QDebug::Flags flags3(EnumFlag1);
+ qDebug() << flags3;
+ QCOMPARE(s_msg, QString::fromLatin1("QFlags<tst_QDebug::FlagType>(EnumFlag1)"));
}
void tst_QDebug::textStreamModifiers() const
diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp
index afa15fe895..30f0e447ad 100644
--- a/tests/auto/corelib/io/qdir/tst_qdir.cpp
+++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp
@@ -33,7 +33,6 @@
#include <qdebug.h>
#include <qdir.h>
#include <qfileinfo.h>
-#include <qregexp.h>
#include <qstringlist.h>
#if defined(Q_OS_WIN)
diff --git a/tests/auto/corelib/io/qfile/.gitignore b/tests/auto/corelib/io/qfile/.gitignore
index c508239722..615264e4d4 100644
--- a/tests/auto/corelib/io/qfile/.gitignore
+++ b/tests/auto/corelib/io/qfile/.gitignore
@@ -1,6 +1,10 @@
tst_qfile
-stdinprocess/stdinprocess
-stdinprocess/stdinprocess.exe
+stdinprocess_helper
+stdinprocess_helper.exe
+debug/stdinprocess_helper
+debug/stdinprocess_helper.exe
+release/stdinprocess_helper
+release/stdinprocess_helper.exe
readonlyfile
newfile.txt
appendfile.txt
diff --git a/tests/auto/corelib/io/qfile/qfile.pro b/tests/auto/corelib/io/qfile/qfile.pro
index 0735daedb3..91c5c15f66 100644
--- a/tests/auto/corelib/io/qfile/qfile.pro
+++ b/tests/auto/corelib/io/qfile/qfile.pro
@@ -1,2 +1,3 @@
TEMPLATE = subdirs
-SUBDIRS = test stdinprocess
+SUBDIRS = test.pro
+!winrt: SUBDIRS += stdinprocess
diff --git a/tests/auto/corelib/io/qfile/stdinprocess/main.cpp b/tests/auto/corelib/io/qfile/stdinprocess/main.cpp
index 6ff42c2485..77a1932bd5 100644
--- a/tests/auto/corelib/io/qfile/stdinprocess/main.cpp
+++ b/tests/auto/corelib/io/qfile/stdinprocess/main.cpp
@@ -33,7 +33,7 @@
int main(int argc, char *argv[])
{
if (argc < 2) {
- printf("usage: stdinprocess <all|line <0|1>>\n");
+ printf("usage: stdinprocess_helper <all|line <0|1>>\n");
printf("echos all its input to its output.\n");
return 1;
}
diff --git a/tests/auto/corelib/io/qfile/stdinprocess/stdinprocess.pro b/tests/auto/corelib/io/qfile/stdinprocess/stdinprocess.pro
index 8e463e4cef..512da8939b 100644
--- a/tests/auto/corelib/io/qfile/stdinprocess/stdinprocess.pro
+++ b/tests/auto/corelib/io/qfile/stdinprocess/stdinprocess.pro
@@ -1,8 +1,4 @@
SOURCES += main.cpp
QT = core
-CONFIG -= app_bundle debug_and_release_target
-CONFIG += console
-# This app is testdata for tst_qfile
-target.path = $$[QT_INSTALL_TESTS]/tst_qfile/$$TARGET
-INSTALLS += target
+load(qt_test_helper)
diff --git a/tests/auto/corelib/io/qfile/test.pro b/tests/auto/corelib/io/qfile/test.pro
new file mode 100644
index 0000000000..95389ab3e2
--- /dev/null
+++ b/tests/auto/corelib/io/qfile/test.pro
@@ -0,0 +1,26 @@
+CONFIG += testcase
+QT = core-private testlib
+qtHaveModule(network): QT += network
+else: DEFINES += QT_NO_NETWORK
+
+contains(CONFIG, builtin_testdata) {
+ DEFINES += BUILTIN_TESTDATA
+}
+
+TESTDATA += BLACKLIST
+
+TARGET = tst_qfile
+
+SOURCES = tst_qfile.cpp
+INCLUDEPATH += ../../../../shared/
+HEADERS += ../../../../shared/emulationdetector.h
+
+RESOURCES += qfile.qrc rename-fallback.qrc copy-fallback.qrc
+
+TESTDATA += \
+ dosfile.txt noendofline.txt testfile.txt \
+ testlog.txt two.dots.file tst_qfile.cpp \
+ Makefile forCopying.txt forRenaming.txt \
+ resources/file1.ext1
+
+win32:!winrt: LIBS += -lole32 -luuid
diff --git a/tests/auto/corelib/io/qfile/test/test.pro b/tests/auto/corelib/io/qfile/test/test.pro
deleted file mode 100644
index 1472ddbb83..0000000000
--- a/tests/auto/corelib/io/qfile/test/test.pro
+++ /dev/null
@@ -1,25 +0,0 @@
-CONFIG += testcase
-CONFIG -= debug_and_release_target
-QT = core-private core testlib
-qtHaveModule(network): QT += network
-else: DEFINES += QT_NO_NETWORK
-
-contains(CONFIG, builtin_testdata) {
- DEFINES += BUILTIN_TESTDATA
-}
-
-TESTDATA += ../BLACKLIST
-
-TARGET = ../tst_qfile
-SOURCES = ../tst_qfile.cpp
-INCLUDEPATH += ../../../../../shared/
-HEADERS += ../../../../../shared/emulationdetector.h
-
-RESOURCES += ../qfile.qrc ../rename-fallback.qrc ../copy-fallback.qrc
-
-TESTDATA += ../dosfile.txt ../noendofline.txt ../testfile.txt \
- ../testlog.txt ../two.dots.file ../tst_qfile.cpp \
- ../Makefile ../forCopying.txt ../forRenaming.txt \
- ../resources/file1.ext1
-
-win32:!winrt: LIBS+=-lole32 -luuid
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index 6665200585..678a80c3f7 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -367,7 +367,7 @@ private:
QTemporaryDir m_temporaryDir;
const QString m_oldDir;
- QString m_stdinProcessDir;
+ QString m_stdinProcess;
QString m_testSourceFile;
QString m_testLogFile;
QString m_dosFile;
@@ -379,12 +379,6 @@ private:
QString m_noEndOfLineFile;
};
-#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
- #define STDINPROCESS_NAME "libstdinprocess.so"
-#else // !android || android_embedded
- #define STDINPROCESS_NAME "stdinprocess"
-#endif // android && !android_embededd
-
static const char noReadFile[] = "noreadfile";
static const char readOnlyFile[] = "readonlyfile";
@@ -455,11 +449,13 @@ void tst_QFile::initTestCase()
QVERIFY2(m_temporaryDir.isValid(), qPrintable(m_temporaryDir.errorString()));
#if QT_CONFIG(process)
#if defined(Q_OS_ANDROID)
- m_stdinProcessDir = QCoreApplication::applicationDirPath();
+ m_stdinProcess = QCoreApplication::applicationDirPath() + QLatin1String("/libstdinprocess_helper.so");
+#elif defined(Q_OS_WIN)
+ m_stdinProcess = QFINDTESTDATA("stdinprocess_helper.exe");
#else
- m_stdinProcessDir = QFINDTESTDATA("stdinprocess");
+ m_stdinProcess = QFINDTESTDATA("stdinprocess_helper");
#endif
- QVERIFY(!m_stdinProcessDir.isEmpty());
+ QVERIFY(!m_stdinProcess.isEmpty());
#endif
m_testLogFile = QFINDTESTDATA("testlog.txt");
QVERIFY(!m_testLogFile.isEmpty());
@@ -981,7 +977,7 @@ void tst_QFile::readAllStdin()
QProcess process;
StdinReaderProcessGuard processGuard(&process);
- process.start(m_stdinProcessDir + QStringLiteral("/" STDINPROCESS_NAME), QStringList(QStringLiteral("all")));
+ process.start(m_stdinProcess, QStringList(QStringLiteral("all")));
QVERIFY2(process.waitForStarted(), qPrintable(process.errorString()));
for (int i = 0; i < 5; ++i) {
QTest::qWait(1000);
@@ -1014,7 +1010,7 @@ void tst_QFile::readLineStdin()
for (int i = 0; i < 2; ++i) {
QProcess process;
StdinReaderProcessGuard processGuard(&process);
- process.start(m_stdinProcessDir + QStringLiteral("/" STDINPROCESS_NAME),
+ process.start(m_stdinProcess,
QStringList() << QStringLiteral("line") << QString::number(i),
QIODevice::Text | QIODevice::ReadWrite);
QVERIFY2(process.waitForStarted(), qPrintable(process.errorString()));
@@ -1050,7 +1046,7 @@ void tst_QFile::readLineStdin_lineByLine()
for (int i = 0; i < 2; ++i) {
QProcess process;
StdinReaderProcessGuard processGuard(&process);
- process.start(m_stdinProcessDir + QStringLiteral("/" STDINPROCESS_NAME),
+ process.start(m_stdinProcess,
QStringList() << QStringLiteral("line") << QString::number(i),
QIODevice::Text | QIODevice::ReadWrite);
QVERIFY2(process.waitForStarted(), qPrintable(process.errorString()));
@@ -1297,6 +1293,12 @@ void tst_QFile::append()
f.putChar('a');
f.close();
QCOMPARE(int(f.size()), 2);
+
+ QVERIFY2(f.open(QIODevice::Append | QIODevice::Truncate), msgOpenFailed(f).constData());
+ QCOMPARE(f.pos(), 0);
+ f.putChar('a');
+ f.close();
+ QCOMPARE(int(f.size()), 1);
}
void tst_QFile::permissions_data()
@@ -1833,13 +1835,14 @@ void tst_QFile::encodeName()
void tst_QFile::truncate()
{
- for (int i = 0; i < 2; ++i) {
+ const QIODevice::OpenModeFlag modes[] = { QFile::ReadWrite, QIODevice::WriteOnly, QIODevice::Append };
+ for (auto mode : modes) {
QFile file("truncate.txt");
QVERIFY2(file.open(QFile::WriteOnly), msgOpenFailed(file).constData());
file.write(QByteArray(200, '@'));
file.close();
- QVERIFY2(file.open((i ? QFile::WriteOnly : QFile::ReadWrite) | QFile::Truncate), msgOpenFailed(file).constData());
+ QVERIFY2(file.open(mode | QFile::Truncate), msgOpenFailed(file).constData());
file.write(QByteArray(100, '$'));
file.close();
@@ -2210,7 +2213,8 @@ public:
uint ownerId(FileOwner) const { return 0; }
QString owner(FileOwner) const { return QString(); }
QDateTime fileTime(FileTime) const { return QDateTime(); }
- bool setFileTime(const QDateTime &newDate, FileTime time) { return false; }
+ bool setFileTime(const QDateTime &newDate, FileTime time)
+ { Q_UNUSED(newDate) Q_UNUSED(time) return false; }
private:
int number;
@@ -2755,19 +2759,20 @@ void tst_QFile::renameMultiple()
void tst_QFile::appendAndRead()
{
- QFile writeFile(QLatin1String("appendfile.txt"));
- QVERIFY2(writeFile.open(QIODevice::WriteOnly | QIODevice::Truncate), msgOpenFailed(writeFile).constData());
+ const QString fileName(QStringLiteral("appendfile.txt"));
+ QFile writeFile(fileName);
+ QVERIFY2(writeFile.open(QIODevice::Append | QIODevice::Truncate), msgOpenFailed(writeFile).constData());
- QFile readFile(QLatin1String("appendfile.txt"));
+ QFile readFile(fileName);
QVERIFY2(readFile.open(QIODevice::ReadOnly), msgOpenFailed(readFile).constData());
// Write to the end of the file, then read that character back, and so on.
for (int i = 0; i < 100; ++i) {
char c = '\0';
- writeFile.putChar(char(i % 256));
+ writeFile.putChar(char(i));
writeFile.flush();
QVERIFY(readFile.getChar(&c));
- QCOMPARE(c, char(i % 256));
+ QCOMPARE(c, char(i));
QCOMPARE(readFile.pos(), writeFile.pos());
}
@@ -2778,8 +2783,6 @@ void tst_QFile::appendAndRead()
writeFile.flush();
QCOMPARE(readFile.read(size).size(), size);
}
-
- readFile.close();
}
void tst_QFile::miscWithUncPathAsCurrentDir()
diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
index 87d5675e7a..017eebe153 100644
--- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
@@ -199,7 +199,8 @@ private slots:
void fileTimes_data();
void fileTimes();
- void fileTimes_oldFile();
+ void fakeFileTimes_data();
+ void fakeFileTimes();
void isSymLink_data();
void isSymLink();
@@ -629,6 +630,16 @@ void tst_QFileInfo::canonicalFilePath()
info.canonicalFilePath();
#if defined(Q_OS_UNIX)
+ // If this file exists, you can't log in to run this test ...
+ const QString notExtantPath(QStringLiteral("/etc/nologin"));
+ QFileInfo notExtant(notExtantPath);
+ QCOMPARE(notExtant.canonicalFilePath(), QString());
+
+ // A path with a non-directory as a directory component also doesn't exist:
+ const QString badDirPath(QStringLiteral("/dev/null/sub/dir/n'existe.pas"));
+ QFileInfo badDir(badDirPath);
+ QCOMPARE(badDir.canonicalFilePath(), QString());
+
// This used to crash on Mac
QFileInfo dontCrash(QLatin1String("/"));
QCOMPARE(dontCrash.canonicalFilePath(), QLatin1String("/"));
@@ -1212,12 +1223,23 @@ void tst_QFileInfo::fileTimes()
QVERIFY(writeTime < beforeRead);
}
-void tst_QFileInfo::fileTimes_oldFile()
+void tst_QFileInfo::fakeFileTimes_data()
{
+ QTest::addColumn<QDateTime>("when");
+
// This is 2^{31} seconds before 1970-01-01 15:14:8,
// i.e. shortly after the start of time_t, in any time-zone:
- const QDateTime early(QDate(1901, 12, 14), QTime(12, 0));
- QFile file("ancientfile.txt");
+ QTest::newRow("early") << QDateTime(QDate(1901, 12, 14), QTime(12, 0));
+
+ // QTBUG-12006 claims XP handled this (2010-Mar-26 8:46:10) wrong due to an MS API bug:
+ QTest::newRow("XP-bug") << QDateTime::fromTime_t(1269593170);
+}
+
+void tst_QFileInfo::fakeFileTimes()
+{
+ QFETCH(QDateTime, when);
+
+ QFile file("faketimefile.txt");
file.open(QIODevice::WriteOnly);
file.write("\n", 1);
file.close();
@@ -1228,15 +1250,13 @@ void tst_QFileInfo::fileTimes_oldFile()
modification time, so need to re-open for read in order to setFileTime().
*/
file.open(QIODevice::ReadOnly);
- bool ok = file.setFileTime(early, QFileDevice::FileModificationTime);
+ bool ok = file.setFileTime(when, QFileDevice::FileModificationTime);
file.close();
- if (ok) {
- QFileInfo info(file.fileName());
- QCOMPARE(info.lastModified(), early);
- } else {
- QSKIP("Unable to set file metadata to ancient values");
- }
+ if (ok)
+ QCOMPARE(QFileInfo(file.fileName()).lastModified(), when);
+ else
+ QSKIP("Unable to set file metadata to contrived values");
}
void tst_QFileInfo::isSymLink_data()
diff --git a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
index fed05698fd..da5327594c 100644
--- a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
+++ b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
@@ -209,9 +209,6 @@ void tst_QIODevice::read_QByteArray()
//--------------------------------------------------------------------
void tst_QIODevice::unget()
{
-#if defined(Q_OS_MAC)
- QSKIP("The unget network test is unstable on Mac. See QTBUG-39983.");
-#endif
QBuffer buffer;
buffer.open(QBuffer::ReadWrite);
buffer.write("ZXCV");
diff --git a/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp b/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp
index 5b61a6007d..a10e706ed7 100644
--- a/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp
+++ b/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp
@@ -187,6 +187,13 @@ private slots:
"default=false");
QCOMPARE(parser.rules().size(), 1);
+ // QSettings escapes * to %2A when writing.
+ parser.setContent("[Rules]\n"
+ "module.%2A=false");
+ QCOMPARE(parser.rules().size(), 1);
+ QCOMPARE(parser.rules().first().category, QString("module."));
+ QCOMPARE(parser.rules().first().flags, QLoggingRule::LeftFilter);
+
parser.setContent("[OtherSection]\n"
"default=false");
QCOMPARE(parser.rules().size(), 0);
diff --git a/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp b/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp
index b78fa29fb6..17c51eaaf4 100644
--- a/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp
+++ b/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp
@@ -65,7 +65,7 @@ void tst_QNoDebug::streaming() const
{
QDateTime dt(QDate(1,2,3),QTime(4,5,6));
const QByteArray debugString = dt.toString(QStringViewLiteral("yyyy-MM-dd HH:mm:ss.zzz t")).toLatin1();
- const QByteArray message = "QDateTime(" + debugString + " Qt::TimeSpec(LocalTime))";
+ const QByteArray message = "QDateTime(" + debugString + " Qt::LocalTime)";
QTest::ignoreMessage(QtWarningMsg, message.constData());
qWarning() << dt;
}
diff --git a/tests/auto/corelib/io/qresourceengine/qresourceengine.pro b/tests/auto/corelib/io/qresourceengine/qresourceengine.pro
index e8071297b1..1e12a41dea 100644
--- a/tests/auto/corelib/io/qresourceengine/qresourceengine.pro
+++ b/tests/auto/corelib/io/qresourceengine/qresourceengine.pro
@@ -1,25 +1,2 @@
-CONFIG += testcase
-TARGET = tst_qresourceengine
-
-QT = core testlib
-SOURCES = tst_qresourceengine.cpp
-RESOURCES += testqrc/test.qrc
-
-qtPrepareTool(QMAKE_RCC, rcc, _DEP)
-runtime_resource.target = runtime_resource.rcc
-runtime_resource.depends = $$PWD/testqrc/test.qrc $$QMAKE_RCC_EXE
-runtime_resource.commands = $$QMAKE_RCC -root /runtime_resource/ -binary $$PWD/testqrc/test.qrc -o $${runtime_resource.target}
-QMAKE_EXTRA_TARGETS = runtime_resource
-PRE_TARGETDEPS += $${runtime_resource.target}
-QMAKE_DISTCLEAN += $${runtime_resource.target}
-
-TESTDATA += \
- parentdir.txt \
- testqrc/*
-GENERATED_TESTDATA = $${runtime_resource.target}
-
-android:!android-embedded {
- RESOURCES += android_testdata.qrc
-}
-
-builtin_testdata: DEFINES += BUILTIN_TESTDATA
+TEMPLATE = subdirs
+SUBDIRS = staticplugin qresourceengine_test.pro
diff --git a/tests/auto/corelib/io/qresourceengine/qresourceengine_test.pro b/tests/auto/corelib/io/qresourceengine/qresourceengine_test.pro
new file mode 100644
index 0000000000..3838a72c21
--- /dev/null
+++ b/tests/auto/corelib/io/qresourceengine/qresourceengine_test.pro
@@ -0,0 +1,33 @@
+CONFIG += testcase
+TARGET = tst_qresourceengine
+
+QT = core testlib
+SOURCES = tst_qresourceengine.cpp
+RESOURCES += testqrc/test.qrc
+
+qtPrepareTool(QMAKE_RCC, rcc, _DEP)
+runtime_resource.target = runtime_resource.rcc
+runtime_resource.depends = $$PWD/testqrc/test.qrc $$QMAKE_RCC_EXE
+runtime_resource.commands = $$QMAKE_RCC -root /runtime_resource/ -binary $$PWD/testqrc/test.qrc -o $${runtime_resource.target}
+QMAKE_EXTRA_TARGETS = runtime_resource
+PRE_TARGETDEPS += $${runtime_resource.target}
+QMAKE_DISTCLEAN += $${runtime_resource.target}
+
+TESTDATA += \
+ parentdir.txt \
+ testqrc/*
+GENERATED_TESTDATA = $${runtime_resource.target}
+
+android:!android-embedded {
+ RESOURCES += android_testdata.qrc
+}
+
+win32 {
+ CONFIG(debug, debug|release): LIBS += -Lstaticplugin/debug
+ else: LIBS += -Lstaticplugin/release
+} else {
+ LIBS += -Lstaticplugin
+}
+LIBS += -lmoctestplugin
+
+builtin_testdata: DEFINES += BUILTIN_TESTDATA
diff --git a/tests/auto/corelib/io/qresourceengine/staticplugin/.gitignore b/tests/auto/corelib/io/qresourceengine/staticplugin/.gitignore
new file mode 100644
index 0000000000..c397dde6a5
--- /dev/null
+++ b/tests/auto/corelib/io/qresourceengine/staticplugin/.gitignore
@@ -0,0 +1 @@
+moctestplugin_plugin_resources.cpp
diff --git a/tests/auto/corelib/io/qresourceengine/staticplugin/main.cpp b/tests/auto/corelib/io/qresourceengine/staticplugin/main.cpp
new file mode 100644
index 0000000000..39a3a1e012
--- /dev/null
+++ b/tests/auto/corelib/io/qresourceengine/staticplugin/main.cpp
@@ -0,0 +1,9 @@
+#include <QObject>
+
+class PluginClass : public QObject
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.tests.moc" FILE "staticplugin.json")
+};
+
+#include "main.moc"
diff --git a/tests/auto/corelib/io/qresourceengine/staticplugin/staticplugin.json b/tests/auto/corelib/io/qresourceengine/staticplugin/staticplugin.json
new file mode 100644
index 0000000000..4103ecb18c
--- /dev/null
+++ b/tests/auto/corelib/io/qresourceengine/staticplugin/staticplugin.json
@@ -0,0 +1 @@
+{ "Keys": [ "staticplugin" ] }
diff --git a/tests/auto/corelib/io/qresourceengine/staticplugin/staticplugin.pro b/tests/auto/corelib/io/qresourceengine/staticplugin/staticplugin.pro
new file mode 100644
index 0000000000..e19d884548
--- /dev/null
+++ b/tests/auto/corelib/io/qresourceengine/staticplugin/staticplugin.pro
@@ -0,0 +1,8 @@
+TEMPLATE = lib
+TARGET = moctestplugin
+CONFIG += plugin static
+SOURCES = main.cpp
+plugin_resource.files = main.cpp
+plugin_resource.prefix = /staticplugin
+RESOURCES += plugin_resource
+QT = core
diff --git a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
index b7e85e8f05..ab49dea6d8 100644
--- a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
+++ b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
@@ -57,6 +57,7 @@ private slots:
void doubleSlashInRoot();
void setLocale();
void lastModified();
+ void resourcesInStaticPlugins();
private:
const QString m_runtimeResourceRcc;
@@ -119,6 +120,7 @@ void tst_QResourceEngine::checkStructure_data()
<< QLatin1String("searchpath1")
<< QLatin1String("searchpath2")
<< QLatin1String("secondary_root")
+ << QLatin1String("staticplugin")
<< QLatin1String("test")
<< QLatin1String("withoutslashes");
@@ -127,7 +129,7 @@ void tst_QResourceEngine::checkStructure_data()
#endif
#if defined(BUILTIN_TESTDATA)
- rootContents.insert(8, QLatin1String("testqrc"));
+ rootContents.insert(9, QLatin1String("testqrc"));
#endif
@@ -520,6 +522,16 @@ void tst_QResourceEngine::lastModified()
}
}
+Q_IMPORT_PLUGIN(PluginClass)
+void tst_QResourceEngine::resourcesInStaticPlugins()
+{
+ // We built a separate static plugin and attempted linking against
+ // it. That should successfully register the resources linked into
+ // the plugin via moc generated Q_INIT_RESOURCE calls in a
+ // Q_CONSTRUCTOR_FUNCTION.
+ QVERIFY(QFile::exists(":/staticplugin/main.cpp"));
+}
+
QTEST_MAIN(tst_QResourceEngine)
#include "tst_qresourceengine.moc"
diff --git a/tests/auto/corelib/io/qsettings/qsettings.pro b/tests/auto/corelib/io/qsettings/qsettings.pro
index 5b4cc8a691..79552b62df 100644
--- a/tests/auto/corelib/io/qsettings/qsettings.pro
+++ b/tests/auto/corelib/io/qsettings/qsettings.pro
@@ -6,4 +6,6 @@ RESOURCES += qsettings.qrc
INCLUDEPATH += $$PWD/../../kernel/qmetatype
msvc: LIBS += advapi32.lib
+darwin: LIBS += -framework CoreFoundation
+
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
index db756ada39..5357194406 100644
--- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
+++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
@@ -531,7 +531,7 @@ void tst_QSettings::ctor()
// more details in QMacSettingsPrivate::QMacSettingsPrivate(), organization was comify()-ed
caseSensitive = settings5.fileName().contains("SoftWare.ORG");;
} else {
- caseSensitive = pathconf(QDir::currentPath().toLatin1().constData(), _PC_CASE_SENSITIVE);
+ caseSensitive = pathconf(settings5.fileName().toLatin1().constData(), _PC_CASE_SENSITIVE);
}
#elif defined(Q_OS_WIN32) || defined(Q_OS_WINRT)
caseSensitive = false;
@@ -1186,6 +1186,10 @@ static void testMetaTypesHelper(QSettings::Format format)
F(QJsonArray) \
F(QJsonDocument) \
F(QPersistentModelIndex) \
+ F(QCborSimpleType) \
+ F(QCborValue) \
+ F(QCborArray) \
+ F(QCborMap) \
#define EXCLUDE_NON_SUPPORTED_METATYPES(MetaTypeName) \
template<> void testMetaTypesHelper<QMetaType::MetaTypeName>(QSettings::Format) \
diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
index 3de777653e..5cb130f631 100644
--- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
+++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
@@ -183,12 +183,14 @@ void tst_qstandardpaths::testDefaultLocations()
#endif
}
+#ifdef Q_XDG_PLATFORM
static void createTestFile(const QString &fileName)
{
QFile file(fileName);
QVERIFY(file.open(QIODevice::WriteOnly));
QVERIFY(file.write("Hello"));
}
+#endif
void tst_qstandardpaths::testCustomLocations()
{
diff --git a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp
index 8b1aa105de..1317489e2f 100644
--- a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp
+++ b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp
@@ -80,7 +80,7 @@ static int qInfoPrinter(const char *format, ...)
// flush
QtMessageHandler qt_message_print = qInstallMessageHandler(0);
qInstallMessageHandler(qt_message_print); // restore the handler
- qt_message_print(QtInfoMsg, QMessageLogContext(), QString::fromLocal8Bit(buf));
+ qt_message_print(QtInfoMsg, QMessageLogContext(), QString::fromLocal8Bit(buf).trimmed());
bufuse = 0;
}
diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp
index 62af907037..84af1c255a 100644
--- a/tests/auto/corelib/io/qurl/tst_qurl.cpp
+++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp
@@ -180,6 +180,8 @@ private slots:
void testThreading();
void matches_data();
void matches();
+ void ipv6_zoneId_data();
+ void ipv6_zoneId();
private:
void testThreadingHelper();
@@ -1876,6 +1878,24 @@ void tst_QUrl::ipv6_data()
QTest::newRow("encoded-digit") << "//[::%31]" << true << "//[::1]";
QTest::newRow("encoded-colon") << "//[%3A%3A]" << true << "//[::]";
+
+ QTest::newRow("full ipv6 with zone id (decoded %)") << QString::fromLatin1("//[56:56:56:56:56:56:56:56%eth0]") << true
+ << "//[56:56:56:56:56:56:56:56%25eth0]";
+
+ QTest::newRow("full ipv6 with zone id (encoded %)") << QString::fromLatin1("//[56:56:56:56:56:56:56:56%25eth0]") << true
+ << "//[56:56:56:56:56:56:56:56%25eth0]";
+
+ QTest::newRow("full ipv6 with invalid zone id") << QString::fromLatin1("//[56:56:56:56:56:56:56:56%]") << false << "";
+
+ QTest::newRow("full ipv6 with invalid zone id (encoded)") << QString::fromLatin1("//[56:56:56:56:56:56:56:56%25]") << false << "";
+
+ QTest::newRow("full ipv6 with zone id 25 (encoded)") << QString::fromLatin1("//[56:56:56:56:56:56:56:56%2525]") << true << "//[56:56:56:56:56:56:56:56%2525]";
+
+ QTest::newRow("case 4 with less and ip4 and port and useinfo and zone id")
+ << QString::fromLatin1("//user:pass@[56::56:56:56:127.0.0.1%ethernet_1]:99") << true
+ << "//user:pass@[56::56:56:56:7f00:1%25ethernet_1]:99";
+
+ QTest::newRow("encoded-digit including zone id") << "//[::%31%25eth0]" << true << "//[::1%25eth0]";
}
void tst_QUrl::ipv6()
@@ -4149,6 +4169,38 @@ void tst_QUrl::matches()
QCOMPARE(urlOne.matches(urlTwo, QUrl::FormattingOptions(options)), matches);
}
+void tst_QUrl::ipv6_zoneId_data()
+{
+ QTest::addColumn<QUrl>("url");
+ QTest::addColumn<QString>("decodedHost");
+ QTest::addColumn<QString>("prettyHost");
+ QTest::addColumn<QString>("encodedHost");
+
+ QTest::newRow("digit") << QUrl("x://[::%251]") << "::%1" << "::%251" << "::%251";
+ QTest::newRow("eth0") << QUrl("x://[::%25eth0]") << "::%eth0" << "::%25eth0" << "::%25eth0";
+ QTest::newRow("space") << QUrl("x://[::%25%20]") << "::% " << "::%25 " << "::%25%20";
+ QTest::newRow("subdelims") << QUrl("x://[::%25eth%2B]") << "::%eth+" << "::%25eth%2B" << "::%25eth%2B";
+ QTest::newRow("other") << QUrl("x://[::%25^]") << "::%^" << "::%25%5E" << "::%25%5E";
+ QTest::newRow("control") << QUrl("x://[::%25%7F]") << "::%\x7f" << "::%25%7F" << "::%25%7F";
+ QTest::newRow("unicode") << QUrl("x://[::%25wlán0]") << "::%wlán0" << "::%25wlán0" << "::%25wl%C3%A1n0";
+ QTest::newRow("non-utf8") << QUrl("x://[::%25%80]") << QString("::%") + QChar(QChar::ReplacementCharacter) << "::%25%80" << "::%25%80";
+ }
+
+void tst_QUrl::ipv6_zoneId()
+{
+ QFETCH(QUrl, url);
+ QFETCH(QString, decodedHost);
+ QFETCH(QString, prettyHost);
+ QFETCH(QString, encodedHost);
+
+ QVERIFY2(url.isValid(), qPrintable(url.errorString()));
+ QCOMPARE(url.host(QUrl::FullyDecoded), decodedHost);
+ QCOMPARE(url.host(), decodedHost);
+ QCOMPARE(url.host(QUrl::FullyEncoded), encodedHost);
+ QCOMPARE(url.toString(), "x://[" + prettyHost + "]");
+ QCOMPARE(url.toString(QUrl::FullyEncoded), "x://[" + encodedHost + "]");
+}
+
QTEST_MAIN(tst_QUrl)
#include "tst_qurl.moc"
diff --git a/tests/auto/corelib/itemmodels/itemmodels.pro b/tests/auto/corelib/itemmodels/itemmodels.pro
index a09f03a7b4..cca350ad43 100644
--- a/tests/auto/corelib/itemmodels/itemmodels.pro
+++ b/tests/auto/corelib/itemmodels/itemmodels.pro
@@ -1,9 +1,9 @@
TEMPLATE=subdirs
-SUBDIRS = qabstractitemmodel \
- qstringlistmodel \
+SUBDIRS = qstringlistmodel
qtHaveModule(gui): SUBDIRS += \
+ qabstractitemmodel \
qabstractproxymodel \
qidentityproxymodel \
qitemselectionmodel \
@@ -11,7 +11,8 @@ qtHaveModule(gui): SUBDIRS += \
qtHaveModule(widgets) {
SUBDIRS += \
- qsortfilterproxymodel
+ qsortfilterproxymodel_regexp \
+ qsortfilterproxymodel_regularexpression
qtHaveModule(sql): SUBDIRS += \
qitemmodel
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/.gitignore b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/.gitignore
deleted file mode 100644
index d3672fe4ae..0000000000
--- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-tst_qsortfilterproxymodel
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/qsortfilterproxymodel.pro b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/qsortfilterproxymodel.pro
deleted file mode 100644
index dfa8b9fa1b..0000000000
--- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/qsortfilterproxymodel.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-CONFIG += testcase
-TARGET = tst_qsortfilterproxymodel
-
-QT += widgets testlib
-mtdir = ../../../other/qabstractitemmodelutils
-
-INCLUDEPATH += $$PWD/$${mtdir}
-SOURCES += tst_qsortfilterproxymodel.cpp $${mtdir}/dynamictreemodel.cpp
-HEADERS += $${mtdir}/dynamictreemodel.h
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp
index bced3f5790..82cd26971b 100644
--- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp
@@ -27,147 +27,17 @@
****************************************************************************/
#include <QtTest/QtTest>
+#include "tst_qsortfilterproxymodel.h"
#include "dynamictreemodel.h"
#include <QtCore/QCoreApplication>
#include <QtGui/QStandardItem>
+#include <QtWidgets/QComboBox>
#include <QtWidgets/QTreeView>
#include <QtWidgets/QTableView>
#include <qdebug.h>
-typedef QList<int> IntList;
-typedef QPair<int, int> IntPair;
-typedef QList<IntPair> IntPairList;
-
-Q_DECLARE_METATYPE(QList<QPersistentModelIndex>)
-
-class tst_QSortFilterProxyModel : public QObject
-{
- Q_OBJECT
-public:
- tst_QSortFilterProxyModel();
-
-public slots:
- void initTestCase();
- void cleanupTestCase();
- void cleanup();
-
-private slots:
- void getSetCheck();
- void sort_data();
- void sort();
- void sortHierarchy_data();
- void sortHierarchy();
-
- void insertRows_data();
- void insertRows();
- void prependRow();
- void removeRows_data();
- void removeRows();
- void removeColumns_data();
- void removeColumns();
- void insertAfterSelect();
- void removeAfterSelect();
- void filter_data();
- void filter();
- void filterHierarchy_data();
- void filterHierarchy();
- void filterColumns_data();
- void filterColumns();
-
- void filterTable();
- void filterCurrent();
- void filter_qtbug30662();
-
- void changeSourceLayout();
- void changeSourceLayoutFilteredOut();
- void removeSourceRows_data();
- void removeSourceRows();
- void insertSourceRows_data();
- void insertSourceRows();
- void changeFilter_data();
- void changeFilter();
- void changeSourceData_data();
- void changeSourceData();
- void changeSourceDataKeepsStableSorting_qtbug1548();
- void changeSourceDataForwardsRoles_qtbug35440();
- void resortingDoesNotBreakTreeModels();
- void dynamicFilterWithoutSort();
- void sortFilterRole();
- void selectionFilteredOut();
- void match_data();
- void match();
- void insertIntoChildrenlessItem();
- void invalidateMappedChildren();
- void insertRowIntoFilteredParent();
- void filterOutParentAndFilterInChild();
-
- void sourceInsertRows();
- void sourceModelDeletion();
-
- void sortColumnTracking1();
- void sortColumnTracking2();
-
- void sortStable();
-
- void hiddenColumns();
- void insertRowsSort();
- void staticSorting();
- void dynamicSorting();
- void fetchMore();
- void hiddenChildren();
- void mapFromToSource();
- void removeRowsRecursive();
- void doubleProxySelectionSetSourceModel();
- void appearsAndSort();
- void unnecessaryDynamicSorting();
- void unnecessaryMapCreation();
- void resetInvalidate_data();
- void resetInvalidate();
-
- void testMultipleProxiesWithSelection();
- void mapSelectionFromSource();
- void testResetInternalData();
- void filteredColumns();
- void headerDataChanged();
-
- void testParentLayoutChanged();
- void moveSourceRows();
-
- void hierarchyFilterInvalidation();
- void simpleFilterInvalidation();
-
- void chainedProxyModelRoleNames();
-
- void noMapAfterSourceDelete();
- void forwardDropApi();
- void canDropMimeData();
- void filterHint();
-
- void sourceLayoutChangeLeavesValidPersistentIndexes();
- void rowMoveLeavesValidPersistentIndexes();
-
- void emitLayoutChangedOnlyIfSortingChanged_data();
- void emitLayoutChangedOnlyIfSortingChanged();
-
- void checkSetNewModel();
- void filterAndInsertRow_data();
- void filterAndInsertRow();
- void filterAndInsertColumn_data();
- void filterAndInsertColumn();
-
-protected:
- void buildHierarchy(const QStringList &data, QAbstractItemModel *model);
- void checkHierarchy(const QStringList &data, const QAbstractItemModel *model);
-
-private:
- QStandardItemModel *m_model;
- QSortFilterProxyModel *m_proxy;
-};
-
-Q_DECLARE_METATYPE(QAbstractItemModel::LayoutChangeHint)
-
// Testing get/set functions
void tst_QSortFilterProxyModel::getSetCheck()
{
@@ -205,7 +75,15 @@ void tst_QSortFilterProxyModel::cleanupTestCase()
void tst_QSortFilterProxyModel::cleanup()
{
- m_proxy->setFilterRegExp(QRegExp());
+ switch (m_filterType) {
+ case FilterType::RegExp:
+ m_proxy->setFilterRegExp(QRegExp());
+ break;
+ case FilterType::RegularExpression:
+ m_proxy->setFilterRegularExpression(QRegularExpression());
+ break;
+ }
+
m_proxy->sort(-1, Qt::AscendingOrder);
m_model->clear();
m_model->insertColumns(0, 1);
@@ -629,6 +507,58 @@ void tst_QSortFilterProxyModel::prependRow()
QCOMPARE(proxy.rowCount(QModelIndex()), 1); //only the "root" item is there
}
+void tst_QSortFilterProxyModel::appendRowFromCombobox_data()
+{
+ QTest::addColumn<QString>("pattern");
+ QTest::addColumn<QStringList>("initial");
+ QTest::addColumn<QString>("newitem");
+ QTest::addColumn<QStringList>("expected");
+
+ QTest::newRow("filter_out_second_last_item")
+ << "^[0-9]*$"
+ << (QStringList() << "a" << "1")
+ << "2"
+ << (QStringList() << "a" << "1" << "2");
+
+ QTest::newRow("filter_out_everything")
+ << "^c*$"
+ << (QStringList() << "a" << "b")
+ << "c"
+ << (QStringList() << "a" << "b" << "c");
+
+ QTest::newRow("no_filter")
+ << ""
+ << (QStringList() << "0" << "1")
+ << "2"
+ << (QStringList() << "0" << "1" << "2");
+
+ QTest::newRow("filter_out_last_item")
+ << "^[a-z]*$"
+ << (QStringList() << "a" << "1")
+ << "b"
+ << (QStringList() << "a" << "1" << "b");
+}
+
+void tst_QSortFilterProxyModel::appendRowFromCombobox()
+{
+ QFETCH(QString, pattern);
+ QFETCH(QStringList, initial);
+ QFETCH(QString, newitem);
+ QFETCH(QStringList, expected);
+
+ QStringListModel model(initial);
+
+ QSortFilterProxyModel proxy;
+ proxy.setSourceModel(&model);
+ proxy.setFilterRegExp(pattern);
+
+ QComboBox comboBox;
+ comboBox.setModel(&proxy);
+ comboBox.addItem(newitem);
+
+ QCOMPARE(model.stringList(), expected);
+}
+
void tst_QSortFilterProxyModel::removeRows_data()
{
QTest::addColumn<QStringList>("initial");
@@ -916,8 +846,9 @@ void tst_QSortFilterProxyModel::removeRows()
if (sortOrder != -1)
proxy.sort(0, static_cast<Qt::SortOrder>(sortOrder));
+
if (!filter.isEmpty())
- proxy.setFilterRegExp(QRegExp(filter));
+ setupFilter(&proxy, filter);
// remove the rows
QCOMPARE(proxy.removeRows(position, count, QModelIndex()), success);
@@ -939,14 +870,29 @@ class MyFilteredColumnProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
- MyFilteredColumnProxyModel(QObject *parent = 0)
- : QSortFilterProxyModel(parent) { }
+ MyFilteredColumnProxyModel(FilterType filterType, QObject *parent = 0) :
+ QSortFilterProxyModel(parent),
+ m_filterType(filterType)
+ { }
+
protected:
bool filterAcceptsColumn(int sourceColumn, const QModelIndex &) const
{
QString key = sourceModel()->headerData(sourceColumn, Qt::Horizontal).toString();
- return key.contains(filterRegExp());
+ bool result = false;
+ switch (m_filterType) {
+ case FilterType::RegExp:
+ result = key.contains(filterRegExp());
+ break;
+ case FilterType::RegularExpression:
+ result = key.contains(filterRegularExpression());
+ break;
+ }
+ return result;
}
+
+private:
+ FilterType m_filterType;
};
void tst_QSortFilterProxyModel::removeColumns_data()
@@ -1155,10 +1101,10 @@ void tst_QSortFilterProxyModel::removeColumns()
QFETCH(QStringList, expectedSource);
QStandardItemModel model;
- MyFilteredColumnProxyModel proxy;
+ MyFilteredColumnProxyModel proxy(m_filterType);
proxy.setSourceModel(&model);
if (!filter.isEmpty())
- proxy.setFilterRegExp(QRegExp(filter));
+ setupFilter(&proxy, filter);
// prepare model
model.setHorizontalHeaderLabels(initial);
@@ -1226,7 +1172,8 @@ void tst_QSortFilterProxyModel::filterColumns()
QModelIndex index = m_model->index(0, col, QModelIndex());
m_model->setData(index, initial.at(col), Qt::DisplayRole);
}
- m_proxy->setFilterRegExp(pattern);
+ setupFilter(m_proxy, pattern);
+
m_proxy->setFilterKeyColumn(-1);
// make sure the model is unchanged
for (int col = 0; col < m_model->columnCount(QModelIndex()); ++col) {
@@ -1292,6 +1239,7 @@ void tst_QSortFilterProxyModel::filter()
QFETCH(QString, pattern);
QFETCH(QStringList, initial);
QFETCH(QStringList, expected);
+
// prepare model
QVERIFY(m_model->insertRows(0, initial.count(), QModelIndex()));
QCOMPARE(m_model->rowCount(QModelIndex()), initial.count());
@@ -1301,7 +1249,7 @@ void tst_QSortFilterProxyModel::filter()
QModelIndex index = m_model->index(row, 0, QModelIndex());
m_model->setData(index, initial.at(row), Qt::DisplayRole);
}
- m_proxy->setFilterRegExp(pattern);
+ setupFilter(m_proxy, pattern);
// make sure the proxy is unfiltered
QCOMPARE(m_proxy->columnCount(QModelIndex()), 1);
QCOMPARE(m_proxy->rowCount(QModelIndex()), expected.count());
@@ -1340,7 +1288,7 @@ void tst_QSortFilterProxyModel::filterHierarchy()
QFETCH(QStringList, initial);
QFETCH(QStringList, expected);
buildHierarchy(initial, m_model);
- m_proxy->setFilterRegExp(pattern);
+ setupFilter(m_proxy, pattern);
checkHierarchy(initial, m_model);
checkHierarchy(expected, m_proxy);
}
@@ -1405,6 +1353,18 @@ void tst_QSortFilterProxyModel::checkHierarchy(const QStringList &l, const QAbst
}
}
+void tst_QSortFilterProxyModel::setupFilter(QSortFilterProxyModel *model, const QString& pattern)
+{
+ switch (m_filterType) {
+ case FilterType::RegExp:
+ model->setFilterRegExp(pattern);
+ break;
+ case FilterType::RegularExpression:
+ model->setFilterRegularExpression(pattern);
+ break;
+ }
+}
+
class TestModel: public QAbstractTableModel
{
public:
@@ -1423,7 +1383,7 @@ void tst_QSortFilterProxyModel::filterTable()
TestModel model;
QSortFilterProxyModel filter;
filter.setSourceModel(&model);
- filter.setFilterRegExp("9");
+ setupFilter(&filter, QLatin1String("9"));
for (int i = 0; i < filter.rowCount(); ++i)
QVERIFY(filter.data(filter.index(i, 0)).toString().contains(QLatin1Char('9')));
@@ -1487,7 +1447,7 @@ void tst_QSortFilterProxyModel::filterCurrent()
view.setCurrentIndex(proxy.index(0, 0));
QCOMPARE(spy.count(), 1);
- proxy.setFilterRegExp(QRegExp("^B"));
+ setupFilter(&proxy, QLatin1String("^B"));
QCOMPARE(spy.count(), 2);
}
@@ -1498,7 +1458,7 @@ void tst_QSortFilterProxyModel::filter_qtbug30662()
proxy.setSourceModel(&model);
// make sure the filter does not match any entry
- proxy.setFilterRegExp(QRegExp("[0-9]+"));
+ setupFilter(&proxy, QLatin1String("[0-9]+"));
QStringList slSource;
slSource << "z" << "x" << "a" << "b";
@@ -1508,7 +1468,7 @@ void tst_QSortFilterProxyModel::filter_qtbug30662()
model.setStringList(slSource);
// without fix for QTBUG-30662 this will make all entries visible - but unsorted
- proxy.setFilterRegExp(QRegExp("[a-z]+"));
+ setupFilter(&proxy, QLatin1String("[a-z]+"));
QStringList slResult;
for (int i = 0; i < proxy.rowCount(); ++i)
@@ -1554,7 +1514,8 @@ void tst_QSortFilterProxyModel::changeSourceLayoutFilteredOut()
QSignalSpy removeSpy(&proxy, &QSortFilterProxyModel::rowsRemoved);
// Filter everything out
- proxy.setFilterRegExp(QRegExp("c"));
+ setupFilter(&proxy, QLatin1String("c"));
+
QCOMPARE(removeSpy.count(), 1);
QCOMPARE(0, proxy.rowCount());
@@ -1563,7 +1524,8 @@ void tst_QSortFilterProxyModel::changeSourceLayoutFilteredOut()
QSignalSpy insertSpy(&proxy, &QSortFilterProxyModel::rowsInserted);
// Remove filter; we expect an insert
- proxy.setFilterRegExp(QRegExp(""));
+ setupFilter(&proxy, "");
+
QCOMPARE(insertSpy.count(), 1);
QCOMPARE(beforeSortFilter, proxy.rowCount());
}
@@ -1843,7 +1805,7 @@ void tst_QSortFilterProxyModel::changeFilter()
QVERIFY(initialRemoveSpy.isValid());
QVERIFY(initialInsertSpy.isValid());
- proxy.setFilterRegExp(initialFilter);
+ setupFilter(&proxy, initialFilter);
QCOMPARE(initialRemoveSpy.count(), initialRemoveIntervals.count());
QCOMPARE(initialInsertSpy.count(), 0);
@@ -1867,7 +1829,7 @@ void tst_QSortFilterProxyModel::changeFilter()
QVERIFY(finalRemoveSpy.isValid());
QVERIFY(finalInsertSpy.isValid());
- proxy.setFilterRegExp(finalFilter);
+ setupFilter(&proxy, finalFilter);
QCOMPARE(finalRemoveSpy.count(), finalRemoveIntervals.count());
for (int i = 0; i < finalRemoveSpy.count(); ++i) {
@@ -2061,7 +2023,7 @@ void tst_QSortFilterProxyModel::changeSourceData()
proxy.sort(0, static_cast<Qt::SortOrder>(sortOrder));
(void)proxy.rowCount(QModelIndex()); // force mapping
- proxy.setFilterRegExp(filter);
+ setupFilter(&proxy, filter);
QCOMPARE(proxy.rowCount(), expectedInitialProxyItems.count());
for (int i = 0; i < expectedInitialProxyItems.count(); ++i) {
@@ -2254,7 +2216,8 @@ void tst_QSortFilterProxyModel::sortFilterRole()
model.setData(index, sourceItems.at(i).second, Qt::UserRole);
}
- proxy.setFilterRegExp("2");
+ setupFilter(&proxy, QLatin1String("2"));
+
QCOMPARE(proxy.rowCount(), 0); // Qt::DisplayRole is default role
proxy.setFilterRole(Qt::UserRole);
@@ -2263,7 +2226,8 @@ void tst_QSortFilterProxyModel::sortFilterRole()
proxy.setFilterRole(Qt::DisplayRole);
QCOMPARE(proxy.rowCount(), 0);
- proxy.setFilterRegExp("1|2|3");
+ setupFilter(&proxy, QLatin1String("1|2|3"));
+
QCOMPARE(proxy.rowCount(), 0);
proxy.setFilterRole(Qt::UserRole);
@@ -2274,7 +2238,8 @@ void tst_QSortFilterProxyModel::sortFilterRole()
proxy.setSortRole(Qt::UserRole);
proxy.setFilterRole(Qt::DisplayRole);
- proxy.setFilterRegExp("a|c");
+ setupFilter(&proxy, QLatin1String("a|c"));
+
QCOMPARE(proxy.rowCount(), orderedItems.count());
for (int i = 0; i < proxy.rowCount(); ++i) {
QModelIndex index = proxy.index(i, 0, QModelIndex());
@@ -2298,7 +2263,8 @@ void tst_QSortFilterProxyModel::selectionFilteredOut()
view.setCurrentIndex(proxy.index(0, 0));
QCOMPARE(spy.count(), 1);
- proxy.setFilterRegExp(QRegExp("^B"));
+
+ setupFilter(&proxy, QLatin1String("^B"));
QCOMPARE(spy.count(), 2);
}
@@ -2384,7 +2350,7 @@ void tst_QSortFilterProxyModel::match()
}
proxy.sort(0, static_cast<Qt::SortOrder>(sortOrder));
- proxy.setFilterRegExp(filter);
+ setupFilter(&proxy, filter);
QModelIndex startIndex = proxy.index(proxyStartRow, 0);
QModelIndexList indexes = proxy.match(startIndex, Qt::DisplayRole, what,
@@ -2509,7 +2475,8 @@ void tst_QSortFilterProxyModel::filterOutParentAndFilterInChild()
QSortFilterProxyModel proxy;
proxy.setSourceModel(&model);
- proxy.setFilterRegExp("A|B");
+ setupFilter(&proxy, QLatin1String("A|B"));
+
QStandardItem *itemA = new QStandardItem("A");
model.appendRow(itemA); // not filtered
QStandardItem *itemB = new QStandardItem("B");
@@ -2523,7 +2490,7 @@ void tst_QSortFilterProxyModel::filterOutParentAndFilterInChild()
QVERIFY(removedSpy.isValid());
QVERIFY(insertedSpy.isValid());
- proxy.setFilterRegExp("C"); // A and B will be filtered out, C filtered in
+ setupFilter(&proxy, QLatin1String("C")); // A and B will be filtered out, C filtered in
// we should now have been notified that the subtree represented by itemA has been removed
QCOMPARE(removedSpy.count(), 1);
@@ -2936,7 +2903,7 @@ void tst_QSortFilterProxyModel::hiddenChildren()
itemA->appendRow(itemB);
QStandardItem *itemC = new QStandardItem("C");
itemA->appendRow(itemC);
- proxy.setFilterRegExp("VISIBLE");
+ setupFilter(&proxy, QLatin1String("VISIBLE"));
QCOMPARE(proxy.rowCount(QModelIndex()) , 1);
QPersistentModelIndex indexA = proxy.index(0,0);
@@ -2963,7 +2930,8 @@ void tst_QSortFilterProxyModel::hiddenChildren()
QModelIndex indexC = proxy.index(0, 0, indexA);
QCOMPARE(proxy.data(indexC).toString(), QString::fromLatin1("C VISIBLE"));
- proxy.setFilterRegExp("C");
+ setupFilter(&proxy, QLatin1String("C"));
+
QCOMPARE(proxy.rowCount(QModelIndex()), 0);
itemC->setText("invisible");
itemA->setText("AC");
@@ -3285,7 +3253,8 @@ void tst_QSortFilterProxyModel::mapSelectionFromSource()
QSortFilterProxyModel proxy;
proxy.setDynamicSortFilter(true);
- proxy.setFilterRegExp("d.*");
+ setupFilter(&proxy, QLatin1String("d.*"));
+
proxy.setSourceModel(&model);
// Only "delta" remains.
@@ -3840,13 +3809,13 @@ void tst_QSortFilterProxyModel::moveSourceRows()
filterProxy.setDynamicSortFilter(true);
filterProxy.sort(0, Qt::AscendingOrder);
filterProxy.setSourceModel(&proxy);
- filterProxy.setFilterRegExp("6"); // One of the parents
+ setupFilter(&filterProxy, QLatin1String("6")); // One of the parents
QSortFilterProxyModel filterBothProxy;
filterBothProxy.setDynamicSortFilter(true);
filterBothProxy.sort(0, Qt::AscendingOrder);
filterBothProxy.setSourceModel(&proxy);
- filterBothProxy.setFilterRegExp("5"); // The parents are 6 and 3. This filters both out.
+ setupFilter(&filterBothProxy, QLatin1String("5")); // The parents are 6 and 3. This filters both out.
QSignalSpy modelBeforeSpy(&model, &DynamicTreeModel::rowsAboutToBeMoved);
QSignalSpy modelAfterSpy(&model, &DynamicTreeModel::rowsMoved);
@@ -4244,7 +4213,7 @@ void tst_QSortFilterProxyModel::filterHint()
QSortFilterProxyModel proxy2;
proxy2.setSourceModel(&proxy1);
proxy2.setFilterRole(Qt::DisplayRole);
- proxy2.setFilterRegExp("^[^ ]*$");
+ setupFilter(&proxy2, QLatin1String("^[^ ]*$"));
proxy2.setDynamicSortFilter(true);
QSignalSpy proxy1BeforeSpy(&proxy1, &QSortFilterProxyModel::layoutAboutToBeChanged);
@@ -4372,8 +4341,7 @@ void tst_QSortFilterProxyModel::sourceLayoutChangeLeavesValidPersistentIndexes()
QSortFilterProxyModel proxy1;
proxy1.setSourceModel(&model);
Q_SET_OBJECT_NAME(proxy1);
-
- proxy1.setFilterRegExp("1|2");
+ setupFilter(&proxy1, QLatin1String("1|2"));
// The current state of things:
// model proxy
@@ -4420,7 +4388,7 @@ void tst_QSortFilterProxyModel::rowMoveLeavesValidPersistentIndexes()
proxy1.setSourceModel(&model);
Q_SET_OBJECT_NAME(proxy1);
- proxy1.setFilterRegExp("1|2");
+ setupFilter(&proxy1, QLatin1String("1|2"));
auto item5 = model.match(model.index(0, 0), Qt::DisplayRole, "5", 1, Qt::MatchRecursive).first();
auto item3 = model.match(model.index(0, 0), Qt::DisplayRole, "3", 1, Qt::MatchRecursive).first();
@@ -4482,6 +4450,44 @@ void tst_QSortFilterProxyModel::emitLayoutChangedOnlyIfSortingChanged_data()
QTest::newRow("many_changes_no_layoutChanged") << -1 << Qt::DisplayRole << "7,5,4,3,2,1,0,8" << "75432108" << "0248" << 0;
}
+// Custom version of QStringListModel which supports emitting dataChanged for many rows at once
+class CustomStringListModel : public QAbstractListModel
+{
+public:
+ bool setData(const QModelIndex &index, const QVariant &value, int role) override
+ {
+ if (index.row() >= 0 && index.row() < lst.size()
+ && (role == Qt::EditRole || role == Qt::DisplayRole)) {
+ lst.replace(index.row(), value.toString());
+ emit dataChanged(index, index, { Qt::DisplayRole, Qt::EditRole });
+ return true;
+ }
+ return false;
+ }
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override
+ {
+ if (role == Qt::DisplayRole || role == Qt::EditRole)
+ return lst.at(index.row());
+ return QVariant();
+ }
+ int rowCount(const QModelIndex & = QModelIndex()) const override { return lst.count(); }
+
+ void replaceData(const QStringList &newData)
+ {
+ lst = newData;
+ emit dataChanged(index(0, 0), index(rowCount() - 1, 0), { Qt::DisplayRole, Qt::EditRole });
+ }
+
+ void emitDecorationChangedSignal()
+ {
+ const QModelIndex idx = index(0, 0);
+ emit dataChanged(idx, idx, { Qt::DecorationRole });
+ }
+
+private:
+ QStringList lst;
+};
+
void tst_QSortFilterProxyModel::emitLayoutChangedOnlyIfSortingChanged()
{
QFETCH(int, changedRow);
@@ -4491,45 +4497,6 @@ void tst_QSortFilterProxyModel::emitLayoutChangedOnlyIfSortingChanged()
QFETCH(QString, expectedProxyRowTexts);
QFETCH(int, expectedLayoutChanged);
- // Custom version of QStringListModel which supports emitting dataChanged for many rows at once
- class CustomStringListModel : public QAbstractListModel
- {
- public:
- bool setData(const QModelIndex &index, const QVariant &value, int role) override
- {
- if (index.row() >= 0 && index.row() < lst.size()
- && (role == Qt::EditRole || role == Qt::DisplayRole)) {
- lst.replace(index.row(), value.toString());
- emit dataChanged(index, index, {Qt::DisplayRole, Qt::EditRole});
- return true;
- }
- return false;
- }
- QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override
- {
- if (role == Qt::DisplayRole || role == Qt::EditRole)
- return lst.at(index.row());
- return QVariant();
- }
- int rowCount(const QModelIndex & = QModelIndex()) const override
- {
- return lst.count();
- }
-
- void replaceData(const QStringList &newData)
- {
- lst = newData;
- emit dataChanged(index(0, 0), index(rowCount()-1, 0), {Qt::DisplayRole, Qt::EditRole});
- }
-
- void emitDecorationChangedSignal()
- {
- const QModelIndex idx = index(0, 0);
- emit dataChanged(idx, idx, {Qt::DecorationRole});
- }
- private:
- QStringList lst;
- };
CustomStringListModel model;
QStringList strings;
for (auto i = 8; i >= 1; --i)
@@ -4567,6 +4534,137 @@ void tst_QSortFilterProxyModel::emitLayoutChangedOnlyIfSortingChanged()
QCOMPARE(proxyLayoutChangedSpy.size(), expectedLayoutChanged);
}
+void tst_QSortFilterProxyModel::removeIntervals_data()
+{
+ QTest::addColumn<QStringList>("sourceItems");
+ QTest::addColumn<int>("sortOrder");
+ QTest::addColumn<QString>("filter");
+ QTest::addColumn<QStringList>("replacementSourceItems");
+ QTest::addColumn<IntPairList>("expectedRemovedProxyIntervals");
+ QTest::addColumn<QStringList>("expectedProxyItems");
+
+ QTest::newRow("filter all, sort ascending")
+ << (QStringList() << "a"
+ << "b"
+ << "c") // sourceItems
+ << static_cast<int>(Qt::AscendingOrder) // sortOrder
+ << "[^x]" // filter
+ << (QStringList() << "x"
+ << "x"
+ << "x") // replacementSourceItems
+ << (IntPairList() << IntPair(0, 2)) // expectedRemovedIntervals
+ << QStringList() // expectedProxyItems
+ ;
+
+ QTest::newRow("filter all, sort descending")
+ << (QStringList() << "a"
+ << "b"
+ << "c") // sourceItems
+ << static_cast<int>(Qt::DescendingOrder) // sortOrder
+ << "[^x]" // filter
+ << (QStringList() << "x"
+ << "x"
+ << "x") // replacementSourceItems
+ << (IntPairList() << IntPair(0, 2)) // expectedRemovedIntervals
+ << QStringList() // expectedProxyItems
+ ;
+
+ QTest::newRow("filter first and last, sort ascending")
+ << (QStringList() << "a"
+ << "b"
+ << "c") // sourceItems
+ << static_cast<int>(Qt::AscendingOrder) // sortOrder
+ << "[^x]" // filter
+ << (QStringList() << "x"
+ << "b"
+ << "x") // replacementSourceItems
+ << (IntPairList() << IntPair(2, 2) << IntPair(0, 0)) // expectedRemovedIntervals
+ << (QStringList() << "b") // expectedProxyItems
+ ;
+
+ QTest::newRow("filter first and last, sort descending")
+ << (QStringList() << "a"
+ << "b"
+ << "c") // sourceItems
+ << static_cast<int>(Qt::DescendingOrder) // sortOrder
+ << "[^x]" // filter
+ << (QStringList() << "x"
+ << "b"
+ << "x") // replacementSourceItems
+ << (IntPairList() << IntPair(2, 2) << IntPair(0, 0)) // expectedRemovedIntervals
+ << (QStringList() << "b") // expectedProxyItems
+ ;
+}
+
+void tst_QSortFilterProxyModel::removeIntervals()
+{
+ QFETCH(QStringList, sourceItems);
+ QFETCH(int, sortOrder);
+ QFETCH(QString, filter);
+ QFETCH(QStringList, replacementSourceItems);
+ QFETCH(IntPairList, expectedRemovedProxyIntervals);
+ QFETCH(QStringList, expectedProxyItems);
+
+ CustomStringListModel model;
+ QSortFilterProxyModel proxy;
+
+ model.replaceData(sourceItems);
+ proxy.setSourceModel(&model);
+
+ for (int i = 0; i < sourceItems.count(); ++i) {
+ QModelIndex sindex = model.index(i, 0, QModelIndex());
+ QModelIndex pindex = proxy.index(i, 0, QModelIndex());
+ QCOMPARE(proxy.data(pindex, Qt::DisplayRole), model.data(sindex, Qt::DisplayRole));
+ }
+
+ proxy.setDynamicSortFilter(true);
+
+ if (sortOrder != -1)
+ proxy.sort(0, static_cast<Qt::SortOrder>(sortOrder));
+ if (!filter.isEmpty())
+ setupFilter(&proxy, filter);
+
+ (void)proxy.rowCount(QModelIndex()); // force mapping
+
+ QSignalSpy removeSpy(&proxy, &QSortFilterProxyModel::rowsRemoved);
+ QSignalSpy insertSpy(&proxy, &QSortFilterProxyModel::rowsInserted);
+ QSignalSpy aboutToRemoveSpy(&proxy, &QSortFilterProxyModel::rowsAboutToBeRemoved);
+ QSignalSpy aboutToInsertSpy(&proxy, &QSortFilterProxyModel::rowsAboutToBeInserted);
+
+ QVERIFY(removeSpy.isValid());
+ QVERIFY(insertSpy.isValid());
+ QVERIFY(aboutToRemoveSpy.isValid());
+ QVERIFY(aboutToInsertSpy.isValid());
+
+ model.replaceData(replacementSourceItems);
+
+ QCOMPARE(aboutToRemoveSpy.count(), expectedRemovedProxyIntervals.count());
+ for (int i = 0; i < aboutToRemoveSpy.count(); ++i) {
+ QList<QVariant> args = aboutToRemoveSpy.at(i);
+ QCOMPARE(args.at(1).type(), QVariant::Int);
+ QCOMPARE(args.at(2).type(), QVariant::Int);
+ QCOMPARE(args.at(1).toInt(), expectedRemovedProxyIntervals.at(i).first);
+ QCOMPARE(args.at(2).toInt(), expectedRemovedProxyIntervals.at(i).second);
+ }
+ QCOMPARE(removeSpy.count(), expectedRemovedProxyIntervals.count());
+ for (int i = 0; i < removeSpy.count(); ++i) {
+ QList<QVariant> args = removeSpy.at(i);
+ QCOMPARE(args.at(1).type(), QVariant::Int);
+ QCOMPARE(args.at(2).type(), QVariant::Int);
+ QCOMPARE(args.at(1).toInt(), expectedRemovedProxyIntervals.at(i).first);
+ QCOMPARE(args.at(2).toInt(), expectedRemovedProxyIntervals.at(i).second);
+ }
+
+ QCOMPARE(insertSpy.count(), 0);
+ QCOMPARE(aboutToInsertSpy.count(), 0);
+
+ QCOMPARE(proxy.rowCount(QModelIndex()), expectedProxyItems.count());
+ for (int i = 0; i < expectedProxyItems.count(); ++i) {
+ QModelIndex pindex = proxy.index(i, 0, QModelIndex());
+ QCOMPARE(proxy.data(pindex, Qt::DisplayRole).toString(), expectedProxyItems.at(i));
+ }
+}
+
void tst_QSortFilterProxyModel::dynamicFilterWithoutSort()
{
QStringListModel model;
@@ -4849,5 +4947,4 @@ void tst_QSortFilterProxyModel::filterAndInsertRow()
}
}
-QTEST_MAIN(tst_QSortFilterProxyModel)
#include "tst_qsortfilterproxymodel.moc"
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h
new file mode 100644
index 0000000000..82d4b7344e
--- /dev/null
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h
@@ -0,0 +1,189 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef TST_QSORTFILTERPROXYMODEL_H
+#define TST_QSORTFILTERPROXYMODEL_H
+
+#include <QtTest/QtTest>
+#include "dynamictreemodel.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtGui/QStandardItem>
+#include <QtWidgets/QTreeView>
+#include <QtWidgets/QTableView>
+
+#include <qdebug.h>
+
+typedef QList<int> IntList;
+typedef QPair<int, int> IntPair;
+typedef QList<IntPair> IntPairList;
+
+enum class FilterType {
+ RegExp,
+ RegularExpression
+};
+
+Q_DECLARE_METATYPE(QList<QPersistentModelIndex>)
+
+class tst_QSortFilterProxyModel : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_QSortFilterProxyModel();
+
+public slots:
+ void initTestCase();
+ void cleanupTestCase();
+ void cleanup();
+
+private slots:
+ void getSetCheck();
+ void sort_data();
+ void sort();
+ void sortHierarchy_data();
+ void sortHierarchy();
+
+ void insertRows_data();
+ void insertRows();
+ void prependRow();
+ void appendRowFromCombobox_data();
+ void appendRowFromCombobox();
+ void removeRows_data();
+ void removeRows();
+ void removeColumns_data();
+ void removeColumns();
+ void insertAfterSelect();
+ void removeAfterSelect();
+ void filter_data();
+ void filter();
+ void filterHierarchy_data();
+ void filterHierarchy();
+ void filterColumns_data();
+ void filterColumns();
+
+ void filterTable();
+ void filterCurrent();
+ void filter_qtbug30662();
+
+ void changeSourceLayout();
+ void changeSourceLayoutFilteredOut();
+ void removeSourceRows_data();
+ void removeSourceRows();
+ void insertSourceRows_data();
+ void insertSourceRows();
+ void changeFilter_data();
+ void changeFilter();
+ void changeSourceData_data();
+ void changeSourceData();
+ void changeSourceDataKeepsStableSorting_qtbug1548();
+ void changeSourceDataForwardsRoles_qtbug35440();
+ void resortingDoesNotBreakTreeModels();
+ void dynamicFilterWithoutSort();
+ void sortFilterRole();
+ void selectionFilteredOut();
+ void match_data();
+ void match();
+ void insertIntoChildrenlessItem();
+ void invalidateMappedChildren();
+ void insertRowIntoFilteredParent();
+ void filterOutParentAndFilterInChild();
+
+ void sourceInsertRows();
+ void sourceModelDeletion();
+
+ void sortColumnTracking1();
+ void sortColumnTracking2();
+
+ void sortStable();
+
+ void hiddenColumns();
+ void insertRowsSort();
+ void staticSorting();
+ void dynamicSorting();
+ void fetchMore();
+ void hiddenChildren();
+ void mapFromToSource();
+ void removeRowsRecursive();
+ void doubleProxySelectionSetSourceModel();
+ void appearsAndSort();
+ void unnecessaryDynamicSorting();
+ void unnecessaryMapCreation();
+ void resetInvalidate_data();
+ void resetInvalidate();
+
+ void testMultipleProxiesWithSelection();
+ void mapSelectionFromSource();
+ void testResetInternalData();
+ void filteredColumns();
+ void headerDataChanged();
+
+ void testParentLayoutChanged();
+ void moveSourceRows();
+
+ void hierarchyFilterInvalidation();
+ void simpleFilterInvalidation();
+
+ void chainedProxyModelRoleNames();
+
+ void noMapAfterSourceDelete();
+ void forwardDropApi();
+ void canDropMimeData();
+ void filterHint();
+
+ void sourceLayoutChangeLeavesValidPersistentIndexes();
+ void rowMoveLeavesValidPersistentIndexes();
+
+ void emitLayoutChangedOnlyIfSortingChanged_data();
+ void emitLayoutChangedOnlyIfSortingChanged();
+
+ void checkSetNewModel();
+ void filterAndInsertRow_data();
+ void filterAndInsertRow();
+ void filterAndInsertColumn_data();
+ void filterAndInsertColumn();
+
+ void removeIntervals_data();
+ void removeIntervals();
+
+protected:
+ void buildHierarchy(const QStringList &data, QAbstractItemModel *model);
+ void checkHierarchy(const QStringList &data, const QAbstractItemModel *model);
+ void setupFilter(QSortFilterProxyModel *model, const QString& pattern);
+
+protected:
+ FilterType m_filterType;
+
+private:
+ QStandardItemModel *m_model;
+ QSortFilterProxyModel *m_proxy;
+};
+
+Q_DECLARE_METATYPE(QAbstractItemModel::LayoutChangeHint)
+
+#endif // TST_QSORTFILTERPROXYMODEL_H
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regexp/.gitignore b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regexp/.gitignore
new file mode 100644
index 0000000000..4fdaebc09d
--- /dev/null
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regexp/.gitignore
@@ -0,0 +1 @@
+tst_qsortfilterproxymodel_regexp
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regexp/qsortfilterproxymodel_regexp.pro b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regexp/qsortfilterproxymodel_regexp.pro
new file mode 100644
index 0000000000..7c510930f4
--- /dev/null
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regexp/qsortfilterproxymodel_regexp.pro
@@ -0,0 +1,16 @@
+CONFIG += testcase
+TARGET = tst_qsortfilterproxymodel_regexp
+
+QT += widgets testlib
+mtdir = ../../../other/qabstractitemmodelutils
+qsfpmdir = ../qsortfilterproxymodel_common
+
+INCLUDEPATH += $$PWD/$${mtdir} $$PWD/$${qsfpmdir}
+SOURCES += \
+ tst_qsortfilterproxymodel_regexp.cpp \
+ $${qsfpmdir}/tst_qsortfilterproxymodel.cpp \
+ $${mtdir}/dynamictreemodel.cpp
+
+HEADERS += \
+ $${qsfpmdir}/tst_qsortfilterproxymodel.h \
+ $${mtdir}/dynamictreemodel.h
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regexp/tst_qsortfilterproxymodel_regexp.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regexp/tst_qsortfilterproxymodel_regexp.cpp
new file mode 100644
index 0000000000..38607f1378
--- /dev/null
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regexp/tst_qsortfilterproxymodel_regexp.cpp
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+
+#include "tst_qsortfilterproxymodel.h"
+
+class tst_QSortFilterProxyModelRegExp : public tst_QSortFilterProxyModel
+{
+ Q_OBJECT
+public:
+ tst_QSortFilterProxyModelRegExp();
+private slots:
+ void tst_invalid();
+ void tst_caseSensitivity();
+};
+
+tst_QSortFilterProxyModelRegExp::tst_QSortFilterProxyModelRegExp() :
+ tst_QSortFilterProxyModel()
+{
+ m_filterType = FilterType::RegExp;
+}
+
+void tst_QSortFilterProxyModelRegExp::tst_invalid()
+{
+ const QLatin1String pattern("test");
+ QSortFilterProxyModel model;
+ model.setFilterRegExp(pattern);
+ QCOMPARE(model.filterRegExp(), QRegExp(pattern));
+ model.setFilterRegularExpression(pattern);
+ QCOMPARE(model.filterRegExp(), QRegExp());
+}
+
+void tst_QSortFilterProxyModelRegExp::tst_caseSensitivity()
+{
+ const QLatin1String pattern("test");
+ QSortFilterProxyModel model;
+ model.setFilterCaseSensitivity(Qt::CaseInsensitive);
+ model.setFilterRegExp(pattern);
+ QCOMPARE(model.filterCaseSensitivity(), Qt::CaseInsensitive);
+}
+
+QTEST_MAIN(tst_QSortFilterProxyModelRegExp)
+#include "tst_qsortfilterproxymodel_regexp.moc"
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regularexpression/.gitignore b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regularexpression/.gitignore
new file mode 100644
index 0000000000..286771e250
--- /dev/null
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regularexpression/.gitignore
@@ -0,0 +1 @@
+tst_qsortfilterproxymodel_regularexpression
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regularexpression/qsortfilterproxymodel_regularexpression.pro b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regularexpression/qsortfilterproxymodel_regularexpression.pro
new file mode 100644
index 0000000000..e993d07126
--- /dev/null
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regularexpression/qsortfilterproxymodel_regularexpression.pro
@@ -0,0 +1,16 @@
+CONFIG += testcase
+TARGET = tst_qsortfilterproxymodel_regularexpression
+
+QT += widgets testlib
+mtdir = ../../../other/qabstractitemmodelutils
+qsfpmdir = ../qsortfilterproxymodel_common
+
+INCLUDEPATH += $$PWD/$${mtdir} $${qsfpmdir}
+SOURCES += \
+ tst_qsortfilterproxymodel_regularexpression.cpp \
+ $${qsfpmdir}/tst_qsortfilterproxymodel.cpp \
+ $${mtdir}/dynamictreemodel.cpp
+
+HEADERS += \
+ $${qsfpmdir}/tst_qsortfilterproxymodel.h \
+ $${mtdir}/dynamictreemodel.h
diff --git a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.h b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regularexpression/tst_qsortfilterproxymodel_regularexpression.cpp
index 8bb4aa0cce..821e199bcb 100644
--- a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.h
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regularexpression/tst_qsortfilterproxymodel_regularexpression.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2012 Giuseppe D'Angelo <dangelog@gmail.com>.
+** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -26,49 +26,34 @@
**
****************************************************************************/
-#include <qobject.h>
-#include <qregularexpression.h>
+#include <QtTest/QtTest>
-Q_DECLARE_METATYPE(QRegularExpression::PatternOptions)
-Q_DECLARE_METATYPE(QRegularExpression::MatchType)
-Q_DECLARE_METATYPE(QRegularExpression::MatchOptions)
+#include "tst_qsortfilterproxymodel.h"
-class tst_QRegularExpression : public QObject
+class tst_QSortFilterProxyModelRegularExpression : public tst_QSortFilterProxyModel
{
Q_OBJECT
-
+public:
+ tst_QSortFilterProxyModelRegularExpression();
private slots:
- void defaultConstructors();
- void gettersSetters_data();
- void gettersSetters();
- void escape_data();
- void escape();
- void validity_data();
- void validity();
- void patternOptions_data();
- void patternOptions();
- void normalMatch_data();
- void normalMatch();
- void partialMatch_data();
- void partialMatch();
- void globalMatch_data();
- void globalMatch();
- void serialize_data();
- void serialize();
- void operatoreq_data();
- void operatoreq();
- void captureCount_data();
- void captureCount();
- void captureNames_data();
- void captureNames();
- void pcreJitStackUsage_data();
- void pcreJitStackUsage();
- void regularExpressionMatch_data();
- void regularExpressionMatch();
- void JOptionUsage_data();
- void JOptionUsage();
- void QStringAndQStringRefEquivalence();
-
-private:
- void provideRegularExpressions();
+ void tst_invalid();
};
+
+tst_QSortFilterProxyModelRegularExpression::tst_QSortFilterProxyModelRegularExpression() :
+ tst_QSortFilterProxyModel()
+{
+ m_filterType = FilterType::RegularExpression;
+}
+
+void tst_QSortFilterProxyModelRegularExpression::tst_invalid()
+{
+ const QLatin1String pattern("test");
+ QSortFilterProxyModel model;
+ model.setFilterRegularExpression(pattern);
+ QCOMPARE(model.filterRegularExpression(), QRegularExpression(pattern));
+ model.setFilterRegExp(pattern);
+ QCOMPARE(model.filterRegularExpression(), QRegularExpression());
+}
+
+QTEST_MAIN(tst_QSortFilterProxyModelRegularExpression)
+#include "tst_qsortfilterproxymodel_regularexpression.moc"
diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
index 5e9dbdd226..a53501b9dd 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
+++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
@@ -415,7 +415,7 @@ void tst_QCoreApplication::removePostedEvents()
expected.clear();
}
-#ifndef QT_NO_THREAD
+#if QT_CONFIG(thread)
class DeliverInDefinedOrderThread : public QThread
{
Q_OBJECT
@@ -532,7 +532,7 @@ void tst_QCoreApplication::deliverInDefinedOrder()
QObject::connect(&obj, SIGNAL(done()), &app, SLOT(quit()));
app.exec();
}
-#endif // QT_NO_QTHREAD
+#endif // QT_CONFIG(thread)
void tst_QCoreApplication::applicationPid()
{
diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h
index b6c20a915f..105cca5174 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h
+++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h
@@ -43,7 +43,7 @@ private slots:
void argc();
void postEvent();
void removePostedEvents();
-#ifndef QT_NO_THREAD
+#if QT_CONFIG(thread)
void deliverInDefinedOrder();
#endif
void applicationPid();
diff --git a/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST b/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST
index 4cd3c2f0c8..4dd71ca9f4 100644
--- a/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST
+++ b/tests/auto/corelib/kernel/qelapsedtimer/BLACKLIST
@@ -1,3 +1,4 @@
[elapsed]
windows
osx-10.12
+osx-10.13
diff --git a/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST b/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST
index 402d87b82f..b1590a5ccf 100644
--- a/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST
+++ b/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST
@@ -1,6 +1,5 @@
[sendPostedEvents]
windows
-osx
[registerTimer]
windows
-osx
+winrt
diff --git a/tests/auto/corelib/kernel/qmetaenum/tst_qmetaenum.cpp b/tests/auto/corelib/kernel/qmetaenum/tst_qmetaenum.cpp
index e4aa8b80c0..6ed0a6caa9 100644
--- a/tests/auto/corelib/kernel/qmetaenum/tst_qmetaenum.cpp
+++ b/tests/auto/corelib/kernel/qmetaenum/tst_qmetaenum.cpp
@@ -37,19 +37,33 @@ class tst_QMetaEnum : public QObject
Q_OBJECT
public:
enum SuperEnum { SuperValue1 = 1 , SuperValue2 = 2 };
+ enum Flag { Flag1 = 1 , Flag2 = 2 };
+ Q_DECLARE_FLAGS(Flags, Flag)
Q_ENUM(SuperEnum)
+ Q_FLAG(Flags)
private slots:
void fromType();
void valuesToKeys_data();
void valuesToKeys();
+ void defaultConstructed();
};
void tst_QMetaEnum::fromType()
{
QMetaEnum meta = QMetaEnum::fromType<SuperEnum>();
QVERIFY(meta.isValid());
+ QVERIFY(!meta.isFlag());
QCOMPARE(meta.name(), "SuperEnum");
+ QCOMPARE(meta.enumName(), "SuperEnum");
+ QCOMPARE(meta.enclosingMetaObject(), &staticMetaObject);
+ QCOMPARE(meta.keyCount(), 2);
+
+ meta = QMetaEnum::fromType<Flags>();
+ QVERIFY(meta.isValid());
+ QVERIFY(meta.isFlag());
+ QCOMPARE(meta.name(), "Flags");
+ QCOMPARE(meta.enumName(), "Flag");
QCOMPARE(meta.enclosingMetaObject(), &staticMetaObject);
QCOMPARE(meta.keyCount(), 2);
}
@@ -86,6 +100,15 @@ void tst_QMetaEnum::valuesToKeys()
QCOMPARE(me.valueToKeys(windowFlags), expected);
}
+void tst_QMetaEnum::defaultConstructed()
+{
+ QMetaEnum e;
+ QVERIFY(!e.isValid());
+ QVERIFY(!e.isScoped());
+ QVERIFY(!e.isFlag());
+ QCOMPARE(e.name(), QByteArray());
+}
+
Q_STATIC_ASSERT(QtPrivate::IsQEnumHelper<tst_QMetaEnum::SuperEnum>::Value);
Q_STATIC_ASSERT(QtPrivate::IsQEnumHelper<Qt::WindowFlags>::Value);
Q_STATIC_ASSERT(QtPrivate::IsQEnumHelper<Qt::Orientation>::Value);
diff --git a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp
index 431a9ebdea..9855bec520 100644
--- a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp
+++ b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp
@@ -54,6 +54,11 @@ namespace MyNamespace {
MyEnum2,
MyEnum3
};
+ enum class MyScopedEnum {
+ Enum1,
+ Enum2,
+ Enum3
+ };
enum MyAnotherEnum {
MyAnotherEnum1 = 1,
MyAnotherEnum2 = 2,
@@ -64,7 +69,13 @@ namespace MyNamespace {
MyFlag2 = 0x02,
MyFlag3 = 0x04
};
+ enum class MyScopedFlag {
+ MyFlag1 = 0x10,
+ MyFlag2 = 0x20,
+ MyFlag3 = 0x40
+ };
Q_DECLARE_FLAGS(MyFlags, MyFlag)
+ Q_DECLARE_FLAGS(MyScopedFlags, MyScopedFlag)
MyEnum myEnum() const { return m_enum; }
void setMyEnum(MyEnum val) { m_enum = val; }
@@ -79,8 +90,10 @@ namespace MyNamespace {
{ }
private:
Q_ENUM(MyEnum)
+ Q_ENUM(MyScopedEnum)
Q_ENUM(MyAnotherEnum)
Q_FLAG(MyFlags)
+ Q_FLAG(MyScopedFlags)
MyEnum m_enum;
MyFlags m_flags;
@@ -1730,20 +1743,35 @@ void tst_QMetaObject::signalIndex()
void tst_QMetaObject::enumDebugStream()
{
- QTest::ignoreMessage(QtDebugMsg, "hello MyNamespace::MyClass::MyEnum(MyEnum2) world ");
- MyNamespace::MyClass::MyEnum e = MyNamespace::MyClass::MyEnum2;
- qDebug() << "hello" << e << "world";
+ QTest::ignoreMessage(QtDebugMsg, "hello MyNamespace::MyClass::MyEnum2 world ");
+ qDebug() << "hello" << MyNamespace::MyClass::MyEnum2 << "world";
+
+ QTest::ignoreMessage(QtDebugMsg, "hello MyNamespace::MyClass::MyScopedEnum::Enum3 scoped world ");
+ qDebug() << "hello" << MyNamespace::MyClass::MyScopedEnum::Enum3 << "scoped world";
- QTest::ignoreMessage(QtDebugMsg, "Qt::WindowType(WindowTitleHint) Qt::WindowType(Window) Qt::WindowType(Desktop) Qt::WindowType(WindowSystemMenuHint)");
- qDebug() << Qt::WindowTitleHint << Qt::Window <<Qt::Desktop << Qt::WindowSystemMenuHint;
+ QTest::ignoreMessage(QtDebugMsg, "Qt::WindowTitleHint Qt::Window Qt::Desktop Qt::WindowSystemMenuHint");
+ qDebug() << Qt::WindowTitleHint << Qt::Window << Qt::Desktop << Qt::WindowSystemMenuHint;
- QTest::ignoreMessage(QtDebugMsg, "hello QFlags<MyNamespace::MyClass::MyFlags>(MyFlag1) world");
+ QTest::ignoreMessage(QtDebugMsg, "hello QFlags<MyNamespace::MyClass::MyFlag>(MyFlag1) world");
MyNamespace::MyClass::MyFlags f1 = MyNamespace::MyClass::MyFlag1;
qDebug() << "hello" << f1 << "world";
MyNamespace::MyClass::MyFlags f2 = MyNamespace::MyClass::MyFlag2 | MyNamespace::MyClass::MyFlag3;
- QTest::ignoreMessage(QtDebugMsg, "QFlags<MyNamespace::MyClass::MyFlags>(MyFlag1) QFlags<MyNamespace::MyClass::MyFlags>(MyFlag2|MyFlag3)");
+ QTest::ignoreMessage(QtDebugMsg, "QFlags<MyNamespace::MyClass::MyFlag>(MyFlag1) QFlags<MyNamespace::MyClass::MyFlag>(MyFlag2|MyFlag3)");
qDebug() << f1 << f2;
+
+ QTest::ignoreMessage(QtDebugMsg, "QFlags<MyNamespace::MyClass::MyScopedFlag>(MyFlag2)");
+ MyNamespace::MyClass::MyScopedFlags f3 = MyNamespace::MyClass::MyScopedFlag::MyFlag2;
+ qDebug() << f3;
+
+ QTest::ignoreMessage(QtDebugMsg, "QFlags<MyNamespace::MyClass::MyScopedFlag>(MyFlag2|MyFlag3)");
+ f3 |= MyNamespace::MyClass::MyScopedFlag::MyFlag3;
+ qDebug() << f3;
+
+ // Single flag recognized as enum:
+ QTest::ignoreMessage(QtDebugMsg, "MyNamespace::MyClass::MyFlag1");
+ MyNamespace::MyClass::MyFlag f4 = MyNamespace::MyClass::MyFlag1;
+ qDebug() << f4;
}
void tst_QMetaObject::inherits_data()
diff --git a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
index 6bb031e357..56623773a2 100644
--- a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
+++ b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
@@ -830,6 +830,7 @@ void tst_QMetaObjectBuilder::enumerator()
// Modify the attributes on enum1.
enum1.setIsFlag(true);
enum1.setIsScoped(true);
+ enum1.setEnumName(QByteArrayLiteral("fooFlag"));
QCOMPARE(enum1.addKey("ABC", 0), 0);
QCOMPARE(enum1.addKey("DEF", 1), 1);
QCOMPARE(enum1.addKey("GHI", -1), 2);
@@ -838,6 +839,7 @@ void tst_QMetaObjectBuilder::enumerator()
QCOMPARE(enum1.name(), QByteArray("foo"));
QVERIFY(enum1.isFlag());
QVERIFY(enum1.isScoped());
+ QCOMPARE(enum1.enumName(), QByteArray("fooFlag"));
QCOMPARE(enum1.keyCount(), 3);
QCOMPARE(enum1.index(), 0);
QCOMPARE(enum1.key(0), QByteArray("ABC"));
diff --git a/tests/auto/corelib/kernel/qmetatype/qmetatype.pro b/tests/auto/corelib/kernel/qmetatype/qmetatype.pro
index ad148ccc7f..d70befecfd 100644
--- a/tests/auto/corelib/kernel/qmetatype/qmetatype.pro
+++ b/tests/auto/corelib/kernel/qmetatype/qmetatype.pro
@@ -1,6 +1,6 @@
CONFIG += testcase
TARGET = tst_qmetatype
-QT = core testlib
+QT = core-private testlib
INCLUDEPATH += $$PWD/../../../other/qvariant_common
SOURCES = tst_qmetatype.cpp
TESTDATA=./typeFlags.bin
diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
index e312199980..5d9b5ca95c 100644
--- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
+++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
@@ -29,6 +29,7 @@
#include <QtCore>
#include <QtTest/QtTest>
+#include <QtCore/private/qmetaobjectbuilder_p.h>
#include "tst_qmetatype.h"
#include "tst_qvariant_common.h"
@@ -38,6 +39,7 @@
#endif
#include <algorithm>
+#include <memory>
// mingw gcc 4.8 also takes way too long, letting the CI system abort the test
#if defined(__MINGW32__)
@@ -52,12 +54,19 @@ class tst_QMetaType: public QObject
Q_PROPERTY(QList<QVariant> prop READ prop WRITE setProp)
public:
+ struct GadgetPropertyType {
+ QByteArray type;
+ QByteArray name;
+ QVariant testData;
+ };
+
tst_QMetaType() { propList << 42 << "Hello"; }
QList<QVariant> prop() const { return propList; }
void setProp(const QList<QVariant> &list) { propList = list; }
private:
+ void registerGadget(const char * name, const QVector<GadgetPropertyType> &gadgetProperties);
QList<QVariant> propList;
private slots:
@@ -89,6 +98,7 @@ private slots:
void flagsBinaryCompatibility5_0();
void construct_data();
void construct();
+ void typedConstruct();
void constructCopy_data();
void constructCopy();
void typedefs();
@@ -115,6 +125,128 @@ private slots:
void customDebugStream();
};
+struct BaseGenericType
+{
+ int m_typeId = -1;
+ virtual void *constructor(int typeId, void *where, const void *copy) = 0;
+ virtual void staticMetacallFunction(QMetaObject::Call _c, int _id, void **_a) = 0;
+ virtual void saveOperator(QDataStream & out) const = 0;
+ virtual void loadOperator(QDataStream &in) = 0;
+ virtual ~BaseGenericType() {}
+};
+
+struct GenericGadgetType : BaseGenericType
+{
+ void *constructor(int typeId, void *where, const void *copy) override
+ {
+ GenericGadgetType *ret = where ? new(where) GenericGadgetType : new GenericGadgetType;
+ ret->m_typeId = typeId;
+ if (copy) {
+ Q_ASSERT(ret->m_typeId == reinterpret_cast<const GenericGadgetType*>(copy)->m_typeId);
+ *ret = *reinterpret_cast<const GenericGadgetType*>(copy);
+ } else {
+ ret->properties = properties;
+ }
+ return ret;
+ }
+
+ void staticMetacallFunction(QMetaObject::Call _c, int _id, void **_a) override
+ {
+ if (_c == QMetaObject::ReadProperty) {
+ if (_id < properties.size()) {
+ const auto &prop = properties.at(_id);
+ QMetaType::destruct(int(prop.userType()), _a[0]);
+ QMetaType::construct(int(prop.userType()), _a[0], prop.constData());
+ }
+ } else if (_c == QMetaObject::WriteProperty) {
+ if (_id < properties.size()) {
+ auto & prop = properties[_id];
+ prop = QVariant(prop.userType(), _a[0]);
+ }
+ }
+ }
+
+ void saveOperator(QDataStream & out) const override
+ {
+ for (const auto &prop : properties)
+ out << prop;
+ }
+
+ void loadOperator(QDataStream &in) override
+ {
+ for (auto &prop : properties)
+ in >> prop;
+ }
+ QVector<QVariant> properties;
+};
+
+struct GenericPODType : BaseGenericType
+{
+ // BaseGenericType interface
+ void *constructor(int typeId, void *where, const void *copy) override
+ {
+ GenericPODType *ret = where ? new(where) GenericPODType : new GenericPODType;
+ ret->m_typeId = typeId;
+ if (copy) {
+ Q_ASSERT(ret->m_typeId == reinterpret_cast<const GenericPODType*>(copy)->m_typeId);
+ *ret = *reinterpret_cast<const GenericPODType*>(copy);
+ } else {
+ ret->podData = podData;
+ }
+ return ret;
+ }
+
+ void staticMetacallFunction(QMetaObject::Call _c, int _id, void **_a) override
+ {
+ Q_UNUSED(_c);
+ Q_UNUSED(_id);
+ Q_UNUSED(_a);
+ Q_ASSERT(false);
+ }
+
+ void saveOperator(QDataStream &out) const override
+ {
+ out << podData;
+ }
+ void loadOperator(QDataStream &in) override
+ {
+ in >> podData;
+ }
+ QByteArray podData;
+};
+
+using RegisteredType = QPair<std::shared_ptr<BaseGenericType>, std::shared_ptr<QMetaObject>>;
+static QHash<int, RegisteredType> s_managedTypes;
+
+static void GadgetsStaticMetacallFunction(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
+{
+ reinterpret_cast<BaseGenericType*>(_o)->staticMetacallFunction(_c, _id, _a);
+}
+
+static void GadgetTypedDestructor(int typeId, void *ptr)
+{
+ QCOMPARE(typeId, reinterpret_cast<BaseGenericType*>(ptr)->m_typeId);
+ reinterpret_cast<BaseGenericType*>(ptr)->~BaseGenericType();
+}
+
+static void *GadgetTypedConstructor(int type, void *where, const void *copy)
+{
+ auto it = s_managedTypes.find(type);
+ if (it == s_managedTypes.end())
+ return nullptr; // crash the test
+ return it->first->constructor(type, where, copy);
+}
+
+static void GadgetSaveOperator(QDataStream & out, const void *data)
+{
+ reinterpret_cast<const BaseGenericType *>(data)->saveOperator(out);
+}
+
+static void GadgetLoadOperator(QDataStream &in, void *data)
+{
+ reinterpret_cast<BaseGenericType *>(data)->loadOperator(in);
+}
+
struct Foo { int i; };
@@ -149,6 +281,34 @@ class GadgetDerivedAndTyped : public CustomGadget {};
Q_DECLARE_METATYPE(GadgetDerivedAndTyped<int>)
Q_DECLARE_METATYPE(GadgetDerivedAndTyped<int>*)
+void tst_QMetaType::registerGadget(const char *name, const QVector<GadgetPropertyType> &gadgetProperties)
+{
+ QMetaObjectBuilder gadgetBuilder;
+ gadgetBuilder.setClassName(name);
+ QMetaObjectBuilder::MetaObjectFlags metaObjectflags = QMetaObjectBuilder::DynamicMetaObject | QMetaObjectBuilder::PropertyAccessInStaticMetaCall;
+ gadgetBuilder.setFlags(metaObjectflags);
+ auto dynamicGadgetProperties = std::make_shared<GenericGadgetType>();
+ for (const auto &prop : gadgetProperties) {
+ int propertyType = QMetaType::type(prop.type);
+ dynamicGadgetProperties->properties.push_back(QVariant(QVariant::Type(propertyType)));
+ auto dynamicPropery = gadgetBuilder.addProperty(prop.name, prop.type);
+ dynamicPropery.setWritable(true);
+ dynamicPropery.setReadable(true);
+ }
+ auto meta = gadgetBuilder.toMetaObject();
+ meta->d.static_metacall = &GadgetsStaticMetacallFunction;
+ meta->d.superdata = nullptr;
+ const auto flags = QMetaType::WasDeclaredAsMetaType | QMetaType::IsGadget | QMetaType::NeedsConstruction | QMetaType::NeedsDestruction;
+ int gadgetTypeId = QMetaType::registerType(name,
+ &GadgetTypedDestructor,
+ &GadgetTypedConstructor,
+ sizeof(GenericGadgetType),
+ flags, meta);
+ QVERIFY(gadgetTypeId > 0);
+ QMetaType::registerStreamOperators(gadgetTypeId, &GadgetSaveOperator, &GadgetLoadOperator);
+ s_managedTypes[gadgetTypeId] = qMakePair(dynamicGadgetProperties, std::shared_ptr<QMetaObject>{meta, [](QMetaObject *ptr){ ::free(ptr); }});
+}
+
void tst_QMetaType::defined()
{
QCOMPARE(int(QMetaTypeId2<QString>::Defined), 1);
@@ -906,6 +1066,90 @@ FOR_EACH_CORE_METATYPE(RETURN_CONSTRUCT_FUNCTION)
TypeTestFunctionGetter::get(type)();
}
+void tst_QMetaType::typedConstruct()
+{
+ auto testMetaObjectWriteOnGadget = [](QVariant &gadget, const QVector<GadgetPropertyType> &properties)
+ {
+ auto metaObject = QMetaType::metaObjectForType(gadget.userType());
+ QVERIFY(metaObject != nullptr);
+ QCOMPARE(metaObject->methodCount(), 0);
+ QCOMPARE(metaObject->propertyCount(), properties.size());
+ for (int i = 0; i < metaObject->propertyCount(); ++i) {
+ auto prop = metaObject->property(i);
+ QCOMPARE(properties[i].name, prop.name());
+ QCOMPARE(properties[i].type, prop.typeName());
+ prop.writeOnGadget(gadget.data(), properties[i].testData);
+ }
+ };
+
+ auto testMetaObjectReadOnGadget = [](QVariant gadget, const QVector<GadgetPropertyType> &properties)
+ {
+ auto metaObject = QMetaType::metaObjectForType(gadget.userType());
+ QVERIFY(metaObject != nullptr);
+ QCOMPARE(metaObject->methodCount(), 0);
+ QCOMPARE(metaObject->propertyCount(), properties.size());
+ for (int i = 0; i < metaObject->propertyCount(); ++i) {
+ auto prop = metaObject->property(i);
+ QCOMPARE(properties[i].name, prop.name());
+ QCOMPARE(properties[i].type, prop.typeName());
+ if (!QMetaType::typeFlags(prop.userType()).testFlag(QMetaType::IsGadget))
+ QCOMPARE(properties[i].testData, prop.readOnGadget(gadget.constData()));
+ }
+ };
+
+ QVector<GadgetPropertyType> dynamicGadget1 = {
+ {"int", "int_prop", 34526},
+ {"float", "float_prop", 1.23f},
+ {"QString", "string_prop", QString{"Test QString"}}
+ };
+ registerGadget("DynamicGadget1", dynamicGadget1);
+
+ QVariant testGadget1(QVariant::Type(QMetaType::type("DynamicGadget1")));
+ testMetaObjectWriteOnGadget(testGadget1, dynamicGadget1);
+ testMetaObjectReadOnGadget(testGadget1, dynamicGadget1);
+
+
+ QVector<GadgetPropertyType> dynamicGadget2 = {
+ {"int", "int_prop", 512},
+ {"double", "double_prop", 4.56},
+ {"QString", "string_prop", QString{"Another String"}},
+ {"DynamicGadget1", "dynamicGadget1_prop", testGadget1}
+ };
+ registerGadget("DynamicGadget2", dynamicGadget2);
+ QVariant testGadget2(QVariant::Type(QMetaType::type("DynamicGadget2")));
+ testMetaObjectWriteOnGadget(testGadget2, dynamicGadget2);
+ testMetaObjectReadOnGadget(testGadget2, dynamicGadget2);
+ auto g2mo = QMetaType::metaObjectForType(testGadget2.userType());
+ auto dynamicGadget1_prop = g2mo->property(g2mo->indexOfProperty("dynamicGadget1_prop"));
+ testMetaObjectReadOnGadget(dynamicGadget1_prop.readOnGadget(testGadget2.constData()), dynamicGadget1);
+
+
+ // Register POD
+ const QByteArray myPodTesData = "My POD test data";
+ const char podTypeName[] = "DynamicPOD";
+ auto dynamicGadgetProperties = std::make_shared<GenericPODType>();
+ dynamicGadgetProperties->podData = myPodTesData;
+ const auto flags = QMetaType::NeedsConstruction | QMetaType::NeedsDestruction;
+ int podTypeId = QMetaType::registerType(podTypeName,
+ &GadgetTypedDestructor,
+ &GadgetTypedConstructor,
+ sizeof(GenericGadgetType),
+ flags, nullptr);
+ QVERIFY(podTypeId > 0);
+ QMetaType::registerStreamOperators(podTypeId, &GadgetSaveOperator, &GadgetLoadOperator);
+ s_managedTypes[podTypeId] = qMakePair(dynamicGadgetProperties, std::shared_ptr<QMetaObject>{});
+
+ // Test POD
+ QCOMPARE(podTypeId, QMetaType::type(podTypeName));
+ QVariant podVariant{QVariant::Type(podTypeId)};
+ QCOMPARE(myPodTesData, static_cast<const GenericPODType *>(reinterpret_cast<const BaseGenericType *>(podVariant.constData()))->podData);
+
+ QVariant podVariant1{podVariant};
+ podVariant1.detach(); // Test stream operators
+ static_cast<GenericPODType *>(reinterpret_cast<BaseGenericType *>(podVariant.data()))->podData.clear();
+ QCOMPARE(myPodTesData, static_cast<const GenericPODType *>(reinterpret_cast<const BaseGenericType *>(podVariant1.constData()))->podData);
+}
+
template<int ID>
static void testConstructCopyHelper()
{
@@ -1574,6 +1818,9 @@ DECLARE_NONSTREAMABLE(QJsonValue)
DECLARE_NONSTREAMABLE(QJsonObject)
DECLARE_NONSTREAMABLE(QJsonArray)
DECLARE_NONSTREAMABLE(QJsonDocument)
+DECLARE_NONSTREAMABLE(QCborValue)
+DECLARE_NONSTREAMABLE(QCborArray)
+DECLARE_NONSTREAMABLE(QCborMap)
DECLARE_NONSTREAMABLE(QObject*)
DECLARE_NONSTREAMABLE(QWidget*)
diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.h b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.h
index 93ff33bb67..6bda9638f7 100644
--- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.h
+++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.h
@@ -273,6 +273,24 @@ template<> struct TestValueFactory<QMetaType::QJsonDocument> {
);
}
};
+
+template<> struct TestValueFactory<QMetaType::QCborSimpleType> {
+ static QCborSimpleType *create() { return new QCborSimpleType(QCborSimpleType::True); }
+};
+template<> struct TestValueFactory<QMetaType::QCborValue> {
+ static QCborValue *create() { return new QCborValue(123.); }
+};
+template<> struct TestValueFactory<QMetaType::QCborMap> {
+ static QCborMap *create() {
+ return new QCborMap{{0, 0}, {"Hello", 1}, {1, nullptr}};
+ }
+};
+template<> struct TestValueFactory<QMetaType::QCborArray> {
+ static QCborArray *create() {
+ return new QCborArray{0, 1, -2, 2.5, false, nullptr, "Hello", QByteArray("World") };
+ }
+};
+
template<> struct TestValueFactory<QMetaType::QVariant> {
static QVariant *create() { return new QVariant(QStringList(QStringList() << "Q" << "t")); }
};
diff --git a/tests/auto/corelib/kernel/qobject/.gitignore b/tests/auto/corelib/kernel/qobject/.gitignore
index 7970e32c8f..d609065333 100644
--- a/tests/auto/corelib/kernel/qobject/.gitignore
+++ b/tests/auto/corelib/kernel/qobject/.gitignore
@@ -1,3 +1,7 @@
tst_qobject
-signalbug/signalbug
-signalbug/signalbug.exe
+signalbug_helper
+signalbug_helper.exe
+debug/signalbug_helper
+release/signalbug_helper
+debug/signalbug_helper.exe
+release/signalbug_helper.exe
diff --git a/tests/auto/corelib/kernel/qobject/qobject.pro b/tests/auto/corelib/kernel/qobject/qobject.pro
index 978aab86c1..75ad7b5f14 100644
--- a/tests/auto/corelib/kernel/qobject/qobject.pro
+++ b/tests/auto/corelib/kernel/qobject/qobject.pro
@@ -1,8 +1,4 @@
TEMPLATE = subdirs
-!winrt {
- test.depends = signalbug
- SUBDIRS += signalbug
-}
-
-SUBDIRS += test
+SUBDIRS += test.pro
+!winrt: SUBDIRS += signalbug
diff --git a/tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro b/tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro
index cc51b4c661..d21b3a62a9 100644
--- a/tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro
+++ b/tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro
@@ -1,11 +1,6 @@
-CONFIG -= app_bundle debug_and_release
-CONFIG += console
-DESTDIR = ./
QT = core
HEADERS += signalbug.h
SOURCES += signalbug.cpp
-# This app is testdata for tst_qobject
-target.path = $$[QT_INSTALL_TESTS]/tst_qobject/$$TARGET
-INSTALLS += target
+load(qt_test_helper)
diff --git a/tests/auto/corelib/kernel/qobject/test/test.pro b/tests/auto/corelib/kernel/qobject/test.pro
index 4e77cb48c5..af5203e152 100644
--- a/tests/auto/corelib/kernel/qobject/test/test.pro
+++ b/tests/auto/corelib/kernel/qobject/test.pro
@@ -1,10 +1,10 @@
CONFIG += testcase console
-TARGET = ../tst_qobject
+
QT = core-private network testlib
-SOURCES = ../tst_qobject.cpp
+TARGET = tst_qobject
+SOURCES = tst_qobject.cpp
# Force C++17 if available (needed due to P0012R1)
contains(QT_CONFIG, c++1z): CONFIG += c++1z
-!winrt: TEST_HELPER_INSTALLS = ../signalbug/signalbug
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
index ec57522f48..effc82261b 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
@@ -55,7 +55,6 @@ class tst_QObject : public QObject
{
Q_OBJECT
private slots:
- void initTestCase();
void disconnect();
void connectSlotsByName();
void connectSignalsToSignalsWithDefaultArguments();
@@ -104,6 +103,7 @@ private slots:
void deleteQObjectWhenDeletingEvent();
void overloads();
void isSignalConnected();
+ void isSignalConnectedAfterDisconnection();
void qMetaObjectConnect();
void qMetaObjectDisconnectOne();
void sameName();
@@ -145,6 +145,7 @@ private slots:
void disconnectDoesNotLeakFunctor();
void contextDoesNotLeakFunctor();
void connectBase();
+ void connectWarnings();
void qmlConnect();
void exceptions();
void noDeclarativeParentChangedOnDestruction();
@@ -282,14 +283,6 @@ static void playWithObjects()
}
}
-void tst_QObject::initTestCase()
-{
-#if QT_CONFIG(process)
- const QString testDataDir = QFileInfo(QFINDTESTDATA("signalbug")).absolutePath();
- QVERIFY2(QDir::setCurrent(testDataDir), qPrintable("Could not chdir to " + testDataDir));
-#endif
-}
-
void tst_QObject::disconnect()
{
SenderObject *s = new SenderObject;
@@ -3026,7 +3019,7 @@ void tst_QObject::recursiveSignalEmission()
#else
QProcess proc;
// signalbug helper app should always be next to this test binary
- const QString path = QStringLiteral("signalbug/signalbug");
+ const QString path = QStringLiteral("signalbug_helper");
proc.start(path);
QVERIFY2(proc.waitForStarted(), qPrintable(QString::fromLatin1("Cannot start '%1': %2").arg(path, proc.errorString())));
QVERIFY(proc.waitForFinished());
@@ -3843,6 +3836,58 @@ void tst_QObject::isSignalConnected()
QVERIFY(!o.isSignalConnected(QMetaMethod()));
}
+void tst_QObject::isSignalConnectedAfterDisconnection()
+{
+ ManySignals o;
+ const QMetaObject *meta = o.metaObject();
+
+ const QMetaMethod sig00 = meta->method(meta->indexOfSignal("sig00()"));
+ QVERIFY(!o.isSignalConnected(sig00));
+ QObject::connect(&o, &ManySignals::sig00, qt_noop);
+ QVERIFY(o.isSignalConnected(sig00));
+ QVERIFY(QObject::disconnect(&o, &ManySignals::sig00, 0, 0));
+ QVERIFY(!o.isSignalConnected(sig00));
+
+ const QMetaMethod sig69 = meta->method(meta->indexOfSignal("sig69()"));
+ QVERIFY(!o.isSignalConnected(sig69));
+ QObject::connect(&o, &ManySignals::sig69, qt_noop);
+ QVERIFY(o.isSignalConnected(sig69));
+ QVERIFY(QObject::disconnect(&o, &ManySignals::sig69, 0, 0));
+ QVERIFY(!o.isSignalConnected(sig69));
+
+ {
+ ManySignals o2;
+ QObject::connect(&o, &ManySignals::sig00, &o2, &ManySignals::sig00);
+ QVERIFY(o.isSignalConnected(sig00));
+ // o2 is destructed
+ }
+ QVERIFY(!o.isSignalConnected(sig00));
+
+ const QMetaMethod sig01 = meta->method(meta->indexOfSignal("sig01()"));
+ QObject::connect(&o, &ManySignals::sig00, qt_noop);
+ QObject::connect(&o, &ManySignals::sig01, qt_noop);
+ QObject::connect(&o, &ManySignals::sig69, qt_noop);
+ QVERIFY(o.isSignalConnected(sig00));
+ QVERIFY(o.isSignalConnected(sig01));
+ QVERIFY(o.isSignalConnected(sig69));
+ QVERIFY(QObject::disconnect(&o, &ManySignals::sig69, 0, 0));
+ QVERIFY(o.isSignalConnected(sig00));
+ QVERIFY(o.isSignalConnected(sig01));
+ QVERIFY(!o.isSignalConnected(sig69));
+ QVERIFY(QObject::disconnect(&o, &ManySignals::sig00, 0, 0));
+ QVERIFY(!o.isSignalConnected(sig00));
+ QVERIFY(o.isSignalConnected(sig01));
+ QVERIFY(!o.isSignalConnected(sig69));
+ QObject::connect(&o, &ManySignals::sig69, qt_noop);
+ QVERIFY(!o.isSignalConnected(sig00));
+ QVERIFY(o.isSignalConnected(sig01));
+ QVERIFY(o.isSignalConnected(sig69));
+ QVERIFY(QObject::disconnect(&o, &ManySignals::sig01, 0, 0));
+ QVERIFY(!o.isSignalConnected(sig00));
+ QVERIFY(!o.isSignalConnected(sig01));
+ QVERIFY(o.isSignalConnected(sig69));
+}
+
void tst_QObject::qMetaObjectConnect()
{
SenderObject *s = new SenderObject;
@@ -6697,6 +6742,26 @@ void tst_QObject::connectBase()
QCOMPARE( r1.count_slot3, 1 );
}
+void tst_QObject::connectWarnings()
+{
+ SubSender sub;
+ SenderObject obj;
+ ReceiverObject r1;
+ r1.reset();
+
+ QTest::ignoreMessage(QtWarningMsg, "QObject::connect(SenderObject, ReceiverObject): invalid null parameter");
+ connect(nullptr, &SubSender::signal1, &r1, &ReceiverObject::slot1);
+
+ QTest::ignoreMessage(QtWarningMsg, "QObject::connect(SubSender, Unknown): invalid null parameter");
+ connect(&sub, &SubSender::signal1, nullptr, &ReceiverObject::slot1);
+
+ QTest::ignoreMessage(QtWarningMsg, "QObject::connect(SenderObject, ReceiverObject): invalid null parameter");
+ connect(nullptr, &SenderObject::signal1, &r1, &ReceiverObject::slot1);
+
+ QTest::ignoreMessage(QtWarningMsg, "QObject::connect(SenderObject, Unknown): invalid null parameter");
+ connect(&obj, &SenderObject::signal1, nullptr, &ReceiverObject::slot1);
+}
+
struct QmlReceiver : public QtPrivate::QSlotObjectBase
{
int callCount;
diff --git a/tests/auto/corelib/kernel/qsharedmemory/sharedmemoryhelper/main.cpp b/tests/auto/corelib/kernel/qsharedmemory/producerconsumer/main.cpp
index ffbad37d82..ffbad37d82 100644
--- a/tests/auto/corelib/kernel/qsharedmemory/sharedmemoryhelper/main.cpp
+++ b/tests/auto/corelib/kernel/qsharedmemory/producerconsumer/main.cpp
diff --git a/tests/auto/corelib/kernel/qsharedmemory/producerconsumer/producerconsumer.pro b/tests/auto/corelib/kernel/qsharedmemory/producerconsumer/producerconsumer.pro
new file mode 100644
index 0000000000..a6156ed5b6
--- /dev/null
+++ b/tests/auto/corelib/kernel/qsharedmemory/producerconsumer/producerconsumer.pro
@@ -0,0 +1,5 @@
+QT = core testlib
+
+SOURCES += main.cpp
+
+load(qt_test_helper)
diff --git a/tests/auto/corelib/kernel/qsharedmemory/qsharedmemory.pro b/tests/auto/corelib/kernel/qsharedmemory/qsharedmemory.pro
index 3a4697750e..323d5bbd37 100644
--- a/tests/auto/corelib/kernel/qsharedmemory/qsharedmemory.pro
+++ b/tests/auto/corelib/kernel/qsharedmemory/qsharedmemory.pro
@@ -1,6 +1,6 @@
TEMPLATE = subdirs
qtConfig(sharedmemory) {
- !winrt: SUBDIRS = sharedmemoryhelper
- SUBDIRS += test
+ !winrt: SUBDIRS = producerconsumer
+ SUBDIRS += test.pro
}
diff --git a/tests/auto/corelib/kernel/qsharedmemory/sharedmemoryhelper/sharedmemoryhelper.pro b/tests/auto/corelib/kernel/qsharedmemory/sharedmemoryhelper/sharedmemoryhelper.pro
deleted file mode 100644
index 389015d504..0000000000
--- a/tests/auto/corelib/kernel/qsharedmemory/sharedmemoryhelper/sharedmemoryhelper.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-QT = core testlib
-
-win32: CONFIG += console
-mac:CONFIG -= app_bundle
-
-SOURCES += main.cpp
-TARGET = helperbinary
-
-CONFIG(debug_and_release) {
- CONFIG(debug, debug|release) {
- DESTDIR = ../debug
- } else {
- DESTDIR = ../release
- }
-} else {
- DESTDIR = ..
-}
diff --git a/tests/auto/corelib/kernel/qsharedmemory/test.pro b/tests/auto/corelib/kernel/qsharedmemory/test.pro
new file mode 100644
index 0000000000..8b3badadb0
--- /dev/null
+++ b/tests/auto/corelib/kernel/qsharedmemory/test.pro
@@ -0,0 +1,8 @@
+CONFIG += testcase
+
+QT = core-private testlib
+
+TARGET = tst_qsharedmemory
+SOURCES += tst_qsharedmemory.cpp
+
+linux: LIBS += -lrt
diff --git a/tests/auto/corelib/kernel/qsharedmemory/test/test.pro b/tests/auto/corelib/kernel/qsharedmemory/test/test.pro
deleted file mode 100644
index 61124c27ee..0000000000
--- a/tests/auto/corelib/kernel/qsharedmemory/test/test.pro
+++ /dev/null
@@ -1,18 +0,0 @@
-CONFIG += testcase
-
-QT = core-private testlib
-
-linux:LIBS += -lrt
-
-SOURCES += tst_qsharedmemory.cpp
-TARGET = tst_qsharedmemory
-
-CONFIG(debug_and_release) {
- CONFIG(debug, debug|release) {
- DESTDIR = ../debug
- } else {
- DESTDIR = ../release
- }
-} else {
- DESTDIR = ..
-}
diff --git a/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp b/tests/auto/corelib/kernel/qsharedmemory/tst_qsharedmemory.cpp
index f81324b894..55deb8eb1a 100644
--- a/tests/auto/corelib/kernel/qsharedmemory/test/tst_qsharedmemory.cpp
+++ b/tests/auto/corelib/kernel/qsharedmemory/tst_qsharedmemory.cpp
@@ -51,7 +51,6 @@ public:
public Q_SLOTS:
void init();
- void initTestCase();
void cleanup();
@@ -101,7 +100,6 @@ private slots:
void uniqueKey();
protected:
- static QString helperBinary();
int remove(const QString &key);
QString rememberKey(const QString &key)
@@ -125,7 +123,7 @@ private:
tst_QSharedMemory::tst_QSharedMemory()
: existingSharedMemory(0)
- , m_helperBinary(tst_QSharedMemory::helperBinary())
+ , m_helperBinary("producerconsumer_helper")
{
}
@@ -133,13 +131,6 @@ tst_QSharedMemory::~tst_QSharedMemory()
{
}
-void tst_QSharedMemory::initTestCase()
-{
-#if QT_CONFIG(process)
- QVERIFY2(!m_helperBinary.isEmpty(), "Could not find helper binary");
-#endif
-}
-
void tst_QSharedMemory::init()
{
existingSharedMemory = new QSharedMemory(EXISTING_SHARE);
@@ -179,15 +170,6 @@ void tst_QSharedMemory::cleanup()
#include <errno.h>
#endif
-QString tst_QSharedMemory::helperBinary()
-{
- QString binary = QStringLiteral("helperbinary");
-#ifdef Q_OS_WIN
- binary += QStringLiteral(".exe");
-#endif
- return QFINDTESTDATA(binary);
-}
-
int tst_QSharedMemory::remove(const QString &key)
{
#ifdef Q_OS_WIN
diff --git a/tests/auto/corelib/kernel/qsystemsemaphore/acquirerelease/acquirerelease.pro b/tests/auto/corelib/kernel/qsystemsemaphore/acquirerelease/acquirerelease.pro
new file mode 100644
index 0000000000..a6156ed5b6
--- /dev/null
+++ b/tests/auto/corelib/kernel/qsystemsemaphore/acquirerelease/acquirerelease.pro
@@ -0,0 +1,5 @@
+QT = core testlib
+
+SOURCES += main.cpp
+
+load(qt_test_helper)
diff --git a/tests/auto/corelib/kernel/qsystemsemaphore/systemsemaphorehelper/main.cpp b/tests/auto/corelib/kernel/qsystemsemaphore/acquirerelease/main.cpp
index 7bfb6b16cc..7bfb6b16cc 100644
--- a/tests/auto/corelib/kernel/qsystemsemaphore/systemsemaphorehelper/main.cpp
+++ b/tests/auto/corelib/kernel/qsystemsemaphore/acquirerelease/main.cpp
diff --git a/tests/auto/corelib/kernel/qsystemsemaphore/qsystemsemaphore.pro b/tests/auto/corelib/kernel/qsystemsemaphore/qsystemsemaphore.pro
index f8a49254d2..70526426aa 100644
--- a/tests/auto/corelib/kernel/qsystemsemaphore/qsystemsemaphore.pro
+++ b/tests/auto/corelib/kernel/qsystemsemaphore/qsystemsemaphore.pro
@@ -1,3 +1,3 @@
TEMPLATE = subdirs
-SUBDIRS = systemsemaphorehelper test
+SUBDIRS = acquirerelease test.pro
diff --git a/tests/auto/corelib/kernel/qsystemsemaphore/systemsemaphorehelper/systemsemaphorehelper.pro b/tests/auto/corelib/kernel/qsystemsemaphore/systemsemaphorehelper/systemsemaphorehelper.pro
deleted file mode 100644
index 389015d504..0000000000
--- a/tests/auto/corelib/kernel/qsystemsemaphore/systemsemaphorehelper/systemsemaphorehelper.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-QT = core testlib
-
-win32: CONFIG += console
-mac:CONFIG -= app_bundle
-
-SOURCES += main.cpp
-TARGET = helperbinary
-
-CONFIG(debug_and_release) {
- CONFIG(debug, debug|release) {
- DESTDIR = ../debug
- } else {
- DESTDIR = ../release
- }
-} else {
- DESTDIR = ..
-}
diff --git a/tests/auto/corelib/kernel/qsystemsemaphore/test.pro b/tests/auto/corelib/kernel/qsystemsemaphore/test.pro
new file mode 100644
index 0000000000..13bd1fa270
--- /dev/null
+++ b/tests/auto/corelib/kernel/qsystemsemaphore/test.pro
@@ -0,0 +1,7 @@
+CONFIG += testcase
+QT = core testlib
+
+SOURCES += tst_qsystemsemaphore.cpp
+TARGET = tst_qsystemsemaphore
+
+win32: CONFIG += console
diff --git a/tests/auto/corelib/kernel/qsystemsemaphore/test/test.pro b/tests/auto/corelib/kernel/qsystemsemaphore/test/test.pro
deleted file mode 100644
index f60207eb01..0000000000
--- a/tests/auto/corelib/kernel/qsystemsemaphore/test/test.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-CONFIG += testcase
-QT = core testlib
-
-win32: CONFIG += console
-
-SOURCES += tst_qsystemsemaphore.cpp
-TARGET = tst_qsystemsemaphore
-
-CONFIG(debug_and_release) {
- CONFIG(debug, debug|release) {
- DESTDIR = ../debug
- } else {
- DESTDIR = ../release
- }
-} else {
- DESTDIR = ..
-}
diff --git a/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp b/tests/auto/corelib/kernel/qsystemsemaphore/tst_qsystemsemaphore.cpp
index 6ff1e14976..5f010ae3d1 100644
--- a/tests/auto/corelib/kernel/qsystemsemaphore/test/tst_qsystemsemaphore.cpp
+++ b/tests/auto/corelib/kernel/qsystemsemaphore/tst_qsystemsemaphore.cpp
@@ -42,7 +42,6 @@ public:
tst_QSystemSemaphore();
public Q_SLOTS:
- void initTestCase();
void init();
void cleanup();
@@ -65,22 +64,16 @@ private slots:
void initialValue();
private:
- static QString helperBinary();
QSystemSemaphore *existingLock;
const QString m_helperBinary;
};
tst_QSystemSemaphore::tst_QSystemSemaphore()
- : m_helperBinary(helperBinary())
+ : m_helperBinary("acquirerelease_helper")
{
}
-void tst_QSystemSemaphore::initTestCase()
-{
- QVERIFY2(!m_helperBinary.isEmpty(), "Could not find helper binary");
-}
-
void tst_QSystemSemaphore::init()
{
existingLock = new QSystemSemaphore(EXISTING_SHARE, 1, QSystemSemaphore::Create);
@@ -294,14 +287,6 @@ void tst_QSystemSemaphore::initialValue()
#endif
}
-QString tst_QSystemSemaphore::helperBinary()
-{
- QString binary = QStringLiteral("helperbinary");
-#ifdef Q_OS_WIN
- binary += QStringLiteral(".exe");
-#endif
- return QFINDTESTDATA(binary);
-}
QTEST_MAIN(tst_QSystemSemaphore)
#include "tst_qsystemsemaphore.moc"
diff --git a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
index 5b2d77a02c..8d194dafc1 100644
--- a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
+++ b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
@@ -75,6 +75,7 @@ private slots:
void dontBlockEvents();
void postedEventsShouldNotStarveTimers();
+ void callOnTimeout();
};
void tst_QTimer::zeroTimer()
@@ -455,8 +456,7 @@ void tst_QTimer::moveToThread()
#if defined(Q_OS_WIN32)
QSKIP("Does not work reliably on Windows :(");
#elif defined(Q_OS_MACOS)
- if (__builtin_available(macOS 10.12, *))
- QSKIP("Does not work reliably on macOS 10.12 (QTBUG-59679)");
+ QSKIP("Does not work reliably on macOS 10.12+ (QTBUG-59679)");
#endif
QTimer ti1;
QTimer ti2;
@@ -979,5 +979,30 @@ void tst_QTimer::crossThreadSingleShotToFunctor()
delete o;
}
+void tst_QTimer::callOnTimeout()
+{
+ QTimer timer;
+ QSignalSpy timeoutSpy(&timer, &QTimer::timeout);
+ timer.setInterval(0);
+ timer.start();
+
+ auto context = new QObject();
+
+ int count = 0;
+ timer.callOnTimeout([&count] { count++; });
+ QMetaObject::Connection connection = timer.callOnTimeout(context, [&count] { count++; });
+ timer.callOnTimeout(&timer, &QTimer::stop);
+
+
+ QTest::qWait(100);
+ QCOMPARE(count, 2);
+ QCOMPARE(timeoutSpy.count(), 1);
+
+ // Test that connection is bound to context lifetime
+ QVERIFY(connection);
+ delete context;
+ QVERIFY(!connection);
+}
+
QTEST_MAIN(tst_QTimer)
#include "tst_qtimer.moc"
diff --git a/tests/auto/corelib/kernel/qtranslator/android_testdata.qrc b/tests/auto/corelib/kernel/qtranslator/android_testdata.qrc
index b33995ef21..39b85db664 100644
--- a/tests/auto/corelib/kernel/qtranslator/android_testdata.qrc
+++ b/tests/auto/corelib/kernel/qtranslator/android_testdata.qrc
@@ -1,6 +1,7 @@
<RCC>
<qresource prefix="/android_testdata">
<file>hellotr_la.qm</file>
+ <file>hellotr_empty.qm</file>
<file>msgfmt_from_po.qm</file>
<file>dependencies_la.qm</file>
</qresource>
diff --git a/tests/auto/corelib/kernel/qtranslator/hellotr_empty.qm b/tests/auto/corelib/kernel/qtranslator/hellotr_empty.qm
new file mode 100644
index 0000000000..be651eede2
--- /dev/null
+++ b/tests/auto/corelib/kernel/qtranslator/hellotr_empty.qm
@@ -0,0 +1 @@
+<¸dÊÍ!¿`¡½Ý \ No newline at end of file
diff --git a/tests/auto/corelib/kernel/qtranslator/hellotr_empty.ts b/tests/auto/corelib/kernel/qtranslator/hellotr_empty.ts
new file mode 100644
index 0000000000..85e0d3992b
--- /dev/null
+++ b/tests/auto/corelib/kernel/qtranslator/hellotr_empty.ts
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1"/>
diff --git a/tests/auto/corelib/kernel/qtranslator/qtranslator.pro b/tests/auto/corelib/kernel/qtranslator/qtranslator.pro
index d8924c2d5f..a985f35a14 100644
--- a/tests/auto/corelib/kernel/qtranslator/qtranslator.pro
+++ b/tests/auto/corelib/kernel/qtranslator/qtranslator.pro
@@ -5,5 +5,5 @@ SOURCES = tst_qtranslator.cpp
RESOURCES += qtranslator.qrc
android:!android-embedded: RESOURCES += android_testdata.qrc
-else: TESTDATA += dependencies_la.qm hellotr_la.qm msgfmt_from_po.qm
+else: TESTDATA += dependencies_la.qm hellotr_empty.qm hellotr_la.qm msgfmt_from_po.qm
diff --git a/tests/auto/corelib/kernel/qtranslator/qtranslator.qrc b/tests/auto/corelib/kernel/qtranslator/qtranslator.qrc
index 333dcfaa21..cb82c6cc95 100644
--- a/tests/auto/corelib/kernel/qtranslator/qtranslator.qrc
+++ b/tests/auto/corelib/kernel/qtranslator/qtranslator.qrc
@@ -1,5 +1,6 @@
<RCC>
<qresource prefix="/tst_qtranslator">
<file>hellotr_la.qm</file>
+ <file>hellotr_empty.qm</file>
</qresource>
</RCC>
diff --git a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp
index 451f96339e..40a29c723c 100644
--- a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp
+++ b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp
@@ -41,13 +41,12 @@ protected:
private slots:
void initTestCase();
+ void load_data();
void load();
- void load2();
void threadLoad();
void testLanguageChange();
void plural();
void translate_qm_file_generated_with_msgfmt();
- void loadFromResource();
void loadDirectory();
void dependencies();
void translationInThreadWhileInstallingTranslator();
@@ -106,24 +105,45 @@ bool tst_QTranslator::eventFilter(QObject *, QEvent *event)
return false;
}
-void tst_QTranslator::load()
+void tst_QTranslator::load_data()
{
+ QTest::addColumn<QString>("filepath");
+ QTest::addColumn<bool>("isEmpty");
+ QTest::addColumn<QString>("translation");
- QTranslator tor( 0 );
- tor.load("hellotr_la");
- QVERIFY(!tor.isEmpty());
- QCOMPARE(tor.translate("QPushButton", "Hello world!"), QLatin1String("Hallo Welt!"));
+ QTest::newRow("hellotr_la") << "hellotr_la.qm" << false << "Hallo Welt!";
+ QTest::newRow("hellotr_empty") << "hellotr_empty.qm" << true << "";
}
-void tst_QTranslator::load2()
+void tst_QTranslator::load()
{
- QTranslator tor( 0 );
- QFile file("hellotr_la.qm");
- file.open(QFile::ReadOnly);
- QByteArray data = file.readAll();
- tor.load((const uchar *)data.constData(), data.length());
- QVERIFY(!tor.isEmpty());
- QCOMPARE(tor.translate("QPushButton", "Hello world!"), QLatin1String("Hallo Welt!"));
+ QFETCH(QString, filepath);
+ QFETCH(bool, isEmpty);
+ QFETCH(QString, translation);
+
+ {
+ QTranslator tor;
+ QVERIFY(tor.load(QFileInfo(filepath).baseName()));
+ QCOMPARE(tor.isEmpty(), isEmpty);
+ QCOMPARE(tor.translate("QPushButton", "Hello world!"), translation);
+ }
+
+ {
+ QFile file(filepath);
+ file.open(QFile::ReadOnly);
+ QByteArray data = file.readAll();
+ QTranslator tor;
+ QVERIFY(tor.load((const uchar *)data.constData(), data.length()));
+ QCOMPARE(tor.isEmpty(), isEmpty);
+ QCOMPARE(tor.translate("QPushButton", "Hello world!"), translation);
+ }
+
+ {
+ QTranslator tor;
+ QVERIFY(tor.load(QString(":/tst_qtranslator/%1").arg(filepath)));
+ QCOMPARE(tor.isEmpty(), isEmpty);
+ QCOMPARE(tor.translate("QPushButton", "Hello world!"), translation);
+ }
}
class TranslatorThread : public QThread
@@ -240,14 +260,6 @@ void tst_QTranslator::translate_qm_file_generated_with_msgfmt()
qApp->removeTranslator(&translator);
}
-void tst_QTranslator::loadFromResource()
-{
- QTranslator tor;
- tor.load(":/tst_qtranslator/hellotr_la.qm");
- QVERIFY(!tor.isEmpty());
- QCOMPARE(tor.translate("QPushButton", "Hello world!"), QLatin1String("Hallo Welt!"));
-}
-
void tst_QTranslator::loadDirectory()
{
QString current_base = QDir::current().dirName();
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/kernel/qwineventnotifier/tst_qwineventnotifier.cpp b/tests/auto/corelib/kernel/qwineventnotifier/tst_qwineventnotifier.cpp
index e2a0c2dad3..ac8aaa1327 100644
--- a/tests/auto/corelib/kernel/qwineventnotifier/tst_qwineventnotifier.cpp
+++ b/tests/auto/corelib/kernel/qwineventnotifier/tst_qwineventnotifier.cpp
@@ -46,6 +46,7 @@ protected slots:
private slots:
void simple_data();
void simple();
+ void blockedWaiting();
void manyNotifiers();
void disableNotifiersInActivatedSlot_data();
void disableNotifiersInActivatedSlot();
@@ -104,6 +105,26 @@ void tst_QWinEventNotifier::simple()
QVERIFY(simpleActivated);
}
+void tst_QWinEventNotifier::blockedWaiting()
+{
+ simpleHEvent = CreateEvent(0, true, false, 0);
+ QWinEventNotifier n(simpleHEvent);
+ QObject::connect(&n, &QWinEventNotifier::activated,
+ this, &tst_QWinEventNotifier::simple_activated);
+ simpleActivated = false;
+
+ SetEvent(simpleHEvent);
+ QCOMPARE(WaitForSingleObject(simpleHEvent, 1000), WAIT_OBJECT_0);
+
+ n.setEnabled(false);
+ ResetEvent(simpleHEvent);
+ n.setEnabled(true);
+
+ QTestEventLoop::instance().enterLoop(1);
+ QVERIFY(QTestEventLoop::instance().timeout());
+ QVERIFY(!simpleActivated);
+}
+
class EventWithNotifier : public QObject
{
Q_OBJECT
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/magic-and-hierarchy.foo b/tests/auto/corelib/mimetypes/qmimedatabase/magic-and-hierarchy.foo
new file mode 100644
index 0000000000..ed5e761417
--- /dev/null
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/magic-and-hierarchy.foo
@@ -0,0 +1,3 @@
+<?foo>
+<blah>
+</blah>
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/magic-and-hierarchy.xml b/tests/auto/corelib/mimetypes/qmimedatabase/magic-and-hierarchy.xml
new file mode 100644
index 0000000000..27b5bd7e1f
--- /dev/null
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/magic-and-hierarchy.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
+ <!-- The real life example would be that this mime type is a sub class of application/xml
+ which has a magic that matches &lt;?xml .
+ XML files with an early appearing qnx tag are detected as
+ application/vnd.qnx.bar-descriptor. We want that XML files without the qnx tag to be
+ identified as application/xml, independent of the order in which the two are registered. -->
+ <mime-type type="application/vnd.qnx.bar-descriptor">
+ <sub-class-of type="application/foo"/>
+ <glob pattern="*.foo"/>
+ <magic><!-- higher priority than the parent magic -->
+ <match value="&lt;qnx&gt;" type="string" offset="0:200"/>
+ </magic>
+ </mime-type>
+ <mime-type type="application/foo">
+ <glob pattern="*.foo"/>
+ <magic priority="40">
+ <match value="&lt;?foo" type="string" offset="0"/>
+ </magic>
+ </mime-type>
+</mime-info>
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/magic-and-hierarchy2.foo b/tests/auto/corelib/mimetypes/qmimedatabase/magic-and-hierarchy2.foo
new file mode 100644
index 0000000000..fd90ed04b3
--- /dev/null
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/magic-and-hierarchy2.foo
@@ -0,0 +1,3 @@
+<?foo>
+<qnx>
+</qnx>
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/testdata.qrc b/tests/auto/corelib/mimetypes/qmimedatabase/testdata.qrc
index 29666627a1..1002d0195d 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/testdata.qrc
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/testdata.qrc
@@ -7,5 +7,8 @@
<file>invalid-magic1.xml</file>
<file>invalid-magic2.xml</file>
<file>invalid-magic3.xml</file>
+ <file>magic-and-hierarchy.xml</file>
+ <file>magic-and-hierarchy.foo</file>
+ <file>magic-and-hierarchy2.foo</file>
</qresource>
</RCC>
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
index 3144c3071c..9df52887f7 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
@@ -52,6 +52,7 @@ static const char *const additionalMimeFiles[] = {
"invalid-magic1.xml",
"invalid-magic2.xml",
"invalid-magic3.xml",
+ "magic-and-hierarchy.xml",
0
};
@@ -985,6 +986,26 @@ void tst_QMimeDatabase::installNewGlobalMimeType()
qDebug() << objcsrc.globPatterns();
}
+ const QString fooTestFile = QLatin1String(RESOURCE_PREFIX "magic-and-hierarchy.foo");
+ QCOMPARE(db.mimeTypeForFile(fooTestFile).name(), QString::fromLatin1("application/foo"));
+
+ 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/corelib/plugin/plugin.pro b/tests/auto/corelib/plugin/plugin.pro
index b094c24e55..240608fddf 100644
--- a/tests/auto/corelib/plugin/plugin.pro
+++ b/tests/auto/corelib/plugin/plugin.pro
@@ -11,6 +11,5 @@ qtConfig(library): SUBDIRS += \
contains(CONFIG, static) {
message(Disabling tests requiring shared build of Qt)
SUBDIRS -= qfactoryloader \
- qplugin \
- qpluginloader
+ qplugin
}
diff --git a/tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp b/tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp
index d285ed79c0..a290c012df 100644
--- a/tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp
+++ b/tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2018 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -30,8 +31,11 @@
#include <QCoreApplication>
#include <QDebug>
#include <QDir>
+#include <qplugin.h>
#include <QPluginLoader>
+#include <private/qplugin_p.h>
+
class tst_QPlugin : public QObject
{
Q_OBJECT
@@ -124,7 +128,10 @@ void tst_QPlugin::scanInvalidPlugin_data()
{
QTest::addColumn<QByteArray>("metadata");
QTest::addColumn<bool>("loads");
+ QTest::addColumn<QString>("errMsg");
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ // Binary JSON metadata
QByteArray prefix = "QTMETADATA ";
{
@@ -138,27 +145,65 @@ void tst_QPlugin::scanInvalidPlugin_data()
obj.insert("debug", true);
#endif
obj.insert("MetaData", QJsonObject());
- QTest::newRow("control") << (prefix + QJsonDocument(obj).toBinaryData()) << true;
+ QTest::newRow("json-control") << (prefix + QJsonDocument(obj).toBinaryData()) << true << "";
}
- QTest::newRow("zeroes") << prefix << false;
+ QTest::newRow("json-zeroes") << prefix << false << " ";
prefix += "qbjs";
- QTest::newRow("bad-json-version0") << prefix << false;
- QTest::newRow("bad-json-version2") << (prefix + QByteArray("\2\0\0\0", 4)) << false;
+ QTest::newRow("bad-json-version0") << prefix << false << " ";
+ QTest::newRow("bad-json-version2") << (prefix + QByteArray("\2\0\0\0", 4)) << false << " ";
// valid qbjs version 1
prefix += QByteArray("\1\0\0\0");
// too large for the file (100 MB)
- QTest::newRow("bad-json-size-large1") << (prefix + QByteArray("\0\0\x40\x06")) << false;
+ QTest::newRow("bad-json-size-large1") << (prefix + QByteArray("\0\0\x40\x06")) << false << " ";
// too large for binary JSON (512 MB)
- QTest::newRow("bad-json-size-large2") << (prefix + QByteArray("\0\0\0\x20")) << false;
+ QTest::newRow("bad-json-size-large2") << (prefix + QByteArray("\0\0\0\x20")) << false << " ";
// could overflow
- QTest::newRow("bad-json-size-large3") << (prefix + "\xff\xff\xff\x7f") << false;
+ QTest::newRow("bad-json-size-large3") << (prefix + "\xff\xff\xff\x7f") << false << " ";
+#endif
+ // CBOR metadata
+ QByteArray cprefix = "QTMETADATA !1234";
+ cprefix[12] = 0; // current version
+ cprefix[13] = QT_VERSION_MAJOR;
+ cprefix[14] = QT_VERSION_MINOR;
+ cprefix[15] = qPluginArchRequirements();
+
+ QByteArray cborValid = [] {
+ QCborMap m;
+ m.insert(int(QtPluginMetaDataKeys::IID), QLatin1String("org.qt-project.tst_qplugin"));
+ m.insert(int(QtPluginMetaDataKeys::ClassName), QLatin1String("tst"));
+ m.insert(int(QtPluginMetaDataKeys::MetaData), QCborMap());
+ return QCborValue(m).toCbor();
+ }();
+ QTest::newRow("cbor-control") << (cprefix + cborValid) << true << "";
+
+ cprefix[12] = 1;
+ QTest::newRow("cbor-major-too-new") << (cprefix + cborValid) << false
+ << " Invalid metadata version";
+
+ cprefix[12] = 0;
+ cprefix[13] = QT_VERSION_MAJOR + 1;
+ QTest::newRow("cbor-major-too-new") << (cprefix + cborValid) << false << "";
+
+ cprefix[13] = QT_VERSION_MAJOR - 1;
+ QTest::newRow("cbor-major-too-old") << (cprefix + cborValid) << false << "";
+
+ cprefix[13] = QT_VERSION_MAJOR;
+ cprefix[14] = QT_VERSION_MINOR + 1;
+ QTest::newRow("cbor-minor-too-new") << (cprefix + cborValid) << false << "";
+
+ QTest::newRow("cbor-invalid") << (cprefix + "\xff") << false
+ << " Metadata parsing error: Invalid CBOR stream: unexpected 'break' byte";
+ QTest::newRow("cbor-not-map1") << (cprefix + "\x01") << false
+ << " Unexpected metadata contents";
+ QTest::newRow("cbor-not-map2") << (cprefix + "\x81\x01") << false
+ << " Unexpected metadata contents";
}
static const char invalidPluginSignature[] = "qplugin testfile";
@@ -214,6 +259,11 @@ void tst_QPlugin::scanInvalidPlugin()
// now try to load this
QFETCH(bool, loads);
+ QFETCH(QString, errMsg);
+ if (!errMsg.isEmpty())
+ QTest::ignoreMessage(QtWarningMsg,
+ "Found invalid metadata in lib " + QFile::encodeName(newName) +
+ ":" + errMsg.toUtf8());
QPluginLoader loader(newName);
QCOMPARE(loader.load(), loads);
if (loads)
diff --git a/tests/auto/corelib/plugin/qplugin/tst_qplugin.pro b/tests/auto/corelib/plugin/qplugin/tst_qplugin.pro
index 8c6540fe87..4432ee20c1 100644
--- a/tests/auto/corelib/plugin/qplugin/tst_qplugin.pro
+++ b/tests/auto/corelib/plugin/qplugin/tst_qplugin.pro
@@ -1,6 +1,6 @@
CONFIG += testcase
TARGET = tst_qplugin
-QT = core testlib
+QT = core-private testlib
SOURCES = tst_qplugin.cpp
TESTDATA += plugins/*
diff --git a/tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.h b/tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.h
index 04ce042e24..ac349c2f75 100644
--- a/tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.h
+++ b/tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.h
@@ -35,7 +35,7 @@
class ThePlugin : public QObject, public PluginInterface
{
Q_OBJECT
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.autotests.plugininterface" FILE "../empty.json")
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.autotests.plugininterface" FILE "../utf8_data.json")
Q_INTERFACES(PluginInterface)
public:
diff --git a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
index f34741281c..c517c0809a 100644
--- a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
+++ b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
@@ -140,6 +140,10 @@ void tst_QPluginLoader::cleanup()
void tst_QPluginLoader::errorString()
{
+#if !defined(QT_SHARED)
+ QSKIP("This test requires Qt to create shared libraries.");
+#endif
+
const QString unknown(QLatin1String("Unknown error"));
{
@@ -206,6 +210,14 @@ void tst_QPluginLoader::errorString()
{
QPluginLoader loader( sys_qualifiedLibraryName("theplugin")); //a plugin
+
+ // Check metadata
+ const QJsonObject metaData = loader.metaData();
+ QCOMPARE(metaData.value("IID").toString(), QStringLiteral("org.qt-project.Qt.autotests.plugininterface"));
+ const QJsonObject kpluginObject = metaData.value("MetaData").toObject().value("KPlugin").toObject();
+ QCOMPARE(kpluginObject.value("Name[mr]").toString(), QString::fromUtf8("चौकट भूमिती"));
+
+ // Load
QCOMPARE(loader.load(), true);
QCOMPARE(loader.errorString(), unknown);
@@ -224,6 +236,9 @@ void tst_QPluginLoader::errorString()
void tst_QPluginLoader::loadHints()
{
+#if !defined(QT_SHARED)
+ QSKIP("This test requires Qt to create shared libraries.");
+#endif
QPluginLoader loader;
QCOMPARE(loader.loadHints(), (QLibrary::LoadHints)0); //Do not crash
loader.setLoadHints(QLibrary::ResolveAllSymbolsHint);
@@ -233,6 +248,9 @@ void tst_QPluginLoader::loadHints()
void tst_QPluginLoader::deleteinstanceOnUnload()
{
+#if !defined(QT_SHARED)
+ QSKIP("This test requires Qt to create shared libraries.");
+#endif
for (int pass = 0; pass < 2; ++pass) {
QPluginLoader loader1;
loader1.setFileName( sys_qualifiedLibraryName("theplugin")); //a plugin
@@ -268,6 +286,9 @@ void tst_QPluginLoader::deleteinstanceOnUnload()
void tst_QPluginLoader::loadDebugObj()
{
+#if !defined(QT_SHARED)
+ QSKIP("This test requires a shared build of Qt, as QPluginLoader::setFileName is a no-op in static builds");
+#endif
#if defined (__ELF__)
QVERIFY(QFile::exists(QFINDTESTDATA("elftest/debugobj.so")));
QPluginLoader lib1(QFINDTESTDATA("elftest/debugobj.so"));
@@ -277,6 +298,9 @@ void tst_QPluginLoader::loadDebugObj()
void tst_QPluginLoader::loadCorruptElf()
{
+#if !defined(QT_SHARED)
+ QSKIP("This test requires a shared build of Qt, as QPluginLoader::setFileName is a no-op in static builds");
+#endif
#if defined (__ELF__)
if (sizeof(void*) == 8) {
QVERIFY(QFile::exists(QFINDTESTDATA("elftest/corrupt1.elf64.so")));
@@ -377,6 +401,9 @@ void tst_QPluginLoader::loadMachO()
#if defined (Q_OS_UNIX)
void tst_QPluginLoader::loadGarbage()
{
+#if !defined(QT_SHARED)
+ QSKIP("This test requires a shared build of Qt, as QPluginLoader::setFileName is a no-op in static builds");
+#endif
for (int i=0; i<5; i++) {
const QString name = QLatin1String("elftest/garbage") + QString::number(i + 1) + QLatin1String(".so");
QPluginLoader lib(QFINDTESTDATA(name));
@@ -388,6 +415,9 @@ void tst_QPluginLoader::loadGarbage()
void tst_QPluginLoader::relativePath()
{
+#if !defined(QT_SHARED)
+ QSKIP("This test requires Qt to create shared libraries.");
+#endif
// Windows binaries run from release and debug subdirs, so we can't rely on the current dir.
const QString binDir = QFINDTESTDATA("bin");
QVERIFY(!binDir.isEmpty());
@@ -402,6 +432,9 @@ void tst_QPluginLoader::relativePath()
void tst_QPluginLoader::absolutePath()
{
+#if !defined(QT_SHARED)
+ QSKIP("This test requires Qt to create shared libraries.");
+#endif
// Windows binaries run from release and debug subdirs, so we can't rely on the current dir.
const QString binDir = QFINDTESTDATA("bin");
QVERIFY(!binDir.isEmpty());
@@ -416,6 +449,9 @@ void tst_QPluginLoader::absolutePath()
void tst_QPluginLoader::reloadPlugin()
{
+#if !defined(QT_SHARED)
+ QSKIP("This test requires Qt to create shared libraries.");
+#endif
QPluginLoader loader;
loader.setFileName( sys_qualifiedLibraryName("theplugin")); //a plugin
loader.load(); // not recommended, instance() should do the job.
@@ -451,6 +487,9 @@ void tst_QPluginLoader::preloadedPlugin_data()
void tst_QPluginLoader::preloadedPlugin()
{
+#if !defined(QT_SHARED)
+ QSKIP("This test requires Qt to create shared libraries.");
+#endif
// check that using QPluginLoader does not interfere with QLibrary
QFETCH(QString, libname);
QLibrary lib(libname);
diff --git a/tests/auto/corelib/plugin/qpluginloader/utf8_data.json b/tests/auto/corelib/plugin/qpluginloader/utf8_data.json
new file mode 100644
index 0000000000..7763b65178
--- /dev/null
+++ b/tests/auto/corelib/plugin/qpluginloader/utf8_data.json
@@ -0,0 +1,17 @@
+{
+ "KPlugin": {
+ "Name": "WindowGeometry",
+ "Name[mr]": "चौकट भूमिती",
+ "Name[pa]": "ਵਿੰਡੋਜà©à¨®à©ˆà¨Ÿà¨°à©€",
+ "Name[th]": "มิติขนาดของหน้าต่าง",
+ "Name[uk]": "Розміри вікна",
+ "Name[zh_CN]": "窗å£å½¢çŠ¶",
+ "Name[zh_TW]": "視窗ä½ç½®",
+ "ServiceTypes": [
+ "KCModule"
+ ]
+ },
+ "X-KDE-ParentComponents": [
+ "windowgeometry"
+ ]
+}
diff --git a/tests/auto/corelib/serialization/qcborstreamreader/qcborstreamreader.pro b/tests/auto/corelib/serialization/qcborstreamreader/qcborstreamreader.pro
new file mode 100644
index 0000000000..5df331314a
--- /dev/null
+++ b/tests/auto/corelib/serialization/qcborstreamreader/qcborstreamreader.pro
@@ -0,0 +1,11 @@
+QT = core testlib
+TARGET = tst_qcborstreamreader
+CONFIG += testcase
+SOURCES += \
+ tst_qcborstreamreader.cpp
+
+INCLUDEPATH += \
+ ../../../../../src/3rdparty/tinycbor/src \
+ ../../../../../src/3rdparty/tinycbor/tests/parser
+
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
diff --git a/tests/auto/corelib/serialization/qcborstreamreader/tst_qcborstreamreader.cpp b/tests/auto/corelib/serialization/qcborstreamreader/tst_qcborstreamreader.cpp
new file mode 100644
index 0000000000..3dd4b5114c
--- /dev/null
+++ b/tests/auto/corelib/serialization/qcborstreamreader/tst_qcborstreamreader.cpp
@@ -0,0 +1,1091 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 Intel Corporation.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/qcborstream.h>
+#include <QtTest>
+
+class tst_QCborStreamReader : public QObject
+{
+ Q_OBJECT
+
+private Q_SLOTS:
+ void initTestCase_data();
+ void basics();
+ void clear_data();
+ void clear();
+ void integers_data();
+ void integers();
+ void fixed_data();
+ void fixed();
+ void strings_data();
+ void strings();
+ void tags_data();
+ void tags() { fixed(); }
+ void emptyContainers_data();
+ void emptyContainers();
+
+ void arrays_data();
+ void arrays();
+ void maps_data() { arrays_data(); }
+ void maps();
+ void undefLengthArrays_data() { arrays_data(); }
+ void undefLengthArrays();
+ void undefLengthMaps_data() { arrays_data(); }
+ void undefLengthMaps();
+
+ void next_data() { arrays_data(); }
+ void next();
+ void validation_data();
+ void validation();
+ void recursionLimit_data();
+ void recursionLimit();
+
+ void addData_singleElement_data();
+ void addData_singleElement();
+ void addData_complex_data() { arrays_data(); }
+ void addData_complex();
+};
+
+#define FOR_CBOR_TYPE(F) \
+ F(QCborStreamReader::UnsignedInteger) \
+ F(QCborStreamReader::NegativeInteger) \
+ F(QCborStreamReader::ByteArray) \
+ F(QCborStreamReader::String) \
+ F(QCborStreamReader::Array) \
+ F(QCborStreamReader::Map) \
+ F(QCborStreamReader::Tag) \
+ F(QCborStreamReader::SimpleType) \
+ F(QCborStreamReader::Float16) \
+ F(QCborStreamReader::Float) \
+ F(QCborStreamReader::Double) \
+ F(QCborStreamReader::Invalid)
+
+QT_BEGIN_NAMESPACE
+namespace QTest {
+template<> char *toString<QCborStreamReader::Type>(const QCborStreamReader::Type &t)
+{
+ return qstrdup([=]() {
+ switch (t) {
+#define TYPE(t) \
+ case t: return QT_STRINGIFY(t);
+ FOR_CBOR_TYPE(TYPE)
+#undef TYPE
+ }
+ return "<huh?>";
+ }());
+}
+} // namespace QTest
+QT_END_NAMESPACE
+
+// Get the data from TinyCBOR (see src/3rdparty/tinycbor/tests/parser/data.cpp)
+#include "data.cpp"
+
+void tst_QCborStreamReader::initTestCase_data()
+{
+ QTest::addColumn<bool>("useDevice");
+ QTest::newRow("QByteArray") << false;
+ QTest::newRow("QBuffer") << true;
+}
+
+void tst_QCborStreamReader::basics()
+{
+ QFETCH_GLOBAL(bool, useDevice);
+ QBuffer buffer;
+ QCborStreamReader reader;
+
+ if (useDevice) {
+ buffer.open(QIODevice::ReadOnly);
+ reader.setDevice(&buffer);
+ QVERIFY(reader.device() != nullptr);
+ } else {
+ QCOMPARE(reader.device(), nullptr);
+ }
+
+ QCOMPARE(reader.currentOffset(), 0);
+ QCOMPARE(reader.lastError(), QCborError::EndOfFile);
+
+ QCOMPARE(reader.type(), QCborStreamReader::Invalid);
+ QVERIFY(!reader.isUnsignedInteger());
+ QVERIFY(!reader.isNegativeInteger());
+ QVERIFY(!reader.isByteArray());
+ QVERIFY(!reader.isString());
+ QVERIFY(!reader.isArray());
+ QVERIFY(!reader.isContainer());
+ QVERIFY(!reader.isMap());
+ QVERIFY(!reader.isTag());
+ QVERIFY(!reader.isSimpleType());
+ QVERIFY(!reader.isBool());
+ QVERIFY(!reader.isNull());
+ QVERIFY(!reader.isUndefined());
+ QVERIFY(!reader.isFloat16());
+ QVERIFY(!reader.isFloat());
+ QVERIFY(!reader.isDouble());
+ QVERIFY(!reader.isValid());
+ QVERIFY(reader.isInvalid());
+
+ QCOMPARE(reader.containerDepth(), 0);
+ QCOMPARE(reader.parentContainerType(), QCborStreamReader::Invalid);
+ QVERIFY(!reader.hasNext());
+ QVERIFY(!reader.next());
+ QCOMPARE(reader.lastError(), QCborError::EndOfFile);
+
+ QVERIFY(reader.isLengthKnown()); // well, it's not unknown
+ QCOMPARE(reader.length(), ~0ULL);
+
+ if (useDevice) {
+ reader.reparse();
+ QVERIFY(reader.device() != nullptr);
+ } else {
+ reader.addData(QByteArray());
+ QCOMPARE(reader.device(), nullptr);
+ }
+
+ // nothing changes, we added nothing
+ QCOMPARE(reader.currentOffset(), 0);
+ QCOMPARE(reader.lastError(), QCborError::EndOfFile);
+
+ QCOMPARE(reader.type(), QCborStreamReader::Invalid);
+ QVERIFY(!reader.isUnsignedInteger());
+ QVERIFY(!reader.isNegativeInteger());
+ QVERIFY(!reader.isByteArray());
+ QVERIFY(!reader.isString());
+ QVERIFY(!reader.isArray());
+ QVERIFY(!reader.isContainer());
+ QVERIFY(!reader.isMap());
+ QVERIFY(!reader.isTag());
+ QVERIFY(!reader.isSimpleType());
+ QVERIFY(!reader.isBool());
+ QVERIFY(!reader.isNull());
+ QVERIFY(!reader.isUndefined());
+ QVERIFY(!reader.isFloat16());
+ QVERIFY(!reader.isFloat());
+ QVERIFY(!reader.isDouble());
+ QVERIFY(!reader.isValid());
+ QVERIFY(reader.isInvalid());
+
+ QVERIFY(reader.isLengthKnown()); // well, it's not unknown
+ QCOMPARE(reader.length(), ~0ULL);
+
+ QCOMPARE(reader.containerDepth(), 0);
+ QCOMPARE(reader.parentContainerType(), QCborStreamReader::Invalid);
+ QVERIFY(!reader.hasNext());
+ QVERIFY(!reader.next());
+
+ reader.clear();
+ QCOMPARE(reader.device(), nullptr);
+ QCOMPARE(reader.currentOffset(), 0);
+ QCOMPARE(reader.lastError(), QCborError::EndOfFile);
+}
+
+void tst_QCborStreamReader::clear_data()
+{
+ QTest::addColumn<QByteArray>("data");
+ QTest::addColumn<QCborError>("firstError");
+ QTest::addColumn<int>("offsetAfterSkip");
+ QTest::newRow("invalid") << QByteArray(512, '\xff') << QCborError{QCborError::UnexpectedBreak} << 0;
+ QTest::newRow("valid") << QByteArray(512, '\0') << QCborError{QCborError::NoError} << 0;
+ QTest::newRow("skipped") << QByteArray(512, '\0') << QCborError{QCborError::NoError} << 1;
+}
+
+void tst_QCborStreamReader::clear()
+{
+ QFETCH_GLOBAL(bool, useDevice);
+ QFETCH(QByteArray, data);
+ QFETCH(QCborError, firstError);
+ QFETCH(int, offsetAfterSkip);
+
+ QBuffer buffer(&data);
+ QCborStreamReader reader(data);
+ if (useDevice) {
+ buffer.open(QIODevice::ReadOnly);
+ reader.setDevice(&buffer);
+ }
+ QCOMPARE(reader.isValid(), !firstError);
+ QCOMPARE(reader.currentOffset(), 0);
+ QCOMPARE(reader.lastError(), firstError);
+
+ if (offsetAfterSkip) {
+ reader.next();
+ QVERIFY(!reader.isValid());
+ QCOMPARE(reader.currentOffset(), 1);
+ QCOMPARE(reader.lastError(), QCborError::NoError);
+ }
+
+ reader.clear();
+ QCOMPARE(reader.device(), nullptr);
+ QCOMPARE(reader.currentOffset(), 0);
+ QCOMPARE(reader.lastError(), QCborError::EndOfFile);
+}
+
+void tst_QCborStreamReader::integers_data()
+{
+ addIntegers();
+}
+
+void tst_QCborStreamReader::integers()
+{
+ QFETCH_GLOBAL(bool, useDevice);
+ QFETCH(QByteArray, data);
+ QFETCH(bool, isNegative);
+ QFETCH(quint64, expectedRaw);
+ QFETCH(qint64, expectedValue);
+ QFETCH(bool, inInt64Range);
+ quint64 absolute = (isNegative ? expectedRaw + 1 : expectedRaw);
+
+ QBuffer buffer(&data);
+ QCborStreamReader reader(useDevice ? QByteArray() : data);
+ if (useDevice) {
+ buffer.open(QIODevice::ReadOnly);
+ reader.setDevice(&buffer);
+ }
+ QVERIFY(reader.isValid());
+ QCOMPARE(reader.lastError(), QCborError::NoError);
+ QVERIFY(reader.isInteger());
+
+ if (inInt64Range)
+ QCOMPARE(reader.toInteger(), expectedValue);
+ if (isNegative)
+ QCOMPARE(quint64(reader.toNegativeInteger()), absolute);
+ else
+ QCOMPARE(reader.toUnsignedInteger(), absolute);
+}
+
+void escapedAppendTo(QString &result, const QByteArray &data)
+{
+ result += "h'" + QString::fromLatin1(data.toHex()) + '\'';
+}
+
+void escapedAppendTo(QString &result, const QString &data)
+{
+ result += '"';
+ for (int i = 0; i <= data.size(); i += 245) {
+ // hopefully we won't have a surrogate pair split here
+ QScopedArrayPointer<char> escaped(QTest::toPrettyUnicode(data.mid(i, 245)));
+ QLatin1String s(escaped.data() + 1); // skip opening "
+ s.chop(1); // drop the closing "
+ result += s;
+ }
+ result += '"';
+}
+
+template <typename S, QCborStreamReader::StringResult<S> (QCborStreamReader:: *Decoder)()>
+static QString parseOneString_helper(QCborStreamReader &reader)
+{
+ QString result;
+ bool parens = !reader.isLengthKnown();
+ if (parens)
+ result += '(';
+
+ auto r = (reader.*Decoder)();
+ const char *comma = "";
+ while (r.status == QCborStreamReader::Ok) {
+ result += comma;
+ escapedAppendTo(result, r.data);
+
+ r = (reader.*Decoder)();
+ comma = ", ";
+ }
+
+ if (r.status == QCborStreamReader::Error)
+ return QString();
+
+ if (parens)
+ result += ')';
+ return result;
+}
+
+static QString parseOneByteArray(QCborStreamReader &reader)
+{
+ return parseOneString_helper<QByteArray, &QCborStreamReader::readByteArray>(reader);
+}
+
+static QString parseOneString(QCborStreamReader &reader)
+{
+ return parseOneString_helper<QString, &QCborStreamReader::readString>(reader);
+}
+
+static QString makeNegativeString(QCborNegativeInteger n)
+{
+ return n == QCborNegativeInteger(0) ?
+ QString("-18446744073709551616") :
+ QString("-%1").arg(quint64(n));
+}
+
+template <typename T> static inline bool canConvertTo(double v)
+{
+ // The [conv.fpint] (7.10 Floating-integral conversions) section of the
+ // standard says only exact conversions are guaranteed. Converting
+ // integrals to floating-point with loss of precision has implementation-
+ // defined behavior whether the next higher or next lower is returned;
+ // converting FP to integral is UB if it can't be represented.;
+ Q_STATIC_ASSERT(std::numeric_limits<T>::is_integer);
+
+ double supremum = ldexp(1, std::numeric_limits<T>::digits);
+ if (v >= supremum)
+ return false;
+
+ if (v < std::numeric_limits<T>::min()) // either zero or a power of two, so it's exact
+ return false;
+
+ // we're in range
+ return v == floor(v);
+}
+
+static QString makeFpString(double v)
+{
+ if (canConvertTo<qint64>(v))
+ return QString::number(qint64(v)) + '.';
+ if (canConvertTo<quint64>(v))
+ return QString::number(quint64(v)) + '.';
+
+ QString s = QString::number(v, 'g', std::numeric_limits<double>::digits10 + 2);
+ if (!s.contains('.') && !s.contains('e') && !qIsInf(v) && !qIsNaN(v))
+ s += '.';
+ return s;
+}
+
+static QString makeFpString(float v)
+{
+ if (qIsInf(v))
+ return v > 0 ? "inf" : "-inf";
+ if (qIsNaN(v))
+ return "nan";
+ return makeFpString(double(v)) + 'f';
+}
+
+static QString makeFpString(qfloat16 v)
+{
+ if (qIsInf(v))
+ return v > 0 ? "inf" : "-inf";
+ if (qIsNaN(v))
+ return "nan";
+ return makeFpString(double(v)) + "f16";
+}
+
+static QString parseOne(QCborStreamReader &reader)
+{
+ QString result;
+
+ switch (reader.type()) {
+ case QCborStreamReader::UnsignedInteger:
+ result = QString::number(reader.toUnsignedInteger());
+ break;
+ case QCborStreamReader::NegativeInteger:
+ result = makeNegativeString(reader.toNegativeInteger());
+ break;
+ case QCborStreamReader::ByteArray:
+ return parseOneByteArray(reader);
+ case QCborStreamReader::String:
+ return parseOneString(reader);
+ case QCborStreamReader::Array:
+ case QCborStreamReader::Map: {
+ const char *delimiters = (reader.isArray() ? "[]" : "{}");
+ result += delimiters[0];
+ reader.enterContainer();
+
+ QLatin1String comma("");
+ while (reader.lastError() == QCborError::NoError && reader.hasNext()) {
+ result += comma + parseOne(reader);
+ comma = QLatin1String(", ");
+
+ if (reader.parentContainerType() == QCborStreamReader::Map
+ && reader.lastError() == QCborError::NoError)
+ result += ": " + parseOne(reader);
+ }
+
+ if (reader.isValid())
+ return QString();
+ if (reader.lastError() != QCborError::NoError)
+ return QString();
+ reader.leaveContainer();
+ result += delimiters[1];
+ return result;
+ }
+ case QCborStreamReader::Tag: {
+ QCborTag tag = reader.toTag();
+ if (!reader.next())
+ return QString();
+ return QString("%1(%2)").arg(quint64(tag)).arg(parseOne(reader));
+ }
+ case QCborStreamReader::SimpleType:
+ switch (reader.toSimpleType()) {
+ case QCborSimpleType::False:
+ result = QStringLiteral("false");
+ break;
+ case QCborSimpleType::True:
+ result = QStringLiteral("true");
+ break;
+ case QCborSimpleType::Null:
+ result = QStringLiteral("null");
+ break;
+ case QCborSimpleType::Undefined:
+ result = QStringLiteral("undefined");
+ break;
+ default:
+ result = QString("simple(%1)").arg(quint8(reader.toSimpleType()));
+ break;
+ }
+ break;
+ case QCborStreamReader::Float16:
+ result = makeFpString(reader.toFloat16());
+ break;
+ case QCborStreamReader::Float:
+ result = makeFpString(reader.toFloat());
+ break;
+ case QCborStreamReader::Double:
+ result = makeFpString(reader.toDouble());
+ break;
+ case QCborStreamReader::Invalid:
+ return QStringLiteral("<invalid>");
+ }
+
+ if (!reader.next())
+ return QString();
+ return result;
+}
+
+bool parseNonRecursive(QString &result, bool &printingStringChunks, QCborStreamReader &reader)
+{
+ while (reader.lastError() == QCborError::NoError) {
+ if (!reader.hasNext()) {
+ if (result.endsWith(", "))
+ result.chop(2);
+ if (reader.containerDepth() == 0)
+ return true;
+ result += reader.parentContainerType() == QCborStreamReader::Map ? "}, " : "], ";
+ reader.leaveContainer();
+ continue;
+ }
+
+ switch (reader.type()) {
+ case QCborStreamReader::UnsignedInteger:
+ result += QString::number(reader.toUnsignedInteger());
+ break;
+ case QCborStreamReader::NegativeInteger:
+ result += makeNegativeString(reader.toNegativeInteger());
+ break;
+ case QCborStreamReader::ByteArray:
+ case QCborStreamReader::String: {
+ QCborStreamReader::StringResultCode status;
+ if (!printingStringChunks && !reader.isLengthKnown()) {
+ printingStringChunks = true;
+ result += '(';
+ }
+ if (reader.isByteArray()) {
+ auto r = reader.readByteArray();
+ status = r.status;
+ if (r.status == QCborStreamReader::Ok)
+ escapedAppendTo(result, r.data);
+ } else {
+ auto r = reader.readString();
+ status = r.status;
+ if (r.status == QCborStreamReader::Ok)
+ escapedAppendTo(result, r.data);
+ }
+
+ if (status == QCborStreamReader::EndOfString) {
+ if (result.endsWith(", "))
+ result.chop(2);
+ if (printingStringChunks)
+ result += ')';
+ result += ", ";
+ printingStringChunks = false;
+ }
+ if (status == QCborStreamReader::Ok && printingStringChunks)
+ result += ", ";
+
+ continue;
+ }
+ case QCborStreamReader::Array:
+ result += '[';
+ reader.enterContainer();
+ continue;
+ case QCborStreamReader::Map:
+ result += '{';
+ reader.enterContainer();
+ continue;
+ case QCborStreamReader::Tag:
+ result += QString("Tag:%1:").arg(quint64(reader.toTag()));
+ reader.next();
+ continue; // skip the comma
+ case QCborStreamReader::SimpleType:
+ switch (reader.toSimpleType()) {
+ case QCborSimpleType::False:
+ result += QStringLiteral("false");
+ break;
+ case QCborSimpleType::True:
+ result += QStringLiteral("true");
+ break;
+ case QCborSimpleType::Null:
+ result += QStringLiteral("null");
+ break;
+ case QCborSimpleType::Undefined:
+ result += QStringLiteral("undefined");
+ break;
+ default:
+ result += QString("simple(%1)").arg(quint8(reader.toSimpleType()));
+ break;
+ }
+ break;
+ case QCborStreamReader::Float16:
+ result += makeFpString(reader.toFloat16());
+ break;
+ case QCborStreamReader::Float:
+ result += makeFpString(reader.toFloat());
+ break;
+ case QCborStreamReader::Double:
+ result += makeFpString(reader.toDouble());
+ break;
+ case QCborStreamReader::Invalid:
+ break;
+ }
+
+ reader.next();
+ result += ", ";
+ }
+ return false;
+};
+
+
+static QString &removeIndicators(QString &str)
+{
+ // remove any CBOR encoding indicators from the string, since parseOne above
+ // doesn't produce them
+ static QRegularExpression rx("_(\\d+)? ?");
+ return str.replace(rx, QString());
+}
+
+void tst_QCborStreamReader::fixed_data()
+{
+ addColumns();
+ addFixedData();
+}
+
+void tst_QCborStreamReader::fixed()
+{
+ QFETCH_GLOBAL(bool, useDevice);
+ QFETCH(QByteArray, data);
+ QFETCH(QString, expected);
+ removeIndicators(expected);
+
+ QBuffer buffer(&data);
+ QCborStreamReader reader(useDevice ? QByteArray() : data);
+ if (useDevice) {
+ buffer.open(QIODevice::ReadOnly);
+ reader.setDevice(&buffer);
+ }
+ QVERIFY(reader.isValid());
+ QCOMPARE(reader.lastError(), QCborError::NoError);
+ QCOMPARE(parseOne(reader), expected);
+
+ // verify that we can re-read
+ reader.reset();
+ QVERIFY(reader.isValid());
+ QCOMPARE(reader.lastError(), QCborError::NoError);
+ QCOMPARE(parseOne(reader), expected);
+}
+
+void tst_QCborStreamReader::strings_data()
+{
+ addColumns();
+ addStringsData();
+}
+
+void tst_QCborStreamReader::strings()
+{
+ fixed();
+ if (QTest::currentTestFailed())
+ return;
+
+ // Extra string checks:
+ // We'll compare the reads using readString() and readByteArray()
+ // (henceforth "control data" because fixed() above tested them) with those
+ // obtained with readStringChunk().
+
+ QFETCH(QByteArray, data);
+ QFETCH(QString, expected);
+ QFETCH_GLOBAL(bool, useDevice);
+ bool isChunked = expected.startsWith('(');
+
+ QBuffer buffer(&data), controlBuffer(&data);
+ QCborStreamReader reader(data), controlReader(data);
+ if (useDevice) {
+ buffer.open(QIODevice::ReadOnly);
+ controlBuffer.open(QIODevice::ReadOnly);
+ reader.setDevice(&buffer);
+ controlReader.setDevice(&controlBuffer);
+ }
+ QVERIFY(reader.isString() || reader.isByteArray());
+ QCOMPARE(reader.isLengthKnown(), !isChunked);
+
+ if (!isChunked)
+ QCOMPARE(reader.currentStringChunkSize(), qsizetype(reader.length()));
+
+ int chunks = 0;
+ forever {
+ QCborStreamReader::StringResult<QByteArray> controlData;
+ if (reader.isString()) {
+ auto r = controlReader.readString();
+ controlData.data = r.data.toUtf8();
+ controlData.status = r.status;
+ } else {
+ controlData = controlReader.readByteArray();
+ }
+ QVERIFY(controlData.status != QCborStreamReader::Error);
+
+ for (int i = 0; i < 10; ++i) {
+ // this call must work several times with the same result
+ QCOMPARE(reader.currentStringChunkSize(), controlData.data.size());
+ }
+
+ QByteArray chunk(controlData.data.size(), Qt::Uninitialized);
+ auto r = reader.readStringChunk(chunk.data(), chunk.size());
+ QCOMPARE(r.status, controlData.status);
+ if (r.status == QCborStreamReader::Ok)
+ QCOMPARE(r.data, controlData.data.size());
+ else
+ QCOMPARE(r.data, 0);
+ QCOMPARE(chunk, controlData.data);
+
+ if (r.status == QCborStreamReader::EndOfString)
+ break;
+ ++chunks;
+ }
+
+ if (!isChunked)
+ QCOMPARE(chunks, 1);
+}
+
+void tst_QCborStreamReader::tags_data()
+{
+ addColumns();
+ addTagsData();
+}
+
+void tst_QCborStreamReader::emptyContainers_data()
+{
+ addColumns();
+ addEmptyContainersData();
+}
+
+void tst_QCborStreamReader::emptyContainers()
+{
+ QFETCH_GLOBAL(bool, useDevice);
+ QFETCH(QByteArray, data);
+ QFETCH(QString, expected);
+ removeIndicators(expected);
+
+ QBuffer buffer(&data);
+ QCborStreamReader reader(data);
+ if (useDevice) {
+ buffer.open(QIODevice::ReadOnly);
+ reader.setDevice(&buffer);
+ }
+ QVERIFY(reader.isValid());
+ QCOMPARE(reader.lastError(), QCborError::NoError);
+ if (reader.isLengthKnown())
+ QCOMPARE(reader.length(), 0U);
+ QCOMPARE(parseOne(reader), expected);
+
+ // verify that we can re-read
+ reader.reset();
+ QVERIFY(reader.isValid());
+ QCOMPARE(reader.lastError(), QCborError::NoError);
+ if (reader.isLengthKnown())
+ QCOMPARE(reader.length(), 0U);
+ QCOMPARE(parseOne(reader), expected);
+}
+
+void tst_QCborStreamReader::arrays_data()
+{
+ addColumns();
+ addFixedData();
+ addStringsData();
+ addTagsData();
+ addEmptyContainersData();
+}
+
+static void checkContainer(int len, const QByteArray &data, const QString &expected)
+{
+ QFETCH_GLOBAL(bool, useDevice);
+
+ QByteArray copy = data;
+ QBuffer buffer(&copy);
+ QCborStreamReader reader(data);
+ if (useDevice) {
+ buffer.open(QIODevice::ReadOnly);
+ reader.setDevice(&buffer);
+ }
+ QVERIFY(reader.isValid());
+ QCOMPARE(reader.lastError(), QCborError::NoError);
+ if (len >= 0) {
+ QVERIFY(reader.isLengthKnown());
+ QCOMPARE(reader.length(), uint(len));
+ }
+ QCOMPARE(parseOne(reader), expected);
+
+ // verify that we can re-read
+ reader.reset();
+ QVERIFY(reader.isValid());
+ QCOMPARE(reader.lastError(), QCborError::NoError);
+ if (len >= 0) {
+ QVERIFY(reader.isLengthKnown());
+ QCOMPARE(reader.length(), uint(len));
+ }
+ QCOMPARE(parseOne(reader), expected);
+}
+
+void tst_QCborStreamReader::arrays()
+{
+ QFETCH(QByteArray, data);
+ QFETCH(QString, expected);
+ removeIndicators(expected);
+
+ checkContainer(1, '\x81' + data, '[' + expected + ']');
+ if (QTest::currentTestFailed())
+ return;
+
+ checkContainer(2, '\x82' + data + data, '[' + expected + ", " + expected + ']');
+}
+
+void tst_QCborStreamReader::maps()
+{
+ QFETCH(QByteArray, data);
+ QFETCH(QString, expected);
+ removeIndicators(expected);
+
+ // int keys
+ checkContainer(1, "\xa1\1" + data, "{1: " + expected + '}');
+ if (QTest::currentTestFailed())
+ return;
+
+ checkContainer(2, "\xa2\1" + data + '\x20' + data,
+ "{1: " + expected + ", -1: " + expected + '}');
+ if (QTest::currentTestFailed())
+ return;
+
+ // string keys
+ checkContainer(1, "\xa1\x65Hello" + data, "{\"Hello\": " + expected + '}');
+ if (QTest::currentTestFailed())
+ return;
+
+ checkContainer(2, "\xa2\x65World" + data + "\x65Hello" + data,
+ "{\"World\": " + expected + ", \"Hello\": " + expected + '}');
+}
+
+void tst_QCborStreamReader::undefLengthArrays()
+{
+ QFETCH(QByteArray, data);
+ QFETCH(QString, expected);
+ removeIndicators(expected);
+
+ checkContainer(-1, '\x9f' + data + '\xff', '[' + expected + ']');
+ if (QTest::currentTestFailed())
+ return;
+
+ checkContainer(-2, '\x9f' + data + data + '\xff', '[' + expected + ", " + expected + ']');
+}
+
+void tst_QCborStreamReader::undefLengthMaps()
+{
+ QFETCH(QByteArray, data);
+ QFETCH(QString, expected);
+ removeIndicators(expected);
+
+ // int keys
+ checkContainer(-1, "\xbf\1" + data + '\xff', "{1: " + expected + '}');
+ if (QTest::currentTestFailed())
+ return;
+
+ checkContainer(-2, "\xbf\1" + data + '\x20' + data + '\xff',
+ "{1: " + expected + ", -1: " + expected + '}');
+ if (QTest::currentTestFailed())
+ return;
+
+ // string keys
+ checkContainer(-1, "\xbf\x65Hello" + data + '\xff', "{\"Hello\": " + expected + '}');
+ if (QTest::currentTestFailed())
+ return;
+
+ checkContainer(-2, "\xbf\x65World" + data + "\x65Hello" + data + '\xff',
+ "{\"World\": " + expected + ", \"Hello\": " + expected + '}');
+}
+
+void tst_QCborStreamReader::next()
+{
+ QFETCH(QByteArray, data);
+
+ auto doit = [](QByteArray data) {
+ QFETCH_GLOBAL(bool, useDevice);
+
+ QBuffer buffer(&data);
+ QCborStreamReader reader(data);
+ if (useDevice) {
+ buffer.open(QIODevice::ReadOnly);
+ reader.setDevice(&buffer);
+ }
+ return reader.next();
+ };
+
+ QVERIFY(doit('\x81' + data));
+ QVERIFY(doit('\x82' + data + data));
+ QVERIFY(doit('\x9f' + data + '\xff'));
+ QVERIFY(doit("\x81\x9f" + data + '\xff'));
+ QVERIFY(doit("\x9f\x81" + data + '\xff'));
+
+ QVERIFY(doit("\xa1\1" + data));
+ QVERIFY(doit("\xa2\1" + data + '\x20' + data));
+ QVERIFY(doit("\xbf\1" + data + '\xff'));
+ QVERIFY(doit("\xbf\x9f\1\xff\x9f" + data + "\xff\xff"));
+}
+
+void tst_QCborStreamReader::validation_data()
+{
+ addValidationColumns();
+ addValidationData();
+}
+
+void tst_QCborStreamReader::validation()
+{
+ QFETCH_GLOBAL(bool, useDevice);
+ QFETCH(QByteArray, data);
+
+ QBuffer buffer(&data);
+ QCborStreamReader reader(data);
+ if (useDevice) {
+ buffer.open(QIODevice::ReadOnly);
+ reader.setDevice(&buffer);
+ }
+ parseOne(reader);
+ QVERIFY(reader.lastError() != QCborError::NoError);
+
+ // next() should fail
+ reader.reset();
+ QVERIFY(!reader.next());
+ QVERIFY(reader.lastError() != QCborError::NoError);
+}
+
+static const int Recursions = 3;
+void tst_QCborStreamReader::recursionLimit_data()
+{
+ static const int recursions = Recursions + 2;
+ QTest::addColumn<QByteArray>("data");
+
+ QTest::newRow("array") << QByteArray(recursions, '\x81') + '\x20';
+ QTest::newRow("_array") << QByteArray(recursions, '\x9f') + '\x20' + QByteArray(recursions, '\xff');
+
+ QByteArray data;
+ for (int i = 0; i < recursions; ++i)
+ data += "\xa1\x65Hello";
+ data += '\2';
+ QTest::newRow("map-recursive-values") << data;
+
+ data.clear();
+ for (int i = 0; i < recursions; ++i)
+ data += "\xbf\x65World";
+ data += '\2';
+ for (int i = 0; i < recursions; ++i)
+ data += "\xff";
+ QTest::newRow("_map-recursive-values") << data;
+
+ data = QByteArray(recursions, '\xa1');
+ data += '\2';
+ for (int i = 0; i < recursions; ++i)
+ data += "\x7f\x64quux\xff";
+ QTest::newRow("map-recursive-keys") << data;
+
+ data = QByteArray(recursions, '\xbf');
+ data += '\2';
+ for (int i = 0; i < recursions; ++i)
+ data += "\1\xff";
+ QTest::newRow("_map-recursive-keys") << data;
+
+ data.clear();
+ for (int i = 0; i < recursions / 2; ++i)
+ data += "\x81\xa1\1";
+ data += '\2';
+ QTest::newRow("mixed") << data;
+}
+
+void tst_QCborStreamReader::recursionLimit()
+{
+ QFETCH_GLOBAL(bool, useDevice);
+ QFETCH(QByteArray, data);
+
+ data.prepend('\x81');
+ QBuffer buffer(&data);
+ QCborStreamReader reader(data);
+ if (useDevice) {
+ buffer.open(QIODevice::ReadOnly);
+ reader.setDevice(&buffer);
+ }
+
+ // verify that it works normally:
+ QVERIFY(reader.enterContainer());
+ QVERIFY(reader.next());
+ QVERIFY(!reader.hasNext());
+
+ reader.reset();
+ QVERIFY(reader.enterContainer());
+ QVERIFY(!reader.next(Recursions));
+ QCOMPARE(reader.lastError(), QCborError::NestingTooDeep);
+}
+
+void tst_QCborStreamReader::addData_singleElement_data()
+{
+ addColumns();
+ addFixedData();
+ addNonChunkedStringsData();
+}
+
+void tst_QCborStreamReader::addData_singleElement()
+{
+ QFETCH_GLOBAL(bool, useDevice);
+ QFETCH(QByteArray, data);
+ QFETCH(QString, expected);
+ removeIndicators(expected);
+
+ QByteArray growing;
+ QBuffer buffer(&growing);
+ QCborStreamReader reader;
+ if (useDevice) {
+ buffer.open(QIODevice::ReadOnly);
+ reader.setDevice(&buffer);
+ }
+ for (int i = 0; i < data.size() - 1; ++i) {
+ // add one byte from the data
+ if (useDevice) {
+ growing.append(data.at(i));
+ reader.reparse();
+ } else {
+ reader.addData(data.constData() + i, 1);
+ }
+
+ parseOne(reader);
+ QCOMPARE(reader.lastError(), QCborError::EndOfFile);
+ }
+
+ // add the last byte
+ if (useDevice) {
+ growing.append(data.right(1));
+ reader.reparse();
+ } else {
+ reader.addData(data.right(1));
+ }
+ QCOMPARE(reader.lastError(), QCborError::NoError);
+ QCOMPARE(parseOne(reader), expected);
+}
+
+void tst_QCborStreamReader::addData_complex()
+{
+ QFETCH(QByteArray, data);
+ QFETCH(QString, expected);
+ removeIndicators(expected);
+
+ // transform tags (parseNonRecursive can't produce the usual form)
+ expected.replace(QRegularExpression(R"/((\d+)\(([^)]+)\))/"), "Tag:\\1:\\2");
+
+ auto doit = [](const QByteArray &data) {
+ QFETCH_GLOBAL(bool, useDevice);
+
+ // start with one byte
+ int added = 1;
+ QByteArray growing = data.left(added);
+ QBuffer buffer(&growing);
+ QCborStreamReader reader(growing);
+ if (useDevice) {
+ buffer.open(QIODevice::ReadOnly);
+ reader.setDevice(&buffer);
+ }
+
+ QString result;
+ bool printingStringChunks = false;
+ forever {
+ if (parseNonRecursive(result, printingStringChunks, reader))
+ return result;
+ if (reader.lastError() != QCborError::EndOfFile)
+ return reader.lastError().toString();
+
+ while (reader.lastError() == QCborError::EndOfFile) {
+ // add more data
+ if (added == data.size())
+ return QStringLiteral("Couldn't parse even with all data");
+
+ if (useDevice) {
+ growing.append(data.at(added));
+ reader.reparse();
+ } else {
+ reader.addData(data.constData() + added, 1);
+ }
+ ++added;
+ }
+ }
+ };
+
+ // plain:
+ QCOMPARE(doit(data), expected);
+
+ // in an array
+ QCOMPARE(doit('\x81' + data), '[' + expected + ']');
+ QCOMPARE(doit('\x82' + data + data), '[' + expected + ", " + expected + ']');
+
+ QCOMPARE(doit('\x9f' + data + '\xff'), '[' + expected + ']');
+ QCOMPARE(doit('\x9f' + data + data + '\xff'), '[' + expected + ", " + expected + ']');
+
+ // in a map
+ QCOMPARE(doit("\xa1\x01" + data), "{1, " + expected + '}');
+ QCOMPARE(doit("\xa1\x65Hello" + data), "{\"Hello\", " + expected + '}');
+ QCOMPARE(doit("\xa1\x7f\x65Hello\x65World\xff" + data), "{(\"Hello\", \"World\"), " + expected + '}');
+ QCOMPARE(doit("\xa2\x01" + data + "\x65Hello" + data),
+ "{1, " + expected + ", \"Hello\", " + expected + '}');
+
+ QCOMPARE(doit("\xbf\x01" + data + '\xff'), "{1, " + expected + '}');
+
+ // mixed
+ QCOMPARE(doit("\xbf\x01\x81" + data + '\xff'), "{1, [" + expected + "]}");
+ QCOMPARE(doit("\xbf\x01\x82" + data + data + '\xff'),
+ "{1, [" + expected + ", " + expected + "]}");
+ QCOMPARE(doit("\xbf\x01\x9f" + data + data + "\xff\xff"),
+ "{1, [" + expected + ", " + expected + "]}");
+}
+
+
+QTEST_MAIN(tst_QCborStreamReader)
+
+#include "tst_qcborstreamreader.moc"
diff --git a/tests/auto/corelib/serialization/qcborstreamwriter/qcborstreamwriter.pro b/tests/auto/corelib/serialization/qcborstreamwriter/qcborstreamwriter.pro
new file mode 100644
index 0000000000..3391b5a296
--- /dev/null
+++ b/tests/auto/corelib/serialization/qcborstreamwriter/qcborstreamwriter.pro
@@ -0,0 +1,8 @@
+QT = core testlib
+TARGET = tst_qcborstreamwriter
+CONFIG += testcase
+SOURCES += \
+ tst_qcborstreamwriter.cpp
+
+INCLUDEPATH += ../../../../../src/3rdparty/tinycbor/tests/encoder
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
diff --git a/tests/auto/corelib/serialization/qcborstreamwriter/tst_qcborstreamwriter.cpp b/tests/auto/corelib/serialization/qcborstreamwriter/tst_qcborstreamwriter.cpp
new file mode 100644
index 0000000000..6995b4d08b
--- /dev/null
+++ b/tests/auto/corelib/serialization/qcborstreamwriter/tst_qcborstreamwriter.cpp
@@ -0,0 +1,313 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 Intel Corporation.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest>
+
+class tst_QCborStreamWriter : public QObject
+{
+ Q_OBJECT
+
+private Q_SLOTS:
+ void initTestCase_data();
+ void fixed_data();
+ void fixed();
+ void strings_data();
+ void strings() { fixed(); }
+ void nonAsciiStrings_data();
+ void nonAsciiStrings();
+ void arraysAndMaps_data();
+ void arraysAndMaps() { fixed(); }
+ void tags_data();
+ void tags();
+ void arrays_data() { tags_data(); }
+ void arrays();
+ void maps_data() { tags_data(); }
+ void maps();
+};
+
+// Get the data from TinyCBOR (see src/3rdparty/tinycbor/tests/encoder/data.cpp)
+typedef quint64 CborTag;
+#include "data.cpp"
+
+void encodeVariant(QCborStreamWriter &writer, const QVariant &v)
+{
+ int type = v.userType();
+ switch (type) {
+ case QVariant::Int:
+ case QVariant::LongLong:
+ return writer.append(v.toLongLong());
+
+ case QVariant::UInt:
+ case QVariant::ULongLong:
+ return writer.append(v.toULongLong());
+
+ case QVariant::Bool:
+ return writer.append(v.toBool());
+
+ case QVariant::Invalid:
+ return writer.appendUndefined();
+
+ case QMetaType::VoidStar:
+ return writer.append(nullptr);
+
+ case QVariant::Double:
+ return writer.append(v.toDouble());
+
+ case QMetaType::Float:
+ return writer.append(v.toFloat());
+
+ case QVariant::String:
+ return writer.append(v.toString());
+
+ case QVariant::ByteArray:
+ return writer.append(v.toByteArray());
+
+ default:
+ if (type == qMetaTypeId<NegativeInteger>())
+ return writer.append(QCborNegativeInteger(v.value<NegativeInteger>().abs));
+ if (type == qMetaTypeId<SimpleType>())
+ return writer.append(QCborSimpleType(v.value<SimpleType>().type));
+ if (type == qMetaTypeId<qfloat16>())
+ return writer.append(v.value<qfloat16>());
+ if (type == qMetaTypeId<Tag>()) {
+ writer.append(QCborTag(v.value<Tag>().tag));
+ return encodeVariant(writer, v.value<Tag>().tagged);
+ }
+ if (type == QVariant::List || type == qMetaTypeId<IndeterminateLengthArray>()) {
+ QVariantList list = v.toList();
+ if (type == qMetaTypeId<IndeterminateLengthArray>()) {
+ list = v.value<IndeterminateLengthArray>();
+ writer.startArray();
+ } else {
+ writer.startArray(list.length());
+ }
+ for (const QVariant &v2 : qAsConst(list))
+ encodeVariant(writer, v2);
+ QVERIFY(writer.endArray());
+ return;
+ }
+ if (type == qMetaTypeId<Map>() || type == qMetaTypeId<IndeterminateLengthMap>()) {
+ Map map = v.value<Map>();
+ if (type == qMetaTypeId<IndeterminateLengthMap>()) {
+ map = v.value<IndeterminateLengthMap>();
+ writer.startMap();
+ } else {
+ writer.startMap(map.length());
+ }
+ for (auto pair : qAsConst(map)) {
+ encodeVariant(writer, pair.first);
+ encodeVariant(writer, pair.second);
+ }
+ QVERIFY(writer.endMap());
+ return;
+ }
+ }
+ QFAIL("Shouldn't have got here");
+}
+
+void compare(const QVariant &input, const QByteArray &output)
+{
+ QFETCH_GLOBAL(bool, useDevice);
+
+ if (useDevice) {
+ QBuffer buffer;
+ buffer.open(QIODevice::WriteOnly);
+ QCborStreamWriter writer(&buffer);
+ encodeVariant(writer, input);
+ QCOMPARE(buffer.data(), output);
+ } else {
+ QByteArray buffer;
+ QCborStreamWriter writer(&buffer);
+ encodeVariant(writer, input);
+ QCOMPARE(buffer, output);
+ }
+}
+
+void tst_QCborStreamWriter::initTestCase_data()
+{
+ QTest::addColumn<bool>("useDevice");
+ QTest::newRow("QByteArray") << false;
+ QTest::newRow("QIODevice") << true;
+}
+
+void tst_QCborStreamWriter::fixed_data()
+{
+ addColumns();
+ addFixedData();
+}
+
+void tst_QCborStreamWriter::fixed()
+{
+ QFETCH(QVariant, input);
+ QFETCH(QByteArray, output);
+ compare(input, output);
+}
+
+void tst_QCborStreamWriter::strings_data()
+{
+ addColumns();
+ addStringsData();
+}
+
+void tst_QCborStreamWriter::nonAsciiStrings_data()
+{
+ QTest::addColumn<QByteArray>("output");
+ QTest::addColumn<QString>("input");
+ QTest::addColumn<bool>("isLatin1");
+
+ QByteArray latin1 = u8"Résumé";
+ QTest::newRow("shortlatin1")
+ << ("\x68" + latin1) << QString::fromUtf8(latin1) << true;
+
+ // replicate it 5 times (total 40 bytes)
+ latin1 += latin1 + latin1 + latin1 + latin1;
+ QTest::newRow("longlatin1")
+ << ("\x78\x28" + latin1) << QString::fromUtf8(latin1) << true;
+
+ QByteArray nonlatin1 = u8"ΧαίÏετε";
+ QTest::newRow("shortnonlatin1")
+ << ("\x6e" + nonlatin1) << QString::fromUtf8(nonlatin1) << false;
+
+ // replicate it 4 times (total 56 bytes)
+ nonlatin1 = nonlatin1 + nonlatin1 + nonlatin1 + nonlatin1;
+ QTest::newRow("longnonlatin1")
+ << ("\x78\x38" + nonlatin1) << QString::fromUtf8(nonlatin1) << false;
+}
+
+void tst_QCborStreamWriter::nonAsciiStrings()
+{
+ QFETCH(QByteArray, output);
+ QFETCH(QString, input);
+ QFETCH(bool, isLatin1);
+ QFETCH_GLOBAL(bool, useDevice);
+
+ // will be wrong if !isLatin1
+ QByteArray latin1 = input.toLatin1();
+
+ if (useDevice) {
+ {
+ QBuffer buffer;
+ buffer.open(QIODevice::WriteOnly);
+ QCborStreamWriter writer(&buffer);
+ writer.append(input);
+ QCOMPARE(buffer.data(), output);
+ }
+
+ if (isLatin1) {
+ QBuffer buffer;
+ buffer.open(QIODevice::WriteOnly);
+ QCborStreamWriter writer(&buffer);
+ writer.append(QLatin1String(latin1.constData(), latin1.size()));
+ QCOMPARE(buffer.data(), output);
+ }
+ } else {
+ {
+ QByteArray buffer;
+ QCborStreamWriter writer(&buffer);
+ encodeVariant(writer, input);
+ QCOMPARE(buffer, output);
+ }
+
+ if (isLatin1) {
+ QByteArray buffer;
+ QCborStreamWriter writer(&buffer);
+ writer.append(QLatin1String(latin1.constData(), latin1.size()));
+ QCOMPARE(buffer, output);
+ }
+ }
+}
+
+void tst_QCborStreamWriter::arraysAndMaps_data()
+{
+ addColumns();
+ addArraysAndMaps();
+}
+
+void tst_QCborStreamWriter::tags_data()
+{
+ addColumns();
+ addFixedData();
+ addStringsData();
+ addArraysAndMaps();
+}
+
+void tst_QCborStreamWriter::tags()
+{
+ QFETCH(QVariant, input);
+ QFETCH(QByteArray, output);
+
+ compare(QVariant::fromValue(Tag{1, input}), "\xc1" + output);
+}
+
+void tst_QCborStreamWriter::arrays()
+{
+ QFETCH(QVariant, input);
+ QFETCH(QByteArray, output);
+
+ compare(make_list(input), "\x81" + output);
+ if (QTest::currentTestFailed())
+ return;
+
+ compare(make_list(input, input), "\x82" + output + output);
+ if (QTest::currentTestFailed())
+ return;
+
+ // nested lists
+ compare(make_list(make_list(input)), "\x81\x81" + output);
+ if (QTest::currentTestFailed())
+ return;
+
+ compare(make_list(make_list(input), make_list(input)), "\x82\x81" + output + "\x81" + output);
+}
+
+void tst_QCborStreamWriter::maps()
+{
+ QFETCH(QVariant, input);
+ QFETCH(QByteArray, output);
+
+ compare(make_map({{1, input}}), "\xa1\1" + output);
+ if (QTest::currentTestFailed())
+ return;
+
+ compare(make_map({{1, input}, {input, 24}}), "\xa2\1" + output + output + "\x18\x18");
+}
+
+QTEST_MAIN(tst_QCborStreamWriter)
+
+#include "tst_qcborstreamwriter.moc"
diff --git a/tests/auto/corelib/serialization/qcborvalue/qcborvalue.pro b/tests/auto/corelib/serialization/qcborvalue/qcborvalue.pro
new file mode 100644
index 0000000000..9dd67da1f0
--- /dev/null
+++ b/tests/auto/corelib/serialization/qcborvalue/qcborvalue.pro
@@ -0,0 +1,11 @@
+QT = core testlib
+TARGET = tst_qcborvalue
+CONFIG += testcase
+SOURCES += \
+ tst_qcborvalue.cpp
+
+INCLUDEPATH += \
+ ../../../../../src/3rdparty/tinycbor/src \
+ ../../../../../src/3rdparty/tinycbor/tests/parser
+
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
diff --git a/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp b/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp
new file mode 100644
index 0000000000..4b753eab6b
--- /dev/null
+++ b/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp
@@ -0,0 +1,1695 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 Intel Corporation.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/qcborvalue.h>
+#include <QtTest>
+
+Q_DECLARE_METATYPE(QCborValue)
+Q_DECLARE_METATYPE(QCborValue::EncodingOptions)
+
+class tst_QCborValue : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void basics_data();
+ void basics();
+ void tagged_data() { basics_data(); }
+ void tagged();
+ void extendedTypes_data();
+ void extendedTypes();
+ void copyCompare_data() { basics_data(); }
+ void copyCompare();
+
+ void arrayDefaultInitialization();
+ void arrayEmptyInitializerList();
+ void arrayEmptyDetach();
+ void arrayInitializerList();
+ void arrayMutation();
+ void arrayPrepend();
+ void arrayInsertRemove_data() { basics_data(); }
+ void arrayInsertRemove();
+ void arrayInsertTagged_data() { basics_data(); }
+ void arrayInsertTagged();
+ void arrayStringElements();
+ void arraySelfAssign_data() { basics_data(); }
+ void arraySelfAssign();
+
+ void mapDefaultInitialization();
+ void mapEmptyInitializerList();
+ void mapEmptyDetach();
+ void mapSimpleInitializerList();
+ void mapMutation();
+ void mapStringValues();
+ void mapStringKeys();
+ void mapInsertRemove_data() { basics_data(); }
+ void mapInsertRemove();
+ void mapInsertTagged_data() { basics_data(); }
+ void mapInsertTagged();
+ void mapSelfAssign_data() { basics_data(); }
+ void mapSelfAssign();
+ void mapComplexKeys_data() { basics_data(); }
+ void mapComplexKeys();
+
+ void sorting();
+
+ void toCbor_data();
+ void toCbor();
+ void fromCbor_data();
+ void fromCbor();
+ void validation_data();
+ void validation();
+ void toDiagnosticNotation_data();
+ void toDiagnosticNotation();
+};
+
+// Get the validation data from TinyCBOR (see src/3rdparty/tinycbor/tests/parser/data.cpp)
+#include "data.cpp"
+
+struct SimpleTypeWrapper
+{
+ // QCborSimpleType is an enum, so QVariant knows how to convert it to
+ // integer and we don't want it to do that.
+ SimpleTypeWrapper(QCborSimpleType type = {}) : st(type) {}
+ QCborSimpleType st;
+};
+Q_DECLARE_METATYPE(SimpleTypeWrapper)
+
+void tst_QCborValue::basics_data()
+{
+ QTest::addColumn<QCborValue::Type>("type");
+ QTest::addColumn<QCborValue>("v");
+ QTest::addColumn<QVariant>("expectedValue");
+ QDateTime dt = QDateTime::currentDateTimeUtc();
+ QUuid uuid = QUuid::createUuid();
+
+ QMetaEnum me = QMetaEnum::fromType<QCborValue::Type>();
+ auto add = [me](QCborValue::Type t, const QCborValue &v, const QVariant &exp) {
+ auto addRow = [=]() -> QTestData & {
+ const char *typeString = me.valueToKey(t);
+ if (t == QCborValue::Integer)
+ return QTest::addRow("Integer:%lld", exp.toLongLong());
+ if (t == QCborValue::Double)
+ return QTest::addRow("Double:%g", exp.toDouble());
+ if (t == QCborValue::ByteArray || t == QCborValue::String)
+ return QTest::addRow("%s:%d", typeString, exp.toString().size());
+ return QTest::newRow(typeString);
+ };
+ addRow() << t << v << exp;
+ };
+ auto st = [](QCborSimpleType t) { return QVariant::fromValue<SimpleTypeWrapper>(t); };
+
+ add(QCborValue::Undefined, QCborValue(), st(QCborSimpleType::Undefined));
+ add(QCborValue::Null, QCborValue::Null, st(QCborSimpleType::Null));
+ QTest::newRow("nullptr") << QCborValue::Null << QCborValue(nullptr)
+ << st(QCborSimpleType::Null);
+ add(QCborValue::False, false, st(QCborSimpleType::False));
+ QTest::newRow("false") << QCborValue::False << QCborValue(QCborValue::False)
+ << st(QCborSimpleType::False);
+ add(QCborValue::True, true, st(QCborSimpleType::True));
+ QTest::newRow("true") << QCborValue::True << QCborValue(QCborValue::True)
+ << st(QCborSimpleType::True);
+ QTest::newRow("simpletype") << QCborValue::Type(QCborValue::SimpleType + 255)
+ << QCborValue(QCborSimpleType(255))
+ << st(QCborSimpleType(255));
+ add(QCborValue::Integer, 0, 0);
+ add(QCborValue::Integer, 1, 1);
+ add(QCborValue::Integer, -1, -1);
+ add(QCborValue::Integer, std::numeric_limits<qint64>::min(), std::numeric_limits<qint64>::min());
+ add(QCborValue::Integer, std::numeric_limits<qint64>::max(), std::numeric_limits<qint64>::max());
+ add(QCborValue::Double, 0., 0.);
+ add(QCborValue::Double, 1.25, 1.25);
+ add(QCborValue::Double, -1.25, -1.25);
+ add(QCborValue::Double, qInf(), qInf());
+ add(QCborValue::Double, -qInf(), -qInf());
+ add(QCborValue::Double, qQNaN(), qQNaN());
+ add(QCborValue::ByteArray, QByteArray("Hello"), QByteArray("Hello"));
+ add(QCborValue::ByteArray, QByteArray(), QByteArray());
+ add(QCborValue::String, "Hello", "Hello");
+ add(QCborValue::String, QLatin1String(), QString());
+ add(QCborValue::DateTime, QCborValue(dt), dt);
+ add(QCborValue::Url, QCborValue(QUrl("http://example.com")), QUrl("http://example.com"));
+ add(QCborValue::RegularExpression, QCborValue(QRegularExpression("^.*$")), QRegularExpression("^.*$"));
+ add(QCborValue::Uuid, QCborValue(uuid), uuid);
+
+ // empty arrays and maps
+ add(QCborValue::Array, QCborArray(), QVariantList());
+ add(QCborValue::Map, QCborMap(), QVariantMap());
+}
+
+static void basicTypeCheck(QCborValue::Type type, const QCborValue &v, const QVariant &expectedValue)
+{
+ bool isSimpleType = (expectedValue.userType() == qMetaTypeId<SimpleTypeWrapper>());
+ QCborSimpleType st = expectedValue.value<SimpleTypeWrapper>().st;
+
+ QCOMPARE(v.type(), type);
+ QCOMPARE(v.isInteger(), type == QCborValue::Integer);
+ QCOMPARE(v.isByteArray(), type == QCborValue::ByteArray);
+ QCOMPARE(v.isString(), type == QCborValue::String);
+ QCOMPARE(v.isArray(), type == QCborValue::Array);
+ QCOMPARE(v.isMap(), type == QCborValue::Map);
+ QCOMPARE(v.isFalse(), type == QCborValue::False);
+ QCOMPARE(v.isTrue(), type == QCborValue::True);
+ QCOMPARE(v.isBool(), type == QCborValue::False || type == QCborValue::True);
+ QCOMPARE(v.isNull(), type == QCborValue::Null);
+ QCOMPARE(v.isUndefined(), type == QCborValue::Undefined);
+ QCOMPARE(v.isDouble(), type == QCborValue::Double);
+ QCOMPARE(v.isDateTime(), type == QCborValue::DateTime);
+ QCOMPARE(v.isUrl(), type == QCborValue::Url);
+ QCOMPARE(v.isUuid(), type == QCborValue::Uuid);
+ QCOMPARE(v.isInvalid(), type == QCborValue::Invalid);
+ QCOMPARE(v.isContainer(), type == QCborValue::Array || type == QCborValue::Map);
+ QCOMPARE(v.isSimpleType(), isSimpleType);
+ QCOMPARE(v.isSimpleType(QCborSimpleType::False), st == QCborSimpleType::False);
+ QCOMPARE(v.isSimpleType(QCborSimpleType::True), st == QCborSimpleType::True);
+ QCOMPARE(v.isSimpleType(QCborSimpleType::Null), st == QCborSimpleType::Null);
+ QCOMPARE(v.isSimpleType(QCborSimpleType::Undefined), st == QCborSimpleType::Undefined);
+ QCOMPARE(v.isSimpleType(QCborSimpleType(255)), st == QCborSimpleType(255));
+
+ if (v.isInteger()) {
+ QCOMPARE(v.toInteger(), expectedValue.toLongLong());
+ QCOMPARE(v.toDouble(), 0. + expectedValue.toLongLong());
+ } else {
+ QCOMPARE(v.toInteger(), qint64(expectedValue.toDouble()));
+ QCOMPARE(v.toDouble(), expectedValue.toDouble());
+ }
+ QCOMPARE(v.toBool(true), st != QCborSimpleType::False);
+ QCOMPARE(v.toBool(), st == QCborSimpleType::True);
+ if (st == QCborSimpleType::Undefined)
+ QCOMPARE(v.toSimpleType(QCborSimpleType::Null), QCborSimpleType::Undefined);
+ else if (isSimpleType)
+ QCOMPARE(v.toSimpleType(), st);
+ else
+ QCOMPARE(v.toSimpleType(), QCborSimpleType::Undefined);
+
+#define CMP(expr, T, validexpr) \
+ if (expectedValue.userType() == qMetaTypeId<T>()) \
+ QCOMPARE(expr, expectedValue.value<T>()); \
+ else \
+ QVERIFY(validexpr)
+ CMP(v.toByteArray(), QByteArray, v.toByteArray().isNull());
+ CMP(v.toString(), QString, v.toString().isNull());
+ CMP(v.toDateTime(), QDateTime, !v.toDateTime().isValid());
+ CMP(v.toUrl(), QUrl, !v.toUrl().isValid());
+ CMP(v.toRegularExpression(), QRegularExpression, v.toRegularExpression().pattern().isNull());
+ CMP(v.toUuid(), QUuid, v.toUuid().isNull());
+#undef CMP
+
+ QVERIFY(v.toArray().isEmpty());
+ QVERIFY(v.toMap().isEmpty());
+
+ QVERIFY(v["Hello"].isUndefined());
+ QVERIFY(v[0].isUndefined());
+}
+
+void tst_QCborValue::basics()
+{
+ QFETCH(QCborValue::Type, type);
+ QFETCH(QCborValue, v);
+ QFETCH(QVariant, expectedValue);
+
+ basicTypeCheck(type, v, expectedValue);
+}
+
+void tst_QCborValue::tagged()
+{
+ QFETCH(QCborValue::Type, type);
+ QFETCH(QCborValue, v);
+ QFETCH(QVariant, expectedValue);
+
+ // make it tagged
+ QCborValue tagged(QCborKnownTags::Signature, v);
+ QVERIFY(tagged.isTag());
+ QCOMPARE(tagged.tag(), QCborTag(QCborKnownTags::Signature));
+
+ // shouldn't compare equal
+ QVERIFY(tagged != v);
+ QVERIFY(v != tagged);
+
+ // ensure we can reach the original value
+ basicTypeCheck(type, tagged.taggedValue(), expectedValue);
+ QVERIFY(tagged.taggedValue() == v);
+ QVERIFY(v == tagged.taggedValue());
+
+ // nested tagging should work too
+ QCborValue tagged2(QCborKnownTags::EncodedCbor, tagged);
+ QVERIFY(tagged2.isTag());
+ QCOMPARE(tagged2.tag(), QCborTag(QCborKnownTags::EncodedCbor));
+
+ QVERIFY(tagged2 != tagged);
+ QVERIFY(tagged != tagged2);
+
+ QVERIFY(tagged2.taggedValue() == tagged);
+ QVERIFY(tagged == tagged2.taggedValue());
+ QVERIFY(tagged2.taggedValue().taggedValue() == v);
+ QVERIFY(v == tagged2.taggedValue().taggedValue());
+}
+
+void tst_QCborValue::extendedTypes_data()
+{
+ QTest::addColumn<QCborValue>("extended");
+ QTest::addColumn<QCborValue>("tagged");
+ QDateTime dt = QDateTime::currentDateTimeUtc();
+ QUuid uuid = QUuid::createUuid();
+
+ QTest::newRow("DateTime") << QCborValue(dt)
+ << QCborValue(QCborKnownTags::DateTimeString, dt.toString(Qt::ISODateWithMs));
+ QTest::newRow("Url:Empty") << QCborValue(QUrl())
+ << QCborValue(QCborKnownTags::Url, QString());
+ QTest::newRow("Url:Authority") << QCborValue(QUrl("https://example.com"))
+ << QCborValue(QCborKnownTags::Url, "https://example.com");
+ QTest::newRow("Url:Path") << QCborValue(QUrl("file:///tmp/none"))
+ << QCborValue(QCborKnownTags::Url, "file:///tmp/none");
+ QTest::newRow("Url:QueryFragment") << QCborValue(QUrl("whatever:?a=b&c=d#e"))
+ << QCborValue(QCborKnownTags::Url, "whatever:?a=b&c=d#e");
+ QTest::newRow("Regex:Empty") << QCborValue(QRegularExpression())
+ << QCborValue(QCborKnownTags::RegularExpression, QString());
+ QTest::newRow("Regex") << QCborValue(QRegularExpression("^.*$"))
+ << QCborValue(QCborKnownTags::RegularExpression, QString("^.*$"));
+ QTest::newRow("Uuid") << QCborValue(uuid)
+ << QCborValue(QCborKnownTags::Uuid, uuid.toRfc4122());
+}
+
+void tst_QCborValue::extendedTypes()
+{
+ QFETCH(QCborValue, extended);
+ QFETCH(QCborValue, tagged);
+ QVERIFY(extended.isTag());
+ QVERIFY(tagged.isTag());
+ QVERIFY(extended == tagged);
+ QVERIFY(tagged == extended);
+
+ QCOMPARE(extended.tag(), tagged.tag());
+ QCOMPARE(extended.taggedValue(), tagged.taggedValue());
+}
+
+void tst_QCborValue::copyCompare()
+{
+ QFETCH(QCborValue, v);
+ QCborValue other = v;
+ other = v;
+ v = other;
+
+ QCOMPARE(v.compare(other), 0);
+ QCOMPARE(v, other);
+ QVERIFY(!(v != other));
+ QVERIFY(!(v < other));
+#if 0 && QT_HAS_INCLUDE(<compare>)
+ QVERIFY(v <= other);
+ QVERIFY(v >= other);
+ QVERIFY(!(v > other));
+#endif
+
+ if (v.isUndefined())
+ other = nullptr;
+ else
+ other = {};
+ QVERIFY(v.type() != other.type());
+ QVERIFY(!(v == other));
+ QVERIFY(v != other);
+
+ // they're different types, so they can't compare equal
+ QVERIFY(v.compare(other) != 0);
+ QVERIFY((v < other) || (other < v));
+}
+
+void tst_QCborValue::arrayDefaultInitialization()
+{
+ QCborArray a;
+ QVERIFY(a.isEmpty());
+ QCOMPARE(a.size(), 0);
+ QVERIFY(!a.contains(0));
+ QVERIFY(!a.contains(-1));
+ QVERIFY(!a.contains(false));
+ QVERIFY(!a.contains(true));
+ QVERIFY(!a.contains(nullptr));
+ QVERIFY(!a.contains({}));
+ QVERIFY(!a.contains(1.0));
+ QVERIFY(!a.contains(QByteArray("Hello")));
+ QVERIFY(!a.contains("Hello"));
+ QVERIFY(!a.contains(QCborArray()));
+ QVERIFY(!a.contains(QCborMap()));
+ QVERIFY(!a.contains(QCborValue(QDateTime::currentDateTimeUtc())));
+ QVERIFY(!a.contains(QCborValue(QUrl("http://example.com"))));
+ QVERIFY(!a.contains(QCborValue(QUuid::createUuid())));
+
+ QVERIFY(a.at(0).isUndefined());
+ QCOMPARE(a.constBegin(), a.constEnd());
+
+ QVERIFY(a == a);
+ QVERIFY(a == QCborArray());
+ QVERIFY(QCborArray() == a);
+
+ QCborValue v(a);
+ QVERIFY(v.isArray());
+ QVERIFY(!v.isMap());
+ QVERIFY(!v.isTag());
+ QVERIFY(v[0].isUndefined());
+
+ QCborArray a2 = v.toArray();
+ QVERIFY(a2.isEmpty());
+ QCOMPARE(a2, a);
+}
+
+void tst_QCborValue::mapDefaultInitialization()
+{
+ QCborMap m;
+ QVERIFY(m.isEmpty());
+ QCOMPARE(m.size(), 0);
+ QVERIFY(m.keys().isEmpty());
+ QVERIFY(!m.contains(0));
+ QVERIFY(!m.contains(-1));
+ QVERIFY(!m.contains(false));
+ QVERIFY(!m.contains(true));
+ QVERIFY(!m.contains(QCborValue::Null));
+ QVERIFY(!m.contains({}));
+ QVERIFY(!m.contains(1.0));
+ QVERIFY(!m.contains(QLatin1String("Hello")));
+ QVERIFY(!m.contains(QStringLiteral("Hello")));
+ QVERIFY(!m.contains(QCborValue(QByteArray("Hello"))));
+ QVERIFY(!m.contains(QCborArray()));
+ QVERIFY(!m.contains(QCborMap()));
+ QVERIFY(!m.contains(QCborValue(QDateTime::currentDateTimeUtc())));
+ QVERIFY(!m.contains(QCborValue(QUrl("http://example.com"))));
+ QVERIFY(!m.contains(QCborValue(QUuid::createUuid())));
+
+ QVERIFY(m.value(0).isUndefined());
+ QVERIFY(m.value(QLatin1String("Hello")).isUndefined());
+ QVERIFY(m.value(QStringLiteral("Hello")).isUndefined());
+ QVERIFY(m.value(QCborValue()).isUndefined());
+#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
+ QVERIFY(m.value("Hello").isUndefined());
+#endif
+
+ QVERIFY(m == m);
+ QVERIFY(m == QCborMap{});
+ QVERIFY(QCborMap{} == m);
+
+ QCborValue v(m);
+ QVERIFY(v.isMap());
+ QVERIFY(!v.isArray());
+ QVERIFY(!v.isTag());
+ QVERIFY(v[0].isUndefined());
+ QVERIFY(v[QLatin1String("Hello")].isUndefined());
+ QVERIFY(v["Hello"].isUndefined());
+
+ QCborMap m2 = v.toMap();
+ QVERIFY(m2.isEmpty());
+ QCOMPARE(m2.size(), 0);
+ QCOMPARE(m2, m);
+}
+
+void tst_QCborValue::arrayEmptyInitializerList()
+{
+ QCborArray a{};
+ QVERIFY(a.isEmpty());
+ QCOMPARE(a.size(), 0);
+ QVERIFY(a == a);
+ QVERIFY(a == QCborArray());
+ QVERIFY(QCborArray() == a);
+}
+
+void tst_QCborValue::mapEmptyInitializerList()
+{
+ QCborMap m{};
+ QVERIFY(m.isEmpty());
+ QCOMPARE(m.size(), 0);
+ QVERIFY(m == m);
+ QVERIFY(m == QCborMap{});
+ QVERIFY(QCborMap{} == m);
+}
+
+void tst_QCborValue::arrayEmptyDetach()
+{
+ QCborArray a;
+ QCOMPARE(a.begin(), a.end());
+ QVERIFY(a.isEmpty());
+ QCOMPARE(a.size(), 0);
+
+ QVERIFY(a == a);
+ QVERIFY(a == QCborArray());
+ QVERIFY(QCborArray() == a);
+
+ QCborValue v(a);
+ QVERIFY(v.isArray());
+ QVERIFY(!v.isMap());
+ QVERIFY(!v.isTag());
+
+ QCborArray a2 = v.toArray();
+ QVERIFY(a2.isEmpty());
+ QCOMPARE(a2, a);
+}
+
+void tst_QCborValue::mapEmptyDetach()
+{
+ QCborMap m;
+ QCOMPARE(m.begin(), m.end());
+ QVERIFY(m.isEmpty());
+ QCOMPARE(m.size(), 0);
+
+ QVERIFY(m == m);
+ QVERIFY(m == QCborMap{});
+ QVERIFY(QCborMap{} == m);
+
+ QCborValue v(m);
+ QVERIFY(v.isMap());
+ QVERIFY(!v.isArray());
+ QVERIFY(!v.isTag());
+
+ QCborMap m2 = v.toMap();
+ QVERIFY(m2.isEmpty());
+ QCOMPARE(m2, m);
+}
+
+void tst_QCborValue::arrayInitializerList()
+{
+ QCborArray a{0, -1, false, true, nullptr, {}, 1.0};
+ QVERIFY(!a.isEmpty());
+ QCOMPARE(a.size(), 7);
+ QCOMPARE(a.at(0), QCborValue(0));
+ QCOMPARE(a.at(1), QCborValue(-1));
+ QCOMPARE(a.at(2), QCborValue(QCborValue::False));
+ QCOMPARE(a.at(3), QCborValue(QCborValue::True));
+ QCOMPARE(a.at(4), QCborValue(QCborValue::Null));
+ QCOMPARE(a.at(5), QCborValue(QCborValue::Undefined));
+ QCOMPARE(a.at(6), QCborValue(1.0));
+
+ QVERIFY(a == a);
+ QVERIFY(a != QCborArray{});
+ QVERIFY(QCborArray{} != a);
+ QVERIFY(a == QCborArray({0, -1, false, true, nullptr, {}, 1.0}));
+
+ QCborValue v = a;
+ QCOMPARE(v[0], QCborValue(0));
+ QCOMPARE(v[1], QCborValue(-1));
+ QCOMPARE(v[2], QCborValue(QCborValue::False));
+ QCOMPARE(v[3], QCborValue(QCborValue::True));
+ QCOMPARE(v[4], QCborValue(QCborValue::Null));
+ QCOMPARE(v[5], QCborValue(QCborValue::Undefined));
+ QCOMPARE(v[6], QCborValue(1.0));
+
+ QVERIFY(a.contains(0));
+ QVERIFY(a.contains(-1));
+ QVERIFY(a.contains(false));
+ QVERIFY(a.contains(true));
+ QVERIFY(a.contains(nullptr));
+ QVERIFY(a.contains({}));
+ QVERIFY(a.contains(1.0));
+ QVERIFY(!a.contains(QByteArray("Hello")));
+ QVERIFY(!a.contains("Hello"));
+ QVERIFY(!a.contains(QCborArray()));
+ QVERIFY(!a.contains(QCborMap()));
+ QVERIFY(!a.contains(QCborValue(QDateTime::currentDateTimeUtc())));
+ QVERIFY(!a.contains(QCborValue(QUrl("http://example.com"))));
+ QVERIFY(!a.contains(QCborValue(QUuid::createUuid())));
+
+ // iterators
+ auto it = a.constBegin();
+ auto end = a.constEnd();
+ QCOMPARE(end - it, 7);
+ QCOMPARE(it + 7, end);
+ QVERIFY(it->isInteger());
+ QCOMPARE(*it, QCborValue(0));
+ QCOMPARE(it[1], QCborValue(-1));
+ QCOMPARE(*(it + 2), QCborValue(false));
+ it += 3;
+ QCOMPARE(*it, QCborValue(true));
+ ++it;
+ QCOMPARE(*it, QCborValue(nullptr));
+ it++;
+ QCOMPARE(*it, QCborValue());
+ --end;
+ QCOMPARE(*end, QCborValue(1.0));
+ end--;
+ QCOMPARE(it, end);
+
+ // range for
+ int i = 0;
+ for (const QCborValue &v : qAsConst(a)) {
+ QVERIFY(!v.isInvalid());
+ QCOMPARE(v.isUndefined(), i == 5); // 6th element is Undefined
+ ++i;
+ }
+ QCOMPARE(i, a.size());
+}
+
+void tst_QCborValue::mapSimpleInitializerList()
+{
+ QCborMap m{{0, 0}, {1, 0}, {2, "Hello"}, {"Hello", 2}, {3, QLatin1String("World")}, {QLatin1String("World"), 3}};
+ QCOMPARE(m.size(), 6);
+ QVERIFY(m == m);
+ QVERIFY(m != QCborMap{});
+ QVERIFY(QCborMap{} != m);
+ QVERIFY(m == QCborMap({{0, 0}, {1, 0}, {2, "Hello"}, {"Hello", 2}, {3, QLatin1String("World")}, {QLatin1String("World"), 3}}));
+
+ QCborValue vmap = m;
+ {
+ QVERIFY(m.contains(0));
+ QCborValue v = m.value(0);
+ QVERIFY(v.isInteger());
+ QCOMPARE(v.toInteger(), 0);
+ QCOMPARE(vmap[0], v);
+ }
+ {
+ QVERIFY(m.contains(1));
+ QCborValue v = m.value(1);
+ QVERIFY(v.isInteger());
+ QCOMPARE(v.toInteger(), 0);
+ QCOMPARE(vmap[1], v);
+ }
+ {
+ QVERIFY(m.contains(2));
+ QCborValue v = m.value(2);
+ QVERIFY(v.isString());
+ QCOMPARE(v.toString(), "Hello");
+ QCOMPARE(vmap[2], v);
+ }
+ {
+ QVERIFY(m.contains(3));
+ QCborValue v = m.value(3);
+ QVERIFY(v.isString());
+ QCOMPARE(v.toString(), "World");
+ QCOMPARE(vmap[3], v);
+ }
+ {
+ QVERIFY(m.contains(QStringLiteral("Hello")));
+ QCborValue v = m.value(QLatin1String("Hello"));
+ QVERIFY(v.isInteger());
+ QCOMPARE(v.toInteger(), 2);
+ QCOMPARE(vmap[QStringLiteral("Hello")], v);
+ }
+ {
+ QVERIFY(m.contains(QLatin1String("World")));
+ QCborValue v = m.value(QStringLiteral("World"));
+ QVERIFY(v.isInteger());
+ QCOMPARE(v.toInteger(), 3);
+ QCOMPARE(vmap[QLatin1String("World")], v);
+ }
+
+ QVERIFY(!m.contains(QCborValue::Null));
+ QVERIFY(!m.contains(QCborValue()));
+ QVERIFY(!m.contains(QCborValue(1.0))); // Important: 1.0 does not match 1
+ QVERIFY(!m.contains(QCborValue(QByteArray("Hello"))));
+ QVERIFY(!m.contains(QCborArray()));
+ QVERIFY(!m.contains(QCborMap()));
+ QVERIFY(!m.contains(QCborValue(QDateTime::currentDateTimeUtc())));
+ QVERIFY(!m.contains(QCborValue(QUrl("http://example.com"))));
+ QVERIFY(!m.contains(QCborValue(QUuid::createUuid())));
+
+ // iterators (QCborMap is not sorted)
+ auto it = m.constBegin();
+ auto end = m.constEnd();
+ QCOMPARE(end - it, 6);
+ QCOMPARE(it + 6, end);
+ QCOMPARE(it.key(), QCborValue(0));
+ QCOMPARE(it.value(), QCborValue(0));
+ QVERIFY(it->isInteger());
+ ++it;
+ QCOMPARE(it.key(), QCborValue(1));
+ QCOMPARE(it.value(), QCborValue(0));
+ QCOMPARE((it + 1).key(), QCborValue(2));
+ QVERIFY((it + 1)->isString());
+ QCOMPARE((it + 1)->toString(), "Hello");
+ it += 2;
+ QCOMPARE(it.key(), QCborValue("Hello"));
+ QVERIFY(it->isInteger());
+ it++;
+ QCOMPARE(it.key(), QCborValue(3));
+ QVERIFY(it->isString());
+ QCOMPARE(it.value().toString(), "World");
+ --end;
+ QCOMPARE(end.key(), QCborValue("World"));
+ QCOMPARE(end.value(), QCborValue(3));
+ end--;
+ QCOMPARE(it, end);
+
+ // range for
+ int i = 0;
+ for (auto pair : qAsConst(m)) {
+ QVERIFY(!pair.first.isUndefined());
+ QVERIFY(!pair.second.isUndefined());
+ ++i;
+ }
+ QCOMPARE(i, m.size());
+}
+
+void tst_QCborValue::arrayMutation()
+{
+ QCborArray a{42};
+ {
+ QCborValueRef v = a[0];
+ QVERIFY(!a.isEmpty());
+ QVERIFY(v.isInteger());
+ QCOMPARE(v.toInteger(), 42);
+
+ // now mutate the list
+ v = true;
+ QVERIFY(v.isBool());
+ QVERIFY(v.isTrue());
+ QVERIFY(a.at(0).isTrue());
+ QVERIFY(a.at(0) == v);
+ QVERIFY(v == a.at(0));
+ }
+
+ QVERIFY(a == a);
+ QVERIFY(a == QCborArray{true});
+
+ QCborArray a2 = a;
+ a.append(nullptr);
+ QCOMPARE(a.size(), 2);
+ QCOMPARE(a2.size(), 1);
+
+ // self-insertion
+ a2.append(a2);
+ QCOMPARE(a2.size(), 2);
+ QCOMPARE(a2.last().toArray().size(), 1);
+
+ QCborValueRef v = a[0];
+ QVERIFY(v.isTrue());
+ v = 2.5;
+ QVERIFY(v.isDouble());
+ QVERIFY(a.first().isDouble());
+ QVERIFY(a.last().isNull());
+ QVERIFY(a2.first().isTrue());
+
+ a2 = a;
+ auto it = a.begin(); // detaches again
+ auto end = a.end();
+ QCOMPARE(end - it, 2);
+ QCOMPARE(it + 2, end);
+ QCOMPARE(*it, QCborValue(2.5));
+ QCOMPARE(*++it, QCborValue(nullptr));
+ QVERIFY(a2 == a);
+ QVERIFY(a == a2);
+
+ *it = -1;
+ QCOMPARE(*it, QCborValue(-1));
+ QCOMPARE(a.at(1), QCborValue(-1));
+ QCOMPARE(a2.at(1), QCborValue(nullptr));
+ QCOMPARE(++it, end);
+}
+
+void tst_QCborValue::mapMutation()
+{
+ QCborMap m;
+ QVERIFY(m.isEmpty());
+
+ {
+ QCborValueRef v = m[42];
+ QCOMPARE(m.size(), 1);
+ QVERIFY(v.isUndefined());
+
+ // now mutate the list
+ v = true;
+ QVERIFY(v.isBool());
+ QVERIFY(v.isTrue());
+ QVERIFY(m.begin()->isTrue());
+ QVERIFY(m.begin().value() == v);
+ QVERIFY(v == m.begin().value());
+ }
+
+ QVERIFY(m == QCborMap({{42, true}}));
+ QVERIFY(QCborMap({{42, true}}) == m);
+
+ QCborMap m2 = m;
+ m.insert({nullptr, nullptr});
+ QCOMPARE(m.size(), 2);
+ QCOMPARE(m2.size(), 1);
+
+ QCborValueRef v = m[42];
+ QVERIFY(v.isTrue());
+ v = 2.5;
+ QVERIFY(v.isDouble());
+ QVERIFY(m.begin()->isDouble());
+ QVERIFY((m.end() - 1)->isNull());
+ QVERIFY(m2.begin()->isTrue());
+
+ m2 = m;
+ auto it = m.begin(); // detaches again
+ auto end = m.end();
+ QCOMPARE(end - it, 2);
+ QCOMPARE(it + 2, end);
+ QCOMPARE(it.key(), QCborValue(42));
+ QCOMPARE(it.value(), QCborValue(2.5));
+ QCOMPARE((++it).value(), QCborValue(nullptr));
+ QCOMPARE(it.key(), QCborValue(nullptr));
+ QVERIFY(m2 == m);
+ QVERIFY(m == m2);
+
+ it.value() = -1;
+ QCOMPARE(it.key(), QCborValue(nullptr));
+ QCOMPARE(it.value(), QCborValue(-1));
+ QCOMPARE((m.end() - 1)->toInteger(), -1);
+ QVERIFY((m2.end() - 1)->isNull());
+ QCOMPARE(++it, end);
+}
+
+void tst_QCborValue::arrayPrepend()
+{
+ QCborArray a;
+ a.prepend(0);
+ a.prepend(nullptr);
+ QCOMPARE(a.at(1), QCborValue(0));
+ QCOMPARE(a.at(0), QCborValue(nullptr));
+ QCOMPARE(a.size(), 2);
+}
+
+void tst_QCborValue::arrayInsertRemove()
+{
+ QFETCH(QCborValue, v);
+ QCborArray a;
+ a.append(42);
+ a.append(v);
+ a.insert(1, QCborValue(nullptr));
+ QCOMPARE(a.at(0), QCborValue(42));
+ QCOMPARE(a.at(1), QCborValue(nullptr));
+ QCOMPARE(a.at(2), v);
+
+ // remove 42
+ a.removeAt(0);
+ QCOMPARE(a.size(), 2);
+ QCOMPARE(a.at(0), QCborValue(nullptr));
+ QCOMPARE(a.at(1), v);
+
+ auto it = a.begin();
+ it = a.erase(it); // removes nullptr
+ QCOMPARE(a.size(), 1);
+ QCOMPARE(a.at(0), v);
+
+ it = a.erase(it);
+ QVERIFY(a.isEmpty());
+ QCOMPARE(it, a.end());
+
+ // reinsert the element so we can take it
+ a.append(v);
+ QCOMPARE(a.takeAt(0), v);
+ QVERIFY(a.isEmpty());
+}
+
+void tst_QCborValue::arrayStringElements()
+{
+ QCborArray a{"Hello"};
+ a.append(QByteArray("Hello"));
+ a.append(QLatin1String("World"));
+ QVERIFY(a == a);
+ QVERIFY(a == QCborArray({QLatin1String("Hello"),
+ QByteArray("Hello"), QStringLiteral("World")}));
+
+ QCborValueRef r1 = a[0];
+ QCOMPARE(r1.toString(), "Hello");
+ QCOMPARE(r1.operator QCborValue(), QCborValue("Hello"));
+ QVERIFY(r1 == QCborValue("Hello"));
+
+ QCborValue v2 = a.at(1);
+ QCOMPARE(v2.toByteArray(), QByteArray("Hello"));
+ QCOMPARE(v2, QCborValue(QByteArray("Hello")));
+
+ // v2 must continue to be valid after the entry getting removed
+ a.removeAt(1);
+ QCOMPARE(v2.toByteArray(), QByteArray("Hello"));
+ QCOMPARE(v2, QCborValue(QByteArray("Hello")));
+
+ v2 = a.at(1);
+ QCOMPARE(v2.toString(), "World");
+ QCOMPARE(v2, QCborValue("World"));
+
+ QCOMPARE(a.takeAt(1).toString(), "World");
+ QCOMPARE(a.takeAt(0).toString(), "Hello");
+ QVERIFY(a.isEmpty());
+}
+
+void tst_QCborValue::mapStringValues()
+{
+ QCborMap m{{0, "Hello"}};
+ m.insert({1, QByteArray("Hello")});
+ m.insert({2, QLatin1String("World")});
+ QVERIFY(m == m);
+
+ QCborValueRef r1 = m[0];
+ QCOMPARE(r1.toString(), "Hello");
+ QCOMPARE(r1.operator QCborValue(), QCborValue("Hello"));
+ QVERIFY(r1 == QCborValue("Hello"));
+
+ QCborValue v2 = m.value(1);
+ QCOMPARE(v2.toByteArray(), QByteArray("Hello"));
+ QCOMPARE(v2, QCborValue(QByteArray("Hello")));
+
+ // v2 must continue to be valid after the entry getting removed
+ m.erase(m.constFind(1));
+ QCOMPARE(v2.toByteArray(), QByteArray("Hello"));
+ QCOMPARE(v2, QCborValue(QByteArray("Hello")));
+
+ v2 = (m.begin() + 1).value();
+ QCOMPARE(v2.toString(), "World");
+ QCOMPARE(v2, QCborValue("World"));
+
+ QCOMPARE(m.extract(m.begin() + 1).toString(), "World");
+ QCOMPARE(m.take(0).toString(), "Hello");
+ QVERIFY(m.isEmpty());
+}
+
+void tst_QCborValue::mapStringKeys()
+{
+ QCborMap m{{QLatin1String("Hello"), 1}, {QStringLiteral("World"), 2}};
+ QCOMPARE(m.value(QStringLiteral("Hello")), QCborValue(1));
+ QCOMPARE(m.value(QLatin1String("World")), QCborValue(2));
+
+ QCborMap m2 = m;
+ QVERIFY(m2 == m);
+ QVERIFY(m == m2);
+
+ m.insert({QByteArray("foo"), "bar"});
+ QCOMPARE(m.size(), 3);
+ QCOMPARE(m2.size(), 2);
+ QVERIFY(m2 != m);
+ QVERIFY(m != m2);
+
+ QVERIFY(m2.value(QCborValue(QByteArray("foo"))).isUndefined());
+ QVERIFY(m.value(QCborValue(QLatin1String("foo"))).isUndefined());
+ QCOMPARE(m.value(QCborValue(QByteArray("foo"))).toString(), "bar");
+}
+
+void tst_QCborValue::mapInsertRemove()
+{
+ QFETCH(QCborValue, v);
+ QCborMap m{{1, v}};
+
+ m.remove(1);
+ QVERIFY(m.isEmpty());
+ QVERIFY(!m.contains(1));
+
+ m.insert(2, v);
+ QVERIFY(m.contains(2));
+ QVERIFY(m[2] == v);
+ QVERIFY(v == m[2]);
+
+ auto it = m.find(2);
+ it = m.erase(it);
+ QVERIFY(m.isEmpty());
+
+ // creates m[2] and m[42] just by referencing them
+ m[2];
+ QCborValueRef r = m[42];
+ QCOMPARE(m.size(), 2);
+
+ r = v;
+ it = m.find(42);
+ QVERIFY(it.value() == v);
+ QVERIFY(v == it.value());
+ QVERIFY(it.value() == r);
+ QVERIFY(r == it.value());
+
+ QCOMPARE(m.extract(it), v);
+ QVERIFY(!m.contains(42));
+
+ m[2] = v;
+ QCOMPARE(m.take(2), v);
+ QVERIFY(m.take(2).isUndefined());
+ QVERIFY(m.isEmpty());
+}
+
+void tst_QCborValue::arrayInsertTagged()
+{
+ QFETCH(QCborValue, v);
+
+ // make it tagged
+ QCborValue tagged(QCborKnownTags::Signature, v);
+
+ QCborArray a{tagged};
+ a.insert(1, tagged);
+ QCOMPARE(a.size(), 2);
+ QCOMPARE(a.at(0), tagged);
+ QCOMPARE(a.at(1), tagged);
+ QCOMPARE(a.at(0).taggedValue(), v);
+ QCOMPARE(a.at(1).taggedValue(), v);
+ QCOMPARE(a.takeAt(0).taggedValue(), v);
+ QCOMPARE(a.takeAt(0).taggedValue(), v);
+ QVERIFY(a.isEmpty());
+}
+
+void tst_QCborValue::mapInsertTagged()
+{
+ QFETCH(QCborValue, v);
+
+ // make it tagged
+ QCborValue tagged(QCborKnownTags::Signature, v);
+
+ QCborMap m{{11, tagged}};
+ m.insert({-21, tagged});
+ QCOMPARE(m.size(), 2);
+ QCOMPARE(m.constBegin().value(), tagged);
+ QCOMPARE(m.value(-21), tagged);
+ QCOMPARE(m.value(11).taggedValue(), v);
+ QCOMPARE((m.end() - 1).value().taggedValue(), v);
+ QCOMPARE(m.extract(m.end() - 1).taggedValue(), v);
+ QVERIFY(!m.contains(-21));
+ QCOMPARE(m.take(11).taggedValue(), v);
+ QVERIFY(m.isEmpty());
+}
+
+void tst_QCborValue::arraySelfAssign()
+{
+ QFETCH(QCborValue, v);
+ QCborArray a;
+
+ a = {v};
+
+ // Test 1: QCborValue created first, so
+ // QCborArray::insert() detaches
+ {
+ a.append(a);
+ QCOMPARE(a.size(), 2);
+ QCOMPARE(a.last().toArray().size(), 1);
+ }
+
+ a = {v};
+
+ // Test 2: QCborValueRef created first
+ {
+ a.append(36);
+ auto it = a.end() - 1;
+ *it = a;
+
+ QCOMPARE(a.size(), 2);
+ QCOMPARE(it->toArray().size(), 2);
+ QCOMPARE(it->toArray().last(), QCborValue(36));
+ }
+}
+
+void tst_QCborValue::mapSelfAssign()
+{
+ QFETCH(QCborValue, v);
+ QCborMap m;
+
+ m = {{0, v}};
+ QCOMPARE(m.size(), 1);
+
+ // Test 1: create a QCborValue first
+ // in this case, QCborMap::operator[] detaches first
+ {
+ QCborValue vm = m;
+ m[1] = vm; // self-assign
+ QCOMPARE(m.size(), 2);
+ QCOMPARE(m.value(0), v);
+
+ QCborMap m2 = m.value(1).toMap();
+ // there mustn't be an element with key 1
+ QCOMPARE(m2.size(), 1);
+ QCOMPARE(m2.value(0), v);
+ QVERIFY(!m2.contains(1));
+ }
+
+ m = {{0, v}};
+
+ // Test 2: create the QCborValueRef first
+ // in this case, there's no opportunity to detach
+ {
+ QCborValueRef rv = m[1];
+ rv = m; // self-assign (implicit QCborValue creation)
+ QCOMPARE(m.size(), 2);
+ QCOMPARE(m.value(0), v);
+
+ QCborMap m2 = m.value(1).toMap();
+ // there must be an element with key 1
+ QCOMPARE(m2.size(), 2);
+ QCOMPARE(m2.value(0), v);
+ QVERIFY(m2.contains(1));
+ QCOMPARE(m2.value(1), QCborValue());
+ }
+
+ m = {{0, v}};
+
+ // Test 3: don't force creation of either before
+ // in this case, it's up to the compiler to choose
+ {
+ m[1] = m; // self-assign
+ QCOMPARE(m.size(), 2);
+
+ QCborMap m2 = m.value(1).toMap();
+ QVERIFY(m2.size() == 1 || m2.size() == 2);
+ }
+
+ m = {{0, v}};
+
+ // Test 4: self-assign as key
+ // in this scase, QCborMap::operator[] must detach
+ {
+ m[m] = v;
+ QCOMPARE(m.size(), 2);
+
+ auto it = m.constEnd() - 1;
+ QCOMPARE(it.value(), v);
+ QCOMPARE(it.key(), QCborMap({{0, v}}));
+ }
+}
+
+void tst_QCborValue::mapComplexKeys()
+{
+ QFETCH(QCborValue, v);
+ QCborValue tagged(QCborKnownTags::Signature, v);
+
+ QCborMap m{{42, true}, {v, 42}, {-3, nullptr}};
+ QCOMPARE(m.size(), 3);
+ QVERIFY(m.contains(42));
+ QVERIFY(m.contains(-3));
+ QVERIFY(m.contains(v));
+ QVERIFY(!m.contains(tagged));
+
+ auto it = m.constFind(v);
+ QVERIFY(it != m.constEnd());
+ QVERIFY(it.key() == v);
+ QVERIFY(v == it.key());
+ QCOMPARE(it.value().toInteger(), 42);
+
+ QCborArray a{0, 1, 2, 3, v};
+ m[a] = 1;
+ QCOMPARE(m.size(), 4);
+ QCOMPARE((m.constEnd() - 1).value(), QCborValue(1));
+ if (v != QCborValue(QCborValue::Array))
+ QVERIFY(!m.contains(QCborArray{}));
+ QVERIFY(!m.contains(QCborArray{0}));
+ QVERIFY(!m.contains(QCborArray{0, 1}));
+ QVERIFY(!m.contains(QCborArray{0, 1, 2}));
+ QVERIFY(!m.contains(QCborArray{0, 1, 2, 4}));
+ QVERIFY(!m.contains(QCborArray{0, 1, 2, 3, v, 4}));
+
+ it = m.constFind(QCborArray{0, 1, 2, 3, v});
+ QVERIFY(it != m.constEnd());
+ QCOMPARE(it.key(), a);
+ QCOMPARE(it.value(), QCborValue(1));
+
+ m[m] = 1; // assign itself as a key -- this necessarily detaches before
+ QCOMPARE(m.size(), 5);
+ QCOMPARE((m.end() - 1).value(), 1);
+ QCOMPARE((m.end() - 1).key().toMap().size(), 4);
+
+ QCborValue mv(m);
+ if (v.isInteger()) {
+ // we should be able to find using the overloads too
+ QCOMPARE(m[v.toInteger()].toInteger(), 42);
+ QCOMPARE(mv[v.toInteger()].toInteger(), 42);
+ } else if (v.isString()) {
+ // ditto
+ QCOMPARE(m[v.toString()].toInteger(), 42);
+ QCOMPARE(mv[v.toString()].toInteger(), 42);
+
+ // basics_data() strings are Latin1
+ QByteArray latin1 = v.toString().toLatin1();
+ Q_ASSERT(v.toString() == QString::fromLatin1(latin1));
+ QCOMPARE(m[QLatin1String(latin1)].toInteger(), 42);
+ }
+
+ m.remove(v);
+ QVERIFY(!m.contains(v));
+ QVERIFY(!m.contains(tagged));
+
+ QCborValueRef r = m[tagged];
+ QVERIFY(!m.contains(v));
+ QVERIFY(m.contains(tagged));
+ r = 47;
+ QCOMPARE(m[tagged].toInteger(), 47);
+ QCOMPARE(m.take(tagged).toInteger(), 47);
+ QVERIFY(!m.contains(tagged));
+}
+
+void tst_QCborValue::sorting()
+{
+ QCborValue vundef, vnull(nullptr);
+ QCborValue vtrue(true), vfalse(false);
+ QCborValue vint1(1), vint2(2);
+ QCborValue vneg1(-1), vneg2(-2);
+ QCborValue vba2(QByteArray("Hello")), vba3(QByteArray("World")), vba1(QByteArray("foo"));
+ QCborValue vs2("Hello"), vs3("World"), vs1("foo");
+ QCborValue va1(QCborValue::Array), va2(QCborArray{1}), va3(QCborArray{0, 0});
+ QCborValue vm1(QCborValue::Map), vm2(QCborMap{{1, 0}}), vm3(QCborMap{{0, 0}, {1, 0}});
+ QCborValue vdt1(QDateTime::fromMSecsSinceEpoch(0, Qt::UTC)), vdt2(QDateTime::currentDateTimeUtc());
+ QCborValue vtagged1(QCborKnownTags::UnixTime_t, 0), vtagged2(QCborKnownTags::UnixTime_t, 0.0),
+ vtagged3(QCborKnownTags::Signature, 0), vtagged4(QCborTag(-2), 0), vtagged5(QCborTag(-1), 0);
+ QCborValue vurl1(QUrl("https://example.net")), vurl2(QUrl("https://example.com/"));
+ QCborValue vuuid1{QUuid()}, vuuid2(QUuid::createUuid());
+ QCborValue vsimple1(QCborSimpleType(1)), vsimple32(QCborSimpleType(32)), vsimple255(QCborSimpleType(255));
+ QCborValue vdouble1(1.5), vdouble2(qInf());
+ QCborValue vndouble1(-1.5), vndouble2(-qInf());
+
+#define CHECK_ORDER(v1, v2) \
+ QVERIFY(v1 < v2); \
+ QVERIFY(!(v2 < v2))
+
+ // intra-type comparisons
+ CHECK_ORDER(vfalse, vtrue);
+ CHECK_ORDER(vsimple1, vsimple32);
+ CHECK_ORDER(vsimple32, vsimple255);
+ CHECK_ORDER(vint1, vint2);
+ CHECK_ORDER(vdouble1, vdouble2);
+ CHECK_ORDER(vndouble1, vndouble2);
+ // note: shorter length sorts first
+ CHECK_ORDER(vba1, vba2);
+ CHECK_ORDER(vba2, vba3);
+ CHECK_ORDER(vs1, vs2);
+ CHECK_ORDER(vs2, vs3);
+ CHECK_ORDER(va1, va2);
+ CHECK_ORDER(va2, va3);
+ CHECK_ORDER(vm1, vm2);
+ CHECK_ORDER(vm2, vm3);
+ CHECK_ORDER(vdt1, vdt2);
+ CHECK_ORDER(vtagged1, vtagged2);
+ CHECK_ORDER(vtagged2, vtagged3);
+ CHECK_ORDER(vtagged3, vtagged4);
+ CHECK_ORDER(vtagged4, vtagged5);
+ CHECK_ORDER(vurl1, vurl2);
+ CHECK_ORDER(vuuid1, vuuid2);
+
+ // surprise 1: CBOR sorts integrals by absolute value
+ CHECK_ORDER(vneg1, vneg2);
+
+ // surprise 2: CBOR sorts negatives after positives (sign+magnitude)
+ CHECK_ORDER(vint2, vneg1);
+ QVERIFY(vint2.toInteger() > vneg1.toInteger());
+ CHECK_ORDER(vdouble2, vndouble1);
+ QVERIFY(vdouble2.toDouble() > vndouble1.toDouble());
+
+ // inter-type comparisons
+ CHECK_ORDER(vneg2, vba1);
+ CHECK_ORDER(vba3, vs1);
+ CHECK_ORDER(vs3, va1);
+ CHECK_ORDER(va2, vm1);
+ CHECK_ORDER(vm2, vdt1);
+ CHECK_ORDER(vdt2, vtagged1);
+ CHECK_ORDER(vtagged2, vurl1);
+ CHECK_ORDER(vurl1, vuuid1);
+ CHECK_ORDER(vuuid2, vtagged3);
+ CHECK_ORDER(vtagged4, vsimple1);
+ CHECK_ORDER(vsimple1, vfalse);
+ CHECK_ORDER(vtrue, vnull);
+ CHECK_ORDER(vnull, vundef);
+ CHECK_ORDER(vundef, vsimple32);
+ CHECK_ORDER(vsimple255, vdouble1);
+
+ // which shows all doubles sorted after integrals
+ CHECK_ORDER(vint2, vdouble1);
+ QVERIFY(vint2.toInteger() > vdouble1.toDouble());
+#undef CHECK_ORDER
+}
+
+static void addCommonCborData()
+{
+ // valid for both decoding and encoding
+ QTest::addColumn<QCborValue>("v");
+ QTest::addColumn<QByteArray>("result");
+ QTest::addColumn<QCborValue::EncodingOptions>("options");
+ QDateTime dt = QDateTime::currentDateTimeUtc();
+ QUuid uuid = QUuid::createUuid();
+ QCborValue::EncodingOptions noxfrm = QCborValue::NoTransformation;
+
+ // integrals
+ QTest::newRow("Integer:0") << QCborValue(0) << raw("\x00") << noxfrm;
+ QTest::newRow("Integer:1") << QCborValue(1) << raw("\x01") << noxfrm;
+ QTest::newRow("Integer:-1") << QCborValue(-1) << raw("\x20") << noxfrm;
+ QTest::newRow("Integer:INT64_MAX") << QCborValue(std::numeric_limits<qint64>::max())
+ << raw("\x1b\x7f\xff\xff\xff""\xff\xff\xff\xff")
+ << noxfrm;
+ QTest::newRow("Integer:INT64_MIN") << QCborValue(std::numeric_limits<qint64>::min())
+ << raw("\x3b\x7f\xff\xff\xff""\xff\xff\xff\xff")
+ << noxfrm;
+
+ QTest::newRow("simple0") << QCborValue(QCborValue::SimpleType) << raw("\xe0") << noxfrm;
+ QTest::newRow("simple1") << QCborValue(QCborSimpleType(1)) << raw("\xe1") << noxfrm;
+ QTest::newRow("simple255") << QCborValue(QCborSimpleType(255)) << raw("\xf8\xff") << noxfrm;
+ QTest::newRow("Undefined") << QCborValue() << raw("\xf7") << noxfrm;
+ QTest::newRow("Null") << QCborValue(nullptr) << raw("\xf6") << noxfrm;
+ QTest::newRow("True") << QCborValue(true) << raw("\xf5") << noxfrm;
+ QTest::newRow("False") << QCborValue(false) << raw("\xf4") << noxfrm;
+ QTest::newRow("simple32") << QCborValue(QCborSimpleType(32)) << raw("\xf8\x20") << noxfrm;
+ QTest::newRow("simple255") << QCborValue(QCborSimpleType(255)) << raw("\xf8\xff") << noxfrm;
+
+ QTest::newRow("Double:0") << QCborValue(0.) << raw("\xfb\0\0\0\0""\0\0\0\0") << noxfrm;
+ QTest::newRow("Double:1.5") << QCborValue(1.5) << raw("\xfb\x3f\xf8\0\0""\0\0\0\0") << noxfrm;
+ QTest::newRow("Double:-1.5") << QCborValue(-1.5) << raw("\xfb\xbf\xf8\0\0""\0\0\0\0") << noxfrm;
+ QTest::newRow("Double:INT64_MAX+1") << QCborValue(std::numeric_limits<qint64>::max() + 1.)
+ << raw("\xfb\x43\xe0\0\0""\0\0\0\0") << noxfrm;
+ QTest::newRow("Double:maxintegralfp") << QCborValue(18446744073709551616.0 - 2048)
+ << raw("\xfb\x43\xef\xff\xff""\xff\xff\xff\xff")
+ << noxfrm;
+ QTest::newRow("Double:minintegralfp") << QCborValue(-18446744073709551616.0 + 2048)
+ << raw("\xfb\xc3\xef\xff\xff""\xff\xff\xff\xff")
+ << noxfrm;
+ QTest::newRow("Double:inf") << QCborValue(qInf()) << raw("\xfb\x7f\xf0\0\0""\0\0\0\0") << noxfrm;
+ QTest::newRow("Double:-inf") << QCborValue(-qInf()) << raw("\xfb\xff\xf0\0""\0\0\0\0\0") << noxfrm;
+ QTest::newRow("Double:nan") << QCborValue(qQNaN()) << raw("\xfb\x7f\xf8\0\0""\0\0\0\0") << noxfrm;
+
+ QTest::newRow("Float:0") << QCborValue(0.) << raw("\xfa\0\0\0\0") << QCborValue::EncodingOptions(QCborValue::UseFloat);
+ QTest::newRow("Float:1.5") << QCborValue(1.5) << raw("\xfa\x3f\xc0\0\0") << QCborValue::EncodingOptions(QCborValue::UseFloat);
+ QTest::newRow("Float:-1.5") << QCborValue(-1.5) << raw("\xfa\xbf\xc0\0\0") << QCborValue::EncodingOptions(QCborValue::UseFloat);
+ QTest::newRow("Float:inf") << QCborValue(qInf()) << raw("\xfa\x7f\x80\0\0") << QCborValue::EncodingOptions(QCborValue::UseFloat);
+ QTest::newRow("Float:-inf") << QCborValue(-qInf()) << raw("\xfa\xff\x80\0\0") << QCborValue::EncodingOptions(QCborValue::UseFloat);
+ QTest::newRow("Float:nan") << QCborValue(qQNaN()) << raw("\xfa\x7f\xc0\0\0") << QCborValue::EncodingOptions(QCborValue::UseFloat);
+
+ QTest::newRow("Float16:0") << QCborValue(0.) << raw("\xf9\0\0") << QCborValue::EncodingOptions(QCborValue::UseFloat16);
+ QTest::newRow("Float16:1.5") << QCborValue(1.5) << raw("\xf9\x3e\0") << QCborValue::EncodingOptions(QCborValue::UseFloat16);
+ QTest::newRow("Float16:-1.5") << QCborValue(-1.5) << raw("\xf9\xbe\0") << QCborValue::EncodingOptions(QCborValue::UseFloat16);
+ QTest::newRow("Float16:inf") << QCborValue(qInf()) << raw("\xf9\x7c\0") << QCborValue::EncodingOptions(QCborValue::UseFloat16);
+ QTest::newRow("Float16:-inf") << QCborValue(-qInf()) << raw("\xf9\xfc\0") << QCborValue::EncodingOptions(QCborValue::UseFloat16);
+ QTest::newRow("Float16:nan") << QCborValue(qQNaN()) << raw("\xf9\x7e\0") << QCborValue::EncodingOptions(QCborValue::UseFloat16);
+
+ // out of range of qint64, but in range for CBOR, so these do get converted
+ // to integrals on write and back to double on read
+ QTest::newRow("UseInteger:INT64_MAX+1") << QCborValue(std::numeric_limits<qint64>::max() + 1.)
+ << raw("\x1b\x80\0\0\0""\0\0\0\0")
+ << QCborValue::EncodingOptions(QCborValue::UseIntegers);
+ QTest::newRow("UseInteger:maxintegralfp") << QCborValue(18446744073709551616.0 - 2048)
+ << raw("\x1b\xff\xff\xff\xff""\xff\xff\xf8\0")
+ << QCborValue::EncodingOptions(QCborValue::UseIntegers);
+ QTest::newRow("UseInteger:minintegralfp") << QCborValue(-18446744073709551616.0 + 2048)
+ << raw("\x3b\xff\xff\xff\xff""\xff\xff\xf7\xff")
+ << QCborValue::EncodingOptions(QCborValue::UseIntegers);
+
+ QTest::newRow("ByteArray:Empty") << QCborValue(QByteArray()) << raw("\x40") << noxfrm;
+ QTest::newRow("ByteArray") << QCborValue(QByteArray("Hello")) << raw("\x45Hello") << noxfrm;
+ QTest::newRow("ByteArray:WithNull") << QCborValue(raw("\0\1\2\xff")) << raw("\x44\0\1\2\xff") << noxfrm;
+
+ QTest::newRow("String:Empty") << QCborValue(QString()) << raw("\x60") << noxfrm;
+ QTest::newRow("String:UsAscii") << QCborValue("Hello") << raw("\x65Hello") << noxfrm;
+ QTest::newRow("String:Latin1") << QCborValue(QLatin1String("R\xe9sum\xe9"))
+ << raw("\x68R\xc3\xa9sum\xc3\xa9") << noxfrm;
+ QTest::newRow("String:Unicode") << QCborValue(QStringLiteral(u"éś α €"))
+ << raw("\x6b\xc3\xa9\xc5\x9b \xce\xb1 \xe2\x82\xac") << noxfrm;
+
+ QTest::newRow("DateTime") << QCborValue(dt) // this is UTC
+ << "\xc0\x78\x18" + dt.toString(Qt::ISODateWithMs).toLatin1()
+ << noxfrm;
+ QTest::newRow("DateTime-UTC") << QCborValue(QDateTime({2018, 1, 1}, {9, 0, 0}, Qt::UTC))
+ << raw("\xc0\x78\x18" "2018-01-01T09:00:00.000Z")
+ << noxfrm;
+ QTest::newRow("DateTime-Local") << QCborValue(QDateTime({2018, 1, 1}, {9, 0, 0}, Qt::LocalTime))
+ << raw("\xc0\x77" "2018-01-01T09:00:00.000")
+ << noxfrm;
+ QTest::newRow("DateTime+01:00") << QCborValue(QDateTime({2018, 1, 1}, {9, 0, 0}, Qt::OffsetFromUTC, 3600))
+ << raw("\xc0\x78\x1d" "2018-01-01T09:00:00.000+01:00")
+ << noxfrm;
+ QTest::newRow("Url:Empty") << QCborValue(QUrl()) << raw("\xd8\x20\x60") << noxfrm;
+ QTest::newRow("Url") << QCborValue(QUrl("HTTPS://example.com/{%30%31}?q=%3Ca+b%20%C2%A9%3E&%26"))
+ << raw("\xd8\x20\x78\x27" "https://example.com/{01}?q=<a+b \xC2\xA9>&%26")
+ << noxfrm;
+ QTest::newRow("Regex:Empty") << QCborValue(QRegularExpression()) << raw("\xd8\x23\x60") << noxfrm;
+ QTest::newRow("Regex") << QCborValue(QRegularExpression("^.*$"))
+ << raw("\xd8\x23\x64" "^.*$") << noxfrm;
+ QTest::newRow("Uuid") << QCborValue(uuid) << raw("\xd8\x25\x50") + uuid.toRfc4122() << noxfrm;
+
+ // empty arrays and maps
+ QTest::newRow("Array") << QCborValue(QCborArray()) << raw("\x80") << noxfrm;
+ QTest::newRow("Map") << QCborValue(QCborMap()) << raw("\xa0") << noxfrm;
+
+ QTest::newRow("Tagged:ByteArray") << QCborValue(QCborKnownTags::PositiveBignum, raw("\1\0\0\0\0""\0\0\0\0"))
+ << raw("\xc2\x49\1\0\0\0\0""\0\0\0\0") << noxfrm;
+ QTest::newRow("Tagged:Array") << QCborValue(QCborKnownTags::Decimal, QCborArray{-2, 27315})
+ << raw("\xc4\x82\x21\x19\x6a\xb3") << noxfrm;
+}
+
+void tst_QCborValue::toCbor_data()
+{
+ addCommonCborData();
+
+ // The rest of these tests are conversions whose decoding does not yield
+ // back the same QCborValue.
+
+ // Signalling NaN get normalized to quiet ones
+ QTest::newRow("Double:snan") << QCborValue(qSNaN()) << raw("\xfb\x7f\xf8\0""\0\0\0\0\0") << QCborValue::EncodingOptions();
+ QTest::newRow("Float:snan") << QCborValue(qSNaN()) << raw("\xfa\x7f\xc0\0\0") << QCborValue::EncodingOptions(QCborValue::UseFloat);
+ QTest::newRow("Float16:snan") << QCborValue(qSNaN()) << raw("\xf9\x7e\0") << QCborValue::EncodingOptions(QCborValue::UseFloat16);
+
+ // Floating point written as integers are read back as integers
+ QTest::newRow("UseInteger:0") << QCborValue(0.) << raw("\x00") << QCborValue::EncodingOptions(QCborValue::UseIntegers);
+ QTest::newRow("UseInteger:1") << QCborValue(1.) << raw("\x01") << QCborValue::EncodingOptions(QCborValue::UseIntegers);
+ QTest::newRow("UseInteger:-1") << QCborValue(-1.) << raw("\x20") << QCborValue::EncodingOptions(QCborValue::UseIntegers);
+ QTest::newRow("UseInteger:INT64_MIN") << QCborValue(std::numeric_limits<qint64>::min() + 0.)
+ << raw("\x3b\x7f\xff\xff\xff""\xff\xff\xff\xff")
+ << QCborValue::EncodingOptions(QCborValue::UseIntegers);
+
+ // but obviously non-integral or out of range floating point stay FP
+ QTest::newRow("UseInteger:1.5") << QCborValue(1.5) << raw("\xfb\x3f\xf8\0\0""\0\0\0\0") << QCborValue::EncodingOptions(QCborValue::UseIntegers);
+ QTest::newRow("UseInteger:-1.5") << QCborValue(-1.5) << raw("\xfb\xbf\xf8\0\0""\0\0\0\0") << QCborValue::EncodingOptions(QCborValue::UseIntegers);
+ QTest::newRow("UseInteger:inf") << QCborValue(qInf()) << raw("\xfb\x7f\xf0\0\0""\0\0\0\0") << QCborValue::EncodingOptions(QCborValue::UseIntegers);
+ QTest::newRow("UseInteger:-inf") << QCborValue(-qInf()) << raw("\xfb\xff\xf0\0""\0\0\0\0\0") << QCborValue::EncodingOptions(QCborValue::UseIntegers);
+ QTest::newRow("UseInteger:nan") << QCborValue(qQNaN()) << raw("\xfb\x7f\xf8\0\0""\0\0\0\0") << QCborValue::EncodingOptions(QCborValue::UseIntegers);
+ QTest::newRow("UseInteger:2^64") << QCborValue(18446744073709551616.0) << raw("\xfb\x43\xf0\0\0""\0\0\0\0") << QCborValue::EncodingOptions(QCborValue::UseIntegers);
+ QTest::newRow("UseInteger:-2^65") << QCborValue(-2 * 18446744073709551616.0) << raw("\xfb\xc4\0\0\0""\0\0\0\0") << QCborValue::EncodingOptions(QCborValue::UseIntegers);
+}
+
+void tst_QCborValue::toCbor()
+{
+ QFETCH(QCborValue, v);
+ QFETCH(QByteArray, result);
+ QFETCH(QCborValue::EncodingOptions, options);
+
+ QCOMPARE(v.toCbor(options), result);
+
+ // in maps and arrays
+ QCOMPARE(QCborArray{v}.toCborValue().toCbor(options), "\x81" + result);
+ QCOMPARE(QCborArray({v, v}).toCborValue().toCbor(options),
+ "\x82" + result + result);
+ QCOMPARE(QCborMap({{1, v}}).toCborValue().toCbor(options),
+ "\xa1\x01" + result);
+
+ // tagged
+ QCborValue t(QCborKnownTags::Signature, v);
+ QCOMPARE(t.toCbor(options), "\xd9\xd9\xf7" + result);
+ QCOMPARE(QCborArray({t, t}).toCborValue().toCbor(options),
+ "\x82\xd9\xd9\xf7" + result + "\xd9\xd9\xf7" + result);
+ QCOMPARE(QCborMap({{1, t}}).toCborValue().toCbor(options),
+ "\xa1\x01\xd9\xd9\xf7" + result);
+}
+
+void tst_QCborValue::fromCbor_data()
+{
+ addCommonCborData();
+
+ // chunked strings
+ QTest::newRow("ByteArray:Chunked") << QCborValue(QByteArray("Hello"))
+ << raw("\x5f\x43Hel\x42lo\xff");
+ QTest::newRow("ByteArray:Chunked:Empty") << QCborValue(QByteArray()) << raw("\x5f\xff");
+ QTest::newRow("String:Chunked") << QCborValue("Hello")
+ << raw("\x7f\x63Hel\x62lo\xff");
+ QTest::newRow("String:Chunked:Empty") << QCborValue(QString())
+ << raw("\x7f\xff");
+
+ QTest::newRow("DateTime:NoMilli") << QCborValue(QDateTime::fromSecsSinceEpoch(1515565477, Qt::UTC))
+ << raw("\xc0\x74" "2018-01-10T06:24:37Z");
+ QTest::newRow("UnixTime_t:Integer") << QCborValue(QDateTime::fromSecsSinceEpoch(1515565477, Qt::UTC))
+ << raw("\xc1\x1a\x5a\x55\xb1\xa5");
+ QTest::newRow("UnixTime_t:Double") << QCborValue(QDateTime::fromMSecsSinceEpoch(1515565477125, Qt::UTC))
+ << raw("\xc1\xfb\x41\xd6\x95\x6c""\x69\x48\x00\x00");
+
+ QTest::newRow("Url:NotNormalized") << QCborValue(QUrl("https://example.com/\xc2\xa9 "))
+ << raw("\xd8\x20\x78\x1dHTTPS://EXAMPLE.COM/%c2%a9%20");
+
+ QTest::newRow("Uuid:Zero") << QCborValue(QUuid()) << raw("\xd8\x25\x40");
+ QTest::newRow("Uuid:TooShort") << QCborValue(QUuid::fromRfc4122(raw("\1\2\3\4""\4\3\2\0""\0\0\0\0""\0\0\0\0")))
+ << raw("\xd8\x25\x47" "\1\2\3\4\4\3\2");
+ QTest::newRow("Uuid:TooLong") << QCborValue(QUuid::fromRfc4122(raw("\1\2\3\4""\4\3\2\0""\0\0\0\0""\0\0\0\1")))
+ << raw("\xd8\x25\x51" "\1\2\3\4""\4\3\2\0""\0\0\0\0""\0\0\0\1""\2");
+}
+
+void tst_QCborValue::fromCbor()
+{
+ QFETCH(QCborValue, v);
+ QFETCH(QByteArray, result);
+
+ auto doCheck = [](const QCborValue &v, const QByteArray &result) {
+ QCborParserError error;
+ QCborValue decoded = QCborValue::fromCbor(result, &error);
+ QVERIFY2(error.error == QCborError(), qPrintable(error.errorString()));
+ QCOMPARE(error.offset, result.size());
+ QVERIFY(decoded == v);
+ QVERIFY(v == decoded);
+ };
+
+ doCheck(v, result);
+ if (QTest::currentTestFailed())
+ return;
+
+ // in an array
+ doCheck(QCborArray{v}, "\x81" + result);
+ if (QTest::currentTestFailed())
+ return;
+
+ doCheck(QCborArray{v, v}, "\x82" + result + result);
+ if (QTest::currentTestFailed())
+ return;
+
+ // in a map
+ doCheck(QCborMap{{1, v}}, "\xa1\1" + result);
+ if (QTest::currentTestFailed())
+ return;
+
+ // undefined-length arrays and maps
+ doCheck(QCborArray{v}, "\x9f" + result + "\xff");
+ if (QTest::currentTestFailed())
+ return;
+ doCheck(QCborArray{v, v}, "\x9f" + result + result + "\xff");
+ if (QTest::currentTestFailed())
+ return;
+ doCheck(QCborMap{{1, v}}, "\xbf\1" + result + "\xff");
+ if (QTest::currentTestFailed())
+ return;
+
+ // tagged
+ QCborValue t(QCborKnownTags::Signature, v);
+ doCheck(t, "\xd9\xd9\xf7" + result);
+ if (QTest::currentTestFailed())
+ return;
+
+ // in an array
+ doCheck(QCborArray{t}, "\x81\xd9\xd9\xf7" + result);
+ if (QTest::currentTestFailed())
+ return;
+
+ doCheck(QCborArray{t, t}, "\x82\xd9\xd9\xf7" + result + "\xd9\xd9\xf7" + result);
+ if (QTest::currentTestFailed())
+ return;
+
+ // in a map
+ doCheck(QCborMap{{1, t}}, "\xa1\1\xd9\xd9\xf7" + result);
+ if (QTest::currentTestFailed())
+ return;
+}
+
+void tst_QCborValue::validation_data()
+{
+ addValidationColumns();
+ addValidationData();
+
+ // These tests say we have arrays and maps with very large item counts.
+ // They are meant to ensure we don't pre-allocate a lot of memory
+ // unnecessarily and possibly crash the application. The actual number of
+ // elements in the stream is only 2, so we should get an unexpected EOF
+ // error. QCborValue internally uses 16 bytes per element, so we get to
+ // 2 GB at 2^27 elements.
+ QTest::addRow("very-large-array-no-overflow") << raw("\x9a\x07\xff\xff\xff" "\0\0");
+ QTest::addRow("very-large-array-overflow1") << raw("\x9a\x40\0\0\0" "\0\0");
+
+ // this makes sure we don't accidentally clip to 32-bit: sending 2^32+2 elements
+ QTest::addRow("very-large-array-overflow2") << raw("\x9b\0\0\0\1""\0\0\0\2" "\0\0");
+}
+
+void tst_QCborValue::validation()
+{
+ QFETCH(QByteArray, data);
+
+ QCborParserError error;
+ QCborValue decoded = QCborValue::fromCbor(data, &error);
+ QVERIFY(error.error != QCborError{});
+
+ if (data.startsWith('\x81')) {
+ // decode without the array prefix
+ decoded = QCborValue::fromCbor(data.mid(1), &error);
+ QVERIFY(error.error != QCborError{});
+ }
+}
+
+void tst_QCborValue::toDiagnosticNotation_data()
+{
+ QTest::addColumn<QCborValue>("v");
+ QTest::addColumn<int>("opts");
+ QTest::addColumn<QString>("expected");
+ QDateTime dt = QDateTime::currentDateTimeUtc();
+ QUuid uuid = QUuid::createUuid();
+
+ QMetaEnum me = QMetaEnum::fromType<QCborValue::Type>();
+ auto add = [me](const QCborValue &v, const QString &exp) {
+ auto addRow = [=](const char *prefix) -> QTestData & {
+ QCborValue::Type t = v.type();
+ if (t == QCborValue::Integer)
+ return QTest::addRow("%sInteger:%lld", prefix, v.toInteger());
+ if (t == QCborValue::Double)
+ return QTest::addRow("%sDouble:%g", prefix, v.toDouble());
+ if (t == QCborValue::ByteArray)
+ return QTest::addRow("%sByteArray:%d", prefix, v.toByteArray().size());
+ if (t == QCborValue::String)
+ return QTest::addRow("%sString:%d", prefix, v.toString().size());
+
+ QByteArray typeString = me.valueToKey(t);
+ Q_ASSERT(!typeString.isEmpty());
+ return QTest::newRow(prefix + typeString);
+ };
+ addRow("") << v << int(QCborValue::DiagnosticNotationOptions{}) << exp;
+ addRow("LW:") << v << int(QCborValue::LineWrapped) << exp;
+ addRow("Array:") << QCborValue(QCborArray{v}) << int(QCborValue::DiagnosticNotationOptions{}) << '[' + exp + ']';
+ addRow("Mapped:") << QCborValue(QCborMap{{2, v}}) << int(QCborValue::DiagnosticNotationOptions{}) << "{2: " + exp + '}';
+ addRow("Mapping:") << QCborValue(QCborMap{{v, 2}}) << int(QCborValue::DiagnosticNotationOptions{}) << '{' + exp + ": 2}";
+ };
+
+ // empty arrays and maps
+ QTest::newRow("EmptyArray")
+ << QCborValue(QCborArray()) << int(QCborValue::DiagnosticNotationOptions{})
+ << "[]";
+ QTest::newRow("EmptyMap")
+ << QCborValue(QCborMap()) << int(QCborValue::DiagnosticNotationOptions{})
+ << "{}";
+
+ add(QCborValue(), "undefined");
+ add(QCborValue::Null, "null");
+ add(false, "false");
+ add(true, "true");
+ add(QCborSimpleType(0), "simple(0)");
+ QTest::newRow("SimpleType-255")
+ << QCborValue(QCborSimpleType(255)) << int(QCborValue::DiagnosticNotationOptions{})
+ << "simple(255)";
+ add(0, "0");
+ add(1, "1");
+ add(-1, "-1");
+ add(std::numeric_limits<qint64>::min(), QString::number(std::numeric_limits<qint64>::min()));
+ add(std::numeric_limits<qint64>::max(), QString::number(std::numeric_limits<qint64>::max()));
+ add(0., "0.0");
+ add(1.25, "1.25");
+ add(-1.25, "-1.25");
+ add(qInf(), "inf");
+ add(-qInf(), "-inf");
+ add(qQNaN(), "nan");
+ add(QByteArray(), "h''");
+ add(QByteArray("Hello"), "h'48656c6c6f'");
+ add(QLatin1String(), QLatin1String("\"\""));
+ add("Hello", "\"Hello\"");
+ add("\"Hello\\World\"", "\"\\\"Hello\\\\World\\\"\"");
+ add(QCborValue(dt), "0(\"" + dt.toString(Qt::ISODateWithMs) + "\")");
+ add(QCborValue(QUrl("http://example.com")), "32(\"http://example.com\")");
+ add(QCborValue(QRegularExpression("^.*$")), "35(\"^.*$\")");
+ add(QCborValue(uuid), "37(h'" + uuid.toString(QUuid::Id128) + "')");
+
+ // arrays and maps with more than one element
+ QTest::newRow("2Array")
+ << QCborValue(QCborArray{0, 1}) << int(QCborValue::DiagnosticNotationOptions{})
+ << "[0, 1]";
+ QTest::newRow("2Map")
+ << QCborValue(QCborMap{{0, 1}, {"foo", "bar"}}) << int(QCborValue::DiagnosticNotationOptions{})
+ << "{0: 1, \"foo\": \"bar\"}";
+
+ // line wrapping in arrays and maps
+ QTest::newRow("LW:EmptyArray")
+ << QCborValue(QCborArray()) << int(QCborValue::LineWrapped)
+ << "[\n]";
+ QTest::newRow("LW:EmptyMap")
+ << QCborValue(QCborMap()) << int(QCborValue::LineWrapped)
+ << "{\n}";
+ QTest::newRow("LW:Array:Integer:0")
+ << QCborValue(QCborArray{0}) << int(QCborValue::LineWrapped)
+ << "[\n 0\n]";
+ QTest::newRow("LW:Array:String:5")
+ << QCborValue(QCborArray{"Hello"}) << int(QCborValue::LineWrapped)
+ << "[\n \"Hello\"\n]";
+ QTest::newRow("LW:Map:0-0")
+ << QCborValue(QCborMap{{0, 0}}) << int(QCborValue::LineWrapped)
+ << "{\n 0: 0\n}";
+ QTest::newRow("LW:Map:String:5")
+ << QCborValue(QCborMap{{0, "Hello"}}) << int(QCborValue::LineWrapped)
+ << "{\n 0: \"Hello\"\n}";
+ QTest::newRow("LW:2Array")
+ << QCborValue(QCborArray{0, 1}) << int(QCborValue::LineWrapped)
+ << "[\n 0,\n 1\n]";
+ QTest::newRow("LW:2Map")
+ << QCborValue(QCborMap{{0, 0}, {"foo", "bar"}}) << int(QCborValue::LineWrapped)
+ << "{\n 0: 0,\n \"foo\": \"bar\"\n}";
+
+ // nested arrays and maps
+ QTest::newRow("Array:EmptyArray")
+ << QCborValue(QCborArray() << QCborArray()) << int(QCborValue::DiagnosticNotationOptions{})
+ << "[[]]";
+ QTest::newRow("Array:EmptyMap")
+ << QCborValue(QCborArray() << QCborMap()) << int(QCborValue::DiagnosticNotationOptions{})
+ << "[{}]";
+ QTest::newRow("LW:Array:EmptyArray")
+ << QCborValue(QCborArray() << QCborArray()) << int(QCborValue::LineWrapped)
+ << "[\n [\n ]\n]";
+ QTest::newRow("LW:Array:EmptyMap")
+ << QCborValue(QCborArray() << QCborMap()) << int(QCborValue::LineWrapped)
+ << "[\n {\n }\n]";
+ QTest::newRow("LW:Array:2Array")
+ << QCborValue(QCborArray() << QCborArray{0, 1}) << int(QCborValue::LineWrapped)
+ << "[\n [\n 0,\n 1\n ]\n]";
+ QTest::newRow("LW:Map:2Array")
+ << QCborValue(QCborMap{{0, QCborArray{0, 1}}}) << int(QCborValue::LineWrapped)
+ << "{\n 0: [\n 0,\n 1\n ]\n}";
+ QTest::newRow("LW:Map:2Map")
+ << QCborValue(QCborMap{{-1, QCborMap{{0, 0}, {"foo", "bar"}}}}) << int(QCborValue::LineWrapped)
+ << "{\n -1: {\n 0: 0,\n \"foo\": \"bar\"\n }\n}";
+
+ // string escaping
+ QTest::newRow("String:escaping")
+ << QCborValue("\1\a\b\t\f\r\n\v\x1f\x7f \"\xc2\xa0\xe2\x82\xac\xf0\x90\x80\x80\\\"")
+ << int(QCborValue::DiagnosticNotationOptions{})
+ << "\"\\u0001\\a\\b\\t\\f\\r\\n\\v\\u001F\\u007F \\\"\\u00A0\\u20AC\\U00010000\\\\\\\"\"";
+
+ // extended formatting for byte arrays
+ QTest::newRow("Extended:ByteArray:0")
+ << QCborValue(QByteArray()) << int(QCborValue::ExtendedFormat)
+ << "h''";
+ QTest::newRow("Extended:ByteArray:5")
+ << QCborValue(QByteArray("Hello")) << int(QCborValue::ExtendedFormat)
+ << "h'48 65 6c 6c 6f'";
+ QTest::newRow("Extended:ByteArray:Base64url")
+ << QCborValue(QCborKnownTags::ExpectedBase64url, QByteArray("\xff\xef"))
+ << int(QCborValue::ExtendedFormat) << "21(b64'_-8')";
+ QTest::newRow("Extended:ByteArray:Base64")
+ << QCborValue(QCborKnownTags::ExpectedBase64, QByteArray("\xff\xef"))
+ << int(QCborValue::ExtendedFormat) << "22(b64'/+8=')";
+
+ // formatting applies through arrays too
+ QTest::newRow("Extended:Array:ByteArray:Base64url")
+ << QCborValue(QCborKnownTags::ExpectedBase64url, QCborArray{QByteArray("\xff\xef")})
+ << int(QCborValue::ExtendedFormat) << "21([b64'_-8'])";
+ // and only the innermost applies
+ QTest::newRow("ByteArray:multiple-tags")
+ << QCborValue(QCborKnownTags::ExpectedBase64url,
+ QCborArray{QCborValue(QCborKnownTags::ExpectedBase16, QByteArray("Hello")),
+ QByteArray("\xff\xef")})
+ << int(QCborValue::ExtendedFormat) << "21([23(h'48 65 6c 6c 6f'), b64'_-8'])";
+}
+
+void tst_QCborValue::toDiagnosticNotation()
+{
+ QFETCH(QCborValue, v);
+ QFETCH(QString, expected);
+ QFETCH(int, opts);
+
+ QString result = v.toDiagnosticNotation(QCborValue::DiagnosticNotationOptions(opts));
+ QCOMPARE(result, expected);
+}
+
+QTEST_MAIN(tst_QCborValue)
+
+#include "tst_qcborvalue.moc"
diff --git a/tests/auto/corelib/serialization/qcborvalue_json/qcborvalue_json.pro b/tests/auto/corelib/serialization/qcborvalue_json/qcborvalue_json.pro
new file mode 100644
index 0000000000..c11000b7c2
--- /dev/null
+++ b/tests/auto/corelib/serialization/qcborvalue_json/qcborvalue_json.pro
@@ -0,0 +1,7 @@
+QT = core testlib
+TARGET = tst_qcborvalue_json
+CONFIG += testcase
+SOURCES += \
+ tst_qcborvalue_json.cpp
+
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
diff --git a/tests/auto/corelib/serialization/qcborvalue_json/tst_qcborvalue_json.cpp b/tests/auto/corelib/serialization/qcborvalue_json/tst_qcborvalue_json.cpp
new file mode 100644
index 0000000000..56245a7173
--- /dev/null
+++ b/tests/auto/corelib/serialization/qcborvalue_json/tst_qcborvalue_json.cpp
@@ -0,0 +1,348 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 Intel Corporation.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/qcborvalue.h>
+#include <QtTest>
+
+Q_DECLARE_METATYPE(QCborValue)
+
+class tst_QCborValue_Json : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void toVariant_data();
+ void toVariant();
+ void toJson_data() { toVariant_data(); }
+ void toJson();
+ void taggedByteArrayToJson_data();
+ void taggedByteArrayToJson();
+
+ void fromVariant_data() { toVariant_data(); }
+ void fromVariant();
+ void fromJson_data();
+ void fromJson();
+
+ void nonStringKeysInMaps_data();
+ void nonStringKeysInMaps();
+};
+
+void tst_QCborValue_Json::toVariant_data()
+{
+ QTest::addColumn<QCborValue>("v");
+ QTest::addColumn<QVariant>("variant");
+ QTest::addColumn<QJsonValue>("json");
+ QDateTime dt = QDateTime::currentDateTimeUtc();
+ QUuid uuid = QUuid::createUuid();
+
+ QMetaEnum me = QMetaEnum::fromType<QCborValue::Type>();
+ auto add = [me](const QCborValue &v, const QVariant &exp, const QJsonValue &json) {
+ auto addRow = [=]() -> QTestData & {
+ const char *typeString = me.valueToKey(v.type());
+ if (v.type() == QCborValue::Integer)
+ return QTest::addRow("Integer:%lld", exp.toLongLong());
+ if (v.type() == QCborValue::Double)
+ return QTest::addRow("Double:%g", exp.toDouble());
+ if (v.type() == QCborValue::ByteArray || v.type() == QCborValue::String)
+ return QTest::addRow("%s:%d", typeString, exp.toString().size());
+ if (v.type() >= 0x10000)
+ return QTest::newRow(exp.typeName());
+ return QTest::newRow(typeString);
+ };
+ addRow() << v << exp << json;
+ };
+
+ // good JSON matching:
+ add(QCborValue(), QVariant(), QJsonValue::Undefined);
+ add(nullptr, QVariant::fromValue(nullptr), QJsonValue::Null);
+ add(false, false, false);
+ add(true, true, true);
+ add(0, 0, 0);
+ add(1, 1, 1);
+ add(-1, -1, -1);
+ add(0., 0., 0.);
+ add(1.25, 1.25, 1.25);
+ add(-1.25, -1.25, -1.25);
+ add("Hello", "Hello", "Hello");
+
+ // converts to string in JSON:
+ add(QByteArray("Hello"), QByteArray("Hello"), "SGVsbG8");
+ add(QCborValue(dt), dt, dt.toString(Qt::ISODateWithMs));
+ add(QCborValue(QUrl("http://example.com/{q}")), QUrl("http://example.com/{q}"),
+ "http://example.com/%7Bq%7D"); // note the encoded form in JSON
+ add(QCborValue(QRegularExpression(".")), QRegularExpression("."), ".");
+ add(QCborValue(uuid), uuid, uuid.toString(QUuid::WithoutBraces));
+
+ // not valid in JSON
+ QTest::newRow("simpletype") << QCborValue(QCborSimpleType(255))
+ << QVariant::fromValue(QCborSimpleType(255))
+ << QJsonValue("simple(255)");
+ QTest::newRow("Double:inf") << QCborValue(qInf())
+ << QVariant(qInf())
+ << QJsonValue();
+ QTest::newRow("Double:-inf") << QCborValue(-qInf())
+ << QVariant(-qInf())
+ << QJsonValue();
+ QTest::newRow("Double:nan") << QCborValue(qQNaN())
+ << QVariant(qQNaN())
+ << QJsonValue();
+
+ // large integral values lose precision in JSON
+ QTest::newRow("Integer:max") << QCborValue(std::numeric_limits<qint64>::max())
+ << QVariant(std::numeric_limits<qint64>::max())
+ << QJsonValue(std::numeric_limits<qint64>::max());
+ QTest::newRow("Integer:min") << QCborValue(std::numeric_limits<qint64>::min())
+ << QVariant(std::numeric_limits<qint64>::min())
+ << QJsonValue(std::numeric_limits<qint64>::min());
+
+ // empty arrays and maps
+ add(QCborArray(), QVariantList(), QJsonArray());
+ add(QCborMap(), QVariantMap(), QJsonObject());
+}
+
+void tst_QCborValue_Json::toVariant()
+{
+ QFETCH(QCborValue, v);
+ QFETCH(QVariant, variant);
+
+ if (qIsNaN(variant.toDouble())) {
+ // because NaN != NaN, QVariant(NaN) != QVariant(NaN), so we
+ // only need to compare the classification
+ QVERIFY(qIsNaN(v.toVariant().toDouble()));
+
+ // the rest of this function depends on the variant comparison
+ return;
+ }
+
+ QCOMPARE(v.toVariant(), variant);
+ if (variant.isValid()) {
+ QVariant variant2 = QVariant::fromValue(v);
+ QVERIFY(variant2.canConvert(variant.userType()));
+ QVERIFY(variant2.convert(variant.userType()));
+ QCOMPARE(variant2, variant);
+ }
+
+ // tags get ignored:
+ QCOMPARE(QCborValue(QCborKnownTags::Signature, v).toVariant(), variant);
+
+ // make arrays with this item
+ QCOMPARE(QCborArray({v}).toVariantList(), QVariantList({variant}));
+ QCOMPARE(QCborArray({v, v}).toVariantList(), QVariantList({variant, variant}));
+
+ // and maps
+ QCOMPARE(QCborMap({{"foo", v}}).toVariantMap(), QVariantMap({{"foo", variant}}));
+ QCOMPARE(QCborMap({{"foo", v}}).toVariantHash(), QVariantHash({{"foo", variant}}));
+
+ // finally, mixed
+ QCOMPARE(QCborArray{QCborMap({{"foo", v}})}.toVariantList(),
+ QVariantList{QVariantMap({{"foo", variant}})});
+}
+
+void tst_QCborValue_Json::toJson()
+{
+ QFETCH(QCborValue, v);
+ QFETCH(QJsonValue, json);
+
+ QCOMPARE(v.toJsonValue(), json);
+ QCOMPARE(QVariant::fromValue(v).toJsonValue(), json);
+
+ // most tags get ignored:
+ QCOMPARE(QCborValue(QCborKnownTags::Signature, v).toJsonValue(), json);
+
+ // make arrays with this item
+ QCOMPARE(QCborArray({v}).toJsonArray(), QJsonArray({json}));
+ QCOMPARE(QCborArray({v, v}).toJsonArray(), QJsonArray({json, json}));
+
+ // and maps
+ QCOMPARE(QCborMap({{"foo", v}}).toJsonObject(), QJsonObject({{"foo", json}}));
+
+ // finally, mixed
+ QCOMPARE(QCborArray{QCborMap({{"foo", v}})}.toJsonArray(),
+ QJsonArray{QJsonObject({{"foo", json}})});
+}
+
+void tst_QCborValue_Json::taggedByteArrayToJson_data()
+{
+ QTest::addColumn<QCborValue>("v");
+ QTest::addColumn<QJsonValue>("json");
+
+ QByteArray data("\xff\x01");
+ QTest::newRow("base64url") << QCborValue(QCborKnownTags::ExpectedBase64url, data) << QJsonValue("_wE");
+ QTest::newRow("base64") << QCborValue(QCborKnownTags::ExpectedBase64, data) << QJsonValue("/wE=");
+ QTest::newRow("hex") << QCborValue(QCborKnownTags::ExpectedBase16, data) << QJsonValue("ff01");
+}
+
+void tst_QCborValue_Json::taggedByteArrayToJson()
+{
+ QFETCH(QCborValue, v);
+ QFETCH(QJsonValue, json);
+
+ QCOMPARE(v.toJsonValue(), json);
+ QCOMPARE(QCborArray({v}).toJsonArray(), QJsonArray({json}));
+}
+
+void tst_QCborValue_Json::fromVariant()
+{
+ QFETCH(QCborValue, v);
+ QFETCH(QVariant, variant);
+
+ QCOMPARE(QCborValue::fromVariant(variant), v);
+ QCOMPARE(variant.value<QCborValue>(), v);
+
+ // try arrays
+ QCOMPARE(QCborArray::fromVariantList({variant}), QCborArray{v});
+ QCOMPARE(QCborArray::fromVariantList({variant, variant}), QCborArray({v, v}));
+
+ if (variant.type() == QVariant::String) {
+ QString s = variant.toString();
+ QCOMPARE(QCborArray::fromStringList({s}), QCborArray{v});
+ QCOMPARE(QCborArray::fromStringList({s, s}), QCborArray({v, v}));
+ }
+
+ // maps...
+ QVariantMap map{{"foo", variant}};
+ QCOMPARE(QCborMap::fromVariantMap(map), QCborMap({{"foo", v}}));
+ QCOMPARE(QCborMap::fromVariantHash({{"foo", variant}}), QCborMap({{"foo", v}}));
+
+ // nested
+ QVariantMap outer{{"bar", QVariantList{0, map, true}}};
+ QCOMPARE(QCborMap::fromVariantMap(outer),
+ QCborMap({{"bar", QCborArray{0, QCborMap{{"foo", v}}, true}}}));
+}
+
+void tst_QCborValue_Json::fromJson_data()
+{
+ QTest::addColumn<QCborValue>("v");
+ QTest::addColumn<QJsonValue>("json");
+
+ QTest::newRow("null") << QCborValue(QCborValue::Null) << QJsonValue(QJsonValue::Null);
+ QTest::newRow("false") << QCborValue(false) << QJsonValue(false);
+ QTest::newRow("true") << QCborValue(true) << QJsonValue(true);
+ QTest::newRow("0") << QCborValue(0) << QJsonValue(0.);
+ QTest::newRow("1") << QCborValue(1) << QJsonValue(1);
+ QTest::newRow("1.5") << QCborValue(1.5) << QJsonValue(1.5);
+ QTest::newRow("string") << QCborValue("Hello") << QJsonValue("Hello");
+ QTest::newRow("array") << QCborValue(QCborValue::Array) << QJsonValue(QJsonValue::Array);
+ QTest::newRow("map") << QCborValue(QCborValue::Map) << QJsonValue(QJsonValue::Object);
+}
+
+void tst_QCborValue_Json::fromJson()
+{
+ QFETCH(QCborValue, v);
+ QFETCH(QJsonValue, json);
+
+ QCOMPARE(QCborValue::fromJsonValue(json), v);
+ QCOMPARE(QVariant(json).value<QCborValue>(), v);
+ QCOMPARE(QCborArray::fromJsonArray({json}), QCborArray({v}));
+ QCOMPARE(QCborArray::fromJsonArray({json, json}), QCborArray({v, v}));
+ QCOMPARE(QCborMap::fromJsonObject({{"foo", json}}), QCborMap({{"foo", v}}));
+
+ // confirm we can roundtrip back to JSON
+ QCOMPARE(QCborValue::fromJsonValue(json).toJsonValue(), json);
+}
+
+void tst_QCborValue_Json::nonStringKeysInMaps_data()
+{
+ QTest::addColumn<QCborValue>("key");
+ QTest::addColumn<QString>("converted");
+
+ auto add = [](const char *str, const QCborValue &v) {
+ QTest::newRow(str) << v << str;
+ };
+ add("0", 0);
+ add("-1", -1);
+ add("false", false);
+ add("true", true);
+ add("null", nullptr);
+ add("undefined", {}); // should this be ""?
+ add("simple(255)", QCborSimpleType(255));
+ add("2.5", 2.5);
+
+ QByteArray data("\xff\x01");
+ QTest::newRow("bytearray") << QCborValue(data) << "_wE";
+ QTest::newRow("base64url") << QCborValue(QCborKnownTags::ExpectedBase64url, data) << "_wE";
+ QTest::newRow("base64") << QCborValue(QCborKnownTags::ExpectedBase64, data) << "/wE=";
+ QTest::newRow("hex") << QCborValue(QCborKnownTags::ExpectedBase16, data) << "ff01";
+
+ QTest::newRow("emptyarray") << QCborValue(QCborValue::Array) << "[]";
+ QTest::newRow("emptymap") << QCborValue(QCborValue::Map) << "{}";
+ QTest::newRow("array") << QCborValue(QCborArray{1, true, 2.5, "Hello"})
+ << "[1, true, 2.5, \"Hello\"]";
+ QTest::newRow("map") << QCborValue(QCborMap{{"Hello", 0}, {0, "Hello"}})
+ << "{\"Hello\": 0, 0: \"Hello\"}";
+
+ QDateTime dt = QDateTime::currentDateTimeUtc();
+ QUrl url("https://example.com");
+ QUuid uuid = QUuid::createUuid();
+ QTest::newRow("QDateTime") << QCborValue(dt) << dt.toString(Qt::ISODateWithMs);
+ QTest::newRow("QUrl") << QCborValue(url) << url.toString(QUrl::FullyEncoded);
+ QTest::newRow("QRegularExpression") << QCborValue(QRegularExpression(".*")) << ".*";
+ QTest::newRow("QUuid") << QCborValue(uuid) << uuid.toString(QUuid::WithoutBraces);
+}
+
+void tst_QCborValue_Json::nonStringKeysInMaps()
+{
+ QFETCH(QCborValue, key);
+ QFETCH(QString, converted);
+
+ QCborMap m;
+ m.insert(key, 0);
+
+ {
+ QVariantMap vm = m.toVariantMap();
+ auto it = vm.begin();
+ QVERIFY(it != vm.end());
+ QCOMPARE(it.key(), converted);
+ QCOMPARE(it.value(), 0);
+ QCOMPARE(++it, vm.end());
+ }
+
+ {
+ QJsonObject o = m.toJsonObject();
+ auto it = o.begin();
+ QVERIFY(it != o.end());
+ QCOMPARE(it.key(), converted);
+ QCOMPARE(it.value(), 0);
+ QCOMPARE(++it, o.end());
+ }
+}
+
+QTEST_MAIN(tst_QCborValue_Json)
+
+#include "tst_qcborvalue_json.moc"
diff --git a/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp
index 14a2528cc6..011a0e1a85 100644
--- a/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp
+++ b/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp
@@ -260,16 +260,16 @@ static int NColorRoles[] = {
QPalette::HighlightedText + 1, // Qt_4_0, Qt_4_1
QPalette::HighlightedText + 1, // Qt_4_2
QPalette::AlternateBase + 1, // Qt_4_3
- QPalette::ToolTipText + 1, // Qt_4_4
- QPalette::ToolTipText + 1, // Qt_4_5
- QPalette::ToolTipText + 1, // Qt_4_6
- QPalette::ToolTipText + 1, // Qt_5_0
- QPalette::ToolTipText + 1, // Qt_5_1
- QPalette::ToolTipText + 1, // Qt_5_2
- QPalette::ToolTipText + 1, // Qt_5_3
- QPalette::ToolTipText + 1, // Qt_5_4
- QPalette::ToolTipText + 1, // Qt_5_5
- QPalette::ToolTipText + 1, // Qt_5_6
+ QPalette::PlaceholderText + 1, // Qt_4_4
+ QPalette::PlaceholderText + 1, // Qt_4_5
+ QPalette::PlaceholderText + 1, // Qt_4_6
+ QPalette::PlaceholderText + 1, // Qt_5_0
+ QPalette::PlaceholderText + 1, // Qt_5_1
+ QPalette::PlaceholderText + 1, // Qt_5_2
+ QPalette::PlaceholderText + 1, // Qt_5_3
+ QPalette::PlaceholderText + 1, // Qt_5_4
+ QPalette::PlaceholderText + 1, // Qt_5_5
+ QPalette::PlaceholderText + 1, // Qt_5_6
0 // add the correct value for Qt_5_7 here later
};
@@ -2139,7 +2139,7 @@ void tst_QDataStream::setVersion()
*/
// revise the test if new color roles or color groups are added
- QVERIFY(QPalette::NColorRoles == QPalette::ToolTipText + 1);
+ QVERIFY(QPalette::NColorRoles == QPalette::PlaceholderText + 1);
QCOMPARE(int(QPalette::NColorGroups), 3);
QByteArray ba2;
@@ -2211,25 +2211,22 @@ void tst_QDataStream::setVersion()
}
}
-class SequentialBuffer : public QBuffer
+class SequentialBuffer : public QIODevice
{
public:
- SequentialBuffer(QByteArray *data) : QBuffer(data) { offset = 0; }
+ SequentialBuffer(QByteArray *data) : QIODevice() { buf.setBuffer(data); }
- bool isSequential() const { return true; }
- bool seek(qint64 pos) { offset = pos; return QBuffer::seek(pos); }
- qint64 pos() const { return qint64(offset); }
+ bool isSequential() const override { return true; }
+ bool open(OpenMode mode) override { return buf.open(mode) && QIODevice::open(mode | QIODevice::Unbuffered); }
+ void close() override { buf.close(); QIODevice::close(); }
+ qint64 bytesAvailable() const override { return QIODevice::bytesAvailable() + buf.bytesAvailable(); }
protected:
- qint64 readData(char *data, qint64 maxSize)
- {
- qint64 ret = QBuffer::readData(data, maxSize);
- offset += ret;
- return ret;
- }
+ qint64 readData(char *data, qint64 maxSize) override { return buf.read(data, maxSize); }
+ qint64 writeData(const char *data, qint64 maxSize) override { return buf.write(data, maxSize); }
private:
- int offset;
+ QBuffer buf;
};
void tst_QDataStream::skipRawData_data()
@@ -3329,15 +3326,21 @@ void tst_QDataStream::transaction_data()
QTest::addColumn<bool>("bData");
QTest::addColumn<float>("fData");
QTest::addColumn<double>("dData");
+ QTest::addColumn<QImage>("imgData");
QTest::addColumn<QByteArray>("strData");
QTest::addColumn<QByteArray>("rawData");
+ QImage img1(open_xpm);
+ QImage img2;
+ QImage img3(50, 50, QImage::Format_ARGB32);
+ img3.fill(qRgba(12, 34, 56, 78));
+
QTest::newRow("1") << qint8(1) << qint16(2) << qint32(3) << qint64(4) << true << 5.0f
- << double(6.0) << QByteArray("Hello world!") << QByteArray("Qt rocks!");
+ << double(6.0) << img1 << QByteArray("Hello world!") << QByteArray("Qt rocks!");
QTest::newRow("2") << qint8(1 << 6) << qint16(1 << 14) << qint32(1 << 30) << qint64Data(3) << false << 123.0f
- << double(234.0) << stringData(5).toUtf8() << stringData(6).toUtf8();
+ << double(234.0) << img2 << stringData(5).toUtf8() << stringData(6).toUtf8();
QTest::newRow("3") << qint8(-1) << qint16(-2) << qint32(-3) << qint64(-4) << true << -123.0f
- << double(-234.0) << stringData(3).toUtf8() << stringData(4).toUtf8();
+ << double(-234.0) << img3 << stringData(3).toUtf8() << stringData(4).toUtf8();
}
void tst_QDataStream::transaction()
@@ -3351,6 +3354,7 @@ void tst_QDataStream::transaction()
QFETCH(bool, bData);
QFETCH(float, fData);
QFETCH(double, dData);
+ QFETCH(QImage, imgData);
QFETCH(QByteArray, strData);
QFETCH(QByteArray, rawData);
@@ -3358,12 +3362,13 @@ void tst_QDataStream::transaction()
QDataStream stream(&testBuffer, QIODevice::WriteOnly);
stream << i8Data << i16Data << i32Data << i64Data
- << bData << fData << dData << strData.constData();
+ << bData << fData << dData << imgData << strData.constData();
stream.writeRawData(rawData.constData(), rawData.size());
}
for (int splitPos = 0; splitPos <= testBuffer.size(); ++splitPos) {
QByteArray readBuffer(testBuffer.left(splitPos));
+
SequentialBuffer dev(&readBuffer);
dev.open(QIODevice::ReadOnly);
QDataStream stream(&dev);
@@ -3375,12 +3380,13 @@ void tst_QDataStream::transaction()
bool b;
float f;
double d;
+ QImage img;
char *str;
QByteArray raw(rawData.size(), 0);
forever {
stream.startTransaction();
- stream >> i8 >> i16 >> i32 >> i64 >> b >> f >> d >> str;
+ stream >> i8 >> i16 >> i32 >> i64 >> b >> f >> d >> img >> str;
stream.readRawData(raw.data(), raw.size());
if (stream.commitTransaction())
@@ -3402,6 +3408,7 @@ void tst_QDataStream::transaction()
QCOMPARE(b, bData);
QCOMPARE(f, fData);
QCOMPARE(d, dData);
+ QCOMPARE(img, imgData);
QVERIFY(strData == str);
delete [] str;
QCOMPARE(raw, rawData);
diff --git a/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp
index df8746e518..edea4713a1 100644
--- a/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp
+++ b/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp
@@ -161,6 +161,7 @@ private slots:
void string_write_operator_ToDevice();
void latin1String_write_operator_ToDevice();
void stringref_write_operator_ToDevice();
+ void stringview_write_operator_ToDevice();
// other
void skipWhiteSpace_data();
@@ -2573,6 +2574,17 @@ void tst_QTextStream::stringref_write_operator_ToDevice()
QCOMPARE(buf.buffer().constData(), "No explicit lengthExplicit length");
}
+void tst_QTextStream::stringview_write_operator_ToDevice()
+{
+ QBuffer buf;
+ buf.open(QBuffer::WriteOnly);
+ QTextStream stream(&buf);
+ const QStringView expected = QStringViewLiteral("expectedStringView");
+ stream << expected;
+ stream.flush();
+ QCOMPARE(buf.buffer().constData(), "expectedStringView");
+}
+
// ------------------------------------------------------------------------------
void tst_QTextStream::useCase1()
{
diff --git a/tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp b/tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp
index 16a4200b5d..8fdf91b090 100644
--- a/tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp
+++ b/tests/auto/corelib/serialization/qxmlstream/tst_qxmlstream.cpp
@@ -577,6 +577,8 @@ private slots:
void invalidStringCharacters() const;
void hasError() const;
void readBack() const;
+ void roundTrip() const;
+ void roundTrip_data() const;
private:
static QByteArray readFile(const QString &filename);
@@ -1741,5 +1743,35 @@ void tst_QXmlStream::readBack() const
}
}
+void tst_QXmlStream::roundTrip_data() const
+{
+ QTest::addColumn<QString>("in");
+
+ QTest::newRow("QTBUG-63434") <<
+ "<?xml version=\"1.0\"?>"
+ "<root>"
+ "<father>"
+ "<child xmlns:unknown=\"http://mydomain\">Text</child>"
+ "</father>"
+ "</root>\n";
+}
+
+void tst_QXmlStream::roundTrip() const
+{
+ QFETCH(QString, in);
+ QString out;
+
+ QXmlStreamReader reader(in);
+ QXmlStreamWriter writer(&out);
+
+ while (!reader.atEnd()) {
+ reader.readNext();
+ QVERIFY(!reader.hasError());
+ writer.writeCurrentToken(reader);
+ QVERIFY(!writer.hasError());
+ }
+ QCOMPARE(out, in);
+}
+
#include "tst_qxmlstream.moc"
// vim: et:ts=4:sw=4:sts=4
diff --git a/tests/auto/corelib/serialization/serialization.pro b/tests/auto/corelib/serialization/serialization.pro
index afb9c5b61c..9187de1bc5 100644
--- a/tests/auto/corelib/serialization/serialization.pro
+++ b/tests/auto/corelib/serialization/serialization.pro
@@ -1,6 +1,10 @@
TEMPLATE = subdirs
SUBDIRS = \
json \
+ qcborstreamreader \
+ qcborstreamwriter \
+ qcborvalue \
+ qcborvalue_json \
qdatastream \
qtextstream \
qxmlstream
diff --git a/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp b/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp
index d4a3ee6054..b8c82c2ea0 100644
--- a/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp
+++ b/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp
@@ -1021,6 +1021,8 @@ void tst_QFuture::iterators()
QCOMPARE(i2, c2);
QCOMPARE(c2, i2);
QCOMPARE(c2, c2);
+ QCOMPARE(1 + i1, i1 + 1);
+ QCOMPARE(1 + c1, c1 + 1);
QVERIFY(i1 != i2);
QVERIFY(i1 != c2);
@@ -1070,6 +1072,8 @@ void tst_QFuture::iterators()
QCOMPARE(i2, c2);
QCOMPARE(c2, i2);
QCOMPARE(c2, c2);
+ QCOMPARE(1 + i1, i1 + 1);
+ QCOMPARE(1 + c1, c1 + 1);
QVERIFY(i1 != i2);
QVERIFY(i1 != c2);
diff --git a/tests/auto/corelib/thread/qsemaphore/BLACKLIST b/tests/auto/corelib/thread/qsemaphore/BLACKLIST
index eb83b03556..0786f50417 100644
--- a/tests/auto/corelib/thread/qsemaphore/BLACKLIST
+++ b/tests/auto/corelib/thread/qsemaphore/BLACKLIST
@@ -1,6 +1,8 @@
[tryAcquireWithTimeout:0.2s]
windows
osx-10.12
+osx-10.13
[tryAcquireWithTimeout:2s]
windows
osx-10.12
+osx-10.13
diff --git a/tests/auto/corelib/thread/qthreadonce/qthreadonce.cpp b/tests/auto/corelib/thread/qthreadonce/qthreadonce.cpp
index 9179750218..d27884197a 100644
--- a/tests/auto/corelib/thread/qthreadonce/qthreadonce.cpp
+++ b/tests/auto/corelib/thread/qthreadonce/qthreadonce.cpp
@@ -30,7 +30,6 @@
#include "qplatformdefs.h"
#include "qthreadonce.h"
-#ifndef QT_NO_THREAD
#include "qmutex.h"
Q_GLOBAL_STATIC_WITH_ARGS(QMutex, onceInitializationMutex, (QMutex::Recursive))
@@ -104,5 +103,3 @@ void QOnceControl::done()
{
extra &= ~MustRunCode;
}
-
-#endif // QT_NO_THREAD
diff --git a/tests/auto/corelib/thread/qthreadonce/qthreadonce.h b/tests/auto/corelib/thread/qthreadonce/qthreadonce.h
index 71e830ca16..e5918b8fa5 100644
--- a/tests/auto/corelib/thread/qthreadonce/qthreadonce.h
+++ b/tests/auto/corelib/thread/qthreadonce/qthreadonce.h
@@ -34,8 +34,6 @@
#include <QtCore/qatomic.h>
-#ifndef QT_NO_THREAD
-
class QOnceControl
{
public:
@@ -91,6 +89,4 @@ public:
inline operator T*() { return value(); }
};
-#endif // QT_NO_THREAD
-
#endif
diff --git a/tests/auto/corelib/thread/qthreadstorage/crashonexit/crashonexit.pro b/tests/auto/corelib/thread/qthreadstorage/crashonexit/crashonexit.pro
index 94a0a01e94..d5c09ebc84 100644
--- a/tests/auto/corelib/thread/qthreadstorage/crashonexit/crashonexit.pro
+++ b/tests/auto/corelib/thread/qthreadstorage/crashonexit/crashonexit.pro
@@ -1,5 +1,13 @@
SOURCES += crashOnExit.cpp
-DESTDIR = ./
+debug_and_release {
+ CONFIG(debug, debug|release) {
+ TARGET = ../../debug/crashOnExit_helper
+ } else {
+ TARGET = ../../release/crashOnExit_helper
+ }
+} else {
+ TARGET = ../crashOnExit_helper
+}
QT = core
CONFIG -= app_bundle
CONFIG += console
diff --git a/tests/auto/corelib/thread/qthreadstorage/test/test.pro b/tests/auto/corelib/thread/qthreadstorage/test/test.pro
index d7190f7e7b..d2f21f48f0 100644
--- a/tests/auto/corelib/thread/qthreadstorage/test/test.pro
+++ b/tests/auto/corelib/thread/qthreadstorage/test/test.pro
@@ -1,9 +1,16 @@
CONFIG += testcase
-TARGET = ../tst_qthreadstorage
-CONFIG -= debug_and_release_target
+debug_and_release {
+ CONFIG(debug, debug|release) {
+ TARGET = ../../debug/tst_qthreadstorage
+ !android:!winrt: TEST_HELPER_INSTALLS = ../../debug/crashonexit_helper
+ } else {
+ TARGET = ../../release/tst_qthreadstorage
+ !android:!winrt: TEST_HELPER_INSTALLS = ../../release/crashonexit_helper
+ }
+} else {
+ TARGET = ../tst_qthreadstorage
+ !android:!winrt: TEST_HELPER_INSTALLS = ../crashonexit_helper
+}
CONFIG += console
QT = core testlib
SOURCES = ../tst_qthreadstorage.cpp
-
-!android:!winrt: TEST_HELPER_INSTALLS = ../crashonexit/crashonexit
-
diff --git a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
index 403e28b07b..ef5d3452d5 100644
--- a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
+++ b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
@@ -48,7 +48,6 @@ class tst_QThreadStorage : public QObject
{
Q_OBJECT
private slots:
- void initTestCase();
void hasLocalData();
void localData();
void localData_const();
@@ -60,9 +59,6 @@ private slots:
void leakInDestructor();
void resetInDestructor();
void valueBased();
-
-private:
- QString m_crashOnExit;
};
class Pointer
@@ -74,22 +70,6 @@ public:
};
int Pointer::count = 0;
-void tst_QThreadStorage::initTestCase()
-{
-#if QT_CONFIG(process)
- const QString crashOnExitDir = QFINDTESTDATA("crashonexit");
- QVERIFY2(!crashOnExitDir.isEmpty(),
- qPrintable(QString::fromLatin1("Could not find 'crashonexit' starting from '%1'")
- .arg(QDir::toNativeSeparators(QDir::currentPath()))));
- m_crashOnExit = crashOnExitDir + QStringLiteral("/crashonexit");
-#ifdef Q_OS_WIN
- m_crashOnExit += QStringLiteral(".exe");
-#endif
- QVERIFY2(QFileInfo(m_crashOnExit).isExecutable(),
- qPrintable(QDir::toNativeSeparators(m_crashOnExit) + QStringLiteral(" does not exist or is not executable.")));
-#endif
-}
-
void tst_QThreadStorage::hasLocalData()
{
QThreadStorage<Pointer *> pointers;
@@ -329,7 +309,7 @@ void tst_QThreadStorage::crashOnExit()
QSKIP("No qprocess support", SkipAll);
#else
QString errorMessage;
- QVERIFY2(runCrashOnExit(m_crashOnExit, &errorMessage),
+ QVERIFY2(runCrashOnExit("crashOnExit_helper", &errorMessage),
qPrintable(errorMessage));
#endif
}
diff --git a/tests/auto/corelib/thread/thread.pro b/tests/auto/corelib/thread/thread.pro
index d3c669859b..90b8d6806e 100644
--- a/tests/auto/corelib/thread/thread.pro
+++ b/tests/auto/corelib/thread/thread.pro
@@ -1,22 +1,25 @@
TEMPLATE=subdirs
-SUBDIRS=\
- qatomicint \
- qatomicinteger \
- qatomicpointer \
- qresultstore \
- qfuture \
- qfuturesynchronizer \
- qmutex \
- qmutexlocker \
- qreadlocker \
- qreadwritelock \
- qsemaphore \
- qthread \
- qthreadonce \
- qthreadpool \
- qthreadstorage \
- qwaitcondition \
- qwritelocker
+
+qtConfig(thread) {
+ SUBDIRS=\
+ qatomicint \
+ qatomicinteger \
+ qatomicpointer \
+ qresultstore \
+ qfuture \
+ qfuturesynchronizer \
+ qmutex \
+ qmutexlocker \
+ qreadlocker \
+ qreadwritelock \
+ qsemaphore \
+ qthread \
+ qthreadonce \
+ qthreadpool \
+ qthreadstorage \
+ qwaitcondition \
+ qwritelocker
+}
qtHaveModule(concurrent) {
SUBDIRS += \
diff --git a/tests/auto/corelib/tools/collections/tst_collections.cpp b/tests/auto/corelib/tools/collections/tst_collections.cpp
index 38366e86ff..b40b1f0624 100644
--- a/tests/auto/corelib/tools/collections/tst_collections.cpp
+++ b/tests/auto/corelib/tools/collections/tst_collections.cpp
@@ -2620,6 +2620,8 @@ void testLinkedListLikeStlIterators()
QVERIFY(i2 == c2);
QVERIFY(c2 == i2);
QVERIFY(c2 == c2);
+ QVERIFY(1 + i1 == i1 + 1);
+ QVERIFY(1 + c1 == c1 + 1);
QVERIFY(i1 != i2);
QVERIFY(i1 != c2);
@@ -2731,6 +2733,8 @@ void testMapLikeStlIterators()
QVERIFY(i2 == c2);
QVERIFY(c2 == i2);
QVERIFY(c2 == c2);
+ QVERIFY(1 + i1 == i1 + 1);
+ QVERIFY(1 + c1 == c1 + 1);
QVERIFY(i1 != i2);
QVERIFY(i1 != c2);
diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
index 338adaabf7..1ed41793dc 100644
--- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
+++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
@@ -106,6 +106,8 @@ private slots:
void number();
void toInt_data();
void toInt();
+ void toDouble_data();
+ void toDouble();
void blockSizeCalculations();
void resizeAfterFromRawData();
@@ -141,6 +143,8 @@ private slots:
#endif
void toUpperLower_data();
void toUpperLower();
+ void isUpper();
+ void isLower();
void macTypes();
@@ -856,15 +860,38 @@ void tst_QByteArray::qstricmp()
if ( actual != 0 ) {
actual = (actual < 0 ? -1 : 1);
}
- QCOMPARE(expected, actual);
+ QCOMPARE(actual, expected);
+
+ actual = ::qstricmp("012345679abcd" + str1.toLatin1(), "012345679AbCd" + str2.toLatin1());
+ if ( actual != 0 ) {
+ actual = (actual < 0 ? -1 : 1);
+ }
+ QCOMPARE(actual, expected);
+
+ actual = str1.toLatin1().compare(str2.toLatin1(), Qt::CaseInsensitive);
+ if ( actual != 0 ) {
+ actual = (actual < 0 ? -1 : 1);
+ }
+ QCOMPARE(actual, expected);
+
+ actual = str1.toLatin1().compare(str2.toLatin1().constData(), Qt::CaseInsensitive);
+ if ( actual != 0 ) {
+ actual = (actual < 0 ? -1 : 1);
+ }
+ QCOMPARE(actual, expected);
}
void tst_QByteArray::qstricmp_singularities()
{
QCOMPARE(::qstricmp(0, 0), 0);
- QVERIFY(::qstricmp(0, "a") != 0);
- QVERIFY(::qstricmp("a", 0) != 0);
+ QVERIFY(::qstricmp(0, "a") < 0);
+ QVERIFY(::qstricmp("a", 0) > 0);
QCOMPARE(::qstricmp("", ""), 0);
+ QCOMPARE(QByteArray().compare(nullptr, Qt::CaseInsensitive), 0);
+ QCOMPARE(QByteArray().compare("", Qt::CaseInsensitive), 0);
+ QVERIFY(QByteArray("a").compare(nullptr, Qt::CaseInsensitive) > 0);
+ QVERIFY(QByteArray("a").compare("", Qt::CaseInsensitive) > 0);
+ QVERIFY(QByteArray().compare("a", Qt::CaseInsensitive) < 0);
}
void tst_QByteArray::qstrnicmp_singularities()
@@ -874,6 +901,9 @@ void tst_QByteArray::qstrnicmp_singularities()
QVERIFY(::qstrnicmp("a", 0, 123) != 0);
QCOMPARE(::qstrnicmp("", "", 123), 0);
QCOMPARE(::qstrnicmp("a", "B", 0), 0);
+ QCOMPARE(QByteArray().compare(QByteArray(), Qt::CaseInsensitive), 0);
+ QVERIFY(QByteArray().compare(QByteArray("a"), Qt::CaseInsensitive) < 0);
+ QVERIFY(QByteArray("a").compare(QByteArray(), Qt::CaseInsensitive) > 0);
}
void tst_QByteArray::chop_data()
@@ -1289,6 +1319,11 @@ void tst_QByteArray::toInt_data()
QTest::newRow("base 0-3") << QByteArray("010") << 0 << int(8) << true;
QTest::newRow("empty") << QByteArray() << 0 << int(0) << false;
+ QTest::newRow("leading space") << QByteArray(" 100") << 10 << int(100) << true;
+ QTest::newRow("trailing space") << QByteArray("100 ") << 10 << int(100) << true;
+ QTest::newRow("leading junk") << QByteArray("x100") << 10 << int(0) << false;
+ QTest::newRow("trailing junk") << QByteArray("100x") << 10 << int(0) << false;
+
// using fromRawData
QTest::newRow("raw1") << QByteArray::fromRawData("1", 1) << 10 << 1 << true;
QTest::newRow("raw2") << QByteArray::fromRawData("1foo", 1) << 10 << 1 << true;
@@ -1313,6 +1348,34 @@ void tst_QByteArray::toInt()
QCOMPARE( number, expectednumber );
}
+void tst_QByteArray::toDouble_data()
+{
+ QTest::addColumn<QByteArray>("string");
+ QTest::addColumn<double>("expectedNumber");
+ QTest::addColumn<bool>("expectedOk");
+
+ QTest::newRow("decimal") << QByteArray("1.2345") << 1.2345 << true;
+ QTest::newRow("exponent lowercase") << QByteArray("1.2345e+01") << 12.345 << true;
+ QTest::newRow("exponent uppercase") << QByteArray("1.2345E+02") << 123.45 << true;
+ QTest::newRow("leading spaces") << QByteArray(" \n\r\t1.2345") << 1.2345 << true;
+ QTest::newRow("trailing spaces") << QByteArray("1.2345 \n\r\t") << 1.2345 << true;
+ QTest::newRow("leading junk") << QByteArray("x1.2345") << 0.0 << false;
+ QTest::newRow("trailing junk") << QByteArray("1.2345x") << 0.0 << false;
+}
+
+void tst_QByteArray::toDouble()
+{
+ QFETCH(QByteArray, string);
+ QFETCH(double, expectedNumber);
+ QFETCH(bool, expectedOk);
+
+ bool ok;
+ const double number = string.toDouble(&ok);
+
+ QCOMPARE(ok, expectedOk);
+ QCOMPARE(number, expectedNumber);
+}
+
void tst_QByteArray::toULong_data()
{
QTest::addColumn<QByteArray>("str");
@@ -1326,6 +1389,11 @@ void tst_QByteArray::toULong_data()
QTest::newRow("empty") << QByteArray("") << 10 << 0UL << false;
QTest::newRow("ulong1") << QByteArray("3234567890") << 10 << 3234567890UL << true;
QTest::newRow("ulong2") << QByteArray("fFFfFfFf") << 16 << 0xFFFFFFFFUL << true;
+
+ QTest::newRow("leading spaces") << QByteArray(" \n\r\t100") << 10 << 100UL << true;
+ QTest::newRow("trailing spaces") << QByteArray("100 \n\r\t") << 10 << 100UL << true;
+ QTest::newRow("leading junk") << QByteArray("x100") << 10 << 0UL << false;
+ QTest::newRow("trailing junk") << QByteArray("100x") << 10 << 0UL << false;
}
void tst_QByteArray::toULong()
@@ -1351,6 +1419,10 @@ void tst_QByteArray::toULongLong_data()
QTest::newRow("default") << QByteArray() << 10 << (qulonglong)0 << false;
QTest::newRow("out of base bound") << QByteArray("c") << 10 << (qulonglong)0 << false;
+ QTest::newRow("leading spaces") << QByteArray(" \n\r\t100") << 10 << qulonglong(100) << true;
+ QTest::newRow("trailing spaces") << QByteArray("100 \n\r\t") << 10 << qulonglong(100) << true;
+ QTest::newRow("leading junk") << QByteArray("x100") << 10 << qulonglong(0) << false;
+ QTest::newRow("trailing junk") << QByteArray("100x") << 10 << qulonglong(0) << false;
}
void tst_QByteArray::toULongLong()
@@ -1757,6 +1829,12 @@ void tst_QByteArray::compare()
const bool isLess = result < 0;
const bool isGreater = result > 0;
+ int cmp = str1.compare(str2);
+ if (cmp)
+ cmp = (cmp < 0 ? -1 : 1);
+
+ QCOMPARE(cmp, result);
+
// basic tests:
QCOMPARE(str1 == str2, isEqual);
QCOMPARE(str1 < str2, isLess);
@@ -2188,6 +2266,51 @@ void tst_QByteArray::toUpperLower()
QCOMPARE(qMove(copy).toUpper(), upper);
}
+void tst_QByteArray::isUpper()
+{
+ QVERIFY(!QByteArray().isUpper());
+ QVERIFY(!QByteArray("").isUpper());
+ QVERIFY(QByteArray("TEXT").isUpper());
+ QVERIFY(QByteArray("\xD0\xDE").isUpper());
+ QVERIFY(!QByteArray("\xD7").isUpper()); // multiplication sign is not upper
+ QVERIFY(!QByteArray("\xDF").isUpper()); // sz ligature is not upper
+ QVERIFY(!QByteArray("text").isUpper());
+ QVERIFY(!QByteArray("Text").isUpper());
+ QVERIFY(!QByteArray("tExt").isUpper());
+ QVERIFY(!QByteArray("teXt").isUpper());
+ QVERIFY(!QByteArray("texT").isUpper());
+ QVERIFY(!QByteArray("TExt").isUpper());
+ QVERIFY(!QByteArray("teXT").isUpper());
+ QVERIFY(!QByteArray("tEXt").isUpper());
+ QVERIFY(!QByteArray("tExT").isUpper());
+ QVERIFY(!QByteArray("@ABYZ[").isUpper());
+ QVERIFY(!QByteArray("@abyz[").isUpper());
+ QVERIFY(!QByteArray("`ABYZ{").isUpper());
+ QVERIFY(!QByteArray("`abyz{").isUpper());
+}
+
+void tst_QByteArray::isLower()
+{
+ QVERIFY(!QByteArray().isLower());
+ QVERIFY(!QByteArray("").isLower());
+ QVERIFY(QByteArray("text").isLower());
+ QVERIFY(QByteArray("\xE0\xFF").isLower());
+ QVERIFY(!QByteArray("\xF7").isLower()); // division sign is not lower
+ QVERIFY(!QByteArray("Text").isLower());
+ QVERIFY(!QByteArray("tExt").isLower());
+ QVERIFY(!QByteArray("teXt").isLower());
+ QVERIFY(!QByteArray("texT").isLower());
+ QVERIFY(!QByteArray("TExt").isLower());
+ QVERIFY(!QByteArray("teXT").isLower());
+ QVERIFY(!QByteArray("tEXt").isLower());
+ QVERIFY(!QByteArray("tExT").isLower());
+ QVERIFY(!QByteArray("TEXT").isLower());
+ QVERIFY(!QByteArray("@ABYZ[").isLower());
+ QVERIFY(!QByteArray("@abyz[").isLower());
+ QVERIFY(!QByteArray("`ABYZ{").isLower());
+ QVERIFY(!QByteArray("`abyz{").isLower());
+}
+
void tst_QByteArray::macTypes()
{
#ifndef Q_OS_MAC
diff --git a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
index 4b362a9825..62c29229e1 100644
--- a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
+++ b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
@@ -100,7 +100,7 @@ void tst_QCommandLineParser::testInvalidOptions()
QCoreApplication app(empty_argc, empty_argv);
QCommandLineParser parser;
QTest::ignoreMessage(QtWarningMsg, "QCommandLineOption: Option names cannot start with a '-'");
- parser.addOption(QCommandLineOption(QStringLiteral("-v"), QStringLiteral("Displays version information.")));
+ QVERIFY(!parser.addOption(QCommandLineOption(QStringLiteral("-v"), QStringLiteral("Displays version information."))));
}
void tst_QCommandLineParser::testPositionalArguments()
@@ -336,7 +336,7 @@ void tst_QCommandLineParser::testDoubleDash()
QCoreApplication app(empty_argc, empty_argv);
QCommandLineParser parser;
- parser.addOption(QCommandLineOption(QStringList() << "o" << "output", QStringLiteral("Output file"), QStringLiteral("filename")));
+ QVERIFY(parser.addOption(QCommandLineOption(QStringList() << "o" << "output", QStringLiteral("Output file"), QStringLiteral("filename"))));
parser.setSingleDashWordOptionMode(parsingMode);
QVERIFY(parser.parse(QStringList() << "tst_qcommandlineparser" << "--output" << "foo"));
QCOMPARE(parser.value("output"), QString("foo"));
@@ -382,7 +382,7 @@ void tst_QCommandLineParser::testMissingOptionValue()
{
QCoreApplication app(empty_argc, empty_argv);
QCommandLineParser parser;
- parser.addOption(QCommandLineOption(QStringLiteral("option"), QStringLiteral("An option"), "value"));
+ QVERIFY(parser.addOption(QCommandLineOption(QStringLiteral("option"), QStringLiteral("An option"), "value")));
QVERIFY(!parser.parse(QStringList() << "argv0" << "--option")); // the user forgot to pass a value for --option
QCOMPARE(parser.value("option"), QString());
QCOMPARE(parser.errorText(), QString("Missing value after '--option'."));
@@ -400,8 +400,8 @@ void tst_QCommandLineParser::testStdinArgument()
QCoreApplication app(empty_argc, empty_argv);
QCommandLineParser parser;
parser.setSingleDashWordOptionMode(parsingMode);
- parser.addOption(QCommandLineOption(QStringList() << "i" << "input", QStringLiteral("Input file."), QStringLiteral("filename")));
- parser.addOption(QCommandLineOption("b", QStringLiteral("Boolean option.")));
+ QVERIFY(parser.addOption(QCommandLineOption(QStringList() << "i" << "input", QStringLiteral("Input file."), QStringLiteral("filename"))));
+ QVERIFY(parser.addOption(QCommandLineOption("b", QStringLiteral("Boolean option."))));
QVERIFY(parser.parse(QStringList() << "tst_qcommandlineparser" << "--input" << "-"));
QCOMPARE(parser.value("input"), QString("-"));
QCOMPARE(parser.positionalArguments(), QStringList());
@@ -471,14 +471,14 @@ void tst_QCommandLineParser::testSingleDashWordOptionModes()
QCoreApplication app(empty_argc, empty_argv);
QCommandLineParser parser;
parser.setSingleDashWordOptionMode(parsingMode);
- parser.addOption(QCommandLineOption("a", QStringLiteral("a option.")));
- parser.addOption(QCommandLineOption("b", QStringLiteral("b option.")));
- parser.addOption(QCommandLineOption(QStringList() << "c" << "abc", QStringLiteral("c option."), QStringLiteral("value")));
- parser.addOption(QCommandLineOption("nn", QStringLiteral("nn option.")));
+ QVERIFY(parser.addOption(QCommandLineOption("a", QStringLiteral("a option."))));
+ QVERIFY(parser.addOption(QCommandLineOption("b", QStringLiteral("b option."))));
+ QVERIFY(parser.addOption(QCommandLineOption(QStringList() << "c" << "abc", QStringLiteral("c option."), QStringLiteral("value"))));
+ QVERIFY(parser.addOption(QCommandLineOption("nn", QStringLiteral("nn option."))));
QCommandLineOption forceShort(QStringLiteral("I"), QStringLiteral("always short option"),
QStringLiteral("path"), QStringLiteral("default"));
forceShort.setFlags(QCommandLineOption::ShortOptionStyle);
- parser.addOption(forceShort);
+ QVERIFY(parser.addOption(forceShort));
QVERIFY(parser.parse(commandLine));
QCOMPARE(parser.optionNames(), expectedOptionNames);
for (int i = 0; i < expectedOptionValues.count(); ++i)
@@ -493,11 +493,11 @@ void tst_QCommandLineParser::testCpp11StyleInitialization()
QCommandLineParser parser;
// primarily check that this compiles:
- parser.addOptions({
+ QVERIFY(parser.addOptions({
{ "a", "The A option." },
{ { "v", "verbose" }, "The verbose option." },
{ { "i", "infile" }, "The input file.", "value" },
- });
+ }));
// but do a very basic functionality test, too:
QVERIFY(parser.parse({"tst_QCommandLineParser", "-a", "-vvv", "--infile=in.txt"}));
QCOMPARE(parser.optionNames(), (QStringList{"a", "v", "v", "v", "infile"}));
diff --git a/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp b/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp
index 17a0f3edd9..3eef7631c8 100644
--- a/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp
+++ b/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp
@@ -29,6 +29,7 @@
#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
+#include <QtCore/QMetaEnum>
Q_DECLARE_METATYPE(QCryptographicHash::Algorithm)
@@ -45,6 +46,7 @@ private slots:
void sha3();
void files_data();
void files();
+ void hashLength();
};
void tst_QCryptographicHash::repeated_result_data()
@@ -291,6 +293,15 @@ void tst_QCryptographicHash::files()
}
}
+void tst_QCryptographicHash::hashLength()
+{
+ auto metaEnum = QMetaEnum::fromType<QCryptographicHash::Algorithm>();
+ for (int i = 0, value = metaEnum.value(i); value != -1; value = metaEnum.value(++i)) {
+ auto algorithm = QCryptographicHash::Algorithm(value);
+ QByteArray output = QCryptographicHash::hash(QByteArrayLiteral("test"), algorithm);
+ QCOMPARE(QCryptographicHash::hashLength(algorithm), output.length());
+ }
+}
QTEST_MAIN(tst_QCryptographicHash)
#include "tst_qcryptographichash.moc"
diff --git a/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp
index 79309f960d..0196dd2d23 100644
--- a/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp
+++ b/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp
@@ -423,7 +423,12 @@ void tst_QEasingCurve::setCustomType()
QCOMPARE(curve.valueForProgress(0.15), 0.1);
QCOMPARE(curve.valueForProgress(0.20), 0.2);
QCOMPARE(curve.valueForProgress(0.25), 0.2);
+ // QTBUG-69947, MinGW 7.3 returns 0.2
+#if defined(Q_CC_MINGW)
+#if !defined(__GNUC__) || __GNUC__ != 7 || __GNUC_MINOR__ < 3
QCOMPARE(curve.valueForProgress(0.30), 0.3);
+#endif
+#endif
QCOMPARE(curve.valueForProgress(0.35), 0.3);
QCOMPARE(curve.valueForProgress(0.999999), 0.9);
diff --git a/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp b/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp
index f545ead1f1..e89e634841 100644
--- a/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp
+++ b/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp
@@ -159,6 +159,8 @@ void tst_QExplicitlySharedDataPointer::data() const
{
QExplicitlySharedDataPointer<const MyClass> pointer;
QCOMPARE(pointer.data(), static_cast<const MyClass *>(0));
+ QVERIFY(pointer == nullptr);
+ QVERIFY(nullptr == pointer);
}
/* On const pointer. Must not mutate the pointer. */
@@ -168,6 +170,9 @@ void tst_QExplicitlySharedDataPointer::data() const
/* Check that this cast is possible. */
static_cast<const MyClass *>(pointer.data());
+
+ QVERIFY(! (pointer == nullptr));
+ QVERIFY(! (nullptr == pointer));
}
/* On mutatable pointer. Must not mutate the pointer. */
diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
index b7cb8a1bdc..261689d401 100644
--- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
+++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
@@ -78,6 +78,7 @@ private slots:
#endif
void ctor();
+ void emptyCtor_data();
void emptyCtor();
void consistentC();
void matchingLocales();
@@ -118,8 +119,10 @@ private slots:
void monthName();
void standaloneMonthName();
- void defaultNumeringSystem();
+ void defaultNumberingSystem_data();
+ void defaultNumberingSystem();
+ void ampm_data();
void ampm();
void currency();
void quoteString();
@@ -127,6 +130,7 @@ private slots:
void weekendDays();
void listPatterns();
+ void measurementSystems_data();
void measurementSystems();
void QTBUG_26035_positivesign();
@@ -135,6 +139,7 @@ private slots:
void formattedDataSize_data();
void formattedDataSize();
+ void bcp47Name_data();
void bcp47Name();
void systemLocale_data();
@@ -145,6 +150,7 @@ private slots:
// QLocale::setDefault() *must* appear *after* all other tests !
void defaulted_ctor(); // This one must be the first of these.
void legacyNames();
+ void unixLocaleName_data();
void unixLocaleName();
void testNames_data();
void testNames();
@@ -152,6 +158,7 @@ private slots:
private:
QString m_decimal, m_thousand, m_sdate, m_ldate, m_time;
QString m_sysapp;
+ QStringList cleanEnv;
bool europeanTimeZone;
};
@@ -184,6 +191,14 @@ void tst_QLocale::initTestCase()
QVERIFY2(fi.exists() && fi.isExecutable(),
qPrintable(QDir::toNativeSeparators(m_sysapp)
+ QStringLiteral(" does not exist or is not executable.")));
+
+ // Get an environment free of any locale-related variables
+ cleanEnv.clear();
+ foreach (QString const& entry, QProcess::systemEnvironment()) {
+ if (entry.startsWith("LANG=") || entry.startsWith("LC_") || entry.startsWith("LANGUAGE="))
+ continue;
+ cleanEnv << entry;
+ }
#endif // QT_CONFIG(process)
}
@@ -214,32 +229,48 @@ void tst_QLocale::ctor()
}
// Exact matches
- TEST_CTOR(Chinese, SimplifiedHanScript, China, QLocale::Chinese, QLocale::SimplifiedHanScript, QLocale::China);
- TEST_CTOR(Chinese, TraditionalHanScript, Taiwan, QLocale::Chinese, QLocale::TraditionalHanScript, QLocale::Taiwan);
- TEST_CTOR(Chinese, TraditionalHanScript, HongKong, QLocale::Chinese, QLocale::TraditionalHanScript, QLocale::HongKong);
+ TEST_CTOR(Chinese, SimplifiedHanScript, China,
+ QLocale::Chinese, QLocale::SimplifiedHanScript, QLocale::China);
+ TEST_CTOR(Chinese, TraditionalHanScript, Taiwan,
+ QLocale::Chinese, QLocale::TraditionalHanScript, QLocale::Taiwan);
+ TEST_CTOR(Chinese, TraditionalHanScript, HongKong,
+ QLocale::Chinese, QLocale::TraditionalHanScript, QLocale::HongKong);
// Best match for AnyCountry
- TEST_CTOR(Chinese, SimplifiedHanScript, AnyCountry, QLocale::Chinese, QLocale::SimplifiedHanScript, QLocale::China);
- TEST_CTOR(Chinese, TraditionalHanScript, AnyCountry, QLocale::Chinese, QLocale::TraditionalHanScript, QLocale::Taiwan);
+ TEST_CTOR(Chinese, SimplifiedHanScript, AnyCountry,
+ QLocale::Chinese, QLocale::SimplifiedHanScript, QLocale::China);
+ TEST_CTOR(Chinese, TraditionalHanScript, AnyCountry,
+ QLocale::Chinese, QLocale::TraditionalHanScript, QLocale::Taiwan);
// Best match for AnyScript (and change country to supported one, if necessary)
- TEST_CTOR(Chinese, AnyScript, China, QLocale::Chinese, QLocale::SimplifiedHanScript, QLocale::China);
- TEST_CTOR(Chinese, AnyScript, Taiwan, QLocale::Chinese, QLocale::TraditionalHanScript, QLocale::Taiwan);
- TEST_CTOR(Chinese, AnyScript, HongKong, QLocale::Chinese, QLocale::TraditionalHanScript, QLocale::HongKong);
- TEST_CTOR(Chinese, AnyScript, UnitedStates, QLocale::Chinese, QLocale::SimplifiedHanScript, QLocale::China);
+ TEST_CTOR(Chinese, AnyScript, China,
+ QLocale::Chinese, QLocale::SimplifiedHanScript, QLocale::China);
+ TEST_CTOR(Chinese, AnyScript, Taiwan,
+ QLocale::Chinese, QLocale::TraditionalHanScript, QLocale::Taiwan);
+ TEST_CTOR(Chinese, AnyScript, HongKong,
+ QLocale::Chinese, QLocale::TraditionalHanScript, QLocale::HongKong);
+ TEST_CTOR(Chinese, AnyScript, UnitedStates,
+ QLocale::Chinese, QLocale::SimplifiedHanScript, QLocale::China);
// Fully-specified not found; find best alternate country
- TEST_CTOR(Chinese, SimplifiedHanScript, Taiwan, QLocale::Chinese, QLocale::SimplifiedHanScript, QLocale::China);
- TEST_CTOR(Chinese, SimplifiedHanScript, UnitedStates, QLocale::Chinese, QLocale::SimplifiedHanScript, QLocale::China);
- TEST_CTOR(Chinese, TraditionalHanScript, China, QLocale::Chinese, QLocale::TraditionalHanScript, QLocale::Taiwan);
- TEST_CTOR(Chinese, TraditionalHanScript, UnitedStates, QLocale::Chinese, QLocale::TraditionalHanScript, QLocale::Taiwan);
+ TEST_CTOR(Chinese, SimplifiedHanScript, Taiwan,
+ QLocale::Chinese, QLocale::SimplifiedHanScript, QLocale::China);
+ TEST_CTOR(Chinese, SimplifiedHanScript, UnitedStates,
+ QLocale::Chinese, QLocale::SimplifiedHanScript, QLocale::China);
+ TEST_CTOR(Chinese, TraditionalHanScript, China,
+ QLocale::Chinese, QLocale::TraditionalHanScript, QLocale::Taiwan);
+ TEST_CTOR(Chinese, TraditionalHanScript, UnitedStates,
+ QLocale::Chinese, QLocale::TraditionalHanScript, QLocale::Taiwan);
// Fully-specified not found; find best alternate script
- TEST_CTOR(Chinese, LatinScript, China, QLocale::Chinese, QLocale::SimplifiedHanScript, QLocale::China);
- TEST_CTOR(Chinese, LatinScript, Taiwan, QLocale::Chinese, QLocale::TraditionalHanScript, QLocale::Taiwan);
+ TEST_CTOR(Chinese, LatinScript, China,
+ QLocale::Chinese, QLocale::SimplifiedHanScript, QLocale::China);
+ TEST_CTOR(Chinese, LatinScript, Taiwan,
+ QLocale::Chinese, QLocale::TraditionalHanScript, QLocale::Taiwan);
// Fully-specified not found; find best alternate country and script
- TEST_CTOR(Chinese, LatinScript, UnitedStates, QLocale::Chinese, QLocale::SimplifiedHanScript, QLocale::China);
+ TEST_CTOR(Chinese, LatinScript, UnitedStates,
+ QLocale::Chinese, QLocale::SimplifiedHanScript, QLocale::China);
#undef TEST_CTOR
}
@@ -278,7 +309,8 @@ void tst_QLocale::defaulted_ctor()
TEST_CTOR(French, France, QLocale::French, QLocale::France)
TEST_CTOR(C, France, QLocale::C, QLocale::AnyCountry)
- TEST_CTOR(Spanish, LatinAmericaAndTheCaribbean, QLocale::Spanish, QLocale::LatinAmericaAndTheCaribbean)
+ TEST_CTOR(Spanish, LatinAmerica, QLocale::Spanish,
+ QLocale::LatinAmerica)
QLocale::setDefault(QLocale(QLocale::English, QLocale::France));
@@ -370,8 +402,9 @@ void tst_QLocale::defaulted_ctor()
QVERIFY2(l.language() == QLocale::exp_lang \
&& l.country() == QLocale::exp_country, \
QString("requested: \"" + QString(req_lc) + "\", got: " \
- + QLocale::languageToString(l.language()) \
- + QLatin1Char('/') + QLocale::countryToString(l.country())).toLatin1().constData()); \
+ + QLocale::languageToString(l.language()) \
+ + QLatin1Char('/') \
+ + QLocale::countryToString(l.country())).toLatin1().constData()); \
QCOMPARE(l, QLocale(QLocale::exp_lang, QLocale::exp_country)); \
QCOMPARE(qHash(l), qHash(QLocale(QLocale::exp_lang, QLocale::exp_country))); \
}
@@ -405,6 +438,8 @@ void tst_QLocale::defaulted_ctor()
TEST_CTOR("en_GB@bla", English, UnitedKingdom)
TEST_CTOR("en-GB", English, UnitedKingdom)
TEST_CTOR("en-GB@bla", English, UnitedKingdom)
+ TEST_CTOR("eo", Esperanto, World)
+ TEST_CTOR("yi", Yiddish, World)
QVERIFY(QLocale::Norwegian == QLocale::NorwegianBokmal);
TEST_CTOR("no", Norwegian, Norway)
@@ -414,8 +449,8 @@ void tst_QLocale::defaulted_ctor()
TEST_CTOR("nb_NO", Norwegian, Norway)
TEST_CTOR("nn_NO", NorwegianNynorsk, Norway)
TEST_CTOR("es_ES", Spanish, Spain)
- TEST_CTOR("es_419", Spanish, LatinAmericaAndTheCaribbean)
- TEST_CTOR("es-419", Spanish, LatinAmericaAndTheCaribbean)
+ TEST_CTOR("es_419", Spanish, LatinAmerica)
+ TEST_CTOR("es-419", Spanish, LatinAmerica)
TEST_CTOR("fr_MA", French, Morocco)
// test default countries for languages
@@ -464,7 +499,8 @@ static inline bool runSysApp(const QString &binary,
process.start(binary);
process.closeWriteChannel();
if (!process.waitForStarted()) {
- *errorMessage = QString::fromLatin1("Cannot start '%1': %2").arg(binary, process.errorString());
+ *errorMessage = QLatin1String("Cannot start '") + binary
+ + QLatin1String("': ") + process.errorString();
return false;
}
if (!process.waitForFinished()) {
@@ -488,94 +524,121 @@ static inline bool runSysAppTest(const QString &binary,
return false;
if (output.isEmpty()) {
- *errorMessage = QString::fromLatin1("Empty output received for requested '%1' (expected '%2')").
- arg(requestedLocale, expectedOutput);
+ *errorMessage = QLatin1String("Empty output received for requested '") + requestedLocale
+ + QLatin1String("' (expected '") + expectedOutput + QLatin1String("')");
return false;
}
if (output != expectedOutput) {
- *errorMessage = QString::fromLatin1("Output mismatch for requested '%1': Expected '%2', got '%3'").
- arg(requestedLocale, expectedOutput, output);
+ *errorMessage = QLatin1String("Output mismatch for requested '") + requestedLocale
+ + QLatin1String("': Expected '") + expectedOutput + QLatin1String("', got '")
+ + output + QLatin1String("'");
return false;
}
return true;
}
#endif
-void tst_QLocale::emptyCtor()
+void tst_QLocale::emptyCtor_data()
{
#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
-#else
+#endif
#ifdef Q_OS_ANDROID
QSKIP("This test crashes on Android");
#endif
-#define TEST_CTOR(req_lc, exp_str) \
- { \
- /* Test constructor without arguments. Needs separate process */ \
- /* because of caching of the system locale. */ \
- QString errorMessage; \
- QVERIFY2(runSysAppTest(m_sysapp, env, QLatin1String(req_lc), QLatin1String(exp_str), &errorMessage), \
- qPrintable(errorMessage)); \
- }
- // Get an environment free of any locale-related variables
- QStringList env;
- foreach (QString const& entry, QProcess::systemEnvironment()) {
- if (entry.startsWith("LANG=") || entry.startsWith("LC_") || entry.startsWith("LANGUAGE="))
- continue;
- env << entry;
- }
+ QTest::addColumn<QString>("expected");
+
+#define ADD_CTOR_TEST(give, expect) QTest::newRow(give) << QStringLiteral(expect);
+
+ // For format and meaning, see:
+ // http://pubs.opengroup.org/onlinepubs/7908799/xbd/envvar.html
+ // Note that the accepted values for fields are implementation-dependent;
+ // the template is language[_territory][.codeset][@modifier]
+
+ // Vanilla:
+ ADD_CTOR_TEST("C", "C");
+
+ // Standard forms:
+ ADD_CTOR_TEST("en", "en_US");
+ ADD_CTOR_TEST("en_GB", "en_GB");
+ ADD_CTOR_TEST("de", "de_DE");
+ // Norsk has some quirks:
+ ADD_CTOR_TEST("no", "nb_NO");
+ ADD_CTOR_TEST("nb", "nb_NO");
+ ADD_CTOR_TEST("nn", "nn_NO");
+ ADD_CTOR_TEST("no_NO", "nb_NO");
+ ADD_CTOR_TEST("nb_NO", "nb_NO");
+ ADD_CTOR_TEST("nn_NO", "nn_NO");
+
+ // Not too fussy about case:
+ ADD_CTOR_TEST("DE", "de_DE");
+ ADD_CTOR_TEST("EN", "en_US");
+
+ // Invalid fields
+ ADD_CTOR_TEST("bla", "C");
+ ADD_CTOR_TEST("zz", "C");
+ ADD_CTOR_TEST("zz_zz", "C");
+ ADD_CTOR_TEST("zz...", "C");
+ ADD_CTOR_TEST("en.bla", "en_US");
+#if !(defined(Q_OS_DARWIN) && QT_HAS_FEATURE(address_sanitizer))
+ // See QTBUG-69875
+ ADD_CTOR_TEST("en@bla", "en_US");
+#endif
+ ADD_CTOR_TEST("en_blaaa", "en_US");
+ ADD_CTOR_TEST("en_zz", "en_US");
+ ADD_CTOR_TEST("en_GB.bla", "en_GB");
+ ADD_CTOR_TEST("en_GB@.bla", "en_GB");
+ ADD_CTOR_TEST("en_GB@bla", "en_GB");
+
+ // Empty optional fields, but with punctuators supplied
+ ADD_CTOR_TEST("en.", "en_US");
+#if !(defined(Q_OS_DARWIN) && QT_HAS_FEATURE(address_sanitizer))
+ // See QTBUG-69875
+ ADD_CTOR_TEST("en@", "en_US");
+#endif
+ ADD_CTOR_TEST("en.@", "en_US");
+ ADD_CTOR_TEST("en_", "en_US");
+ ADD_CTOR_TEST("en_.", "en_US");
+ ADD_CTOR_TEST("en_.@", "en_US");
+#undef ADD_CTOR_TEST
+#if QT_CONFIG(process) // for runSysApp
// Get default locale.
QString defaultLoc;
QString errorMessage;
- QVERIFY2(runSysApp(m_sysapp, env, &defaultLoc, &errorMessage),
- qPrintable(errorMessage));
-
- TEST_CTOR("C", "C")
- TEST_CTOR("bla", "C")
- TEST_CTOR("zz", "C")
- TEST_CTOR("zz_zz", "C")
- TEST_CTOR("zz...", "C")
- TEST_CTOR("en", "en_US")
- TEST_CTOR("en", "en_US")
- TEST_CTOR("en.", "en_US")
- TEST_CTOR("en@", "en_US")
- TEST_CTOR("en.@", "en_US")
- TEST_CTOR("en_", "en_US")
- TEST_CTOR("en_.", "en_US")
- TEST_CTOR("en_.@", "en_US")
- TEST_CTOR("en.bla", "en_US")
- TEST_CTOR("en@bla", "en_US")
- TEST_CTOR("en_blaaa", "en_US")
- TEST_CTOR("en_zz", "en_US")
- TEST_CTOR("en_GB", "en_GB")
- TEST_CTOR("en_GB.bla", "en_GB")
- TEST_CTOR("en_GB@.bla", "en_GB")
- TEST_CTOR("en_GB@bla", "en_GB")
- TEST_CTOR("de", "de_DE")
-
- QVERIFY(QLocale::Norwegian == QLocale::NorwegianBokmal);
- TEST_CTOR("no", "nb_NO")
- TEST_CTOR("nb", "nb_NO")
- TEST_CTOR("nn", "nn_NO")
- TEST_CTOR("no_NO", "nb_NO")
- TEST_CTOR("nb_NO", "nb_NO")
- TEST_CTOR("nn_NO", "nn_NO")
+ if (runSysApp(m_sysapp, cleanEnv, &defaultLoc, &errorMessage)) {
+#define ADD_CTOR_TEST(give) QTest::newRow(give) << defaultLoc;
+ ADD_CTOR_TEST("en/");
+ ADD_CTOR_TEST("asdfghj");
+ ADD_CTOR_TEST("123456");
+#undef ADD_CTOR_TEST
+ } else {
+ qDebug() << "Skipping tests based on default locale" << qPrintable(errorMessage);
+ }
+#endif // process
+}
- TEST_CTOR("DE", "de_DE");
- TEST_CTOR("EN", "en_US");
+void tst_QLocale::emptyCtor()
+{
+#if QT_CONFIG(process) // for runSysAppTest
+ QLatin1String request(QTest::currentDataTag());
+ QFETCH(QString, expected);
- TEST_CTOR("en/", defaultLoc.toLatin1())
- TEST_CTOR("asdfghj", defaultLoc.toLatin1());
- TEST_CTOR("123456", defaultLoc.toLatin1());
+ // Test constructor without arguments (see syslocaleapp/syslocaleapp.cpp)
+ // Needs separate process because of caching of the system locale.
+ QString errorMessage;
+ QVERIFY2(runSysAppTest(m_sysapp, cleanEnv, request, expected, &errorMessage),
+ qPrintable(errorMessage));
-#undef TEST_CTOR
-#endif
+#else
+ // This won't be called, as _data() skipped out early.
+#endif // process
}
void tst_QLocale::legacyNames()
{
+ QVERIFY(QLocale::Norwegian == QLocale::NorwegianBokmal);
QLocale::setDefault(QLocale(QLocale::C));
#define TEST_CTOR(req_lang, req_country, exp_lang, exp_country) \
@@ -598,8 +661,9 @@ void tst_QLocale::legacyNames()
QVERIFY2(l.language() == QLocale::exp_lang \
&& l.country() == QLocale::exp_country, \
QString("requested: \"" + QString(req_lc) + "\", got: " \
- + QLocale::languageToString(l.language()) \
- + QLatin1Char('/') + QLocale::countryToString(l.country())).toLatin1().constData()); \
+ + QLocale::languageToString(l.language()) \
+ + QLatin1Char('/') \
+ + QLocale::countryToString(l.country())).toLatin1().constData()); \
}
TEST_CTOR("mo_MD", Romanian, Moldova)
@@ -649,22 +713,32 @@ void tst_QLocale::matchingLocales()
QVERIFY(locales.contains(ru_RU));
}
+void tst_QLocale::unixLocaleName_data()
+{
+ QTest::addColumn<QLocale::Language>("lang");
+ QTest::addColumn<QLocale::Country>("land");
+ QTest::addColumn<QString>("expect");
+
+#define ADDROW(nom, lang, land, name) \
+ QTest::newRow(nom) << QLocale::lang << QLocale::land << QStringLiteral(name)
+
+ ADDROW("C_any", C, AnyCountry, "C");
+ ADDROW("en_any", English, AnyCountry, "en_US");
+ ADDROW("en_GB", English, UnitedKingdom, "en_GB");
+ ADDROW("ay_GB", Aymara, UnitedKingdom, "C");
+#undef ADDROW
+}
+
void tst_QLocale::unixLocaleName()
{
-#define TEST_NAME(req_lang, req_country, exp_name) \
- { \
- QLocale l(QLocale::req_lang, QLocale::req_country); \
- QCOMPARE(l.name(), QString(exp_name)); \
- }
+ QFETCH(QLocale::Language, lang);
+ QFETCH(QLocale::Country, land);
+ QFETCH(QString, expect);
QLocale::setDefault(QLocale(QLocale::C));
- TEST_NAME(C, AnyCountry, "C")
- TEST_NAME(English, AnyCountry, "en_US")
- TEST_NAME(English, UnitedKingdom, "en_GB")
- TEST_NAME(Aymara, UnitedKingdom, "C")
-
-#undef TEST_NAME
+ QLocale locale(lang, land);
+ QCOMPARE(locale.name(), expect);
}
void tst_QLocale::stringToDouble_data()
@@ -1282,7 +1356,8 @@ void tst_QLocale::formatDate_data()
QTest::newRow("26") << QDate(1974, 12, 1) << "\"yy\"" << "\"74\"";
QTest::newRow("27") << QDate(1974, 12, 1) << "'\"yy\"'" << "\"yy\"";
QTest::newRow("28") << QDate() << "'\"yy\"'" << "";
- QTest::newRow("29") << QDate(1974, 12, 1) << "hh:mm:ss.zzz ap d'd'dd/M/yy" << "hh:mm:ss.zzz ap 1d01/12/74";
+ QTest::newRow("29")
+ << QDate(1974, 12, 1) << "hh:mm:ss.zzz ap d'd'dd/M/yy" << "hh:mm:ss.zzz ap 1d01/12/74";
QTest::newRow("dd MMMM yyyy") << QDate(1, 1, 1) << "dd MMMM yyyy" << "01 January 0001";
}
@@ -1298,7 +1373,6 @@ void tst_QLocale::formatDate()
QCOMPARE(l.toString(date, QStringView(format)), result);
}
-
void tst_QLocale::formatTime_data()
{
QTest::addColumn<QTime>("time");
@@ -1577,7 +1651,8 @@ void tst_QLocale::formatTimeZone()
QDateTime::currentDateTime().timeZoneAbbreviation());
// Time on its own will always be current local time zone
- QCOMPARE(enUS.toString(QTime(1, 2, 3), "t"), QDateTime::currentDateTime().timeZoneAbbreviation());
+ QCOMPARE(enUS.toString(QTime(1, 2, 3), "t"),
+ QDateTime::currentDateTime().timeZoneAbbreviation());
}
void tst_QLocale::toDateTime_data()
@@ -1614,7 +1689,8 @@ void tst_QLocale::toDateTime_data()
QTest::newRow("bad-hour-C") << "C" << QDateTime() << "d-MMM-yy hh:m" << "4-Jun-11 1:2";
QTest::newRow("bad-min-C") << "C" << QDateTime() << "d-MMM-yy h:mm" << "4-Jun-11 1:2";
QTest::newRow("bad-sec-C") << "C" << QDateTime() << "d-MMM-yy h:m:ss" << "4-Jun-11 1:2:3";
- QTest::newRow("bad-milli-C") << "C" << QDateTime() << "d-MMM-yy h:m:s.zzz" << "4-Jun-11 1:2:3.4";
+ QTest::newRow("bad-milli-C")
+ << "C" << QDateTime() << "d-MMM-yy h:m:s.zzz" << "4-Jun-11 1:2:3.4";
QTest::newRow("ok-C") << "C" << QDateTime(QDate(1911, 6, 4), QTime(1, 2, 3, 400))
<< "d-MMM-yy h:m:s.z" << "4-Jun-11 1:2:3.4";
@@ -1637,11 +1713,13 @@ void tst_QLocale::toDateTime_data()
QTest::newRow("12no_NO") << "no_NO" << QDateTime(QDate(1974, 12, 1), QTime(15, 0, 0))
<< "d'd'dd/M/yyh" << "1d01/12/7415";
- QTest::newRow("RFC-1123") << "C" << QDateTime(QDate(2007, 11, 1), QTime(18, 8, 30))
- << "ddd, dd MMM yyyy hh:mm:ss 'GMT'" << "Thu, 01 Nov 2007 18:08:30 GMT";
+ QTest::newRow("RFC-1123")
+ << "C" << QDateTime(QDate(2007, 11, 1), QTime(18, 8, 30))
+ << "ddd, dd MMM yyyy hh:mm:ss 'GMT'" << "Thu, 01 Nov 2007 18:08:30 GMT";
- QTest::newRow("longFormat") << "en_US" << QDateTime(QDate(2009, 1, 5), QTime(11, 48, 32))
- << "dddd, MMMM d, yyyy h:mm:ss AP " << "Monday, January 5, 2009 11:48:32 AM ";
+ QTest::newRow("longFormat")
+ << "en_US" << QDateTime(QDate(2009, 1, 5), QTime(11, 48, 32))
+ << "dddd, MMMM d, yyyy h:mm:ss AP " << "Monday, January 5, 2009 11:48:32 AM ";
}
void tst_QLocale::toDateTime()
@@ -1716,36 +1794,40 @@ void tst_QLocale::macDefaultLocale()
// To run this test make sure "Curreny" is US Dollar in System Preferences->Language & Region->Advanced.
if (locale.currencySymbol() == QString("$")) {
- QCOMPARE(locale.toCurrencyString(qulonglong(1234)), systemLocaleFormatNumber(QString("$1,234.00")));
- QCOMPARE(locale.toCurrencyString(double(1234.56)), systemLocaleFormatNumber(QString("$1,234.56")));
+ QCOMPARE(locale.toCurrencyString(qulonglong(1234)),
+ systemLocaleFormatNumber(QString("$1,234.00")));
+ QCOMPARE(locale.toCurrencyString(double(1234.56)),
+ systemLocaleFormatNumber(QString("$1,234.56")));
}
// Depending on the configured time zone, the time string might not
// contain a GMT specifier. (Sometimes it just names the zone, like "CEST")
- if (timeString.contains(QString("GMT"))) {
- QString expectedGMTSpecifierBase("GMT");
- if (diff >= 0)
- expectedGMTSpecifierBase.append(QLatin1Char('+'));
- else
- expectedGMTSpecifierBase.append(QLatin1Char('-'));
-
- QString expectedGMTSpecifier = expectedGMTSpecifierBase + QString("%1").arg(qAbs(diff));
- QString expectedGMTSpecifierZeroExtended = expectedGMTSpecifierBase + QString("0%1").arg(qAbs(diff));
-
- QVERIFY2(timeString.contains(expectedGMTSpecifier)
- || timeString.contains(expectedGMTSpecifierZeroExtended),
- qPrintable(QString("timeString `%1', expectedGMTSpecifier `%2' or `%3'")
- .arg(timeString)
- .arg(expectedGMTSpecifier)
- .arg(expectedGMTSpecifierZeroExtended)
- ));
+ QLatin1String gmt("GMT");
+ if (timeString.contains(gmt) && diff) {
+ QLatin1Char sign(diff < 0 ? '-' : '+');
+ QString number(QString::number(qAbs(diff)));
+ const QString expect = gmt + sign + number;
+
+ if (diff < 10) {
+ const QString zeroed = gmt + sign + QLatin1Char('0') + number;
+
+ QVERIFY2(timeString.contains(expect) || timeString.contains(zeroed),
+ qPrintable(QString("timeString `%1', expected GMT specifier `%2' or `%3'")
+ .arg(timeString).arg(expect).arg(zeroed)));
+ } else {
+ QVERIFY2(timeString.contains(expect),
+ qPrintable(QString("timeString `%1', expected GMT specifier `%2'")
+ .arg(timeString).arg(expect)));
+ }
}
QCOMPARE(locale.dayName(1), QString("Monday"));
QCOMPARE(locale.dayName(7), QString("Sunday"));
QCOMPARE(locale.monthName(1), QString("January"));
QCOMPARE(locale.monthName(12), QString("December"));
- QCOMPARE(locale.quoteString("string"), QString::fromUtf8("\xe2\x80\x9c" "string" "\xe2\x80\x9d"));
- QCOMPARE(locale.quoteString("string", QLocale::AlternateQuotation), QString::fromUtf8("\xe2\x80\x98" "string" "\xe2\x80\x99"));
+ QCOMPARE(locale.quoteString("string"),
+ QString::fromUtf8("\xe2\x80\x9c" "string" "\xe2\x80\x9d"));
+ QCOMPARE(locale.quoteString("string", QLocale::AlternateQuotation),
+ QString::fromUtf8("\xe2\x80\x98" "string" "\xe2\x80\x99"));
QList<Qt::DayOfWeek> days;
days << Qt::Monday << Qt::Tuesday << Qt::Wednesday << Qt::Thursday << Qt::Friday;
@@ -1787,12 +1869,6 @@ static void setWinLocaleInfo(LCTYPE type, const QString &value)
# define LOCALE_SSHORTTIME 0x00000079
#endif
-static inline LCTYPE shortTimeType()
-{
- return (QSysInfo::windowsVersion() & QSysInfo::WV_NT_based) && QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS7 ?
- LOCALE_SSHORTTIME : LOCALE_STIMEFORMAT;
-}
-
class RestoreLocaleHelper {
public:
RestoreLocaleHelper() {
@@ -1800,7 +1876,7 @@ public:
m_thousand = getWinLocaleInfo(LOCALE_STHOUSAND);
m_sdate = getWinLocaleInfo(LOCALE_SSHORTDATE);
m_ldate = getWinLocaleInfo(LOCALE_SLONGDATE);
- m_time = getWinLocaleInfo(shortTimeType());
+ m_time = getWinLocaleInfo(LOCALE_SSHORTTIME);
}
~RestoreLocaleHelper() {
@@ -1809,7 +1885,7 @@ public:
setWinLocaleInfo(LOCALE_STHOUSAND, m_thousand);
setWinLocaleInfo(LOCALE_SSHORTDATE, m_sdate);
setWinLocaleInfo(LOCALE_SLONGDATE, m_ldate);
- setWinLocaleInfo(shortTimeType(), m_time);
+ setWinLocaleInfo(LOCALE_SSHORTTIME, m_time);
// make sure QLocale::system() gets updated
QLocalePrivate::updateSystemPrivate();
@@ -1819,14 +1895,9 @@ public:
};
-#endif // Q_OS_WIN
-
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
-
void tst_QLocale::windowsDefaultLocale()
{
RestoreLocaleHelper systemLocale;
- const bool win7OrLater = (QSysInfo::windowsVersion() & QSysInfo::WV_NT_based) && QSysInfo::windowsVersion();
// set weird system defaults and make sure we're using them
setWinLocaleInfo(LOCALE_SDECIMAL, QLatin1String("@"));
setWinLocaleInfo(LOCALE_STHOUSAND, QLatin1String("?"));
@@ -1835,7 +1906,7 @@ void tst_QLocale::windowsDefaultLocale()
const QString longDateFormat = QStringLiteral("d@M@yyyy");
setWinLocaleInfo(LOCALE_SLONGDATE, longDateFormat);
const QString shortTimeFormat = QStringLiteral("h^m^s");
- setWinLocaleInfo(shortTimeType(), shortTimeFormat);
+ setWinLocaleInfo(LOCALE_SSHORTTIME, shortTimeFormat);
// make sure QLocale::system() gets updated
QLocalePrivate::updateSystemPrivate();
@@ -1847,21 +1918,24 @@ void tst_QLocale::windowsDefaultLocale()
QCOMPARE(locale.dateFormat(QLocale::ShortFormat), shortDateFormat);
QCOMPARE(locale.dateFormat(QLocale::LongFormat), longDateFormat);
QCOMPARE(locale.timeFormat(QLocale::ShortFormat), shortTimeFormat);
- QCOMPARE(locale.dateTimeFormat(QLocale::ShortFormat), shortDateFormat + QLatin1Char(' ') + shortTimeFormat);
- const QString expectedLongDateTimeFormat = longDateFormat + QLatin1Char(' ')
- + (win7OrLater ? QStringLiteral("h:mm:ss AP") : shortTimeFormat);
+ QCOMPARE(locale.dateTimeFormat(QLocale::ShortFormat),
+ shortDateFormat + QLatin1Char(' ') + shortTimeFormat);
+ const QString expectedLongDateTimeFormat
+ = longDateFormat + QLatin1Char(' ') + QStringLiteral("h:mm:ss AP");
QCOMPARE(locale.dateTimeFormat(QLocale::LongFormat), expectedLongDateTimeFormat);
// make sure we are using the system to parse them
QCOMPARE(locale.toString(1234.56), QString("1?234@56"));
QCOMPARE(locale.toString(QDate(1974, 12, 1), QLocale::ShortFormat), QString("1*12*1974"));
- QCOMPARE(locale.toString(QDate(1974, 12, 1), QLocale::NarrowFormat), locale.toString(QDate(1974, 12, 1), QLocale::ShortFormat));
+ QCOMPARE(locale.toString(QDate(1974, 12, 1), QLocale::NarrowFormat),
+ locale.toString(QDate(1974, 12, 1), QLocale::ShortFormat));
QCOMPARE(locale.toString(QDate(1974, 12, 1), QLocale::LongFormat), QString("1@12@1974"));
const QString expectedFormattedShortTimeSeconds = QStringLiteral("1^2^3");
- const QString expectedFormattedShortTime = win7OrLater ? QStringLiteral("1^2") : expectedFormattedShortTimeSeconds;
+ const QString expectedFormattedShortTime = QStringLiteral("1^2");
QCOMPARE(locale.toString(QTime(1,2,3), QLocale::ShortFormat), expectedFormattedShortTime);
- QCOMPARE(locale.toString(QTime(1,2,3), QLocale::NarrowFormat), locale.toString(QTime(1,2,3), QLocale::ShortFormat));
- const QString expectedFormattedLongTime = win7OrLater ? QStringLiteral("1:02:03 AM") : expectedFormattedShortTimeSeconds;
+ QCOMPARE(locale.toString(QTime(1,2,3), QLocale::NarrowFormat),
+ locale.toString(QTime(1,2,3), QLocale::ShortFormat));
+ const QString expectedFormattedLongTime = QStringLiteral("1:02:03 AM");
QCOMPARE(locale.toString(QTime(1,2,3), QLocale::LongFormat), expectedFormattedLongTime);
QCOMPARE(locale.toString(QDateTime(QDate(1974, 12, 1), QTime(1,2,3)), QLocale::ShortFormat),
QStringLiteral("1*12*1974 ") + expectedFormattedShortTime);
@@ -1871,7 +1945,7 @@ void tst_QLocale::windowsDefaultLocale()
QStringLiteral("1@12@1974 ") + expectedFormattedLongTime);
QCOMPARE(locale.toString(QTime(1,2,3), QLocale::LongFormat), expectedFormattedLongTime);
}
-#endif // #ifdef Q_OS_WIN
+#endif // Q_OS_WIN but !Q_OS_WINRT
void tst_QLocale::numberOptions()
{
@@ -2056,17 +2130,23 @@ void tst_QLocale::dayName_data()
QTest::addColumn<int>("day");
QTest::addColumn<QLocale::FormatType>("format");
- QTest::newRow("no_NO") << QString("no_NO") << QString("tirsdag") << 2 << QLocale::LongFormat;
- QTest::newRow("nb_NO") << QString("nb_NO") << QString("tirsdag") << 2 << QLocale::LongFormat;
- QTest::newRow("nn_NO") << QString("nn_NO") << QString("tysdag") << 2 << QLocale::LongFormat;
+ QTest::newRow("no_NO") << QString("no_NO") << QString("tirsdag") << 2 << QLocale::LongFormat;
+ QTest::newRow("nb_NO") << QString("nb_NO") << QString("tirsdag") << 2 << QLocale::LongFormat;
+ QTest::newRow("nn_NO") << QString("nn_NO") << QString("tysdag") << 2 << QLocale::LongFormat;
- QTest::newRow("C long") << QString("C") << QString("Sunday") << 7 << QLocale::LongFormat;
- QTest::newRow("C short") << QString("C") << QString("Sun") << 7 << QLocale::ShortFormat;
- QTest::newRow("C narrow") << QString("C") << QString("7") << 7 << QLocale::NarrowFormat;
+ QTest::newRow("C long") << QString("C") << QString("Sunday") << 7 << QLocale::LongFormat;
+ QTest::newRow("C short") << QString("C") << QString("Sun") << 7 << QLocale::ShortFormat;
+ QTest::newRow("C narrow") << QString("C") << QString("7") << 7 << QLocale::NarrowFormat;
- QTest::newRow("ru_RU long") << QString("ru_RU") << QString::fromUtf8("\320\262\320\276\321\201\320\272\321\200\320\265\321\201\320\265\320\275\321\214\320\265") << 7 << QLocale::LongFormat;
- QTest::newRow("ru_RU short") << QString("ru_RU") << QString::fromUtf8("\320\262\321\201") << 7 << QLocale::ShortFormat;
- QTest::newRow("ru_RU narrow") << QString("ru_RU") << QString::fromUtf8("\320\262\321\201") << 7 << QLocale::NarrowFormat;
+ QTest::newRow("ru_RU long")
+ << QString("ru_RU")
+ << QString::fromUtf8("\320\262\320\276\321\201\320\272\321\200\320"
+ "\265\321\201\320\265\320\275\321\214\320\265")
+ << 7 << QLocale::LongFormat;
+ QTest::newRow("ru_RU short")
+ << QString("ru_RU") << QString::fromUtf8("\320\262\321\201") << 7 << QLocale::ShortFormat;
+ QTest::newRow("ru_RU narrow")
+ << QString("ru_RU") << QString::fromUtf8("\320\262\321\201") << 7 << QLocale::NarrowFormat;
}
void tst_QLocale::dayName()
@@ -2096,24 +2176,30 @@ void tst_QLocale::standaloneDayName_data()
QTest::addColumn<int>("day");
QTest::addColumn<QLocale::FormatType>("format");
- QTest::newRow("no_NO") << QString("no_NO") << QString("tirsdag") << 2 << QLocale::LongFormat;
- QTest::newRow("nb_NO") << QString("nb_NO") << QString("tirsdag") << 2 << QLocale::LongFormat;
- QTest::newRow("nn_NO") << QString("nn_NO") << QString("tysdag") << 2 << QLocale::LongFormat;
+ QTest::newRow("no_NO") << QString("no_NO") << QString("tirsdag") << 2 << QLocale::LongFormat;
+ QTest::newRow("nb_NO") << QString("nb_NO") << QString("tirsdag") << 2 << QLocale::LongFormat;
+ QTest::newRow("nn_NO") << QString("nn_NO") << QString("tysdag") << 2 << QLocale::LongFormat;
- QTest::newRow("C invalid: 0 long") << QString("C") << QString() << 0 << QLocale::LongFormat;
- QTest::newRow("C invalid: 0 short") << QString("C") << QString() << 0 << QLocale::ShortFormat;
- QTest::newRow("C invalid: 0 narrow") << QString("C") << QString() << 0 << QLocale::NarrowFormat;
- QTest::newRow("C invalid: 8 long") << QString("C") << QString() << 8 << QLocale::LongFormat;
- QTest::newRow("C invalid: 8 short") << QString("C") << QString() << 8 << QLocale::ShortFormat;
- QTest::newRow("C invalid: 8 narrow") << QString("C") << QString() << 8 << QLocale::NarrowFormat;
+ QTest::newRow("C invalid: 0 long") << QString("C") << QString() << 0 << QLocale::LongFormat;
+ QTest::newRow("C invalid: 0 short") << QString("C") << QString() << 0 << QLocale::ShortFormat;
+ QTest::newRow("C invalid: 0 narrow") << QString("C") << QString() << 0 << QLocale::NarrowFormat;
+ QTest::newRow("C invalid: 8 long") << QString("C") << QString() << 8 << QLocale::LongFormat;
+ QTest::newRow("C invalid: 8 short") << QString("C") << QString() << 8 << QLocale::ShortFormat;
+ QTest::newRow("C invalid: 8 narrow") << QString("C") << QString() << 8 << QLocale::NarrowFormat;
- QTest::newRow("C long") << QString("C") << QString("Sunday") << 7 << QLocale::LongFormat;
- QTest::newRow("C short") << QString("C") << QString("Sun") << 7 << QLocale::ShortFormat;
- QTest::newRow("C narrow") << QString("C") << QString("S") << 7 << QLocale::NarrowFormat;
+ QTest::newRow("C long") << QString("C") << QString("Sunday") << 7 << QLocale::LongFormat;
+ QTest::newRow("C short") << QString("C") << QString("Sun") << 7 << QLocale::ShortFormat;
+ QTest::newRow("C narrow") << QString("C") << QString("S") << 7 << QLocale::NarrowFormat;
- QTest::newRow("ru_RU long") << QString("ru_RU") << QString::fromUtf8("\320\262\320\276\321\201\320\272\321\200\320\265\321\201\320\265\320\275\321\214\320\265") << 7 << QLocale::LongFormat;
- QTest::newRow("ru_RU short") << QString("ru_RU") << QString::fromUtf8("\320\262\321\201") << 7 << QLocale::ShortFormat;
- QTest::newRow("ru_RU narrow") << QString("ru_RU") << QString::fromUtf8("\320\222") << 7 << QLocale::NarrowFormat;
+ QTest::newRow("ru_RU long")
+ << QString("ru_RU")
+ << QString::fromUtf8("\320\262\320\276\321\201\320\272\321\200\320"
+ "\265\321\201\320\265\320\275\321\214\320\265")
+ << 7 << QLocale::LongFormat;
+ QTest::newRow("ru_RU short")
+ << QString("ru_RU") << QString::fromUtf8("\320\262\321\201") << 7 << QLocale::ShortFormat;
+ QTest::newRow("ru_RU narrow")
+ << QString("ru_RU") << QString::fromUtf8("\320\222") << 7 << QLocale::NarrowFormat;
}
void tst_QLocale::standaloneDayName()
@@ -2129,9 +2215,7 @@ void tst_QLocale::standaloneDayName()
void tst_QLocale::underflowOverflow()
{
- QString
-a(QLatin1String("0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e10"));
-
+ QString a(QLatin1String("0.") + QString(546, QLatin1Char('0')) + QLatin1String("1e10"));
bool ok = false;
double d = a.toDouble(&ok);
QVERIFY(!ok);
@@ -2160,75 +2244,56 @@ a(QLatin1String("0.0000000000000000000000000000000000000000000000000000000000000
QVERIFY(!ok);
}
-void tst_QLocale::defaultNumeringSystem()
+void tst_QLocale::defaultNumberingSystem_data()
{
- QLocale sk("sk_SK");
- QCOMPARE(sk.toString(123), QLatin1String("123"));
+ QTest::addColumn<QString>("expect");
- QLocale ta("ta_IN");
- QCOMPARE(ta.toString(123), QLatin1String("123"));
-
- QLocale te("te_IN");
- QCOMPARE(te.toString(123), QLatin1String("123"));
-
- QLocale hi("hi_IN");
- QCOMPARE(hi.toString(123), QLatin1String("123"));
-
- QLocale gu("gu_IN");
- QCOMPARE(gu.toString(123), QLatin1String("123"));
-
- QLocale kn("kn_IN");
- QCOMPARE(kn.toString(123), QLatin1String("123"));
-
- QLocale pa("pa_IN");
- QCOMPARE(pa.toString(123), QLatin1String("123"));
-
- QLocale ne("ne_IN");
- QCOMPARE(ne.toString(123), QString::fromUtf8("१२३"));
+ QTest::newRow("sk_SK") << QStringLiteral("123");
+ QTest::newRow("ta_IN") << QStringLiteral("123");
+ QTest::newRow("te_IN") << QStringLiteral("123");
+ QTest::newRow("hi_IN") << QStringLiteral("123");
+ QTest::newRow("gu_IN") << QStringLiteral("123");
+ QTest::newRow("kn_IN") << QStringLiteral("123");
+ QTest::newRow("pa_IN") << QStringLiteral("123");
+ QTest::newRow("ne_IN") << QString::fromUtf8("१२३");
+ QTest::newRow("mr_IN") << QString::fromUtf8("१२३");
+ QTest::newRow("ml_IN") << QStringLiteral("123");
+ QTest::newRow("kok_IN") << QStringLiteral("123");
+}
- QLocale mr("mr_IN");
- QCOMPARE(mr.toString(123), QString::fromUtf8("१२३"));
+void tst_QLocale::defaultNumberingSystem()
+{
+ QFETCH(QString, expect);
+ QLatin1String name(QTest::currentDataTag());
+ QLocale locale(name);
+ QCOMPARE(locale.toString(123), expect);
+}
- QLocale ml("ml_IN");
- QCOMPARE(ml.toString(123), QLatin1String("123"));
+void tst_QLocale::ampm_data()
+{
+ QTest::addColumn<QString>("morn");
+ QTest::addColumn<QString>("even");
- QLocale kok("kok_IN");
- QCOMPARE(kok.toString(123), QLatin1String("123"));
+ QTest::newRow("C") << QStringLiteral("AM") << QStringLiteral("PM");
+ QTest::newRow("de_DE") << QStringLiteral("AM") << QStringLiteral("PM");
+ QTest::newRow("sv_SE") << QStringLiteral("fm") << QStringLiteral("em");
+ QTest::newRow("nl_NL") << QStringLiteral("a.m.") << QStringLiteral("p.m.");
+ QTest::newRow("uk_UA") << QString::fromUtf8("\320\264\320\277")
+ << QString::fromUtf8("\320\277\320\277");
+ QTest::newRow("tr_TR") << QString::fromUtf8("\303\226\303\226")
+ << QString::fromUtf8("\303\226\123");
+ QTest::newRow("id_ID") << QStringLiteral("AM") << QStringLiteral("PM");
+ QTest::newRow("ta_LK") << QString::fromUtf8("à®®à¯à®±à¯à®ªà®•à®²à¯") << QString::fromUtf8("பிறà¯à®ªà®•à®²à¯");
}
void tst_QLocale::ampm()
{
- QLocale c(QLocale::C);
- QCOMPARE(c.amText(), QLatin1String("AM"));
- QCOMPARE(c.pmText(), QLatin1String("PM"));
-
- QLocale de("de_DE");
- QCOMPARE(de.amText(), QLatin1String("vorm."));
- QCOMPARE(de.pmText(), QLatin1String("nachm."));
-
- QLocale sv("sv_SE");
- QCOMPARE(sv.amText(), QLatin1String("fm"));
- QCOMPARE(sv.pmText(), QLatin1String("em"));
-
- QLocale nn("nl_NL");
- QCOMPARE(nn.amText(), QLatin1String("a.m."));
- QCOMPARE(nn.pmText(), QLatin1String("p.m."));
-
- QLocale ua("uk_UA");
- QCOMPARE(ua.amText(), QString::fromUtf8("\320\264\320\277"));
- QCOMPARE(ua.pmText(), QString::fromUtf8("\320\277\320\277"));
-
- QLocale tr("tr_TR");
- QCOMPARE(tr.amText(), QString::fromUtf8("\303\226\303\226"));
- QCOMPARE(tr.pmText(), QString::fromUtf8("\303\226\123"));
-
- QLocale id("id_ID");
- QCOMPARE(id.amText(), QLatin1String("AM"));
- QCOMPARE(id.pmText(), QLatin1String("PM"));
-
- QLocale ta("ta_LK");
- QCOMPARE(ta.amText(), QString::fromUtf8("à®®à¯à®±à¯à®ªà®•à®²à¯"));
- QCOMPARE(ta.pmText(), QString::fromUtf8("பிறà¯à®ªà®•à®²à¯"));
+ QFETCH(QString, morn);
+ QFETCH(QString, even);
+ QLatin1String name(QTest::currentDataTag());
+ QLocale locale(name == QLatin1String("C") ? QLocale(QLocale::C) : QLocale(name));
+ QCOMPARE(locale.amText(), morn);
+ QCOMPARE(locale.pmText(), even);
}
void tst_QLocale::dateFormat()
@@ -2310,8 +2375,10 @@ void tst_QLocale::monthName()
QCOMPARE(de.monthName(12, QLocale::NarrowFormat), QLatin1String("D"));
QLocale ru("ru_RU");
- QCOMPARE(ru.monthName(1, QLocale::LongFormat), QString::fromUtf8("\321\217\320\275\320\262\320\260\321\200\321\217"));
- QCOMPARE(ru.monthName(1, QLocale::ShortFormat), QString::fromUtf8("\321\217\320\275\320\262\56"));
+ QCOMPARE(ru.monthName(1, QLocale::LongFormat),
+ QString::fromUtf8("\321\217\320\275\320\262\320\260\321\200\321\217"));
+ QCOMPARE(ru.monthName(1, QLocale::ShortFormat),
+ QString::fromUtf8("\321\217\320\275\320\262\56"));
QCOMPARE(ru.monthName(1, QLocale::NarrowFormat), QString::fromUtf8("\320\257"));
QLocale ir("ga_IE");
@@ -2340,13 +2407,16 @@ void tst_QLocale::standaloneMonthName()
// For de_DE locale Unicode CLDR database doesn't contain standalone long months
// so just checking if the return value is the same as in monthName().
QCOMPARE(de.standaloneMonthName(12, QLocale::LongFormat), QLatin1String("Dezember"));
- QCOMPARE(de.standaloneMonthName(12, QLocale::LongFormat), de.monthName(12, QLocale::LongFormat));
+ QCOMPARE(de.standaloneMonthName(12, QLocale::LongFormat),
+ de.monthName(12, QLocale::LongFormat));
QCOMPARE(de.standaloneMonthName(12, QLocale::ShortFormat), QLatin1String("Dez"));
QCOMPARE(de.standaloneMonthName(12, QLocale::NarrowFormat), QLatin1String("D"));
QLocale ru("ru_RU");
- QCOMPARE(ru.standaloneMonthName(1, QLocale::LongFormat), QString::fromUtf8("\xd1\x8f\xd0\xbd\xd0\xb2\xd0\xb0\xd1\x80\xd1\x8c"));
- QCOMPARE(ru.standaloneMonthName(1, QLocale::ShortFormat), QString::fromUtf8("\xd1\x8f\xd0\xbd\xd0\xb2."));
+ QCOMPARE(ru.standaloneMonthName(1, QLocale::LongFormat),
+ QString::fromUtf8("\xd1\x8f\xd0\xbd\xd0\xb2\xd0\xb0\xd1\x80\xd1\x8c"));
+ QCOMPARE(ru.standaloneMonthName(1, QLocale::ShortFormat),
+ QString::fromUtf8("\xd1\x8f\xd0\xbd\xd0\xb2."));
QCOMPARE(ru.standaloneMonthName(1, QLocale::NarrowFormat), QString::fromUtf8("\xd0\xaf"));
}
@@ -2371,19 +2441,30 @@ void tst_QLocale::currency()
QCOMPARE(en_US.toCurrencyString(double(-1234.56), NULL, 4), QString("$-1,234.5600"));
const QLocale ru_RU("ru_RU");
- QCOMPARE(ru_RU.toCurrencyString(qulonglong(1234)), QString::fromUtf8("1" "\xc2\xa0" "234\xc2\xa0\xe2\x82\xbd"));
- QCOMPARE(ru_RU.toCurrencyString(qlonglong(-1234)), QString::fromUtf8("-1" "\xc2\xa0" "234\xc2\xa0\xe2\x82\xbd"));
- QCOMPARE(ru_RU.toCurrencyString(double(1234.56)), QString::fromUtf8("1" "\xc2\xa0" "234,56\xc2\xa0\xe2\x82\xbd"));
- QCOMPARE(ru_RU.toCurrencyString(double(-1234.56)), QString::fromUtf8("-1" "\xc2\xa0" "234,56\xc2\xa0\xe2\x82\xbd"));
+ QCOMPARE(ru_RU.toCurrencyString(qulonglong(1234)),
+ QString::fromUtf8("1" "\xc2\xa0" "234\xc2\xa0\xe2\x82\xbd"));
+ QCOMPARE(ru_RU.toCurrencyString(qlonglong(-1234)),
+ QString::fromUtf8("-1" "\xc2\xa0" "234\xc2\xa0\xe2\x82\xbd"));
+ QCOMPARE(ru_RU.toCurrencyString(double(1234.56)),
+ QString::fromUtf8("1" "\xc2\xa0" "234,56\xc2\xa0\xe2\x82\xbd"));
+ QCOMPARE(ru_RU.toCurrencyString(double(-1234.56)),
+ QString::fromUtf8("-1" "\xc2\xa0" "234,56\xc2\xa0\xe2\x82\xbd"));
const QLocale de_DE("de_DE");
- QCOMPARE(de_DE.toCurrencyString(qulonglong(1234)), QString::fromUtf8("1.234\xc2\xa0\xe2\x82\xac"));
- QCOMPARE(de_DE.toCurrencyString(qulonglong(1234), QLatin1String("BAZ")), QString::fromUtf8("1.234\xc2\xa0" "BAZ"));
- QCOMPARE(de_DE.toCurrencyString(qlonglong(-1234)), QString::fromUtf8("-1.234\xc2\xa0\xe2\x82\xac"));
- QCOMPARE(de_DE.toCurrencyString(qlonglong(-1234), QLatin1String("BAZ")), QString::fromUtf8("-1.234\xc2\xa0" "BAZ"));
- QCOMPARE(de_DE.toCurrencyString(double(1234.56)), QString::fromUtf8("1.234,56\xc2\xa0\xe2\x82\xac"));
- QCOMPARE(de_DE.toCurrencyString(double(-1234.56)), QString::fromUtf8("-1.234,56\xc2\xa0\xe2\x82\xac"));
- QCOMPARE(de_DE.toCurrencyString(double(-1234.56), QLatin1String("BAZ")), QString::fromUtf8("-1.234,56\xc2\xa0" "BAZ"));
+ QCOMPARE(de_DE.toCurrencyString(qulonglong(1234)),
+ QString::fromUtf8("1.234\xc2\xa0\xe2\x82\xac"));
+ QCOMPARE(de_DE.toCurrencyString(qulonglong(1234), QLatin1String("BAZ")),
+ QString::fromUtf8("1.234\xc2\xa0" "BAZ"));
+ QCOMPARE(de_DE.toCurrencyString(qlonglong(-1234)),
+ QString::fromUtf8("-1.234\xc2\xa0\xe2\x82\xac"));
+ QCOMPARE(de_DE.toCurrencyString(qlonglong(-1234), QLatin1String("BAZ")),
+ QString::fromUtf8("-1.234\xc2\xa0" "BAZ"));
+ QCOMPARE(de_DE.toCurrencyString(double(1234.56)),
+ QString::fromUtf8("1.234,56\xc2\xa0\xe2\x82\xac"));
+ QCOMPARE(de_DE.toCurrencyString(double(-1234.56)),
+ QString::fromUtf8("-1.234,56\xc2\xa0\xe2\x82\xac"));
+ QCOMPARE(de_DE.toCurrencyString(double(-1234.56), QLatin1String("BAZ")),
+ QString::fromUtf8("-1.234,56\xc2\xa0" "BAZ"));
const QLocale es_CR(QLocale::Spanish, QLocale::CostaRica);
QCOMPARE(es_CR.toCurrencyString(double(1565.25)),
@@ -2398,11 +2479,13 @@ void tst_QLocale::quoteString()
const QString someText("text");
const QLocale c(QLocale::C);
QCOMPARE(c.quoteString(someText), QString::fromUtf8("\x22" "text" "\x22"));
- QCOMPARE(c.quoteString(someText, QLocale::AlternateQuotation), QString::fromUtf8("\x27" "text" "\x27"));
+ QCOMPARE(c.quoteString(someText, QLocale::AlternateQuotation),
+ QString::fromUtf8("\x27" "text" "\x27"));
const QLocale de_CH("de_CH");
QCOMPARE(de_CH.quoteString(someText), QString::fromUtf8("\xe2\x80\x9e" "text" "\xe2\x80\x9c"));
- QCOMPARE(de_CH.quoteString(someText, QLocale::AlternateQuotation), QString::fromUtf8("\xe2\x80\x9a" "text" "\xe2\x80\x98"));
+ QCOMPARE(de_CH.quoteString(someText, QLocale::AlternateQuotation),
+ QString::fromUtf8("\xe2\x80\x9a" "text" "\xe2\x80\x98"));
}
@@ -2484,23 +2567,28 @@ void tst_QLocale::listPatterns()
QCOMPARE(zh_CN.createSeparatedList(sl1), QString(""));
QCOMPARE(zh_CN.createSeparatedList(sl2), QString("aaa"));
QCOMPARE(zh_CN.createSeparatedList(sl3), QString::fromUtf8("aaa" "\xe5\x92\x8c" "bbb"));
- QCOMPARE(zh_CN.createSeparatedList(sl4), QString::fromUtf8("aaa" "\xe3\x80\x81" "bbb" "\xe5\x92\x8c" "ccc"));
- QCOMPARE(zh_CN.createSeparatedList(sl5), QString::fromUtf8("aaa" "\xe3\x80\x81" "bbb" "\xe3\x80\x81" "ccc" "\xe5\x92\x8c" "ddd"));
+ QCOMPARE(zh_CN.createSeparatedList(sl4),
+ QString::fromUtf8("aaa" "\xe3\x80\x81" "bbb" "\xe5\x92\x8c" "ccc"));
+ QCOMPARE(zh_CN.createSeparatedList(sl5),
+ QString::fromUtf8("aaa" "\xe3\x80\x81" "bbb" "\xe3\x80\x81"
+ "ccc" "\xe5\x92\x8c" "ddd"));
}
-void tst_QLocale::measurementSystems()
+void tst_QLocale::measurementSystems_data()
{
- QLocale locale(QLocale::English, QLocale::UnitedStates);
- QCOMPARE(locale.measurementSystem(), QLocale::ImperialUSSystem);
-
- locale = QLocale(QLocale::English, QLocale::UnitedKingdom);
- QCOMPARE(locale.measurementSystem(), QLocale::ImperialUKSystem);
-
- locale = QLocale(QLocale::English, QLocale::Australia);
- QCOMPARE(locale.measurementSystem(), QLocale::MetricSystem);
+ QTest::addColumn<QLocale>("locale");
+ QTest::addColumn<QLocale::MeasurementSystem>("system");
+ QTest::newRow("en_US") << QLocale(QLocale::English, QLocale::UnitedStates) << QLocale::ImperialUSSystem;
+ QTest::newRow("en_GB") << QLocale(QLocale::English, QLocale::UnitedKingdom) << QLocale::ImperialUKSystem;
+ QTest::newRow("en_AU") << QLocale(QLocale::English, QLocale::Australia) << QLocale::MetricSystem;
+ QTest::newRow("de") << QLocale(QLocale::German) << QLocale::MetricSystem;
+}
- locale = QLocale(QLocale::German);
- QCOMPARE(locale.measurementSystem(), QLocale::MetricSystem);
+void tst_QLocale::measurementSystems()
+{
+ QFETCH(QLocale, locale);
+ QFETCH(QLocale::MeasurementSystem, system);
+ QCOMPARE(locale.measurementSystem(), system);
}
void tst_QLocale::QTBUG_26035_positivesign()
@@ -2566,7 +2654,9 @@ void tst_QLocale::textDirection_data()
case QLocale::Uighur:
case QLocale::Urdu:
case QLocale::Yiddish:
- rightToLeft = QLocale(QLocale::Language(language)).language() == QLocale::Language(language); // false if there is no locale data for language
+ // false if there is no locale data for language:
+ rightToLeft = (QLocale(QLocale::Language(language)).language()
+ == QLocale::Language(language));
break;
default:
break;
@@ -2651,6 +2741,37 @@ void tst_QLocale::formattedDataSize_data()
#undef ROWQ
#undef ROWB
}
+
+ // Languages which don't use a Latin alphabet
+
+ const QLocale::DataSizeFormats iecFormat = QLocale::DataSizeIecFormat;
+ const QLocale::DataSizeFormats traditionalFormat = QLocale::DataSizeTraditionalFormat;
+ const QLocale::DataSizeFormats siFormat = QLocale::DataSizeSIFormat;
+ const QLocale::Language lang = QLocale::Russian;
+
+ QTest::newRow("Russian-IEC-0") << lang << 2 << iecFormat << 0 << QString("0 \u0431\u0430\u0439\u0442\u044B");
+ QTest::newRow("Russian-IEC-10") << lang << 2 << iecFormat << 10 << QString("10 \u0431\u0430\u0439\u0442\u044B");
+ // CLDR doesn't provide IEC prefixes (yet?) so they aren't getting translated
+ QTest::newRow("Russian-IEC-12Ki") << lang << 2 << iecFormat << 12345 << QString("12,06 KiB");
+ QTest::newRow("Russian-IEC-16Ki") << lang << 2 << iecFormat << 16384 << QString("16,00 KiB");
+ QTest::newRow("Russian-IEC-1235k") << lang << 2 << iecFormat << 1234567 << QString("1,18 MiB");
+ QTest::newRow("Russian-IEC-1374k") << lang << 2 << iecFormat << 1374744 << QString("1,31 MiB");
+ QTest::newRow("Russian-IEC-1234M") << lang << 2 << iecFormat << 1234567890 << QString("1,15 GiB");
+
+ QTest::newRow("Russian-Trad-0") << lang << 2 << traditionalFormat << 0 << QString("0 \u0431\u0430\u0439\u0442\u044B");
+ QTest::newRow("Russian-Trad-10") << lang << 2 << traditionalFormat << 10 << QString("10 \u0431\u0430\u0439\u0442\u044B");
+ QTest::newRow("Russian-Trad-12Ki") << lang << 2 << traditionalFormat << 12345 << QString("12,06 \u043A\u0411");
+ QTest::newRow("Russian-Trad-16Ki") << lang << 2 << traditionalFormat << 16384 << QString("16,00 \u043A\u0411");
+ QTest::newRow("Russian-Trad-1235k") << lang << 2 << traditionalFormat << 1234567 << QString("1,18 \u041C\u0411");
+ QTest::newRow("Russian-Trad-1374k") << lang << 2 << traditionalFormat << 1374744 << QString("1,31 \u041C\u0411");
+ QTest::newRow("Russian-Trad-1234M") << lang << 2 << traditionalFormat << 1234567890 << QString("1,15 \u0413\u0411");
+
+ QTest::newRow("Russian-Decimal-0") << lang << 2 << siFormat << 0 << QString("0 \u0431\u0430\u0439\u0442\u044B");
+ QTest::newRow("Russian-Decimal-10") << lang << 2 << siFormat << 10 << QString("10 \u0431\u0430\u0439\u0442\u044B");
+ QTest::newRow("Russian-Decimal-16Ki") << lang << 2 << siFormat << 16384 << QString("16,38 \u043A\u0411");
+ QTest::newRow("Russian-Decimal-1234k") << lang << 2 << siFormat << 1234567 << QString("1,23 \u041C\u0411");
+ QTest::newRow("Russian-Decimal-1374k") << lang << 2 << siFormat << 1374744 << QString("1,37 \u041C\u0411");
+ QTest::newRow("Russian-Decimal-1234M") << lang << 2 << siFormat << 1234567890 << QString("1,23 \u0413\u0411");
}
void tst_QLocale::formattedDataSize()
@@ -2663,25 +2784,33 @@ void tst_QLocale::formattedDataSize()
QCOMPARE(QLocale(language).formattedDataSize(bytes, decimalPlaces, units), output);
}
-void tst_QLocale::bcp47Name()
+void tst_QLocale::bcp47Name_data()
{
- QCOMPARE(QLocale("C").bcp47Name(), QStringLiteral("en"));
- QCOMPARE(QLocale("en").bcp47Name(), QStringLiteral("en"));
- QCOMPARE(QLocale("en_US").bcp47Name(), QStringLiteral("en"));
- QCOMPARE(QLocale("en_GB").bcp47Name(), QStringLiteral("en-GB"));
- QCOMPARE(QLocale("en_DE").bcp47Name(), QStringLiteral("en-DE"));
- QCOMPARE(QLocale("de_DE").bcp47Name(), QStringLiteral("de"));
- QCOMPARE(QLocale("sr_RS").bcp47Name(), QStringLiteral("sr"));
- QCOMPARE(QLocale("sr_Cyrl_RS").bcp47Name(), QStringLiteral("sr"));
- QCOMPARE(QLocale("sr_Latn_RS").bcp47Name(), QStringLiteral("sr-Latn"));
- QCOMPARE(QLocale("sr_ME").bcp47Name(), QStringLiteral("sr-ME"));
- QCOMPARE(QLocale("sr_Cyrl_ME").bcp47Name(), QStringLiteral("sr-Cyrl-ME"));
- QCOMPARE(QLocale("sr_Latn_ME").bcp47Name(), QStringLiteral("sr-ME"));
+ QTest::addColumn<QString>("expect");
+
+ QTest::newRow("C") << QStringLiteral("en");
+ QTest::newRow("en") << QStringLiteral("en");
+ QTest::newRow("en_US") << QStringLiteral("en");
+ QTest::newRow("en_GB") << QStringLiteral("en-GB");
+ QTest::newRow("en_DE") << QStringLiteral("en-DE");
+ QTest::newRow("de_DE") << QStringLiteral("de");
+ QTest::newRow("sr_RS") << QStringLiteral("sr");
+ QTest::newRow("sr_Cyrl_RS") << QStringLiteral("sr");
+ QTest::newRow("sr_Latn_RS") << QStringLiteral("sr-Latn");
+ QTest::newRow("sr_ME") << QStringLiteral("sr-ME");
+ QTest::newRow("sr_Cyrl_ME") << QStringLiteral("sr-Cyrl-ME");
+ QTest::newRow("sr_Latn_ME") << QStringLiteral("sr-ME");
// Fall back to defaults when country isn't in CLDR for this language:
- QCOMPARE(QLocale("sr_HR").bcp47Name(), QStringLiteral("sr"));
- QCOMPARE(QLocale("sr_Cyrl_HR").bcp47Name(), QStringLiteral("sr"));
- QCOMPARE(QLocale("sr_Latn_HR").bcp47Name(), QStringLiteral("sr-Latn"));
+ QTest::newRow("sr_HR") << QStringLiteral("sr");
+ QTest::newRow("sr_Cyrl_HR") << QStringLiteral("sr");
+ QTest::newRow("sr_Latn_HR") << QStringLiteral("sr-Latn");
+}
+
+void tst_QLocale::bcp47Name()
+{
+ QFETCH(QString, expect);
+ QCOMPARE(QLocale(QLatin1String(QTest::currentDataTag())).bcp47Name(), expect);
}
class MySystemLocale : public QSystemLocale
diff --git a/tests/auto/corelib/tools/qmacautoreleasepool/qmacautoreleasepool.pro b/tests/auto/corelib/tools/qmacautoreleasepool/qmacautoreleasepool.pro
index 26b3a47472..8599596344 100644
--- a/tests/auto/corelib/tools/qmacautoreleasepool/qmacautoreleasepool.pro
+++ b/tests/auto/corelib/tools/qmacautoreleasepool/qmacautoreleasepool.pro
@@ -2,3 +2,4 @@ CONFIG += testcase
TARGET = tst_qmacautoreleasepool
QT = core testlib
SOURCES = tst_qmacautoreleasepool.mm
+LIBS += -framework Foundation
diff --git a/tests/auto/corelib/tools/qmakearray/qmakearray.pro b/tests/auto/corelib/tools/qmakearray/qmakearray.pro
new file mode 100644
index 0000000000..abb3d9fdbc
--- /dev/null
+++ b/tests/auto/corelib/tools/qmakearray/qmakearray.pro
@@ -0,0 +1,4 @@
+CONFIG += testcase
+TARGET = tst_qmakearray
+QT = core testlib core-private
+SOURCES = $$PWD/tst_qmakearray.cpp
diff --git a/tests/auto/corelib/tools/qmakearray/tst_qmakearray.cpp b/tests/auto/corelib/tools/qmakearray/tst_qmakearray.cpp
new file mode 100644
index 0000000000..e0d3f52719
--- /dev/null
+++ b/tests/auto/corelib/tools/qmakearray/tst_qmakearray.cpp
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+
+#include <private/qmakearray_p.h>
+
+
+class tst_QMakeArray : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void quicksort();
+};
+
+struct Pair {
+ unsigned int key;
+ unsigned int val;
+
+ constexpr bool operator <=(const Pair &that) const noexcept
+ {
+ return key <= that.key;
+ }
+
+ constexpr bool operator<(const Pair &that) const noexcept
+ {
+ return key < that.key;
+ }
+
+ constexpr bool operator==(const Pair &that) const noexcept
+ {
+ return key == that.key;
+ }
+};
+
+template<std::size_t Key, std::size_t Val>
+struct PairQuickSortElem
+{
+ using Type = Pair;
+ static constexpr Type data() noexcept { return Type{Key, Val}; }
+};
+
+void tst_QMakeArray::quicksort()
+{
+ constexpr const auto sorted_array = qMakeArray(
+ QSortedData<
+ PairQuickSortElem<10, 0>,
+ PairQuickSortElem<5, 0>,
+ PairQuickSortElem<7, 0>,
+ PairQuickSortElem<1, 0>,
+ PairQuickSortElem<8, 0>,
+ PairQuickSortElem<6, 0>,
+ PairQuickSortElem<4, 0>,
+ PairQuickSortElem<3, 0>,
+ PairQuickSortElem<1, 0>,
+ PairQuickSortElem<2, 0>,
+ PairQuickSortElem<10, 0>,
+ PairQuickSortElem<5, 0>
+ >::Data{});
+ static_assert(sorted_array.size() == 12, "sorted_array.size() != 12");
+ QCOMPARE(sorted_array[0].key, 1u);
+ QCOMPARE(sorted_array[1].key, 1u);
+ QCOMPARE(sorted_array[2].key, 2u);
+ QCOMPARE(sorted_array[3].key, 3u);
+ QCOMPARE(sorted_array[4].key, 4u);
+ QCOMPARE(sorted_array[5].key, 5u);
+ QCOMPARE(sorted_array[6].key, 5u);
+ QCOMPARE(sorted_array[7].key, 6u);
+ QCOMPARE(sorted_array[8].key, 7u);
+ QCOMPARE(sorted_array[9].key, 8u);
+ QCOMPARE(sorted_array[10].key, 10u);
+ QCOMPARE(sorted_array[11].key, 10u);
+}
+
+
+QTEST_APPLESS_MAIN(tst_QMakeArray)
+#include "tst_qmakearray.moc"
diff --git a/tests/auto/corelib/tools/qregularexpression/alwaysoptimize/alwaysoptimize.pro b/tests/auto/corelib/tools/qregularexpression/alwaysoptimize/alwaysoptimize.pro
deleted file mode 100644
index a27286ff20..0000000000
--- a/tests/auto/corelib/tools/qregularexpression/alwaysoptimize/alwaysoptimize.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-CONFIG += testcase
-TARGET = tst_qregularexpression_alwaysoptimize
-QT = core testlib
-HEADERS = ../tst_qregularexpression.h
-SOURCES = \
- tst_qregularexpression_alwaysoptimize.cpp \
- ../tst_qregularexpression.cpp
diff --git a/tests/auto/corelib/tools/qregularexpression/defaultoptimize/defaultoptimize.pro b/tests/auto/corelib/tools/qregularexpression/defaultoptimize/defaultoptimize.pro
deleted file mode 100644
index 0b36c79c1b..0000000000
--- a/tests/auto/corelib/tools/qregularexpression/defaultoptimize/defaultoptimize.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-CONFIG += testcase
-TARGET = tst_qregularexpression_defaultoptimize
-QT = core testlib
-HEADERS = ../tst_qregularexpression.h
-SOURCES = \
- tst_qregularexpression_defaultoptimize.cpp \
- ../tst_qregularexpression.cpp
diff --git a/tests/auto/corelib/tools/qregularexpression/forceoptimize/forceoptimize.pro b/tests/auto/corelib/tools/qregularexpression/forceoptimize/forceoptimize.pro
deleted file mode 100644
index 1db77781dd..0000000000
--- a/tests/auto/corelib/tools/qregularexpression/forceoptimize/forceoptimize.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-CONFIG += testcase
-TARGET = tst_qregularexpression_forceoptimize
-QT = core testlib
-HEADERS = ../tst_qregularexpression.h
-SOURCES = \
- tst_qregularexpression_forceoptimize.cpp \
- ../tst_qregularexpression.cpp
-DEFINES += forceOptimize=true
diff --git a/tests/auto/corelib/tools/qregularexpression/qregularexpression.pro b/tests/auto/corelib/tools/qregularexpression/qregularexpression.pro
index e1840808ff..ec8189717e 100644
--- a/tests/auto/corelib/tools/qregularexpression/qregularexpression.pro
+++ b/tests/auto/corelib/tools/qregularexpression/qregularexpression.pro
@@ -1,3 +1,4 @@
-TEMPLATE = subdirs
-SUBDIRS = defaultoptimize forceoptimize
-qtConfig(private_tests): SUBDIRS += alwaysoptimize
+CONFIG += testcase
+TARGET = tst_qregularexpression
+QT = core testlib
+SOURCES = tst_qregularexpression.cpp
diff --git a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
index c828551e44..18098f16bf 100644
--- a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
+++ b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
@@ -33,11 +33,60 @@
#include <qstringlist.h>
#include <qhash.h>
-#include "tst_qregularexpression.h"
+#include <qobject.h>
+#include <qregularexpression.h>
+#include <qthread.h>
-#ifndef forceOptimize
-#define forceOptimize false
-#endif
+Q_DECLARE_METATYPE(QRegularExpression::PatternOptions)
+Q_DECLARE_METATYPE(QRegularExpression::MatchType)
+Q_DECLARE_METATYPE(QRegularExpression::MatchOptions)
+
+class tst_QRegularExpression : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void defaultConstructors();
+ void gettersSetters_data();
+ void gettersSetters();
+ void escape_data();
+ void escape();
+ void validity_data();
+ void validity();
+ void patternOptions_data();
+ void patternOptions();
+ void normalMatch_data();
+ void normalMatch();
+ void partialMatch_data();
+ void partialMatch();
+ void globalMatch_data();
+ void globalMatch();
+ void serialize_data();
+ void serialize();
+ void operatoreq_data();
+ void operatoreq();
+ void captureCount_data();
+ void captureCount();
+ void captureNames_data();
+ void captureNames();
+ void pcreJitStackUsage_data();
+ void pcreJitStackUsage();
+ void regularExpressionMatch_data();
+ void regularExpressionMatch();
+ void JOptionUsage_data();
+ void JOptionUsage();
+ void QStringAndQStringRefEquivalence();
+ void threadSafety_data();
+ void threadSafety();
+
+ void wildcard_data();
+ void wildcard();
+ void testInvalidWildcard_data();
+ void testInvalidWildcard();
+
+private:
+ void provideRegularExpressions();
+};
struct Match
{
@@ -292,9 +341,6 @@ static void testMatch(const QRegularExpression &regexp,
QRegularExpression::MatchOptions matchOptions,
const Result &result)
{
- if (forceOptimize)
- regexp.optimize();
-
// test with QString as subject type
testMatchImpl<QREMatch>(regexp, matchingMethodForString, subject, offset, matchType, matchOptions, result);
@@ -401,30 +447,22 @@ void tst_QRegularExpression::gettersSetters()
{
QRegularExpression re;
re.setPattern(pattern);
- if (forceOptimize)
- re.optimize();
QCOMPARE(re.pattern(), pattern);
QCOMPARE(re.patternOptions(), QRegularExpression::NoPatternOption);
}
{
QRegularExpression re;
re.setPatternOptions(patternOptions);
- if (forceOptimize)
- re.optimize();
QCOMPARE(re.pattern(), QString());
QCOMPARE(re.patternOptions(), patternOptions);
}
{
QRegularExpression re(pattern);
- if (forceOptimize)
- re.optimize();
QCOMPARE(re.pattern(), pattern);
QCOMPARE(re.patternOptions(), QRegularExpression::NoPatternOption);
}
{
QRegularExpression re(pattern, patternOptions);
- if (forceOptimize)
- re.optimize();
QCOMPARE(re.pattern(), pattern);
QCOMPARE(re.patternOptions(), patternOptions);
}
@@ -465,8 +503,6 @@ void tst_QRegularExpression::escape()
QFETCH(QString, escaped);
QCOMPARE(QRegularExpression::escape(string), escaped);
QRegularExpression re(escaped);
- if (forceOptimize)
- re.optimize();
QCOMPARE(re.isValid(), true);
}
@@ -497,8 +533,6 @@ void tst_QRegularExpression::validity()
QFETCH(QString, pattern);
QFETCH(bool, validity);
QRegularExpression re(pattern);
- if (forceOptimize)
- re.optimize();
QCOMPARE(re.isValid(), validity);
if (!validity)
QTest::ignoreMessage(QtWarningMsg, "QRegularExpressionPrivate::doMatch(): called on an invalid QRegularExpression object");
@@ -585,9 +619,6 @@ void tst_QRegularExpression::patternOptions()
QFETCH(QString, subject);
QFETCH(Match, match);
- if (forceOptimize)
- regexp.optimize();
-
QRegularExpressionMatch m = regexp.match(subject);
consistencyCheck(m);
QVERIFY(m == match);
@@ -1403,9 +1434,6 @@ void tst_QRegularExpression::serialize()
QFETCH(QRegularExpression::PatternOptions, patternOptions);
QRegularExpression outRe(pattern, patternOptions);
- if (forceOptimize)
- outRe.optimize();
-
QByteArray buffer;
{
QDataStream out(&buffer, QIODevice::WriteOnly);
@@ -1468,33 +1496,18 @@ void tst_QRegularExpression::operatoreq()
QRegularExpression re1(pattern);
QRegularExpression re2(pattern);
- if (forceOptimize)
- re1.optimize();
- if (forceOptimize)
- re2.optimize();
-
verifyEquality(re1, re2);
}
{
QRegularExpression re1(QString(), patternOptions);
QRegularExpression re2(QString(), patternOptions);
- if (forceOptimize)
- re1.optimize();
- if (forceOptimize)
- re2.optimize();
-
verifyEquality(re1, re2);
}
{
QRegularExpression re1(pattern, patternOptions);
QRegularExpression re2(pattern, patternOptions);
- if (forceOptimize)
- re1.optimize();
- if (forceOptimize)
- re2.optimize();
-
verifyEquality(re1, re2);
}
}
@@ -1524,9 +1537,6 @@ void tst_QRegularExpression::captureCount()
QFETCH(QString, pattern);
QRegularExpression re(pattern);
- if (forceOptimize)
- re.optimize();
-
QTEST(re.captureCount(), "captureCount");
if (!re.isValid())
QCOMPARE(re.captureCount(), -1);
@@ -1595,9 +1605,6 @@ void tst_QRegularExpression::captureNames()
QRegularExpression re(pattern);
- if (forceOptimize)
- re.optimize();
-
QStringList namedCaptureGroups = re.namedCaptureGroups();
int namedCaptureGroupsCount = namedCaptureGroups.size();
@@ -1633,9 +1640,6 @@ void tst_QRegularExpression::pcreJitStackUsage()
QRegularExpression re(pattern);
- if (forceOptimize)
- re.optimize();
-
QVERIFY(re.isValid());
QRegularExpressionMatch match = re.match(subject);
consistencyCheck(match);
@@ -1663,9 +1667,6 @@ void tst_QRegularExpression::regularExpressionMatch()
QRegularExpression re(pattern);
- if (forceOptimize)
- re.optimize();
-
QVERIFY(re.isValid());
QRegularExpressionMatch match = re.match(subject);
consistencyCheck(match);
@@ -1705,8 +1706,6 @@ void tst_QRegularExpression::JOptionUsage()
QRegularExpression re(pattern);
if (isValid && JOptionUsed)
QTest::ignoreMessage(QtWarningMsg, qPrintable(warningMessage.arg(pattern)));
- if (forceOptimize)
- re.optimize();
QCOMPARE(re.isValid(), isValid);
}
@@ -2066,3 +2065,189 @@ void tst_QRegularExpression::QStringAndQStringRefEquivalence()
}
}
}
+
+class MatcherThread : public QThread
+{
+public:
+ explicit MatcherThread(const QRegularExpression &re, const QString &subject, QObject *parent = nullptr)
+ : QThread(parent),
+ m_re(re),
+ m_subject(subject)
+ {
+ }
+
+private:
+ static const int MATCH_ITERATIONS = 50;
+
+ void run() override
+ {
+ yieldCurrentThread();
+ for (int i = 0; i < MATCH_ITERATIONS; ++i)
+ m_re.match(m_subject);
+ }
+
+ const QRegularExpression &m_re;
+ const QString &m_subject;
+};
+
+void tst_QRegularExpression::threadSafety_data()
+{
+ QTest::addColumn<QString>("pattern");
+ QTest::addColumn<QString>("subject");
+
+ int i = 0;
+ QTest::addRow("pattern%d", ++i) << "ab.*cd" << "abcd";
+ QTest::addRow("pattern%d", ++i) << "ab.*cd" << "abd";
+ QTest::addRow("pattern%d", ++i) << "ab.*cd" << "abbbbcccd";
+ QTest::addRow("pattern%d", ++i) << "ab.*cd" << "abababcd";
+ QTest::addRow("pattern%d", ++i) << "ab.*cd" << "abcabcd";
+ QTest::addRow("pattern%d", ++i) << "ab.*cd" << "abccccccababd";
+
+ {
+ QString subject(512*1024, QLatin1Char('x'));
+ QTest::addRow("pattern%d", ++i) << "ab.*cd" << subject;
+ }
+
+ // pcre2 does not support JIT for winrt. As this test row takes a long time without JIT we skip
+ // it for winrt as it might time out in COIN.
+#ifndef Q_OS_WINRT
+ {
+ QString subject = "ab";
+ subject.append(QString(512*1024, QLatin1Char('x')));
+ subject.append("c");
+ QTest::addRow("pattern%d", ++i) << "ab.*cd" << subject;
+ }
+#endif // Q_OS_WINRT
+
+ {
+ QString subject = "ab";
+ subject.append(QString(512*1024, QLatin1Char('x')));
+ subject.append("cd");
+ QTest::addRow("pattern%d", ++i) << "ab.*cd" << subject;
+ }
+
+ QTest::addRow("pattern%d", ++i) << "(?(R)a*(?1)|((?R))b)" << "aaaabcde";
+ QTest::addRow("pattern%d", ++i) << "(?(R)a*(?1)|((?R))b)" << "aaaaaaabcde";
+}
+
+void tst_QRegularExpression::threadSafety()
+{
+ QFETCH(QString, pattern);
+ QFETCH(QString, subject);
+
+ static const int THREAD_SAFETY_ITERATIONS = 50;
+
+ const int threadCount = qMax(QThread::idealThreadCount(), 4);
+
+ for (int threadSafetyIteration = 0; threadSafetyIteration < THREAD_SAFETY_ITERATIONS; ++threadSafetyIteration) {
+ QRegularExpression re(pattern);
+
+ QVector<MatcherThread *> threads;
+ for (int i = 0; i < threadCount; ++i) {
+ MatcherThread *thread = new MatcherThread(re, subject);
+ thread->start();
+ threads.push_back(thread);
+ }
+
+ for (int i = 0; i < threadCount; ++i)
+ threads[i]->wait();
+
+ qDeleteAll(threads);
+ }
+}
+
+void tst_QRegularExpression::wildcard_data()
+{
+ QTest::addColumn<QString>("pattern");
+ QTest::addColumn<QString>("string");
+ QTest::addColumn<int>("foundIndex");
+
+ auto addRow = [](const char *pattern, const char *string, int foundIndex) {
+ QTest::newRow(pattern) << pattern << string << foundIndex;
+ };
+
+ addRow("*.html", "test.html", 0);
+ addRow("*.html", "test.htm", -1);
+ addRow("bar*", "foobarbaz", 3);
+ 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);
+
+#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);
+#endif
+}
+
+void tst_QRegularExpression::wildcard()
+{
+ QFETCH(QString, pattern);
+ QFETCH(QString, string);
+ QFETCH(int, foundIndex);
+
+ QRegularExpression re(QRegularExpression::wildcardToRegularExpression(pattern));
+ QRegularExpressionMatch match = re.match(string);
+
+ QCOMPARE(match.capturedStart(), foundIndex);
+}
+
+void tst_QRegularExpression::testInvalidWildcard_data()
+{
+ QTest::addColumn<QString>("pattern");
+ QTest::addColumn<bool>("isValid");
+
+ QTest::newRow("valid []") << "[abc]" << true;
+ QTest::newRow("valid ending ]") << "abc]" << true;
+ QTest::newRow("invalid [") << "[abc" << false;
+ QTest::newRow("ending [") << "abc[" << false;
+ QTest::newRow("ending [^") << "abc[^" << false;
+ QTest::newRow("ending [\\") << "abc[\\" << false;
+ QTest::newRow("ending []") << "abc[]" << false;
+ QTest::newRow("ending [[") << "abc[[" << false;
+}
+
+void tst_QRegularExpression::testInvalidWildcard()
+{
+ QFETCH(QString, pattern);
+ QFETCH(bool, isValid);
+
+ QRegularExpression re(QRegularExpression::wildcardToRegularExpression(pattern));
+ QCOMPARE(re.isValid(), isValid);
+}
+
+QTEST_APPLESS_MAIN(tst_QRegularExpression)
+
+#include "tst_qregularexpression.moc"
diff --git a/tests/auto/corelib/tools/qscopeguard/qscopeguard.pro b/tests/auto/corelib/tools/qscopeguard/qscopeguard.pro
new file mode 100644
index 0000000000..070d4b077c
--- /dev/null
+++ b/tests/auto/corelib/tools/qscopeguard/qscopeguard.pro
@@ -0,0 +1,4 @@
+CONFIG += testcase
+TARGET = tst_qscopeguard
+QT = core testlib
+SOURCES = tst_qscopeguard.cpp
diff --git a/tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp b/tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp
new file mode 100644
index 0000000000..f95d48f042
--- /dev/null
+++ b/tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Sérgio Martins <sergio.martins@kdab.com>
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QtCore/QScopeGuard>
+
+/*!
+ \class tst_QScopedGuard
+ \internal
+ \since 5.11
+ \brief Tests class QScopedCleanup and function qScopeGuard
+
+ */
+class tst_QScopedGuard : public QObject
+{
+ Q_OBJECT
+
+private Q_SLOTS:
+ void leavingScope();
+ void exceptions();
+};
+
+static int s_globalState = 0;
+
+void tst_QScopedGuard::leavingScope()
+{
+ auto cleanup = qScopeGuard([] { s_globalState++; QCOMPARE(s_globalState, 3); });
+ QCOMPARE(s_globalState, 0);
+
+ {
+ auto cleanup = qScopeGuard([] { s_globalState++; });
+ QCOMPARE(s_globalState, 0);
+ }
+
+ QCOMPARE(s_globalState, 1);
+ s_globalState++;
+}
+
+void tst_QScopedGuard::exceptions()
+{
+ s_globalState = 0;
+ bool caught = false;
+ QT_TRY
+ {
+ auto cleanup = qScopeGuard([&caught] { s_globalState++; });
+ QT_THROW(std::bad_alloc()); //if Qt compiled without exceptions this is noop
+ s_globalState = 100;
+ }
+ QT_CATCH(...)
+ {
+ caught = true;
+ QCOMPARE(s_globalState, 1);
+ }
+
+ QVERIFY((caught && s_globalState == 1) || (!caught && s_globalState == 101));
+
+}
+
+QTEST_MAIN(tst_QScopedGuard)
+#include "tst_qscopeguard.moc"
diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp
index 3e1668522e..4dc620e6ab 100644
--- a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp
@@ -53,6 +53,12 @@
# include <unistd.h>
#endif
+enum {
+ QMakeTimeout = 300000, // 5 minutes
+ CompileTimeout = 600000, // 10 minutes
+ RunTimeout = 300000 // 5 minutes
+};
+
static QString makespec()
{
static const char default_makespec[] = DEFAULT_MAKESPEC;
@@ -143,7 +149,7 @@ namespace QTest {
bool prepareSourceCode(const QByteArray &body);
bool createProjectFile();
bool runQmake();
- bool runMake(Target target);
+ bool runMake(Target target, int timeout);
bool commonSetup(const QByteArray &body);
};
@@ -602,7 +608,7 @@ namespace QTest {
std_err += "qmake: ";
std_err += qmake.errorString().toLocal8Bit();
} else {
- ok = qmake.waitForFinished();
+ ok = qmake.waitForFinished(QMakeTimeout);
exitCode = qmake.exitCode();
if (!ok)
QTest::ensureStopped(qmake);
@@ -617,7 +623,7 @@ namespace QTest {
#endif // QT_CONFIG(process)
}
- bool QExternalTestPrivate::runMake(Target target)
+ bool QExternalTestPrivate::runMake(Target target, int timeout)
{
#if !QT_CONFIG(process)
return false;
@@ -670,7 +676,7 @@ namespace QTest {
}
make.closeWriteChannel();
- bool ok = make.waitForFinished(channelMode == QProcess::ForwardedChannels ? -1 : 60000);
+ bool ok = make.waitForFinished(channelMode == QProcess::ForwardedChannels ? -1 : timeout);
if (!ok)
QTest::ensureStopped(make);
exitCode = make.exitCode();
@@ -705,7 +711,7 @@ namespace QTest {
failedStage = QExternalTest::CompilationStage;
std_out += "\n### --- stdout from make (compilation) --- ###\n";
std_err += "\n### --- stderr from make (compilation) --- ###\n";
- return runMake(Compile);
+ return runMake(Compile, CompileTimeout);
}
bool QExternalTestPrivate::tryLink(const QByteArray &body)
@@ -717,7 +723,7 @@ namespace QTest {
failedStage = QExternalTest::LinkStage;
std_out += "\n### --- stdout from make (linking) --- ###\n";
std_err += "\n### --- stderr from make (linking) --- ###\n";
- return runMake(Link);
+ return runMake(Link, CompileTimeout);
}
bool QExternalTestPrivate::tryRun(const QByteArray &body)
@@ -729,7 +735,7 @@ namespace QTest {
failedStage = QExternalTest::RunStage;
std_out += "\n### --- stdout from process --- ###\n";
std_err += "\n### --- stderr from process --- ###\n";
- return runMake(Run);
+ return runMake(Run, RunTimeout);
}
}
QT_END_NAMESPACE
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
index 2074c9789a..f429bda804 100644
--- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
@@ -450,6 +450,8 @@ private slots:
void trimmed();
void toUpper();
void toLower();
+ void isUpper();
+ void isLower();
void toCaseFolded();
void rightJustified();
void leftJustified();
@@ -529,10 +531,8 @@ private slots:
void integer_conversion();
void tortureSprintfDouble();
void toNum();
-#if !defined(Q_OS_WIN)
void localeAwareCompare_data();
void localeAwareCompare();
-#endif
void reverseIterators();
void split_data();
void split();
@@ -2315,6 +2315,46 @@ void tst_QString::toLower()
#endif
}
+void tst_QString::isUpper()
+{
+ QVERIFY(!QString().isUpper());
+ QVERIFY(!QString("").isUpper());
+ QVERIFY(QString("TEXT").isUpper());
+ QVERIFY(!QString("text").isUpper());
+ QVERIFY(!QString("Text").isUpper());
+ QVERIFY(!QString("tExt").isUpper());
+ QVERIFY(!QString("teXt").isUpper());
+ QVERIFY(!QString("texT").isUpper());
+ QVERIFY(!QString("TExt").isUpper());
+ QVERIFY(!QString("teXT").isUpper());
+ QVERIFY(!QString("tEXt").isUpper());
+ QVERIFY(!QString("tExT").isUpper());
+ QVERIFY(!QString("@ABYZ[").isUpper());
+ QVERIFY(!QString("@abyz[").isUpper());
+ QVERIFY(!QString("`ABYZ{").isUpper());
+ QVERIFY(!QString("`abyz{").isUpper());
+}
+
+void tst_QString::isLower()
+{
+ QVERIFY(!QString().isLower());
+ QVERIFY(!QString("").isLower());
+ QVERIFY(QString("text").isLower());
+ QVERIFY(!QString("Text").isLower());
+ QVERIFY(!QString("tExt").isLower());
+ QVERIFY(!QString("teXt").isLower());
+ QVERIFY(!QString("texT").isLower());
+ QVERIFY(!QString("TExt").isLower());
+ QVERIFY(!QString("teXT").isLower());
+ QVERIFY(!QString("tEXt").isLower());
+ QVERIFY(!QString("tExT").isLower());
+ QVERIFY(!QString("TEXT").isLower());
+ QVERIFY(!QString("@ABYZ[").isLower());
+ QVERIFY(!QString("@abyz[").isLower());
+ QVERIFY(!QString("`ABYZ{").isLower());
+ QVERIFY(!QString("`abyz{").isLower());
+}
+
void tst_QString::toCaseFolded()
{
QCOMPARE( QString().toCaseFolded(), QString() );
@@ -5468,8 +5508,6 @@ void tst_QString::tortureSprintfDouble()
#include <locale.h>
-#if !defined(Q_OS_WIN)
-// On Q_OS_WIN, we cannot set the system or user locale
void tst_QString::localeAwareCompare_data()
{
QTest::addColumn<QString>("locale");
@@ -5477,6 +5515,46 @@ void tst_QString::localeAwareCompare_data()
QTest::addColumn<QString>("s2");
QTest::addColumn<int>("result");
+ // Compare decomposed and composed form
+ {
+ // From ES6 test262 test suite (built-ins/String/prototype/localeCompare/15.5.4.9_CE.js). The test cases boil down to code like this:
+ // console.log("\u1111\u1171\u11B6".localeCompare("\ud4db")
+
+ // example from Unicode 5.0, section 3.7, definition D70
+ QTest::newRow("normalize1") << QString() << QString::fromUtf8("o\xCC\x88") << QString::fromUtf8("\xC3\xB6") << 0;
+ // examples from Unicode 5.0, chapter 3.11
+ QTest::newRow("normalize2") << QString() << QString::fromUtf8("\xC3\xA4\xCC\xA3") << QString::fromUtf8("a\xCC\xA3\xCC\x88") << 0;
+ QTest::newRow("normalize3") << QString() << QString::fromUtf8("a\xCC\x88\xCC\xA3") << QString::fromUtf8("a\xCC\xA3\xCC\x88") << 0;
+ QTest::newRow("normalize4") << QString() << QString::fromUtf8("\xE1\xBA\xA1\xCC\x88") << QString::fromUtf8("a\xCC\xA3\xCC\x88") << 0;
+ QTest::newRow("normalize5") << QString() << QString::fromUtf8("\xC3\xA4\xCC\x86") << QString::fromUtf8("a\xCC\x88\xCC\x86") << 0;
+ QTest::newRow("normalize6") << QString() << QString::fromUtf8("\xC4\x83\xCC\x88") << QString::fromUtf8("a\xCC\x86\xCC\x88") << 0;
+ // example from Unicode 5.0, chapter 3.12
+ QTest::newRow("normalize7") << QString() << QString::fromUtf8("\xE1\x84\x91\xE1\x85\xB1\xE1\x86\xB6") << QString::fromUtf8("\xED\x93\x9B") << 0;
+ // examples from UTS 10, Unicode Collation Algorithm
+ QTest::newRow("normalize8") << QString() << QString::fromUtf8("\xE2\x84\xAB") << QString::fromUtf8("\xC3\x85") << 0;
+ QTest::newRow("normalize9") << QString() << QString::fromUtf8("\xE2\x84\xAB") << QString::fromUtf8("A\xCC\x8A") << 0;
+ QTest::newRow("normalize10") << QString() << QString::fromUtf8("x\xCC\x9B\xCC\xA3") << QString::fromUtf8("x\xCC\xA3\xCC\x9B") << 0;
+ QTest::newRow("normalize11") << QString() << QString::fromUtf8("\xE1\xBB\xB1") << QString::fromUtf8("\xE1\xBB\xA5\xCC\x9B") << 0;
+ QTest::newRow("normalize12") << QString() << QString::fromUtf8("\xE1\xBB\xB1") << QString::fromUtf8("u\xCC\x9B\xCC\xA3") << 0;
+ QTest::newRow("normalize13") << QString() << QString::fromUtf8("\xE1\xBB\xB1") << QString::fromUtf8("\xC6\xB0\xCC\xA3") << 0;
+ QTest::newRow("normalize14") << QString() << QString::fromUtf8("\xE1\xBB\xB1") << QString::fromUtf8("u\xCC\xA3\xCC\x9B") << 0;
+ // examples from UAX 15, Unicode Normalization Forms
+ QTest::newRow("normalize15") << QString() << QString::fromUtf8("\xC3\x87") << QString::fromUtf8("C\xCC\xA7") << 0;
+ QTest::newRow("normalize16") << QString() << QString::fromUtf8("q\xCC\x87\xCC\xA3") << QString::fromUtf8("q\xCC\xA3\xCC\x87") << 0;
+ QTest::newRow("normalize17") << QString() << QString::fromUtf8("\xEA\xB0\x80") << QString::fromUtf8("\xE1\x84\x80\xE1\x85\xA1") << 0;
+ QTest::newRow("normalize18") << QString() << QString::fromUtf8("\xE2\x84\xAB") << QString::fromUtf8("A\xCC\x8A") << 0;
+ QTest::newRow("normalize19") << QString() << QString::fromUtf8("\xE2\x84\xA6") << QString::fromUtf8("\xCE\xA9") << 0;
+ QTest::newRow("normalize20") << QString() << QString::fromUtf8("\xC3\x85") << QString::fromUtf8("A\xCC\x8A") << 0;
+ QTest::newRow("normalize21") << QString() << QString::fromUtf8("\xC3\xB4") << QString::fromUtf8("o\xCC\x82") << 0;
+ QTest::newRow("normalize22") << QString() << QString::fromUtf8("\xE1\xB9\xA9") << QString::fromUtf8("s\xCC\xA3\xCC\x87") << 0;
+ QTest::newRow("normalize23") << QString() << QString::fromUtf8("\xE1\xB8\x8B\xCC\xA3") << QString::fromUtf8("d\xCC\xA3\xCC\x87") << 0;
+ QTest::newRow("normalize24") << QString() << QString::fromUtf8("\xE1\xB8\x8B\xCC\xA3") << QString::fromUtf8("\xE1\xB8\x8D\xCC\x87") << 0;
+ QTest::newRow("normalize25") << QString() << QString::fromUtf8("q\xCC\x87\xCC\xA3") << QString::fromUtf8("q\xCC\xA3\xCC\x87") << 0;
+
+ }
+
+#if !defined(Q_OS_WIN)
+// On Q_OS_WIN, we cannot set the system or user locale
/*
The C locale performs pure byte comparisons for
Latin-1-specific characters (I think). Compare with Swedish
@@ -5537,6 +5615,7 @@ void tst_QString::localeAwareCompare_data()
QTest::newRow("german2") << QString("de_DE") << QString::fromLatin1("\xe4") << QString::fromLatin1("\xf6") << -1;
QTest::newRow("german3") << QString("de_DE") << QString::fromLatin1("z") << QString::fromLatin1("\xf6") << 1;
#endif
+#endif //!defined(Q_OS_WIN)
}
void tst_QString::localeAwareCompare()
@@ -5549,17 +5628,17 @@ void tst_QString::localeAwareCompare()
QStringRef r1(&s1, 0, s1.length());
QStringRef r2(&s2, 0, s2.length());
+ if (!locale.isEmpty()) {
#if defined (Q_OS_DARWIN) || defined(QT_USE_ICU)
- QSKIP("Setting the locale is not supported on OS X or ICU (you can set the C locale, but that won't affect localeAwareCompare)");
+ QSKIP("Setting the locale is not supported on OS X or ICU (you can set the C locale, but that won't affect localeAwareCompare)");
#else
- if (!locale.isEmpty()) {
const char *newLocale = setlocale(LC_ALL, locale.toLatin1());
if (!newLocale) {
setlocale(LC_ALL, "");
QSKIP("Please install the proper locale on this machine to test properly");
}
- }
#endif
+ }
#ifdef QT_USE_ICU
// ### for c1, ICU disagrees with libc on how to compare
@@ -5614,7 +5693,6 @@ void tst_QString::localeAwareCompare()
if (!locale.isEmpty())
setlocale(LC_ALL, "");
}
-#endif //!defined(Q_OS_WIN)
void tst_QString::reverseIterators()
{
@@ -6160,11 +6238,14 @@ void tst_QString::compare()
QStringRef r1(&s1, 0, s1.length());
QStringRef r2(&s2, 0, s2.length());
+ const QStringView v2(s2);
+
QCOMPARE(sign(QString::compare(s1, s2)), csr);
QCOMPARE(sign(QStringRef::compare(r1, r2)), csr);
QCOMPARE(sign(s1.compare(s2)), csr);
QCOMPARE(sign(s1.compare(r2)), csr);
QCOMPARE(sign(r1.compare(r2)), csr);
+ QCOMPARE(sign(s1.compare(v2)), csr);
QCOMPARE(sign(s1.compare(s2, Qt::CaseSensitive)), csr);
QCOMPARE(sign(s1.compare(s2, Qt::CaseInsensitive)), cir);
@@ -6172,6 +6253,8 @@ void tst_QString::compare()
QCOMPARE(sign(s1.compare(r2, Qt::CaseInsensitive)), cir);
QCOMPARE(sign(r1.compare(r2, Qt::CaseSensitive)), csr);
QCOMPARE(sign(r1.compare(r2, Qt::CaseInsensitive)), cir);
+ QCOMPARE(sign(s1.compare(v2, Qt::CaseSensitive)), csr);
+ QCOMPARE(sign(s1.compare(v2, Qt::CaseInsensitive)), cir);
QCOMPARE(sign(QString::compare(s1, s2, Qt::CaseSensitive)), csr);
QCOMPARE(sign(QString::compare(s1, s2, Qt::CaseInsensitive)), cir);
diff --git a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp
index 9f054190e5..a3aec4c299 100644
--- a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp
+++ b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp
@@ -273,6 +273,15 @@ void tst_QStringList::contains()
QVERIFY(list.contains(QLatin1String("ARTHUR"), Qt::CaseInsensitive));
QVERIFY(list.contains(QLatin1String("dent"), Qt::CaseInsensitive));
QVERIFY(!list.contains(QLatin1String("hans"), Qt::CaseInsensitive));
+
+ QVERIFY(list.contains(QStringView(QString("arthur"))));
+ QVERIFY(!list.contains(QStringView(QString("ArthuR"))));
+ QVERIFY(!list.contains(QStringView(QString("Hans"))));
+ QVERIFY(list.contains(QStringView(QString("arthur")), Qt::CaseInsensitive));
+ QVERIFY(list.contains(QStringView(QString("ArthuR")), Qt::CaseInsensitive));
+ QVERIFY(list.contains(QStringView(QString("ARTHUR")), Qt::CaseInsensitive));
+ QVERIFY(list.contains(QStringView(QString("dent")), Qt::CaseInsensitive));
+ QVERIFY(!list.contains(QStringView(QString("hans")), Qt::CaseInsensitive));
}
void tst_QStringList::removeDuplicates_data()
diff --git a/tests/auto/corelib/tools/qstringview/tst_qstringview.cpp b/tests/auto/corelib/tools/qstringview/tst_qstringview.cpp
index 4ae96005d0..e800a0d794 100644
--- a/tests/auto/corelib/tools/qstringview/tst_qstringview.cpp
+++ b/tests/auto/corelib/tools/qstringview/tst_qstringview.cpp
@@ -217,6 +217,8 @@ private Q_SLOTS:
#endif
}
+ void comparison();
+
private:
template <typename String>
void conversion_tests(String arg) const;
@@ -615,5 +617,23 @@ void tst_QStringView::conversion_tests(String string) const
}
}
+void tst_QStringView::comparison()
+{
+ const QStringView aa = QStringViewLiteral("aa");
+ const QStringView upperAa = QStringViewLiteral("AA");
+ const QStringView bb = QStringViewLiteral("bb");
+
+ QVERIFY(aa == aa);
+ QVERIFY(aa != bb);
+ QVERIFY(aa < bb);
+ QVERIFY(bb > aa);
+
+ QCOMPARE(aa.compare(aa), 0);
+ QVERIFY(aa.compare(upperAa) != 0);
+ QCOMPARE(aa.compare(upperAa, Qt::CaseInsensitive), 0);
+ QVERIFY(aa.compare(bb) < 0);
+ QVERIFY(bb.compare(aa) > 0);
+}
+
QTEST_APPLESS_MAIN(tst_QStringView)
#include "tst_qstringview.moc"
diff --git a/tests/auto/corelib/tools/qtimeline/BLACKLIST b/tests/auto/corelib/tools/qtimeline/BLACKLIST
index 74f84a4a6d..5611969b4d 100644
--- a/tests/auto/corelib/tools/qtimeline/BLACKLIST
+++ b/tests/auto/corelib/tools/qtimeline/BLACKLIST
@@ -1,7 +1,9 @@
[interpolation]
windows
osx-10.12
+osx-10.13
[duration]
windows
[frameRate]
osx-10.12
+osx-10.13
diff --git a/tests/auto/corelib/tools/qtimezone/qtimezone.pro b/tests/auto/corelib/tools/qtimezone/qtimezone.pro
index 19ebc13306..5ec8d008e7 100644
--- a/tests/auto/corelib/tools/qtimezone/qtimezone.pro
+++ b/tests/auto/corelib/tools/qtimezone/qtimezone.pro
@@ -3,7 +3,7 @@ TARGET = tst_qtimezone
QT = core-private testlib
SOURCES = tst_qtimezone.cpp
qtConfig(icu) {
- DEFINES += QT_USE_ICU
+ QMAKE_USE_PRIVATE += icu
}
darwin {
diff --git a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
index ed80d4528d..d335dae7bc 100644
--- a/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
+++ b/tests/auto/corelib/tools/qtimezone/tst_qtimezone.cpp
@@ -31,6 +31,10 @@
#include <private/qtimezoneprivate_p.h>
#include <qlocale.h>
+#if defined(Q_OS_WIN) && !QT_CONFIG(icu)
+# define USING_WIN_TZ
+#endif
+
class tst_QTimeZone : public QObject
{
Q_OBJECT
@@ -413,7 +417,7 @@ void tst_QTimeZone::specificTransition_data()
QTest::addColumn<int>("dstoff");
// Moscow ditched DST on 2010-10-31 but has since changed standard offset twice.
-#ifdef Q_OS_WIN
+#ifdef USING_WIN_TZ
// Win7 is too old to know about this transition:
if (QOperatingSystemVersion::current() > QOperatingSystemVersion::Windows7)
#endif
@@ -477,8 +481,9 @@ void tst_QTimeZone::transitionEachZone_data()
};
QString name;
+ const auto zones = QTimeZone::availableTimeZoneIds();
for (int k = sizeof(table) / sizeof(table[0]); k-- > 0; ) {
- foreach (QByteArray zone, QTimeZone::availableTimeZoneIds()) {
+ for (const QByteArray &zone : zones) {
name.sprintf("%s@%d", zone.constData(), table[k].year);
QTest::newRow(name.toUtf8().constData())
<< zone
@@ -500,7 +505,7 @@ void tst_QTimeZone::transitionEachZone()
QTimeZone named(zone);
for (int i = start; i < stop; i++) {
-#ifdef Q_OS_WIN
+#ifdef USING_WIN_TZ
// See QTBUG-64985: MS's TZ APIs' misdescription of Europe/Samara leads
// to mis-disambiguation of its fall-back here.
if (QOperatingSystemVersion::current() <= QOperatingSystemVersion::Windows7
@@ -833,7 +838,7 @@ void tst_QTimeZone::utcTest()
void tst_QTimeZone::icuTest()
{
-#if defined(QT_BUILD_INTERNAL) && defined(QT_USE_ICU)
+#if defined(QT_BUILD_INTERNAL) && QT_CONFIG(icu)
// Known datetimes
qint64 std = QDateTime(QDate(2012, 1, 1), QTime(0, 0, 0), Qt::UTC).toMSecsSinceEpoch();
qint64 dst = QDateTime(QDate(2012, 6, 1), QTime(0, 0, 0), Qt::UTC).toMSecsSinceEpoch();
@@ -881,7 +886,7 @@ void tst_QTimeZone::icuTest()
testCetPrivate(tzp);
testEpochTranPrivate(QIcuTimeZonePrivate("America/Toronto"));
-#endif // QT_USE_ICU
+#endif // icu
}
void tst_QTimeZone::tzTest()
@@ -907,7 +912,7 @@ void tst_QTimeZone::tzTest()
QLocale enUS("en_US");
// Only test names in debug mode, names used can vary by ICU version installed
if (debug) {
-#ifdef QT_USE_ICU
+#if QT_CONFIG(icu)
QCOMPARE(tzp.displayName(QTimeZone::StandardTime, QTimeZone::LongName, enUS),
QString("Central European Standard Time"));
QCOMPARE(tzp.displayName(QTimeZone::StandardTime, QTimeZone::ShortName, enUS),
@@ -946,7 +951,7 @@ void tst_QTimeZone::tzTest()
QString("CET"));
QCOMPARE(tzp.displayName(QTimeZone::GenericTime, QTimeZone::OffsetName, enUS),
QString("CET"));
-#endif // QT_USE_ICU
+#endif // icu
// Test Abbreviations
QCOMPARE(tzp.abbreviation(std), QString("CET"));
@@ -1123,7 +1128,7 @@ void tst_QTimeZone::darwinTypes()
void tst_QTimeZone::winTest()
{
-#if defined(QT_BUILD_INTERNAL) && defined(Q_OS_WIN)
+#if defined(QT_BUILD_INTERNAL) && defined(USING_WIN_TZ)
// Known datetimes
qint64 std = QDateTime(QDate(2012, 1, 1), QTime(0, 0, 0), Qt::UTC).toMSecsSinceEpoch();
qint64 dst = QDateTime(QDate(2012, 6, 1), QTime(0, 0, 0), Qt::UTC).toMSecsSinceEpoch();
@@ -1174,7 +1179,7 @@ void tst_QTimeZone::winTest()
testCetPrivate(tzp);
testEpochTranPrivate(QWinTimeZonePrivate("America/Toronto"));
-#endif // Q_OS_WIN
+#endif // QT_BUILD_INTERNAL && USING_WIN_TZ
}
#ifdef QT_BUILD_INTERNAL
@@ -1286,7 +1291,7 @@ void tst_QTimeZone::testEpochTranPrivate(const QTimeZonePrivate &tzp)
// 1970-04-26 02:00 EST, -5 -> -4
const QDateTime after = QDateTime(QDate(1970, 4, 26), QTime(2, 0), Qt::OffsetFromUTC, -5 * 3600);
const QDateTime found = QDateTime::fromMSecsSinceEpoch(tran.atMSecsSinceEpoch, Qt::UTC);
-#ifdef Q_OS_WIN // MS gets the date wrong: 5th April instead of 26th.
+#ifdef USING_WIN_TZ // MS gets the date wrong: 5th April instead of 26th.
QCOMPARE(found.toOffsetFromUtc(-5 * 3600).time(), after.time());
#else
QCOMPARE(found, after);
diff --git a/tests/auto/corelib/tools/tools.pro b/tests/auto/corelib/tools/tools.pro
index f35ed026ac..f28cf21b8b 100644
--- a/tests/auto/corelib/tools/tools.pro
+++ b/tests/auto/corelib/tools/tools.pro
@@ -30,6 +30,7 @@ SUBDIRS=\
qlist \
qlist_strictiterators \
qlocale \
+ qmakearray \
qmap \
qmap_strictiterators \
qmargins \
diff --git a/tests/auto/dbus/qdbusinterface/qdbusinterface/qdbusinterface.pro b/tests/auto/dbus/qdbusinterface/qdbusinterface/qdbusinterface.pro
index b7dedad133..67709105a6 100644
--- a/tests/auto/dbus/qdbusinterface/qdbusinterface/qdbusinterface.pro
+++ b/tests/auto/dbus/qdbusinterface/qdbusinterface/qdbusinterface.pro
@@ -4,4 +4,11 @@ HEADERS += ../myobject.h
TARGET = ../tst_qdbusinterface
DESTDIR = ./
-QT = core core-private dbus testlib
+QT = core core-private dbus dbus-private testlib
+
+qtConfig(dbus-linked) {
+ DEFINES += QT_LINKED_LIBDBUS
+ QMAKE_USE += dbus
+} else {
+ SOURCES += ../../../../../src/dbus/qdbus_symbols.cpp
+}
diff --git a/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp b/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp
index da24429b9e..535d2f756b 100644
--- a/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp
+++ b/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp
@@ -115,6 +115,16 @@ public slots:
return obj.m_complexProp;
}
+ bool interactiveAuthorization()
+ {
+ if (message().isInteractiveAuthorizationAllowed())
+ return true;
+
+ sendErrorReply(QStringLiteral("org.freedesktop.DBus.Error.InteractiveAuthorizationRequired"),
+ QStringLiteral("Interactive authentication required."));
+ return false;
+ }
+
void quit()
{
qApp->quit();
diff --git a/tests/auto/dbus/qdbusinterface/tst_qdbusinterface.cpp b/tests/auto/dbus/qdbusinterface/tst_qdbusinterface.cpp
index 5494959aaf..05480c6dd2 100644
--- a/tests/auto/dbus/qdbusinterface/tst_qdbusinterface.cpp
+++ b/tests/auto/dbus/qdbusinterface/tst_qdbusinterface.cpp
@@ -33,6 +33,7 @@
#include <QtTest/QtTest>
#include <QtCore/qvariant.h>
#include <QtDBus/QtDBus>
+#include <QtDBus/private/qdbus_symbols_p.h>
#include <qdebug.h>
#include "../qdbusmarshall/common.h"
#include "myobject.h"
@@ -213,6 +214,8 @@ private slots:
void propertyWritePeer();
void complexPropertyReadPeer();
void complexPropertyWritePeer();
+
+ void interactiveAuthorizationRequired();
private:
QProcess proc;
};
@@ -1127,6 +1130,30 @@ void tst_QDBusInterface::complexPropertyWritePeer()
QCOMPARE(complexPropPeer(), arg);
}
+void tst_QDBusInterface::interactiveAuthorizationRequired()
+{
+ int major;
+ int minor;
+ int micro;
+ q_dbus_get_version(&major, &minor, &micro);
+
+ QVersionNumber dbusVersion(major, minor, micro);
+ if (dbusVersion < QVersionNumber(1, 9, 2))
+ QSKIP("Your DBus library is too old to support interactive authorization");
+
+ QDBusMessage req = QDBusMessage::createMethodCall(serviceName, objectPath, interfaceName, "interactiveAuthorization");
+ QDBusMessage reply = QDBusConnection::sessionBus().call(req);
+
+ QCOMPARE(reply.type(), QDBusMessage::ErrorMessage);
+ QCOMPARE(reply.errorName(), QStringLiteral("org.freedesktop.DBus.Error.InteractiveAuthorizationRequired"));
+
+ req.setInteractiveAuthorizationAllowed(true);
+ reply = QDBusConnection::sessionBus().call(req);
+
+ QCOMPARE(reply.type(), QDBusMessage::ReplyMessage);
+ QVERIFY(reply.arguments().at(0).toBool());
+}
+
QTEST_MAIN(tst_QDBusInterface)
#include "tst_qdbusinterface.moc"
diff --git a/tests/auto/gui/gui.pro b/tests/auto/gui/gui.pro
index d7cda11513..e0c8123f26 100644
--- a/tests/auto/gui/gui.pro
+++ b/tests/auto/gui/gui.pro
@@ -14,6 +14,6 @@ SUBDIRS = \
util \
itemmodels \
-!qtConfig(opengl): SUBDIRS -= qopengl qopenglconfig
+!qtConfig(opengl)|winrt: SUBDIRS -= qopengl qopenglconfig
!qtConfig(vulkan): SUBDIRS -= qvulkan
diff --git a/tests/auto/gui/image/qimage/images/jpeg_exif_utf8_comment.jpg b/tests/auto/gui/image/qimage/images/jpeg_exif_utf8_comment.jpg
new file mode 100644
index 0000000000..42b305f5b8
--- /dev/null
+++ b/tests/auto/gui/image/qimage/images/jpeg_exif_utf8_comment.jpg
Binary files differ
diff --git a/tests/auto/gui/image/qimage/qimage.pro b/tests/auto/gui/image/qimage/qimage.pro
index 56618e0bfa..b40866892e 100644
--- a/tests/auto/gui/image/qimage/qimage.pro
+++ b/tests/auto/gui/image/qimage/qimage.pro
@@ -7,4 +7,7 @@ qtConfig(c++11): CONFIG += c++11
android:!android-embedded: RESOURCES += qimage.qrc
+win32:!winrt: LIBS += -lgdi32 -luser32
+darwin: LIBS += -framework CoreGraphics
+
TESTDATA += images/*
diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp
index 34b20a5cca..5ffd75f931 100644
--- a/tests/auto/gui/image/qimage/tst_qimage.cpp
+++ b/tests/auto/gui/image/qimage/tst_qimage.cpp
@@ -44,6 +44,10 @@
#include <CoreGraphics/CoreGraphics.h>
#endif
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+# include <qt_windows.h>
+#endif
+
Q_DECLARE_METATYPE(QImage::Format)
Q_DECLARE_METATYPE(Qt::GlobalColor)
@@ -116,6 +120,7 @@ private slots:
void smoothScale2();
void smoothScale3_data();
void smoothScale3();
+ void smoothScale4_data();
void smoothScale4();
void smoothScaleBig();
@@ -192,6 +197,7 @@ private slots:
void exif_QTBUG45865();
void exifInvalidData_data();
void exifInvalidData();
+ void exifReadComments();
void cleanupFunctions();
@@ -224,6 +230,11 @@ private slots:
void convertColorTable();
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+ void toWinHBITMAP_data();
+ void toWinHBITMAP();
+#endif // Q_OS_WIN && !Q_OS_WINRT
+
private:
const QString m_prefix;
};
@@ -281,6 +292,12 @@ static QLatin1String formatToString(QImage::Format format)
return QLatin1String("Alpha8");
case QImage::Format_Grayscale8:
return QLatin1String("Grayscale8");
+ case QImage::Format_RGBX64:
+ return QLatin1String("RGBx64");
+ case QImage::Format_RGBA64:
+ return QLatin1String("RGBA64");
+ case QImage::Format_RGBA64_Premultiplied:
+ return QLatin1String("RGBA64pm");
default:
break;
};
@@ -1665,29 +1682,30 @@ void tst_QImage::smoothScale()
// test area sampling
void tst_QImage::smoothScale2_data()
{
- QTest::addColumn<int>("format");
+ QTest::addColumn<QImage::Format>("format");
QTest::addColumn<int>("size");
int sizes[] = { 2, 3, 4, 6, 7, 8, 10, 16, 20, 32, 40, 64, 100, 101, 128, 0 };
- QImage::Format formats[] = { QImage::Format_RGB32, QImage::Format_ARGB32_Premultiplied, QImage::Format_Invalid };
+ QImage::Format formats[] = { QImage::Format_RGB32, QImage::Format_ARGB32_Premultiplied, QImage::Format_RGBX64, QImage::Format_RGBA64_Premultiplied, QImage::Format_Invalid };
for (int j = 0; formats[j] != QImage::Format_Invalid; ++j) {
- QByteArray formatstr = formats[j] == QImage::Format_RGB32 ? QByteArrayLiteral("rgb32") : QByteArrayLiteral("argb32pm");
+ QString formatstr = formatToString(formats[j]);
for (int i = 0; sizes[i] != 0; ++i) {
const QByteArray sizeB = QByteArray::number(sizes[i]);
- QTest::newRow((formatstr + ' ' + sizeB + 'x' + sizeB).constData())
- << (int)formats[j] << sizes[i];
+ QTest::newRow(QString("%1 %2x%2").arg(formatstr).arg(sizes[i]).toUtf8()) << formats[j] << sizes[i];
}
}
}
void tst_QImage::smoothScale2()
{
- QFETCH(int, format);
+ QFETCH(QImage::Format, format);
QFETCH(int, size);
- QRgb expected = format == QImage::Format_RGB32 ? qRgb(63, 127, 255) : qRgba(31, 63, 127, 127);
+ bool opaque = (format == QImage::Format_RGB32 || format == QImage::Format_RGBX64);
- QImage img(size, size, (QImage::Format)format);
+ QRgb expected = opaque ? qRgb(63, 127, 255) : qRgba(31, 63, 127, 127);
+
+ QImage img(size, size, format);
img.fill(expected);
// scale x down, y down
@@ -1824,21 +1842,31 @@ void tst_QImage::smoothScale3()
}
// Tests smooth upscale is smooth
+void tst_QImage::smoothScale4_data()
+{
+ QTest::addColumn<QImage::Format>("format");
+
+ QTest::newRow("RGB32") << QImage::Format_RGB32;
+ QTest::newRow("RGBx64") << QImage::Format_RGBX64;
+}
+
void tst_QImage::smoothScale4()
{
- QImage img(4, 4, QImage::Format_RGB32);
+ QFETCH(QImage::Format, format);
+ QImage img(4, 4, format);
for (int y = 0; y < 4; ++y) {
for (int x = 0; x < 4; ++x) {
img.setPixel(x, y, qRgb(x * 255 / 3, y * 255 / 3, 0));
}
}
QImage scaled = img.scaled(37, 23, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
+ QCOMPARE(scaled.format(), format);
for (int y = 0; y < scaled.height(); ++y) {
for (int x = 0; x < scaled.width(); ++x) {
if (x > 0)
- QVERIFY(qRed(scaled.pixel(x, y)) >= qRed(scaled.pixel(x - 1, y)));
+ QVERIFY(scaled.pixelColor(x, y).redF() >= scaled.pixelColor(x - 1, y).redF());
if (y > 0)
- QVERIFY(qGreen(scaled.pixel(x, y)) >= qGreen(scaled.pixel(x, y - 1)));
+ QVERIFY(scaled.pixelColor(x, y).greenF() >= scaled.pixelColor(x, y - 1).greenF());
}
}
}
@@ -2337,7 +2365,9 @@ void tst_QImage::rgbSwapped_data()
{
QTest::addColumn<QImage::Format>("format");
- for (int i = QImage::Format_Indexed8; i < QImage::Format_Alpha8; ++i) {
+ for (int i = QImage::Format_Indexed8; i < QImage::NImageFormats; ++i) {
+ if (i == QImage::Format_Alpha8 || i == QImage::Format_Grayscale8)
+ continue;
QTest::addRow("%s", formatToString(QImage::Format(i)).data()) << QImage::Format(i);
}
}
@@ -2505,14 +2535,7 @@ void tst_QImage::mirrored()
void tst_QImage::inplaceRgbSwapped_data()
{
- QTest::addColumn<QImage::Format>("format");
-
- QTest::newRow("Format_ARGB32_Premultiplied") << QImage::Format_ARGB32_Premultiplied;
- QTest::newRow("Format_RGBA8888") << QImage::Format_RGBA8888;
- QTest::newRow("Format_A2RGB30_Premultiplied") << QImage::Format_A2RGB30_Premultiplied;
- QTest::newRow("Format_RGB888") << QImage::Format_RGB888;
- QTest::newRow("Format_RGB16") << QImage::Format_RGB16;
- QTest::newRow("Format_Indexed8") << QImage::Format_Indexed8;
+ rgbSwapped_data();
}
void tst_QImage::inplaceRgbSwapped()
@@ -2543,9 +2566,9 @@ void tst_QImage::inplaceRgbSwapped()
for (int i = 0; i < imageSwapped.width(); ++i) {
QRgb referenceColor = testColor[i];
QRgb swappedColor = imageSwapped.pixel(i, 0);
- QCOMPARE(qRed(swappedColor) & 0xf8, qBlue(referenceColor) & 0xf8);
- QCOMPARE(qGreen(swappedColor) & 0xf8, qGreen(referenceColor) & 0xf8);
- QCOMPARE(qBlue(swappedColor) & 0xf8, qRed(referenceColor) & 0xf8);
+ QCOMPARE(qRed(swappedColor) & 0xf0, qBlue(referenceColor) & 0xf0);
+ QCOMPARE(qGreen(swappedColor) & 0xf0, qGreen(referenceColor) & 0xf0);
+ QCOMPARE(qBlue(swappedColor) & 0xf0, qRed(referenceColor) & 0xf0);
}
QCOMPARE(imageSwapped.constScanLine(0), orginalPtr);
@@ -2761,9 +2784,13 @@ void tst_QImage::genericRgbConversion_data()
QTest::addColumn<QImage::Format>("format");
QTest::addColumn<QImage::Format>("dest_format");
- for (int i = QImage::Format_RGB32; i < QImage::Format_Alpha8; ++i) {
+ for (int i = QImage::Format_RGB32; i < QImage::NImageFormats; ++i) {
+ if (i == QImage::Format_Alpha8 || i == QImage::Format_Grayscale8)
+ continue;
const QLatin1String formatI = formatToString(QImage::Format(i));
- for (int j = QImage::Format_RGB32; j < QImage::Format_Alpha8; ++j) {
+ for (int j = QImage::Format_RGB32; j < QImage::NImageFormats; ++j) {
+ if (j == QImage::Format_Alpha8 || j == QImage::Format_Grayscale8)
+ continue;
if (i == j)
continue;
QTest::addRow("%s -> %s", formatI.data(), formatToString(QImage::Format(j)).data())
@@ -2800,8 +2827,12 @@ void tst_QImage::inplaceRgbConversion_data()
QTest::addColumn<QImage::Format>("format");
QTest::addColumn<QImage::Format>("dest_format");
- for (int i = QImage::Format_RGB32; i < QImage::Format_Alpha8; ++i) {
- for (int j = QImage::Format_RGB32; j < QImage::Format_Alpha8; ++j) {
+ for (int i = QImage::Format_RGB32; i < QImage::NImageFormats; ++i) {
+ if (i == QImage::Format_Alpha8 || i == QImage::Format_Grayscale8)
+ continue;
+ for (int j = QImage::Format_RGB32; j < QImage::NImageFormats; ++j) {
+ if (j == QImage::Format_Alpha8 || j == QImage::Format_Grayscale8)
+ continue;
if (i == j)
continue;
QTest::addRow("%s -> %s", formatToString(QImage::Format(i)).data(), formatToString(QImage::Format(j)).data())
@@ -2834,10 +2865,10 @@ void tst_QImage::inplaceRgbConversion()
QCOMPARE(qGreen(convertedColor) & 0xF0, i * 16);
}
}
- if (image.depth() == imageConverted.depth())
+ if (qt_depthForFormat(format) == qt_depthForFormat(dest_format))
QCOMPARE(imageConverted.constScanLine(0), originalPtr);
- {
+ if (qt_depthForFormat(format) <= 32) {
// Test attempted inplace conversion of images created on existing buffer
static const quint32 readOnlyData[] = { 0xff0102ffU, 0xff0506ffU, 0xff0910ffU, 0xff1314ffU };
quint32 readWriteData[] = { 0xff0102ffU, 0xff0506ffU, 0xff0910ffU, 0xff1314ffU };
@@ -2970,7 +3001,9 @@ void tst_QImage::invertPixelsRGB_data()
{
QTest::addColumn<QImage::Format>("image_format");
- for (int i = QImage::Format_RGB32; i < QImage::Format_Alpha8; ++i) {
+ for (int i = QImage::Format_RGB32; i < QImage::NImageFormats; ++i) {
+ if (i == QImage::Format_Alpha8 || i == QImage::Format_Grayscale8)
+ continue;
QTest::addRow("%s", formatToString(QImage::Format(i)).data()) << QImage::Format(i);
}
}
@@ -3068,6 +3101,34 @@ void tst_QImage::exifInvalidData()
QVERIFY(!image.isNull());
}
+void tst_QImage::exifReadComments()
+{
+ QImage image;
+ QVERIFY(image.load(m_prefix + "jpeg_exif_utf8_comment.jpg"));
+ QVERIFY(!image.isNull());
+ QCOMPARE(image.textKeys().size(), 1);
+ QCOMPARE(image.textKeys().first(), "Description");
+ // check if exif comment is read as utf-8
+ QCOMPARE(image.text("Description"), QString::fromUtf8("some unicode chars: ÖÄÜ€@"));
+
+ QByteArray ba;
+ {
+ QBuffer buf(&ba);
+ QVERIFY(buf.open(QIODevice::WriteOnly));
+ QVERIFY(image.save(&buf, "JPG"));
+ }
+ QVERIFY(!ba.isEmpty());
+ image = QImage();
+ QCOMPARE(image.textKeys().size(), 0);
+ {
+ QBuffer buf(&ba);
+ QVERIFY(buf.open(QIODevice::ReadOnly));
+ QVERIFY(image.load(&buf, "JPG"));
+ }
+ // compare written (and reread) description text
+ QCOMPARE(image.text("Description"), QString::fromUtf8("some unicode chars: ÖÄÜ€@"));
+}
+
static void cleanupFunction(void* info)
{
bool *called = static_cast<bool*>(info);
@@ -3473,5 +3534,108 @@ void tst_QImage::convertColorTable()
QCOMPARE(rgb32.pixel(0,0), 0xffffffff);
}
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
+QT_BEGIN_NAMESPACE
+Q_GUI_EXPORT HBITMAP qt_imageToWinHBITMAP(const QImage &p, int hbitmapFormat = 0);
+Q_GUI_EXPORT QImage qt_imageFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat = 0);
+QT_END_NAMESPACE
+
+static inline QColor COLORREFToQColor(COLORREF cr)
+{
+ return QColor(GetRValue(cr), GetGValue(cr), GetBValue(cr));
+}
+
+void tst_QImage::toWinHBITMAP_data()
+{
+ QTest::addColumn<QImage::Format>("format");
+ QTest::addColumn<QColor>("color");
+ QTest::addColumn<QColor>("bottomRightColor");
+
+ const QColor red(Qt::red);
+ const QColor green(Qt::green);
+ const QColor blue(Qt::blue);
+ const QColor gray(Qt::gray);
+ const QColor gray555(0x5a, 0x5a, 0x5a); // Note: Interpolation 8<->5 bit occurs.
+ const QColor white(Qt::white);
+ const QColor black(Qt::black);
+
+ QTest::newRow("argb32p-red") << QImage::Format_ARGB32_Premultiplied << red << gray;
+ QTest::newRow("argb32p-green") << QImage::Format_ARGB32_Premultiplied << green << gray;
+ QTest::newRow("argb32p-blue") << QImage::Format_ARGB32_Premultiplied << blue << gray;
+ QTest::newRow("rgb888-red") << QImage::Format_RGB888 << red << gray;
+ QTest::newRow("rgb888-green") << QImage::Format_RGB888 << green << gray;
+ QTest::newRow("rgb888-blue") << QImage::Format_RGB888 << blue << gray;
+ QTest::newRow("indexed8-red") << QImage::Format_Indexed8 << red << gray;
+ QTest::newRow("indexed8-green") << QImage::Format_Indexed8 << green << gray;
+ QTest::newRow("indexed8-blue") << QImage::Format_Indexed8 << blue << gray;
+ QTest::newRow("rgb555-red") << QImage::Format_RGB555 << red << gray555;
+ QTest::newRow("rgb555-green") << QImage::Format_RGB555 << green << gray555;
+ QTest::newRow("rgb555-blue") << QImage::Format_RGB555 << blue << gray555;
+ QTest::newRow("mono") << QImage::Format_Mono << white << black;
+}
+
+// Test image filled with color, black pixel at botttom right corner.
+static inline QImage createTestImage(QImage::Format format, int width, int height,
+ const QColor &fillColor, const QColor &bottomRightColor)
+{
+ QImage image(QSize(width, height), format);
+ image.fill(fillColor);
+ QPainter painter(&image);
+ QPen pen = painter.pen();
+ pen.setColor(bottomRightColor);
+ painter.setPen(pen);
+ painter.drawPoint(width -1, height - 1);
+ return image;
+}
+
+void tst_QImage::toWinHBITMAP()
+{
+ static const int width = 73;
+ static const int height = 57;
+
+ QFETCH(QImage::Format, format);
+ QFETCH(QColor, color);
+ QFETCH(QColor, bottomRightColor);
+
+ // Cannot paint on indexed/mono images.
+ const QImage image = format == QImage::Format_Indexed8 || format == QImage::Format_Mono
+ ? createTestImage(QImage::Format_RGB32, width, height, color, bottomRightColor).convertToFormat(format)
+ : createTestImage(format, width, height, color, bottomRightColor);
+
+ const HBITMAP bitmap = qt_imageToWinHBITMAP(image);
+
+ QVERIFY(bitmap != 0);
+
+ // Verify size
+ BITMAP bitmapInfo;
+ memset(&bitmapInfo, 0, sizeof(BITMAP));
+
+ const int res = GetObject(bitmap, sizeof(BITMAP), &bitmapInfo);
+ QVERIFY(res);
+ QCOMPARE(width, int(bitmapInfo.bmWidth));
+ QCOMPARE(height, int(bitmapInfo.bmHeight));
+
+ const HDC displayDc = GetDC(0);
+ const HDC bitmapDc = CreateCompatibleDC(displayDc);
+
+ const HBITMAP nullBitmap = static_cast<HBITMAP>(SelectObject(bitmapDc, bitmap));
+
+ QCOMPARE(COLORREFToQColor(GetPixel(bitmapDc, 0, 0)), color);
+ QCOMPARE(COLORREFToQColor(GetPixel(bitmapDc, width - 1, 3)), color);
+ QCOMPARE(COLORREFToQColor(GetPixel(bitmapDc, 3, height - 1)), color);
+ QCOMPARE(COLORREFToQColor(GetPixel(bitmapDc, width - 1, height - 1)), bottomRightColor);
+
+ const QImage convertedBack = qt_imageFromWinHBITMAP(bitmap);
+ QCOMPARE(convertedBack.convertToFormat(QImage::Format_ARGB32_Premultiplied),
+ image.convertToFormat(QImage::Format_ARGB32_Premultiplied));
+
+ // Clean up
+ SelectObject(bitmapDc, nullBitmap);
+ DeleteObject(bitmap);
+ DeleteDC(bitmapDc);
+ ReleaseDC(0, displayDc);
+}
+#endif // Q_OS_WIN && !Q_OS_WINRT
+
QTEST_GUILESS_MAIN(tst_QImage)
#include "tst_qimage.moc"
diff --git a/tests/auto/gui/image/qimagereader/images/basn0g16.png b/tests/auto/gui/image/qimagereader/images/basn0g16.png
new file mode 100644
index 0000000000..318ebcadf4
--- /dev/null
+++ b/tests/auto/gui/image/qimagereader/images/basn0g16.png
Binary files differ
diff --git a/tests/auto/gui/image/qimagereader/images/basn2c16.png b/tests/auto/gui/image/qimagereader/images/basn2c16.png
new file mode 100644
index 0000000000..1bd4a4d0e2
--- /dev/null
+++ b/tests/auto/gui/image/qimagereader/images/basn2c16.png
Binary files differ
diff --git a/tests/auto/gui/image/qimagereader/images/basn4a16.png b/tests/auto/gui/image/qimagereader/images/basn4a16.png
new file mode 100644
index 0000000000..6dbee9fbdb
--- /dev/null
+++ b/tests/auto/gui/image/qimagereader/images/basn4a16.png
Binary files differ
diff --git a/tests/auto/gui/image/qimagereader/images/basn6a16.png b/tests/auto/gui/image/qimagereader/images/basn6a16.png
new file mode 100644
index 0000000000..a9bf3cb461
--- /dev/null
+++ b/tests/auto/gui/image/qimagereader/images/basn6a16.png
Binary files differ
diff --git a/tests/auto/gui/image/qimagereader/images/kollada-16bpc.png b/tests/auto/gui/image/qimagereader/images/kollada-16bpc.png
new file mode 100644
index 0000000000..b99d5f8a6f
--- /dev/null
+++ b/tests/auto/gui/image/qimagereader/images/kollada-16bpc.png
Binary files differ
diff --git a/tests/auto/gui/image/qimagereader/images/tbwn0g16.png b/tests/auto/gui/image/qimagereader/images/tbwn0g16.png
new file mode 100644
index 0000000000..99bdeed2b3
--- /dev/null
+++ b/tests/auto/gui/image/qimagereader/images/tbwn0g16.png
Binary files differ
diff --git a/tests/auto/gui/image/qimagereader/qimagereader.pro b/tests/auto/gui/image/qimagereader/qimagereader.pro
index b06f56dddf..623d45ffe2 100644
--- a/tests/auto/gui/image/qimagereader/qimagereader.pro
+++ b/tests/auto/gui/image/qimagereader/qimagereader.pro
@@ -3,7 +3,8 @@ TARGET = tst_qimagereader
SOURCES += tst_qimagereader.cpp
MOC_DIR=tmp
QT += core-private gui-private network testlib
-RESOURCES += qimagereader.qrc
+
+RESOURCES += $$files(images/*)
android:!android-embedded {
RESOURCES += android_testdata.qrc
diff --git a/tests/auto/gui/image/qimagereader/qimagereader.qrc b/tests/auto/gui/image/qimagereader/qimagereader.qrc
deleted file mode 100644
index 2522154b1f..0000000000
--- a/tests/auto/gui/image/qimagereader/qimagereader.qrc
+++ /dev/null
@@ -1,69 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>images/16bpp.bmp</file>
- <file>images/4bpp-rle.bmp</file>
- <file>images/YCbCr_cmyk.jpg</file>
- <file>images/YCbCr_cmyk.png</file>
- <file>images/YCbCr_rgb.jpg</file>
- <file>images/away.png</file>
- <file>images/bat1.gif</file>
- <file>images/bat2.gif</file>
- <file>images/beavis.jpg</file>
- <file>images/black.png</file>
- <file>images/black.xpm</file>
- <file>images/colorful.bmp</file>
- <file>images/corrupt-colors.xpm</file>
- <file>images/corrupt-pixels.xpm</file>
- <file>images/corrupt.bmp</file>
- <file>images/corrupt.gif</file>
- <file>images/corrupt.jpg</file>
- <file>images/corrupt.png</file>
- <file>images/corrupt.xbm</file>
- <file>images/crash-signed-char.bmp</file>
- <file>images/earth.gif</file>
- <file>images/font.bmp</file>
- <file>images/gnus.xbm</file>
- <file>images/image.pbm</file>
- <file>images/image.pgm</file>
- <file>images/image.png</file>
- <file>images/image.ppm</file>
- <file>images/kollada.png</file>
- <file>images/marble.xpm</file>
- <file>images/namedcolors.xpm</file>
- <file>images/negativeheight.bmp</file>
- <file>images/noclearcode.bmp</file>
- <file>images/noclearcode.gif</file>
- <file>images/nontransparent.xpm</file>
- <file>images/rgb32bf.bmp</file>
- <file>images/runners.ppm</file>
- <file>images/teapot.ppm</file>
- <file>images/test.ppm</file>
- <file>images/test.xpm</file>
- <file>images/test32bfv4.bmp</file>
- <file>images/test32v5.bmp</file>
- <file>images/tst7.bmp</file>
- <file>images/tst7.png</file>
- <file>images/transparent.xpm</file>
- <file>images/trolltech.gif</file>
- <file>images/qt.gif</file>
- <file>images/qt1.gif</file>
- <file>images/qt2.gif</file>
- <file>images/qt3.gif</file>
- <file>images/qt4.gif</file>
- <file>images/qt5.gif</file>
- <file>images/qt6.gif</file>
- <file>images/qt7.gif</file>
- <file>images/qt8.gif</file>
- <file>images/endless-anim.gif</file>
- <file>images/four-frames.gif</file>
- <file>images/qt-gif-anim.gif</file>
- <file>images/qt-gif-noanim.gif</file>
- <file>images/rect.svg</file>
- <file>images/rect.svgz</file>
- <file>images/corrupt.svg</file>
- <file>images/corrupt.svgz</file>
- <file>images/qtbug13653-no_eoi.jpg</file>
- <file>images/txts.jpg</file>
- <file>images/txts.png</file>
- </qresource>
-</RCC>
diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
index 170f551dbf..c2ec5b8925 100644
--- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
@@ -234,6 +234,7 @@ void tst_QImageReader::readImage_data()
QTest::newRow("BMP: high mask bit set") << QString("rgb32bf.bmp") << true << QByteArray("bmp");
QTest::newRow("XPM: marble") << QString("marble.xpm") << true << QByteArray("xpm");
QTest::newRow("PNG: kollada") << QString("kollada.png") << true << QByteArray("png");
+ QTest::newRow("PNG: kollada 16bpc") << QString("kollada-16bpc.png") << true << QByteArray("png");
QTest::newRow("PPM: teapot") << QString("teapot.ppm") << true << QByteArray("ppm");
QTest::newRow("PPM: runners") << QString("runners.ppm") << true << QByteArray("ppm");
QTest::newRow("PPM: test") << QString("test.ppm") << true << QByteArray("ppm");
@@ -523,6 +524,12 @@ void tst_QImageReader::imageFormat_data()
QTest::newRow("bmp-4") << QString("test32v5.bmp") << QByteArray("bmp") << QImage::Format_RGB32;
QTest::newRow("png") << QString("kollada.png") << QByteArray("png") << QImage::Format_ARGB32;
QTest::newRow("png-2") << QString("YCbCr_cmyk.png") << QByteArray("png") << QImage::Format_RGB32;
+ QTest::newRow("png-3") << QString("kollada-16bpc.png") << QByteArray("png") << QImage::Format_RGBA64;
+ QTest::newRow("png-4") << QString("basn0g16.png") << QByteArray("png") << QImage::Format_RGBX64; // Grayscale16
+ QTest::newRow("png-5") << QString("basn2c16.png") << QByteArray("png") << QImage::Format_RGBX64;
+ QTest::newRow("png-6") << QString("basn4a16.png") << QByteArray("png") << QImage::Format_RGBA64; // Grayscale16Alpha16
+ QTest::newRow("png-7") << QString("basn6a16.png") << QByteArray("png") << QImage::Format_RGBA64;
+ QTest::newRow("png-8") << QString("tbwn0g16.png") << QByteArray("png") << QImage::Format_RGBA64; // Grayscale16+tRNS
QTest::newRow("svg") << QString("rect.svg") << QByteArray("svg") << QImage::Format_ARGB32_Premultiplied;
QTest::newRow("svgz") << QString("rect.svgz") << QByteArray("svgz") << QImage::Format_ARGB32_Premultiplied;
}
@@ -1596,6 +1603,7 @@ void tst_QImageReader::supportsOption_data()
<< (QIntList() << QImageIOHandler::Gamma
<< QImageIOHandler::Description
<< QImageIOHandler::Quality
+ << QImageIOHandler::CompressionRatio
<< QImageIOHandler::Size
<< QImageIOHandler::ScaledSize);
}
@@ -1850,6 +1858,8 @@ void tst_QImageReader::saveFormat_data()
QTest::newRow("Format_RGB888") << QImage::Format_RGB888;
QTest::newRow("Format_RGB444") << QImage::Format_RGB444;
QTest::newRow("Format_ARGB4444_Premultiplied") << QImage::Format_ARGB4444_Premultiplied;
+ QTest::newRow("Format_RGBA64") << QImage::Format_RGBA64;
+ QTest::newRow("Format_RGBA64_Premultiplied") << QImage::Format_RGBA64_Premultiplied;
}
void tst_QImageReader::saveFormat()
diff --git a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
index a53c2ddb5b..77851cd7d0 100644
--- a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
+++ b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
@@ -408,6 +408,7 @@ void tst_QImageWriter::supportsOption_data()
<< (QIntList() << QImageIOHandler::Gamma
<< QImageIOHandler::Description
<< QImageIOHandler::Quality
+ << QImageIOHandler::CompressionRatio
<< QImageIOHandler::Size
<< QImageIOHandler::ScaledSize);
}
diff --git a/tests/auto/gui/image/qpicture/qpicture.pro b/tests/auto/gui/image/qpicture/qpicture.pro
index 0fc851ce11..7f967f33b9 100644
--- a/tests/auto/gui/image/qpicture/qpicture.pro
+++ b/tests/auto/gui/image/qpicture/qpicture.pro
@@ -1,7 +1,6 @@
CONFIG += testcase
TARGET = tst_qpicture
QT += testlib
-qtHaveModule(widgets): QT += widgets
SOURCES += tst_qpicture.cpp
diff --git a/tests/auto/gui/image/qpicture/tst_qpicture.cpp b/tests/auto/gui/image/qpicture/tst_qpicture.cpp
index 5c812fd1b2..ec6bb8dcee 100644
--- a/tests/auto/gui/image/qpicture/tst_qpicture.cpp
+++ b/tests/auto/gui/image/qpicture/tst_qpicture.cpp
@@ -33,10 +33,8 @@
#include <qpainter.h>
#include <qimage.h>
#include <qpaintengine.h>
-#ifndef QT_NO_WIDGETS
-#include <qdesktopwidget.h>
-#include <qapplication.h>
-#endif
+#include <qguiapplication.h>
+#include <qscreen.h>
#include <limits.h>
class tst_QPicture : public QObject
@@ -53,11 +51,7 @@ private slots:
void boundingRect();
void swap();
void serialization();
-
-#ifndef QT_NO_WIDGETS
void save_restore();
-#endif
-
void boundaryValues_data();
void boundaryValues();
};
@@ -244,30 +238,23 @@ void tst_QPicture::serialization()
}
}
-
-#ifndef QT_NO_WIDGETS
-static QPointF scalePoint(const QPointF &point, QPaintDevice *sourceDevice, QPaintDevice *destDevice)
-{
- return QPointF(point.x() * qreal(destDevice->logicalDpiX()) / qreal(sourceDevice->logicalDpiX()),
- point.y() * qreal(destDevice->logicalDpiY()) / qreal(sourceDevice->logicalDpiY()));
-}
-
-static QRectF scaleRect(const QRectF &rect, QPaintDevice *sourceDevice, QPaintDevice *destDevice)
+static QRectF scaleRect(const QRectF &rect, qreal xf, qreal yf)
{
- return QRectF(rect.left() * qreal(destDevice->logicalDpiX()) / qreal(sourceDevice->logicalDpiX()),
- rect.top() * qreal(destDevice->logicalDpiY()) / qreal(sourceDevice->logicalDpiY()),
- rect.width() * qreal(destDevice->logicalDpiX()) / qreal(sourceDevice->logicalDpiX()),
- rect.height() * qreal(destDevice->logicalDpiY()) / qreal(sourceDevice->logicalDpiY()));
+ return QRectF(rect.left() * xf, rect.top() * yf, rect.width() * xf, rect.height() * yf);
}
static void paintStuff(QPainter *p)
{
- QPaintDevice *screenDevice = QApplication::desktop();
- p->drawRect(scaleRect(QRectF(100, 100, 100, 100), screenDevice, p->device()));
+ const QScreen *screen = QGuiApplication::primaryScreen();
+ // Calculate factors from the screen resolution against QPicture's 96DPI
+ // (enforced by Qt::AA_Use96Dpi as set by QTEST_MAIN).
+ const qreal xf = qreal(p->device()->logicalDpiX()) / screen->logicalDotsPerInchX();
+ const qreal yf = qreal(p->device()->logicalDpiY()) / screen->logicalDotsPerInchY();
+ p->drawRect(scaleRect(QRectF(100, 100, 100, 100), xf, yf));
p->save();
- p->translate(scalePoint(QPointF(10, 10), screenDevice, p->device()));
+ p->translate(10 * xf, 10 * yf);
p->restore();
- p->drawRect(scaleRect(QRectF(100, 100, 100, 100), screenDevice, p->device()));
+ p->drawRect(scaleRect(QRectF(100, 100, 100, 100), xf, yf));
}
/* See task: 41469
@@ -298,7 +285,6 @@ void tst_QPicture::save_restore()
QVERIFY( pix1.toImage() == pix2.toImage() );
}
-#endif
void tst_QPicture::boundaryValues_data()
{
diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
index e3bda6c2df..9a338ad55a 100644
--- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
@@ -90,6 +90,7 @@ private slots:
void mask();
void bitmapMask();
+ void bitmapFromImageRvalue();
void setGetMask_data();
void setGetMask();
void cacheKey();
@@ -596,6 +597,27 @@ void tst_QPixmap::bitmapMask()
QVERIFY(image.pixel(1, 1));
}
+void tst_QPixmap::bitmapFromImageRvalue()
+{
+ auto makeImage = [](){
+ QImage image(3, 3, QImage::Format_MonoLSB);
+ image.setColor(0, Qt::color0);
+ image.setColor(1, Qt::color1);
+ image.fill(Qt::color0);
+ image.setPixel(1, 1, Qt::color1);
+ image.setPixel(0, 0, Qt::color1);
+ return image;
+ };
+
+ auto image1 = makeImage();
+ auto image2 = makeImage();
+ auto bitmap1 = QBitmap::fromImage(image1);
+ auto bitmap2 = QBitmap::fromImage(std::move(image2));
+ QCOMPARE(bitmap1.toImage(), bitmap2.toImage());
+ QVERIFY(!image1.isNull());
+ QVERIFY(image2.isNull());
+}
+
void tst_QPixmap::setGetMask_data()
{
QTest::addColumn<QPixmap>("pixmap");
diff --git a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
index 8a2a35f86c..158530428d 100644
--- a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
+++ b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
@@ -92,6 +92,9 @@ void tst_QPixmapCache::cacheLimit()
// it was between 2048 and 10240 last time I looked at it
QVERIFY(originalCacheLimit >= 1024 && originalCacheLimit <= 20480);
+ QPixmapCache::setCacheLimit(std::numeric_limits<int>::max());
+ QCOMPARE(QPixmapCache::cacheLimit(), std::numeric_limits<int>::max());
+
QPixmapCache::setCacheLimit(100);
QCOMPARE(QPixmapCache::cacheLimit(), 100);
diff --git a/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp b/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp
index a45539a041..d19aa9b54f 100644
--- a/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp
+++ b/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp
@@ -69,8 +69,20 @@ private slots:
void sortChildren();
void subclassing();
void lessThan();
+ void clearData();
};
+void tst_QStandardItem::clearData()
+{
+ QStandardItem item;
+ item.setData(QStringLiteral("Test"), Qt::EditRole);
+ item.setData(5, Qt::UserRole);
+ item.clearData();
+ QCOMPARE(item.data(Qt::EditRole), QVariant());
+ QCOMPARE(item.data(Qt::UserRole), QVariant());
+ QCOMPARE(item.data(Qt::DisplayRole), QVariant());
+}
+
void tst_QStandardItem::ctor()
{
QStandardItem item;
diff --git a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
index 9399ebce34..e2d7a41bd1 100644
--- a/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
+++ b/tests/auto/gui/itemmodels/qstandarditemmodel/tst_qstandarditemmodel.cpp
@@ -98,6 +98,7 @@ private slots:
void checkChildren();
void data();
void clear();
+ void clearItemData();
void sort_data();
void sort();
void sortRole_data();
@@ -749,7 +750,32 @@ void tst_QStandardItemModel::data()
QCOMPARE(m_model->data(m_model->index(0, 0), Qt::DisplayRole).toString(), QLatin1String("initialitem"));
QCOMPARE(m_model->data(m_model->index(0, 0), Qt::ToolTipRole).toString(), QLatin1String("tooltip"));
+ const QMap<int, QVariant> itmData = m_model->itemData(m_model->index(0, 0));
+ QCOMPARE(itmData.value(Qt::DisplayRole), QLatin1String("initialitem"));
+ QCOMPARE(itmData.value(Qt::ToolTipRole), QLatin1String("tooltip"));
+ QVERIFY(!itmData.contains(Qt::UserRole - 1));
+ QVERIFY(m_model->itemData(QModelIndex()).isEmpty());
+}
+void tst_QStandardItemModel::clearItemData()
+{
+ currentRoles.clear();
+ QVERIFY(!m_model->clearItemData(QModelIndex()));
+ QCOMPARE(currentRoles, {});
+ const QModelIndex idx = m_model->index(0, 0);
+ const QMap<int, QVariant> oldData = m_model->itemData(idx);
+ m_model->setData(idx, QLatin1String("initialitem"), Qt::DisplayRole);
+ m_model->setData(idx, QLatin1String("tooltip"), Qt::ToolTipRole);
+ m_model->setData(idx, 5, Qt::UserRole);
+ currentRoles.clear();
+ QVERIFY(m_model->clearItemData(idx));
+ QCOMPARE(idx.data(Qt::UserRole), QVariant());
+ QCOMPARE(idx.data(Qt::ToolTipRole), QVariant());
+ QCOMPARE(idx.data(Qt::DisplayRole), QVariant());
+ QCOMPARE(idx.data(Qt::EditRole), QVariant());
+ QCOMPARE(currentRoles, {});
+ m_model->setItemData(idx, oldData);
+ currentRoles.clear();
}
void tst_QStandardItemModel::clear()
diff --git a/tests/auto/gui/kernel/qguiapplication/BLACKLIST b/tests/auto/gui/kernel/qguiapplication/BLACKLIST
new file mode 100644
index 0000000000..9a670237b7
--- /dev/null
+++ b/tests/auto/gui/kernel/qguiapplication/BLACKLIST
@@ -0,0 +1,4 @@
+[focusObject]
+opensuse
+opensuse-leap
+ubuntu
diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
index fc011d726d..a304981cd1 100644
--- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
+++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
@@ -374,6 +374,9 @@ public:
void tst_QGuiApplication::changeFocusWindow()
{
+#ifdef Q_OS_WINRT
+ QSKIP("WinRt does not support multiple native windows.");
+#endif
int argc = 0;
QGuiApplication app(argc, 0);
@@ -594,6 +597,9 @@ public:
void tst_QGuiApplication::modalWindow()
{
+#ifdef Q_OS_WINRT
+ QSKIP("WinRt does not support multiple native windows.");
+#endif
int argc = 0;
QGuiApplication app(argc, 0);
const QRect screenGeometry = QGuiApplication::primaryScreen()->availableVirtualGeometry();
diff --git a/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp b/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp
index ca6f677ba6..a0ac1b3631 100644
--- a/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp
+++ b/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp
@@ -67,9 +67,10 @@ void tst_QPalette::roleValues_data()
QTest::newRow("QPalette::NoRole") << int(QPalette::NoRole) << 17;
QTest::newRow("QPalette::ToolTipBase") << int(QPalette::ToolTipBase) << 18;
QTest::newRow("QPalette::ToolTipText") << int(QPalette::ToolTipText) << 19;
+ QTest::newRow("QPalette::PlaceholderText") << int(QPalette::PlaceholderText) << 20;
// Change this value as you add more roles.
- QTest::newRow("QPalette::NColorRoles") << int(QPalette::NColorRoles) << 20;
+ QTest::newRow("QPalette::NColorRoles") << int(QPalette::NColorRoles) << 21;
}
void tst_QPalette::roleValues()
diff --git a/tests/auto/gui/kernel/qtouchevent/qtouchevent.pro b/tests/auto/gui/kernel/qtouchevent/qtouchevent.pro
index b1e3c10724..8506a005bc 100644
--- a/tests/auto/gui/kernel/qtouchevent/qtouchevent.pro
+++ b/tests/auto/gui/kernel/qtouchevent/qtouchevent.pro
@@ -1,5 +1,4 @@
CONFIG += testcase
-osx: CONFIG += insignificant_test # QTBUG-46266, crashes
SOURCES=tst_qtouchevent.cpp
TARGET=tst_qtouchevent
QT += testlib widgets gui-private
diff --git a/tests/auto/gui/kernel/qwindow/BLACKLIST b/tests/auto/gui/kernel/qwindow/BLACKLIST
index df02b5b33e..f54865b841 100644
--- a/tests/auto/gui/kernel/qwindow/BLACKLIST
+++ b/tests/auto/gui/kernel/qwindow/BLACKLIST
@@ -1,12 +1,14 @@
[positioning:default]
linux
osx-10.12 ci
+winrt
[positioning:fake]
osx-10.12 ci
[modalWithChildWindow]
ubuntu-16.04
# QTBUG-66851
opensuse
+opensuse-leap
# QTBUG-69160
android
[setVisible]
@@ -38,6 +40,7 @@ android
[exposeEventOnShrink_QTBUG54040]
# QTBUG-69155
android
+opensuse
[initialSize]
# QTBUG-69159
android
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index 722405377e..9415908383 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -29,6 +29,7 @@
#include <qrasterwindow.h>
#include <qpa/qwindowsysteminterface.h>
#include <qpa/qplatformintegration.h>
+#include <qpa/qplatformwindow.h>
#include <private/qguiapplication_p.h>
#include <private/qhighdpiscaling_p.h>
#include <QtGui/QPainter>
@@ -48,6 +49,12 @@
Q_DECLARE_METATYPE(Qt::ScreenOrientation)
Q_DECLARE_METATYPE(QWindow::Visibility)
+static bool isPlatformWinRT()
+{
+ static const bool isWinRT = !QGuiApplication::platformName().compare(QLatin1String("winrt"), Qt::CaseInsensitive);
+ return isWinRT;
+}
+
class tst_QWindow: public QObject
{
Q_OBJECT
@@ -97,6 +104,7 @@ private slots:
void modalWindowPosition();
#ifndef QT_NO_CURSOR
void modalWindowEnterEventOnHide_QTBUG35109();
+ void spuriousMouseMove();
#endif
void windowsTransientChildren();
void requestUpdate();
@@ -107,6 +115,7 @@ private slots:
void cleanup();
void testBlockingWindowShownAfterModalDialog();
void generatedMouseMove();
+ void keepPendingUpdateRequests();
private:
QPoint m_availableTopLeft;
@@ -234,6 +243,8 @@ void tst_QWindow::setVisible()
QVERIFY(h.handle());
i.setParent(&h);
QVERIFY2(i.handle(), "Making a visible but not created child window child of a created window should create it");
+ if (isPlatformWinRT())
+ QEXPECT_FAIL("", "Child windows are unsupported on winrt", Continue);
QVERIFY(QTest::qWaitForWindowExposed(&i));
}
@@ -398,11 +409,15 @@ void tst_QWindow::resizeEventAfterResize()
// Make sure we get a resizeEvent after calling resize
window.resize(m_testWindowSize);
+ if (isPlatformWinRT())
+ QEXPECT_FAIL("", "Winrt windows are fullscreen by default.", Continue);
QTRY_COMPARE(window.received(QEvent::Resize), 2);
}
void tst_QWindow::exposeEventOnShrink_QTBUG54040()
{
+ if (isPlatformWinRT())
+ QSKIP("", "WinRT does not support non-maximized/non-fullscreen top level windows. QTBUG-54528", Continue);
Window window;
window.setGeometry(QRect(m_availableTopLeft + QPoint(80, 80), m_testWindowSize));
window.setTitle(QTest::currentTestFunction());
@@ -479,7 +494,7 @@ void tst_QWindow::positioning()
}
if (isPlatformWayland())
- QSKIP("Wayland: This fails. Figure out why.");
+ QSKIP("Wayland: This fails. See QTBUG-68660.");
// Some platforms enforce minimum widths for windows, which can cause extra resize
// events, so set the width to suitably large value to avoid those.
@@ -590,6 +605,8 @@ void tst_QWindow::childWindowPositioning()
{
if (isPlatformWayland())
QSKIP("Wayland: This is flaky (protocol errors for xdg-shell v6). See QTBUG-67648.");
+ else if (isPlatformWinRT())
+ QSKIP("WinRT does not support child windows.");
const QPoint topLeftOrigin(0, 0);
@@ -787,11 +804,10 @@ void tst_QWindow::isExposed()
window.hide();
- if (isPlatformWayland())
- QSKIP("Wayland: This is flaky. Figure out why.");
-
QCoreApplication::processEvents();
QTRY_VERIFY(window.received(QEvent::Expose) > 1);
+ if (isPlatformWinRT())
+ QEXPECT_FAIL("", "WinRT does not destroy the window. Figure out why. QTBUG-68297", Continue);
QTRY_VERIFY(!window.isExposed());
}
@@ -825,6 +841,8 @@ void tst_QWindow::isActive()
child.setGeometry(10, 10, 20, 20);
child.show();
+ if (isPlatformWinRT())
+ QEXPECT_FAIL("", "WinRT does not support native child windows.", Abort);
QTRY_VERIFY(child.isExposed());
child.requestActivate();
@@ -895,7 +913,7 @@ void tst_QWindow::isActive()
QVERIFY(child.isActive());
}
-class InputTestWindow : public QWindow
+class InputTestWindow : public ColoredWindow
{
public:
void keyPressEvent(QKeyEvent *event) {
@@ -989,7 +1007,9 @@ public:
enterEventCount = leaveEventCount = 0;
}
- InputTestWindow() {
+ explicit InputTestWindow(const QColor &color = Qt::white, QWindow *parent = nullptr)
+ : ColoredWindow(color, parent)
+ {
keyPressCode = keyReleaseCode = 0;
mousePressButton = mouseReleaseButton = mouseMoveButton = 0;
ignoreMouse = ignoreTouch = false;
@@ -1843,7 +1863,7 @@ void tst_QWindow::mask()
void tst_QWindow::initialSize()
{
if (isPlatformWayland())
- QSKIP("Wayland: This fails. Figure out why.");
+ QSKIP("Wayland: This fails. See QTBUG-66818.");
QSize defaultSize(0,0);
{
@@ -1857,6 +1877,8 @@ void tst_QWindow::initialSize()
Window w;
w.setWidth(m_testWindowSize.width());
w.showNormal();
+ if (isPlatformWinRT())
+ QEXPECT_FAIL("", "WinRT shows windows as fullscreen by default.", Continue);
QTRY_COMPARE(w.width(), m_testWindowSize.width());
QTRY_VERIFY(w.height() > 0);
}
@@ -1867,6 +1889,8 @@ void tst_QWindow::initialSize()
w.showNormal();
const QSize expectedSize = testSize;
+ if (isPlatformWinRT())
+ QEXPECT_FAIL("", "WinRT shows windows as fullscreen by default.", Continue);
QTRY_COMPARE(w.size(), expectedSize);
}
}
@@ -1910,13 +1934,15 @@ void tst_QWindow::modalDialog()
return;
}
+ if (isPlatformWinRT())
+ QEXPECT_FAIL("", "WinRT only support one native window.", Continue);
QTRY_COMPARE(QGuiApplication::focusWindow(), &dialog);
}
void tst_QWindow::modalDialogClosingOneOfTwoModal()
{
- if (isPlatformWayland())
- QSKIP("Wayland: This fails. Figure out why.");
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
+ QSKIP("QWindow::requestActivate() is not supported.");
QWindow normalWindow;
normalWindow.setFramePosition(m_availableTopLeft + QPoint(80, 80));
@@ -1955,6 +1981,8 @@ void tst_QWindow::modalDialogClosingOneOfTwoModal()
return;
}
+ if (isPlatformWinRT())
+ QEXPECT_FAIL("", "WinRT only support one native window.", Continue);
QTRY_COMPARE(QGuiApplication::focusWindow(), &first_dialog);
}
@@ -1982,6 +2010,8 @@ void tst_QWindow::modalWithChildWindow()
tlw_dialog.show();
QVERIFY(QTest::qWaitForWindowExposed(&tlw_dialog));
+ if (isPlatformWinRT())
+ QEXPECT_FAIL("", "WinRT only support one native window.", Abort);
QVERIFY(QTest::qWaitForWindowExposed(&sub_window));
QTRY_COMPARE(QGuiApplication::focusWindow(), &tlw_dialog);
@@ -2034,6 +2064,8 @@ void tst_QWindow::modalWindowPosition()
window.setModality(Qt::WindowModal);
window.show();
QVERIFY(QTest::qWaitForWindowExposed(&window));
+ if (isPlatformWinRT())
+ QEXPECT_FAIL("", "WinRT windows are fullscreen by default.", Continue);
QCOMPARE(window.geometry(), origGeo);
}
@@ -2094,6 +2126,9 @@ void tst_QWindow::modalWindowEnterEventOnHide_QTBUG35109()
root.resetCounters();
modal.close();
+ if (isPlatformWinRT())
+ QEXPECT_FAIL("", "WinRT does not trigger the enter event correctly"
+ "- QTBUG-68297.", Abort);
// Check for the enter event
QTRY_COMPARE(root.enterEventCount, 1);
}
@@ -2213,7 +2248,53 @@ void tst_QWindow::modalWindowEnterEventOnHide_QTBUG35109()
QTRY_COMPARE(root.enterEventCount, 1);
}
}
-#endif
+
+// Verify that no spurious mouse move events are received. On Windows, there is
+// no enter event, the OS sends mouse move events instead. Test that the QPA
+// plugin properly suppresses those since they can interfere with tests.
+// Simulate a main window setup with a modal dialog on top, keep the cursor
+// in the center and check that no mouse events are recorded.
+void tst_QWindow::spuriousMouseMove()
+{
+ const QString &platformName = QGuiApplication::platformName();
+ if (platformName == QLatin1String("offscreen") || platformName == QLatin1String("cocoa"))
+ QSKIP("No enter events sent");
+ if (isPlatformWayland() || isPlatformWinRT())
+ QSKIP("QCursor::setPos() is not supported on this platform");
+ const QRect screenGeometry = QGuiApplication::primaryScreen()->geometry();
+ const QPoint center = screenGeometry.center();
+ QCursor::setPos(center);
+ QRect windowGeometry(QPoint(), 2 * m_testWindowSize);
+ windowGeometry.moveCenter(center);
+ QTRY_COMPARE(QCursor::pos(), center);
+ InputTestWindow topLevel;
+ topLevel.setTitle(QTest::currentTestFunction());
+ topLevel.setGeometry(windowGeometry);
+ topLevel.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
+ QTRY_VERIFY(topLevel.enterEventCount > 0);
+ InputTestWindow dialog(Qt::yellow);
+ dialog.setTransientParent(&topLevel);
+ dialog.setTitle("Dialog " + topLevel.title());
+ dialog.setModality(Qt::ApplicationModal);
+ windowGeometry.setSize(m_testWindowSize);
+ windowGeometry.moveCenter(center);
+ dialog.setGeometry(windowGeometry);
+ dialog.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&dialog));
+ QTRY_VERIFY(dialog.enterEventCount > 0);
+ dialog.setVisible(false);
+ QCOMPARE(dialog.mousePressedCount, 0);
+ QCOMPARE(dialog.mouseReleasedCount, 0);
+ QCOMPARE(dialog.mouseMovedCount, 0);
+ QCOMPARE(dialog.mouseDoubleClickedCount, 0);
+ topLevel.setVisible(false);
+ QCOMPARE(topLevel.mousePressedCount, 0);
+ QCOMPARE(topLevel.mouseReleasedCount, 0);
+ QCOMPARE(topLevel.mouseMovedCount, 0);
+ QCOMPARE(topLevel.mouseDoubleClickedCount, 0);
+}
+#endif // !QT_NO_CURSOR
static bool isNativeWindowVisible(const QWindow *window)
{
@@ -2372,6 +2453,27 @@ void tst_QWindow::generatedMouseMove()
QVERIFY(w.mouseMovedCount == 5);
}
+void tst_QWindow::keepPendingUpdateRequests()
+{
+ QRect geometry(m_availableTopLeft + QPoint(80, 80), m_testWindowSize);
+
+ Window window;
+ window.setGeometry(geometry);
+ window.show();
+ QCoreApplication::processEvents();
+ QTRY_VERIFY(window.isExposed());
+
+ window.requestUpdate();
+ window.close();
+ window.setVisible(true);
+
+ QPlatformWindow *platformWindow = window.handle();
+ QVERIFY(platformWindow);
+
+ QVERIFY(platformWindow->hasPendingUpdateRequest());
+ QTRY_VERIFY(!platformWindow->hasPendingUpdateRequest());
+}
+
#include <tst_qwindow.moc>
QTEST_MAIN(tst_QWindow)
diff --git a/tests/auto/gui/painting/qbrush/tst_qbrush.cpp b/tests/auto/gui/painting/qbrush/tst_qbrush.cpp
index 9098bb0f6e..cd3eaa1478 100644
--- a/tests/auto/gui/painting/qbrush/tst_qbrush.cpp
+++ b/tests/auto/gui/painting/qbrush/tst_qbrush.cpp
@@ -58,6 +58,7 @@ private slots:
void testQGradientCopyConstructor();
void gradientStops();
+ void gradientPresets();
void textures();
@@ -326,6 +327,26 @@ void tst_QBrush::gradientStops()
QCOMPARE(gradient.stops().at(0).second, QColor());
}
+void tst_QBrush::gradientPresets()
+{
+ QGradient gradient(QGradient::WarmFlame);
+ QCOMPARE(gradient.type(), QGradient::LinearGradient);
+ QCOMPARE(gradient.coordinateMode(), QGradient::ObjectMode);
+
+ QLinearGradient *lg = static_cast<QLinearGradient *>(&gradient);
+ QCOMPARE(lg->start(), QPointF(0, 1));
+ QCOMPARE(lg->finalStop(), QPointF(1, 0));
+
+ QCOMPARE(lg->stops().size(), 3);
+ QCOMPARE(lg->stops().at(0), QGradientStop(0, QColor(QLatin1Literal("#ff9a9e"))));
+ QCOMPARE(lg->stops().at(1), QGradientStop(0.99, QColor(QLatin1Literal("#fad0c4"))));
+ QCOMPARE(lg->stops().at(2), QGradientStop(1, QColor(QLatin1Literal("#fad0c4"))));
+
+
+ QGradient invalidPreset(QGradient::Preset(-1));
+ QCOMPARE(invalidPreset.type(), QGradient::NoGradient);
+}
+
void fill(QPaintDevice *pd) {
QPainter p(pd);
diff --git a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
index 67d30d7c9a..ece7a30830 100644
--- a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
+++ b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
@@ -1492,10 +1492,28 @@ void tst_QColor::unpremultiply_sse4()
// Tests that qUnpremultiply_sse4 returns the same as qUnpremultiply.
#if QT_COMPILER_SUPPORTS_HERE(SSE4_1)
if (qCpuHasFeature(SSE4_1)) {
+ int minorDifferences = 0;
+ for (uint a = 0; a < 256; a++) {
+ for (uint c = 0; c <= a; c++) {
+ const QRgb p = qRgba(c, a-c, c/2, a);
+ const uint u = qUnpremultiply(p);
+ const uint usse4 = qUnpremultiply_sse4(p);
+ if (u != usse4) {
+ QCOMPARE(qAlpha(u), qAlpha(usse4));
+ QVERIFY(qAbs(qRed(u) - qRed(usse4)) <= 1);
+ QVERIFY(qAbs(qGreen(u) - qGreen(usse4)) <= 1);
+ QVERIFY(qAbs(qBlue(u) - qBlue(usse4)) <= 1);
+ ++minorDifferences;
+ }
+ }
+ }
+ // Allow a few rounding differences as long as it still obeys
+ // the qPremultiply(qUnpremultiply(x)) == x invariant
+ QVERIFY(minorDifferences <= 16 * 255);
for (uint a = 0; a < 256; a++) {
for (uint c = 0; c <= a; c++) {
QRgb p = qRgba(c, a-c, c, a);
- QCOMPARE(qUnpremultiply(p), qUnpremultiply_sse4(p));
+ QCOMPARE(p, qPremultiply(qUnpremultiply_sse4(p)));
}
}
return;
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index 181c609c6e..9bf9e99bf9 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -31,9 +31,9 @@
#include <qpainter.h>
#ifndef QT_NO_WIDGETS
#include <qdrawutil.h>
-#include <qapplication.h>
#include <qwidget.h>
#endif
+#include <qguiapplication.h>
#include <qfontmetrics.h>
#include <qbitmap.h>
#include <qimage.h>
@@ -41,26 +41,18 @@
#include <limits.h>
#include <math.h>
#include <qpaintengine.h>
-#ifndef QT_NO_WIDGETS
-#include <qdesktopwidget.h>
-#endif
#include <qpixmap.h>
#include <qrandom.h>
#include <private/qdrawhelper_p.h>
#include <qpainter.h>
-
-#ifndef QT_NO_WIDGETS
-#include <qlabel.h>
-#endif
-
#include <qqueue.h>
+#include <qscreen.h>
#ifndef QT_NO_WIDGETS
#include <qgraphicsview.h>
#include <qgraphicsscene.h>
#include <qgraphicsproxywidget.h>
-#include <qlayout.h>
#endif
#include <qfontdatabase.h>
@@ -404,7 +396,7 @@ void tst_QPainter::cleanupTestCase()
#ifndef QT_NO_WIDGETS
void tst_QPainter::drawPixmap_comp_data()
{
- if (qApp->desktop()->depth() < 24)
+ if (QGuiApplication::primaryScreen()->depth() < 24)
QSKIP("Test only works on 32 bit displays");
QTest::addColumn<uint>("dest");
@@ -1099,6 +1091,7 @@ void tst_QPainter::fillRect_data()
QTest::newRow("argb32pm") << QImage::Format_ARGB32_Premultiplied;
QTest::newRow("rgba8888pm") << QImage::Format_RGBA8888_Premultiplied;
+ QTest::newRow("rgba64pm") << QImage::Format_RGBA64_Premultiplied;
}
void tst_QPainter::fillRect()
@@ -2451,6 +2444,24 @@ void tst_QPainter::setOpacity_data()
QTest::newRow("A2RGB30P on RGB30") << QImage::Format_RGB30
<< QImage::Format_A2RGB30_Premultiplied;
+ QTest::newRow("RGBA64P on RGBA64P") << QImage::Format_RGBA64_Premultiplied
+ << QImage::Format_RGBA64_Premultiplied;
+
+ QTest::newRow("RGBA64 on RGBA64") << QImage::Format_RGBA64
+ << QImage::Format_RGBA64;
+
+ QTest::newRow("RGBx64 on RGBx64") << QImage::Format_RGBX64
+ << QImage::Format_RGBX64;
+
+ QTest::newRow("RGBA64P on ARGB32P") << QImage::Format_ARGB32_Premultiplied
+ << QImage::Format_RGBA64_Premultiplied;
+
+ QTest::newRow("RGBx64 on ARGB32P") << QImage::Format_ARGB32_Premultiplied
+ << QImage::Format_RGBX64;
+
+ QTest::newRow("ARGB32P on RGBA64P") << QImage::Format_RGBA64_Premultiplied
+ << QImage::Format_ARGB32_Premultiplied;
+
}
void tst_QPainter::setOpacity()
@@ -3855,6 +3866,8 @@ void tst_QPainter::gradientPixelFormat_data()
QTest::newRow("rgbx8888") << QImage::Format_RGBX8888;
QTest::newRow("rgba8888") << QImage::Format_RGBA8888;
QTest::newRow("rgba8888_pm") << QImage::Format_RGBA8888_Premultiplied;
+ QTest::newRow("rgbx64") << QImage::Format_RGBX64;
+ QTest::newRow("rgba64_pm") << QImage::Format_RGBA64_Premultiplied;
}
void tst_QPainter::gradientPixelFormat()
@@ -4792,7 +4805,19 @@ void tst_QPainter::blendARGBonRGB_data()
<< QPainter::CompositionMode_SourceIn << qRgba(255, 0, 0, 127) << 255 ;
QTest::newRow("ARGB_PM source-in ARGB32") << QImage::Format_ARGB32 << QImage::Format_ARGB32_Premultiplied
<< QPainter::CompositionMode_SourceIn << qRgba(127, 0, 0, 127) << 255;
- // Only ARGB does inverse premultiply, on the rest over and source gives similar results:
+ QTest::newRow("ARGB over RGBA8888") << QImage::Format_RGBA8888 << QImage::Format_ARGB32
+ << QPainter::CompositionMode_SourceOver << qRgba(255, 0, 0, 127) << 127;
+ QTest::newRow("ARGB_PM over RGBA8888") << QImage::Format_RGBA8888 << QImage::Format_ARGB32_Premultiplied
+ << QPainter::CompositionMode_SourceOver << qRgba(127, 0, 0, 127) << 127;
+ QTest::newRow("ARGB source RGBA8888") << QImage::Format_RGBA8888 << QImage::Format_ARGB32
+ << QPainter::CompositionMode_Source << qRgba(255, 0, 0, 127) << 255;
+ QTest::newRow("ARGB_PM source RGBA8888") << QImage::Format_RGBA8888 << QImage::Format_ARGB32_Premultiplied
+ << QPainter::CompositionMode_Source << qRgba(127, 0, 0, 127) << 255;
+ QTest::newRow("ARGB source-in RGBA8888") << QImage::Format_RGBA8888 << QImage::Format_ARGB32
+ << QPainter::CompositionMode_SourceIn << qRgba(255, 0, 0, 127) << 255;
+ QTest::newRow("ARGB_PM source-in RGBA8888") << QImage::Format_RGBA8888 << QImage::Format_ARGB32_Premultiplied
+ << QPainter::CompositionMode_SourceIn << qRgba(127, 0, 0, 127) << 255;
+ // Only ARGB32 and RGBA8888 does inverse premultiply, on the rest over and source gives similar results:
QTest::newRow("ARGB over RGB32") << QImage::Format_RGB32 << QImage::Format_ARGB32
<< QPainter::CompositionMode_SourceOver << qRgba(255, 0, 0, 127) << 127;
QTest::newRow("ARGB_PM over RGB32") << QImage::Format_RGB32 << QImage::Format_ARGB32_Premultiplied
@@ -4829,18 +4854,6 @@ void tst_QPainter::blendARGBonRGB_data()
<< QPainter::CompositionMode_SourceIn << qRgba(255, 0, 0, 127) << 127;
QTest::newRow("ARGB_PM source-in RGBx8888") << QImage::Format_RGBX8888 << QImage::Format_ARGB32_Premultiplied
<< QPainter::CompositionMode_SourceIn << qRgba(127, 0, 0, 127) << 127;
- QTest::newRow("ARGB over RGBA8888") << QImage::Format_RGBA8888 << QImage::Format_ARGB32
- << QPainter::CompositionMode_SourceOver << qRgba(255, 0, 0, 127) << 127;
- QTest::newRow("ARGB_PM over RGBA8888") << QImage::Format_RGBA8888 << QImage::Format_ARGB32_Premultiplied
- << QPainter::CompositionMode_SourceOver << qRgba(127, 0, 0, 127) << 127;
- QTest::newRow("ARGB source RGBA8888") << QImage::Format_RGBA8888 << QImage::Format_ARGB32
- << QPainter::CompositionMode_Source << qRgba(255, 0, 0, 127) << 255;
- QTest::newRow("ARGB_PM source RGBA8888") << QImage::Format_RGBA8888 << QImage::Format_ARGB32_Premultiplied
- << QPainter::CompositionMode_Source << qRgba(127, 0, 0, 127) << 255;
- QTest::newRow("ARGB source-in RGBA8888") << QImage::Format_RGBA8888 << QImage::Format_ARGB32
- << QPainter::CompositionMode_SourceIn << qRgba(255, 0, 0, 127) << 255;
- QTest::newRow("ARGB_PM source-in RGBA8888") << QImage::Format_RGBA8888 << QImage::Format_ARGB32_Premultiplied
- << QPainter::CompositionMode_SourceIn << qRgba(127, 0, 0, 127) << 255;
QTest::newRow("ARGB over RGB16") << QImage::Format_RGB16 << QImage::Format_ARGB32
<< QPainter::CompositionMode_SourceOver << qRgba(255, 0, 0, 127) << 123;
QTest::newRow("ARGB_PM over RGB16") << QImage::Format_RGB16 << QImage::Format_ARGB32_Premultiplied
@@ -5011,7 +5024,7 @@ void tst_QPainter::drawPolyline_data()
{
QTest::addColumn< QVector<QPointF> >("points");
- QTest::newRow("basic") << (QVector<QPointF>() << QPointF(10, 10) << QPointF(20, 10) << QPointF(20, 20) << QPointF(10, 20));
+ QTest::newRow("basic") << (QVector<QPointF>() << QPointF(10, 10) << QPointF(20, 10) << QPointF(20, 20));
QTest::newRow("clipped") << (QVector<QPointF>() << QPoint(-10, 100) << QPoint(-1, 100) << QPoint(-1, -2) << QPoint(100, -2) << QPoint(100, 40)); // QTBUG-31579
QTest::newRow("shortsegment") << (QVector<QPointF>() << QPoint(20, 100) << QPoint(20, 99) << QPoint(21, 99) << QPoint(21, 104)); // QTBUG-42398
QTest::newRow("edge") << (QVector<QPointF>() << QPointF(4.5, 121.6) << QPointF(9.4, 150.9) << QPointF(14.2, 184.8) << QPointF(19.1, 130.4));
diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp
index 5b1af9b6c9..f1360b9efe 100644
--- a/tests/auto/gui/qopengl/tst_qopengl.cpp
+++ b/tests/auto/gui/qopengl/tst_qopengl.cpp
@@ -82,6 +82,8 @@ private slots:
void fboRendering();
void fboRenderingRGB30_data();
void fboRenderingRGB30();
+ void fboRenderingRGB64_data();
+ void fboRenderingRGB64();
void fboHandleNulledAfterContextDestroyed();
void fboMRT();
void fboMRT_differentFormats();
@@ -614,6 +616,10 @@ void tst_QOpenGL::fboRenderingRGB30_data()
#define GL_RGB10_A2 0x8059
#endif
+#ifndef GL_RGBA16
+#define GL_RGBA16 0x805B
+#endif
+
#ifndef GL_FRAMEBUFFER_RENDERABLE
#define GL_FRAMEBUFFER_RENDERABLE 0x8289
#endif
@@ -622,7 +628,7 @@ void tst_QOpenGL::fboRenderingRGB30_data()
#define GL_FULL_SUPPORT 0x82B7
#endif
-static bool hasRGB10A2(QOpenGLContext *ctx)
+static bool supportsInternalFboFormat(QOpenGLContext *ctx, int glFormat)
{
if (ctx->format().majorVersion() < 3)
return false;
@@ -631,7 +637,7 @@ static bool hasRGB10A2(QOpenGLContext *ctx)
GLint value = -1;
QOpenGLFunctions_4_2_Core* vFuncs = ctx->versionFunctions<QOpenGLFunctions_4_2_Core>();
if (vFuncs && vFuncs->initializeOpenGLFunctions()) {
- vFuncs->glGetInternalformativ(GL_TEXTURE_2D, GL_RGB10_A2, GL_FRAMEBUFFER_RENDERABLE, 1, &value);
+ vFuncs->glGetInternalformativ(GL_TEXTURE_2D, glFormat, GL_FRAMEBUFFER_RENDERABLE, 1, &value);
if (value != GL_FULL_SUPPORT)
return false;
}
@@ -657,7 +663,7 @@ void tst_QOpenGL::fboRenderingRGB30()
if (!QOpenGLFramebufferObject::hasOpenGLFramebufferObjects())
QSKIP("QOpenGLFramebufferObject not supported on this platform");
- if (!hasRGB10A2(&ctx))
+ if (!supportsInternalFboFormat(&ctx, GL_RGB10_A2))
QSKIP("An internal RGB30_A2 format is not guaranteed on this platform");
// No multisample with combined depth/stencil attachment:
@@ -713,6 +719,71 @@ void tst_QOpenGL::fboRenderingRGB30()
QVERIFY(((pixel >> 20) & 0x3f) > 0);
}
+void tst_QOpenGL::fboRenderingRGB64_data()
+{
+ common_data();
+}
+
+void tst_QOpenGL::fboRenderingRGB64()
+{
+#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(__x86_64__)
+ QSKIP("QTBUG-22617");
+#endif
+
+ QFETCH(int, surfaceClass);
+ QScopedPointer<QSurface> surface(createSurface(surfaceClass));
+
+ QOpenGLContext ctx;
+ QVERIFY(ctx.create());
+
+ QVERIFY(ctx.makeCurrent(surface.data()));
+
+ if (!QOpenGLFramebufferObject::hasOpenGLFramebufferObjects())
+ QSKIP("QOpenGLFramebufferObject not supported on this platform");
+
+ if (!supportsInternalFboFormat(&ctx, GL_RGBA16))
+ QSKIP("An internal RGBA16 format is not guaranteed on this platform");
+
+ // No multisample with combined depth/stencil attachment:
+ QOpenGLFramebufferObjectFormat fboFormat;
+ fboFormat.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
+ fboFormat.setInternalTextureFormat(GL_RGBA16);
+
+ // Uncomplicate things by using POT:
+ const QSize size(256, 128);
+ QOpenGLFramebufferObject fbo(size, fboFormat);
+
+ if (fbo.attachment() != QOpenGLFramebufferObject::CombinedDepthStencil)
+ QSKIP("FBOs missing combined depth~stencil support");
+
+ QVERIFY(fbo.bind());
+
+ QPainter fboPainter;
+ QOpenGLPaintDevice device(fbo.width(), fbo.height());
+ bool painterBegun = fboPainter.begin(&device);
+ QVERIFY(painterBegun);
+
+ qt_opengl_draw_test_pattern(&fboPainter, fbo.width(), fbo.height());
+
+ fboPainter.end();
+
+ QImage fb = fbo.toImage();
+ QCOMPARE(fb.format(), QImage::Format_RGBA64_Premultiplied);
+ QCOMPARE(fb.size(), size);
+
+ qt_opengl_check_test_pattern(fb);
+
+ // Check rendering can handle precise 16 bit color values.
+ fboPainter.begin(&device);
+ fboPainter.fillRect(QRect(0, 0, 256, 128), QColor::fromRgba64(5, 1002, 8001, 65535));
+ fboPainter.end();
+ fb = fbo.toImage();
+ QRgba64 pixel = ((QRgba64*)fb.bits())[0];
+ QCOMPARE(pixel.red(), 5);
+ QCOMPARE(pixel.green(), 1002);
+ QCOMPARE(pixel.blue(), 8001);
+}
+
void tst_QOpenGL::fboHandleNulledAfterContextDestroyed()
{
QWindow window;
@@ -844,7 +915,7 @@ void tst_QOpenGL::fboMRT_differentFormats()
if (!f->hasOpenGLFeature(QOpenGLFunctions::MultipleRenderTargets))
QSKIP("Multiple render targets not supported on this platform");
- if (!hasRGB10A2(&ctx))
+ if (!supportsInternalFboFormat(&ctx, GL_RGB10_A2))
QSKIP("RGB10_A2 not supported on this platform");
// 3 color attachments, same size, different internal format, depth/stencil.
diff --git a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
index 2a53f5d633..cfd24a8701 100644
--- a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
+++ b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
@@ -1509,6 +1509,12 @@ void tst_QCssParser::gradient_data()
"spread: repeat, stop:0.2 rgb(1, 2, 3), stop:0.5 rgba(1, 2, 3, 4))" << "conical" << QPointF(4, 2) << QPointF()
<< 2 << qreal(0.2) << QColor(1, 2, 3) << qreal(0.5) << QColor(1, 2, 3, 4);
+ // spaces before first function parameter lead to parser errors
+ QTest::newRow("QTBUG-61795") <<
+ "selection-background-color: qconicalgradient( cx: 4, cy : 2, angle: 23, "
+ "spread: repeat, stop:0.2 rgb( 1, 2, 3), stop:0.5 rgba( 1, 2, 3, 4))" << "conical" << QPointF(4, 2) << QPointF()
+ << 2 << qreal(0.2) << QColor(1, 2, 3) << qreal(0.5) << QColor(1, 2, 3, 4);
+
/* won't pass: stop values are expected to be sorted
QTest::newRow("unsorted-stop") <<
"selection-background: lineargradient(x1:0, y1:0, x2:0, y2:1, "
diff --git a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
index 79058e5073..da2f100c0b 100644
--- a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
+++ b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
@@ -65,6 +65,7 @@ private slots:
void fallbackFonts();
void condensedFontWidth();
+ void condensedFontWidthNoFontMerging();
void condensedFontMatching();
void rasterFonts();
@@ -297,6 +298,29 @@ static QString testString()
return QStringLiteral("foo bar");
}
+void tst_QFontDatabase::condensedFontWidthNoFontMerging()
+{
+ int regularFontId = QFontDatabase::addApplicationFont(m_testFont);
+ int condensedFontId = QFontDatabase::addApplicationFont(m_testFontCondensed);
+
+ QVERIFY(!QFontDatabase::applicationFontFamilies(regularFontId).isEmpty());
+ QVERIFY(!QFontDatabase::applicationFontFamilies(condensedFontId).isEmpty());
+
+ QString regularFontName = QFontDatabase::applicationFontFamilies(regularFontId).first();
+ QString condensedFontName = QFontDatabase::applicationFontFamilies(condensedFontId).first();
+
+ QFont condensedFont1(condensedFontName);
+ if (regularFontName == condensedFontName)
+ condensedFont1.setStyleName(QStringLiteral("Condensed"));
+ condensedFont1.setStyleStrategy(QFont::PreferMatch);
+
+ QFont condensedFont2 = condensedFont1;
+ condensedFont2.setStyleStrategy(QFont::StyleStrategy(QFont::NoFontMerging | QFont::PreferMatch));
+
+ QCOMPARE(QFontMetricsF(condensedFont2).horizontalAdvance(QStringLiteral("foobar")),
+ QFontMetricsF(condensedFont1).horizontalAdvance(QStringLiteral("foobar")));
+ }
+
void tst_QFontDatabase::condensedFontWidth()
{
QFontDatabase db;
diff --git a/tests/auto/gui/text/qglyphrun/BLACKLIST b/tests/auto/gui/text/qglyphrun/BLACKLIST
new file mode 100644
index 0000000000..57f32c683d
--- /dev/null
+++ b/tests/auto/gui/text/qglyphrun/BLACKLIST
@@ -0,0 +1,3 @@
+[mixedScripts]
+ubuntu-18.04
+b2qt
diff --git a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
index 21b2697b90..b7f014d0e2 100644
--- a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
+++ b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
@@ -731,6 +731,9 @@ void tst_QGlyphRun::mixedScripts()
layout.endLayout();
QList<QGlyphRun> glyphRuns = layout.glyphRuns();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Hangul character not rendered on winrt", Continue);
+#endif
QCOMPARE(glyphRuns.size(), 2);
}
diff --git a/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp b/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp
index 0089aeb43e..d00dc251d8 100644
--- a/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp
+++ b/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp
@@ -61,6 +61,8 @@ private slots:
void drawToPoint();
void drawToRect_data();
void drawToRect();
+ void compareToDrawText_data();
+ void compareToDrawText();
void setFont();
void setTextWidth();
void prepareToCorrectData();
@@ -212,6 +214,66 @@ void tst_QStaticText::drawToRect()
QCOMPARE(imageDrawStaticText, imageDrawText);
}
+void tst_QStaticText::compareToDrawText_data()
+{
+ QTest::addColumn<QFont>("font");
+
+ QTest::newRow("default") << QFont();
+ QFont sansserif; sansserif.setStyleHint(QFont::SansSerif);
+ QFont serif; serif.setStyleHint(QFont::Serif);
+ QFont monospace; monospace.setStyleHint(QFont::Monospace);
+ QTest::newRow("sans-serif") << QFont(sansserif.defaultFamily());
+ QTest::newRow("serif") << QFont(serif.defaultFamily());
+ QTest::newRow("monospace") << QFont(monospace.defaultFamily());
+}
+
+void tst_QStaticText::compareToDrawText()
+{
+ QFETCH(QFont, font);
+
+ QPixmap imageDrawText(1000, 1000);
+ imageDrawText.fill(Qt::white);
+ {
+ QPainter p(&imageDrawText);
+ p.setFont(font);
+ p.drawText(QRectF(11, 12, 30, 500), "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
+ }
+
+ QPixmap imageDrawStaticPlainText(1000, 1000);
+ imageDrawStaticPlainText.fill(Qt::white);
+ {
+ QPainter p(&imageDrawStaticPlainText);
+ p.setFont(font);
+ QStaticText text("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
+ text.setTextWidth(10),
+ p.setClipRect(QRectF(11, 12, 30, 500));
+ text.setTextFormat(Qt::PlainText);
+ p.drawStaticText(QPointF(11, 12), text);
+ }
+
+ QPixmap imageDrawStaticRichText(1000, 1000);
+ imageDrawStaticRichText.fill(Qt::white);
+ {
+ QPainter p(&imageDrawStaticRichText);
+ p.setFont(font);
+ QStaticText text("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
+ text.setTextWidth(10),
+ p.setClipRect(QRectF(11, 12, 30, 500));
+ text.setTextFormat(Qt::RichText);
+ p.drawStaticText(QPointF(11, 12), text);
+ }
+
+#if defined(DEBUG_SAVE_IMAGE)
+ imageDrawText.save("compareToDrawText_imageDrawText.png");
+ imageDrawStaticText.save("compareToDrawText_imageDrawStaticPlainText.png");
+ imageDrawStaticText.save("compareToDrawText_imageDrawStaticRichText.png");
+#endif
+
+ QVERIFY(imageDrawText.toImage() != m_whiteSquare);
+ QCOMPARE(imageDrawStaticPlainText, imageDrawText);
+ QCOMPARE(imageDrawStaticRichText, imageDrawText);
+}
+
void tst_QStaticText::prepareToCorrectData()
{
QTransform transform;
diff --git a/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp b/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp
index d2c4adb888..2bc611fe93 100644
--- a/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp
+++ b/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp
@@ -137,6 +137,7 @@ private slots:
void cursorPositionWithBlockUndoAndRedo3();
void joinNonEmptyRemovedBlockUserState();
+ void crashOnDetachingDanglingCursor();
private:
int blockCount();
@@ -1974,5 +1975,14 @@ void tst_QTextCursor::joinNonEmptyRemovedBlockUserState()
QCOMPARE(cursor.block().userState(), 10);
}
+void tst_QTextCursor::crashOnDetachingDanglingCursor()
+{
+ QTextDocument *document = new QTextDocument;
+ QTextCursor cursor(document);
+ QTextCursor cursor2 = cursor;
+ delete document;
+ cursor2.setPosition(0); // Don't crash here
+}
+
QTEST_MAIN(tst_QTextCursor)
#include "tst_qtextcursor.moc"
diff --git a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
index ed69802d95..3e354b7523 100644
--- a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
+++ b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
@@ -1692,6 +1692,9 @@ void tst_QTextDocumentFragment::html_bodyBackground()
const char html[] = "<body background=\"foo.png\">Foo</body>";
doc->setHtml(html);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on winrt. Investigate - QTBUG-68297", Continue);
+#endif
QCOMPARE(doc->rootFrame()->frameFormat().background().style(), Qt::TexturePattern);
}
@@ -1706,6 +1709,9 @@ void tst_QTextDocumentFragment::html_tableCellBackground()
QVERIFY(table);
QTextTableCell cell = table->cellAt(0, 0);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on winrt. Investigate - QTBUG-68297", Continue);
+#endif
QCOMPARE(cell.format().background().style(), Qt::TexturePattern);
}
@@ -1714,6 +1720,9 @@ void tst_QTextDocumentFragment::css_bodyBackground()
const char html[] = "<body style=\"background-image:url('foo.png')\">Foo</body>";
doc->setHtml(html);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on winrt. Investigate - QTBUG-68297", Continue);
+#endif
QCOMPARE(doc->rootFrame()->frameFormat().background().style(), Qt::TexturePattern);
}
@@ -1728,6 +1737,9 @@ void tst_QTextDocumentFragment::css_tableCellBackground()
QVERIFY(table);
QTextTableCell cell = table->cellAt(0, 0);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on winrt. Investigate - QTBUG-68297", Continue);
+#endif
QCOMPARE(cell.format().background().style(), Qt::TexturePattern);
}
diff --git a/tests/auto/gui/text/qtextdocumentlayout/tst_qtextdocumentlayout.cpp b/tests/auto/gui/text/qtextdocumentlayout/tst_qtextdocumentlayout.cpp
index 082d16f62d..c79f787547 100644
--- a/tests/auto/gui/text/qtextdocumentlayout/tst_qtextdocumentlayout.cpp
+++ b/tests/auto/gui/text/qtextdocumentlayout/tst_qtextdocumentlayout.cpp
@@ -299,8 +299,11 @@ void tst_QTextDocumentLayout::imageAtRightAlignedTab()
imgFormat.setName(name);
cursor.insertImage(imgFormat);
- // Everything should fit into the 300 pixels
- QCOMPARE(doc->idealWidth(), 300.0);
+ // Everything should fit into the 300 pixels
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on winrt. Figure out why - QTBUG-68297", Continue);
+#endif
+ QCOMPARE(doc->idealWidth(), 300.0);
}
void tst_QTextDocumentLayout::blockVisibility()
diff --git a/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp b/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp
index fb92b5a20f..bbb90ec82a 100644
--- a/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp
+++ b/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp
@@ -131,7 +131,7 @@ void tst_QTextOdfWriter::testWriteParagraph_data()
QTest::newRow("misc2") << "\t \tFoo" <<
"<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\"><text:tab/> <text:s text:c=\"4\"/><text:tab/>Foo</text:span></text:p>";
QTest::newRow("linefeed") << (QStringLiteral("line1") + QChar(0x2028) + QStringLiteral("line2")) <<
- "<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">line1<text:line-break/>line2</text:span></text:p>";
+ "<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">line1<text:tab/><text:line-break/>line2</text:span></text:p>";
QTest::newRow("spaces") << "The quick brown fox jumped over the lazy dog" <<
"<text:p text:style-name=\"p1\"><text:span text:style-name=\"c0\">The quick brown fox jumped over the lazy dog</text:span></text:p>";
}
@@ -378,7 +378,7 @@ void tst_QTextOdfWriter::testWriteTable()
odfWriter->writeFrame(*xmlWriter, document->rootFrame());
QString xml = QString::fromLatin1(
"<text:p text:style-name=\"p1\"/>"
- "<table:table>"
+ "<table:table table:style-name=\"Table2\">"
"<table:table-column table:number-columns-repeated=\"3\"/>"
"<table:table-row>"
"<table:table-cell table:style-name=\"T3\">"
diff --git a/tests/auto/gui/util/qdoublevalidator/tst_qdoublevalidator.cpp b/tests/auto/gui/util/qdoublevalidator/tst_qdoublevalidator.cpp
index 4705fc3ed7..012a7e2ce3 100644
--- a/tests/auto/gui/util/qdoublevalidator/tst_qdoublevalidator.cpp
+++ b/tests/auto/gui/util/qdoublevalidator/tst_qdoublevalidator.cpp
@@ -155,6 +155,10 @@ void tst_QDoubleValidator::validate_data()
QTest::newRow("data48") << "C" << 0.0 << 100.0 << 1 << QString("0.0") << ACC << ACC;
QTest::newRow("data49") << "C" << 0.0 << 100.0 << 0 << QString(".") << ITM << ITM;
QTest::newRow("data50") << "C" << 0.0 << 100.0 << 1 << QString(".") << ITM << ITM;
+ QTest::newRow("data51") << "C" << 0.0 << 2.0 << 2 << QString("9.99") << ITM << ITM;
+ QTest::newRow("data52") << "C" << 100.0 << 200.0 << 4 << QString("999.9999") << ITM << ITM;
+ QTest::newRow("data53") << "C" << 0.0 << 2.0 << 2 << QString("9.9999") << INV << INV;
+ QTest::newRow("data54") << "C" << 100.0 << 200.0 << 4 << QString("9999.9999") << ITM << INV;
QTest::newRow("data_de0") << "de" << 0.0 << 100.0 << 1 << QString("50,0") << ACC << ACC;
QTest::newRow("data_de1") << "de" << 00.0 << 100.0 << 1 << QString("500,0") << ITM << ITM;
@@ -206,6 +210,10 @@ void tst_QDoubleValidator::validate_data()
QTest::newRow("data_de43") << "de" << 0.01 << 0.09 << 2 << QString("0") << ITM << ITM;
QTest::newRow("data_de44") << "de" << 0.0 << 10.0 << 1 << QString("11") << ITM << ITM;
QTest::newRow("data_de45") << "de" << 0.0 << 10.0 << 2 << QString("11") << ITM << ITM;
+ QTest::newRow("data_de46") << "de" << 0.0 << 2.0 << 2 << QString("9,99") << ITM << ITM;
+ QTest::newRow("data_de47") << "de" << 100.0 << 200.0 << 4 << QString("999,9999") << ITM << ITM;
+ QTest::newRow("data_de48") << "de" << 0.0 << 2.0 << 2 << QString("9,9999") << INV << INV;
+ QTest::newRow("data_de49") << "de" << 100.0 << 200.0 << 4 << QString("9999,9999") << ITM << INV;
QString arabicNum;
arabicNum += QChar(1633); // "18.4" in arabic
diff --git a/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp b/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp
index 57f55c3121..ec0d63f67c 100644
--- a/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp
+++ b/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp
@@ -54,7 +54,7 @@ void tst_QIntValidator::validate_data()
QTest::addColumn<QValidator::State>("state");
QTest::newRow("data0") << 0 << 100 << QString("50") << ACC;
- QTest::newRow("data1") << 0 << 100 << QString("500") << INV;
+ QTest::newRow("data1") << 0 << 100 << QString("500") << INT;
QTest::newRow("data1a") << 0 << 100 << QString("5000") << INV;
QTest::newRow("data1b") << -100 << 0 << QString("50") << INT;
QTest::newRow("data1c") << -100 << 0 << QString("500") << INV;
@@ -121,7 +121,7 @@ void tst_QIntValidator::validate_data()
QTest::newRow("5.1") << 6 << 8 << QString("5") << INT;
QTest::newRow("5.2") << 6 << 8 << QString("7") << ACC;
- QTest::newRow("5.3") << 6 << 8 << QString("9") << INV;
+ QTest::newRow("5.3") << 6 << 8 << QString("9") << INT;
QTest::newRow("5.3a") << 6 << 8 << QString("19") << INV;
QTest::newRow("5.4") << -8 << -6 << QString("-5") << INT;
QTest::newRow("5.5") << -8 << -6 << QString("-7") << ACC;
@@ -129,13 +129,13 @@ void tst_QIntValidator::validate_data()
QTest::newRow("5.6a") << -8 << -6 << QString("-19") << INV;
QTest::newRow("5.7") << -8 << -6 << QString("5") << INT;
QTest::newRow("5.8") << -8 << -6 << QString("7") << INT;
- QTest::newRow("5.9") << -8 << -6 << QString("9") << INV;
+ QTest::newRow("5.9") << -8 << -6 << QString("9") << INT;
QTest::newRow("5.10") << -6 << 8 << QString("-5") << ACC;
QTest::newRow("5.11") << -6 << 8 << QString("5") << ACC;
QTest::newRow("5.12") << -6 << 8 << QString("-7") << INV;
QTest::newRow("5.13") << -6 << 8 << QString("7") << ACC;
QTest::newRow("5.14") << -6 << 8 << QString("-9") << INV;
- QTest::newRow("5.15") << -6 << 8 << QString("9") << INV;
+ QTest::newRow("5.15") << -6 << 8 << QString("9") << INT;
QTest::newRow("6.1") << 100 << 102 << QString("11") << INT;
QTest::newRow("6.2") << 100 << 102 << QString("-11") << INV;
diff --git a/tests/auto/gui/util/qtexturefilereader/qtexturefilereader.pro b/tests/auto/gui/util/qtexturefilereader/qtexturefilereader.pro
new file mode 100644
index 0000000000..43951fe722
--- /dev/null
+++ b/tests/auto/gui/util/qtexturefilereader/qtexturefilereader.pro
@@ -0,0 +1,5 @@
+CONFIG += testcase
+QT += testlib gui-private
+SOURCES += tst_qtexturefilereader.cpp
+TARGET = tst_qtexturefilereader
+RESOURCES += qtexturefilereader.qrc
diff --git a/tests/auto/gui/util/qtexturefilereader/qtexturefilereader.qrc b/tests/auto/gui/util/qtexturefilereader/qtexturefilereader.qrc
new file mode 100644
index 0000000000..ab882b5db2
--- /dev/null
+++ b/tests/auto/gui/util/qtexturefilereader/qtexturefilereader.qrc
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/">
+ <file>texturefiles/car.ktx</file>
+ <file>texturefiles/pattern.pkm</file>
+ <file>texturefiles/car_mips.ktx</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/gui/util/qtexturefilereader/texturefiles/car.ktx b/tests/auto/gui/util/qtexturefilereader/texturefiles/car.ktx
new file mode 100644
index 0000000000..2aefdd306b
--- /dev/null
+++ b/tests/auto/gui/util/qtexturefilereader/texturefiles/car.ktx
Binary files differ
diff --git a/tests/auto/gui/util/qtexturefilereader/texturefiles/car_mips.ktx b/tests/auto/gui/util/qtexturefilereader/texturefiles/car_mips.ktx
new file mode 100644
index 0000000000..82822e6c0b
--- /dev/null
+++ b/tests/auto/gui/util/qtexturefilereader/texturefiles/car_mips.ktx
Binary files differ
diff --git a/tests/auto/gui/util/qtexturefilereader/texturefiles/pattern.pkm b/tests/auto/gui/util/qtexturefilereader/texturefiles/pattern.pkm
new file mode 100644
index 0000000000..d986e89b2d
--- /dev/null
+++ b/tests/auto/gui/util/qtexturefilereader/texturefiles/pattern.pkm
Binary files differ
diff --git a/tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp b/tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp
new file mode 100644
index 0000000000..9ff4f0ccf2
--- /dev/null
+++ b/tests/auto/gui/util/qtexturefilereader/tst_qtexturefilereader.cpp
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <private/qtexturefilereader_p.h>
+#include <QtTest>
+
+class tst_qtexturefilereader : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void checkHandlers_data();
+ void checkHandlers();
+};
+
+void tst_qtexturefilereader::checkHandlers_data()
+{
+ QTest::addColumn<QString>("fileName");
+ QTest::addColumn<QSize>("size");
+ QTest::addColumn<quint32>("glFormat");
+ QTest::addColumn<quint32>("glInternalFormat");
+ QTest::addColumn<quint32>("glBaseInternalFormat");
+ QTest::addColumn<int>("levels");
+ QTest::addColumn<QList<int>>("dataOffsets");
+ QTest::addColumn<QList<int>>("dataLengths");
+
+ QTest::addRow("pattern.pkm") << QStringLiteral(":/texturefiles/pattern.pkm")
+ << QSize(64, 64)
+ << quint32(0x0)
+ << quint32(0x8d64)
+ << quint32(0x0)
+ << 1
+ << (QList<int>() << 16)
+ << (QList<int>() << 2048);
+
+ QTest::addRow("car.ktx") << QStringLiteral(":/texturefiles/car.ktx")
+ << QSize(146, 80)
+ << quint32(0x0)
+ << quint32(0x9278)
+ << quint32(0x1908)
+ << 1
+ << (QList<int>() << 68)
+ << (QList<int>() << 11840);
+
+ QTest::addRow("car_mips.ktx") << QStringLiteral(":/texturefiles/car_mips.ktx")
+ << QSize(146, 80)
+ << quint32(0x0)
+ << quint32(0x9274)
+ << quint32(0x1907)
+ << 8
+ << (QList<int>() << 68 << 5992 << 7516 << 7880 << 8004 << 8056 << 8068 << 8080)
+ << (QList<int>() << 5920 << 1520 << 360 << 120 << 48 << 8 << 8 << 8);
+
+}
+
+void tst_qtexturefilereader::checkHandlers()
+{
+ QFETCH(QString, fileName);
+ QFETCH(QSize, size);
+ QFETCH(quint32, glFormat);
+ QFETCH(quint32, glInternalFormat);
+ QFETCH(int, levels);
+ QFETCH(QList<int>, dataOffsets);
+ QFETCH(QList<int>, dataLengths);
+
+ QFile f(fileName);
+ QVERIFY(f.open(QIODevice::ReadOnly));
+ QTextureFileReader r(&f, fileName);
+ QVERIFY(r.canRead());
+
+ QTextureFileData tex = r.read();
+ QVERIFY(!tex.isNull());
+ QVERIFY(tex.isValid());
+ QCOMPARE(tex.size(), size);
+ QCOMPARE(tex.glFormat(), glFormat);
+ QCOMPARE(tex.glInternalFormat(), glInternalFormat);
+ QCOMPARE(tex.numLevels(), levels);
+ for (int i = 0; i < tex.numLevels(); i++) {
+ QCOMPARE(tex.dataOffset(i), dataOffsets.at(i));
+ QCOMPARE(tex.dataLength(i), dataLengths.at(i));
+ }
+}
+
+QTEST_MAIN(tst_qtexturefilereader)
+
+#include "tst_qtexturefilereader.moc"
diff --git a/tests/auto/gui/util/util.pro b/tests/auto/gui/util/util.pro
index 940e892e5f..2789ffb55d 100644
--- a/tests/auto/gui/util/util.pro
+++ b/tests/auto/gui/util/util.pro
@@ -10,4 +10,4 @@ SUBDIRS= \
qshadergraphloader \
qshadernodes \
qshadernodesloader \
-
+ qtexturefilereader
diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h
index 16966ced4e..a3c318420f 100644
--- a/tests/auto/network-settings.h
+++ b/tests/auto/network-settings.h
@@ -27,10 +27,12 @@
****************************************************************************/
#include <QString>
+#include <QtTest/QtTest>
#ifdef QT_NETWORK_LIB
#include <QtNetwork/QHostInfo>
#include <QtNetwork/QHostAddress>
#include <QtNetwork/QAbstractSocket>
+#include <QtNetwork/QTcpSocket>
#endif
#ifdef Q_OS_UNIX
@@ -50,7 +52,11 @@ public:
}
static QString serverDomainName()
{
+#ifdef QT_TEST_SERVER_DOMAIN
+ return QString(QT_TEST_SERVER_DOMAIN); // Defined in testserver feature
+#else
return QString("qt-test-net");
+#endif
}
static QString serverName()
{
@@ -137,6 +143,20 @@ public:
return true;
}
+ static bool verifyConnection(QString serverName, quint16 port, quint32 retry = 10)
+ {
+ QTcpSocket socket;
+ for (quint32 i = 1; i < retry; i++) {
+ socket.connectToHost(serverName, port);
+ if (socket.waitForConnected(1000))
+ return true;
+ // Wait for service to start up
+ QTest::qWait(1000);
+ }
+ socket.connectToHost(serverName, port);
+ return socket.waitForConnected(1000);
+ }
+
// Helper function for usage with QVERIFY2 on sockets.
static QByteArray msgSocketError(const QAbstractSocket &s)
{
@@ -153,4 +173,45 @@ public:
return result.toLocal8Bit();
}
#endif // QT_NETWORK_LIB
+
+ static QString ftpServerName()
+ {
+#ifdef QT_TEST_SERVER
+ return QString("vsftpd.") % serverDomainName();
+#else
+ return serverName();
+#endif
+ }
+ static QString ftpProxyServerName()
+ {
+#ifdef QT_TEST_SERVER
+ return QString("ftp-proxy.") % serverDomainName();
+#else
+ return serverName();
+#endif
+ }
+ static QString httpServerName()
+ {
+#ifdef QT_TEST_SERVER
+ return QString("apache2.") % serverDomainName();
+#else
+ return serverName();
+#endif
+ }
+ static QString httpProxyServerName()
+ {
+#ifdef QT_TEST_SERVER
+ return QString("squid.") % serverDomainName();
+#else
+ return serverName();
+#endif
+ }
+ static QString socksProxyServerName()
+ {
+#ifdef QT_TEST_SERVER
+ return QString("danted.") % serverDomainName();
+#else
+ return serverName();
+#endif
+ }
};
diff --git a/tests/auto/network/access/hpack/hpack.pro b/tests/auto/network/access/hpack/hpack.pro
index 3c8b8e7944..2823ae4d0c 100644
--- a/tests/auto/network/access/hpack/hpack.pro
+++ b/tests/auto/network/access/hpack/hpack.pro
@@ -1,5 +1,5 @@
-QT += core core-private network network-private testlib
-CONFIG += testcase parallel_test c++14
+QT = core core-private network network-private testlib
+CONFIG += testcase parallel_test c++11
TEMPLATE = app
TARGET = tst_hpack
diff --git a/tests/auto/network/access/hsts/hsts.pro b/tests/auto/network/access/hsts/hsts.pro
index 07bdea5f62..dad6638364 100644
--- a/tests/auto/network/access/hsts/hsts.pro
+++ b/tests/auto/network/access/hsts/hsts.pro
@@ -1,4 +1,4 @@
-QT += core core-private network network-private testlib
+QT = core core-private network network-private testlib
CONFIG += testcase parallel_test c++11
TEMPLATE = app
TARGET = tst_qhsts
diff --git a/tests/auto/network/access/http2/http2.pro b/tests/auto/network/access/http2/http2.pro
index e130f30784..62b685e556 100644
--- a/tests/auto/network/access/http2/http2.pro
+++ b/tests/auto/network/access/http2/http2.pro
@@ -1,4 +1,4 @@
-QT += core core-private network network-private testlib
+QT = core core-private network network-private testlib
CONFIG += testcase parallel_test c++11
TARGET = tst_http2
diff --git a/tests/auto/network/access/http2/http2srv.cpp b/tests/auto/network/access/http2/http2srv.cpp
index b0bae13bad..1f9ffb8985 100644
--- a/tests/auto/network/access/http2/http2srv.cpp
+++ b/tests/auto/network/access/http2/http2srv.cpp
@@ -212,13 +212,30 @@ void Http2Server::sendDATA(quint32 streamID, quint32 windowSize)
const quint32 offset = it->second;
Q_ASSERT(offset < quint32(responseBody.size()));
- const quint32 bytes = std::min<quint32>(windowSize, responseBody.size() - offset);
+ quint32 bytesToSend = std::min<quint32>(windowSize, responseBody.size() - offset);
+ quint32 bytesSent = 0;
const quint32 frameSizeLimit(clientSetting(Settings::MAX_FRAME_SIZE_ID, Http2::maxFrameSize));
const uchar *src = reinterpret_cast<const uchar *>(responseBody.constData() + offset);
- const bool last = offset + bytes == quint32(responseBody.size());
+ const bool last = offset + bytesToSend == quint32(responseBody.size());
+
+ // The payload can significantly exceed frameSizeLimit. Internally, writer
+ // will do needed fragmentation, but if some test failed, there is no need
+ // to wait for writer to send all DATA frames, we check 'interrupted' and
+ // stop early instead.
+ const quint32 framesInChunk = 10;
+ while (bytesToSend) {
+ if (interrupted.loadAcquire())
+ return;
+ const quint32 chunkSize = std::min<quint32>(framesInChunk * frameSizeLimit, bytesToSend);
+ writer.start(FrameType::DATA, FrameFlag::EMPTY, streamID);
+ writer.writeDATA(*socket, frameSizeLimit, src, chunkSize);
+ src += chunkSize;
+ bytesToSend -= chunkSize;
+ bytesSent += chunkSize;
+ }
- writer.start(FrameType::DATA, FrameFlag::EMPTY, streamID);
- writer.writeDATA(*socket, frameSizeLimit, src, bytes);
+ if (interrupted.loadAcquire())
+ return;
if (last) {
writer.start(FrameType::DATA, FrameFlag::END_STREAM, streamID);
@@ -230,7 +247,7 @@ void Http2Server::sendDATA(quint32 streamID, quint32 windowSize)
Q_ASSERT(closedStreams.find(streamID) == closedStreams.end());
closedStreams.insert(streamID);
} else {
- it->second += bytes;
+ it->second += bytesSent;
}
}
@@ -819,6 +836,11 @@ void Http2Server::sendResponse(quint32 streamID, bool emptyBody)
}
}
+void Http2Server::stopSendingDATAFrames()
+{
+ interrupted.storeRelease(1);
+}
+
void Http2Server::processRequest()
{
Q_ASSERT(continuedRequest.size());
diff --git a/tests/auto/network/access/http2/http2srv.h b/tests/auto/network/access/http2/http2srv.h
index 14b41cc67d..87a17ced8b 100644
--- a/tests/auto/network/access/http2/http2srv.h
+++ b/tests/auto/network/access/http2/http2srv.h
@@ -40,6 +40,7 @@
#include <QtCore/qscopedpointer.h>
#include <QtNetwork/qtcpserver.h>
#include <QtCore/qbytearray.h>
+#include <QtCore/qatomic.h>
#include <QtCore/qglobal.h>
#include <vector>
@@ -96,6 +97,8 @@ public:
Q_INVOKABLE void sendResponse(quint32 streamID, bool emptyBody);
+ void stopSendingDATAFrames();
+
private:
void processRequest();
@@ -191,6 +194,7 @@ private:
// may still be sending DATA frames. See tst_Http2::earlyResponse().
bool redirectWhileReading = false;
quint16 targetPort = 0;
+ QAtomicInt interrupted;
protected slots:
void ignoreErrorSlot();
};
diff --git a/tests/auto/network/access/http2/tst_http2.cpp b/tests/auto/network/access/http2/tst_http2.cpp
index ecf4c5814a..49daedf32c 100644
--- a/tests/auto/network/access/http2/tst_http2.cpp
+++ b/tests/auto/network/access/http2/tst_http2.cpp
@@ -110,8 +110,7 @@ private:
QThread *workerThread = nullptr;
QNetworkAccessManager manager;
- QEventLoop eventLoop;
- QTimer timer;
+ QTestEventLoop eventLoop;
int nRequests = 0;
int nSentRequests = 0;
@@ -133,8 +132,10 @@ struct ServerDeleter
{
static void cleanup(Http2Server *srv)
{
- if (srv)
+ if (srv) {
+ srv->stopSendingDATAFrames();
QMetaObject::invokeMethod(srv, "deleteLater", Qt::QueuedConnection);
+ }
}
};
@@ -146,11 +147,6 @@ tst_Http2::tst_Http2()
: workerThread(new QThread)
{
workerThread->start();
-
- timer.setInterval(10000);
- timer.setSingleShot(true);
-
- connect(&timer, SIGNAL(timeout()), &eventLoop, SLOT(quit()));
}
tst_Http2::~tst_Http2()
@@ -497,15 +493,12 @@ void tst_Http2::clearHTTP2State()
void tst_Http2::runEventLoop(int ms)
{
- timer.setInterval(ms);
- timer.start();
- eventLoop.exec();
+ eventLoop.enterLoopMSecs(ms);
}
void tst_Http2::stopEventLoop()
{
- timer.stop();
- eventLoop.quit();
+ eventLoop.exitLoop();
}
Http2Server *tst_Http2::newServer(const Http2::RawSettings &serverSettings,
diff --git a/tests/auto/network/access/qnetworkreply/certs/qt-test-net-cacert.pem b/tests/auto/network/access/qnetworkreply/certs/qt-test-net-cacert.pem
new file mode 100644
index 0000000000..43c8794ce2
--- /dev/null
+++ b/tests/auto/network/access/qnetworkreply/certs/qt-test-net-cacert.pem
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIIClTCCAf4CCQC2xMhNhwvATDANBgkqhkiG9w0BAQQFADCBjjELMAkGA1UEChMC
+UXQxGTAXBgNVBAsTEENvcmUgQW5kIE5ldHdvcmsxGzAZBgkqhkiG9w0BCQEWDG5v
+Ym9keS5xdC5pbzENMAsGA1UEBxMET3NsbzENMAsGA1UECBMET3NsbzELMAkGA1UE
+BhMCTk8xHDAaBgNVBAMUEyoudGVzdC1uZXQucXQubG9jYWwwHhcNMTgwNzAxMTgz
+NjI3WhcNNDgwNjIzMTgzNjI3WjCBjjELMAkGA1UEChMCUXQxGTAXBgNVBAsTEENv
+cmUgQW5kIE5ldHdvcmsxGzAZBgkqhkiG9w0BCQEWDG5vYm9keS5xdC5pbzENMAsG
+A1UEBxMET3NsbzENMAsGA1UECBMET3NsbzELMAkGA1UEBhMCTk8xHDAaBgNVBAMU
+EyoudGVzdC1uZXQucXQubG9jYWwwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB
+AM2q22/WNMmn8cC+5EEYGeICySLmp9W6Ay6eKHr0Xxp3X3epETuPfvAuxp7rOtkS
+18EMUegkUj8jw0IMEcbyHKFC/rTCaYOt93CxGBXMIChiMPAsFeYzGa/D6xzAkfcR
+aJRQ+Ek3CDLXPnXfo7xpABXezYcPXAJrgsgBfWrwHdxzAgMBAAEwDQYJKoZIhvcN
+AQEEBQADgYEAZu/lQPy8PXeyyYGamOVms/FZKJ48BH1y8KC3BeBU5FYnhvgG7pz8
+Wz9JKvt2t/r45wQeAkNL6HnGUBhPJsHMjPHl5KktqN+db3D+FQygBeS2V1+zmC0X
+UZNRE4aWiHvt1Lq+pTx89SOMOpfqWfh4qTQKiE5jC2V4DeCNQ3u7uI8=
+-----END CERTIFICATE-----
diff --git a/tests/auto/network/access/qnetworkreply/test/test.pro b/tests/auto/network/access/qnetworkreply/test/test.pro
index e8464e81af..9d36352abc 100644
--- a/tests/auto/network/access/qnetworkreply/test/test.pro
+++ b/tests/auto/network/access/qnetworkreply/test/test.pro
@@ -14,3 +14,6 @@ TESTDATA += ../empty ../rfc3252.txt ../resource ../bigfile ../*.jpg ../certs \
../index.html ../smb-file.txt
!android:!winrt: TEST_HELPER_INSTALLS = ../echo/echo
+
+QT_TEST_SERVER_LIST = vsftpd apache2 ftp-proxy danted squid
+include($$dirname(_QMAKE_CONF_)/tests/auto/testserver.pri)
diff --git a/tests/auto/network/access/qnetworkreply/testserver_index.html b/tests/auto/network/access/qnetworkreply/testserver_index.html
new file mode 100644
index 0000000000..abc1df188d
--- /dev/null
+++ b/tests/auto/network/access/qnetworkreply/testserver_index.html
@@ -0,0 +1,3 @@
+<h1>Welcome to qt-test-server</h1>
+<img src="fluke.gif" alt="fluke">
+<p>This is a network test server. It serves as a caching ftp and http proxy, transparent http/socks5 proxy, imap, ftp and http server, and more.</p>
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 9c77e156d7..30b41da515 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -156,6 +156,7 @@ class tst_QNetworkReply: public QObject
#ifndef QT_NO_SSL
QSslConfiguration storedSslConfiguration;
QList<QSslError> storedExpectedSslErrors;
+ static const QString certsFilePath;
#endif
#ifndef QT_NO_BEARERMANAGEMENT
QNetworkConfigurationManager *netConfMan;
@@ -547,8 +548,15 @@ static void setupSslServer(QSslSocket* serverSocket)
serverSocket->setPrivateKey(testDataDir + "/certs/server.key");
serverSocket->startServerEncryption();
}
+
+#ifdef QT_TEST_SERVER
+const QString tst_QNetworkReply::certsFilePath = "/certs/qt-test-net-cacert.pem";
+#else
+const QString tst_QNetworkReply::certsFilePath = "/certs/qt-test-server-cacert.pem";
#endif
+#endif // !QT_NO_SSL
+
// NOTE: MiniHttpServer has a very limited support of PUT/POST requests! Make
// sure you understand the server's code before PUTting/POSTing data (and
// probably you'll have to update the logic).
@@ -1270,18 +1278,23 @@ tst_QNetworkReply::tst_QNetworkReply()
manager.setCookieJar(cookieJar);
#ifndef QT_NO_NETWORKPROXY
- QHostInfo hostInfo = QHostInfo::fromName(QtNetworkSettings::serverName());
+ QHostInfo hostInfo = QHostInfo::fromName(QtNetworkSettings::httpProxyServerName());
proxies << ProxyData(QNetworkProxy::NoProxy, "", false);
if (hostInfo.error() == QHostInfo::NoError && !hostInfo.addresses().isEmpty()) {
- QString proxyserver = hostInfo.addresses().first().toString();
- proxies << ProxyData(QNetworkProxy(QNetworkProxy::HttpProxy, proxyserver, 3128), "+proxy", false)
- << ProxyData(QNetworkProxy(QNetworkProxy::HttpProxy, proxyserver, 3129), "+proxyauth", true)
+ QString httpProxy = QtNetworkSettings::httpProxyServerName();
+ QString socksProxy = QtNetworkSettings::socksProxyServerName();
+ proxies << ProxyData(QNetworkProxy(QNetworkProxy::HttpProxy, httpProxy, 3128),
+ "+proxy", false)
+ << ProxyData(QNetworkProxy(QNetworkProxy::HttpProxy, httpProxy, 3129),
+ "+proxyauth", true)
// currently unsupported
// << ProxyData(QNetworkProxy(QNetworkProxy::HttpProxy, proxyserver, 3130), "+proxyauth-ntlm", true);
- << ProxyData(QNetworkProxy(QNetworkProxy::Socks5Proxy, proxyserver, 1080), "+socks", false)
- << ProxyData(QNetworkProxy(QNetworkProxy::Socks5Proxy, proxyserver, 1081), "+socksauth", true);
+ << ProxyData(QNetworkProxy(QNetworkProxy::Socks5Proxy, socksProxy, 1080),
+ "+socks", false)
+ << ProxyData(QNetworkProxy(QNetworkProxy::Socks5Proxy, socksProxy, 1081),
+ "+socksauth", true);
} else {
#endif // !QT_NO_NETWORKPROXY
printf("==================================================================\n");
@@ -1508,8 +1521,20 @@ void tst_QNetworkReply::initTestCase()
if (testDataDir.isEmpty())
testDataDir = QCoreApplication::applicationDirPath();
+#if defined(QT_TEST_SERVER)
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::ftpServerName(), 21));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::ftpProxyServerName(), 2121));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpServerName(), 80));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpServerName(), 443));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3128));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3129));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::httpProxyServerName(), 3130));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::socksProxyServerName(), 1080));
+ QVERIFY(QtNetworkSettings::verifyConnection(QtNetworkSettings::socksProxyServerName(), 1081));
+#else
if (!QtNetworkSettings::verifyTestNetworkSettings())
QSKIP("No network test server available");
+#endif
#if !defined Q_OS_WIN
wronlyFileName = testDataDir + "/write-only" + uniqueExtension;
QFile wr(wronlyFileName);
@@ -1808,8 +1833,13 @@ void tst_QNetworkReply::getFromFtp_data()
QTest::addColumn<QString>("referenceName");
QTest::addColumn<QString>("url");
- QTest::newRow("rfc3252.txt") << (testDataDir + "/rfc3252.txt") << "ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt";
- QTest::newRow("bigfile") << (testDataDir + "/bigfile") << "ftp://" + QtNetworkSettings::serverName() + "/qtest/bigfile";
+ QTest::newRow("rfc3252.txt")
+ << testDataDir + "/rfc3252.txt"
+ << "ftp://" + QtNetworkSettings::ftpServerName() + "/qtest/rfc3252.txt";
+
+ QTest::newRow("bigfile")
+ << testDataDir + "/bigfile"
+ << "ftp://" + QtNetworkSettings::ftpServerName() + "/qtest/bigfile";
}
void tst_QNetworkReply::getFromFtp()
@@ -1833,7 +1863,7 @@ void tst_QNetworkReply::getFromFtp()
void tst_QNetworkReply::getFromFtpAfterError()
{
- QNetworkRequest invalidRequest(QUrl("ftp://" + QtNetworkSettings::serverName() + "/qtest/invalid.txt"));
+ QNetworkRequest invalidRequest(QUrl("ftp://" + QtNetworkSettings::ftpServerName() + "/qtest/invalid.txt"));
QNetworkReplyPtr invalidReply;
invalidReply.reset(manager.get(invalidRequest));
QSignalSpy spy(invalidReply.data(), SIGNAL(error(QNetworkReply::NetworkError)));
@@ -1842,7 +1872,7 @@ void tst_QNetworkReply::getFromFtpAfterError()
QFile reference(testDataDir + "/rfc3252.txt");
QVERIFY(reference.open(QIODevice::ReadOnly));
- QNetworkRequest validRequest(QUrl("ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"));
+ QNetworkRequest validRequest(QUrl("ftp://" + QtNetworkSettings::ftpServerName() + "/qtest/rfc3252.txt"));
QNetworkReplyPtr validReply;
RUN_REQUEST(runSimpleRequest(QNetworkAccessManager::GetOperation, validRequest, validReply));
QCOMPARE(validReply->url(), validRequest.url());
@@ -1856,9 +1886,17 @@ void tst_QNetworkReply::getFromHttp_data()
QTest::addColumn<QString>("referenceName");
QTest::addColumn<QString>("url");
- QTest::newRow("success-internal") << (testDataDir + "/rfc3252.txt") << "http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt";
- QTest::newRow("success-external") << (testDataDir + "/rfc3252.txt") << "http://www.ietf.org/rfc/rfc3252.txt";
- QTest::newRow("bigfile-internal") << (testDataDir + "/bigfile") << "http://" + QtNetworkSettings::serverName() + "/qtest/bigfile";
+ QTest::newRow("success-internal")
+ << testDataDir + "/rfc3252.txt"
+ << "http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt";
+
+ QTest::newRow("success-external")
+ << testDataDir + "/rfc3252.txt"
+ << "http://www.ietf.org/rfc/rfc3252.txt";
+
+ QTest::newRow("bigfile-internal")
+ << testDataDir + "/bigfile"
+ << "http://" + QtNetworkSettings::httpServerName() + "/qtest/bigfile";
}
void tst_QNetworkReply::getFromHttp()
@@ -1898,15 +1936,45 @@ void tst_QNetworkReply::headFromHttp_data()
qint64 rfcsize = QFileInfo(testDataDir + "/rfc3252.txt").size();
qint64 bigfilesize = QFileInfo(testDataDir + "/bigfile").size();
+
+#if defined(QT_TEST_SERVER)
+ qint64 indexsize = QFileInfo(testDataDir + "/testserver_index.html").size();
+#else
qint64 indexsize = QFileInfo(testDataDir + "/index.html").size();
+#endif
+ QString httpServer = QtNetworkSettings::httpServerName();
//testing proxies, mainly for the 407 response from http proxy
for (int i = 0; i < proxies.count(); ++i) {
- QTest::newRow("rfc" + proxies.at(i).tag) << rfcsize << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt") << "text/plain" << proxies.at(i).proxy;
- QTest::newRow("bigfile" + proxies.at(i).tag) << bigfilesize << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/bigfile") << "text/plain" << proxies.at(i).proxy;
- QTest::newRow("index" + proxies.at(i).tag) << indexsize << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/") << "text/html" << proxies.at(i).proxy;
- QTest::newRow("with-authentication" + proxies.at(i).tag) << rfcsize << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt") << "text/plain" << proxies.at(i).proxy;
- QTest::newRow("cgi" + proxies.at(i).tag) << (qint64)-1 << QUrl("http://qt-test-server/qtest/cgi-bin/httpcachetest_expires500.cgi") << "text/html" << proxies.at(i).proxy;
+ QTest::newRow("rfc" + proxies.at(i).tag)
+ << rfcsize
+ << QUrl("http://" + httpServer + "/qtest/rfc3252.txt")
+ << "text/plain"
+ << proxies.at(i).proxy;
+
+ QTest::newRow("bigfile" + proxies.at(i).tag)
+ << bigfilesize
+ << QUrl("http://" + httpServer + "/qtest/bigfile")
+ << "text/plain"
+ << proxies.at(i).proxy;
+
+ QTest::newRow("index" + proxies.at(i).tag)
+ << indexsize
+ << QUrl("http://" + httpServer + "/qtest/")
+ << "text/html"
+ << proxies.at(i).proxy;
+
+ QTest::newRow("with-authentication" + proxies.at(i).tag)
+ << rfcsize
+ << QUrl("http://" + httpServer + "/qtest/rfcs-auth/rfc3252.txt")
+ << "text/plain"
+ << proxies.at(i).proxy;
+
+ QTest::newRow("cgi" + proxies.at(i).tag)
+ << (qint64)-1
+ << QUrl("http://" + httpServer + "/qtest/cgi-bin/httpcachetest_expires500.cgi")
+ << "text/html"
+ << proxies.at(i).proxy;
}
}
@@ -1988,23 +2056,23 @@ void tst_QNetworkReply::getErrors_data()
// ftp: errors
QTest::newRow("ftp-host") << "ftp://invalid.test.qt-project.org/foo.txt"
<< int(QNetworkReply::HostNotFoundError) << 0 << true;
- QTest::newRow("ftp-no-path") << "ftp://" + QtNetworkSettings::serverName()
+ QTest::newRow("ftp-no-path") << "ftp://" + QtNetworkSettings::ftpServerName()
<< int(QNetworkReply::ContentOperationNotPermittedError) << 0 << true;
- QTest::newRow("ftp-is-dir") << "ftp://" + QtNetworkSettings::serverName() + "/qtest"
+ QTest::newRow("ftp-is-dir") << "ftp://" + QtNetworkSettings::ftpServerName() + "/qtest"
<< int(QNetworkReply::ContentOperationNotPermittedError) << 0 << true;
- QTest::newRow("ftp-dir-not-readable") << "ftp://" + QtNetworkSettings::serverName() + "/pub/dir-not-readable/foo.txt"
+ QTest::newRow("ftp-dir-not-readable") << "ftp://" + QtNetworkSettings::ftpServerName() + "/pub/dir-not-readable/foo.txt"
<< int(QNetworkReply::ContentAccessDenied) << 0 << true;
- QTest::newRow("ftp-file-not-readable") << "ftp://" + QtNetworkSettings::serverName() + "/pub/file-not-readable.txt"
+ QTest::newRow("ftp-file-not-readable") << "ftp://" + QtNetworkSettings::ftpServerName() + "/pub/file-not-readable.txt"
<< int(QNetworkReply::ContentAccessDenied) << 0 << true;
- QTest::newRow("ftp-exist") << "ftp://" + QtNetworkSettings::serverName() + "/pub/this-file-doesnt-exist.txt"
+ QTest::newRow("ftp-exist") << "ftp://" + QtNetworkSettings::ftpServerName() + "/pub/this-file-doesnt-exist.txt"
<< int(QNetworkReply::ContentNotFoundError) << 0 << true;
// http: errors
QTest::newRow("http-host") << "http://invalid.test.qt-project.org/"
<< int(QNetworkReply::HostNotFoundError) << 0 << true;
- QTest::newRow("http-exist") << "http://" + QtNetworkSettings::serverName() + "/this-file-doesnt-exist.txt"
+ QTest::newRow("http-exist") << "http://" + QtNetworkSettings::httpServerName() + "/this-file-doesnt-exist.txt"
<< int(QNetworkReply::ContentNotFoundError) << 404 << false;
- QTest::newRow("http-authentication") << "http://" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth"
+ QTest::newRow("http-authentication") << "http://" + QtNetworkSettings::httpServerName() + "/qtest/rfcs-auth"
<< int(QNetworkReply::AuthenticationRequiredError) << 401 << false;
}
@@ -2130,7 +2198,7 @@ void tst_QNetworkReply::putToFtp_data()
void tst_QNetworkReply::putToFtp()
{
- QUrl url("ftp://" + QtNetworkSettings::serverName());
+ QUrl url("ftp://" + QtNetworkSettings::ftpServerName());
url.setPath(QString("/qtest/upload/qnetworkaccess-putToFtp-%1-%2")
.arg(QTest::currentDataTag())
.arg(uniqueExtension));
@@ -2176,7 +2244,7 @@ void tst_QNetworkReply::putToFtp()
void tst_QNetworkReply::putToFtpWithInvalidCredentials()
{
- QUrl url("ftp://" + QtNetworkSettings::serverName());
+ QUrl url("ftp://" + QtNetworkSettings::ftpServerName());
url.setPath(QString("/qtest/upload/qnetworkaccess-putToFtp-%1-%2")
.arg(QTest::currentDataTag())
.arg(uniqueExtension));
@@ -2203,7 +2271,7 @@ void tst_QNetworkReply::putToHttp_data()
void tst_QNetworkReply::putToHttp()
{
- QUrl url("http://" + QtNetworkSettings::serverName());
+ QUrl url("http://" + QtNetworkSettings::httpServerName());
url.setPath(QString("/dav/qnetworkaccess-putToHttp-%1-%2")
.arg(QTest::currentDataTag())
.arg(uniqueExtension));
@@ -2223,7 +2291,7 @@ void tst_QNetworkReply::putToHttp()
// download the file again from HTTP to make sure it was uploaded
// correctly. HTTP/0.9 is enough
QTcpSocket socket;
- socket.connectToHost(QtNetworkSettings::serverName(), 80);
+ socket.connectToHost(QtNetworkSettings::httpServerName(), 80);
socket.write("GET " + url.toEncoded(QUrl::RemoveScheme | QUrl::RemoveAuthority) + "\r\n");
if (!socket.waitForDisconnected(10000))
QFAIL("Network timeout");
@@ -2240,7 +2308,7 @@ void tst_QNetworkReply::putToHttpSynchronous_data()
void tst_QNetworkReply::putToHttpSynchronous()
{
- QUrl url("http://" + QtNetworkSettings::serverName());
+ QUrl url("http://" + QtNetworkSettings::httpServerName());
url.setPath(QString("/dav/qnetworkaccess-putToHttp-%1-%2")
.arg(QTest::currentDataTag())
.arg(uniqueExtension));
@@ -2264,7 +2332,7 @@ void tst_QNetworkReply::putToHttpSynchronous()
// download the file again from HTTP to make sure it was uploaded
// correctly. HTTP/0.9 is enough
QTcpSocket socket;
- socket.connectToHost(QtNetworkSettings::serverName(), 80);
+ socket.connectToHost(QtNetworkSettings::httpServerName(), 80);
socket.write("GET " + url.toEncoded(QUrl::RemoveScheme | QUrl::RemoveAuthority) + "\r\n");
if (!socket.waitForDisconnected(10000))
QFAIL("Network timeout");
@@ -2280,7 +2348,7 @@ void tst_QNetworkReply::postToHttp_data()
void tst_QNetworkReply::postToHttp()
{
- QUrl url("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/md5sum.cgi");
+ QUrl url("http://" + QtNetworkSettings::httpServerName() + "/qtest/cgi-bin/md5sum.cgi");
QNetworkRequest request(url);
request.setRawHeader("Content-Type", "application/octet-stream");
@@ -2307,7 +2375,7 @@ void tst_QNetworkReply::postToHttpSynchronous_data()
void tst_QNetworkReply::postToHttpSynchronous()
{
- QUrl url("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/md5sum.cgi");
+ QUrl url("http://" + QtNetworkSettings::httpServerName() + "/qtest/cgi-bin/md5sum.cgi");
QNetworkRequest request(url);
request.setRawHeader("Content-Type", "application/octet-stream");
@@ -2339,7 +2407,7 @@ void tst_QNetworkReply::postToHttpMultipart_data()
QTest::addColumn<QByteArray>("expectedReplyData");
QTest::addColumn<QByteArray>("contentType");
- QUrl url("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/multipart.cgi");
+ QUrl url("http://" + QtNetworkSettings::httpServerName() + "/qtest/cgi-bin/multipart.cgi");
QByteArray expectedData;
@@ -2388,8 +2456,13 @@ void tst_QNetworkReply::postToHttpMultipart_data()
multiPart2->setContentType(QHttpMultiPart::FormDataType);
multiPart2->append(textPart);
multiPart2->append(textPart2);
+#ifdef QT_TEST_SERVER
+ expectedData = "key: text, value: 7 bytes\n"
+ "key: text2, value: some more bytes\n";
+#else
expectedData = "key: text2, value: some more bytes\n"
"key: text, value: 7 bytes\n";
+#endif
QTest::newRow("text-text") << url << multiPart2 << expectedData << QByteArray("form-data");
@@ -2457,9 +2530,15 @@ void tst_QNetworkReply::postToHttpMultipart_data()
imagePart22.setBodyDevice(file22);
imageMultiPart2->append(imagePart22);
file22->setParent(imageMultiPart2);
+#ifdef QT_TEST_SERVER
+ expectedData = "key: text, value: 7 bytes\n"
+ "key: testImage1, value: 87ef3bb319b004ba9e5e9c9fa713776e\n"
+ "key: testImage2, value: 483761b893f7fb1bd2414344cd1f3dfb\n";
+#else
expectedData = "key: testImage1, value: 87ef3bb319b004ba9e5e9c9fa713776e\n"
"key: text, value: 7 bytes\n"
"key: testImage2, value: 483761b893f7fb1bd2414344cd1f3dfb\n";
+#endif
QTest::newRow("text-image-image") << url << imageMultiPart2 << expectedData << QByteArray("form-data");
@@ -2591,7 +2670,7 @@ void tst_QNetworkReply::postToHttpMultipart()
void tst_QNetworkReply::multipartSkipIndices() // QTBUG-32534
{
QHttpMultiPart *multiPart = new QHttpMultiPart(QHttpMultiPart::MixedType);
- QUrl url("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/multipart.cgi");
+ QUrl url("http://" + QtNetworkSettings::httpServerName() + "/qtest/cgi-bin/multipart.cgi");
QNetworkRequest request(url);
QList<QByteArray> parts;
parts << QByteArray(56083, 'X') << QByteArray(468, 'X') << QByteArray(24952, 'X');
@@ -2685,13 +2764,13 @@ void tst_QNetworkReply::putToHttps_data()
void tst_QNetworkReply::putToHttps()
{
- QUrl url("https://" + QtNetworkSettings::serverName());
+ QUrl url("https://" + QtNetworkSettings::httpServerName());
url.setPath(QString("/dav/qnetworkaccess-putToHttp-%1-%2")
.arg(QTest::currentDataTag())
.arg(uniqueExtension));
QNetworkRequest request(url);
- QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + "/certs/qt-test-server-cacert.pem");
+ QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + certsFilePath);
QSslConfiguration conf;
conf.setCaCertificates(certs);
request.setSslConfiguration(conf);
@@ -2709,7 +2788,7 @@ void tst_QNetworkReply::putToHttps()
// download the file again from HTTP to make sure it was uploaded
// correctly. HTTP/0.9 is enough
QTcpSocket socket;
- socket.connectToHost(QtNetworkSettings::serverName(), 80);
+ socket.connectToHost(QtNetworkSettings::httpServerName(), 80);
socket.write("GET " + url.toEncoded(QUrl::RemoveScheme | QUrl::RemoveAuthority) + "\r\n");
if (!socket.waitForDisconnected(10000))
QFAIL("Network timeout");
@@ -2726,13 +2805,13 @@ void tst_QNetworkReply::putToHttpsSynchronous_data()
void tst_QNetworkReply::putToHttpsSynchronous()
{
- QUrl url("https://" + QtNetworkSettings::serverName());
+ QUrl url("https://" + QtNetworkSettings::httpServerName());
url.setPath(QString("/dav/qnetworkaccess-putToHttp-%1-%2")
.arg(QTest::currentDataTag())
.arg(uniqueExtension));
QNetworkRequest request(url);
- QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + "/certs/qt-test-server-cacert.pem");
+ QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + certsFilePath);
QSslConfiguration conf;
conf.setCaCertificates(certs);
request.setSslConfiguration(conf);
@@ -2754,7 +2833,7 @@ void tst_QNetworkReply::putToHttpsSynchronous()
// download the file again from HTTP to make sure it was uploaded
// correctly. HTTP/0.9 is enough
QTcpSocket socket;
- socket.connectToHost(QtNetworkSettings::serverName(), 80);
+ socket.connectToHost(QtNetworkSettings::httpServerName(), 80);
socket.write("GET " + url.toEncoded(QUrl::RemoveScheme | QUrl::RemoveAuthority) + "\r\n");
if (!socket.waitForDisconnected(10000))
QFAIL("Network timeout");
@@ -2770,10 +2849,10 @@ void tst_QNetworkReply::postToHttps_data()
void tst_QNetworkReply::postToHttps()
{
- QUrl url("https://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/md5sum.cgi");
+ QUrl url("https://" + QtNetworkSettings::httpServerName() + "/qtest/cgi-bin/md5sum.cgi");
QNetworkRequest request(url);
- QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + "/certs/qt-test-server-cacert.pem");
+ QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + certsFilePath);
QSslConfiguration conf;
conf.setCaCertificates(certs);
request.setSslConfiguration(conf);
@@ -2801,10 +2880,10 @@ void tst_QNetworkReply::postToHttpsSynchronous_data()
void tst_QNetworkReply::postToHttpsSynchronous()
{
- QUrl url("https://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/md5sum.cgi");
+ QUrl url("https://" + QtNetworkSettings::httpServerName() + "/qtest/cgi-bin/md5sum.cgi");
QNetworkRequest request(url);
- QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + "/certs/qt-test-server-cacert.pem");
+ QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + certsFilePath);
QSslConfiguration conf;
conf.setCaCertificates(certs);
request.setSslConfiguration(conf);
@@ -2843,7 +2922,7 @@ void tst_QNetworkReply::postToHttpsMultipart()
static QSet<QByteArray> boundaries;
QNetworkRequest request(url);
- QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + "/certs/qt-test-server-cacert.pem");
+ QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + certsFilePath);
QSslConfiguration conf;
conf.setCaCertificates(certs);
request.setSslConfiguration(conf);
@@ -2888,11 +2967,26 @@ void tst_QNetworkReply::deleteFromHttp_data()
// for status codes to expect, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
- QTest::newRow("405-method-not-allowed") << QUrl("http://" + QtNetworkSettings::serverName() + "/index.html") << 405 << QNetworkReply::ContentOperationNotPermittedError;
- QTest::newRow("200-ok") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/http-delete.cgi?200-ok") << 200 << QNetworkReply::NoError;
- QTest::newRow("202-accepted") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/http-delete.cgi?202-accepted") << 202 << QNetworkReply::NoError;
- QTest::newRow("204-no-content") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/http-delete.cgi?204-no-content") << 204 << QNetworkReply::NoError;
- QTest::newRow("404-not-found") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/http-delete.cgi?404-not-found") << 404 << QNetworkReply::ContentNotFoundError;
+ QString httpServer = QtNetworkSettings::httpServerName();
+ QTest::newRow("405-method-not-allowed")
+ << QUrl("http://" + httpServer + "/index.html")
+ << 405 << QNetworkReply::ContentOperationNotPermittedError;
+
+ QTest::newRow("200-ok")
+ << QUrl("http://" + httpServer + "/qtest/cgi-bin/http-delete.cgi?200-ok")
+ << 200 << QNetworkReply::NoError;
+
+ QTest::newRow("202-accepted")
+ << QUrl("http://" + httpServer + "/qtest/cgi-bin/http-delete.cgi?202-accepted")
+ << 202 << QNetworkReply::NoError;
+
+ QTest::newRow("204-no-content")
+ << QUrl("http://" + httpServer + "/qtest/cgi-bin/http-delete.cgi?204-no-content")
+ << 204 << QNetworkReply::NoError;
+
+ QTest::newRow("404-not-found")
+ << QUrl("http://" + httpServer + "/qtest/cgi-bin/http-delete.cgi?404-not-found")
+ << 404 << QNetworkReply::ContentNotFoundError;
}
void tst_QNetworkReply::deleteFromHttp()
@@ -2920,7 +3014,7 @@ void tst_QNetworkReply::putGetDeleteGetFromHttp_data()
QTest::addColumn<int>("get2ResultCode");
QTest::addColumn<QNetworkReply::NetworkError>("get2Error");
- QUrl url("http://" + QtNetworkSettings::serverName());
+ QUrl url("http://" + QtNetworkSettings::httpServerName());
url.setPath(QString("/dav/qnetworkaccess-putToHttp-%1-%2")
.arg(QTest::currentDataTag())
.arg(uniqueExtension));
@@ -2928,7 +3022,7 @@ void tst_QNetworkReply::putGetDeleteGetFromHttp_data()
// first use case: put, get (to check it is there), delete, get (to check it is not there anymore)
QTest::newRow("success") << url << 201 << QNetworkReply::NoError << url << 204 << QNetworkReply::NoError << url << 404 << QNetworkReply::ContentNotFoundError;
- QUrl wrongUrl("http://" + QtNetworkSettings::serverName());
+ QUrl wrongUrl("http://" + QtNetworkSettings::httpServerName());
wrongUrl.setPath(QString("/dav/qnetworkaccess-thisURLisNotAvailable"));
// second use case: put, get (to check it is there), delete wrong URL, get (to check it is still there)
@@ -3023,27 +3117,27 @@ void tst_QNetworkReply::sendCustomRequestToHttp_data()
QTest::addColumn<QNetworkReply::NetworkError>("error");
QTest::addColumn<QByteArray>("expectedContent");
- QTest::newRow("options") << QUrl("http://" + QtNetworkSettings::serverName()) <<
+ QTest::newRow("options") << QUrl("http://" + QtNetworkSettings::httpServerName()) <<
QByteArray("OPTIONS") << (QBuffer *) 0 << 200 << QNetworkReply::NoError << QByteArray();
- QTest::newRow("trace") << QUrl("http://" + QtNetworkSettings::serverName()) <<
+ QTest::newRow("trace") << QUrl("http://" + QtNetworkSettings::httpServerName()) <<
QByteArray("TRACE") << (QBuffer *) 0 << 200 << QNetworkReply::NoError << QByteArray();
- QTest::newRow("connect") << QUrl("http://" + QtNetworkSettings::serverName()) <<
+ QTest::newRow("connect") << QUrl("http://" + QtNetworkSettings::httpServerName()) <<
QByteArray("CONNECT") << (QBuffer *) 0 << 400 << QNetworkReply::ProtocolInvalidOperationError << QByteArray(); // 400 = Bad Request
- QTest::newRow("nonsense") << QUrl("http://" + QtNetworkSettings::serverName()) <<
+ QTest::newRow("nonsense") << QUrl("http://" + QtNetworkSettings::httpServerName()) <<
QByteArray("NONSENSE") << (QBuffer *) 0 << 501 << QNetworkReply::OperationNotImplementedError << QByteArray(); // 501 = Method Not Implemented
QByteArray ba("test");
QBuffer *buffer = new QBuffer;
buffer->setData(ba);
buffer->open(QIODevice::ReadOnly);
- QTest::newRow("post") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/md5sum.cgi") << QByteArray("POST")
+ QTest::newRow("post") << QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/cgi-bin/md5sum.cgi") << QByteArray("POST")
<< buffer << 200 << QNetworkReply::NoError << QByteArray("098f6bcd4621d373cade4e832627b4f6\n");
QByteArray ba2("test");
QBuffer *buffer2 = new QBuffer;
buffer2->setData(ba2);
buffer2->open(QIODevice::ReadOnly);
- QTest::newRow("put") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/md5sum.cgi") << QByteArray("PUT")
+ QTest::newRow("put") << QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/cgi-bin/md5sum.cgi") << QByteArray("PUT")
<< buffer2 << 200 << QNetworkReply::NoError << QByteArray("098f6bcd4621d373cade4e832627b4f6\n");
}
@@ -3181,7 +3275,7 @@ void tst_QNetworkReply::ioGetFromFtp()
QFile reference(fileName);
reference.open(QIODevice::ReadOnly); // will fail for bigfile
- QNetworkRequest request("ftp://" + QtNetworkSettings::serverName() + "/qtest/" + fileName);
+ QNetworkRequest request("ftp://" + QtNetworkSettings::ftpServerName() + "/qtest/" + fileName);
QNetworkReplyPtr reply(manager.get(request));
DataReader reader(reply);
@@ -3204,7 +3298,7 @@ void tst_QNetworkReply::ioGetFromFtpWithReuse()
QFile reference(fileName);
reference.open(QIODevice::ReadOnly);
- QNetworkRequest request(QUrl("ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"));
+ QNetworkRequest request(QUrl("ftp://" + QtNetworkSettings::ftpServerName() + "/qtest/rfc3252.txt"));
// two concurrent (actually, consecutive) gets:
QNetworkReplyPtr reply1(manager.get(request));
@@ -3236,7 +3330,7 @@ void tst_QNetworkReply::ioGetFromHttp()
QFile reference(testDataDir + "/rfc3252.txt");
QVERIFY(reference.open(QIODevice::ReadOnly));
- QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"));
+ QNetworkRequest request(QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"));
QNetworkReplyPtr reply(manager.get(request));
DataReader reader(reply);
@@ -3257,7 +3351,7 @@ void tst_QNetworkReply::ioGetFromHttpWithReuseParallel()
QFile reference(testDataDir + "/rfc3252.txt");
QVERIFY(reference.open(QIODevice::ReadOnly));
- QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"));
+ QNetworkRequest request(QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"));
QNetworkReplyPtr reply1(manager.get(request));
QNetworkReplyPtr reply2(manager.get(request));
DataReader reader1(reply1);
@@ -3289,7 +3383,7 @@ void tst_QNetworkReply::ioGetFromHttpWithReuseSequential()
QFile reference(testDataDir + "/rfc3252.txt");
QVERIFY(reference.open(QIODevice::ReadOnly));
- QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"));
+ QNetworkRequest request(QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"));
{
QNetworkReplyPtr reply(manager.get(request));
DataReader reader(reply);
@@ -3334,16 +3428,40 @@ void tst_QNetworkReply::ioGetFromHttpWithAuth_data()
QFile reference(testDataDir + "/rfc3252.txt");
reference.open(QIODevice::ReadOnly);
QByteArray referenceData = reference.readAll();
- QTest::newRow("basic") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt") << referenceData << 1;
- QTest::newRow("digest") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/auth-digest/") << QByteArray("digest authentication successful\n") << 1;
+ QString httpServer = QtNetworkSettings::httpServerName();
+ QTest::newRow("basic")
+ << QUrl("http://" + httpServer + "/qtest/rfcs-auth/rfc3252.txt")
+ << referenceData << 1;
+
+ QTest::newRow("digest")
+ << QUrl("http://" + httpServer + "/qtest/auth-digest/")
+ << QByteArray("digest authentication successful\n") << 1;
+
//if url contains username & password, then it should be used
- QTest::newRow("basic-in-url") << QUrl("http://httptest:httptest@" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt") << referenceData << 0;
- QTest::newRow("digest-in-url") << QUrl("http://httptest:httptest@" + QtNetworkSettings::serverName() + "/qtest/auth-digest/") << QByteArray("digest authentication successful\n") << 0;
+ QTest::newRow("basic-in-url")
+ << QUrl("http://httptest:httptest@" + httpServer + "/qtest/rfcs-auth/rfc3252.txt")
+ << referenceData << 0;
+
+ QTest::newRow("digest-in-url")
+ << QUrl("http://httptest:httptest@" + httpServer + "/qtest/auth-digest/")
+ << QByteArray("digest authentication successful\n") << 0;
+
// if url contains incorrect credentials, expect QNAM to ask for good ones (even if cached - matches behaviour of browsers)
- QTest::newRow("basic-bad-user-in-url") << QUrl("http://baduser:httptest@" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt") << referenceData << 3;
- QTest::newRow("basic-bad-password-in-url") << QUrl("http://httptest:wrong@" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt") << referenceData << 3;
- QTest::newRow("digest-bad-user-in-url") << QUrl("http://baduser:httptest@" + QtNetworkSettings::serverName() + "/qtest/auth-digest/") << QByteArray("digest authentication successful\n") << 3;
- QTest::newRow("digest-bad-password-in-url") << QUrl("http://httptest:wrong@" + QtNetworkSettings::serverName() + "/qtest/auth-digest/") << QByteArray("digest authentication successful\n") << 3;
+ QTest::newRow("basic-bad-user-in-url")
+ << QUrl("http://baduser:httptest@" + httpServer + "/qtest/rfcs-auth/rfc3252.txt")
+ << referenceData << 3;
+
+ QTest::newRow("basic-bad-password-in-url")
+ << QUrl("http://httptest:wrong@" + httpServer + "/qtest/rfcs-auth/rfc3252.txt")
+ << referenceData << 3;
+
+ QTest::newRow("digest-bad-user-in-url")
+ << QUrl("http://baduser:httptest@" + httpServer + "/qtest/auth-digest/")
+ << QByteArray("digest authentication successful\n") << 3;
+
+ QTest::newRow("digest-bad-password-in-url")
+ << QUrl("http://httptest:wrong@" + httpServer + "/qtest/auth-digest/")
+ << QByteArray("digest authentication successful\n") << 3;
}
void tst_QNetworkReply::ioGetFromHttpWithAuth()
@@ -3459,7 +3577,7 @@ void tst_QNetworkReply::ioGetFromHttpWithAuthSynchronous()
// verify that we do not enter an endless loop with synchronous calls and wrong credentials
// the case when we succeed with the login is tested in ioGetFromHttpWithAuth()
- QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt"));
+ QNetworkRequest request(QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/rfcs-auth/rfc3252.txt"));
request.setAttribute(
QNetworkRequest::SynchronousRequestAttribute,
true);
@@ -3481,8 +3599,8 @@ void tst_QNetworkReply::ioGetFromHttpWithProxyAuth()
QFile reference(testDataDir + "/rfc3252.txt");
QVERIFY(reference.open(QIODevice::ReadOnly));
- QNetworkProxy proxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129);
- QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"));
+ QNetworkProxy proxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3129);
+ QNetworkRequest request(QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"));
{
manager.setProxy(proxy);
QNetworkReplyPtr reply1(manager.get(request));
@@ -3561,8 +3679,8 @@ void tst_QNetworkReply::ioGetFromHttpWithProxyAuthSynchronous()
// verify that we do not enter an endless loop with synchronous calls and wrong credentials
// the case when we succeed with the login is tested in ioGetFromHttpWithAuth()
- QNetworkProxy proxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129);
- QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"));
+ QNetworkProxy proxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3129);
+ QNetworkRequest request(QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"));
manager.setProxy(proxy);
request.setAttribute(
QNetworkRequest::SynchronousRequestAttribute,
@@ -3585,8 +3703,8 @@ void tst_QNetworkReply::ioGetFromHttpWithSocksProxy()
QFile reference(testDataDir + "/rfc3252.txt");
QVERIFY(reference.open(QIODevice::ReadOnly));
- QNetworkProxy proxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080);
- QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"));
+ QNetworkProxy proxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1080);
+ QNetworkRequest request(QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"));
{
manager.setProxy(proxy);
QNetworkReplyPtr reply(manager.get(request));
@@ -3609,7 +3727,7 @@ void tst_QNetworkReply::ioGetFromHttpWithSocksProxy()
}
// set an invalid proxy just to make sure that we can't load
- proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1079);
+ proxy = QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1079);
{
manager.setProxy(proxy);
QNetworkReplyPtr reply(manager.get(request));
@@ -3643,7 +3761,7 @@ void tst_QNetworkReply::ioGetFromHttpsWithSslErrors()
QFile reference(testDataDir + "/rfc3252.txt");
QVERIFY(reference.open(QIODevice::ReadOnly));
- QNetworkRequest request(QUrl("https://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"));
+ QNetworkRequest request(QUrl("https://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"));
QNetworkReplyPtr reply(manager.get(request));
DataReader reader(reply);
@@ -3674,7 +3792,7 @@ void tst_QNetworkReply::ioGetFromHttpsWithIgnoreSslErrors()
QFile reference(testDataDir + "/rfc3252.txt");
QVERIFY(reference.open(QIODevice::ReadOnly));
- QNetworkRequest request(QUrl("https://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"));
+ QNetworkRequest request(QUrl("https://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"));
QNetworkReplyPtr reply(manager.get(request));
reply->ignoreSslErrors();
@@ -3699,7 +3817,7 @@ void tst_QNetworkReply::ioGetFromHttpsWithSslHandshakeError()
QFile reference(testDataDir + "/rfc3252.txt");
QVERIFY(reference.open(QIODevice::ReadOnly));
- QNetworkRequest request(QUrl("https://" + QtNetworkSettings::serverName() + ":80"));
+ QNetworkRequest request(QUrl("https://" + QtNetworkSettings::httpServerName() + ":80"));
QNetworkReplyPtr reply(manager.get(request));
reply->ignoreSslErrors();
@@ -4013,34 +4131,34 @@ void tst_QNetworkReply::ioGetWithManyProxies_data()
// Simple tests that work:
// HTTP request with HTTP caching proxy
- proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129);
+ proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3129);
QTest::newRow("http-on-http")
<< proxyList << proxyList.at(0)
- << "http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
+ << "http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"
<< QNetworkReply::NoError;
// HTTP request with HTTP transparent proxy
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3129);
+ proxyList << QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::httpProxyServerName(), 3129);
QTest::newRow("http-on-http2")
<< proxyList << proxyList.at(0)
- << "http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
+ << "http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"
<< QNetworkReply::NoError;
// HTTP request with SOCKS transparent proxy
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1081);
+ proxyList << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1081);
QTest::newRow("http-on-socks")
<< proxyList << proxyList.at(0)
- << "http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
+ << "http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"
<< QNetworkReply::NoError;
// FTP request with FTP caching proxy
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::serverName(), 2121);
+ proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::ftpProxyServerName(), 2121);
QTest::newRow("ftp-on-ftp")
<< proxyList << proxyList.at(0)
- << "ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
+ << "ftp://" + QtNetworkSettings::ftpServerName() + "/qtest/rfc3252.txt"
<< QNetworkReply::NoError;
// The following test doesn't work because QFtp is too limited
@@ -4048,27 +4166,27 @@ void tst_QNetworkReply::ioGetWithManyProxies_data()
// FTP request with SOCKSv5 transparent proxy
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1081);
+ proxyList << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1081);
QTest::newRow("ftp-on-socks")
<< proxyList << proxyList.at(0)
- << "ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
+ << "ftp://" + QtNetworkSettings::ftpServerName() + "/qtest/rfc3252.txt"
<< QNetworkReply::NoError;
#ifndef QT_NO_SSL
// HTTPS with HTTP transparent proxy
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3129);
+ proxyList << QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::httpProxyServerName(), 3129);
QTest::newRow("https-on-http")
<< proxyList << proxyList.at(0)
- << "https://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
+ << "https://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"
<< QNetworkReply::NoError;
// HTTPS request with SOCKS transparent proxy
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1081);
+ proxyList << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1081);
QTest::newRow("https-on-socks")
<< proxyList << proxyList.at(0)
- << "https://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
+ << "https://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"
<< QNetworkReply::NoError;
#endif
@@ -4076,44 +4194,44 @@ void tst_QNetworkReply::ioGetWithManyProxies_data()
// HTTP request with FTP caching proxy
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::serverName(), 2121);
+ proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::ftpProxyServerName(), 2121);
QTest::newRow("http-on-ftp")
<< proxyList << QNetworkProxy()
- << "http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
+ << "http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"
<< QNetworkReply::ProxyNotFoundError;
// FTP request with HTTP caching proxy
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129);
+ proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3129);
QTest::newRow("ftp-on-http")
<< proxyList << QNetworkProxy()
- << "ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
+ << "ftp://" + QtNetworkSettings::ftpServerName() + "/qtest/rfc3252.txt"
<< QNetworkReply::ProxyNotFoundError;
// FTP request with HTTP caching proxies
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129)
- << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3130);
+ proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3129)
+ << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3130);
QTest::newRow("ftp-on-multiple-http")
<< proxyList << QNetworkProxy()
- << "ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
+ << "ftp://" + QtNetworkSettings::ftpServerName() + "/qtest/rfc3252.txt"
<< QNetworkReply::ProxyNotFoundError;
#ifndef QT_NO_SSL
// HTTPS with HTTP caching proxy
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129);
+ proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3129);
QTest::newRow("https-on-httptransparent")
<< proxyList << QNetworkProxy()
- << "https://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
+ << "https://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"
<< QNetworkReply::ProxyNotFoundError;
// HTTPS with FTP caching proxy
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::serverName(), 2121);
+ proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::ftpProxyServerName(), 2121);
QTest::newRow("https-on-ftp")
<< proxyList << QNetworkProxy()
- << "https://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
+ << "https://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"
<< QNetworkReply::ProxyNotFoundError;
#endif
@@ -4121,77 +4239,77 @@ void tst_QNetworkReply::ioGetWithManyProxies_data()
// HTTP request with more than one HTTP proxy
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129)
- << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3130);
+ proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3129)
+ << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3130);
QTest::newRow("http-on-multiple-http")
<< proxyList << proxyList.at(0)
- << "http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
+ << "http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"
<< QNetworkReply::NoError;
// HTTP request with HTTP + SOCKS
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129)
- << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1081);
+ proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3129)
+ << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1081);
QTest::newRow("http-on-http+socks")
<< proxyList << proxyList.at(0)
- << "http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
+ << "http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"
<< QNetworkReply::NoError;
// HTTP request with FTP + HTTP + SOCKS
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::serverName(), 2121)
- << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129)
- << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1081);
+ proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::ftpProxyServerName(), 2121)
+ << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3129)
+ << QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::socksProxyServerName(), 1081);
QTest::newRow("http-on-ftp+http+socks")
<< proxyList << proxyList.at(1) // second proxy should be used
- << "http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
+ << "http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"
<< QNetworkReply::NoError;
// HTTP request with NoProxy + HTTP
proxyList.clear();
proxyList << QNetworkProxy(QNetworkProxy::NoProxy)
- << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129);
+ << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3129);
QTest::newRow("http-on-noproxy+http")
<< proxyList << proxyList.at(0)
- << "http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
+ << "http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"
<< QNetworkReply::NoError;
// HTTP request with FTP + NoProxy
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::serverName(), 2121)
+ proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::ftpProxyServerName(), 2121)
<< QNetworkProxy(QNetworkProxy::NoProxy);
QTest::newRow("http-on-ftp+noproxy")
<< proxyList << proxyList.at(1) // second proxy should be used
- << "http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
+ << "http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"
<< QNetworkReply::NoError;
// FTP request with HTTP Caching + FTP
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129)
- << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::serverName(), 2121);
+ proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3129)
+ << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::ftpProxyServerName(), 2121);
QTest::newRow("ftp-on-http+ftp")
<< proxyList << proxyList.at(1) // second proxy should be used
- << "ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
+ << "ftp://" + QtNetworkSettings::ftpServerName() + "/qtest/rfc3252.txt"
<< QNetworkReply::NoError;
#ifndef QT_NO_SSL
// HTTPS request with HTTP Caching + HTTP transparent
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129)
- << QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3129);
+ proxyList << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3129)
+ << QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::httpProxyServerName(), 3129);
QTest::newRow("https-on-httpcaching+http")
<< proxyList << proxyList.at(1) // second proxy should be used
- << "https://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
+ << "https://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"
<< QNetworkReply::NoError;
// HTTPS request with FTP + HTTP C + HTTP T
proxyList.clear();
- proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::serverName(), 2121)
- << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129)
- << QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3129);
+ proxyList << QNetworkProxy(QNetworkProxy::FtpCachingProxy, QtNetworkSettings::ftpProxyServerName(), 2121)
+ << QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::httpProxyServerName(), 3129)
+ << QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::httpProxyServerName(), 3129);
QTest::newRow("https-on-ftp+httpcaching+http")
<< proxyList << proxyList.at(2) // skip the first two
- << "https://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"
+ << "https://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"
<< QNetworkReply::NoError;
#endif
}
@@ -4442,7 +4560,7 @@ void tst_QNetworkReply::ioPutToFtpFromFile()
QFile sourceFile(fileName);
QVERIFY(sourceFile.open(QIODevice::ReadOnly));
- QUrl url("ftp://" + QtNetworkSettings::serverName());
+ QUrl url("ftp://" + QtNetworkSettings::ftpServerName());
url.setPath(QString("/qtest/upload/qnetworkaccess-ioPutToFtpFromFile-%1-%2")
.arg(QTest::currentDataTag())
.arg(uniqueExtension));
@@ -4491,7 +4609,7 @@ void tst_QNetworkReply::ioPutToHttpFromFile()
QFile sourceFile(fileName);
QVERIFY(sourceFile.open(QIODevice::ReadOnly));
- QUrl url("http://" + QtNetworkSettings::serverName());
+ QUrl url("http://" + QtNetworkSettings::httpServerName());
url.setPath(QString("/dav/qnetworkaccess-ioPutToHttpFromFile-%1-%2")
.arg(QTest::currentDataTag())
.arg(uniqueExtension));
@@ -4534,7 +4652,7 @@ void tst_QNetworkReply::ioPostToHttpFromFile()
QFile sourceFile(fileName);
QVERIFY(sourceFile.open(QIODevice::ReadOnly));
- QUrl url("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/md5sum.cgi");
+ QUrl url("http://" + QtNetworkSettings::httpServerName() + "/qtest/cgi-bin/md5sum.cgi");
QNetworkRequest request(url);
request.setRawHeader("Content-Type", "application/octet-stream");
@@ -4568,9 +4686,9 @@ void tst_QNetworkReply::ioPostToHttpFromSocket_data()
for (int auth = 0; auth < 2; ++auth) {
QUrl url;
if (auth)
- url = "http://" + QtNetworkSettings::serverName() + "/qtest/protected/cgi-bin/md5sum.cgi";
+ url = "http://" + QtNetworkSettings::httpServerName() + "/qtest/protected/cgi-bin/md5sum.cgi";
else
- url = "http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/md5sum.cgi";
+ url = "http://" + QtNetworkSettings::httpServerName() + "/qtest/cgi-bin/md5sum.cgi";
QNetworkProxy proxy = proxies.at(i).proxy;
QByteArray testsuffix = QByteArray(auth ? "+auth" : "") + proxies.at(i).tag;
@@ -4685,7 +4803,7 @@ void tst_QNetworkReply::ioPostToHttpFromSocketSynchronous()
// ### for 4.8: make the socket pair unbuffered, to not read everything in one go in QNetworkReplyImplPrivate::setup()
QTestEventLoop::instance().enterLoop(3);
- QUrl url("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/md5sum.cgi");
+ QUrl url("http://" + QtNetworkSettings::httpServerName() + "/qtest/cgi-bin/md5sum.cgi");
QNetworkRequest request(url);
request.setRawHeader("Content-Type", "application/octet-stream");
request.setAttribute(
@@ -4716,7 +4834,7 @@ void tst_QNetworkReply::ioPostToHttpFromMiddleOfFileToEnd()
// seeking to the middle
sourceFile.seek(sourceFile.size() / 2);
- QUrl url = "http://" + QtNetworkSettings::serverName() + "/qtest/protected/cgi-bin/md5sum.cgi";
+ QUrl url = "http://" + QtNetworkSettings::httpServerName() + "/qtest/protected/cgi-bin/md5sum.cgi";
QNetworkRequest request(url);
request.setRawHeader("Content-Type", "application/octet-stream");
QNetworkReplyPtr reply(manager.post(request, &sourceFile));
@@ -4742,7 +4860,7 @@ void tst_QNetworkReply::ioPostToHttpFromMiddleOfFileFiveBytes()
// seeking to the middle
sourceFile.seek(sourceFile.size() / 2);
- QUrl url = "http://" + QtNetworkSettings::serverName() + "/qtest/protected/cgi-bin/md5sum.cgi";
+ QUrl url = "http://" + QtNetworkSettings::httpServerName() + "/qtest/protected/cgi-bin/md5sum.cgi";
QNetworkRequest request(url);
request.setRawHeader("Content-Type", "application/octet-stream");
// only send 5 bytes
@@ -4773,7 +4891,7 @@ void tst_QNetworkReply::ioPostToHttpFromMiddleOfQBufferFiveBytes()
uploadBuffer.write("1234567890");
uploadBuffer.seek(5);
- QUrl url = "http://" + QtNetworkSettings::serverName() + "/qtest/protected/cgi-bin/md5sum.cgi";
+ QUrl url = "http://" + QtNetworkSettings::httpServerName() + "/qtest/protected/cgi-bin/md5sum.cgi";
QNetworkRequest request(url);
request.setRawHeader("Content-Type", "application/octet-stream");
QNetworkReplyPtr reply(manager.post(request, &uploadBuffer));
@@ -4801,7 +4919,7 @@ void tst_QNetworkReply::ioPostToHttpNoBufferFlag()
QTRY_VERIFY(socketpair.create()); //QTRY_VERIFY as a workaround for QTBUG-24451
socketpair.endPoints[0]->write(data);
- QUrl url = "http://" + QtNetworkSettings::serverName() + "/qtest/protected/cgi-bin/md5sum.cgi";
+ QUrl url = "http://" + QtNetworkSettings::httpServerName() + "/qtest/protected/cgi-bin/md5sum.cgi";
QNetworkRequest request(url);
request.setRawHeader("Content-Type", "application/octet-stream");
// disallow buffering
@@ -5216,7 +5334,7 @@ void tst_QNetworkReply::lastModifiedHeaderForFile()
void tst_QNetworkReply::lastModifiedHeaderForHttp()
{
// Tue, 22 May 2007 12:04:57 GMT according to webserver
- QUrl url = "http://" + QtNetworkSettings::serverName() + "/qtest/fluke.gif";
+ QUrl url = "http://" + QtNetworkSettings::httpServerName() + "/qtest/fluke.gif";
QNetworkRequest request(url);
QNetworkReplyPtr reply(manager.head(request));
@@ -5232,7 +5350,7 @@ void tst_QNetworkReply::lastModifiedHeaderForHttp()
void tst_QNetworkReply::httpCanReadLine()
{
- QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt"));
+ QNetworkRequest request(QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt"));
QNetworkReplyPtr reply(manager.get(request));
QVERIFY2(waitForFinish(reply) == Success, msgWaitForFinished(reply));
@@ -5312,11 +5430,11 @@ void tst_QNetworkReply::downloadProgress_data()
QTest::addColumn<int>("expectedSize");
QTest::newRow("empty") << QUrl::fromLocalFile(QFINDTESTDATA("empty")) << 0;
- QTest::newRow("http:small") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt") << 25962;
- QTest::newRow("http:big") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/bigfile") << 519240;
- QTest::newRow("http:no-length") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/deflate/rfc2616.html") << -1;
- QTest::newRow("ftp:small") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt") << 25962;
- QTest::newRow("ftp:big") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/bigfile") << 519240;
+ QTest::newRow("http:small") << QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt") << 25962;
+ QTest::newRow("http:big") << QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/bigfile") << 519240;
+ QTest::newRow("http:no-length") << QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/deflate/rfc2616.html") << -1;
+ QTest::newRow("ftp:small") << QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt") << 25962;
+ QTest::newRow("ftp:big") << QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/bigfile") << 519240;
}
class SlowReader : public QObject
@@ -5473,7 +5591,7 @@ void tst_QNetworkReply::receiveCookiesFromHttp_data()
QList<QNetworkCookie> header, jar;
QNetworkCookie cookie("a", "b");
header << cookie;
- cookie.setDomain(QtNetworkSettings::serverName());
+ cookie.setDomain(QtNetworkSettings::httpServerName());
cookie.setPath("/qtest/cgi-bin/");
jar << cookie;
QTest::newRow("simple-cookie") << "a=b" << header << jar;
@@ -5497,7 +5615,7 @@ void tst_QNetworkReply::receiveCookiesFromHttp_data()
cookie = QNetworkCookie("a", "b");
cookie.setPath("/not/part-of-path");
header << cookie;
- cookie.setDomain(QtNetworkSettings::serverName());
+ cookie.setDomain(QtNetworkSettings::httpServerName());
jar << cookie;
QTest::newRow("invalid-cookie-path") << "a=b; path=/not/part-of-path" << header << jar;
@@ -5514,7 +5632,7 @@ void tst_QNetworkReply::receiveCookiesFromHttp()
QFETCH(QString, cookieString);
QByteArray data = cookieString.toLatin1() + '\n';
- QUrl url("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/set-cookie.cgi");
+ QUrl url("http://" + QtNetworkSettings::httpServerName() + "/qtest/cgi-bin/set-cookie.cgi");
QNetworkRequest request(url);
request.setRawHeader("Content-Type", "application/octet-stream");
QNetworkReplyPtr reply;
@@ -5541,7 +5659,7 @@ void tst_QNetworkReply::receiveCookiesFromHttpSynchronous()
QFETCH(QString, cookieString);
QByteArray data = cookieString.toLatin1() + '\n';
- QUrl url("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/set-cookie.cgi");
+ QUrl url("http://" + QtNetworkSettings::httpServerName() + "/qtest/cgi-bin/set-cookie.cgi");
QNetworkRequest request(url);
request.setRawHeader("Content-Type", "application/octet-stream");
@@ -5577,7 +5695,7 @@ void tst_QNetworkReply::sendCookies_data()
list << cookie;
QTest::newRow("no-match-domain") << list << "";
- cookie.setDomain(QtNetworkSettings::serverName());
+ cookie.setDomain(QtNetworkSettings::httpServerName());
cookie.setPath("/something/else");
list << cookie;
QTest::newRow("no-match-path") << list << "";
@@ -5610,7 +5728,7 @@ void tst_QNetworkReply::sendCookies()
QFETCH(QList<QNetworkCookie>, cookiesToSet);
cookieJar->setAllCookies(cookiesToSet);
- QUrl url("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/get-cookie.cgi");
+ QUrl url("http://" + QtNetworkSettings::httpServerName() + "/qtest/cgi-bin/get-cookie.cgi");
QNetworkRequest request(url);
QNetworkReplyPtr reply;
RUN_REQUEST(runSimpleRequest(QNetworkAccessManager::GetOperation, request, reply));
@@ -5634,7 +5752,7 @@ void tst_QNetworkReply::sendCookiesSynchronous()
QFETCH(QList<QNetworkCookie>, cookiesToSet);
cookieJar->setAllCookies(cookiesToSet);
- QUrl url("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/get-cookie.cgi");
+ QUrl url("http://" + QtNetworkSettings::httpServerName() + "/qtest/cgi-bin/get-cookie.cgi");
QNetworkRequest request(url);
request.setAttribute(
@@ -5682,7 +5800,7 @@ void tst_QNetworkReply::nestedEventLoops()
qDebug("Takes 16 seconds to run, please wait");
- QUrl url("http://" + QtNetworkSettings::serverName());
+ QUrl url("http://" + QtNetworkSettings::httpServerName());
QNetworkRequest request(url);
QNetworkReplyPtr reply(manager.get(request));
@@ -5840,7 +5958,7 @@ void tst_QNetworkReply::proxyChange()
"HTTP/1.0 200 OK\r\nProxy-Connection: keep-alive\r\n"
"Content-Length: 1\r\n\r\n1");
QNetworkProxy dummyProxy(QNetworkProxy::HttpProxy, "127.0.0.1", proxyServer.serverPort());
- QNetworkRequest req(QUrl("http://" + QtNetworkSettings::serverName()));
+ QNetworkRequest req(QUrl("http://" + QtNetworkSettings::httpServerName()));
proxyServer.doClose = false;
{
@@ -5899,13 +6017,17 @@ void tst_QNetworkReply::authorizationError_data()
QTest::addColumn<int>("httpStatusCode");
QTest::addColumn<QString>("httpBody");
- QTest::newRow("unknown-authorization-method") << "http://" + QtNetworkSettings::serverName() +
- "/qtest/cgi-bin/http-unknown-authentication-method.cgi?401-authorization-required" << 1 << 1
- << int(QNetworkReply::AuthenticationRequiredError) << 401 << "authorization required";
- QTest::newRow("unknown-proxy-authorization-method") << "http://" + QtNetworkSettings::serverName() +
- "/qtest/cgi-bin/http-unknown-authentication-method.cgi?407-proxy-authorization-required" << 1 << 1
- << int(QNetworkReply::ProxyAuthenticationRequiredError) << 407
- << "authorization required";
+ QTest::newRow("unknown-authorization-method")
+ << "http://" + QtNetworkSettings::httpServerName()
+ + "/qtest/cgi-bin/http-unknown-authentication-method.cgi?401-authorization-required"
+ << 1 << 1 << int(QNetworkReply::AuthenticationRequiredError)
+ << 401 << "authorization required";
+
+ QTest::newRow("unknown-proxy-authorization-method")
+ << "http://" + QtNetworkSettings::httpServerName()
+ + "/qtest/cgi-bin/http-unknown-authentication-method.cgi?407-proxy-authorization-required"
+ << 1 << 1 << int(QNetworkReply::ProxyAuthenticationRequiredError)
+ << 407 << "authorization required";
}
void tst_QNetworkReply::authorizationError()
@@ -6124,7 +6246,7 @@ public slots:
}
void startOne()
{
- QUrl url = "http://" + QtNetworkSettings::serverName() + "/qtest/fluke.gif";
+ QUrl url = "http://" + QtNetworkSettings::httpServerName() + "/qtest/fluke.gif";
QNetworkRequest request(url);
QNetworkReply *reply = manager.get(request);
reply->setParent(this);
@@ -6146,29 +6268,28 @@ void tst_QNetworkReply::httpRecursiveCreation()
#ifndef QT_NO_SSL
void tst_QNetworkReply::ignoreSslErrorsList_data()
{
- QTest::addColumn<QString>("url");
QTest::addColumn<QList<QSslError> >("expectedSslErrors");
QTest::addColumn<QNetworkReply::NetworkError>("expectedNetworkError");
QList<QSslError> expectedSslErrors;
- QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + "/certs/qt-test-server-cacert.pem");
+ QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + certsFilePath);
QSslError rightError(FLUKE_CERTIFICATE_ERROR, certs.at(0));
QSslError wrongError(FLUKE_CERTIFICATE_ERROR);
- QTest::newRow("SSL-failure-empty-list") << "https://" + QtNetworkSettings::serverName() + "/index.html" << expectedSslErrors << QNetworkReply::SslHandshakeFailedError;
+ QTest::newRow("SSL-failure-empty-list") << expectedSslErrors << QNetworkReply::SslHandshakeFailedError;
expectedSslErrors.append(wrongError);
- QTest::newRow("SSL-failure-wrong-error") << "https://" + QtNetworkSettings::serverName() + "/index.html" << expectedSslErrors << QNetworkReply::SslHandshakeFailedError;
+ QTest::newRow("SSL-failure-wrong-error") << expectedSslErrors << QNetworkReply::SslHandshakeFailedError;
expectedSslErrors.append(rightError);
- QTest::newRow("allErrorsInExpectedList1") << "https://" + QtNetworkSettings::serverName() + "/index.html" << expectedSslErrors << QNetworkReply::NoError;
+ QTest::newRow("allErrorsInExpectedList1") << expectedSslErrors << QNetworkReply::NoError;
expectedSslErrors.removeAll(wrongError);
- QTest::newRow("allErrorsInExpectedList2") << "https://" + QtNetworkSettings::serverName() + "/index.html" << expectedSslErrors << QNetworkReply::NoError;
+ QTest::newRow("allErrorsInExpectedList2") << expectedSslErrors << QNetworkReply::NoError;
expectedSslErrors.removeAll(rightError);
- QTest::newRow("SSL-failure-empty-list-again") << "https://" + QtNetworkSettings::serverName() + "/index.html" << expectedSslErrors << QNetworkReply::SslHandshakeFailedError;
+ QTest::newRow("SSL-failure-empty-list-again") << expectedSslErrors << QNetworkReply::SslHandshakeFailedError;
}
void tst_QNetworkReply::ignoreSslErrorsList()
{
- QFETCH(QString, url);
+ QString url(QLatin1String("https://") + QtNetworkSettings::httpServerName() + QLatin1String("/index.html"));
QNetworkRequest request(url);
QNetworkReplyPtr reply(manager.get(request));
@@ -6195,7 +6316,7 @@ void tst_QNetworkReply::ignoreSslErrorListSlot(QNetworkReply *reply, const QList
// do the same as in ignoreSslErrorsList, but ignore the errors in the slot
void tst_QNetworkReply::ignoreSslErrorsListWithSlot()
{
- QFETCH(QString, url);
+ QString url(QLatin1String("https://") + QtNetworkSettings::httpServerName() + QLatin1String("/index.html"));
QNetworkRequest request(url);
QNetworkReplyPtr reply(manager.get(request));
@@ -6220,7 +6341,7 @@ void tst_QNetworkReply::sslConfiguration_data()
QTest::newRow("empty") << QSslConfiguration() << false;
QSslConfiguration conf = QSslConfiguration::defaultConfiguration();
QTest::newRow("default") << conf << false; // does not contain test server cert
- QList<QSslCertificate> testServerCert = QSslCertificate::fromPath(testDataDir + "/certs/qt-test-server-cacert.pem");
+ QList<QSslCertificate> testServerCert = QSslCertificate::fromPath(testDataDir + certsFilePath);
conf.setCaCertificates(testServerCert);
QTest::newRow("set-root-cert") << conf << true;
conf.setProtocol(QSsl::SecureProtocols);
@@ -6229,8 +6350,8 @@ void tst_QNetworkReply::sslConfiguration_data()
void tst_QNetworkReply::encrypted()
{
- qDebug() << QtNetworkSettings::serverName();
- QUrl url("https://" + QtNetworkSettings::serverName());
+ qDebug() << QtNetworkSettings::httpServerName();
+ QUrl url("https://" + QtNetworkSettings::httpServerName());
QNetworkRequest request(url);
QNetworkReply *reply = manager.get(request);
reply->ignoreSslErrors();
@@ -6278,7 +6399,7 @@ void tst_QNetworkReply::abortOnEncrypted()
void tst_QNetworkReply::sslConfiguration()
{
- QNetworkRequest request(QUrl("https://" + QtNetworkSettings::serverName() + "/index.html"));
+ QNetworkRequest request(QUrl("https://" + QtNetworkSettings::httpServerName() + "/index.html"));
QFETCH(QSslConfiguration, configuration);
request.setSslConfiguration(configuration);
QNetworkReplyPtr reply(manager.get(request));
@@ -6305,7 +6426,7 @@ void tst_QNetworkReply::sslSessionSharing()
QSKIP("Not implemented with SecureTransport");
#endif
- QString urlString("https://" + QtNetworkSettings::serverName());
+ QString urlString("https://" + QtNetworkSettings::httpServerName());
QList<QNetworkReplyPtr> replies;
// warm up SSL session cache
@@ -6373,7 +6494,7 @@ void tst_QNetworkReply::sslSessionSharingFromPersistentSession()
QSKIP("Not implemented with SecureTransport");
#endif
- QString urlString("https://" + QtNetworkSettings::serverName());
+ QString urlString("https://" + QtNetworkSettings::httpServerName());
// warm up SSL session cache to get a working session
QNetworkRequest warmupRequest(urlString);
@@ -6439,7 +6560,7 @@ void tst_QNetworkReply::getAndThenDeleteObject()
QSKIP("unstable test - reply may be finished too early");
// yes, this will leak if the testcase fails. I don't care. It must not fail then :P
QNetworkAccessManager *manager = new QNetworkAccessManager();
- QNetworkRequest request("http://" + QtNetworkSettings::serverName() + "/qtest/bigfile");
+ QNetworkRequest request("http://" + QtNetworkSettings::httpServerName() + "/qtest/bigfile");
QNetworkReply *reply = manager->get(request);
reply->setReadBufferSize(1);
reply->setParent((QObject*)0); // must be 0 because else it is the manager
@@ -6479,7 +6600,7 @@ void tst_QNetworkReply::getFromHttpIntoBuffer_data()
{
QTest::addColumn<QUrl>("url");
- QTest::newRow("rfc-internal") << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt");
+ QTest::newRow("rfc-internal") << QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt");
}
// Please note that the whole "zero copy" download buffer API is private right now. Do not use it.
@@ -6892,9 +7013,15 @@ void tst_QNetworkReply::authenticationCacheAfterCancel_data()
QTest::addColumn<bool>("proxyAuth");
QTest::addColumn<QUrl>("url");
for (int i = 0; i < proxies.count(); ++i) {
- QTest::newRow("http" + proxies.at(i).tag) << proxies.at(i).proxy << proxies.at(i).requiresAuthentication << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt");
+ QTest::newRow("http" + proxies.at(i).tag)
+ << proxies.at(i).proxy
+ << proxies.at(i).requiresAuthentication
+ << QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/rfcs-auth/rfc3252.txt");
#ifndef QT_NO_SSL
- QTest::newRow("https" + proxies.at(i).tag) << proxies.at(i).proxy << proxies.at(i).requiresAuthentication << QUrl("https://" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt");
+ QTest::newRow("https" + proxies.at(i).tag)
+ << proxies.at(i).proxy
+ << proxies.at(i).requiresAuthentication
+ << QUrl("https://" + QtNetworkSettings::httpServerName() + "/qtest/rfcs-auth/rfc3252.txt");
#endif
}
}
@@ -7083,7 +7210,7 @@ void tst_QNetworkReply::authenticationWithDifferentRealm()
helper.httpUserName = "httptest";
helper.httpPassword = "httptest";
- QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt"));
+ QNetworkRequest request(QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/rfcs-auth/rfc3252.txt"));
QNetworkReply* reply = manager.get(request);
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection);
QTestEventLoop::instance().enterLoop(10);
@@ -7093,7 +7220,7 @@ void tst_QNetworkReply::authenticationWithDifferentRealm()
helper.httpUserName = "httptest";
helper.httpPassword = "httptest";
- request.setUrl(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/auth-digest/"));
+ request.setUrl(QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/auth-digest/"));
reply = manager.get(request);
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection);
QTestEventLoop::instance().enterLoop(10);
@@ -7135,7 +7262,7 @@ void tst_QNetworkReply::qtbug13431replyThrottling()
connect(&nam, SIGNAL(finished(QNetworkReply*)), &helper, SLOT(replyFinished(QNetworkReply*)));
// Download a bigger file
- QNetworkRequest netRequest(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/bigfile"));
+ QNetworkRequest netRequest(QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/bigfile"));
helper.m_reply = nam.get(netRequest);
// Set the throttle
helper.m_reply->setReadBufferSize(36000);
@@ -7161,7 +7288,7 @@ void tst_QNetworkReply::httpWithNoCredentialUsage()
// Get with credentials, to preload authentication cache
{
- QNetworkRequest request(QUrl("http://httptest:httptest@" + QtNetworkSettings::serverName() + "/qtest/protected/cgi-bin/md5sum.cgi"));
+ QNetworkRequest request(QUrl("http://httptest:httptest@" + QtNetworkSettings::httpServerName() + "/qtest/protected/cgi-bin/md5sum.cgi"));
QNetworkReplyPtr reply(manager.get(request));
QVERIFY2(waitForFinish(reply) == Success, msgWaitForFinished(reply));
// credentials in URL, so don't expect authentication signal
@@ -7172,7 +7299,7 @@ void tst_QNetworkReply::httpWithNoCredentialUsage()
// Get with cached credentials (normal usage)
{
- QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/protected/cgi-bin/md5sum.cgi"));
+ QNetworkRequest request(QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/protected/cgi-bin/md5sum.cgi"));
QNetworkReplyPtr reply(manager.get(request));
QVERIFY2(waitForFinish(reply) == Success, msgWaitForFinished(reply));
// credentials in cache, so don't expect authentication signal
@@ -7183,7 +7310,7 @@ void tst_QNetworkReply::httpWithNoCredentialUsage()
// Do not use cached credentials (webkit cross origin usage)
{
- QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/protected/cgi-bin/md5sum.cgi"));
+ QNetworkRequest request(QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/protected/cgi-bin/md5sum.cgi"));
request.setAttribute(QNetworkRequest::AuthenticationReuseAttribute, QNetworkRequest::Manual);
QNetworkReplyPtr reply(manager.get(request));
@@ -7502,13 +7629,13 @@ void tst_QNetworkReply::synchronousRequest_data()
// ### cache, auth, proxies
QTest::newRow("http")
- << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt")
+ << QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt")
<< QString("file:" + testDataDir + "/rfc3252.txt")
<< true
<< QString("text/plain");
QTest::newRow("http-gzip")
- << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/deflate/rfc3252.txt")
+ << QUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/deflate/rfc3252.txt")
<< QString("file:" + testDataDir + "/rfc3252.txt")
<< false // don't check content length, because it's gzip encoded
// ### we would need to enflate (un-deflate) the file content and compare the sizes
@@ -7516,7 +7643,7 @@ void tst_QNetworkReply::synchronousRequest_data()
#ifndef QT_NO_SSL
QTest::newRow("https")
- << QUrl("https://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt")
+ << QUrl("https://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt")
<< QString("file:" + testDataDir + "/rfc3252.txt")
<< true
<< QString("text/plain");
@@ -7552,7 +7679,7 @@ void tst_QNetworkReply::synchronousRequest()
// QNetworkRequest, see QTBUG-14774
if (url.scheme() == "https") {
QSslConfiguration sslConf;
- QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + "/certs/qt-test-server-cacert.pem");
+ QList<QSslCertificate> certs = QSslCertificate::fromPath(testDataDir + certsFilePath);
sslConf.setCaCertificates(certs);
request.setSslConfiguration(sslConf);
}
@@ -7597,7 +7724,7 @@ void tst_QNetworkReply::synchronousRequestSslFailure()
// and that we do not emit the sslError signal (in the manager that is,
// in the reply we don't care)
- QUrl url("https://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt");
+ QUrl url("https://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt");
QNetworkRequest request(url);
request.setAttribute(
QNetworkRequest::SynchronousRequestAttribute,
@@ -7643,7 +7770,7 @@ void tst_QNetworkReply::httpAbort()
// It must not crash either.
// Abort after the first readyRead()
- QNetworkRequest request("http://" + QtNetworkSettings::serverName() + "/qtest/bigfile");
+ QNetworkRequest request("http://" + QtNetworkSettings::httpServerName() + "/qtest/bigfile");
QNetworkReplyPtr reply(manager.get(request));
HttpAbortHelper replyHolder(reply.data());
QTestEventLoop::instance().enterLoop(10);
@@ -7659,7 +7786,7 @@ void tst_QNetworkReply::httpAbort()
QVERIFY(reply2->isFinished());
// Abort after the finished()
- QNetworkRequest request3("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt");
+ QNetworkRequest request3("http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt");
QNetworkReplyPtr reply3(manager.get(request3));
QCOMPARE(waitForFinish(reply3), int(Success));
@@ -7795,7 +7922,7 @@ void tst_QNetworkReply::synchronousAuthenticationCache()
void tst_QNetworkReply::pipelining()
{
- QString urlString("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/echo.cgi?");
+ QString urlString("http://" + QtNetworkSettings::httpServerName() + "/qtest/cgi-bin/echo.cgi?");
QList<QNetworkReplyPtr> replies;
for (int a = 0; a < 20; a++) {
QNetworkRequest request(urlString + QString::number(a));
@@ -7839,8 +7966,8 @@ void tst_QNetworkReply::emitErrorForAllRepliesSlot() {
void tst_QNetworkReply::closeDuringDownload_data()
{
QTest::addColumn<QUrl>("url");
- QTest::newRow("http") << QUrl("http://" + QtNetworkSettings::serverName() + "/bigfile");
- QTest::newRow("ftp") << QUrl("ftp://" + QtNetworkSettings::serverName() + "/qtest/bigfile");
+ QTest::newRow("http") << QUrl("http://" + QtNetworkSettings::httpServerName() + "/bigfile");
+ QTest::newRow("ftp") << QUrl("ftp://" + QtNetworkSettings::ftpServerName() + "/qtest/bigfile");
}
void tst_QNetworkReply::closeDuringDownload()
@@ -7864,8 +7991,8 @@ void tst_QNetworkReply::ftpAuthentication_data()
QTest::addColumn<QString>("url");
QTest::addColumn<int>("error");
- QTest::newRow("invalidPassword") << (testDataDir + "/rfc3252.txt") << "ftp://ftptest:invalid@" + QtNetworkSettings::serverName() + "/home/qt-test-server/ftp/qtest/rfc3252.txt" << int(QNetworkReply::AuthenticationRequiredError);
- QTest::newRow("validPassword") << (testDataDir + "/rfc3252.txt") << "ftp://ftptest:password@" + QtNetworkSettings::serverName() + "/home/qt-test-server/ftp/qtest/rfc3252.txt" << int(QNetworkReply::NoError);
+ QTest::newRow("invalidPassword") << (testDataDir + "/rfc3252.txt") << "ftp://ftptest:invalid@" + QtNetworkSettings::ftpServerName() + "/home/qt-test-server/ftp/qtest/rfc3252.txt" << int(QNetworkReply::AuthenticationRequiredError);
+ QTest::newRow("validPassword") << (testDataDir + "/rfc3252.txt") << "ftp://ftptest:password@" + QtNetworkSettings::ftpServerName() + "/home/qt-test-server/ftp/qtest/rfc3252.txt" << int(QNetworkReply::NoError);
}
void tst_QNetworkReply::ftpAuthentication()
@@ -7925,9 +8052,9 @@ void tst_QNetworkReply::backgroundRequest_data()
QTest::addColumn<int>("policy");
QTest::addColumn<QNetworkReply::NetworkError>("error");
- QUrl httpurl("http://" + QtNetworkSettings::serverName());
- QUrl httpsurl("https://" + QtNetworkSettings::serverName());
- QUrl ftpurl("ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt");
+ QUrl httpurl("http://" + QtNetworkSettings::httpServerName());
+ QUrl httpsurl("https://" + QtNetworkSettings::httpServerName());
+ QUrl ftpurl("ftp://" + QtNetworkSettings::ftpServerName() + "/qtest/rfc3252.txt");
QTest::newRow("http, fg, normal") << httpurl << false << (int)QNetworkSession::NoPolicy << QNetworkReply::NoError;
QTest::newRow("http, bg, normal") << httpurl << true << (int)QNetworkSession::NoPolicy << QNetworkReply::NoError;
@@ -7996,9 +8123,9 @@ void tst_QNetworkReply::backgroundRequestInterruption_data()
QTest::addColumn<bool>("background");
QTest::addColumn<QNetworkReply::NetworkError>("error");
- QUrl httpurl("http://" + QtNetworkSettings::serverName() + "/qtest/mediumfile");
- QUrl httpsurl("https://" + QtNetworkSettings::serverName() + "/qtest/mediumfile");
- QUrl ftpurl("ftp://" + QtNetworkSettings::serverName() + "/qtest/bigfile");
+ QUrl httpurl("http://" + QtNetworkSettings::httpServerName() + "/qtest/mediumfile");
+ QUrl httpsurl("https://" + QtNetworkSettings::httpServerName() + "/qtest/mediumfile");
+ QUrl ftpurl("ftp://" + QtNetworkSettings::ftpServerName() + "/qtest/bigfile");
QTest::newRow("http, fg, nobg") << httpurl << false << QNetworkReply::NoError;
QTest::newRow("http, bg, nobg") << httpurl << true << QNetworkReply::BackgroundRequestNotAllowedError;
@@ -8069,8 +8196,8 @@ void tst_QNetworkReply::backgroundRequestConnectInBackground_data()
QTest::addColumn<QUrl>("url");
QTest::addColumn<bool>("background");
- QUrl httpurl("http://" + QtNetworkSettings::serverName());
- QUrl ftpurl("ftp://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt");
+ QUrl httpurl("http://" + QtNetworkSettings::httpServerName());
+ QUrl ftpurl("ftp://" + QtNetworkSettings::ftpServerName() + "/qtest/rfc3252.txt");
QTest::newRow("http, fg") << httpurl << false;
QTest::newRow("http, bg") << httpurl << true;
@@ -8196,7 +8323,7 @@ void tst_QNetworkReply::putWithRateLimiting()
QByteArray data = reference.readAll();
QVERIFY(data.length() > 0);
- QUrl url = QUrl::fromUserInput("http://" + QtNetworkSettings::serverName()+ "/qtest/cgi-bin/echo.cgi?");
+ QUrl url = QUrl::fromUserInput("http://" + QtNetworkSettings::httpServerName()+ "/qtest/cgi-bin/echo.cgi?");
QNetworkRequest request(url);
QNetworkReplyPtr reply;
@@ -8641,7 +8768,7 @@ void tst_QNetworkReply::ioHttpRedirect()
void tst_QNetworkReply::ioHttpRedirectFromLocalToRemote()
{
- QUrl targetUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt");
+ QUrl targetUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/rfc3252.txt");
QString redirectReply = tempRedirectReplyStr().arg(targetUrl.toString());
MiniHttpServer redirectServer(redirectReply.toLatin1(), false);
@@ -8710,7 +8837,7 @@ void tst_QNetworkReply::ioHttpRedirectPostPut()
QFETCH(QByteArray, data);
QFETCH(QString, contentType);
- QUrl targetUrl("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/md5sum.cgi");
+ QUrl targetUrl("http://" + QtNetworkSettings::httpServerName() + "/qtest/cgi-bin/md5sum.cgi");
QString redirectReply = QStringLiteral("HTTP/1.1 %1\r\n"
"Content-Type: text/plain\r\n"
@@ -8999,7 +9126,7 @@ void tst_QNetworkReply::putWithServerClosingConnectionImmediately()
// NOTE: This test must be last testcase in tst_qnetworkreply!
void tst_QNetworkReply::parentingRepliesToTheApp()
{
- QNetworkRequest request (QUrl("http://" + QtNetworkSettings::serverName()));
+ QNetworkRequest request(QUrl("http://" + QtNetworkSettings::httpServerName()));
manager.get(request)->setParent(this); // parent to this object
manager.get(request)->setParent(qApp); // parent to the app
}
diff --git a/tests/auto/network/access/qnetworkrequest/tst_qnetworkrequest.cpp b/tests/auto/network/access/qnetworkrequest/tst_qnetworkrequest.cpp
index 50c7ddb0b6..7a3def410a 100644
--- a/tests/auto/network/access/qnetworkrequest/tst_qnetworkrequest.cpp
+++ b/tests/auto/network/access/qnetworkrequest/tst_qnetworkrequest.cpp
@@ -236,6 +236,46 @@ void tst_QNetworkRequest::setHeader_data()
<< true << "Last-Modified"
<< "Thu, 01 Nov 2007 18:08:30 GMT";
+ QTest::newRow("If-Modified-Since-Date") << QNetworkRequest::IfModifiedSinceHeader
+ << QVariant(QDate(2017, 7, 01))
+ << true << "If-Modified-Since"
+ << "Sat, 01 Jul 2017 00:00:00 GMT";
+ QTest::newRow("If-Modified-Since-DateTime") << QNetworkRequest::IfModifiedSinceHeader
+ << QVariant(QDateTime(QDate(2017, 7, 01),
+ QTime(3, 14, 15),
+ Qt::UTC))
+ << true << "If-Modified-Since"
+ << "Sat, 01 Jul 2017 03:14:15 GMT";
+
+ QTest::newRow("Etag-strong") << QNetworkRequest::ETagHeader << QVariant(R"("xyzzy")")
+ << true << "ETag" << R"("xyzzy")";
+ QTest::newRow("Etag-weak") << QNetworkRequest::ETagHeader << QVariant(R"(W/"xyzzy")")
+ << true << "ETag" << R"(W/"xyzzy")";
+ QTest::newRow("Etag-empty") << QNetworkRequest::ETagHeader << QVariant(R"("")")
+ << true << "ETag" << R"("")";
+
+ QTest::newRow("If-Match-empty") << QNetworkRequest::IfMatchHeader << QVariant(R"("")")
+ << true << "If-Match" << R"("")";
+ QTest::newRow("If-Match-any") << QNetworkRequest::IfMatchHeader << QVariant(R"("*")")
+ << true << "If-Match" << R"("*")";
+ QTest::newRow("If-Match-single") << QNetworkRequest::IfMatchHeader << QVariant(R"("xyzzy")")
+ << true << "If-Match" << R"("xyzzy")";
+ QTest::newRow("If-Match-multiple") << QNetworkRequest::IfMatchHeader
+ << QVariant(R"("xyzzy", "r2d2xxxx", "c3piozzzz")")
+ << true << "If-Match"
+ << R"("xyzzy", "r2d2xxxx", "c3piozzzz")";
+
+ QTest::newRow("If-None-Match-empty") << QNetworkRequest::IfNoneMatchHeader << QVariant(R"("")")
+ << true << "If-None-Match" << R"("")";
+ QTest::newRow("If-None-Match-any") << QNetworkRequest::IfNoneMatchHeader << QVariant(R"("*")")
+ << true << "If-None-Match" << R"("*")";
+ QTest::newRow("If-None-Match-single") << QNetworkRequest::IfNoneMatchHeader << QVariant(R"("xyzzy")")
+ << true << "If-None-Match" << R"("xyzzy")";
+ QTest::newRow("If-None-Match-multiple") << QNetworkRequest::IfNoneMatchHeader
+ << QVariant(R"("xyzzy", W/"r2d2xxxx", "c3piozzzz")")
+ << true << "If-None-Match"
+ << R"("xyzzy", W/"r2d2xxxx", "c3piozzzz")";
+
QNetworkCookie cookie;
cookie.setName("a");
cookie.setValue("b");
@@ -327,6 +367,62 @@ void tst_QNetworkRequest::rawHeaderParsing_data()
<< true << "Last-Modified"
<< "Sun Nov 6 08:49:37 1994";
+ QTest::newRow("If-Modified-Since-RFC1123") << QNetworkRequest::IfModifiedSinceHeader
+ << QVariant(QDateTime(QDate(1994, 8, 06),
+ QTime(8, 49, 37),
+ Qt::UTC))
+ << true << "If-Modified-Since"
+ << "Sun, 06 Aug 1994 08:49:37 GMT";
+ QTest::newRow("If-Modified-Since-RFC850") << QNetworkRequest::IfModifiedSinceHeader
+ << QVariant(QDateTime(QDate(1994, 8, 06),
+ QTime(8, 49, 37),
+ Qt::UTC))
+ << true << "If-Modified-Since"
+ << "Sunday, 06-Aug-94 08:49:37 GMT";
+ QTest::newRow("If-Modified-Since-asctime") << QNetworkRequest::IfModifiedSinceHeader
+ << QVariant(QDateTime(QDate(1994, 8, 06),
+ QTime(8, 49, 37),
+ Qt::UTC))
+ << true << "If-Modified-Since"
+ << "Sun Aug 6 08:49:37 1994";
+
+ QTest::newRow("Etag-strong") << QNetworkRequest::ETagHeader << QVariant(R"("xyzzy")")
+ << true << "ETag" << R"("xyzzy")";
+ QTest::newRow("Etag-weak") << QNetworkRequest::ETagHeader << QVariant(R"(W/"xyzzy")")
+ << true << "ETag" << R"(W/"xyzzy")";
+ QTest::newRow("Etag-empty") << QNetworkRequest::ETagHeader << QVariant(R"("")")
+ << true << "ETag" << R"("")";
+
+ QTest::newRow("If-Match-empty") << QNetworkRequest::IfMatchHeader << QVariant(QStringList(R"("")"))
+ << true << "If-Match" << R"("")";
+ QTest::newRow("If-Match-any") << QNetworkRequest::IfMatchHeader << QVariant(QStringList(R"("*")"))
+ << true << "If-Match" << R"("*")";
+ QTest::newRow("If-Match-single") << QNetworkRequest::IfMatchHeader
+ << QVariant(QStringList(R"("xyzzy")"))
+ << true << "If-Match" << R"("xyzzy")";
+ QTest::newRow("If-Match-multiple") << QNetworkRequest::IfMatchHeader
+ << QVariant(QStringList({R"("xyzzy")",
+ R"("r2d2xxxx")",
+ R"("c3piozzzz")"}))
+ << true << "If-Match"
+ << R"("xyzzy", "r2d2xxxx", "c3piozzzz")";
+
+ QTest::newRow("If-None-Match-empty") << QNetworkRequest::IfNoneMatchHeader
+ << QVariant(QStringList(R"("")"))
+ << true << "If-None-Match" << R"("")";
+ QTest::newRow("If-None-Match-any") << QNetworkRequest::IfNoneMatchHeader
+ << QVariant(QStringList(R"("*")"))
+ << true << "If-None-Match" << R"("*")";
+ QTest::newRow("If-None-Match-single") << QNetworkRequest::IfNoneMatchHeader
+ << QVariant(QStringList(R"("xyzzy")"))
+ << true << "If-None-Match" << R"("xyzzy")";
+ QTest::newRow("If-None-Match-multiple") << QNetworkRequest::IfNoneMatchHeader
+ << QVariant(QStringList({R"("xyzzy")",
+ R"(W/"r2d2xxxx")",
+ R"("c3piozzzz")"}))
+ << true << "If-None-Match"
+ << R"("xyzzy", W/"r2d2xxxx", "c3piozzzz")";
+
QTest::newRow("Content-Length-invalid1") << QNetworkRequest::ContentLengthHeader << QVariant()
<< false << "Content-Length" << "1a";
QTest::newRow("Content-Length-invalid2") << QNetworkRequest::ContentLengthHeader << QVariant()
diff --git a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
index bc53faf106..01168cc0d6 100644
--- a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
+++ b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
@@ -29,10 +29,6 @@
#include <QtTest/QTest>
-#ifdef Q_OS_WIN
-#include <winsock2.h>
-#endif
-
#include <qcoreapplication.h>
#include <qdatastream.h>
#include <qhostaddress.h>
diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
index 779d55a77a..45ab275510 100644
--- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
@@ -962,9 +962,6 @@ void tst_QLocalSocket::processConnection()
#if !QT_CONFIG(process)
QSKIP("No qprocess support", SkipAll);
#else
-#ifdef Q_OS_MAC
- QSKIP("The processConnection test is unstable on Mac. See QTBUG-39986.");
-#endif
#ifdef Q_OS_WIN
const QString exeSuffix = QStringLiteral(".exe");
diff --git a/tests/auto/network/ssl/qdtls/certs/bogus-ca.crt b/tests/auto/network/ssl/qdtls/certs/bogus-ca.crt
new file mode 100644
index 0000000000..cf5893e98d
--- /dev/null
+++ b/tests/auto/network/ssl/qdtls/certs/bogus-ca.crt
@@ -0,0 +1,20 @@
+-----BEGIN CERTIFICATE-----
+MIIDMzCCAhugAwIBAgIJAJBdFtmKuuELMA0GCSqGSIb3DQEBCwUAMC8xGjAYBgNV
+BAoMEUJvZ3VzIENvcnBvcmF0aW9uMREwDwYDVQQDDAhCb2d1cyBDQTAgFw0xNTAx
+MzAxNzM0NDdaGA8yMTE1MDEwNjE3MzQ0N1owLzEaMBgGA1UECgwRQm9ndXMgQ29y
+cG9yYXRpb24xETAPBgNVBAMMCEJvZ3VzIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC
+AQ8AMIIBCgKCAQEAnXt/X69lmfvWampP88f20yNs1VZroG9VjdR4GaJM6pbWu5Wn
+SYBfS81osnHC7dTW2FvKZUGnz7KX+ImkbE2qUvj6yTeFu6ILj3o+8ws7A4iOTkiH
+84CHb6T/HxWO5fW6mS5v+tvPDp3rQ7JpPVYvoh7dSv8X1+JCdDmkepRveN6Pzo47
+9VFVC0oscc5I4Y0wPwnaXZ4X26vmRfbhqtoKL57lz1lJ0R6bvLC9mf4DGFPx7WXQ
+eOtlKX2dtuKj+Cl3vyHff6gHNMKM0bq3KfsT+vDO6eIs/ayqVRdd0XBIMj+bZYd9
+7QI/+3XTNR3TwTisrjo71XZtHdA1DkcMaSGoJwIDAQABo1AwTjAdBgNVHQ4EFgQU
+xVZK4BIjBgmluCLIespCbne4BIUwHwYDVR0jBBgwFoAUxVZK4BIjBgmluCLIespC
+bne4BIUwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAgZn6odHr2y1G
+1OStblBdsXNxmsW7WzhLUYFUhSzBw9KS/O7uG2HAFLwJNM4sQHeuc0JjxqXG5n7s
+mGbmWpUYt8+KJDRnUssmKwwg2u6Rqp+0I9leCk9KTtYpXX7d9wprSsgwjQKhTEeQ
+fNImbNR6Br7GDO7Om2MnOALvZmp0KJgUFIH0J630LJTrsrTvwfX7wKhYb1wgud5N
+SXdGjBuJxKK3Y0VBMsbqwI0y+wHIYE+qLzlFWNRHmKaYeGtg0T8CVK6XWUrLcjcr
+rQINqW3rb1OlWF7YZ5dg7vXoZrza6YSQLWha6/FQMCaKtJHxIE1NBw0ZXK6txnkI
+f4HXoPvSGg==
+-----END CERTIFICATE-----
diff --git a/tests/auto/network/ssl/qdtls/certs/bogus-ca.key b/tests/auto/network/ssl/qdtls/certs/bogus-ca.key
new file mode 100644
index 0000000000..1c2db7932e
--- /dev/null
+++ b/tests/auto/network/ssl/qdtls/certs/bogus-ca.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEAnXt/X69lmfvWampP88f20yNs1VZroG9VjdR4GaJM6pbWu5Wn
+SYBfS81osnHC7dTW2FvKZUGnz7KX+ImkbE2qUvj6yTeFu6ILj3o+8ws7A4iOTkiH
+84CHb6T/HxWO5fW6mS5v+tvPDp3rQ7JpPVYvoh7dSv8X1+JCdDmkepRveN6Pzo47
+9VFVC0oscc5I4Y0wPwnaXZ4X26vmRfbhqtoKL57lz1lJ0R6bvLC9mf4DGFPx7WXQ
+eOtlKX2dtuKj+Cl3vyHff6gHNMKM0bq3KfsT+vDO6eIs/ayqVRdd0XBIMj+bZYd9
+7QI/+3XTNR3TwTisrjo71XZtHdA1DkcMaSGoJwIDAQABAoIBAGKkKmJq4L8UyXca
+ZD4UcHxL4i221e9GDVarURbtXDRMivAwivo1GHvIi93J+Ak0meYniJzoBQ7JlPsu
+a/kSpK8YGS3UQ0YF+CvErI1b6XkLHefW8qEJTswVk1+LB1jvFBRCzA1bhVRogiaD
+J/wtceSgZIhHRE4LAQj/2hCVzUTtV6Zr0GIJGjB7hdF9MHGlTwkPrkjvERlK/PTc
+dVjyNbinYGJNA2i701u/atplH2eSBUresMhHu3AZUUXZKfFQ2m07FDBNAtsoYNnO
+d17EXDaoQRDVWSP83GN4b/hpmngvHl1fuFBZ1ms375FNPQo/K33QBaUsLsqiIS/v
+k3LBkeECgYEAyqv5dkgte9c2mxT5zUQySr1fDms4nwZTth8477jRnOZND1M9VoIv
+1EjBfxq3y7gJVd34VWYeCxNBYwK8C45SDXtlU9X2hLeKWU6yfdegyxv950P5AahT
+J80YtYSez+mTLPOC42GeTg7l01NXlTHmPpraIkdNniHc8bqyAEK9w+kCgYEAxuuO
+Ln84GkAm1gr6gyFkOMVwVEfszKjRGIqp4BnSwM9bFgWvhyj4jpr+bpe4gQKQQE5q
+E/GoxYOtdZ3yYupd2Ki0irGhhm3u0ywgmbomurOw46AInONWcHTU6kZY/dd8wfvW
+8YcmFq/LNupwFOEw18mKaQXygMnUYci+uOSw0Y8CgYEAkcX0XjE4FdUL/6usqQme
+KsfesR5J0YfZeism5rXGftXfI2C5w5lMEaJrGqL7A9pRTKOlVLdocIrfAvoaiy1I
+s03H6e8Bqx/gsK+8DmujybNOgqMPXTPW68/HL/g9ykm0hCZ6RFYYaQiqIb/WRQdp
+FiqHLxSeLVkp8+xWz30xxNECgYAA7P23Z64qKRxFKL3ruE8QGJMiQUdv2GVIuPR7
+b4NUlGJ3IsWjWmR1vXDrsNcR+qITOoox15ESgj9facHEBhUzue1FK/h1eLOA1ha8
+wGoHumhbVtZTbJdtZI3NHVCytbsF6Bci/p8FwgGvGr40yquAhZaYUIfFY6sSXW3N
+zHqqLwKBgQCUGrePDhjjUZZNQya0TQZ95HL8OQB2e9bx8RwypYdC3pAZ6uDfl+Ne
+IZoA8EoDHVbsxDXmLTGil/kyvmYBnzvkVz/yMyFm/7I0zXEOr8bTgqE5wJ8BMGSp
+yil5jDoN28KL6D+HsDsWUEOvvHieDYP3cxfpZWiQuWIZ6gfDDVjIwQ==
+-----END RSA PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qdtls/certs/bogus-client.crt b/tests/auto/network/ssl/qdtls/certs/bogus-client.crt
new file mode 100644
index 0000000000..c9d43ce662
--- /dev/null
+++ b/tests/auto/network/ssl/qdtls/certs/bogus-client.crt
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIC/zCCAeegAwIBAgIBADANBgkqhkiG9w0BAQsFADAvMRowGAYDVQQKDBFCb2d1
+cyBDb3Jwb3JhdGlvbjERMA8GA1UEAwwIQm9ndXMgQ0EwIBcNMTUwMTMwMTczNTI0
+WhgPMjExNTAxMDYxNzM1MjRaMDMxGjAYBgNVBAoMEUJvZ3VzIENvcnBvcmF0aW9u
+MRUwEwYDVQQDDAxCb2d1cyBDbGllbnQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
+ggEKAoIBAQDa28y3b2qcrFTjr3GIgjx78qlbRZomBt/A//ZW5qx00+QXT30bu8F0
+jCfHaBTDSnabP86856C/kL1d6oRtc7jmaxNoj39uRh3NcV3VmFEiLI9XmJ0gOIBN
+vMQ0voi4gvRBzjFMnVOFML8FePV4OUX1QUZK4eAvZCsDhaJv1cCEERsfcttv7X31
+CT3+a3geZsb0cMDqicq/uaX2IONhqoNYwGlmgF+bWICIxJmEnaK3e/LnKKpvvfTt
+n2M0Fx0W4150HSZxQ9Iz6fQQ8oLNn3qNL5i9377XKpck2uxC39yt5WXK2d5m8xBF
+5+qwMMqlEW4LoE/dTU9mJ1lZLwV7m7QJAgMBAAGjIDAeMAkGA1UdEwQCMAAwEQYJ
+YIZIAYb4QgEBBAQDAgeAMA0GCSqGSIb3DQEBCwUAA4IBAQBBeGwXbU/WRLkfxDoI
+Js2nPqzpfEXAcrJhurHKlm/wMIHnHHhTM69O7yTl/VUdKIXPzC1bGkAiSBQo+51B
+SJkyWo3vt47g8rqAnUs4oM+bPD2t1YkJVeGLu+Nfw5SHlc+HdojdAcpKtnCbqtrd
+vnV4QyB70nxKXC3jmWVBu/jeim0RzUacO+lF9vRPqwnlDINopx8ZpEjaXxABtaQA
+cVUosFGEPRjOYAbw9j4fK7J7EXh/124j81OfawkfaMMDt2EedmSdlhPy+Io7VaBo
+ho+39cX/oO3Ek+C9v+4aGF7rgp3VyKOGtC5rIy+YiwjcI09pRVPuqEqXC6C4nQcS
+SjjF
+-----END CERTIFICATE-----
diff --git a/tests/auto/network/ssl/qdtls/certs/bogus-client.key b/tests/auto/network/ssl/qdtls/certs/bogus-client.key
new file mode 100644
index 0000000000..f676af73d4
--- /dev/null
+++ b/tests/auto/network/ssl/qdtls/certs/bogus-client.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEA2tvMt29qnKxU469xiII8e/KpW0WaJgbfwP/2VuasdNPkF099
+G7vBdIwnx2gUw0p2mz/OvOegv5C9XeqEbXO45msTaI9/bkYdzXFd1ZhRIiyPV5id
+IDiATbzENL6IuIL0Qc4xTJ1ThTC/BXj1eDlF9UFGSuHgL2QrA4Wib9XAhBEbH3Lb
+b+199Qk9/mt4HmbG9HDA6onKv7ml9iDjYaqDWMBpZoBfm1iAiMSZhJ2it3vy5yiq
+b7307Z9jNBcdFuNedB0mcUPSM+n0EPKCzZ96jS+Yvd++1yqXJNrsQt/creVlytne
+ZvMQRefqsDDKpRFuC6BP3U1PZidZWS8Fe5u0CQIDAQABAoIBAQDOzZlA0CgWiYTh
+bLvEOQQ8Pw0msLs7KY2vCm7UqL3W2w4RtMvMM/tWTMWd2EyeSLOQeZe5ysmLmpJF
+tz+RSSMzn4REbiwEoH6yzWfUWEx6FU8Rf6UheCJM0o04Jb59U0jJEbRl59eu6GPo
+IOcaxkvDtv1b7tnvDiDTACiAsqNqZhs54QlqwpadSYe4QgK9KH0WxqBzLpXr8eEq
+ZV1uuuNpaf+mitVaJhXHyVt7Od1yPfohbTYaXjko3xt3BcStt4tzRZkGQk2kjMWd
+d53wqcFlc+zxSW9/ogLr+TCDttTEa1oV+JLpXLkV5J0/saf/LYw96r6f98XhLrd1
+5otsbQ+dAoGBAP0nCzd6otnuUsLX+dz0ed61zDzyTVBXLxuOOvDpuPItVUKPI8yZ
+mwveIm97/4u50HGSWUgLR5v+ABfMVG/DqkEP50dDbIhQ2uBhkR5xVgSlZSiZ7S03
+1AErADaeViphKjfAuHraGgC6SRv8HBZadbYW+ZQRVTF6IRJmstiLNJIDAoGBAN1S
+AYtYhH0tJSQxyL+sdeuPGhY5RDdlSeLRAStpoGjmaOC4Rc8uDsts2xuInkCcTW2y
+nogoR5YxFvcly3vGL5kOzLuscLbueqkz/rbTlZPruqL7fMyPI7Y3YgGER5XNwPpE
++DlW1fu2aE42WUU49mkUNaT2WBtOLnbZKShAWKoDAoGAOGZfeF/JMnaHV8OYdmK9
+WCH2u8lb8j9KToBUn2HjA4mYCjkrx6SdR3qY/2+H0pB2YScy3vssXBOt3591XGUi
+ZFZvt4/M+V3SNdVm6HplqKlUrUQF9GIQyKXU6VZDajO1nTBBqZU339ug+Cwl8dD7
+krLxrcxix6AnCBt7UwVIlBMCgYEAydQADogxgknKJiC0Vn86pg9BFeUxXWckIxDA
+hUt0+lSsbcn993qkCUUC5zAGSRuAzLnoMnixF7k6nTW9Q+mu/GBvufH+dAQ0ndsJ
+vMZlEJkXAYxf+dfLFF+bI5DzCxywkEqXJwsWZs6ofjK35BWXOKoyZXY1UOlSHBXb
+n5ZWhOsCgYBRLqEjUehkZfqjZj8VClyPQ/6bAgtfjMRqpgsLgvqG9gBraDs4DXJr
+K8Ac3+vCP8rqVwIUC0iu/5MFX75WJ7Go7wbAg7m91P9tmzSiLEm5H1toXJpla6nv
+oLZW+jN9O1BaVow8f2qIEJMjHnDbuZnMPQlMGUD+g2tNgczfxT3MOA==
+-----END RSA PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qdtls/certs/bogus-server.crt b/tests/auto/network/ssl/qdtls/certs/bogus-server.crt
new file mode 100644
index 0000000000..7e59f6128d
--- /dev/null
+++ b/tests/auto/network/ssl/qdtls/certs/bogus-server.crt
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIC/zCCAeegAwIBAgIBATANBgkqhkiG9w0BAQsFADAvMRowGAYDVQQKDBFCb2d1
+cyBDb3Jwb3JhdGlvbjERMA8GA1UEAwwIQm9ndXMgQ0EwIBcNMTUwMTMxMTc0MjI3
+WhgPMjExNTAxMDcxNzQyMjdaMDMxGjAYBgNVBAoMEUJvZ3VzIENvcnBvcmF0aW9u
+MRUwEwYDVQQDDAxCb2d1cyBTZXJ2ZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
+ggEKAoIBAQCv899JQxy/mpaQzscopmoKOkgbmwGwty1KiTpT09MU1+gtMHCfhmVp
+nAiNIlQlDa+5mjhvyy1fSf+mgdjnvT5pdUAro633gfCv318EViwYsvA7/0ZumFqU
+UyPWw4/2of/ZfJv2ewzMLoYEDKiLcXxInBsMlt5Lr7IBS8SNitDU+TAM7HLEIkMz
+c0JpxY09H707tO8G3e93yfB5l8H+JdeEdPe+7PDfnsZZuMmaImiNYRByPTTuGvrN
+I9I+OxcE4ZOMMNb3mzAoEFnyfHiCO2ehHl58y0a49ayAKJdP/FV3n2LtL/Zc5Ilq
+b3VJgaShevrfIiItURjOAjDA9B95hYuZAgMBAAGjIDAeMAkGA1UdEwQCMAAwEQYJ
+YIZIAYb4QgEBBAQDAgZAMA0GCSqGSIb3DQEBCwUAA4IBAQBhTqwD3HxamZGopq0K
+r8KUdtliiPwo4GBFp0zg6VdSxo01WfpwFGOaeKNmV0JadtJ1DhcsdIUv2OvrxiWQ
+1n0IGHULeazQnst1q1t/Vlup3IggKTGCLi8yd3acY8tr2wj9lGjWhsR+BcrCUTEB
+BCpIsQiFA8+PTf/8SHuzMokDBP+j02fWCqwR749H4NDQgqrFsgzxLDA69XgvkNM3
++HOsOR/QxeYIp54mqPnsNVhzV0JbpQpF4j9R5kMI/bsPmWH6W0GbSSyA07o8iVw7
+eqPbwHnIlHXzafvaGmF0QituAzU0nPgMc9OMxuoqacBSmSvmSdMmh///vr7O2KHO
+7s+g
+-----END CERTIFICATE-----
diff --git a/tests/auto/network/ssl/qdtls/certs/bogus-server.key b/tests/auto/network/ssl/qdtls/certs/bogus-server.key
new file mode 100644
index 0000000000..bda8dae678
--- /dev/null
+++ b/tests/auto/network/ssl/qdtls/certs/bogus-server.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEAr/PfSUMcv5qWkM7HKKZqCjpIG5sBsLctSok6U9PTFNfoLTBw
+n4ZlaZwIjSJUJQ2vuZo4b8stX0n/poHY570+aXVAK6Ot94Hwr99fBFYsGLLwO/9G
+bphalFMj1sOP9qH/2Xyb9nsMzC6GBAyoi3F8SJwbDJbeS6+yAUvEjYrQ1PkwDOxy
+xCJDM3NCacWNPR+9O7TvBt3vd8nweZfB/iXXhHT3vuzw357GWbjJmiJojWEQcj00
+7hr6zSPSPjsXBOGTjDDW95swKBBZ8nx4gjtnoR5efMtGuPWsgCiXT/xVd59i7S/2
+XOSJam91SYGkoXr63yIiLVEYzgIwwPQfeYWLmQIDAQABAoIBAHVRJJLjpZp3h2a8
+CHypIND69TM60hCywgcNoo9cEES4hL0ErEMhSCL3f5giyHoAOyeElZasoO8FFuk9
+cJNrUd7c59FxDECYKhQJ2n+4uSQqwxUt6xc4jESTfrTmpemrMD0h4ZehifHmH0M5
+8XMwUs7TDxIA0e0jE4vbqg05/m3RMHoeJ4W5K4dMxkJbjmyjjCr8aT8WP/KSTABS
+YQPql0rs6WL5Q2s1I/i3I4qIS4CKk8Ym7O5/Wk1fxbCh2ABL2PhW8PZDzvsFYo2T
+cwX0cc0EILBc3tOG11Iua6mK8y9Zz1BpUT02ZvGaPf9R6vI0Shk1yWbZ0NYLx0MH
+Zu8HIYECgYEA5awzjNcnDYQY9f6C/0TNj54Z8I7UFmGJX7XhPVVMceNieUiLvrsH
+Zmf4Q51PLM1iz0S2qGA/c7lngHDXwFe++MANIK7KNwL2LtPF/83mYgBUxBKJaNHD
+4B/6CCitjSwAfMNBnE70zg0F9chqy+9p+fTEwUFW6Y4y9U5jO4kw5HECgYEAxB8+
+YYMUGeIt9TnMKrC2YK/o8jo+5ZEOpEIPwleeAIUMujVVonu3TX2nKos2MgaZg/F0
+OpvDlcQZqb4Em73ctf3ZgBYEs9tt2qdB5qGlg4Hs2wyfgKUPQGLX2RseUQCYsOWT
+cPPKvYDTZ6yhW6gGBd5ufl5tnG93CsIpcNV1DakCgYEAwByZhi6V4Q1k36eDpcjE
+dWRW6ExghVQS17dIb8hAyGbeAPs4wVKqbvN6y/vytVQbWapta0wO51rng51gKuh6
+upHSqUrrpLZafHLyBPYSxljmjpe+zqnfwUKeH2L/QL3UroeZAwlcZlqoaJ27D1j0
++XrPdaOU8onagCyQfsVT21ECgYAafW3blezdIiO6/7eH/J5lqNz5+swMDe/AV/vw
+8AyzXUU+0X1jmPpFSTePE4aaczHBFJfyYp+kVvxwZO4Say6olkUOe+resEDCS90m
+3aaRgLcRTz8sDR9mPvOQq40Iu9/j5N5pX0R/HCtx0WtqCePmXwjloLOFcbjOhzM5
+vls1IQKBgEF8DEk8T4ycjwBXC3U7Duj9jPL815417BAHdGstLP1yNcI05ubN2T56
+ITbf625YS7OdtYfrf1/jBnUVXsJspsQqkOUB97M224CVWI+vJiv8jPX+KCnR7/Zh
+A/7OrtZ6FCzLyBeu/2p1NHAttqSUqu9t6wCeeBcelnAUcrjfLmlw
+-----END RSA PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qdtls/certs/fake-login.live.com.key b/tests/auto/network/ssl/qdtls/certs/fake-login.live.com.key
new file mode 100644
index 0000000000..692a7bd85d
--- /dev/null
+++ b/tests/auto/network/ssl/qdtls/certs/fake-login.live.com.key
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQDOtxdvMa0VHUQYG5q7Tsi1Jj4qKEJppyZEkmuRXOi0fDbd1SwE
+bwHrLGMvDO6OMrYBbq3WDNrtnIfF9CvzUOEch+gjr4hEVQqecU5fb45Wor7yNel3
+/C/gxfbzuXHrsj/gUjNghL2i10+c2NW+hUo/sWO6OusaBT6d6s7ee+YBcQIDAQAB
+AoGAb8cVhu0HuLkgjyCuJMbPRRUu3ED02Iin6sB6JhplQuNAD+grayJTmUVhRJnr
+jTziqhedLHe7Em1oBaSo92MutfMpXvWiccSlbNygI61VgmrJpVB+qIN5H9cQc9ql
+Zymc+nIPa1+i5rsrOzlpUytTh7AsbZ27QG4tQXR/kQejEiECQQD6BgTxBeT8D7x9
+DuukoBaSCkLwx7U7P1NXx15EI3lA1nO51t6UHfvk/jGPp8Sl4wv4alJ7AQxr5uQ/
+vC3kzA/1AkEA06gNu10se8pe3n8qL2RRt+FmVjHkQdD9Mm2Dx9oWCs2A4wOSOrlo
+6/nKYF1CaQNYn9HgsNbHVEUpnICVO18qDQJBALEw/uOJ1+TDikPfBSWgxx4s45Ad
+GNWqZXh6NNZ5hX9r/IwiOZAjR9fcRmeW8IjYRi2BvH6sGY+HDRAWXzgdXtkCQCma
+dOiJTf8fLjqp4E7kdzOfuI/kyqstOze4Uxjrgz2oW1dEEnA8laUcumzqp+0gXUE8
+7d+UuCWWWrGKjMrYz9kCQQDh5E5+b6Djn082Jo6gvyuXWC5eXju6IdmihlJ2SMzD
+s2y3IDjOUtTeQQRDymLneteMz0ha79KeUp6VnAvZCOVe
+-----END RSA PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qdtls/certs/fake-login.live.com.pem b/tests/auto/network/ssl/qdtls/certs/fake-login.live.com.pem
new file mode 100644
index 0000000000..429f95187c
--- /dev/null
+++ b/tests/auto/network/ssl/qdtls/certs/fake-login.live.com.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDDjCCAnegAwIBAgIRALC3Ez7Qlvm1b66RyHS9OsAwDQYJKoZIhvcNAQEFBQAw
+XjELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNVBAoTGElu
+dGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEXMBUGA1UEAxMObG9naW4ubGl2ZS5jb20w
+HhcNMTEwMzI1MTMyODUwWhcNMTEwNDI0MTMyODUwWjBeMQswCQYDVQQGEwJBVTET
+MBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQ
+dHkgTHRkMRcwFQYDVQQDEw5sb2dpbi5saXZlLmNvbTCBnzANBgkqhkiG9w0BAQEF
+AAOBjQAwgYkCgYEAzrcXbzGtFR1EGBuau07ItSY+KihCaacmRJJrkVzotHw23dUs
+BG8B6yxjLwzujjK2AW6t1gza7ZyHxfQr81DhHIfoI6+IRFUKnnFOX2+OVqK+8jXp
+d/wv4MX287lx67I/4FIzYIS9otdPnNjVvoVKP7FjujrrGgU+nerO3nvmAXECAwEA
+AaOByzCByDAdBgNVHQ4EFgQUpSOEcmtkQITvBdM2IDfcXnJ0FCAwgZgGA1UdIwSB
+kDCBjYAUpSOEcmtkQITvBdM2IDfcXnJ0FCChYqRgMF4xCzAJBgNVBAYTAkFVMRMw
+EQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0
+eSBMdGQxFzAVBgNVBAMTDmxvZ2luLmxpdmUuY29tghEAsLcTPtCW+bVvrpHIdL06
+wDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAD+2HT4GSHHKCdbl9VkX
+zsl+D+drMm2b0ksxz9SgPihP7aW50EEIJDEEihNMTa27mhpeOXHc/sLqDi4ECUao
+/0Ns/5uoVuAIrAKCydmtPsonVFh9XWjyrfUzPOHAc9p2bmJ1i9a3kTsLB6jlrVDO
+VufGzsowHlHZ0TtKf5omojU5
+-----END CERTIFICATE-----
diff --git a/tests/auto/network/ssl/qdtls/certs/fluke.cert b/tests/auto/network/ssl/qdtls/certs/fluke.cert
new file mode 100644
index 0000000000..ace4e4f0eb
--- /dev/null
+++ b/tests/auto/network/ssl/qdtls/certs/fluke.cert
@@ -0,0 +1,75 @@
+Certificate:
+ Data:
+ Version: 3 (0x2)
+ Serial Number: 0 (0x0)
+ Signature Algorithm: sha1WithRSAEncryption
+ Issuer: C=NO, ST=Oslo, L=Nydalen, O=Nokia Corporation and/or its subsidiary(-ies), OU=Development, CN=fluke.troll.no/emailAddress=ahanssen@trolltech.com
+ Validity
+ Not Before: Dec 4 01:10:32 2007 GMT
+ Not After : Apr 21 01:10:32 2035 GMT
+ Subject: C=NO, ST=Oslo, O=Nokia Corporation and/or its subsidiary(-ies), OU=Development, CN=fluke.troll.no
+ Subject Public Key Info:
+ Public Key Algorithm: rsaEncryption
+ RSA Public Key: (1024 bit)
+ Modulus (1024 bit):
+ 00:a7:c8:a0:4a:c4:19:05:1b:66:ba:32:e2:d2:f1:
+ 1c:6f:17:82:e4:39:2e:01:51:90:db:04:34:32:11:
+ 21:c2:0d:6f:59:d8:53:90:54:3f:83:8f:a9:d3:b3:
+ d5:ee:1a:9b:80:ae:c3:25:c9:5e:a5:af:4b:60:05:
+ aa:a0:d1:91:01:1f:ca:04:83:e3:58:1c:99:32:45:
+ 84:70:72:58:03:98:4a:63:8b:41:f5:08:49:d2:91:
+ 02:60:6b:e4:64:fe:dd:a0:aa:74:08:e9:34:4c:91:
+ 5f:12:3d:37:4d:54:2c:ad:7f:5b:98:60:36:02:8c:
+ 3b:f6:45:f3:27:6a:9b:94:9d
+ Exponent: 65537 (0x10001)
+ X509v3 extensions:
+ X509v3 Basic Constraints:
+ CA:FALSE
+ Netscape Comment:
+ OpenSSL Generated Certificate
+ X509v3 Subject Key Identifier:
+ 21:85:04:3D:23:01:66:E5:F7:9F:1A:84:24:8A:AF:0A:79:F4:E5:AC
+ X509v3 Authority Key Identifier:
+ DirName:/C=NO/ST=Oslo/L=Nydalen/O=Nokia Corporation and/or its subsidiary(-ies)/OU=Development/CN=fluke.troll.no/emailAddress=ahanssen@trolltech.com
+ serial:8E:A8:B4:E8:91:B7:54:2E
+
+ Signature Algorithm: sha1WithRSAEncryption
+ 6d:57:5f:d1:05:43:f0:62:05:ec:2a:71:a5:dc:19:08:f2:c4:
+ a6:bd:bb:25:d9:ca:89:01:0e:e4:cf:1f:c1:8c:c8:24:18:35:
+ 53:59:7b:c0:43:b4:32:e6:98:b2:a6:ef:15:05:0b:48:5f:e1:
+ a0:0c:97:a9:a1:77:d8:35:18:30:bc:a9:8f:d3:b7:54:c7:f1:
+ a9:9e:5d:e6:19:bf:f6:3c:5b:2b:d8:e4:3e:62:18:88:8b:d3:
+ 24:e1:40:9b:0c:e6:29:16:62:ab:ea:05:24:70:36:aa:55:93:
+ ef:02:81:1b:23:10:a2:04:eb:56:95:75:fc:f8:94:b1:5d:42:
+ c5:3f:36:44:85:5d:3a:2e:90:46:8a:a2:b9:6f:87:ae:0c:15:
+ 40:19:31:90:fc:3b:25:bb:ae:f1:66:13:0d:85:90:d9:49:34:
+ 8f:f2:5d:f9:7a:db:4d:5d:27:f6:76:9d:35:8c:06:a6:4c:a3:
+ b1:b2:b6:6f:1d:d7:a3:00:fd:72:eb:9e:ea:44:a1:af:21:34:
+ 7d:c7:42:e2:49:91:19:8b:c0:ad:ba:82:80:a8:71:70:f4:35:
+ 31:91:63:84:20:95:e9:60:af:64:8b:cc:ff:3d:8a:76:74:3d:
+ c8:55:6d:e4:8e:c3:2b:1c:e8:42:18:ae:9f:e6:6b:9c:34:06:
+ ec:6a:f2:c3
+-----BEGIN CERTIFICATE-----
+MIIEEzCCAvugAwIBAgIBADANBgkqhkiG9w0BAQUFADCBnDELMAkGA1UEBhMCTk8x
+DTALBgNVBAgTBE9zbG8xEDAOBgNVBAcTB055ZGFsZW4xFjAUBgNVBAoTDVRyb2xs
+dGVjaCBBU0ExFDASBgNVBAsTC0RldmVsb3BtZW50MRcwFQYDVQQDEw5mbHVrZS50
+cm9sbC5ubzElMCMGCSqGSIb3DQEJARYWYWhhbnNzZW5AdHJvbGx0ZWNoLmNvbTAe
+Fw0wNzEyMDQwMTEwMzJaFw0zNTA0MjEwMTEwMzJaMGMxCzAJBgNVBAYTAk5PMQ0w
+CwYDVQQIEwRPc2xvMRYwFAYDVQQKEw1Ucm9sbHRlY2ggQVNBMRQwEgYDVQQLEwtE
+ZXZlbG9wbWVudDEXMBUGA1UEAxMOZmx1a2UudHJvbGwubm8wgZ8wDQYJKoZIhvcN
+AQEBBQADgY0AMIGJAoGBAKfIoErEGQUbZroy4tLxHG8XguQ5LgFRkNsENDIRIcIN
+b1nYU5BUP4OPqdOz1e4am4CuwyXJXqWvS2AFqqDRkQEfygSD41gcmTJFhHByWAOY
+SmOLQfUISdKRAmBr5GT+3aCqdAjpNEyRXxI9N01ULK1/W5hgNgKMO/ZF8ydqm5Sd
+AgMBAAGjggEaMIIBFjAJBgNVHRMEAjAAMCwGCWCGSAGG+EIBDQQfFh1PcGVuU1NM
+IEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUIYUEPSMBZuX3nxqEJIqv
+Cnn05awwgbsGA1UdIwSBszCBsKGBoqSBnzCBnDELMAkGA1UEBhMCTk8xDTALBgNV
+BAgTBE9zbG8xEDAOBgNVBAcTB055ZGFsZW4xFjAUBgNVBAoTDVRyb2xsdGVjaCBB
+U0ExFDASBgNVBAsTC0RldmVsb3BtZW50MRcwFQYDVQQDEw5mbHVrZS50cm9sbC5u
+bzElMCMGCSqGSIb3DQEJARYWYWhhbnNzZW5AdHJvbGx0ZWNoLmNvbYIJAI6otOiR
+t1QuMA0GCSqGSIb3DQEBBQUAA4IBAQBtV1/RBUPwYgXsKnGl3BkI8sSmvbsl2cqJ
+AQ7kzx/BjMgkGDVTWXvAQ7Qy5piypu8VBQtIX+GgDJepoXfYNRgwvKmP07dUx/Gp
+nl3mGb/2PFsr2OQ+YhiIi9Mk4UCbDOYpFmKr6gUkcDaqVZPvAoEbIxCiBOtWlXX8
++JSxXULFPzZEhV06LpBGiqK5b4euDBVAGTGQ/Dslu67xZhMNhZDZSTSP8l35ettN
+XSf2dp01jAamTKOxsrZvHdejAP1y657qRKGvITR9x0LiSZEZi8CtuoKAqHFw9DUx
+kWOEIJXpYK9ki8z/PYp2dD3IVW3kjsMrHOhCGK6f5mucNAbsavLD
+-----END CERTIFICATE-----
diff --git a/tests/auto/network/ssl/qdtls/certs/fluke.key b/tests/auto/network/ssl/qdtls/certs/fluke.key
new file mode 100644
index 0000000000..9d1664d609
--- /dev/null
+++ b/tests/auto/network/ssl/qdtls/certs/fluke.key
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXAIBAAKBgQCnyKBKxBkFG2a6MuLS8RxvF4LkOS4BUZDbBDQyESHCDW9Z2FOQ
+VD+Dj6nTs9XuGpuArsMlyV6lr0tgBaqg0ZEBH8oEg+NYHJkyRYRwclgDmEpji0H1
+CEnSkQJga+Rk/t2gqnQI6TRMkV8SPTdNVCytf1uYYDYCjDv2RfMnapuUnQIDAQAB
+AoGANFzLkanTeSGNFM0uttBipFT9F4a00dqHz6JnO7zXAT26I5r8sU1pqQBb6uLz
+/+Qz5Zwk8RUAQcsMRgJetuPQUb0JZjF6Duv24hNazqXBCu7AZzUenjafwmKC/8ri
+KpX3fTwqzfzi//FKGgbXQ80yykSSliDL3kn/drATxsLCgQECQQDXhEFWLJ0vVZ1s
+1Ekf+3NITE+DR16X+LQ4W6vyEHAjTbaNWtcTKdAWLA2l6N4WAAPYSi6awm+zMxx4
+VomVTsjdAkEAx0z+e7natLeFcrrq8pbU+wa6SAP1VfhQWKitxL1e7u/QO90NCpxE
+oQYKzMkmmpOOFjQwEMAy1dvFMbm4LHlewQJAC/ksDBaUcQHHqjktCtrUb8rVjAyW
+A8lscckeB2fEYyG5J6dJVaY4ClNOOs5yMDS2Afk1F6H/xKvtQ/5CzInA/QJATDub
+K+BPU8jO9q+gpuIi3VIZdupssVGmCgObVCHLakG4uO04y9IyPhV9lA9tALtoIf4c
+VIvv5fWGXBrZ48kZAQJBAJmVCdzQxd9LZI5vxijUCj5EI4e+x5DRqVUvyP8KCZrC
+AiNyoDP85T+hBZaSXK3aYGpVwelyj3bvo1GrTNwNWLw=
+-----END RSA PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qdtls/certs/ss-srv-cert.pem b/tests/auto/network/ssl/qdtls/certs/ss-srv-cert.pem
new file mode 100644
index 0000000000..2c3d2e180d
--- /dev/null
+++ b/tests/auto/network/ssl/qdtls/certs/ss-srv-cert.pem
@@ -0,0 +1,18 @@
+-----BEGIN CERTIFICATE-----
+MIIC5TCCAk6gAwIBAgIJAP0E+KApnERsMA0GCSqGSIb3DQEBCwUAMIGJMQswCQYD
+VQQGEwJOTzENMAsGA1UECAwET3NsbzENMAsGA1UEBwwET3NsbzELMAkGA1UECgwC
+UXQxHzAdBgNVBAsMFlImRCAoQ29yZSBhbmQgTmV0d29yaykxEDAOBgNVBAMMB2Jv
+Yi5vcmcxHDAaBgkqhkiG9w0BCQEWDWJvYkBnbWFpbC5jb20wHhcNMTgwNDI2MDgw
+NDAxWhcNMjgwNDIzMDgwNDAxWjCBiTELMAkGA1UEBhMCTk8xDTALBgNVBAgMBE9z
+bG8xDTALBgNVBAcMBE9zbG8xCzAJBgNVBAoMAlF0MR8wHQYDVQQLDBZSJkQgKENv
+cmUgYW5kIE5ldHdvcmspMRAwDgYDVQQDDAdib2Iub3JnMRwwGgYJKoZIhvcNAQkB
+Fg1ib2JAZ21haWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDWSh+1
+Xp5l3MgpzfTtiiuT4jMh8uQug/N7fyZlo+obMarT51dYWt1L5yFYyPw92FCtWgTi
+rWFUh6Z8O/wIRkLRd/meKAqQsqRMnEVt4WSE9fA41XecWw1FJl2Ehwnl2C3Nj3GF
+XonG+4Wg5EzH7JGEUUQIGQnuUTj06BkHLq0R8QIDAQABo1MwUTAdBgNVHQ4EFgQU
+TRydf45RdKVcjhzNUYgfNq4f/W8wHwYDVR0jBBgwFoAUTRydf45RdKVcjhzNUYgf
+Nq4f/W8wDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOBgQAsn1aZTcZU
+4qD+ciziSYFM0Qk1GTCHtWf5nufB35AyuUqOK3h6QgRHovvNm+IMJIPMlnnwj5gF
+G8UZ6mCYBUQPBuofZz8+XEL+N0QtvzUXA2/jVKn2TkcSvFXV90juC9KfhGhM93kQ
+1R3qNPgxkuQqteffCbUyWnugv3/axNCjsQ==
+-----END CERTIFICATE-----
diff --git a/tests/auto/network/ssl/qdtls/certs/ss-srv-key.pem b/tests/auto/network/ssl/qdtls/certs/ss-srv-key.pem
new file mode 100644
index 0000000000..c2d912bf4d
--- /dev/null
+++ b/tests/auto/network/ssl/qdtls/certs/ss-srv-key.pem
@@ -0,0 +1,18 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIC1DBOBgkqhkiG9w0BBQ0wQTApBgkqhkiG9w0BBQwwHAQIBoCUfXYbG50CAggA
+MAwGCCqGSIb3DQIJBQAwFAYIKoZIhvcNAwcECHsb5ejBIDukBIICgFiMs6LbW0L4
+fxGDVNQWEbWf+1h4HJZsetWVqX5kh+9R3yfvK6vMVI5EQZ3mm8t5NDIKRFON6dN/
+uKGvZA+4vR6Vc5yeOOzL6sC8NsIU6eJOzkxXdyBahBHORm51dJCRtCdsoaWnx00I
+jEAIvdv/dWh+kx9iMF6cZeOvIXbdVPuadjeh62cjPU/zyZSKCFd59zqWRMvIMIIM
+kUOy2In5dVBb8/W9Zz0S8OG7KRJ+KdxxR5ev324L70XtRbb/tDVnGuMz+K83xbQC
+ySJgIEvaz9lmhFeWiJ9HPGqcYtMAUUk4XgF5mcQDete8uCndDnxCy3uCyNxWtIm3
+dXRYzWZh+nbsbjYQWT3Lo3z3zkchB8vNDBfVcp6m0nx7spaUFlptrXujYKU9VQTK
+2vAMhT9uUstLaHm+TEI1SuDBeugbvxy1DNI5lEQ3SG50L8r0m/OuQkV9zPVreHLX
+nJdx7POS69WW+yac2SJX9mMSXICksLvaSGxSnFf1hMyozIp3xM4jGsxV+ckGw2I/
+CNUW2QHMuJ2/AvZo8cJY5iwbRgCaewAKkUiPZbGMDLeRapm9nrRFyTkLGyjI+4wG
+wByzJ8ZZ2IlnZexXbcs0o8qoFmUxgA2R5Q3AvDYAg9/XGWtRcbIOhly4gRv4B/OF
+pWfqYrCK6ZbTNSNZNifMDJfjx5T9qSnnLbAZRjuVwOgvqWTcBZpzpn97YS7XnsrU
+5qMOiaP+VgpWeO2Fcf5zq9CJaBLO8sBUWWJW7mPgrOpxbBOio6x1GbRMT2niOiPN
+wSXWPfw5Kp/P43ORJEttudEGJYpIMAzZ88hmF2j8n3hGC9FHAw5RGaV+3vsonsZq
+iwE2rYxs3RI=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qdtls/qdtls.pro b/tests/auto/network/ssl/qdtls/qdtls.pro
new file mode 100644
index 0000000000..19e13a965c
--- /dev/null
+++ b/tests/auto/network/ssl/qdtls/qdtls.pro
@@ -0,0 +1,16 @@
+CONFIG += testcase
+
+SOURCES += tst_qdtls.cpp
+QT = core network-private testlib
+
+TARGET = tst_qdtls
+
+win32 {
+ CONFIG(debug, debug|release) {
+ DESTDIR = debug
+ } else {
+ DESTDIR = release
+ }
+}
+
+TESTDATA += certs
diff --git a/tests/auto/network/ssl/qdtls/tst_qdtls.cpp b/tests/auto/network/ssl/qdtls/tst_qdtls.cpp
new file mode 100644
index 0000000000..6a94eee389
--- /dev/null
+++ b/tests/auto/network/ssl/qdtls/tst_qdtls.cpp
@@ -0,0 +1,1324 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+
+#include <QtNetwork/qsslpresharedkeyauthenticator.h>
+#include <QtNetwork/qsslconfiguration.h>
+#include <QtNetwork/qhostaddress.h>
+#include <QtNetwork/qsslsocket.h>
+#include <QtNetwork/qsslcipher.h>
+#include <QtNetwork/qudpsocket.h>
+#include <QtNetwork/qsslerror.h>
+#include <QtNetwork/qsslkey.h>
+#include <QtNetwork/qdtls.h>
+#include <QtNetwork/qssl.h>
+
+#include <QtCore/qcryptographichash.h>
+#include <QtCore/qbytearray.h>
+#include <QtCore/qvector.h>
+#include <QtCore/qstring.h>
+#include <QtCore/qobject.h>
+
+#include <algorithm>
+
+QT_BEGIN_NAMESPACE
+
+namespace
+{
+
+bool dtlsErrorIsCleared(const QDtls &dtls)
+{
+ return dtls.dtlsError() == QDtlsError::NoError && dtls.dtlsErrorString().isEmpty();
+}
+
+using DtlsPtr = QScopedPointer<QDtls>;
+
+bool dtlsErrorIsCleared(DtlsPtr &dtls)
+{
+ return dtlsErrorIsCleared(*dtls);
+}
+
+} // unnamed namespace
+
+#define QDTLS_VERIFY_NO_ERROR(obj) QVERIFY(dtlsErrorIsCleared(obj))
+
+#define QDTLS_VERIFY_HANDSHAKE_SUCCESS(obj) \
+ QVERIFY(obj->isConnectionEncrypted()); \
+ QCOMPARE(obj->handshakeState(), QDtls::HandshakeComplete); \
+ QDTLS_VERIFY_NO_ERROR(obj); \
+ QCOMPARE(obj->peerVerificationErrors().size(), 0)
+
+class tst_QDtls : public QObject
+{
+ Q_OBJECT
+
+public slots:
+ void initTestCase();
+ void init();
+
+private slots:
+ // Tests:
+ void construction_data();
+ void construction();
+ void configuration_data();
+ void configuration();
+ void invalidConfiguration();
+ void setPeer_data();
+ void setPeer();
+ void handshake_data();
+ void handshake();
+ void handshakeWithRetransmission();
+ void sessionCipher();
+ void cipherPreferences_data();
+ void cipherPreferences();
+ void protocolVersionMatching_data();
+ void protocolVersionMatching();
+ void verificationErrors_data();
+ void verificationErrors();
+ void presetExpectedErrors_data();
+ void presetExpectedErrors();
+ void verifyServerCertificate_data();
+ void verifyServerCertificate();
+ void verifyClientCertificate_data();
+ void verifyClientCertificate();
+ void blacklistedCerificate();
+ void readWriteEncrypted_data();
+ void readWriteEncrypted();
+ void datagramFragmentation();
+
+protected slots:
+ void handshakeReadyRead();
+ void encryptedReadyRead();
+ void pskRequested(QSslPreSharedKeyAuthenticator *auth);
+ void handleHandshakeTimeout();
+
+private:
+ void clientServerData();
+ void connectHandshakeReadingSlots();
+ void connectEncryptedReadingSlots();
+ bool verificationErrorDetected(QSslError::SslError code) const;
+
+ static QHostAddress toNonAny(const QHostAddress &addr);
+
+ QUdpSocket serverSocket;
+ QHostAddress serverAddress;
+ quint16 serverPort = 0;
+ QSslConfiguration defaultServerConfig;
+ QSslCertificate selfSignedCert;
+ QString hostName;
+ QSslKey serverKeySS;
+ bool serverDropDgram = false;
+ const QByteArray serverExpectedPlainText = "Hello W ... hmm, I mean DTLS server!";
+ QByteArray serverReceivedPlainText;
+
+ QUdpSocket clientSocket;
+ QHostAddress clientAddress;
+ quint16 clientPort = 0;
+ bool clientDropDgram = false;
+ const QByteArray clientExpectedPlainText = "Hello DTLS client.";
+ QByteArray clientReceivedPlainText;
+
+ DtlsPtr serverCrypto;
+ DtlsPtr clientCrypto;
+
+ QTestEventLoop testLoop;
+ const int handshakeTimeoutMS = 5000;
+ const int dataExchangeTimeoutMS = 1000;
+
+ const QByteArray presharedKey = "DEADBEEFDEADBEEF";
+ QString certDirPath;
+};
+
+QT_END_NAMESPACE
+
+Q_DECLARE_METATYPE(QSsl::SslProtocol)
+Q_DECLARE_METATYPE(QSslSocket::SslMode)
+Q_DECLARE_METATYPE(QSslSocket::PeerVerifyMode)
+Q_DECLARE_METATYPE(QList<QSslCertificate>)
+Q_DECLARE_METATYPE(QSslKey)
+Q_DECLARE_METATYPE(QVector<QSslError>)
+
+QT_BEGIN_NAMESPACE
+
+void tst_QDtls::initTestCase()
+{
+ certDirPath = QFileInfo(QFINDTESTDATA("certs")).absolutePath();
+ QVERIFY(certDirPath.size() > 0);
+ certDirPath += QDir::separator() + QStringLiteral("certs") + QDir::separator();
+
+ QVERIFY(QSslSocket::supportsSsl());
+
+ QFile keyFile(certDirPath + QStringLiteral("ss-srv-key.pem"));
+ QVERIFY(keyFile.open(QIODevice::ReadOnly));
+ serverKeySS = QSslKey(keyFile.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey, "foobar");
+ QVERIFY(!serverKeySS.isNull());
+
+ QList<QSslCertificate> certificates = QSslCertificate::fromPath(certDirPath + QStringLiteral("ss-srv-cert.pem"));
+ QVERIFY(!certificates.isEmpty());
+ QVERIFY(!certificates.first().isNull());
+ selfSignedCert = certificates.first();
+
+ defaultServerConfig = QSslConfiguration::defaultDtlsConfiguration();
+ defaultServerConfig.setPeerVerifyMode(QSslSocket::VerifyNone);
+ defaultServerConfig.setDtlsCookieVerificationEnabled(false);
+
+ hostName = QStringLiteral("bob.org");
+}
+
+void tst_QDtls::init()
+{
+ if (serverSocket.state() != QAbstractSocket::UnconnectedState) {
+ serverSocket.close();
+ // disconnect signals/slots:
+ serverSocket.disconnect();
+ }
+
+ QVERIFY(serverSocket.bind());
+ serverAddress = toNonAny(serverSocket.localAddress());
+ serverPort = serverSocket.localPort();
+
+ if (clientSocket.localPort()) {
+ clientSocket.close();
+ // disconnect signals/slots:
+ clientSocket.disconnect();
+ }
+
+ clientAddress = {};
+ clientPort = 0;
+
+ serverCrypto.reset(new QDtls(QSslSocket::SslServerMode));
+ serverDropDgram = false;
+ serverReceivedPlainText.clear();
+
+ clientCrypto.reset(new QDtls(QSslSocket::SslClientMode));
+ clientDropDgram = false;
+ clientReceivedPlainText.clear();
+
+ connect(clientCrypto.data(), &QDtls::handshakeTimeout,
+ this, &tst_QDtls::handleHandshakeTimeout);
+ connect(serverCrypto.data(), &QDtls::handshakeTimeout,
+ this, &tst_QDtls::handleHandshakeTimeout);
+}
+
+void tst_QDtls::construction_data()
+{
+ clientServerData();
+}
+
+void tst_QDtls::construction()
+{
+ QFETCH(const QSslSocket::SslMode, mode);
+
+ QDtls dtls(mode);
+ QCOMPARE(dtls.peerAddress(), QHostAddress());
+ QCOMPARE(dtls.peerPort(), quint16());
+ QCOMPARE(dtls.peerVerificationName(), QString());
+ QCOMPARE(dtls.sslMode(), mode);
+
+ QCOMPARE(dtls.mtuHint(), quint16());
+
+ const auto params = dtls.cookieGeneratorParameters();
+ QVERIFY(params.secret.size() > 0);
+#ifdef QT_CRYPTOGRAPHICHASH_ONLY_SHA1
+ QCOMPARE(params.hash, QCryptographicHash::Sha1);
+#else
+ QCOMPARE(params.hash, QCryptographicHash::Sha256);
+#endif
+
+ QCOMPARE(dtls.dtlsConfiguration(), QSslConfiguration::defaultDtlsConfiguration());
+
+ QCOMPARE(dtls.handshakeState(), QDtls::HandshakeNotStarted);
+ QCOMPARE(dtls.isConnectionEncrypted(), false);
+ QCOMPARE(dtls.sessionCipher(), QSslCipher());
+ QCOMPARE(dtls.sessionProtocol(), QSsl::UnknownProtocol);
+
+ QCOMPARE(dtls.dtlsError(), QDtlsError::NoError);
+ QCOMPARE(dtls.dtlsErrorString(), QString());
+ QCOMPARE(dtls.peerVerificationErrors().size(), 0);
+}
+
+void tst_QDtls::configuration_data()
+{
+ clientServerData();
+}
+
+void tst_QDtls::configuration()
+{
+ // There is a proper auto-test for QSslConfiguration in our TLS test suite,
+ // here we only test several DTLS-related details.
+ auto config = QSslConfiguration::defaultDtlsConfiguration();
+ QCOMPARE(config.protocol(), QSsl::DtlsV1_2OrLater);
+
+ const QList<QSslCipher> ciphers = config.ciphers();
+ QVERIFY(ciphers.size() > 0);
+ for (const auto &cipher : ciphers)
+ QVERIFY(cipher.usedBits() >= 128);
+
+ QCOMPARE(config.dtlsCookieVerificationEnabled(), true);
+
+ QFETCH(const QSslSocket::SslMode, mode);
+ QDtls dtls(mode);
+ QCOMPARE(dtls.dtlsConfiguration(), config);
+ config.setProtocol(QSsl::DtlsV1_0OrLater);
+ config.setDtlsCookieVerificationEnabled(false);
+ QCOMPARE(config.dtlsCookieVerificationEnabled(), false);
+
+ QVERIFY(dtls.setDtlsConfiguration(config));
+ QDTLS_VERIFY_NO_ERROR(dtls);
+ QCOMPARE(dtls.dtlsConfiguration(), config);
+
+ if (mode == QSslSocket::SslClientMode) {
+ // Testing a DTLS server would be more complicated, we'd need a DTLS
+ // client sending ClientHello(s), running an event loop etc. - way too
+ // much dancing for a simple setter/getter test.
+ QVERIFY(dtls.setPeer(serverAddress, serverPort));
+ QDTLS_VERIFY_NO_ERROR(dtls);
+
+ QUdpSocket clientSocket;
+ QVERIFY(dtls.doHandshake(&clientSocket));
+ QDTLS_VERIFY_NO_ERROR(dtls);
+ QCOMPARE(dtls.handshakeState(), QDtls::HandshakeInProgress);
+ // As soon as handshake started, it's not allowed to change configuration:
+ QVERIFY(!dtls.setDtlsConfiguration(QSslConfiguration::defaultDtlsConfiguration()));
+ QCOMPARE(dtls.dtlsError(), QDtlsError::InvalidOperation);
+ QCOMPARE(dtls.dtlsConfiguration(), config);
+ }
+}
+
+void tst_QDtls::invalidConfiguration()
+{
+ QUdpSocket socket;
+ QDtls crypto(QSslSocket::SslClientMode);
+ QVERIFY(crypto.setPeer(serverAddress, serverPort));
+ // Note: not defaultDtlsConfiguration(), so the protocol is TLS (without D):
+ QVERIFY(crypto.setDtlsConfiguration(QSslConfiguration::defaultConfiguration()));
+ QDTLS_VERIFY_NO_ERROR(crypto);
+ QCOMPARE(crypto.dtlsConfiguration(), QSslConfiguration::defaultConfiguration());
+ // Try to start the handshake:
+ QCOMPARE(crypto.doHandshake(&socket), false);
+ QCOMPARE(crypto.dtlsError(), QDtlsError::TlsInitializationError);
+}
+
+void tst_QDtls::setPeer_data()
+{
+ clientServerData();
+}
+
+void tst_QDtls::setPeer()
+{
+ static const QHostAddress invalid[] = {QHostAddress(),
+ QHostAddress(QHostAddress::Broadcast),
+ QHostAddress(QStringLiteral("224.0.0.0"))};
+ static const QString peerName = QStringLiteral("does not matter actually");
+
+ QFETCH(const QSslSocket::SslMode, mode);
+ QDtls dtls(mode);
+
+ for (const auto &addr : invalid) {
+ QCOMPARE(dtls.setPeer(addr, 100, peerName), false);
+ QCOMPARE(dtls.dtlsError(), QDtlsError::InvalidInputParameters);
+ QCOMPARE(dtls.peerAddress(), QHostAddress());
+ QCOMPARE(dtls.peerPort(), quint16());
+ QCOMPARE(dtls.peerVerificationName(), QString());
+ }
+
+ QVERIFY(dtls.setPeer(serverAddress, serverPort, peerName));
+ QDTLS_VERIFY_NO_ERROR(dtls);
+ QCOMPARE(dtls.peerAddress(), serverAddress);
+ QCOMPARE(dtls.peerPort(), serverPort);
+ QCOMPARE(dtls.peerVerificationName(), peerName);
+
+ if (mode == QSslSocket::SslClientMode) {
+ // We test for client mode only, for server mode we'd have to run event
+ // loop etc. too much work for a simple setter/getter test.
+ QUdpSocket clientSocket;
+ QVERIFY(dtls.doHandshake(&clientSocket));
+ QDTLS_VERIFY_NO_ERROR(dtls);
+ QCOMPARE(dtls.handshakeState(), QDtls::HandshakeInProgress);
+ QCOMPARE(dtls.setPeer(serverAddress, serverPort), false);
+ QCOMPARE(dtls.dtlsError(), QDtlsError::InvalidOperation);
+ }
+}
+
+void tst_QDtls::handshake_data()
+{
+ QTest::addColumn<bool>("withCertificate");
+
+ QTest::addRow("no-cert") << false;
+ QTest::addRow("with-cert") << true;
+}
+
+void tst_QDtls::handshake()
+{
+ connectHandshakeReadingSlots();
+
+ QFETCH(const bool, withCertificate);
+
+ auto serverConfig = defaultServerConfig;
+ auto clientConfig = QSslConfiguration::defaultDtlsConfiguration();
+
+ if (!withCertificate) {
+ connect(serverCrypto.data(), &QDtls::pskRequired, this, &tst_QDtls::pskRequested);
+ connect(clientCrypto.data(), &QDtls::pskRequired, this, &tst_QDtls::pskRequested);
+ clientConfig.setPeerVerifyMode(QSslSocket::VerifyNone);
+ QVERIFY(clientConfig.peerCertificate().isNull());
+ } else {
+ serverConfig.setPrivateKey(serverKeySS);
+ serverConfig.setLocalCertificate(selfSignedCert);
+ clientConfig.setCaCertificates({selfSignedCert});
+ }
+
+ QVERIFY(serverCrypto->setDtlsConfiguration(serverConfig));
+ QVERIFY(clientCrypto->setDtlsConfiguration(clientConfig));
+
+ // Some early checks before we run event loop.
+ // Remote was not set yet:
+ QVERIFY(!clientCrypto->doHandshake(&clientSocket));
+ QCOMPARE(clientCrypto->dtlsError(), QDtlsError::InvalidOperation);
+ QVERIFY(!serverCrypto->doHandshake(&serverSocket, QByteArray("ClientHello")));
+ QCOMPARE(serverCrypto->dtlsError(), QDtlsError::InvalidOperation);
+
+ QVERIFY(clientCrypto->setPeer(serverAddress, serverPort, hostName));
+
+ // Invalid socket:
+ QVERIFY(!clientCrypto->doHandshake(nullptr));
+ QCOMPARE(clientCrypto->dtlsError(), QDtlsError::InvalidInputParameters);
+
+ // Now we are ready for handshake:
+ QVERIFY(clientCrypto->doHandshake(&clientSocket));
+ QDTLS_VERIFY_NO_ERROR(clientCrypto);
+ QCOMPARE(clientCrypto->handshakeState(), QDtls::HandshakeInProgress);
+
+ testLoop.enterLoopMSecs(handshakeTimeoutMS);
+
+ QVERIFY(!testLoop.timeout());
+
+ QVERIFY(serverCrypto->isConnectionEncrypted());
+ QDTLS_VERIFY_NO_ERROR(serverCrypto);
+ QCOMPARE(serverCrypto->handshakeState(), QDtls::HandshakeComplete);
+ QCOMPARE(serverCrypto->peerVerificationErrors().size(), 0);
+
+ QVERIFY(clientCrypto->isConnectionEncrypted());
+ QDTLS_VERIFY_NO_ERROR(clientCrypto);
+ QCOMPARE(clientCrypto->handshakeState(), QDtls::HandshakeComplete);
+ QCOMPARE(clientCrypto->peerVerificationErrors().size(), 0);
+
+ if (withCertificate) {
+ const auto serverCert = clientCrypto->dtlsConfiguration().peerCertificate();
+ QVERIFY(!serverCert.isNull());
+ QCOMPARE(serverCert, selfSignedCert);
+ }
+
+ // Already in 'HandshakeComplete' state/encrypted.
+ QVERIFY(!clientCrypto->doHandshake(&clientSocket));
+ QCOMPARE(clientCrypto->dtlsError(), QDtlsError::InvalidOperation);
+ QVERIFY(!serverCrypto->doHandshake(&serverSocket, {"ServerHello"}));
+ QCOMPARE(serverCrypto->dtlsError(), QDtlsError::InvalidOperation);
+ // Cannot change a remote without calling shutdown first.
+ QVERIFY(!clientCrypto->setPeer(serverAddress, serverPort));
+ QCOMPARE(clientCrypto->dtlsError(), QDtlsError::InvalidOperation);
+ QVERIFY(!serverCrypto->setPeer(clientAddress, clientPort));
+ QCOMPARE(serverCrypto->dtlsError(), QDtlsError::InvalidOperation);
+}
+
+void tst_QDtls::handshakeWithRetransmission()
+{
+ connectHandshakeReadingSlots();
+
+ auto serverConfig = defaultServerConfig;
+ serverConfig.setPrivateKey(serverKeySS);
+ serverConfig.setLocalCertificate(selfSignedCert);
+ QVERIFY(serverCrypto->setDtlsConfiguration(serverConfig));
+
+ auto clientConfig = QSslConfiguration::defaultDtlsConfiguration();
+ clientConfig.setCaCertificates({selfSignedCert});
+ QVERIFY(clientCrypto->setDtlsConfiguration(clientConfig));
+ QVERIFY(clientCrypto->setPeer(serverAddress, serverPort, hostName));
+
+ // Now we are ready for handshake:
+ QVERIFY(clientCrypto->doHandshake(&clientSocket));
+ QDTLS_VERIFY_NO_ERROR(clientCrypto);
+ QCOMPARE(clientCrypto->handshakeState(), QDtls::HandshakeInProgress);
+
+ serverDropDgram = true;
+ clientDropDgram = true;
+ // Every failed re-transmission doubles the next timeout. We don't want to
+ // slow down the test just to check the re-transmission ability, so we'll
+ // drop only the first 'ClientHello' and 'ServerHello' datagrams. The
+ // arithmetic is approximately this: the first ClientHello to be dropped -
+ // client will re-transmit in 1s., the first part of 'ServerHello' to be
+ // dropped, the client then will re-transmit after another 2 s. Thus it's ~3.
+ // We err on safe side and double our (already quite generous) 5s.
+ testLoop.enterLoopMSecs(handshakeTimeoutMS * 2);
+
+ QVERIFY(!testLoop.timeout());
+ QDTLS_VERIFY_HANDSHAKE_SUCCESS(serverCrypto);
+ QDTLS_VERIFY_HANDSHAKE_SUCCESS(clientCrypto);
+}
+
+void tst_QDtls::sessionCipher()
+{
+ connectHandshakeReadingSlots();
+
+ auto serverConfig = defaultServerConfig;
+ serverConfig.setPrivateKey(serverKeySS);
+ serverConfig.setLocalCertificate(selfSignedCert);
+ QVERIFY(serverCrypto->setDtlsConfiguration(serverConfig));
+
+ auto clientConfig = QSslConfiguration::defaultDtlsConfiguration();
+ clientConfig.setCaCertificates({selfSignedCert});
+ QVERIFY(clientCrypto->setDtlsConfiguration(clientConfig));
+
+ QVERIFY(clientCrypto->setPeer(serverAddress, serverPort, hostName));
+ QVERIFY(clientCrypto->doHandshake(&clientSocket));
+
+ testLoop.enterLoopMSecs(handshakeTimeoutMS);
+
+ QVERIFY(!testLoop.timeout());
+ QDTLS_VERIFY_HANDSHAKE_SUCCESS(clientCrypto);
+ QDTLS_VERIFY_HANDSHAKE_SUCCESS(serverCrypto);
+
+ const auto defaultDtlsConfig = QSslConfiguration::defaultDtlsConfiguration();
+
+ const auto clCipher = clientCrypto->sessionCipher();
+ QVERIFY(!clCipher.isNull());
+ QVERIFY(defaultDtlsConfig.ciphers().contains(clCipher));
+
+ const auto srvCipher = serverCrypto->sessionCipher();
+ QVERIFY(!srvCipher.isNull());
+ QVERIFY(defaultDtlsConfig.ciphers().contains(srvCipher));
+
+ QCOMPARE(clCipher, srvCipher);
+}
+
+void tst_QDtls::cipherPreferences_data()
+{
+ QTest::addColumn<bool>("preferClient");
+
+ QTest::addRow("prefer-server") << true;
+ QTest::addRow("prefer-client") << false;
+}
+
+void tst_QDtls::cipherPreferences()
+{
+ // This test is based on the similar case in tst_QSslSocket. We test it for QDtls
+ // because it's possible to set ciphers and corresponding ('server preferred')
+ // options via QSslConfiguration.
+ const QSslCipher aes128(QStringLiteral("AES128-SHA"));
+ const QSslCipher aes256(QStringLiteral("AES256-SHA"));
+
+ auto serverConfig = defaultServerConfig;
+ const QList<QSslCipher> ciphers = serverConfig.ciphers();
+ if (!ciphers.contains(aes128) || !ciphers.contains(aes256))
+ QSKIP("The ciphers needed by this test were not found in the default DTLS configuration");
+
+ serverConfig.setCiphers({aes128, aes256});
+ serverConfig.setLocalCertificate(selfSignedCert);
+ serverConfig.setPrivateKey(serverKeySS);
+
+ QFETCH(const bool, preferClient);
+ if (preferClient)
+ serverConfig.setSslOption(QSsl::SslOptionDisableServerCipherPreference, true);
+
+ QVERIFY(serverCrypto->setDtlsConfiguration(serverConfig));
+ QDTLS_VERIFY_NO_ERROR(serverCrypto);
+
+ auto clientConfig = QSslConfiguration::defaultDtlsConfiguration();
+ clientConfig.setPeerVerifyMode(QSslSocket::VerifyNone);
+ clientConfig.setCiphers({aes256, aes128});
+ QVERIFY(clientCrypto->setDtlsConfiguration(clientConfig));
+ QVERIFY(clientCrypto->setPeer(serverAddress, serverPort));
+ QDTLS_VERIFY_NO_ERROR(clientCrypto);
+
+ connectHandshakeReadingSlots();
+
+ QVERIFY(clientCrypto->doHandshake(&clientSocket));
+ QDTLS_VERIFY_NO_ERROR(clientCrypto);
+
+ testLoop.enterLoopMSecs(handshakeTimeoutMS);
+ QVERIFY(!testLoop.timeout());
+ QDTLS_VERIFY_HANDSHAKE_SUCCESS(clientCrypto);
+ QDTLS_VERIFY_HANDSHAKE_SUCCESS(serverCrypto);
+
+ if (preferClient) {
+ QCOMPARE(clientCrypto->sessionCipher(), aes256);
+ QCOMPARE(serverCrypto->sessionCipher(), aes256);
+ } else {
+ QCOMPARE(clientCrypto->sessionCipher(), aes128);
+ QCOMPARE(serverCrypto->sessionCipher(), aes128);
+ }
+}
+
+void tst_QDtls::protocolVersionMatching_data()
+{
+ QTest::addColumn<QSsl::SslProtocol>("serverProtocol");
+ QTest::addColumn<QSsl::SslProtocol>("clientProtocol");
+ QTest::addColumn<bool>("works");
+
+ QTest::addRow("DtlsV1_0 <-> DtlsV1_0") << QSsl::DtlsV1_0 << QSsl::DtlsV1_0 << true;
+ QTest::addRow("DtlsV1_0OrLater <-> DtlsV1_0") << QSsl::DtlsV1_0OrLater << QSsl::DtlsV1_0 << true;
+ QTest::addRow("DtlsV1_0 <-> DtlsV1_0OrLater") << QSsl::DtlsV1_0 << QSsl::DtlsV1_0OrLater << true;
+ QTest::addRow("DtlsV1_0OrLater <-> DtlsV1_0OrLater") << QSsl::DtlsV1_0OrLater << QSsl::DtlsV1_0OrLater << true;
+
+ QTest::addRow("DtlsV1_2 <-> DtlsV1_2") << QSsl::DtlsV1_2 << QSsl::DtlsV1_2 << true;
+ QTest::addRow("DtlsV1_2OrLater <-> DtlsV1_2") << QSsl::DtlsV1_2OrLater << QSsl::DtlsV1_2 << true;
+ QTest::addRow("DtlsV1_2 <-> DtlsV1_2OrLater") << QSsl::DtlsV1_2 << QSsl::DtlsV1_2OrLater << true;
+ QTest::addRow("DtlsV1_2OrLater <-> DtlsV1_2OrLater") << QSsl::DtlsV1_2OrLater << QSsl::DtlsV1_2OrLater << true;
+
+ QTest::addRow("DtlsV1_0 <-> DtlsV1_2") << QSsl::DtlsV1_0 << QSsl::DtlsV1_2 << false;
+ QTest::addRow("DtlsV1_0 <-> DtlsV1_2OrLater") << QSsl::DtlsV1_0 << QSsl::DtlsV1_2OrLater << false;
+ QTest::addRow("DtlsV1_2 <-> DtlsV1_0") << QSsl::DtlsV1_2 << QSsl::DtlsV1_0 << false;
+ QTest::addRow("DtlsV1_2OrLater <-> DtlsV1_0") << QSsl::DtlsV1_2OrLater << QSsl::DtlsV1_0 << false;
+}
+
+void tst_QDtls::protocolVersionMatching()
+{
+ QFETCH(const QSsl::SslProtocol, serverProtocol);
+ QFETCH(const QSsl::SslProtocol, clientProtocol);
+ QFETCH(const bool, works);
+
+ connectHandshakeReadingSlots();
+
+ connect(serverCrypto.data(), &QDtls::pskRequired, this, &tst_QDtls::pskRequested);
+ connect(clientCrypto.data(), &QDtls::pskRequired, this, &tst_QDtls::pskRequested);
+
+ auto serverConfig = defaultServerConfig;
+ serverConfig.setProtocol(serverProtocol);
+ QVERIFY(serverCrypto->setDtlsConfiguration(serverConfig));
+
+ auto clientConfig = QSslConfiguration::defaultDtlsConfiguration();
+ clientConfig.setPeerVerifyMode(QSslSocket::VerifyNone);
+ clientConfig.setProtocol(clientProtocol);
+ QVERIFY(clientCrypto->setDtlsConfiguration(clientConfig));
+
+ QVERIFY(clientCrypto->setPeer(serverAddress, serverPort));
+ QVERIFY(clientCrypto->doHandshake(&clientSocket));
+
+ testLoop.enterLoopMSecs(handshakeTimeoutMS);
+
+ if (works) {
+ QDTLS_VERIFY_HANDSHAKE_SUCCESS(serverCrypto);
+ QDTLS_VERIFY_HANDSHAKE_SUCCESS(clientCrypto);
+ } else {
+ QCOMPARE(serverCrypto->isConnectionEncrypted(), false);
+ QVERIFY(serverCrypto->handshakeState() != QDtls::HandshakeComplete);
+ QCOMPARE(clientCrypto->isConnectionEncrypted(), false);
+ QVERIFY(clientCrypto->handshakeState() != QDtls::HandshakeComplete);
+ }
+}
+
+void tst_QDtls::verificationErrors_data()
+{
+ QTest::addColumn<bool>("abortHandshake");
+
+ QTest::addRow("abort-handshake") << true;
+ QTest::addRow("ignore-errors") << false;
+}
+
+void tst_QDtls::verificationErrors()
+{
+ connectHandshakeReadingSlots();
+
+ auto serverConfig = defaultServerConfig;
+ serverConfig.setPrivateKey(serverKeySS);
+ serverConfig.setLocalCertificate(selfSignedCert);
+ QVERIFY(serverCrypto->setDtlsConfiguration(serverConfig));
+ // And our client already has the default DTLS configuration.
+
+ QVERIFY(clientCrypto->setPeer(serverAddress, serverPort));
+ // Now we are ready for handshake:
+ QVERIFY(clientCrypto->doHandshake(&clientSocket));
+
+ testLoop.enterLoopMSecs(handshakeTimeoutMS);
+
+ QVERIFY(!testLoop.timeout());
+ QDTLS_VERIFY_NO_ERROR(serverCrypto);
+
+ QCOMPARE(clientCrypto->dtlsError(), QDtlsError::PeerVerificationError);
+ QCOMPARE(clientCrypto->handshakeState(), QDtls::PeerVerificationFailed);
+ QVERIFY(!clientCrypto->isConnectionEncrypted());
+
+ QVERIFY(verificationErrorDetected(QSslError::HostNameMismatch));
+ QVERIFY(verificationErrorDetected(QSslError::SelfSignedCertificate));
+
+ const auto serverCert = clientCrypto->dtlsConfiguration().peerCertificate();
+ QVERIFY(!serverCert.isNull());
+ QCOMPARE(selfSignedCert, serverCert);
+
+ QFETCH(const bool, abortHandshake);
+
+ if (abortHandshake) {
+ QVERIFY(!clientCrypto->abortHandshake(nullptr));
+ QCOMPARE(clientCrypto->dtlsError(), QDtlsError::InvalidInputParameters);
+ QVERIFY(clientCrypto->abortHandshake(&clientSocket));
+ QDTLS_VERIFY_NO_ERROR(clientCrypto);
+ QVERIFY(!clientCrypto->isConnectionEncrypted());
+ QCOMPARE(clientCrypto->handshakeState(), QDtls::HandshakeNotStarted);
+ QCOMPARE(clientCrypto->sessionCipher(), QSslCipher());
+ QCOMPARE(clientCrypto->sessionProtocol(), QSsl::UnknownProtocol);
+ const auto config = clientCrypto->dtlsConfiguration();
+ QVERIFY(config.peerCertificate().isNull());
+ QCOMPARE(config.peerCertificateChain().size(), 0);
+ QCOMPARE(clientCrypto->peerVerificationErrors().size(), 0);
+ } else {
+ clientCrypto->ignoreVerificationErrors(clientCrypto->peerVerificationErrors());
+ QVERIFY(!clientCrypto->resumeHandshake(nullptr));
+ QCOMPARE(clientCrypto->dtlsError(), QDtlsError::InvalidInputParameters);
+ QVERIFY(clientCrypto->resumeHandshake(&clientSocket));
+ QDTLS_VERIFY_HANDSHAKE_SUCCESS(clientCrypto);
+ QVERIFY(clientCrypto->isConnectionEncrypted());
+ QCOMPARE(clientCrypto->handshakeState(), QDtls::HandshakeComplete);
+ QCOMPARE(clientCrypto->peerVerificationErrors().size(), 0);
+ }
+}
+
+void tst_QDtls::presetExpectedErrors_data()
+{
+ QTest::addColumn<QVector<QSslError>>("expectedTlsErrors");
+ QTest::addColumn<bool>("works");
+
+ QVector<QSslError> expectedErrors{{QSslError::HostNameMismatch, selfSignedCert}};
+ QTest::addRow("unexpected-self-signed") << expectedErrors << false;
+ expectedErrors.push_back({QSslError::SelfSignedCertificate, selfSignedCert});
+ QTest::addRow("all-errors-ignored") << expectedErrors << true;
+}
+
+void tst_QDtls::presetExpectedErrors()
+{
+ QFETCH(const QVector<QSslError>, expectedTlsErrors);
+ QFETCH(const bool, works);
+
+ connectHandshakeReadingSlots();
+
+ auto serverConfig = defaultServerConfig;
+ serverConfig.setPrivateKey(serverKeySS);
+ serverConfig.setLocalCertificate(selfSignedCert);
+ QVERIFY(serverCrypto->setDtlsConfiguration(serverConfig));
+
+ clientCrypto->ignoreVerificationErrors(expectedTlsErrors);
+ QVERIFY(clientCrypto->setPeer(serverAddress, serverPort));
+ QVERIFY(clientCrypto->doHandshake(&clientSocket));
+
+ testLoop.enterLoopMSecs(handshakeTimeoutMS);
+
+ QVERIFY(!testLoop.timeout());
+
+ if (works) {
+ QDTLS_VERIFY_HANDSHAKE_SUCCESS(serverCrypto);
+ QCOMPARE(clientCrypto->handshakeState(), QDtls::HandshakeComplete);
+ QVERIFY(clientCrypto->isConnectionEncrypted());
+ } else {
+ QCOMPARE(clientCrypto->dtlsError(), QDtlsError::PeerVerificationError);
+ QVERIFY(!clientCrypto->isConnectionEncrypted());
+ QCOMPARE(clientCrypto->handshakeState(), QDtls::PeerVerificationFailed);
+ }
+}
+
+void tst_QDtls::verifyServerCertificate_data()
+{
+ QTest::addColumn<QSslSocket::PeerVerifyMode>("verifyMode");
+ QTest::addColumn<QList<QSslCertificate>>("serverCerts");
+ QTest::addColumn<QSslKey>("serverKey");
+ QTest::addColumn<QString>("peerName");
+ QTest::addColumn<bool>("encrypted");
+
+ {
+ // A special case - null key (but with certificate):
+ const auto chain = QSslCertificate::fromPath(certDirPath + QStringLiteral("bogus-server.crt"));
+ QCOMPARE(chain.size(), 1);
+
+ QSslKey nullKey;
+ // Only one row - server must fail to start handshake immediately.
+ QTest::newRow("valid-server-cert-no-key : VerifyPeer") << QSslSocket::VerifyPeer << chain << nullKey << QString() << false;
+ }
+ {
+ // Valid certificate:
+ auto chain = QSslCertificate::fromPath(certDirPath + QStringLiteral("bogus-server.crt"));
+ QCOMPARE(chain.size(), 1);
+
+ const auto caCert = QSslCertificate::fromPath(certDirPath + QStringLiteral("bogus-ca.crt"));
+ QCOMPARE(caCert.size(), 1);
+ chain += caCert;
+
+ QFile keyFile(certDirPath + QStringLiteral("bogus-server.key"));
+ QVERIFY(keyFile.open(QIODevice::ReadOnly));
+ const QSslKey key(keyFile.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey);
+ QVERIFY(!key.isNull());
+
+ auto cert = chain.first();
+ const QString name(cert.subjectInfo(QSslCertificate::CommonName).first());
+ QTest::newRow("valid-server-cert : AutoVerifyPeer") << QSslSocket::AutoVerifyPeer << chain << key << name << true;
+ QTest::newRow("valid-server-cert : QueryPeer") << QSslSocket::QueryPeer << chain << key << name << true;
+ QTest::newRow("valid-server-cert : VerifyNone") << QSslSocket::VerifyNone << chain << key << name << true;
+ QTest::newRow("valid-server-cert : VerifyPeer (add CA)") << QSslSocket::VerifyPeer << chain << key << name << true;
+ QTest::newRow("valid-server-cert : VerifyPeer (no CA)") << QSslSocket::VerifyPeer << chain << key << name << false;
+ QTest::newRow("valid-server-cert : VerifyPeer (name mismatch)") << QSslSocket::VerifyPeer << chain << key << QString() << false;
+ }
+}
+
+void tst_QDtls::verifyServerCertificate()
+{
+ QFETCH(const QSslSocket::PeerVerifyMode, verifyMode);
+ QFETCH(const QList<QSslCertificate>, serverCerts);
+ QFETCH(const QSslKey, serverKey);
+ QFETCH(const QString, peerName);
+ QFETCH(const bool, encrypted);
+
+ auto serverConfig = defaultServerConfig;
+ serverConfig.setLocalCertificateChain(serverCerts);
+ serverConfig.setPrivateKey(serverKey);
+ QVERIFY(serverCrypto->setDtlsConfiguration(serverConfig));
+
+ auto clientConfig = QSslConfiguration::defaultDtlsConfiguration();
+
+ if (serverCerts.size() == 2 && encrypted) {
+ auto caCerts = clientConfig.caCertificates();
+ caCerts.append(serverCerts.at(1));
+ clientConfig.setCaCertificates(caCerts);
+ }
+
+ clientConfig.setPeerVerifyMode(verifyMode);
+
+ QVERIFY(clientCrypto->setDtlsConfiguration(clientConfig));
+ QVERIFY(clientCrypto->setPeer(serverAddress, serverPort, peerName));
+
+ connectHandshakeReadingSlots();
+
+ QVERIFY(clientCrypto->doHandshake(&clientSocket));
+
+ testLoop.enterLoopMSecs(handshakeTimeoutMS);
+ QVERIFY(!testLoop.timeout());
+
+ if (serverKey.isNull() && !serverCerts.isEmpty()) {
+ QDTLS_VERIFY_NO_ERROR(clientCrypto);
+ QCOMPARE(clientCrypto->handshakeState(), QDtls::HandshakeInProgress);
+ QCOMPARE(serverCrypto->dtlsError(), QDtlsError::TlsInitializationError);
+ QCOMPARE(serverCrypto->handshakeState(), QDtls::HandshakeNotStarted);
+ return;
+ }
+
+ if (encrypted) {
+ QDTLS_VERIFY_HANDSHAKE_SUCCESS(serverCrypto);
+ QDTLS_VERIFY_HANDSHAKE_SUCCESS(clientCrypto);
+ } else {
+ QVERIFY(!clientCrypto->isConnectionEncrypted());
+ QCOMPARE(clientCrypto->handshakeState(), QDtls::PeerVerificationFailed);
+ QVERIFY(clientCrypto->peerVerificationErrors().size());
+ QVERIFY(clientCrypto->writeDatagramEncrypted(&clientSocket, "something") < 0);
+ QCOMPARE(clientCrypto->dtlsError(), QDtlsError::InvalidOperation);
+ }
+}
+
+void tst_QDtls::verifyClientCertificate_data()
+{
+#if !QT_CONFIG(opensslv11)
+ QSKIP("This test is not supposed to work with OpenSSL version below 1.1");
+#endif
+
+ QTest::addColumn<QSslSocket::PeerVerifyMode>("verifyMode");
+ QTest::addColumn<QList<QSslCertificate>>("clientCerts");
+ QTest::addColumn<QSslKey>("clientKey");
+ QTest::addColumn<bool>("encrypted");
+ {
+ // No certficates, no key:
+ QList<QSslCertificate> chain;
+ QSslKey key;
+ QTest::newRow("no-cert : AutoVerifyPeer") << QSslSocket::AutoVerifyPeer << chain << key << true;
+ QTest::newRow("no-cert : QueryPeer") << QSslSocket::QueryPeer << chain << key << true;
+ QTest::newRow("no-cert : VerifyNone") << QSslSocket::VerifyNone << chain << key << true;
+ QTest::newRow("no-cert : VerifyPeer") << QSslSocket::VerifyPeer << chain << key << false;
+ }
+ {
+ const auto chain = QSslCertificate::fromPath(certDirPath + QStringLiteral("fluke.cert"));
+ QCOMPARE(chain.size(), 1);
+
+ QFile keyFile(certDirPath + QStringLiteral("fluke.key"));
+ QVERIFY(keyFile.open(QIODevice::ReadOnly));
+ const QSslKey key(keyFile.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey);
+ QVERIFY(!key.isNull());
+
+ QTest::newRow("self-signed-cert : AutoVerifyPeer") << QSslSocket::AutoVerifyPeer << chain << key << true;
+ QTest::newRow("self-signed-cert : QueryPeer") << QSslSocket::QueryPeer << chain << key << true;
+ QTest::newRow("self-signed-cert : VerifyNone") << QSslSocket::VerifyNone << chain << key << true;
+ QTest::newRow("self-signed-cert : VerifyPeer") << QSslSocket::VerifyPeer << chain << key << false;
+ }
+ {
+ // Valid certificate, but wrong usage (server certificate):
+ const auto chain = QSslCertificate::fromPath(certDirPath + QStringLiteral("bogus-server.crt"));
+ QCOMPARE(chain.size(), 1);
+
+ QFile keyFile(certDirPath + QStringLiteral("bogus-server.key"));
+ QVERIFY(keyFile.open(QIODevice::ReadOnly));
+ const QSslKey key(keyFile.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey);
+ QVERIFY(!key.isNull());
+
+ QTest::newRow("valid-server-cert : AutoVerifyPeer") << QSslSocket::AutoVerifyPeer << chain << key << true;
+ QTest::newRow("valid-server-cert : QueryPeer") << QSslSocket::QueryPeer << chain << key << true;
+ QTest::newRow("valid-server-cert : VerifyNone") << QSslSocket::VerifyNone << chain << key << true;
+ QTest::newRow("valid-server-cert : VerifyPeer") << QSslSocket::VerifyPeer << chain << key << false;
+ }
+ {
+ // Valid certificate, correct usage (client certificate):
+ auto chain = QSslCertificate::fromPath(certDirPath + QStringLiteral("bogus-client.crt"));
+ QCOMPARE(chain.size(), 1);
+
+ QFile keyFile(certDirPath + QStringLiteral("bogus-client.key"));
+ QVERIFY(keyFile.open(QIODevice::ReadOnly));
+ const QSslKey key(keyFile.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey);
+ QVERIFY(!key.isNull());
+
+ QTest::newRow("valid-client-cert : AutoVerifyPeer") << QSslSocket::AutoVerifyPeer << chain << key << true;
+ QTest::newRow("valid-client-cert : QueryPeer") << QSslSocket::QueryPeer << chain << key << true;
+ QTest::newRow("valid-client-cert : VerifyNone") << QSslSocket::VerifyNone << chain << key << true;
+ QTest::newRow("valid-client-cert : VerifyPeer") << QSslSocket::VerifyPeer << chain << key << true;
+
+ // Valid certificate, correct usage (client certificate), with chain:
+ chain += QSslCertificate::fromPath(certDirPath + QStringLiteral("bogus-ca.crt"));
+ QCOMPARE(chain.size(), 2);
+
+ QTest::newRow("valid-client-chain : AutoVerifyPeer") << QSslSocket::AutoVerifyPeer << chain << key << true;
+ QTest::newRow("valid-client-chain : QueryPeer") << QSslSocket::QueryPeer << chain << key << true;
+ QTest::newRow("valid-client-chain : VerifyNone") << QSslSocket::VerifyNone << chain << key << true;
+ QTest::newRow("valid-client-chain : VerifyPeer") << QSslSocket::VerifyPeer << chain << key << true;
+ }
+}
+
+void tst_QDtls::verifyClientCertificate()
+{
+ connectHandshakeReadingSlots();
+
+ QFETCH(const QSslSocket::PeerVerifyMode, verifyMode);
+ QFETCH(const QList<QSslCertificate>, clientCerts);
+ QFETCH(const QSslKey, clientKey);
+ QFETCH(const bool, encrypted);
+
+ QSslConfiguration serverConfig = defaultServerConfig;
+ serverConfig.setLocalCertificate(selfSignedCert);
+ serverConfig.setPrivateKey(serverKeySS);
+ serverConfig.setPeerVerifyMode(verifyMode);
+
+ if (verifyMode == QSslSocket::VerifyPeer && clientCerts.size()) {
+ // Not always needed even if these conditions met, but does not hurt
+ // either.
+ const auto certs = QSslCertificate::fromPath(certDirPath + QStringLiteral("bogus-ca.crt"));
+ QCOMPARE(certs.size(), 1);
+ serverConfig.setCaCertificates(serverConfig.caCertificates() + certs);
+ }
+
+ QVERIFY(serverCrypto->setDtlsConfiguration(serverConfig));
+ serverConfig = serverCrypto->dtlsConfiguration();
+ QVERIFY(serverConfig.peerCertificate().isNull());
+ QCOMPARE(serverConfig.peerCertificateChain().size(), 0);
+
+ auto clientConfig = QSslConfiguration::defaultDtlsConfiguration();
+ clientConfig.setLocalCertificateChain(clientCerts);
+ clientConfig.setPrivateKey(clientKey);
+ clientConfig.setPeerVerifyMode(QSslSocket::VerifyNone);
+ QVERIFY(clientCrypto->setDtlsConfiguration(clientConfig));
+ QVERIFY(clientCrypto->setPeer(serverAddress, serverPort));
+
+ QVERIFY(clientCrypto->doHandshake(&clientSocket));
+ QDTLS_VERIFY_NO_ERROR(clientCrypto);
+
+ testLoop.enterLoopMSecs(handshakeTimeoutMS);
+
+ serverConfig = serverCrypto->dtlsConfiguration();
+
+ if (verifyMode == QSslSocket::VerifyNone || clientCerts.isEmpty()) {
+ QVERIFY(serverConfig.peerCertificate().isNull());
+ QCOMPARE(serverConfig.peerCertificateChain().size(), 0);
+ } else {
+ QCOMPARE(serverConfig.peerCertificate(), clientCerts.first());
+ QCOMPARE(serverConfig.peerCertificateChain(), clientCerts);
+ }
+
+ if (encrypted) {
+ QDTLS_VERIFY_HANDSHAKE_SUCCESS(serverCrypto);
+ QDTLS_VERIFY_HANDSHAKE_SUCCESS(clientCrypto);
+ } else {
+ QVERIFY(!serverCrypto->isConnectionEncrypted());
+ QCOMPARE(serverCrypto->handshakeState(), QDtls::PeerVerificationFailed);
+ QVERIFY(serverCrypto->dtlsErrorString().size() > 0);
+ QVERIFY(serverCrypto->peerVerificationErrors().size() > 0);
+
+ QVERIFY(!clientCrypto->isConnectionEncrypted());
+ QDTLS_VERIFY_NO_ERROR(clientCrypto);
+ QCOMPARE(clientCrypto->handshakeState(), QDtls::HandshakeInProgress);
+ }
+}
+
+void tst_QDtls::blacklistedCerificate()
+{
+ const auto serverChain = QSslCertificate::fromPath(certDirPath + QStringLiteral("fake-login.live.com.pem"));
+ QCOMPARE(serverChain.size(), 1);
+
+ QFile keyFile(certDirPath + QStringLiteral("fake-login.live.com.key"));
+ QVERIFY(keyFile.open(QIODevice::ReadOnly));
+ const QSslKey key(keyFile.readAll(), QSsl::Rsa, QSsl::Pem, QSsl::PrivateKey);
+ QVERIFY(!key.isNull());
+
+ auto serverConfig = defaultServerConfig;
+ serverConfig.setLocalCertificateChain(serverChain);
+ serverConfig.setPrivateKey(key);
+ QVERIFY(serverCrypto->setDtlsConfiguration(serverConfig));
+
+ connectHandshakeReadingSlots();
+ const QString name(serverChain.first().subjectInfo(QSslCertificate::CommonName).first());
+ QVERIFY(clientCrypto->setPeer(serverAddress, serverPort, name));
+ QVERIFY(clientCrypto->doHandshake(&clientSocket));
+
+ testLoop.enterLoopMSecs(handshakeTimeoutMS);
+ QVERIFY(!testLoop.timeout());
+ QCOMPARE(clientCrypto->handshakeState(), QDtls::PeerVerificationFailed);
+ QCOMPARE(clientCrypto->dtlsError(), QDtlsError::PeerVerificationError);
+ QVERIFY(!clientCrypto->isConnectionEncrypted());
+ QVERIFY(verificationErrorDetected(QSslError::CertificateBlacklisted));
+}
+
+void tst_QDtls::readWriteEncrypted_data()
+{
+ QTest::addColumn<bool>("serverSideShutdown");
+
+ QTest::addRow("client-shutdown") << false;
+ QTest::addRow("server-shutdown") << true;
+}
+
+void tst_QDtls::readWriteEncrypted()
+{
+ connectHandshakeReadingSlots();
+
+ auto serverConfig = defaultServerConfig;
+ serverConfig.setLocalCertificate(selfSignedCert);
+ serverConfig.setPrivateKey(serverKeySS);
+ QVERIFY(serverCrypto->setDtlsConfiguration(serverConfig));
+
+ auto clientConfig = QSslConfiguration::defaultDtlsConfiguration();
+ clientConfig.setCaCertificates({selfSignedCert});
+ QVERIFY(clientCrypto->setDtlsConfiguration(clientConfig));
+ QVERIFY(clientCrypto->setPeer(serverAddress, serverPort, hostName));
+
+ // 0. Verify we cannot write any encrypted message without handshake done
+ QDTLS_VERIFY_NO_ERROR(clientCrypto);
+ QVERIFY(clientCrypto->writeDatagramEncrypted(&clientSocket, serverExpectedPlainText) <= 0);
+ QCOMPARE(clientCrypto->dtlsError(), QDtlsError::InvalidOperation);
+ QVERIFY(!clientCrypto->shutdown(&clientSocket));
+ QCOMPARE(clientCrypto->dtlsError(), QDtlsError::InvalidOperation);
+ QDTLS_VERIFY_NO_ERROR(serverCrypto);
+ QVERIFY(serverCrypto->writeDatagramEncrypted(&serverSocket, clientExpectedPlainText) <= 0);
+ QCOMPARE(serverCrypto->dtlsError(), QDtlsError::InvalidOperation);
+ QVERIFY(!serverCrypto->shutdown(&serverSocket));
+ QCOMPARE(serverCrypto->dtlsError(), QDtlsError::InvalidOperation);
+
+ // 1. Initiate a handshake:
+ QVERIFY(clientCrypto->doHandshake(&clientSocket));
+ QDTLS_VERIFY_NO_ERROR(clientCrypto);
+ // 1.1 Verify we cannot read yet. What the datagram is - not really important,
+ // invalid state/operation - is what we verify:
+ const QByteArray dummy = clientCrypto->decryptDatagram(&clientSocket, "BS dgram");
+ QCOMPARE(dummy.size(), 0);
+ QCOMPARE(clientCrypto->dtlsError(), QDtlsError::InvalidOperation);
+
+ // 1.2 Finish the handshake:
+ testLoop.enterLoopMSecs(handshakeTimeoutMS);
+ QVERIFY(!testLoop.timeout());
+
+ QDTLS_VERIFY_HANDSHAKE_SUCCESS(clientCrypto);
+ QDTLS_VERIFY_HANDSHAKE_SUCCESS(serverCrypto);
+
+ // 2. Change reading slots:
+ connectEncryptedReadingSlots();
+
+ // 3. Test parameter validation:
+ QVERIFY(clientCrypto->writeDatagramEncrypted(nullptr, serverExpectedPlainText) <= 0);
+ QCOMPARE(clientCrypto->dtlsError(), QDtlsError::InvalidInputParameters);
+ // 4. Write the client's message:
+ qint64 clientBytesWritten = clientCrypto->writeDatagramEncrypted(&clientSocket, serverExpectedPlainText);
+ QDTLS_VERIFY_NO_ERROR(clientCrypto);
+ QVERIFY(clientBytesWritten > 0);
+
+ // 5. Exchange client/server messages:
+ testLoop.enterLoopMSecs(dataExchangeTimeoutMS);
+ QVERIFY(!testLoop.timeout());
+
+ QCOMPARE(serverExpectedPlainText, serverReceivedPlainText);
+ QCOMPARE(clientExpectedPlainText, clientReceivedPlainText);
+
+ QFETCH(const bool, serverSideShutdown);
+ DtlsPtr &crypto = serverSideShutdown ? serverCrypto : clientCrypto;
+ QUdpSocket *socket = serverSideShutdown ? &serverSocket : &clientSocket;
+ // 6. Parameter validation:
+ QVERIFY(!crypto->shutdown(nullptr));
+ QCOMPARE(crypto->dtlsError(), QDtlsError::InvalidInputParameters);
+ // 7. Send shutdown alert:
+ QVERIFY(crypto->shutdown(socket));
+ QDTLS_VERIFY_NO_ERROR(crypto);
+ QCOMPARE(crypto->handshakeState(), QDtls::HandshakeNotStarted);
+ QVERIFY(!crypto->isConnectionEncrypted());
+ // 8. Receive this read notification and handle it:
+ testLoop.enterLoopMSecs(dataExchangeTimeoutMS);
+ QVERIFY(!testLoop.timeout());
+
+ DtlsPtr &peerCrypto = serverSideShutdown ? clientCrypto : serverCrypto;
+ QVERIFY(!peerCrypto->isConnectionEncrypted());
+ QCOMPARE(peerCrypto->handshakeState(), QDtls::HandshakeNotStarted);
+ QCOMPARE(peerCrypto->dtlsError(), QDtlsError::RemoteClosedConnectionError);
+}
+
+void tst_QDtls::datagramFragmentation()
+{
+ connectHandshakeReadingSlots();
+
+ auto serverConfig = defaultServerConfig;
+ serverConfig.setLocalCertificate(selfSignedCert);
+ serverConfig.setPrivateKey(serverKeySS);
+ QVERIFY(serverCrypto->setDtlsConfiguration(serverConfig));
+
+ auto clientConfig = QSslConfiguration::defaultDtlsConfiguration();
+ clientConfig.setPeerVerifyMode(QSslSocket::VerifyNone);
+ QVERIFY(clientCrypto->setDtlsConfiguration(clientConfig));
+ QVERIFY(clientCrypto->setPeer(serverAddress, serverPort));
+
+ QVERIFY(clientCrypto->doHandshake(&clientSocket));
+
+ testLoop.enterLoopMSecs(handshakeTimeoutMS);
+ QVERIFY(!testLoop.timeout());
+
+ QDTLS_VERIFY_HANDSHAKE_SUCCESS(clientCrypto);
+ QDTLS_VERIFY_HANDSHAKE_SUCCESS(serverCrypto);
+
+ // Done with handshake, reconnect readyRead:
+ connectEncryptedReadingSlots();
+
+ // Verify our dgram is not fragmented and some error set (either UnderlyingSocketError
+ // if OpenSSL somehow had attempted a write or TlsFatalError in case OpenSSL
+ // noticed how big the chunk is).
+ QVERIFY(clientCrypto->writeDatagramEncrypted(&clientSocket, QByteArray(1024 * 17, Qt::Uninitialized)) <= 0);
+ QVERIFY(clientCrypto->dtlsError() != QDtlsError::NoError);
+ // Error to write does not mean QDtls is broken:
+ QVERIFY(clientCrypto->isConnectionEncrypted());
+ QVERIFY(clientCrypto->writeDatagramEncrypted(&clientSocket, "Hello, I'm a tiny datagram") > 0);
+ QDTLS_VERIFY_NO_ERROR(clientCrypto);
+}
+
+void tst_QDtls::handshakeReadyRead()
+{
+ QUdpSocket *socket = qobject_cast<QUdpSocket *>(sender());
+ Q_ASSERT(socket);
+
+ if (!socket->pendingDatagramSize())
+ return;
+
+ const bool isServer = socket == &serverSocket;
+ DtlsPtr &crypto = isServer ? serverCrypto : clientCrypto;
+ DtlsPtr &peerCrypto = isServer ? clientCrypto : serverCrypto;
+ QHostAddress addr;
+ quint16 port = 0;
+
+ QByteArray dgram(socket->pendingDatagramSize(), Qt::Uninitialized);
+ const qint64 size = socket->readDatagram(dgram.data(), dgram.size(), &addr, &port);
+ if (size != dgram.size())
+ return;
+
+ if (isServer) {
+ if (!clientPort) {
+ // It's probably an initial 'ClientHello' message. Let's set remote's
+ // address/port. But first we make sure it is, indeed, 'ClientHello'.
+ if (int(dgram.constData()[0]) != 22)
+ return;
+
+ if (addr.isNull() || addr.isBroadcast()) // Could never be us (client), bail out
+ return;
+
+ if (!crypto->setPeer(addr, port))
+ return testLoop.exitLoop();
+
+ // Check parameter validation:
+ if (crypto->doHandshake(nullptr, dgram) || crypto->dtlsError() != QDtlsError::InvalidInputParameters)
+ return testLoop.exitLoop();
+
+ if (crypto->doHandshake(&serverSocket, {}) || crypto->dtlsError() != QDtlsError::InvalidInputParameters)
+ return testLoop.exitLoop();
+
+ // Make sure we cannot decrypt yet:
+ const QByteArray dummyDgram = crypto->decryptDatagram(&serverSocket, dgram);
+ if (dummyDgram.size() > 0 || crypto->dtlsError() != QDtlsError::InvalidOperation)
+ return testLoop.exitLoop();
+
+ clientAddress = addr;
+ clientPort = port;
+ } else if (clientPort != port || clientAddress != addr) {
+ return;
+ }
+
+ if (serverDropDgram) {
+ serverDropDgram = false;
+ return;
+ }
+ } else if (clientDropDgram) {
+ clientDropDgram = false;
+ return;
+ }
+
+ if (!crypto->doHandshake(socket, dgram))
+ return testLoop.exitLoop();
+
+ const auto state = crypto->handshakeState();
+ if (state != QDtls::HandshakeInProgress && state != QDtls::HandshakeComplete)
+ return testLoop.exitLoop();
+
+ if (state == QDtls::HandshakeComplete && peerCrypto->handshakeState() == QDtls::HandshakeComplete)
+ testLoop.exitLoop();
+}
+
+void tst_QDtls::encryptedReadyRead()
+{
+ QUdpSocket *socket = qobject_cast<QUdpSocket *>(sender());
+ Q_ASSERT(socket);
+
+ if (socket->pendingDatagramSize() <= 0)
+ return;
+
+ QByteArray dtlsMessage(int(socket->pendingDatagramSize()), Qt::Uninitialized);
+ QHostAddress addr;
+ quint16 port = 0;
+ const qint64 bytesRead = socket->readDatagram(dtlsMessage.data(), dtlsMessage.size(), &addr, &port);
+ if (bytesRead <= 0)
+ return;
+
+ dtlsMessage.resize(int(bytesRead));
+
+ if (socket == &serverSocket) {
+ if (addr != clientAddress || port != clientPort)
+ return;
+
+ if (serverExpectedPlainText == dtlsMessage) // No way it can happen!
+ return testLoop.exitLoop();
+
+ serverReceivedPlainText = serverCrypto->decryptDatagram(nullptr, dtlsMessage);
+ if (serverReceivedPlainText.size() > 0 || serverCrypto->dtlsError() != QDtlsError::InvalidInputParameters)
+ return testLoop.exitLoop();
+
+ serverReceivedPlainText = serverCrypto->decryptDatagram(&serverSocket, dtlsMessage);
+
+ const int messageType = dtlsMessage.data()[0];
+ if (serverReceivedPlainText != serverExpectedPlainText
+ && (messageType == 23 || messageType == 21)) {
+ // Type 23 is for application data, 21 is shutdown alert. Here we test
+ // write/read operations and shutdown alerts, not expecting and thus
+ // ignoring any other types of messages.
+ return testLoop.exitLoop();
+ }
+
+ if (serverCrypto->dtlsError() != QDtlsError::NoError)
+ return testLoop.exitLoop();
+
+ // Verify it cannot be done twice:
+ const QByteArray replayed = serverCrypto->decryptDatagram(&serverSocket, dtlsMessage);
+ if (replayed.size() > 0)
+ return testLoop.exitLoop();
+
+ if (serverCrypto->writeDatagramEncrypted(&serverSocket, clientExpectedPlainText) <= 0)
+ testLoop.exitLoop();
+ } else {
+ if (port != serverPort)
+ return;
+
+ if (clientExpectedPlainText == dtlsMessage) // What a disaster!
+ return testLoop.exitLoop();
+
+ clientReceivedPlainText = clientCrypto->decryptDatagram(&clientSocket, dtlsMessage);
+ testLoop.exitLoop();
+ }
+}
+
+void tst_QDtls::pskRequested(QSslPreSharedKeyAuthenticator *auth)
+{
+ Q_ASSERT(auth);
+
+ auth->setPreSharedKey(presharedKey);
+}
+
+void tst_QDtls::handleHandshakeTimeout()
+{
+ auto crypto = qobject_cast<QDtls *>(sender());
+ Q_ASSERT(crypto);
+
+ if (!crypto->handleTimeout(&clientSocket))
+ testLoop.exitLoop();
+}
+
+void tst_QDtls::clientServerData()
+{
+ QTest::addColumn<QSslSocket::SslMode>("mode");
+
+ QTest::addRow("client") << QSslSocket::SslClientMode;
+ QTest::addRow("server") << QSslSocket::SslServerMode;
+}
+
+void tst_QDtls::connectHandshakeReadingSlots()
+{
+ connect(&serverSocket, &QUdpSocket::readyRead, this, &tst_QDtls::handshakeReadyRead);
+ connect(&clientSocket, &QUdpSocket::readyRead, this, &tst_QDtls::handshakeReadyRead);
+}
+
+void tst_QDtls::connectEncryptedReadingSlots()
+{
+ serverSocket.disconnect();
+ clientSocket.disconnect();
+ connect(&serverSocket, &QUdpSocket::readyRead, this, &tst_QDtls::encryptedReadyRead);
+ connect(&clientSocket, &QUdpSocket::readyRead, this, &tst_QDtls::encryptedReadyRead);
+}
+
+bool tst_QDtls::verificationErrorDetected(QSslError::SslError code) const
+{
+ Q_ASSERT(clientCrypto.data());
+
+ const auto errors = clientCrypto->peerVerificationErrors();
+ for (const QSslError &error : errors) {
+ if (error.error() == code)
+ return true;
+ }
+
+ return false;
+}
+
+QHostAddress tst_QDtls::toNonAny(const QHostAddress &addr)
+{
+ if (addr == QHostAddress::Any || addr == QHostAddress::AnyIPv4)
+ return QHostAddress::LocalHost;
+ if (addr == QHostAddress::AnyIPv6)
+ return QHostAddress::LocalHostIPv6;
+ return addr;
+}
+
+QT_END_NAMESPACE
+
+QTEST_MAIN(tst_QDtls)
+
+#include "tst_qdtls.moc"
diff --git a/tests/auto/network/ssl/qdtlscookie/qdtlscookie.pro b/tests/auto/network/ssl/qdtlscookie/qdtlscookie.pro
new file mode 100644
index 0000000000..4caa89fe49
--- /dev/null
+++ b/tests/auto/network/ssl/qdtlscookie/qdtlscookie.pro
@@ -0,0 +1,15 @@
+CONFIG += testcase
+
+SOURCES += tst_qdtlscookie.cpp
+QT = core network-private testlib
+
+TARGET = tst_qdtlscookie
+
+win32 {
+ CONFIG(debug, debug|release) {
+ DESTDIR = debug
+ } else {
+ DESTDIR = release
+ }
+}
+
diff --git a/tests/auto/network/ssl/qdtlscookie/tst_qdtlscookie.cpp b/tests/auto/network/ssl/qdtlscookie/tst_qdtlscookie.cpp
new file mode 100644
index 0000000000..c90e9cb2c8
--- /dev/null
+++ b/tests/auto/network/ssl/qdtlscookie/tst_qdtlscookie.cpp
@@ -0,0 +1,478 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+
+#include <QtNetwork/qhostaddress.h>
+#include <QtNetwork/qsslsocket.h>
+#include <QtNetwork/qudpsocket.h>
+#include <QtNetwork/qdtls.h>
+
+#include <QtCore/qcryptographichash.h>
+#include <QtCore/qsharedpointer.h>
+#include <QtCore/qbytearray.h>
+#include <QtCore/qstring.h>
+#include <QtCore/qobject.h>
+#include <QtCore/qtimer.h>
+#include <QtCore/qdebug.h>
+
+#include <utility>
+#include <vector>
+
+QT_BEGIN_NAMESPACE
+
+#define STOP_ON_FAILURE \
+ if (QTest::currentTestFailed()) \
+ return;
+
+class tst_QDtlsCookie : public QObject
+{
+ Q_OBJECT
+
+public slots:
+ void initTestCase();
+ void init();
+
+private slots:
+ // Tests:
+ void construction();
+ void validateParameters_data();
+ void validateParameters();
+ void verifyClient();
+ void cookieGeneratorParameters();
+ void verifyMultipleClients();
+
+protected slots:
+ // Aux. functions:
+ void stopLoopOnMessage();
+ void serverReadyRead();
+ void clientReadyRead();
+ void handleClientTimeout();
+ void makeNoise();
+ void spawnClients();
+
+private:
+ void sendClientHello(QUdpSocket *socket, QDtls *handshake,
+ const QByteArray &serverMessage = {});
+ void receiveMessage(QUdpSocket *socket, QByteArray *message,
+ QHostAddress *address = nullptr,
+ quint16 *port = nullptr);
+
+ static QHostAddress toNonAny(const QHostAddress &addr);
+
+ enum AddressType
+ {
+ ValidAddress,
+ NullAddress,
+ BroadcastAddress,
+ MulticastAddress
+ };
+
+ QUdpSocket serverSocket;
+ QHostAddress serverAddress;
+ quint16 serverPort = 0;
+
+ QTestEventLoop testLoop;
+ int handshakeTimeoutMS = 500;
+
+ QDtlsClientVerifier listener;
+ using HandshakePtr = QSharedPointer<QDtls>;
+ HandshakePtr dtls;
+
+ const QCryptographicHash::Algorithm defaultHash =
+#ifdef QT_CRYPTOGRAPHICHASH_ONLY_SHA1
+ QCryptographicHash::Sha1;
+#else
+ QCryptographicHash::Sha256;
+#endif
+
+ using CookieParams = QDtlsClientVerifier::GeneratorParameters;
+
+ QUdpSocket noiseMaker;
+ QHostAddress spammerAddress;
+ QTimer noiseTimer;
+ quint16 spammerPort = 0;
+ const int noiseTimeoutMS = 5;
+
+ using SocketPtr = QSharedPointer<QUdpSocket>;
+ using ValidClient = QPair<SocketPtr, HandshakePtr>;
+ unsigned clientsToWait = 0;
+ unsigned clientsToAdd = 0;
+ std::vector<ValidClient> dtlsClients;
+ QTimer spawnTimer;
+};
+
+QHostAddress tst_QDtlsCookie::toNonAny(const QHostAddress &addr)
+{
+ if (addr == QHostAddress::Any || addr == QHostAddress::AnyIPv4)
+ return QHostAddress::LocalHost;
+ if (addr == QHostAddress::AnyIPv6)
+ return QHostAddress::LocalHostIPv6;
+ return addr;
+}
+
+void tst_QDtlsCookie::initTestCase()
+{
+ QVERIFY(noiseMaker.bind());
+ spammerAddress = toNonAny(noiseMaker.localAddress());
+ spammerPort = noiseMaker.localPort();
+}
+
+void tst_QDtlsCookie::init()
+{
+ if (serverSocket.state() != QAbstractSocket::UnconnectedState) {
+ serverSocket.close();
+ // Disconnect stopLoopOnMessage or serverReadyRead slots:
+ serverSocket.disconnect();
+ }
+
+ QCOMPARE(serverSocket.state(), QAbstractSocket::UnconnectedState);
+ QVERIFY(serverSocket.bind());
+
+ serverAddress = toNonAny(serverSocket.localAddress());
+ serverPort = serverSocket.localPort();
+
+ dtls.reset(new QDtls(QSslSocket::SslClientMode));
+ dtls->setPeer(serverAddress, serverPort);
+}
+
+void tst_QDtlsCookie::construction()
+{
+ QDtlsClientVerifier verifier;
+
+ QCOMPARE(verifier.dtlsError(), QDtlsError::NoError);
+ QCOMPARE(verifier.dtlsErrorString(), QString());
+ QCOMPARE(verifier.verifiedHello(), QByteArray());
+
+ const auto params = verifier.cookieGeneratorParameters();
+ QCOMPARE(params.hash, defaultHash);
+ QVERIFY(params.secret.size() > 0);
+}
+
+void tst_QDtlsCookie::validateParameters_data()
+{
+ QTest::addColumn<bool>("invalidSocket");
+ QTest::addColumn<bool>("emptyDatagram");
+ QTest::addColumn<int>("addressType");
+
+ QTest::addRow("socket") << true << false << int(ValidAddress);
+ QTest::addRow("dgram") << false << true << int(ValidAddress);
+ QTest::addRow("addr(invalid)") << false << false << int(NullAddress);
+ QTest::addRow("addr(broadcast)") << false << false << int(BroadcastAddress);
+ QTest::addRow("addr(multicast)") << false << false << int(MulticastAddress);
+
+ QTest::addRow("socket-dgram") << true << true << int(ValidAddress);
+ QTest::addRow("socket-dgram-addr(invalid)") << true << true << int(NullAddress);
+ QTest::addRow("socket-dgram-addr(broadcast)") << true << true << int(BroadcastAddress);
+ QTest::addRow("socket-dgram-addr(multicast)") << true << true << int(MulticastAddress);
+
+ QTest::addRow("dgram-addr(invalid)") << false << true << int(NullAddress);
+ QTest::addRow("dgram-addr(broadcast)") << false << true << int(BroadcastAddress);
+ QTest::addRow("dgram-addr(multicast)") << false << true << int(MulticastAddress);
+
+ QTest::addRow("socket-addr(invalid)") << true << false << int(NullAddress);
+ QTest::addRow("socket-addr(broadcast)") << true << false << int(BroadcastAddress);
+ QTest::addRow("socket-addr(multicast)") << true << false << int(MulticastAddress);
+}
+
+void tst_QDtlsCookie::validateParameters()
+{
+ connect(&serverSocket, &QUdpSocket::readyRead, this,
+ &tst_QDtlsCookie::stopLoopOnMessage);
+
+ QFETCH(const bool, invalidSocket);
+ QFETCH(const bool, emptyDatagram);
+ QFETCH(const int, addressType);
+
+ QUdpSocket clientSocket;
+ QByteArray hello;
+ QHostAddress clientAddress;
+ quint16 clientPort = 0;
+
+ sendClientHello(&clientSocket, dtls.data());
+ STOP_ON_FAILURE
+ receiveMessage(&serverSocket, &hello, &clientAddress, &clientPort);
+ STOP_ON_FAILURE
+
+ switch (addressType) {
+ case MulticastAddress:
+ clientAddress.setAddress(QStringLiteral("224.0.0.0"));
+ break;
+ case BroadcastAddress:
+ clientAddress = QHostAddress::Broadcast;
+ break;
+ case NullAddress:
+ clientAddress = {};
+ break;
+ }
+
+ if (emptyDatagram)
+ hello.clear();
+
+ QUdpSocket *socket = invalidSocket ? nullptr : &serverSocket;
+ QCOMPARE(listener.verifyClient(socket, hello, clientAddress, clientPort), false);
+ QCOMPARE(listener.verifiedHello(), QByteArray());
+ QCOMPARE(listener.dtlsError(), QDtlsError::InvalidInputParameters);
+}
+
+void tst_QDtlsCookie::verifyClient()
+{
+ connect(&serverSocket, &QUdpSocket::readyRead, this,
+ &tst_QDtlsCookie::stopLoopOnMessage);
+
+ QUdpSocket clientSocket;
+ connect(&clientSocket, &QUdpSocket::readyRead, this,
+ &tst_QDtlsCookie::stopLoopOnMessage);
+
+ // Client: send an initial ClientHello message without any cookie:
+ sendClientHello(&clientSocket, dtls.data());
+ STOP_ON_FAILURE
+ // Server: read the first ClientHello message:
+ QByteArray dgram;
+ QHostAddress clientAddress;
+ quint16 clientPort = 0;
+ receiveMessage(&serverSocket, &dgram, &clientAddress, &clientPort);
+ STOP_ON_FAILURE
+ // Server: reply with a verify hello request (the client is not verified yet):
+ QCOMPARE(listener.verifyClient(&serverSocket, dgram, clientAddress, clientPort), false);
+ QCOMPARE(listener.verifiedHello(), QByteArray());
+ QCOMPARE(listener.dtlsError(), QDtlsError::NoError);
+ // Client: read hello verify request:
+ receiveMessage(&clientSocket, &dgram);
+ STOP_ON_FAILURE
+ // Client: send a new hello message, this time with a cookie attached:
+ sendClientHello(&clientSocket, dtls.data(), dgram);
+ STOP_ON_FAILURE
+ // Server: read a client-verified message:
+ receiveMessage(&serverSocket, &dgram, &clientAddress, &clientPort);
+ STOP_ON_FAILURE
+ // Client's readyRead is not interesting anymore:
+ clientSocket.close();
+
+ // Verify with the address and port we extracted, do it twice (DTLS "listen"
+ // must be stateless and work as many times as needed):
+ for (int i = 0; i < 2; ++i) {
+ QCOMPARE(listener.verifyClient(&serverSocket, dgram, clientAddress, clientPort), true);
+ QCOMPARE(listener.verifiedHello(), dgram);
+ QCOMPARE(listener.dtlsError(), QDtlsError::NoError);
+ }
+
+ // Test that another freshly created (stateless) verifier can verify:
+ QDtlsClientVerifier anotherListener;
+ QCOMPARE(anotherListener.verifyClient(&serverSocket, dgram, clientAddress,
+ clientPort), true);
+ QCOMPARE(anotherListener.verifiedHello(), dgram);
+ QCOMPARE(anotherListener.dtlsError(), QDtlsError::NoError);
+ // Now let's use a wrong port:
+ QCOMPARE(listener.verifyClient(&serverSocket, dgram, clientAddress, serverPort), false);
+ // Invalid cookie, no verified hello message:
+ QCOMPARE(listener.verifiedHello(), QByteArray());
+ // But it's UDP so we ignore this "fishy datagram", no error expected:
+ QCOMPARE(listener.dtlsError(), QDtlsError::NoError);
+}
+
+void tst_QDtlsCookie::cookieGeneratorParameters()
+{
+ CookieParams params;// By defualt, 'secret' is empty.
+ QCOMPARE(listener.setCookieGeneratorParameters(params), false);
+ QCOMPARE(listener.dtlsError(), QDtlsError::InvalidInputParameters);
+ params.secret = "abcdefghijklmnopqrstuvwxyz";
+ QCOMPARE(listener.setCookieGeneratorParameters(params), true);
+ QCOMPARE(listener.dtlsError(), QDtlsError::NoError);
+}
+
+void tst_QDtlsCookie::verifyMultipleClients()
+{
+ // 'verifyClient' above was quite simple - it's like working with blocking
+ // sockets, step by step - we write, then make sure we read a datagram back
+ // etc. This test is more asynchronous - we are running an event loop and don't
+ // stop on the first datagram received, instead, we spawn many clients
+ // with which to exchange handshake messages and verify requests, while at
+ // the same time dealing with a 'noise maker' - a fake DTLS client, who keeps
+ // spamming our server with non-DTLS datagrams and initial ClientHello
+ // messages, but never replies to client verify requests.
+ connect(&serverSocket, &QUdpSocket::readyRead, this, &tst_QDtlsCookie::serverReadyRead);
+
+ noiseTimer.setInterval(noiseTimeoutMS);
+ connect(&noiseTimer, &QTimer::timeout, this, &tst_QDtlsCookie::makeNoise);
+
+ spawnTimer.setInterval(noiseTimeoutMS * 10);
+ connect(&spawnTimer, &QTimer::timeout, this, &tst_QDtlsCookie::spawnClients);
+
+ noiseTimer.start();
+ spawnTimer.start();
+
+ clientsToAdd = clientsToWait = 100;
+
+ testLoop.enterLoop(handshakeTimeoutMS * clientsToWait);
+ QVERIFY(!testLoop.timeout());
+ QVERIFY(clientsToWait == 0);
+}
+
+void tst_QDtlsCookie::sendClientHello(QUdpSocket *socket, QDtls *dtls,
+ const QByteArray &serverMessage)
+{
+ Q_ASSERT(socket && dtls);
+ dtls->doHandshake(socket, serverMessage);
+ // We don't really care about QDtls in this auto-test, but must be
+ // sure that we, indeed, sent our hello and if not - stop early without
+ // running event loop:
+ QCOMPARE(dtls->dtlsError(), QDtlsError::NoError);
+ // We never complete a handshake, so it must be 'HandshakeInProgress':
+ QCOMPARE(dtls->handshakeState(), QDtls::HandshakeInProgress);
+}
+
+void tst_QDtlsCookie::receiveMessage(QUdpSocket *socket, QByteArray *message,
+ QHostAddress *address, quint16 *port)
+{
+ Q_ASSERT(socket && message);
+
+ if (!socket->pendingDatagramSize())
+ testLoop.enterLoopMSecs(handshakeTimeoutMS);
+
+ QVERIFY(!testLoop.timeout());
+ QVERIFY(socket->pendingDatagramSize());
+
+ message->resize(socket->pendingDatagramSize());
+ const qint64 read = socket->readDatagram(message->data(), message->size(),
+ address, port);
+ QVERIFY(read > 0);
+
+ message->resize(read);
+ if (address)
+ QVERIFY(!address->isNull());
+}
+
+void tst_QDtlsCookie::stopLoopOnMessage()
+{
+ testLoop.exitLoop();
+}
+
+void tst_QDtlsCookie::serverReadyRead()
+{
+ Q_ASSERT(clientsToWait);
+
+ if (!serverSocket.pendingDatagramSize())
+ return;
+
+ QByteArray hello;
+ QHostAddress clientAddress;
+ quint16 clientPort = 0;
+
+ receiveMessage(&serverSocket, &hello, &clientAddress, &clientPort);
+ if (QTest::currentTestFailed())
+ return testLoop.exitLoop();
+
+ const bool ok = listener.verifyClient(&serverSocket, hello, clientAddress, clientPort);
+ if (listener.dtlsError() != QDtlsError::NoError) {
+ // exit early, let the test fail.
+ return testLoop.exitLoop();
+ }
+
+ if (!ok) // not verified yet.
+ return;
+
+ if (clientAddress == spammerAddress && clientPort == spammerPort) // should never happen
+ return testLoop.exitLoop();
+
+ --clientsToWait;
+ if (!clientsToWait) // done, success.
+ testLoop.exitLoop();
+}
+
+void tst_QDtlsCookie::clientReadyRead()
+{
+ QUdpSocket *clientSocket = qobject_cast<QUdpSocket *>(sender());
+ Q_ASSERT(clientSocket);
+
+ if (!clientSocket->pendingDatagramSize())
+ return;
+
+ QDtls *handshake = nullptr;
+ for (ValidClient &client : dtlsClients) {
+ if (client.first.data() == clientSocket) {
+ handshake = client.second.data();
+ break;
+ }
+ }
+
+ Q_ASSERT(handshake);
+
+ QByteArray response;
+ receiveMessage(clientSocket, &response);
+ if (QTest::currentTestFailed() || !handshake->doHandshake(clientSocket, response))
+ testLoop.exitLoop();
+}
+
+void tst_QDtlsCookie::makeNoise()
+{
+ noiseMaker.writeDatagram({"Hello, my little DTLS server, take this useless dgram!"},
+ serverAddress, serverPort);
+ QDtls fakeHandshake(QSslSocket::SslClientMode);
+ fakeHandshake.setPeer(serverAddress, serverPort);
+ fakeHandshake.doHandshake(&noiseMaker, {});
+}
+
+void tst_QDtlsCookie::spawnClients()
+{
+ for (int i = 0; i < 10 && clientsToAdd; ++i, --clientsToAdd) {
+ ValidClient newClient;
+ newClient.first.reset(new QUdpSocket);
+ connect(newClient.first.data(), &QUdpSocket::readyRead,
+ this, &tst_QDtlsCookie::clientReadyRead);
+ newClient.second.reset(new QDtls(QSslSocket::SslClientMode));
+ newClient.second->setPeer(serverAddress, serverPort);
+ connect(newClient.second.data(), &QDtls::handshakeTimeout,
+ this, &tst_QDtlsCookie::handleClientTimeout);
+ newClient.second->doHandshake(newClient.first.data(), {});
+ dtlsClients.push_back(std::move(newClient));
+ }
+}
+
+void tst_QDtlsCookie::handleClientTimeout()
+{
+ QDtls *handshake = qobject_cast<QDtls *>(sender());
+ Q_ASSERT(handshake);
+
+ QUdpSocket *clientSocket = nullptr;
+ for (ValidClient &client : dtlsClients) {
+ if (client.second.data() == handshake) {
+ clientSocket = client.first.data();
+ break;
+ }
+ }
+
+ Q_ASSERT(clientSocket);
+ handshake->handleTimeout(clientSocket);
+}
+
+QT_END_NAMESPACE
+
+QTEST_MAIN(tst_QDtlsCookie)
+
+#include "tst_qdtlscookie.moc"
diff --git a/tests/auto/network/ssl/qpassworddigestor/qpassworddigestor.pro b/tests/auto/network/ssl/qpassworddigestor/qpassworddigestor.pro
new file mode 100644
index 0000000000..3e2685f579
--- /dev/null
+++ b/tests/auto/network/ssl/qpassworddigestor/qpassworddigestor.pro
@@ -0,0 +1,4 @@
+CONFIG += testcase
+TARGET = tst_qpassworddigestor
+QT = core network testlib
+SOURCES = tst_qpassworddigestor.cpp
diff --git a/tests/auto/network/ssl/qpassworddigestor/tst_qpassworddigestor.cpp b/tests/auto/network/ssl/qpassworddigestor/tst_qpassworddigestor.cpp
new file mode 100644
index 0000000000..bbd6c72ca8
--- /dev/null
+++ b/tests/auto/network/ssl/qpassworddigestor/tst_qpassworddigestor.cpp
@@ -0,0 +1,171 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <QtNetwork/qpassworddigestor.h>
+#include <QtCore/QByteArray>
+
+class tst_QPasswordDigestor : public QObject
+{
+ Q_OBJECT
+private Q_SLOTS:
+ void pbkdf1Vectors_data();
+ void pbkdf1Vectors();
+ void pbkdf2Vectors_data();
+ void pbkdf2Vectors();
+};
+
+void tst_QPasswordDigestor::pbkdf1Vectors_data()
+{
+ QTest::addColumn<QCryptographicHash::Algorithm>("algorithm");
+ QTest::addColumn<QByteArray>("password");
+ QTest::addColumn<QByteArray>("salt");
+ QTest::addColumn<int>("iterations");
+ QTest::addColumn<int>("dkLen");
+ QTest::addColumn<QByteArray>("result");
+
+ // data from
+ // https://web.archive.org/web/20160912052752/https://www.di-mgt.com.au/cryptoKDFs.html#examplespbkdf
+ // (Note: this is not official, but at least it's something to compare with.)
+ QTest::newRow("di-mgt") << QCryptographicHash::Sha1 << QByteArray::fromHex("70617373776F7264")
+ << QByteArray::fromHex("78578E5A5D63CB06") << 1000 << 16
+ << QByteArray::fromHex("DC19847E05C64D2FAF10EBFB4A3D2A20");
+}
+
+void tst_QPasswordDigestor::pbkdf1Vectors()
+{
+ QFETCH(QCryptographicHash::Algorithm, algorithm);
+ QFETCH(QByteArray, password);
+ QFETCH(QByteArray, salt);
+ QFETCH(int, iterations);
+ QFETCH(int, dkLen);
+ QFETCH(QByteArray, result);
+
+ QCOMPARE(QPasswordDigestor::deriveKeyPbkdf1(algorithm, password, salt, iterations, dkLen), result);
+}
+
+void tst_QPasswordDigestor::pbkdf2Vectors_data()
+{
+ QTest::addColumn<QCryptographicHash::Algorithm>("algorithm");
+ QTest::addColumn<QByteArray>("password");
+ QTest::addColumn<QByteArray>("salt");
+ QTest::addColumn<int>("iterations");
+ QTest::addColumn<int>("dkLen");
+ QTest::addColumn<QByteArray>("result");
+
+ // data from https://tools.ietf.org/html/rfc6070
+ auto hash = QCryptographicHash::Sha1;
+ QTest::newRow("rfc6070-1") << hash << QByteArrayLiteral("password") << QByteArrayLiteral("salt")
+ << 1 << 20
+ << QByteArray::fromHex("0c60c80f961f0e71f3a9b524af6012062fe037a6");
+ QTest::newRow("rfc6070-2") << hash << QByteArrayLiteral("password") << QByteArrayLiteral("salt")
+ << 2 << 20
+ << QByteArray::fromHex("ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957");
+ QTest::newRow("rfc6070-3") << hash << QByteArrayLiteral("password") << QByteArrayLiteral("salt")
+ << 4096 << 20
+ << QByteArray::fromHex("4b007901b765489abead49d926f721d065a429c1");
+#if 0
+ // Excluding: takes about 3 minutes to run
+ QTest::newRow("rfc6070-4") << hash << QByteArrayLiteral("password") << QByteArrayLiteral("salt")
+ << 16777216 << 20
+ << QByteArray::fromHex("eefe3d61cd4da4e4e9945b3d6ba2158c2634e984");
+#endif
+ QTest::newRow("rfc6070-5") << hash << QByteArrayLiteral("passwordPASSWORDpassword")
+ << QByteArrayLiteral("saltSALTsaltSALTsaltSALTsaltSALTsalt") << 4096
+ << 25
+ << QByteArray::fromHex(
+ "3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038");
+ QTest::newRow("rfc6070-6") << hash << QByteArrayLiteral("pass\0word")
+ << QByteArrayLiteral("sa\0lt") << 4096 << 16
+ << QByteArray::fromHex("56fa6aa75548099dcc37d7f03425e0c3");
+
+ // the next few bits of data are from https://tools.ietf.org/html/rfc3962#appendix-B
+ QByteArray password = QByteArrayLiteral("password");
+ QByteArray salt = QByteArrayLiteral("ATHENA.MIT.EDUraeburn");
+ QTest::newRow("rfc3962-1") << hash << password << salt << 1 << 16
+ << QByteArray::fromHex("cdedb5281bb2f801565a1122b2563515");
+ QTest::newRow("rfc3962-2")
+ << hash << password << salt << 1 << 32
+ << QByteArray::fromHex("cdedb5281bb2f801565a1122b25635150ad1f7a04bb9f3a333ecc0e2e1f70837");
+ QTest::newRow("rfc3962-3") << hash << password << salt << 2 << 16
+ << QByteArray::fromHex("01dbee7f4a9e243e988b62c73cda935d");
+ QTest::newRow("rfc3962-4")
+ << hash << QByteArrayLiteral("password") << salt << 2 << 32
+ << QByteArray::fromHex("01dbee7f4a9e243e988b62c73cda935da05378b93244ec8f48a99e61ad799d86");
+ QTest::newRow("rfc3962-5") << hash << password << salt << 1200 << 16
+ << QByteArray::fromHex("5c08eb61fdf71e4e4ec3cf6ba1f5512b");
+ QTest::newRow("rfc3962-6")
+ << hash << password << salt << 1200 << 32
+ << QByteArray::fromHex("5c08eb61fdf71e4e4ec3cf6ba1f5512ba7e52ddbc5e5142f708a31e2e62b1e13");
+
+ salt = QByteArray::fromHex("1234567878563412"); // 0x1234567878563412
+ QTest::newRow("rfc3962-7") << hash << password << salt << 5 << 16
+ << QByteArray::fromHex("d1daa78615f287e6a1c8b120d7062a49");
+ QTest::newRow("rfc3962-8")
+ << hash << password << salt << 5 << 32
+ << QByteArray::fromHex("d1daa78615f287e6a1c8b120d7062a493f98d203e6be49a6adf4fa574b6e64ee");
+
+ password = QByteArray(64, 'X');
+ salt = "pass phrase equals block size";
+ QTest::newRow("rfc3962-9") << hash << password << salt << 1200 << 16
+ << QByteArray::fromHex("139c30c0966bc32ba55fdbf212530ac9");
+ QTest::newRow("rfc3962-10")
+ << hash << password << salt << 1200 << 32
+ << QByteArray::fromHex("139c30c0966bc32ba55fdbf212530ac9c5ec59f1a452f5cc9ad940fea0598ed1");
+
+ password.append('X');
+ salt = "pass phrase exceeds block size";
+ QTest::newRow("rfc3962-11") << hash << password << salt << 1200 << 16
+ << QByteArray::fromHex("9ccad6d468770cd51b10e6a68721be61");
+ QTest::newRow("rfc3962-12")
+ << hash << password << salt << 1200 << 32
+ << QByteArray::fromHex("9ccad6d468770cd51b10e6a68721be611a8b4d282601db3b36be9246915ec82a");
+
+ password = QByteArray::fromHex("f09d849e"); // 0xf09d849e
+ salt = "EXAMPLE.COMpianist";
+ QTest::newRow("rfc3962-13") << hash << password << salt << 50 << 16
+ << QByteArray::fromHex("6b9cf26d45455a43a5b8bb276a403b39");
+ QTest::newRow("rfc3962-14")
+ << hash << password << salt << 50 << 32
+ << QByteArray::fromHex("6b9cf26d45455a43a5b8bb276a403b39e7fe37a0c41e02c281ff3069e1e94f52");
+}
+
+void tst_QPasswordDigestor::pbkdf2Vectors()
+{
+ QFETCH(QCryptographicHash::Algorithm, algorithm);
+ QFETCH(QByteArray, password);
+ QFETCH(QByteArray, salt);
+ QFETCH(int, iterations);
+ QFETCH(int, dkLen);
+ QFETCH(QByteArray, result);
+
+ QCOMPARE(QPasswordDigestor::deriveKeyPbkdf2(algorithm, password, salt, iterations, dkLen), result);
+}
+
+QTEST_MAIN(tst_QPasswordDigestor)
+#include "tst_qpassworddigestor.moc"
diff --git a/tests/auto/network/ssl/qsslcertificate/qsslcertificate.pro b/tests/auto/network/ssl/qsslcertificate/qsslcertificate.pro
index 7c1cd5b66b..7e6870f74b 100644
--- a/tests/auto/network/ssl/qsslcertificate/qsslcertificate.pro
+++ b/tests/auto/network/ssl/qsslcertificate/qsslcertificate.pro
@@ -1,7 +1,6 @@
CONFIG += testcase
SOURCES += tst_qsslcertificate.cpp
-win32:LIBS += -lws2_32
QT = core network testlib
TARGET = tst_qsslcertificate
diff --git a/tests/auto/network/ssl/qsslcipher/qsslcipher.pro b/tests/auto/network/ssl/qsslcipher/qsslcipher.pro
index 81ef2d8d9a..392d22c054 100644
--- a/tests/auto/network/ssl/qsslcipher/qsslcipher.pro
+++ b/tests/auto/network/ssl/qsslcipher/qsslcipher.pro
@@ -1,7 +1,6 @@
CONFIG += testcase
SOURCES += tst_qsslcipher.cpp
-win32:LIBS += -lws2_32
QT = core network testlib
TARGET = tst_qsslcipher
diff --git a/tests/auto/network/ssl/qssldiffiehellmanparameters/qssldiffiehellmanparameters.pro b/tests/auto/network/ssl/qssldiffiehellmanparameters/qssldiffiehellmanparameters.pro
index dee95886e0..2d45f4476c 100644
--- a/tests/auto/network/ssl/qssldiffiehellmanparameters/qssldiffiehellmanparameters.pro
+++ b/tests/auto/network/ssl/qssldiffiehellmanparameters/qssldiffiehellmanparameters.pro
@@ -2,7 +2,6 @@ CONFIG += testcase
CONFIG += parallel_test
SOURCES += tst_qssldiffiehellmanparameters.cpp
-win32: LIBS += -lws2_32
QT = core network testlib
TARGET = tst_qssldiffiehellmanparameters
diff --git a/tests/auto/network/ssl/qsslellipticcurve/qsslellipticcurve.pro b/tests/auto/network/ssl/qsslellipticcurve/qsslellipticcurve.pro
index a180086c5e..7eae6ae864 100644
--- a/tests/auto/network/ssl/qsslellipticcurve/qsslellipticcurve.pro
+++ b/tests/auto/network/ssl/qsslellipticcurve/qsslellipticcurve.pro
@@ -1,7 +1,6 @@
CONFIG += testcase
SOURCES += tst_qsslellipticcurve.cpp
-win32:LIBS += -lws2_32
QT = core network testlib
TARGET = tst_qsslellipticcurve
diff --git a/tests/auto/network/ssl/qsslerror/qsslerror.pro b/tests/auto/network/ssl/qsslerror/qsslerror.pro
index 117fd4ac27..83644d093c 100644
--- a/tests/auto/network/ssl/qsslerror/qsslerror.pro
+++ b/tests/auto/network/ssl/qsslerror/qsslerror.pro
@@ -1,7 +1,6 @@
CONFIG += testcase
SOURCES += tst_qsslerror.cpp
-win32:LIBS += -lws2_32
QT = core network testlib
TARGET = tst_qsslerror
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-MD5-DES.der b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-MD5-DES.der
new file mode 100644
index 0000000000..e70bde5820
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-MD5-DES.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-MD5-DES.pem b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-MD5-DES.pem
new file mode 100644
index 0000000000..fd62743d94
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-MD5-DES.pem
@@ -0,0 +1,8 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIHwMBsGCSqGSIb3DQEFAzAOBAiBYHv8jvBwMQICCAAEgdCwfamafrN1nvpdnF5t
+KCPgBvRGfV9zStK+XItBAe72CZdAy1Jjr2UJHc8Rl3OEo2hmCr+892/lhK7GIugj
+oLOvON3VEqrUvrvmH0Qtm+/A/ypq14Lr4sBfq7bViM44bv/DUwHMD5/xmLtSzXlC
+AjjioBJ/k4K+6DzD3+eMDNr6Z9rCUcvJP6q8+PPhpIXEJquA3RYuyuDhdIbazO5A
+iMts7PbzBzW/4YhENPWaUdviuRZo/ap+WDJ/SdwiNxOxx7KrWgj3y2dAtNnVAv5T
+njE4
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-MD5-RC2-64.der b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-MD5-RC2-64.der
new file mode 100644
index 0000000000..40bbe6a441
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-MD5-RC2-64.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-MD5-RC2-64.pem b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-MD5-RC2-64.pem
new file mode 100644
index 0000000000..6a8a8484e0
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-MD5-RC2-64.pem
@@ -0,0 +1,8 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIHwMBsGCSqGSIb3DQEFBjAOBAga2K6FvYk1ygICCAAEgdCV9m57p+DrBrVafXUq
+8pgdr+1FEX9YaFXNRMKyPZ5Ca6t5RsPpWC3RdGlieH4iVp03/rlTttx0rLUWx3IG
+gsrd2adrP6Bl/lbEJnZ6lIeZz2KvPbbhfmRMCIhr/h24JSi5lmGl5KzxQXSm9ujb
+/5jtN/QtoQ3cLWpNn1SwMNdIAYgEpnCghwqITbBwMovD8yd2YNbNbejG/T+q6bwl
+GJE46OSX+IAWQ/wJejdq//ozD3m2PxjK6nktWeqAeoqcycYGYGKvta27lNqyuE3M
+BdGT
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-SHA1-DES.der b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-SHA1-DES.der
new file mode 100644
index 0000000000..6ebe9c4011
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-SHA1-DES.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-SHA1-DES.pem b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-SHA1-DES.pem
new file mode 100644
index 0000000000..3422931606
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-SHA1-DES.pem
@@ -0,0 +1,8 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIHwMBsGCSqGSIb3DQEFCjAOBAjj2EIj8WAOWwICCAAEgdB4G1oLnLtLAGaZtpGb
+vU2g4g3pJtQLJX1H0a/cmXO1OrX7YRcESvw8nocZjNKKWCehfQqinRBpVUsoaGUw
+QssIDKlWkW3LbM11F6YMI5GCzN5bpWcJazQRyHEnIk/OTQN3aeKjnYQXep1nt7tN
+INKsCAVyx1cYfr3izxGRwN2hTraz5fBdeBpEye+Essn5KziwET32EbW+kt+wsule
+k4tvnKgCOvbvVzqIdafH/FfP04KRv39O+HR3evoBjhGudUxXJ0OLp8IZkG+34f3P
+ZQxC
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-SHA1-RC2-64.der b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-SHA1-RC2-64.der
new file mode 100644
index 0000000000..c8ae94c4f8
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-SHA1-RC2-64.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-SHA1-RC2-64.pem b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-SHA1-RC2-64.pem
new file mode 100644
index 0000000000..93857f010b
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-PBE-SHA1-RC2-64.pem
@@ -0,0 +1,8 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIHwMBsGCSqGSIb3DQEFCzAOBAgrv/kKBXNFAwICCAAEgdAFpWxMmQygufWZpeAI
+heJ3uqyb5bnahW75t2HWQZTb1qEqp62/iLr1IlbHmZAQbJc0+VLhXz/2QtK3q/BB
+bHpa9cWGFi2HVgO4dFjSI7X68QrM93GPGHqwtnVZnlo2aPHgA6BzotEEwklXl4Db
+BbPKo0vBUVA9ZKaN0lH+Pzj/Rb37kC6xRWBjNd87jaszykcNFYkTNrrG8nESHJAw
+fTeHwrsGsmIz8FfOxRfqXrPwOiA5AZZ/S/8Jt2gtoOW5ydY6/Bfp0aEwAIhwxjFJ
+cy6N
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes128-hmacWithSHA1.der b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes128-hmacWithSHA1.der
new file mode 100644
index 0000000000..2c2caa0665
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes128-hmacWithSHA1.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes128-hmacWithSHA1.pem b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes128-hmacWithSHA1.pem
new file mode 100644
index 0000000000..0797d9167f
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes128-hmacWithSHA1.pem
@@ -0,0 +1,9 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBHjBJBgkqhkiG9w0BBQ0wPDAbBgkqhkiG9w0BBQwwDgQI8mhki8A7ijgCAggA
+MB0GCWCGSAFlAwQBAgQQbVjLreAybYGwsnk4ZMQUIgSB0Ozr2DfP+rkb58tT748m
++7xe+bhpT3xrrSpUsB2RXUH/6M7hVjb+XZ/JSAegqkuZq08df+ezpHjWX/W+IVL4
+Sx0wZWNW51TiwGymNFuBwSVliqCvndAaY+EIY3bsME5RFik86R4iAbtrxalWPFoR
+jscLkGtNstQR5JQCOccTN7h5jRBwEFrArqfPv+XZb5ysy9FjFnVDuspFg/CysIJD
+V7WEJcxOzEIk2bbxY4UEpLhfFv8RHrV8M7jmjVRC+mN094zMnzBVSv8KIjk0Ljff
+ysY=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes128-hmacWithSHA256.der b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes128-hmacWithSHA256.der
new file mode 100644
index 0000000000..3f3bd2e8ea
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes128-hmacWithSHA256.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes128-hmacWithSHA256.pem b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes128-hmacWithSHA256.pem
new file mode 100644
index 0000000000..e78d69ae8a
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes128-hmacWithSHA256.pem
@@ -0,0 +1,9 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBLDBXBgkqhkiG9w0BBQ0wSjApBgkqhkiG9w0BBQwwHAQICIPD0G0X/sECAggA
+MAwGCCqGSIb3DQIJBQAwHQYJYIZIAWUDBAECBBDSrIv/kITtQ/RL5j675WqsBIHQ
+oSiQJLyXPOmnNYmWLw4Biom8Utn/I8109mUujVPhUA63njp0I/jGwNn4FcdilZlO
+TTCKIxlzG3zhztS5xqxQFuzWNQdTgfqzO7DSi/ZtGErvZi+ShaiQU7ri7LYRIw8C
+7YtXiPrfPSKpfyU0adD2socAa1OlnvinoaHYd/QNs4EEv3hahIiq/nHpzRkb2qdX
+XIruJhlvF4B07aYfmRvMK4CVd6VGXfGfGXECFqMk5b7HwJzkMTbtB2bsMTNguGxK
+o1+Hf3PHRst6q1776z8ENw==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes256-hmacWithSHA1.der b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes256-hmacWithSHA1.der
new file mode 100644
index 0000000000..f078644544
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes256-hmacWithSHA1.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes256-hmacWithSHA1.pem b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes256-hmacWithSHA1.pem
new file mode 100644
index 0000000000..9a6b147602
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes256-hmacWithSHA1.pem
@@ -0,0 +1,9 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBHjBJBgkqhkiG9w0BBQ0wPDAbBgkqhkiG9w0BBQwwDgQIdlQB+08q40gCAggA
+MB0GCWCGSAFlAwQBKgQQ3dY2cSZfdPyeYlHRO+M63wSB0DjoR/cQ2rLkW1Ur8V1q
+LG/0nv0O1mVK8Sj+BcOje/nqMU67lRdkXVI1yICmpwrwFEkwIV6zHIx+Dwriliel
+h0yXsTLaBmMQeJo17J6kOyuW+C0Mr8CqlnAVEoEQI7FPes7rtw6W0wkuuPPw3vEs
+RKB8xwdfS5t5ot5DtKZ5rN+6XbtRA/jdfi1O6ekKzeT0fpRGP+ppTEmCh77+8Ity
+/BwPKGXepZpHkOcDOvWGdDiuy7vhA5gaYyzpXPD2Fo3V5cobFzgLzT3in+b6YtV4
+s/4=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes256-hmacWithSHA256.der b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes256-hmacWithSHA256.der
new file mode 100644
index 0000000000..618be6ad9c
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes256-hmacWithSHA256.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes256-hmacWithSHA256.pem b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes256-hmacWithSHA256.pem
new file mode 100644
index 0000000000..a82c2fbc94
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-aes256-hmacWithSHA256.pem
@@ -0,0 +1,9 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBLDBXBgkqhkiG9w0BBQ0wSjApBgkqhkiG9w0BBQwwHAQIVsIsQ3kPm5gCAggA
+MAwGCCqGSIb3DQIJBQAwHQYJYIZIAWUDBAEqBBAOdrxyNKYeoKCTuDXeYiwpBIHQ
+DheVgnsmJ7bYb5Y02qOdCjfYEUje8bvendhIsG41recaNjdHcWQB1JOV8anmZPJ+
+4buMQhE9Lfw5Hvg2x0pqkvQCV0aUWUwwybnoQ9T8z0z67WJG6f03m9eE+Mzw9Q0D
+wavghqO/lnh9uGd4Tdfzuj0NWHbrey7ags81fZ9jWOdX/M5LywFr7oThokfq6LlH
+rpnK13j9MUVrmmSvsjVXGjWErEaTXbJOpCeyDn1510iI5pyGRZpicmfHzE6YNHvF
+dKSlxRWO+cOxE9Ax9dm5mg==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-des3-hmacWithSHA1.der b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-des3-hmacWithSHA1.der
new file mode 100644
index 0000000000..33ca45e2c9
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-des3-hmacWithSHA1.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-des3-hmacWithSHA1.pem b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-des3-hmacWithSHA1.pem
new file mode 100644
index 0000000000..ec276fd807
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-des3-hmacWithSHA1.pem
@@ -0,0 +1,8 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBFTBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIwE9ZHpXAOK8CAggA
+MBQGCCqGSIb3DQMHBAgOtF6y98HdvQSB0KtvnVtpFqjG8OLzPyZrugisgiYBgvoU
+62D+rfO5Ji4cbWwuQEeS3ywI7rHH6BG8+mxcVeQHSmGZi336M/j0erO/yo6MnkrU
+a8pfrqfPvLJPa+2FPSWlM/+ppj+kcaZa0B8pF/mioBThID8KhDFm8CG4UwP4P2Kn
+GUUGmM9cyNdPFWuVg8PyY1zHcx2GNiL4XZcKp1qsGf75uso8DmgrvI+c9yDD+5ag
+rPmsgFSy3XtlNmYGyLq1pW4rQ6ivLknZc5oweqjISVT3jKjJqowgJYo=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-des3-hmacWithSHA256.der b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-des3-hmacWithSHA256.der
new file mode 100644
index 0000000000..6d23cd3604
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-des3-hmacWithSHA256.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-des3-hmacWithSHA256.pem b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-des3-hmacWithSHA256.pem
new file mode 100644
index 0000000000..f33f0dc4c4
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-des3-hmacWithSHA256.pem
@@ -0,0 +1,9 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBIzBOBgkqhkiG9w0BBQ0wQTApBgkqhkiG9w0BBQwwHAQI584onGZg/sMCAggA
+MAwGCCqGSIb3DQIJBQAwFAYIKoZIhvcNAwcECMEvKBdjD2B+BIHQlCNsdhKhN8ce
+l73RzS4AUNbPamaLPV+l+vy8F4jjziCux0RwS/83ju/XlD/TntSYH4RYx/2vNHo5
+/YVGinOSTHZD7BqHHOxTjMqlVY4uFU2oJcGQ2VIsbVuPiL78Tq6XcuaIy5ElXjte
+g/qa8y9/cJM9wm6O1XMfIIL6AboBdbVloStvij3HOOOOlZp6161+QlmADdo2yJJ2
+byP7SoC4I6fLDrKZub8+AEcPFCjvLZ6a9HmCF8aw/rvVqOZ91YJOxgsPYYmOXJtG
+sYzN48y81w==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-2DES.der b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-2DES.der
new file mode 100644
index 0000000000..f195c03e3b
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-2DES.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-2DES.pem b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-2DES.pem
new file mode 100644
index 0000000000..d317c53836
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-2DES.pem
@@ -0,0 +1,8 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIHxMBwGCiqGSIb3DQEMAQQwDgQIcCYglgSeP+sCAggABIHQXnZlcc/CDvsT/3aQ
+o2E6AgnJgaq6P2l41yQ6BuomXRSI+KoP+nYWC2fAtb/URgdoNstrflNjTGysSdyl
+CU7A1FnrQkoSvvLElcy25/ttuH9LE4adbhCiKgv2NQXXY/2Lzeeq1e3iqLg7/5wx
+7B2XmgQvMV3EHN1uJWVDKuevOOJ5ULKYONELDaicrlm8IumdhWMvp3ypUrHe6hSD
+i2YYZf8eXfCY0NIRFeXluEgK4MFz/iEkl7aYpNDSA9F7Uk6TC3IRQu3yFs0GR37b
+4fDtpg==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-3DES.der b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-3DES.der
new file mode 100644
index 0000000000..96b54c3f5d
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-3DES.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-3DES.pem b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-3DES.pem
new file mode 100644
index 0000000000..2fe8300613
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-3DES.pem
@@ -0,0 +1,8 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIHxMBwGCiqGSIb3DQEMAQMwDgQIwZ3Xa+/tptsCAggABIHQmdPeV+Zd96TBIGM+
+kYRNqxckxWbVWE8EBWzJOwjlvrOxhVi3hbSl4QM3cMyNFv0ssyuJiXGQQ7+6/dkp
+UxPWigaSJkemDMtDTQNpHcK/4Ekao+PlAvzgi6wG0lUfL4ioSiEqrE5DlcdfctdR
+Nj9mF4u0rekPWthXhfHcmDxQKSORDi8gYfyQUaV59niKQGIYMsVz4Bu2fwrrTLFn
+NjzyHhYsva2GLAfEWNB13/VtIv4gJaB5mZpzLf81VWe52rR7rZWb3R/rWEz9FFQm
+vrgagw==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-128.der b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-128.der
new file mode 100644
index 0000000000..7fd85f55db
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-128.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-128.pem b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-128.pem
new file mode 100644
index 0000000000..e9faf30e61
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-128.pem
@@ -0,0 +1,8 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIHxMBwGCiqGSIb3DQEMAQUwDgQIMLBXkL2mR68CAggABIHQkquhoK6Ep0EtnjC7
+V2FbRzYrFSvOakBOGuU6U6p+JeStbTRp4gLQ9hY/8xG7l0GrzM8dlcrO5QnI9Ypk
+zw6a/9FTE+ROpQYGiRjnhdegRguIn6aaCdejfu5s4g09kz/Y6saM1LBkA/hby0m9
+YWB8IFg+/B8qLScjnhn7UOBm4HAW/UywXGH7IFH87ml1g87xlDu88GhcP8iqenco
+TrfPCQDoa+C0EBLV8yTR5aG66kK6BrWXNkyZgUiuhUF1TYmZhZDaiUJ4Er4gMlgA
+C8o6qw==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-40.der b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-40.der
new file mode 100644
index 0000000000..c0d8b9bb3f
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-40.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-40.pem b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-40.pem
new file mode 100644
index 0000000000..a1d968b912
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-40.pem
@@ -0,0 +1,8 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIHxMBwGCiqGSIb3DQEMAQYwDgQI3y3PINAU1csCAggABIHQEPD8M7YheSdikqwW
+tem/Oz+CZxAXWCBYokpxSeGexFR85Ni2bd/wr8tT4Mv5nNrPLlcNMrKLYCTWryEu
+PtW1XtMp881xmPM9QMgrFRfhiGeVfveEmKZzdGrXN5RRqa20Xa0ufEqaJpvfJHIz
+meWfNkAUtr0RhwK1tMfjxg3CvnSXG1l/cegvUgsc5Nq4VfCOwLYAPY24ltYIZrAp
+JKuc9XkbBx+Uow4kOVpOBTA28giB9gywSbpn1/bCgrm1iBltlrC1bOI2UEYLXAK8
+S8kOew==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-128.der b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-128.der
new file mode 100644
index 0000000000..59f01c9057
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-128.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-128.pem b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-128.pem
new file mode 100644
index 0000000000..29da203ac1
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-128.pem
@@ -0,0 +1,7 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIHqMBwGCiqGSIb3DQEMAQEwDgQIS1fq1s4wBy4CAggABIHJsEjsk3aow+m3DXPe
+1KCnwl0qXzzh96JCrtAa+2pWytp52+mZphUgnNXYkIoj0rdqJbr1y4/3t73ffVFG
+TU/4401k2QTSKo2mObTxY811fnWImBbNG3BJVmoq8zvJuHrctfVQuKBQb9UFA7RF
+E5WrYwkNXfRxgSsuUgtMvklHyxeAjxdZ0vWennUuPkJIa4XQhIY5gqMiume8dCGl
+mDujTHUPhBjRKifaGQv2hvc8l7FgjUlUY1DcZIl0AapzF3jEXS/Se90FOE2M
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-40.der b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-40.der
new file mode 100644
index 0000000000..f185d58b51
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-40.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-40.pem b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-40.pem
new file mode 100644
index 0000000000..3dd08fd969
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-40.pem
@@ -0,0 +1,7 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIHqMBwGCiqGSIb3DQEMAQIwDgQICCPn/nJOcwECAggABIHJY1EqBsfnKkOsytQR
+ujblH/MciuYQ5PIkhS+rfEyYvNaQAM4ELbZjBOhqhPxpWgV/nwzl5lbjGHGaBojp
+uH6Tm9L/J/DUVXt5U6i0bmuJ3vUQL9t8WlLwWKEUbszMOJfzgn+q7pr2AViOwcgA
+kL9JD3fTL7KspScIvYo8JD5YomwzDTMyhJFtkvKpjDtBsBkZxvmDRtBnjYYDAvie
+ICGKQ5ojeZD2p2v69ra9bhAOXi/wz+AMotLVWa8myrOb7B+X/b0xEnoOqxKL
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-rc2-hmacWithSHA1.der b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-rc2-hmacWithSHA1.der
new file mode 100644
index 0000000000..a3d1fa4c9b
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-rc2-hmacWithSHA1.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-rc2-hmacWithSHA1.pem b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-rc2-hmacWithSHA1.pem
new file mode 100644
index 0000000000..9adf8802c3
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-rc2-hmacWithSHA1.pem
@@ -0,0 +1,9 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBHTBIBgkqhkiG9w0BBQ0wOzAeBgkqhkiG9w0BBQwwEQQI7hWoVS10HvICAggA
+AgEQMBkGCCqGSIb3DQMCMA0CAToECLPHM3qUvtYPBIHQl36zBfnW7J89+Kl+tLa4
+rm9Iu8KpMNJm2bnuLptltF/e5Vyp92xRvuCoaAVQka0dq4jKOVOkruMfHHHOf22g
+mxpwtJfYvKqqjW2KH2FE0Y3l1XPV6o4Of5FbhvcULDmNtCoFlme0hoAoHm1kUUzS
+Ed4CJqc6VpYpHGCv8X6k+0j274XnPqRJaY8KizrD0+/i6vS/nu/srxLqt9COT9nS
+tVTQL/CRmmXf8/jSdVLDMKjjboFU1FtVZnOq4yAAuJiBZFtfmIF5+EI1dbXMbMdF
+MA==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-rc2-hmacWithSHA256.der b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-rc2-hmacWithSHA256.der
new file mode 100644
index 0000000000..398d47b4c4
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-rc2-hmacWithSHA256.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-rc2-hmacWithSHA256.pem b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-rc2-hmacWithSHA256.pem
new file mode 100644
index 0000000000..de0d9179a2
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8-rc2-hmacWithSHA256.pem
@@ -0,0 +1,9 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBKzBWBgkqhkiG9w0BBQ0wSTAsBgkqhkiG9w0BBQwwHwQIysmtT0sgtmsCAggA
+AgEQMAwGCCqGSIb3DQIJBQAwGQYIKoZIhvcNAwIwDQIBOgQI3Lf5sOaUEmsEgdDE
+0UkzkZdDMLBn9gGk9plFNb+2QKT2l0M1byplj92l8+eSv9stLTSf3v9STP7c/plJ
+PMj4RUym4W7URvFhIEicyLDYNL7nD9JELC2i7E6S3NaSAZVeOxSl4gxEVtOPC00i
+Dy/AISKSeNNBJkdUwT+m7as8Uc4+M1eitfMBQFUjRWQONpzw/2NtIeqI14VKPAM0
+1kVQTsO7TLEAwj7Jd1iscGakz+Ib7zMl1pCbVHrlh6nHrKvF+gvMDw5eC952CbpD
+XCcPq3tU2j6KGGzK3ksd
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8.der b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8.der
new file mode 100644
index 0000000000..ecd0670072
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8.pem b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8.pem
new file mode 100644
index 0000000000..a6f6f734eb
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/dsa-pri-512-pkcs8.pem
@@ -0,0 +1,7 @@
+-----BEGIN PRIVATE KEY-----
+MIHIAgEAMIGpBgcqhkjOOAQBMIGdAkEA+7WshnhYKUIf+71hYgDUGQcSk2JxzOw6
+rpKt3fkIafnkm6KnXeTIPrWlSLAhtHpsCX56HDzYu69BRyVjuYiFxwIVAJljwa1Y
+uxEZ/+w73/UFLgvb0juZAkEAhk+R4vDxKY6w78hLyCfhSwnT4L3BWn6pINaAM4NU
+lVzsYP6ye4R9vCvc2h+254GszhsjvKrCzl1RDI3UyJenAgQXAhUAl95kGzNYPVm5
+Y+2jpGA9N2PkcCU=
+-----END PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-MD5-DES.der b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-MD5-DES.der
new file mode 100644
index 0000000000..7af45943cb
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-MD5-DES.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-MD5-DES.pem b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-MD5-DES.pem
new file mode 100644
index 0000000000..91874a9b29
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-MD5-DES.pem
@@ -0,0 +1,6 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIGgMBsGCSqGSIb3DQEFAzAOBAihGk2iurZE8wICCAAEgYCaneaK9dlMsDGD11jl
+F5etfmvAbUbpzVmooM4ORHweCnP/DiwJVyQ02dU3PlB0teLCG6DyJCl6CaOhZjRc
+cDE4fYIBBVtLlcqwr8oc73DWi3azJ+/KdkuUQyHZEkzNo9Thi1owDI6XMlWbFZwd
+wSlfuk9AghDAN8/n3iMu87veSQ==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-MD5-RC2-64.der b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-MD5-RC2-64.der
new file mode 100644
index 0000000000..14bb01d10d
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-MD5-RC2-64.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-MD5-RC2-64.pem b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-MD5-RC2-64.pem
new file mode 100644
index 0000000000..30b186b796
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-MD5-RC2-64.pem
@@ -0,0 +1,6 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIGgMBsGCSqGSIb3DQEFBjAOBAgQKZdqJ6i7cQICCAAEgYCfJQJakYch640S/EA0
+tLuO7xxLgeI9gxeooy0GM9FeHiDencz9BXJrFFpXLs8J5IgVuj2zjfMDOuf/3zCa
+gn1itwByKWPLXHx5vRUAT5zds2F3uBo7RCQj+FlR3xv4Xuqwx34qfYJpafORpi7/
+eO6M4V2BnAkws1b5UK0WDjFfSQ==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-SHA1-DES.der b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-SHA1-DES.der
new file mode 100644
index 0000000000..689780f8a1
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-SHA1-DES.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-SHA1-DES.pem b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-SHA1-DES.pem
new file mode 100644
index 0000000000..1f737d9803
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-SHA1-DES.pem
@@ -0,0 +1,6 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIGgMBsGCSqGSIb3DQEFCjAOBAjruvWW+JZt7wICCAAEgYAgvrADpBoAMNrS8uYX
+9FTnHUsGr5Sg3e2ueEwMUGsnGliJJTa58r9634RffN6uyB8jBihCdQw5iBbzLkC2
+ltEVcOR8pNQvprGXX4X/jwOY4RhyKrb89YdZ2BZ4orzY5cL+6nGYQKEm3WlrXW+a
+Ncq6UvRpVmHqQ0OW+zuCbi5/nA==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-SHA1-RC2-64.der b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-SHA1-RC2-64.der
new file mode 100644
index 0000000000..a06790a254
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-SHA1-RC2-64.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-SHA1-RC2-64.pem b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-SHA1-RC2-64.pem
new file mode 100644
index 0000000000..814c341760
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-PBE-SHA1-RC2-64.pem
@@ -0,0 +1,6 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIGgMBsGCSqGSIb3DQEFCzAOBAg95ivo7up6egICCAAEgYDAMawlX0a61+iLgab0
+Zi62Ef7g0Jdj0KG4NeKmWrmuCXI3HBiAVv878vWkL8cMx5DqhBDw8A14aOxCkIm9
+uZ5twNwunINclMQtYxL7mtQLjUr50sFFY/Dd2PH669Qb6dqZC6efO7y31n93+fUI
+gyntTIXfeuUSg8uw/qG9Vfa6oQ==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes128-hmacWithSHA1.der b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes128-hmacWithSHA1.der
new file mode 100644
index 0000000000..fe071489cb
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes128-hmacWithSHA1.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes128-hmacWithSHA1.pem b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes128-hmacWithSHA1.pem
new file mode 100644
index 0000000000..d7c41b121d
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes128-hmacWithSHA1.pem
@@ -0,0 +1,7 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIHOMEkGCSqGSIb3DQEFDTA8MBsGCSqGSIb3DQEFDDAOBAhC3xITYW8eRQICCAAw
+HQYJYIZIAWUDBAECBBDUQa3ddOnliyQ/qIYEFmK2BIGASDcmbEFHEwmV9uJzQEI4
+hfZTOVaR0lYHCTTnJjEsbM8oyvVvMxJkefNqPVkBF1Oc4nHaN6LEPIZRpHYJxjDH
+tk7RFlcvSlS2Dcv41y+2Bcj1dMtocXM1t6jxo5nioeBnHCUQr3VsDT9+eJvithY9
+UyUqUt+P5f1H1LCpqD3BYcc=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes128-hmacWithSHA256.der b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes128-hmacWithSHA256.der
new file mode 100644
index 0000000000..62113a1e6b
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes128-hmacWithSHA256.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes128-hmacWithSHA256.pem b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes128-hmacWithSHA256.pem
new file mode 100644
index 0000000000..83e58214fb
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes128-hmacWithSHA256.pem
@@ -0,0 +1,7 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIHcMFcGCSqGSIb3DQEFDTBKMCkGCSqGSIb3DQEFDDAcBAjv/NQpQZwZbgICCAAw
+DAYIKoZIhvcNAgkFADAdBglghkgBZQMEAQIEEPMGCKos4+H6cwxOhDR8UbQEgYC6
+01v9qHJnnFkHBbQ7L4xpWY3RVHTalKfCfLQErqwPx1akV7BPdCZmjd4rAdIGLImy
+kaaAPVrJ3GVjF6fW+E9UIGoDEbFeZ1hlnTzhOTqUwGiBrCM0SY3XDyBxSdqv/Pk/
+M4Ibk/lDycV/kWm26j2I9OYPxedj4vdPgXPxEi7FeQ==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes256-hmacWithSHA1.der b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes256-hmacWithSHA1.der
new file mode 100644
index 0000000000..232a6cf2cd
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes256-hmacWithSHA1.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes256-hmacWithSHA1.pem b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes256-hmacWithSHA1.pem
new file mode 100644
index 0000000000..294278ea44
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes256-hmacWithSHA1.pem
@@ -0,0 +1,7 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIHOMEkGCSqGSIb3DQEFDTA8MBsGCSqGSIb3DQEFDDAOBAgYx6Cuor4IHQICCAAw
+HQYJYIZIAWUDBAEqBBDc1FODsp0BBJI/EOjU/nA1BIGAUIe6lzmR2cWVQUAW6gF8
+UdykIWS5E4AnbPtaiVdFNmhyjtUq10gf67jX3/hfA3QXwDCTT1aot+5Vjrb57M8S
+hjxrs871w0UvzBmrTLJA2/BWPz5gni72fj1N5JGYUKI4MFKHGhv53iUzW/E8KiRW
+ab4KY+hUF9zFcXOBwOGvG7E=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes256-hmacWithSHA256.der b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes256-hmacWithSHA256.der
new file mode 100644
index 0000000000..0f4075965a
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes256-hmacWithSHA256.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes256-hmacWithSHA256.pem b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes256-hmacWithSHA256.pem
new file mode 100644
index 0000000000..90ab751415
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-aes256-hmacWithSHA256.pem
@@ -0,0 +1,7 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIHcMFcGCSqGSIb3DQEFDTBKMCkGCSqGSIb3DQEFDDAcBAg+0vyp4rA5hgICCAAw
+DAYIKoZIhvcNAgkFADAdBglghkgBZQMEASoEEDlKgIIcdKfiQcsZLfQt97cEgYAD
+TrjldhQKT8SjAnmChT/knsUeJzThLxKpdpRwbr8qYTZbCmngbb2oYBkrNzAwGoVM
++cj+6p3EgP7T/zjJYj7EArRvs7FM0spxqre2bQY3GG5E3PDGyR/h4nwdVTzorqNw
+/35Dtl8ifbnVI4SCwTtifnCDsz9TjIXszixrCm354g==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-des3-hmacWithSHA1.der b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-des3-hmacWithSHA1.der
new file mode 100644
index 0000000000..669cb1f9cc
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-des3-hmacWithSHA1.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-des3-hmacWithSHA1.pem b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-des3-hmacWithSHA1.pem
new file mode 100644
index 0000000000..233dd94a18
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-des3-hmacWithSHA1.pem
@@ -0,0 +1,7 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIHFMEAGCSqGSIb3DQEFDTAzMBsGCSqGSIb3DQEFDDAOBAjU9TMJNWzzUAICCAAw
+FAYIKoZIhvcNAwcECEd8I4R+1rlZBIGABNupNKmIR5j2lAyQAbDjXX2PtpOGH0+k
+KXnS7i6rmseQFjwDiF+xMefhj9ZamEgypDjyWaYz/EwV7dP0dUzZuQpzGsN/JLZS
+i1IhRV9sVABs4SbCn/KZsy8bLW/7/3e5qloRkXskB6dR4nVrq4kz1qMmQVO+9Ojo
+Td+SUeCdhd0=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-des3-hmacWithSHA256.der b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-des3-hmacWithSHA256.der
new file mode 100644
index 0000000000..9f444d6350
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-des3-hmacWithSHA256.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-des3-hmacWithSHA256.pem b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-des3-hmacWithSHA256.pem
new file mode 100644
index 0000000000..29f17933bd
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-des3-hmacWithSHA256.pem
@@ -0,0 +1,7 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIHTME4GCSqGSIb3DQEFDTBBMCkGCSqGSIb3DQEFDDAcBAgf2AMm0URGvQICCAAw
+DAYIKoZIhvcNAgkFADAUBggqhkiG9w0DBwQI/4fa6rbvznsEgYBImRLhwGbEgcLm
++yHcsohX1uQyqPfP8PVHGtM6ITaAJ16djxQKfXRoffS4DSTnhFgHnXm42V7epgJO
+ZHRe0dVbKynbp1ZCnNIXsvsgyP4ghfw70j2u+45fiBK2ZqhVaQns/1t02eIa7Kud
+308ffy9xR8xbCV9H1hu978sWDPRgmA==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-2DES.der b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-2DES.der
new file mode 100644
index 0000000000..e7939899c8
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-2DES.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-2DES.pem b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-2DES.pem
new file mode 100644
index 0000000000..eba00a5597
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-2DES.pem
@@ -0,0 +1,6 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIGhMBwGCiqGSIb3DQEMAQQwDgQIASNN5nArudcCAggABIGAsi5Ta25v+vkS7qc0
+b10/Hv1H2SVhhOA4iYMdjB2XgpRFXBduYIFfROdAT8pJvspZ2EIJGu975H+SKeJ3
+ndULrOFmaDknlsAyVW8HslnOiuQVpNE0vTWWJYVg1xq9Hwg5YU7C1PsCMy8f5g4O
+gbsHxVy7AGF2FSrJqy2PVdoEADI=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-3DES.der b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-3DES.der
new file mode 100644
index 0000000000..9dd3f9d42c
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-3DES.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-3DES.pem b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-3DES.pem
new file mode 100644
index 0000000000..01f62cf5f2
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-3DES.pem
@@ -0,0 +1,6 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIGhMBwGCiqGSIb3DQEMAQMwDgQINArkfLom3CoCAggABIGAaqrWHE+VgTLr/TQk
+x86KYu88/eiO5jxGUxbFwUCOtTbw8g40MY4tuXNhhm9lQ5zVSrC7fdjagqr6Flz5
+YV8NWpURbA4CKXgX+JKUMzZclHUwfe/M/CI5tKIU8vu7O2jl8gL5mOAFagLmFUld
+iS5+KYtWvuOy1jQd9Cn4pOrF0yA=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC2-128.der b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC2-128.der
new file mode 100644
index 0000000000..2f1148d1ea
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC2-128.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC2-128.pem b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC2-128.pem
new file mode 100644
index 0000000000..fdddcfb02c
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC2-128.pem
@@ -0,0 +1,6 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIGhMBwGCiqGSIb3DQEMAQUwDgQIBOJoKaHoCH8CAggABIGA5ekhEhokinZUh8Su
+FU9XT9TmpJI6+uSUnV6dCI5F7jxUC4BKYUDLQ/wjassasP/z7NYgIUFXiSsx8+u9
+rIOd83qJly/QL3MI8HA/gwrUOK1mcQCdHM7WcDxgTDfA8iXvE7ipxkqWWh+vjWVg
+QIBy+Mik4f8m6qRJtHvkn1+QVUQ=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC2-40.der b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC2-40.der
new file mode 100644
index 0000000000..f8a47e1127
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC2-40.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC2-40.pem b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC2-40.pem
new file mode 100644
index 0000000000..368b1d9fd7
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC2-40.pem
@@ -0,0 +1,6 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIGhMBwGCiqGSIb3DQEMAQYwDgQIYoqh4a7jy44CAggABIGAhOjw9xEXhMSaBJM6
+Opu29QK4+h7/RJJ+NcrzFBPV5p6t0bjqONRxdq8LwXA5nimlUq3ZbRqjhu0BCKh5
++jvfjs0R9qD2cAv3QXjk6eh2YEx+wuDbc50SSL1Y826sLD06V4KThrQwfaLHE7r1
+mjx5N5Jg5rPFdTGe4umThyGlGPo=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC4-128.der b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC4-128.der
new file mode 100644
index 0000000000..a2e71ed488
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC4-128.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC4-128.pem b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC4-128.pem
new file mode 100644
index 0000000000..91c71a3df0
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC4-128.pem
@@ -0,0 +1,6 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIGaMBwGCiqGSIb3DQEMAQEwDgQIvutMegO9IYICAggABHoRfn/sZK/NRxF7jwF2
++/0zh3Y/8cCm4xeGaCP7NOcJoJXOisXXxT05tgQEa5mfymOFK1PYjnHHVVLGs6CQ
+TDPI2kb6XteXjkzR8Q0WQUtLSgAQ9/uEMmr43jAabaw+qnIcJrjaTt3rlbezZioR
+Q3xbb38W5QBFcUIpCg==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC4-40.der b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC4-40.der
new file mode 100644
index 0000000000..cf6373b642
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC4-40.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC4-40.pem b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC4-40.pem
new file mode 100644
index 0000000000..cc5ec63996
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-pkcs12-PBE-SHA1-RC4-40.pem
@@ -0,0 +1,6 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIGaMBwGCiqGSIb3DQEMAQIwDgQIGgo8eWJg23YCAggABHp/EXYSQmp35zzgLl8l
+paNqOjR3Ku19rhrN9QiW1dagTztFuqzezlZC7WjbycWz9qRZeQFLLAEi/DIipIAf
+sLsnbtfBypqcUCoO2AysmI31hPSaXSsHDH4cJ5LH+1DK6KVeQoVGJw/xTvrmaBD8
+lD9zOO313VgMIGe7wg==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-rc2-hmacWithSHA1.der b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-rc2-hmacWithSHA1.der
new file mode 100644
index 0000000000..be137430e6
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-rc2-hmacWithSHA1.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-rc2-hmacWithSHA1.pem b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-rc2-hmacWithSHA1.pem
new file mode 100644
index 0000000000..b52d270e42
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-rc2-hmacWithSHA1.pem
@@ -0,0 +1,7 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIHNMEgGCSqGSIb3DQEFDTA7MB4GCSqGSIb3DQEFDDARBAjwbKdmEddIYQICCAAC
+ARAwGQYIKoZIhvcNAwIwDQIBOgQIvopesgNCATUEgYDQ7uOTZ+cUnxDAVh3z845L
+QyZ2KkSbna0NmiKZGy9e1kh5iAQ1RhZ2iKaTTyGlpCi4i2mlZo3gvJbEHp+Do2vc
+nq9g57AP6dU9+1LsLsTeVFbdJ7OymlcwUoSfF723g9IGlQa0D5K4RTR3y34lHMNC
+NmrOwaAH4DPKDyC5EWYV0Q==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-rc2-hmacWithSHA256.der b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-rc2-hmacWithSHA256.der
new file mode 100644
index 0000000000..fecff8a2bd
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-rc2-hmacWithSHA256.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-rc2-hmacWithSHA256.pem b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-rc2-hmacWithSHA256.pem
new file mode 100644
index 0000000000..67931bbbac
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8-rc2-hmacWithSHA256.pem
@@ -0,0 +1,7 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIHbMFYGCSqGSIb3DQEFDTBJMCwGCSqGSIb3DQEFDDAfBAhdjCzod22WFQICCAAC
+ARAwDAYIKoZIhvcNAgkFADAZBggqhkiG9w0DAjANAgE6BAj2j6TpIIho6QSBgK4/
+Kgspc57C+rWNbf3c0+o/bJ7ga3tTfq0iw8TYqZ8jV9+FZGjS4NVvh9EK8+L6f2w1
+NuyiGbKfsq7Lf1O1dlHNu2TagxYAWbJUwzoy0uUkfpRnfe5M/dl/l5Gx0cR4y9SH
+yKOhuX3YxUvOtkwxEb6iyNg8vaq0yRG/1F5O2jI3
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8.der b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8.der
new file mode 100644
index 0000000000..c8e51cc01b
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8.pem b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8.pem
new file mode 100644
index 0000000000..741f007304
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/ec-pri-224-secp224r1-pkcs8.pem
@@ -0,0 +1,5 @@
+-----BEGIN PRIVATE KEY-----
+MHgCAQAwEAYHKoZIzj0CAQYFK4EEACEEYTBfAgEBBBxr31AB6pNVnFUfX9rNKpZc
+Ps+RbUj5PYdpHLtIoTwDOgAEg7Qj4reRDs3ot/r/rp2orzU/g07BIYsZCsLLrf8j
+8wq50FHUIdwDRZEfpfGBPBXGgd/9DS9T7hU=
+-----END PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/genkeys.sh b/tests/auto/network/ssl/qsslkey/keys/genkeys.sh
index 7fb15e91ee..6210b42ab4 100755
--- a/tests/auto/network/ssl/qsslkey/keys/genkeys.sh
+++ b/tests/auto/network/ssl/qsslkey/keys/genkeys.sh
@@ -87,3 +87,58 @@ do
echo -e "\ngenerating EC public key to DER file ..."
openssl ec -in ec-pri-$size-$curve.pem -pubout -out ec-pub-$size-$curve.der -outform DER
done
+
+#--- PKCS#8 ------------------------------------------------------------------------
+# Note: We'll just grab some of the keys generated earlier and convert those
+# https://www.openssl.org/docs/manmaster/man1/pkcs8.html#PKCS-5-v1.5-and-PKCS-12-algorithms
+echo -e "\ngenerating unencrypted PKCS#8-format RSA PEM file ..."
+openssl pkcs8 -topk8 -nocrypt -in rsa-pri-512.pem -out rsa-pri-512-pkcs8.pem
+echo -e "\ngenerating unencrypted PKCS#8-format RSA DER file ..."
+openssl pkcs8 -topk8 -nocrypt -in rsa-pri-512.pem -outform DER -out rsa-pri-512-pkcs8.der
+
+echo -e "\ngenerating unencrypted PKCS#8-format DSA PEM file ..."
+openssl pkcs8 -topk8 -nocrypt -in dsa-pri-512.pem -out dsa-pri-512-pkcs8.pem
+echo -e "\ngenerating unencrypted PKCS#8-format DSA DER file ..."
+openssl pkcs8 -topk8 -nocrypt -in dsa-pri-512.pem -outform DER -out dsa-pri-512-pkcs8.der
+
+echo -e "\ngenerating unencrypted PKCS#8-format EC PEM file ..."
+openssl pkcs8 -topk8 -nocrypt -in ec-pri-224-secp224r1.pem -out ec-pri-224-secp224r1-pkcs8.pem
+echo -e "\ngenerating unencrypted PKCS#8-format EC DER file ..."
+openssl pkcs8 -topk8 -nocrypt -in ec-pri-224-secp224r1.pem -outform DER -out ec-pri-224-secp224r1-pkcs8.der
+
+for pkey in rsa-pri-512 dsa-pri-512 ec-pri-224-secp224r1
+do
+ pkeystem=`echo "$pkey" | cut -d- -f 1`
+ # List: https://www.openssl.org/docs/manmaster/man1/pkcs8.html#PKCS-5-v1.5-and-PKCS-12-algorithms
+ # These are technically supported, but fail to generate. Probably because MD2 is deprecated/removed
+ # PBE-MD2-DES PBE-MD2-RC2-64
+ for algorithm in PBE-MD5-DES PBE-SHA1-RC2-64 PBE-MD5-RC2-64 PBE-SHA1-DES
+ do
+ echo -e "\ngenerating encrypted PKCS#8-format (v1) PEM-encoded $pkeystem key using $algorithm ..."
+ openssl pkcs8 -topk8 -in $pkey.pem -v1 $algorithm -out $pkey-pkcs8-$algorithm.pem -passout pass:1234
+
+ echo -e "\ngenerating encrypted PKCS#8-format (v1) DER-encoded $pkeystem key using $algorithm ..."
+ openssl pkcs8 -topk8 -in $pkey.pem -v1 $algorithm -outform DER -out $pkey-pkcs8-$algorithm.der -passout pass:1234
+ done
+
+ for algorithm in PBE-SHA1-RC4-128 PBE-SHA1-RC4-40 PBE-SHA1-3DES PBE-SHA1-2DES PBE-SHA1-RC2-128 PBE-SHA1-RC2-40
+ do
+ echo -e "\ngenerating encrypted PKCS#8-format (v1 PKCS#12) PEM-encoded $pkeystem key using $algorithm ..."
+ openssl pkcs8 -topk8 -in $pkey.pem -v1 $algorithm -out $pkey-pkcs8-pkcs12-$algorithm.pem -passout pass:1234
+
+ echo -e "\ngenerating encrypted PKCS#8-format (v1 PKCS#12) DER-encoded $pkeystem key using $algorithm ..."
+ openssl pkcs8 -topk8 -in $pkey.pem -v1 $algorithm -outform DER -out $pkey-pkcs8-pkcs12-$algorithm.der -passout pass:1234
+ done
+
+ for algorithm in des3 aes128 aes256 rc2
+ do
+ for prf in hmacWithSHA1 hmacWithSHA256
+ do
+ echo -e "\ngenerating encrypted PKCS#8-format (v2) PEM-encoded $pkeystem key using $algorithm and $prf ..."
+ openssl pkcs8 -topk8 -in $pkey.pem -v2 $algorithm -v2prf $prf -out $pkey-pkcs8-$algorithm-$prf.pem -passout pass:1234
+
+ echo -e "\ngenerating encrypted PKCS#8-format (v2) DER-encoded $pkeystem key using $algorithm and $prf ..."
+ openssl pkcs8 -topk8 -in $pkey.pem -v2 $algorithm -v2prf $prf -outform DER -out $pkey-pkcs8-$algorithm-$prf.der -passout pass:1234
+ done
+ done
+done
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-MD5-DES.der b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-MD5-DES.der
new file mode 100644
index 0000000000..293001c629
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-MD5-DES.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-MD5-DES.pem b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-MD5-DES.pem
new file mode 100644
index 0000000000..e9aa918a11
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-MD5-DES.pem
@@ -0,0 +1,11 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBgTAbBgkqhkiG9w0BBQMwDgQIbdPEAuKuoSgCAggABIIBYAo3BSb8H60g9eyM
+2QajPdxRT5RJBQeSmlYCG4NEhiXYCXkGx2btS20w7yeX2ESqKPTSTMTB6XY1o44x
+DLnDF2FEjvrk89ADZraMaOKnUxcZiawXOi9chNf+S6PclRC+ZRMRfbCxTnqb6y8q
+42aD4oMmHv48f+/27/kFVwj4o/5ls6Hfwc6/YpXZXfT/8hIrkVaPd8QErhY+pAau
+H/ObrYXu7Hm1deBLdZD1+u19yFv/uGRg7E7S7/Ku2GSe0i9DpYlYpsz1lydubAp1
+RfxAARfMjEoo0gwUfGCvP6drh16fnLcu9GnxuPKacUTCRd3Pk6hm59TXdcLtXB+W
+tzQ/TpPY4u0oL2NU/aF9jqZuDWW89TAjvwekYpqrtq5cbU4VHpFLLc2yO1n4flRm
+pfHP4BXjW8D9frPMyLiOSJAdKoJnHfM4y9bG8SHbukmTaJCOUD2MJ5uXW8pVejxU
+gnYbceU=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-MD5-RC2-64.der b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-MD5-RC2-64.der
new file mode 100644
index 0000000000..3bb492bc5e
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-MD5-RC2-64.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-MD5-RC2-64.pem b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-MD5-RC2-64.pem
new file mode 100644
index 0000000000..08115431df
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-MD5-RC2-64.pem
@@ -0,0 +1,11 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBgTAbBgkqhkiG9w0BBQYwDgQIHQKYle7B6TECAggABIIBYP7M3ZLd+cmLd7HG
+avwLJdK7dq1hUxdpDMYIIHXQMqR7yhrr271v6Sqlkq8i97CrdlmzWgWNiv8uok88
+z9CxT79Y6/sLcvKVfCkoI7Z/p86Pc2/P7otvhoc9GlRNIvU8r/nMtigf3FZDQWrp
+3XmBSabIERSQZxNwVjmSQzAVFd+SgfcqrNpKD0kErrphcySF7M4SfyTm3/dfFbrO
+gUdg0ULs0rbKbTpYyBgVhrdCXYFAQLajHlE6UVIAK21Ifq2EvJ3LQDUEXg6RADbf
+s2easyTlKfssoRzTDkBo60J2OsgmS5ls7fxOBndjxMZYPJI55k/ct4FPJraXPIsj
+j5iBIOJBdW7Fi42O/ezaLtSFC/TUwZf+rgsVQaqpz67ynp3V7K/wJqdR0P3WmO3T
+XkL3quUX+GFtm1htiqT9EGX6c1UZFfqmTJ3juLP4YpgOgUVLSIrOPauk2txH9E/R
+JATHbjg=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-SHA1-DES.der b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-SHA1-DES.der
new file mode 100644
index 0000000000..82e2f79cd8
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-SHA1-DES.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-SHA1-DES.pem b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-SHA1-DES.pem
new file mode 100644
index 0000000000..82b997804a
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-SHA1-DES.pem
@@ -0,0 +1,11 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBgTAbBgkqhkiG9w0BBQowDgQIQPSp44KDjkUCAggABIIBYLdDgiRyUnAkUhLW
+pqaNMqrK0iaSKpwHvsw1S4PhOQdFclVUEZKs+2oBedtrr3VysWRg/ZKNBdBAnzLi
+E3nw7RubL4WH2y3QNx6eLsMJsI1thF9pK0yWWfy+zQP3+oZVG+JTmctCLQDAToCa
+1OoRGnaHrZxcGzg/B1yI2hRSDdcuFCelMTIG4fGJ3dyrQHR/Gyxr4m27kV25H4t2
+Vxc6DSb1qWmSgauvUKLMlnvqtFVJ/OxjTz3BWPKUJqOyDd80PdfX8t5ttdK9Ebca
+DwIUHvAmblES9mknhUwJUym/JGQFd3GXPc7WNyTsqwV4x9xp/8WTmJvM8qPk8fNz
+x5kj3+VZgcAIh0ePKdF0TBAaAz5nKg611UwIOI/ShdMeyc1B3iWA71Y+uPElPEf+
+6+Zp8DwJNaOZ1SEqfNyB6aNMuYlTmbwctEKjokaIvyakSI6nFs63ycq5/s+HrMHT
+KHF9A4Q=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-SHA1-RC2-64.der b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-SHA1-RC2-64.der
new file mode 100644
index 0000000000..ea6b0d6134
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-SHA1-RC2-64.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-SHA1-RC2-64.pem b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-SHA1-RC2-64.pem
new file mode 100644
index 0000000000..14edbd1f09
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-PBE-SHA1-RC2-64.pem
@@ -0,0 +1,11 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBgTAbBgkqhkiG9w0BBQswDgQI+m9oVxROlkYCAggABIIBYBRYVJdSaW3fR2zh
+t/s5PFJ+9ebZUxhSRoc7lxk5LU76xJIH6EUa5k2sPH2WnWfu/V0Hi6t7FC0wkPLZ
+QUNcr8VPESfjDkzqmU9H+37mfrUG63P5hGgyoWzMEaok2uFfjt1e1XVfVLe8P1Z+
+zxy4+BNoLzWQ/Wb/gTwVVc0kkttmjUiRIqSQLCEh8ntWF2ws0JS+ihiR9NUdPdEe
+niQWskeAxWvO758m6kfTQeRY7WnVWPaqoosH1+uC8UZ2TmuWqTxJlHTvqEJzjPTK
+n7EzwIFHhZVJ+p+IT/6SvwL5i1h0dtlNwOfTlcU6W//U76cYmwwtrzjwVsKJNbBw
+vuPboJ2asZSzXa8887zI8O3+5ClkTCvJpk46QJHuNTQhJc1/R7aXgWbpiGu8CBCo
+PNB1OEbs+lTU8DYp8cIxdc/aTKnSxPm4d73jCaOEJ1Sj4tA97rPQVEFu0w/HLtP+
+6MxHjI0=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes128-hmacWithSHA1.der b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes128-hmacWithSHA1.der
new file mode 100644
index 0000000000..a42fb92161
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes128-hmacWithSHA1.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes128-hmacWithSHA1.pem b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes128-hmacWithSHA1.pem
new file mode 100644
index 0000000000..11b1032852
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes128-hmacWithSHA1.pem
@@ -0,0 +1,12 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBrzBJBgkqhkiG9w0BBQ0wPDAbBgkqhkiG9w0BBQwwDgQINZqXAZw29eMCAggA
+MB0GCWCGSAFlAwQBAgQQMN7uviOQj5Hdt8Zb9sCtrQSCAWCsMtmLiGbnaleRuRh5
+mRWDqJ0PYXNaaTwQ24WKjl8dquPPJZz0QU2hDZGtuhBL90A2lqvG9oHJmFBpMg4E
+RPHS33R04BtCTdpfCUziKcBomHbrh8ttQ/Y1UA9OgSgob3GQIDxwNS+0p0wApyWC
+InPBE4DXByp9o1lQxNZj2wkmWLfkXCT75aMxevM30lf33SOCXDPTvtHlz/YcB6Yh
+i/b31YUAEOilXaqaCu427BMPKCanshJAjX3wwOROQ+yh8R8HiSPu+x55gJlU+yCn
+9S/oNwtTMimpI21cZTUIOkIRYyKJhgvUxjlQ0CjcMOjJvDms2rRgNhD6IFZrXoks
+FRF/Z9pUH0n/m3208uckyPkilwoFNoYLec0lq1SdtBq2LOBV0hgCmR0J0Fokpo/p
+8T/rzlb48JowOfZLnLqMtC6uqccQWmiEY3691exhFf5muUYsd8uOVkeWgMTfVnua
+jwVr
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes128-hmacWithSHA256.der b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes128-hmacWithSHA256.der
new file mode 100644
index 0000000000..74b870d490
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes128-hmacWithSHA256.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes128-hmacWithSHA256.pem b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes128-hmacWithSHA256.pem
new file mode 100644
index 0000000000..371448ae69
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes128-hmacWithSHA256.pem
@@ -0,0 +1,12 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBvTBXBgkqhkiG9w0BBQ0wSjApBgkqhkiG9w0BBQwwHAQIadJLdxsx0GsCAggA
+MAwGCCqGSIb3DQIJBQAwHQYJYIZIAWUDBAECBBDc7IW9CVmuaaYtM4KFXpsUBIIB
+YC1qJ4WQa6f2uxeaojvzpgYHmrh4gR9gXa2cNwCNQir557amVsPqiXEiSYmqrCy/
+Y9tN5ubLxu3z5TtscC1Y9bqP8oY3bQj+AleqzmywVI7dJhwGoTaM9lD574cknKVo
+Fn5oe6a4dTTg8wxcic+zWFc5EPi3g3swu3jqmjrLaOM8gd0RlWkAFmM60F8LX9G1
+mxnNZXHcRmkpugpICwaNYhROlzVfvLQvqtlJNccGc6QvYq/zY0nX6R3ISkbW/Bzn
+kadVaA4hNrao9RA9TT61v4H95+BGF6CLDTyU1z3jtaEvm4ihygeA5mS/pjBd7lAi
+V9YCNazgfMlgNv1ynwU67e8to89SFvzrv2sjUEDEAx1cN6zLGl42dz7ZDk1ytmsO
+grVc9vON+HhwrVIZiu8bMjj4lSD6E1XqsffpNzEhOAy2INp9ArvakCVP4mE06dv4
+4LHAAqaYj8jIHSBDPYw3F7w=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes256-hmacWithSHA1.der b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes256-hmacWithSHA1.der
new file mode 100644
index 0000000000..112aca5d9f
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes256-hmacWithSHA1.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes256-hmacWithSHA1.pem b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes256-hmacWithSHA1.pem
new file mode 100644
index 0000000000..74aa2eb50a
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes256-hmacWithSHA1.pem
@@ -0,0 +1,12 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBrzBJBgkqhkiG9w0BBQ0wPDAbBgkqhkiG9w0BBQwwDgQILWdaWkH3cTMCAggA
+MB0GCWCGSAFlAwQBKgQQSj7y41B6JDjCn6mV9g3/EgSCAWBipZOOZk5C6IuwElK6
+1aGy8r4cmh6hbJ+IJIj5pNphE3IeLXfBQAUzJCD2wKKzgkL4bofdZYndIGqdBU/1
+0P27kCYKDIN0iixPr+gW6N0yEmD+R0v8fUFyQF+RiiZ0lCznAmKhc5d8C5r4zE5y
+QN4E6RTAoiaTGM85jEpb2qP0Ju/2lhFJ85z0Dn2xXtH/y4O2UYQklufYpPxDX9xQ
+DdgDPgdBXj7nH2a165CqFhA5b9PXCVjzSG8+u/PlWkO0UOCobL7YTlg0z88iAkWx
+VWX6DG7UJovp8boqJ6CL8AeroSKDsNRzO5inROWeanj8t00vsSadXUtKTlFRBSaM
+1Gzn81X5EZnhPzCkrmOmmK8+DZwgncRhLk6voFBfga9lSt9PZaDNEeNrVLixQvbc
+fc5nAIp4SwkFbo/n11YRjHyBZsYqm1ugQIaEW0jGsQxGxKAzeN342emBm0KHBqr6
+liGH
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes256-hmacWithSHA256.der b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes256-hmacWithSHA256.der
new file mode 100644
index 0000000000..45ebba1975
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes256-hmacWithSHA256.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes256-hmacWithSHA256.pem b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes256-hmacWithSHA256.pem
new file mode 100644
index 0000000000..ecf4acf311
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-aes256-hmacWithSHA256.pem
@@ -0,0 +1,12 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBvTBXBgkqhkiG9w0BBQ0wSjApBgkqhkiG9w0BBQwwHAQINZe2ZZmkA6ECAggA
+MAwGCCqGSIb3DQIJBQAwHQYJYIZIAWUDBAEqBBBrqs2JUotuTr374kCzYAyoBIIB
+YDqyE1zTjItA+UhQ2jZ53NnaTCWTccqSVtb11jizZCOSvVEN0vayyr2OoQKsOw1y
+Uane3niV4MX8H98u5Vz+ijHuebBTiSbtSAlEqeeWTtzNfsQa4PN633n4ov1Ybn2+
+ZiW2n5d3cbC+bqPGs5cjTA6GPxLsojx6ZZEQBAyiUZ8Ikn2UsLxBV7RMiS1MK+wg
+1cvtOzDuA1SbAtLbv4GOFTYrZZrzrmtIJvxD9C0Nlsa4ci9PkVclE/tzTQxqHOq6
+DLC7LErqrWfZI3KNlw4c33CV3VaXiB1dFHcTohlYhYbrJZPz6wiKN5c1IxxD0fj8
+2BseKG3iV3jrp0yt9zSgquJL3OOAHk1rG4zvjQySJ29SVEH0TyvsLSPiV87U5u64
+rpHC8yRNz3ut//ZVPQKnz/dftFw5b80vXT2UT0BZQTzj4HHDkIBKDc8USteag91O
+SBmhwK5Vuuph6o8ILY3YoUA=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-des3-hmacWithSHA1.der b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-des3-hmacWithSHA1.der
new file mode 100644
index 0000000000..4f07e0cb50
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-des3-hmacWithSHA1.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-des3-hmacWithSHA1.pem b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-des3-hmacWithSHA1.pem
new file mode 100644
index 0000000000..8040f68152
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-des3-hmacWithSHA1.pem
@@ -0,0 +1,11 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBpjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIjA3V6epUyL4CAggA
+MBQGCCqGSIb3DQMHBAin4GYIwaJohQSCAWC1BTA4MHvRL83mHd6lFsC/UgvGf5/4
+csPetxLj+foMBL9A6rspxB07WxB929Ayxy5rRWq4jeYhPCAg46PL+Ne5MYp9PnDm
+OjYIJjLNPk8wDuDYMDyMYH8+U4o+WaSz612YpcHIM5GEJ2TD0ngx6LctBNRtyWsR
+9Ehn2/NLxrBI0MS93gUxFA/8XkYsQp569kITAfomEjvlsJaNVI+h98cNYdD8Oi0d
+tveEPLh3xHYhNCRYpx34a/RaoAAP7KTGXXR6rjVjPWnNzG9sICBvLOve8Ro/c1cs
+EFynJ56Xd2UJCS/yMnIhlRehVl9IhN5XJ+7Dv0JKHx2BG6N+ME7YZMM9jDZb0WzH
+2+YJqPx99ERnDsRTIdQYgShWsTbMHTdz7MNzox/Zz6l4p7kipQOZLrknoNMb2hy8
+xh1f4SPT9kHwCV/obKSYzv7bGCYjBraetyBavIwl5LjlUySKQ+HC4zFS
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-des3-hmacWithSHA256.der b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-des3-hmacWithSHA256.der
new file mode 100644
index 0000000000..764d2f68ca
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-des3-hmacWithSHA256.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-des3-hmacWithSHA256.pem b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-des3-hmacWithSHA256.pem
new file mode 100644
index 0000000000..4327d31f43
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-des3-hmacWithSHA256.pem
@@ -0,0 +1,12 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBtDBOBgkqhkiG9w0BBQ0wQTApBgkqhkiG9w0BBQwwHAQIFcxat+WIQSYCAggA
+MAwGCCqGSIb3DQIJBQAwFAYIKoZIhvcNAwcECHOnq5nGmYd0BIIBYNxOhizI4irA
+fq63+fV0k/C2HYCN7TEexoU+PiJlIm2/vlusPrTl6LnJqXTA6Y+iVelTWynnkKws
+c13oHCPMTx702JwzNntsLlQo+w8cShjc02SdbJrPUxE/RCtqWo85sEZTYteGk/Lr
+8GnPR3iDhB+m456PgdatqdpEsmy5EGcL3UT0kWmM5knVZfqHkx03kNxtMLV4rkcO
+SPsnezcI2MjyfC4DhXGBBaso48RYZ/905INvmLIRbBX1MHeYtRDpKQlyGQZiSyew
+TqyougDnYqSUs8yKhSsdHqUwltnZmIuJXEtcvtiA/Wmpt4fxxiPtJ8XYWyHreEMf
+w1CevyEbkUdOWsa7zsW10337Lr8DY4Ax/tOTqtARioOBSYdRwlhluBuh91bK5eBt
+ABidgQolNZ3SqIaBV+sEOX+gBDtpu/Lg4jAUO4eokKbhOlKL5YwueiSVrj/cWuKe
+6Js/MZGBcX0=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-2DES.der b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-2DES.der
new file mode 100644
index 0000000000..c89a60b8ef
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-2DES.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-2DES.pem b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-2DES.pem
new file mode 100644
index 0000000000..46a31fa316
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-2DES.pem
@@ -0,0 +1,11 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBgjAcBgoqhkiG9w0BDAEEMA4ECEOdj9GT2jg/AgIIAASCAWARTCBBDzPLkY0e
+Y60arOJ+bkKuaJJ/OX0IGH3znnFQ5ZmtoToZtoNOaNXG0rAc3PVmkGOW6Uh5nIp8
+D5DrESPzbxltyONQb1TGW5InZKGpO/Vajqy6gDQ/QMR3eXDJsnvSvQ/eCEwqNHXA
+64V1A7Nw0Wfcv6M9qnFMB1LJmcC6Jpt3GTJeoqq+OlsUWqlUWfgIAdOng0ouvVJ0
+u04hGbOJyd5Ejov3PxWc7uXT1X4kcqUNiWFYwvjGocDByzFrW9tmoxyU3ESULdP2
+Fx910xvZnalZBFHQFIOufim/eHKdpND/c4YohgaTULsDwH4EAuZGyqB5kfP0lt8R
+gx3I3jpHiRZXTdzZW7LWIXqGYF+2AaQMTU7qNiNrgWCQ7k8h9YzM1Upzk6YLYsZ9
+UhlbbzkSbJOhlU/1Rce2q0Y7Fsi3bbJqZZ9o0xBK2aP3ApBau9/+ErNtAmuB6EXh
+aKIfeqqn
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-3DES.der b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-3DES.der
new file mode 100644
index 0000000000..cf1811f406
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-3DES.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-3DES.pem b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-3DES.pem
new file mode 100644
index 0000000000..492b530b00
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-3DES.pem
@@ -0,0 +1,11 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBgjAcBgoqhkiG9w0BDAEDMA4ECEil5BSrj6LeAgIIAASCAWC/kwcthGmbTuVE
+ebfLDlGvn4tnSHzINEquDg3nz555OHreT0DDj0OWtsUY9IqVv/OrukJUXfQnj+jk
+j1TfMi0/MHRRbjmSHf3wGl8LUBtYzn0tmhfvoBtlCt7v3+VQo6QY/hXWbQmOopmx
+vNb8OfRWj0uLjGxeJpaOqsj0gZjbXUQcSXwaZyAG74qNCQMHs6Y/h93Xu9dVhe5h
+B+PtPgT4kFAHV72wiWkxZlyDkonAlhX4wpoEuzYFl+Mc+IZ0ss/bvhswVjjBYx5d
+v1fpOQcVPvjOFPdlm67WYfPyXWgIwP69JSwi7ywyg8GABPfgsNL4Kz9VhH/tanZL
+ZCFnZvHUAX12x39F6RAWxSw8r22jDtsDQQ9sO39PleIhtvfndquEQVx9rswrqKXD
+PxYTOiZ5fEoCxQb1/p9SBMC3rvVotMyuHueLyRYdxwYQOqagRwikJuYLYUK9ibMU
+bBDHp4Mc
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-128.der b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-128.der
new file mode 100644
index 0000000000..0cb3d5c28e
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-128.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-128.pem b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-128.pem
new file mode 100644
index 0000000000..e74b99eb29
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-128.pem
@@ -0,0 +1,11 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBgjAcBgoqhkiG9w0BDAEFMA4ECC8vkmUmfY3WAgIIAASCAWDzODlrgQ+L8c/5
+YMHk8uVGYRK2cmFRVUIgHz8pnxx7BPnR3mb2igUVk55fi74bIgmk+KGnoRhG2jsq
+dXV2rfTHGZ/AdjwgwA1yLNinhy0BUObMQ4QOrtkNpq4K2MUK8fcvLNRvEhMni0dx
+r41Q4C+bnnx70td2iT7/0efgs4YfT2uxQq//MvI5vfyvCSx71GY6xJdc1wwGbqT7
+KoY5ARvL78Tb1wi6UmdsJza+DU1yO5z1TPAu+a0bawT4LWWAOj2+x/cglsq/La0g
+lJ797NBFWI0Uq5YCMBGzwv3RY2fHtVbt/TSav2Q4oIuaoxLkYRZ2HwUDseMJ4O5A
+46QZqHZyKSQX25pm/gq7kr6bbX/JrGVoWD5ynlaUiVBxyoKHaHRojlbyQTASxjMb
+XZG7jUDpcM4JQ1LKtrNmU72YYGyfrNZhr1TFmSw5ayVfw8vgO4U3Y+JeHXKZOqW/
+QTisuu3L
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-40.der b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-40.der
new file mode 100644
index 0000000000..404b593068
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-40.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-40.pem b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-40.pem
new file mode 100644
index 0000000000..ddd0106a71
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC2-40.pem
@@ -0,0 +1,11 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBgjAcBgoqhkiG9w0BDAEGMA4ECAicFoXG2QPWAgIIAASCAWB0Uk5k6u0IoN6G
+CB6y4EpIc8lgEGIxO0iAMGYdQd/b/yYVSH5yWBJTM/WJCtIx0GPSYQUjnFh9IQOr
+AAimL90mlzCfdYHAJ7kS2rNCTWJeqXwPeOJmFpmI8oySUE6uflu16ZHXLuZoDIrZ
+O8JZnKF7KlQLIgFn5qiqRuuQrDKiildLChXtsU8nW1B+xBy89qkqWekw7nyN4J68
+3wsm7gzrT7PUNFl9XnWFw+FmSZag8sdqgvDZ0RiFdMAYeFWfTx70KY3PnSYOzoSw
+kYVgviMhcLFxulMsvIsVPaG4cr9JX/eNZfVFH8jnkm3Nqtdl647oO3LfwkXPKz/W
+1JNyd3/p2IOPnkMi8KMFvuhce3zoD77wZJ85PhbsW4YEsB+hxfk8N5ILJysrMf7J
+4BDxc4yYmV4mWna6aUiWnn4gD5ux1qxTUUGWf3tgnyHRGYS0d0xQUQzbCffeW7vj
+PDGpGqbl
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-128.der b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-128.der
new file mode 100644
index 0000000000..4d13899e1b
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-128.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-128.pem b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-128.pem
new file mode 100644
index 0000000000..a9939f278c
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-128.pem
@@ -0,0 +1,10 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBfDAcBgoqhkiG9w0BDAEBMA4ECJJ4g6/+vh0mAgIIAASCAVo/PESsuYWux3ET
+RNX7Hk3fhm/ZFx5/lvpTFqRy1hMpA6i9liFeLpI13FHarasc92chFLhj+s5JZ+Qg
+WMlDz1nQf4c79dTxVpXGjf4pByXpqr+ksyb0Wo1/NayhjurqrVDpQf0kOdlCNKqn
+8IW2CB5zftsOn8PVkPF3/riUih4xYwvW2w+8rs8RRN0vX9PUsYjtqmq0KnpiWzut
+Tt/D0WJhJTlWVb5dp3nYXEZPM3IOHzvmqBDgbv66JgofpiKn7YXmDUx+edNuWwX2
++GTih5yaRp2IqGbVYT/3eeiyJCpeNLlHJdUDui7zWkiTKpL+RU5VsV4DSjVT7SGV
+tpMQM6HnaCDEr+y4GxUB3/2w8Ua9vZwJ/DRa0vS+N6N+gZfrD78j511h1JOl5EbD
+35P6xNWZBeQbO6pJMKGq5qj/IBgbOQp9xpRtmdTezcY/lys27qN+35vhJSTQy7XG
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-40.der b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-40.der
new file mode 100644
index 0000000000..cec667ea89
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-40.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-40.pem b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-40.pem
new file mode 100644
index 0000000000..22667c1d9c
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-pkcs12-PBE-SHA1-RC4-40.pem
@@ -0,0 +1,10 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBfDAcBgoqhkiG9w0BDAECMA4ECE5xFtUDnxEJAgIIAASCAVri1/I0SyDAH3Zf
+N4WTxaXJj94JqNOrHC07kckm23evvqGtINC141iSUuPz+zInB0wd0IyDZj+v8ExB
+eFwKOblHhr7ZRCR0zN9IT0CHxjIVmU5W50lpJWTXcALgH+SW97K6jCjVdfAwSEkW
+8X5/iiuhbNXu/8BTy+CBfsiVl8R4CMGhAxD922JoiQqSFA1HzrcxZiIUJ+etN6BF
+YmiF5sCEhiMYMd7FbTDZ3u20dnNPu5Fn+L31aioZ+jtSyRNglVwWYZrdqGyZLlFO
+QAx3AlQdiiqOPJ5rwnezTWdjac9luxhhIFFFq14b02QPu7SeYG56MvruWkwM3raf
+73qbwtNE19yZ9DiWVXaeXpI84tL38E8sIQ1vthVuHtJ+6U1HUgPafVYZn+eKqiPz
+UrJYbJTPL27GS2zXJnr9OrwRlGpKHQGjHo6hyg0UmZ71xuurVuHPty00Oap1CV13
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-rc2-hmacWithSHA1.der b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-rc2-hmacWithSHA1.der
new file mode 100644
index 0000000000..3860600474
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-rc2-hmacWithSHA1.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-rc2-hmacWithSHA1.pem b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-rc2-hmacWithSHA1.pem
new file mode 100644
index 0000000000..61de0e9893
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-rc2-hmacWithSHA1.pem
@@ -0,0 +1,11 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBpjBIBgkqhkiG9w0BBQ0wOzAeBgkqhkiG9w0BBQwwEQQIQYOeTgwR/LsCAggA
+AgEQMBkGCCqGSIb3DQMCMA0CAToECMd9tvoaH7I8BIIBWNGNJ3RipB+HrN0t6rsA
+C3iOTcc4LEo03gguQ4Uxf0KyDMt7fyLpo/77m0QXLVBMW7mDjDASsaFWDzqM1OxZ
+3kmV2+thdyLfnnA2l6tCDdImKWrNBYK2ogmpkJy15piwFZ/XUBrm63zP/NYCyRsF
+jXOzy0FGv/xxaw9RAiGJMsvdoopHr2Lo37DeeBoXCR6gzfvyyuqzr5fbrV7agk5i
+pGMAbJNKtbbCrzXOKCBDTGDUFiOtxNoDEsJy2Tx6YqotNJedyMzhZAatcL5h0a9w
+r4jRLSWmHqo9WTFgcibhcXuy6cko3/wGov0Z2Pq1bPga8tWeuta74IaGLCuVWwHE
+ze2nii7RWIU1oQ9ZgD6CuZnggyRT8b3/TYTQ6pra+yp99lvH48MySVJU5QEdpoOq
+tUU+7z0BdEl5SALfBlQhBCEP13KhPitKcppVphxMv1cAidIHBne1YGKo
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-rc2-hmacWithSHA256.der b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-rc2-hmacWithSHA256.der
new file mode 100644
index 0000000000..f4ca23ba74
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-rc2-hmacWithSHA256.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-rc2-hmacWithSHA256.pem b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-rc2-hmacWithSHA256.pem
new file mode 100644
index 0000000000..c09da71121
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8-rc2-hmacWithSHA256.pem
@@ -0,0 +1,12 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIBtDBWBgkqhkiG9w0BBQ0wSTAsBgkqhkiG9w0BBQwwHwQIi1jllb1PqZcCAggA
+AgEQMAwGCCqGSIb3DQIJBQAwGQYIKoZIhvcNAwIwDQIBOgQIQDijmMtzY+UEggFY
+gItLu4+5cGLUWeqbt9L7tKBoLpMSYGScvjcPwiKX1tygqg1lD9saeOqSZFx3AEyd
+3AlEpZSPaQpAqp61zrKV1cSYzafRyYV2R6NArgWpSZP3LggquoQHnZN/8hRtbidC
+7KgB/kXP7sCWKiUj4Smh/HhkS/w0K5doxt34VicijP4q29NZ0UDQDGABC1gA7L5l
+FvZrZJi6laawHJbZDb6zaHVbvL2OMclXrzLpHF269H/NYwE+3/xtUa8AhTYVRRq/
+oOByi++ap2QL32IyHbdgNEj7a9WGM58iWVW+jS9G45ChylIDG9oCg4KeHp+5sjPv
+rkDsXdzXeCwFQuJ1nj/pRVR6aI3qUMM1jjQFoOQ/XrPWIBvVzXC8eYRud/rHaOdV
+IH7B9kFFqwSAzzi9GtTNj1hfQ8adm54N+qq2c4JRKN/a6cSRAlwtoI344OO20ejv
+2RO9QGJkkSU=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8.der b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8.der
new file mode 100644
index 0000000000..b6ef9a15a2
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8.der
Binary files differ
diff --git a/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8.pem b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8.pem
new file mode 100644
index 0000000000..2a71a861bf
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/keys/rsa-pri-512-pkcs8.pem
@@ -0,0 +1,10 @@
+-----BEGIN PRIVATE KEY-----
+MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAwDsb+Kv6gzwj4qqN
+kD5pZigHwVq+TgsAua++RsXnaWGiOWA2m2a5vM+TC9trcIAHHU2xaGjxt2UGi9b9
+mPNMoQIDAQABAkB64062Yfr7+m5WcQGevMdUbzLGAOS3r4D/M8JILCwLySrni0rV
+sti1UF1X2ypna24tsRKN0CD/a8111k+yZXeBAiEA4ats1RjWHIA9tIimdi3Qj9LO
+BtBs5wBaaryExZyQDFUCIQDaESne8AcqQ08gst1Ykyj0bKwl+ybSWxAzSb/52fFL
+HQIgKFX9s/EmhB2f6d7q8gCqYKqrTKiAbqGvh5h+mturG6kCIQDYAeRt92nBjYcW
+JtdnY+5PoE4uGUhtWtMDWuyVfDOuaQIgU9/flj81ZByBxXk5sULHUa3+eqfQKSgi
+xYZorAtL3xg=
+-----END PRIVATE KEY-----
diff --git a/tests/auto/network/ssl/qsslkey/qsslkey.pro b/tests/auto/network/ssl/qsslkey/qsslkey.pro
index 0074513878..8ed65e68ad 100644
--- a/tests/auto/network/ssl/qsslkey/qsslkey.pro
+++ b/tests/auto/network/ssl/qsslkey/qsslkey.pro
@@ -1,7 +1,6 @@
CONFIG += testcase
SOURCES += tst_qsslkey.cpp
-win32:LIBS += -lws2_32
QT = core network testlib
qtConfig(private_tests) {
QT += core-private network-private
diff --git a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
index 27d92db3bf..ddfe52c5e4 100644
--- a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
+++ b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
@@ -110,10 +110,10 @@ void tst_QSslKey::initTestCase()
testDataDir += QLatin1String("/");
QDir dir(testDataDir + "keys");
- QFileInfoList fileInfoList = dir.entryInfoList(QDir::Files | QDir::Readable);
- QRegExp rx(QLatin1String("^(rsa|dsa|ec)-(pub|pri)-(\\d+)-?\\w*\\.(pem|der)$"));
- foreach (QFileInfo fileInfo, fileInfoList) {
- if (rx.indexIn(fileInfo.fileName()) >= 0)
+ const QFileInfoList fileInfoList = dir.entryInfoList(QDir::Files | QDir::Readable);
+ QRegExp rx(QLatin1String("^(rsa|dsa|ec)-(pub|pri)-(\\d+)-?[\\w-]*\\.(pem|der)$"));
+ for (const QFileInfo &fileInfo : fileInfoList) {
+ if (rx.indexIn(fileInfo.fileName()) >= 0) {
keyInfoList << KeyInfo(
fileInfo,
rx.cap(1) == QLatin1String("rsa") ? QSsl::Rsa :
@@ -121,6 +121,7 @@ void tst_QSslKey::initTestCase()
rx.cap(2) == QLatin1String("pub") ? QSsl::PublicKey : QSsl::PrivateKey,
rx.cap(3).toInt(),
rx.cap(4) == QLatin1String("pem") ? QSsl::Pem : QSsl::Der);
+ }
}
}
@@ -163,6 +164,16 @@ void tst_QSslKey::createPlainTestRows(bool filter, QSsl::EncodingFormat format)
foreach (KeyInfo keyInfo, keyInfoList) {
if (filter && keyInfo.format != format)
continue;
+#ifdef Q_OS_WINRT
+ if (keyInfo.fileInfo.fileName().contains("RC2-64"))
+ continue; // WinRT treats RC2 as 128 bit
+#endif
+#if !defined(QT_NO_SSL) && defined(QT_NO_OPENSSL) // generic backend
+ if (keyInfo.fileInfo.fileName().contains(QRegularExpression("-aes\\d\\d\\d-")))
+ continue; // No AES support in the generic back-end
+ if (keyInfo.fileInfo.fileName().contains("pkcs8-pkcs12"))
+ continue; // The generic back-end doesn't support PKCS#12 algorithms
+#endif
QTest::newRow(keyInfo.fileInfo.fileName().toLatin1())
<< keyInfo.fileInfo.absoluteFilePath() << keyInfo.algorithm << keyInfo.type
@@ -186,7 +197,10 @@ void tst_QSslKey::constructor()
QFETCH(QSsl::EncodingFormat, format);
QByteArray encoded = readFile(absFilePath);
- QSslKey key(encoded, algorithm, format, type);
+ QByteArray passphrase;
+ if (QByteArray(QTest::currentDataTag()).contains("-pkcs8-"))
+ passphrase = QByteArray("1234");
+ QSslKey key(encoded, algorithm, format, type, passphrase);
QVERIFY(!key.isNull());
}
@@ -215,9 +229,12 @@ void tst_QSslKey::constructorHandle()
? q_PEM_read_bio_PUBKEY
: q_PEM_read_bio_PrivateKey);
+ QByteArray passphrase;
+ if (QByteArray(QTest::currentDataTag()).contains("-pkcs8-"))
+ passphrase = "1234";
BIO* bio = q_BIO_new(q_BIO_s_mem());
q_BIO_write(bio, pem.constData(), pem.length());
- QSslKey key(func(bio, nullptr, nullptr, nullptr), type);
+ QSslKey key(func(bio, nullptr, nullptr, static_cast<void *>(passphrase.data())), type);
q_BIO_free(bio);
QVERIFY(!key.isNull());
@@ -245,7 +262,10 @@ void tst_QSslKey::copyAndAssign()
QFETCH(QSsl::EncodingFormat, format);
QByteArray encoded = readFile(absFilePath);
- QSslKey key(encoded, algorithm, format, type);
+ QByteArray passphrase;
+ if (QByteArray(QTest::currentDataTag()).contains("-pkcs8-"))
+ passphrase = QByteArray("1234");
+ QSslKey key(encoded, algorithm, format, type, passphrase);
QSslKey copied(key);
QCOMPARE(key, copied);
@@ -286,7 +306,10 @@ void tst_QSslKey::length()
QFETCH(QSsl::EncodingFormat, format);
QByteArray encoded = readFile(absFilePath);
- QSslKey key(encoded, algorithm, format, type);
+ QByteArray passphrase;
+ if (QByteArray(QTest::currentDataTag()).contains("-pkcs8-"))
+ passphrase = QByteArray("1234");
+ QSslKey key(encoded, algorithm, format, type, passphrase);
QVERIFY(!key.isNull());
QCOMPARE(key.length(), length);
}
@@ -306,6 +329,17 @@ void tst_QSslKey::toPemOrDer()
QFETCH(QSsl::KeyType, type);
QFETCH(QSsl::EncodingFormat, format);
+ QByteArray dataTag = QByteArray(QTest::currentDataTag());
+ if (dataTag.contains("-pkcs8-")) // these are encrypted
+ QSKIP("Encrypted PKCS#8 keys gets decrypted when loaded. So we can't compare it to the encrypted version.");
+#ifndef QT_NO_OPENSSL
+ if (dataTag.contains("pkcs8"))
+ QSKIP("OpenSSL converts PKCS#8 keys to other formats, invalidating comparisons.");
+#else // !openssl
+ if (dataTag.contains("pkcs8") && dataTag.contains("rsa"))
+ QSKIP("PKCS#8 RSA keys are changed into a different format in the generic back-end, meaning the comparison fails.");
+#endif // openssl
+
QByteArray encoded = readFile(absFilePath);
QSslKey key(encoded, algorithm, format, type);
QVERIFY(!key.isNull());
@@ -326,6 +360,8 @@ void tst_QSslKey::toEncryptedPemOrDer_data()
passwords << " " << "foobar" << "foo bar"
<< "aAzZ`1234567890-=~!@#$%^&*()_+[]{}\\|;:'\",.<>/?"; // ### add more (?)
foreach (KeyInfo keyInfo, keyInfoList) {
+ if (keyInfo.fileInfo.fileName().contains("pkcs8"))
+ continue; // pkcs8 keys are encrypted in a different way than the other keys
foreach (QString password, passwords) {
const QByteArray testName = keyInfo.fileInfo.fileName().toLatin1()
+ '-' + (keyInfo.algorithm == QSsl::Rsa ? "RSA" :
diff --git a/tests/auto/network/ssl/qsslsocket/qsslsocket.pro b/tests/auto/network/ssl/qsslsocket/qsslsocket.pro
index f45857b02d..1260dc9410 100644
--- a/tests/auto/network/ssl/qsslsocket/qsslsocket.pro
+++ b/tests/auto/network/ssl/qsslsocket/qsslsocket.pro
@@ -1,7 +1,6 @@
CONFIG += testcase
SOURCES += tst_qsslsocket.cpp
-win32:LIBS += -lws2_32
QT = core core-private network-private testlib
TARGET = tst_qsslsocket
diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
index e32fa7c724..f45a5af5a1 100644
--- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -202,6 +202,9 @@ private slots:
void verifyDepth();
void disconnectFromHostWhenConnecting();
void disconnectFromHostWhenConnected();
+#ifndef QT_NO_OPENSSL
+ void closeWhileEmittingSocketError();
+#endif
void resetProxy();
void ignoreSslErrorsList_data();
void ignoreSslErrorsList();
@@ -1340,13 +1343,19 @@ void tst_QSslSocket::protocolServerSide()
QAbstractSocket::SocketState expectedState = (works) ? QAbstractSocket::ConnectedState : QAbstractSocket::UnconnectedState;
// Determine whether the client or the server caused the event loop
// to quit due to a socket error, and investigate the culprit.
- if (server.socket->error() != QAbstractSocket::UnknownSocketError) {
+ if (client.error() != QAbstractSocket::UnknownSocketError) {
+ // It can happen that the client, after TCP connection established, before
+ // incomingConnection() slot fired, hits TLS initialization error and stops
+ // the loop, so the server socket is not created yet.
+ if (server.socket)
+ QVERIFY(server.socket->error() == QAbstractSocket::UnknownSocketError);
+
+ QCOMPARE(int(client.state()), int(expectedState));
+ } else if (server.socket->error() != QAbstractSocket::UnknownSocketError) {
QVERIFY(client.error() == QAbstractSocket::UnknownSocketError);
QCOMPARE(int(server.socket->state()), int(expectedState));
- } else if (client.error() != QAbstractSocket::UnknownSocketError) {
- QVERIFY(server.socket->error() == QAbstractSocket::UnknownSocketError);
- QCOMPARE(int(client.state()), int(expectedState));
}
+
QCOMPARE(client.isEncrypted(), works);
}
@@ -2336,6 +2345,66 @@ void tst_QSslSocket::disconnectFromHostWhenConnected()
QCOMPARE(socket->bytesToWrite(), qint64(0));
}
+#ifndef QT_NO_OPENSSL
+
+class BrokenPskHandshake : public QTcpServer
+{
+public:
+ void socketError(QAbstractSocket::SocketError error)
+ {
+ Q_UNUSED(error);
+ QSslSocket *clientSocket = qobject_cast<QSslSocket *>(sender());
+ Q_ASSERT(clientSocket);
+ clientSocket->close();
+ QTestEventLoop::instance().exitLoop();
+ }
+private:
+
+ void incomingConnection(qintptr handle) override
+ {
+ if (!socket.setSocketDescriptor(handle))
+ return;
+
+ QSslConfiguration serverConfig(QSslConfiguration::defaultConfiguration());
+ serverConfig.setPreSharedKeyIdentityHint("abcdefghijklmnop");
+ socket.setSslConfiguration(serverConfig);
+ socket.startServerEncryption();
+ }
+
+ QSslSocket socket;
+};
+
+void tst_QSslSocket::closeWhileEmittingSocketError()
+{
+ QFETCH_GLOBAL(bool, setProxy);
+ if (setProxy)
+ return;
+
+ BrokenPskHandshake handshake;
+ if (!handshake.listen())
+ QSKIP("failed to start TLS server");
+
+ QSslSocket clientSocket;
+ QSslConfiguration clientConfig(QSslConfiguration::defaultConfiguration());
+ clientConfig.setPeerVerifyMode(QSslSocket::VerifyNone);
+ clientSocket.setSslConfiguration(clientConfig);
+
+ QSignalSpy socketErrorSpy(&clientSocket, SIGNAL(error(QAbstractSocket::SocketError)));
+ void (QSslSocket::*errorSignal)(QAbstractSocket::SocketError) = &QSslSocket::error;
+ connect(&clientSocket, errorSignal, &handshake, &BrokenPskHandshake::socketError);
+
+ clientSocket.connectToHostEncrypted(QStringLiteral("127.0.0.1"), handshake.serverPort());
+ // Make sure we have some data buffered so that close will try to flush:
+ clientSocket.write(QByteArray(1000000, Qt::Uninitialized));
+
+ QTestEventLoop::instance().enterLoopMSecs(1000);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QCOMPARE(socketErrorSpy.count(), 1);
+}
+
+#endif // QT_NO_OPENSSL
+
void tst_QSslSocket::resetProxy()
{
#ifndef QT_NO_NETWORKPROXY
@@ -2809,13 +2878,13 @@ class SslServer4 : public QTcpServer
{
Q_OBJECT
public:
- SslServer4() : socket(0) {}
- WebSocket *socket;
+
+ QScopedPointer<WebSocket> socket;
protected:
- void incomingConnection(qintptr socketDescriptor)
+ void incomingConnection(qintptr socketDescriptor) override
{
- socket = new WebSocket(socketDescriptor);
+ socket.reset(new WebSocket(socketDescriptor));
}
};
@@ -2829,38 +2898,36 @@ void tst_QSslSocket::qtbug18498_peek()
return;
SslServer4 server;
- QSslSocket *client = new QSslSocket(this);
-
QVERIFY(server.listen(QHostAddress::LocalHost));
- client->connectToHost("127.0.0.1", server.serverPort());
- QVERIFY(client->waitForConnected(5000));
+
+ QSslSocket client;
+ client.connectToHost("127.0.0.1", server.serverPort());
+ QVERIFY(client.waitForConnected(5000));
QVERIFY(server.waitForNewConnection(1000));
- client->setObjectName("client");
- client->ignoreSslErrors();
+ client.ignoreSslErrors();
int encryptedCounter = 2;
- connect(client, &QSslSocket::encrypted, this, [&encryptedCounter, this](){
+ connect(&client, &QSslSocket::encrypted, this, [&encryptedCounter](){
if (!--encryptedCounter)
exitLoop();
});
- WebSocket *serversocket = server.socket;
- connect(serversocket, &QSslSocket::encrypted, this, [&encryptedCounter, this](){
+ WebSocket *serversocket = server.socket.data();
+ connect(serversocket, &QSslSocket::encrypted, this, [&encryptedCounter](){
if (!--encryptedCounter)
exitLoop();
});
- connect(client, SIGNAL(disconnected()), this, SLOT(exitLoop()));
+ connect(&client, SIGNAL(disconnected()), this, SLOT(exitLoop()));
- client->startClientEncryption();
+ client.startClientEncryption();
QVERIFY(serversocket);
- serversocket->setObjectName("server");
enterLoop(1);
QVERIFY(!timeout());
QVERIFY(serversocket->isEncrypted());
- QVERIFY(client->isEncrypted());
+ QVERIFY(client.isEncrypted());
QByteArray data("abc123");
- client->write(data.data());
+ client.write(data.data());
connect(serversocket, SIGNAL(readyRead()), this, SLOT(exitLoop()));
enterLoop(1);
diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro
index c862b3d3ae..05755ff606 100644
--- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro
+++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/qsslsocket_onDemandCertificates_member.pro
@@ -2,7 +2,6 @@ CONFIG += testcase
testcase.timeout = 300 # this test is slow
SOURCES += tst_qsslsocket_onDemandCertificates_member.cpp
-win32:LIBS += -lws2_32
QT = core core-private network-private testlib
TARGET = tst_qsslsocket_onDemandCertificates_member
diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro
index c27a58fcd2..c345d7379f 100644
--- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro
+++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/qsslsocket_onDemandCertificates_static.pro
@@ -1,7 +1,6 @@
CONFIG += testcase
SOURCES += tst_qsslsocket_onDemandCertificates_static.cpp
-win32:LIBS += -lws2_32
QT = core core-private network-private testlib
TARGET = tst_qsslsocket_onDemandCertificates_static
diff --git a/tests/auto/network/ssl/ssl.pro b/tests/auto/network/ssl/ssl.pro
index 175f361071..e89443ef4e 100644
--- a/tests/auto/network/ssl/ssl.pro
+++ b/tests/auto/network/ssl/ssl.pro
@@ -1,7 +1,8 @@
TEMPLATE=subdirs
-QT_FOR_CONFIG += network
+QT_FOR_CONFIG += network-private
SUBDIRS=\
+ qpassworddigestor \
qsslcertificate \
qsslcipher \
qsslellipticcurve \
@@ -13,7 +14,13 @@ qtConfig(ssl) {
SUBDIRS += \
qsslsocket \
qsslsocket_onDemandCertificates_member \
- qsslsocket_onDemandCertificates_static \
+ qsslsocket_onDemandCertificates_static
+
+ qtConfig(dtls) {
+ SUBDIRS += \
+ qdtlscookie \
+ qdtls
+ }
}
}
diff --git a/tests/auto/opengl/qgl/BLACKLIST b/tests/auto/opengl/qgl/BLACKLIST
index 71be4bf19d..d3165a51e5 100644
--- a/tests/auto/opengl/qgl/BLACKLIST
+++ b/tests/auto/opengl/qgl/BLACKLIST
@@ -19,6 +19,7 @@ winrt
[graphicsViewClipping]
windows
winrt
+linux ci
[glFBOUseInGLWidget]
windows
winrt
diff --git a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
index 76186f5575..09bea20d26 100644
--- a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
+++ b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
@@ -131,6 +131,13 @@ public:
setAutoBufferSwap(false);
}
+ void resizeEvent(QResizeEvent *e)
+ {
+ m_thread->lock();
+ QGLWidget::resizeEvent(e);
+ m_thread->unlock();
+ }
+
void paintEvent(QPaintEvent *)
{
m_thread->lock();
diff --git a/tests/auto/other/gestures/BLACKLIST b/tests/auto/other/gestures/BLACKLIST
index 169117b36a..269bac5750 100644
--- a/tests/auto/other/gestures/BLACKLIST
+++ b/tests/auto/other/gestures/BLACKLIST
@@ -1,6 +1,18 @@
[]
rhel-7.4
+ubuntu-18.04
[customGesture]
# QTBUG-67254
ubuntu
opensuse
+opensuse-leap
+[graphicsItemGesture]
+ubuntu-18.04
+[graphicsItemTreeGesture]
+ubuntu-18.04
+[graphicsView]
+ubuntu-18.04
+[explicitGraphicsObjectTarget]
+ubuntu-18.04
+[autoCancelGestures2]
+ubuntu-18.04
diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp
index 074644393d..65a688ec40 100644
--- a/tests/auto/other/lancelot/paintcommands.cpp
+++ b/tests/auto/other/lancelot/paintcommands.cpp
@@ -106,7 +106,8 @@ const char *PaintCommands::spreadMethodTable[] = {
const char *PaintCommands::coordinateMethodTable[] = {
"LogicalMode",
"StretchToDeviceMode",
- "ObjectBoundingMode"
+ "ObjectBoundingMode",
+ "ObjectMode"
};
const char *PaintCommands::sizeModeTable[] = {
@@ -176,6 +177,9 @@ const char *PaintCommands::imageFormatTable[] = {
"Format_A2RGB30_Premultiplied",
"Alpha8",
"Grayscale8",
+ "RGBx64",
+ "RGBA64",
+ "RGBA64_Premultiplied",
};
int PaintCommands::translateEnum(const char *table[], const QString &pattern, int limit)
@@ -561,6 +565,10 @@ void PaintCommands::staticInit()
"^bitmap_load\\s+([\\w.:\\/]*)\\s*([\\w.:\\/]*)$",
"bitmap_load <bitmap filename> <bitmapName>\n - note that the image is stored as a pixmap",
"bitmap_load :/images/bitmap.png myBitmap");
+ DECL_PAINTCOMMAND("pixmap_setDevicePixelRatio", command_pixmap_setDevicePixelRatio,
+ "^pixmap_setDevicePixelRatio\\s+([\\w.:\\/]*)\\s+([.0-9]*)$",
+ "pixmap_setDevicePixelRatio <pixmapName> <dpr>",
+ "pixmap_setDevicePixelRatio myPixmap 2.0");
DECL_PAINTCOMMAND("image_convertToFormat", command_image_convertToFormat,
"^image_convertToFormat\\s+([\\w.:\\/]*)\\s+([\\w.:\\/]+)\\s+([\\w0-9_]*)$",
"image_convertToFormat <sourceImageName> <destImageName> <image format enum>",
@@ -577,6 +585,10 @@ void PaintCommands::staticInit()
"^image_setColorCount\\s+([\\w.:\\/]*)\\s+([0-9]*)$",
"image_setColorCount <imageName> <nbColors>",
"image_setColorCount myImage 128");
+ DECL_PAINTCOMMAND("image_setDevicePixelRatio", command_image_setDevicePixelRatio,
+ "^image_setDevicePixelRatio\\s+([\\w.:\\/]*)\\s+([.0-9]*)$",
+ "image_setDevicePixelRatio <imageName> <dpr>",
+ "image_setDevicePixelRatio myImage 2.0");
DECL_PAINTCOMMANDSECTION("transformations");
DECL_PAINTCOMMAND("resetMatrix", command_resetMatrix,
@@ -1761,7 +1773,9 @@ void PaintCommands::command_setBrush(QRegularExpressionMatch re)
{
QStringList caps = re.capturedTexts();
- QImage img = image_load<QImage>(caps.at(1));
+ QImage img = m_imageMap[caps.at(1)]; // try cache first
+ if (img.isNull())
+ img = image_load<QImage>(caps.at(1));
if (!img.isNull()) { // Assume image brush
if (m_verboseMode)
printf(" -(lance) setBrush(image=%s, width=%d, height=%d)\n",
@@ -2132,6 +2146,20 @@ void PaintCommands::command_bitmap_load(QRegularExpressionMatch re)
m_pixmapMap[name] = bm;
}
+void PaintCommands::command_pixmap_setDevicePixelRatio(QRegularExpressionMatch re)
+{
+ QStringList caps = re.capturedTexts();
+
+ QString name = caps.at(1);
+ double dpr = convertToDouble(caps.at(2));
+
+ if (m_verboseMode)
+ printf(" -(lance) pixmap_setDevicePixelRatio(%s), %.1f -> %.1f\n",
+ qPrintable(name), m_pixmapMap[name].devicePixelRatioF(), dpr);
+
+ m_pixmapMap[name].setDevicePixelRatio(dpr);
+}
+
/***************************************************************************************************/
void PaintCommands::command_pixmap_setMask(QRegularExpressionMatch re)
{
@@ -2197,6 +2225,21 @@ void PaintCommands::command_image_setColor(QRegularExpressionMatch re)
}
/***************************************************************************************************/
+void PaintCommands::command_image_setDevicePixelRatio(QRegularExpressionMatch re)
+{
+ QStringList caps = re.capturedTexts();
+
+ QString name = caps.at(1);
+ double dpr = convertToDouble(caps.at(2));
+
+ if (m_verboseMode)
+ printf(" -(lance) image_setDevicePixelRatio(%s), %.1f -> %.1f\n",
+ qPrintable(name), m_imageMap[name].devicePixelRatioF(), dpr);
+
+ m_imageMap[name].setDevicePixelRatio(dpr);
+}
+
+/***************************************************************************************************/
void PaintCommands::command_abort(QRegularExpressionMatch)
{
m_abort = true;
@@ -2355,7 +2398,7 @@ void PaintCommands::command_gradient_setSpread(QRegularExpressionMatch re)
void PaintCommands::command_gradient_setCoordinateMode(QRegularExpressionMatch re)
{
- int coord = translateEnum(coordinateMethodTable, re.captured(1), 3);
+ int coord = translateEnum(coordinateMethodTable, re.captured(1), 4);
if (m_verboseMode)
printf(" -(lance) gradient_setCoordinateMode %d=[%s]\n", coord,
diff --git a/tests/auto/other/lancelot/paintcommands.h b/tests/auto/other/lancelot/paintcommands.h
index e3fb96744c..83e3bbc11c 100644
--- a/tests/auto/other/lancelot/paintcommands.h
+++ b/tests/auto/other/lancelot/paintcommands.h
@@ -229,10 +229,12 @@ private:
void command_pixmap_load(QRegularExpressionMatch re);
void command_pixmap_setMask(QRegularExpressionMatch re);
void command_bitmap_load(QRegularExpressionMatch re);
+ void command_pixmap_setDevicePixelRatio(QRegularExpressionMatch re);
void command_image_convertToFormat(QRegularExpressionMatch re);
void command_image_load(QRegularExpressionMatch re);
void command_image_setColor(QRegularExpressionMatch re);
void command_image_setColorCount(QRegularExpressionMatch re);
+ void command_image_setDevicePixelRatio(QRegularExpressionMatch re);
// commands: transformation
void command_resetMatrix(QRegularExpressionMatch re);
diff --git a/tests/auto/other/lancelot/scripts/gradientxform_object.qps b/tests/auto/other/lancelot/scripts/gradientxform_object.qps
index d785a008c0..dcc718072f 100644
--- a/tests/auto/other/lancelot/scripts/gradientxform_object.qps
+++ b/tests/auto/other/lancelot/scripts/gradientxform_object.qps
@@ -62,7 +62,22 @@ repeat_block row
restore
end_block block
+save
translate 400 0
brushRotate 30.0
brushScale 1.5 .5
repeat_block block
+restore
+
+drawText 80 400 "BRUSH XFORM, OBJECT BOUNDING MODE"
+drawText 500 400 "BRUSH XFORM, OBJECT MODE"
+
+translate 0 400
+brushTranslate 0.5 0.5
+brushRotate 180.0
+brushTranslate -0.5 -0.5
+repeat_block block
+
+translate 400 0
+gradient_setCoordinateMode ObjectMode
+repeat_block block
diff --git a/tests/auto/other/lancelot/scripts/image_dpr.qps b/tests/auto/other/lancelot/scripts/image_dpr.qps
new file mode 100644
index 0000000000..7d3ca3099c
--- /dev/null
+++ b/tests/auto/other/lancelot/scripts/image_dpr.qps
@@ -0,0 +1,43 @@
+
+setRenderHint Antialiasing true
+setRenderHint SmoothPixmapTransform true
+
+image_load sign.png img1
+pixmap_load sign.png pix1
+
+begin_block drawIt
+save
+
+drawImage img1 20 20 -1 -1
+drawRect 17.5 17.5 85 85
+
+setBrush img1
+setPen NoPen
+drawRect 20 120 120 120
+
+brushRotate 45
+drawRect 20 260 120 120
+
+setBrush NoBrush
+drawTiledPixmap pix1 20 400 120 120
+
+restore
+end_block
+
+save
+translate 150 0
+rotate -5
+repeat_block drawIt
+restore
+
+image_setDevicePixelRatio img1 2.0
+pixmap_setDevicePixelRatio pix1 2.0
+translate 400 0
+repeat_block drawIt
+
+save
+translate 150 0
+rotate -5
+repeat_block drawIt
+restore
+
diff --git a/tests/auto/other/macnativeevents/macnativeevents.pro b/tests/auto/other/macnativeevents/macnativeevents.pro
index 0611377d0b..0fe5949a1d 100644
--- a/tests/auto/other/macnativeevents/macnativeevents.pro
+++ b/tests/auto/other/macnativeevents/macnativeevents.pro
@@ -8,3 +8,5 @@ SOURCES += tst_macnativeevents.cpp
requires(mac)
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+
+LIBS += -framework AppKit
diff --git a/tests/auto/other/other.pro b/tests/auto/other/other.pro
index ea2e1dabf2..d70c895dec 100644
--- a/tests/auto/other/other.pro
+++ b/tests/auto/other/other.pro
@@ -7,7 +7,7 @@ SUBDIRS=\
lancelot \
languagechange \
macgui \
- macnativeevents \
+ #macnativeevents \
macplist \
networkselftest \
qaccessibility \
@@ -39,7 +39,7 @@ SUBDIRS=\
qaccessibilitylinux \
qaccessibilitymac \
-!qtHaveModule(network): SUBDIRS -= \
+winrt|!qtHaveModule(network): SUBDIRS -= \
lancelot \
networkselftest \
qnetworkaccessmanager_and_qprogressdialog \
@@ -48,9 +48,9 @@ cross_compile: SUBDIRS -= \
atwrapper \
compiler
-!qtConfig(accessibility): SUBDIRS -= qaccessibility
+winrt|!qtHaveModule(gui)|!qtConfig(accessibility): SUBDIRS -= qaccessibility
-!qtConfig(accessibility-atspi-bridge): SUBDIRS -= qaccessibilitylinux
+!qtHaveModule(gui)|!qtConfig(accessibility-atspi-bridge): SUBDIRS -= qaccessibilitylinux
!qtConfig(process): SUBDIRS -= qprocess_and_guieventloop
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index 8cf039c06a..8b24937079 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -876,6 +876,10 @@ void tst_QAccessibility::applicationTest()
QCOMPARE(interface->child(1), static_cast<QAccessibleInterface*>(0));
QCOMPARE(interface->childCount(), 0);
+ // Check that asking for the application interface twice returns the same object
+ QAccessibleInterface *app2 = QAccessible::queryAccessibleInterface(qApp);
+ QCOMPARE(interface, app2);
+
QWidget widget;
widget.show();
qApp->setActiveWindow(&widget);
diff --git a/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp b/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp
index 2575f22309..48594b2fa1 100644
--- a/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp
+++ b/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp
@@ -211,6 +211,27 @@ void tst_QAccessibilityLinux::registerDbus()
mainWindow = getInterface(window, "org.a11y.atspi.Accessible");
}
+quint64 getAtspiState(QDBusInterface *interface)
+{
+ QDBusMessage msg = interface->call(QDBus::Block, "GetState");
+ const QDBusArgument arg = msg.arguments().at(0).value<QDBusArgument>();
+ quint32 state1 = 0;
+ quint64 state2 = 0;
+ arg.beginArray();
+ arg >> state1;
+ arg >> state2;
+ arg.endArray();
+
+ state2 = state2 << 32;
+ return state2 | state1;
+}
+
+bool hasState(QDBusInterface *interface, AtspiStateType state)
+{
+ quint64 intState = quint64(1) << state;
+ return getAtspiState(interface) & intState;
+}
+
#define ROOTPATH "/org/a11y/atspi/accessible"
void tst_QAccessibilityLinux::testLabel()
@@ -353,13 +374,21 @@ void tst_QAccessibilityLinux::testTreeWidget()
QDBusInterface *cell3 = getInterface(tableChildren.at(2), "org.a11y.atspi.Accessible");
QCOMPARE(cell3->property("Name").toString(), QLatin1String("0.0"));
+ QVERIFY(!hasState(cell3, ATSPI_STATE_EXPANDABLE));
+ QVERIFY(!hasState(cell3, ATSPI_STATE_EXPANDED));
QDBusInterface *cell4 = getInterface(tableChildren.at(3), "org.a11y.atspi.Accessible");
QCOMPARE(cell4->property("Name").toString(), QLatin1String("0.1"));
+ QDBusInterface *dbus_top2 = getInterface(tableChildren.at(4), "org.a11y.atspi.Accessible");
+ QCOMPARE(dbus_top2->property("Name").toString(), QLatin1String("1.0"));
+ QVERIFY(hasState(dbus_top2, ATSPI_STATE_EXPANDABLE));
+ QVERIFY(!hasState(dbus_top2, ATSPI_STATE_EXPANDED));
+
tree->expandItem(top2);
tableChildren = getChildren(treeIface);
QCOMPARE(tableChildren.size(), 8);
+ QVERIFY(hasState(dbus_top2, ATSPI_STATE_EXPANDED));
QDBusInterface *cell5 = getInterface(tableChildren.at(6), "org.a11y.atspi.Accessible");
QCOMPARE(cell5->property("Name").toString(), QLatin1String("1.0 0.0"));
@@ -471,23 +500,10 @@ void tst_QAccessibilityLinux::testSlider()
m_window->clearChildren();
}
-quint64 getAtspiState(QDBusInterface *interface)
-{
- QDBusMessage msg = interface->call(QDBus::Block, "GetState");
- const QDBusArgument arg = msg.arguments().at(0).value<QDBusArgument>();
- quint32 state1 = 0;
- quint64 state2 = 0;
- arg.beginArray();
- arg >> state1;
- arg >> state2;
- arg.endArray();
-
- state2 = state2 << 32;
- return state2 | state1;
-}
-
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);
@@ -508,15 +524,14 @@ void tst_QAccessibilityLinux::testFocus()
QDBusInterface *componentInterfaceLineEdit2 = getInterface(children.at(1), "org.a11y.atspi.Component");
QVERIFY(componentInterfaceLineEdit2->isValid());
- quint64 focusedState = quint64(1) << ATSPI_STATE_FOCUSED;
- QVERIFY(getAtspiState(accessibleInterfaceLineEdit1) & focusedState);
- QVERIFY(!(getAtspiState(accessibleInterfaceLineEdit2) & focusedState));
+ QVERIFY(hasState(accessibleInterfaceLineEdit1, ATSPI_STATE_FOCUSED));
+ QVERIFY(!hasState(accessibleInterfaceLineEdit2, ATSPI_STATE_FOCUSED));
QDBusMessage focusReply = componentInterfaceLineEdit2->call(QDBus::Block, "GrabFocus");
QVERIFY(focusReply.arguments().at(0).toBool());
QVERIFY(lineEdit2->hasFocus());
- QVERIFY(!(getAtspiState(accessibleInterfaceLineEdit1) & focusedState));
- QVERIFY(getAtspiState(accessibleInterfaceLineEdit2) & focusedState);
+ QVERIFY(!hasState(accessibleInterfaceLineEdit1, ATSPI_STATE_FOCUSED));
+ QVERIFY(hasState(accessibleInterfaceLineEdit2, ATSPI_STATE_FOCUSED));
m_window->clearChildren();
delete accessibleInterfaceLineEdit1;
delete accessibleInterfaceLineEdit2;
diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
index e9407fd903..4ebf7a37f9 100644
--- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
+++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
@@ -101,9 +101,9 @@ QDebug operator<<(QDebug dbg, AXErrorTag err)
@implementation TestAXObject
-- (id) initWithAXUIElementRef: (AXUIElementRef) ref {
+- (instancetype)initWithAXUIElementRef:(AXUIElementRef)ref {
- if ( self = [super init] ) {
+ if ((self = [super init])) {
reference = ref;
}
return self;
diff --git a/tests/auto/other/qfocusevent/BLACKLIST b/tests/auto/other/qfocusevent/BLACKLIST
index 502820fa12..0b03472587 100644
--- a/tests/auto/other/qfocusevent/BLACKLIST
+++ b/tests/auto/other/qfocusevent/BLACKLIST
@@ -2,4 +2,5 @@
osx-10.12 ci
[checkReason_ActiveWindow]
osx-10.12 ci
+winrt
diff --git a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
index ceac02279e..260ba12a97 100644
--- a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
+++ b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
@@ -351,9 +351,10 @@ void tst_QFocusEvent::checkReason_ActiveWindow()
d->hide();
if (!QGuiApplication::platformName().compare(QLatin1String("offscreen"), Qt::CaseInsensitive)
- || !QGuiApplication::platformName().compare(QLatin1String("minimal"), Qt::CaseInsensitive)) {
+ || !QGuiApplication::platformName().compare(QLatin1String("minimal"), Qt::CaseInsensitive)
+ || !QGuiApplication::platformName().compare(QLatin1String("winrt"), Qt::CaseInsensitive)) {
// Activate window of testFocusWidget, focus in that window goes to childFocusWidgetOne
- QWARN("Platforms offscreen and minimal require explicit activateWindow()");
+ QWARN("Platforms offscreen, minimal, and winrt require explicit activateWindow()");
testFocusWidget->activateWindow();
}
diff --git a/tests/auto/printsupport/dialogs/qabstractprintdialog/tst_qabstractprintdialog.cpp b/tests/auto/printsupport/dialogs/qabstractprintdialog/tst_qabstractprintdialog.cpp
index bb3624a51d..7f874a843d 100644
--- a/tests/auto/printsupport/dialogs/qabstractprintdialog/tst_qabstractprintdialog.cpp
+++ b/tests/auto/printsupport/dialogs/qabstractprintdialog/tst_qabstractprintdialog.cpp
@@ -101,8 +101,7 @@ void tst_QAbstractPrintDialog::setMinMax()
QPrinter printer;
MyAbstractPrintDialog obj1(&printer);
obj1.setEnabledOptions(QAbstractPrintDialog::PrintDialogOptions(QAbstractPrintDialog::None));
- QEXPECT_FAIL("", "QTBUG-22637", Abort);
- QCOMPARE(obj1.minPage(), 1);
+ QCOMPARE(obj1.minPage(), 0);
QCOMPARE(obj1.maxPage(), INT_MAX);
QVERIFY(!obj1.isOptionEnabled(QAbstractPrintDialog::PrintPageRange));
obj1.setMinMax(2,5);
diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
index 4f86e74117..a65dd0bf8f 100644
--- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
+++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
@@ -1026,7 +1026,7 @@ void tst_QPrinter::duplex()
pdf.setOutputFormat(QPrinter::PdfFormat);
QCOMPARE(pdf.duplex(), QPrinter::DuplexNone);
pdf.setDuplex(QPrinter::DuplexAuto);
- QCOMPARE(pdf.duplex(), QPrinter::DuplexAuto);
+ QCOMPARE(pdf.duplex(), QPrinter::DuplexNone); // pdf doesn't have the concept of duplex
QPrinter native;
if (native.outputFormat() == QPrinter::NativeFormat) {
@@ -1071,7 +1071,7 @@ void tst_QPrinter::doubleSidedPrinting()
pdf.setOutputFormat(QPrinter::PdfFormat);
QCOMPARE(pdf.doubleSidedPrinting(), false);
pdf.setDoubleSidedPrinting(true);
- QCOMPARE(pdf.doubleSidedPrinting(), true);
+ QCOMPARE(pdf.doubleSidedPrinting(), false); // pdf doesn't have the concept of duplex
QPrinter native;
if (native.outputFormat() == QPrinter::NativeFormat) {
diff --git a/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp b/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp
index 7bfa29ec8e..15190b0f3e 100644
--- a/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp
+++ b/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp
@@ -54,6 +54,18 @@ private slots:
void formatValue();
};
+static bool driverSupportsDefaultValues(QSqlDriver::DbmsType dbType)
+{
+ switch (dbType) {
+ case QSqlDriver::SQLite:
+ case QSqlDriver::PostgreSQL:
+ case QSqlDriver::Oracle:
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
void tst_QSqlDriver::initTestCase_data()
{
@@ -81,8 +93,9 @@ void tst_QSqlDriver::recreateTestTables(QSqlDatabase db)
doubleField = "more_data double precision";
else
doubleField = "more_data double(8,7)";
+ const QString defValue(driverSupportsDefaultValues(dbType) ? QStringLiteral("DEFAULT 'defaultVal'") : QString());
QVERIFY_SQL( q, exec("create table " + relTEST1 +
- " (id int not null primary key, name varchar(20), title_key int, another_title_key int, " + doubleField + QLatin1Char(')')));
+ " (id int not null primary key, name varchar(20) " + defValue + ", title_key int, another_title_key int, " + doubleField + QLatin1Char(')')));
QVERIFY_SQL( q, exec("insert into " + relTEST1 + " values(1, 'harry', 1, 2, 1.234567)"));
QVERIFY_SQL( q, exec("insert into " + relTEST1 + " values(2, 'trond', 2, 1, 8.901234)"));
QVERIFY_SQL( q, exec("insert into " + relTEST1 + " values(3, 'vohi', 1, 2, 5.678901)"));
@@ -127,7 +140,7 @@ void tst_QSqlDriver::record()
//check we can get records using an unquoted mixed case table name
QSqlRecord rec = db.driver()->record(tablename);
- QCOMPARE(rec.count(), 5);
+ QCOMPARE(rec.count(), fields.size());
QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db);
// QTBUG-1363: QSqlField::length() always return -1 when using QODBC3 driver and QSqlDatabase::record()
@@ -141,6 +154,9 @@ void tst_QSqlDriver::record()
for (int i = 0; i < fields.count(); ++i)
QCOMPARE(rec.fieldName(i), fields[i]);
+ if (driverSupportsDefaultValues(dbType))
+ QCOMPARE(rec.field(QStringLiteral("name")).defaultValue().toString(), QStringLiteral("defaultVal"));
+
if (dbType == QSqlDriver::Interbase || dbType == QSqlDriver::Oracle || dbType == QSqlDriver::DB2)
tablename = tablename.toUpper();
else if (dbType == QSqlDriver::PostgreSQL)
diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
index c64310a715..c4cf2e752f 100644
--- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
@@ -180,6 +180,8 @@ private slots:
void timeStampParsing();
void sqliteVirtualTable_data() { generic_data("QSQLITE"); }
void sqliteVirtualTable();
+ void mysql_timeType_data() { generic_data("QMYSQL"); }
+ void mysql_timeType();
#ifdef NOT_READY_YET
void task_229811();
@@ -631,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));
}
@@ -4722,5 +4731,58 @@ void tst_QSqlQuery::sqliteVirtualTable()
QCOMPARE(qry.value(1).toString(), "Peter");
}
+void tst_QSqlQuery::mysql_timeType()
+{
+ // The TIME data type is different to the standard with MySQL as it has a range of
+ // '-838:59:59' to '838:59:59'.
+ QFETCH(QString, dbName);
+ QSqlDatabase db = QSqlDatabase::database(dbName);
+ CHECK_DATABASE(db);
+ const auto tableName = qTableName("mysqlTimeType", __FILE__, db);
+ tst_Databases::safeDropTables(db, { tableName });
+ QSqlQuery qry(db);
+ QVERIFY_SQL(qry, exec("create table " + tableName + " (t time(6))"));
+
+ // MySQL will convert days into hours and add them together so 17 days 11 hours becomes 419 hours
+ const QStringList timeData = { "-838:59:59.000000", "-123:45:56.789", "000:00:00.0", "123:45:56.789",
+ "838:59:59.000000", "15:50", "12", "1213", "0 1:2:3", "17 11:22:33" };
+ const QStringList resultTimeData = { "-838:59:59.000000", "-123:45:56.789000", "00:00:00.000000",
+ "123:45:56.789000", "838:59:59.000000", "15:50:00.000000", "00:00:12.000000", "00:12:13.000000",
+ "01:02:03.000000", "419:22:33.000000" };
+ for (const QString &time : timeData)
+ QVERIFY_SQL(qry, exec("insert into " + tableName + " (t) VALUES ('" + time + "')"));
+
+ QVERIFY_SQL(qry, exec("select * from " + tableName));
+ for (const QString &time : qAsConst(resultTimeData)) {
+ QVERIFY(qry.next());
+ QCOMPARE(qry.value(0).toString(), time);
+ }
+
+ QVERIFY_SQL(qry, exec("delete from " + tableName));
+ for (const QString &time : timeData) {
+ QVERIFY_SQL(qry, prepare("insert into " + tableName + " (t) VALUES (:time)"));
+ qry.bindValue(0, time);
+ QVERIFY_SQL(qry, exec());
+ }
+ QVERIFY_SQL(qry, exec("select * from " + tableName));
+ for (const QString &time : resultTimeData) {
+ QVERIFY(qry.next());
+ QCOMPARE(qry.value(0).toString(), time);
+ }
+
+ QVERIFY_SQL(qry, exec("delete from " + tableName));
+ const QList<QTime> qTimeBasedData = { QTime(), QTime(1, 2, 3, 4), QTime(0, 0, 0, 0), QTime(23,59,59,999) };
+ for (const QTime &time : qTimeBasedData) {
+ QVERIFY_SQL(qry, prepare("insert into " + tableName + " (t) VALUES (:time)"));
+ qry.bindValue(0, time);
+ QVERIFY_SQL(qry, exec());
+ }
+ QVERIFY_SQL(qry, exec("select * from " + tableName));
+ for (const QTime &time : qTimeBasedData) {
+ QVERIFY(qry.next());
+ QCOMPARE(qry.value(0).toTime(), time);
+ }
+}
+
QTEST_MAIN( tst_QSqlQuery )
#include "tst_qsqlquery.moc"
diff --git a/tests/auto/sql/kernel/qsqlresult/qsqlresult.pro b/tests/auto/sql/kernel/qsqlresult/qsqlresult.pro
index 2e4c3f998d..5c567ad771 100644
--- a/tests/auto/sql/kernel/qsqlresult/qsqlresult.pro
+++ b/tests/auto/sql/kernel/qsqlresult/qsqlresult.pro
@@ -6,5 +6,3 @@ QT = core core-private sql sql-private testlib
SOURCES += tst_qsqlresult.cpp
HEADERS += testsqldriver.h
-mingw: LIBS += -lws2_32
-
diff --git a/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp b/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp
index 5482dc393b..09a842eb83 100644
--- a/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp
+++ b/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp
@@ -401,8 +401,10 @@ void tst_QSqlThread::readWriteThreading()
QTRY_VERIFY_WITH_TIMEOUT(threadFinishedCount >= 2, 10000);
}
+#ifdef QOCI_THREADED
// run with n threads in parallel. Change this constant to hammer the poor DB server even more
static const int maxThreadCount = 4;
+#endif
void tst_QSqlThread::readFromSingleConnection()
{
diff --git a/tests/auto/sql/models/qsqlrelationaldelegate/qsqlrelationaldelegate.pro b/tests/auto/sql/models/qsqlrelationaldelegate/qsqlrelationaldelegate.pro
new file mode 100644
index 0000000000..d911a46259
--- /dev/null
+++ b/tests/auto/sql/models/qsqlrelationaldelegate/qsqlrelationaldelegate.pro
@@ -0,0 +1,5 @@
+CONFIG += testcase
+TARGET = tst_qsqlrelationaldelegate
+SOURCES += tst_qsqlrelationaldelegate.cpp
+
+QT = core sql testlib core-private sql-private widgets
diff --git a/tests/auto/sql/models/qsqlrelationaldelegate/tst_qsqlrelationaldelegate.cpp b/tests/auto/sql/models/qsqlrelationaldelegate/tst_qsqlrelationaldelegate.cpp
new file mode 100644
index 0000000000..36f592395e
--- /dev/null
+++ b/tests/auto/sql/models/qsqlrelationaldelegate/tst_qsqlrelationaldelegate.cpp
@@ -0,0 +1,170 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QtTest/QtTest>
+#include <QtSql/QtSql>
+#include <QTableView>
+#include <QComboBox>
+
+#include "../../kernel/qsqldatabase/tst_databases.h"
+
+const QString reltest1(qTableName("reltest1", __FILE__, QSqlDatabase())),
+ reltest2(qTableName("reltest2", __FILE__, QSqlDatabase()));
+
+class tst_QSqlRelationalDelegate : public QObject
+{
+ Q_OBJECT
+
+public:
+ void recreateTestTables(QSqlDatabase);
+
+ tst_Databases dbs;
+
+public slots:
+ void initTestCase_data();
+ void initTestCase();
+ void cleanupTestCase();
+ void init();
+ void cleanup();
+
+private slots:
+ void comboBoxEditor();
+private:
+ void dropTestTables(QSqlDatabase db);
+};
+
+
+void tst_QSqlRelationalDelegate::initTestCase_data()
+{
+ QVERIFY(dbs.open());
+ if (dbs.fillTestTable() == 0)
+ QSKIP("No database drivers are available in this Qt configuration");
+}
+
+void tst_QSqlRelationalDelegate::recreateTestTables(QSqlDatabase db)
+{
+ dropTestTables(db);
+
+ QSqlQuery q(db);
+ QVERIFY_SQL(q, exec("create table " + reltest1 +
+ " (id int not null primary key, name varchar(20), title_key int, another_title_key int)"));
+ QVERIFY_SQL(q, exec("insert into " + reltest1 + " values(1, 'harry', 1, 2)"));
+ QVERIFY_SQL(q, exec("insert into " + reltest1 + " values(2, 'trond', 2, 1)"));
+ QVERIFY_SQL(q, exec("insert into " + reltest1 + " values(3, 'vohi', 1, 2)"));
+ QVERIFY_SQL(q, exec("insert into " + reltest1 + " values(4, 'boris', 2, 2)"));
+ QVERIFY_SQL(q, exec("insert into " + reltest1 + " values(5, 'nat', NULL, NULL)"));
+ QVERIFY_SQL(q, exec("insert into " + reltest1 + " values(6, 'ale', NULL, 2)"));
+
+ QVERIFY_SQL(q, exec("create table " + reltest2 + " (id int not null primary key, title varchar(20))"));
+ QVERIFY_SQL(q, exec("insert into " + reltest2 + " values(1, 'herr')"));
+ QVERIFY_SQL(q, exec("insert into " + reltest2 + " values(2, 'mister')"));
+}
+
+void tst_QSqlRelationalDelegate::initTestCase()
+{
+ foreach (const QString &dbname, dbs.dbNames) {
+ QSqlDatabase db=QSqlDatabase::database(dbname);
+ QSqlDriver::DbmsType dbType = tst_Databases::getDatabaseType(db);
+ if (dbType == QSqlDriver::Interbase) {
+ db.exec("SET DIALECT 3");
+ } else if (dbType == QSqlDriver::MSSqlServer) {
+ db.exec("SET ANSI_DEFAULTS ON");
+ db.exec("SET IMPLICIT_TRANSACTIONS OFF");
+ } else if (dbType == QSqlDriver::PostgreSQL) {
+ db.exec("set client_min_messages='warning'");
+ }
+ recreateTestTables(db);
+ }
+}
+
+void tst_QSqlRelationalDelegate::cleanupTestCase()
+{
+ foreach (const QString &dbName, dbs.dbNames) {
+ QSqlDatabase db = QSqlDatabase::database(dbName);
+ CHECK_DATABASE(db);
+ dropTestTables(QSqlDatabase::database(dbName));
+ }
+ dbs.close();
+}
+
+void tst_QSqlRelationalDelegate::dropTestTables(QSqlDatabase db)
+{
+ QStringList tableNames = { reltest1, reltest2 };
+ tst_Databases::safeDropTables(db, tableNames);
+}
+
+void tst_QSqlRelationalDelegate::init()
+{
+}
+
+void tst_QSqlRelationalDelegate::cleanup()
+{
+}
+
+void tst_QSqlRelationalDelegate::comboBoxEditor()
+{
+ QFETCH_GLOBAL(QString, dbName);
+ QSqlDatabase db = QSqlDatabase::database(dbName);
+ CHECK_DATABASE(db);
+
+ QTableView tv;
+ QSqlRelationalTableModel model(0, db);
+ model.setEditStrategy(QSqlTableModel::OnManualSubmit);
+ model.setTable(reltest1);
+ model.setRelation(2, QSqlRelation(reltest2, "id", "title"));
+ model.setRelation(3, QSqlRelation(reltest2, "id", "title"));
+ tv.setModel(&model);
+ QVERIFY_SQL(model, select());
+
+ QSqlRelationalDelegate delegate;
+ tv.setItemDelegate(&delegate);
+ tv.show();
+ QVERIFY(QTest::qWaitForWindowActive(&tv));
+
+ QModelIndex index = model.index(0, 2);
+ tv.setCurrentIndex(index);
+ tv.edit(index);
+ QList<QComboBox*> comboBoxes = tv.viewport()->findChildren<QComboBox *>();
+ QCOMPARE(comboBoxes.count(), 1);
+
+ QComboBox *editor = comboBoxes.at(0);
+ QCOMPARE(editor->currentText(), "herr");
+ QTest::keyClick(editor, Qt::Key_Down);
+ QTest::keyClick(editor, Qt::Key_Enter);
+ QCOMPARE(editor->currentText(), "mister");
+ QVERIFY_SQL(model, submitAll());
+
+ QSqlQuery qry(db);
+ QVERIFY_SQL(qry, exec("SELECT title_key FROM " + reltest1 + " WHERE id=1"));
+ QVERIFY(qry.next());
+ QCOMPARE(qry.value(0).toString(), "mister");
+}
+
+QTEST_MAIN(tst_QSqlRelationalDelegate)
+#include "tst_qsqlrelationaldelegate.moc"
diff --git a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp
index 430fa981d5..da31f437d9 100644
--- a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp
+++ b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp
@@ -31,11 +31,29 @@
#include "../../kernel/qsqldatabase/tst_databases.h"
#include <QtSql>
#include <QtSql/private/qsqltablemodel_p.h>
+#include <QThread>
const QString test(qTableName("test", __FILE__, QSqlDatabase())),
test2(qTableName("test2", __FILE__, QSqlDatabase())),
test3(qTableName("test3", __FILE__, QSqlDatabase()));
+// In order to catch when the warning message occurs, indicating that the database belongs to another
+// thread, we have to install our own message handler. To ensure that the test reporting still happens
+// as before, we call the originating one.
+//
+// For now, this is only called inside the modelInAnotherThread() test
+QtMessageHandler oldHandler = nullptr;
+
+void sqlTableModelMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
+{
+ if (type == QtWarningMsg &&
+ msg == "QSqlDatabasePrivate::database: requested database does not "
+ "belong to the calling thread.") {
+ QFAIL("Requested database does not belong to the calling thread.");
+ }
+ if (oldHandler)
+ oldHandler(type, context, msg);
+}
class tst_QSqlTableModel : public QObject
{
@@ -116,6 +134,7 @@ private slots:
void sqlite_bigTable_data() { generic_data("QSQLITE"); }
void sqlite_bigTable();
+ void modelInAnotherThread();
// bug specific tests
void insertRecordBeforeSelect_data() { generic_data(); }
@@ -276,6 +295,10 @@ void tst_QSqlTableModel::init()
void tst_QSqlTableModel::cleanup()
{
recreateTestTables();
+ if (oldHandler) {
+ qInstallMessageHandler(oldHandler);
+ oldHandler = nullptr;
+ }
}
void tst_QSqlTableModel::select()
@@ -2100,5 +2123,29 @@ void tst_QSqlTableModel::invalidFilterAndHeaderData()
QVERIFY(!v.isValid());
}
+class SqlThread : public QThread
+{
+public:
+ SqlThread() : QThread() {}
+ void run()
+ {
+ QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE", "non-default-connection");
+ QSqlTableModel stm(nullptr, db);
+ isDone = true;
+ }
+ bool isDone = false;
+};
+
+void tst_QSqlTableModel::modelInAnotherThread()
+{
+ oldHandler = qInstallMessageHandler(sqlTableModelMessageHandler);
+ QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
+ CHECK_DATABASE(db);
+ SqlThread t;
+ t.start();
+ QTRY_VERIFY(t.isDone);
+ QVERIFY(t.isFinished());
+}
+
QTEST_MAIN(tst_QSqlTableModel)
#include "tst_qsqltablemodel.moc"
diff --git a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
index a662fea615..8e2c7694a5 100644
--- a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+++ b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
@@ -130,6 +130,10 @@ private slots:
void compare_unregistered_enums();
void compare_registered_enums();
void compare_class_enums();
+ void test_windowflags_data();
+ void test_windowflags();
+ void test_unregistered_flags_data();
+ void test_unregistered_flags();
void compare_boolfuncs();
void compare_to_nullptr();
void compare_pointerfuncs();
@@ -180,6 +184,64 @@ void tst_Cmptest::compare_class_enums()
QCOMPARE(MyClassEnum::MyClassEnumValue1, MyClassEnum::MyClassEnumValue2);
}
+void tst_Cmptest::test_windowflags_data()
+{
+ QTest::addColumn<Qt::WindowFlags>("actualWindowFlags");
+ QTest::addColumn<Qt::WindowFlags>("expectedWindowFlags");
+
+ const Qt::WindowFlags windowFlags = Qt::Window
+ | Qt::WindowSystemMenuHint | Qt::WindowStaysOnBottomHint;
+ QTest::newRow("pass")
+ << windowFlags
+ << windowFlags;
+ QTest::newRow("fail1")
+ << windowFlags
+ << (windowFlags | Qt::FramelessWindowHint);
+ QTest::newRow("fail2")
+ << Qt::WindowFlags(Qt::Window)
+ << Qt::WindowFlags(Qt::Window | Qt::FramelessWindowHint);
+}
+
+void tst_Cmptest::test_windowflags()
+{
+ QFETCH(Qt::WindowFlags, actualWindowFlags);
+ QFETCH(Qt::WindowFlags, expectedWindowFlags);
+ QCOMPARE(actualWindowFlags, expectedWindowFlags);
+}
+
+enum UnregisteredEnum {
+ UnregisteredEnumValue1 = 0x1,
+ UnregisteredEnumValue2 = 0x2,
+ UnregisteredEnumValue3 = 0x4
+};
+
+typedef QFlags<UnregisteredEnum> UnregisteredFlags;
+
+Q_DECLARE_METATYPE(UnregisteredFlags);
+
+void tst_Cmptest::test_unregistered_flags_data()
+{
+ QTest::addColumn<UnregisteredFlags>("actualFlags");
+ QTest::addColumn<UnregisteredFlags>("expectedFlags");
+
+ QTest::newRow("pass")
+ << UnregisteredFlags(UnregisteredEnumValue1)
+ << UnregisteredFlags(UnregisteredEnumValue1);
+ QTest::newRow("fail1")
+ << UnregisteredFlags(UnregisteredEnumValue1 | UnregisteredEnumValue2)
+ << UnregisteredFlags(UnregisteredEnumValue1 | UnregisteredEnumValue3);
+ QTest::newRow("fail2")
+ << UnregisteredFlags(UnregisteredEnumValue1)
+ << UnregisteredFlags(UnregisteredEnumValue1 | UnregisteredEnumValue3);
+}
+
+void tst_Cmptest::test_unregistered_flags()
+{
+ QFETCH(UnregisteredFlags, actualFlags);
+ QFETCH(UnregisteredFlags, expectedFlags);
+ QCOMPARE(actualFlags, expectedFlags);
+}
+
static bool boolfunc() { return true; }
static bool boolfunc2() { return true; }
diff --git a/tests/auto/testlib/selftests/expected_assert.tap b/tests/auto/testlib/selftests/expected_assert.tap
new file mode 100644
index 0000000000..4cd26848ac
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_assert.tap
@@ -0,0 +1,16 @@
+TAP version 13
+# tst_Assert
+ok 1 - initTestCase()
+ok 2 - testNumber1()
+# ASSERT: "false" in file qtbase/tests/auto/testlib/selftests/assert/tst_assert.cpp, line 0
+not ok 3 - testNumber2()
+ ---
+ # Received a fatal error.
+ at: tst_Assert::testNumber2() (Unknown file:0)
+ file: Unknown file
+ line: 0
+ ...
+1..3
+# tests 3
+# pass 2
+# fail 1
diff --git a/tests/auto/testlib/selftests/expected_badxml.tap b/tests/auto/testlib/selftests/expected_badxml.tap
new file mode 100644
index 0000000000..7aa4f11829
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_badxml.tap
@@ -0,0 +1,61 @@
+TAP version 13
+# tst_BadXml
+ok 1 - initTestCase()
+# a message
+not ok 2 - badDataTag(fail end cdata ]]> text ]]> more text)
+ ---
+ # a failure
+ at: tst_BadXml::badDataTag() (qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp:101)
+ file: qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp
+ line: 101
+ ...
+# a message
+ok 3 - badDataTag(pass end cdata ]]> text ]]> more text)
+# a message
+not ok 4 - badDataTag(fail quotes " text" more text)
+ ---
+ # a failure
+ at: tst_BadXml::badDataTag() (qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp:101)
+ file: qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp
+ line: 101
+ ...
+# a message
+ok 5 - badDataTag(pass quotes " text" more text)
+# a message
+not ok 6 - badDataTag(fail xml close > open < tags < text)
+ ---
+ # a failure
+ at: tst_BadXml::badDataTag() (qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp:101)
+ file: qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp
+ line: 101
+ ...
+# a message
+ok 7 - badDataTag(pass xml close > open < tags < text)
+# a message
+not ok 8 - badDataTag(fail all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs)
+ ---
+ # a failure
+ at: tst_BadXml::badDataTag() (qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp:101)
+ file: qtbase/tests/auto/testlib/selftests/badxml/tst_badxml.cpp
+ line: 101
+ ...
+# a message
+ok 9 - badDataTag(pass all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs)
+# end cdata ]]> text ]]> more text
+ok 10 - badMessage(string 0)
+# quotes " text" more text
+ok 11 - badMessage(string 1)
+# xml close > open < tags < text
+ok 12 - badMessage(string 2)
+# all > " mixed ]]> up > " in < the ]]> hopes < of triggering "< ]]> bugs
+ok 13 - badMessage(string 3)
+not ok 14 - failWithNoFile()
+ ---
+ # failure message
+ ...
+ok 15 - encoding() # SKIP Skipped for text due to unpredictable console encoding.
+ok 16 - cleanupTestCase()
+1..16
+# tests 16
+# pass 10
+# fail 5
diff --git a/tests/auto/testlib/selftests/expected_benchlibcounting.tap b/tests/auto/testlib/selftests/expected_benchlibcounting.tap
new file mode 100644
index 0000000000..e7a4280278
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_benchlibcounting.tap
@@ -0,0 +1,17 @@
+TAP version 13
+# tst_BenchlibCounting
+ok 1 - initTestCase()
+ok 2 - passingBenchmark()
+ok 3 - skippingBenchmark() # SKIP This is a skipping benchmark
+not ok 4 - failingBenchmark()
+ ---
+ # This is a failing benchmark
+ at: tst_BenchlibCounting::failingBenchmark() (qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp:58)
+ file: qtbase/tests/auto/testlib/selftests/benchlibcounting/tst_benchlibcounting.cpp
+ line: 58
+ ...
+ok 5 - cleanupTestCase()
+1..5
+# tests 5
+# pass 3
+# fail 1
diff --git a/tests/auto/testlib/selftests/expected_benchlibeventcounter.tap b/tests/auto/testlib/selftests/expected_benchlibeventcounter.tap
new file mode 100644
index 0000000000..02c65e59da
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_benchlibeventcounter.tap
@@ -0,0 +1,15 @@
+TAP version 13
+# tst_BenchlibEventCounter
+ok 1 - initTestCase()
+ok 2 - events(0)
+ok 3 - events(1)
+ok 4 - events(10)
+ok 5 - events(100)
+ok 6 - events(500)
+ok 7 - events(5000)
+ok 8 - events(100000)
+ok 9 - cleanupTestCase()
+1..9
+# tests 9
+# pass 9
+# fail 0
diff --git a/tests/auto/testlib/selftests/expected_benchlibtickcounter.tap b/tests/auto/testlib/selftests/expected_benchlibtickcounter.tap
new file mode 100644
index 0000000000..85d7f10ea0
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_benchlibtickcounter.tap
@@ -0,0 +1,9 @@
+TAP version 13
+# tst_BenchlibTickCounter
+ok 1 - initTestCase()
+ok 2 - threeBillionTicks()
+ok 3 - cleanupTestCase()
+1..3
+# tests 3
+# pass 3
+# fail 0
diff --git a/tests/auto/testlib/selftests/expected_benchlibwalltime.tap b/tests/auto/testlib/selftests/expected_benchlibwalltime.tap
new file mode 100644
index 0000000000..7653ccbeb3
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_benchlibwalltime.tap
@@ -0,0 +1,11 @@
+TAP version 13
+# tst_BenchlibWalltime
+ok 1 - initTestCase()
+ok 2 - waitForOneThousand()
+ok 3 - waitForFourThousand()
+ok 4 - qbenchmark_once()
+ok 5 - cleanupTestCase()
+1..5
+# tests 5
+# pass 5
+# fail 0
diff --git a/tests/auto/testlib/selftests/expected_cmptest.lightxml b/tests/auto/testlib/selftests/expected_cmptest.lightxml
index d47967a445..58b5a5e530 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.lightxml
+++ b/tests/auto/testlib/selftests/expected_cmptest.lightxml
@@ -29,6 +29,42 @@
</Incident>
<Duration msecs="0"/>
</TestFunction>
+<TestFunction name="test_windowflags">
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[pass]]></DataTag>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[fail1]]></DataTag>
+ <Description><![CDATA[Compared values are not the same
+ Actual (actualWindowFlags) : Window|WindowSystemMenuHint|WindowStaysOnBottomHint
+ Expected (expectedWindowFlags): Window|FramelessWindowHint|WindowSystemMenuHint|WindowStaysOnBottomHint]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[fail2]]></DataTag>
+ <Description><![CDATA[Compared values are not the same
+ Actual (actualWindowFlags) : Window
+ Expected (expectedWindowFlags): Window|FramelessWindowHint]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="test_unregistered_flags">
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[pass]]></DataTag>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[fail1]]></DataTag>
+ <Description><![CDATA[Compared values are not the same
+ Actual (actualFlags) : 0x3
+ Expected (expectedFlags): 0x5]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[fail2]]></DataTag>
+ <Description><![CDATA[Compared values are not the same
+ Actual (actualFlags) : 0x1
+ Expected (expectedFlags): 0x5]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
<TestFunction name="compare_boolfuncs">
<Incident type="pass" file="" line="0" />
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_cmptest.tap b/tests/auto/testlib/selftests/expected_cmptest.tap
new file mode 100644
index 0000000000..238db2fc2b
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_cmptest.tap
@@ -0,0 +1,456 @@
+TAP version 13
+# tst_Cmptest
+ok 1 - initTestCase()
+not ok 2 - compare_unregistered_enums()
+ ---
+ # Compared values are not the same
+ at: tst_Cmptest::compare_unregistered_enums() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:171)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 171
+ ...
+not ok 3 - compare_registered_enums()
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: Sunday (Qt::Sunday)
+ found: Monday (Qt::Monday)
+ expected: Sunday (Qt::Sunday)
+ actual: Monday (Qt::Monday)
+ at: tst_Cmptest::compare_registered_enums() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:178)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 178
+ ...
+not ok 4 - compare_class_enums()
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: MyClassEnumValue2 (MyClassEnum::MyClassEnumValue2)
+ found: MyClassEnumValue1 (MyClassEnum::MyClassEnumValue1)
+ expected: MyClassEnumValue2 (MyClassEnum::MyClassEnumValue2)
+ actual: MyClassEnumValue1 (MyClassEnum::MyClassEnumValue1)
+ at: tst_Cmptest::compare_class_enums() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:184)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 184
+ ...
+ok 5 - test_windowflags(pass)
+not ok 6 - test_windowflags(fail1)
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: Window|FramelessWindowHint|WindowSystemMenuHint|WindowStaysOnBottomHint (expectedWindowFlags)
+ found: Window|WindowSystemMenuHint|WindowStaysOnBottomHint (actualWindowFlags)
+ expected: Window|FramelessWindowHint|WindowSystemMenuHint|WindowStaysOnBottomHint (expectedWindowFlags)
+ actual: Window|WindowSystemMenuHint|WindowStaysOnBottomHint (actualWindowFlags)
+ at: tst_Cmptest::test_windowflags() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:209)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 209
+ ...
+not ok 7 - test_windowflags(fail2)
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: Window|FramelessWindowHint (expectedWindowFlags)
+ found: Window (actualWindowFlags)
+ expected: Window|FramelessWindowHint (expectedWindowFlags)
+ actual: Window (actualWindowFlags)
+ at: tst_Cmptest::test_windowflags() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:209)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 209
+ ...
+ok 8 - test_unregistered_flags(pass)
+not ok 9 - test_unregistered_flags(fail1)
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: 0x5 (expectedFlags)
+ found: 0x3 (actualFlags)
+ expected: 0x5 (expectedFlags)
+ actual: 0x3 (actualFlags)
+ at: tst_Cmptest::test_unregistered_flags() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:242)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 242
+ ...
+not ok 10 - test_unregistered_flags(fail2)
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: 0x5 (expectedFlags)
+ found: 0x1 (actualFlags)
+ expected: 0x5 (expectedFlags)
+ actual: 0x1 (actualFlags)
+ at: tst_Cmptest::test_unregistered_flags() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:242)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 242
+ ...
+ok 11 - compare_boolfuncs()
+ok 12 - compare_to_nullptr()
+ok 13 - compare_pointerfuncs()
+not ok 14 - compare_tostring(int, string)
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: QVariant(QString,hi) (expected)
+ found: QVariant(int,123) (actual)
+ expected: QVariant(QString,hi) (expected)
+ actual: QVariant(int,123) (actual)
+ at: tst_Cmptest::compare_tostring() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:331)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 331
+ ...
+ok 15 - compare_tostring(both invalid)
+not ok 16 - compare_tostring(null hash, invalid)
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: QVariant() (expected)
+ found: QVariant(QVariantHash) (actual)
+ expected: QVariant() (expected)
+ actual: QVariant(QVariantHash) (actual)
+ at: tst_Cmptest::compare_tostring() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:331)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 331
+ ...
+not ok 17 - compare_tostring(string, null user type)
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: QVariant(PhonyClass) (expected)
+ found: QVariant(QString,A simple string) (actual)
+ expected: QVariant(PhonyClass) (expected)
+ actual: QVariant(QString,A simple string) (actual)
+ at: tst_Cmptest::compare_tostring() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:331)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 331
+ ...
+not ok 18 - compare_tostring(both non-null user type)
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: QVariant(PhonyClass,<value not representable as string>) (expected)
+ found: QVariant(PhonyClass,<value not representable as string>) (actual)
+ expected: QVariant(PhonyClass,<value not representable as string>) (expected)
+ actual: QVariant(PhonyClass,<value not representable as string>) (actual)
+ at: tst_Cmptest::compare_tostring() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:331)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 331
+ ...
+ok 19 - compareQStringLists(empty lists)
+ok 20 - compareQStringLists(equal lists)
+not ok 21 - compareQStringLists(last item different)
+ ---
+ type: QCOMPARE
+ message: Compared lists differ at index 2.
+ wanted: "DIFFERS" (opB)
+ found: "string3" (opA)
+ expected: "DIFFERS" (opB)
+ actual: "string3" (opA)
+ at: tst_Cmptest::compareQStringLists() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:425)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 425
+ ...
+not ok 22 - compareQStringLists(second-last item different)
+ ---
+ type: QCOMPARE
+ message: Compared lists differ at index 2.
+ wanted: "DIFFERS" (opB)
+ found: "string3" (opA)
+ expected: "DIFFERS" (opB)
+ actual: "string3" (opA)
+ at: tst_Cmptest::compareQStringLists() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:425)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 425
+ ...
+not ok 23 - compareQStringLists(prefix)
+ ---
+ # Compared lists have different sizes.
+ Actual (opA) size: 2
+ Expected (opB) size: 1
+ at: tst_Cmptest::compareQStringLists() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:425)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 425
+ ...
+not ok 24 - compareQStringLists(short list second)
+ ---
+ # Compared lists have different sizes.
+ Actual (opA) size: 12
+ Expected (opB) size: 1
+ at: tst_Cmptest::compareQStringLists() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:425)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 425
+ ...
+not ok 25 - compareQStringLists(short list first)
+ ---
+ # Compared lists have different sizes.
+ Actual (opA) size: 1
+ Expected (opB) size: 12
+ at: tst_Cmptest::compareQStringLists() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:425)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 425
+ ...
+not ok 26 - compareQListInt()
+ ---
+ type: QCOMPARE
+ message: Compared lists differ at index 2.
+ wanted: 4 (int2)
+ found: 3 (int1)
+ expected: 4 (int2)
+ actual: 3 (int1)
+ at: tst_Cmptest::compareQListInt() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:432)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 432
+ ...
+not ok 27 - compareQListDouble()
+ ---
+ type: QCOMPARE
+ message: Compared lists differ at index 0.
+ wanted: 1 (double2)
+ found: 1.5 (double1)
+ expected: 1 (double2)
+ actual: 1.5 (double1)
+ at: tst_Cmptest::compareQListDouble() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:439)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 439
+ ...
+ok 28 - compareQColor(Qt::yellow vs "yellow")
+not ok 29 - compareQColor(Qt::yellow vs Qt::green)
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: #ff00ff00 (colorB)
+ found: #ffffff00 (colorA)
+ expected: #ff00ff00 (colorB)
+ actual: #ffffff00 (colorA)
+ at: tst_Cmptest::compareQColor() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:458)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 458
+ ...
+not ok 30 - compareQColor(0x88ff0000 vs 0xffff0000)
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: #ffff0000 (colorB)
+ found: #88ff0000 (colorA)
+ expected: #ffff0000 (colorB)
+ actual: #88ff0000 (colorA)
+ at: tst_Cmptest::compareQColor() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:458)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 458
+ ...
+ok 31 - compareQPixmaps(both null)
+not ok 32 - compareQPixmaps(one null)
+ ---
+ type: QCOMPARE
+ message: Compared QPixmaps differ.
+ wanted: 0 (opB).isNull()
+ found: 1 (opA).isNull()
+ expected: 0 (opB).isNull()
+ actual: 1 (opA).isNull()
+ at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:483)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 483
+ ...
+not ok 33 - compareQPixmaps(other null)
+ ---
+ type: QCOMPARE
+ message: Compared QPixmaps differ.
+ wanted: 1 (opB).isNull()
+ found: 0 (opA).isNull()
+ expected: 1 (opB).isNull()
+ actual: 0 (opA).isNull()
+ at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:483)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 483
+ ...
+ok 34 - compareQPixmaps(equal)
+not ok 35 - compareQPixmaps(different size)
+ ---
+ type: QCOMPARE
+ message: Compared QPixmaps differ in size.
+ wanted: 20x20 (opB)
+ found: 11x20 (opA)
+ expected: 20x20 (opB)
+ actual: 11x20 (opA)
+ at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:483)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 483
+ ...
+not ok 36 - compareQPixmaps(different pixels)
+ ---
+ # Compared values are not the same
+ at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:483)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 483
+ ...
+ok 37 - compareQImages(both null)
+not ok 38 - compareQImages(one null)
+ ---
+ type: QCOMPARE
+ message: Compared QImages differ.
+ wanted: 0 (opB).isNull()
+ found: 1 (opA).isNull()
+ expected: 0 (opB).isNull()
+ actual: 1 (opA).isNull()
+ at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:510)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 510
+ ...
+not ok 39 - compareQImages(other null)
+ ---
+ type: QCOMPARE
+ message: Compared QImages differ.
+ wanted: 1 (opB).isNull()
+ found: 0 (opA).isNull()
+ expected: 1 (opB).isNull()
+ actual: 0 (opA).isNull()
+ at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:510)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 510
+ ...
+ok 40 - compareQImages(equal)
+not ok 41 - compareQImages(different size)
+ ---
+ type: QCOMPARE
+ message: Compared QImages differ in size.
+ wanted: 20x20 (opB)
+ found: 11x20 (opA)
+ expected: 20x20 (opB)
+ actual: 11x20 (opA)
+ at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:510)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 510
+ ...
+not ok 42 - compareQImages(different format)
+ ---
+ type: QCOMPARE
+ message: Compared QImages differ in format.
+ wanted: 3 (opB)
+ found: 6 (opA)
+ expected: 3 (opB)
+ actual: 6 (opA)
+ at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:510)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 510
+ ...
+not ok 43 - compareQImages(different pixels)
+ ---
+ # Compared values are not the same
+ at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:510)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 510
+ ...
+ok 44 - compareQRegion(equal-empty)
+not ok 45 - compareQRegion(1-empty)
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: QRegion(null) (rB)
+ found: QRegion(200x50+10+10) (rA)
+ expected: QRegion(null) (rB)
+ actual: QRegion(200x50+10+10) (rA)
+ at: tst_Cmptest::compareQRegion() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:533)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 533
+ ...
+ok 46 - compareQRegion(equal)
+not ok 47 - compareQRegion(different lists)
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: QRegion(2 rectangles, 50x200+100+200, 200x50+10+10) (rB)
+ found: QRegion(200x50+10+10) (rA)
+ expected: QRegion(2 rectangles, 50x200+100+200, 200x50+10+10) (rB)
+ actual: QRegion(200x50+10+10) (rA)
+ at: tst_Cmptest::compareQRegion() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:533)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 533
+ ...
+not ok 48 - compareQVector2D()
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: QVector2D(1, 3) (v2b)
+ found: QVector2D(1, 2) (v2a)
+ expected: QVector2D(1, 3) (v2b)
+ actual: QVector2D(1, 2) (v2a)
+ at: tst_Cmptest::compareQVector2D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:542)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 542
+ ...
+not ok 49 - compareQVector3D()
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: QVector3D(1, 3, 3) (v3b)
+ found: QVector3D(1, 2, 3) (v3a)
+ expected: QVector3D(1, 3, 3) (v3b)
+ actual: QVector3D(1, 2, 3) (v3a)
+ at: tst_Cmptest::compareQVector3D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:551)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 551
+ ...
+not ok 50 - compareQVector4D()
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: QVector4D(1, 3, 3, 4) (v4b)
+ found: QVector4D(1, 2, 3, 4) (v4a)
+ expected: QVector4D(1, 3, 3, 4) (v4b)
+ actual: QVector4D(1, 2, 3, 4) (v4a)
+ at: tst_Cmptest::compareQVector4D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:560)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 560
+ ...
+not ok 51 - verify()
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (opaqueFunc() < 2)
+ found: false (opaqueFunc() < 2)
+ expected: true (opaqueFunc() < 2)
+ actual: false (opaqueFunc() < 2)
+ at: tst_Cmptest::verify() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:572)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 572
+ ...
+not ok 52 - verify2()
+ ---
+ type: QVERIFY
+ message: 42
+ wanted: true (opaqueFunc() < 2)
+ found: false (opaqueFunc() < 2)
+ expected: true (opaqueFunc() < 2)
+ actual: false (opaqueFunc() < 2)
+ at: tst_Cmptest::verify2() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:578)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 578
+ ...
+not ok 53 - tryVerify()
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (opaqueFunc() < 2)
+ found: false (opaqueFunc() < 2)
+ expected: true (opaqueFunc() < 2)
+ actual: false (opaqueFunc() < 2)
+ at: tst_Cmptest::tryVerify() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:584)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 584
+ ...
+not ok 54 - tryVerify2()
+ ---
+ type: QVERIFY
+ message: 42
+ wanted: true (opaqueFunc() < 2)
+ found: false (opaqueFunc() < 2)
+ expected: true (opaqueFunc() < 2)
+ actual: false (opaqueFunc() < 2)
+ at: tst_Cmptest::tryVerify2() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:590)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 590
+ ...
+ok 55 - verifyExplicitOperatorBool()
+ok 56 - cleanupTestCase()
+1..56
+# tests 56
+# pass 18
+# fail 38
diff --git a/tests/auto/testlib/selftests/expected_cmptest.teamcity b/tests/auto/testlib/selftests/expected_cmptest.teamcity
index a0dc509279..422d0cbfdf 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.teamcity
+++ b/tests/auto/testlib/selftests/expected_cmptest.teamcity
@@ -10,6 +10,22 @@
##teamcity[testStarted name='compare_class_enums()' flowId='tst_Cmptest']
##teamcity[testFailed name='compare_class_enums()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared values are not the same|n Actual (MyClassEnum::MyClassEnumValue1): MyClassEnumValue1|n Expected (MyClassEnum::MyClassEnumValue2): MyClassEnumValue2' flowId='tst_Cmptest']
##teamcity[testFinished name='compare_class_enums()' flowId='tst_Cmptest']
+##teamcity[testStarted name='test_windowflags(pass)' flowId='tst_Cmptest']
+##teamcity[testFinished name='test_windowflags(pass)' flowId='tst_Cmptest']
+##teamcity[testStarted name='test_windowflags(fail1)' flowId='tst_Cmptest']
+##teamcity[testFailed name='test_windowflags(fail1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared values are not the same|n Actual (actualWindowFlags) : Window||WindowSystemMenuHint||WindowStaysOnBottomHint|n Expected (expectedWindowFlags): Window||FramelessWindowHint||WindowSystemMenuHint||WindowStaysOnBottomHint' flowId='tst_Cmptest']
+##teamcity[testFinished name='test_windowflags(fail1)' flowId='tst_Cmptest']
+##teamcity[testStarted name='test_windowflags(fail2)' flowId='tst_Cmptest']
+##teamcity[testFailed name='test_windowflags(fail2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared values are not the same|n Actual (actualWindowFlags) : Window|n Expected (expectedWindowFlags): Window||FramelessWindowHint' flowId='tst_Cmptest']
+##teamcity[testFinished name='test_windowflags(fail2)' flowId='tst_Cmptest']
+##teamcity[testStarted name='test_unregistered_flags(pass)' flowId='tst_Cmptest']
+##teamcity[testFinished name='test_unregistered_flags(pass)' flowId='tst_Cmptest']
+##teamcity[testStarted name='test_unregistered_flags(fail1)' flowId='tst_Cmptest']
+##teamcity[testFailed name='test_unregistered_flags(fail1)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared values are not the same|n Actual (actualFlags) : 0x3|n Expected (expectedFlags): 0x5' flowId='tst_Cmptest']
+##teamcity[testFinished name='test_unregistered_flags(fail1)' flowId='tst_Cmptest']
+##teamcity[testStarted name='test_unregistered_flags(fail2)' flowId='tst_Cmptest']
+##teamcity[testFailed name='test_unregistered_flags(fail2)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared values are not the same|n Actual (actualFlags) : 0x1|n Expected (expectedFlags): 0x5' flowId='tst_Cmptest']
+##teamcity[testFinished name='test_unregistered_flags(fail2)' flowId='tst_Cmptest']
##teamcity[testStarted name='compare_boolfuncs()' flowId='tst_Cmptest']
##teamcity[testFinished name='compare_boolfuncs()' flowId='tst_Cmptest']
##teamcity[testStarted name='compare_to_nullptr()' flowId='tst_Cmptest']
diff --git a/tests/auto/testlib/selftests/expected_cmptest.txt b/tests/auto/testlib/selftests/expected_cmptest.txt
index 78df990dea..e1aa81c1a1 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.txt
+++ b/tests/auto/testlib/selftests/expected_cmptest.txt
@@ -11,6 +11,24 @@ FAIL! : tst_Cmptest::compare_class_enums() Compared values are not the same
Actual (MyClassEnum::MyClassEnumValue1): MyClassEnumValue1
Expected (MyClassEnum::MyClassEnumValue2): MyClassEnumValue2
Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
+PASS : tst_Cmptest::test_windowflags(pass)
+FAIL! : tst_Cmptest::test_windowflags(fail1) Compared values are not the same
+ Actual (actualWindowFlags) : Window|WindowSystemMenuHint|WindowStaysOnBottomHint
+ Expected (expectedWindowFlags): Window|FramelessWindowHint|WindowSystemMenuHint|WindowStaysOnBottomHint
+ Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
+FAIL! : tst_Cmptest::test_windowflags(fail2) Compared values are not the same
+ Actual (actualWindowFlags) : Window
+ Expected (expectedWindowFlags): Window|FramelessWindowHint
+ Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
+PASS : tst_Cmptest::test_unregistered_flags(pass)
+FAIL! : tst_Cmptest::test_unregistered_flags(fail1) Compared values are not the same
+ Actual (actualFlags) : 0x3
+ Expected (expectedFlags): 0x5
+ Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
+FAIL! : tst_Cmptest::test_unregistered_flags(fail2) Compared values are not the same
+ Actual (actualFlags) : 0x1
+ Expected (expectedFlags): 0x5
+ Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
PASS : tst_Cmptest::compare_boolfuncs()
PASS : tst_Cmptest::compare_to_nullptr()
PASS : tst_Cmptest::compare_pointerfuncs()
@@ -138,5 +156,5 @@ FAIL! : tst_Cmptest::tryVerify2() 'opaqueFunc() < 2' returned FALSE. (42)
Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
PASS : tst_Cmptest::verifyExplicitOperatorBool()
PASS : tst_Cmptest::cleanupTestCase()
-Totals: 16 passed, 34 failed, 0 skipped, 0 blacklisted, 0ms
+Totals: 18 passed, 38 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Cmptest *********
diff --git a/tests/auto/testlib/selftests/expected_cmptest.xml b/tests/auto/testlib/selftests/expected_cmptest.xml
index 01b725f247..1c5a17631a 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.xml
+++ b/tests/auto/testlib/selftests/expected_cmptest.xml
@@ -31,6 +31,42 @@
</Incident>
<Duration msecs="0"/>
</TestFunction>
+<TestFunction name="test_windowflags">
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[pass]]></DataTag>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[fail1]]></DataTag>
+ <Description><![CDATA[Compared values are not the same
+ Actual (actualWindowFlags) : Window|WindowSystemMenuHint|WindowStaysOnBottomHint
+ Expected (expectedWindowFlags): Window|FramelessWindowHint|WindowSystemMenuHint|WindowStaysOnBottomHint]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[fail2]]></DataTag>
+ <Description><![CDATA[Compared values are not the same
+ Actual (actualWindowFlags) : Window
+ Expected (expectedWindowFlags): Window|FramelessWindowHint]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="test_unregistered_flags">
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[pass]]></DataTag>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[fail1]]></DataTag>
+ <Description><![CDATA[Compared values are not the same
+ Actual (actualFlags) : 0x3
+ Expected (expectedFlags): 0x5]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[fail2]]></DataTag>
+ <Description><![CDATA[Compared values are not the same
+ Actual (actualFlags) : 0x1
+ Expected (expectedFlags): 0x5]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
<TestFunction name="compare_boolfuncs">
<Incident type="pass" file="" line="0" />
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_cmptest.xunitxml b/tests/auto/testlib/selftests/expected_cmptest.xunitxml
index 812696ffcf..99823d1c1c 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.xunitxml
+++ b/tests/auto/testlib/selftests/expected_cmptest.xunitxml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<testsuite errors="0" failures="34" tests="24" name="tst_Cmptest">
+<testsuite errors="0" failures="38" tests="26" name="tst_Cmptest">
<properties>
<property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/>
<property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/>
@@ -19,6 +19,22 @@
Actual (MyClassEnum::MyClassEnumValue1): MyClassEnumValue1
Expected (MyClassEnum::MyClassEnumValue2): MyClassEnumValue2" result="fail"/>
</testcase>
+ <testcase result="fail" name="test_windowflags">
+ <failure tag="fail1" message="Compared values are not the same
+ Actual (actualWindowFlags) : Window|WindowSystemMenuHint|WindowStaysOnBottomHint
+ Expected (expectedWindowFlags): Window|FramelessWindowHint|WindowSystemMenuHint|WindowStaysOnBottomHint" result="fail"/>
+ <failure tag="fail2" message="Compared values are not the same
+ Actual (actualWindowFlags) : Window
+ Expected (expectedWindowFlags): Window|FramelessWindowHint" result="fail"/>
+ </testcase>
+ <testcase result="fail" name="test_unregistered_flags">
+ <failure tag="fail1" message="Compared values are not the same
+ Actual (actualFlags) : 0x3
+ Expected (expectedFlags): 0x5" result="fail"/>
+ <failure tag="fail2" message="Compared values are not the same
+ Actual (actualFlags) : 0x1
+ Expected (expectedFlags): 0x5" result="fail"/>
+ </testcase>
<testcase result="pass" name="compare_boolfuncs"/>
<testcase result="pass" name="compare_to_nullptr"/>
<testcase result="pass" name="compare_pointerfuncs"/>
diff --git a/tests/auto/testlib/selftests/expected_commandlinedata.tap b/tests/auto/testlib/selftests/expected_commandlinedata.tap
new file mode 100644
index 0000000000..1e1abfba50
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_commandlinedata.tap
@@ -0,0 +1,20 @@
+TAP version 13
+# tst_DataTable
+ok 1 - initTestCase()
+# QVERIFY(test)
+ok 2 - fiveTablePasses(fiveTablePasses_data1)
+# QVERIFY(test)
+ok 3 - fiveTablePasses(fiveTablePasses_data2)
+# QVERIFY(test)
+ok 4 - fiveTablePasses(fiveTablePasses_data3)
+# QVERIFY(test)
+ok 5 - fiveTablePasses(fiveTablePasses_data4)
+# QVERIFY(test)
+ok 6 - fiveTablePasses(fiveTablePasses_data5)
+# QVERIFY(test)
+ok 7 - fiveTablePasses(fiveTablePasses_data1)
+ok 8 - cleanupTestCase()
+1..8
+# tests 8
+# pass 8
+# fail 0
diff --git a/tests/auto/testlib/selftests/expected_counting.tap b/tests/auto/testlib/selftests/expected_counting.tap
new file mode 100644
index 0000000000..ad53e8f14e
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_counting.tap
@@ -0,0 +1,118 @@
+TAP version 13
+# tst_Counting
+ok 1 - initTestCase()
+ok 2 - testPassPass(row 1)
+ok 3 - testPassPass(row 2)
+ok 4 - testPassSkip(row 1)
+ok 5 - testPassSkip(row 2) # SKIP Skipping
+ok 6 - testPassFail(row 1)
+not ok 7 - testPassFail(row 2)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_Counting::testPassFail() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:102)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 102
+ ...
+ok 8 - testSkipPass(row 1) # SKIP Skipping
+ok 9 - testSkipPass(row 2)
+ok 10 - testSkipSkip(row 1) # SKIP Skipping
+ok 11 - testSkipSkip(row 2) # SKIP Skipping
+ok 12 - testSkipFail(row 1) # SKIP Skipping
+not ok 13 - testSkipFail(row 2)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_Counting::testSkipFail() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:102)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 102
+ ...
+not ok 14 - testFailPass(row 1)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_Counting::testFailPass() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:102)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 102
+ ...
+ok 15 - testFailPass(row 2)
+not ok 16 - testFailSkip(row 1)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_Counting::testFailSkip() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:102)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 102
+ ...
+ok 17 - testFailSkip(row 2) # SKIP Skipping
+not ok 18 - testFailFail(row 1)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_Counting::testFailFail() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:102)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 102
+ ...
+not ok 19 - testFailFail(row 2)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_Counting::testFailFail() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:102)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 102
+ ...
+ok 20 - testFailInInit(before)
+not ok 21 - testFailInInit(fail)
+ ---
+ # Fail in init()
+ at: tst_Counting::testFailInInit() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:221)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 221
+ ...
+ok 22 - testFailInInit(after)
+ok 23 - testFailInCleanup(before)
+# This test function should execute and then QFAIL in cleanup()
+not ok 24 - testFailInCleanup(fail)
+ ---
+ # Fail in cleanup()
+ at: tst_Counting::testFailInCleanup() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:229)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 229
+ ...
+ok 25 - testFailInCleanup(after)
+ok 26 - testSkipInInit(before)
+ok 27 - testSkipInInit(skip) # SKIP Skip in init()
+ok 28 - testSkipInInit(after)
+ok 29 - testSkipInCleanup(before)
+# This test function should execute and then QSKIP in cleanup()
+ok 30 - testSkipInCleanup(skip) # SKIP Skip in cleanup()
+ok 31 - testSkipInCleanup(after)
+ok 32 - cleanupTestCase()
+1..32
+# tests 32
+# pass 16
+# fail 8
diff --git a/tests/auto/testlib/selftests/expected_crashes_4.txt b/tests/auto/testlib/selftests/expected_crashes_4.txt
new file mode 100644
index 0000000000..e0e4d27b0a
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_crashes_4.txt
@@ -0,0 +1,7 @@
+********* Start testing of tst_Crashes *********
+Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+PASS : tst_Crashes::initTestCase()
+QFATAL : tst_Crashes::crash() Received signal 11
+ Function time: ms Total time: ms
+FAIL! : tst_Crashes::crash() Received a fatal error.
+ Loc: [Unknown file(0)]
diff --git a/tests/auto/testlib/selftests/expected_datatable.tap b/tests/auto/testlib/selftests/expected_datatable.tap
new file mode 100644
index 0000000000..8a3d473b6c
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_datatable.tap
@@ -0,0 +1,183 @@
+TAP version 13
+# tst_DataTable
+ok 1 - initTestCase()
+ok 2 - singleTestFunction1()
+ok 3 - singleTestFunction2()
+ok 4 - fiveTablePasses(fiveTablePasses_data 1)
+ok 5 - fiveTablePasses(fiveTablePasses_data 2)
+ok 6 - fiveTablePasses(fiveTablePasses_data 3)
+ok 7 - fiveTablePasses(fiveTablePasses_data 4)
+ok 8 - fiveTablePasses(fiveTablePasses_data 5)
+not ok 9 - fiveTableFailures(fiveTableFailures_data 1)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (test)
+ found: false (test)
+ expected: true (test)
+ actual: false (test)
+ at: tst_DataTable::fiveTableFailures() (qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp:78)
+ file: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp
+ line: 78
+ ...
+not ok 10 - fiveTableFailures(fiveTableFailures_data 2)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (test)
+ found: false (test)
+ expected: true (test)
+ actual: false (test)
+ at: tst_DataTable::fiveTableFailures() (qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp:78)
+ file: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp
+ line: 78
+ ...
+not ok 11 - fiveTableFailures(fiveTableFailures_data 3)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (test)
+ found: false (test)
+ expected: true (test)
+ actual: false (test)
+ at: tst_DataTable::fiveTableFailures() (qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp:78)
+ file: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp
+ line: 78
+ ...
+not ok 12 - fiveTableFailures(fiveTableFailures_data 4)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (test)
+ found: false (test)
+ expected: true (test)
+ actual: false (test)
+ at: tst_DataTable::fiveTableFailures() (qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp:78)
+ file: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp
+ line: 78
+ ...
+not ok 13 - fiveTableFailures(fiveTableFailures_data 5)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (test)
+ found: false (test)
+ expected: true (test)
+ actual: false (test)
+ at: tst_DataTable::fiveTableFailures() (qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp:78)
+ file: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp
+ line: 78
+ ...
+not ok 14 - startsWithFailure(startsWithFailure_data 1)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (test)
+ found: false (test)
+ expected: true (test)
+ actual: false (test)
+ at: tst_DataTable::startsWithFailure() (qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp:78)
+ file: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp
+ line: 78
+ ...
+ok 15 - startsWithFailure(startsWithFailure_data 2)
+ok 16 - startsWithFailure(startsWithFailure_data 3)
+ok 17 - startsWithFailure(startsWithFailure_data 4)
+ok 18 - startsWithFailure(startsWithFailure_data 5)
+ok 19 - endsWithFailure(endsWithFailure 1)
+ok 20 - endsWithFailure(endsWithFailure 2)
+ok 21 - endsWithFailure(endsWithFailure 3)
+ok 22 - endsWithFailure(endsWithFailure 4)
+not ok 23 - endsWithFailure(endsWithFailure 5)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (test)
+ found: false (test)
+ expected: true (test)
+ actual: false (test)
+ at: tst_DataTable::endsWithFailure() (qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp:78)
+ file: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp
+ line: 78
+ ...
+ok 24 - failureInMiddle(failureInMiddle_data 1)
+ok 25 - failureInMiddle(failureInMiddle_data 2)
+not ok 26 - failureInMiddle(failureInMiddle_data 3)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (test)
+ found: false (test)
+ expected: true (test)
+ actual: false (test)
+ at: tst_DataTable::failureInMiddle() (qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp:78)
+ file: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp
+ line: 78
+ ...
+ok 27 - failureInMiddle(failureInMiddle_data 4)
+ok 28 - failureInMiddle(failureInMiddle_data 5)
+not ok 29 - fiveIsolatedFailures(fiveIsolatedFailures_data 1)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (!test)
+ found: false (!test)
+ expected: true (!test)
+ actual: false (!test)
+ at: tst_DataTable::fiveIsolatedFailures() (qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp:160)
+ file: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp
+ line: 160
+ ...
+not ok 30 - fiveIsolatedFailures(fiveIsolatedFailures_data 2)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (!test)
+ found: false (!test)
+ expected: true (!test)
+ actual: false (!test)
+ at: tst_DataTable::fiveIsolatedFailures() (qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp:160)
+ file: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp
+ line: 160
+ ...
+not ok 31 - fiveIsolatedFailures(fiveIsolatedFailures_data 3)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (!test)
+ found: false (!test)
+ expected: true (!test)
+ actual: false (!test)
+ at: tst_DataTable::fiveIsolatedFailures() (qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp:160)
+ file: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp
+ line: 160
+ ...
+not ok 32 - fiveIsolatedFailures(fiveIsolatedFailures_data 4)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (!test)
+ found: false (!test)
+ expected: true (!test)
+ actual: false (!test)
+ at: tst_DataTable::fiveIsolatedFailures() (qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp:160)
+ file: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp
+ line: 160
+ ...
+not ok 33 - fiveIsolatedFailures(fiveIsolatedFailures_data 5)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (!test)
+ found: false (!test)
+ expected: true (!test)
+ actual: false (!test)
+ at: tst_DataTable::fiveIsolatedFailures() (qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp:160)
+ file: qtbase/tests/auto/testlib/selftests/datatable/tst_datatable.cpp
+ line: 160
+ ...
+ok 34 - cleanupTestCase()
+1..34
+# tests 34
+# pass 21
+# fail 13
diff --git a/tests/auto/testlib/selftests/expected_datetime.tap b/tests/auto/testlib/selftests/expected_datetime.tap
new file mode 100644
index 0000000000..896aeafa37
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_datetime.tap
@@ -0,0 +1,46 @@
+TAP version 13
+# tst_DateTime
+ok 1 - initTestCase()
+not ok 2 - dateTime()
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: 2000/05/03 04:03:04.000[UTC] (utc)
+ found: 2000/05/03 04:03:04.000[UTC+00:02] (local)
+ expected: 2000/05/03 04:03:04.000[UTC] (utc)
+ actual: 2000/05/03 04:03:04.000[UTC+00:02] (local)
+ at: tst_DateTime::dateTime() (qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp:52)
+ file: qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp
+ line: 52
+ ...
+ok 3 - qurl(empty urls)
+not ok 4 - qurl(empty rhs)
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: Invalid URL: (operandB)
+ found: http://example.com (operandA)
+ expected: Invalid URL: (operandB)
+ actual: http://example.com (operandA)
+ at: tst_DateTime::qurl() (qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp:60)
+ file: qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp
+ line: 60
+ ...
+not ok 5 - qurl(empty lhs)
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: http://example.com (operandB)
+ found: Invalid URL: (operandA)
+ expected: http://example.com (operandB)
+ actual: Invalid URL: (operandA)
+ at: tst_DateTime::qurl() (qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp:60)
+ file: qtbase/tests/auto/testlib/selftests/datetime/tst_datetime.cpp
+ line: 60
+ ...
+ok 6 - qurl(same urls)
+ok 7 - cleanupTestCase()
+1..7
+# tests 7
+# pass 4
+# fail 3
diff --git a/tests/auto/testlib/selftests/expected_exceptionthrow.tap b/tests/auto/testlib/selftests/expected_exceptionthrow.tap
new file mode 100644
index 0000000000..d8dbf173d6
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_exceptionthrow.tap
@@ -0,0 +1,14 @@
+TAP version 13
+# tst_Exception
+ok 1 - initTestCase()
+not ok 2 - throwException()
+ ---
+ # Caught unhandled exception
+ at: tst_Exception::throwException() (qtbase/src/testlib/qtestcase.cpp:1846)
+ file: qtbase/src/testlib/qtestcase.cpp
+ line: 1846
+ ...
+1..2
+# tests 2
+# pass 1
+# fail 1
diff --git a/tests/auto/testlib/selftests/expected_expectfail.tap b/tests/auto/testlib/selftests/expected_expectfail.tap
new file mode 100644
index 0000000000..0e5dc4d982
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_expectfail.tap
@@ -0,0 +1,96 @@
+TAP version 13
+# tst_ExpectFail
+ok 1 - initTestCase()
+# begin
+not ok 2 - xfailAndContinue() # TODO This should xfail
+ ---
+ at: tst_ExpectFail::xfailAndContinue() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:65)
+ file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
+ line: 65
+ ...
+# after
+# begin
+not ok 3 - xfailAndAbort() # TODO This should xfail
+ ---
+ at: tst_ExpectFail::xfailAndAbort() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:73)
+ file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
+ line: 73
+ ...
+not ok 4 - xfailTwice()
+ ---
+ # Already expecting a fail
+ at: tst_ExpectFail::xfailTwice() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:83)
+ file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
+ line: 83
+ ...
+not ok 5 - xfailWithQString() # TODO A string
+ ---
+ at: tst_ExpectFail::xfailWithQString() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:92)
+ file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
+ line: 92
+ ...
+not ok 5 - xfailWithQString() # TODO Bug 5 (The message)
+ ---
+ at: tst_ExpectFail::xfailWithQString() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:97)
+ file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
+ line: 97
+ ...
+ok 6 - xfailDataDrivenWithQVerify(Pass 1)
+ok 7 - xfailDataDrivenWithQVerify(Pass 2)
+not ok 8 - xfailDataDrivenWithQVerify(Abort) # TODO This test should xfail
+ ---
+ at: tst_ExpectFail::xfailDataDrivenWithQVerify() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:126)
+ file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
+ line: 126
+ ...
+not ok 9 - xfailDataDrivenWithQVerify(Continue) # TODO This test should xfail
+ ---
+ at: tst_ExpectFail::xfailDataDrivenWithQVerify() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:126)
+ file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
+ line: 126
+ ...
+ok 10 - xfailDataDrivenWithQCompare(Pass 1)
+ok 11 - xfailDataDrivenWithQCompare(Pass 2)
+not ok 12 - xfailDataDrivenWithQCompare(Abort) # TODO This test should xfail
+ ---
+ at: tst_ExpectFail::xfailDataDrivenWithQCompare() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:160)
+ file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
+ line: 160
+ ...
+not ok 13 - xfailDataDrivenWithQCompare(Continue) # TODO This test should xfail
+ ---
+ at: tst_ExpectFail::xfailDataDrivenWithQCompare() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:160)
+ file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
+ line: 160
+ ...
+ok 14 - xfailOnWrongRow(right row)
+not ok 15 - xfailOnAnyRow(first row) # TODO This test should xfail
+ ---
+ at: tst_ExpectFail::xfailOnAnyRow() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:195)
+ file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
+ line: 195
+ ...
+not ok 16 - xfailOnAnyRow(second row) # TODO This test should xfail
+ ---
+ at: tst_ExpectFail::xfailOnAnyRow() (qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp:195)
+ file: qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
+ line: 195
+ ...
+not ok 17 - xfailWithoutVerify(first row)
+ ---
+ # QEXPECT_FAIL was called without any subsequent verification statements
+ ...
+not ok 18 - xfailWithoutVerify(second row)
+ ---
+ # QEXPECT_FAIL was called without any subsequent verification statements
+ ...
+ok 19 - xpass() # TODO 'true' returned TRUE unexpectedly. ()
+ok 20 - xpassDataDrivenWithQVerify(XPass) # TODO 'true' returned TRUE unexpectedly. ()
+ok 21 - xpassDataDrivenWithQVerify(Pass)
+ok 22 - xpassDataDrivenWithQCompare(XPass) # TODO QCOMPARE(1, 1) returned TRUE unexpectedly.
+ok 23 - xpassDataDrivenWithQCompare(Pass)
+ok 24 - cleanupTestCase()
+1..24
+# tests 24
+# pass 18
+# fail 6
diff --git a/tests/auto/testlib/selftests/expected_failcleanup.tap b/tests/auto/testlib/selftests/expected_failcleanup.tap
new file mode 100644
index 0000000000..2098cc1e17
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_failcleanup.tap
@@ -0,0 +1,20 @@
+TAP version 13
+# tst_FailCleanup
+ok 1 - initTestCase()
+ok 2 - aTestFunction()
+not ok 3 - cleanupTestCase()
+ ---
+ type: QVERIFY
+ message: Fail inside cleanupTestCase
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_FailCleanup::cleanupTestCase() (qtbase/tests/auto/testlib/selftests/failcleanup/tst_failcleanup.cpp:46)
+ file: qtbase/tests/auto/testlib/selftests/failcleanup/tst_failcleanup.cpp
+ line: 46
+ ...
+1..3
+# tests 3
+# pass 2
+# fail 1
diff --git a/tests/auto/testlib/selftests/expected_failinit.tap b/tests/auto/testlib/selftests/expected_failinit.tap
new file mode 100644
index 0000000000..d99a71fd51
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_failinit.tap
@@ -0,0 +1,19 @@
+TAP version 13
+# tst_FailInit
+not ok 1 - initTestCase()
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_FailInit::initTestCase() (qtbase/tests/auto/testlib/selftests/failinit/tst_failinit.cpp:42)
+ file: qtbase/tests/auto/testlib/selftests/failinit/tst_failinit.cpp
+ line: 42
+ ...
+ok 2 - cleanupTestCase()
+1..2
+# tests 2
+# pass 1
+# fail 1
diff --git a/tests/auto/testlib/selftests/expected_failinitdata.tap b/tests/auto/testlib/selftests/expected_failinitdata.tap
new file mode 100644
index 0000000000..27bdda5a13
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_failinitdata.tap
@@ -0,0 +1,18 @@
+TAP version 13
+# tst_FailInitData
+not ok 1 - initTestCase()
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_FailInitData::initTestCase() (qtbase/tests/auto/testlib/selftests/failinitdata/tst_failinitdata.cpp:43)
+ file: qtbase/tests/auto/testlib/selftests/failinitdata/tst_failinitdata.cpp
+ line: 43
+ ...
+1..1
+# tests 1
+# pass 0
+# fail 1
diff --git a/tests/auto/testlib/selftests/expected_fetchbogus.tap b/tests/auto/testlib/selftests/expected_fetchbogus.tap
new file mode 100644
index 0000000000..c6761b2301
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_fetchbogus.tap
@@ -0,0 +1,15 @@
+TAP version 13
+# tst_FetchBogus
+ok 1 - initTestCase()
+# QFETCH: Requested testdata 'bubu' not available, check your _data function.
+not ok 2 - fetchBogus(foo)
+ ---
+ # Received a fatal error.
+ at: tst_FetchBogus::fetchBogus() (Unknown file:0)
+ file: Unknown file
+ line: 0
+ ...
+1..2
+# tests 2
+# pass 1
+# fail 1
diff --git a/tests/auto/testlib/selftests/expected_findtestdata.tap b/tests/auto/testlib/selftests/expected_findtestdata.tap
new file mode 100644
index 0000000000..0fb38d2822
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_findtestdata.tap
@@ -0,0 +1,10 @@
+TAP version 13
+# FindTestData
+ok 1 - initTestCase()
+# testdata testfile could not be located!
+ok 2 - paths()
+ok 3 - cleanupTestCase()
+1..3
+# tests 3
+# pass 3
+# fail 0
diff --git a/tests/auto/testlib/selftests/expected_float.tap b/tests/auto/testlib/selftests/expected_float.tap
new file mode 100644
index 0000000000..fae2dc9796
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_float.tap
@@ -0,0 +1,82 @@
+TAP version 13
+# tst_float
+ok 1 - initTestCase()
+ok 2 - floatComparisons(should SUCCEED 1)
+not ok 3 - floatComparisons(should FAIL 1)
+ ---
+ type: QCOMPARE
+ message: Compared floats are not the same (fuzzy compare)
+ wanted: 3 (operandRight)
+ found: 1 (operandLeft)
+ expected: 3 (operandRight)
+ actual: 1 (operandLeft)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:48)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 48
+ ...
+not ok 4 - floatComparisons(should FAIL 2)
+ ---
+ type: QCOMPARE
+ message: Compared floats are not the same (fuzzy compare)
+ wanted: 3e-07 (operandRight)
+ found: 1e-07 (operandLeft)
+ expected: 3e-07 (operandRight)
+ actual: 1e-07 (operandLeft)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:48)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 48
+ ...
+not ok 5 - floatComparisons(should FAIL 3)
+ ---
+ type: QCOMPARE
+ message: Compared floats are not the same (fuzzy compare)
+ wanted: 99999 (operandRight)
+ found: 99998 (operandLeft)
+ expected: 99999 (operandRight)
+ actual: 99998 (operandLeft)
+ at: tst_float::floatComparisons() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:48)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 48
+ ...
+ok 6 - floatComparisons(should SUCCEED 2)
+not ok 7 - compareFloatTests(1e0)
+ ---
+ type: QCOMPARE
+ message: Compared floats are not the same (fuzzy compare)
+ wanted: 3 (t3)
+ found: 1 (t1)
+ expected: 3 (t3)
+ actual: 1 (t1)
+ at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:96)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 96
+ ...
+not ok 8 - compareFloatTests(1e-7)
+ ---
+ type: QCOMPARE
+ message: Compared floats are not the same (fuzzy compare)
+ wanted: 3e-07 (t3)
+ found: 1e-07 (t1)
+ expected: 3e-07 (t3)
+ actual: 1e-07 (t1)
+ at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:96)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 96
+ ...
+not ok 9 - compareFloatTests(1e+7)
+ ---
+ type: QCOMPARE
+ message: Compared floats are not the same (fuzzy compare)
+ wanted: 3e+07 (t3)
+ found: 1e+07 (t1)
+ expected: 3e+07 (t3)
+ actual: 1e+07 (t1)
+ at: tst_float::compareFloatTests() (qtbase/tests/auto/testlib/selftests/float/tst_float.cpp:96)
+ file: qtbase/tests/auto/testlib/selftests/float/tst_float.cpp
+ line: 96
+ ...
+ok 10 - cleanupTestCase()
+1..10
+# tests 10
+# pass 4
+# fail 6
diff --git a/tests/auto/testlib/selftests/expected_globaldata.tap b/tests/auto/testlib/selftests/expected_globaldata.tap
new file mode 100644
index 0000000000..580cf3a7a8
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_globaldata.tap
@@ -0,0 +1,52 @@
+TAP version 13
+# tst_globaldata
+# initTestCase initTestCase (null)
+ok 1 - initTestCase()
+# init testGlobal local 1
+# global: false
+# local: false
+# cleanup testGlobal local 1
+ok 2 - testGlobal(1:local 1)
+# init testGlobal local 2
+# global: false
+# local: true
+# cleanup testGlobal local 2
+ok 3 - testGlobal(1:local 2)
+# init testGlobal local 1
+# global: true
+# local: false
+# cleanup testGlobal local 1
+ok 4 - testGlobal(2:local 1)
+# init testGlobal local 2
+# global: true
+# local: true
+# cleanup testGlobal local 2
+ok 5 - testGlobal(2:local 2)
+ok 6 - skip(1) # SKIP skipping
+# init skipLocal local 1
+ok 7 - skipLocal(1:local 1) # SKIP skipping
+# cleanup skipLocal local 1
+# init skipLocal local 2
+ok 8 - skipLocal(1:local 2) # SKIP skipping
+# cleanup skipLocal local 2
+# init skipSingle local 1
+# global: false local: false
+# cleanup skipSingle local 1
+ok 9 - skipSingle(1:local 1)
+# init skipSingle local 2
+# global: false local: true
+# cleanup skipSingle local 2
+ok 10 - skipSingle(1:local 2)
+# init skipSingle local 1
+ok 11 - skipSingle(2:local 1) # SKIP skipping
+# cleanup skipSingle local 1
+# init skipSingle local 2
+# global: true local: true
+# cleanup skipSingle local 2
+ok 12 - skipSingle(2:local 2)
+# cleanupTestCase cleanupTestCase (null)
+ok 13 - cleanupTestCase()
+1..13
+# tests 13
+# pass 9
+# fail 0
diff --git a/tests/auto/testlib/selftests/expected_keyboard.lightxml b/tests/auto/testlib/selftests/expected_keyboard.lightxml
new file mode 100644
index 0000000000..5699fba3bf
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_keyboard.lightxml
@@ -0,0 +1,18 @@
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="keyPressAndRelease">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_keyboard.tap b/tests/auto/testlib/selftests/expected_keyboard.tap
new file mode 100644
index 0000000000..0725434f8c
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_keyboard.tap
@@ -0,0 +1,9 @@
+TAP version 13
+# tst_Keyboard
+ok 1 - initTestCase()
+ok 2 - keyPressAndRelease()
+ok 3 - cleanupTestCase()
+1..3
+# tests 3
+# pass 3
+# fail 0
diff --git a/tests/auto/testlib/selftests/expected_keyboard.teamcity b/tests/auto/testlib/selftests/expected_keyboard.teamcity
new file mode 100644
index 0000000000..dc01f86ff0
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_keyboard.teamcity
@@ -0,0 +1,8 @@
+##teamcity[testSuiteStarted name='tst_Keyboard' flowId='tst_Keyboard']
+##teamcity[testStarted name='initTestCase()' flowId='tst_Keyboard']
+##teamcity[testFinished name='initTestCase()' flowId='tst_Keyboard']
+##teamcity[testStarted name='keyPressAndRelease()' flowId='tst_Keyboard']
+##teamcity[testFinished name='keyPressAndRelease()' flowId='tst_Keyboard']
+##teamcity[testStarted name='cleanupTestCase()' flowId='tst_Keyboard']
+##teamcity[testFinished name='cleanupTestCase()' flowId='tst_Keyboard']
+##teamcity[testSuiteFinished name='tst_Keyboard' flowId='tst_Keyboard']
diff --git a/tests/auto/testlib/selftests/expected_keyboard.txt b/tests/auto/testlib/selftests/expected_keyboard.txt
new file mode 100644
index 0000000000..13b7c70672
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_keyboard.txt
@@ -0,0 +1,7 @@
+********* Start testing of tst_Keyboard *********
+Config: Using QtTest library
+PASS : tst_Keyboard::initTestCase()
+PASS : tst_Keyboard::keyPressAndRelease()
+PASS : tst_Keyboard::cleanupTestCase()
+Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_Keyboard *********
diff --git a/tests/auto/testlib/selftests/expected_keyboard.xml b/tests/auto/testlib/selftests/expected_keyboard.xml
new file mode 100644
index 0000000000..f5ad1b2287
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_keyboard.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<TestCase name="tst_Keyboard">
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="keyPressAndRelease">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_keyboard.xunitxml b/tests/auto/testlib/selftests/expected_keyboard.xunitxml
new file mode 100644
index 0000000000..93b5f7bfff
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_keyboard.xunitxml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite errors="0" failures="0" tests="3" name="tst_Keyboard">
+ <properties>
+ <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/>
+ <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/>
+ <property value="" name="QtBuild"/>
+ </properties>
+ <testcase result="pass" name="initTestCase"/>
+ <testcase result="pass" name="keyPressAndRelease"/>
+ <testcase result="pass" name="cleanupTestCase"/>
+ <system-err/>
+</testsuite>
diff --git a/tests/auto/testlib/selftests/expected_longstring.tap b/tests/auto/testlib/selftests/expected_longstring.tap
new file mode 100644
index 0000000000..ac870f2d53
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_longstring.tap
@@ -0,0 +1,23 @@
+TAP version 13
+# tst_LongString
+ok 1 - initTestCase()
+not ok 2 - failWithLongString()
+ ---
+ # Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui.
+
+Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia.
+
+Nam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy metus. Vestibulum volutpat pretium libero. Cras id dui. Aenean ut eros et nisl sagittis vestibulum. Nullam nulla eros, ultricies sit amet, nonummy id, imperdiet feugiat, pede. Sed lectus. Donec mollis hendrerit risus. Phasellus nec sem in justo pellentesque facilisis. Etiam imperdiet imperdiet orci. Nunc nec neque. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi.
+
+Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Maecenas malesuada. Praesent congue erat at massa. Sed cursus turpis vitae tortor. Donec posuere vulputate arcu. Phasellus accumsan cursus velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed aliquam, nisi quis porttitor congue, elit erat euismod orci, ac placerat dolor lectus quis orci. Phasellus consectetuer vestibulum elit. Aenean tellus metus, bibendum sed, posuere ac, mattis non, nunc. Vestibulum fringilla pede sit amet augue. In turpis. Pellentesque posuere. Praesent turpis.
+
+Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales nec, volutpat a, suscipit non, turpis. Nullam sagittis. Suspendisse pulvinar, augue ac venenatis condimentum, sem libero volutpat nibh, nec pellentesque velit pede quis nunc. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce id purus. Ut varius tincidunt libero. Phasellus dolor. Maecenas vestibulum mollis diam. Pellentesque ut neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
+ at: tst_LongString::failWithLongString() (qtbase/tests/auto/testlib/selftests/longstring/tst_longstring.cpp:54)
+ file: qtbase/tests/auto/testlib/selftests/longstring/tst_longstring.cpp
+ line: 54
+ ...
+ok 3 - cleanupTestCase()
+1..3
+# tests 3
+# pass 2
+# fail 1
diff --git a/tests/auto/testlib/selftests/expected_maxwarnings.tap b/tests/auto/testlib/selftests/expected_maxwarnings.tap
new file mode 100644
index 0000000000..57bfbd8f8d
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_maxwarnings.tap
@@ -0,0 +1,2011 @@
+TAP version 13
+# MaxWarnings
+ok 1 - initTestCase()
+# 0
+# 1
+# 2
+# 3
+# 4
+# 5
+# 6
+# 7
+# 8
+# 9
+# 10
+# 11
+# 12
+# 13
+# 14
+# 15
+# 16
+# 17
+# 18
+# 19
+# 20
+# 21
+# 22
+# 23
+# 24
+# 25
+# 26
+# 27
+# 28
+# 29
+# 30
+# 31
+# 32
+# 33
+# 34
+# 35
+# 36
+# 37
+# 38
+# 39
+# 40
+# 41
+# 42
+# 43
+# 44
+# 45
+# 46
+# 47
+# 48
+# 49
+# 50
+# 51
+# 52
+# 53
+# 54
+# 55
+# 56
+# 57
+# 58
+# 59
+# 60
+# 61
+# 62
+# 63
+# 64
+# 65
+# 66
+# 67
+# 68
+# 69
+# 70
+# 71
+# 72
+# 73
+# 74
+# 75
+# 76
+# 77
+# 78
+# 79
+# 80
+# 81
+# 82
+# 83
+# 84
+# 85
+# 86
+# 87
+# 88
+# 89
+# 90
+# 91
+# 92
+# 93
+# 94
+# 95
+# 96
+# 97
+# 98
+# 99
+# 100
+# 101
+# 102
+# 103
+# 104
+# 105
+# 106
+# 107
+# 108
+# 109
+# 110
+# 111
+# 112
+# 113
+# 114
+# 115
+# 116
+# 117
+# 118
+# 119
+# 120
+# 121
+# 122
+# 123
+# 124
+# 125
+# 126
+# 127
+# 128
+# 129
+# 130
+# 131
+# 132
+# 133
+# 134
+# 135
+# 136
+# 137
+# 138
+# 139
+# 140
+# 141
+# 142
+# 143
+# 144
+# 145
+# 146
+# 147
+# 148
+# 149
+# 150
+# 151
+# 152
+# 153
+# 154
+# 155
+# 156
+# 157
+# 158
+# 159
+# 160
+# 161
+# 162
+# 163
+# 164
+# 165
+# 166
+# 167
+# 168
+# 169
+# 170
+# 171
+# 172
+# 173
+# 174
+# 175
+# 176
+# 177
+# 178
+# 179
+# 180
+# 181
+# 182
+# 183
+# 184
+# 185
+# 186
+# 187
+# 188
+# 189
+# 190
+# 191
+# 192
+# 193
+# 194
+# 195
+# 196
+# 197
+# 198
+# 199
+# 200
+# 201
+# 202
+# 203
+# 204
+# 205
+# 206
+# 207
+# 208
+# 209
+# 210
+# 211
+# 212
+# 213
+# 214
+# 215
+# 216
+# 217
+# 218
+# 219
+# 220
+# 221
+# 222
+# 223
+# 224
+# 225
+# 226
+# 227
+# 228
+# 229
+# 230
+# 231
+# 232
+# 233
+# 234
+# 235
+# 236
+# 237
+# 238
+# 239
+# 240
+# 241
+# 242
+# 243
+# 244
+# 245
+# 246
+# 247
+# 248
+# 249
+# 250
+# 251
+# 252
+# 253
+# 254
+# 255
+# 256
+# 257
+# 258
+# 259
+# 260
+# 261
+# 262
+# 263
+# 264
+# 265
+# 266
+# 267
+# 268
+# 269
+# 270
+# 271
+# 272
+# 273
+# 274
+# 275
+# 276
+# 277
+# 278
+# 279
+# 280
+# 281
+# 282
+# 283
+# 284
+# 285
+# 286
+# 287
+# 288
+# 289
+# 290
+# 291
+# 292
+# 293
+# 294
+# 295
+# 296
+# 297
+# 298
+# 299
+# 300
+# 301
+# 302
+# 303
+# 304
+# 305
+# 306
+# 307
+# 308
+# 309
+# 310
+# 311
+# 312
+# 313
+# 314
+# 315
+# 316
+# 317
+# 318
+# 319
+# 320
+# 321
+# 322
+# 323
+# 324
+# 325
+# 326
+# 327
+# 328
+# 329
+# 330
+# 331
+# 332
+# 333
+# 334
+# 335
+# 336
+# 337
+# 338
+# 339
+# 340
+# 341
+# 342
+# 343
+# 344
+# 345
+# 346
+# 347
+# 348
+# 349
+# 350
+# 351
+# 352
+# 353
+# 354
+# 355
+# 356
+# 357
+# 358
+# 359
+# 360
+# 361
+# 362
+# 363
+# 364
+# 365
+# 366
+# 367
+# 368
+# 369
+# 370
+# 371
+# 372
+# 373
+# 374
+# 375
+# 376
+# 377
+# 378
+# 379
+# 380
+# 381
+# 382
+# 383
+# 384
+# 385
+# 386
+# 387
+# 388
+# 389
+# 390
+# 391
+# 392
+# 393
+# 394
+# 395
+# 396
+# 397
+# 398
+# 399
+# 400
+# 401
+# 402
+# 403
+# 404
+# 405
+# 406
+# 407
+# 408
+# 409
+# 410
+# 411
+# 412
+# 413
+# 414
+# 415
+# 416
+# 417
+# 418
+# 419
+# 420
+# 421
+# 422
+# 423
+# 424
+# 425
+# 426
+# 427
+# 428
+# 429
+# 430
+# 431
+# 432
+# 433
+# 434
+# 435
+# 436
+# 437
+# 438
+# 439
+# 440
+# 441
+# 442
+# 443
+# 444
+# 445
+# 446
+# 447
+# 448
+# 449
+# 450
+# 451
+# 452
+# 453
+# 454
+# 455
+# 456
+# 457
+# 458
+# 459
+# 460
+# 461
+# 462
+# 463
+# 464
+# 465
+# 466
+# 467
+# 468
+# 469
+# 470
+# 471
+# 472
+# 473
+# 474
+# 475
+# 476
+# 477
+# 478
+# 479
+# 480
+# 481
+# 482
+# 483
+# 484
+# 485
+# 486
+# 487
+# 488
+# 489
+# 490
+# 491
+# 492
+# 493
+# 494
+# 495
+# 496
+# 497
+# 498
+# 499
+# 500
+# 501
+# 502
+# 503
+# 504
+# 505
+# 506
+# 507
+# 508
+# 509
+# 510
+# 511
+# 512
+# 513
+# 514
+# 515
+# 516
+# 517
+# 518
+# 519
+# 520
+# 521
+# 522
+# 523
+# 524
+# 525
+# 526
+# 527
+# 528
+# 529
+# 530
+# 531
+# 532
+# 533
+# 534
+# 535
+# 536
+# 537
+# 538
+# 539
+# 540
+# 541
+# 542
+# 543
+# 544
+# 545
+# 546
+# 547
+# 548
+# 549
+# 550
+# 551
+# 552
+# 553
+# 554
+# 555
+# 556
+# 557
+# 558
+# 559
+# 560
+# 561
+# 562
+# 563
+# 564
+# 565
+# 566
+# 567
+# 568
+# 569
+# 570
+# 571
+# 572
+# 573
+# 574
+# 575
+# 576
+# 577
+# 578
+# 579
+# 580
+# 581
+# 582
+# 583
+# 584
+# 585
+# 586
+# 587
+# 588
+# 589
+# 590
+# 591
+# 592
+# 593
+# 594
+# 595
+# 596
+# 597
+# 598
+# 599
+# 600
+# 601
+# 602
+# 603
+# 604
+# 605
+# 606
+# 607
+# 608
+# 609
+# 610
+# 611
+# 612
+# 613
+# 614
+# 615
+# 616
+# 617
+# 618
+# 619
+# 620
+# 621
+# 622
+# 623
+# 624
+# 625
+# 626
+# 627
+# 628
+# 629
+# 630
+# 631
+# 632
+# 633
+# 634
+# 635
+# 636
+# 637
+# 638
+# 639
+# 640
+# 641
+# 642
+# 643
+# 644
+# 645
+# 646
+# 647
+# 648
+# 649
+# 650
+# 651
+# 652
+# 653
+# 654
+# 655
+# 656
+# 657
+# 658
+# 659
+# 660
+# 661
+# 662
+# 663
+# 664
+# 665
+# 666
+# 667
+# 668
+# 669
+# 670
+# 671
+# 672
+# 673
+# 674
+# 675
+# 676
+# 677
+# 678
+# 679
+# 680
+# 681
+# 682
+# 683
+# 684
+# 685
+# 686
+# 687
+# 688
+# 689
+# 690
+# 691
+# 692
+# 693
+# 694
+# 695
+# 696
+# 697
+# 698
+# 699
+# 700
+# 701
+# 702
+# 703
+# 704
+# 705
+# 706
+# 707
+# 708
+# 709
+# 710
+# 711
+# 712
+# 713
+# 714
+# 715
+# 716
+# 717
+# 718
+# 719
+# 720
+# 721
+# 722
+# 723
+# 724
+# 725
+# 726
+# 727
+# 728
+# 729
+# 730
+# 731
+# 732
+# 733
+# 734
+# 735
+# 736
+# 737
+# 738
+# 739
+# 740
+# 741
+# 742
+# 743
+# 744
+# 745
+# 746
+# 747
+# 748
+# 749
+# 750
+# 751
+# 752
+# 753
+# 754
+# 755
+# 756
+# 757
+# 758
+# 759
+# 760
+# 761
+# 762
+# 763
+# 764
+# 765
+# 766
+# 767
+# 768
+# 769
+# 770
+# 771
+# 772
+# 773
+# 774
+# 775
+# 776
+# 777
+# 778
+# 779
+# 780
+# 781
+# 782
+# 783
+# 784
+# 785
+# 786
+# 787
+# 788
+# 789
+# 790
+# 791
+# 792
+# 793
+# 794
+# 795
+# 796
+# 797
+# 798
+# 799
+# 800
+# 801
+# 802
+# 803
+# 804
+# 805
+# 806
+# 807
+# 808
+# 809
+# 810
+# 811
+# 812
+# 813
+# 814
+# 815
+# 816
+# 817
+# 818
+# 819
+# 820
+# 821
+# 822
+# 823
+# 824
+# 825
+# 826
+# 827
+# 828
+# 829
+# 830
+# 831
+# 832
+# 833
+# 834
+# 835
+# 836
+# 837
+# 838
+# 839
+# 840
+# 841
+# 842
+# 843
+# 844
+# 845
+# 846
+# 847
+# 848
+# 849
+# 850
+# 851
+# 852
+# 853
+# 854
+# 855
+# 856
+# 857
+# 858
+# 859
+# 860
+# 861
+# 862
+# 863
+# 864
+# 865
+# 866
+# 867
+# 868
+# 869
+# 870
+# 871
+# 872
+# 873
+# 874
+# 875
+# 876
+# 877
+# 878
+# 879
+# 880
+# 881
+# 882
+# 883
+# 884
+# 885
+# 886
+# 887
+# 888
+# 889
+# 890
+# 891
+# 892
+# 893
+# 894
+# 895
+# 896
+# 897
+# 898
+# 899
+# 900
+# 901
+# 902
+# 903
+# 904
+# 905
+# 906
+# 907
+# 908
+# 909
+# 910
+# 911
+# 912
+# 913
+# 914
+# 915
+# 916
+# 917
+# 918
+# 919
+# 920
+# 921
+# 922
+# 923
+# 924
+# 925
+# 926
+# 927
+# 928
+# 929
+# 930
+# 931
+# 932
+# 933
+# 934
+# 935
+# 936
+# 937
+# 938
+# 939
+# 940
+# 941
+# 942
+# 943
+# 944
+# 945
+# 946
+# 947
+# 948
+# 949
+# 950
+# 951
+# 952
+# 953
+# 954
+# 955
+# 956
+# 957
+# 958
+# 959
+# 960
+# 961
+# 962
+# 963
+# 964
+# 965
+# 966
+# 967
+# 968
+# 969
+# 970
+# 971
+# 972
+# 973
+# 974
+# 975
+# 976
+# 977
+# 978
+# 979
+# 980
+# 981
+# 982
+# 983
+# 984
+# 985
+# 986
+# 987
+# 988
+# 989
+# 990
+# 991
+# 992
+# 993
+# 994
+# 995
+# 996
+# 997
+# 998
+# 999
+# 1000
+# 1001
+# 1002
+# 1003
+# 1004
+# 1005
+# 1006
+# 1007
+# 1008
+# 1009
+# 1010
+# 1011
+# 1012
+# 1013
+# 1014
+# 1015
+# 1016
+# 1017
+# 1018
+# 1019
+# 1020
+# 1021
+# 1022
+# 1023
+# 1024
+# 1025
+# 1026
+# 1027
+# 1028
+# 1029
+# 1030
+# 1031
+# 1032
+# 1033
+# 1034
+# 1035
+# 1036
+# 1037
+# 1038
+# 1039
+# 1040
+# 1041
+# 1042
+# 1043
+# 1044
+# 1045
+# 1046
+# 1047
+# 1048
+# 1049
+# 1050
+# 1051
+# 1052
+# 1053
+# 1054
+# 1055
+# 1056
+# 1057
+# 1058
+# 1059
+# 1060
+# 1061
+# 1062
+# 1063
+# 1064
+# 1065
+# 1066
+# 1067
+# 1068
+# 1069
+# 1070
+# 1071
+# 1072
+# 1073
+# 1074
+# 1075
+# 1076
+# 1077
+# 1078
+# 1079
+# 1080
+# 1081
+# 1082
+# 1083
+# 1084
+# 1085
+# 1086
+# 1087
+# 1088
+# 1089
+# 1090
+# 1091
+# 1092
+# 1093
+# 1094
+# 1095
+# 1096
+# 1097
+# 1098
+# 1099
+# 1100
+# 1101
+# 1102
+# 1103
+# 1104
+# 1105
+# 1106
+# 1107
+# 1108
+# 1109
+# 1110
+# 1111
+# 1112
+# 1113
+# 1114
+# 1115
+# 1116
+# 1117
+# 1118
+# 1119
+# 1120
+# 1121
+# 1122
+# 1123
+# 1124
+# 1125
+# 1126
+# 1127
+# 1128
+# 1129
+# 1130
+# 1131
+# 1132
+# 1133
+# 1134
+# 1135
+# 1136
+# 1137
+# 1138
+# 1139
+# 1140
+# 1141
+# 1142
+# 1143
+# 1144
+# 1145
+# 1146
+# 1147
+# 1148
+# 1149
+# 1150
+# 1151
+# 1152
+# 1153
+# 1154
+# 1155
+# 1156
+# 1157
+# 1158
+# 1159
+# 1160
+# 1161
+# 1162
+# 1163
+# 1164
+# 1165
+# 1166
+# 1167
+# 1168
+# 1169
+# 1170
+# 1171
+# 1172
+# 1173
+# 1174
+# 1175
+# 1176
+# 1177
+# 1178
+# 1179
+# 1180
+# 1181
+# 1182
+# 1183
+# 1184
+# 1185
+# 1186
+# 1187
+# 1188
+# 1189
+# 1190
+# 1191
+# 1192
+# 1193
+# 1194
+# 1195
+# 1196
+# 1197
+# 1198
+# 1199
+# 1200
+# 1201
+# 1202
+# 1203
+# 1204
+# 1205
+# 1206
+# 1207
+# 1208
+# 1209
+# 1210
+# 1211
+# 1212
+# 1213
+# 1214
+# 1215
+# 1216
+# 1217
+# 1218
+# 1219
+# 1220
+# 1221
+# 1222
+# 1223
+# 1224
+# 1225
+# 1226
+# 1227
+# 1228
+# 1229
+# 1230
+# 1231
+# 1232
+# 1233
+# 1234
+# 1235
+# 1236
+# 1237
+# 1238
+# 1239
+# 1240
+# 1241
+# 1242
+# 1243
+# 1244
+# 1245
+# 1246
+# 1247
+# 1248
+# 1249
+# 1250
+# 1251
+# 1252
+# 1253
+# 1254
+# 1255
+# 1256
+# 1257
+# 1258
+# 1259
+# 1260
+# 1261
+# 1262
+# 1263
+# 1264
+# 1265
+# 1266
+# 1267
+# 1268
+# 1269
+# 1270
+# 1271
+# 1272
+# 1273
+# 1274
+# 1275
+# 1276
+# 1277
+# 1278
+# 1279
+# 1280
+# 1281
+# 1282
+# 1283
+# 1284
+# 1285
+# 1286
+# 1287
+# 1288
+# 1289
+# 1290
+# 1291
+# 1292
+# 1293
+# 1294
+# 1295
+# 1296
+# 1297
+# 1298
+# 1299
+# 1300
+# 1301
+# 1302
+# 1303
+# 1304
+# 1305
+# 1306
+# 1307
+# 1308
+# 1309
+# 1310
+# 1311
+# 1312
+# 1313
+# 1314
+# 1315
+# 1316
+# 1317
+# 1318
+# 1319
+# 1320
+# 1321
+# 1322
+# 1323
+# 1324
+# 1325
+# 1326
+# 1327
+# 1328
+# 1329
+# 1330
+# 1331
+# 1332
+# 1333
+# 1334
+# 1335
+# 1336
+# 1337
+# 1338
+# 1339
+# 1340
+# 1341
+# 1342
+# 1343
+# 1344
+# 1345
+# 1346
+# 1347
+# 1348
+# 1349
+# 1350
+# 1351
+# 1352
+# 1353
+# 1354
+# 1355
+# 1356
+# 1357
+# 1358
+# 1359
+# 1360
+# 1361
+# 1362
+# 1363
+# 1364
+# 1365
+# 1366
+# 1367
+# 1368
+# 1369
+# 1370
+# 1371
+# 1372
+# 1373
+# 1374
+# 1375
+# 1376
+# 1377
+# 1378
+# 1379
+# 1380
+# 1381
+# 1382
+# 1383
+# 1384
+# 1385
+# 1386
+# 1387
+# 1388
+# 1389
+# 1390
+# 1391
+# 1392
+# 1393
+# 1394
+# 1395
+# 1396
+# 1397
+# 1398
+# 1399
+# 1400
+# 1401
+# 1402
+# 1403
+# 1404
+# 1405
+# 1406
+# 1407
+# 1408
+# 1409
+# 1410
+# 1411
+# 1412
+# 1413
+# 1414
+# 1415
+# 1416
+# 1417
+# 1418
+# 1419
+# 1420
+# 1421
+# 1422
+# 1423
+# 1424
+# 1425
+# 1426
+# 1427
+# 1428
+# 1429
+# 1430
+# 1431
+# 1432
+# 1433
+# 1434
+# 1435
+# 1436
+# 1437
+# 1438
+# 1439
+# 1440
+# 1441
+# 1442
+# 1443
+# 1444
+# 1445
+# 1446
+# 1447
+# 1448
+# 1449
+# 1450
+# 1451
+# 1452
+# 1453
+# 1454
+# 1455
+# 1456
+# 1457
+# 1458
+# 1459
+# 1460
+# 1461
+# 1462
+# 1463
+# 1464
+# 1465
+# 1466
+# 1467
+# 1468
+# 1469
+# 1470
+# 1471
+# 1472
+# 1473
+# 1474
+# 1475
+# 1476
+# 1477
+# 1478
+# 1479
+# 1480
+# 1481
+# 1482
+# 1483
+# 1484
+# 1485
+# 1486
+# 1487
+# 1488
+# 1489
+# 1490
+# 1491
+# 1492
+# 1493
+# 1494
+# 1495
+# 1496
+# 1497
+# 1498
+# 1499
+# 1500
+# 1501
+# 1502
+# 1503
+# 1504
+# 1505
+# 1506
+# 1507
+# 1508
+# 1509
+# 1510
+# 1511
+# 1512
+# 1513
+# 1514
+# 1515
+# 1516
+# 1517
+# 1518
+# 1519
+# 1520
+# 1521
+# 1522
+# 1523
+# 1524
+# 1525
+# 1526
+# 1527
+# 1528
+# 1529
+# 1530
+# 1531
+# 1532
+# 1533
+# 1534
+# 1535
+# 1536
+# 1537
+# 1538
+# 1539
+# 1540
+# 1541
+# 1542
+# 1543
+# 1544
+# 1545
+# 1546
+# 1547
+# 1548
+# 1549
+# 1550
+# 1551
+# 1552
+# 1553
+# 1554
+# 1555
+# 1556
+# 1557
+# 1558
+# 1559
+# 1560
+# 1561
+# 1562
+# 1563
+# 1564
+# 1565
+# 1566
+# 1567
+# 1568
+# 1569
+# 1570
+# 1571
+# 1572
+# 1573
+# 1574
+# 1575
+# 1576
+# 1577
+# 1578
+# 1579
+# 1580
+# 1581
+# 1582
+# 1583
+# 1584
+# 1585
+# 1586
+# 1587
+# 1588
+# 1589
+# 1590
+# 1591
+# 1592
+# 1593
+# 1594
+# 1595
+# 1596
+# 1597
+# 1598
+# 1599
+# 1600
+# 1601
+# 1602
+# 1603
+# 1604
+# 1605
+# 1606
+# 1607
+# 1608
+# 1609
+# 1610
+# 1611
+# 1612
+# 1613
+# 1614
+# 1615
+# 1616
+# 1617
+# 1618
+# 1619
+# 1620
+# 1621
+# 1622
+# 1623
+# 1624
+# 1625
+# 1626
+# 1627
+# 1628
+# 1629
+# 1630
+# 1631
+# 1632
+# 1633
+# 1634
+# 1635
+# 1636
+# 1637
+# 1638
+# 1639
+# 1640
+# 1641
+# 1642
+# 1643
+# 1644
+# 1645
+# 1646
+# 1647
+# 1648
+# 1649
+# 1650
+# 1651
+# 1652
+# 1653
+# 1654
+# 1655
+# 1656
+# 1657
+# 1658
+# 1659
+# 1660
+# 1661
+# 1662
+# 1663
+# 1664
+# 1665
+# 1666
+# 1667
+# 1668
+# 1669
+# 1670
+# 1671
+# 1672
+# 1673
+# 1674
+# 1675
+# 1676
+# 1677
+# 1678
+# 1679
+# 1680
+# 1681
+# 1682
+# 1683
+# 1684
+# 1685
+# 1686
+# 1687
+# 1688
+# 1689
+# 1690
+# 1691
+# 1692
+# 1693
+# 1694
+# 1695
+# 1696
+# 1697
+# 1698
+# 1699
+# 1700
+# 1701
+# 1702
+# 1703
+# 1704
+# 1705
+# 1706
+# 1707
+# 1708
+# 1709
+# 1710
+# 1711
+# 1712
+# 1713
+# 1714
+# 1715
+# 1716
+# 1717
+# 1718
+# 1719
+# 1720
+# 1721
+# 1722
+# 1723
+# 1724
+# 1725
+# 1726
+# 1727
+# 1728
+# 1729
+# 1730
+# 1731
+# 1732
+# 1733
+# 1734
+# 1735
+# 1736
+# 1737
+# 1738
+# 1739
+# 1740
+# 1741
+# 1742
+# 1743
+# 1744
+# 1745
+# 1746
+# 1747
+# 1748
+# 1749
+# 1750
+# 1751
+# 1752
+# 1753
+# 1754
+# 1755
+# 1756
+# 1757
+# 1758
+# 1759
+# 1760
+# 1761
+# 1762
+# 1763
+# 1764
+# 1765
+# 1766
+# 1767
+# 1768
+# 1769
+# 1770
+# 1771
+# 1772
+# 1773
+# 1774
+# 1775
+# 1776
+# 1777
+# 1778
+# 1779
+# 1780
+# 1781
+# 1782
+# 1783
+# 1784
+# 1785
+# 1786
+# 1787
+# 1788
+# 1789
+# 1790
+# 1791
+# 1792
+# 1793
+# 1794
+# 1795
+# 1796
+# 1797
+# 1798
+# 1799
+# 1800
+# 1801
+# 1802
+# 1803
+# 1804
+# 1805
+# 1806
+# 1807
+# 1808
+# 1809
+# 1810
+# 1811
+# 1812
+# 1813
+# 1814
+# 1815
+# 1816
+# 1817
+# 1818
+# 1819
+# 1820
+# 1821
+# 1822
+# 1823
+# 1824
+# 1825
+# 1826
+# 1827
+# 1828
+# 1829
+# 1830
+# 1831
+# 1832
+# 1833
+# 1834
+# 1835
+# 1836
+# 1837
+# 1838
+# 1839
+# 1840
+# 1841
+# 1842
+# 1843
+# 1844
+# 1845
+# 1846
+# 1847
+# 1848
+# 1849
+# 1850
+# 1851
+# 1852
+# 1853
+# 1854
+# 1855
+# 1856
+# 1857
+# 1858
+# 1859
+# 1860
+# 1861
+# 1862
+# 1863
+# 1864
+# 1865
+# 1866
+# 1867
+# 1868
+# 1869
+# 1870
+# 1871
+# 1872
+# 1873
+# 1874
+# 1875
+# 1876
+# 1877
+# 1878
+# 1879
+# 1880
+# 1881
+# 1882
+# 1883
+# 1884
+# 1885
+# 1886
+# 1887
+# 1888
+# 1889
+# 1890
+# 1891
+# 1892
+# 1893
+# 1894
+# 1895
+# 1896
+# 1897
+# 1898
+# 1899
+# 1900
+# 1901
+# 1902
+# 1903
+# 1904
+# 1905
+# 1906
+# 1907
+# 1908
+# 1909
+# 1910
+# 1911
+# 1912
+# 1913
+# 1914
+# 1915
+# 1916
+# 1917
+# 1918
+# 1919
+# 1920
+# 1921
+# 1922
+# 1923
+# 1924
+# 1925
+# 1926
+# 1927
+# 1928
+# 1929
+# 1930
+# 1931
+# 1932
+# 1933
+# 1934
+# 1935
+# 1936
+# 1937
+# 1938
+# 1939
+# 1940
+# 1941
+# 1942
+# 1943
+# 1944
+# 1945
+# 1946
+# 1947
+# 1948
+# 1949
+# 1950
+# 1951
+# 1952
+# 1953
+# 1954
+# 1955
+# 1956
+# 1957
+# 1958
+# 1959
+# 1960
+# 1961
+# 1962
+# 1963
+# 1964
+# 1965
+# 1966
+# 1967
+# 1968
+# 1969
+# 1970
+# 1971
+# 1972
+# 1973
+# 1974
+# 1975
+# 1976
+# 1977
+# 1978
+# 1979
+# 1980
+# 1981
+# 1982
+# 1983
+# 1984
+# 1985
+# 1986
+# 1987
+# 1988
+# 1989
+# 1990
+# 1991
+# 1992
+# 1993
+# 1994
+# 1995
+# 1996
+# 1997
+# 1998
+# 1999
+# 2000
+# Maximum amount of warnings exceeded. Use -maxwarnings to override.
+ok 2 - warn()
+ok 3 - cleanupTestCase()
+1..3
+# tests 3
+# pass 3
+# fail 0
diff --git a/tests/auto/testlib/selftests/expected_pairdiagnostics.tap b/tests/auto/testlib/selftests/expected_pairdiagnostics.tap
new file mode 100644
index 0000000000..9c45880c2d
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_pairdiagnostics.tap
@@ -0,0 +1,32 @@
+TAP version 13
+# tst_PairDiagnostics
+ok 1 - initTestCase()
+not ok 2 - testQPair()
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: "QPair(1,2)" (pair2)
+ found: "QPair(1,1)" (pair1)
+ expected: "QPair(1,2)" (pair2)
+ actual: "QPair(1,1)" (pair1)
+ at: tst_PairDiagnostics::testQPair() (qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp:51)
+ file: qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp
+ line: 51
+ ...
+not ok 3 - testStdPair()
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: "std::pair(1,2)" (pair2)
+ found: "std::pair(1,1)" (pair1)
+ expected: "std::pair(1,2)" (pair2)
+ actual: "std::pair(1,1)" (pair1)
+ at: tst_PairDiagnostics::testStdPair() (qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp:58)
+ file: qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp
+ line: 58
+ ...
+ok 4 - cleanupTestCase()
+1..4
+# tests 4
+# pass 2
+# fail 2
diff --git a/tests/auto/testlib/selftests/expected_singleskip.tap b/tests/auto/testlib/selftests/expected_singleskip.tap
new file mode 100644
index 0000000000..2cc09e7d26
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_singleskip.tap
@@ -0,0 +1,9 @@
+TAP version 13
+# tst_SingleSkip
+ok 1 - initTestCase()
+ok 2 - myTest() # SKIP skipping test
+ok 3 - cleanupTestCase()
+1..3
+# tests 3
+# pass 2
+# fail 0
diff --git a/tests/auto/testlib/selftests/expected_skip.tap b/tests/auto/testlib/selftests/expected_skip.tap
new file mode 100644
index 0000000000..adf9f692a9
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_skip.tap
@@ -0,0 +1,13 @@
+TAP version 13
+# tst_Skip
+ok 1 - initTestCase()
+ok 2 - test() # SKIP skipping all
+ok 3 - emptytest() # SKIP skipping all
+ok 4 - singleSkip(local 1) # SKIP skipping one
+# this line should only be reached once (true)
+ok 5 - singleSkip(local 2)
+ok 6 - cleanupTestCase()
+1..6
+# tests 6
+# pass 3
+# fail 0
diff --git a/tests/auto/testlib/selftests/expected_skipcleanup.tap b/tests/auto/testlib/selftests/expected_skipcleanup.tap
new file mode 100644
index 0000000000..4a3f8f852c
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_skipcleanup.tap
@@ -0,0 +1,9 @@
+TAP version 13
+# tst_SkipCleanup
+ok 1 - initTestCase()
+ok 2 - aTestFunction()
+ok 3 - cleanupTestCase() # SKIP Skip inside cleanupTestCase.
+1..3
+# tests 3
+# pass 2
+# fail 0
diff --git a/tests/auto/testlib/selftests/expected_skipinit.tap b/tests/auto/testlib/selftests/expected_skipinit.tap
new file mode 100644
index 0000000000..1fc38e79aa
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_skipinit.tap
@@ -0,0 +1,8 @@
+TAP version 13
+# tst_SkipInit
+ok 1 - initTestCase() # SKIP Skip inside initTestCase. This should skip all tests in the class.
+ok 2 - cleanupTestCase()
+1..2
+# tests 2
+# pass 1
+# fail 0
diff --git a/tests/auto/testlib/selftests/expected_skipinitdata.tap b/tests/auto/testlib/selftests/expected_skipinitdata.tap
new file mode 100644
index 0000000000..1ea96ca74e
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_skipinitdata.tap
@@ -0,0 +1,7 @@
+TAP version 13
+# tst_SkipInitData
+ok 1 - initTestCase() # SKIP Skip inside initTestCase_data. This should skip all tests in the class.
+1..1
+# tests 1
+# pass 0
+# fail 0
diff --git a/tests/auto/testlib/selftests/expected_sleep.tap b/tests/auto/testlib/selftests/expected_sleep.tap
new file mode 100644
index 0000000000..7caef214d2
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_sleep.tap
@@ -0,0 +1,9 @@
+TAP version 13
+# tst_Sleep
+ok 1 - initTestCase()
+ok 2 - sleep()
+ok 3 - cleanupTestCase()
+1..3
+# tests 3
+# pass 3
+# fail 0
diff --git a/tests/auto/testlib/selftests/expected_strcmp.tap b/tests/auto/testlib/selftests/expected_strcmp.tap
new file mode 100644
index 0000000000..af368e4745
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_strcmp.tap
@@ -0,0 +1,87 @@
+TAP version 13
+# tst_StrCmp
+ok 1 - initTestCase()
+ok 2 - compareCharStars()
+not ok 3 - compareByteArray() # TODO Next test should fail
+ ---
+ at: tst_StrCmp::compareByteArray() (qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp:75)
+ file: qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp
+ line: 75
+ ...
+not ok 3 - compareByteArray() # TODO Next test should fail
+ ---
+ at: tst_StrCmp::compareByteArray() (qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp:82)
+ file: qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp
+ line: 82
+ ...
+not ok 3 - compareByteArray() # TODO Next test should fail
+ ---
+ at: tst_StrCmp::compareByteArray() (qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp:89)
+ file: qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp
+ line: 89
+ ...
+not ok 3 - compareByteArray()
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"... (b)
+ found: "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"... (a)
+ expected: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"... (b)
+ actual: "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"... (a)
+ at: tst_StrCmp::compareByteArray() (qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp:96)
+ file: qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp
+ line: 96
+ ...
+not ok 4 - failByteArray()
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: "cba" (QByteArray("cba"))
+ found: "abc" (QByteArray("abc"))
+ expected: "cba" (QByteArray("cba"))
+ actual: "abc" (QByteArray("abc"))
+ at: tst_StrCmp::failByteArray() (qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp:102)
+ file: qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp
+ line: 102
+ ...
+not ok 5 - failByteArrayNull()
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: "" (QByteArray())
+ found: "foo" (QByteArray("foo"))
+ expected: "" (QByteArray())
+ actual: "foo" (QByteArray("foo"))
+ at: tst_StrCmp::failByteArrayNull() (qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp:108)
+ file: qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp
+ line: 108
+ ...
+not ok 6 - failByteArrayEmpty()
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: "foo" (QByteArray("foo"))
+ found: "" (QByteArray(""))
+ expected: "foo" (QByteArray("foo"))
+ actual: "" (QByteArray(""))
+ at: tst_StrCmp::failByteArrayEmpty() (qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp:113)
+ file: qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp
+ line: 113
+ ...
+not ok 7 - failByteArraySingleChars()
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: "7" (QByteArray("7"))
+ found: "6" (QByteArray("6"))
+ expected: "7" (QByteArray("7"))
+ actual: "6" (QByteArray("6"))
+ at: tst_StrCmp::failByteArraySingleChars() (qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp:120)
+ file: qtbase/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp
+ line: 120
+ ...
+ok 8 - cleanupTestCase()
+1..8
+# tests 8
+# pass 3
+# fail 5
diff --git a/tests/auto/testlib/selftests/expected_subtest.tap b/tests/auto/testlib/selftests/expected_subtest.tap
new file mode 100644
index 0000000000..67fe7be570
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_subtest.tap
@@ -0,0 +1,68 @@
+TAP version 13
+# tst_Subtest
+# initTestCase initTestCase (null)
+ok 1 - initTestCase()
+# init test1 (null)
+# test1 test1 (null)
+# cleanup test1 (null)
+ok 2 - test1()
+# test2_data test2 (null)
+# test2_data end
+# init test2 data0
+# test2 test2 data0
+# test2 end
+# cleanup test2 data0
+ok 3 - test2(data0)
+# init test2 data1
+# test2 test2 data1
+# test2 end
+# cleanup test2 data1
+ok 4 - test2(data1)
+# init test2 data2
+# test2 test2 data2
+# test2 end
+# cleanup test2 data2
+ok 5 - test2(data2)
+# test3_data test3 (null)
+# test3_data end
+# init test3 data0
+# test2 test3 data0
+# test2 end
+# cleanup test3 data0
+ok 6 - test3(data0)
+# init test3 data1
+# test2 test3 data1
+not ok 7 - test3(data1)
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: "hello0" (QString("hello0"))
+ found: "hello1" (str)
+ expected: "hello0" (QString("hello0"))
+ actual: "hello1" (str)
+ at: tst_Subtest::test3() (qtbase/tests/auto/testlib/selftests/subtest/tst_subtest.cpp:141)
+ file: qtbase/tests/auto/testlib/selftests/subtest/tst_subtest.cpp
+ line: 141
+ ...
+# cleanup test3 data1
+# init test3 data2
+# test2 test3 data2
+not ok 8 - test3(data2)
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: "hello0" (QString("hello0"))
+ found: "hello2" (str)
+ expected: "hello0" (QString("hello0"))
+ actual: "hello2" (str)
+ at: tst_Subtest::test3() (qtbase/tests/auto/testlib/selftests/subtest/tst_subtest.cpp:141)
+ file: qtbase/tests/auto/testlib/selftests/subtest/tst_subtest.cpp
+ line: 141
+ ...
+# cleanup test3 data2
+# cleanupTestCase cleanupTestCase (null)
+ok 9 - cleanupTestCase()
+1..9
+# tests 9
+# pass 7
+# fail 2
diff --git a/tests/auto/testlib/selftests/expected_tuplediagnostics.lightxml b/tests/auto/testlib/selftests/expected_tuplediagnostics.lightxml
new file mode 100644
index 0000000000..810941d894
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_tuplediagnostics.lightxml
@@ -0,0 +1,34 @@
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="testEmptyTuple">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="testSimpleTuple">
+<Incident type="fail" file="/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp" line="0">
+ <Description><![CDATA[Compared values are not the same
+ Actual (std::tuple<int>{1}): std::tuple(1)
+ Expected (std::tuple<int>{2}): std::tuple(2)]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="testTuple">
+<Incident type="fail" file="/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp" line="0">
+ <Description><![CDATA[Compared values are not the same
+ Actual (tuple1): std::tuple(42, 'Y', "tuple1")
+ Expected (tuple2): std::tuple(42, 'Y', "tuple2")]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_tuplediagnostics.tap b/tests/auto/testlib/selftests/expected_tuplediagnostics.tap
new file mode 100644
index 0000000000..9e007c14e1
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_tuplediagnostics.tap
@@ -0,0 +1,33 @@
+TAP version 13
+# tst_TupleDiagnostics
+ok 1 - initTestCase()
+ok 2 - testEmptyTuple()
+not ok 3 - testSimpleTuple()
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: std::tuple(2) (std::tuple<int>{2})
+ found: std::tuple(1) (std::tuple<int>{1})
+ expected: std::tuple(2) (std::tuple<int>{2})
+ actual: std::tuple(1) (std::tuple<int>{1})
+ at: tst_TupleDiagnostics::testSimpleTuple() (/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp:53)
+ file: /localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp
+ line: 53
+ ...
+not ok 4 - testTuple()
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: std::tuple(42, 'Y', "tuple2") (tuple2)
+ found: std::tuple(42, 'Y', "tuple1") (tuple1)
+ expected: std::tuple(42, 'Y', "tuple2") (tuple2)
+ actual: std::tuple(42, 'Y', "tuple1") (tuple1)
+ at: tst_TupleDiagnostics::testTuple() (/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp:60)
+ file: /localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp
+ line: 60
+ ...
+ok 5 - cleanupTestCase()
+1..5
+# tests 5
+# pass 3
+# fail 2
diff --git a/tests/auto/testlib/selftests/expected_tuplediagnostics.teamcity b/tests/auto/testlib/selftests/expected_tuplediagnostics.teamcity
new file mode 100644
index 0000000000..a395857c60
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_tuplediagnostics.teamcity
@@ -0,0 +1,14 @@
+##teamcity[testSuiteStarted name='tst_TupleDiagnostics' flowId='tst_TupleDiagnostics']
+##teamcity[testStarted name='initTestCase()' flowId='tst_TupleDiagnostics']
+##teamcity[testFinished name='initTestCase()' flowId='tst_TupleDiagnostics']
+##teamcity[testStarted name='testEmptyTuple()' flowId='tst_TupleDiagnostics']
+##teamcity[testFinished name='testEmptyTuple()' flowId='tst_TupleDiagnostics']
+##teamcity[testStarted name='testSimpleTuple()' flowId='tst_TupleDiagnostics']
+##teamcity[testFailed name='testSimpleTuple()' message='Failure! |[Loc: /localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)|]' details='Compared values are not the same|n Actual (std::tuple<int>{1}): std::tuple(1)|n Expected (std::tuple<int>{2}): std::tuple(2)' flowId='tst_TupleDiagnostics']
+##teamcity[testFinished name='testSimpleTuple()' flowId='tst_TupleDiagnostics']
+##teamcity[testStarted name='testTuple()' flowId='tst_TupleDiagnostics']
+##teamcity[testFailed name='testTuple()' message='Failure! |[Loc: /localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)|]' details='Compared values are not the same|n Actual (tuple1): std::tuple(42, |'Y|', "tuple1")|n Expected (tuple2): std::tuple(42, |'Y|', "tuple2")' flowId='tst_TupleDiagnostics']
+##teamcity[testFinished name='testTuple()' flowId='tst_TupleDiagnostics']
+##teamcity[testStarted name='cleanupTestCase()' flowId='tst_TupleDiagnostics']
+##teamcity[testFinished name='cleanupTestCase()' flowId='tst_TupleDiagnostics']
+##teamcity[testSuiteFinished name='tst_TupleDiagnostics' flowId='tst_TupleDiagnostics']
diff --git a/tests/auto/testlib/selftests/expected_tuplediagnostics.txt b/tests/auto/testlib/selftests/expected_tuplediagnostics.txt
new file mode 100644
index 0000000000..ce568bf6c0
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_tuplediagnostics.txt
@@ -0,0 +1,15 @@
+********* Start testing of tst_TupleDiagnostics *********
+Config: Using QtTest library
+PASS : tst_TupleDiagnostics::initTestCase()
+PASS : tst_TupleDiagnostics::testEmptyTuple()
+FAIL! : tst_TupleDiagnostics::testSimpleTuple() Compared values are not the same
+ Actual (std::tuple<int>{1}): std::tuple(1)
+ Expected (std::tuple<int>{2}): std::tuple(2)
+ Loc: [/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)]
+FAIL! : tst_TupleDiagnostics::testTuple() Compared values are not the same
+ Actual (tuple1): std::tuple(42, 'Y', "tuple1")
+ Expected (tuple2): std::tuple(42, 'Y', "tuple2")
+ Loc: [/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp(0)]
+PASS : tst_TupleDiagnostics::cleanupTestCase()
+Totals: 3 passed, 2 failed, 0 skipped, 0 blacklisted, 0ms
+********* Finished testing of tst_TupleDiagnostics *********
diff --git a/tests/auto/testlib/selftests/expected_tuplediagnostics.xml b/tests/auto/testlib/selftests/expected_tuplediagnostics.xml
new file mode 100644
index 0000000000..4c55a6d393
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_tuplediagnostics.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<TestCase name="tst_TupleDiagnostics">
+<Environment>
+ <QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>
+ <QtBuild/>
+ <QTestVersion>@INSERT_QT_VERSION_HERE@</QTestVersion>
+</Environment>
+<TestFunction name="initTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="testEmptyTuple">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="testSimpleTuple">
+<Incident type="fail" file="/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp" line="0">
+ <Description><![CDATA[Compared values are not the same
+ Actual (std::tuple<int>{1}): std::tuple(1)
+ Expected (std::tuple<int>{2}): std::tuple(2)]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="testTuple">
+<Incident type="fail" file="/localqtbase/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp" line="0">
+ <Description><![CDATA[Compared values are not the same
+ Actual (tuple1): std::tuple(42, 'Y', "tuple1")
+ Expected (tuple2): std::tuple(42, 'Y', "tuple2")]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="cleanupTestCase">
+<Incident type="pass" file="" line="0" />
+ <Duration msecs="0"/>
+</TestFunction>
+<Duration msecs="0"/>
+</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_tuplediagnostics.xunitxml b/tests/auto/testlib/selftests/expected_tuplediagnostics.xunitxml
new file mode 100644
index 0000000000..0a276a17f5
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_tuplediagnostics.xunitxml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<testsuite errors="0" failures="2" tests="5" name="tst_TupleDiagnostics">
+ <properties>
+ <property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/>
+ <property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/>
+ <property value="" name="QtBuild"/>
+ </properties>
+ <testcase result="pass" name="initTestCase"/>
+ <testcase result="pass" name="testEmptyTuple"/>
+ <testcase result="fail" name="testSimpleTuple">
+ <failure message="Compared values are not the same
+ Actual (std::tuple&lt;int&gt;{1}): std::tuple(1)
+ Expected (std::tuple&lt;int&gt;{2}): std::tuple(2)" result="fail"/>
+ </testcase>
+ <testcase result="fail" name="testTuple">
+ <failure message="Compared values are not the same
+ Actual (tuple1): std::tuple(42, &apos;Y&apos;, &quot;tuple1&quot;)
+ Expected (tuple2): std::tuple(42, &apos;Y&apos;, &quot;tuple2&quot;)" result="fail"/>
+ </testcase>
+ <testcase result="pass" name="cleanupTestCase"/>
+ <system-err/>
+</testsuite>
diff --git a/tests/auto/testlib/selftests/expected_verbose1.tap b/tests/auto/testlib/selftests/expected_verbose1.tap
new file mode 100644
index 0000000000..ad53e8f14e
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_verbose1.tap
@@ -0,0 +1,118 @@
+TAP version 13
+# tst_Counting
+ok 1 - initTestCase()
+ok 2 - testPassPass(row 1)
+ok 3 - testPassPass(row 2)
+ok 4 - testPassSkip(row 1)
+ok 5 - testPassSkip(row 2) # SKIP Skipping
+ok 6 - testPassFail(row 1)
+not ok 7 - testPassFail(row 2)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_Counting::testPassFail() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:102)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 102
+ ...
+ok 8 - testSkipPass(row 1) # SKIP Skipping
+ok 9 - testSkipPass(row 2)
+ok 10 - testSkipSkip(row 1) # SKIP Skipping
+ok 11 - testSkipSkip(row 2) # SKIP Skipping
+ok 12 - testSkipFail(row 1) # SKIP Skipping
+not ok 13 - testSkipFail(row 2)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_Counting::testSkipFail() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:102)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 102
+ ...
+not ok 14 - testFailPass(row 1)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_Counting::testFailPass() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:102)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 102
+ ...
+ok 15 - testFailPass(row 2)
+not ok 16 - testFailSkip(row 1)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_Counting::testFailSkip() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:102)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 102
+ ...
+ok 17 - testFailSkip(row 2) # SKIP Skipping
+not ok 18 - testFailFail(row 1)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_Counting::testFailFail() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:102)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 102
+ ...
+not ok 19 - testFailFail(row 2)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_Counting::testFailFail() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:102)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 102
+ ...
+ok 20 - testFailInInit(before)
+not ok 21 - testFailInInit(fail)
+ ---
+ # Fail in init()
+ at: tst_Counting::testFailInInit() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:221)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 221
+ ...
+ok 22 - testFailInInit(after)
+ok 23 - testFailInCleanup(before)
+# This test function should execute and then QFAIL in cleanup()
+not ok 24 - testFailInCleanup(fail)
+ ---
+ # Fail in cleanup()
+ at: tst_Counting::testFailInCleanup() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:229)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 229
+ ...
+ok 25 - testFailInCleanup(after)
+ok 26 - testSkipInInit(before)
+ok 27 - testSkipInInit(skip) # SKIP Skip in init()
+ok 28 - testSkipInInit(after)
+ok 29 - testSkipInCleanup(before)
+# This test function should execute and then QSKIP in cleanup()
+ok 30 - testSkipInCleanup(skip) # SKIP Skip in cleanup()
+ok 31 - testSkipInCleanup(after)
+ok 32 - cleanupTestCase()
+1..32
+# tests 32
+# pass 16
+# fail 8
diff --git a/tests/auto/testlib/selftests/expected_verbose2.tap b/tests/auto/testlib/selftests/expected_verbose2.tap
new file mode 100644
index 0000000000..7e6a7280a4
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_verbose2.tap
@@ -0,0 +1,136 @@
+TAP version 13
+# tst_Counting
+ok 1 - initTestCase()
+# QVERIFY(true)
+# QCOMPARE(2 + 1, 3)
+ok 2 - testPassPass(row 1)
+# QVERIFY(true)
+# QCOMPARE(2 + 1, 3)
+ok 3 - testPassPass(row 2)
+# QVERIFY(true)
+# QCOMPARE(2 + 1, 3)
+ok 4 - testPassSkip(row 1)
+ok 5 - testPassSkip(row 2) # SKIP Skipping
+# QVERIFY(true)
+# QCOMPARE(2 + 1, 3)
+ok 6 - testPassFail(row 1)
+# QVERIFY(false)
+not ok 7 - testPassFail(row 2)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_Counting::testPassFail() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:102)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 102
+ ...
+ok 8 - testSkipPass(row 1) # SKIP Skipping
+# QVERIFY(true)
+# QCOMPARE(2 + 1, 3)
+ok 9 - testSkipPass(row 2)
+ok 10 - testSkipSkip(row 1) # SKIP Skipping
+ok 11 - testSkipSkip(row 2) # SKIP Skipping
+ok 12 - testSkipFail(row 1) # SKIP Skipping
+# QVERIFY(false)
+not ok 13 - testSkipFail(row 2)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_Counting::testSkipFail() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:102)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 102
+ ...
+# QVERIFY(false)
+not ok 14 - testFailPass(row 1)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_Counting::testFailPass() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:102)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 102
+ ...
+# QVERIFY(true)
+# QCOMPARE(2 + 1, 3)
+ok 15 - testFailPass(row 2)
+# QVERIFY(false)
+not ok 16 - testFailSkip(row 1)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_Counting::testFailSkip() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:102)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 102
+ ...
+ok 17 - testFailSkip(row 2) # SKIP Skipping
+# QVERIFY(false)
+not ok 18 - testFailFail(row 1)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_Counting::testFailFail() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:102)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 102
+ ...
+# QVERIFY(false)
+not ok 19 - testFailFail(row 2)
+ ---
+ type: QVERIFY
+ message: Verification failed
+ wanted: true (false)
+ found: false (false)
+ expected: true (false)
+ actual: false (false)
+ at: tst_Counting::testFailFail() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:102)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 102
+ ...
+ok 20 - testFailInInit(before)
+not ok 21 - testFailInInit(fail)
+ ---
+ # Fail in init()
+ at: tst_Counting::testFailInInit() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:221)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 221
+ ...
+ok 22 - testFailInInit(after)
+ok 23 - testFailInCleanup(before)
+# This test function should execute and then QFAIL in cleanup()
+not ok 24 - testFailInCleanup(fail)
+ ---
+ # Fail in cleanup()
+ at: tst_Counting::testFailInCleanup() (qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp:229)
+ file: qtbase/tests/auto/testlib/selftests/counting/tst_counting.cpp
+ line: 229
+ ...
+ok 25 - testFailInCleanup(after)
+ok 26 - testSkipInInit(before)
+ok 27 - testSkipInInit(skip) # SKIP Skip in init()
+ok 28 - testSkipInInit(after)
+ok 29 - testSkipInCleanup(before)
+# This test function should execute and then QSKIP in cleanup()
+ok 30 - testSkipInCleanup(skip) # SKIP Skip in cleanup()
+ok 31 - testSkipInCleanup(after)
+ok 32 - cleanupTestCase()
+1..32
+# tests 32
+# pass 16
+# fail 8
diff --git a/tests/auto/testlib/selftests/expected_verifyexceptionthrown.tap b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.tap
new file mode 100644
index 0000000000..2b04c08cdb
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_verifyexceptionthrown.tap
@@ -0,0 +1,53 @@
+TAP version 13
+# tst_VerifyExceptionThrown
+ok 1 - initTestCase()
+ok 2 - testCorrectStdTypes()
+ok 3 - testCorrectStdExceptions()
+ok 4 - testCorrectMyExceptions()
+not ok 5 - testFailInt()
+ ---
+ # Expected exception of type double to be thrown but unknown exception caught
+ at: tst_VerifyExceptionThrown::testFailInt() (qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp:115)
+ file: qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp
+ line: 115
+ ...
+not ok 6 - testFailStdString()
+ ---
+ # Expected exception of type char* to be thrown but unknown exception caught
+ at: tst_VerifyExceptionThrown::testFailStdString() (qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp:120)
+ file: qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp
+ line: 120
+ ...
+not ok 7 - testFailStdRuntimeError()
+ ---
+ # Expected exception of type std::runtime_error to be thrown but std::exception caught with message: logic error
+ at: tst_VerifyExceptionThrown::testFailStdRuntimeError() (qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp:125)
+ file: qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp
+ line: 125
+ ...
+not ok 8 - testFailMyException()
+ ---
+ # Expected exception of type MyBaseException to be thrown but std::exception caught with message: logic error
+ at: tst_VerifyExceptionThrown::testFailMyException() (qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp:130)
+ file: qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp
+ line: 130
+ ...
+not ok 9 - testFailMyDerivedException()
+ ---
+ # Expected exception of type std::runtime_error to be thrown but std::exception caught with message: MyDerivedException
+ at: tst_VerifyExceptionThrown::testFailMyDerivedException() (qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp:135)
+ file: qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp
+ line: 135
+ ...
+not ok 10 - testFailNoException()
+ ---
+ # Expected exception of type std::exception to be thrown but no exception caught
+ at: tst_VerifyExceptionThrown::testFailNoException() (qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp:140)
+ file: qtbase/tests/auto/testlib/selftests/verifyexceptionthrown/tst_verifyexceptionthrown.cpp
+ line: 140
+ ...
+ok 11 - cleanupTestCase()
+1..11
+# tests 11
+# pass 5
+# fail 6
diff --git a/tests/auto/testlib/selftests/expected_warnings.tap b/tests/auto/testlib/selftests/expected_warnings.tap
new file mode 100644
index 0000000000..0e357cb770
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_warnings.tap
@@ -0,0 +1,42 @@
+TAP version 13
+# tst_Warnings
+ok 1 - initTestCase()
+# Warning
+# Warning
+# Debug
+# Debug
+# Info
+# Info
+# Baba
+# Baba
+# Bubublabla
+# Babablabla
+ok 2 - testWarnings()
+# Did not receive message: "Warning0"
+# Did not receive message: "Warning1"
+not ok 3 - testMissingWarnings()
+ ---
+ # Not all expected messages were received
+ ...
+# Did not receive any message matching: "Warning\s\d"
+not ok 4 - testMissingWarningsRegularExpression()
+ ---
+ # Not all expected messages were received
+ ...
+# Did not receive message: "Warning0"
+# Did not receive message: "Warning1"
+not ok 5 - testMissingWarningsWithData(first row)
+ ---
+ # Not all expected messages were received
+ ...
+# Did not receive message: "Warning0"
+# Did not receive message: "Warning1"
+not ok 6 - testMissingWarningsWithData(second row)
+ ---
+ # Not all expected messages were received
+ ...
+ok 7 - cleanupTestCase()
+1..7
+# tests 7
+# pass 3
+# fail 4
diff --git a/tests/auto/testlib/selftests/expected_xunit.tap b/tests/auto/testlib/selftests/expected_xunit.tap
new file mode 100644
index 0000000000..13ff7e45a3
--- /dev/null
+++ b/tests/auto/testlib/selftests/expected_xunit.tap
@@ -0,0 +1,44 @@
+TAP version 13
+# tst_Xunit
+ok 1 - initTestCase()
+# just a QWARN() !
+ok 2 - testFunc1()
+# a qDebug() call with comment-ending stuff -->
+not ok 3 - testFunc2()
+ ---
+ type: QCOMPARE
+ message: Compared values are not the same
+ wanted: 3 (3)
+ found: 2 (2)
+ expected: 3 (3)
+ actual: 2 (2)
+ at: tst_Xunit::testFunc2() (qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp:61)
+ file: qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp
+ line: 61
+ ...
+ok 4 - testFunc3() # SKIP skipping this function!
+not ok 5 - testFunc4()
+ ---
+ # a forced failure!
+ at: tst_Xunit::testFunc4() (qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp:71)
+ file: qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp
+ line: 71
+ ...
+not ok 6 - testFunc5() # TODO this failure is expected
+ ---
+ at: tst_Xunit::testFunc5() (qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp:85)
+ file: qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp
+ line: 85
+ ...
+not ok 7 - testFunc6() # TODO this failure is also expected
+ ---
+ at: tst_Xunit::testFunc6() (qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp:91)
+ file: qtbase/tests/auto/testlib/selftests/xunit/tst_xunit.cpp
+ line: 91
+ ...
+ok 8 - testFunc7() # TODO 'true' returned TRUE unexpectedly. ()
+ok 9 - cleanupTestCase()
+1..9
+# tests 9
+# pass 5
+# fail 3
diff --git a/tests/auto/testlib/selftests/generate_expected_output.py b/tests/auto/testlib/selftests/generate_expected_output.py
index aa11ca4fe7..1996416e8c 100755
--- a/tests/auto/testlib/selftests/generate_expected_output.py
+++ b/tests/auto/testlib/selftests/generate_expected_output.py
@@ -37,9 +37,7 @@
# it to the output of each test, ignoring various boring changes.
# This script canonicalises the parts that would exhibit those boring
# changes, so as to avoid noise in git (and conflicts in merges) for
-# the saved copies of the output. If you add or remove any files, be
-# sure to update selftests.qrc to match; the selftest only sees files
-# listed there.
+# the saved copies of the output.
import os
import subprocess
@@ -116,10 +114,13 @@ class Cleaner (object):
raise Fail('Unable to find', command, 'in $PATH')
# Are we being run from the right place ?
- myNames = scriptPath.split(os.path.sep)
- if not (here.split(os.path.sep)[-5:] == myNames[-6:-1]
+ scriptPath, myName = os.path.split(scriptPath)
+ hereNames, depth = scriptPath.split(os.path.sep), 5
+ hereNames = hereNames[-depth:] # path components from qtbase down
+ assert hereNames[0] == 'qtbase', ('Script moved: please correct depth', hereNames)
+ if not (here.split(os.path.sep)[-depth:] == hereNames
and os.path.isfile(qmake)):
- raise Fail('Run', myNames[-1], 'in its directory of a completed build')
+ raise Fail('Run', myName, 'in its directory of a completed build')
try:
qtver = subprocess.check_output([qmake, '-query', 'QT_VERSION'])
@@ -127,8 +128,17 @@ class Cleaner (object):
raise Fail(what.strerror)
qtver = qtver.strip().decode('utf-8')
- scriptPath = os.path.dirname(scriptPath) # ditch leaf file-name
- sentinel = os.path.sep + 'qtbase' + os.path.sep # '/qtbase/'
+ hereNames = tuple(hereNames)
+ # Add path to specific sources and to tst_*.cpp if missing (for in-source builds):
+ patterns += ((r'(^|[^/])\b(qtestcase.cpp)\b', r'\1qtbase/src/testlib/\2'),
+ # Add more special cases here, if they show up !
+ (r'([[" ])\.\./(counting/tst_counting.cpp)\b',
+ r'\1' + os.path.sep.join(hereNames + (r'\2',))),
+ # The common pattern:
+ (r'(^|[^/])\b(tst_)?([a-z]+\d*)\.cpp\b',
+ r'\1' + os.path.sep.join(hereNames + (r'\3', r'\2\3.cpp'))))
+
+ sentinel = os.path.sep + hereNames[0] + os.path.sep # '/qtbase/'
# Identify the path prefix of our qtbase ancestor directory
# (source, build and $PWD, when different); trim such prefixes
# off all paths we see.
@@ -212,7 +222,7 @@ class Scanner (object):
del re
def generateTestData(testname, clean,
- formats = ('xml', 'txt', 'xunitxml', 'lightxml', 'teamcity'),
+ formats = ('xml', 'txt', 'xunitxml', 'lightxml', 'teamcity', 'tap'),
extraArgs = {
"commandlinedata": "fiveTablePasses fiveTablePasses:fiveTablePasses_data1 -v2",
"benchlibcallgrind": "-callgrind",
diff --git a/tests/auto/testlib/selftests/keyboard/keyboard.pro b/tests/auto/testlib/selftests/keyboard/keyboard.pro
new file mode 100644
index 0000000000..0097318797
--- /dev/null
+++ b/tests/auto/testlib/selftests/keyboard/keyboard.pro
@@ -0,0 +1,7 @@
+SOURCES += tst_keyboard.cpp
+QT += testlib testlib-private gui gui-private
+
+macos:CONFIG -= app_bundle
+CONFIG -= debug_and_release_target
+
+TARGET = keyboard
diff --git a/tests/auto/testlib/selftests/keyboard/tst_keyboard.cpp b/tests/auto/testlib/selftests/keyboard/tst_keyboard.cpp
new file mode 100644
index 0000000000..e185be8532
--- /dev/null
+++ b/tests/auto/testlib/selftests/keyboard/tst_keyboard.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/qtest.h>
+#include <QtGui/qwindow.h>
+
+class tst_Keyboard : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void keyPressAndRelease();
+};
+
+class KeyWindow : public QWindow
+{
+public:
+ void keyPressEvent(QKeyEvent *event) override
+ {
+ QSharedPointer<QKeyEvent> copiedEvent(new QKeyEvent(event->type(), event->key(),
+ event->modifiers(), event->text(), event->isAutoRepeat(), event->count()));
+ mEventOrder.append(copiedEvent);
+ }
+
+ void keyReleaseEvent(QKeyEvent *event) override
+ {
+ QSharedPointer<QKeyEvent> copiedEvent(new QKeyEvent(event->type(), event->key(),
+ event->modifiers(), event->text(), event->isAutoRepeat(), event->count()));
+ mEventOrder.append(copiedEvent);
+ }
+
+ QVector<QSharedPointer<QKeyEvent>> mEventOrder;
+};
+
+void tst_Keyboard::keyPressAndRelease()
+{
+ KeyWindow window;
+ window.show();
+ window.setGeometry(100, 100, 200, 200);
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
+ QVERIFY(QTest::qWaitForWindowActive(&window));
+
+ QTest::keyPress(&window, Qt::Key_A);
+ QTest::keyRelease(&window, Qt::Key_A);
+ QCOMPARE(window.mEventOrder.size(), 2);
+
+ const auto pressEvent = window.mEventOrder.at(0);
+ QCOMPARE(pressEvent->type(), QEvent::KeyPress);
+ QCOMPARE(pressEvent->key(), Qt::Key_A);
+ QCOMPARE(pressEvent->modifiers(), Qt::NoModifier);
+ QCOMPARE(pressEvent->text(), "a");
+ QCOMPARE(pressEvent->isAutoRepeat(), false);
+
+ const auto releaseEvent = window.mEventOrder.at(1);
+ QCOMPARE(releaseEvent->type(), QEvent::KeyRelease);
+ QCOMPARE(releaseEvent->key(), Qt::Key_A);
+ QCOMPARE(releaseEvent->modifiers(), Qt::NoModifier);
+ QCOMPARE(releaseEvent->text(), "a");
+ QCOMPARE(releaseEvent->isAutoRepeat(), false);
+}
+
+QTEST_MAIN(tst_Keyboard)
+#include "tst_keyboard.moc"
diff --git a/tests/auto/testlib/selftests/selftests.pri b/tests/auto/testlib/selftests/selftests.pri
index 079f3f7959..05ed6d9905 100644
--- a/tests/auto/testlib/selftests/selftests.pri
+++ b/tests/auto/testlib/selftests/selftests.pri
@@ -43,12 +43,16 @@ SUBPROGRAMS = \
sleep \
strcmp \
subtest \
+ tuplediagnostics \
verbose1 \
verbose2 \
verifyexceptionthrown \
warnings \
- xunit \
- mouse
+ xunit
+
+qtHaveModule(gui): SUBPROGRAMS += \
+ keyboard \
+ mouse
INCLUDEPATH += ../../../../shared/
HEADERS += ../../../../shared/emulationdetector.h
diff --git a/tests/auto/testlib/selftests/selftests.qrc b/tests/auto/testlib/selftests/selftests.qrc
deleted file mode 100644
index 75d3375394..0000000000
--- a/tests/auto/testlib/selftests/selftests.qrc
+++ /dev/null
@@ -1,219 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>expected_assert.lightxml</file>
- <file>expected_assert.teamcity</file>
- <file>expected_assert.txt</file>
- <file>expected_assert.xml</file>
- <file>expected_assert.xunitxml</file>
- <file>expected_badxml.lightxml</file>
- <file>expected_badxml.teamcity</file>
- <file>expected_badxml.txt</file>
- <file>expected_badxml.xml</file>
- <file>expected_badxml.xunitxml</file>
- <file>expected_benchlibcallgrind_0.txt</file>
- <file>expected_benchlibcallgrind_1.txt</file>
- <file>expected_benchlibcallgrind.csv</file>
- <file>expected_benchlibcallgrind.lightxml</file>
- <file>expected_benchlibcallgrind.xml</file>
- <file>expected_benchlibcallgrind.xunitxml</file>
- <file>expected_benchlibcounting.csv</file>
- <file>expected_benchlibcounting.lightxml</file>
- <file>expected_benchlibcounting.txt</file>
- <file>expected_benchlibcounting.xml</file>
- <file>expected_benchlibcounting.xunitxml</file>
- <file>expected_benchlibeventcounter.csv</file>
- <file>expected_benchlibeventcounter.lightxml</file>
- <file>expected_benchlibeventcounter.txt</file>
- <file>expected_benchlibeventcounter.xml</file>
- <file>expected_benchlibeventcounter.xunitxml</file>
- <file>expected_benchliboptions.lightxml</file>
- <file>expected_benchliboptions.txt</file>
- <file>expected_benchliboptions.xml</file>
- <file>expected_benchliboptions.xunitxml</file>
- <file>expected_benchlibtickcounter.csv</file>
- <file>expected_benchlibtickcounter.lightxml</file>
- <file>expected_benchlibtickcounter.txt</file>
- <file>expected_benchlibtickcounter.xml</file>
- <file>expected_benchlibtickcounter.xunitxml</file>
- <file>expected_benchlibwalltime.csv</file>
- <file>expected_benchlibwalltime.lightxml</file>
- <file>expected_benchlibwalltime.txt</file>
- <file>expected_benchlibwalltime.xml</file>
- <file>expected_benchlibwalltime.xunitxml</file>
- <file>expected_blacklisted.lightxml</file>
- <file>expected_blacklisted.txt</file>
- <file>expected_blacklisted.xml</file>
- <file>expected_blacklisted.xunitxml</file>
- <file>expected_cmptest.lightxml</file>
- <file>expected_cmptest.teamcity</file>
- <file>expected_cmptest.txt</file>
- <file>expected_cmptest.xml</file>
- <file>expected_cmptest.xunitxml</file>
- <file>expected_commandlinedata.lightxml</file>
- <file>expected_commandlinedata.teamcity</file>
- <file>expected_commandlinedata.txt</file>
- <file>expected_commandlinedata.xml</file>
- <file>expected_commandlinedata.xunitxml</file>
- <file>expected_counting.lightxml</file>
- <file>expected_counting.teamcity</file>
- <file>expected_counting.txt</file>
- <file>expected_counting.xml</file>
- <file>expected_counting.xunitxml</file>
- <file>expected_crashes_1.txt</file>
- <file>expected_crashes_2.txt</file>
- <file>expected_crashes_3.txt</file>
- <file>expected_datatable.lightxml</file>
- <file>expected_datatable.teamcity</file>
- <file>expected_datatable.txt</file>
- <file>expected_datatable.xml</file>
- <file>expected_datatable.xunitxml</file>
- <file>expected_datetime.lightxml</file>
- <file>expected_datetime.teamcity</file>
- <file>expected_datetime.txt</file>
- <file>expected_datetime.xml</file>
- <file>expected_datetime.xunitxml</file>
- <file>expected_differentexec.lightxml</file>
- <file>expected_differentexec.txt</file>
- <file>expected_differentexec.xml</file>
- <file>expected_differentexec.xunitxml</file>
- <file>expected_exceptionthrow.lightxml</file>
- <file>expected_exceptionthrow.teamcity</file>
- <file>expected_exceptionthrow.txt</file>
- <file>expected_exceptionthrow.xml</file>
- <file>expected_exceptionthrow.xunitxml</file>
- <file>expected_expectfail.lightxml</file>
- <file>expected_expectfail.teamcity</file>
- <file>expected_expectfail.txt</file>
- <file>expected_expectfail.xml</file>
- <file>expected_expectfail.xunitxml</file>
- <file>expected_failcleanup.lightxml</file>
- <file>expected_failcleanup.teamcity</file>
- <file>expected_failcleanup.txt</file>
- <file>expected_failcleanup.xml</file>
- <file>expected_failcleanup.xunitxml</file>
- <file>expected_failinit.lightxml</file>
- <file>expected_failinit.teamcity</file>
- <file>expected_failinit.txt</file>
- <file>expected_failinit.xml</file>
- <file>expected_failinit.xunitxml</file>
- <file>expected_failinitdata.lightxml</file>
- <file>expected_failinitdata.teamcity</file>
- <file>expected_failinitdata.txt</file>
- <file>expected_failinitdata.xml</file>
- <file>expected_failinitdata.xunitxml</file>
- <file>expected_fetchbogus.lightxml</file>
- <file>expected_fetchbogus.teamcity</file>
- <file>expected_fetchbogus.txt</file>
- <file>expected_fetchbogus.xml</file>
- <file>expected_fetchbogus.xunitxml</file>
- <file>expected_findtestdata.lightxml</file>
- <file>expected_findtestdata.teamcity</file>
- <file>expected_findtestdata.txt</file>
- <file>expected_findtestdata.xml</file>
- <file>expected_findtestdata.xunitxml</file>
- <file>expected_float.lightxml</file>
- <file>expected_float.txt</file>
- <file>expected_float.xml</file>
- <file>expected_float.xunitxml</file>
- <file>expected_globaldata.lightxml</file>
- <file>expected_globaldata.teamcity</file>
- <file>expected_globaldata.txt</file>
- <file>expected_globaldata.xml</file>
- <file>expected_globaldata.xunitxml</file>
- <file>expected_longstring.lightxml</file>
- <file>expected_longstring.teamcity</file>
- <file>expected_longstring.txt</file>
- <file>expected_longstring.xml</file>
- <file>expected_longstring.xunitxml</file>
- <file>expected_maxwarnings.lightxml</file>
- <file>expected_maxwarnings.teamcity</file>
- <file>expected_maxwarnings.txt</file>
- <file>expected_maxwarnings.xml</file>
- <file>expected_maxwarnings.xunitxml</file>
- <file>expected_multiexec.lightxml</file>
- <file>expected_multiexec.txt</file>
- <file>expected_multiexec.xml</file>
- <file>expected_multiexec.xunitxml</file>
- <file>expected_pairdiagnostics.lightxml</file>
- <file>expected_pairdiagnostics.teamcity</file>
- <file>expected_pairdiagnostics.txt</file>
- <file>expected_pairdiagnostics.xml</file>
- <file>expected_pairdiagnostics.xunitxml</file>
- <file>expected_printdatatags.txt</file>
- <file>expected_printdatatagswithglobaltags.txt</file>
- <file>expected_qexecstringlist.lightxml</file>
- <file>expected_qexecstringlist.txt</file>
- <file>expected_qexecstringlist.xml</file>
- <file>expected_qexecstringlist.xunitxml</file>
- <file>expected_silent.lightxml</file>
- <file>expected_silent.teamcity</file>
- <file>expected_silent.txt</file>
- <file>expected_silent.xml</file>
- <file>expected_silent.xunitxml</file>
- <file>expected_singleskip.lightxml</file>
- <file>expected_singleskip.teamcity</file>
- <file>expected_singleskip.txt</file>
- <file>expected_singleskip.xml</file>
- <file>expected_singleskip.xunitxml</file>
- <file>expected_skip.lightxml</file>
- <file>expected_skip.teamcity</file>
- <file>expected_skip.txt</file>
- <file>expected_skip.xml</file>
- <file>expected_skip.xunitxml</file>
- <file>expected_skipcleanup.lightxml</file>
- <file>expected_skipcleanup.teamcity</file>
- <file>expected_skipcleanup.txt</file>
- <file>expected_skipcleanup.xml</file>
- <file>expected_skipcleanup.xunitxml</file>
- <file>expected_skipinit.lightxml</file>
- <file>expected_skipinit.txt</file>
- <file>expected_skipinit.teamcity</file>
- <file>expected_skipinit.xml</file>
- <file>expected_skipinit.xunitxml</file>
- <file>expected_skipinitdata.lightxml</file>
- <file>expected_skipinitdata.teamcity</file>
- <file>expected_skipinitdata.txt</file>
- <file>expected_skipinitdata.xml</file>
- <file>expected_skipinitdata.xunitxml</file>
- <file>expected_sleep.lightxml</file>
- <file>expected_sleep.teamcity</file>
- <file>expected_sleep.txt</file>
- <file>expected_sleep.xml</file>
- <file>expected_sleep.xunitxml</file>
- <file>expected_strcmp.lightxml</file>
- <file>expected_strcmp.teamcity</file>
- <file>expected_strcmp.txt</file>
- <file>expected_strcmp.xml</file>
- <file>expected_strcmp.xunitxml</file>
- <file>expected_subtest.lightxml</file>
- <file>expected_subtest.txt</file>
- <file>expected_subtest.teamcity</file>
- <file>expected_subtest.xml</file>
- <file>expected_subtest.xunitxml</file>
- <file>expected_verbose1.lightxml</file>
- <file>expected_verbose1.teamcity</file>
- <file>expected_verbose1.txt</file>
- <file>expected_verbose1.xml</file>
- <file>expected_verbose1.xunitxml</file>
- <file>expected_verbose2.lightxml</file>
- <file>expected_verbose2.teamcity</file>
- <file>expected_verbose2.txt</file>
- <file>expected_verbose2.xml</file>
- <file>expected_verbose2.xunitxml</file>
- <file>expected_verifyexceptionthrown.lightxml</file>
- <file>expected_verifyexceptionthrown.teamcity</file>
- <file>expected_verifyexceptionthrown.txt</file>
- <file>expected_verifyexceptionthrown.xml</file>
- <file>expected_verifyexceptionthrown.xunitxml</file>
- <file>expected_warnings.lightxml</file>
- <file>expected_warnings.teamcity</file>
- <file>expected_warnings.txt</file>
- <file>expected_warnings.xml</file>
- <file>expected_warnings.xunitxml</file>
- <file>expected_xunit.lightxml</file>
- <file>expected_xunit.teamcity</file>
- <file>expected_xunit.txt</file>
- <file>expected_xunit.xml</file>
- <file>expected_xunit.xunitxml</file>
- </qresource>
-</RCC>
diff --git a/tests/auto/testlib/selftests/test/test.pro b/tests/auto/testlib/selftests/test/test.pro
index bd2366f3e8..ec1633ebff 100644
--- a/tests/auto/testlib/selftests/test/test.pro
+++ b/tests/auto/testlib/selftests/test/test.pro
@@ -12,7 +12,9 @@ win32 {
}
}
-RESOURCES += ../selftests.qrc
+expected_files.files = $$files($$PWD/../expected_*)
+expected_files.base = $$PWD/..
+RESOURCES += expected_files
include(../selftests.pri)
!android:!winrt: for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../$${file}/$${file}"
diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp
index 63e5721e7e..c5f847562e 100644
--- a/tests/auto/testlib/selftests/tst_selftests.cpp
+++ b/tests/auto/testlib/selftests/tst_selftests.cpp
@@ -62,11 +62,22 @@ private slots:
private:
void doRunSubTest(QString const& subdir, QStringList const& loggers, QStringList const& arguments, bool crashes);
+ bool compareOutput(const QString &logger, const QString &subdir,
+ const QByteArray &rawOutput, const QByteArrayList &actual,
+ const QByteArrayList &expected,
+ QString *errorMessage) const;
+ bool compareLine(const QString &logger, const QString &subdir, bool benchmark,
+ const QString &actualLine, const QString &expLine,
+ QString *errorMessage) const;
+ bool checkXml(const QString &logger, QByteArray rawOutput,
+ QString *errorMessage) const;
+
QString logName(const QString &logger) const;
QList<LoggerSet> allLoggerSets() const;
QTemporaryDir tempDir;
QRegularExpression durationRegExp;
+ QRegularExpression teamcityLocRegExp;
};
struct BenchmarkResult
@@ -81,46 +92,50 @@ struct BenchmarkResult
static BenchmarkResult parse(QString const&, QString*);
};
-QT_BEGIN_NAMESPACE
-namespace QTest
+static QString msgMismatch(const QString &actual, const QString &expected)
{
-template <>
-inline bool qCompare
- (BenchmarkResult const &r1, BenchmarkResult const &r2,
- const char* actual, const char* expected, const char* file, int line)
+ return QLatin1String("Mismatch:\n'") + actual + QLatin1String("'\n !=\n'")
+ + expected + QLatin1Char('\'');
+}
+
+static bool compareBenchmarkResult(BenchmarkResult const &r1, BenchmarkResult const &r2,
+ QString *errorMessage)
{
// First make sure the iterations and unit match.
if (r1.iterations != r2.iterations || r1.unit != r2.unit) {
// Nope - compare whole string for best failure message
- return qCompare(r1.toString(), r2.toString(), actual, expected, file, line);
+ *errorMessage = msgMismatch(r1.toString(), r2.toString());
+ return false;
}
// Now check the value. Some variance is allowed, and how much depends on
// the measured unit.
qreal variance = 0.;
- if (r1.unit == "msecs" || r1.unit == "WalltimeMilliseconds") {
+ if (r1.unit == QLatin1String("msecs") || r1.unit == QLatin1String("WalltimeMilliseconds"))
variance = 0.1;
- }
- else if (r1.unit == "instruction reads") {
+ else if (r1.unit == QLatin1String("instruction reads"))
variance = 0.001;
- }
- else if (r1.unit == "CPU ticks" || r1.unit == "CPUTicks") {
+ else if (r1.unit == QLatin1String("CPU ticks") || r1.unit == QLatin1String("CPUTicks"))
variance = 0.001;
- }
+
if (variance == 0.) {
// No variance allowed - compare whole string
- return qCompare(r1.toString(), r2.toString(), actual, expected, file, line);
+ const QString r1S = r1.toString();
+ const QString r2S = r2.toString();
+ if (r1S != r2S) {
+ *errorMessage = msgMismatch(r1S, r2S);
+ return false;
+ }
+ return true;
}
- if (qAbs(qreal(r1.total) - qreal(r2.total)) <= qreal(r1.total)*variance) {
- return compare_helper(true, 0, 0, 0, actual, expected, file, line);
+ if (qAbs(qreal(r1.total) - qreal(r2.total)) > qreal(r1.total) * variance) {
+ // Whoops, didn't match. Compare the whole string for the most useful failure message.
+ *errorMessage = msgMismatch(r1.toString(), r2.toString());
+ return false;
}
-
- // Whoops, didn't match. Compare the whole string for the most useful failure message.
- return qCompare(r1.toString(), r2.toString(), actual, expected, file, line);
-}
+ return true;
}
-QT_END_NAMESPACE
// Split the passed block of text into an array of lines, replacing any
// filenames and line numbers with generic markers to avoid failing the test
@@ -227,26 +242,6 @@ static QByteArray runDiff(const QByteArrayList &expected, const QByteArrayList &
return result;
}
-// Print the difference preferably using 'diff', else just print lines
-static void printDifference(const QByteArrayList &expected, const QByteArrayList &actual)
-{
- QDebug info = qInfo();
- info.noquote();
- info.nospace();
- const QByteArray diff = runDiff(expected, actual);
- if (diff.isEmpty()) {
- info << "<<<<<<\n";
- for (const QByteArray &line : actual)
- info << line << '\n';
- info << "======\n";
- for (const QByteArray &line : expected)
- info << line << '\n';
- info << ">>>>>>\n";
- } else {
- info << diff;
- }
-}
-
// Each test is run with a set of one or more test output loggers.
// This struct holds information about one such test.
struct LoggerSet
@@ -315,6 +310,14 @@ QList<LoggerSet> tst_Selftests::allLoggerSets() const
QStringList() << "teamcity",
QStringList() << "-teamcity" << "-o" << logName("teamcity")
)
+ << LoggerSet("old stdout tap",
+ QStringList() << "stdout tap",
+ QStringList() << "-tap"
+ )
+ << LoggerSet("old tap",
+ QStringList() << "tap",
+ QStringList() << "-tap" << "-o" << logName("tap")
+ )
// Test with new-style options for a single logger
<< LoggerSet("new stdout txt",
QStringList() << "stdout txt",
@@ -362,6 +365,14 @@ QList<LoggerSet> tst_Selftests::allLoggerSets() const
QStringList() << "teamcity",
QStringList() << "-o" << logName("teamcity")+",teamcity"
)
+ << LoggerSet("new stdout tap",
+ QStringList() << "stdout tap",
+ QStringList() << "-o" << "-,tap"
+ )
+ << LoggerSet("new tap",
+ QStringList() << "tap",
+ QStringList() << "-o" << logName("tap")+",tap"
+ )
// Test with two loggers (don't test all 32 combinations, just a sample)
<< LoggerSet("stdout txt + txt",
QStringList() << "stdout txt" << "txt",
@@ -385,13 +396,14 @@ QList<LoggerSet> tst_Selftests::allLoggerSets() const
)
// All loggers at the same time (except csv)
<< LoggerSet("all loggers",
- QStringList() << "txt" << "xml" << "lightxml" << "stdout txt" << "xunitxml",
+ QStringList() << "txt" << "xml" << "lightxml" << "stdout txt" << "xunitxml" << "tap",
QStringList() << "-o" << logName("txt")+",txt"
<< "-o" << logName("xml")+",xml"
<< "-o" << logName("lightxml")+",lightxml"
<< "-o" << "-,txt"
<< "-o" << logName("xunitxml")+",xunitxml"
<< "-o" << logName("teamcity")+",teamcity"
+ << "-o" << logName("tap")+",tap"
)
;
}
@@ -399,6 +411,7 @@ QList<LoggerSet> tst_Selftests::allLoggerSets() const
tst_Selftests::tst_Selftests()
: tempDir(QDir::tempPath() + "/tst_selftests.XXXXXX")
, durationRegExp("<Duration msecs=\"[\\d\\.]+\"/>")
+ , teamcityLocRegExp("\\|\\[Loc: .*\\(\\d*\\)\\|\\]")
{}
void tst_Selftests::initTestCase()
@@ -464,6 +477,7 @@ void tst_Selftests::runSubTest_data()
<< "findtestdata"
<< "float"
<< "globaldata"
+ << "keyboard"
<< "longstring"
<< "maxwarnings"
<< "multiexec"
@@ -480,6 +494,7 @@ void tst_Selftests::runSubTest_data()
<< "sleep"
<< "strcmp"
<< "subtest"
+ << "tuplediagnostics"
<< "verbose1"
<< "verbose2"
#ifndef QT_NO_EXCEPTIONS
@@ -760,147 +775,203 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge
}
QList<QByteArray> res = splitLines(actualOutputs[n]);
- const QString expectedFileName = expectedFileNameFromTest(subdir, logger);
- QList<QByteArray> exp = expectedResult(expectedFileName);
+ QString errorMessage;
+ QString expectedFileName = expectedFileNameFromTest(subdir, logger);
+ QByteArrayList exp = expectedResult(expectedFileName);
+ if (!exp.isEmpty()) {
#ifdef Q_CC_MINGW
- // MinGW formats double numbers differently
- if (n == 0 && subdir == QStringLiteral("float")) {
- for (int i = 0; i < exp.size(); ++i) {
- exp[i].replace("e-07", "e-007");
- exp[i].replace("e+07", "e+007");
- }
- }
-#endif
-
- // For the "crashes" test, there are multiple versions of the
- // expected output. Load the one with the same line count as
- // the actual output.
- if (exp.count() == 0) {
- QList<QList<QByteArray> > expArr;
- QList<QByteArray> tmp;
- int i = 1;
- do {
- tmp = expectedResult(expectedFileNameFromTest(subdir + QLatin1Char('_') + QString::number(i++), logger));
- if (tmp.count())
- expArr += tmp;
- } while (tmp.count());
-
- for (int j = 0; j < expArr.count(); ++j) {
- if (res.count() == expArr.at(j).count()) {
- exp = expArr.at(j);
- break;
+ // MinGW formats double numbers differently (last verified with 7.1)
+ if (n == 0 && subdir == QStringLiteral("float")) {
+ for (int i = 0; i < exp.size(); ++i) {
+ exp[i].replace("e-07", "e-007");
+ exp[i].replace("e+07", "e+007");
}
}
-
- if (expArr.count()) {
- QVERIFY2(exp.count(),
- qPrintable(QString::fromLatin1("None of the expected output files for "
- "%1 format has matching line count.")
- .arg(loggers.at(n))));
+#endif
+ if (!compareOutput(logger, subdir, actualOutputs[n], res, exp, &errorMessage)) {
+ errorMessage.prepend(QLatin1Char('"') + logger + QLatin1String("\", ")
+ + expectedFileName + QLatin1Char(' '));
+ errorMessage += QLatin1String("\nActual:\n") + QLatin1String(actualOutputs[n]);
+ const QByteArray diff = runDiff(exp, res);
+ if (!diff.isEmpty())
+ errorMessage += QLatin1String("\nDiff:\n") + QLatin1String(diff);
+ QFAIL(qPrintable(errorMessage));
}
} else {
- if (res.count() != exp.count()) {
- printDifference(exp, res);
- QVERIFY2(res.count() == exp.count(),
- qPrintable(QString::fromLatin1("Mismatch in line count: %1 != %2 (%3, %4).")
- .arg(res.count()).arg(exp.count()).arg(loggers.at(n), expectedFileName)));
+ // For the "crashes" and other tests, there are multiple versions of the
+ // expected output. Loop until a matching one is found.
+ bool ok = false;
+ for (int i = 1; !ok; ++i) {
+ expectedFileName = expectedFileNameFromTest(subdir + QLatin1Char('_') + QString::number(i), logger);
+ const QByteArrayList exp = expectedResult(expectedFileName);
+ if (exp.isEmpty())
+ break;
+ QString errorMessage2;
+ ok = compareOutput(logger, subdir, actualOutputs[n], res, exp, &errorMessage2);
+ if (!ok)
+ errorMessage += QLatin1Char('\n') + expectedFileName + QLatin1String(": ") + errorMessage2;
+ }
+ if (!ok) { // Use QDebug's quote mechanism to report potentially garbled output.
+ errorMessage.prepend(QLatin1String("Cannot find a matching file for ") + subdir);
+ errorMessage += QLatin1String("\nActual:\n");
+ QDebug(&errorMessage) << actualOutputs[n];
+ QFAIL(qPrintable(errorMessage));
}
}
+ }
+}
- // By this point, we should have loaded a non-empty expected data file.
- QVERIFY2(exp.count(),
- qPrintable(QString::fromLatin1("Expected test data for %1 format is empty or not found.")
- .arg(loggers.at(n))));
-
- // For xml output formats, verify that the log is valid XML.
- if (logFormat(logger) == "xunitxml" || logFormat(logger) == "xml" || logFormat(logger) == "lightxml") {
- QByteArray xml(actualOutputs[n]);
- // lightxml intentionally skips the root element, which technically makes it
- // not valid XML.
- // We'll add that ourselves for the purpose of validation.
- if (logFormat(logger) == "lightxml") {
- xml.prepend("<root>");
- xml.append("</root>");
- }
+static QString teamCityLocation() { return QStringLiteral("|[Loc: _FILE_(_LINE_)|]"); }
+static QString qtVersionPlaceHolder() { return QStringLiteral("@INSERT_QT_VERSION_HERE@"); }
- QXmlStreamReader reader(xml);
+bool tst_Selftests::compareOutput(const QString &logger, const QString &subdir,
+ const QByteArray &rawOutput, const QByteArrayList &actual,
+ const QByteArrayList &expected,
+ QString *errorMessage) const
+{
- while (!reader.atEnd())
- reader.readNext();
+ if (actual.size() != expected.size()) {
+ *errorMessage = QString::fromLatin1("Mismatch in line count: %1 != %2.")
+ .arg(actual.size()).arg(expected.size());
+ return false;
+ }
- QVERIFY2(!reader.error(), qPrintable(QString("line %1, col %2: %3")
- .arg(reader.lineNumber())
- .arg(reader.columnNumber())
- .arg(reader.errorString())
- ));
+ // For xml output formats, verify that the log is valid XML.
+ if (logger.endsWith(QLatin1String("xml")) && !checkXml(logger, rawOutput, errorMessage))
+ return false;
+
+ // Verify that the actual output is an acceptable match for the
+ // expected output.
+
+ const QString qtVersion = QLatin1String(QT_VERSION_STR);
+ bool benchmark = false;
+ for (int i = 0, size = actual.size(); i < size; ++i) {
+ const QByteArray &actualLineBA = actual.at(i);
+ // the __FILE__ __LINE__ output is compiler dependent, skip it
+ if (actualLineBA.startsWith(" Loc: [") && actualLineBA.endsWith(")]"))
+ continue;
+ if (actualLineBA.endsWith(" : failure location"))
+ continue;
+
+ if (actualLineBA.startsWith("Config: Using QtTest library") // Text build string
+ || actualLineBA.startsWith(" <QtBuild") // XML, Light XML build string
+ || (actualLineBA.startsWith(" <property value=") && actualLineBA.endsWith("name=\"QtBuild\"/>"))) { // XUNIT-XML build string
+ continue;
}
- // Verify that the actual output is an acceptable match for the
- // expected output.
- bool benchmark = false;
- for (int i = 0; i < res.count(); ++i) {
- QByteArray line = res.at(i);
- // the __FILE__ __LINE__ output is compiler dependent, skip it
- if (line.startsWith(" Loc: [") && line.endsWith(")]"))
- continue;
- if (line.endsWith(" : failure location"))
- continue;
+ QString actualLine = QString::fromLatin1(actualLineBA);
+ QString expectedLine = QString::fromLatin1(expected.at(i));
+ expectedLine.replace(qtVersionPlaceHolder(), qtVersion);
- if (line.startsWith("Config: Using QtTest library") // Text build string
- || line.startsWith(" <QtBuild") // XML, Light XML build string
- || (line.startsWith(" <property value=") && line.endsWith("name=\"QtBuild\"/>"))) { // XUNIT-XML build string
- continue;
- }
+ // Special handling for ignoring _FILE_ and _LINE_ if logger is teamcity
+ if (logger.endsWith(QLatin1String("teamcity"))) {
+ actualLine.replace(teamcityLocRegExp, teamCityLocation());
+ expectedLine.replace(teamcityLocRegExp, teamCityLocation());
+ }
- QByteArray expLine = exp.at(i);
+ if (logger.endsWith(QLatin1String("tap"))) {
+ if (expectedLine.contains(QLatin1String("at:"))
+ || expectedLine.contains(QLatin1String("file:"))
+ || expectedLine.contains(QLatin1String("line:")))
+ actualLine = expectedLine;
+ }
- // Special handling for ignoring _FILE_ and _LINE_ if logger is teamcity
- if (logFormat(logger) == "teamcity") {
- QRegularExpression teamcityLocRegExp("\\|\\[Loc: .*\\(\\d*\\)\\|\\]");
- line = QString(line).replace(teamcityLocRegExp, "|[Loc: _FILE_(_LINE_)|]").toLatin1();
- expLine = QString(expLine).replace(teamcityLocRegExp, "|[Loc: _FILE_(_LINE_)|]").toLatin1();
- }
+ if (!compareLine(logger, subdir, benchmark, actualLine,
+ expectedLine, errorMessage)) {
+ errorMessage->prepend(QLatin1String("Line ") + QString::number(i + 1)
+ + QLatin1String(": "));
+ return false;
+ }
- const QString output(QString::fromLatin1(line));
- const QString expected(QString::fromLatin1(expLine).replace("@INSERT_QT_VERSION_HERE@", QT_VERSION_STR));
+ benchmark = actualLineBA.startsWith("RESULT : ");
+ }
+ return true;
+}
- if (subdir == "assert" && output.contains("ASSERT: ") && expected.contains("ASSERT: ") && output != expected)
- // Q_ASSERT uses __FILE__, the exact contents of which are
- // undefined. If we something that looks like a Q_ASSERT and we
- // were expecting to see a Q_ASSERT, we'll skip the line.
- continue;
- else if (expected.startsWith(QLatin1String("FAIL! : tst_Exception::throwException() Caught unhandled exce")) && expected != output)
- // On some platforms we compile without RTTI, and as a result we never throw an exception.
- QCOMPARE(output.simplified(), QString::fromLatin1("tst_Exception::throwException()").simplified());
- else if (benchmark || line.startsWith("<BenchmarkResult") || (logFormat(logger) == "csv" && line.startsWith('"'))) {
- // Don't do a literal comparison for benchmark results, since
- // results have some natural variance.
- QString error;
-
- BenchmarkResult actualResult = BenchmarkResult::parse(output, &error);
- QVERIFY2(error.isEmpty(), qPrintable(QString("Actual line didn't parse as benchmark result: %1\nLine: %2").arg(error).arg(output)));
-
- BenchmarkResult expectedResult = BenchmarkResult::parse(expected, &error);
- QVERIFY2(error.isEmpty(), qPrintable(QString("Expected line didn't parse as benchmark result: %1\nLine: %2").arg(error).arg(expected)));
-
- QCOMPARE(actualResult, expectedResult);
- } else if (line.startsWith(" <Duration msecs=") || line.startsWith("<Duration msecs=")) {
- QRegularExpressionMatch match = durationRegExp.match(line);
- QVERIFY2(match.hasMatch(), qPrintable(QString::fromLatin1("Invalid Duration tag at line %1 (%2): '%3'")
- .arg(i).arg(loggers.at(n), output)));
- } else if (line.startsWith("Totals:")) {
- const int lastCommaPos = line.lastIndexOf(',');
- if (lastCommaPos > 0)
- line.truncate(lastCommaPos); // Plain text logger: strip time (", 2323dms").
- } else {
- QVERIFY2(output == expected,
- qPrintable(QString::fromLatin1("Mismatch at line %1 (%2, %3):\n'%4'\n !=\n'%5'")
- .arg(i + 1).arg(loggers.at(n), expectedFileName, output, expected)));
- }
+bool tst_Selftests::compareLine(const QString &logger, const QString &subdir,
+ bool benchmark,
+ const QString &actualLine, const QString &expectedLine,
+ QString *errorMessage) const
+{
+ if (subdir == QLatin1String("assert") && actualLine.contains(QLatin1String("ASSERT: "))
+ && expectedLine.contains(QLatin1String("ASSERT: ")) && actualLine != expectedLine) {
+ // Q_ASSERT uses __FILE__, the exact contents of which are
+ // undefined. If have we something that looks like a Q_ASSERT and we
+ // were expecting to see a Q_ASSERT, we'll skip the line.
+ return true;
+ }
- benchmark = line.startsWith("RESULT : ");
+ if (expectedLine.startsWith(QLatin1String("FAIL! : tst_Exception::throwException() Caught unhandled exce"))
+ && actualLine != expectedLine) {
+ // On some platforms we compile without RTTI, and as a result we never throw an exception
+ if (actualLine.simplified() != QLatin1String("tst_Exception::throwException()")) {
+ *errorMessage = QString::fromLatin1("'%1' != 'tst_Exception::throwException()'").arg(actualLine);
+ return false;
}
+ return true;
+ }
+
+ if (benchmark || actualLine.startsWith(QLatin1String("<BenchmarkResult"))
+ || (logger == QLatin1String("csv") && actualLine.startsWith(QLatin1Char('"')))) {
+ // Don't do a literal comparison for benchmark results, since
+ // results have some natural variance.
+ QString error;
+ BenchmarkResult actualResult = BenchmarkResult::parse(actualLine, &error);
+ if (!error.isEmpty()) {
+ *errorMessage = QString::fromLatin1("Actual line didn't parse as benchmark result: %1\nLine: %2").arg(error, actualLine);
+ return false;
+ }
+ BenchmarkResult expectedResult = BenchmarkResult::parse(expectedLine, &error);
+ if (!error.isEmpty()) {
+ *errorMessage = QString::fromLatin1("Expected line didn't parse as benchmark result: %1\nLine: %2").arg(error, expectedLine);
+ return false;
+ }
+ return compareBenchmarkResult(actualResult, expectedResult, errorMessage);
+ }
+
+ if (actualLine.startsWith(QLatin1String(" <Duration msecs="))
+ || actualLine.startsWith(QLatin1String("<Duration msecs="))) {
+ QRegularExpressionMatch match = durationRegExp.match(actualLine);
+ if (match.hasMatch())
+ return true;
+ *errorMessage = QString::fromLatin1("Invalid Duration tag: '%1'").arg(actualLine);
+ return false;
+ }
+
+ if (actualLine.startsWith(QLatin1String("Totals:")) && expectedLine.startsWith(QLatin1String("Totals:")))
+ return true;
+
+ if (actualLine == expectedLine)
+ return true;
+
+ *errorMessage = msgMismatch(actualLine, expectedLine);
+ return false;
+}
+
+bool tst_Selftests::checkXml(const QString &logger, QByteArray xml,
+ QString *errorMessage) const
+{
+ // lightxml intentionally skips the root element, which technically makes it
+ // not valid XML.
+ // We'll add that ourselves for the purpose of validation.
+ if (logger.endsWith(QLatin1String("lightxml"))) {
+ xml.prepend("<root>");
+ xml.append("</root>");
+ }
+
+ QXmlStreamReader reader(xml);
+ while (!reader.atEnd())
+ reader.readNext();
+
+ if (reader.hasError()) {
+ const int lineNumber = int(reader.lineNumber());
+ const QByteArray line = xml.split('\n').value(lineNumber - 1);
+ *errorMessage = QString::fromLatin1("line %1, col %2 '%3': %4")
+ .arg(lineNumber).arg(reader.columnNumber())
+ .arg(QString::fromLatin1(line), reader.errorString());
+ return false;
}
+ return true;
}
#endif // QT_CONFIG(process)
diff --git a/tests/auto/corelib/tools/qregularexpression/alwaysoptimize/tst_qregularexpression_alwaysoptimize.cpp b/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp
index 6d2ae48235..17da52eaba 100644
--- a/tests/auto/corelib/tools/qregularexpression/alwaysoptimize/tst_qregularexpression_alwaysoptimize.cpp
+++ b/tests/auto/testlib/selftests/tuplediagnostics/tst_tuplediagnostics.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2012 Giuseppe D'Angelo <dangelog@gmail.com>.
+** Copyright (C) 2017 Samuel Gaist <samuel.gaist@edeltech.ch>
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -26,26 +26,40 @@
**
****************************************************************************/
+// Make sure we get a real Q_ASSERT even in release builds
+#ifdef QT_NO_DEBUG
+# undef QT_NO_DEBUG
+#endif
+
#include <QtTest/QtTest>
-#include "../tst_qregularexpression.h"
-class tst_QRegularExpression_AlwaysOptimize : public tst_QRegularExpression
+class tst_TupleDiagnostics: public QObject
{
Q_OBJECT
private slots:
- void initTestCase();
+ void testEmptyTuple() const;
+ void testSimpleTuple() const;
+ void testTuple() const;
};
-QT_BEGIN_NAMESPACE
-extern Q_CORE_EXPORT unsigned int qt_qregularexpression_optimize_after_use_count; // from qregularexpression.cpp
-QT_END_NAMESPACE
+void tst_TupleDiagnostics::testEmptyTuple() const
+{
+ QCOMPARE(std::tuple<>{}, std::tuple<>{});
+}
+
+void tst_TupleDiagnostics::testSimpleTuple() const
+{
+ QCOMPARE(std::tuple<int>{1}, std::tuple<int>{2});
+}
-void tst_QRegularExpression_AlwaysOptimize::initTestCase()
+void tst_TupleDiagnostics::testTuple() const
{
- qt_qregularexpression_optimize_after_use_count = 1;
+ std::tuple<int, char, QString> tuple1{42, 'Y', QStringLiteral("tuple1")};
+ std::tuple<int, char, QString> tuple2{42, 'Y', QStringLiteral("tuple2")};
+ QCOMPARE(tuple1, tuple2);
}
-QTEST_APPLESS_MAIN(tst_QRegularExpression_AlwaysOptimize)
+QTEST_MAIN(tst_TupleDiagnostics)
-#include "tst_qregularexpression_alwaysoptimize.moc"
+#include "tst_tuplediagnostics.moc"
diff --git a/tests/auto/testlib/selftests/tuplediagnostics/tuplediagnostics.pro b/tests/auto/testlib/selftests/tuplediagnostics/tuplediagnostics.pro
new file mode 100644
index 0000000000..7a29e0e5e1
--- /dev/null
+++ b/tests/auto/testlib/selftests/tuplediagnostics/tuplediagnostics.pro
@@ -0,0 +1,6 @@
+SOURCES += tst_tuplediagnostics.cpp
+QT = core testlib
+
+CONFIG -= app_bundle debug_and_release_target
+
+TARGET = tuplediagnostics
diff --git a/tests/auto/testserver.pri b/tests/auto/testserver.pri
new file mode 100644
index 0000000000..b2f593235f
--- /dev/null
+++ b/tests/auto/testserver.pri
@@ -0,0 +1,109 @@
+# Integrating docker-based test servers into Qt Test framework
+#
+# This file adds support for docker-based test servers built by testcase
+# projects that need them. To enable this feature, any automated test can
+# include testserver.pri in its project file. This instructs qmake to insert
+# additional targets into the generated Makefile. The 'check' target then brings
+# up test servers before running the testcase, and shuts them down afterwards.
+#
+# TESTSERVER_COMPOSE_FILE
+# - Contains the path of docker-compose file
+# This configuration file defines the services used for autotests. It tells the
+# docker engine how to build up the docker images and containers. In qtbase, a
+# shared docker-compose file is located in the tests folder.
+# Example: TESTSERVER_COMPOSE_FILE = \
+# $$dirname(_QMAKE_CONF_)/tests/testserver/docker-compose.yml
+#
+# The user must run the provisioning scripts in advance before attempting to
+# build the test servers. The docker_testserver.sh script is used to build up
+# the docker images into the docker-cache. It handles the immutable parts of the
+# server installation that rarely need adjustment, such as downloading packages.
+# Example: qt5/coin/provisioning/.../testserver/docker_testserver.sh
+#
+# QT_TEST_SERVER_LIST
+# - A list of test servers to bring up for this testcase
+# These test servers should be defined in $$TESTSERVER_COMPOSE_FILE. Each
+# testcase can define the test servers it depends on.
+# Example: QT_TEST_SERVER_LIST = apache2 squid vsftpd ftp-proxy danted
+#
+# Pre-processor defines needed for the application:
+# QT_TEST_SERVER
+# - A preprocessor macro used for testcase to change testing parameters at
+# compile time
+# This macro is predefined for docker-based test servers and is passed as a
+# compiler option (-DQT_TEST_SERVER). The testcase can then check whether
+# docker-based servers are in use and change the testing parameters, such as
+# host name or port number, at compile time. An example can be found in
+# network-settings.h.
+#
+# Example:
+# #if defined(QT_TEST_SERVER)
+# Change the testing parameters at compile time
+# #endif
+#
+# QT_TEST_SERVER_DOMAIN
+# - A preprocessor macro that holds the server domain name
+# Provided for the helper functions in network-settings.h. Use function
+# serverDomainName() in your application instead.
+#
+# Additional make targets:
+# 1. check_network - A renamed target from the check target of testcase feature.
+# 2. testserver_clean - Clean up server containers/images and tidy away related
+# files.
+
+TESTSERVER_COMPOSE_FILE = $$dirname(_QMAKE_CONF_)/tests/testserver/docker-compose.yml
+TESTSERVER_VERSION = $$system(docker-compose --version)
+
+equals(QMAKE_HOST.os, Windows)|isEmpty(TESTSERVER_VERSION) {
+ # Make check with server "qt-test-server.qt-test-net" as a fallback
+ message("testserver: qt-test-server.qt-test-net")
+} else {
+ # Make check with test servers
+ message("testserver:" $$TESTSERVER_VERSION)
+
+ # Ensure that the docker-compose file is provided. It is a configuration
+ # file which is mandatory for all docker-compose commands. You can get more
+ # detail from the description of TESTSERVER_COMPOSE_FILE above. There is
+ # also an example showing how to configure it manually.
+ FILE_PRETEST_MSG = "Project variable 'TESTSERVER_COMPOSE_FILE' is not set"
+ testserver_pretest.commands = $(if $$TESTSERVER_COMPOSE_FILE,,$(error $$FILE_PRETEST_MSG))
+
+ # Before starting the test servers, it requires the user to run the setup
+ # script (coin/provisioning/.../testserver/docker_testserver.sh) in advance.
+ IMAGE_PRETEST_CMD = docker images -aq "qt-test-server-*"
+ IMAGE_PRETEST_MSG = "Docker image qt-test-server-* not found"
+ testserver_pretest.commands += $(if $(shell $$IMAGE_PRETEST_CMD),,$(error $$IMAGE_PRETEST_MSG))
+
+ # The domain name is relevant to https keycert (qnetworkreply/crts/qt-test-net-cacert.pem).
+ DNSDOMAIN = test-net.qt.local
+ TEST_ENV += TESTSERVER_DOMAIN=$$DNSDOMAIN
+ DEFINES += QT_TEST_SERVER QT_TEST_SERVER_DOMAIN=$$shell_quote(\"$${DNSDOMAIN}\")
+
+ # There is no docker bridge on macOS. It is impossible to ping a container.
+ # Docker docs recommends using port mapping to connect to a container.
+ equals(QMAKE_HOST.os, Darwin): TEST_ENV += TESTSERVER_BIND_LOCAL=1
+
+ # Rename the check target of testcase feature
+ check.target = check_network
+ testserver_test.target = check
+
+ # Pretesting test servers environment
+ testserver_test.depends = testserver_pretest
+
+ # Bring up test servers and make sure the services are ready.
+ testserver_test.commands = $$TEST_ENV docker-compose -f $$TESTSERVER_COMPOSE_FILE up -d \
+ --force-recreate --timeout 1 $${QT_TEST_SERVER_LIST} &&
+
+ # Check test cases with docker-based test servers.
+ testserver_test.commands += $(MAKE) check_network;
+
+ # Stop and remove test servers after testing.
+ testserver_test.commands += $$TEST_ENV docker-compose -f $$TESTSERVER_COMPOSE_FILE down \
+ --timeout 1
+
+ # Destroy test servers and tidy away related files.
+ testserver_clean.commands = $$TEST_ENV docker-compose -f $$TESTSERVER_COMPOSE_FILE down \
+ --rmi all
+
+ QMAKE_EXTRA_TARGETS += testserver_pretest testserver_test testserver_clean
+}
diff --git a/tests/auto/tools/moc/cxx11-enums.h b/tests/auto/tools/moc/cxx11-enums.h
index 47a4857cd0..93ab16c157 100644
--- a/tests/auto/tools/moc/cxx11-enums.h
+++ b/tests/auto/tools/moc/cxx11-enums.h
@@ -39,10 +39,14 @@ public:
enum TypedEnum : char { B0, B1 , B2, B3 };
enum class TypedEnumClass : char { C0, C1, C2, C3 };
enum NormalEnum { D2 = 2, D3, D0 =0 , D1 };
+ enum class ClassFlag { F0 = 1, F1 = 2, F2 = 4, F3 = 8};
+ Q_DECLARE_FLAGS(ClassFlags, ClassFlag)
+
Q_ENUM(EnumClass)
Q_ENUM(TypedEnum)
Q_ENUM(TypedEnumClass)
Q_ENUM(NormalEnum)
+ Q_FLAG(ClassFlags)
};
// Also test the Q_ENUMS macro
@@ -54,7 +58,10 @@ public:
enum TypedEnum : char { B0, B1 , B2, B3 };
enum class TypedEnumClass : char { C0, C1, C2, C3 };
enum NormalEnum { D2 = 2, D3, D0 =0 , D1 };
+ enum class ClassFlag { F0 = 1, F1 = 2, F2 = 4, F3 = 8 };
+ Q_DECLARE_FLAGS(ClassFlags, ClassFlag)
Q_ENUMS(EnumClass TypedEnum TypedEnumClass NormalEnum)
+ Q_FLAGS(ClassFlags)
};
#else
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 753da401a2..92a94055a4 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -2248,6 +2248,7 @@ void tst_Moc::privateClass()
void tst_Moc::cxx11Enums_data()
{
QTest::addColumn<const QMetaObject *>("meta");
+ QTest::addColumn<QByteArray>("typeName");
QTest::addColumn<QByteArray>("enumName");
QTest::addColumn<char>("prefix");
QTest::addColumn<bool>("isScoped");
@@ -2255,14 +2256,16 @@ void tst_Moc::cxx11Enums_data()
const QMetaObject *meta1 = &CXX11Enums::staticMetaObject;
const QMetaObject *meta2 = &CXX11Enums2::staticMetaObject;
- QTest::newRow("EnumClass") << meta1 << QByteArray("EnumClass") << 'A' << true;
- QTest::newRow("EnumClass 2") << meta2 << QByteArray("EnumClass") << 'A' << true;
- QTest::newRow("TypedEnum") << meta1 << QByteArray("TypedEnum") << 'B' << false;
- QTest::newRow("TypedEnum 2") << meta2 << QByteArray("TypedEnum") << 'B' << false;
- QTest::newRow("TypedEnumClass") << meta1 << QByteArray("TypedEnumClass") << 'C' << true;
- QTest::newRow("TypedEnumClass 2") << meta2 << QByteArray("TypedEnumClass") << 'C' << true;
- QTest::newRow("NormalEnum") << meta1 << QByteArray("NormalEnum") << 'D' << false;
- QTest::newRow("NormalEnum 2") << meta2 << QByteArray("NormalEnum") << 'D' << false;
+ QTest::newRow("EnumClass") << meta1 << QByteArray("EnumClass") << QByteArray("EnumClass") << 'A' << true;
+ QTest::newRow("EnumClass 2") << meta2 << QByteArray("EnumClass") << QByteArray("EnumClass") << 'A' << true;
+ QTest::newRow("TypedEnum") << meta1 << QByteArray("TypedEnum") << QByteArray("TypedEnum") << 'B' << false;
+ QTest::newRow("TypedEnum 2") << meta2 << QByteArray("TypedEnum") << QByteArray("TypedEnum") << 'B' << false;
+ QTest::newRow("TypedEnumClass") << meta1 << QByteArray("TypedEnumClass") << QByteArray("TypedEnumClass") << 'C' << true;
+ QTest::newRow("TypedEnumClass 2") << meta2 << QByteArray("TypedEnumClass") << QByteArray("TypedEnumClass") << 'C' << true;
+ QTest::newRow("NormalEnum") << meta1 << QByteArray("NormalEnum") << QByteArray("NormalEnum") << 'D' << false;
+ QTest::newRow("NormalEnum 2") << meta2 << QByteArray("NormalEnum") << QByteArray("NormalEnum") << 'D' << false;
+ QTest::newRow("ClassFlags") << meta1 << QByteArray("ClassFlags") << QByteArray("ClassFlag") << 'F' << true;
+ QTest::newRow("ClassFlags 2") << meta2 << QByteArray("ClassFlags") << QByteArray("ClassFlag") << 'F' << true;
}
void tst_Moc::cxx11Enums()
@@ -2270,21 +2273,26 @@ void tst_Moc::cxx11Enums()
QFETCH(const QMetaObject *,meta);
QCOMPARE(meta->enumeratorOffset(), 0);
+ QFETCH(QByteArray, typeName);
QFETCH(QByteArray, enumName);
QFETCH(char, prefix);
QFETCH(bool, isScoped);
- int idx;
- idx = meta->indexOfEnumerator(enumName);
+ int idx = meta->indexOfEnumerator(typeName);
QVERIFY(idx != -1);
+ QCOMPARE(meta->indexOfEnumerator(enumName), idx);
+
QCOMPARE(meta->enumerator(idx).enclosingMetaObject(), meta);
QCOMPARE(meta->enumerator(idx).isValid(), true);
QCOMPARE(meta->enumerator(idx).keyCount(), 4);
- QCOMPARE(meta->enumerator(idx).name(), enumName.constData());
+ QCOMPARE(meta->enumerator(idx).name(), typeName.constData());
+ QCOMPARE(meta->enumerator(idx).enumName(), enumName.constData());
+ bool isFlag = meta->enumerator(idx).isFlag();
for (int i = 0; i < 4; i++) {
QByteArray v = prefix + QByteArray::number(i);
- QCOMPARE(meta->enumerator(idx).keyToValue(v), i);
- QCOMPARE(meta->enumerator(idx).valueToKey(i), v.constData());
+ const int value = isFlag ? (1 << i) : i;
+ QCOMPARE(meta->enumerator(idx).keyToValue(v), value);
+ QCOMPARE(meta->enumerator(idx).valueToKey(value), v.constData());
}
QCOMPARE(meta->enumerator(idx).isScoped(), isScoped);
}
diff --git a/tests/auto/tools/qmakelib/evaltest.cpp b/tests/auto/tools/qmakelib/evaltest.cpp
index aeedf4ae32..948e2b3121 100644
--- a/tests/auto/tools/qmakelib/evaltest.cpp
+++ b/tests/auto/tools/qmakelib/evaltest.cpp
@@ -819,7 +819,7 @@ void tst_qmakelib::addReplaceFunctions(const QString &qindir)
QTest::newRow("$$member(): bad number of arguments")
<< "VAR = $$member(1, 2, 3, 4)"
<< "VAR ="
- << "##:1: member(var, start, end) requires one to three arguments."
+ << "##:1: member(var, [start, [end]]) requires one to three arguments."
<< true;
QTest::newRow("$$member(): bad args (1)")
@@ -1030,8 +1030,8 @@ void tst_qmakelib::addReplaceFunctions(const QString &qindir)
QTest::newRow("$$fromfile(): bad number of arguments")
<< "VAR = $$fromfile(1) \\\n$$fromfile(1, 2, 3)"
<< "VAR ="
- << "##:1: fromfile(file, variable) requires two arguments.\n"
- "##:2: fromfile(file, variable) requires two arguments."
+ << "##:1: fromfile(file, var) requires two arguments.\n"
+ "##:2: fromfile(file, var) requires two arguments."
<< true;
QTest::newRow("$$eval()")
@@ -1043,7 +1043,7 @@ void tst_qmakelib::addReplaceFunctions(const QString &qindir)
QTest::newRow("$$eval(): bad number of arguments")
<< "VAR = $$eval(1, 2)"
<< "VAR ="
- << "##:1: eval(variable) requires one argument."
+ << "##:1: eval(var) requires one argument."
<< true;
QTest::newRow("$$list()")
@@ -1128,7 +1128,7 @@ void tst_qmakelib::addReplaceFunctions(const QString &qindir)
QTest::newRow("$$format_number(): bad number of arguments")
<< "VAR = $$format_number(13, 1, 2)"
<< "VAR ="
- << "##:1: format_number(number[, options...]) requires one or two arguments."
+ << "##:1: format_number(number, [options...]) requires one or two arguments."
<< true;
QTest::newRow("$$format_number(): invalid option")
@@ -1200,7 +1200,7 @@ void tst_qmakelib::addReplaceFunctions(const QString &qindir)
QTest::newRow("$$join(): bad number of arguments")
<< "VAR = $$join(1, 2, 3, 4, 5)"
<< "VAR ="
- << "##:1: join(var, glue, before, after) requires one to four arguments."
+ << "##:1: join(var, [glue, [before, [after]]]) requires one to four arguments."
<< true;
QTest::newRow("$$split(): default sep")
@@ -1296,8 +1296,8 @@ void tst_qmakelib::addReplaceFunctions(const QString &qindir)
QTest::newRow("$$section(): bad number of arguments")
<< "VAR = $$section(1, 2) \\\n$$section(1, 2, 3, 4, 5)"
<< "VAR ="
- << "##:1: section(var, sep, begin, end) requires three or four arguments.\n"
- "##:2: section(var, sep, begin, end) requires three or four arguments."
+ << "##:1: section(var, sep, begin, [end]) requires three or four arguments.\n"
+ "##:2: section(var, sep, begin, [end]) requires three or four arguments."
<< true;
QTest::newRow("$$find()")
@@ -1333,7 +1333,7 @@ void tst_qmakelib::addReplaceFunctions(const QString &qindir)
QTest::newRow("$$cat(): bad number of arguments")
<< "VAR = $$cat(1, 2, 3)"
<< "VAR ="
- << "##:1: cat(file, singleline=true) requires one or two arguments."
+ << "##:1: cat(file, [mode=true|blob|lines]) requires one or two arguments."
<< true;
QTest::newRow("$$system(): default mode")
@@ -1473,7 +1473,7 @@ void tst_qmakelib::addReplaceFunctions(const QString &qindir)
QTest::newRow("$$files(): bad number of arguments")
<< "VAR = $$files(1, 2, 3)"
<< "VAR ="
- << "##:1: files(pattern, recursive=false) requires one or two arguments."
+ << "##:1: files(pattern, [recursive=false]) requires one or two arguments."
<< true;
#if 0
@@ -1639,7 +1639,7 @@ void tst_qmakelib::addReplaceFunctions(const QString &qindir)
QTest::newRow("$$absolute_path(): bad number of arguments")
<< "VAR = $$absolute_path(1, 2, 3)"
<< "VAR ="
- << "##:1: absolute_path(path[, base]) requires one or two arguments."
+ << "##:1: absolute_path(path, [base]) requires one or two arguments."
<< true;
QTest::newRow("$$relative_path(): relative file")
@@ -1683,7 +1683,7 @@ void tst_qmakelib::addReplaceFunctions(const QString &qindir)
QTest::newRow("$$relative_path(): bad number of arguments")
<< "VAR = $$relative_path(1, 2, 3)"
<< "VAR ="
- << "##:1: relative_path(path[, base]) requires one or two arguments."
+ << "##:1: relative_path(path, [base]) requires one or two arguments."
<< true;
QTest::newRow("$$clean_path()")
@@ -1847,7 +1847,7 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
QTest::newRow("defined(): bad number of arguments")
<< "defined(1, 2, 3): OK = 1"
<< "OK = UNDEF"
- << "##:1: defined(function, [\"test\"|\"replace\"|\"var\"]) requires one or two arguments."
+ << "##:1: defined(object, [\"test\"|\"replace\"|\"var\"]) requires one or two arguments."
<< true;
QTest::newRow("export()")
@@ -1864,7 +1864,7 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
QTest::newRow("export(): bad number of arguments")
<< "export(1, 2): OK = 1"
<< "OK = UNDEF"
- << "##:1: export(variable) requires one argument."
+ << "##:1: export(var) requires one argument."
<< true;
QTest::newRow("infile(): found")
@@ -2006,7 +2006,7 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
QTest::newRow("CONFIG(): bad number of arguments")
<< "CONFIG(1, 2, 3): OK = 1"
<< "OK = UNDEF"
- << "##:1: CONFIG(config) requires one or two arguments."
+ << "##:1: CONFIG(config, [mutuals]) requires one or two arguments."
<< true;
QTest::newRow("contains(simple plain): true")
@@ -2072,8 +2072,8 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
QTest::newRow("contains(): bad number of arguments")
<< "contains(1): OK = 1\ncontains(1, 2, 3, 4): OK = 1"
<< "OK = UNDEF"
- << "##:1: contains(var, val) requires two or three arguments.\n"
- "##:2: contains(var, val) requires two or three arguments."
+ << "##:1: contains(var, val, [mutuals]) requires two or three arguments.\n"
+ "##:2: contains(var, val, [mutuals]) requires two or three arguments."
<< true;
QTest::newRow("count(): true")
@@ -2133,8 +2133,8 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
QTest::newRow("count(): bad number of arguments")
<< "count(1): OK = 1\ncount(1, 2, 3, 4): OK = 1"
<< "OK = UNDEF"
- << "##:1: count(var, count, op=\"equals\") requires two or three arguments.\n"
- "##:2: count(var, count, op=\"equals\") requires two or three arguments."
+ << "##:1: count(var, count, [op=operator]) requires two or three arguments.\n"
+ "##:2: count(var, count, [op=operator]) requires two or three arguments."
<< true;
QTest::newRow("greaterThan(int): true")
@@ -2164,8 +2164,8 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
QTest::newRow("greaterThan(): bad number of arguments")
<< "greaterThan(1): OK = 1\ngreaterThan(1, 2, 3): OK = 1"
<< "OK = UNDEF"
- << "##:1: greaterThan(variable, value) requires two arguments.\n"
- "##:2: greaterThan(variable, value) requires two arguments."
+ << "##:1: greaterThan(var, val) requires two arguments.\n"
+ "##:2: greaterThan(var, val) requires two arguments."
<< true;
QTest::newRow("lessThan(int): true")
@@ -2195,8 +2195,8 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
QTest::newRow("lessThan(): bad number of arguments")
<< "lessThan(1): OK = 1\nlessThan(1, 2, 3): OK = 1"
<< "OK = UNDEF"
- << "##:1: lessThan(variable, value) requires two arguments.\n"
- "##:2: lessThan(variable, value) requires two arguments."
+ << "##:1: lessThan(var, val) requires two arguments.\n"
+ "##:2: lessThan(var, val) requires two arguments."
<< true;
QTest::newRow("equals(): true")
@@ -2214,8 +2214,8 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
QTest::newRow("equals(): bad number of arguments")
<< "equals(1): OK = 1\nequals(1, 2, 3): OK = 1"
<< "OK = UNDEF"
- << "##:1: equals(variable, value) requires two arguments.\n"
- "##:2: equals(variable, value) requires two arguments."
+ << "##:1: equals(var, val) requires two arguments.\n"
+ "##:2: equals(var, val) requires two arguments."
<< true;
// That's just an alias, so don't test much.
@@ -2240,8 +2240,8 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
QTest::newRow("versionAtLeast(): bad number of arguments")
<< "versionAtLeast(1): OK = 1\nversionAtLeast(1, 2, 3): OK = 1"
<< "OK = UNDEF"
- << "##:1: versionAtLeast(variable, versionNumber) requires two arguments.\n"
- "##:2: versionAtLeast(variable, versionNumber) requires two arguments."
+ << "##:1: versionAtLeast(var, version) requires two arguments.\n"
+ "##:2: versionAtLeast(var, version) requires two arguments."
<< true;
QTest::newRow("versionAtMost(): true")
@@ -2259,8 +2259,8 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
QTest::newRow("versionAtMost(): bad number of arguments")
<< "versionAtMost(1): OK = 1\nversionAtMost(1, 2, 3): OK = 1"
<< "OK = UNDEF"
- << "##:1: versionAtMost(variable, versionNumber) requires two arguments.\n"
- "##:2: versionAtMost(variable, versionNumber) requires two arguments."
+ << "##:1: versionAtMost(var, version) requires two arguments.\n"
+ "##:2: versionAtMost(var, version) requires two arguments."
<< true;
QTest::newRow("clear(): top-level")
@@ -2288,7 +2288,7 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
QTest::newRow("clear(): bad number of arguments")
<< "clear(1, 2): OK = 1"
<< "OK = UNDEF"
- << "##:1: clear(variable) requires one argument."
+ << "##:1: clear(var) requires one argument."
<< true;
QTest::newRow("unset(): top-level")
@@ -2316,7 +2316,7 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
QTest::newRow("unset(): bad number of arguments")
<< "unset(1, 2): OK = 1"
<< "OK = UNDEF"
- << "##:1: unset(variable) requires one argument."
+ << "##:1: unset(var) requires one argument."
<< true;
// This function does not follow the established naming pattern.
@@ -2362,8 +2362,8 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
QTest::newRow("parseJson(): bad number of arguments")
<< "parseJson(1): OK = 1\nparseJson(1, 2, 3): OK = 1"
<< "OK = UNDEF"
- << "##:1: parseJson(variable, into) requires two arguments.\n"
- "##:2: parseJson(variable, into) requires two arguments."
+ << "##:1: parseJson(var, into) requires two arguments.\n"
+ "##:2: parseJson(var, into) requires two arguments."
<< true;
QTest::newRow("include()")
@@ -2395,7 +2395,7 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
QTest::newRow("include(): bad number of arguments")
<< "include(1, 2, 3, 4): OK = 1"
<< "OK = UNDEF"
- << "##:1: include(file, [into, [silent]]) requires one, two or three arguments."
+ << "##:1: include(file, [into, [silent]]) requires one to three arguments."
<< true;
QTest::newRow("load()")
@@ -2419,7 +2419,7 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
QTest::newRow("load(): bad number of arguments")
<< "load(1, 2, 3): OK = 1"
<< "OK = UNDEF"
- << "##:1: load(feature) requires one or two arguments."
+ << "##:1: load(feature, [ignore_errors=false]) requires one or two arguments."
<< true;
QTest::newRow("discard_from()")
@@ -2668,7 +2668,7 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
QTest::newRow("mkpath(): bad number of arguments")
<< "mkpath(1, 2): OK = 1"
<< "OK = UNDEF"
- << "##:1: mkpath(file) requires one argument."
+ << "##:1: mkpath(path) requires one argument."
<< true;
#if 0
diff --git a/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Bottom.ui.h b/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Bottom.ui.h
index d8db966b76..1f5004b2aa 100644
--- a/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Bottom.ui.h
+++ b/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Bottom.ui.h
@@ -24,10 +24,10 @@ public:
void setupUi(QDialog *Dialog)
{
if (Dialog->objectName().isEmpty())
- Dialog->setObjectName(QStringLiteral("Dialog"));
+ Dialog->setObjectName(QString::fromUtf8("Dialog"));
Dialog->resize(400, 300);
buttonBox = new QDialogButtonBox(Dialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setGeometry(QRect(30, 240, 341, 32));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Right.ui.h b/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Right.ui.h
index b167eaec8a..8dd8b11b62 100644
--- a/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Right.ui.h
+++ b/tests/auto/tools/uic/baseline/Dialog_with_Buttons_Right.ui.h
@@ -24,10 +24,10 @@ public:
void setupUi(QDialog *Dialog)
{
if (Dialog->objectName().isEmpty())
- Dialog->setObjectName(QStringLiteral("Dialog"));
+ Dialog->setObjectName(QString::fromUtf8("Dialog"));
Dialog->resize(400, 300);
buttonBox = new QDialogButtonBox(Dialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setGeometry(QRect(290, 20, 81, 241));
buttonBox->setOrientation(Qt::Vertical);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/Dialog_without_Buttons.ui.h b/tests/auto/tools/uic/baseline/Dialog_without_Buttons.ui.h
index 52e9f3b931..95acabf3f8 100644
--- a/tests/auto/tools/uic/baseline/Dialog_without_Buttons.ui.h
+++ b/tests/auto/tools/uic/baseline/Dialog_without_Buttons.ui.h
@@ -22,7 +22,7 @@ public:
void setupUi(QDialog *Dialog)
{
if (Dialog->objectName().isEmpty())
- Dialog->setObjectName(QStringLiteral("Dialog"));
+ Dialog->setObjectName(QString::fromUtf8("Dialog"));
Dialog->resize(400, 300);
retranslateUi(Dialog);
diff --git a/tests/auto/tools/uic/baseline/Main_Window.ui.h b/tests/auto/tools/uic/baseline/Main_Window.ui.h
index eba78c1a2b..9e59e9f2e5 100644
--- a/tests/auto/tools/uic/baseline/Main_Window.ui.h
+++ b/tests/auto/tools/uic/baseline/Main_Window.ui.h
@@ -28,16 +28,16 @@ public:
void setupUi(QMainWindow *MainWindow)
{
if (MainWindow->objectName().isEmpty())
- MainWindow->setObjectName(QStringLiteral("MainWindow"));
+ MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
MainWindow->resize(800, 600);
menubar = new QMenuBar(MainWindow);
- menubar->setObjectName(QStringLiteral("menubar"));
+ menubar->setObjectName(QString::fromUtf8("menubar"));
MainWindow->setMenuBar(menubar);
centralwidget = new QWidget(MainWindow);
- centralwidget->setObjectName(QStringLiteral("centralwidget"));
+ centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
MainWindow->setCentralWidget(centralwidget);
statusbar = new QStatusBar(MainWindow);
- statusbar->setObjectName(QStringLiteral("statusbar"));
+ statusbar->setObjectName(QString::fromUtf8("statusbar"));
MainWindow->setStatusBar(statusbar);
retranslateUi(MainWindow);
diff --git a/tests/auto/tools/uic/baseline/Widget.ui.h b/tests/auto/tools/uic/baseline/Widget.ui.h
index 8cb31b4589..4318c2262f 100644
--- a/tests/auto/tools/uic/baseline/Widget.ui.h
+++ b/tests/auto/tools/uic/baseline/Widget.ui.h
@@ -30,22 +30,22 @@ public:
void setupUi(QWidget *Form)
{
if (Form->objectName().isEmpty())
- Form->setObjectName(QStringLiteral("Form"));
+ Form->setObjectName(QString::fromUtf8("Form"));
Form->resize(400, 300);
vboxLayout = new QVBoxLayout(Form);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
Alabel = new QLabel(Form);
- Alabel->setObjectName(QStringLiteral("Alabel"));
+ Alabel->setObjectName(QString::fromUtf8("Alabel"));
vboxLayout->addWidget(Alabel);
groupBox = new QGroupBox(Form);
- groupBox->setObjectName(QStringLiteral("groupBox"));
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
vboxLayout->addWidget(groupBox);
pushButton = new QPushButton(Form);
- pushButton->setObjectName(QStringLiteral("pushButton"));
+ pushButton->setObjectName(QString::fromUtf8("pushButton"));
vboxLayout->addWidget(pushButton);
diff --git a/tests/auto/tools/uic/baseline/addlinkdialog.ui.h b/tests/auto/tools/uic/baseline/addlinkdialog.ui.h
index 71d091380a..17f51a92f8 100644
--- a/tests/auto/tools/uic/baseline/addlinkdialog.ui.h
+++ b/tests/auto/tools/uic/baseline/addlinkdialog.ui.h
@@ -38,31 +38,31 @@ public:
void setupUi(QDialog *AddLinkDialog)
{
if (AddLinkDialog->objectName().isEmpty())
- AddLinkDialog->setObjectName(QStringLiteral("AddLinkDialog"));
+ AddLinkDialog->setObjectName(QString::fromUtf8("AddLinkDialog"));
AddLinkDialog->setSizeGripEnabled(false);
AddLinkDialog->setModal(true);
verticalLayout = new QVBoxLayout(AddLinkDialog);
- verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
formLayout = new QFormLayout();
- formLayout->setObjectName(QStringLiteral("formLayout"));
+ formLayout->setObjectName(QString::fromUtf8("formLayout"));
label = new QLabel(AddLinkDialog);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
formLayout->setWidget(0, QFormLayout::LabelRole, label);
titleInput = new QLineEdit(AddLinkDialog);
- titleInput->setObjectName(QStringLiteral("titleInput"));
+ titleInput->setObjectName(QString::fromUtf8("titleInput"));
titleInput->setMinimumSize(QSize(337, 0));
formLayout->setWidget(0, QFormLayout::FieldRole, titleInput);
label_2 = new QLabel(AddLinkDialog);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
formLayout->setWidget(1, QFormLayout::LabelRole, label_2);
urlInput = new QLineEdit(AddLinkDialog);
- urlInput->setObjectName(QStringLiteral("urlInput"));
+ urlInput->setObjectName(QString::fromUtf8("urlInput"));
formLayout->setWidget(1, QFormLayout::FieldRole, urlInput);
@@ -74,14 +74,14 @@ public:
verticalLayout->addItem(verticalSpacer);
line = new QFrame(AddLinkDialog);
- line->setObjectName(QStringLiteral("line"));
+ line->setObjectName(QString::fromUtf8("line"));
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
verticalLayout->addWidget(line);
buttonBox = new QDialogButtonBox(AddLinkDialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/addtorrentform.ui.h b/tests/auto/tools/uic/baseline/addtorrentform.ui.h
index e76f05f1de..d259a011bf 100644
--- a/tests/auto/tools/uic/baseline/addtorrentform.ui.h
+++ b/tests/auto/tools/uic/baseline/addtorrentform.ui.h
@@ -56,7 +56,7 @@ public:
void setupUi(QDialog *AddTorrentFile)
{
if (AddTorrentFile->objectName().isEmpty())
- AddTorrentFile->setObjectName(QStringLiteral("AddTorrentFile"));
+ AddTorrentFile->setObjectName(QString::fromUtf8("AddTorrentFile"));
AddTorrentFile->resize(464, 385);
AddTorrentFile->setSizeGripEnabled(false);
AddTorrentFile->setModal(true);
@@ -65,56 +65,56 @@ public:
vboxLayout->setSpacing(6);
#endif
vboxLayout->setContentsMargins(8, 8, 8, 8);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
groupBox = new QGroupBox(AddTorrentFile);
- groupBox->setObjectName(QStringLiteral("groupBox"));
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
widget = new QWidget(groupBox);
- widget->setObjectName(QStringLiteral("widget"));
+ widget->setObjectName(QString::fromUtf8("widget"));
widget->setGeometry(QRect(10, 40, 364, 33));
gridLayout = new QGridLayout(groupBox);
#ifndef Q_OS_MAC
gridLayout->setSpacing(6);
#endif
gridLayout->setContentsMargins(8, 8, 8, 8);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
label_4 = new QLabel(groupBox);
- label_4->setObjectName(QStringLiteral("label_4"));
+ label_4->setObjectName(QString::fromUtf8("label_4"));
gridLayout->addWidget(label_4, 6, 0, 1, 1);
torrentFile = new QLineEdit(groupBox);
- torrentFile->setObjectName(QStringLiteral("torrentFile"));
+ torrentFile->setObjectName(QString::fromUtf8("torrentFile"));
gridLayout->addWidget(torrentFile, 0, 1, 1, 2);
label_2 = new QLabel(groupBox);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
gridLayout->addWidget(label_2, 1, 0, 1, 1);
browseTorrents = new QPushButton(groupBox);
- browseTorrents->setObjectName(QStringLiteral("browseTorrents"));
+ browseTorrents->setObjectName(QString::fromUtf8("browseTorrents"));
gridLayout->addWidget(browseTorrents, 0, 3, 1, 1);
label_5 = new QLabel(groupBox);
- label_5->setObjectName(QStringLiteral("label_5"));
+ label_5->setObjectName(QString::fromUtf8("label_5"));
label_5->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop);
gridLayout->addWidget(label_5, 5, 0, 1, 1);
label_3 = new QLabel(groupBox);
- label_3->setObjectName(QStringLiteral("label_3"));
+ label_3->setObjectName(QString::fromUtf8("label_3"));
gridLayout->addWidget(label_3, 4, 0, 1, 1);
label_6 = new QLabel(groupBox);
- label_6->setObjectName(QStringLiteral("label_6"));
+ label_6->setObjectName(QString::fromUtf8("label_6"));
gridLayout->addWidget(label_6, 2, 0, 1, 1);
torrentContents = new QTextEdit(groupBox);
- torrentContents->setObjectName(QStringLiteral("torrentContents"));
+ torrentContents->setObjectName(QString::fromUtf8("torrentContents"));
torrentContents->setFocusPolicy(Qt::NoFocus);
torrentContents->setTabChangesFocus(true);
torrentContents->setLineWrapMode(QTextEdit::NoWrap);
@@ -123,43 +123,43 @@ public:
gridLayout->addWidget(torrentContents, 5, 1, 1, 3);
destinationFolder = new QLineEdit(groupBox);
- destinationFolder->setObjectName(QStringLiteral("destinationFolder"));
+ destinationFolder->setObjectName(QString::fromUtf8("destinationFolder"));
destinationFolder->setFocusPolicy(Qt::StrongFocus);
gridLayout->addWidget(destinationFolder, 6, 1, 1, 2);
announceUrl = new QLabel(groupBox);
- announceUrl->setObjectName(QStringLiteral("announceUrl"));
+ announceUrl->setObjectName(QString::fromUtf8("announceUrl"));
gridLayout->addWidget(announceUrl, 1, 1, 1, 3);
label = new QLabel(groupBox);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout->addWidget(label, 0, 0, 1, 1);
browseDestination = new QPushButton(groupBox);
- browseDestination->setObjectName(QStringLiteral("browseDestination"));
+ browseDestination->setObjectName(QString::fromUtf8("browseDestination"));
gridLayout->addWidget(browseDestination, 6, 3, 1, 1);
label_7 = new QLabel(groupBox);
- label_7->setObjectName(QStringLiteral("label_7"));
+ label_7->setObjectName(QString::fromUtf8("label_7"));
gridLayout->addWidget(label_7, 3, 0, 1, 1);
commentLabel = new QLabel(groupBox);
- commentLabel->setObjectName(QStringLiteral("commentLabel"));
+ commentLabel->setObjectName(QString::fromUtf8("commentLabel"));
gridLayout->addWidget(commentLabel, 3, 1, 1, 3);
creatorLabel = new QLabel(groupBox);
- creatorLabel->setObjectName(QStringLiteral("creatorLabel"));
+ creatorLabel->setObjectName(QString::fromUtf8("creatorLabel"));
gridLayout->addWidget(creatorLabel, 2, 1, 1, 3);
sizeLabel = new QLabel(groupBox);
- sizeLabel->setObjectName(QStringLiteral("sizeLabel"));
+ sizeLabel->setObjectName(QString::fromUtf8("sizeLabel"));
gridLayout->addWidget(sizeLabel, 4, 1, 1, 3);
@@ -171,19 +171,19 @@ public:
hboxLayout->setSpacing(6);
#endif
hboxLayout->setContentsMargins(0, 0, 0, 0);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
spacerItem = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout->addItem(spacerItem);
okButton = new QPushButton(AddTorrentFile);
- okButton->setObjectName(QStringLiteral("okButton"));
+ okButton->setObjectName(QString::fromUtf8("okButton"));
okButton->setEnabled(false);
hboxLayout->addWidget(okButton);
cancelButton = new QPushButton(AddTorrentFile);
- cancelButton->setObjectName(QStringLiteral("cancelButton"));
+ cancelButton->setObjectName(QString::fromUtf8("cancelButton"));
hboxLayout->addWidget(cancelButton);
diff --git a/tests/auto/tools/uic/baseline/authenticationdialog.ui.h b/tests/auto/tools/uic/baseline/authenticationdialog.ui.h
index 331770b5e0..16c9ce16a8 100644
--- a/tests/auto/tools/uic/baseline/authenticationdialog.ui.h
+++ b/tests/auto/tools/uic/baseline/authenticationdialog.ui.h
@@ -37,50 +37,50 @@ public:
void setupUi(QDialog *Dialog)
{
if (Dialog->objectName().isEmpty())
- Dialog->setObjectName(QStringLiteral("Dialog"));
+ Dialog->setObjectName(QString::fromUtf8("Dialog"));
Dialog->resize(389, 243);
gridLayout = new QGridLayout(Dialog);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
label = new QLabel(Dialog);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
label->setWordWrap(false);
gridLayout->addWidget(label, 0, 0, 1, 2);
label_2 = new QLabel(Dialog);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
gridLayout->addWidget(label_2, 2, 0, 1, 1);
userEdit = new QLineEdit(Dialog);
- userEdit->setObjectName(QStringLiteral("userEdit"));
+ userEdit->setObjectName(QString::fromUtf8("userEdit"));
gridLayout->addWidget(userEdit, 2, 1, 1, 1);
label_3 = new QLabel(Dialog);
- label_3->setObjectName(QStringLiteral("label_3"));
+ label_3->setObjectName(QString::fromUtf8("label_3"));
gridLayout->addWidget(label_3, 3, 0, 1, 1);
passwordEdit = new QLineEdit(Dialog);
- passwordEdit->setObjectName(QStringLiteral("passwordEdit"));
+ passwordEdit->setObjectName(QString::fromUtf8("passwordEdit"));
gridLayout->addWidget(passwordEdit, 3, 1, 1, 1);
buttonBox = new QDialogButtonBox(Dialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
gridLayout->addWidget(buttonBox, 5, 0, 1, 2);
label_4 = new QLabel(Dialog);
- label_4->setObjectName(QStringLiteral("label_4"));
+ label_4->setObjectName(QString::fromUtf8("label_4"));
gridLayout->addWidget(label_4, 1, 0, 1, 1);
siteDescription = new QLabel(Dialog);
- siteDescription->setObjectName(QStringLiteral("siteDescription"));
+ siteDescription->setObjectName(QString::fromUtf8("siteDescription"));
QFont font;
font.setBold(true);
font.setWeight(75);
diff --git a/tests/auto/tools/uic/baseline/backside.ui.h b/tests/auto/tools/uic/baseline/backside.ui.h
index 963eb082ae..e7053c632f 100644
--- a/tests/auto/tools/uic/baseline/backside.ui.h
+++ b/tests/auto/tools/uic/baseline/backside.ui.h
@@ -47,47 +47,47 @@ public:
void setupUi(QWidget *BackSide)
{
if (BackSide->objectName().isEmpty())
- BackSide->setObjectName(QStringLiteral("BackSide"));
+ BackSide->setObjectName(QString::fromUtf8("BackSide"));
BackSide->resize(378, 385);
verticalLayout_2 = new QVBoxLayout(BackSide);
- verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2"));
+ verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2"));
groupBox = new QGroupBox(BackSide);
- groupBox->setObjectName(QStringLiteral("groupBox"));
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
groupBox->setFlat(true);
groupBox->setCheckable(true);
gridLayout = new QGridLayout(groupBox);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
label = new QLabel(groupBox);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout->addWidget(label, 0, 0, 1, 1);
hostName = new QLineEdit(groupBox);
- hostName->setObjectName(QStringLiteral("hostName"));
+ hostName->setObjectName(QString::fromUtf8("hostName"));
gridLayout->addWidget(hostName, 0, 1, 1, 1);
label_2 = new QLabel(groupBox);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
gridLayout->addWidget(label_2, 1, 0, 1, 1);
label_3 = new QLabel(groupBox);
- label_3->setObjectName(QStringLiteral("label_3"));
+ label_3->setObjectName(QString::fromUtf8("label_3"));
gridLayout->addWidget(label_3, 2, 0, 1, 1);
horizontalLayout = new QHBoxLayout();
- horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
+ horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
horizontalSlider = new QSlider(groupBox);
- horizontalSlider->setObjectName(QStringLiteral("horizontalSlider"));
+ horizontalSlider->setObjectName(QString::fromUtf8("horizontalSlider"));
horizontalSlider->setValue(42);
horizontalSlider->setOrientation(Qt::Horizontal);
horizontalLayout->addWidget(horizontalSlider);
spinBox = new QSpinBox(groupBox);
- spinBox->setObjectName(QStringLiteral("spinBox"));
+ spinBox->setObjectName(QString::fromUtf8("spinBox"));
spinBox->setValue(42);
horizontalLayout->addWidget(spinBox);
@@ -96,7 +96,7 @@ public:
gridLayout->addLayout(horizontalLayout, 2, 1, 1, 1);
dateTimeEdit = new QDateTimeEdit(groupBox);
- dateTimeEdit->setObjectName(QStringLiteral("dateTimeEdit"));
+ dateTimeEdit->setObjectName(QString::fromUtf8("dateTimeEdit"));
gridLayout->addWidget(dateTimeEdit, 1, 1, 1, 1);
@@ -104,11 +104,11 @@ public:
verticalLayout_2->addWidget(groupBox);
groupBox_2 = new QGroupBox(BackSide);
- groupBox_2->setObjectName(QStringLiteral("groupBox_2"));
+ groupBox_2->setObjectName(QString::fromUtf8("groupBox_2"));
groupBox_2->setFlat(true);
groupBox_2->setCheckable(true);
horizontalLayout_2 = new QHBoxLayout(groupBox_2);
- horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
+ horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2"));
treeWidget = new QTreeWidget(groupBox_2);
QTreeWidgetItem *__qtreewidgetitem = new QTreeWidgetItem(treeWidget);
QTreeWidgetItem *__qtreewidgetitem1 = new QTreeWidgetItem(__qtreewidgetitem);
@@ -121,7 +121,7 @@ public:
QTreeWidgetItem *__qtreewidgetitem4 = new QTreeWidgetItem(treeWidget);
QTreeWidgetItem *__qtreewidgetitem5 = new QTreeWidgetItem(__qtreewidgetitem4);
new QTreeWidgetItem(__qtreewidgetitem5);
- treeWidget->setObjectName(QStringLiteral("treeWidget"));
+ treeWidget->setObjectName(QString::fromUtf8("treeWidget"));
horizontalLayout_2->addWidget(treeWidget);
diff --git a/tests/auto/tools/uic/baseline/batchtranslation.ui.h b/tests/auto/tools/uic/baseline/batchtranslation.ui.h
index 1f55b6230e..8a4dc7a677 100644
--- a/tests/auto/tools/uic/baseline/batchtranslation.ui.h
+++ b/tests/auto/tools/uic/baseline/batchtranslation.ui.h
@@ -78,7 +78,7 @@ public:
void setupUi(QDialog *databaseTranslationDialog)
{
if (databaseTranslationDialog->objectName().isEmpty())
- databaseTranslationDialog->setObjectName(QStringLiteral("databaseTranslationDialog"));
+ databaseTranslationDialog->setObjectName(QString::fromUtf8("databaseTranslationDialog"));
databaseTranslationDialog->resize(425, 370);
vboxLayout = new QVBoxLayout(databaseTranslationDialog);
#ifndef Q_OS_MAC
@@ -87,9 +87,9 @@ public:
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
groupBox = new QGroupBox(databaseTranslationDialog);
- groupBox->setObjectName(QStringLiteral("groupBox"));
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(4));
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -102,15 +102,15 @@ public:
#ifndef Q_OS_MAC
vboxLayout1->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
ckOnlyUntranslated = new QCheckBox(groupBox);
- ckOnlyUntranslated->setObjectName(QStringLiteral("ckOnlyUntranslated"));
+ ckOnlyUntranslated->setObjectName(QString::fromUtf8("ckOnlyUntranslated"));
ckOnlyUntranslated->setChecked(true);
vboxLayout1->addWidget(ckOnlyUntranslated);
ckMarkFinished = new QCheckBox(groupBox);
- ckMarkFinished->setObjectName(QStringLiteral("ckMarkFinished"));
+ ckMarkFinished->setObjectName(QString::fromUtf8("ckMarkFinished"));
ckMarkFinished->setChecked(true);
vboxLayout1->addWidget(ckMarkFinished);
@@ -119,7 +119,7 @@ public:
vboxLayout->addWidget(groupBox);
groupBox_2 = new QGroupBox(databaseTranslationDialog);
- groupBox_2->setObjectName(QStringLiteral("groupBox_2"));
+ groupBox_2->setObjectName(QString::fromUtf8("groupBox_2"));
QSizePolicy sizePolicy1(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(1));
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
@@ -132,7 +132,7 @@ public:
#ifndef Q_OS_MAC
vboxLayout2->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout2->setObjectName(QStringLiteral("vboxLayout2"));
+ vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2"));
hboxLayout = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout->setSpacing(6);
@@ -140,9 +140,9 @@ public:
#ifndef Q_OS_MAC
hboxLayout->setContentsMargins(0, 0, 0, 0);
#endif
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
phrasebookList = new QListView(groupBox_2);
- phrasebookList->setObjectName(QStringLiteral("phrasebookList"));
+ phrasebookList->setObjectName(QString::fromUtf8("phrasebookList"));
phrasebookList->setUniformItemSizes(true);
hboxLayout->addWidget(phrasebookList);
@@ -152,14 +152,14 @@ public:
vboxLayout3->setSpacing(6);
#endif
vboxLayout3->setContentsMargins(0, 0, 0, 0);
- vboxLayout3->setObjectName(QStringLiteral("vboxLayout3"));
+ vboxLayout3->setObjectName(QString::fromUtf8("vboxLayout3"));
moveUpButton = new QPushButton(groupBox_2);
- moveUpButton->setObjectName(QStringLiteral("moveUpButton"));
+ moveUpButton->setObjectName(QString::fromUtf8("moveUpButton"));
vboxLayout3->addWidget(moveUpButton);
moveDownButton = new QPushButton(groupBox_2);
- moveDownButton->setObjectName(QStringLiteral("moveDownButton"));
+ moveDownButton->setObjectName(QString::fromUtf8("moveDownButton"));
vboxLayout3->addWidget(moveDownButton);
@@ -174,7 +174,7 @@ public:
vboxLayout2->addLayout(hboxLayout);
label = new QLabel(groupBox_2);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
label->setWordWrap(true);
vboxLayout2->addWidget(label);
@@ -187,18 +187,18 @@ public:
hboxLayout1->setSpacing(6);
#endif
hboxLayout1->setContentsMargins(0, 0, 0, 0);
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
spacerItem1 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout1->addItem(spacerItem1);
runButton = new QPushButton(databaseTranslationDialog);
- runButton->setObjectName(QStringLiteral("runButton"));
+ runButton->setObjectName(QString::fromUtf8("runButton"));
hboxLayout1->addWidget(runButton);
cancelButton = new QPushButton(databaseTranslationDialog);
- cancelButton->setObjectName(QStringLiteral("cancelButton"));
+ cancelButton->setObjectName(QString::fromUtf8("cancelButton"));
hboxLayout1->addWidget(cancelButton);
diff --git a/tests/auto/tools/uic/baseline/bookmarkdialog.ui.h b/tests/auto/tools/uic/baseline/bookmarkdialog.ui.h
index c2bb062bb8..b5a44998be 100644
--- a/tests/auto/tools/uic/baseline/bookmarkdialog.ui.h
+++ b/tests/auto/tools/uic/baseline/bookmarkdialog.ui.h
@@ -48,7 +48,7 @@ public:
void setupUi(QDialog *BookmarkDialog)
{
if (BookmarkDialog->objectName().isEmpty())
- BookmarkDialog->setObjectName(QStringLiteral("BookmarkDialog"));
+ BookmarkDialog->setObjectName(QString::fromUtf8("BookmarkDialog"));
BookmarkDialog->resize(450, 135);
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
sizePolicy.setHorizontalStretch(0);
@@ -56,18 +56,18 @@ public:
sizePolicy.setHeightForWidth(BookmarkDialog->sizePolicy().hasHeightForWidth());
BookmarkDialog->setSizePolicy(sizePolicy);
verticalLayout_3 = new QVBoxLayout(BookmarkDialog);
- verticalLayout_3->setObjectName(QStringLiteral("verticalLayout_3"));
+ verticalLayout_3->setObjectName(QString::fromUtf8("verticalLayout_3"));
horizontalLayout = new QHBoxLayout();
- horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
+ horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
verticalLayout_2 = new QVBoxLayout();
- verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2"));
+ verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2"));
label = new QLabel(BookmarkDialog);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
verticalLayout_2->addWidget(label);
label_2 = new QLabel(BookmarkDialog);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
verticalLayout_2->addWidget(label_2);
@@ -75,14 +75,14 @@ public:
horizontalLayout->addLayout(verticalLayout_2);
verticalLayout = new QVBoxLayout();
- verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
bookmarkEdit = new QLineEdit(BookmarkDialog);
- bookmarkEdit->setObjectName(QStringLiteral("bookmarkEdit"));
+ bookmarkEdit->setObjectName(QString::fromUtf8("bookmarkEdit"));
verticalLayout->addWidget(bookmarkEdit);
bookmarkFolders = new QComboBox(BookmarkDialog);
- bookmarkFolders->setObjectName(QStringLiteral("bookmarkFolders"));
+ bookmarkFolders->setObjectName(QString::fromUtf8("bookmarkFolders"));
verticalLayout->addWidget(bookmarkFolders);
@@ -93,15 +93,15 @@ public:
verticalLayout_3->addLayout(horizontalLayout);
horizontalLayout_3 = new QHBoxLayout();
- horizontalLayout_3->setObjectName(QStringLiteral("horizontalLayout_3"));
+ horizontalLayout_3->setObjectName(QString::fromUtf8("horizontalLayout_3"));
toolButton = new QToolButton(BookmarkDialog);
- toolButton->setObjectName(QStringLiteral("toolButton"));
+ toolButton->setObjectName(QString::fromUtf8("toolButton"));
toolButton->setMinimumSize(QSize(25, 20));
horizontalLayout_3->addWidget(toolButton);
line = new QFrame(BookmarkDialog);
- line->setObjectName(QStringLiteral("line"));
+ line->setObjectName(QString::fromUtf8("line"));
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
@@ -111,7 +111,7 @@ public:
verticalLayout_3->addLayout(horizontalLayout_3);
bookmarkWidget = new BookmarkWidget(BookmarkDialog);
- bookmarkWidget->setObjectName(QStringLiteral("bookmarkWidget"));
+ bookmarkWidget->setObjectName(QString::fromUtf8("bookmarkWidget"));
bookmarkWidget->setEnabled(true);
QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Ignored);
sizePolicy1.setHorizontalStretch(0);
@@ -122,14 +122,14 @@ public:
verticalLayout_3->addWidget(bookmarkWidget);
horizontalLayout_4 = new QHBoxLayout();
- horizontalLayout_4->setObjectName(QStringLiteral("horizontalLayout_4"));
+ horizontalLayout_4->setObjectName(QString::fromUtf8("horizontalLayout_4"));
newFolderButton = new QPushButton(BookmarkDialog);
- newFolderButton->setObjectName(QStringLiteral("newFolderButton"));
+ newFolderButton->setObjectName(QString::fromUtf8("newFolderButton"));
horizontalLayout_4->addWidget(newFolderButton);
buttonBox = new QDialogButtonBox(BookmarkDialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/bookwindow.ui.h b/tests/auto/tools/uic/baseline/bookwindow.ui.h
index 89b1e04c6c..8fe5f000e2 100644
--- a/tests/auto/tools/uic/baseline/bookwindow.ui.h
+++ b/tests/auto/tools/uic/baseline/bookwindow.ui.h
@@ -49,10 +49,10 @@ public:
void setupUi(QMainWindow *BookWindow)
{
if (BookWindow->objectName().isEmpty())
- BookWindow->setObjectName(QStringLiteral("BookWindow"));
+ BookWindow->setObjectName(QString::fromUtf8("BookWindow"));
BookWindow->resize(601, 420);
centralWidget = new QWidget(BookWindow);
- centralWidget->setObjectName(QStringLiteral("centralWidget"));
+ centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
vboxLayout = new QVBoxLayout(centralWidget);
#ifndef Q_OS_MAC
vboxLayout->setSpacing(6);
@@ -60,9 +60,9 @@ public:
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
groupBox = new QGroupBox(centralWidget);
- groupBox->setObjectName(QStringLiteral("groupBox"));
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
vboxLayout1 = new QVBoxLayout(groupBox);
#ifndef Q_OS_MAC
vboxLayout1->setSpacing(6);
@@ -70,57 +70,57 @@ public:
#ifndef Q_OS_MAC
vboxLayout1->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
bookTable = new QTableView(groupBox);
- bookTable->setObjectName(QStringLiteral("bookTable"));
+ bookTable->setObjectName(QString::fromUtf8("bookTable"));
bookTable->setSelectionBehavior(QAbstractItemView::SelectRows);
vboxLayout1->addWidget(bookTable);
groupBox_2 = new QGroupBox(groupBox);
- groupBox_2->setObjectName(QStringLiteral("groupBox_2"));
+ groupBox_2->setObjectName(QString::fromUtf8("groupBox_2"));
formLayout = new QFormLayout(groupBox_2);
- formLayout->setObjectName(QStringLiteral("formLayout"));
+ formLayout->setObjectName(QString::fromUtf8("formLayout"));
label_5 = new QLabel(groupBox_2);
- label_5->setObjectName(QStringLiteral("label_5"));
+ label_5->setObjectName(QString::fromUtf8("label_5"));
formLayout->setWidget(0, QFormLayout::LabelRole, label_5);
titleEdit = new QLineEdit(groupBox_2);
- titleEdit->setObjectName(QStringLiteral("titleEdit"));
+ titleEdit->setObjectName(QString::fromUtf8("titleEdit"));
titleEdit->setEnabled(true);
formLayout->setWidget(0, QFormLayout::FieldRole, titleEdit);
label_2_2_2_2 = new QLabel(groupBox_2);
- label_2_2_2_2->setObjectName(QStringLiteral("label_2_2_2_2"));
+ label_2_2_2_2->setObjectName(QString::fromUtf8("label_2_2_2_2"));
formLayout->setWidget(1, QFormLayout::LabelRole, label_2_2_2_2);
authorEdit = new QComboBox(groupBox_2);
- authorEdit->setObjectName(QStringLiteral("authorEdit"));
+ authorEdit->setObjectName(QString::fromUtf8("authorEdit"));
authorEdit->setEnabled(true);
formLayout->setWidget(1, QFormLayout::FieldRole, authorEdit);
label_3 = new QLabel(groupBox_2);
- label_3->setObjectName(QStringLiteral("label_3"));
+ label_3->setObjectName(QString::fromUtf8("label_3"));
formLayout->setWidget(2, QFormLayout::LabelRole, label_3);
genreEdit = new QComboBox(groupBox_2);
- genreEdit->setObjectName(QStringLiteral("genreEdit"));
+ genreEdit->setObjectName(QString::fromUtf8("genreEdit"));
genreEdit->setEnabled(true);
formLayout->setWidget(2, QFormLayout::FieldRole, genreEdit);
label_4 = new QLabel(groupBox_2);
- label_4->setObjectName(QStringLiteral("label_4"));
+ label_4->setObjectName(QString::fromUtf8("label_4"));
formLayout->setWidget(3, QFormLayout::LabelRole, label_4);
yearEdit = new QSpinBox(groupBox_2);
- yearEdit->setObjectName(QStringLiteral("yearEdit"));
+ yearEdit->setObjectName(QString::fromUtf8("yearEdit"));
yearEdit->setEnabled(true);
yearEdit->setMaximum(2100);
yearEdit->setMinimum(-1000);
@@ -128,12 +128,12 @@ public:
formLayout->setWidget(3, QFormLayout::FieldRole, yearEdit);
label = new QLabel(groupBox_2);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
formLayout->setWidget(4, QFormLayout::LabelRole, label);
ratingEdit = new QSpinBox(groupBox_2);
- ratingEdit->setObjectName(QStringLiteral("ratingEdit"));
+ ratingEdit->setObjectName(QString::fromUtf8("ratingEdit"));
ratingEdit->setMaximum(5);
formLayout->setWidget(4, QFormLayout::FieldRole, ratingEdit);
diff --git a/tests/auto/tools/uic/baseline/browserwidget.ui.h b/tests/auto/tools/uic/baseline/browserwidget.ui.h
index 491f51ce94..3db93c34cf 100644
--- a/tests/auto/tools/uic/baseline/browserwidget.ui.h
+++ b/tests/auto/tools/uic/baseline/browserwidget.ui.h
@@ -46,22 +46,22 @@ public:
void setupUi(QWidget *Browser)
{
if (Browser->objectName().isEmpty())
- Browser->setObjectName(QStringLiteral("Browser"));
+ Browser->setObjectName(QString::fromUtf8("Browser"));
Browser->resize(765, 515);
insertRowAction = new QAction(Browser);
- insertRowAction->setObjectName(QStringLiteral("insertRowAction"));
+ insertRowAction->setObjectName(QString::fromUtf8("insertRowAction"));
insertRowAction->setEnabled(false);
deleteRowAction = new QAction(Browser);
- deleteRowAction->setObjectName(QStringLiteral("deleteRowAction"));
+ deleteRowAction->setObjectName(QString::fromUtf8("deleteRowAction"));
deleteRowAction->setEnabled(false);
vboxLayout = new QVBoxLayout(Browser);
#ifndef Q_OS_MAC
vboxLayout->setSpacing(6);
#endif
vboxLayout->setContentsMargins(8, 8, 8, 8);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
splitter_2 = new QSplitter(Browser);
- splitter_2->setObjectName(QStringLiteral("splitter_2"));
+ splitter_2->setObjectName(QString::fromUtf8("splitter_2"));
QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(7), static_cast<QSizePolicy::Policy>(7));
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -69,7 +69,7 @@ public:
splitter_2->setSizePolicy(sizePolicy);
splitter_2->setOrientation(Qt::Horizontal);
connectionWidget = new ConnectionWidget(splitter_2);
- connectionWidget->setObjectName(QStringLiteral("connectionWidget"));
+ connectionWidget->setObjectName(QString::fromUtf8("connectionWidget"));
QSizePolicy sizePolicy1(static_cast<QSizePolicy::Policy>(13), static_cast<QSizePolicy::Policy>(7));
sizePolicy1.setHorizontalStretch(1);
sizePolicy1.setVerticalStretch(0);
@@ -77,7 +77,7 @@ public:
connectionWidget->setSizePolicy(sizePolicy1);
splitter_2->addWidget(connectionWidget);
table = new QTableView(splitter_2);
- table->setObjectName(QStringLiteral("table"));
+ table->setObjectName(QString::fromUtf8("table"));
QSizePolicy sizePolicy2(static_cast<QSizePolicy::Policy>(7), static_cast<QSizePolicy::Policy>(7));
sizePolicy2.setHorizontalStretch(2);
sizePolicy2.setVerticalStretch(0);
@@ -90,7 +90,7 @@ public:
vboxLayout->addWidget(splitter_2);
groupBox = new QGroupBox(Browser);
- groupBox->setObjectName(QStringLiteral("groupBox"));
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
QSizePolicy sizePolicy3(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(3));
sizePolicy3.setHorizontalStretch(0);
sizePolicy3.setVerticalStretch(0);
@@ -104,9 +104,9 @@ public:
#ifndef Q_OS_MAC
vboxLayout1->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
sqlEdit = new QTextEdit(groupBox);
- sqlEdit->setObjectName(QStringLiteral("sqlEdit"));
+ sqlEdit->setObjectName(QString::fromUtf8("sqlEdit"));
QSizePolicy sizePolicy4(static_cast<QSizePolicy::Policy>(7), static_cast<QSizePolicy::Policy>(3));
sizePolicy4.setHorizontalStretch(0);
sizePolicy4.setVerticalStretch(0);
@@ -122,18 +122,18 @@ public:
hboxLayout->setSpacing(6);
#endif
hboxLayout->setContentsMargins(1, 1, 1, 1);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
spacerItem = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout->addItem(spacerItem);
clearButton = new QPushButton(groupBox);
- clearButton->setObjectName(QStringLiteral("clearButton"));
+ clearButton->setObjectName(QString::fromUtf8("clearButton"));
hboxLayout->addWidget(clearButton);
submitButton = new QPushButton(groupBox);
- submitButton->setObjectName(QStringLiteral("submitButton"));
+ submitButton->setObjectName(QString::fromUtf8("submitButton"));
hboxLayout->addWidget(submitButton);
diff --git a/tests/auto/tools/uic/baseline/bug18156QTreeWidget.ui.h b/tests/auto/tools/uic/baseline/bug18156QTreeWidget.ui.h
index 5a545485e3..47f8f22132 100644
--- a/tests/auto/tools/uic/baseline/bug18156QTreeWidget.ui.h
+++ b/tests/auto/tools/uic/baseline/bug18156QTreeWidget.ui.h
@@ -29,19 +29,19 @@ public:
void setupUi(QDialog *Dialog)
{
if (Dialog->objectName().isEmpty())
- Dialog->setObjectName(QStringLiteral("Dialog"));
+ Dialog->setObjectName(QString::fromUtf8("Dialog"));
Dialog->resize(400, 300);
gridLayout = new QGridLayout(Dialog);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
treeWidget = new QTreeWidget(Dialog);
treeWidget->headerItem()->setText(0, QString());
treeWidget->headerItem()->setText(2, QString());
- treeWidget->setObjectName(QStringLiteral("treeWidget"));
+ treeWidget->setObjectName(QString::fromUtf8("treeWidget"));
gridLayout->addWidget(treeWidget, 0, 0, 1, 1);
buttonBox = new QDialogButtonBox(Dialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/buttongroup.ui.h b/tests/auto/tools/uic/baseline/buttongroup.ui.h
index 38029df7ec..87814dcba1 100644
--- a/tests/auto/tools/uic/baseline/buttongroup.ui.h
+++ b/tests/auto/tools/uic/baseline/buttongroup.ui.h
@@ -1,7 +1,7 @@
/********************************************************************************
** Form generated from reading UI file 'buttongroup.ui'
**
-** Created by: Qt User Interface Compiler version 5.10.1
+** Created by: Qt User Interface Compiler version 5.12.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
@@ -51,12 +51,12 @@ public:
void setupUi(QWidget *Form)
{
if (Form->objectName().isEmpty())
- Form->setObjectName(QStringLiteral("Form"));
+ Form->setObjectName(QString::fromUtf8("Form"));
Form->resize(545, 471);
gridLayout = new QGridLayout(Form);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
easingCurvePicker = new QListWidget(Form);
- easingCurvePicker->setObjectName(QStringLiteral("easingCurvePicker"));
+ easingCurvePicker->setObjectName(QString::fromUtf8("easingCurvePicker"));
QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -72,17 +72,17 @@ public:
gridLayout->addWidget(easingCurvePicker, 0, 0, 1, 2);
verticalLayout = new QVBoxLayout();
- verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
groupBox_2 = new QGroupBox(Form);
- groupBox_2->setObjectName(QStringLiteral("groupBox_2"));
+ groupBox_2->setObjectName(QString::fromUtf8("groupBox_2"));
groupBox_2->setMaximumSize(QSize(16777215, 16777215));
gridLayout_2 = new QGridLayout(groupBox_2);
- gridLayout_2->setObjectName(QStringLiteral("gridLayout_2"));
+ gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
lineRadio = new QRadioButton(groupBox_2);
buttonGroup = new QButtonGroup(Form);
- buttonGroup->setObjectName(QStringLiteral("buttonGroup"));
+ buttonGroup->setObjectName(QString::fromUtf8("buttonGroup"));
buttonGroup->addButton(lineRadio);
- lineRadio->setObjectName(QStringLiteral("lineRadio"));
+ lineRadio->setObjectName(QString::fromUtf8("lineRadio"));
lineRadio->setMaximumSize(QSize(16777215, 40));
lineRadio->setLayoutDirection(Qt::LeftToRight);
lineRadio->setChecked(true);
@@ -91,7 +91,7 @@ public:
circleRadio = new QRadioButton(groupBox_2);
buttonGroup->addButton(circleRadio);
- circleRadio->setObjectName(QStringLiteral("circleRadio"));
+ circleRadio->setObjectName(QString::fromUtf8("circleRadio"));
circleRadio->setMaximumSize(QSize(16777215, 40));
gridLayout_2->addWidget(circleRadio, 1, 0, 1, 1);
@@ -100,17 +100,17 @@ public:
verticalLayout->addWidget(groupBox_2);
groupBox = new QGroupBox(Form);
- groupBox->setObjectName(QStringLiteral("groupBox"));
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Preferred);
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
sizePolicy1.setHeightForWidth(groupBox->sizePolicy().hasHeightForWidth());
groupBox->setSizePolicy(sizePolicy1);
formLayout = new QFormLayout(groupBox);
- formLayout->setObjectName(QStringLiteral("formLayout"));
+ formLayout->setObjectName(QString::fromUtf8("formLayout"));
formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
label = new QLabel(groupBox);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
QSizePolicy sizePolicy2(QSizePolicy::Preferred, QSizePolicy::Preferred);
sizePolicy2.setHorizontalStretch(0);
sizePolicy2.setVerticalStretch(0);
@@ -121,7 +121,7 @@ public:
formLayout->setWidget(0, QFormLayout::LabelRole, label);
periodSpinBox = new QDoubleSpinBox(groupBox);
- periodSpinBox->setObjectName(QStringLiteral("periodSpinBox"));
+ periodSpinBox->setObjectName(QString::fromUtf8("periodSpinBox"));
periodSpinBox->setEnabled(false);
QSizePolicy sizePolicy3(QSizePolicy::Minimum, QSizePolicy::Fixed);
sizePolicy3.setHorizontalStretch(0);
@@ -129,40 +129,40 @@ public:
sizePolicy3.setHeightForWidth(periodSpinBox->sizePolicy().hasHeightForWidth());
periodSpinBox->setSizePolicy(sizePolicy3);
periodSpinBox->setMinimumSize(QSize(0, 30));
- periodSpinBox->setMinimum(-1);
- periodSpinBox->setSingleStep(0.1);
- periodSpinBox->setValue(-1);
+ periodSpinBox->setMinimum(-1.000000000000000);
+ periodSpinBox->setSingleStep(0.100000000000000);
+ periodSpinBox->setValue(-1.000000000000000);
formLayout->setWidget(0, QFormLayout::FieldRole, periodSpinBox);
amplitudeSpinBox = new QDoubleSpinBox(groupBox);
- amplitudeSpinBox->setObjectName(QStringLiteral("amplitudeSpinBox"));
+ amplitudeSpinBox->setObjectName(QString::fromUtf8("amplitudeSpinBox"));
amplitudeSpinBox->setEnabled(false);
amplitudeSpinBox->setMinimumSize(QSize(0, 30));
- amplitudeSpinBox->setMinimum(-1);
- amplitudeSpinBox->setSingleStep(0.1);
- amplitudeSpinBox->setValue(-1);
+ amplitudeSpinBox->setMinimum(-1.000000000000000);
+ amplitudeSpinBox->setSingleStep(0.100000000000000);
+ amplitudeSpinBox->setValue(-1.000000000000000);
formLayout->setWidget(2, QFormLayout::FieldRole, amplitudeSpinBox);
label_3 = new QLabel(groupBox);
- label_3->setObjectName(QStringLiteral("label_3"));
+ label_3->setObjectName(QString::fromUtf8("label_3"));
label_3->setMinimumSize(QSize(0, 30));
formLayout->setWidget(4, QFormLayout::LabelRole, label_3);
overshootSpinBox = new QDoubleSpinBox(groupBox);
- overshootSpinBox->setObjectName(QStringLiteral("overshootSpinBox"));
+ overshootSpinBox->setObjectName(QString::fromUtf8("overshootSpinBox"));
overshootSpinBox->setEnabled(false);
overshootSpinBox->setMinimumSize(QSize(0, 30));
- overshootSpinBox->setMinimum(-1);
- overshootSpinBox->setSingleStep(0.1);
- overshootSpinBox->setValue(-1);
+ overshootSpinBox->setMinimum(-1.000000000000000);
+ overshootSpinBox->setSingleStep(0.100000000000000);
+ overshootSpinBox->setValue(-1.000000000000000);
formLayout->setWidget(4, QFormLayout::FieldRole, overshootSpinBox);
label_2 = new QLabel(groupBox);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
label_2->setMinimumSize(QSize(0, 30));
formLayout->setWidget(2, QFormLayout::LabelRole, label_2);
@@ -178,7 +178,7 @@ public:
gridLayout->addLayout(verticalLayout, 1, 0, 1, 1);
graphicsView = new QGraphicsView(Form);
- graphicsView->setObjectName(QStringLiteral("graphicsView"));
+ graphicsView->setObjectName(QString::fromUtf8("graphicsView"));
QSizePolicy sizePolicy4(QSizePolicy::Expanding, QSizePolicy::Expanding);
sizePolicy4.setHorizontalStretch(0);
sizePolicy4.setVerticalStretch(0);
diff --git a/tests/auto/tools/uic/baseline/calculator.ui.h b/tests/auto/tools/uic/baseline/calculator.ui.h
index ad738d7afc..0387ee472b 100644
--- a/tests/auto/tools/uic/baseline/calculator.ui.h
+++ b/tests/auto/tools/uic/baseline/calculator.ui.h
@@ -52,7 +52,7 @@ public:
void setupUi(QWidget *Calculator)
{
if (Calculator->objectName().isEmpty())
- Calculator->setObjectName(QStringLiteral("Calculator"));
+ Calculator->setObjectName(QString::fromUtf8("Calculator"));
Calculator->resize(314, 301);
QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
sizePolicy.setHorizontalStretch(0);
@@ -62,88 +62,88 @@ public:
Calculator->setMinimumSize(QSize(314, 301));
Calculator->setMaximumSize(QSize(314, 301));
backspaceButton = new QToolButton(Calculator);
- backspaceButton->setObjectName(QStringLiteral("backspaceButton"));
+ backspaceButton->setObjectName(QString::fromUtf8("backspaceButton"));
backspaceButton->setGeometry(QRect(10, 50, 91, 41));
clearButton = new QToolButton(Calculator);
- clearButton->setObjectName(QStringLiteral("clearButton"));
+ clearButton->setObjectName(QString::fromUtf8("clearButton"));
clearButton->setGeometry(QRect(110, 50, 91, 41));
clearAllButton = new QToolButton(Calculator);
- clearAllButton->setObjectName(QStringLiteral("clearAllButton"));
+ clearAllButton->setObjectName(QString::fromUtf8("clearAllButton"));
clearAllButton->setGeometry(QRect(210, 50, 91, 41));
clearMemoryButton = new QToolButton(Calculator);
- clearMemoryButton->setObjectName(QStringLiteral("clearMemoryButton"));
+ clearMemoryButton->setObjectName(QString::fromUtf8("clearMemoryButton"));
clearMemoryButton->setGeometry(QRect(10, 100, 41, 41));
readMemoryButton = new QToolButton(Calculator);
- readMemoryButton->setObjectName(QStringLiteral("readMemoryButton"));
+ readMemoryButton->setObjectName(QString::fromUtf8("readMemoryButton"));
readMemoryButton->setGeometry(QRect(10, 150, 41, 41));
setMemoryButton = new QToolButton(Calculator);
- setMemoryButton->setObjectName(QStringLiteral("setMemoryButton"));
+ setMemoryButton->setObjectName(QString::fromUtf8("setMemoryButton"));
setMemoryButton->setGeometry(QRect(10, 200, 41, 41));
addToMemoryButton = new QToolButton(Calculator);
- addToMemoryButton->setObjectName(QStringLiteral("addToMemoryButton"));
+ addToMemoryButton->setObjectName(QString::fromUtf8("addToMemoryButton"));
addToMemoryButton->setGeometry(QRect(10, 250, 41, 41));
sevenButton = new QToolButton(Calculator);
- sevenButton->setObjectName(QStringLiteral("sevenButton"));
+ sevenButton->setObjectName(QString::fromUtf8("sevenButton"));
sevenButton->setGeometry(QRect(60, 100, 41, 41));
eightButton = new QToolButton(Calculator);
- eightButton->setObjectName(QStringLiteral("eightButton"));
+ eightButton->setObjectName(QString::fromUtf8("eightButton"));
eightButton->setGeometry(QRect(110, 100, 41, 41));
nineButton = new QToolButton(Calculator);
- nineButton->setObjectName(QStringLiteral("nineButton"));
+ nineButton->setObjectName(QString::fromUtf8("nineButton"));
nineButton->setGeometry(QRect(160, 100, 41, 41));
fourButton = new QToolButton(Calculator);
- fourButton->setObjectName(QStringLiteral("fourButton"));
+ fourButton->setObjectName(QString::fromUtf8("fourButton"));
fourButton->setGeometry(QRect(60, 150, 41, 41));
fiveButton = new QToolButton(Calculator);
- fiveButton->setObjectName(QStringLiteral("fiveButton"));
+ fiveButton->setObjectName(QString::fromUtf8("fiveButton"));
fiveButton->setGeometry(QRect(110, 150, 41, 41));
sixButton = new QToolButton(Calculator);
- sixButton->setObjectName(QStringLiteral("sixButton"));
+ sixButton->setObjectName(QString::fromUtf8("sixButton"));
sixButton->setGeometry(QRect(160, 150, 41, 41));
oneButton = new QToolButton(Calculator);
- oneButton->setObjectName(QStringLiteral("oneButton"));
+ oneButton->setObjectName(QString::fromUtf8("oneButton"));
oneButton->setGeometry(QRect(60, 200, 41, 41));
twoButton = new QToolButton(Calculator);
- twoButton->setObjectName(QStringLiteral("twoButton"));
+ twoButton->setObjectName(QString::fromUtf8("twoButton"));
twoButton->setGeometry(QRect(110, 200, 41, 41));
threeButton = new QToolButton(Calculator);
- threeButton->setObjectName(QStringLiteral("threeButton"));
+ threeButton->setObjectName(QString::fromUtf8("threeButton"));
threeButton->setGeometry(QRect(160, 200, 41, 41));
zeroButton = new QToolButton(Calculator);
- zeroButton->setObjectName(QStringLiteral("zeroButton"));
+ zeroButton->setObjectName(QString::fromUtf8("zeroButton"));
zeroButton->setGeometry(QRect(60, 250, 41, 41));
pointButton = new QToolButton(Calculator);
- pointButton->setObjectName(QStringLiteral("pointButton"));
+ pointButton->setObjectName(QString::fromUtf8("pointButton"));
pointButton->setGeometry(QRect(110, 250, 41, 41));
changeSignButton = new QToolButton(Calculator);
- changeSignButton->setObjectName(QStringLiteral("changeSignButton"));
+ changeSignButton->setObjectName(QString::fromUtf8("changeSignButton"));
changeSignButton->setGeometry(QRect(160, 250, 41, 41));
plusButton = new QToolButton(Calculator);
- plusButton->setObjectName(QStringLiteral("plusButton"));
+ plusButton->setObjectName(QString::fromUtf8("plusButton"));
plusButton->setGeometry(QRect(210, 250, 41, 41));
divisionButton = new QToolButton(Calculator);
- divisionButton->setObjectName(QStringLiteral("divisionButton"));
+ divisionButton->setObjectName(QString::fromUtf8("divisionButton"));
divisionButton->setGeometry(QRect(210, 100, 41, 41));
timesButton = new QToolButton(Calculator);
- timesButton->setObjectName(QStringLiteral("timesButton"));
+ timesButton->setObjectName(QString::fromUtf8("timesButton"));
timesButton->setGeometry(QRect(210, 150, 41, 41));
minusButton = new QToolButton(Calculator);
- minusButton->setObjectName(QStringLiteral("minusButton"));
+ minusButton->setObjectName(QString::fromUtf8("minusButton"));
minusButton->setGeometry(QRect(210, 200, 41, 41));
squareRootButton = new QToolButton(Calculator);
- squareRootButton->setObjectName(QStringLiteral("squareRootButton"));
+ squareRootButton->setObjectName(QString::fromUtf8("squareRootButton"));
squareRootButton->setGeometry(QRect(260, 100, 41, 41));
powerButton = new QToolButton(Calculator);
- powerButton->setObjectName(QStringLiteral("powerButton"));
+ powerButton->setObjectName(QString::fromUtf8("powerButton"));
powerButton->setGeometry(QRect(260, 150, 41, 41));
reciprocalButton = new QToolButton(Calculator);
- reciprocalButton->setObjectName(QStringLiteral("reciprocalButton"));
+ reciprocalButton->setObjectName(QString::fromUtf8("reciprocalButton"));
reciprocalButton->setGeometry(QRect(260, 200, 41, 41));
equalButton = new QToolButton(Calculator);
- equalButton->setObjectName(QStringLiteral("equalButton"));
+ equalButton->setObjectName(QString::fromUtf8("equalButton"));
equalButton->setGeometry(QRect(260, 250, 41, 41));
display = new QLineEdit(Calculator);
- display->setObjectName(QStringLiteral("display"));
+ display->setObjectName(QString::fromUtf8("display"));
display->setGeometry(QRect(10, 10, 291, 31));
display->setMaxLength(15);
display->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
diff --git a/tests/auto/tools/uic/baseline/calculatorform.ui.h b/tests/auto/tools/uic/baseline/calculatorform.ui.h
index ced29d5eab..f4661c6237 100644
--- a/tests/auto/tools/uic/baseline/calculatorform.ui.h
+++ b/tests/auto/tools/uic/baseline/calculatorform.ui.h
@@ -43,7 +43,7 @@ public:
void setupUi(QWidget *CalculatorForm)
{
if (CalculatorForm->objectName().isEmpty())
- CalculatorForm->setObjectName(QStringLiteral("CalculatorForm"));
+ CalculatorForm->setObjectName(QString::fromUtf8("CalculatorForm"));
CalculatorForm->resize(276, 98);
QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(5));
sizePolicy.setHorizontalStretch(0);
@@ -57,30 +57,30 @@ public:
#ifndef Q_OS_MAC
gridLayout->setContentsMargins(9, 9, 9, 9);
#endif
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
- gridLayout->setObjectName(QStringLiteral(""));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8(""));
hboxLayout = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout->setSpacing(6);
#endif
hboxLayout->setContentsMargins(1, 1, 1, 1);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
- hboxLayout->setObjectName(QStringLiteral(""));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8(""));
vboxLayout = new QVBoxLayout();
#ifndef Q_OS_MAC
vboxLayout->setSpacing(6);
#endif
vboxLayout->setContentsMargins(1, 1, 1, 1);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
- vboxLayout->setObjectName(QStringLiteral(""));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8(""));
label = new QLabel(CalculatorForm);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
label->setGeometry(QRect(1, 1, 45, 19));
vboxLayout->addWidget(label);
inputSpinBox1 = new QSpinBox(CalculatorForm);
- inputSpinBox1->setObjectName(QStringLiteral("inputSpinBox1"));
+ inputSpinBox1->setObjectName(QString::fromUtf8("inputSpinBox1"));
inputSpinBox1->setGeometry(QRect(1, 26, 45, 25));
inputSpinBox1->setMouseTracking(true);
@@ -90,7 +90,7 @@ public:
hboxLayout->addLayout(vboxLayout);
label_3 = new QLabel(CalculatorForm);
- label_3->setObjectName(QStringLiteral("label_3"));
+ label_3->setObjectName(QString::fromUtf8("label_3"));
label_3->setGeometry(QRect(54, 1, 7, 52));
label_3->setAlignment(Qt::AlignCenter);
@@ -101,16 +101,16 @@ public:
vboxLayout1->setSpacing(6);
#endif
vboxLayout1->setContentsMargins(1, 1, 1, 1);
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
- vboxLayout1->setObjectName(QStringLiteral(""));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8(""));
label_2 = new QLabel(CalculatorForm);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
label_2->setGeometry(QRect(1, 1, 45, 19));
vboxLayout1->addWidget(label_2);
inputSpinBox2 = new QSpinBox(CalculatorForm);
- inputSpinBox2->setObjectName(QStringLiteral("inputSpinBox2"));
+ inputSpinBox2->setObjectName(QString::fromUtf8("inputSpinBox2"));
inputSpinBox2->setGeometry(QRect(1, 26, 45, 25));
inputSpinBox2->setMouseTracking(true);
@@ -120,7 +120,7 @@ public:
hboxLayout->addLayout(vboxLayout1);
label_3_2 = new QLabel(CalculatorForm);
- label_3_2->setObjectName(QStringLiteral("label_3_2"));
+ label_3_2->setObjectName(QString::fromUtf8("label_3_2"));
label_3_2->setGeometry(QRect(120, 1, 7, 52));
label_3_2->setAlignment(Qt::AlignCenter);
@@ -131,16 +131,16 @@ public:
vboxLayout2->setSpacing(6);
#endif
vboxLayout2->setContentsMargins(1, 1, 1, 1);
- vboxLayout2->setObjectName(QStringLiteral("vboxLayout2"));
- vboxLayout2->setObjectName(QStringLiteral(""));
+ vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2"));
+ vboxLayout2->setObjectName(QString::fromUtf8(""));
label_2_2_2 = new QLabel(CalculatorForm);
- label_2_2_2->setObjectName(QStringLiteral("label_2_2_2"));
+ label_2_2_2->setObjectName(QString::fromUtf8("label_2_2_2"));
label_2_2_2->setGeometry(QRect(1, 1, 37, 17));
vboxLayout2->addWidget(label_2_2_2);
outputWidget = new QLabel(CalculatorForm);
- outputWidget->setObjectName(QStringLiteral("outputWidget"));
+ outputWidget->setObjectName(QString::fromUtf8("outputWidget"));
outputWidget->setGeometry(QRect(1, 24, 37, 27));
outputWidget->setFrameShape(QFrame::Box);
outputWidget->setFrameShadow(QFrame::Sunken);
diff --git a/tests/auto/tools/uic/baseline/certificateinfo.ui.h b/tests/auto/tools/uic/baseline/certificateinfo.ui.h
index 07263bcdd7..2aa47d40ad 100644
--- a/tests/auto/tools/uic/baseline/certificateinfo.ui.h
+++ b/tests/auto/tools/uic/baseline/certificateinfo.ui.h
@@ -38,16 +38,16 @@ public:
void setupUi(QDialog *CertificateInfo)
{
if (CertificateInfo->objectName().isEmpty())
- CertificateInfo->setObjectName(QStringLiteral("CertificateInfo"));
+ CertificateInfo->setObjectName(QString::fromUtf8("CertificateInfo"));
CertificateInfo->resize(400, 397);
vboxLayout = new QVBoxLayout(CertificateInfo);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
groupBox = new QGroupBox(CertificateInfo);
- groupBox->setObjectName(QStringLiteral("groupBox"));
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
hboxLayout = new QHBoxLayout(groupBox);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
certificationPathView = new QListWidget(groupBox);
- certificationPathView->setObjectName(QStringLiteral("certificationPathView"));
+ certificationPathView->setObjectName(QString::fromUtf8("certificationPathView"));
hboxLayout->addWidget(certificationPathView);
@@ -55,11 +55,11 @@ public:
vboxLayout->addWidget(groupBox);
groupBox_2 = new QGroupBox(CertificateInfo);
- groupBox_2->setObjectName(QStringLiteral("groupBox_2"));
+ groupBox_2->setObjectName(QString::fromUtf8("groupBox_2"));
hboxLayout1 = new QHBoxLayout(groupBox_2);
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
certificateInfoView = new QListWidget(groupBox_2);
- certificateInfoView->setObjectName(QStringLiteral("certificateInfoView"));
+ certificateInfoView->setObjectName(QString::fromUtf8("certificateInfoView"));
hboxLayout1->addWidget(certificateInfoView);
@@ -67,13 +67,13 @@ public:
vboxLayout->addWidget(groupBox_2);
hboxLayout2 = new QHBoxLayout();
- hboxLayout2->setObjectName(QStringLiteral("hboxLayout2"));
+ hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2"));
spacerItem = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout2->addItem(spacerItem);
buttonBox = new QDialogButtonBox(CertificateInfo);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setStandardButtons(QDialogButtonBox::Close);
hboxLayout2->addWidget(buttonBox);
diff --git a/tests/auto/tools/uic/baseline/chatdialog.ui.h b/tests/auto/tools/uic/baseline/chatdialog.ui.h
index 32b083fbc4..ace6951669 100644
--- a/tests/auto/tools/uic/baseline/chatdialog.ui.h
+++ b/tests/auto/tools/uic/baseline/chatdialog.ui.h
@@ -35,7 +35,7 @@ public:
void setupUi(QDialog *ChatDialog)
{
if (ChatDialog->objectName().isEmpty())
- ChatDialog->setObjectName(QStringLiteral("ChatDialog"));
+ ChatDialog->setObjectName(QString::fromUtf8("ChatDialog"));
ChatDialog->resize(513, 349);
vboxLayout = new QVBoxLayout(ChatDialog);
#ifndef Q_OS_MAC
@@ -44,7 +44,7 @@ public:
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
hboxLayout = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout->setSpacing(6);
@@ -52,16 +52,16 @@ public:
#ifndef Q_OS_MAC
hboxLayout->setContentsMargins(0, 0, 0, 0);
#endif
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
textEdit = new QTextEdit(ChatDialog);
- textEdit->setObjectName(QStringLiteral("textEdit"));
+ textEdit->setObjectName(QString::fromUtf8("textEdit"));
textEdit->setFocusPolicy(Qt::NoFocus);
textEdit->setReadOnly(true);
hboxLayout->addWidget(textEdit);
listWidget = new QListWidget(ChatDialog);
- listWidget->setObjectName(QStringLiteral("listWidget"));
+ listWidget->setObjectName(QString::fromUtf8("listWidget"));
listWidget->setMaximumSize(QSize(180, 16777215));
listWidget->setFocusPolicy(Qt::NoFocus);
@@ -75,14 +75,14 @@ public:
hboxLayout1->setSpacing(6);
#endif
hboxLayout1->setContentsMargins(0, 0, 0, 0);
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
label = new QLabel(ChatDialog);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
hboxLayout1->addWidget(label);
lineEdit = new QLineEdit(ChatDialog);
- lineEdit->setObjectName(QStringLiteral("lineEdit"));
+ lineEdit->setObjectName(QString::fromUtf8("lineEdit"));
hboxLayout1->addWidget(lineEdit);
diff --git a/tests/auto/tools/uic/baseline/chatmainwindow.ui.h b/tests/auto/tools/uic/baseline/chatmainwindow.ui.h
index 921eb376de..8d4ccd53ae 100644
--- a/tests/auto/tools/uic/baseline/chatmainwindow.ui.h
+++ b/tests/auto/tools/uic/baseline/chatmainwindow.ui.h
@@ -48,16 +48,16 @@ public:
void setupUi(QMainWindow *ChatMainWindow)
{
if (ChatMainWindow->objectName().isEmpty())
- ChatMainWindow->setObjectName(QStringLiteral("ChatMainWindow"));
+ ChatMainWindow->setObjectName(QString::fromUtf8("ChatMainWindow"));
ChatMainWindow->resize(800, 600);
actionQuit = new QAction(ChatMainWindow);
- actionQuit->setObjectName(QStringLiteral("actionQuit"));
+ actionQuit->setObjectName(QString::fromUtf8("actionQuit"));
actionAboutQt = new QAction(ChatMainWindow);
- actionAboutQt->setObjectName(QStringLiteral("actionAboutQt"));
+ actionAboutQt->setObjectName(QString::fromUtf8("actionAboutQt"));
actionChangeNickname = new QAction(ChatMainWindow);
- actionChangeNickname->setObjectName(QStringLiteral("actionChangeNickname"));
+ actionChangeNickname->setObjectName(QString::fromUtf8("actionChangeNickname"));
centralwidget = new QWidget(ChatMainWindow);
- centralwidget->setObjectName(QStringLiteral("centralwidget"));
+ centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
hboxLayout = new QHBoxLayout(centralwidget);
#ifndef Q_OS_MAC
hboxLayout->setSpacing(6);
@@ -65,7 +65,7 @@ public:
#ifndef Q_OS_MAC
hboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
vboxLayout = new QVBoxLayout();
#ifndef Q_OS_MAC
vboxLayout->setSpacing(6);
@@ -73,9 +73,9 @@ public:
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(0, 0, 0, 0);
#endif
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
chatHistory = new QTextBrowser(centralwidget);
- chatHistory->setObjectName(QStringLiteral("chatHistory"));
+ chatHistory->setObjectName(QString::fromUtf8("chatHistory"));
chatHistory->setAcceptDrops(false);
chatHistory->setAcceptRichText(true);
@@ -86,19 +86,19 @@ public:
hboxLayout1->setSpacing(6);
#endif
hboxLayout1->setContentsMargins(0, 0, 0, 0);
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
label = new QLabel(centralwidget);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
hboxLayout1->addWidget(label);
messageLineEdit = new QLineEdit(centralwidget);
- messageLineEdit->setObjectName(QStringLiteral("messageLineEdit"));
+ messageLineEdit->setObjectName(QString::fromUtf8("messageLineEdit"));
hboxLayout1->addWidget(messageLineEdit);
sendButton = new QPushButton(centralwidget);
- sendButton->setObjectName(QStringLiteral("sendButton"));
+ sendButton->setObjectName(QString::fromUtf8("sendButton"));
QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(1), static_cast<QSizePolicy::Policy>(0));
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -115,15 +115,15 @@ public:
ChatMainWindow->setCentralWidget(centralwidget);
menubar = new QMenuBar(ChatMainWindow);
- menubar->setObjectName(QStringLiteral("menubar"));
+ menubar->setObjectName(QString::fromUtf8("menubar"));
menubar->setGeometry(QRect(0, 0, 800, 31));
menuQuit = new QMenu(menubar);
- menuQuit->setObjectName(QStringLiteral("menuQuit"));
+ menuQuit->setObjectName(QString::fromUtf8("menuQuit"));
menuFile = new QMenu(menubar);
- menuFile->setObjectName(QStringLiteral("menuFile"));
+ menuFile->setObjectName(QString::fromUtf8("menuFile"));
ChatMainWindow->setMenuBar(menubar);
statusbar = new QStatusBar(ChatMainWindow);
- statusbar->setObjectName(QStringLiteral("statusbar"));
+ statusbar->setObjectName(QString::fromUtf8("statusbar"));
ChatMainWindow->setStatusBar(statusbar);
#ifndef QT_NO_SHORTCUT
label->setBuddy(messageLineEdit);
diff --git a/tests/auto/tools/uic/baseline/chatsetnickname.ui.h b/tests/auto/tools/uic/baseline/chatsetnickname.ui.h
index 6aaa47f84e..c73dfb2c6e 100644
--- a/tests/auto/tools/uic/baseline/chatsetnickname.ui.h
+++ b/tests/auto/tools/uic/baseline/chatsetnickname.ui.h
@@ -37,7 +37,7 @@ public:
void setupUi(QDialog *NicknameDialog)
{
if (NicknameDialog->objectName().isEmpty())
- NicknameDialog->setObjectName(QStringLiteral("NicknameDialog"));
+ NicknameDialog->setObjectName(QString::fromUtf8("NicknameDialog"));
NicknameDialog->resize(396, 105);
QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(1), static_cast<QSizePolicy::Policy>(1));
sizePolicy.setHorizontalStretch(0);
@@ -51,7 +51,7 @@ public:
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
vboxLayout1 = new QVBoxLayout();
#ifndef Q_OS_MAC
vboxLayout1->setSpacing(6);
@@ -59,16 +59,16 @@ public:
#ifndef Q_OS_MAC
vboxLayout1->setContentsMargins(0, 0, 0, 0);
#endif
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
label = new QLabel(NicknameDialog);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
sizePolicy.setHeightForWidth(label->sizePolicy().hasHeightForWidth());
label->setSizePolicy(sizePolicy);
vboxLayout1->addWidget(label);
nickname = new QLineEdit(NicknameDialog);
- nickname->setObjectName(QStringLiteral("nickname"));
+ nickname->setObjectName(QString::fromUtf8("nickname"));
vboxLayout1->addWidget(nickname);
@@ -80,18 +80,18 @@ public:
hboxLayout->setSpacing(6);
#endif
hboxLayout->setContentsMargins(0, 0, 0, 0);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
spacerItem = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout->addItem(spacerItem);
okButton = new QPushButton(NicknameDialog);
- okButton->setObjectName(QStringLiteral("okButton"));
+ okButton->setObjectName(QString::fromUtf8("okButton"));
hboxLayout->addWidget(okButton);
cancelButton = new QPushButton(NicknameDialog);
- cancelButton->setObjectName(QStringLiteral("cancelButton"));
+ cancelButton->setObjectName(QString::fromUtf8("cancelButton"));
hboxLayout->addWidget(cancelButton);
diff --git a/tests/auto/tools/uic/baseline/config.ui.h b/tests/auto/tools/uic/baseline/config.ui.h
index 7948f6b4ba..8287e0b1ac 100644
--- a/tests/auto/tools/uic/baseline/config.ui.h
+++ b/tests/auto/tools/uic/baseline/config.ui.h
@@ -118,20 +118,20 @@ public:
void setupUi(QDialog *Config)
{
if (Config->objectName().isEmpty())
- Config->setObjectName(QStringLiteral("Config"));
+ Config->setObjectName(QString::fromUtf8("Config"));
Config->resize(600, 650);
Config->setSizeGripEnabled(true);
vboxLayout = new QVBoxLayout(Config);
vboxLayout->setSpacing(6);
vboxLayout->setContentsMargins(11, 11, 11, 11);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
vboxLayout->setContentsMargins(8, 8, 8, 8);
hboxLayout = new QHBoxLayout();
hboxLayout->setSpacing(6);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
hboxLayout->setContentsMargins(0, 0, 0, 0);
ButtonGroup1 = new QGroupBox(Config);
- ButtonGroup1->setObjectName(QStringLiteral("ButtonGroup1"));
+ ButtonGroup1->setObjectName(QString::fromUtf8("ButtonGroup1"));
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -140,44 +140,44 @@ public:
vboxLayout1 = new QVBoxLayout(ButtonGroup1);
vboxLayout1->setSpacing(6);
vboxLayout1->setContentsMargins(11, 11, 11, 11);
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
vboxLayout1->setContentsMargins(11, 11, 11, 11);
size_176_220 = new QRadioButton(ButtonGroup1);
- size_176_220->setObjectName(QStringLiteral("size_176_220"));
+ size_176_220->setObjectName(QString::fromUtf8("size_176_220"));
vboxLayout1->addWidget(size_176_220);
size_240_320 = new QRadioButton(ButtonGroup1);
- size_240_320->setObjectName(QStringLiteral("size_240_320"));
+ size_240_320->setObjectName(QString::fromUtf8("size_240_320"));
vboxLayout1->addWidget(size_240_320);
size_320_240 = new QRadioButton(ButtonGroup1);
- size_320_240->setObjectName(QStringLiteral("size_320_240"));
+ size_320_240->setObjectName(QString::fromUtf8("size_320_240"));
vboxLayout1->addWidget(size_320_240);
size_640_480 = new QRadioButton(ButtonGroup1);
- size_640_480->setObjectName(QStringLiteral("size_640_480"));
+ size_640_480->setObjectName(QString::fromUtf8("size_640_480"));
vboxLayout1->addWidget(size_640_480);
size_800_600 = new QRadioButton(ButtonGroup1);
- size_800_600->setObjectName(QStringLiteral("size_800_600"));
+ size_800_600->setObjectName(QString::fromUtf8("size_800_600"));
vboxLayout1->addWidget(size_800_600);
size_1024_768 = new QRadioButton(ButtonGroup1);
- size_1024_768->setObjectName(QStringLiteral("size_1024_768"));
+ size_1024_768->setObjectName(QString::fromUtf8("size_1024_768"));
vboxLayout1->addWidget(size_1024_768);
hboxLayout1 = new QHBoxLayout();
hboxLayout1->setSpacing(6);
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
hboxLayout1->setContentsMargins(0, 0, 0, 0);
size_custom = new QRadioButton(ButtonGroup1);
- size_custom->setObjectName(QStringLiteral("size_custom"));
+ size_custom->setObjectName(QString::fromUtf8("size_custom"));
QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Fixed);
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
@@ -187,7 +187,7 @@ public:
hboxLayout1->addWidget(size_custom);
size_width = new QSpinBox(ButtonGroup1);
- size_width->setObjectName(QStringLiteral("size_width"));
+ size_width->setObjectName(QString::fromUtf8("size_width"));
size_width->setMinimum(1);
size_width->setMaximum(1280);
size_width->setSingleStep(16);
@@ -196,7 +196,7 @@ public:
hboxLayout1->addWidget(size_width);
size_height = new QSpinBox(ButtonGroup1);
- size_height->setObjectName(QStringLiteral("size_height"));
+ size_height->setObjectName(QString::fromUtf8("size_height"));
size_height->setMinimum(1);
size_height->setMaximum(1024);
size_height->setSingleStep(16);
@@ -211,59 +211,59 @@ public:
hboxLayout->addWidget(ButtonGroup1);
ButtonGroup2 = new QGroupBox(Config);
- ButtonGroup2->setObjectName(QStringLiteral("ButtonGroup2"));
+ ButtonGroup2->setObjectName(QString::fromUtf8("ButtonGroup2"));
vboxLayout2 = new QVBoxLayout(ButtonGroup2);
vboxLayout2->setSpacing(6);
vboxLayout2->setContentsMargins(11, 11, 11, 11);
- vboxLayout2->setObjectName(QStringLiteral("vboxLayout2"));
+ vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2"));
vboxLayout2->setContentsMargins(11, 11, 11, 11);
depth_1 = new QRadioButton(ButtonGroup2);
- depth_1->setObjectName(QStringLiteral("depth_1"));
+ depth_1->setObjectName(QString::fromUtf8("depth_1"));
vboxLayout2->addWidget(depth_1);
depth_4gray = new QRadioButton(ButtonGroup2);
- depth_4gray->setObjectName(QStringLiteral("depth_4gray"));
+ depth_4gray->setObjectName(QString::fromUtf8("depth_4gray"));
vboxLayout2->addWidget(depth_4gray);
depth_8 = new QRadioButton(ButtonGroup2);
- depth_8->setObjectName(QStringLiteral("depth_8"));
+ depth_8->setObjectName(QString::fromUtf8("depth_8"));
vboxLayout2->addWidget(depth_8);
depth_12 = new QRadioButton(ButtonGroup2);
- depth_12->setObjectName(QStringLiteral("depth_12"));
+ depth_12->setObjectName(QString::fromUtf8("depth_12"));
vboxLayout2->addWidget(depth_12);
depth_15 = new QRadioButton(ButtonGroup2);
- depth_15->setObjectName(QStringLiteral("depth_15"));
+ depth_15->setObjectName(QString::fromUtf8("depth_15"));
vboxLayout2->addWidget(depth_15);
depth_16 = new QRadioButton(ButtonGroup2);
- depth_16->setObjectName(QStringLiteral("depth_16"));
+ depth_16->setObjectName(QString::fromUtf8("depth_16"));
vboxLayout2->addWidget(depth_16);
depth_18 = new QRadioButton(ButtonGroup2);
- depth_18->setObjectName(QStringLiteral("depth_18"));
+ depth_18->setObjectName(QString::fromUtf8("depth_18"));
vboxLayout2->addWidget(depth_18);
depth_24 = new QRadioButton(ButtonGroup2);
- depth_24->setObjectName(QStringLiteral("depth_24"));
+ depth_24->setObjectName(QString::fromUtf8("depth_24"));
vboxLayout2->addWidget(depth_24);
depth_32 = new QRadioButton(ButtonGroup2);
- depth_32->setObjectName(QStringLiteral("depth_32"));
+ depth_32->setObjectName(QString::fromUtf8("depth_32"));
vboxLayout2->addWidget(depth_32);
depth_32_argb = new QRadioButton(ButtonGroup2);
- depth_32_argb->setObjectName(QStringLiteral("depth_32_argb"));
+ depth_32_argb->setObjectName(QString::fromUtf8("depth_32_argb"));
vboxLayout2->addWidget(depth_32_argb);
@@ -275,16 +275,16 @@ public:
hboxLayout2 = new QHBoxLayout();
hboxLayout2->setSpacing(6);
- hboxLayout2->setObjectName(QStringLiteral("hboxLayout2"));
+ hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2"));
hboxLayout2->setContentsMargins(0, 0, 0, 0);
TextLabel1_3 = new QLabel(Config);
- TextLabel1_3->setObjectName(QStringLiteral("TextLabel1_3"));
+ TextLabel1_3->setObjectName(QString::fromUtf8("TextLabel1_3"));
hboxLayout2->addWidget(TextLabel1_3);
skin = new QComboBox(Config);
skin->addItem(QString());
- skin->setObjectName(QStringLiteral("skin"));
+ skin->setObjectName(QString::fromUtf8("skin"));
QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Fixed);
sizePolicy2.setHorizontalStretch(0);
sizePolicy2.setVerticalStretch(0);
@@ -297,12 +297,12 @@ public:
vboxLayout->addLayout(hboxLayout2);
touchScreen = new QCheckBox(Config);
- touchScreen->setObjectName(QStringLiteral("touchScreen"));
+ touchScreen->setObjectName(QString::fromUtf8("touchScreen"));
vboxLayout->addWidget(touchScreen);
lcdScreen = new QCheckBox(Config);
- lcdScreen->setObjectName(QStringLiteral("lcdScreen"));
+ lcdScreen->setObjectName(QString::fromUtf8("lcdScreen"));
vboxLayout->addWidget(lcdScreen);
@@ -311,7 +311,7 @@ public:
vboxLayout->addItem(spacerItem);
TextLabel1 = new QLabel(Config);
- TextLabel1->setObjectName(QStringLiteral("TextLabel1"));
+ TextLabel1->setObjectName(QString::fromUtf8("TextLabel1"));
sizePolicy.setHeightForWidth(TextLabel1->sizePolicy().hasHeightForWidth());
TextLabel1->setSizePolicy(sizePolicy);
TextLabel1->setWordWrap(true);
@@ -319,21 +319,21 @@ public:
vboxLayout->addWidget(TextLabel1);
GroupBox1 = new QGroupBox(Config);
- GroupBox1->setObjectName(QStringLiteral("GroupBox1"));
+ GroupBox1->setObjectName(QString::fromUtf8("GroupBox1"));
gridLayout = new QGridLayout(GroupBox1);
gridLayout->setSpacing(6);
gridLayout->setContentsMargins(11, 11, 11, 11);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
gridLayout->setHorizontalSpacing(6);
gridLayout->setVerticalSpacing(6);
gridLayout->setContentsMargins(11, 11, 11, 11);
TextLabel3 = new QLabel(GroupBox1);
- TextLabel3->setObjectName(QStringLiteral("TextLabel3"));
+ TextLabel3->setObjectName(QString::fromUtf8("TextLabel3"));
gridLayout->addWidget(TextLabel3, 6, 0, 1, 1);
bslider = new QSlider(GroupBox1);
- bslider->setObjectName(QStringLiteral("bslider"));
+ bslider->setObjectName(QString::fromUtf8("bslider"));
QPalette palette;
QBrush brush(QColor(128, 128, 128, 255));
brush.setStyle(Qt::SolidPattern);
@@ -416,17 +416,17 @@ public:
gridLayout->addWidget(bslider, 6, 1, 1, 1);
blabel = new QLabel(GroupBox1);
- blabel->setObjectName(QStringLiteral("blabel"));
+ blabel->setObjectName(QString::fromUtf8("blabel"));
gridLayout->addWidget(blabel, 6, 2, 1, 1);
TextLabel2 = new QLabel(GroupBox1);
- TextLabel2->setObjectName(QStringLiteral("TextLabel2"));
+ TextLabel2->setObjectName(QString::fromUtf8("TextLabel2"));
gridLayout->addWidget(TextLabel2, 4, 0, 1, 1);
gslider = new QSlider(GroupBox1);
- gslider->setObjectName(QStringLiteral("gslider"));
+ gslider->setObjectName(QString::fromUtf8("gslider"));
QPalette palette1;
palette1.setBrush(QPalette::Active, QPalette::WindowText, brush);
QBrush brush11(QColor(0, 255, 0, 255));
@@ -497,22 +497,22 @@ public:
gridLayout->addWidget(gslider, 4, 1, 1, 1);
glabel = new QLabel(GroupBox1);
- glabel->setObjectName(QStringLiteral("glabel"));
+ glabel->setObjectName(QString::fromUtf8("glabel"));
gridLayout->addWidget(glabel, 4, 2, 1, 1);
TextLabel7 = new QLabel(GroupBox1);
- TextLabel7->setObjectName(QStringLiteral("TextLabel7"));
+ TextLabel7->setObjectName(QString::fromUtf8("TextLabel7"));
gridLayout->addWidget(TextLabel7, 0, 0, 1, 1);
TextLabel8 = new QLabel(GroupBox1);
- TextLabel8->setObjectName(QStringLiteral("TextLabel8"));
+ TextLabel8->setObjectName(QString::fromUtf8("TextLabel8"));
gridLayout->addWidget(TextLabel8, 0, 2, 1, 1);
gammaslider = new QSlider(GroupBox1);
- gammaslider->setObjectName(QStringLiteral("gammaslider"));
+ gammaslider->setObjectName(QString::fromUtf8("gammaslider"));
QPalette palette2;
palette2.setBrush(QPalette::Active, QPalette::WindowText, brush);
palette2.setBrush(QPalette::Active, QPalette::Button, brush7);
@@ -577,17 +577,17 @@ public:
gridLayout->addWidget(gammaslider, 0, 1, 1, 1);
TextLabel1_2 = new QLabel(GroupBox1);
- TextLabel1_2->setObjectName(QStringLiteral("TextLabel1_2"));
+ TextLabel1_2->setObjectName(QString::fromUtf8("TextLabel1_2"));
gridLayout->addWidget(TextLabel1_2, 2, 0, 1, 1);
rlabel = new QLabel(GroupBox1);
- rlabel->setObjectName(QStringLiteral("rlabel"));
+ rlabel->setObjectName(QString::fromUtf8("rlabel"));
gridLayout->addWidget(rlabel, 2, 2, 1, 1);
rslider = new QSlider(GroupBox1);
- rslider->setObjectName(QStringLiteral("rslider"));
+ rslider->setObjectName(QString::fromUtf8("rslider"));
QPalette palette3;
palette3.setBrush(QPalette::Active, QPalette::WindowText, brush);
QBrush brush18(QColor(255, 0, 0, 255));
@@ -658,12 +658,12 @@ public:
gridLayout->addWidget(rslider, 2, 1, 1, 1);
PushButton3 = new QPushButton(GroupBox1);
- PushButton3->setObjectName(QStringLiteral("PushButton3"));
+ PushButton3->setObjectName(QString::fromUtf8("PushButton3"));
gridLayout->addWidget(PushButton3, 8, 0, 1, 3);
MyCustomWidget1 = new GammaView(GroupBox1);
- MyCustomWidget1->setObjectName(QStringLiteral("MyCustomWidget1"));
+ MyCustomWidget1->setObjectName(QString::fromUtf8("MyCustomWidget1"));
gridLayout->addWidget(MyCustomWidget1, 0, 3, 9, 1);
@@ -672,20 +672,20 @@ public:
hboxLayout3 = new QHBoxLayout();
hboxLayout3->setSpacing(6);
- hboxLayout3->setObjectName(QStringLiteral("hboxLayout3"));
+ hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3"));
hboxLayout3->setContentsMargins(0, 0, 0, 0);
spacerItem1 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout3->addItem(spacerItem1);
buttonOk = new QPushButton(Config);
- buttonOk->setObjectName(QStringLiteral("buttonOk"));
+ buttonOk->setObjectName(QString::fromUtf8("buttonOk"));
buttonOk->setAutoDefault(true);
hboxLayout3->addWidget(buttonOk);
buttonCancel = new QPushButton(Config);
- buttonCancel->setObjectName(QStringLiteral("buttonCancel"));
+ buttonCancel->setObjectName(QString::fromUtf8("buttonCancel"));
buttonCancel->setAutoDefault(true);
hboxLayout3->addWidget(buttonCancel);
diff --git a/tests/auto/tools/uic/baseline/connectdialog.ui.h b/tests/auto/tools/uic/baseline/connectdialog.ui.h
index 935f8a21a1..a470a6705d 100644
--- a/tests/auto/tools/uic/baseline/connectdialog.ui.h
+++ b/tests/auto/tools/uic/baseline/connectdialog.ui.h
@@ -46,24 +46,24 @@ public:
void setupUi(QDialog *ConnectDialog)
{
if (ConnectDialog->objectName().isEmpty())
- ConnectDialog->setObjectName(QStringLiteral("ConnectDialog"));
+ ConnectDialog->setObjectName(QString::fromUtf8("ConnectDialog"));
ConnectDialog->resize(585, 361);
gridLayout = new QGridLayout(ConnectDialog);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
signalGroupBox = new QGroupBox(ConnectDialog);
- signalGroupBox->setObjectName(QStringLiteral("signalGroupBox"));
+ signalGroupBox->setObjectName(QString::fromUtf8("signalGroupBox"));
vboxLayout = new QVBoxLayout(signalGroupBox);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
signalList = new QListWidget(signalGroupBox);
- signalList->setObjectName(QStringLiteral("signalList"));
+ signalList->setObjectName(QString::fromUtf8("signalList"));
signalList->setTextElideMode(Qt::ElideMiddle);
vboxLayout->addWidget(signalList);
hboxLayout = new QHBoxLayout();
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
editSignalsButton = new QToolButton(signalGroupBox);
- editSignalsButton->setObjectName(QStringLiteral("editSignalsButton"));
+ editSignalsButton->setObjectName(QString::fromUtf8("editSignalsButton"));
hboxLayout->addWidget(editSignalsButton);
@@ -78,19 +78,19 @@ public:
gridLayout->addWidget(signalGroupBox, 0, 0, 1, 2);
slotGroupBox = new QGroupBox(ConnectDialog);
- slotGroupBox->setObjectName(QStringLiteral("slotGroupBox"));
+ slotGroupBox->setObjectName(QString::fromUtf8("slotGroupBox"));
vboxLayout1 = new QVBoxLayout(slotGroupBox);
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
slotList = new QListWidget(slotGroupBox);
- slotList->setObjectName(QStringLiteral("slotList"));
+ slotList->setObjectName(QString::fromUtf8("slotList"));
slotList->setTextElideMode(Qt::ElideMiddle);
vboxLayout1->addWidget(slotList);
hboxLayout1 = new QHBoxLayout();
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
editSlotsButton = new QToolButton(slotGroupBox);
- editSlotsButton->setObjectName(QStringLiteral("editSlotsButton"));
+ editSlotsButton->setObjectName(QString::fromUtf8("editSlotsButton"));
hboxLayout1->addWidget(editSlotsButton);
@@ -105,12 +105,12 @@ public:
gridLayout->addWidget(slotGroupBox, 0, 2, 1, 1);
showAllCheckBox = new QCheckBox(ConnectDialog);
- showAllCheckBox->setObjectName(QStringLiteral("showAllCheckBox"));
+ showAllCheckBox->setObjectName(QString::fromUtf8("showAllCheckBox"));
gridLayout->addWidget(showAllCheckBox, 1, 0, 1, 1);
buttonBox = new QDialogButtonBox(ConnectDialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/controller.ui.h b/tests/auto/tools/uic/baseline/controller.ui.h
index e3382e2c17..72b0956472 100644
--- a/tests/auto/tools/uic/baseline/controller.ui.h
+++ b/tests/auto/tools/uic/baseline/controller.ui.h
@@ -31,7 +31,7 @@ public:
void setupUi(QWidget *Controller)
{
if (Controller->objectName().isEmpty())
- Controller->setObjectName(QStringLiteral("Controller"));
+ Controller->setObjectName(QString::fromUtf8("Controller"));
Controller->resize(255, 111);
gridLayout = new QGridLayout(Controller);
#ifndef Q_OS_MAC
@@ -40,30 +40,30 @@ public:
#ifndef Q_OS_MAC
gridLayout->setContentsMargins(9, 9, 9, 9);
#endif
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
label = new QLabel(Controller);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
label->setAlignment(Qt::AlignCenter);
gridLayout->addWidget(label, 1, 1, 1, 1);
decelerate = new QPushButton(Controller);
- decelerate->setObjectName(QStringLiteral("decelerate"));
+ decelerate->setObjectName(QString::fromUtf8("decelerate"));
gridLayout->addWidget(decelerate, 2, 1, 1, 1);
accelerate = new QPushButton(Controller);
- accelerate->setObjectName(QStringLiteral("accelerate"));
+ accelerate->setObjectName(QString::fromUtf8("accelerate"));
gridLayout->addWidget(accelerate, 0, 1, 1, 1);
right = new QPushButton(Controller);
- right->setObjectName(QStringLiteral("right"));
+ right->setObjectName(QString::fromUtf8("right"));
gridLayout->addWidget(right, 1, 2, 1, 1);
left = new QPushButton(Controller);
- left->setObjectName(QStringLiteral("left"));
+ left->setObjectName(QString::fromUtf8("left"));
gridLayout->addWidget(left, 1, 0, 1, 1);
diff --git a/tests/auto/tools/uic/baseline/cookies.ui.h b/tests/auto/tools/uic/baseline/cookies.ui.h
index 2702fb489f..144c306874 100644
--- a/tests/auto/tools/uic/baseline/cookies.ui.h
+++ b/tests/auto/tools/uic/baseline/cookies.ui.h
@@ -39,33 +39,33 @@ public:
void setupUi(QDialog *CookiesDialog)
{
if (CookiesDialog->objectName().isEmpty())
- CookiesDialog->setObjectName(QStringLiteral("CookiesDialog"));
+ CookiesDialog->setObjectName(QString::fromUtf8("CookiesDialog"));
CookiesDialog->resize(550, 370);
gridLayout = new QGridLayout(CookiesDialog);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
spacerItem = new QSpacerItem(252, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
gridLayout->addItem(spacerItem, 0, 0, 1, 1);
search = new SearchLineEdit(CookiesDialog);
- search->setObjectName(QStringLiteral("search"));
+ search->setObjectName(QString::fromUtf8("search"));
gridLayout->addWidget(search, 0, 1, 1, 1);
cookiesTable = new EditTableView(CookiesDialog);
- cookiesTable->setObjectName(QStringLiteral("cookiesTable"));
+ cookiesTable->setObjectName(QString::fromUtf8("cookiesTable"));
gridLayout->addWidget(cookiesTable, 1, 0, 1, 2);
hboxLayout = new QHBoxLayout();
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
removeButton = new QPushButton(CookiesDialog);
- removeButton->setObjectName(QStringLiteral("removeButton"));
+ removeButton->setObjectName(QString::fromUtf8("removeButton"));
hboxLayout->addWidget(removeButton);
removeAllButton = new QPushButton(CookiesDialog);
- removeAllButton->setObjectName(QStringLiteral("removeAllButton"));
+ removeAllButton->setObjectName(QString::fromUtf8("removeAllButton"));
hboxLayout->addWidget(removeAllButton);
@@ -74,7 +74,7 @@ public:
hboxLayout->addItem(spacerItem1);
buttonBox = new QDialogButtonBox(CookiesDialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setStandardButtons(QDialogButtonBox::Ok);
hboxLayout->addWidget(buttonBox);
diff --git a/tests/auto/tools/uic/baseline/cookiesexceptions.ui.h b/tests/auto/tools/uic/baseline/cookiesexceptions.ui.h
index eaa39e3e78..a3bf7a449e 100644
--- a/tests/auto/tools/uic/baseline/cookiesexceptions.ui.h
+++ b/tests/auto/tools/uic/baseline/cookiesexceptions.ui.h
@@ -54,23 +54,23 @@ public:
void setupUi(QDialog *CookiesExceptionsDialog)
{
if (CookiesExceptionsDialog->objectName().isEmpty())
- CookiesExceptionsDialog->setObjectName(QStringLiteral("CookiesExceptionsDialog"));
+ CookiesExceptionsDialog->setObjectName(QString::fromUtf8("CookiesExceptionsDialog"));
CookiesExceptionsDialog->resize(466, 446);
vboxLayout = new QVBoxLayout(CookiesExceptionsDialog);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
newExceptionGroupBox = new QGroupBox(CookiesExceptionsDialog);
- newExceptionGroupBox->setObjectName(QStringLiteral("newExceptionGroupBox"));
+ newExceptionGroupBox->setObjectName(QString::fromUtf8("newExceptionGroupBox"));
gridLayout = new QGridLayout(newExceptionGroupBox);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
hboxLayout = new QHBoxLayout();
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
label = new QLabel(newExceptionGroupBox);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
hboxLayout->addWidget(label);
domainLineEdit = new QLineEdit(newExceptionGroupBox);
- domainLineEdit->setObjectName(QStringLiteral("domainLineEdit"));
+ domainLineEdit->setObjectName(QString::fromUtf8("domainLineEdit"));
hboxLayout->addWidget(domainLineEdit);
@@ -78,25 +78,25 @@ public:
gridLayout->addLayout(hboxLayout, 0, 0, 1, 1);
hboxLayout1 = new QHBoxLayout();
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
spacerItem = new QSpacerItem(81, 25, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout1->addItem(spacerItem);
blockButton = new QPushButton(newExceptionGroupBox);
- blockButton->setObjectName(QStringLiteral("blockButton"));
+ blockButton->setObjectName(QString::fromUtf8("blockButton"));
blockButton->setEnabled(false);
hboxLayout1->addWidget(blockButton);
allowForSessionButton = new QPushButton(newExceptionGroupBox);
- allowForSessionButton->setObjectName(QStringLiteral("allowForSessionButton"));
+ allowForSessionButton->setObjectName(QString::fromUtf8("allowForSessionButton"));
allowForSessionButton->setEnabled(false);
hboxLayout1->addWidget(allowForSessionButton);
allowButton = new QPushButton(newExceptionGroupBox);
- allowButton->setObjectName(QStringLiteral("allowButton"));
+ allowButton->setObjectName(QString::fromUtf8("allowButton"));
allowButton->setEnabled(false);
hboxLayout1->addWidget(allowButton);
@@ -108,30 +108,30 @@ public:
vboxLayout->addWidget(newExceptionGroupBox);
ExceptionsGroupBox = new QGroupBox(CookiesExceptionsDialog);
- ExceptionsGroupBox->setObjectName(QStringLiteral("ExceptionsGroupBox"));
+ ExceptionsGroupBox->setObjectName(QString::fromUtf8("ExceptionsGroupBox"));
gridLayout1 = new QGridLayout(ExceptionsGroupBox);
- gridLayout1->setObjectName(QStringLiteral("gridLayout1"));
+ gridLayout1->setObjectName(QString::fromUtf8("gridLayout1"));
spacerItem1 = new QSpacerItem(252, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
gridLayout1->addItem(spacerItem1, 0, 0, 1, 3);
search = new SearchLineEdit(ExceptionsGroupBox);
- search->setObjectName(QStringLiteral("search"));
+ search->setObjectName(QString::fromUtf8("search"));
gridLayout1->addWidget(search, 0, 3, 1, 1);
exceptionTable = new EditTableView(ExceptionsGroupBox);
- exceptionTable->setObjectName(QStringLiteral("exceptionTable"));
+ exceptionTable->setObjectName(QString::fromUtf8("exceptionTable"));
gridLayout1->addWidget(exceptionTable, 1, 0, 1, 4);
removeButton = new QPushButton(ExceptionsGroupBox);
- removeButton->setObjectName(QStringLiteral("removeButton"));
+ removeButton->setObjectName(QString::fromUtf8("removeButton"));
gridLayout1->addWidget(removeButton, 2, 0, 1, 1);
removeAllButton = new QPushButton(ExceptionsGroupBox);
- removeAllButton->setObjectName(QStringLiteral("removeAllButton"));
+ removeAllButton->setObjectName(QString::fromUtf8("removeAllButton"));
gridLayout1->addWidget(removeAllButton, 2, 1, 1, 1);
@@ -143,7 +143,7 @@ public:
vboxLayout->addWidget(ExceptionsGroupBox);
buttonBox = new QDialogButtonBox(CookiesExceptionsDialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/default.ui.h b/tests/auto/tools/uic/baseline/default.ui.h
index 4fae8e7130..fafff9d728 100644
--- a/tests/auto/tools/uic/baseline/default.ui.h
+++ b/tests/auto/tools/uic/baseline/default.ui.h
@@ -63,18 +63,18 @@ public:
void setupUi(QMainWindow *MainWindow)
{
if (MainWindow->objectName().isEmpty())
- MainWindow->setObjectName(QStringLiteral("MainWindow"));
+ MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
MainWindow->resize(388, 413);
exitAction = new QAction(MainWindow);
- exitAction->setObjectName(QStringLiteral("exitAction"));
+ exitAction->setObjectName(QString::fromUtf8("exitAction"));
aboutQtAction = new QAction(MainWindow);
- aboutQtAction->setObjectName(QStringLiteral("aboutQtAction"));
+ aboutQtAction->setObjectName(QString::fromUtf8("aboutQtAction"));
editStyleAction = new QAction(MainWindow);
- editStyleAction->setObjectName(QStringLiteral("editStyleAction"));
+ editStyleAction->setObjectName(QString::fromUtf8("editStyleAction"));
aboutAction = new QAction(MainWindow);
- aboutAction->setObjectName(QStringLiteral("aboutAction"));
+ aboutAction->setObjectName(QString::fromUtf8("aboutAction"));
centralwidget = new QWidget(MainWindow);
- centralwidget->setObjectName(QStringLiteral("centralwidget"));
+ centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
gridLayout = new QGridLayout(centralwidget);
#ifndef Q_OS_MAC
gridLayout->setSpacing(6);
@@ -82,9 +82,9 @@ public:
#ifndef Q_OS_MAC
gridLayout->setContentsMargins(9, 9, 9, 9);
#endif
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
nameLabel = new QLabel(centralwidget);
- nameLabel->setObjectName(QStringLiteral("nameLabel"));
+ nameLabel->setObjectName(QString::fromUtf8("nameLabel"));
gridLayout->addWidget(nameLabel, 0, 0, 1, 1);
@@ -93,7 +93,7 @@ public:
nameCombo->addItem(QString());
nameCombo->addItem(QString());
nameCombo->addItem(QString());
- nameCombo->setObjectName(QStringLiteral("nameCombo"));
+ nameCombo->setObjectName(QString::fromUtf8("nameCombo"));
nameCombo->setEditable(true);
gridLayout->addWidget(nameCombo, 0, 1, 1, 3);
@@ -103,62 +103,62 @@ public:
gridLayout->addItem(spacerItem, 1, 3, 1, 1);
femaleRadioButton = new QRadioButton(centralwidget);
- femaleRadioButton->setObjectName(QStringLiteral("femaleRadioButton"));
+ femaleRadioButton->setObjectName(QString::fromUtf8("femaleRadioButton"));
gridLayout->addWidget(femaleRadioButton, 1, 2, 1, 1);
agreeCheckBox = new QCheckBox(centralwidget);
- agreeCheckBox->setObjectName(QStringLiteral("agreeCheckBox"));
+ agreeCheckBox->setObjectName(QString::fromUtf8("agreeCheckBox"));
gridLayout->addWidget(agreeCheckBox, 6, 0, 1, 4);
maleRadioButton = new QRadioButton(centralwidget);
- maleRadioButton->setObjectName(QStringLiteral("maleRadioButton"));
+ maleRadioButton->setObjectName(QString::fromUtf8("maleRadioButton"));
gridLayout->addWidget(maleRadioButton, 1, 1, 1, 1);
genderLabel = new QLabel(centralwidget);
- genderLabel->setObjectName(QStringLiteral("genderLabel"));
+ genderLabel->setObjectName(QString::fromUtf8("genderLabel"));
gridLayout->addWidget(genderLabel, 1, 0, 1, 1);
ageSpinBox = new QSpinBox(centralwidget);
- ageSpinBox->setObjectName(QStringLiteral("ageSpinBox"));
+ ageSpinBox->setObjectName(QString::fromUtf8("ageSpinBox"));
ageSpinBox->setMinimum(12);
ageSpinBox->setValue(22);
gridLayout->addWidget(ageSpinBox, 2, 1, 1, 3);
buttonBox = new QDialogButtonBox(centralwidget);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok);
gridLayout->addWidget(buttonBox, 7, 2, 1, 2);
ageLabel = new QLabel(centralwidget);
- ageLabel->setObjectName(QStringLiteral("ageLabel"));
+ ageLabel->setObjectName(QString::fromUtf8("ageLabel"));
gridLayout->addWidget(ageLabel, 2, 0, 1, 1);
passwordLabel = new QLabel(centralwidget);
- passwordLabel->setObjectName(QStringLiteral("passwordLabel"));
+ passwordLabel->setObjectName(QString::fromUtf8("passwordLabel"));
gridLayout->addWidget(passwordLabel, 3, 0, 1, 1);
passwordEdit = new QLineEdit(centralwidget);
- passwordEdit->setObjectName(QStringLiteral("passwordEdit"));
+ passwordEdit->setObjectName(QString::fromUtf8("passwordEdit"));
passwordEdit->setEchoMode(QLineEdit::Password);
gridLayout->addWidget(passwordEdit, 3, 1, 1, 3);
label = new QLabel(centralwidget);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout->addWidget(label, 5, 0, 1, 1);
countryLabel = new QLabel(centralwidget);
- countryLabel->setObjectName(QStringLiteral("countryLabel"));
+ countryLabel->setObjectName(QString::fromUtf8("countryLabel"));
gridLayout->addWidget(countryLabel, 4, 0, 1, 1);
@@ -166,7 +166,7 @@ public:
new QListWidgetItem(professionList);
new QListWidgetItem(professionList);
new QListWidgetItem(professionList);
- professionList->setObjectName(QStringLiteral("professionList"));
+ professionList->setObjectName(QString::fromUtf8("professionList"));
gridLayout->addWidget(professionList, 5, 1, 1, 3);
@@ -176,21 +176,21 @@ public:
countryCombo->addItem(QString());
countryCombo->addItem(QString());
countryCombo->addItem(QString());
- countryCombo->setObjectName(QStringLiteral("countryCombo"));
+ countryCombo->setObjectName(QString::fromUtf8("countryCombo"));
gridLayout->addWidget(countryCombo, 4, 1, 1, 3);
MainWindow->setCentralWidget(centralwidget);
menubar = new QMenuBar(MainWindow);
- menubar->setObjectName(QStringLiteral("menubar"));
+ menubar->setObjectName(QString::fromUtf8("menubar"));
menubar->setGeometry(QRect(0, 0, 388, 21));
menu_File = new QMenu(menubar);
- menu_File->setObjectName(QStringLiteral("menu_File"));
+ menu_File->setObjectName(QString::fromUtf8("menu_File"));
menu_Help = new QMenu(menubar);
- menu_Help->setObjectName(QStringLiteral("menu_Help"));
+ menu_Help->setObjectName(QString::fromUtf8("menu_Help"));
MainWindow->setMenuBar(menubar);
statusbar = new QStatusBar(MainWindow);
- statusbar->setObjectName(QStringLiteral("statusbar"));
+ statusbar->setObjectName(QString::fromUtf8("statusbar"));
MainWindow->setStatusBar(statusbar);
#ifndef QT_NO_SHORTCUT
nameLabel->setBuddy(nameCombo);
diff --git a/tests/auto/tools/uic/baseline/dialog.ui.h b/tests/auto/tools/uic/baseline/dialog.ui.h
index 1aa41c2ac8..2a159312b9 100644
--- a/tests/auto/tools/uic/baseline/dialog.ui.h
+++ b/tests/auto/tools/uic/baseline/dialog.ui.h
@@ -29,24 +29,24 @@ public:
void setupUi(QDialog *Dialog)
{
if (Dialog->objectName().isEmpty())
- Dialog->setObjectName(QStringLiteral("Dialog"));
+ Dialog->setObjectName(QString::fromUtf8("Dialog"));
Dialog->resize(451, 322);
gridLayout = new QGridLayout(Dialog);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
loadFromFileButton = new QPushButton(Dialog);
- loadFromFileButton->setObjectName(QStringLiteral("loadFromFileButton"));
+ loadFromFileButton->setObjectName(QString::fromUtf8("loadFromFileButton"));
gridLayout->addWidget(loadFromFileButton, 0, 0, 1, 1);
label = new QLabel(Dialog);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
label->setAlignment(Qt::AlignCenter);
label->setWordWrap(true);
gridLayout->addWidget(label, 1, 0, 1, 1);
loadFromSharedMemoryButton = new QPushButton(Dialog);
- loadFromSharedMemoryButton->setObjectName(QStringLiteral("loadFromSharedMemoryButton"));
+ loadFromSharedMemoryButton->setObjectName(QString::fromUtf8("loadFromSharedMemoryButton"));
gridLayout->addWidget(loadFromSharedMemoryButton, 2, 0, 1, 1);
diff --git a/tests/auto/tools/uic/baseline/downloaditem.ui.h b/tests/auto/tools/uic/baseline/downloaditem.ui.h
index 2e854aa9ed..f0e8e88307 100644
--- a/tests/auto/tools/uic/baseline/downloaditem.ui.h
+++ b/tests/auto/tools/uic/baseline/downloaditem.ui.h
@@ -41,13 +41,13 @@ public:
void setupUi(QWidget *DownloadItem)
{
if (DownloadItem->objectName().isEmpty())
- DownloadItem->setObjectName(QStringLiteral("DownloadItem"));
+ DownloadItem->setObjectName(QString::fromUtf8("DownloadItem"));
DownloadItem->resize(423, 110);
horizontalLayout = new QHBoxLayout(DownloadItem);
horizontalLayout->setContentsMargins(0, 0, 0, 0);
- horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
+ horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
fileIcon = new QLabel(DownloadItem);
- fileIcon->setObjectName(QStringLiteral("fileIcon"));
+ fileIcon->setObjectName(QString::fromUtf8("fileIcon"));
QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -57,9 +57,9 @@ public:
horizontalLayout->addWidget(fileIcon);
verticalLayout_2 = new QVBoxLayout();
- verticalLayout_2->setObjectName(QStringLiteral("verticalLayout_2"));
+ verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2"));
fileNameLabel = new SqueezeLabel(DownloadItem);
- fileNameLabel->setObjectName(QStringLiteral("fileNameLabel"));
+ fileNameLabel->setObjectName(QString::fromUtf8("fileNameLabel"));
QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Preferred);
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
@@ -69,13 +69,13 @@ public:
verticalLayout_2->addWidget(fileNameLabel);
progressBar = new QProgressBar(DownloadItem);
- progressBar->setObjectName(QStringLiteral("progressBar"));
+ progressBar->setObjectName(QString::fromUtf8("progressBar"));
progressBar->setValue(0);
verticalLayout_2->addWidget(progressBar);
downloadInfoLabel = new SqueezeLabel(DownloadItem);
- downloadInfoLabel->setObjectName(QStringLiteral("downloadInfoLabel"));
+ downloadInfoLabel->setObjectName(QString::fromUtf8("downloadInfoLabel"));
QSizePolicy sizePolicy2(QSizePolicy::Minimum, QSizePolicy::Preferred);
sizePolicy2.setHorizontalStretch(0);
sizePolicy2.setVerticalStretch(0);
@@ -88,24 +88,24 @@ public:
horizontalLayout->addLayout(verticalLayout_2);
verticalLayout = new QVBoxLayout();
- verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
verticalSpacer = new QSpacerItem(17, 1, QSizePolicy::Minimum, QSizePolicy::Expanding);
verticalLayout->addItem(verticalSpacer);
tryAgainButton = new QPushButton(DownloadItem);
- tryAgainButton->setObjectName(QStringLiteral("tryAgainButton"));
+ tryAgainButton->setObjectName(QString::fromUtf8("tryAgainButton"));
tryAgainButton->setEnabled(false);
verticalLayout->addWidget(tryAgainButton);
stopButton = new QPushButton(DownloadItem);
- stopButton->setObjectName(QStringLiteral("stopButton"));
+ stopButton->setObjectName(QString::fromUtf8("stopButton"));
verticalLayout->addWidget(stopButton);
openButton = new QPushButton(DownloadItem);
- openButton->setObjectName(QStringLiteral("openButton"));
+ openButton->setObjectName(QString::fromUtf8("openButton"));
verticalLayout->addWidget(openButton);
diff --git a/tests/auto/tools/uic/baseline/downloads.ui.h b/tests/auto/tools/uic/baseline/downloads.ui.h
index 5ac40a9581..1df992d30f 100644
--- a/tests/auto/tools/uic/baseline/downloads.ui.h
+++ b/tests/auto/tools/uic/baseline/downloads.ui.h
@@ -36,21 +36,21 @@ public:
void setupUi(QDialog *DownloadDialog)
{
if (DownloadDialog->objectName().isEmpty())
- DownloadDialog->setObjectName(QStringLiteral("DownloadDialog"));
+ DownloadDialog->setObjectName(QString::fromUtf8("DownloadDialog"));
DownloadDialog->resize(332, 252);
gridLayout = new QGridLayout(DownloadDialog);
gridLayout->setSpacing(0);
gridLayout->setContentsMargins(0, 0, 0, 0);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
downloadsView = new EditTableView(DownloadDialog);
- downloadsView->setObjectName(QStringLiteral("downloadsView"));
+ downloadsView->setObjectName(QString::fromUtf8("downloadsView"));
gridLayout->addWidget(downloadsView, 0, 0, 1, 3);
horizontalLayout = new QHBoxLayout();
- horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
+ horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
cleanupButton = new QPushButton(DownloadDialog);
- cleanupButton->setObjectName(QStringLiteral("cleanupButton"));
+ cleanupButton->setObjectName(QString::fromUtf8("cleanupButton"));
cleanupButton->setEnabled(false);
horizontalLayout->addWidget(cleanupButton);
@@ -63,7 +63,7 @@ public:
gridLayout->addLayout(horizontalLayout, 1, 0, 1, 1);
itemCount = new QLabel(DownloadDialog);
- itemCount->setObjectName(QStringLiteral("itemCount"));
+ itemCount->setObjectName(QString::fromUtf8("itemCount"));
gridLayout->addWidget(itemCount, 1, 1, 1, 1);
diff --git a/tests/auto/tools/uic/baseline/embeddeddialog.ui.h b/tests/auto/tools/uic/baseline/embeddeddialog.ui.h
index 67ef6e1de1..194ff578e8 100644
--- a/tests/auto/tools/uic/baseline/embeddeddialog.ui.h
+++ b/tests/auto/tools/uic/baseline/embeddeddialog.ui.h
@@ -36,49 +36,49 @@ public:
void setupUi(QDialog *embeddedDialog)
{
if (embeddedDialog->objectName().isEmpty())
- embeddedDialog->setObjectName(QStringLiteral("embeddedDialog"));
+ embeddedDialog->setObjectName(QString::fromUtf8("embeddedDialog"));
embeddedDialog->resize(407, 134);
formLayout = new QFormLayout(embeddedDialog);
- formLayout->setObjectName(QStringLiteral("formLayout"));
+ formLayout->setObjectName(QString::fromUtf8("formLayout"));
label = new QLabel(embeddedDialog);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
formLayout->setWidget(0, QFormLayout::LabelRole, label);
layoutDirection = new QComboBox(embeddedDialog);
layoutDirection->addItem(QString());
layoutDirection->addItem(QString());
- layoutDirection->setObjectName(QStringLiteral("layoutDirection"));
+ layoutDirection->setObjectName(QString::fromUtf8("layoutDirection"));
formLayout->setWidget(0, QFormLayout::FieldRole, layoutDirection);
label_2 = new QLabel(embeddedDialog);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
formLayout->setWidget(1, QFormLayout::LabelRole, label_2);
fontComboBox = new QFontComboBox(embeddedDialog);
- fontComboBox->setObjectName(QStringLiteral("fontComboBox"));
+ fontComboBox->setObjectName(QString::fromUtf8("fontComboBox"));
formLayout->setWidget(1, QFormLayout::FieldRole, fontComboBox);
label_3 = new QLabel(embeddedDialog);
- label_3->setObjectName(QStringLiteral("label_3"));
+ label_3->setObjectName(QString::fromUtf8("label_3"));
formLayout->setWidget(2, QFormLayout::LabelRole, label_3);
style = new QComboBox(embeddedDialog);
- style->setObjectName(QStringLiteral("style"));
+ style->setObjectName(QString::fromUtf8("style"));
formLayout->setWidget(2, QFormLayout::FieldRole, style);
label_4 = new QLabel(embeddedDialog);
- label_4->setObjectName(QStringLiteral("label_4"));
+ label_4->setObjectName(QString::fromUtf8("label_4"));
formLayout->setWidget(3, QFormLayout::LabelRole, label_4);
spacing = new QSlider(embeddedDialog);
- spacing->setObjectName(QStringLiteral("spacing"));
+ spacing->setObjectName(QString::fromUtf8("spacing"));
spacing->setOrientation(Qt::Horizontal);
formLayout->setWidget(3, QFormLayout::FieldRole, spacing);
diff --git a/tests/auto/tools/uic/baseline/enumnostdset.ui.h b/tests/auto/tools/uic/baseline/enumnostdset.ui.h
index 451cbd6a68..233fc616ac 100644
--- a/tests/auto/tools/uic/baseline/enumnostdset.ui.h
+++ b/tests/auto/tools/uic/baseline/enumnostdset.ui.h
@@ -24,10 +24,10 @@ public:
void setupUi(QWidget *Form)
{
if (Form->objectName().isEmpty())
- Form->setObjectName(QStringLiteral("Form"));
+ Form->setObjectName(QString::fromUtf8("Form"));
Form->resize(400, 300);
worldTimeClock = new WorldTimeClock(Form);
- worldTimeClock->setObjectName(QStringLiteral("worldTimeClock"));
+ worldTimeClock->setObjectName(QString::fromUtf8("worldTimeClock"));
worldTimeClock->setGeometry(QRect(100, 100, 100, 100));
worldTimeClock->setProperty("penStyle", QVariant::fromValue(Qt::DashDotLine));
diff --git a/tests/auto/tools/uic/baseline/filespage.ui.h b/tests/auto/tools/uic/baseline/filespage.ui.h
index 8ab8d09768..29ed981a8a 100644
--- a/tests/auto/tools/uic/baseline/filespage.ui.h
+++ b/tests/auto/tools/uic/baseline/filespage.ui.h
@@ -34,23 +34,23 @@ public:
void setupUi(QWidget *FilesPage)
{
if (FilesPage->objectName().isEmpty())
- FilesPage->setObjectName(QStringLiteral("FilesPage"));
+ FilesPage->setObjectName(QString::fromUtf8("FilesPage"));
FilesPage->resize(417, 242);
gridLayout = new QGridLayout(FilesPage);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
fileLabel = new QLabel(FilesPage);
- fileLabel->setObjectName(QStringLiteral("fileLabel"));
+ fileLabel->setObjectName(QString::fromUtf8("fileLabel"));
fileLabel->setWordWrap(true);
gridLayout->addWidget(fileLabel, 0, 0, 1, 2);
fileListWidget = new QListWidget(FilesPage);
- fileListWidget->setObjectName(QStringLiteral("fileListWidget"));
+ fileListWidget->setObjectName(QString::fromUtf8("fileListWidget"));
gridLayout->addWidget(fileListWidget, 1, 0, 3, 1);
removeButton = new QPushButton(FilesPage);
- removeButton->setObjectName(QStringLiteral("removeButton"));
+ removeButton->setObjectName(QString::fromUtf8("removeButton"));
QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -60,7 +60,7 @@ public:
gridLayout->addWidget(removeButton, 1, 1, 1, 1);
removeAllButton = new QPushButton(FilesPage);
- removeAllButton->setObjectName(QStringLiteral("removeAllButton"));
+ removeAllButton->setObjectName(QString::fromUtf8("removeAllButton"));
gridLayout->addWidget(removeAllButton, 2, 1, 1, 1);
diff --git a/tests/auto/tools/uic/baseline/filternamedialog.ui.h b/tests/auto/tools/uic/baseline/filternamedialog.ui.h
index 60642c29f6..716c291fdd 100644
--- a/tests/auto/tools/uic/baseline/filternamedialog.ui.h
+++ b/tests/auto/tools/uic/baseline/filternamedialog.ui.h
@@ -34,24 +34,24 @@ public:
void setupUi(QDialog *FilterNameDialogClass)
{
if (FilterNameDialogClass->objectName().isEmpty())
- FilterNameDialogClass->setObjectName(QStringLiteral("FilterNameDialogClass"));
+ FilterNameDialogClass->setObjectName(QString::fromUtf8("FilterNameDialogClass"));
FilterNameDialogClass->resize(312, 95);
gridLayout = new QGridLayout(FilterNameDialogClass);
gridLayout->setSpacing(6);
gridLayout->setContentsMargins(9, 9, 9, 9);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
label = new QLabel(FilterNameDialogClass);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout->addWidget(label, 0, 0, 1, 1);
lineEdit = new QLineEdit(FilterNameDialogClass);
- lineEdit->setObjectName(QStringLiteral("lineEdit"));
+ lineEdit->setObjectName(QString::fromUtf8("lineEdit"));
gridLayout->addWidget(lineEdit, 0, 1, 1, 2);
line = new QFrame(FilterNameDialogClass);
- line->setObjectName(QStringLiteral("line"));
+ line->setObjectName(QString::fromUtf8("line"));
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
@@ -62,7 +62,7 @@ public:
gridLayout->addItem(spacerItem, 2, 0, 1, 2);
buttonBox = new QDialogButtonBox(FilterNameDialogClass);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/filterpage.ui.h b/tests/auto/tools/uic/baseline/filterpage.ui.h
index a20dffc09a..f6610fdc4d 100644
--- a/tests/auto/tools/uic/baseline/filterpage.ui.h
+++ b/tests/auto/tools/uic/baseline/filterpage.ui.h
@@ -42,37 +42,37 @@ public:
void setupUi(QWidget *FilterPage)
{
if (FilterPage->objectName().isEmpty())
- FilterPage->setObjectName(QStringLiteral("FilterPage"));
+ FilterPage->setObjectName(QString::fromUtf8("FilterPage"));
FilterPage->resize(419, 243);
gridLayout = new QGridLayout(FilterPage);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
label = new QLabel(FilterPage);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout->addWidget(label, 1, 0, 1, 1);
filterLineEdit = new QLineEdit(FilterPage);
- filterLineEdit->setObjectName(QStringLiteral("filterLineEdit"));
+ filterLineEdit->setObjectName(QString::fromUtf8("filterLineEdit"));
gridLayout->addWidget(filterLineEdit, 2, 0, 1, 1);
groupBox = new QGroupBox(FilterPage);
- groupBox->setObjectName(QStringLiteral("groupBox"));
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
gridLayout1 = new QGridLayout(groupBox);
- gridLayout1->setObjectName(QStringLiteral("gridLayout1"));
+ gridLayout1->setObjectName(QString::fromUtf8("gridLayout1"));
customFilterWidget = new QTreeWidget(groupBox);
- customFilterWidget->setObjectName(QStringLiteral("customFilterWidget"));
+ customFilterWidget->setObjectName(QString::fromUtf8("customFilterWidget"));
customFilterWidget->setColumnCount(2);
gridLayout1->addWidget(customFilterWidget, 0, 0, 3, 1);
addButton = new QPushButton(groupBox);
- addButton->setObjectName(QStringLiteral("addButton"));
+ addButton->setObjectName(QString::fromUtf8("addButton"));
gridLayout1->addWidget(addButton, 0, 1, 1, 1);
removeButton = new QPushButton(groupBox);
- removeButton->setObjectName(QStringLiteral("removeButton"));
+ removeButton->setObjectName(QString::fromUtf8("removeButton"));
gridLayout1->addWidget(removeButton, 1, 1, 1, 1);
diff --git a/tests/auto/tools/uic/baseline/finddialog.ui.h b/tests/auto/tools/uic/baseline/finddialog.ui.h
index 0bb1ec4286..a427be3614 100644
--- a/tests/auto/tools/uic/baseline/finddialog.ui.h
+++ b/tests/auto/tools/uic/baseline/finddialog.ui.h
@@ -77,7 +77,7 @@ public:
void setupUi(QDialog *FindDialog)
{
if (FindDialog->objectName().isEmpty())
- FindDialog->setObjectName(QStringLiteral("FindDialog"));
+ FindDialog->setObjectName(QString::fromUtf8("FindDialog"));
FindDialog->resize(414, 170);
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
sizePolicy.setHorizontalStretch(0);
@@ -87,22 +87,22 @@ public:
hboxLayout = new QHBoxLayout(FindDialog);
hboxLayout->setSpacing(6);
hboxLayout->setContentsMargins(11, 11, 11, 11);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
vboxLayout = new QVBoxLayout();
vboxLayout->setSpacing(6);
vboxLayout->setContentsMargins(0, 0, 0, 0);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
hboxLayout1 = new QHBoxLayout();
hboxLayout1->setSpacing(6);
hboxLayout1->setContentsMargins(0, 0, 0, 0);
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
findWhat = new QLabel(FindDialog);
- findWhat->setObjectName(QStringLiteral("findWhat"));
+ findWhat->setObjectName(QString::fromUtf8("findWhat"));
hboxLayout1->addWidget(findWhat);
led = new QLineEdit(FindDialog);
- led->setObjectName(QStringLiteral("led"));
+ led->setObjectName(QString::fromUtf8("led"));
hboxLayout1->addWidget(led);
@@ -110,36 +110,36 @@ public:
vboxLayout->addLayout(hboxLayout1);
groupBox = new QGroupBox(FindDialog);
- groupBox->setObjectName(QStringLiteral("groupBox"));
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
gridLayout = new QGridLayout(groupBox);
gridLayout->setSpacing(6);
gridLayout->setContentsMargins(9, 9, 9, 9);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
sourceText = new QCheckBox(groupBox);
- sourceText->setObjectName(QStringLiteral("sourceText"));
+ sourceText->setObjectName(QString::fromUtf8("sourceText"));
sourceText->setChecked(true);
gridLayout->addWidget(sourceText, 1, 0, 1, 1);
translations = new QCheckBox(groupBox);
- translations->setObjectName(QStringLiteral("translations"));
+ translations->setObjectName(QString::fromUtf8("translations"));
translations->setChecked(true);
gridLayout->addWidget(translations, 2, 0, 1, 1);
matchCase = new QCheckBox(groupBox);
- matchCase->setObjectName(QStringLiteral("matchCase"));
+ matchCase->setObjectName(QString::fromUtf8("matchCase"));
gridLayout->addWidget(matchCase, 0, 1, 1, 1);
comments = new QCheckBox(groupBox);
- comments->setObjectName(QStringLiteral("comments"));
+ comments->setObjectName(QString::fromUtf8("comments"));
comments->setChecked(true);
gridLayout->addWidget(comments, 0, 0, 1, 1);
ignoreAccelerators = new QCheckBox(groupBox);
- ignoreAccelerators->setObjectName(QStringLiteral("ignoreAccelerators"));
+ ignoreAccelerators->setObjectName(QString::fromUtf8("ignoreAccelerators"));
ignoreAccelerators->setChecked(true);
gridLayout->addWidget(ignoreAccelerators, 1, 1, 1, 1);
@@ -153,15 +153,15 @@ public:
vboxLayout1 = new QVBoxLayout();
vboxLayout1->setSpacing(6);
vboxLayout1->setContentsMargins(0, 0, 0, 0);
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
findNxt = new QPushButton(FindDialog);
- findNxt->setObjectName(QStringLiteral("findNxt"));
+ findNxt->setObjectName(QString::fromUtf8("findNxt"));
findNxt->setFlat(false);
vboxLayout1->addWidget(findNxt);
cancel = new QPushButton(FindDialog);
- cancel->setObjectName(QStringLiteral("cancel"));
+ cancel->setObjectName(QString::fromUtf8("cancel"));
vboxLayout1->addWidget(cancel);
diff --git a/tests/auto/tools/uic/baseline/form.ui.h b/tests/auto/tools/uic/baseline/form.ui.h
index fc4f3e079c..ecc63e339b 100644
--- a/tests/auto/tools/uic/baseline/form.ui.h
+++ b/tests/auto/tools/uic/baseline/form.ui.h
@@ -40,7 +40,7 @@ public:
void setupUi(QWidget *WorldTimeForm)
{
if (WorldTimeForm->objectName().isEmpty())
- WorldTimeForm->setObjectName(QStringLiteral("WorldTimeForm"));
+ WorldTimeForm->setObjectName(QString::fromUtf8("WorldTimeForm"));
WorldTimeForm->resize(400, 300);
hboxLayout = new QHBoxLayout(WorldTimeForm);
#ifndef Q_OS_MAC
@@ -49,9 +49,9 @@ public:
#ifndef Q_OS_MAC
hboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
worldTimeClock = new WorldTimeClock(WorldTimeForm);
- worldTimeClock->setObjectName(QStringLiteral("worldTimeClock"));
+ worldTimeClock->setObjectName(QString::fromUtf8("worldTimeClock"));
hboxLayout->addWidget(worldTimeClock);
@@ -60,7 +60,7 @@ public:
vboxLayout->setSpacing(6);
#endif
vboxLayout->setContentsMargins(1, 1, 1, 1);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
spacerItem = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
vboxLayout->addItem(spacerItem);
@@ -70,14 +70,14 @@ public:
hboxLayout1->setSpacing(6);
#endif
hboxLayout1->setContentsMargins(1, 1, 1, 1);
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
label = new QLabel(WorldTimeForm);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
hboxLayout1->addWidget(label);
timeEdit = new QTimeEdit(WorldTimeForm);
- timeEdit->setObjectName(QStringLiteral("timeEdit"));
+ timeEdit->setObjectName(QString::fromUtf8("timeEdit"));
timeEdit->setReadOnly(true);
hboxLayout1->addWidget(timeEdit);
@@ -90,14 +90,14 @@ public:
hboxLayout2->setSpacing(6);
#endif
hboxLayout2->setContentsMargins(1, 1, 1, 1);
- hboxLayout2->setObjectName(QStringLiteral("hboxLayout2"));
+ hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2"));
label_2 = new QLabel(WorldTimeForm);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
hboxLayout2->addWidget(label_2);
spinBox = new QSpinBox(WorldTimeForm);
- spinBox->setObjectName(QStringLiteral("spinBox"));
+ spinBox->setObjectName(QString::fromUtf8("spinBox"));
spinBox->setMaximum(12);
spinBox->setMinimum(-12);
diff --git a/tests/auto/tools/uic/baseline/formwindowsettings.ui.h b/tests/auto/tools/uic/baseline/formwindowsettings.ui.h
index 349ef9ac80..d2cfa03edb 100644
--- a/tests/auto/tools/uic/baseline/formwindowsettings.ui.h
+++ b/tests/auto/tools/uic/baseline/formwindowsettings.ui.h
@@ -92,19 +92,19 @@ public:
void setupUi(QDialog *FormWindowSettings)
{
if (FormWindowSettings->objectName().isEmpty())
- FormWindowSettings->setObjectName(QStringLiteral("FormWindowSettings"));
+ FormWindowSettings->setObjectName(QString::fromUtf8("FormWindowSettings"));
FormWindowSettings->resize(433, 465);
gridLayout = new QGridLayout(FormWindowSettings);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
buttonBox = new QDialogButtonBox(FormWindowSettings);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok);
gridLayout->addWidget(buttonBox, 6, 0, 1, 2);
line = new QFrame(FormWindowSettings);
- line->setObjectName(QStringLiteral("line"));
+ line->setObjectName(QString::fromUtf8("line"));
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
@@ -115,33 +115,33 @@ public:
hboxLayout->setSpacing(6);
#endif
hboxLayout->setContentsMargins(0, 0, 0, 0);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
layoutDefaultGroupBox = new QGroupBox(FormWindowSettings);
- layoutDefaultGroupBox->setObjectName(QStringLiteral("layoutDefaultGroupBox"));
+ layoutDefaultGroupBox->setObjectName(QString::fromUtf8("layoutDefaultGroupBox"));
layoutDefaultGroupBox->setCheckable(true);
gridLayout1 = new QGridLayout(layoutDefaultGroupBox);
#ifndef Q_OS_MAC
gridLayout1->setSpacing(6);
#endif
gridLayout1->setContentsMargins(8, 8, 8, 8);
- gridLayout1->setObjectName(QStringLiteral("gridLayout1"));
+ gridLayout1->setObjectName(QString::fromUtf8("gridLayout1"));
label_2 = new QLabel(layoutDefaultGroupBox);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
gridLayout1->addWidget(label_2, 1, 0, 1, 1);
label = new QLabel(layoutDefaultGroupBox);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout1->addWidget(label, 0, 0, 1, 1);
defaultSpacingSpinBox = new QSpinBox(layoutDefaultGroupBox);
- defaultSpacingSpinBox->setObjectName(QStringLiteral("defaultSpacingSpinBox"));
+ defaultSpacingSpinBox->setObjectName(QString::fromUtf8("defaultSpacingSpinBox"));
gridLayout1->addWidget(defaultSpacingSpinBox, 1, 1, 1, 1);
defaultMarginSpinBox = new QSpinBox(layoutDefaultGroupBox);
- defaultMarginSpinBox->setObjectName(QStringLiteral("defaultMarginSpinBox"));
+ defaultMarginSpinBox->setObjectName(QString::fromUtf8("defaultMarginSpinBox"));
gridLayout1->addWidget(defaultMarginSpinBox, 0, 1, 1, 1);
@@ -149,31 +149,31 @@ public:
hboxLayout->addWidget(layoutDefaultGroupBox);
layoutFunctionGroupBox = new QGroupBox(FormWindowSettings);
- layoutFunctionGroupBox->setObjectName(QStringLiteral("layoutFunctionGroupBox"));
+ layoutFunctionGroupBox->setObjectName(QString::fromUtf8("layoutFunctionGroupBox"));
layoutFunctionGroupBox->setCheckable(true);
gridLayout2 = new QGridLayout(layoutFunctionGroupBox);
#ifndef Q_OS_MAC
gridLayout2->setSpacing(6);
#endif
gridLayout2->setContentsMargins(8, 8, 8, 8);
- gridLayout2->setObjectName(QStringLiteral("gridLayout2"));
+ gridLayout2->setObjectName(QString::fromUtf8("gridLayout2"));
spacingFunctionLineEdit = new QLineEdit(layoutFunctionGroupBox);
- spacingFunctionLineEdit->setObjectName(QStringLiteral("spacingFunctionLineEdit"));
+ spacingFunctionLineEdit->setObjectName(QString::fromUtf8("spacingFunctionLineEdit"));
gridLayout2->addWidget(spacingFunctionLineEdit, 1, 1, 1, 1);
marginFunctionLineEdit = new QLineEdit(layoutFunctionGroupBox);
- marginFunctionLineEdit->setObjectName(QStringLiteral("marginFunctionLineEdit"));
+ marginFunctionLineEdit->setObjectName(QString::fromUtf8("marginFunctionLineEdit"));
gridLayout2->addWidget(marginFunctionLineEdit, 0, 1, 1, 1);
label_3 = new QLabel(layoutFunctionGroupBox);
- label_3->setObjectName(QStringLiteral("label_3"));
+ label_3->setObjectName(QString::fromUtf8("label_3"));
gridLayout2->addWidget(label_3, 0, 0, 1, 1);
label_3_2 = new QLabel(layoutFunctionGroupBox);
- label_3_2->setObjectName(QStringLiteral("label_3_2"));
+ label_3_2->setObjectName(QString::fromUtf8("label_3_2"));
gridLayout2->addWidget(label_3_2, 1, 0, 1, 1);
@@ -184,15 +184,15 @@ public:
gridLayout->addLayout(hboxLayout, 2, 0, 1, 2);
pixmapFunctionGroupBox_2 = new QGroupBox(FormWindowSettings);
- pixmapFunctionGroupBox_2->setObjectName(QStringLiteral("pixmapFunctionGroupBox_2"));
+ pixmapFunctionGroupBox_2->setObjectName(QString::fromUtf8("pixmapFunctionGroupBox_2"));
vboxLayout = new QVBoxLayout(pixmapFunctionGroupBox_2);
#ifndef Q_OS_MAC
vboxLayout->setSpacing(6);
#endif
vboxLayout->setContentsMargins(8, 8, 8, 8);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
authorLineEdit = new QLineEdit(pixmapFunctionGroupBox_2);
- authorLineEdit->setObjectName(QStringLiteral("authorLineEdit"));
+ authorLineEdit->setObjectName(QString::fromUtf8("authorLineEdit"));
vboxLayout->addWidget(authorLineEdit);
@@ -200,15 +200,15 @@ public:
gridLayout->addWidget(pixmapFunctionGroupBox_2, 0, 0, 1, 2);
includeHintsGroupBox = new QGroupBox(FormWindowSettings);
- includeHintsGroupBox->setObjectName(QStringLiteral("includeHintsGroupBox"));
+ includeHintsGroupBox->setObjectName(QString::fromUtf8("includeHintsGroupBox"));
vboxLayout1 = new QVBoxLayout(includeHintsGroupBox);
#ifndef Q_OS_MAC
vboxLayout1->setSpacing(6);
#endif
vboxLayout1->setContentsMargins(8, 8, 8, 8);
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
includeHintsTextEdit = new QTextEdit(includeHintsGroupBox);
- includeHintsTextEdit->setObjectName(QStringLiteral("includeHintsTextEdit"));
+ includeHintsTextEdit->setObjectName(QString::fromUtf8("includeHintsTextEdit"));
vboxLayout1->addWidget(includeHintsTextEdit);
@@ -220,18 +220,18 @@ public:
hboxLayout1->setSpacing(6);
#endif
hboxLayout1->setContentsMargins(0, 0, 0, 0);
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
pixmapFunctionGroupBox = new QGroupBox(FormWindowSettings);
- pixmapFunctionGroupBox->setObjectName(QStringLiteral("pixmapFunctionGroupBox"));
+ pixmapFunctionGroupBox->setObjectName(QString::fromUtf8("pixmapFunctionGroupBox"));
pixmapFunctionGroupBox->setCheckable(true);
vboxLayout2 = new QVBoxLayout(pixmapFunctionGroupBox);
#ifndef Q_OS_MAC
vboxLayout2->setSpacing(6);
#endif
vboxLayout2->setContentsMargins(8, 8, 8, 8);
- vboxLayout2->setObjectName(QStringLiteral("vboxLayout2"));
+ vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2"));
pixmapFunctionLineEdit = new QLineEdit(pixmapFunctionGroupBox);
- pixmapFunctionLineEdit->setObjectName(QStringLiteral("pixmapFunctionLineEdit"));
+ pixmapFunctionLineEdit->setObjectName(QString::fromUtf8("pixmapFunctionLineEdit"));
vboxLayout2->addWidget(pixmapFunctionLineEdit);
@@ -246,7 +246,7 @@ public:
gridLayout->addItem(spacerItem, 4, 1, 1, 1);
gridPanel = new qdesigner_internal::GridPanel(FormWindowSettings);
- gridPanel->setObjectName(QStringLiteral("gridPanel"));
+ gridPanel->setObjectName(QString::fromUtf8("gridPanel"));
gridLayout->addWidget(gridPanel, 1, 0, 1, 2);
diff --git a/tests/auto/tools/uic/baseline/generalpage.ui.h b/tests/auto/tools/uic/baseline/generalpage.ui.h
index cb0c4e92c4..bd04285d28 100644
--- a/tests/auto/tools/uic/baseline/generalpage.ui.h
+++ b/tests/auto/tools/uic/baseline/generalpage.ui.h
@@ -33,27 +33,27 @@ public:
void setupUi(QWidget *GeneralPage)
{
if (GeneralPage->objectName().isEmpty())
- GeneralPage->setObjectName(QStringLiteral("GeneralPage"));
+ GeneralPage->setObjectName(QString::fromUtf8("GeneralPage"));
GeneralPage->resize(417, 243);
gridLayout = new QGridLayout(GeneralPage);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
label = new QLabel(GeneralPage);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout->addWidget(label, 1, 0, 1, 1);
namespaceLineEdit = new QLineEdit(GeneralPage);
- namespaceLineEdit->setObjectName(QStringLiteral("namespaceLineEdit"));
+ namespaceLineEdit->setObjectName(QString::fromUtf8("namespaceLineEdit"));
gridLayout->addWidget(namespaceLineEdit, 1, 1, 1, 1);
label_2 = new QLabel(GeneralPage);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
gridLayout->addWidget(label_2, 2, 0, 1, 1);
folderLineEdit = new QLineEdit(GeneralPage);
- folderLineEdit->setObjectName(QStringLiteral("folderLineEdit"));
+ folderLineEdit->setObjectName(QString::fromUtf8("folderLineEdit"));
gridLayout->addWidget(folderLineEdit, 2, 1, 1, 1);
diff --git a/tests/auto/tools/uic/baseline/gridalignment.ui.h b/tests/auto/tools/uic/baseline/gridalignment.ui.h
index 8e243ce800..421f257c9a 100644
--- a/tests/auto/tools/uic/baseline/gridalignment.ui.h
+++ b/tests/auto/tools/uic/baseline/gridalignment.ui.h
@@ -29,27 +29,27 @@ public:
void setupUi(QWidget *Form)
{
if (Form->objectName().isEmpty())
- Form->setObjectName(QStringLiteral("Form"));
+ Form->setObjectName(QString::fromUtf8("Form"));
Form->resize(279, 163);
gridLayout = new QGridLayout(Form);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
pushButton = new QPushButton(Form);
- pushButton->setObjectName(QStringLiteral("pushButton"));
+ pushButton->setObjectName(QString::fromUtf8("pushButton"));
gridLayout->addWidget(pushButton, 0, 0, 1, 1, Qt::AlignLeft);
pushButton_3 = new QPushButton(Form);
- pushButton_3->setObjectName(QStringLiteral("pushButton_3"));
+ pushButton_3->setObjectName(QString::fromUtf8("pushButton_3"));
gridLayout->addWidget(pushButton_3, 0, 1, 1, 1, Qt::AlignTop);
pushButton_2 = new QPushButton(Form);
- pushButton_2->setObjectName(QStringLiteral("pushButton_2"));
+ pushButton_2->setObjectName(QString::fromUtf8("pushButton_2"));
gridLayout->addWidget(pushButton_2, 1, 0, 1, 1, Qt::AlignRight);
pushButton_4 = new QPushButton(Form);
- pushButton_4->setObjectName(QStringLiteral("pushButton_4"));
+ pushButton_4->setObjectName(QString::fromUtf8("pushButton_4"));
gridLayout->addWidget(pushButton_4, 1, 1, 1, 1, Qt::AlignBottom);
diff --git a/tests/auto/tools/uic/baseline/gridpanel.ui.h b/tests/auto/tools/uic/baseline/gridpanel.ui.h
index feeff26013..858b71d0cc 100644
--- a/tests/auto/tools/uic/baseline/gridpanel.ui.h
+++ b/tests/auto/tools/uic/baseline/gridpanel.ui.h
@@ -46,17 +46,17 @@ public:
void setupUi(QWidget *qdesigner_internal__GridPanel)
{
if (qdesigner_internal__GridPanel->objectName().isEmpty())
- qdesigner_internal__GridPanel->setObjectName(QStringLiteral("qdesigner_internal__GridPanel"));
+ qdesigner_internal__GridPanel->setObjectName(QString::fromUtf8("qdesigner_internal__GridPanel"));
qdesigner_internal__GridPanel->resize(393, 110);
vboxLayout = new QVBoxLayout(qdesigner_internal__GridPanel);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
vboxLayout->setContentsMargins(0, 0, 0, 0);
m_gridGroupBox = new QGroupBox(qdesigner_internal__GridPanel);
- m_gridGroupBox->setObjectName(QStringLiteral("m_gridGroupBox"));
+ m_gridGroupBox->setObjectName(QString::fromUtf8("m_gridGroupBox"));
gridLayout = new QGridLayout(m_gridGroupBox);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
m_visibleCheckBox = new QCheckBox(m_gridGroupBox);
- m_visibleCheckBox->setObjectName(QStringLiteral("m_visibleCheckBox"));
+ m_visibleCheckBox->setObjectName(QString::fromUtf8("m_visibleCheckBox"));
QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -66,28 +66,28 @@ public:
gridLayout->addWidget(m_visibleCheckBox, 0, 0, 1, 1);
label = new QLabel(m_gridGroupBox);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout->addWidget(label, 0, 1, 1, 1);
m_deltaXSpinBox = new QSpinBox(m_gridGroupBox);
- m_deltaXSpinBox->setObjectName(QStringLiteral("m_deltaXSpinBox"));
+ m_deltaXSpinBox->setObjectName(QString::fromUtf8("m_deltaXSpinBox"));
m_deltaXSpinBox->setMinimum(2);
m_deltaXSpinBox->setMaximum(100);
gridLayout->addWidget(m_deltaXSpinBox, 0, 2, 1, 1);
m_snapXCheckBox = new QCheckBox(m_gridGroupBox);
- m_snapXCheckBox->setObjectName(QStringLiteral("m_snapXCheckBox"));
+ m_snapXCheckBox->setObjectName(QString::fromUtf8("m_snapXCheckBox"));
sizePolicy.setHeightForWidth(m_snapXCheckBox->sizePolicy().hasHeightForWidth());
m_snapXCheckBox->setSizePolicy(sizePolicy);
gridLayout->addWidget(m_snapXCheckBox, 0, 3, 1, 1);
hboxLayout = new QHBoxLayout();
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
m_resetButton = new QPushButton(m_gridGroupBox);
- m_resetButton->setObjectName(QStringLiteral("m_resetButton"));
+ m_resetButton->setObjectName(QString::fromUtf8("m_resetButton"));
hboxLayout->addWidget(m_resetButton);
@@ -99,19 +99,19 @@ public:
gridLayout->addLayout(hboxLayout, 1, 0, 1, 1);
label_2 = new QLabel(m_gridGroupBox);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
gridLayout->addWidget(label_2, 1, 1, 1, 1);
m_deltaYSpinBox = new QSpinBox(m_gridGroupBox);
- m_deltaYSpinBox->setObjectName(QStringLiteral("m_deltaYSpinBox"));
+ m_deltaYSpinBox->setObjectName(QString::fromUtf8("m_deltaYSpinBox"));
m_deltaYSpinBox->setMinimum(2);
m_deltaYSpinBox->setMaximum(100);
gridLayout->addWidget(m_deltaYSpinBox, 1, 2, 1, 1);
m_snapYCheckBox = new QCheckBox(m_gridGroupBox);
- m_snapYCheckBox->setObjectName(QStringLiteral("m_snapYCheckBox"));
+ m_snapYCheckBox->setObjectName(QString::fromUtf8("m_snapYCheckBox"));
sizePolicy.setHeightForWidth(m_snapYCheckBox->sizePolicy().hasHeightForWidth());
m_snapYCheckBox->setSizePolicy(sizePolicy);
diff --git a/tests/auto/tools/uic/baseline/helpdialog.ui.h b/tests/auto/tools/uic/baseline/helpdialog.ui.h
index 7c584639c2..abcf280cf9 100644
--- a/tests/auto/tools/uic/baseline/helpdialog.ui.h
+++ b/tests/auto/tools/uic/baseline/helpdialog.ui.h
@@ -98,26 +98,26 @@ public:
void setupUi(QWidget *HelpDialog)
{
if (HelpDialog->objectName().isEmpty())
- HelpDialog->setObjectName(QStringLiteral("HelpDialog"));
+ HelpDialog->setObjectName(QString::fromUtf8("HelpDialog"));
HelpDialog->resize(274, 417);
vboxLayout = new QVBoxLayout(HelpDialog);
#ifndef Q_OS_MAC
vboxLayout->setSpacing(6);
#endif
vboxLayout->setContentsMargins(0, 0, 0, 0);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
tabWidget = new QTabWidget(HelpDialog);
- tabWidget->setObjectName(QStringLiteral("tabWidget"));
+ tabWidget->setObjectName(QString::fromUtf8("tabWidget"));
contentPage = new QWidget();
- contentPage->setObjectName(QStringLiteral("contentPage"));
+ contentPage->setObjectName(QString::fromUtf8("contentPage"));
vboxLayout1 = new QVBoxLayout(contentPage);
#ifndef Q_OS_MAC
vboxLayout1->setSpacing(6);
#endif
vboxLayout1->setContentsMargins(5, 5, 5, 5);
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
listContents = new QTreeWidget(contentPage);
- listContents->setObjectName(QStringLiteral("listContents"));
+ listContents->setObjectName(QString::fromUtf8("listContents"));
listContents->setContextMenuPolicy(Qt::CustomContextMenu);
listContents->setRootIsDecorated(true);
listContents->setUniformRowHeights(true);
@@ -126,40 +126,40 @@ public:
tabWidget->addTab(contentPage, QString());
indexPage = new QWidget();
- indexPage->setObjectName(QStringLiteral("indexPage"));
+ indexPage->setObjectName(QString::fromUtf8("indexPage"));
vboxLayout2 = new QVBoxLayout(indexPage);
#ifndef Q_OS_MAC
vboxLayout2->setSpacing(6);
#endif
vboxLayout2->setContentsMargins(5, 5, 5, 5);
- vboxLayout2->setObjectName(QStringLiteral("vboxLayout2"));
+ vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2"));
TextLabel1 = new QLabel(indexPage);
- TextLabel1->setObjectName(QStringLiteral("TextLabel1"));
+ TextLabel1->setObjectName(QString::fromUtf8("TextLabel1"));
vboxLayout2->addWidget(TextLabel1);
editIndex = new QLineEdit(indexPage);
- editIndex->setObjectName(QStringLiteral("editIndex"));
+ editIndex->setObjectName(QString::fromUtf8("editIndex"));
vboxLayout2->addWidget(editIndex);
listIndex = new QListView(indexPage);
- listIndex->setObjectName(QStringLiteral("listIndex"));
+ listIndex->setObjectName(QString::fromUtf8("listIndex"));
listIndex->setContextMenuPolicy(Qt::CustomContextMenu);
vboxLayout2->addWidget(listIndex);
tabWidget->addTab(indexPage, QString());
bookmarkPage = new QWidget();
- bookmarkPage->setObjectName(QStringLiteral("bookmarkPage"));
+ bookmarkPage->setObjectName(QString::fromUtf8("bookmarkPage"));
vboxLayout3 = new QVBoxLayout(bookmarkPage);
#ifndef Q_OS_MAC
vboxLayout3->setSpacing(6);
#endif
vboxLayout3->setContentsMargins(5, 5, 5, 5);
- vboxLayout3->setObjectName(QStringLiteral("vboxLayout3"));
+ vboxLayout3->setObjectName(QString::fromUtf8("vboxLayout3"));
listBookmarks = new QTreeWidget(bookmarkPage);
- listBookmarks->setObjectName(QStringLiteral("listBookmarks"));
+ listBookmarks->setObjectName(QString::fromUtf8("listBookmarks"));
listBookmarks->setContextMenuPolicy(Qt::CustomContextMenu);
listBookmarks->setUniformRowHeights(true);
@@ -170,18 +170,18 @@ public:
hboxLayout->setSpacing(6);
#endif
hboxLayout->setContentsMargins(0, 0, 0, 0);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
spacerItem = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout->addItem(spacerItem);
buttonAdd = new QPushButton(bookmarkPage);
- buttonAdd->setObjectName(QStringLiteral("buttonAdd"));
+ buttonAdd->setObjectName(QString::fromUtf8("buttonAdd"));
hboxLayout->addWidget(buttonAdd);
buttonRemove = new QPushButton(bookmarkPage);
- buttonRemove->setObjectName(QStringLiteral("buttonRemove"));
+ buttonRemove->setObjectName(QString::fromUtf8("buttonRemove"));
hboxLayout->addWidget(buttonRemove);
@@ -190,35 +190,35 @@ public:
tabWidget->addTab(bookmarkPage, QString());
searchPage = new QWidget();
- searchPage->setObjectName(QStringLiteral("searchPage"));
+ searchPage->setObjectName(QString::fromUtf8("searchPage"));
gridLayout = new QGridLayout(searchPage);
#ifndef Q_OS_MAC
gridLayout->setSpacing(6);
#endif
gridLayout->setContentsMargins(5, 5, 5, 5);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
spacerItem1 = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Fixed);
gridLayout->addItem(spacerItem1, 3, 0, 1, 1);
TextLabel1_2 = new QLabel(searchPage);
- TextLabel1_2->setObjectName(QStringLiteral("TextLabel1_2"));
+ TextLabel1_2->setObjectName(QString::fromUtf8("TextLabel1_2"));
gridLayout->addWidget(TextLabel1_2, 0, 0, 1, 1);
termsEdit = new QLineEdit(searchPage);
- termsEdit->setObjectName(QStringLiteral("termsEdit"));
+ termsEdit->setObjectName(QString::fromUtf8("termsEdit"));
gridLayout->addWidget(termsEdit, 1, 0, 1, 1);
resultBox = new QListWidget(searchPage);
- resultBox->setObjectName(QStringLiteral("resultBox"));
+ resultBox->setObjectName(QString::fromUtf8("resultBox"));
resultBox->setContextMenuPolicy(Qt::CustomContextMenu);
gridLayout->addWidget(resultBox, 5, 0, 1, 1);
TextLabel2 = new QLabel(searchPage);
- TextLabel2->setObjectName(QStringLiteral("TextLabel2"));
+ TextLabel2->setObjectName(QString::fromUtf8("TextLabel2"));
gridLayout->addWidget(TextLabel2, 4, 0, 1, 1);
@@ -227,9 +227,9 @@ public:
hboxLayout1->setSpacing(6);
#endif
hboxLayout1->setContentsMargins(1, 1, 1, 1);
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
helpButton = new QPushButton(searchPage);
- helpButton->setObjectName(QStringLiteral("helpButton"));
+ helpButton->setObjectName(QString::fromUtf8("helpButton"));
hboxLayout1->addWidget(helpButton);
@@ -238,7 +238,7 @@ public:
hboxLayout1->addItem(spacerItem2);
searchButton = new QPushButton(searchPage);
- searchButton->setObjectName(QStringLiteral("searchButton"));
+ searchButton->setObjectName(QString::fromUtf8("searchButton"));
searchButton->setEnabled(false);
hboxLayout1->addWidget(searchButton);
@@ -251,7 +251,7 @@ public:
vboxLayout->addWidget(tabWidget);
framePrepare = new QFrame(HelpDialog);
- framePrepare->setObjectName(QStringLiteral("framePrepare"));
+ framePrepare->setObjectName(QString::fromUtf8("framePrepare"));
framePrepare->setFrameShape(QFrame::StyledPanel);
framePrepare->setFrameShadow(QFrame::Raised);
hboxLayout2 = new QHBoxLayout(framePrepare);
@@ -259,14 +259,14 @@ public:
hboxLayout2->setSpacing(6);
#endif
hboxLayout2->setContentsMargins(3, 3, 3, 3);
- hboxLayout2->setObjectName(QStringLiteral("hboxLayout2"));
+ hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2"));
labelPrepare = new QLabel(framePrepare);
- labelPrepare->setObjectName(QStringLiteral("labelPrepare"));
+ labelPrepare->setObjectName(QString::fromUtf8("labelPrepare"));
hboxLayout2->addWidget(labelPrepare);
progressPrepare = new QProgressBar(framePrepare);
- progressPrepare->setObjectName(QStringLiteral("progressPrepare"));
+ progressPrepare->setObjectName(QString::fromUtf8("progressPrepare"));
hboxLayout2->addWidget(progressPrepare);
diff --git a/tests/auto/tools/uic/baseline/history.ui.h b/tests/auto/tools/uic/baseline/history.ui.h
index f9050de854..715312d11a 100644
--- a/tests/auto/tools/uic/baseline/history.ui.h
+++ b/tests/auto/tools/uic/baseline/history.ui.h
@@ -39,33 +39,33 @@ public:
void setupUi(QDialog *HistoryDialog)
{
if (HistoryDialog->objectName().isEmpty())
- HistoryDialog->setObjectName(QStringLiteral("HistoryDialog"));
+ HistoryDialog->setObjectName(QString::fromUtf8("HistoryDialog"));
HistoryDialog->resize(758, 450);
gridLayout = new QGridLayout(HistoryDialog);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
spacerItem = new QSpacerItem(252, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
gridLayout->addItem(spacerItem, 0, 0, 1, 1);
search = new SearchLineEdit(HistoryDialog);
- search->setObjectName(QStringLiteral("search"));
+ search->setObjectName(QString::fromUtf8("search"));
gridLayout->addWidget(search, 0, 1, 1, 1);
tree = new EditTreeView(HistoryDialog);
- tree->setObjectName(QStringLiteral("tree"));
+ tree->setObjectName(QString::fromUtf8("tree"));
gridLayout->addWidget(tree, 1, 0, 1, 2);
hboxLayout = new QHBoxLayout();
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
removeButton = new QPushButton(HistoryDialog);
- removeButton->setObjectName(QStringLiteral("removeButton"));
+ removeButton->setObjectName(QString::fromUtf8("removeButton"));
hboxLayout->addWidget(removeButton);
removeAllButton = new QPushButton(HistoryDialog);
- removeAllButton->setObjectName(QStringLiteral("removeAllButton"));
+ removeAllButton->setObjectName(QString::fromUtf8("removeAllButton"));
hboxLayout->addWidget(removeAllButton);
@@ -74,7 +74,7 @@ public:
hboxLayout->addItem(spacerItem1);
buttonBox = new QDialogButtonBox(HistoryDialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setStandardButtons(QDialogButtonBox::Ok);
hboxLayout->addWidget(buttonBox);
diff --git a/tests/auto/tools/uic/baseline/icontheme.ui.h b/tests/auto/tools/uic/baseline/icontheme.ui.h
index 75a1b648cd..936d6b5cf7 100644
--- a/tests/auto/tools/uic/baseline/icontheme.ui.h
+++ b/tests/auto/tools/uic/baseline/icontheme.ui.h
@@ -29,39 +29,39 @@ public:
void setupUi(QWidget *Form)
{
if (Form->objectName().isEmpty())
- Form->setObjectName(QStringLiteral("Form"));
+ Form->setObjectName(QString::fromUtf8("Form"));
Form->resize(122, 117);
verticalLayout = new QVBoxLayout(Form);
- verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
fileicon = new QPushButton(Form);
- fileicon->setObjectName(QStringLiteral("fileicon"));
+ fileicon->setObjectName(QString::fromUtf8("fileicon"));
QIcon icon;
- icon.addFile(QStringLiteral("image1.png"), QSize(), QIcon::Normal, QIcon::Off);
+ icon.addFile(QString::fromUtf8("image1.png"), QSize(), QIcon::Normal, QIcon::Off);
fileicon->setIcon(icon);
verticalLayout->addWidget(fileicon);
fileandthemeicon = new QPushButton(Form);
- fileandthemeicon->setObjectName(QStringLiteral("fileandthemeicon"));
+ fileandthemeicon->setObjectName(QString::fromUtf8("fileandthemeicon"));
QIcon icon1;
- QString iconThemeName = QStringLiteral("edit-copy");
+ QString iconThemeName = QString::fromUtf8("edit-copy");
if (QIcon::hasThemeIcon(iconThemeName)) {
icon1 = QIcon::fromTheme(iconThemeName);
} else {
- icon1.addFile(QStringLiteral("image7.png"), QSize(), QIcon::Normal, QIcon::Off);
+ icon1.addFile(QString::fromUtf8("image7.png"), QSize(), QIcon::Normal, QIcon::Off);
}
fileandthemeicon->setIcon(icon1);
verticalLayout->addWidget(fileandthemeicon);
themeicon = new QPushButton(Form);
- themeicon->setObjectName(QStringLiteral("themeicon"));
+ themeicon->setObjectName(QString::fromUtf8("themeicon"));
QIcon icon2;
- iconThemeName = QStringLiteral("edit-copy");
+ iconThemeName = QString::fromUtf8("edit-copy");
if (QIcon::hasThemeIcon(iconThemeName)) {
icon2 = QIcon::fromTheme(iconThemeName);
} else {
- icon2.addFile(QStringLiteral(""), QSize(), QIcon::Normal, QIcon::Off);
+ icon2.addFile(QString::fromUtf8(""), QSize(), QIcon::Normal, QIcon::Off);
}
themeicon->setIcon(icon2);
diff --git a/tests/auto/tools/uic/baseline/idbased.ui.h b/tests/auto/tools/uic/baseline/idbased.ui.h
index dbcd92a839..e246313e11 100644
--- a/tests/auto/tools/uic/baseline/idbased.ui.h
+++ b/tests/auto/tools/uic/baseline/idbased.ui.h
@@ -26,12 +26,12 @@ public:
void setupUi(QWidget *Form)
{
if (Form->objectName().isEmpty())
- Form->setObjectName(QStringLiteral("Form"));
+ Form->setObjectName(QString::fromUtf8("Form"));
Form->resize(400, 300);
verticalLayout = new QVBoxLayout(Form);
- verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
pushButton = new QPushButton(Form);
- pushButton->setObjectName(QStringLiteral("pushButton"));
+ pushButton->setObjectName(QString::fromUtf8("pushButton"));
verticalLayout->addWidget(pushButton);
diff --git a/tests/auto/tools/uic/baseline/identifierpage.ui.h b/tests/auto/tools/uic/baseline/identifierpage.ui.h
index d16333cc9c..322a9cf30a 100644
--- a/tests/auto/tools/uic/baseline/identifierpage.ui.h
+++ b/tests/auto/tools/uic/baseline/identifierpage.ui.h
@@ -36,16 +36,16 @@ public:
void setupUi(QWidget *IdentifierPage)
{
if (IdentifierPage->objectName().isEmpty())
- IdentifierPage->setObjectName(QStringLiteral("IdentifierPage"));
+ IdentifierPage->setObjectName(QString::fromUtf8("IdentifierPage"));
IdentifierPage->resize(417, 242);
gridLayout = new QGridLayout(IdentifierPage);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
spacerItem = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Fixed);
gridLayout->addItem(spacerItem, 0, 1, 1, 1);
identifierCheckBox = new QCheckBox(IdentifierPage);
- identifierCheckBox->setObjectName(QStringLiteral("identifierCheckBox"));
+ identifierCheckBox->setObjectName(QString::fromUtf8("identifierCheckBox"));
gridLayout->addWidget(identifierCheckBox, 1, 0, 1, 3);
@@ -58,20 +58,20 @@ public:
gridLayout->addItem(spacerItem2, 2, 0, 1, 1);
globalButton = new QRadioButton(IdentifierPage);
- globalButton->setObjectName(QStringLiteral("globalButton"));
+ globalButton->setObjectName(QString::fromUtf8("globalButton"));
globalButton->setEnabled(false);
globalButton->setChecked(true);
gridLayout->addWidget(globalButton, 2, 1, 1, 1);
prefixLineEdit = new QLineEdit(IdentifierPage);
- prefixLineEdit->setObjectName(QStringLiteral("prefixLineEdit"));
+ prefixLineEdit->setObjectName(QString::fromUtf8("prefixLineEdit"));
prefixLineEdit->setEnabled(false);
gridLayout->addWidget(prefixLineEdit, 2, 2, 1, 1);
fileNameButton = new QRadioButton(IdentifierPage);
- fileNameButton->setObjectName(QStringLiteral("fileNameButton"));
+ fileNameButton->setObjectName(QString::fromUtf8("fileNameButton"));
fileNameButton->setEnabled(false);
gridLayout->addWidget(fileNameButton, 3, 1, 1, 2);
diff --git a/tests/auto/tools/uic/baseline/imagedialog.ui.h b/tests/auto/tools/uic/baseline/imagedialog.ui.h
index 29a30d1996..e32e7639fa 100644
--- a/tests/auto/tools/uic/baseline/imagedialog.ui.h
+++ b/tests/auto/tools/uic/baseline/imagedialog.ui.h
@@ -46,8 +46,8 @@ public:
void setupUi(QDialog *dialog)
{
if (dialog->objectName().isEmpty())
- dialog->setObjectName(QStringLiteral("dialog"));
- dialog->setObjectName(QStringLiteral("ImageDialog"));
+ dialog->setObjectName(QString::fromUtf8("dialog"));
+ dialog->setObjectName(QString::fromUtf8("ImageDialog"));
dialog->resize(320, 180);
vboxLayout = new QVBoxLayout(dialog);
#ifndef Q_OS_MAC
@@ -56,17 +56,17 @@ public:
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
- vboxLayout->setObjectName(QStringLiteral(""));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8(""));
gridLayout = new QGridLayout();
#ifndef Q_OS_MAC
gridLayout->setSpacing(6);
#endif
gridLayout->setContentsMargins(1, 1, 1, 1);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
- gridLayout->setObjectName(QStringLiteral(""));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8(""));
widthLabel = new QLabel(dialog);
- widthLabel->setObjectName(QStringLiteral("widthLabel"));
+ widthLabel->setObjectName(QString::fromUtf8("widthLabel"));
widthLabel->setGeometry(QRect(1, 27, 67, 22));
widthLabel->setFrameShape(QFrame::NoFrame);
widthLabel->setFrameShadow(QFrame::Plain);
@@ -75,7 +75,7 @@ public:
gridLayout->addWidget(widthLabel, 1, 0, 1, 1);
heightLabel = new QLabel(dialog);
- heightLabel->setObjectName(QStringLiteral("heightLabel"));
+ heightLabel->setObjectName(QString::fromUtf8("heightLabel"));
heightLabel->setGeometry(QRect(1, 55, 67, 22));
heightLabel->setFrameShape(QFrame::NoFrame);
heightLabel->setFrameShadow(QFrame::Plain);
@@ -84,7 +84,7 @@ public:
gridLayout->addWidget(heightLabel, 2, 0, 1, 1);
colorDepthCombo = new QComboBox(dialog);
- colorDepthCombo->setObjectName(QStringLiteral("colorDepthCombo"));
+ colorDepthCombo->setObjectName(QString::fromUtf8("colorDepthCombo"));
colorDepthCombo->setGeometry(QRect(74, 83, 227, 22));
QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(0));
sizePolicy.setHorizontalStretch(0);
@@ -96,7 +96,7 @@ public:
gridLayout->addWidget(colorDepthCombo, 3, 1, 1, 1);
nameLineEdit = new QLineEdit(dialog);
- nameLineEdit->setObjectName(QStringLiteral("nameLineEdit"));
+ nameLineEdit->setObjectName(QString::fromUtf8("nameLineEdit"));
nameLineEdit->setGeometry(QRect(74, 83, 227, 22));
QSizePolicy sizePolicy1(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(0));
sizePolicy1.setHorizontalStretch(1);
@@ -108,7 +108,7 @@ public:
gridLayout->addWidget(nameLineEdit, 0, 1, 1, 1);
spinBox = new QSpinBox(dialog);
- spinBox->setObjectName(QStringLiteral("spinBox"));
+ spinBox->setObjectName(QString::fromUtf8("spinBox"));
spinBox->setGeometry(QRect(74, 1, 227, 20));
sizePolicy.setHeightForWidth(spinBox->sizePolicy().hasHeightForWidth());
spinBox->setSizePolicy(sizePolicy);
@@ -120,7 +120,7 @@ public:
gridLayout->addWidget(spinBox, 1, 1, 1, 1);
spinBox_2 = new QSpinBox(dialog);
- spinBox_2->setObjectName(QStringLiteral("spinBox_2"));
+ spinBox_2->setObjectName(QString::fromUtf8("spinBox_2"));
spinBox_2->setGeometry(QRect(74, 27, 227, 22));
sizePolicy.setHeightForWidth(spinBox_2->sizePolicy().hasHeightForWidth());
spinBox_2->setSizePolicy(sizePolicy);
@@ -132,7 +132,7 @@ public:
gridLayout->addWidget(spinBox_2, 2, 1, 1, 1);
nameLabel = new QLabel(dialog);
- nameLabel->setObjectName(QStringLiteral("nameLabel"));
+ nameLabel->setObjectName(QString::fromUtf8("nameLabel"));
nameLabel->setGeometry(QRect(1, 1, 67, 20));
nameLabel->setFrameShape(QFrame::NoFrame);
nameLabel->setFrameShadow(QFrame::Plain);
@@ -141,7 +141,7 @@ public:
gridLayout->addWidget(nameLabel, 0, 0, 1, 1);
colorDepthLabel = new QLabel(dialog);
- colorDepthLabel->setObjectName(QStringLiteral("colorDepthLabel"));
+ colorDepthLabel->setObjectName(QString::fromUtf8("colorDepthLabel"));
colorDepthLabel->setGeometry(QRect(1, 83, 67, 22));
colorDepthLabel->setFrameShape(QFrame::NoFrame);
colorDepthLabel->setFrameShadow(QFrame::Plain);
@@ -161,20 +161,20 @@ public:
hboxLayout->setSpacing(6);
#endif
hboxLayout->setContentsMargins(1, 1, 1, 1);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
- hboxLayout->setObjectName(QStringLiteral(""));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8(""));
spacerItem1 = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout->addItem(spacerItem1);
okButton = new QPushButton(dialog);
- okButton->setObjectName(QStringLiteral("okButton"));
+ okButton->setObjectName(QString::fromUtf8("okButton"));
okButton->setGeometry(QRect(135, 1, 80, 24));
hboxLayout->addWidget(okButton);
cancelButton = new QPushButton(dialog);
- cancelButton->setObjectName(QStringLiteral("cancelButton"));
+ cancelButton->setObjectName(QString::fromUtf8("cancelButton"));
cancelButton->setGeometry(QRect(221, 1, 80, 24));
hboxLayout->addWidget(cancelButton);
diff --git a/tests/auto/tools/uic/baseline/inputpage.ui.h b/tests/auto/tools/uic/baseline/inputpage.ui.h
index fb7ae1ea6f..9367dec6df 100644
--- a/tests/auto/tools/uic/baseline/inputpage.ui.h
+++ b/tests/auto/tools/uic/baseline/inputpage.ui.h
@@ -35,16 +35,16 @@ public:
void setupUi(QWidget *InputPage)
{
if (InputPage->objectName().isEmpty())
- InputPage->setObjectName(QStringLiteral("InputPage"));
+ InputPage->setObjectName(QString::fromUtf8("InputPage"));
InputPage->resize(417, 242);
gridLayout = new QGridLayout(InputPage);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
spacerItem = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Fixed);
gridLayout->addItem(spacerItem, 0, 2, 1, 1);
label = new QLabel(InputPage);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -55,14 +55,14 @@ public:
hboxLayout = new QHBoxLayout();
hboxLayout->setSpacing(0);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
fileLineEdit = new QLineEdit(InputPage);
- fileLineEdit->setObjectName(QStringLiteral("fileLineEdit"));
+ fileLineEdit->setObjectName(QString::fromUtf8("fileLineEdit"));
hboxLayout->addWidget(fileLineEdit);
browseButton = new QToolButton(InputPage);
- browseButton->setObjectName(QStringLiteral("browseButton"));
+ browseButton->setObjectName(QString::fromUtf8("browseButton"));
hboxLayout->addWidget(browseButton);
diff --git a/tests/auto/tools/uic/baseline/installdialog.ui.h b/tests/auto/tools/uic/baseline/installdialog.ui.h
index 885488d2a7..3ec7f69b76 100644
--- a/tests/auto/tools/uic/baseline/installdialog.ui.h
+++ b/tests/auto/tools/uic/baseline/installdialog.ui.h
@@ -44,32 +44,32 @@ public:
void setupUi(QDialog *InstallDialog)
{
if (InstallDialog->objectName().isEmpty())
- InstallDialog->setObjectName(QStringLiteral("InstallDialog"));
+ InstallDialog->setObjectName(QString::fromUtf8("InstallDialog"));
InstallDialog->resize(436, 245);
gridLayout = new QGridLayout(InstallDialog);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
label = new QLabel(InstallDialog);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout->addWidget(label, 0, 0, 1, 4);
listWidget = new QListWidget(InstallDialog);
- listWidget->setObjectName(QStringLiteral("listWidget"));
+ listWidget->setObjectName(QString::fromUtf8("listWidget"));
gridLayout->addWidget(listWidget, 1, 0, 4, 4);
installButton = new QPushButton(InstallDialog);
- installButton->setObjectName(QStringLiteral("installButton"));
+ installButton->setObjectName(QString::fromUtf8("installButton"));
gridLayout->addWidget(installButton, 1, 4, 1, 1);
cancelButton = new QPushButton(InstallDialog);
- cancelButton->setObjectName(QStringLiteral("cancelButton"));
+ cancelButton->setObjectName(QString::fromUtf8("cancelButton"));
gridLayout->addWidget(cancelButton, 2, 4, 1, 1);
closeButton = new QPushButton(InstallDialog);
- closeButton->setObjectName(QStringLiteral("closeButton"));
+ closeButton->setObjectName(QString::fromUtf8("closeButton"));
gridLayout->addWidget(closeButton, 3, 4, 1, 1);
@@ -78,34 +78,34 @@ public:
gridLayout->addItem(spacerItem, 4, 4, 1, 1);
label_4 = new QLabel(InstallDialog);
- label_4->setObjectName(QStringLiteral("label_4"));
+ label_4->setObjectName(QString::fromUtf8("label_4"));
gridLayout->addWidget(label_4, 5, 0, 1, 1);
pathLineEdit = new QLineEdit(InstallDialog);
- pathLineEdit->setObjectName(QStringLiteral("pathLineEdit"));
+ pathLineEdit->setObjectName(QString::fromUtf8("pathLineEdit"));
gridLayout->addWidget(pathLineEdit, 5, 1, 1, 2);
browseButton = new QToolButton(InstallDialog);
- browseButton->setObjectName(QStringLiteral("browseButton"));
+ browseButton->setObjectName(QString::fromUtf8("browseButton"));
gridLayout->addWidget(browseButton, 5, 3, 1, 1);
line = new QFrame(InstallDialog);
- line->setObjectName(QStringLiteral("line"));
+ line->setObjectName(QString::fromUtf8("line"));
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
gridLayout->addWidget(line, 6, 0, 1, 5);
statusLabel = new QLabel(InstallDialog);
- statusLabel->setObjectName(QStringLiteral("statusLabel"));
+ statusLabel->setObjectName(QString::fromUtf8("statusLabel"));
gridLayout->addWidget(statusLabel, 7, 0, 1, 2);
progressBar = new QProgressBar(InstallDialog);
- progressBar->setObjectName(QStringLiteral("progressBar"));
+ progressBar->setObjectName(QString::fromUtf8("progressBar"));
progressBar->setValue(0);
progressBar->setOrientation(Qt::Horizontal);
diff --git a/tests/auto/tools/uic/baseline/languagesdialog.ui.h b/tests/auto/tools/uic/baseline/languagesdialog.ui.h
index 6f722a4e74..cf2599fd07 100644
--- a/tests/auto/tools/uic/baseline/languagesdialog.ui.h
+++ b/tests/auto/tools/uic/baseline/languagesdialog.ui.h
@@ -39,50 +39,50 @@ public:
void setupUi(QDialog *LanguagesDialog)
{
if (LanguagesDialog->objectName().isEmpty())
- LanguagesDialog->setObjectName(QStringLiteral("LanguagesDialog"));
+ LanguagesDialog->setObjectName(QString::fromUtf8("LanguagesDialog"));
LanguagesDialog->resize(400, 300);
verticalLayout = new QVBoxLayout(LanguagesDialog);
- verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
languagesList = new QTreeWidget(LanguagesDialog);
- languagesList->setObjectName(QStringLiteral("languagesList"));
+ languagesList->setObjectName(QString::fromUtf8("languagesList"));
languagesList->setIndentation(0);
verticalLayout->addWidget(languagesList);
hboxLayout = new QHBoxLayout();
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
upButton = new QToolButton(LanguagesDialog);
- upButton->setObjectName(QStringLiteral("upButton"));
+ upButton->setObjectName(QString::fromUtf8("upButton"));
upButton->setEnabled(false);
QIcon icon;
- icon.addFile(QStringLiteral(":/images/up.png"), QSize(), QIcon::Normal, QIcon::Off);
+ icon.addFile(QString::fromUtf8(":/images/up.png"), QSize(), QIcon::Normal, QIcon::Off);
upButton->setIcon(icon);
hboxLayout->addWidget(upButton);
downButton = new QToolButton(LanguagesDialog);
- downButton->setObjectName(QStringLiteral("downButton"));
+ downButton->setObjectName(QString::fromUtf8("downButton"));
downButton->setEnabled(false);
QIcon icon1;
- icon1.addFile(QStringLiteral(":/images/down.png"), QSize(), QIcon::Normal, QIcon::Off);
+ icon1.addFile(QString::fromUtf8(":/images/down.png"), QSize(), QIcon::Normal, QIcon::Off);
downButton->setIcon(icon1);
hboxLayout->addWidget(downButton);
removeButton = new QToolButton(LanguagesDialog);
- removeButton->setObjectName(QStringLiteral("removeButton"));
+ removeButton->setObjectName(QString::fromUtf8("removeButton"));
removeButton->setEnabled(false);
QIcon icon2;
- icon2.addFile(QStringLiteral(":/images/editdelete.png"), QSize(), QIcon::Normal, QIcon::Off);
+ icon2.addFile(QString::fromUtf8(":/images/editdelete.png"), QSize(), QIcon::Normal, QIcon::Off);
removeButton->setIcon(icon2);
hboxLayout->addWidget(removeButton);
openFileButton = new QToolButton(LanguagesDialog);
- openFileButton->setObjectName(QStringLiteral("openFileButton"));
+ openFileButton->setObjectName(QString::fromUtf8("openFileButton"));
openFileButton->setEnabled(true);
QIcon icon3;
- icon3.addFile(QStringLiteral(":/images/mac/fileopen.png"), QSize(), QIcon::Normal, QIcon::Off);
+ icon3.addFile(QString::fromUtf8(":/images/mac/fileopen.png"), QSize(), QIcon::Normal, QIcon::Off);
openFileButton->setIcon(icon3);
hboxLayout->addWidget(openFileButton);
@@ -92,7 +92,7 @@ public:
hboxLayout->addItem(spacerItem);
okButton = new QPushButton(LanguagesDialog);
- okButton->setObjectName(QStringLiteral("okButton"));
+ okButton->setObjectName(QString::fromUtf8("okButton"));
hboxLayout->addWidget(okButton);
diff --git a/tests/auto/tools/uic/baseline/listwidgeteditor.ui.h b/tests/auto/tools/uic/baseline/listwidgeteditor.ui.h
index 06f55dba4c..14067ced18 100644
--- a/tests/auto/tools/uic/baseline/listwidgeteditor.ui.h
+++ b/tests/auto/tools/uic/baseline/listwidgeteditor.ui.h
@@ -79,7 +79,7 @@ public:
void setupUi(QDialog *qdesigner_internal__ListWidgetEditor)
{
if (qdesigner_internal__ListWidgetEditor->objectName().isEmpty())
- qdesigner_internal__ListWidgetEditor->setObjectName(QStringLiteral("qdesigner_internal__ListWidgetEditor"));
+ qdesigner_internal__ListWidgetEditor->setObjectName(QString::fromUtf8("qdesigner_internal__ListWidgetEditor"));
qdesigner_internal__ListWidgetEditor->resize(223, 245);
vboxLayout = new QVBoxLayout(qdesigner_internal__ListWidgetEditor);
#ifndef Q_OS_MAC
@@ -88,25 +88,25 @@ public:
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
groupBox = new QGroupBox(qdesigner_internal__ListWidgetEditor);
- groupBox->setObjectName(QStringLiteral("groupBox"));
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
gridLayout = new QGridLayout(groupBox);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
listWidget = new QListWidget(groupBox);
- listWidget->setObjectName(QStringLiteral("listWidget"));
+ listWidget->setObjectName(QString::fromUtf8("listWidget"));
gridLayout->addWidget(listWidget, 0, 0, 1, 1);
horizontalLayout_2 = new QHBoxLayout();
- horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
+ horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2"));
newItemButton = new QToolButton(groupBox);
- newItemButton->setObjectName(QStringLiteral("newItemButton"));
+ newItemButton->setObjectName(QString::fromUtf8("newItemButton"));
horizontalLayout_2->addWidget(newItemButton);
deleteItemButton = new QToolButton(groupBox);
- deleteItemButton->setObjectName(QStringLiteral("deleteItemButton"));
+ deleteItemButton->setObjectName(QString::fromUtf8("deleteItemButton"));
horizontalLayout_2->addWidget(deleteItemButton);
@@ -115,12 +115,12 @@ public:
horizontalLayout_2->addItem(spacerItem);
moveItemUpButton = new QToolButton(groupBox);
- moveItemUpButton->setObjectName(QStringLiteral("moveItemUpButton"));
+ moveItemUpButton->setObjectName(QString::fromUtf8("moveItemUpButton"));
horizontalLayout_2->addWidget(moveItemUpButton);
moveItemDownButton = new QToolButton(groupBox);
- moveItemDownButton->setObjectName(QStringLiteral("moveItemDownButton"));
+ moveItemDownButton->setObjectName(QString::fromUtf8("moveItemDownButton"));
horizontalLayout_2->addWidget(moveItemDownButton);
@@ -128,14 +128,14 @@ public:
gridLayout->addLayout(horizontalLayout_2, 1, 0, 1, 1);
horizontalLayout = new QHBoxLayout();
- horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
+ horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
label = new QLabel(groupBox);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
horizontalLayout->addWidget(label);
itemIconSelector = new qdesigner_internal::IconSelector(groupBox);
- itemIconSelector->setObjectName(QStringLiteral("itemIconSelector"));
+ itemIconSelector->setObjectName(QString::fromUtf8("itemIconSelector"));
horizontalLayout->addWidget(itemIconSelector);
@@ -150,7 +150,7 @@ public:
vboxLayout->addWidget(groupBox);
buttonBox = new QDialogButtonBox(qdesigner_internal__ListWidgetEditor);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/mainwindow.ui.h b/tests/auto/tools/uic/baseline/mainwindow.ui.h
index 950040aeed..fe84d0baa3 100644
--- a/tests/auto/tools/uic/baseline/mainwindow.ui.h
+++ b/tests/auto/tools/uic/baseline/mainwindow.ui.h
@@ -86,14 +86,14 @@ public:
void setupUi(QMainWindow *MainWindow)
{
if (MainWindow->objectName().isEmpty())
- MainWindow->setObjectName(QStringLiteral("MainWindow"));
+ MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
MainWindow->resize(829, 813);
actionAdd_Custom_Font = new QAction(MainWindow);
- actionAdd_Custom_Font->setObjectName(QStringLiteral("actionAdd_Custom_Font"));
+ actionAdd_Custom_Font->setObjectName(QString::fromUtf8("actionAdd_Custom_Font"));
action_Exit = new QAction(MainWindow);
- action_Exit->setObjectName(QStringLiteral("action_Exit"));
+ action_Exit->setObjectName(QString::fromUtf8("action_Exit"));
centralwidget = new QWidget(MainWindow);
- centralwidget->setObjectName(QStringLiteral("centralwidget"));
+ centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
vboxLayout = new QVBoxLayout(centralwidget);
#ifndef Q_OS_MAC
vboxLayout->setSpacing(6);
@@ -101,9 +101,9 @@ public:
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
groupBox = new QGroupBox(centralwidget);
- groupBox->setObjectName(QStringLiteral("groupBox"));
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
hboxLayout = new QHBoxLayout(groupBox);
#ifndef Q_OS_MAC
hboxLayout->setSpacing(6);
@@ -111,40 +111,40 @@ public:
#ifndef Q_OS_MAC
hboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
label = new QLabel(groupBox);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
hboxLayout->addWidget(label);
fontComboBox = new QFontComboBox(groupBox);
- fontComboBox->setObjectName(QStringLiteral("fontComboBox"));
+ fontComboBox->setObjectName(QString::fromUtf8("fontComboBox"));
hboxLayout->addWidget(fontComboBox);
label_2 = new QLabel(groupBox);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
hboxLayout->addWidget(label_2);
pixelSize = new QSpinBox(groupBox);
- pixelSize->setObjectName(QStringLiteral("pixelSize"));
+ pixelSize->setObjectName(QString::fromUtf8("pixelSize"));
pixelSize->setMinimum(1);
hboxLayout->addWidget(pixelSize);
label_7 = new QLabel(groupBox);
- label_7->setObjectName(QStringLiteral("label_7"));
+ label_7->setObjectName(QString::fromUtf8("label_7"));
hboxLayout->addWidget(label_7);
weightCombo = new QComboBox(groupBox);
- weightCombo->setObjectName(QStringLiteral("weightCombo"));
+ weightCombo->setObjectName(QString::fromUtf8("weightCombo"));
hboxLayout->addWidget(weightCombo);
italic = new QCheckBox(groupBox);
- italic->setObjectName(QStringLiteral("italic"));
+ italic->setObjectName(QString::fromUtf8("italic"));
hboxLayout->addWidget(italic);
@@ -156,7 +156,7 @@ public:
vboxLayout->addWidget(groupBox);
groupBox_2 = new QGroupBox(centralwidget);
- groupBox_2->setObjectName(QStringLiteral("groupBox_2"));
+ groupBox_2->setObjectName(QString::fromUtf8("groupBox_2"));
vboxLayout1 = new QVBoxLayout(groupBox_2);
#ifndef Q_OS_MAC
vboxLayout1->setSpacing(6);
@@ -164,9 +164,9 @@ public:
#ifndef Q_OS_MAC
vboxLayout1->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
chooseFromCodePoints = new QRadioButton(groupBox_2);
- chooseFromCodePoints->setObjectName(QStringLiteral("chooseFromCodePoints"));
+ chooseFromCodePoints->setObjectName(QString::fromUtf8("chooseFromCodePoints"));
chooseFromCodePoints->setChecked(true);
vboxLayout1->addWidget(chooseFromCodePoints);
@@ -176,9 +176,9 @@ public:
vboxLayout2->setSpacing(6);
#endif
vboxLayout2->setContentsMargins(0, 0, 0, 0);
- vboxLayout2->setObjectName(QStringLiteral("vboxLayout2"));
+ vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2"));
characterRangeView = new QListWidget(groupBox_2);
- characterRangeView->setObjectName(QStringLiteral("characterRangeView"));
+ characterRangeView->setObjectName(QString::fromUtf8("characterRangeView"));
vboxLayout2->addWidget(characterRangeView);
@@ -187,19 +187,19 @@ public:
hboxLayout1->setSpacing(6);
#endif
hboxLayout1->setContentsMargins(0, 0, 0, 0);
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
selectAll = new QPushButton(groupBox_2);
- selectAll->setObjectName(QStringLiteral("selectAll"));
+ selectAll->setObjectName(QString::fromUtf8("selectAll"));
hboxLayout1->addWidget(selectAll);
deselectAll = new QPushButton(groupBox_2);
- deselectAll->setObjectName(QStringLiteral("deselectAll"));
+ deselectAll->setObjectName(QString::fromUtf8("deselectAll"));
hboxLayout1->addWidget(deselectAll);
invertSelection = new QPushButton(groupBox_2);
- invertSelection->setObjectName(QStringLiteral("invertSelection"));
+ invertSelection->setObjectName(QString::fromUtf8("invertSelection"));
hboxLayout1->addWidget(invertSelection);
@@ -214,7 +214,7 @@ public:
vboxLayout1->addLayout(vboxLayout2);
chooseFromSampleFile = new QRadioButton(groupBox_2);
- chooseFromSampleFile->setObjectName(QStringLiteral("chooseFromSampleFile"));
+ chooseFromSampleFile->setObjectName(QString::fromUtf8("chooseFromSampleFile"));
vboxLayout1->addWidget(chooseFromSampleFile);
@@ -223,27 +223,27 @@ public:
hboxLayout2->setSpacing(6);
#endif
hboxLayout2->setContentsMargins(0, 0, 0, 0);
- hboxLayout2->setObjectName(QStringLiteral("hboxLayout2"));
+ hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2"));
label_5 = new QLabel(groupBox_2);
- label_5->setObjectName(QStringLiteral("label_5"));
+ label_5->setObjectName(QString::fromUtf8("label_5"));
label_5->setEnabled(false);
hboxLayout2->addWidget(label_5);
sampleFile = new QLineEdit(groupBox_2);
- sampleFile->setObjectName(QStringLiteral("sampleFile"));
+ sampleFile->setObjectName(QString::fromUtf8("sampleFile"));
sampleFile->setEnabled(false);
hboxLayout2->addWidget(sampleFile);
browseSampleFile = new QPushButton(groupBox_2);
- browseSampleFile->setObjectName(QStringLiteral("browseSampleFile"));
+ browseSampleFile->setObjectName(QString::fromUtf8("browseSampleFile"));
browseSampleFile->setEnabled(false);
hboxLayout2->addWidget(browseSampleFile);
charCount = new QLabel(groupBox_2);
- charCount->setObjectName(QStringLiteral("charCount"));
+ charCount->setObjectName(QString::fromUtf8("charCount"));
charCount->setEnabled(false);
hboxLayout2->addWidget(charCount);
@@ -255,7 +255,7 @@ public:
vboxLayout->addWidget(groupBox_2);
groupBox_3 = new QGroupBox(centralwidget);
- groupBox_3->setObjectName(QStringLiteral("groupBox_3"));
+ groupBox_3->setObjectName(QString::fromUtf8("groupBox_3"));
hboxLayout3 = new QHBoxLayout(groupBox_3);
#ifndef Q_OS_MAC
hboxLayout3->setSpacing(6);
@@ -263,9 +263,9 @@ public:
#ifndef Q_OS_MAC
hboxLayout3->setContentsMargins(9, 9, 9, 9);
#endif
- hboxLayout3->setObjectName(QStringLiteral("hboxLayout3"));
+ hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3"));
preview = new QLineEdit(groupBox_3);
- preview->setObjectName(QStringLiteral("preview"));
+ preview->setObjectName(QString::fromUtf8("preview"));
hboxLayout3->addWidget(preview);
@@ -273,7 +273,7 @@ public:
vboxLayout->addWidget(groupBox_3);
groupBox_4 = new QGroupBox(centralwidget);
- groupBox_4->setObjectName(QStringLiteral("groupBox_4"));
+ groupBox_4->setObjectName(QString::fromUtf8("groupBox_4"));
hboxLayout4 = new QHBoxLayout(groupBox_4);
#ifndef Q_OS_MAC
hboxLayout4->setSpacing(6);
@@ -281,29 +281,29 @@ public:
#ifndef Q_OS_MAC
hboxLayout4->setContentsMargins(9, 9, 9, 9);
#endif
- hboxLayout4->setObjectName(QStringLiteral("hboxLayout4"));
+ hboxLayout4->setObjectName(QString::fromUtf8("hboxLayout4"));
label_3 = new QLabel(groupBox_4);
- label_3->setObjectName(QStringLiteral("label_3"));
+ label_3->setObjectName(QString::fromUtf8("label_3"));
hboxLayout4->addWidget(label_3);
path = new QLineEdit(groupBox_4);
- path->setObjectName(QStringLiteral("path"));
+ path->setObjectName(QString::fromUtf8("path"));
hboxLayout4->addWidget(path);
browsePath = new QPushButton(groupBox_4);
- browsePath->setObjectName(QStringLiteral("browsePath"));
+ browsePath->setObjectName(QString::fromUtf8("browsePath"));
hboxLayout4->addWidget(browsePath);
label_4 = new QLabel(groupBox_4);
- label_4->setObjectName(QStringLiteral("label_4"));
+ label_4->setObjectName(QString::fromUtf8("label_4"));
hboxLayout4->addWidget(label_4);
fileName = new QLineEdit(groupBox_4);
- fileName->setObjectName(QStringLiteral("fileName"));
+ fileName->setObjectName(QString::fromUtf8("fileName"));
fileName->setEnabled(false);
hboxLayout4->addWidget(fileName);
@@ -316,9 +316,9 @@ public:
hboxLayout5->setSpacing(6);
#endif
hboxLayout5->setContentsMargins(0, 0, 0, 0);
- hboxLayout5->setObjectName(QStringLiteral("hboxLayout5"));
+ hboxLayout5->setObjectName(QString::fromUtf8("hboxLayout5"));
generate = new QPushButton(centralwidget);
- generate->setObjectName(QStringLiteral("generate"));
+ generate->setObjectName(QString::fromUtf8("generate"));
hboxLayout5->addWidget(generate);
@@ -331,13 +331,13 @@ public:
MainWindow->setCentralWidget(centralwidget);
menubar = new QMenuBar(MainWindow);
- menubar->setObjectName(QStringLiteral("menubar"));
+ menubar->setObjectName(QString::fromUtf8("menubar"));
menubar->setGeometry(QRect(0, 0, 829, 29));
menuFile = new QMenu(menubar);
- menuFile->setObjectName(QStringLiteral("menuFile"));
+ menuFile->setObjectName(QString::fromUtf8("menuFile"));
MainWindow->setMenuBar(menubar);
statusbar = new QStatusBar(MainWindow);
- statusbar->setObjectName(QStringLiteral("statusbar"));
+ statusbar->setObjectName(QString::fromUtf8("statusbar"));
MainWindow->setStatusBar(statusbar);
menubar->addAction(menuFile->menuAction());
diff --git a/tests/auto/tools/uic/baseline/mydialog.ui.h b/tests/auto/tools/uic/baseline/mydialog.ui.h
index 95864d5195..1a784d1b0a 100644
--- a/tests/auto/tools/uic/baseline/mydialog.ui.h
+++ b/tests/auto/tools/uic/baseline/mydialog.ui.h
@@ -28,7 +28,7 @@ public:
void setupUi(QDialog *MyDialog)
{
if (MyDialog->objectName().isEmpty())
- MyDialog->setObjectName(QStringLiteral("MyDialog"));
+ MyDialog->setObjectName(QString::fromUtf8("MyDialog"));
MyDialog->resize(401, 70);
vboxLayout = new QVBoxLayout(MyDialog);
#ifndef Q_OS_MAC
@@ -37,14 +37,14 @@ public:
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
aLabel = new QLabel(MyDialog);
- aLabel->setObjectName(QStringLiteral("aLabel"));
+ aLabel->setObjectName(QString::fromUtf8("aLabel"));
vboxLayout->addWidget(aLabel);
aButton = new QPushButton(MyDialog);
- aButton->setObjectName(QStringLiteral("aButton"));
+ aButton->setObjectName(QString::fromUtf8("aButton"));
vboxLayout->addWidget(aButton);
diff --git a/tests/auto/tools/uic/baseline/myform.ui.h b/tests/auto/tools/uic/baseline/myform.ui.h
index d52c1ecf75..d3a08e04c9 100644
--- a/tests/auto/tools/uic/baseline/myform.ui.h
+++ b/tests/auto/tools/uic/baseline/myform.ui.h
@@ -41,35 +41,35 @@ public:
void setupUi(QWidget *Form)
{
if (Form->objectName().isEmpty())
- Form->setObjectName(QStringLiteral("Form"));
+ Form->setObjectName(QString::fromUtf8("Form"));
Form->resize(258, 224);
vboxLayout = new QVBoxLayout(Form);
#ifndef Q_OS_MAC
vboxLayout->setSpacing(6);
#endif
vboxLayout->setContentsMargins(8, 8, 8, 8);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
groupBox = new QGroupBox(Form);
- groupBox->setObjectName(QStringLiteral("groupBox"));
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
gridLayout = new QGridLayout(groupBox);
#ifndef Q_OS_MAC
gridLayout->setSpacing(6);
#endif
gridLayout->setContentsMargins(8, 8, 8, 8);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
radioButton_2 = new QRadioButton(groupBox);
- radioButton_2->setObjectName(QStringLiteral("radioButton_2"));
+ radioButton_2->setObjectName(QString::fromUtf8("radioButton_2"));
gridLayout->addWidget(radioButton_2, 1, 0, 1, 1);
radioButton = new QRadioButton(groupBox);
- radioButton->setObjectName(QStringLiteral("radioButton"));
+ radioButton->setObjectName(QString::fromUtf8("radioButton"));
radioButton->setChecked(true);
gridLayout->addWidget(radioButton, 0, 0, 1, 1);
checkBox_2 = new QCheckBox(groupBox);
- checkBox_2->setObjectName(QStringLiteral("checkBox_2"));
+ checkBox_2->setObjectName(QString::fromUtf8("checkBox_2"));
checkBox_2->setChecked(true);
gridLayout->addWidget(checkBox_2, 1, 1, 1, 1);
@@ -79,32 +79,32 @@ public:
gridLayout->addItem(spacerItem, 5, 0, 1, 1);
checkBox = new QCheckBox(groupBox);
- checkBox->setObjectName(QStringLiteral("checkBox"));
+ checkBox->setObjectName(QString::fromUtf8("checkBox"));
gridLayout->addWidget(checkBox, 0, 1, 1, 1);
radioButton_2_2 = new QRadioButton(groupBox);
- radioButton_2_2->setObjectName(QStringLiteral("radioButton_2_2"));
+ radioButton_2_2->setObjectName(QString::fromUtf8("radioButton_2_2"));
gridLayout->addWidget(radioButton_2_2, 2, 0, 1, 1);
radioButton_3 = new QRadioButton(groupBox);
- radioButton_3->setObjectName(QStringLiteral("radioButton_3"));
+ radioButton_3->setObjectName(QString::fromUtf8("radioButton_3"));
gridLayout->addWidget(radioButton_3, 3, 0, 1, 1);
radioButton_4 = new QRadioButton(groupBox);
- radioButton_4->setObjectName(QStringLiteral("radioButton_4"));
+ radioButton_4->setObjectName(QString::fromUtf8("radioButton_4"));
gridLayout->addWidget(radioButton_4, 4, 0, 1, 1);
checkBox_3 = new QCheckBox(groupBox);
- checkBox_3->setObjectName(QStringLiteral("checkBox_3"));
+ checkBox_3->setObjectName(QString::fromUtf8("checkBox_3"));
gridLayout->addWidget(checkBox_3, 2, 1, 1, 1);
checkBox_4 = new QCheckBox(groupBox);
- checkBox_4->setObjectName(QStringLiteral("checkBox_4"));
+ checkBox_4->setObjectName(QString::fromUtf8("checkBox_4"));
checkBox_4->setChecked(true);
gridLayout->addWidget(checkBox_4, 3, 1, 1, 1);
diff --git a/tests/auto/tools/uic/baseline/newactiondialog.ui.h b/tests/auto/tools/uic/baseline/newactiondialog.ui.h
index 993ff456b8..ca99ab8356 100644
--- a/tests/auto/tools/uic/baseline/newactiondialog.ui.h
+++ b/tests/auto/tools/uic/baseline/newactiondialog.ui.h
@@ -76,42 +76,42 @@ public:
void setupUi(QDialog *qdesigner_internal__NewActionDialog)
{
if (qdesigner_internal__NewActionDialog->objectName().isEmpty())
- qdesigner_internal__NewActionDialog->setObjectName(QStringLiteral("qdesigner_internal__NewActionDialog"));
+ qdesigner_internal__NewActionDialog->setObjectName(QString::fromUtf8("qdesigner_internal__NewActionDialog"));
qdesigner_internal__NewActionDialog->resize(363, 156);
verticalLayout = new QVBoxLayout(qdesigner_internal__NewActionDialog);
- verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
formLayout = new QFormLayout();
- formLayout->setObjectName(QStringLiteral("formLayout"));
+ formLayout->setObjectName(QString::fromUtf8("formLayout"));
label = new QLabel(qdesigner_internal__NewActionDialog);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
formLayout->setWidget(0, QFormLayout::LabelRole, label);
editActionText = new QLineEdit(qdesigner_internal__NewActionDialog);
- editActionText->setObjectName(QStringLiteral("editActionText"));
+ editActionText->setObjectName(QString::fromUtf8("editActionText"));
editActionText->setMinimumSize(QSize(255, 0));
formLayout->setWidget(0, QFormLayout::FieldRole, editActionText);
label_3 = new QLabel(qdesigner_internal__NewActionDialog);
- label_3->setObjectName(QStringLiteral("label_3"));
+ label_3->setObjectName(QString::fromUtf8("label_3"));
formLayout->setWidget(1, QFormLayout::LabelRole, label_3);
editObjectName = new QLineEdit(qdesigner_internal__NewActionDialog);
- editObjectName->setObjectName(QStringLiteral("editObjectName"));
+ editObjectName->setObjectName(QString::fromUtf8("editObjectName"));
formLayout->setWidget(1, QFormLayout::FieldRole, editObjectName);
label_2 = new QLabel(qdesigner_internal__NewActionDialog);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
formLayout->setWidget(2, QFormLayout::LabelRole, label_2);
horizontalLayout = new QHBoxLayout();
- horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
+ horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
iconSelector = new qdesigner_internal::IconSelector(qdesigner_internal__NewActionDialog);
- iconSelector->setObjectName(QStringLiteral("iconSelector"));
+ iconSelector->setObjectName(QString::fromUtf8("iconSelector"));
horizontalLayout->addWidget(iconSelector);
@@ -130,14 +130,14 @@ public:
verticalLayout->addItem(verticalSpacer);
line = new QFrame(qdesigner_internal__NewActionDialog);
- line->setObjectName(QStringLiteral("line"));
+ line->setObjectName(QString::fromUtf8("line"));
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
verticalLayout->addWidget(line);
buttonBox = new QDialogButtonBox(qdesigner_internal__NewActionDialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/newdynamicpropertydialog.ui.h b/tests/auto/tools/uic/baseline/newdynamicpropertydialog.ui.h
index d0279cf21f..f5fd6f1fa4 100644
--- a/tests/auto/tools/uic/baseline/newdynamicpropertydialog.ui.h
+++ b/tests/auto/tools/uic/baseline/newdynamicpropertydialog.ui.h
@@ -42,20 +42,20 @@ public:
void setupUi(QDialog *qdesigner_internal__NewDynamicPropertyDialog)
{
if (qdesigner_internal__NewDynamicPropertyDialog->objectName().isEmpty())
- qdesigner_internal__NewDynamicPropertyDialog->setObjectName(QStringLiteral("qdesigner_internal__NewDynamicPropertyDialog"));
+ qdesigner_internal__NewDynamicPropertyDialog->setObjectName(QString::fromUtf8("qdesigner_internal__NewDynamicPropertyDialog"));
qdesigner_internal__NewDynamicPropertyDialog->resize(340, 118);
verticalLayout = new QVBoxLayout(qdesigner_internal__NewDynamicPropertyDialog);
- verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
formLayout = new QFormLayout();
- formLayout->setObjectName(QStringLiteral("formLayout"));
+ formLayout->setObjectName(QString::fromUtf8("formLayout"));
m_lineEdit = new QLineEdit(qdesigner_internal__NewDynamicPropertyDialog);
- m_lineEdit->setObjectName(QStringLiteral("m_lineEdit"));
+ m_lineEdit->setObjectName(QString::fromUtf8("m_lineEdit"));
m_lineEdit->setMinimumSize(QSize(220, 0));
formLayout->setWidget(0, QFormLayout::FieldRole, m_lineEdit);
label = new QLabel(qdesigner_internal__NewDynamicPropertyDialog);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -65,9 +65,9 @@ public:
formLayout->setWidget(0, QFormLayout::LabelRole, label);
horizontalLayout = new QHBoxLayout();
- horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
+ horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
m_comboBox = new QComboBox(qdesigner_internal__NewDynamicPropertyDialog);
- m_comboBox->setObjectName(QStringLiteral("m_comboBox"));
+ m_comboBox->setObjectName(QString::fromUtf8("m_comboBox"));
horizontalLayout->addWidget(m_comboBox);
@@ -79,7 +79,7 @@ public:
formLayout->setLayout(1, QFormLayout::FieldRole, horizontalLayout);
label_2 = new QLabel(qdesigner_internal__NewDynamicPropertyDialog);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
sizePolicy.setHeightForWidth(label_2->sizePolicy().hasHeightForWidth());
label_2->setSizePolicy(sizePolicy);
@@ -93,7 +93,7 @@ public:
verticalLayout->addItem(spacerItem);
m_buttonBox = new QDialogButtonBox(qdesigner_internal__NewDynamicPropertyDialog);
- m_buttonBox->setObjectName(QStringLiteral("m_buttonBox"));
+ m_buttonBox->setObjectName(QString::fromUtf8("m_buttonBox"));
m_buttonBox->setOrientation(Qt::Horizontal);
m_buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
m_buttonBox->setCenterButtons(false);
diff --git a/tests/auto/tools/uic/baseline/newform.ui.h b/tests/auto/tools/uic/baseline/newform.ui.h
index 26da1b6fc2..80e70dcf66 100644
--- a/tests/auto/tools/uic/baseline/newform.ui.h
+++ b/tests/auto/tools/uic/baseline/newform.ui.h
@@ -67,7 +67,7 @@ public:
void setupUi(QDialog *NewForm)
{
if (NewForm->objectName().isEmpty())
- NewForm->setObjectName(QStringLiteral("NewForm"));
+ NewForm->setObjectName(QString::fromUtf8("NewForm"));
NewForm->resize(495, 319);
vboxLayout = new QVBoxLayout(NewForm);
#ifndef Q_OS_MAC
@@ -76,15 +76,15 @@ public:
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
hboxLayout = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout->setSpacing(6);
#endif
hboxLayout->setContentsMargins(1, 1, 1, 1);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
treeWidget = new QTreeWidget(NewForm);
- treeWidget->setObjectName(QStringLiteral("treeWidget"));
+ treeWidget->setObjectName(QString::fromUtf8("treeWidget"));
treeWidget->setIconSize(QSize(128, 128));
treeWidget->setRootIsDecorated(false);
treeWidget->setColumnCount(1);
@@ -92,7 +92,7 @@ public:
hboxLayout->addWidget(treeWidget);
lblPreview = new QLabel(NewForm);
- lblPreview->setObjectName(QStringLiteral("lblPreview"));
+ lblPreview->setObjectName(QString::fromUtf8("lblPreview"));
QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(7), static_cast<QSizePolicy::Policy>(5));
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -108,19 +108,19 @@ public:
vboxLayout->addLayout(hboxLayout);
horizontalLine = new QFrame(NewForm);
- horizontalLine->setObjectName(QStringLiteral("horizontalLine"));
+ horizontalLine->setObjectName(QString::fromUtf8("horizontalLine"));
horizontalLine->setFrameShape(QFrame::HLine);
horizontalLine->setFrameShadow(QFrame::Sunken);
vboxLayout->addWidget(horizontalLine);
chkShowOnStartup = new QCheckBox(NewForm);
- chkShowOnStartup->setObjectName(QStringLiteral("chkShowOnStartup"));
+ chkShowOnStartup->setObjectName(QString::fromUtf8("chkShowOnStartup"));
vboxLayout->addWidget(chkShowOnStartup);
buttonBox = new QDialogButtonBox(NewForm);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
vboxLayout->addWidget(buttonBox);
diff --git a/tests/auto/tools/uic/baseline/orderdialog.ui.h b/tests/auto/tools/uic/baseline/orderdialog.ui.h
index e2b9762510..0ee08257f4 100644
--- a/tests/auto/tools/uic/baseline/orderdialog.ui.h
+++ b/tests/auto/tools/uic/baseline/orderdialog.ui.h
@@ -70,18 +70,18 @@ public:
void setupUi(QDialog *qdesigner_internal__OrderDialog)
{
if (qdesigner_internal__OrderDialog->objectName().isEmpty())
- qdesigner_internal__OrderDialog->setObjectName(QStringLiteral("qdesigner_internal__OrderDialog"));
+ qdesigner_internal__OrderDialog->setObjectName(QString::fromUtf8("qdesigner_internal__OrderDialog"));
qdesigner_internal__OrderDialog->resize(467, 310);
vboxLayout = new QVBoxLayout(qdesigner_internal__OrderDialog);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
groupBox = new QGroupBox(qdesigner_internal__OrderDialog);
- groupBox->setObjectName(QStringLiteral("groupBox"));
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
hboxLayout = new QHBoxLayout(groupBox);
hboxLayout->setSpacing(6);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
hboxLayout->setContentsMargins(9, 9, 9, 9);
pageList = new QListWidget(groupBox);
- pageList->setObjectName(QStringLiteral("pageList"));
+ pageList->setObjectName(QString::fromUtf8("pageList"));
pageList->setMinimumSize(QSize(344, 0));
pageList->setDragDropMode(QAbstractItemView::InternalMove);
pageList->setSelectionMode(QAbstractItemView::ContiguousSelection);
@@ -91,15 +91,15 @@ public:
vboxLayout1 = new QVBoxLayout();
vboxLayout1->setSpacing(6);
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
vboxLayout1->setContentsMargins(0, 0, 0, 0);
upButton = new QToolButton(groupBox);
- upButton->setObjectName(QStringLiteral("upButton"));
+ upButton->setObjectName(QString::fromUtf8("upButton"));
vboxLayout1->addWidget(upButton);
downButton = new QToolButton(groupBox);
- downButton->setObjectName(QStringLiteral("downButton"));
+ downButton->setObjectName(QString::fromUtf8("downButton"));
vboxLayout1->addWidget(downButton);
@@ -114,7 +114,7 @@ public:
vboxLayout->addWidget(groupBox);
buttonBox = new QDialogButtonBox(qdesigner_internal__OrderDialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::Reset);
diff --git a/tests/auto/tools/uic/baseline/outputpage.ui.h b/tests/auto/tools/uic/baseline/outputpage.ui.h
index 1024ba1c19..00491bb3d8 100644
--- a/tests/auto/tools/uic/baseline/outputpage.ui.h
+++ b/tests/auto/tools/uic/baseline/outputpage.ui.h
@@ -33,16 +33,16 @@ public:
void setupUi(QWidget *OutputPage)
{
if (OutputPage->objectName().isEmpty())
- OutputPage->setObjectName(QStringLiteral("OutputPage"));
+ OutputPage->setObjectName(QString::fromUtf8("OutputPage"));
OutputPage->resize(417, 242);
gridLayout = new QGridLayout(OutputPage);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
spacerItem = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Fixed);
gridLayout->addItem(spacerItem, 0, 1, 1, 1);
label = new QLabel(OutputPage);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -52,7 +52,7 @@ public:
gridLayout->addWidget(label, 1, 0, 1, 1);
projectLineEdit = new QLineEdit(OutputPage);
- projectLineEdit->setObjectName(QStringLiteral("projectLineEdit"));
+ projectLineEdit->setObjectName(QString::fromUtf8("projectLineEdit"));
QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Fixed);
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
@@ -62,14 +62,14 @@ public:
gridLayout->addWidget(projectLineEdit, 1, 1, 1, 1);
label_2 = new QLabel(OutputPage);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
sizePolicy.setHeightForWidth(label_2->sizePolicy().hasHeightForWidth());
label_2->setSizePolicy(sizePolicy);
gridLayout->addWidget(label_2, 2, 0, 1, 1);
collectionLineEdit = new QLineEdit(OutputPage);
- collectionLineEdit->setObjectName(QStringLiteral("collectionLineEdit"));
+ collectionLineEdit->setObjectName(QString::fromUtf8("collectionLineEdit"));
sizePolicy1.setHeightForWidth(collectionLineEdit->sizePolicy().hasHeightForWidth());
collectionLineEdit->setSizePolicy(sizePolicy1);
diff --git a/tests/auto/tools/uic/baseline/pagefold.ui.h b/tests/auto/tools/uic/baseline/pagefold.ui.h
index c0ec214e85..c1ff03648d 100644
--- a/tests/auto/tools/uic/baseline/pagefold.ui.h
+++ b/tests/auto/tools/uic/baseline/pagefold.ui.h
@@ -67,18 +67,18 @@ public:
void setupUi(QMainWindow *MainWindow)
{
if (MainWindow->objectName().isEmpty())
- MainWindow->setObjectName(QStringLiteral("MainWindow"));
+ MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
MainWindow->resize(392, 412);
exitAction = new QAction(MainWindow);
- exitAction->setObjectName(QStringLiteral("exitAction"));
+ exitAction->setObjectName(QString::fromUtf8("exitAction"));
aboutQtAction = new QAction(MainWindow);
- aboutQtAction->setObjectName(QStringLiteral("aboutQtAction"));
+ aboutQtAction->setObjectName(QString::fromUtf8("aboutQtAction"));
editStyleAction = new QAction(MainWindow);
- editStyleAction->setObjectName(QStringLiteral("editStyleAction"));
+ editStyleAction->setObjectName(QString::fromUtf8("editStyleAction"));
aboutAction = new QAction(MainWindow);
- aboutAction->setObjectName(QStringLiteral("aboutAction"));
+ aboutAction->setObjectName(QString::fromUtf8("aboutAction"));
centralwidget = new QWidget(MainWindow);
- centralwidget->setObjectName(QStringLiteral("centralwidget"));
+ centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
vboxLayout = new QVBoxLayout(centralwidget);
#ifndef Q_OS_MAC
vboxLayout->setSpacing(6);
@@ -86,9 +86,9 @@ public:
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
mainFrame = new QFrame(centralwidget);
- mainFrame->setObjectName(QStringLiteral("mainFrame"));
+ mainFrame->setObjectName(QString::fromUtf8("mainFrame"));
mainFrame->setFrameShape(QFrame::StyledPanel);
mainFrame->setFrameShadow(QFrame::Raised);
gridLayout = new QGridLayout(mainFrame);
@@ -98,13 +98,13 @@ public:
#ifndef Q_OS_MAC
gridLayout->setContentsMargins(9, 9, 9, 9);
#endif
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
nameCombo = new QComboBox(mainFrame);
nameCombo->addItem(QString());
nameCombo->addItem(QString());
nameCombo->addItem(QString());
nameCombo->addItem(QString());
- nameCombo->setObjectName(QStringLiteral("nameCombo"));
+ nameCombo->setObjectName(QString::fromUtf8("nameCombo"));
nameCombo->setEditable(true);
gridLayout->addWidget(nameCombo, 0, 1, 1, 3);
@@ -114,56 +114,56 @@ public:
gridLayout->addItem(spacerItem, 1, 3, 1, 1);
femaleRadioButton = new QRadioButton(mainFrame);
- femaleRadioButton->setObjectName(QStringLiteral("femaleRadioButton"));
+ femaleRadioButton->setObjectName(QString::fromUtf8("femaleRadioButton"));
gridLayout->addWidget(femaleRadioButton, 1, 2, 1, 1);
genderLabel = new QLabel(mainFrame);
- genderLabel->setObjectName(QStringLiteral("genderLabel"));
+ genderLabel->setObjectName(QString::fromUtf8("genderLabel"));
gridLayout->addWidget(genderLabel, 1, 0, 1, 1);
ageLabel = new QLabel(mainFrame);
- ageLabel->setObjectName(QStringLiteral("ageLabel"));
+ ageLabel->setObjectName(QString::fromUtf8("ageLabel"));
gridLayout->addWidget(ageLabel, 2, 0, 1, 1);
maleRadioButton = new QRadioButton(mainFrame);
- maleRadioButton->setObjectName(QStringLiteral("maleRadioButton"));
+ maleRadioButton->setObjectName(QString::fromUtf8("maleRadioButton"));
gridLayout->addWidget(maleRadioButton, 1, 1, 1, 1);
nameLabel = new QLabel(mainFrame);
- nameLabel->setObjectName(QStringLiteral("nameLabel"));
+ nameLabel->setObjectName(QString::fromUtf8("nameLabel"));
gridLayout->addWidget(nameLabel, 0, 0, 1, 1);
passwordLabel = new QLabel(mainFrame);
- passwordLabel->setObjectName(QStringLiteral("passwordLabel"));
+ passwordLabel->setObjectName(QString::fromUtf8("passwordLabel"));
gridLayout->addWidget(passwordLabel, 3, 0, 1, 1);
ageSpinBox = new QSpinBox(mainFrame);
- ageSpinBox->setObjectName(QStringLiteral("ageSpinBox"));
+ ageSpinBox->setObjectName(QString::fromUtf8("ageSpinBox"));
ageSpinBox->setMinimum(12);
ageSpinBox->setValue(22);
gridLayout->addWidget(ageSpinBox, 2, 1, 1, 3);
buttonBox = new QDialogButtonBox(mainFrame);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok);
gridLayout->addWidget(buttonBox, 7, 2, 1, 2);
agreeCheckBox = new QCheckBox(mainFrame);
- agreeCheckBox->setObjectName(QStringLiteral("agreeCheckBox"));
+ agreeCheckBox->setObjectName(QString::fromUtf8("agreeCheckBox"));
gridLayout->addWidget(agreeCheckBox, 6, 0, 1, 4);
passwordEdit = new QLineEdit(mainFrame);
- passwordEdit->setObjectName(QStringLiteral("passwordEdit"));
+ passwordEdit->setObjectName(QString::fromUtf8("passwordEdit"));
passwordEdit->setEchoMode(QLineEdit::Password);
gridLayout->addWidget(passwordEdit, 3, 1, 1, 3);
@@ -172,12 +172,12 @@ public:
new QListWidgetItem(professionList);
new QListWidgetItem(professionList);
new QListWidgetItem(professionList);
- professionList->setObjectName(QStringLiteral("professionList"));
+ professionList->setObjectName(QString::fromUtf8("professionList"));
gridLayout->addWidget(professionList, 5, 1, 1, 3);
label = new QLabel(mainFrame);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout->addWidget(label, 5, 0, 1, 1);
@@ -189,12 +189,12 @@ public:
countryCombo->addItem(QString());
countryCombo->addItem(QString());
countryCombo->addItem(QString());
- countryCombo->setObjectName(QStringLiteral("countryCombo"));
+ countryCombo->setObjectName(QString::fromUtf8("countryCombo"));
gridLayout->addWidget(countryCombo, 4, 1, 1, 3);
countryLabel = new QLabel(mainFrame);
- countryLabel->setObjectName(QStringLiteral("countryLabel"));
+ countryLabel->setObjectName(QString::fromUtf8("countryLabel"));
gridLayout->addWidget(countryLabel, 4, 0, 1, 1);
@@ -203,15 +203,15 @@ public:
MainWindow->setCentralWidget(centralwidget);
menubar = new QMenuBar(MainWindow);
- menubar->setObjectName(QStringLiteral("menubar"));
+ menubar->setObjectName(QString::fromUtf8("menubar"));
menubar->setGeometry(QRect(0, 0, 392, 25));
menu_File = new QMenu(menubar);
- menu_File->setObjectName(QStringLiteral("menu_File"));
+ menu_File->setObjectName(QString::fromUtf8("menu_File"));
menu_Help = new QMenu(menubar);
- menu_Help->setObjectName(QStringLiteral("menu_Help"));
+ menu_Help->setObjectName(QString::fromUtf8("menu_Help"));
MainWindow->setMenuBar(menubar);
statusbar = new QStatusBar(MainWindow);
- statusbar->setObjectName(QStringLiteral("statusbar"));
+ statusbar->setObjectName(QString::fromUtf8("statusbar"));
MainWindow->setStatusBar(statusbar);
#ifndef QT_NO_SHORTCUT
ageLabel->setBuddy(ageSpinBox);
diff --git a/tests/auto/tools/uic/baseline/paletteeditor.ui.h b/tests/auto/tools/uic/baseline/paletteeditor.ui.h
index 3ccdf6082d..0061164960 100644
--- a/tests/auto/tools/uic/baseline/paletteeditor.ui.h
+++ b/tests/auto/tools/uic/baseline/paletteeditor.ui.h
@@ -79,7 +79,7 @@ public:
void setupUi(QDialog *qdesigner_internal__PaletteEditor)
{
if (qdesigner_internal__PaletteEditor->objectName().isEmpty())
- qdesigner_internal__PaletteEditor->setObjectName(QStringLiteral("qdesigner_internal__PaletteEditor"));
+ qdesigner_internal__PaletteEditor->setObjectName(QString::fromUtf8("qdesigner_internal__PaletteEditor"));
qdesigner_internal__PaletteEditor->resize(365, 409);
QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(7), static_cast<QSizePolicy::Policy>(7));
sizePolicy.setHorizontalStretch(0);
@@ -93,9 +93,9 @@ public:
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
advancedBox = new QGroupBox(qdesigner_internal__PaletteEditor);
- advancedBox->setObjectName(QStringLiteral("advancedBox"));
+ advancedBox->setObjectName(QString::fromUtf8("advancedBox"));
advancedBox->setMinimumSize(QSize(0, 0));
advancedBox->setMaximumSize(QSize(16777215, 16777215));
gridLayout = new QGridLayout(advancedBox);
@@ -105,9 +105,9 @@ public:
#ifndef Q_OS_MAC
gridLayout->setContentsMargins(9, 9, 9, 9);
#endif
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
buildButton = new QtColorButton(advancedBox);
- buildButton->setObjectName(QStringLiteral("buildButton"));
+ buildButton->setObjectName(QString::fromUtf8("buildButton"));
QSizePolicy sizePolicy1(static_cast<QSizePolicy::Policy>(7), static_cast<QSizePolicy::Policy>(13));
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
@@ -117,24 +117,24 @@ public:
gridLayout->addWidget(buildButton, 0, 1, 1, 1);
paletteView = new QTreeView(advancedBox);
- paletteView->setObjectName(QStringLiteral("paletteView"));
+ paletteView->setObjectName(QString::fromUtf8("paletteView"));
paletteView->setMinimumSize(QSize(0, 200));
gridLayout->addWidget(paletteView, 1, 0, 1, 4);
detailsRadio = new QRadioButton(advancedBox);
- detailsRadio->setObjectName(QStringLiteral("detailsRadio"));
+ detailsRadio->setObjectName(QString::fromUtf8("detailsRadio"));
gridLayout->addWidget(detailsRadio, 0, 3, 1, 1);
computeRadio = new QRadioButton(advancedBox);
- computeRadio->setObjectName(QStringLiteral("computeRadio"));
+ computeRadio->setObjectName(QString::fromUtf8("computeRadio"));
computeRadio->setChecked(true);
gridLayout->addWidget(computeRadio, 0, 2, 1, 1);
label = new QLabel(advancedBox);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout->addWidget(label, 0, 0, 1, 1);
@@ -142,7 +142,7 @@ public:
vboxLayout->addWidget(advancedBox);
GroupBox126 = new QGroupBox(qdesigner_internal__PaletteEditor);
- GroupBox126->setObjectName(QStringLiteral("GroupBox126"));
+ GroupBox126->setObjectName(QString::fromUtf8("GroupBox126"));
QSizePolicy sizePolicy2(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(7));
sizePolicy2.setHorizontalStretch(0);
sizePolicy2.setVerticalStretch(0);
@@ -153,25 +153,25 @@ public:
gridLayout1->setSpacing(6);
#endif
gridLayout1->setContentsMargins(8, 8, 8, 8);
- gridLayout1->setObjectName(QStringLiteral("gridLayout1"));
+ gridLayout1->setObjectName(QString::fromUtf8("gridLayout1"));
disabledRadio = new QRadioButton(GroupBox126);
- disabledRadio->setObjectName(QStringLiteral("disabledRadio"));
+ disabledRadio->setObjectName(QString::fromUtf8("disabledRadio"));
gridLayout1->addWidget(disabledRadio, 0, 2, 1, 1);
inactiveRadio = new QRadioButton(GroupBox126);
- inactiveRadio->setObjectName(QStringLiteral("inactiveRadio"));
+ inactiveRadio->setObjectName(QString::fromUtf8("inactiveRadio"));
gridLayout1->addWidget(inactiveRadio, 0, 1, 1, 1);
activeRadio = new QRadioButton(GroupBox126);
- activeRadio->setObjectName(QStringLiteral("activeRadio"));
+ activeRadio->setObjectName(QString::fromUtf8("activeRadio"));
activeRadio->setChecked(true);
gridLayout1->addWidget(activeRadio, 0, 0, 1, 1);
previewFrame = new qdesigner_internal::PreviewFrame(GroupBox126);
- previewFrame->setObjectName(QStringLiteral("previewFrame"));
+ previewFrame->setObjectName(QString::fromUtf8("previewFrame"));
sizePolicy.setHeightForWidth(previewFrame->sizePolicy().hasHeightForWidth());
previewFrame->setSizePolicy(sizePolicy);
@@ -181,7 +181,7 @@ public:
vboxLayout->addWidget(GroupBox126);
buttonBox = new QDialogButtonBox(qdesigner_internal__PaletteEditor);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/passworddialog.ui.h b/tests/auto/tools/uic/baseline/passworddialog.ui.h
index d47835b57b..9ab95c4de9 100644
--- a/tests/auto/tools/uic/baseline/passworddialog.ui.h
+++ b/tests/auto/tools/uic/baseline/passworddialog.ui.h
@@ -36,19 +36,19 @@ public:
void setupUi(QDialog *PasswordDialog)
{
if (PasswordDialog->objectName().isEmpty())
- PasswordDialog->setObjectName(QStringLiteral("PasswordDialog"));
+ PasswordDialog->setObjectName(QString::fromUtf8("PasswordDialog"));
PasswordDialog->resize(399, 148);
gridLayout = new QGridLayout(PasswordDialog);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
hboxLayout = new QHBoxLayout();
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
iconLabel = new QLabel(PasswordDialog);
- iconLabel->setObjectName(QStringLiteral("iconLabel"));
+ iconLabel->setObjectName(QString::fromUtf8("iconLabel"));
hboxLayout->addWidget(iconLabel);
introLabel = new QLabel(PasswordDialog);
- introLabel->setObjectName(QStringLiteral("introLabel"));
+ introLabel->setObjectName(QString::fromUtf8("introLabel"));
QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -61,28 +61,28 @@ public:
gridLayout->addLayout(hboxLayout, 0, 0, 1, 2);
label = new QLabel(PasswordDialog);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout->addWidget(label, 1, 0, 1, 1);
userNameLineEdit = new QLineEdit(PasswordDialog);
- userNameLineEdit->setObjectName(QStringLiteral("userNameLineEdit"));
+ userNameLineEdit->setObjectName(QString::fromUtf8("userNameLineEdit"));
gridLayout->addWidget(userNameLineEdit, 1, 1, 1, 1);
lblPassword = new QLabel(PasswordDialog);
- lblPassword->setObjectName(QStringLiteral("lblPassword"));
+ lblPassword->setObjectName(QString::fromUtf8("lblPassword"));
gridLayout->addWidget(lblPassword, 2, 0, 1, 1);
passwordLineEdit = new QLineEdit(PasswordDialog);
- passwordLineEdit->setObjectName(QStringLiteral("passwordLineEdit"));
+ passwordLineEdit->setObjectName(QString::fromUtf8("passwordLineEdit"));
passwordLineEdit->setEchoMode(QLineEdit::Password);
gridLayout->addWidget(passwordLineEdit, 2, 1, 1, 1);
buttonBox = new QDialogButtonBox(PasswordDialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/pathpage.ui.h b/tests/auto/tools/uic/baseline/pathpage.ui.h
index 361831721b..eb151f9550 100644
--- a/tests/auto/tools/uic/baseline/pathpage.ui.h
+++ b/tests/auto/tools/uic/baseline/pathpage.ui.h
@@ -38,12 +38,12 @@ public:
void setupUi(QWidget *PathPage)
{
if (PathPage->objectName().isEmpty())
- PathPage->setObjectName(QStringLiteral("PathPage"));
+ PathPage->setObjectName(QString::fromUtf8("PathPage"));
PathPage->resize(417, 243);
gridLayout = new QGridLayout(PathPage);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
label_2 = new QLabel(PathPage);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -53,7 +53,7 @@ public:
gridLayout->addWidget(label_2, 0, 0, 1, 1);
filterLineEdit = new QLineEdit(PathPage);
- filterLineEdit->setObjectName(QStringLiteral("filterLineEdit"));
+ filterLineEdit->setObjectName(QString::fromUtf8("filterLineEdit"));
gridLayout->addWidget(filterLineEdit, 0, 1, 1, 2);
@@ -62,17 +62,17 @@ public:
gridLayout->addItem(spacerItem, 1, 1, 1, 1);
label = new QLabel(PathPage);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout->addWidget(label, 2, 0, 1, 3);
pathListWidget = new QListWidget(PathPage);
- pathListWidget->setObjectName(QStringLiteral("pathListWidget"));
+ pathListWidget->setObjectName(QString::fromUtf8("pathListWidget"));
gridLayout->addWidget(pathListWidget, 3, 0, 3, 3);
addButton = new QPushButton(PathPage);
- addButton->setObjectName(QStringLiteral("addButton"));
+ addButton->setObjectName(QString::fromUtf8("addButton"));
QSizePolicy sizePolicy1(QSizePolicy::Maximum, QSizePolicy::Fixed);
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
@@ -82,7 +82,7 @@ public:
gridLayout->addWidget(addButton, 3, 3, 1, 1);
removeButton = new QPushButton(PathPage);
- removeButton->setObjectName(QStringLiteral("removeButton"));
+ removeButton->setObjectName(QString::fromUtf8("removeButton"));
sizePolicy1.setHeightForWidth(removeButton->sizePolicy().hasHeightForWidth());
removeButton->setSizePolicy(sizePolicy1);
diff --git a/tests/auto/tools/uic/baseline/phrasebookbox.ui.h b/tests/auto/tools/uic/baseline/phrasebookbox.ui.h
index e41a7061b4..27a0fa79ed 100644
--- a/tests/auto/tools/uic/baseline/phrasebookbox.ui.h
+++ b/tests/auto/tools/uic/baseline/phrasebookbox.ui.h
@@ -77,45 +77,45 @@ public:
void setupUi(QDialog *PhraseBookBox)
{
if (PhraseBookBox->objectName().isEmpty())
- PhraseBookBox->setObjectName(QStringLiteral("PhraseBookBox"));
+ PhraseBookBox->setObjectName(QString::fromUtf8("PhraseBookBox"));
PhraseBookBox->resize(596, 454);
unnamed = new QHBoxLayout(PhraseBookBox);
unnamed->setSpacing(6);
unnamed->setContentsMargins(11, 11, 11, 11);
- unnamed->setObjectName(QStringLiteral("unnamed"));
+ unnamed->setObjectName(QString::fromUtf8("unnamed"));
inputsLayout = new QVBoxLayout();
inputsLayout->setSpacing(6);
- inputsLayout->setObjectName(QStringLiteral("inputsLayout"));
+ inputsLayout->setObjectName(QString::fromUtf8("inputsLayout"));
gridLayout = new QGridLayout();
gridLayout->setSpacing(6);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
target = new QLabel(PhraseBookBox);
- target->setObjectName(QStringLiteral("target"));
+ target->setObjectName(QString::fromUtf8("target"));
gridLayout->addWidget(target, 1, 0, 1, 1);
targetLed = new QLineEdit(PhraseBookBox);
- targetLed->setObjectName(QStringLiteral("targetLed"));
+ targetLed->setObjectName(QString::fromUtf8("targetLed"));
gridLayout->addWidget(targetLed, 1, 1, 1, 1);
source = new QLabel(PhraseBookBox);
- source->setObjectName(QStringLiteral("source"));
+ source->setObjectName(QString::fromUtf8("source"));
gridLayout->addWidget(source, 0, 0, 1, 1);
definitionLed = new QLineEdit(PhraseBookBox);
- definitionLed->setObjectName(QStringLiteral("definitionLed"));
+ definitionLed->setObjectName(QString::fromUtf8("definitionLed"));
gridLayout->addWidget(definitionLed, 2, 1, 1, 1);
sourceLed = new QLineEdit(PhraseBookBox);
- sourceLed->setObjectName(QStringLiteral("sourceLed"));
+ sourceLed->setObjectName(QString::fromUtf8("sourceLed"));
gridLayout->addWidget(sourceLed, 0, 1, 1, 1);
definition = new QLabel(PhraseBookBox);
- definition->setObjectName(QStringLiteral("definition"));
+ definition->setObjectName(QString::fromUtf8("definition"));
gridLayout->addWidget(definition, 2, 0, 1, 1);
@@ -123,7 +123,7 @@ public:
inputsLayout->addLayout(gridLayout);
phraseList = new QTreeView(PhraseBookBox);
- phraseList->setObjectName(QStringLiteral("phraseList"));
+ phraseList->setObjectName(QString::fromUtf8("phraseList"));
phraseList->setRootIsDecorated(false);
phraseList->setUniformRowHeights(true);
phraseList->setItemsExpandable(false);
@@ -137,24 +137,24 @@ public:
buttonLayout = new QVBoxLayout();
buttonLayout->setSpacing(6);
- buttonLayout->setObjectName(QStringLiteral("buttonLayout"));
+ buttonLayout->setObjectName(QString::fromUtf8("buttonLayout"));
newBut = new QPushButton(PhraseBookBox);
- newBut->setObjectName(QStringLiteral("newBut"));
+ newBut->setObjectName(QString::fromUtf8("newBut"));
buttonLayout->addWidget(newBut);
removeBut = new QPushButton(PhraseBookBox);
- removeBut->setObjectName(QStringLiteral("removeBut"));
+ removeBut->setObjectName(QString::fromUtf8("removeBut"));
buttonLayout->addWidget(removeBut);
saveBut = new QPushButton(PhraseBookBox);
- saveBut->setObjectName(QStringLiteral("saveBut"));
+ saveBut->setObjectName(QString::fromUtf8("saveBut"));
buttonLayout->addWidget(saveBut);
closeBut = new QPushButton(PhraseBookBox);
- closeBut->setObjectName(QStringLiteral("closeBut"));
+ closeBut->setObjectName(QString::fromUtf8("closeBut"));
buttonLayout->addWidget(closeBut);
diff --git a/tests/auto/tools/uic/baseline/pixmapfunction.ui b/tests/auto/tools/uic/baseline/pixmapfunction.ui
new file mode 100644
index 0000000000..8edafc7248
--- /dev/null
+++ b/tests/auto/tools/uic/baseline/pixmapfunction.ui
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>149</width>
+ <height>112</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap>labelPixmap</pixmap>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="pushButton">
+ <property name="text">
+ <string>PushButton</string>
+ </property>
+ <property name="icon">
+ <iconset>
+ <normaloff>buttonIconNormalOff</normaloff>
+ <normalon>buttonIconNormalOn</normalon>
+ <disabledoff>buttonIconDisabledOff</disabledoff>
+ <disabledon>buttonIconDisabledOn</disabledon>
+ </iconset>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <pixmapfunction>pixmapFunction</pixmapfunction>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/tests/auto/tools/uic/baseline/pixmapfunction.ui.h b/tests/auto/tools/uic/baseline/pixmapfunction.ui.h
new file mode 100644
index 0000000000..1644380c15
--- /dev/null
+++ b/tests/auto/tools/uic/baseline/pixmapfunction.ui.h
@@ -0,0 +1,74 @@
+/********************************************************************************
+** Form generated from reading UI file 'pixmapfunction.ui'
+**
+** Created by: Qt User Interface Compiler version 5.12.0
+**
+** WARNING! All changes made in this file will be lost when recompiling UI file!
+********************************************************************************/
+
+#ifndef PIXMAPFUNCTION_H
+#define PIXMAPFUNCTION_H
+
+#include <QtCore/QVariant>
+#include <QtGui/QIcon>
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QLabel>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QWidget>
+
+QT_BEGIN_NAMESPACE
+
+class Ui_Form
+{
+public:
+ QVBoxLayout *verticalLayout;
+ QLabel *label;
+ QPushButton *pushButton;
+
+ void setupUi(QWidget *Form)
+ {
+ if (Form->objectName().isEmpty())
+ Form->setObjectName(QString::fromUtf8("Form"));
+ Form->resize(149, 112);
+ verticalLayout = new QVBoxLayout(Form);
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
+ label = new QLabel(Form);
+ label->setObjectName(QString::fromUtf8("label"));
+ label->setPixmap(QPixmap(pixmapFunction("labelPixmap")));
+
+ verticalLayout->addWidget(label);
+
+ pushButton = new QPushButton(Form);
+ pushButton->setObjectName(QString::fromUtf8("pushButton"));
+ QIcon icon;
+ icon.addPixmap(QPixmap(pixmapFunction("buttonIconNormalOff")), QIcon::Normal, QIcon::Off);
+ icon.addPixmap(QPixmap(pixmapFunction("buttonIconNormalOn")), QIcon::Normal, QIcon::On);
+ icon.addPixmap(QPixmap(pixmapFunction("buttonIconDisabledOff")), QIcon::Disabled, QIcon::Off);
+ icon.addPixmap(QPixmap(pixmapFunction("buttonIconDisabledOn")), QIcon::Disabled, QIcon::On);
+ pushButton->setIcon(icon);
+
+ verticalLayout->addWidget(pushButton);
+
+
+ retranslateUi(Form);
+
+ QMetaObject::connectSlotsByName(Form);
+ } // setupUi
+
+ void retranslateUi(QWidget *Form)
+ {
+ Form->setWindowTitle(QApplication::translate("Form", "Form", nullptr));
+ label->setText(QString());
+ pushButton->setText(QApplication::translate("Form", "PushButton", nullptr));
+ } // retranslateUi
+
+};
+
+namespace Ui {
+ class Form: public Ui_Form {};
+} // namespace Ui
+
+QT_END_NAMESPACE
+
+#endif // PIXMAPFUNCTION_H
diff --git a/tests/auto/tools/uic/baseline/plugindialog.ui.h b/tests/auto/tools/uic/baseline/plugindialog.ui.h
index 30256a35c2..3634b8436f 100644
--- a/tests/auto/tools/uic/baseline/plugindialog.ui.h
+++ b/tests/auto/tools/uic/baseline/plugindialog.ui.h
@@ -64,39 +64,39 @@ public:
void setupUi(QDialog *PluginDialog)
{
if (PluginDialog->objectName().isEmpty())
- PluginDialog->setObjectName(QStringLiteral("PluginDialog"));
+ PluginDialog->setObjectName(QString::fromUtf8("PluginDialog"));
PluginDialog->resize(401, 331);
vboxLayout = new QVBoxLayout(PluginDialog);
vboxLayout->setSpacing(6);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
vboxLayout->setContentsMargins(8, 8, 8, 8);
label = new QLabel(PluginDialog);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
label->setWordWrap(true);
vboxLayout->addWidget(label);
treeWidget = new QTreeWidget(PluginDialog);
- treeWidget->setObjectName(QStringLiteral("treeWidget"));
+ treeWidget->setObjectName(QString::fromUtf8("treeWidget"));
treeWidget->setTextElideMode(Qt::ElideNone);
vboxLayout->addWidget(treeWidget);
message = new QLabel(PluginDialog);
- message->setObjectName(QStringLiteral("message"));
+ message->setObjectName(QString::fromUtf8("message"));
message->setWordWrap(true);
vboxLayout->addWidget(message);
hboxLayout = new QHBoxLayout();
hboxLayout->setSpacing(6);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
hboxLayout->setContentsMargins(0, 0, 0, 0);
vboxLayout->addLayout(hboxLayout);
buttonBox = new QDialogButtonBox(PluginDialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Close);
diff --git a/tests/auto/tools/uic/baseline/preferencesdialog.ui.h b/tests/auto/tools/uic/baseline/preferencesdialog.ui.h
index 15761b2cdc..289e6775b4 100644
--- a/tests/auto/tools/uic/baseline/preferencesdialog.ui.h
+++ b/tests/auto/tools/uic/baseline/preferencesdialog.ui.h
@@ -53,21 +53,21 @@ public:
void setupUi(QDialog *PreferencesDialog)
{
if (PreferencesDialog->objectName().isEmpty())
- PreferencesDialog->setObjectName(QStringLiteral("PreferencesDialog"));
+ PreferencesDialog->setObjectName(QString::fromUtf8("PreferencesDialog"));
PreferencesDialog->resize(455, 359);
PreferencesDialog->setModal(true);
vboxLayout = new QVBoxLayout(PreferencesDialog);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
hboxLayout = new QHBoxLayout();
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
vboxLayout1 = new QVBoxLayout();
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
m_uiModeGroupBox = new QGroupBox(PreferencesDialog);
- m_uiModeGroupBox->setObjectName(QStringLiteral("m_uiModeGroupBox"));
+ m_uiModeGroupBox->setObjectName(QString::fromUtf8("m_uiModeGroupBox"));
vboxLayout2 = new QVBoxLayout(m_uiModeGroupBox);
- vboxLayout2->setObjectName(QStringLiteral("vboxLayout2"));
+ vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2"));
m_uiModeCombo = new QComboBox(m_uiModeGroupBox);
- m_uiModeCombo->setObjectName(QStringLiteral("m_uiModeCombo"));
+ m_uiModeCombo->setObjectName(QString::fromUtf8("m_uiModeCombo"));
vboxLayout2->addWidget(m_uiModeCombo);
@@ -75,12 +75,12 @@ public:
vboxLayout1->addWidget(m_uiModeGroupBox);
m_fontPanel = new FontPanel(PreferencesDialog);
- m_fontPanel->setObjectName(QStringLiteral("m_fontPanel"));
+ m_fontPanel->setObjectName(QString::fromUtf8("m_fontPanel"));
vboxLayout1->addWidget(m_fontPanel);
m_previewConfigurationWidget = new qdesigner_internal::PreviewConfigurationWidget(PreferencesDialog);
- m_previewConfigurationWidget->setObjectName(QStringLiteral("m_previewConfigurationWidget"));
+ m_previewConfigurationWidget->setObjectName(QString::fromUtf8("m_previewConfigurationWidget"));
vboxLayout1->addWidget(m_previewConfigurationWidget);
@@ -88,23 +88,23 @@ public:
hboxLayout->addLayout(vboxLayout1);
vboxLayout3 = new QVBoxLayout();
- vboxLayout3->setObjectName(QStringLiteral("vboxLayout3"));
+ vboxLayout3->setObjectName(QString::fromUtf8("vboxLayout3"));
m_templatePathGroupBox = new QGroupBox(PreferencesDialog);
- m_templatePathGroupBox->setObjectName(QStringLiteral("m_templatePathGroupBox"));
+ m_templatePathGroupBox->setObjectName(QString::fromUtf8("m_templatePathGroupBox"));
gridLayout = new QGridLayout(m_templatePathGroupBox);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
m_templatePathListWidget = new QListWidget(m_templatePathGroupBox);
- m_templatePathListWidget->setObjectName(QStringLiteral("m_templatePathListWidget"));
+ m_templatePathListWidget->setObjectName(QString::fromUtf8("m_templatePathListWidget"));
gridLayout->addWidget(m_templatePathListWidget, 0, 0, 1, 3);
m_addTemplatePathButton = new QToolButton(m_templatePathGroupBox);
- m_addTemplatePathButton->setObjectName(QStringLiteral("m_addTemplatePathButton"));
+ m_addTemplatePathButton->setObjectName(QString::fromUtf8("m_addTemplatePathButton"));
gridLayout->addWidget(m_addTemplatePathButton, 1, 0, 1, 1);
m_removeTemplatePathButton = new QToolButton(m_templatePathGroupBox);
- m_removeTemplatePathButton->setObjectName(QStringLiteral("m_removeTemplatePathButton"));
+ m_removeTemplatePathButton->setObjectName(QString::fromUtf8("m_removeTemplatePathButton"));
gridLayout->addWidget(m_removeTemplatePathButton, 1, 1, 1, 1);
@@ -116,7 +116,7 @@ public:
vboxLayout3->addWidget(m_templatePathGroupBox);
m_gridPanel = new qdesigner_internal::GridPanel(PreferencesDialog);
- m_gridPanel->setObjectName(QStringLiteral("m_gridPanel"));
+ m_gridPanel->setObjectName(QString::fromUtf8("m_gridPanel"));
vboxLayout3->addWidget(m_gridPanel);
@@ -127,14 +127,14 @@ public:
vboxLayout->addLayout(hboxLayout);
line = new QFrame(PreferencesDialog);
- line->setObjectName(QStringLiteral("line"));
+ line->setObjectName(QString::fromUtf8("line"));
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
vboxLayout->addWidget(line);
m_dialogButtonBox = new QDialogButtonBox(PreferencesDialog);
- m_dialogButtonBox->setObjectName(QStringLiteral("m_dialogButtonBox"));
+ m_dialogButtonBox->setObjectName(QString::fromUtf8("m_dialogButtonBox"));
m_dialogButtonBox->setOrientation(Qt::Horizontal);
m_dialogButtonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/previewconfigurationwidget.ui.h b/tests/auto/tools/uic/baseline/previewconfigurationwidget.ui.h
index 60bf65af45..3c729b9c65 100644
--- a/tests/auto/tools/uic/baseline/previewconfigurationwidget.ui.h
+++ b/tests/auto/tools/uic/baseline/previewconfigurationwidget.ui.h
@@ -40,40 +40,40 @@ public:
void setupUi(QGroupBox *PreviewConfigurationWidget)
{
if (PreviewConfigurationWidget->objectName().isEmpty())
- PreviewConfigurationWidget->setObjectName(QStringLiteral("PreviewConfigurationWidget"));
+ PreviewConfigurationWidget->setObjectName(QString::fromUtf8("PreviewConfigurationWidget"));
PreviewConfigurationWidget->setCheckable(true);
formLayout = new QFormLayout(PreviewConfigurationWidget);
- formLayout->setObjectName(QStringLiteral("formLayout"));
+ formLayout->setObjectName(QString::fromUtf8("formLayout"));
m_styleLabel = new QLabel(PreviewConfigurationWidget);
- m_styleLabel->setObjectName(QStringLiteral("m_styleLabel"));
+ m_styleLabel->setObjectName(QString::fromUtf8("m_styleLabel"));
formLayout->setWidget(0, QFormLayout::LabelRole, m_styleLabel);
m_styleCombo = new QComboBox(PreviewConfigurationWidget);
- m_styleCombo->setObjectName(QStringLiteral("m_styleCombo"));
+ m_styleCombo->setObjectName(QString::fromUtf8("m_styleCombo"));
formLayout->setWidget(0, QFormLayout::FieldRole, m_styleCombo);
m_appStyleSheetLabel = new QLabel(PreviewConfigurationWidget);
- m_appStyleSheetLabel->setObjectName(QStringLiteral("m_appStyleSheetLabel"));
+ m_appStyleSheetLabel->setObjectName(QString::fromUtf8("m_appStyleSheetLabel"));
formLayout->setWidget(1, QFormLayout::LabelRole, m_appStyleSheetLabel);
hboxLayout = new QHBoxLayout();
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
m_appStyleSheetLineEdit = new qdesigner_internal::TextPropertyEditor(PreviewConfigurationWidget);
- m_appStyleSheetLineEdit->setObjectName(QStringLiteral("m_appStyleSheetLineEdit"));
+ m_appStyleSheetLineEdit->setObjectName(QString::fromUtf8("m_appStyleSheetLineEdit"));
m_appStyleSheetLineEdit->setMinimumSize(QSize(149, 0));
hboxLayout->addWidget(m_appStyleSheetLineEdit);
m_appStyleSheetChangeButton = new QToolButton(PreviewConfigurationWidget);
- m_appStyleSheetChangeButton->setObjectName(QStringLiteral("m_appStyleSheetChangeButton"));
+ m_appStyleSheetChangeButton->setObjectName(QString::fromUtf8("m_appStyleSheetChangeButton"));
hboxLayout->addWidget(m_appStyleSheetChangeButton);
m_appStyleSheetClearButton = new QToolButton(PreviewConfigurationWidget);
- m_appStyleSheetClearButton->setObjectName(QStringLiteral("m_appStyleSheetClearButton"));
+ m_appStyleSheetClearButton->setObjectName(QString::fromUtf8("m_appStyleSheetClearButton"));
hboxLayout->addWidget(m_appStyleSheetClearButton);
@@ -81,19 +81,19 @@ public:
formLayout->setLayout(1, QFormLayout::FieldRole, hboxLayout);
m_skinLabel = new QLabel(PreviewConfigurationWidget);
- m_skinLabel->setObjectName(QStringLiteral("m_skinLabel"));
+ m_skinLabel->setObjectName(QString::fromUtf8("m_skinLabel"));
formLayout->setWidget(2, QFormLayout::LabelRole, m_skinLabel);
hboxLayout1 = new QHBoxLayout();
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
m_skinCombo = new QComboBox(PreviewConfigurationWidget);
- m_skinCombo->setObjectName(QStringLiteral("m_skinCombo"));
+ m_skinCombo->setObjectName(QString::fromUtf8("m_skinCombo"));
hboxLayout1->addWidget(m_skinCombo);
m_skinRemoveButton = new QToolButton(PreviewConfigurationWidget);
- m_skinRemoveButton->setObjectName(QStringLiteral("m_skinRemoveButton"));
+ m_skinRemoveButton->setObjectName(QString::fromUtf8("m_skinRemoveButton"));
hboxLayout1->addWidget(m_skinRemoveButton);
diff --git a/tests/auto/tools/uic/baseline/previewdialogbase.ui.h b/tests/auto/tools/uic/baseline/previewdialogbase.ui.h
index 7ea1e72e04..8d4c0dae9f 100644
--- a/tests/auto/tools/uic/baseline/previewdialogbase.ui.h
+++ b/tests/auto/tools/uic/baseline/previewdialogbase.ui.h
@@ -45,7 +45,7 @@ public:
void setupUi(QDialog *PreviewDialogBase)
{
if (PreviewDialogBase->objectName().isEmpty())
- PreviewDialogBase->setObjectName(QStringLiteral("PreviewDialogBase"));
+ PreviewDialogBase->setObjectName(QString::fromUtf8("PreviewDialogBase"));
PreviewDialogBase->resize(733, 479);
vboxLayout = new QVBoxLayout(PreviewDialogBase);
#ifndef Q_OS_MAC
@@ -54,7 +54,7 @@ public:
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
hboxLayout = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout->setSpacing(6);
@@ -62,14 +62,14 @@ public:
#ifndef Q_OS_MAC
hboxLayout->setContentsMargins(0, 0, 0, 0);
#endif
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
label = new QLabel(PreviewDialogBase);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
hboxLayout->addWidget(label);
paperSizeCombo = new QComboBox(PreviewDialogBase);
- paperSizeCombo->setObjectName(QStringLiteral("paperSizeCombo"));
+ paperSizeCombo->setObjectName(QString::fromUtf8("paperSizeCombo"));
QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(1), static_cast<QSizePolicy::Policy>(0));
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -79,12 +79,12 @@ public:
hboxLayout->addWidget(paperSizeCombo);
label_2 = new QLabel(PreviewDialogBase);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
hboxLayout->addWidget(label_2);
paperOrientationCombo = new QComboBox(PreviewDialogBase);
- paperOrientationCombo->setObjectName(QStringLiteral("paperOrientationCombo"));
+ paperOrientationCombo->setObjectName(QString::fromUtf8("paperOrientationCombo"));
sizePolicy.setHeightForWidth(paperOrientationCombo->sizePolicy().hasHeightForWidth());
paperOrientationCombo->setSizePolicy(sizePolicy);
@@ -102,9 +102,9 @@ public:
hboxLayout1->setSpacing(6);
#endif
hboxLayout1->setContentsMargins(0, 0, 0, 0);
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
pageList = new QTreeWidget(PreviewDialogBase);
- pageList->setObjectName(QStringLiteral("pageList"));
+ pageList->setObjectName(QString::fromUtf8("pageList"));
pageList->setIndentation(0);
pageList->setRootIsDecorated(false);
pageList->setUniformRowHeights(true);
@@ -114,7 +114,7 @@ public:
hboxLayout1->addWidget(pageList);
previewArea = new QScrollArea(PreviewDialogBase);
- previewArea->setObjectName(QStringLiteral("previewArea"));
+ previewArea->setObjectName(QString::fromUtf8("previewArea"));
QSizePolicy sizePolicy1(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(5));
sizePolicy1.setHorizontalStretch(1);
sizePolicy1.setVerticalStretch(0);
@@ -131,9 +131,9 @@ public:
hboxLayout2->setSpacing(6);
#endif
hboxLayout2->setContentsMargins(0, 0, 0, 0);
- hboxLayout2->setObjectName(QStringLiteral("hboxLayout2"));
+ hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2"));
progressBar = new QProgressBar(PreviewDialogBase);
- progressBar->setObjectName(QStringLiteral("progressBar"));
+ progressBar->setObjectName(QString::fromUtf8("progressBar"));
progressBar->setEnabled(false);
QSizePolicy sizePolicy2(static_cast<QSizePolicy::Policy>(7), static_cast<QSizePolicy::Policy>(0));
sizePolicy2.setHorizontalStretch(1);
@@ -147,7 +147,7 @@ public:
hboxLayout2->addWidget(progressBar);
buttonBox = new QDialogButtonBox(PreviewDialogBase);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/previewwidget.ui.h b/tests/auto/tools/uic/baseline/previewwidget.ui.h
index a86fec7c0d..6e359416c8 100644
--- a/tests/auto/tools/uic/baseline/previewwidget.ui.h
+++ b/tests/auto/tools/uic/baseline/previewwidget.ui.h
@@ -90,7 +90,7 @@ public:
void setupUi(QWidget *qdesigner_internal__PreviewWidget)
{
if (qdesigner_internal__PreviewWidget->objectName().isEmpty())
- qdesigner_internal__PreviewWidget->setObjectName(QStringLiteral("qdesigner_internal__PreviewWidget"));
+ qdesigner_internal__PreviewWidget->setObjectName(QString::fromUtf8("qdesigner_internal__PreviewWidget"));
qdesigner_internal__PreviewWidget->resize(471, 251);
QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(1), static_cast<QSizePolicy::Policy>(1));
sizePolicy.setHorizontalStretch(0);
@@ -104,7 +104,7 @@ public:
#ifndef Q_OS_MAC
gridLayout->setContentsMargins(9, 9, 9, 9);
#endif
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
vboxLayout = new QVBoxLayout();
#ifndef Q_OS_MAC
vboxLayout->setSpacing(6);
@@ -112,15 +112,15 @@ public:
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(0, 0, 0, 0);
#endif
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
LineEdit1 = new QLineEdit(qdesigner_internal__PreviewWidget);
- LineEdit1->setObjectName(QStringLiteral("LineEdit1"));
+ LineEdit1->setObjectName(QString::fromUtf8("LineEdit1"));
vboxLayout->addWidget(LineEdit1);
ComboBox1 = new QComboBox(qdesigner_internal__PreviewWidget);
ComboBox1->addItem(QString());
- ComboBox1->setObjectName(QStringLiteral("ComboBox1"));
+ ComboBox1->setObjectName(QString::fromUtf8("ComboBox1"));
vboxLayout->addWidget(ComboBox1);
@@ -129,14 +129,14 @@ public:
hboxLayout->setSpacing(6);
#endif
hboxLayout->setContentsMargins(0, 0, 0, 0);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
SpinBox1 = new QSpinBox(qdesigner_internal__PreviewWidget);
- SpinBox1->setObjectName(QStringLiteral("SpinBox1"));
+ SpinBox1->setObjectName(QString::fromUtf8("SpinBox1"));
hboxLayout->addWidget(SpinBox1);
PushButton1 = new QPushButton(qdesigner_internal__PreviewWidget);
- PushButton1->setObjectName(QStringLiteral("PushButton1"));
+ PushButton1->setObjectName(QString::fromUtf8("PushButton1"));
hboxLayout->addWidget(PushButton1);
@@ -144,19 +144,19 @@ public:
vboxLayout->addLayout(hboxLayout);
ScrollBar1 = new QScrollBar(qdesigner_internal__PreviewWidget);
- ScrollBar1->setObjectName(QStringLiteral("ScrollBar1"));
+ ScrollBar1->setObjectName(QString::fromUtf8("ScrollBar1"));
ScrollBar1->setOrientation(Qt::Horizontal);
vboxLayout->addWidget(ScrollBar1);
Slider1 = new QSlider(qdesigner_internal__PreviewWidget);
- Slider1->setObjectName(QStringLiteral("Slider1"));
+ Slider1->setObjectName(QString::fromUtf8("Slider1"));
Slider1->setOrientation(Qt::Horizontal);
vboxLayout->addWidget(Slider1);
listWidget = new QListWidget(qdesigner_internal__PreviewWidget);
- listWidget->setObjectName(QStringLiteral("listWidget"));
+ listWidget->setObjectName(QString::fromUtf8("listWidget"));
listWidget->setMaximumSize(QSize(32767, 50));
vboxLayout->addWidget(listWidget);
@@ -169,13 +169,13 @@ public:
gridLayout->addItem(spacerItem, 3, 0, 1, 2);
ProgressBar1 = new QProgressBar(qdesigner_internal__PreviewWidget);
- ProgressBar1->setObjectName(QStringLiteral("ProgressBar1"));
+ ProgressBar1->setObjectName(QString::fromUtf8("ProgressBar1"));
ProgressBar1->setOrientation(Qt::Horizontal);
gridLayout->addWidget(ProgressBar1, 2, 0, 1, 1);
ButtonGroup2 = new QGroupBox(qdesigner_internal__PreviewWidget);
- ButtonGroup2->setObjectName(QStringLiteral("ButtonGroup2"));
+ ButtonGroup2->setObjectName(QString::fromUtf8("ButtonGroup2"));
vboxLayout1 = new QVBoxLayout(ButtonGroup2);
#ifndef Q_OS_MAC
vboxLayout1->setSpacing(6);
@@ -183,15 +183,15 @@ public:
#ifndef Q_OS_MAC
vboxLayout1->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
CheckBox1 = new QCheckBox(ButtonGroup2);
- CheckBox1->setObjectName(QStringLiteral("CheckBox1"));
+ CheckBox1->setObjectName(QString::fromUtf8("CheckBox1"));
CheckBox1->setChecked(true);
vboxLayout1->addWidget(CheckBox1);
CheckBox2 = new QCheckBox(ButtonGroup2);
- CheckBox2->setObjectName(QStringLiteral("CheckBox2"));
+ CheckBox2->setObjectName(QString::fromUtf8("CheckBox2"));
vboxLayout1->addWidget(CheckBox2);
@@ -199,7 +199,7 @@ public:
gridLayout->addWidget(ButtonGroup2, 1, 0, 1, 1);
ButtonGroup1 = new QGroupBox(qdesigner_internal__PreviewWidget);
- ButtonGroup1->setObjectName(QStringLiteral("ButtonGroup1"));
+ ButtonGroup1->setObjectName(QString::fromUtf8("ButtonGroup1"));
vboxLayout2 = new QVBoxLayout(ButtonGroup1);
#ifndef Q_OS_MAC
vboxLayout2->setSpacing(6);
@@ -207,20 +207,20 @@ public:
#ifndef Q_OS_MAC
vboxLayout2->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout2->setObjectName(QStringLiteral("vboxLayout2"));
+ vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2"));
RadioButton1 = new QRadioButton(ButtonGroup1);
- RadioButton1->setObjectName(QStringLiteral("RadioButton1"));
+ RadioButton1->setObjectName(QString::fromUtf8("RadioButton1"));
RadioButton1->setChecked(true);
vboxLayout2->addWidget(RadioButton1);
RadioButton2 = new QRadioButton(ButtonGroup1);
- RadioButton2->setObjectName(QStringLiteral("RadioButton2"));
+ RadioButton2->setObjectName(QString::fromUtf8("RadioButton2"));
vboxLayout2->addWidget(RadioButton2);
RadioButton3 = new QRadioButton(ButtonGroup1);
- RadioButton3->setObjectName(QStringLiteral("RadioButton3"));
+ RadioButton3->setObjectName(QString::fromUtf8("RadioButton3"));
vboxLayout2->addWidget(RadioButton3);
diff --git a/tests/auto/tools/uic/baseline/proxy.ui.h b/tests/auto/tools/uic/baseline/proxy.ui.h
index 2112324eae..a1bc287190 100644
--- a/tests/auto/tools/uic/baseline/proxy.ui.h
+++ b/tests/auto/tools/uic/baseline/proxy.ui.h
@@ -34,44 +34,44 @@ public:
void setupUi(QDialog *ProxyDialog)
{
if (ProxyDialog->objectName().isEmpty())
- ProxyDialog->setObjectName(QStringLiteral("ProxyDialog"));
+ ProxyDialog->setObjectName(QString::fromUtf8("ProxyDialog"));
ProxyDialog->resize(369, 144);
gridLayout = new QGridLayout(ProxyDialog);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
iconLabel = new QLabel(ProxyDialog);
- iconLabel->setObjectName(QStringLiteral("iconLabel"));
+ iconLabel->setObjectName(QString::fromUtf8("iconLabel"));
gridLayout->addWidget(iconLabel, 0, 0, 1, 1);
introLabel = new QLabel(ProxyDialog);
- introLabel->setObjectName(QStringLiteral("introLabel"));
+ introLabel->setObjectName(QString::fromUtf8("introLabel"));
introLabel->setWordWrap(true);
gridLayout->addWidget(introLabel, 0, 1, 1, 2);
usernameLabel = new QLabel(ProxyDialog);
- usernameLabel->setObjectName(QStringLiteral("usernameLabel"));
+ usernameLabel->setObjectName(QString::fromUtf8("usernameLabel"));
gridLayout->addWidget(usernameLabel, 1, 0, 1, 2);
userNameLineEdit = new QLineEdit(ProxyDialog);
- userNameLineEdit->setObjectName(QStringLiteral("userNameLineEdit"));
+ userNameLineEdit->setObjectName(QString::fromUtf8("userNameLineEdit"));
gridLayout->addWidget(userNameLineEdit, 1, 2, 1, 1);
passwordLabel = new QLabel(ProxyDialog);
- passwordLabel->setObjectName(QStringLiteral("passwordLabel"));
+ passwordLabel->setObjectName(QString::fromUtf8("passwordLabel"));
gridLayout->addWidget(passwordLabel, 2, 0, 1, 2);
passwordLineEdit = new QLineEdit(ProxyDialog);
- passwordLineEdit->setObjectName(QStringLiteral("passwordLineEdit"));
+ passwordLineEdit->setObjectName(QString::fromUtf8("passwordLineEdit"));
passwordLineEdit->setEchoMode(QLineEdit::Password);
gridLayout->addWidget(passwordLineEdit, 2, 2, 1, 1);
buttonBox = new QDialogButtonBox(ProxyDialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/qfiledialog.ui.h b/tests/auto/tools/uic/baseline/qfiledialog.ui.h
index cd1891c58c..53607db449 100644
--- a/tests/auto/tools/uic/baseline/qfiledialog.ui.h
+++ b/tests/auto/tools/uic/baseline/qfiledialog.ui.h
@@ -92,20 +92,20 @@ public:
void setupUi(QDialog *QFileDialog)
{
if (QFileDialog->objectName().isEmpty())
- QFileDialog->setObjectName(QStringLiteral("QFileDialog"));
+ QFileDialog->setObjectName(QString::fromUtf8("QFileDialog"));
QFileDialog->resize(521, 316);
QFileDialog->setSizeGripEnabled(true);
gridLayout = new QGridLayout(QFileDialog);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
lookInLabel = new QLabel(QFileDialog);
- lookInLabel->setObjectName(QStringLiteral("lookInLabel"));
+ lookInLabel->setObjectName(QString::fromUtf8("lookInLabel"));
gridLayout->addWidget(lookInLabel, 0, 0, 1, 1);
hboxLayout = new QHBoxLayout();
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
lookInCombo = new QFileDialogComboBox(QFileDialog);
- lookInCombo->setObjectName(QStringLiteral("lookInCombo"));
+ lookInCombo->setObjectName(QString::fromUtf8("lookInCombo"));
QSizePolicy sizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
sizePolicy.setHorizontalStretch(1);
sizePolicy.setVerticalStretch(0);
@@ -116,32 +116,32 @@ public:
hboxLayout->addWidget(lookInCombo);
backButton = new QToolButton(QFileDialog);
- backButton->setObjectName(QStringLiteral("backButton"));
+ backButton->setObjectName(QString::fromUtf8("backButton"));
hboxLayout->addWidget(backButton);
forwardButton = new QToolButton(QFileDialog);
- forwardButton->setObjectName(QStringLiteral("forwardButton"));
+ forwardButton->setObjectName(QString::fromUtf8("forwardButton"));
hboxLayout->addWidget(forwardButton);
toParentButton = new QToolButton(QFileDialog);
- toParentButton->setObjectName(QStringLiteral("toParentButton"));
+ toParentButton->setObjectName(QString::fromUtf8("toParentButton"));
hboxLayout->addWidget(toParentButton);
newFolderButton = new QToolButton(QFileDialog);
- newFolderButton->setObjectName(QStringLiteral("newFolderButton"));
+ newFolderButton->setObjectName(QString::fromUtf8("newFolderButton"));
hboxLayout->addWidget(newFolderButton);
listModeButton = new QToolButton(QFileDialog);
- listModeButton->setObjectName(QStringLiteral("listModeButton"));
+ listModeButton->setObjectName(QString::fromUtf8("listModeButton"));
hboxLayout->addWidget(listModeButton);
detailModeButton = new QToolButton(QFileDialog);
- detailModeButton->setObjectName(QStringLiteral("detailModeButton"));
+ detailModeButton->setObjectName(QString::fromUtf8("detailModeButton"));
hboxLayout->addWidget(detailModeButton);
@@ -149,7 +149,7 @@ public:
gridLayout->addLayout(hboxLayout, 0, 1, 1, 2);
splitter = new QSplitter(QFileDialog);
- splitter->setObjectName(QStringLiteral("splitter"));
+ splitter->setObjectName(QString::fromUtf8("splitter"));
QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Expanding);
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
@@ -157,38 +157,38 @@ public:
splitter->setSizePolicy(sizePolicy1);
splitter->setOrientation(Qt::Horizontal);
sidebar = new QSidebar(splitter);
- sidebar->setObjectName(QStringLiteral("sidebar"));
+ sidebar->setObjectName(QString::fromUtf8("sidebar"));
splitter->addWidget(sidebar);
frame = new QFrame(splitter);
- frame->setObjectName(QStringLiteral("frame"));
+ frame->setObjectName(QString::fromUtf8("frame"));
frame->setFrameShape(QFrame::NoFrame);
frame->setFrameShadow(QFrame::Raised);
vboxLayout = new QVBoxLayout(frame);
vboxLayout->setSpacing(0);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
vboxLayout->setContentsMargins(0, 0, 0, 0);
stackedWidget = new QStackedWidget(frame);
- stackedWidget->setObjectName(QStringLiteral("stackedWidget"));
+ stackedWidget->setObjectName(QString::fromUtf8("stackedWidget"));
page = new QWidget();
- page->setObjectName(QStringLiteral("page"));
+ page->setObjectName(QString::fromUtf8("page"));
vboxLayout1 = new QVBoxLayout(page);
vboxLayout1->setSpacing(0);
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
vboxLayout1->setContentsMargins(0, 0, 0, 0);
listView = new QFileDialogListView(page);
- listView->setObjectName(QStringLiteral("listView"));
+ listView->setObjectName(QString::fromUtf8("listView"));
vboxLayout1->addWidget(listView);
stackedWidget->addWidget(page);
page_2 = new QWidget();
- page_2->setObjectName(QStringLiteral("page_2"));
+ page_2->setObjectName(QString::fromUtf8("page_2"));
vboxLayout2 = new QVBoxLayout(page_2);
vboxLayout2->setSpacing(0);
- vboxLayout2->setObjectName(QStringLiteral("vboxLayout2"));
+ vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2"));
vboxLayout2->setContentsMargins(0, 0, 0, 0);
treeView = new QFileDialogTreeView(page_2);
- treeView->setObjectName(QStringLiteral("treeView"));
+ treeView->setObjectName(QString::fromUtf8("treeView"));
vboxLayout2->addWidget(treeView);
@@ -201,7 +201,7 @@ public:
gridLayout->addWidget(splitter, 1, 0, 1, 3);
fileNameLabel = new QLabel(QFileDialog);
- fileNameLabel->setObjectName(QStringLiteral("fileNameLabel"));
+ fileNameLabel->setObjectName(QString::fromUtf8("fileNameLabel"));
QSizePolicy sizePolicy2(QSizePolicy::Minimum, QSizePolicy::Preferred);
sizePolicy2.setHorizontalStretch(0);
sizePolicy2.setVerticalStretch(0);
@@ -212,7 +212,7 @@ public:
gridLayout->addWidget(fileNameLabel, 2, 0, 1, 1);
fileNameEdit = new QFileDialogLineEdit(QFileDialog);
- fileNameEdit->setObjectName(QStringLiteral("fileNameEdit"));
+ fileNameEdit->setObjectName(QString::fromUtf8("fileNameEdit"));
QSizePolicy sizePolicy3(QSizePolicy::Expanding, QSizePolicy::Fixed);
sizePolicy3.setHorizontalStretch(1);
sizePolicy3.setVerticalStretch(0);
@@ -222,14 +222,14 @@ public:
gridLayout->addWidget(fileNameEdit, 2, 1, 1, 1);
buttonBox = new QDialogButtonBox(QFileDialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Vertical);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok);
gridLayout->addWidget(buttonBox, 2, 2, 2, 1);
fileTypeLabel = new QLabel(QFileDialog);
- fileTypeLabel->setObjectName(QStringLiteral("fileTypeLabel"));
+ fileTypeLabel->setObjectName(QString::fromUtf8("fileTypeLabel"));
QSizePolicy sizePolicy4(QSizePolicy::Preferred, QSizePolicy::Fixed);
sizePolicy4.setHorizontalStretch(0);
sizePolicy4.setVerticalStretch(0);
@@ -239,7 +239,7 @@ public:
gridLayout->addWidget(fileTypeLabel, 3, 0, 1, 1);
fileTypeCombo = new QComboBox(QFileDialog);
- fileTypeCombo->setObjectName(QStringLiteral("fileTypeCombo"));
+ fileTypeCombo->setObjectName(QString::fromUtf8("fileTypeCombo"));
QSizePolicy sizePolicy5(QSizePolicy::Expanding, QSizePolicy::Fixed);
sizePolicy5.setHorizontalStretch(0);
sizePolicy5.setVerticalStretch(0);
diff --git a/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h b/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h
index 5b0a5b9dc6..a5379bc468 100644
--- a/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h
+++ b/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h
@@ -1,7 +1,7 @@
/********************************************************************************
** Form generated from reading UI file 'qpagesetupwidget.ui'
**
-** Created by: Qt User Interface Compiler version 5.9.0
+** Created by: Qt User Interface Compiler version 5.12.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
@@ -76,46 +76,46 @@ public:
void setupUi(QWidget *QPageSetupWidget)
{
if (QPageSetupWidget->objectName().isEmpty())
- QPageSetupWidget->setObjectName(QStringLiteral("QPageSetupWidget"));
+ QPageSetupWidget->setObjectName(QString::fromUtf8("QPageSetupWidget"));
QPageSetupWidget->resize(416, 515);
gridLayout_3 = new QGridLayout(QPageSetupWidget);
gridLayout_3->setContentsMargins(0, 0, 0, 0);
- gridLayout_3->setObjectName(QStringLiteral("gridLayout_3"));
+ gridLayout_3->setObjectName(QString::fromUtf8("gridLayout_3"));
groupBox_2 = new QGroupBox(QPageSetupWidget);
- groupBox_2->setObjectName(QStringLiteral("groupBox_2"));
+ groupBox_2->setObjectName(QString::fromUtf8("groupBox_2"));
gridLayout_2 = new QGridLayout(groupBox_2);
- gridLayout_2->setObjectName(QStringLiteral("gridLayout_2"));
+ gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
pageSizeLabel = new QLabel(groupBox_2);
- pageSizeLabel->setObjectName(QStringLiteral("pageSizeLabel"));
+ pageSizeLabel->setObjectName(QString::fromUtf8("pageSizeLabel"));
gridLayout_2->addWidget(pageSizeLabel, 0, 0, 1, 1);
pageSizeCombo = new QComboBox(groupBox_2);
- pageSizeCombo->setObjectName(QStringLiteral("pageSizeCombo"));
+ pageSizeCombo->setObjectName(QString::fromUtf8("pageSizeCombo"));
gridLayout_2->addWidget(pageSizeCombo, 0, 1, 1, 1);
widthLabel = new QLabel(groupBox_2);
- widthLabel->setObjectName(QStringLiteral("widthLabel"));
+ widthLabel->setObjectName(QString::fromUtf8("widthLabel"));
gridLayout_2->addWidget(widthLabel, 1, 0, 1, 1);
horizontalLayout_3 = new QHBoxLayout();
- horizontalLayout_3->setObjectName(QStringLiteral("horizontalLayout_3"));
+ horizontalLayout_3->setObjectName(QString::fromUtf8("horizontalLayout_3"));
pageWidth = new QDoubleSpinBox(groupBox_2);
- pageWidth->setObjectName(QStringLiteral("pageWidth"));
- pageWidth->setMaximum(9999.99);
+ pageWidth->setObjectName(QString::fromUtf8("pageWidth"));
+ pageWidth->setMaximum(9999.989999999999782);
horizontalLayout_3->addWidget(pageWidth);
heightLabel = new QLabel(groupBox_2);
- heightLabel->setObjectName(QStringLiteral("heightLabel"));
+ heightLabel->setObjectName(QString::fromUtf8("heightLabel"));
horizontalLayout_3->addWidget(heightLabel);
pageHeight = new QDoubleSpinBox(groupBox_2);
- pageHeight->setObjectName(QStringLiteral("pageHeight"));
- pageHeight->setMaximum(9999.99);
+ pageHeight->setObjectName(QString::fromUtf8("pageHeight"));
+ pageHeight->setMaximum(9999.989999999999782);
horizontalLayout_3->addWidget(pageHeight);
@@ -123,12 +123,12 @@ public:
gridLayout_2->addLayout(horizontalLayout_3, 1, 1, 1, 1);
paperSourceLabel = new QLabel(groupBox_2);
- paperSourceLabel->setObjectName(QStringLiteral("paperSourceLabel"));
+ paperSourceLabel->setObjectName(QString::fromUtf8("paperSourceLabel"));
gridLayout_2->addWidget(paperSourceLabel, 2, 0, 1, 1);
paperSource = new QComboBox(groupBox_2);
- paperSource->setObjectName(QStringLiteral("paperSource"));
+ paperSource->setObjectName(QString::fromUtf8("paperSource"));
gridLayout_2->addWidget(paperSource, 2, 1, 1, 1);
@@ -140,9 +140,9 @@ public:
gridLayout_3->addWidget(groupBox_2, 1, 0, 1, 2);
horizontalLayout_4 = new QHBoxLayout();
- horizontalLayout_4->setObjectName(QStringLiteral("horizontalLayout_4"));
+ horizontalLayout_4->setObjectName(QString::fromUtf8("horizontalLayout_4"));
unitCombo = new QComboBox(QPageSetupWidget);
- unitCombo->setObjectName(QStringLiteral("unitCombo"));
+ unitCombo->setObjectName(QString::fromUtf8("unitCombo"));
horizontalLayout_4->addWidget(unitCombo);
@@ -154,32 +154,32 @@ public:
gridLayout_3->addLayout(horizontalLayout_4, 0, 0, 1, 2);
preview = new QWidget(QPageSetupWidget);
- preview->setObjectName(QStringLiteral("preview"));
+ preview->setObjectName(QString::fromUtf8("preview"));
gridLayout_3->addWidget(preview, 2, 1, 2, 1);
groupBox_3 = new QGroupBox(QPageSetupWidget);
- groupBox_3->setObjectName(QStringLiteral("groupBox_3"));
+ groupBox_3->setObjectName(QString::fromUtf8("groupBox_3"));
verticalLayout = new QVBoxLayout(groupBox_3);
- verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
portrait = new QRadioButton(groupBox_3);
- portrait->setObjectName(QStringLiteral("portrait"));
+ portrait->setObjectName(QString::fromUtf8("portrait"));
portrait->setChecked(true);
verticalLayout->addWidget(portrait);
landscape = new QRadioButton(groupBox_3);
- landscape->setObjectName(QStringLiteral("landscape"));
+ landscape->setObjectName(QString::fromUtf8("landscape"));
verticalLayout->addWidget(landscape);
reverseLandscape = new QRadioButton(groupBox_3);
- reverseLandscape->setObjectName(QStringLiteral("reverseLandscape"));
+ reverseLandscape->setObjectName(QString::fromUtf8("reverseLandscape"));
verticalLayout->addWidget(reverseLandscape);
reversePortrait = new QRadioButton(groupBox_3);
- reversePortrait->setObjectName(QStringLiteral("reversePortrait"));
+ reversePortrait->setObjectName(QString::fromUtf8("reversePortrait"));
verticalLayout->addWidget(reversePortrait);
@@ -191,28 +191,28 @@ public:
gridLayout_3->addWidget(groupBox_3, 2, 0, 1, 1);
groupBox = new QGroupBox(QPageSetupWidget);
- groupBox->setObjectName(QStringLiteral("groupBox"));
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
horizontalLayout_2 = new QHBoxLayout(groupBox);
- horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
+ horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2"));
gridLayout = new QGridLayout();
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
topMargin = new QDoubleSpinBox(groupBox);
- topMargin->setObjectName(QStringLiteral("topMargin"));
+ topMargin->setObjectName(QString::fromUtf8("topMargin"));
topMargin->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
- topMargin->setMaximum(999.99);
+ topMargin->setMaximum(999.990000000000009);
gridLayout->addWidget(topMargin, 0, 1, 1, 1);
horizontalLayout = new QHBoxLayout();
- horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
+ horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
horizontalSpacer_7 = new QSpacerItem(0, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout->addItem(horizontalSpacer_7);
leftMargin = new QDoubleSpinBox(groupBox);
- leftMargin->setObjectName(QStringLiteral("leftMargin"));
+ leftMargin->setObjectName(QString::fromUtf8("leftMargin"));
leftMargin->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
- leftMargin->setMaximum(999.99);
+ leftMargin->setMaximum(999.990000000000009);
horizontalLayout->addWidget(leftMargin);
@@ -221,9 +221,9 @@ public:
horizontalLayout->addItem(horizontalSpacer);
rightMargin = new QDoubleSpinBox(groupBox);
- rightMargin->setObjectName(QStringLiteral("rightMargin"));
+ rightMargin->setObjectName(QString::fromUtf8("rightMargin"));
rightMargin->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
- rightMargin->setMaximum(999.99);
+ rightMargin->setMaximum(999.990000000000009);
horizontalLayout->addWidget(rightMargin);
@@ -239,9 +239,9 @@ public:
gridLayout->addItem(horizontalSpacer_2, 0, 2, 1, 1);
bottomMargin = new QDoubleSpinBox(groupBox);
- bottomMargin->setObjectName(QStringLiteral("bottomMargin"));
+ bottomMargin->setObjectName(QString::fromUtf8("bottomMargin"));
bottomMargin->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
- bottomMargin->setMaximum(999.99);
+ bottomMargin->setMaximum(999.990000000000009);
gridLayout->addWidget(bottomMargin, 2, 1, 1, 1);
@@ -256,11 +256,11 @@ public:
gridLayout_3->addWidget(groupBox, 3, 0, 1, 1);
pagesPerSheetButtonGroup = new QGroupBox(QPageSetupWidget);
- pagesPerSheetButtonGroup->setObjectName(QStringLiteral("pagesPerSheetButtonGroup"));
+ pagesPerSheetButtonGroup->setObjectName(QString::fromUtf8("pagesPerSheetButtonGroup"));
gridLayout_4 = new QGridLayout(pagesPerSheetButtonGroup);
- gridLayout_4->setObjectName(QStringLiteral("gridLayout_4"));
+ gridLayout_4->setObjectName(QString::fromUtf8("gridLayout_4"));
pagesPerSheetCombo = new QComboBox(pagesPerSheetButtonGroup);
- pagesPerSheetCombo->setObjectName(QStringLiteral("pagesPerSheetCombo"));
+ pagesPerSheetCombo->setObjectName(QString::fromUtf8("pagesPerSheetCombo"));
gridLayout_4->addWidget(pagesPerSheetCombo, 0, 1, 1, 1);
@@ -269,17 +269,17 @@ public:
gridLayout_4->addItem(horizontalSpacer_6, 0, 2, 1, 1);
label = new QLabel(pagesPerSheetButtonGroup);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout_4->addWidget(label, 1, 0, 1, 1);
pagesPerSheetLayoutCombo = new QComboBox(pagesPerSheetButtonGroup);
- pagesPerSheetLayoutCombo->setObjectName(QStringLiteral("pagesPerSheetLayoutCombo"));
+ pagesPerSheetLayoutCombo->setObjectName(QString::fromUtf8("pagesPerSheetLayoutCombo"));
gridLayout_4->addWidget(pagesPerSheetLayoutCombo, 1, 1, 1, 1);
label_2 = new QLabel(pagesPerSheetButtonGroup);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
gridLayout_4->addWidget(label_2, 0, 0, 1, 1);
diff --git a/tests/auto/tools/uic/baseline/qprintpropertieswidget.ui.h b/tests/auto/tools/uic/baseline/qprintpropertieswidget.ui.h
index baa9bbec38..8626a9fc3c 100644
--- a/tests/auto/tools/uic/baseline/qprintpropertieswidget.ui.h
+++ b/tests/auto/tools/uic/baseline/qprintpropertieswidget.ui.h
@@ -36,30 +36,30 @@ public:
void setupUi(QWidget *QPrintPropertiesWidget)
{
if (QPrintPropertiesWidget->objectName().isEmpty())
- QPrintPropertiesWidget->setObjectName(QStringLiteral("QPrintPropertiesWidget"));
+ QPrintPropertiesWidget->setObjectName(QString::fromUtf8("QPrintPropertiesWidget"));
QPrintPropertiesWidget->resize(396, 288);
verticalLayout_4 = new QVBoxLayout(QPrintPropertiesWidget);
verticalLayout_4->setContentsMargins(0, 0, 0, 0);
- verticalLayout_4->setObjectName(QStringLiteral("verticalLayout_4"));
+ verticalLayout_4->setObjectName(QString::fromUtf8("verticalLayout_4"));
tabs = new QTabWidget(QPrintPropertiesWidget);
- tabs->setObjectName(QStringLiteral("tabs"));
+ tabs->setObjectName(QString::fromUtf8("tabs"));
tabPage = new QWidget();
- tabPage->setObjectName(QStringLiteral("tabPage"));
+ tabPage->setObjectName(QString::fromUtf8("tabPage"));
tabPage->setGeometry(QRect(0, 0, 392, 261));
horizontalLayout = new QHBoxLayout(tabPage);
- horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
+ horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
pageSetup = new QPageSetupWidget(tabPage);
- pageSetup->setObjectName(QStringLiteral("pageSetup"));
+ pageSetup->setObjectName(QString::fromUtf8("pageSetup"));
horizontalLayout->addWidget(pageSetup);
tabs->addTab(tabPage, QString());
cupsPropertiesPage = new QWidget();
- cupsPropertiesPage->setObjectName(QStringLiteral("cupsPropertiesPage"));
+ cupsPropertiesPage->setObjectName(QString::fromUtf8("cupsPropertiesPage"));
horizontalLayout_2 = new QHBoxLayout(cupsPropertiesPage);
- horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
+ horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2"));
treeView = new QTreeView(cupsPropertiesPage);
- treeView->setObjectName(QStringLiteral("treeView"));
+ treeView->setObjectName(QString::fromUtf8("treeView"));
treeView->setAlternatingRowColors(true);
horizontalLayout_2->addWidget(treeView);
diff --git a/tests/auto/tools/uic/baseline/qprintsettingsoutput.ui.h b/tests/auto/tools/uic/baseline/qprintsettingsoutput.ui.h
index a0f16c998b..656b5f9deb 100644
--- a/tests/auto/tools/uic/baseline/qprintsettingsoutput.ui.h
+++ b/tests/auto/tools/uic/baseline/qprintsettingsoutput.ui.h
@@ -70,20 +70,20 @@ public:
void setupUi(QWidget *QPrintSettingsOutput)
{
if (QPrintSettingsOutput->objectName().isEmpty())
- QPrintSettingsOutput->setObjectName(QStringLiteral("QPrintSettingsOutput"));
+ QPrintSettingsOutput->setObjectName(QString::fromUtf8("QPrintSettingsOutput"));
QPrintSettingsOutput->resize(416, 166);
horizontalLayout_2 = new QHBoxLayout(QPrintSettingsOutput);
horizontalLayout_2->setContentsMargins(0, 0, 0, 0);
- horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
+ horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2"));
tabs = new QTabWidget(QPrintSettingsOutput);
- tabs->setObjectName(QStringLiteral("tabs"));
+ tabs->setObjectName(QString::fromUtf8("tabs"));
copiesTab = new QWidget();
- copiesTab->setObjectName(QStringLiteral("copiesTab"));
+ copiesTab->setObjectName(QString::fromUtf8("copiesTab"));
copiesTab->setGeometry(QRect(0, 0, 412, 139));
horizontalLayout = new QHBoxLayout(copiesTab);
- horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
+ horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
gbPrintRange = new QGroupBox(copiesTab);
- gbPrintRange->setObjectName(QStringLiteral("gbPrintRange"));
+ gbPrintRange->setObjectName(QString::fromUtf8("gbPrintRange"));
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -92,9 +92,9 @@ public:
_3 = new QVBoxLayout(gbPrintRange);
_3->setSpacing(4);
_3->setContentsMargins(6, 6, 6, 6);
- _3->setObjectName(QStringLiteral("_3"));
+ _3->setObjectName(QString::fromUtf8("_3"));
printAll = new QRadioButton(gbPrintRange);
- printAll->setObjectName(QStringLiteral("printAll"));
+ printAll->setObjectName(QString::fromUtf8("printAll"));
printAll->setChecked(true);
_3->addWidget(printAll);
@@ -104,14 +104,14 @@ public:
_4->setSpacing(6);
#endif
_4->setContentsMargins(0, 0, 0, 0);
- _4->setObjectName(QStringLiteral("_4"));
+ _4->setObjectName(QString::fromUtf8("_4"));
printRange = new QRadioButton(gbPrintRange);
- printRange->setObjectName(QStringLiteral("printRange"));
+ printRange->setObjectName(QString::fromUtf8("printRange"));
_4->addWidget(printRange);
from = new QSpinBox(gbPrintRange);
- from->setObjectName(QStringLiteral("from"));
+ from->setObjectName(QString::fromUtf8("from"));
from->setEnabled(false);
from->setMinimum(1);
from->setMaximum(999);
@@ -119,12 +119,12 @@ public:
_4->addWidget(from);
label_3 = new QLabel(gbPrintRange);
- label_3->setObjectName(QStringLiteral("label_3"));
+ label_3->setObjectName(QString::fromUtf8("label_3"));
_4->addWidget(label_3);
to = new QSpinBox(gbPrintRange);
- to->setObjectName(QStringLiteral("to"));
+ to->setObjectName(QString::fromUtf8("to"));
to->setEnabled(false);
to->setMinimum(1);
to->setMaximum(999);
@@ -139,7 +139,7 @@ public:
_3->addLayout(_4);
printSelection = new QRadioButton(gbPrintRange);
- printSelection->setObjectName(QStringLiteral("printSelection"));
+ printSelection->setObjectName(QString::fromUtf8("printSelection"));
_3->addWidget(printSelection);
@@ -151,16 +151,16 @@ public:
horizontalLayout->addWidget(gbPrintRange);
groupBox = new QGroupBox(copiesTab);
- groupBox->setObjectName(QStringLiteral("groupBox"));
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
gridLayout = new QGridLayout(groupBox);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
label = new QLabel(groupBox);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout->addWidget(label, 0, 0, 1, 1);
copies = new QSpinBox(groupBox);
- copies->setObjectName(QStringLiteral("copies"));
+ copies->setObjectName(QString::fromUtf8("copies"));
copies->setMinimum(1);
copies->setMaximum(999);
@@ -171,12 +171,12 @@ public:
gridLayout->addItem(horizontalSpacer, 0, 3, 1, 1);
collate = new QCheckBox(groupBox);
- collate->setObjectName(QStringLiteral("collate"));
+ collate->setObjectName(QString::fromUtf8("collate"));
gridLayout->addWidget(collate, 1, 0, 1, 2);
outputIcon = new QLabel(groupBox);
- outputIcon->setObjectName(QStringLiteral("outputIcon"));
+ outputIcon->setObjectName(QString::fromUtf8("outputIcon"));
QSizePolicy sizePolicy1(QSizePolicy::Ignored, QSizePolicy::Ignored);
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
@@ -186,7 +186,7 @@ public:
gridLayout->addWidget(outputIcon, 1, 2, 2, 2);
reverse = new QCheckBox(groupBox);
- reverse->setObjectName(QStringLiteral("reverse"));
+ reverse->setObjectName(QString::fromUtf8("reverse"));
gridLayout->addWidget(reverse, 2, 0, 1, 2);
@@ -199,30 +199,30 @@ public:
tabs->addTab(copiesTab, QString());
optionsTab = new QWidget();
- optionsTab->setObjectName(QStringLiteral("optionsTab"));
+ optionsTab->setObjectName(QString::fromUtf8("optionsTab"));
optionsTab->setGeometry(QRect(0, 0, 412, 139));
gridLayout_2 = new QGridLayout(optionsTab);
- gridLayout_2->setObjectName(QStringLiteral("gridLayout_2"));
+ gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
colorMode = new QGroupBox(optionsTab);
- colorMode->setObjectName(QStringLiteral("colorMode"));
+ colorMode->setObjectName(QString::fromUtf8("colorMode"));
gridLayout_4 = new QGridLayout(colorMode);
- gridLayout_4->setObjectName(QStringLiteral("gridLayout_4"));
+ gridLayout_4->setObjectName(QString::fromUtf8("gridLayout_4"));
verticalSpacer_6 = new QSpacerItem(1, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
gridLayout_4->addItem(verticalSpacer_6, 2, 0, 1, 1);
color = new QRadioButton(colorMode);
- color->setObjectName(QStringLiteral("color"));
+ color->setObjectName(QString::fromUtf8("color"));
gridLayout_4->addWidget(color, 0, 0, 1, 1);
colorIcon = new QLabel(colorMode);
- colorIcon->setObjectName(QStringLiteral("colorIcon"));
+ colorIcon->setObjectName(QString::fromUtf8("colorIcon"));
gridLayout_4->addWidget(colorIcon, 0, 1, 3, 1);
grayscale = new QRadioButton(colorMode);
- grayscale->setObjectName(QStringLiteral("grayscale"));
+ grayscale->setObjectName(QString::fromUtf8("grayscale"));
gridLayout_4->addWidget(grayscale, 1, 0, 1, 1);
@@ -230,22 +230,22 @@ public:
gridLayout_2->addWidget(colorMode, 0, 1, 1, 1);
duplex = new QGroupBox(optionsTab);
- duplex->setObjectName(QStringLiteral("duplex"));
+ duplex->setObjectName(QString::fromUtf8("duplex"));
verticalLayout = new QVBoxLayout(duplex);
- verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
noDuplex = new QRadioButton(duplex);
- noDuplex->setObjectName(QStringLiteral("noDuplex"));
+ noDuplex->setObjectName(QString::fromUtf8("noDuplex"));
noDuplex->setChecked(true);
verticalLayout->addWidget(noDuplex);
duplexLong = new QRadioButton(duplex);
- duplexLong->setObjectName(QStringLiteral("duplexLong"));
+ duplexLong->setObjectName(QString::fromUtf8("duplexLong"));
verticalLayout->addWidget(duplexLong);
duplexShort = new QRadioButton(duplex);
- duplexShort->setObjectName(QStringLiteral("duplexShort"));
+ duplexShort->setObjectName(QString::fromUtf8("duplexShort"));
verticalLayout->addWidget(duplexShort);
diff --git a/tests/auto/tools/uic/baseline/qprintwidget.ui.h b/tests/auto/tools/uic/baseline/qprintwidget.ui.h
index 73fa2cfcfa..04b05143c6 100644
--- a/tests/auto/tools/uic/baseline/qprintwidget.ui.h
+++ b/tests/auto/tools/uic/baseline/qprintwidget.ui.h
@@ -46,22 +46,22 @@ public:
void setupUi(QWidget *QPrintWidget)
{
if (QPrintWidget->objectName().isEmpty())
- QPrintWidget->setObjectName(QStringLiteral("QPrintWidget"));
+ QPrintWidget->setObjectName(QString::fromUtf8("QPrintWidget"));
QPrintWidget->resize(443, 175);
horizontalLayout_2 = new QHBoxLayout(QPrintWidget);
horizontalLayout_2->setContentsMargins(0, 0, 0, 0);
- horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
+ horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2"));
printerGroup = new QGroupBox(QPrintWidget);
- printerGroup->setObjectName(QStringLiteral("printerGroup"));
+ printerGroup->setObjectName(QString::fromUtf8("printerGroup"));
gridLayout = new QGridLayout(printerGroup);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
label = new QLabel(printerGroup);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout->addWidget(label, 0, 0, 1, 1);
printers = new QComboBox(printerGroup);
- printers->setObjectName(QStringLiteral("printers"));
+ printers->setObjectName(QString::fromUtf8("printers"));
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
sizePolicy.setHorizontalStretch(3);
sizePolicy.setVerticalStretch(0);
@@ -71,7 +71,7 @@ public:
gridLayout->addWidget(printers, 0, 1, 1, 1);
properties = new QPushButton(printerGroup);
- properties->setObjectName(QStringLiteral("properties"));
+ properties->setObjectName(QString::fromUtf8("properties"));
QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Fixed);
sizePolicy1.setHorizontalStretch(1);
sizePolicy1.setVerticalStretch(0);
@@ -81,44 +81,44 @@ public:
gridLayout->addWidget(properties, 0, 2, 1, 1);
label_2 = new QLabel(printerGroup);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
gridLayout->addWidget(label_2, 1, 0, 1, 1);
location = new QLabel(printerGroup);
- location->setObjectName(QStringLiteral("location"));
+ location->setObjectName(QString::fromUtf8("location"));
gridLayout->addWidget(location, 1, 1, 1, 1);
preview = new QCheckBox(printerGroup);
- preview->setObjectName(QStringLiteral("preview"));
+ preview->setObjectName(QString::fromUtf8("preview"));
gridLayout->addWidget(preview, 1, 2, 1, 1);
label_3 = new QLabel(printerGroup);
- label_3->setObjectName(QStringLiteral("label_3"));
+ label_3->setObjectName(QString::fromUtf8("label_3"));
gridLayout->addWidget(label_3, 2, 0, 1, 1);
type = new QLabel(printerGroup);
- type->setObjectName(QStringLiteral("type"));
+ type->setObjectName(QString::fromUtf8("type"));
gridLayout->addWidget(type, 2, 1, 1, 1);
lOutput = new QLabel(printerGroup);
- lOutput->setObjectName(QStringLiteral("lOutput"));
+ lOutput->setObjectName(QString::fromUtf8("lOutput"));
gridLayout->addWidget(lOutput, 3, 0, 1, 1);
horizontalLayout = new QHBoxLayout();
- horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
+ horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
filename = new QLineEdit(printerGroup);
- filename->setObjectName(QStringLiteral("filename"));
+ filename->setObjectName(QString::fromUtf8("filename"));
horizontalLayout->addWidget(filename);
fileBrowser = new QToolButton(printerGroup);
- fileBrowser->setObjectName(QStringLiteral("fileBrowser"));
+ fileBrowser->setObjectName(QString::fromUtf8("fileBrowser"));
horizontalLayout->addWidget(fileBrowser);
diff --git a/tests/auto/tools/uic/baseline/qsqlconnectiondialog.ui.h b/tests/auto/tools/uic/baseline/qsqlconnectiondialog.ui.h
index 5ed3ff1acd..2131bc6d9b 100644
--- a/tests/auto/tools/uic/baseline/qsqlconnectiondialog.ui.h
+++ b/tests/auto/tools/uic/baseline/qsqlconnectiondialog.ui.h
@@ -55,44 +55,44 @@ public:
void setupUi(QDialog *QSqlConnectionDialogUi)
{
if (QSqlConnectionDialogUi->objectName().isEmpty())
- QSqlConnectionDialogUi->setObjectName(QStringLiteral("QSqlConnectionDialogUi"));
+ QSqlConnectionDialogUi->setObjectName(QString::fromUtf8("QSqlConnectionDialogUi"));
QSqlConnectionDialogUi->resize(315, 302);
vboxLayout = new QVBoxLayout(QSqlConnectionDialogUi);
#ifndef Q_OS_MAC
vboxLayout->setSpacing(6);
#endif
vboxLayout->setContentsMargins(8, 8, 8, 8);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
connGroupBox = new QGroupBox(QSqlConnectionDialogUi);
- connGroupBox->setObjectName(QStringLiteral("connGroupBox"));
+ connGroupBox->setObjectName(QString::fromUtf8("connGroupBox"));
gridLayout = new QGridLayout(connGroupBox);
#ifndef Q_OS_MAC
gridLayout->setSpacing(6);
#endif
gridLayout->setContentsMargins(8, 8, 8, 8);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
comboDriver = new QComboBox(connGroupBox);
- comboDriver->setObjectName(QStringLiteral("comboDriver"));
+ comboDriver->setObjectName(QString::fromUtf8("comboDriver"));
gridLayout->addWidget(comboDriver, 0, 1, 1, 1);
textLabel4 = new QLabel(connGroupBox);
- textLabel4->setObjectName(QStringLiteral("textLabel4"));
+ textLabel4->setObjectName(QString::fromUtf8("textLabel4"));
gridLayout->addWidget(textLabel4, 2, 0, 1, 1);
textLabel2 = new QLabel(connGroupBox);
- textLabel2->setObjectName(QStringLiteral("textLabel2"));
+ textLabel2->setObjectName(QString::fromUtf8("textLabel2"));
gridLayout->addWidget(textLabel2, 0, 0, 1, 1);
editDatabase = new QLineEdit(connGroupBox);
- editDatabase->setObjectName(QStringLiteral("editDatabase"));
+ editDatabase->setObjectName(QString::fromUtf8("editDatabase"));
gridLayout->addWidget(editDatabase, 1, 1, 1, 1);
portSpinBox = new QSpinBox(connGroupBox);
- portSpinBox->setObjectName(QStringLiteral("portSpinBox"));
+ portSpinBox->setObjectName(QString::fromUtf8("portSpinBox"));
portSpinBox->setMaximum(65535);
portSpinBox->setMinimum(-1);
portSpinBox->setValue(-1);
@@ -100,38 +100,38 @@ public:
gridLayout->addWidget(portSpinBox, 5, 1, 1, 1);
textLabel3 = new QLabel(connGroupBox);
- textLabel3->setObjectName(QStringLiteral("textLabel3"));
+ textLabel3->setObjectName(QString::fromUtf8("textLabel3"));
gridLayout->addWidget(textLabel3, 1, 0, 1, 1);
editPassword = new QLineEdit(connGroupBox);
- editPassword->setObjectName(QStringLiteral("editPassword"));
+ editPassword->setObjectName(QString::fromUtf8("editPassword"));
editPassword->setEchoMode(QLineEdit::Password);
gridLayout->addWidget(editPassword, 3, 1, 1, 1);
editUsername = new QLineEdit(connGroupBox);
- editUsername->setObjectName(QStringLiteral("editUsername"));
+ editUsername->setObjectName(QString::fromUtf8("editUsername"));
gridLayout->addWidget(editUsername, 2, 1, 1, 1);
editHostname = new QLineEdit(connGroupBox);
- editHostname->setObjectName(QStringLiteral("editHostname"));
+ editHostname->setObjectName(QString::fromUtf8("editHostname"));
gridLayout->addWidget(editHostname, 4, 1, 1, 1);
textLabel5 = new QLabel(connGroupBox);
- textLabel5->setObjectName(QStringLiteral("textLabel5"));
+ textLabel5->setObjectName(QString::fromUtf8("textLabel5"));
gridLayout->addWidget(textLabel5, 4, 0, 1, 1);
textLabel5_2 = new QLabel(connGroupBox);
- textLabel5_2->setObjectName(QStringLiteral("textLabel5_2"));
+ textLabel5_2->setObjectName(QString::fromUtf8("textLabel5_2"));
gridLayout->addWidget(textLabel5_2, 5, 0, 1, 1);
textLabel4_2 = new QLabel(connGroupBox);
- textLabel4_2->setObjectName(QStringLiteral("textLabel4_2"));
+ textLabel4_2->setObjectName(QString::fromUtf8("textLabel4_2"));
gridLayout->addWidget(textLabel4_2, 3, 0, 1, 1);
@@ -143,13 +143,13 @@ public:
hboxLayout->setSpacing(6);
#endif
hboxLayout->setContentsMargins(0, 0, 0, 0);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
spacerItem = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout->addItem(spacerItem);
dbCheckBox = new QCheckBox(QSqlConnectionDialogUi);
- dbCheckBox->setObjectName(QStringLiteral("dbCheckBox"));
+ dbCheckBox->setObjectName(QString::fromUtf8("dbCheckBox"));
hboxLayout->addWidget(dbCheckBox);
@@ -161,18 +161,18 @@ public:
hboxLayout1->setSpacing(6);
#endif
hboxLayout1->setContentsMargins(0, 0, 0, 0);
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
spacerItem1 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout1->addItem(spacerItem1);
okButton = new QPushButton(QSqlConnectionDialogUi);
- okButton->setObjectName(QStringLiteral("okButton"));
+ okButton->setObjectName(QString::fromUtf8("okButton"));
hboxLayout1->addWidget(okButton);
cancelButton = new QPushButton(QSqlConnectionDialogUi);
- cancelButton->setObjectName(QStringLiteral("cancelButton"));
+ cancelButton->setObjectName(QString::fromUtf8("cancelButton"));
hboxLayout1->addWidget(cancelButton);
diff --git a/tests/auto/tools/uic/baseline/qtgradientdialog.ui.h b/tests/auto/tools/uic/baseline/qtgradientdialog.ui.h
index 53fd59295b..805f70e60d 100644
--- a/tests/auto/tools/uic/baseline/qtgradientdialog.ui.h
+++ b/tests/auto/tools/uic/baseline/qtgradientdialog.ui.h
@@ -58,12 +58,12 @@ public:
void setupUi(QDialog *QtGradientDialog)
{
if (QtGradientDialog->objectName().isEmpty())
- QtGradientDialog->setObjectName(QStringLiteral("QtGradientDialog"));
+ QtGradientDialog->setObjectName(QString::fromUtf8("QtGradientDialog"));
QtGradientDialog->resize(178, 81);
vboxLayout = new QVBoxLayout(QtGradientDialog);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
gradientEditor = new QtGradientEditor(QtGradientDialog);
- gradientEditor->setObjectName(QStringLiteral("gradientEditor"));
+ gradientEditor->setObjectName(QString::fromUtf8("gradientEditor"));
QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -73,7 +73,7 @@ public:
vboxLayout->addWidget(gradientEditor);
buttonBox = new QDialogButtonBox(QtGradientDialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/qtgradienteditor.ui.h b/tests/auto/tools/uic/baseline/qtgradienteditor.ui.h
index 6e63c4863d..9db07f35ac 100644
--- a/tests/auto/tools/uic/baseline/qtgradienteditor.ui.h
+++ b/tests/auto/tools/uic/baseline/qtgradienteditor.ui.h
@@ -31,7 +31,7 @@
/********************************************************************************
** Form generated from reading UI file 'qtgradienteditor.ui'
**
-** Created by: Qt User Interface Compiler version 5.0.0
+** Created by: Qt User Interface Compiler version 5.12.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
@@ -145,10 +145,10 @@ public:
void setupUi(QWidget *QtGradientEditor)
{
if (QtGradientEditor->objectName().isEmpty())
- QtGradientEditor->setObjectName(QStringLiteral("QtGradientEditor"));
+ QtGradientEditor->setObjectName(QString::fromUtf8("QtGradientEditor"));
QtGradientEditor->resize(364, 518);
frame = new QFrame(QtGradientEditor);
- frame->setObjectName(QStringLiteral("frame"));
+ frame->setObjectName(QString::fromUtf8("frame"));
frame->setGeometry(QRect(10, 69, 193, 150));
QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
sizePolicy.setHorizontalStretch(0);
@@ -159,73 +159,73 @@ public:
frame->setFrameShadow(QFrame::Raised);
vboxLayout = new QVBoxLayout(frame);
vboxLayout->setSpacing(6);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
vboxLayout->setContentsMargins(0, 0, 0, 0);
gradientWidget = new QtGradientWidget(frame);
- gradientWidget->setObjectName(QStringLiteral("gradientWidget"));
+ gradientWidget->setObjectName(QString::fromUtf8("gradientWidget"));
sizePolicy.setHeightForWidth(gradientWidget->sizePolicy().hasHeightForWidth());
gradientWidget->setSizePolicy(sizePolicy);
vboxLayout->addWidget(gradientWidget);
label1 = new QLabel(QtGradientEditor);
- label1->setObjectName(QStringLiteral("label1"));
+ label1->setObjectName(QString::fromUtf8("label1"));
label1->setGeometry(QRect(209, 69, 64, 23));
spinBox1 = new QDoubleSpinBox(QtGradientEditor);
- spinBox1->setObjectName(QStringLiteral("spinBox1"));
+ spinBox1->setObjectName(QString::fromUtf8("spinBox1"));
spinBox1->setGeometry(QRect(279, 69, 73, 23));
spinBox1->setKeyboardTracking(false);
spinBox1->setDecimals(3);
- spinBox1->setMaximum(1);
- spinBox1->setSingleStep(0.01);
+ spinBox1->setMaximum(1.000000000000000);
+ spinBox1->setSingleStep(0.010000000000000);
label2 = new QLabel(QtGradientEditor);
- label2->setObjectName(QStringLiteral("label2"));
+ label2->setObjectName(QString::fromUtf8("label2"));
label2->setGeometry(QRect(209, 99, 64, 23));
spinBox2 = new QDoubleSpinBox(QtGradientEditor);
- spinBox2->setObjectName(QStringLiteral("spinBox2"));
+ spinBox2->setObjectName(QString::fromUtf8("spinBox2"));
spinBox2->setGeometry(QRect(279, 99, 73, 23));
spinBox2->setKeyboardTracking(false);
spinBox2->setDecimals(3);
- spinBox2->setMaximum(1);
- spinBox2->setSingleStep(0.01);
+ spinBox2->setMaximum(1.000000000000000);
+ spinBox2->setSingleStep(0.010000000000000);
label3 = new QLabel(QtGradientEditor);
- label3->setObjectName(QStringLiteral("label3"));
+ label3->setObjectName(QString::fromUtf8("label3"));
label3->setGeometry(QRect(209, 129, 64, 23));
spinBox3 = new QDoubleSpinBox(QtGradientEditor);
- spinBox3->setObjectName(QStringLiteral("spinBox3"));
+ spinBox3->setObjectName(QString::fromUtf8("spinBox3"));
spinBox3->setGeometry(QRect(279, 129, 73, 23));
spinBox3->setKeyboardTracking(false);
spinBox3->setDecimals(3);
- spinBox3->setMaximum(1);
- spinBox3->setSingleStep(0.01);
+ spinBox3->setMaximum(1.000000000000000);
+ spinBox3->setSingleStep(0.010000000000000);
label4 = new QLabel(QtGradientEditor);
- label4->setObjectName(QStringLiteral("label4"));
+ label4->setObjectName(QString::fromUtf8("label4"));
label4->setGeometry(QRect(209, 159, 64, 23));
spinBox4 = new QDoubleSpinBox(QtGradientEditor);
- spinBox4->setObjectName(QStringLiteral("spinBox4"));
+ spinBox4->setObjectName(QString::fromUtf8("spinBox4"));
spinBox4->setGeometry(QRect(279, 159, 73, 23));
spinBox4->setKeyboardTracking(false);
spinBox4->setDecimals(3);
- spinBox4->setMaximum(1);
- spinBox4->setSingleStep(0.01);
+ spinBox4->setMaximum(1.000000000000000);
+ spinBox4->setSingleStep(0.010000000000000);
label5 = new QLabel(QtGradientEditor);
- label5->setObjectName(QStringLiteral("label5"));
+ label5->setObjectName(QString::fromUtf8("label5"));
label5->setGeometry(QRect(209, 189, 64, 23));
spinBox5 = new QDoubleSpinBox(QtGradientEditor);
- spinBox5->setObjectName(QStringLiteral("spinBox5"));
+ spinBox5->setObjectName(QString::fromUtf8("spinBox5"));
spinBox5->setGeometry(QRect(279, 189, 73, 23));
spinBox5->setKeyboardTracking(false);
spinBox5->setDecimals(3);
- spinBox5->setMaximum(1);
- spinBox5->setSingleStep(0.01);
+ spinBox5->setMaximum(1.000000000000000);
+ spinBox5->setSingleStep(0.010000000000000);
gradientStopsWidget = new QtGradientStopsWidget(QtGradientEditor);
- gradientStopsWidget->setObjectName(QStringLiteral("gradientStopsWidget"));
+ gradientStopsWidget->setObjectName(QString::fromUtf8("gradientStopsWidget"));
gradientStopsWidget->setGeometry(QRect(10, 225, 193, 67));
zoomLabel = new QLabel(QtGradientEditor);
- zoomLabel->setObjectName(QStringLiteral("zoomLabel"));
+ zoomLabel->setObjectName(QString::fromUtf8("zoomLabel"));
zoomLabel->setGeometry(QRect(209, 231, 64, 23));
zoomAllButton = new QToolButton(QtGradientEditor);
- zoomAllButton->setObjectName(QStringLiteral("zoomAllButton"));
+ zoomAllButton->setObjectName(QString::fromUtf8("zoomAllButton"));
zoomAllButton->setGeometry(QRect(279, 260, 72, 26));
QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Fixed);
sizePolicy1.setHorizontalStretch(0);
@@ -233,15 +233,15 @@ public:
sizePolicy1.setHeightForWidth(zoomAllButton->sizePolicy().hasHeightForWidth());
zoomAllButton->setSizePolicy(sizePolicy1);
positionLabel = new QLabel(QtGradientEditor);
- positionLabel->setObjectName(QStringLiteral("positionLabel"));
+ positionLabel->setObjectName(QString::fromUtf8("positionLabel"));
positionLabel->setGeometry(QRect(209, 304, 64, 23));
hLabel = new QLabel(QtGradientEditor);
- hLabel->setObjectName(QStringLiteral("hLabel"));
+ hLabel->setObjectName(QString::fromUtf8("hLabel"));
hLabel->setGeometry(QRect(10, 335, 32, 18));
sizePolicy1.setHeightForWidth(hLabel->sizePolicy().hasHeightForWidth());
hLabel->setSizePolicy(sizePolicy1);
frame_2 = new QFrame(QtGradientEditor);
- frame_2->setObjectName(QStringLiteral("frame_2"));
+ frame_2->setObjectName(QString::fromUtf8("frame_2"));
frame_2->setGeometry(QRect(48, 333, 155, 23));
QSizePolicy sizePolicy2(QSizePolicy::Ignored, QSizePolicy::Preferred);
sizePolicy2.setHorizontalStretch(0);
@@ -251,10 +251,10 @@ public:
frame_2->setFrameShape(QFrame::StyledPanel);
frame_2->setFrameShadow(QFrame::Raised);
hboxLayout = new QHBoxLayout(frame_2);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
hboxLayout->setContentsMargins(0, 0, 0, 0);
hueColorLine = new QtColorLine(frame_2);
- hueColorLine->setObjectName(QStringLiteral("hueColorLine"));
+ hueColorLine->setObjectName(QString::fromUtf8("hueColorLine"));
QSizePolicy sizePolicy3(QSizePolicy::Expanding, QSizePolicy::Preferred);
sizePolicy3.setHorizontalStretch(0);
sizePolicy3.setVerticalStretch(0);
@@ -264,99 +264,99 @@ public:
hboxLayout->addWidget(hueColorLine);
hueLabel = new QLabel(QtGradientEditor);
- hueLabel->setObjectName(QStringLiteral("hueLabel"));
+ hueLabel->setObjectName(QString::fromUtf8("hueLabel"));
hueLabel->setGeometry(QRect(209, 335, 64, 18));
sizePolicy1.setHeightForWidth(hueLabel->sizePolicy().hasHeightForWidth());
hueLabel->setSizePolicy(sizePolicy1);
sLabel = new QLabel(QtGradientEditor);
- sLabel->setObjectName(QStringLiteral("sLabel"));
+ sLabel->setObjectName(QString::fromUtf8("sLabel"));
sLabel->setGeometry(QRect(10, 364, 32, 18));
sizePolicy1.setHeightForWidth(sLabel->sizePolicy().hasHeightForWidth());
sLabel->setSizePolicy(sizePolicy1);
frame_5 = new QFrame(QtGradientEditor);
- frame_5->setObjectName(QStringLiteral("frame_5"));
+ frame_5->setObjectName(QString::fromUtf8("frame_5"));
frame_5->setGeometry(QRect(48, 362, 155, 23));
sizePolicy2.setHeightForWidth(frame_5->sizePolicy().hasHeightForWidth());
frame_5->setSizePolicy(sizePolicy2);
frame_5->setFrameShape(QFrame::StyledPanel);
frame_5->setFrameShadow(QFrame::Raised);
hboxLayout1 = new QHBoxLayout(frame_5);
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
hboxLayout1->setContentsMargins(0, 0, 0, 0);
saturationColorLine = new QtColorLine(frame_5);
- saturationColorLine->setObjectName(QStringLiteral("saturationColorLine"));
+ saturationColorLine->setObjectName(QString::fromUtf8("saturationColorLine"));
sizePolicy3.setHeightForWidth(saturationColorLine->sizePolicy().hasHeightForWidth());
saturationColorLine->setSizePolicy(sizePolicy3);
hboxLayout1->addWidget(saturationColorLine);
saturationLabel = new QLabel(QtGradientEditor);
- saturationLabel->setObjectName(QStringLiteral("saturationLabel"));
+ saturationLabel->setObjectName(QString::fromUtf8("saturationLabel"));
saturationLabel->setGeometry(QRect(209, 364, 64, 18));
sizePolicy1.setHeightForWidth(saturationLabel->sizePolicy().hasHeightForWidth());
saturationLabel->setSizePolicy(sizePolicy1);
vLabel = new QLabel(QtGradientEditor);
- vLabel->setObjectName(QStringLiteral("vLabel"));
+ vLabel->setObjectName(QString::fromUtf8("vLabel"));
vLabel->setGeometry(QRect(10, 393, 32, 18));
sizePolicy1.setHeightForWidth(vLabel->sizePolicy().hasHeightForWidth());
vLabel->setSizePolicy(sizePolicy1);
frame_3 = new QFrame(QtGradientEditor);
- frame_3->setObjectName(QStringLiteral("frame_3"));
+ frame_3->setObjectName(QString::fromUtf8("frame_3"));
frame_3->setGeometry(QRect(48, 391, 155, 23));
sizePolicy2.setHeightForWidth(frame_3->sizePolicy().hasHeightForWidth());
frame_3->setSizePolicy(sizePolicy2);
frame_3->setFrameShape(QFrame::StyledPanel);
frame_3->setFrameShadow(QFrame::Raised);
hboxLayout2 = new QHBoxLayout(frame_3);
- hboxLayout2->setObjectName(QStringLiteral("hboxLayout2"));
+ hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2"));
hboxLayout2->setContentsMargins(0, 0, 0, 0);
valueColorLine = new QtColorLine(frame_3);
- valueColorLine->setObjectName(QStringLiteral("valueColorLine"));
+ valueColorLine->setObjectName(QString::fromUtf8("valueColorLine"));
sizePolicy3.setHeightForWidth(valueColorLine->sizePolicy().hasHeightForWidth());
valueColorLine->setSizePolicy(sizePolicy3);
hboxLayout2->addWidget(valueColorLine);
valueLabel = new QLabel(QtGradientEditor);
- valueLabel->setObjectName(QStringLiteral("valueLabel"));
+ valueLabel->setObjectName(QString::fromUtf8("valueLabel"));
valueLabel->setGeometry(QRect(209, 393, 64, 18));
sizePolicy1.setHeightForWidth(valueLabel->sizePolicy().hasHeightForWidth());
valueLabel->setSizePolicy(sizePolicy1);
aLabel = new QLabel(QtGradientEditor);
- aLabel->setObjectName(QStringLiteral("aLabel"));
+ aLabel->setObjectName(QString::fromUtf8("aLabel"));
aLabel->setGeometry(QRect(10, 422, 32, 18));
sizePolicy1.setHeightForWidth(aLabel->sizePolicy().hasHeightForWidth());
aLabel->setSizePolicy(sizePolicy1);
frame_4 = new QFrame(QtGradientEditor);
- frame_4->setObjectName(QStringLiteral("frame_4"));
+ frame_4->setObjectName(QString::fromUtf8("frame_4"));
frame_4->setGeometry(QRect(48, 420, 155, 23));
sizePolicy2.setHeightForWidth(frame_4->sizePolicy().hasHeightForWidth());
frame_4->setSizePolicy(sizePolicy2);
frame_4->setFrameShape(QFrame::StyledPanel);
frame_4->setFrameShadow(QFrame::Raised);
hboxLayout3 = new QHBoxLayout(frame_4);
- hboxLayout3->setObjectName(QStringLiteral("hboxLayout3"));
+ hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3"));
hboxLayout3->setContentsMargins(0, 0, 0, 0);
alphaColorLine = new QtColorLine(frame_4);
- alphaColorLine->setObjectName(QStringLiteral("alphaColorLine"));
+ alphaColorLine->setObjectName(QString::fromUtf8("alphaColorLine"));
sizePolicy3.setHeightForWidth(alphaColorLine->sizePolicy().hasHeightForWidth());
alphaColorLine->setSizePolicy(sizePolicy3);
hboxLayout3->addWidget(alphaColorLine);
alphaLabel = new QLabel(QtGradientEditor);
- alphaLabel->setObjectName(QStringLiteral("alphaLabel"));
+ alphaLabel->setObjectName(QString::fromUtf8("alphaLabel"));
alphaLabel->setGeometry(QRect(209, 422, 64, 18));
sizePolicy1.setHeightForWidth(alphaLabel->sizePolicy().hasHeightForWidth());
alphaLabel->setSizePolicy(sizePolicy1);
typeComboBox = new QComboBox(QtGradientEditor);
- typeComboBox->setObjectName(QStringLiteral("typeComboBox"));
+ typeComboBox->setObjectName(QString::fromUtf8("typeComboBox"));
typeComboBox->setGeometry(QRect(10, 40, 79, 22));
spreadComboBox = new QComboBox(QtGradientEditor);
- spreadComboBox->setObjectName(QStringLiteral("spreadComboBox"));
+ spreadComboBox->setObjectName(QString::fromUtf8("spreadComboBox"));
spreadComboBox->setGeometry(QRect(96, 40, 72, 22));
colorLabel = new QLabel(QtGradientEditor);
- colorLabel->setObjectName(QStringLiteral("colorLabel"));
+ colorLabel->setObjectName(QString::fromUtf8("colorLabel"));
colorLabel->setGeometry(QRect(10, 298, 32, 29));
QSizePolicy sizePolicy4(QSizePolicy::Fixed, QSizePolicy::Preferred);
sizePolicy4.setHorizontalStretch(0);
@@ -364,10 +364,10 @@ public:
sizePolicy4.setHeightForWidth(colorLabel->sizePolicy().hasHeightForWidth());
colorLabel->setSizePolicy(sizePolicy4);
colorButton = new QtColorButton(QtGradientEditor);
- colorButton->setObjectName(QStringLiteral("colorButton"));
+ colorButton->setObjectName(QString::fromUtf8("colorButton"));
colorButton->setGeometry(QRect(48, 300, 26, 25));
hsvRadioButton = new QRadioButton(QtGradientEditor);
- hsvRadioButton->setObjectName(QStringLiteral("hsvRadioButton"));
+ hsvRadioButton->setObjectName(QString::fromUtf8("hsvRadioButton"));
hsvRadioButton->setGeometry(QRect(80, 301, 49, 23));
QSizePolicy sizePolicy5(QSizePolicy::Fixed, QSizePolicy::Fixed);
sizePolicy5.setHorizontalStretch(0);
@@ -376,87 +376,87 @@ public:
hsvRadioButton->setSizePolicy(sizePolicy5);
hsvRadioButton->setChecked(true);
rgbRadioButton = new QRadioButton(QtGradientEditor);
- rgbRadioButton->setObjectName(QStringLiteral("rgbRadioButton"));
+ rgbRadioButton->setObjectName(QString::fromUtf8("rgbRadioButton"));
rgbRadioButton->setGeometry(QRect(135, 301, 49, 23));
sizePolicy5.setHeightForWidth(rgbRadioButton->sizePolicy().hasHeightForWidth());
rgbRadioButton->setSizePolicy(sizePolicy5);
positionWidget = new QWidget(QtGradientEditor);
- positionWidget->setObjectName(QStringLiteral("positionWidget"));
+ positionWidget->setObjectName(QString::fromUtf8("positionWidget"));
positionWidget->setGeometry(QRect(279, 304, 73, 23));
vboxLayout1 = new QVBoxLayout(positionWidget);
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
vboxLayout1->setContentsMargins(0, 0, 0, 0);
positionSpinBox = new QDoubleSpinBox(positionWidget);
- positionSpinBox->setObjectName(QStringLiteral("positionSpinBox"));
+ positionSpinBox->setObjectName(QString::fromUtf8("positionSpinBox"));
positionSpinBox->setKeyboardTracking(false);
positionSpinBox->setDecimals(3);
- positionSpinBox->setMinimum(0);
- positionSpinBox->setMaximum(1);
- positionSpinBox->setSingleStep(0.01);
- positionSpinBox->setValue(0);
+ positionSpinBox->setMinimum(0.000000000000000);
+ positionSpinBox->setMaximum(1.000000000000000);
+ positionSpinBox->setSingleStep(0.010000000000000);
+ positionSpinBox->setValue(0.000000000000000);
vboxLayout1->addWidget(positionSpinBox);
hueWidget = new QWidget(QtGradientEditor);
- hueWidget->setObjectName(QStringLiteral("hueWidget"));
+ hueWidget->setObjectName(QString::fromUtf8("hueWidget"));
hueWidget->setGeometry(QRect(279, 333, 73, 23));
vboxLayout2 = new QVBoxLayout(hueWidget);
- vboxLayout2->setObjectName(QStringLiteral("vboxLayout2"));
+ vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2"));
vboxLayout2->setContentsMargins(0, 0, 0, 0);
hueSpinBox = new QSpinBox(hueWidget);
- hueSpinBox->setObjectName(QStringLiteral("hueSpinBox"));
+ hueSpinBox->setObjectName(QString::fromUtf8("hueSpinBox"));
hueSpinBox->setKeyboardTracking(false);
hueSpinBox->setMaximum(359);
vboxLayout2->addWidget(hueSpinBox);
saturationWidget = new QWidget(QtGradientEditor);
- saturationWidget->setObjectName(QStringLiteral("saturationWidget"));
+ saturationWidget->setObjectName(QString::fromUtf8("saturationWidget"));
saturationWidget->setGeometry(QRect(279, 362, 73, 23));
vboxLayout3 = new QVBoxLayout(saturationWidget);
- vboxLayout3->setObjectName(QStringLiteral("vboxLayout3"));
+ vboxLayout3->setObjectName(QString::fromUtf8("vboxLayout3"));
vboxLayout3->setContentsMargins(0, 0, 0, 0);
saturationSpinBox = new QSpinBox(saturationWidget);
- saturationSpinBox->setObjectName(QStringLiteral("saturationSpinBox"));
+ saturationSpinBox->setObjectName(QString::fromUtf8("saturationSpinBox"));
saturationSpinBox->setKeyboardTracking(false);
saturationSpinBox->setMaximum(255);
vboxLayout3->addWidget(saturationSpinBox);
valueWidget = new QWidget(QtGradientEditor);
- valueWidget->setObjectName(QStringLiteral("valueWidget"));
+ valueWidget->setObjectName(QString::fromUtf8("valueWidget"));
valueWidget->setGeometry(QRect(279, 391, 73, 23));
vboxLayout4 = new QVBoxLayout(valueWidget);
- vboxLayout4->setObjectName(QStringLiteral("vboxLayout4"));
+ vboxLayout4->setObjectName(QString::fromUtf8("vboxLayout4"));
vboxLayout4->setContentsMargins(0, 0, 0, 0);
valueSpinBox = new QSpinBox(valueWidget);
- valueSpinBox->setObjectName(QStringLiteral("valueSpinBox"));
+ valueSpinBox->setObjectName(QString::fromUtf8("valueSpinBox"));
valueSpinBox->setKeyboardTracking(false);
valueSpinBox->setMaximum(255);
vboxLayout4->addWidget(valueSpinBox);
alphaWidget = new QWidget(QtGradientEditor);
- alphaWidget->setObjectName(QStringLiteral("alphaWidget"));
+ alphaWidget->setObjectName(QString::fromUtf8("alphaWidget"));
alphaWidget->setGeometry(QRect(279, 420, 73, 23));
vboxLayout5 = new QVBoxLayout(alphaWidget);
- vboxLayout5->setObjectName(QStringLiteral("vboxLayout5"));
+ vboxLayout5->setObjectName(QString::fromUtf8("vboxLayout5"));
vboxLayout5->setContentsMargins(0, 0, 0, 0);
alphaSpinBox = new QSpinBox(alphaWidget);
- alphaSpinBox->setObjectName(QStringLiteral("alphaSpinBox"));
+ alphaSpinBox->setObjectName(QString::fromUtf8("alphaSpinBox"));
alphaSpinBox->setKeyboardTracking(false);
alphaSpinBox->setMaximum(255);
vboxLayout5->addWidget(alphaSpinBox);
zoomWidget = new QWidget(QtGradientEditor);
- zoomWidget->setObjectName(QStringLiteral("zoomWidget"));
+ zoomWidget->setObjectName(QString::fromUtf8("zoomWidget"));
zoomWidget->setGeometry(QRect(279, 231, 73, 23));
vboxLayout6 = new QVBoxLayout(zoomWidget);
- vboxLayout6->setObjectName(QStringLiteral("vboxLayout6"));
+ vboxLayout6->setObjectName(QString::fromUtf8("vboxLayout6"));
vboxLayout6->setContentsMargins(0, 0, 0, 0);
zoomSpinBox = new QSpinBox(zoomWidget);
- zoomSpinBox->setObjectName(QStringLiteral("zoomSpinBox"));
+ zoomSpinBox->setObjectName(QString::fromUtf8("zoomSpinBox"));
zoomSpinBox->setKeyboardTracking(false);
zoomSpinBox->setMinimum(100);
zoomSpinBox->setMaximum(10000);
@@ -466,33 +466,33 @@ public:
vboxLayout6->addWidget(zoomSpinBox);
line1Widget = new QWidget(QtGradientEditor);
- line1Widget->setObjectName(QStringLiteral("line1Widget"));
+ line1Widget->setObjectName(QString::fromUtf8("line1Widget"));
line1Widget->setGeometry(QRect(209, 219, 143, 16));
vboxLayout7 = new QVBoxLayout(line1Widget);
- vboxLayout7->setObjectName(QStringLiteral("vboxLayout7"));
+ vboxLayout7->setObjectName(QString::fromUtf8("vboxLayout7"));
vboxLayout7->setContentsMargins(0, 0, 0, 0);
line1 = new QFrame(line1Widget);
- line1->setObjectName(QStringLiteral("line1"));
+ line1->setObjectName(QString::fromUtf8("line1"));
line1->setFrameShape(QFrame::HLine);
line1->setFrameShadow(QFrame::Sunken);
vboxLayout7->addWidget(line1);
line2Widget = new QWidget(QtGradientEditor);
- line2Widget->setObjectName(QStringLiteral("line2Widget"));
+ line2Widget->setObjectName(QString::fromUtf8("line2Widget"));
line2Widget->setGeometry(QRect(209, 292, 143, 16));
vboxLayout8 = new QVBoxLayout(line2Widget);
- vboxLayout8->setObjectName(QStringLiteral("vboxLayout8"));
+ vboxLayout8->setObjectName(QString::fromUtf8("vboxLayout8"));
vboxLayout8->setContentsMargins(0, 0, 0, 0);
line2 = new QFrame(line2Widget);
- line2->setObjectName(QStringLiteral("line2"));
+ line2->setObjectName(QString::fromUtf8("line2"));
line2->setFrameShape(QFrame::HLine);
line2->setFrameShadow(QFrame::Sunken);
vboxLayout8->addWidget(line2);
zoomButtonsWidget = new QWidget(QtGradientEditor);
- zoomButtonsWidget->setObjectName(QStringLiteral("zoomButtonsWidget"));
+ zoomButtonsWidget->setObjectName(QString::fromUtf8("zoomButtonsWidget"));
zoomButtonsWidget->setGeometry(QRect(209, 260, 64, 26));
QSizePolicy sizePolicy6(QSizePolicy::Maximum, QSizePolicy::Preferred);
sizePolicy6.setHorizontalStretch(0);
@@ -500,15 +500,15 @@ public:
sizePolicy6.setHeightForWidth(zoomButtonsWidget->sizePolicy().hasHeightForWidth());
zoomButtonsWidget->setSizePolicy(sizePolicy6);
hboxLayout4 = new QHBoxLayout(zoomButtonsWidget);
- hboxLayout4->setObjectName(QStringLiteral("hboxLayout4"));
+ hboxLayout4->setObjectName(QString::fromUtf8("hboxLayout4"));
hboxLayout4->setContentsMargins(0, 0, 0, 0);
zoomInButton = new QToolButton(zoomButtonsWidget);
- zoomInButton->setObjectName(QStringLiteral("zoomInButton"));
+ zoomInButton->setObjectName(QString::fromUtf8("zoomInButton"));
hboxLayout4->addWidget(zoomInButton);
zoomOutButton = new QToolButton(zoomButtonsWidget);
- zoomOutButton->setObjectName(QStringLiteral("zoomOutButton"));
+ zoomOutButton->setObjectName(QString::fromUtf8("zoomOutButton"));
hboxLayout4->addWidget(zoomOutButton);
@@ -517,7 +517,7 @@ public:
hboxLayout4->addItem(spacerItem);
detailsButton = new QToolButton(QtGradientEditor);
- detailsButton->setObjectName(QStringLiteral("detailsButton"));
+ detailsButton->setObjectName(QString::fromUtf8("detailsButton"));
detailsButton->setGeometry(QRect(176, 40, 25, 22));
QSizePolicy sizePolicy7(QSizePolicy::Fixed, QSizePolicy::Ignored);
sizePolicy7.setHorizontalStretch(0);
@@ -527,32 +527,32 @@ public:
detailsButton->setCheckable(true);
detailsButton->setAutoRaise(true);
linearButton = new QToolButton(QtGradientEditor);
- linearButton->setObjectName(QStringLiteral("linearButton"));
+ linearButton->setObjectName(QString::fromUtf8("linearButton"));
linearButton->setGeometry(QRect(10, 10, 30, 26));
linearButton->setCheckable(true);
linearButton->setAutoRaise(true);
radialButton = new QToolButton(QtGradientEditor);
- radialButton->setObjectName(QStringLiteral("radialButton"));
+ radialButton->setObjectName(QString::fromUtf8("radialButton"));
radialButton->setGeometry(QRect(40, 10, 30, 26));
radialButton->setCheckable(true);
radialButton->setAutoRaise(true);
conicalButton = new QToolButton(QtGradientEditor);
- conicalButton->setObjectName(QStringLiteral("conicalButton"));
+ conicalButton->setObjectName(QString::fromUtf8("conicalButton"));
conicalButton->setGeometry(QRect(70, 10, 30, 26));
conicalButton->setCheckable(true);
conicalButton->setAutoRaise(true);
padButton = new QToolButton(QtGradientEditor);
- padButton->setObjectName(QStringLiteral("padButton"));
+ padButton->setObjectName(QString::fromUtf8("padButton"));
padButton->setGeometry(QRect(110, 10, 30, 26));
padButton->setCheckable(true);
padButton->setAutoRaise(true);
repeatButton = new QToolButton(QtGradientEditor);
- repeatButton->setObjectName(QStringLiteral("repeatButton"));
+ repeatButton->setObjectName(QString::fromUtf8("repeatButton"));
repeatButton->setGeometry(QRect(140, 10, 30, 26));
repeatButton->setCheckable(true);
repeatButton->setAutoRaise(true);
reflectButton = new QToolButton(QtGradientEditor);
- reflectButton->setObjectName(QStringLiteral("reflectButton"));
+ reflectButton->setObjectName(QString::fromUtf8("reflectButton"));
reflectButton->setGeometry(QRect(170, 10, 30, 26));
reflectButton->setCheckable(true);
reflectButton->setAutoRaise(true);
diff --git a/tests/auto/tools/uic/baseline/qtgradientview.ui.h b/tests/auto/tools/uic/baseline/qtgradientview.ui.h
index 4d51c2400e..aa3c03b02f 100644
--- a/tests/auto/tools/uic/baseline/qtgradientview.ui.h
+++ b/tests/auto/tools/uic/baseline/qtgradientview.ui.h
@@ -35,15 +35,15 @@ public:
void setupUi(QWidget *QtGradientView)
{
if (QtGradientView->objectName().isEmpty())
- QtGradientView->setObjectName(QStringLiteral("QtGradientView"));
+ QtGradientView->setObjectName(QString::fromUtf8("QtGradientView"));
QtGradientView->resize(484, 228);
vboxLayout = new QVBoxLayout(QtGradientView);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
vboxLayout->setContentsMargins(0, 0, 0, 0);
hboxLayout = new QHBoxLayout();
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
newButton = new QToolButton(QtGradientView);
- newButton->setObjectName(QStringLiteral("newButton"));
+ newButton->setObjectName(QString::fromUtf8("newButton"));
QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -55,7 +55,7 @@ public:
hboxLayout->addWidget(newButton);
editButton = new QToolButton(QtGradientView);
- editButton->setObjectName(QStringLiteral("editButton"));
+ editButton->setObjectName(QString::fromUtf8("editButton"));
sizePolicy.setHeightForWidth(editButton->sizePolicy().hasHeightForWidth());
editButton->setSizePolicy(sizePolicy);
editButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
@@ -64,7 +64,7 @@ public:
hboxLayout->addWidget(editButton);
renameButton = new QToolButton(QtGradientView);
- renameButton->setObjectName(QStringLiteral("renameButton"));
+ renameButton->setObjectName(QString::fromUtf8("renameButton"));
sizePolicy.setHeightForWidth(renameButton->sizePolicy().hasHeightForWidth());
renameButton->setSizePolicy(sizePolicy);
renameButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
@@ -73,7 +73,7 @@ public:
hboxLayout->addWidget(renameButton);
removeButton = new QToolButton(QtGradientView);
- removeButton->setObjectName(QStringLiteral("removeButton"));
+ removeButton->setObjectName(QString::fromUtf8("removeButton"));
sizePolicy.setHeightForWidth(removeButton->sizePolicy().hasHeightForWidth());
removeButton->setSizePolicy(sizePolicy);
removeButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
@@ -89,7 +89,7 @@ public:
vboxLayout->addLayout(hboxLayout);
listWidget = new QListWidget(QtGradientView);
- listWidget->setObjectName(QStringLiteral("listWidget"));
+ listWidget->setObjectName(QString::fromUtf8("listWidget"));
vboxLayout->addWidget(listWidget);
diff --git a/tests/auto/tools/uic/baseline/qtgradientviewdialog.ui.h b/tests/auto/tools/uic/baseline/qtgradientviewdialog.ui.h
index 74fe3745c9..e6d98ed4f0 100644
--- a/tests/auto/tools/uic/baseline/qtgradientviewdialog.ui.h
+++ b/tests/auto/tools/uic/baseline/qtgradientviewdialog.ui.h
@@ -58,12 +58,12 @@ public:
void setupUi(QDialog *QtGradientViewDialog)
{
if (QtGradientViewDialog->objectName().isEmpty())
- QtGradientViewDialog->setObjectName(QStringLiteral("QtGradientViewDialog"));
+ QtGradientViewDialog->setObjectName(QString::fromUtf8("QtGradientViewDialog"));
QtGradientViewDialog->resize(178, 72);
vboxLayout = new QVBoxLayout(QtGradientViewDialog);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
gradientView = new QtGradientView(QtGradientViewDialog);
- gradientView->setObjectName(QStringLiteral("gradientView"));
+ gradientView->setObjectName(QString::fromUtf8("gradientView"));
QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -73,7 +73,7 @@ public:
vboxLayout->addWidget(gradientView);
buttonBox = new QDialogButtonBox(QtGradientViewDialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/qtresourceeditordialog.ui.h b/tests/auto/tools/uic/baseline/qtresourceeditordialog.ui.h
index 62d99b3235..6a8c9c7172 100644
--- a/tests/auto/tools/uic/baseline/qtresourceeditordialog.ui.h
+++ b/tests/auto/tools/uic/baseline/qtresourceeditordialog.ui.h
@@ -49,20 +49,20 @@ public:
void setupUi(QDialog *QtResourceEditorDialog)
{
if (QtResourceEditorDialog->objectName().isEmpty())
- QtResourceEditorDialog->setObjectName(QStringLiteral("QtResourceEditorDialog"));
+ QtResourceEditorDialog->setObjectName(QString::fromUtf8("QtResourceEditorDialog"));
QtResourceEditorDialog->resize(469, 317);
verticalLayout = new QVBoxLayout(QtResourceEditorDialog);
- verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
splitter = new QSplitter(QtResourceEditorDialog);
- splitter->setObjectName(QStringLiteral("splitter"));
+ splitter->setObjectName(QString::fromUtf8("splitter"));
splitter->setOrientation(Qt::Horizontal);
layoutWidget = new QWidget(splitter);
- layoutWidget->setObjectName(QStringLiteral("layoutWidget"));
+ layoutWidget->setObjectName(QString::fromUtf8("layoutWidget"));
gridLayout = new QGridLayout(layoutWidget);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
gridLayout->setContentsMargins(0, 0, 0, 0);
qrcFileList = new QListWidget(layoutWidget);
- qrcFileList->setObjectName(QStringLiteral("qrcFileList"));
+ qrcFileList->setObjectName(QString::fromUtf8("qrcFileList"));
QSizePolicy sizePolicy(QSizePolicy::Ignored, QSizePolicy::Expanding);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -72,12 +72,12 @@ public:
gridLayout->addWidget(qrcFileList, 0, 0, 1, 4);
newQrcButton = new QToolButton(layoutWidget);
- newQrcButton->setObjectName(QStringLiteral("newQrcButton"));
+ newQrcButton->setObjectName(QString::fromUtf8("newQrcButton"));
gridLayout->addWidget(newQrcButton, 1, 0, 1, 1);
removeQrcButton = new QToolButton(layoutWidget);
- removeQrcButton->setObjectName(QStringLiteral("removeQrcButton"));
+ removeQrcButton->setObjectName(QString::fromUtf8("removeQrcButton"));
gridLayout->addWidget(removeQrcButton, 1, 2, 1, 1);
@@ -86,33 +86,33 @@ public:
gridLayout->addItem(spacerItem, 1, 3, 1, 1);
importQrcButton = new QToolButton(layoutWidget);
- importQrcButton->setObjectName(QStringLiteral("importQrcButton"));
+ importQrcButton->setObjectName(QString::fromUtf8("importQrcButton"));
gridLayout->addWidget(importQrcButton, 1, 1, 1, 1);
splitter->addWidget(layoutWidget);
widget = new QWidget(splitter);
- widget->setObjectName(QStringLiteral("widget"));
+ widget->setObjectName(QString::fromUtf8("widget"));
gridLayout1 = new QGridLayout(widget);
- gridLayout1->setObjectName(QStringLiteral("gridLayout1"));
+ gridLayout1->setObjectName(QString::fromUtf8("gridLayout1"));
gridLayout1->setContentsMargins(0, 0, 0, 0);
resourceTreeView = new QTreeView(widget);
- resourceTreeView->setObjectName(QStringLiteral("resourceTreeView"));
+ resourceTreeView->setObjectName(QString::fromUtf8("resourceTreeView"));
gridLayout1->addWidget(resourceTreeView, 0, 0, 1, 4);
newResourceButton = new QToolButton(widget);
- newResourceButton->setObjectName(QStringLiteral("newResourceButton"));
+ newResourceButton->setObjectName(QString::fromUtf8("newResourceButton"));
gridLayout1->addWidget(newResourceButton, 1, 0, 1, 1);
addResourceButton = new QToolButton(widget);
- addResourceButton->setObjectName(QStringLiteral("addResourceButton"));
+ addResourceButton->setObjectName(QString::fromUtf8("addResourceButton"));
gridLayout1->addWidget(addResourceButton, 1, 1, 1, 1);
removeResourceButton = new QToolButton(widget);
- removeResourceButton->setObjectName(QStringLiteral("removeResourceButton"));
+ removeResourceButton->setObjectName(QString::fromUtf8("removeResourceButton"));
gridLayout1->addWidget(removeResourceButton, 1, 2, 1, 1);
@@ -125,7 +125,7 @@ public:
verticalLayout->addWidget(splitter);
buttonBox = new QDialogButtonBox(QtResourceEditorDialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/qttoolbardialog.ui.h b/tests/auto/tools/uic/baseline/qttoolbardialog.ui.h
index 1c546aa196..e893386d9b 100644
--- a/tests/auto/tools/uic/baseline/qttoolbardialog.ui.h
+++ b/tests/auto/tools/uic/baseline/qttoolbardialog.ui.h
@@ -50,21 +50,21 @@ public:
void setupUi(QDialog *QtToolBarDialog)
{
if (QtToolBarDialog->objectName().isEmpty())
- QtToolBarDialog->setObjectName(QStringLiteral("QtToolBarDialog"));
+ QtToolBarDialog->setObjectName(QString::fromUtf8("QtToolBarDialog"));
QtToolBarDialog->resize(583, 508);
gridLayout = new QGridLayout(QtToolBarDialog);
#ifndef Q_OS_MAC
gridLayout->setSpacing(6);
#endif
gridLayout->setContentsMargins(8, 8, 8, 8);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
actionTree = new QTreeWidget(QtToolBarDialog);
- actionTree->setObjectName(QStringLiteral("actionTree"));
+ actionTree->setObjectName(QString::fromUtf8("actionTree"));
gridLayout->addWidget(actionTree, 1, 0, 3, 1);
label = new QLabel(QtToolBarDialog);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout->addWidget(label, 0, 0, 1, 1);
@@ -73,24 +73,24 @@ public:
hboxLayout->setSpacing(6);
#endif
hboxLayout->setContentsMargins(0, 0, 0, 0);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
label_2 = new QLabel(QtToolBarDialog);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
hboxLayout->addWidget(label_2);
newButton = new QToolButton(QtToolBarDialog);
- newButton->setObjectName(QStringLiteral("newButton"));
+ newButton->setObjectName(QString::fromUtf8("newButton"));
hboxLayout->addWidget(newButton);
removeButton = new QToolButton(QtToolBarDialog);
- removeButton->setObjectName(QStringLiteral("removeButton"));
+ removeButton->setObjectName(QString::fromUtf8("removeButton"));
hboxLayout->addWidget(removeButton);
renameButton = new QToolButton(QtToolBarDialog);
- renameButton->setObjectName(QStringLiteral("renameButton"));
+ renameButton->setObjectName(QString::fromUtf8("renameButton"));
hboxLayout->addWidget(renameButton);
@@ -102,9 +102,9 @@ public:
vboxLayout->setSpacing(6);
#endif
vboxLayout->setContentsMargins(0, 0, 0, 0);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
upButton = new QToolButton(QtToolBarDialog);
- upButton->setObjectName(QStringLiteral("upButton"));
+ upButton->setObjectName(QString::fromUtf8("upButton"));
QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -114,21 +114,21 @@ public:
vboxLayout->addWidget(upButton);
leftButton = new QToolButton(QtToolBarDialog);
- leftButton->setObjectName(QStringLiteral("leftButton"));
+ leftButton->setObjectName(QString::fromUtf8("leftButton"));
sizePolicy.setHeightForWidth(leftButton->sizePolicy().hasHeightForWidth());
leftButton->setSizePolicy(sizePolicy);
vboxLayout->addWidget(leftButton);
rightButton = new QToolButton(QtToolBarDialog);
- rightButton->setObjectName(QStringLiteral("rightButton"));
+ rightButton->setObjectName(QString::fromUtf8("rightButton"));
sizePolicy.setHeightForWidth(rightButton->sizePolicy().hasHeightForWidth());
rightButton->setSizePolicy(sizePolicy);
vboxLayout->addWidget(rightButton);
downButton = new QToolButton(QtToolBarDialog);
- downButton->setObjectName(QStringLiteral("downButton"));
+ downButton->setObjectName(QString::fromUtf8("downButton"));
sizePolicy.setHeightForWidth(downButton->sizePolicy().hasHeightForWidth());
downButton->setSizePolicy(sizePolicy);
@@ -142,22 +142,22 @@ public:
gridLayout->addLayout(vboxLayout, 3, 1, 1, 1);
currentToolBarList = new QListWidget(QtToolBarDialog);
- currentToolBarList->setObjectName(QStringLiteral("currentToolBarList"));
+ currentToolBarList->setObjectName(QString::fromUtf8("currentToolBarList"));
gridLayout->addWidget(currentToolBarList, 3, 2, 1, 1);
label_3 = new QLabel(QtToolBarDialog);
- label_3->setObjectName(QStringLiteral("label_3"));
+ label_3->setObjectName(QString::fromUtf8("label_3"));
gridLayout->addWidget(label_3, 2, 1, 1, 2);
toolBarList = new QListWidget(QtToolBarDialog);
- toolBarList->setObjectName(QStringLiteral("toolBarList"));
+ toolBarList->setObjectName(QString::fromUtf8("toolBarList"));
gridLayout->addWidget(toolBarList, 1, 1, 1, 2);
buttonBox = new QDialogButtonBox(QtToolBarDialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setStandardButtons(QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults);
gridLayout->addWidget(buttonBox, 5, 0, 1, 3);
diff --git a/tests/auto/tools/uic/baseline/qttrid.ui.h b/tests/auto/tools/uic/baseline/qttrid.ui.h
index b7ec1062de..890ffc7789 100644
--- a/tests/auto/tools/uic/baseline/qttrid.ui.h
+++ b/tests/auto/tools/uic/baseline/qttrid.ui.h
@@ -67,28 +67,28 @@ public:
void setupUi(QMainWindow *RemoteControlClass)
{
if (RemoteControlClass->objectName().isEmpty())
- RemoteControlClass->setObjectName(QStringLiteral("RemoteControlClass"));
+ RemoteControlClass->setObjectName(QString::fromUtf8("RemoteControlClass"));
RemoteControlClass->resize(344, 364);
actionQuit = new QAction(RemoteControlClass);
- actionQuit->setObjectName(QStringLiteral("actionQuit"));
+ actionQuit->setObjectName(QString::fromUtf8("actionQuit"));
centralWidget = new QWidget(RemoteControlClass);
- centralWidget->setObjectName(QStringLiteral("centralWidget"));
+ centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
gridLayout = new QGridLayout(centralWidget);
gridLayout->setSpacing(6);
gridLayout->setContentsMargins(11, 11, 11, 11);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
label = new QLabel(centralWidget);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout->addWidget(label, 0, 0, 1, 1);
startUrlLineEdit = new QLineEdit(centralWidget);
- startUrlLineEdit->setObjectName(QStringLiteral("startUrlLineEdit"));
+ startUrlLineEdit->setObjectName(QString::fromUtf8("startUrlLineEdit"));
gridLayout->addWidget(startUrlLineEdit, 0, 1, 1, 2);
launchButton = new QPushButton(centralWidget);
- launchButton->setObjectName(QStringLiteral("launchButton"));
+ launchButton->setObjectName(QString::fromUtf8("launchButton"));
gridLayout->addWidget(launchButton, 1, 1, 1, 1);
@@ -101,27 +101,27 @@ public:
gridLayout->addItem(spacerItem1, 2, 1, 1, 1);
actionGroupBox = new QGroupBox(centralWidget);
- actionGroupBox->setObjectName(QStringLiteral("actionGroupBox"));
+ actionGroupBox->setObjectName(QString::fromUtf8("actionGroupBox"));
actionGroupBox->setEnabled(false);
gridLayout1 = new QGridLayout(actionGroupBox);
gridLayout1->setSpacing(6);
gridLayout1->setContentsMargins(11, 11, 11, 11);
- gridLayout1->setObjectName(QStringLiteral("gridLayout1"));
+ gridLayout1->setObjectName(QString::fromUtf8("gridLayout1"));
label_2 = new QLabel(actionGroupBox);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
gridLayout1->addWidget(label_2, 0, 0, 1, 1);
hboxLayout = new QHBoxLayout();
hboxLayout->setSpacing(0);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
indexLineEdit = new QLineEdit(actionGroupBox);
- indexLineEdit->setObjectName(QStringLiteral("indexLineEdit"));
+ indexLineEdit->setObjectName(QString::fromUtf8("indexLineEdit"));
hboxLayout->addWidget(indexLineEdit);
indexButton = new QToolButton(actionGroupBox);
- indexButton->setObjectName(QStringLiteral("indexButton"));
+ indexButton->setObjectName(QString::fromUtf8("indexButton"));
const QIcon icon = QIcon(QString::fromUtf8(":/remotecontrol/enter.png"));
indexButton->setIcon(icon);
@@ -131,20 +131,20 @@ public:
gridLayout1->addLayout(hboxLayout, 0, 1, 1, 2);
label_4 = new QLabel(actionGroupBox);
- label_4->setObjectName(QStringLiteral("label_4"));
+ label_4->setObjectName(QString::fromUtf8("label_4"));
gridLayout1->addWidget(label_4, 1, 0, 1, 1);
hboxLayout1 = new QHBoxLayout();
hboxLayout1->setSpacing(0);
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
identifierLineEdit = new QLineEdit(actionGroupBox);
- identifierLineEdit->setObjectName(QStringLiteral("identifierLineEdit"));
+ identifierLineEdit->setObjectName(QString::fromUtf8("identifierLineEdit"));
hboxLayout1->addWidget(identifierLineEdit);
identifierButton = new QToolButton(actionGroupBox);
- identifierButton->setObjectName(QStringLiteral("identifierButton"));
+ identifierButton->setObjectName(QString::fromUtf8("identifierButton"));
identifierButton->setIcon(icon);
hboxLayout1->addWidget(identifierButton);
@@ -153,20 +153,20 @@ public:
gridLayout1->addLayout(hboxLayout1, 1, 1, 1, 2);
label_3 = new QLabel(actionGroupBox);
- label_3->setObjectName(QStringLiteral("label_3"));
+ label_3->setObjectName(QString::fromUtf8("label_3"));
gridLayout1->addWidget(label_3, 2, 0, 1, 1);
hboxLayout2 = new QHBoxLayout();
hboxLayout2->setSpacing(0);
- hboxLayout2->setObjectName(QStringLiteral("hboxLayout2"));
+ hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2"));
urlLineEdit = new QLineEdit(actionGroupBox);
- urlLineEdit->setObjectName(QStringLiteral("urlLineEdit"));
+ urlLineEdit->setObjectName(QString::fromUtf8("urlLineEdit"));
hboxLayout2->addWidget(urlLineEdit);
urlButton = new QToolButton(actionGroupBox);
- urlButton->setObjectName(QStringLiteral("urlButton"));
+ urlButton->setObjectName(QString::fromUtf8("urlButton"));
urlButton->setIcon(icon);
hboxLayout2->addWidget(urlButton);
@@ -175,7 +175,7 @@ public:
gridLayout1->addLayout(hboxLayout2, 2, 1, 1, 2);
syncContentsButton = new QPushButton(actionGroupBox);
- syncContentsButton->setObjectName(QStringLiteral("syncContentsButton"));
+ syncContentsButton->setObjectName(QString::fromUtf8("syncContentsButton"));
gridLayout1->addWidget(syncContentsButton, 3, 1, 1, 1);
@@ -184,17 +184,17 @@ public:
gridLayout1->addItem(spacerItem2, 3, 2, 1, 1);
contentsCheckBox = new QCheckBox(actionGroupBox);
- contentsCheckBox->setObjectName(QStringLiteral("contentsCheckBox"));
+ contentsCheckBox->setObjectName(QString::fromUtf8("contentsCheckBox"));
gridLayout1->addWidget(contentsCheckBox, 4, 0, 1, 3);
indexCheckBox = new QCheckBox(actionGroupBox);
- indexCheckBox->setObjectName(QStringLiteral("indexCheckBox"));
+ indexCheckBox->setObjectName(QString::fromUtf8("indexCheckBox"));
gridLayout1->addWidget(indexCheckBox, 5, 0, 1, 1);
bookmarksCheckBox = new QCheckBox(actionGroupBox);
- bookmarksCheckBox->setObjectName(QStringLiteral("bookmarksCheckBox"));
+ bookmarksCheckBox->setObjectName(QString::fromUtf8("bookmarksCheckBox"));
gridLayout1->addWidget(bookmarksCheckBox, 6, 0, 1, 3);
@@ -203,13 +203,13 @@ public:
RemoteControlClass->setCentralWidget(centralWidget);
menuBar = new QMenuBar(RemoteControlClass);
- menuBar->setObjectName(QStringLiteral("menuBar"));
+ menuBar->setObjectName(QString::fromUtf8("menuBar"));
menuBar->setGeometry(QRect(0, 0, 344, 21));
menuFile = new QMenu(menuBar);
- menuFile->setObjectName(QStringLiteral("menuFile"));
+ menuFile->setObjectName(QString::fromUtf8("menuFile"));
RemoteControlClass->setMenuBar(menuBar);
statusBar = new QStatusBar(RemoteControlClass);
- statusBar->setObjectName(QStringLiteral("statusBar"));
+ statusBar->setObjectName(QString::fromUtf8("statusBar"));
RemoteControlClass->setStatusBar(statusBar);
menuBar->addAction(menuFile->menuAction());
diff --git a/tests/auto/tools/uic/baseline/querywidget.ui.h b/tests/auto/tools/uic/baseline/querywidget.ui.h
index 0e941a0e5e..81516722d5 100644
--- a/tests/auto/tools/uic/baseline/querywidget.ui.h
+++ b/tests/auto/tools/uic/baseline/querywidget.ui.h
@@ -46,13 +46,13 @@ public:
void setupUi(QMainWindow *QueryWidget)
{
if (QueryWidget->objectName().isEmpty())
- QueryWidget->setObjectName(QStringLiteral("QueryWidget"));
+ QueryWidget->setObjectName(QString::fromUtf8("QueryWidget"));
QueryWidget->resize(545, 531);
centralwidget = new QWidget(QueryWidget);
- centralwidget->setObjectName(QStringLiteral("centralwidget"));
+ centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
centralwidget->setGeometry(QRect(0, 29, 545, 480));
verticalLayout = new QVBoxLayout(centralwidget);
- verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
vboxLayout = new QVBoxLayout();
#ifndef Q_OS_MAC
vboxLayout->setSpacing(6);
@@ -60,12 +60,12 @@ public:
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(0, 0, 0, 0);
#endif
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
inputGroupBox = new QGroupBox(centralwidget);
- inputGroupBox->setObjectName(QStringLiteral("inputGroupBox"));
+ inputGroupBox->setObjectName(QString::fromUtf8("inputGroupBox"));
inputGroupBox->setMinimumSize(QSize(550, 120));
verticalLayout_4 = new QVBoxLayout(inputGroupBox);
- verticalLayout_4->setObjectName(QStringLiteral("verticalLayout_4"));
+ verticalLayout_4->setObjectName(QString::fromUtf8("verticalLayout_4"));
_2 = new QVBoxLayout();
#ifndef Q_OS_MAC
_2->setSpacing(6);
@@ -73,9 +73,9 @@ public:
#ifndef Q_OS_MAC
_2->setContentsMargins(0, 0, 0, 0);
#endif
- _2->setObjectName(QStringLiteral("_2"));
+ _2->setObjectName(QString::fromUtf8("_2"));
inputTextEdit = new QTextEdit(inputGroupBox);
- inputTextEdit->setObjectName(QStringLiteral("inputTextEdit"));
+ inputTextEdit->setObjectName(QString::fromUtf8("inputTextEdit"));
_2->addWidget(inputTextEdit);
@@ -86,17 +86,17 @@ public:
vboxLayout->addWidget(inputGroupBox);
queryGroupBox = new QGroupBox(centralwidget);
- queryGroupBox->setObjectName(QStringLiteral("queryGroupBox"));
+ queryGroupBox->setObjectName(QString::fromUtf8("queryGroupBox"));
queryGroupBox->setMinimumSize(QSize(550, 120));
verticalLayout_5 = new QVBoxLayout(queryGroupBox);
- verticalLayout_5->setObjectName(QStringLiteral("verticalLayout_5"));
+ verticalLayout_5->setObjectName(QString::fromUtf8("verticalLayout_5"));
defaultQueries = new QComboBox(queryGroupBox);
- defaultQueries->setObjectName(QStringLiteral("defaultQueries"));
+ defaultQueries->setObjectName(QString::fromUtf8("defaultQueries"));
verticalLayout_5->addWidget(defaultQueries);
queryTextEdit = new QTextEdit(queryGroupBox);
- queryTextEdit->setObjectName(QStringLiteral("queryTextEdit"));
+ queryTextEdit->setObjectName(QString::fromUtf8("queryTextEdit"));
queryTextEdit->setMinimumSize(QSize(400, 60));
queryTextEdit->setReadOnly(true);
queryTextEdit->setAcceptRichText(false);
@@ -107,10 +107,10 @@ public:
vboxLayout->addWidget(queryGroupBox);
outputGroupBox = new QGroupBox(centralwidget);
- outputGroupBox->setObjectName(QStringLiteral("outputGroupBox"));
+ outputGroupBox->setObjectName(QString::fromUtf8("outputGroupBox"));
outputGroupBox->setMinimumSize(QSize(550, 120));
verticalLayout_6 = new QVBoxLayout(outputGroupBox);
- verticalLayout_6->setObjectName(QStringLiteral("verticalLayout_6"));
+ verticalLayout_6->setObjectName(QString::fromUtf8("verticalLayout_6"));
_3 = new QVBoxLayout();
#ifndef Q_OS_MAC
_3->setSpacing(6);
@@ -118,9 +118,9 @@ public:
#ifndef Q_OS_MAC
_3->setContentsMargins(0, 0, 0, 0);
#endif
- _3->setObjectName(QStringLiteral("_3"));
+ _3->setObjectName(QString::fromUtf8("_3"));
outputTextEdit = new QTextEdit(outputGroupBox);
- outputTextEdit->setObjectName(QStringLiteral("outputTextEdit"));
+ outputTextEdit->setObjectName(QString::fromUtf8("outputTextEdit"));
outputTextEdit->setMinimumSize(QSize(500, 80));
outputTextEdit->setReadOnly(true);
outputTextEdit->setAcceptRichText(false);
@@ -138,11 +138,11 @@ public:
QueryWidget->setCentralWidget(centralwidget);
menubar = new QMenuBar(QueryWidget);
- menubar->setObjectName(QStringLiteral("menubar"));
+ menubar->setObjectName(QString::fromUtf8("menubar"));
menubar->setGeometry(QRect(0, 0, 545, 29));
QueryWidget->setMenuBar(menubar);
statusbar = new QStatusBar(QueryWidget);
- statusbar->setObjectName(QStringLiteral("statusbar"));
+ statusbar->setObjectName(QString::fromUtf8("statusbar"));
statusbar->setGeometry(QRect(0, 509, 545, 22));
QueryWidget->setStatusBar(statusbar);
diff --git a/tests/auto/tools/uic/baseline/remotecontrol.ui.h b/tests/auto/tools/uic/baseline/remotecontrol.ui.h
index c883637dc4..5893ff42af 100644
--- a/tests/auto/tools/uic/baseline/remotecontrol.ui.h
+++ b/tests/auto/tools/uic/baseline/remotecontrol.ui.h
@@ -67,28 +67,28 @@ public:
void setupUi(QMainWindow *RemoteControlClass)
{
if (RemoteControlClass->objectName().isEmpty())
- RemoteControlClass->setObjectName(QStringLiteral("RemoteControlClass"));
+ RemoteControlClass->setObjectName(QString::fromUtf8("RemoteControlClass"));
RemoteControlClass->resize(344, 364);
actionQuit = new QAction(RemoteControlClass);
- actionQuit->setObjectName(QStringLiteral("actionQuit"));
+ actionQuit->setObjectName(QString::fromUtf8("actionQuit"));
centralWidget = new QWidget(RemoteControlClass);
- centralWidget->setObjectName(QStringLiteral("centralWidget"));
+ centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
gridLayout = new QGridLayout(centralWidget);
gridLayout->setSpacing(6);
gridLayout->setContentsMargins(11, 11, 11, 11);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
label = new QLabel(centralWidget);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout->addWidget(label, 0, 0, 1, 1);
startUrlLineEdit = new QLineEdit(centralWidget);
- startUrlLineEdit->setObjectName(QStringLiteral("startUrlLineEdit"));
+ startUrlLineEdit->setObjectName(QString::fromUtf8("startUrlLineEdit"));
gridLayout->addWidget(startUrlLineEdit, 0, 1, 1, 2);
launchButton = new QPushButton(centralWidget);
- launchButton->setObjectName(QStringLiteral("launchButton"));
+ launchButton->setObjectName(QString::fromUtf8("launchButton"));
gridLayout->addWidget(launchButton, 1, 1, 1, 1);
@@ -101,27 +101,27 @@ public:
gridLayout->addItem(spacerItem1, 2, 1, 1, 1);
actionGroupBox = new QGroupBox(centralWidget);
- actionGroupBox->setObjectName(QStringLiteral("actionGroupBox"));
+ actionGroupBox->setObjectName(QString::fromUtf8("actionGroupBox"));
actionGroupBox->setEnabled(false);
gridLayout1 = new QGridLayout(actionGroupBox);
gridLayout1->setSpacing(6);
gridLayout1->setContentsMargins(11, 11, 11, 11);
- gridLayout1->setObjectName(QStringLiteral("gridLayout1"));
+ gridLayout1->setObjectName(QString::fromUtf8("gridLayout1"));
label_2 = new QLabel(actionGroupBox);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
gridLayout1->addWidget(label_2, 0, 0, 1, 1);
hboxLayout = new QHBoxLayout();
hboxLayout->setSpacing(0);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
indexLineEdit = new QLineEdit(actionGroupBox);
- indexLineEdit->setObjectName(QStringLiteral("indexLineEdit"));
+ indexLineEdit->setObjectName(QString::fromUtf8("indexLineEdit"));
hboxLayout->addWidget(indexLineEdit);
indexButton = new QToolButton(actionGroupBox);
- indexButton->setObjectName(QStringLiteral("indexButton"));
+ indexButton->setObjectName(QString::fromUtf8("indexButton"));
const QIcon icon = QIcon(QString::fromUtf8(":/remotecontrol/enter.png"));
indexButton->setIcon(icon);
@@ -131,20 +131,20 @@ public:
gridLayout1->addLayout(hboxLayout, 0, 1, 1, 2);
label_4 = new QLabel(actionGroupBox);
- label_4->setObjectName(QStringLiteral("label_4"));
+ label_4->setObjectName(QString::fromUtf8("label_4"));
gridLayout1->addWidget(label_4, 1, 0, 1, 1);
hboxLayout1 = new QHBoxLayout();
hboxLayout1->setSpacing(0);
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
identifierLineEdit = new QLineEdit(actionGroupBox);
- identifierLineEdit->setObjectName(QStringLiteral("identifierLineEdit"));
+ identifierLineEdit->setObjectName(QString::fromUtf8("identifierLineEdit"));
hboxLayout1->addWidget(identifierLineEdit);
identifierButton = new QToolButton(actionGroupBox);
- identifierButton->setObjectName(QStringLiteral("identifierButton"));
+ identifierButton->setObjectName(QString::fromUtf8("identifierButton"));
identifierButton->setIcon(icon);
hboxLayout1->addWidget(identifierButton);
@@ -153,20 +153,20 @@ public:
gridLayout1->addLayout(hboxLayout1, 1, 1, 1, 2);
label_3 = new QLabel(actionGroupBox);
- label_3->setObjectName(QStringLiteral("label_3"));
+ label_3->setObjectName(QString::fromUtf8("label_3"));
gridLayout1->addWidget(label_3, 2, 0, 1, 1);
hboxLayout2 = new QHBoxLayout();
hboxLayout2->setSpacing(0);
- hboxLayout2->setObjectName(QStringLiteral("hboxLayout2"));
+ hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2"));
urlLineEdit = new QLineEdit(actionGroupBox);
- urlLineEdit->setObjectName(QStringLiteral("urlLineEdit"));
+ urlLineEdit->setObjectName(QString::fromUtf8("urlLineEdit"));
hboxLayout2->addWidget(urlLineEdit);
urlButton = new QToolButton(actionGroupBox);
- urlButton->setObjectName(QStringLiteral("urlButton"));
+ urlButton->setObjectName(QString::fromUtf8("urlButton"));
urlButton->setIcon(icon);
hboxLayout2->addWidget(urlButton);
@@ -175,7 +175,7 @@ public:
gridLayout1->addLayout(hboxLayout2, 2, 1, 1, 2);
syncContentsButton = new QPushButton(actionGroupBox);
- syncContentsButton->setObjectName(QStringLiteral("syncContentsButton"));
+ syncContentsButton->setObjectName(QString::fromUtf8("syncContentsButton"));
gridLayout1->addWidget(syncContentsButton, 3, 1, 1, 1);
@@ -184,17 +184,17 @@ public:
gridLayout1->addItem(spacerItem2, 3, 2, 1, 1);
contentsCheckBox = new QCheckBox(actionGroupBox);
- contentsCheckBox->setObjectName(QStringLiteral("contentsCheckBox"));
+ contentsCheckBox->setObjectName(QString::fromUtf8("contentsCheckBox"));
gridLayout1->addWidget(contentsCheckBox, 4, 0, 1, 3);
indexCheckBox = new QCheckBox(actionGroupBox);
- indexCheckBox->setObjectName(QStringLiteral("indexCheckBox"));
+ indexCheckBox->setObjectName(QString::fromUtf8("indexCheckBox"));
gridLayout1->addWidget(indexCheckBox, 5, 0, 1, 1);
bookmarksCheckBox = new QCheckBox(actionGroupBox);
- bookmarksCheckBox->setObjectName(QStringLiteral("bookmarksCheckBox"));
+ bookmarksCheckBox->setObjectName(QString::fromUtf8("bookmarksCheckBox"));
gridLayout1->addWidget(bookmarksCheckBox, 6, 0, 1, 3);
@@ -203,13 +203,13 @@ public:
RemoteControlClass->setCentralWidget(centralWidget);
menuBar = new QMenuBar(RemoteControlClass);
- menuBar->setObjectName(QStringLiteral("menuBar"));
+ menuBar->setObjectName(QString::fromUtf8("menuBar"));
menuBar->setGeometry(QRect(0, 0, 344, 21));
menuFile = new QMenu(menuBar);
- menuFile->setObjectName(QStringLiteral("menuFile"));
+ menuFile->setObjectName(QString::fromUtf8("menuFile"));
RemoteControlClass->setMenuBar(menuBar);
statusBar = new QStatusBar(RemoteControlClass);
- statusBar->setObjectName(QStringLiteral("statusBar"));
+ statusBar->setObjectName(QString::fromUtf8("statusBar"));
RemoteControlClass->setStatusBar(statusBar);
menuBar->addAction(menuFile->menuAction());
diff --git a/tests/auto/tools/uic/baseline/saveformastemplate.ui.h b/tests/auto/tools/uic/baseline/saveformastemplate.ui.h
index 6cd8726d07..9ef6eedb4c 100644
--- a/tests/auto/tools/uic/baseline/saveformastemplate.ui.h
+++ b/tests/auto/tools/uic/baseline/saveformastemplate.ui.h
@@ -67,13 +67,13 @@ public:
void setupUi(QDialog *SaveFormAsTemplate)
{
if (SaveFormAsTemplate->objectName().isEmpty())
- SaveFormAsTemplate->setObjectName(QStringLiteral("SaveFormAsTemplate"));
+ SaveFormAsTemplate->setObjectName(QString::fromUtf8("SaveFormAsTemplate"));
vboxLayout = new QVBoxLayout(SaveFormAsTemplate);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
formLayout = new QFormLayout();
- formLayout->setObjectName(QStringLiteral("formLayout"));
+ formLayout->setObjectName(QString::fromUtf8("formLayout"));
label = new QLabel(SaveFormAsTemplate);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
label->setFrameShape(QFrame::NoFrame);
label->setFrameShadow(QFrame::Plain);
label->setTextFormat(Qt::AutoText);
@@ -81,14 +81,14 @@ public:
formLayout->setWidget(0, QFormLayout::LabelRole, label);
templateNameEdit = new QLineEdit(SaveFormAsTemplate);
- templateNameEdit->setObjectName(QStringLiteral("templateNameEdit"));
+ templateNameEdit->setObjectName(QString::fromUtf8("templateNameEdit"));
templateNameEdit->setMinimumSize(QSize(222, 0));
templateNameEdit->setEchoMode(QLineEdit::Normal);
formLayout->setWidget(0, QFormLayout::FieldRole, templateNameEdit);
label_2 = new QLabel(SaveFormAsTemplate);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
label_2->setFrameShape(QFrame::NoFrame);
label_2->setFrameShadow(QFrame::Plain);
label_2->setTextFormat(Qt::AutoText);
@@ -96,7 +96,7 @@ public:
formLayout->setWidget(1, QFormLayout::LabelRole, label_2);
categoryCombo = new QComboBox(SaveFormAsTemplate);
- categoryCombo->setObjectName(QStringLiteral("categoryCombo"));
+ categoryCombo->setObjectName(QString::fromUtf8("categoryCombo"));
formLayout->setWidget(1, QFormLayout::FieldRole, categoryCombo);
@@ -104,14 +104,14 @@ public:
vboxLayout->addLayout(formLayout);
horizontalLine = new QFrame(SaveFormAsTemplate);
- horizontalLine->setObjectName(QStringLiteral("horizontalLine"));
+ horizontalLine->setObjectName(QString::fromUtf8("horizontalLine"));
horizontalLine->setFrameShape(QFrame::HLine);
horizontalLine->setFrameShadow(QFrame::Sunken);
vboxLayout->addWidget(horizontalLine);
buttonBox = new QDialogButtonBox(SaveFormAsTemplate);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/settings.ui.h b/tests/auto/tools/uic/baseline/settings.ui.h
index 6a1f11fa85..cc680c8033 100644
--- a/tests/auto/tools/uic/baseline/settings.ui.h
+++ b/tests/auto/tools/uic/baseline/settings.ui.h
@@ -47,14 +47,14 @@ public:
void setupUi(QDialog *Dialog)
{
if (Dialog->objectName().isEmpty())
- Dialog->setObjectName(QStringLiteral("Dialog"));
+ Dialog->setObjectName(QString::fromUtf8("Dialog"));
Dialog->resize(392, 176);
verticalLayout = new QVBoxLayout(Dialog);
- verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
hboxLayout = new QHBoxLayout();
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
label = new QLabel(Dialog);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -66,7 +66,7 @@ public:
hboxLayout->addWidget(label);
deviceCombo = new QComboBox(Dialog);
- deviceCombo->setObjectName(QStringLiteral("deviceCombo"));
+ deviceCombo->setObjectName(QString::fromUtf8("deviceCombo"));
QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Fixed);
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
@@ -79,9 +79,9 @@ public:
verticalLayout->addLayout(hboxLayout);
hboxLayout1 = new QHBoxLayout();
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
label_6 = new QLabel(Dialog);
- label_6->setObjectName(QStringLiteral("label_6"));
+ label_6->setObjectName(QString::fromUtf8("label_6"));
sizePolicy.setHeightForWidth(label_6->sizePolicy().hasHeightForWidth());
label_6->setSizePolicy(sizePolicy);
label_6->setMinimumSize(QSize(90, 0));
@@ -90,7 +90,7 @@ public:
hboxLayout1->addWidget(label_6);
audioEffectsCombo = new QComboBox(Dialog);
- audioEffectsCombo->setObjectName(QStringLiteral("audioEffectsCombo"));
+ audioEffectsCombo->setObjectName(QString::fromUtf8("audioEffectsCombo"));
sizePolicy1.setHeightForWidth(audioEffectsCombo->sizePolicy().hasHeightForWidth());
audioEffectsCombo->setSizePolicy(sizePolicy1);
@@ -100,9 +100,9 @@ public:
verticalLayout->addLayout(hboxLayout1);
hboxLayout2 = new QHBoxLayout();
- hboxLayout2->setObjectName(QStringLiteral("hboxLayout2"));
+ hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2"));
crossFadeLabel = new QLabel(Dialog);
- crossFadeLabel->setObjectName(QStringLiteral("crossFadeLabel"));
+ crossFadeLabel->setObjectName(QString::fromUtf8("crossFadeLabel"));
sizePolicy.setHeightForWidth(crossFadeLabel->sizePolicy().hasHeightForWidth());
crossFadeLabel->setSizePolicy(sizePolicy);
crossFadeLabel->setMinimumSize(QSize(90, 0));
@@ -111,9 +111,9 @@ public:
hboxLayout2->addWidget(crossFadeLabel);
vboxLayout = new QVBoxLayout();
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
crossFadeSlider = new QSlider(Dialog);
- crossFadeSlider->setObjectName(QStringLiteral("crossFadeSlider"));
+ crossFadeSlider->setObjectName(QString::fromUtf8("crossFadeSlider"));
sizePolicy1.setHeightForWidth(crossFadeSlider->sizePolicy().hasHeightForWidth());
crossFadeSlider->setSizePolicy(sizePolicy1);
crossFadeSlider->setMinimum(-20);
@@ -127,9 +127,9 @@ public:
vboxLayout->addWidget(crossFadeSlider);
hboxLayout3 = new QHBoxLayout();
- hboxLayout3->setObjectName(QStringLiteral("hboxLayout3"));
+ hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3"));
label_3 = new QLabel(Dialog);
- label_3->setObjectName(QStringLiteral("label_3"));
+ label_3->setObjectName(QString::fromUtf8("label_3"));
QFont font;
font.setPointSize(9);
label_3->setFont(font);
@@ -141,7 +141,7 @@ public:
hboxLayout3->addItem(spacerItem);
label_5 = new QLabel(Dialog);
- label_5->setObjectName(QStringLiteral("label_5"));
+ label_5->setObjectName(QString::fromUtf8("label_5"));
label_5->setFont(font);
hboxLayout3->addWidget(label_5);
@@ -151,7 +151,7 @@ public:
hboxLayout3->addItem(spacerItem1);
label_4 = new QLabel(Dialog);
- label_4->setObjectName(QStringLiteral("label_4"));
+ label_4->setObjectName(QString::fromUtf8("label_4"));
label_4->setFont(font);
hboxLayout3->addWidget(label_4);
@@ -166,7 +166,7 @@ public:
verticalLayout->addLayout(hboxLayout2);
buttonBox = new QDialogButtonBox(Dialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/signalslotdialog.ui.h b/tests/auto/tools/uic/baseline/signalslotdialog.ui.h
index ad6c5776e1..5833a25a8b 100644
--- a/tests/auto/tools/uic/baseline/signalslotdialog.ui.h
+++ b/tests/auto/tools/uic/baseline/signalslotdialog.ui.h
@@ -45,33 +45,33 @@ public:
void setupUi(QDialog *SignalSlotDialogClass)
{
if (SignalSlotDialogClass->objectName().isEmpty())
- SignalSlotDialogClass->setObjectName(QStringLiteral("SignalSlotDialogClass"));
+ SignalSlotDialogClass->setObjectName(QString::fromUtf8("SignalSlotDialogClass"));
SignalSlotDialogClass->resize(617, 535);
vboxLayout = new QVBoxLayout(SignalSlotDialogClass);
vboxLayout->setSpacing(6);
vboxLayout->setContentsMargins(11, 11, 11, 11);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
slotGroupBox = new QGroupBox(SignalSlotDialogClass);
- slotGroupBox->setObjectName(QStringLiteral("slotGroupBox"));
+ slotGroupBox->setObjectName(QString::fromUtf8("slotGroupBox"));
vboxLayout1 = new QVBoxLayout(slotGroupBox);
vboxLayout1->setSpacing(6);
vboxLayout1->setContentsMargins(11, 11, 11, 11);
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
slotListView = new QListView(slotGroupBox);
- slotListView->setObjectName(QStringLiteral("slotListView"));
+ slotListView->setObjectName(QString::fromUtf8("slotListView"));
vboxLayout1->addWidget(slotListView);
hboxLayout = new QHBoxLayout();
hboxLayout->setSpacing(6);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
addSlotButton = new QToolButton(slotGroupBox);
- addSlotButton->setObjectName(QStringLiteral("addSlotButton"));
+ addSlotButton->setObjectName(QString::fromUtf8("addSlotButton"));
hboxLayout->addWidget(addSlotButton);
removeSlotButton = new QToolButton(slotGroupBox);
- removeSlotButton->setObjectName(QStringLiteral("removeSlotButton"));
+ removeSlotButton->setObjectName(QString::fromUtf8("removeSlotButton"));
hboxLayout->addWidget(removeSlotButton);
@@ -86,26 +86,26 @@ public:
vboxLayout->addWidget(slotGroupBox);
signalGroupBox = new QGroupBox(SignalSlotDialogClass);
- signalGroupBox->setObjectName(QStringLiteral("signalGroupBox"));
+ signalGroupBox->setObjectName(QString::fromUtf8("signalGroupBox"));
vboxLayout2 = new QVBoxLayout(signalGroupBox);
vboxLayout2->setSpacing(6);
vboxLayout2->setContentsMargins(11, 11, 11, 11);
- vboxLayout2->setObjectName(QStringLiteral("vboxLayout2"));
+ vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2"));
signalListView = new QListView(signalGroupBox);
- signalListView->setObjectName(QStringLiteral("signalListView"));
+ signalListView->setObjectName(QString::fromUtf8("signalListView"));
vboxLayout2->addWidget(signalListView);
hboxLayout1 = new QHBoxLayout();
hboxLayout1->setSpacing(6);
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
addSignalButton = new QToolButton(signalGroupBox);
- addSignalButton->setObjectName(QStringLiteral("addSignalButton"));
+ addSignalButton->setObjectName(QString::fromUtf8("addSignalButton"));
hboxLayout1->addWidget(addSignalButton);
removeSignalButton = new QToolButton(signalGroupBox);
- removeSignalButton->setObjectName(QStringLiteral("removeSignalButton"));
+ removeSignalButton->setObjectName(QString::fromUtf8("removeSignalButton"));
hboxLayout1->addWidget(removeSignalButton);
@@ -120,7 +120,7 @@ public:
vboxLayout->addWidget(signalGroupBox);
buttonBox = new QDialogButtonBox(SignalSlotDialogClass);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
vboxLayout->addWidget(buttonBox);
diff --git a/tests/auto/tools/uic/baseline/sslclient.ui.h b/tests/auto/tools/uic/baseline/sslclient.ui.h
index 3e7feab75a..382889648e 100644
--- a/tests/auto/tools/uic/baseline/sslclient.ui.h
+++ b/tests/auto/tools/uic/baseline/sslclient.ui.h
@@ -48,29 +48,29 @@ public:
void setupUi(QWidget *Form)
{
if (Form->objectName().isEmpty())
- Form->setObjectName(QStringLiteral("Form"));
+ Form->setObjectName(QString::fromUtf8("Form"));
Form->resize(343, 320);
vboxLayout = new QVBoxLayout(Form);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
gridLayout = new QGridLayout();
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
hostNameLabel = new QLabel(Form);
- hostNameLabel->setObjectName(QStringLiteral("hostNameLabel"));
+ hostNameLabel->setObjectName(QString::fromUtf8("hostNameLabel"));
gridLayout->addWidget(hostNameLabel, 0, 0, 1, 1);
hostNameEdit = new QLineEdit(Form);
- hostNameEdit->setObjectName(QStringLiteral("hostNameEdit"));
+ hostNameEdit->setObjectName(QString::fromUtf8("hostNameEdit"));
gridLayout->addWidget(hostNameEdit, 0, 1, 1, 1);
portLabel = new QLabel(Form);
- portLabel->setObjectName(QStringLiteral("portLabel"));
+ portLabel->setObjectName(QString::fromUtf8("portLabel"));
gridLayout->addWidget(portLabel, 1, 0, 1, 1);
portBox = new QSpinBox(Form);
- portBox->setObjectName(QStringLiteral("portBox"));
+ portBox->setObjectName(QString::fromUtf8("portBox"));
portBox->setMinimum(1);
portBox->setMaximum(65535);
portBox->setValue(993);
@@ -81,25 +81,25 @@ public:
vboxLayout->addLayout(gridLayout);
connectButton = new QPushButton(Form);
- connectButton->setObjectName(QStringLiteral("connectButton"));
+ connectButton->setObjectName(QString::fromUtf8("connectButton"));
connectButton->setEnabled(true);
vboxLayout->addWidget(connectButton);
sessionBox = new QGroupBox(Form);
- sessionBox->setObjectName(QStringLiteral("sessionBox"));
+ sessionBox->setObjectName(QString::fromUtf8("sessionBox"));
sessionBox->setEnabled(false);
vboxLayout1 = new QVBoxLayout(sessionBox);
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
hboxLayout = new QHBoxLayout();
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
cipherText = new QLabel(sessionBox);
- cipherText->setObjectName(QStringLiteral("cipherText"));
+ cipherText->setObjectName(QString::fromUtf8("cipherText"));
hboxLayout->addWidget(cipherText);
cipherLabel = new QLabel(sessionBox);
- cipherLabel->setObjectName(QStringLiteral("cipherLabel"));
+ cipherLabel->setObjectName(QString::fromUtf8("cipherLabel"));
cipherLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
hboxLayout->addWidget(cipherLabel);
@@ -108,7 +108,7 @@ public:
vboxLayout1->addLayout(hboxLayout);
sessionOutput = new QTextEdit(sessionBox);
- sessionOutput->setObjectName(QStringLiteral("sessionOutput"));
+ sessionOutput->setObjectName(QString::fromUtf8("sessionOutput"));
sessionOutput->setEnabled(false);
sessionOutput->setFocusPolicy(Qt::NoFocus);
sessionOutput->setReadOnly(true);
@@ -116,20 +116,20 @@ public:
vboxLayout1->addWidget(sessionOutput);
hboxLayout1 = new QHBoxLayout();
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
sessionInputLabel = new QLabel(sessionBox);
- sessionInputLabel->setObjectName(QStringLiteral("sessionInputLabel"));
+ sessionInputLabel->setObjectName(QString::fromUtf8("sessionInputLabel"));
hboxLayout1->addWidget(sessionInputLabel);
sessionInput = new QLineEdit(sessionBox);
- sessionInput->setObjectName(QStringLiteral("sessionInput"));
+ sessionInput->setObjectName(QString::fromUtf8("sessionInput"));
sessionInput->setEnabled(false);
hboxLayout1->addWidget(sessionInput);
sendButton = new QPushButton(sessionBox);
- sendButton->setObjectName(QStringLiteral("sendButton"));
+ sendButton->setObjectName(QString::fromUtf8("sendButton"));
sendButton->setEnabled(false);
sendButton->setFocusPolicy(Qt::TabFocus);
diff --git a/tests/auto/tools/uic/baseline/sslerrors.ui.h b/tests/auto/tools/uic/baseline/sslerrors.ui.h
index d920908de6..04f21ded43 100644
--- a/tests/auto/tools/uic/baseline/sslerrors.ui.h
+++ b/tests/auto/tools/uic/baseline/sslerrors.ui.h
@@ -36,25 +36,25 @@ public:
void setupUi(QDialog *SslErrors)
{
if (SslErrors->objectName().isEmpty())
- SslErrors->setObjectName(QStringLiteral("SslErrors"));
+ SslErrors->setObjectName(QString::fromUtf8("SslErrors"));
SslErrors->resize(371, 216);
vboxLayout = new QVBoxLayout(SslErrors);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
label = new QLabel(SslErrors);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
label->setWordWrap(true);
vboxLayout->addWidget(label);
sslErrorList = new QListWidget(SslErrors);
- sslErrorList->setObjectName(QStringLiteral("sslErrorList"));
+ sslErrorList->setObjectName(QString::fromUtf8("sslErrorList"));
vboxLayout->addWidget(sslErrorList);
hboxLayout = new QHBoxLayout();
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
certificateChainButton = new QPushButton(SslErrors);
- certificateChainButton->setObjectName(QStringLiteral("certificateChainButton"));
+ certificateChainButton->setObjectName(QString::fromUtf8("certificateChainButton"));
certificateChainButton->setAutoDefault(false);
hboxLayout->addWidget(certificateChainButton);
@@ -64,12 +64,12 @@ public:
hboxLayout->addItem(spacerItem);
pushButton = new QPushButton(SslErrors);
- pushButton->setObjectName(QStringLiteral("pushButton"));
+ pushButton->setObjectName(QString::fromUtf8("pushButton"));
hboxLayout->addWidget(pushButton);
pushButton_2 = new QPushButton(SslErrors);
- pushButton_2->setObjectName(QStringLiteral("pushButton_2"));
+ pushButton_2->setObjectName(QString::fromUtf8("pushButton_2"));
hboxLayout->addWidget(pushButton_2);
diff --git a/tests/auto/tools/uic/baseline/statistics.ui.h b/tests/auto/tools/uic/baseline/statistics.ui.h
index ab0f4f9b8d..0b508836f2 100644
--- a/tests/auto/tools/uic/baseline/statistics.ui.h
+++ b/tests/auto/tools/uic/baseline/statistics.ui.h
@@ -76,24 +76,24 @@ public:
void setupUi(QDialog *Statistics)
{
if (Statistics->objectName().isEmpty())
- Statistics->setObjectName(QStringLiteral("Statistics"));
- Statistics->setObjectName(QStringLiteral("linguist_stats"));
+ Statistics->setObjectName(QString::fromUtf8("Statistics"));
+ Statistics->setObjectName(QString::fromUtf8("linguist_stats"));
Statistics->resize(336, 164);
gridLayout = new QGridLayout(Statistics);
gridLayout->setSpacing(6);
gridLayout->setContentsMargins(11, 11, 11, 11);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
- gridLayout->setObjectName(QStringLiteral("unnamed"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("unnamed"));
hboxLayout = new QHBoxLayout();
hboxLayout->setSpacing(6);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
- hboxLayout->setObjectName(QStringLiteral("unnamed"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("unnamed"));
spacer4_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout->addItem(spacer4_2);
closeBtn = new QPushButton(Statistics);
- closeBtn->setObjectName(QStringLiteral("closeBtn"));
+ closeBtn->setObjectName(QString::fromUtf8("closeBtn"));
hboxLayout->addWidget(closeBtn);
@@ -105,66 +105,66 @@ public:
gridLayout->addLayout(hboxLayout, 1, 0, 1, 1);
frame4 = new QFrame(Statistics);
- frame4->setObjectName(QStringLiteral("frame4"));
+ frame4->setObjectName(QString::fromUtf8("frame4"));
frame4->setFrameShape(QFrame::StyledPanel);
frame4->setFrameShadow(QFrame::Raised);
gridLayout1 = new QGridLayout(frame4);
gridLayout1->setSpacing(6);
gridLayout1->setContentsMargins(11, 11, 11, 11);
- gridLayout1->setObjectName(QStringLiteral("gridLayout1"));
- gridLayout1->setObjectName(QStringLiteral("unnamed"));
+ gridLayout1->setObjectName(QString::fromUtf8("gridLayout1"));
+ gridLayout1->setObjectName(QString::fromUtf8("unnamed"));
textLabel4 = new QLabel(frame4);
- textLabel4->setObjectName(QStringLiteral("textLabel4"));
+ textLabel4->setObjectName(QString::fromUtf8("textLabel4"));
gridLayout1->addWidget(textLabel4, 0, 2, 1, 1);
textLabel5 = new QLabel(frame4);
- textLabel5->setObjectName(QStringLiteral("textLabel5"));
+ textLabel5->setObjectName(QString::fromUtf8("textLabel5"));
gridLayout1->addWidget(textLabel5, 0, 1, 1, 1);
untrWords = new QLabel(frame4);
- untrWords->setObjectName(QStringLiteral("untrWords"));
+ untrWords->setObjectName(QString::fromUtf8("untrWords"));
gridLayout1->addWidget(untrWords, 1, 1, 1, 1);
trWords = new QLabel(frame4);
- trWords->setObjectName(QStringLiteral("trWords"));
+ trWords->setObjectName(QString::fromUtf8("trWords"));
gridLayout1->addWidget(trWords, 1, 2, 1, 1);
textLabel1 = new QLabel(frame4);
- textLabel1->setObjectName(QStringLiteral("textLabel1"));
+ textLabel1->setObjectName(QString::fromUtf8("textLabel1"));
gridLayout1->addWidget(textLabel1, 1, 0, 1, 1);
trChars = new QLabel(frame4);
- trChars->setObjectName(QStringLiteral("trChars"));
+ trChars->setObjectName(QString::fromUtf8("trChars"));
gridLayout1->addWidget(trChars, 2, 2, 1, 1);
untrChars = new QLabel(frame4);
- untrChars->setObjectName(QStringLiteral("untrChars"));
+ untrChars->setObjectName(QString::fromUtf8("untrChars"));
gridLayout1->addWidget(untrChars, 2, 1, 1, 1);
textLabel3 = new QLabel(frame4);
- textLabel3->setObjectName(QStringLiteral("textLabel3"));
+ textLabel3->setObjectName(QString::fromUtf8("textLabel3"));
gridLayout1->addWidget(textLabel3, 2, 0, 1, 1);
textLabel6 = new QLabel(frame4);
- textLabel6->setObjectName(QStringLiteral("textLabel6"));
+ textLabel6->setObjectName(QString::fromUtf8("textLabel6"));
gridLayout1->addWidget(textLabel6, 3, 0, 1, 1);
trCharsSpc = new QLabel(frame4);
- trCharsSpc->setObjectName(QStringLiteral("trCharsSpc"));
+ trCharsSpc->setObjectName(QString::fromUtf8("trCharsSpc"));
gridLayout1->addWidget(trCharsSpc, 3, 2, 1, 1);
untrCharsSpc = new QLabel(frame4);
- untrCharsSpc->setObjectName(QStringLiteral("untrCharsSpc"));
+ untrCharsSpc->setObjectName(QString::fromUtf8("untrCharsSpc"));
gridLayout1->addWidget(untrCharsSpc, 3, 1, 1, 1);
diff --git a/tests/auto/tools/uic/baseline/stringlisteditor.ui.h b/tests/auto/tools/uic/baseline/stringlisteditor.ui.h
index 44603f1e8a..fd78ce91c1 100644
--- a/tests/auto/tools/uic/baseline/stringlisteditor.ui.h
+++ b/tests/auto/tools/uic/baseline/stringlisteditor.ui.h
@@ -82,7 +82,7 @@ public:
void setupUi(QDialog *qdesigner_internal__Dialog)
{
if (qdesigner_internal__Dialog->objectName().isEmpty())
- qdesigner_internal__Dialog->setObjectName(QStringLiteral("qdesigner_internal__Dialog"));
+ qdesigner_internal__Dialog->setObjectName(QString::fromUtf8("qdesigner_internal__Dialog"));
qdesigner_internal__Dialog->resize(400, 300);
vboxLayout = new QVBoxLayout(qdesigner_internal__Dialog);
#ifndef Q_OS_MAC
@@ -91,9 +91,9 @@ public:
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
groupBox = new QGroupBox(qdesigner_internal__Dialog);
- groupBox->setObjectName(QStringLiteral("groupBox"));
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
gridLayout = new QGridLayout(groupBox);
#ifndef Q_OS_MAC
gridLayout->setSpacing(6);
@@ -101,7 +101,7 @@ public:
#ifndef Q_OS_MAC
gridLayout->setContentsMargins(9, 9, 9, 9);
#endif
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
vboxLayout1 = new QVBoxLayout();
#ifndef Q_OS_MAC
vboxLayout1->setSpacing(6);
@@ -109,7 +109,7 @@ public:
#ifndef Q_OS_MAC
vboxLayout1->setContentsMargins(0, 0, 0, 0);
#endif
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
hboxLayout = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout->setSpacing(6);
@@ -117,15 +117,15 @@ public:
#ifndef Q_OS_MAC
hboxLayout->setContentsMargins(0, 0, 0, 0);
#endif
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
newButton = new QToolButton(groupBox);
- newButton->setObjectName(QStringLiteral("newButton"));
+ newButton->setObjectName(QString::fromUtf8("newButton"));
newButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
hboxLayout->addWidget(newButton);
deleteButton = new QToolButton(groupBox);
- deleteButton->setObjectName(QStringLiteral("deleteButton"));
+ deleteButton->setObjectName(QString::fromUtf8("deleteButton"));
deleteButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
hboxLayout->addWidget(deleteButton);
@@ -142,14 +142,14 @@ public:
hboxLayout1->setSpacing(6);
#endif
hboxLayout1->setContentsMargins(0, 0, 0, 0);
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
label = new QLabel(groupBox);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
hboxLayout1->addWidget(label);
valueEdit = new QLineEdit(groupBox);
- valueEdit->setObjectName(QStringLiteral("valueEdit"));
+ valueEdit->setObjectName(QString::fromUtf8("valueEdit"));
hboxLayout1->addWidget(valueEdit);
@@ -164,18 +164,18 @@ public:
vboxLayout2->setSpacing(6);
#endif
vboxLayout2->setContentsMargins(0, 0, 0, 0);
- vboxLayout2->setObjectName(QStringLiteral("vboxLayout2"));
+ vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2"));
spacerItem1 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
vboxLayout2->addItem(spacerItem1);
upButton = new QToolButton(groupBox);
- upButton->setObjectName(QStringLiteral("upButton"));
+ upButton->setObjectName(QString::fromUtf8("upButton"));
vboxLayout2->addWidget(upButton);
downButton = new QToolButton(groupBox);
- downButton->setObjectName(QStringLiteral("downButton"));
+ downButton->setObjectName(QString::fromUtf8("downButton"));
vboxLayout2->addWidget(downButton);
@@ -187,7 +187,7 @@ public:
gridLayout->addLayout(vboxLayout2, 0, 1, 1, 1);
listView = new QListView(groupBox);
- listView->setObjectName(QStringLiteral("listView"));
+ listView->setObjectName(QString::fromUtf8("listView"));
gridLayout->addWidget(listView, 0, 0, 1, 1);
@@ -195,7 +195,7 @@ public:
vboxLayout->addWidget(groupBox);
buttonBox = new QDialogButtonBox(qdesigner_internal__Dialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/stylesheeteditor.ui.h b/tests/auto/tools/uic/baseline/stylesheeteditor.ui.h
index a867317820..5ae254ebab 100644
--- a/tests/auto/tools/uic/baseline/stylesheeteditor.ui.h
+++ b/tests/auto/tools/uic/baseline/stylesheeteditor.ui.h
@@ -41,7 +41,7 @@ public:
void setupUi(QWidget *StyleSheetEditor)
{
if (StyleSheetEditor->objectName().isEmpty())
- StyleSheetEditor->setObjectName(QStringLiteral("StyleSheetEditor"));
+ StyleSheetEditor->setObjectName(QString::fromUtf8("StyleSheetEditor"));
StyleSheetEditor->resize(445, 289);
gridLayout = new QGridLayout(StyleSheetEditor);
#ifndef Q_OS_MAC
@@ -50,7 +50,7 @@ public:
#ifndef Q_OS_MAC
gridLayout->setContentsMargins(9, 9, 9, 9);
#endif
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
spacerItem = new QSpacerItem(32, 20, QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
gridLayout->addItem(spacerItem, 0, 6, 1, 1);
@@ -63,7 +63,7 @@ public:
styleSheetCombo->addItem(QString());
styleSheetCombo->addItem(QString());
styleSheetCombo->addItem(QString());
- styleSheetCombo->setObjectName(QStringLiteral("styleSheetCombo"));
+ styleSheetCombo->setObjectName(QString::fromUtf8("styleSheetCombo"));
gridLayout->addWidget(styleSheetCombo, 0, 5, 1, 1);
@@ -72,7 +72,7 @@ public:
gridLayout->addItem(spacerItem2, 0, 3, 1, 1);
styleCombo = new QComboBox(StyleSheetEditor);
- styleCombo->setObjectName(QStringLiteral("styleCombo"));
+ styleCombo->setObjectName(QString::fromUtf8("styleCombo"));
QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(5), static_cast<QSizePolicy::Policy>(0));
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -82,7 +82,7 @@ public:
gridLayout->addWidget(styleCombo, 0, 2, 1, 1);
label_7 = new QLabel(StyleSheetEditor);
- label_7->setObjectName(QStringLiteral("label_7"));
+ label_7->setObjectName(QString::fromUtf8("label_7"));
QSizePolicy sizePolicy1(static_cast<QSizePolicy::Policy>(0), static_cast<QSizePolicy::Policy>(5));
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
@@ -96,13 +96,13 @@ public:
hboxLayout->setSpacing(6);
#endif
hboxLayout->setContentsMargins(0, 0, 0, 0);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
spacerItem3 = new QSpacerItem(321, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout->addItem(spacerItem3);
applyButton = new QPushButton(StyleSheetEditor);
- applyButton->setObjectName(QStringLiteral("applyButton"));
+ applyButton->setObjectName(QString::fromUtf8("applyButton"));
applyButton->setEnabled(false);
hboxLayout->addWidget(applyButton);
@@ -111,12 +111,12 @@ public:
gridLayout->addLayout(hboxLayout, 2, 0, 1, 7);
styleTextEdit = new QTextEdit(StyleSheetEditor);
- styleTextEdit->setObjectName(QStringLiteral("styleTextEdit"));
+ styleTextEdit->setObjectName(QString::fromUtf8("styleTextEdit"));
gridLayout->addWidget(styleTextEdit, 1, 0, 1, 7);
label_8 = new QLabel(StyleSheetEditor);
- label_8->setObjectName(QStringLiteral("label_8"));
+ label_8->setObjectName(QString::fromUtf8("label_8"));
sizePolicy1.setHeightForWidth(label_8->sizePolicy().hasHeightForWidth());
label_8->setSizePolicy(sizePolicy1);
diff --git a/tests/auto/tools/uic/baseline/tabbedbrowser.ui.h b/tests/auto/tools/uic/baseline/tabbedbrowser.ui.h
index 5d670b46af..09b230f5df 100644
--- a/tests/auto/tools/uic/baseline/tabbedbrowser.ui.h
+++ b/tests/auto/tools/uic/baseline/tabbedbrowser.ui.h
@@ -77,28 +77,28 @@ public:
void setupUi(QWidget *TabbedBrowser)
{
if (TabbedBrowser->objectName().isEmpty())
- TabbedBrowser->setObjectName(QStringLiteral("TabbedBrowser"));
+ TabbedBrowser->setObjectName(QString::fromUtf8("TabbedBrowser"));
TabbedBrowser->resize(710, 664);
vboxLayout = new QVBoxLayout(TabbedBrowser);
vboxLayout->setSpacing(0);
vboxLayout->setContentsMargins(0, 0, 0, 0);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
tab = new QTabWidget(TabbedBrowser);
- tab->setObjectName(QStringLiteral("tab"));
+ tab->setObjectName(QString::fromUtf8("tab"));
frontpage = new QWidget();
- frontpage->setObjectName(QStringLiteral("frontpage"));
+ frontpage->setObjectName(QString::fromUtf8("frontpage"));
gridLayout = new QGridLayout(frontpage);
#ifndef Q_OS_MAC
gridLayout->setSpacing(6);
#endif
gridLayout->setContentsMargins(8, 8, 8, 8);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
tab->addTab(frontpage, QString());
vboxLayout->addWidget(tab);
frameFind = new QFrame(TabbedBrowser);
- frameFind->setObjectName(QStringLiteral("frameFind"));
+ frameFind->setObjectName(QString::fromUtf8("frameFind"));
frameFind->setFrameShape(QFrame::StyledPanel);
frameFind->setFrameShadow(QFrame::Raised);
hboxLayout = new QHBoxLayout(frameFind);
@@ -106,9 +106,9 @@ public:
hboxLayout->setSpacing(6);
#endif
hboxLayout->setContentsMargins(0, 0, 0, 0);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
toolClose = new QToolButton(frameFind);
- toolClose->setObjectName(QStringLiteral("toolClose"));
+ toolClose->setObjectName(QString::fromUtf8("toolClose"));
const QIcon icon = QIcon(QString::fromUtf8(":/qt-project.org/assistant/images/close.png"));
toolClose->setIcon(icon);
toolClose->setAutoRaise(true);
@@ -116,7 +116,7 @@ public:
hboxLayout->addWidget(toolClose);
editFind = new QLineEdit(frameFind);
- editFind->setObjectName(QStringLiteral("editFind"));
+ editFind->setObjectName(QString::fromUtf8("editFind"));
QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(0), static_cast<QSizePolicy::Policy>(0));
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -127,7 +127,7 @@ public:
hboxLayout->addWidget(editFind);
toolPrevious = new QToolButton(frameFind);
- toolPrevious->setObjectName(QStringLiteral("toolPrevious"));
+ toolPrevious->setObjectName(QString::fromUtf8("toolPrevious"));
const QIcon icon1 = QIcon(QString::fromUtf8(":/qt-project.org/assistant/images/win/previous.png"));
toolPrevious->setIcon(icon1);
toolPrevious->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
@@ -136,7 +136,7 @@ public:
hboxLayout->addWidget(toolPrevious);
toolNext = new QToolButton(frameFind);
- toolNext->setObjectName(QStringLiteral("toolNext"));
+ toolNext->setObjectName(QString::fromUtf8("toolNext"));
toolNext->setMinimumSize(QSize(0, 0));
const QIcon icon2 = QIcon(QString::fromUtf8(":/qt-project.org/assistant/images/win/next.png"));
toolNext->setIcon(icon2);
@@ -147,17 +147,17 @@ public:
hboxLayout->addWidget(toolNext);
checkCase = new QCheckBox(frameFind);
- checkCase->setObjectName(QStringLiteral("checkCase"));
+ checkCase->setObjectName(QString::fromUtf8("checkCase"));
hboxLayout->addWidget(checkCase);
checkWholeWords = new QCheckBox(frameFind);
- checkWholeWords->setObjectName(QStringLiteral("checkWholeWords"));
+ checkWholeWords->setObjectName(QString::fromUtf8("checkWholeWords"));
hboxLayout->addWidget(checkWholeWords);
labelWrapped = new QLabel(frameFind);
- labelWrapped->setObjectName(QStringLiteral("labelWrapped"));
+ labelWrapped->setObjectName(QString::fromUtf8("labelWrapped"));
labelWrapped->setMinimumSize(QSize(0, 20));
labelWrapped->setMaximumSize(QSize(105, 20));
labelWrapped->setTextFormat(Qt::RichText);
diff --git a/tests/auto/tools/uic/baseline/tablewidgeteditor.ui.h b/tests/auto/tools/uic/baseline/tablewidgeteditor.ui.h
index ff000305cc..e3ba00095e 100644
--- a/tests/auto/tools/uic/baseline/tablewidgeteditor.ui.h
+++ b/tests/auto/tools/uic/baseline/tablewidgeteditor.ui.h
@@ -104,28 +104,28 @@ public:
void setupUi(QDialog *qdesigner_internal__TableWidgetEditor)
{
if (qdesigner_internal__TableWidgetEditor->objectName().isEmpty())
- qdesigner_internal__TableWidgetEditor->setObjectName(QStringLiteral("qdesigner_internal__TableWidgetEditor"));
+ qdesigner_internal__TableWidgetEditor->setObjectName(QString::fromUtf8("qdesigner_internal__TableWidgetEditor"));
qdesigner_internal__TableWidgetEditor->resize(591, 455);
gridLayout_4 = new QGridLayout(qdesigner_internal__TableWidgetEditor);
- gridLayout_4->setObjectName(QStringLiteral("gridLayout_4"));
+ gridLayout_4->setObjectName(QString::fromUtf8("gridLayout_4"));
itemsBox = new QGroupBox(qdesigner_internal__TableWidgetEditor);
- itemsBox->setObjectName(QStringLiteral("itemsBox"));
+ itemsBox->setObjectName(QString::fromUtf8("itemsBox"));
gridLayout = new QGridLayout(itemsBox);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
tableWidget = new QTableWidget(itemsBox);
- tableWidget->setObjectName(QStringLiteral("tableWidget"));
+ tableWidget->setObjectName(QString::fromUtf8("tableWidget"));
gridLayout->addWidget(tableWidget, 0, 0, 1, 1);
horizontalLayout_5 = new QHBoxLayout();
- horizontalLayout_5->setObjectName(QStringLiteral("horizontalLayout_5"));
+ horizontalLayout_5->setObjectName(QString::fromUtf8("horizontalLayout_5"));
label_3 = new QLabel(itemsBox);
- label_3->setObjectName(QStringLiteral("label_3"));
+ label_3->setObjectName(QString::fromUtf8("label_3"));
horizontalLayout_5->addWidget(label_3);
itemIconSelector = new qdesigner_internal::IconSelector(itemsBox);
- itemIconSelector->setObjectName(QStringLiteral("itemIconSelector"));
+ itemIconSelector->setObjectName(QString::fromUtf8("itemIconSelector"));
horizontalLayout_5->addWidget(itemIconSelector);
@@ -140,14 +140,14 @@ public:
gridLayout_4->addWidget(itemsBox, 0, 0, 1, 1);
buttonBox = new QDialogButtonBox(qdesigner_internal__TableWidgetEditor);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
gridLayout_4->addWidget(buttonBox, 1, 0, 1, 2);
widget = new QWidget(qdesigner_internal__TableWidgetEditor);
- widget->setObjectName(QStringLiteral("widget"));
+ widget->setObjectName(QString::fromUtf8("widget"));
QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -155,13 +155,13 @@ public:
widget->setSizePolicy(sizePolicy);
verticalLayout = new QVBoxLayout(widget);
verticalLayout->setContentsMargins(0, 0, 0, 0);
- verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
+ verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
columnsBox = new QGroupBox(widget);
- columnsBox->setObjectName(QStringLiteral("columnsBox"));
+ columnsBox->setObjectName(QString::fromUtf8("columnsBox"));
gridLayout_2 = new QGridLayout(columnsBox);
- gridLayout_2->setObjectName(QStringLiteral("gridLayout_2"));
+ gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
columnsListWidget = new QListWidget(columnsBox);
- columnsListWidget->setObjectName(QStringLiteral("columnsListWidget"));
+ columnsListWidget->setObjectName(QString::fromUtf8("columnsListWidget"));
QSizePolicy sizePolicy1(QSizePolicy::Ignored, QSizePolicy::Expanding);
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
@@ -172,14 +172,14 @@ public:
gridLayout_2->addWidget(columnsListWidget, 0, 0, 1, 1);
horizontalLayout_3 = new QHBoxLayout();
- horizontalLayout_3->setObjectName(QStringLiteral("horizontalLayout_3"));
+ horizontalLayout_3->setObjectName(QString::fromUtf8("horizontalLayout_3"));
newColumnButton = new QToolButton(columnsBox);
- newColumnButton->setObjectName(QStringLiteral("newColumnButton"));
+ newColumnButton->setObjectName(QString::fromUtf8("newColumnButton"));
horizontalLayout_3->addWidget(newColumnButton);
deleteColumnButton = new QToolButton(columnsBox);
- deleteColumnButton->setObjectName(QStringLiteral("deleteColumnButton"));
+ deleteColumnButton->setObjectName(QString::fromUtf8("deleteColumnButton"));
horizontalLayout_3->addWidget(deleteColumnButton);
@@ -188,12 +188,12 @@ public:
horizontalLayout_3->addItem(spacerItem);
moveColumnUpButton = new QToolButton(columnsBox);
- moveColumnUpButton->setObjectName(QStringLiteral("moveColumnUpButton"));
+ moveColumnUpButton->setObjectName(QString::fromUtf8("moveColumnUpButton"));
horizontalLayout_3->addWidget(moveColumnUpButton);
moveColumnDownButton = new QToolButton(columnsBox);
- moveColumnDownButton->setObjectName(QStringLiteral("moveColumnDownButton"));
+ moveColumnDownButton->setObjectName(QString::fromUtf8("moveColumnDownButton"));
horizontalLayout_3->addWidget(moveColumnDownButton);
@@ -201,14 +201,14 @@ public:
gridLayout_2->addLayout(horizontalLayout_3, 1, 0, 1, 1);
horizontalLayout_2 = new QHBoxLayout();
- horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
+ horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2"));
label = new QLabel(columnsBox);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
horizontalLayout_2->addWidget(label);
columnIconSelector = new qdesigner_internal::IconSelector(columnsBox);
- columnIconSelector->setObjectName(QStringLiteral("columnIconSelector"));
+ columnIconSelector->setObjectName(QString::fromUtf8("columnIconSelector"));
horizontalLayout_2->addWidget(columnIconSelector);
@@ -223,11 +223,11 @@ public:
verticalLayout->addWidget(columnsBox);
rowsBox = new QGroupBox(widget);
- rowsBox->setObjectName(QStringLiteral("rowsBox"));
+ rowsBox->setObjectName(QString::fromUtf8("rowsBox"));
gridLayout_3 = new QGridLayout(rowsBox);
- gridLayout_3->setObjectName(QStringLiteral("gridLayout_3"));
+ gridLayout_3->setObjectName(QString::fromUtf8("gridLayout_3"));
rowsListWidget = new QListWidget(rowsBox);
- rowsListWidget->setObjectName(QStringLiteral("rowsListWidget"));
+ rowsListWidget->setObjectName(QString::fromUtf8("rowsListWidget"));
sizePolicy1.setHeightForWidth(rowsListWidget->sizePolicy().hasHeightForWidth());
rowsListWidget->setSizePolicy(sizePolicy1);
rowsListWidget->setFocusPolicy(Qt::TabFocus);
@@ -235,14 +235,14 @@ public:
gridLayout_3->addWidget(rowsListWidget, 0, 0, 1, 1);
horizontalLayout_4 = new QHBoxLayout();
- horizontalLayout_4->setObjectName(QStringLiteral("horizontalLayout_4"));
+ horizontalLayout_4->setObjectName(QString::fromUtf8("horizontalLayout_4"));
newRowButton = new QToolButton(rowsBox);
- newRowButton->setObjectName(QStringLiteral("newRowButton"));
+ newRowButton->setObjectName(QString::fromUtf8("newRowButton"));
horizontalLayout_4->addWidget(newRowButton);
deleteRowButton = new QToolButton(rowsBox);
- deleteRowButton->setObjectName(QStringLiteral("deleteRowButton"));
+ deleteRowButton->setObjectName(QString::fromUtf8("deleteRowButton"));
horizontalLayout_4->addWidget(deleteRowButton);
@@ -251,12 +251,12 @@ public:
horizontalLayout_4->addItem(spacerItem2);
moveRowUpButton = new QToolButton(rowsBox);
- moveRowUpButton->setObjectName(QStringLiteral("moveRowUpButton"));
+ moveRowUpButton->setObjectName(QString::fromUtf8("moveRowUpButton"));
horizontalLayout_4->addWidget(moveRowUpButton);
moveRowDownButton = new QToolButton(rowsBox);
- moveRowDownButton->setObjectName(QStringLiteral("moveRowDownButton"));
+ moveRowDownButton->setObjectName(QString::fromUtf8("moveRowDownButton"));
horizontalLayout_4->addWidget(moveRowDownButton);
@@ -264,14 +264,14 @@ public:
gridLayout_3->addLayout(horizontalLayout_4, 1, 0, 1, 1);
horizontalLayout = new QHBoxLayout();
- horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
+ horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
label_2 = new QLabel(rowsBox);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
horizontalLayout->addWidget(label_2);
rowIconSelector = new qdesigner_internal::IconSelector(rowsBox);
- rowIconSelector->setObjectName(QStringLiteral("rowIconSelector"));
+ rowIconSelector->setObjectName(QString::fromUtf8("rowIconSelector"));
horizontalLayout->addWidget(rowIconSelector);
diff --git a/tests/auto/tools/uic/baseline/tetrixwindow.ui.h b/tests/auto/tools/uic/baseline/tetrixwindow.ui.h
index 32c6464209..dc1033ce3a 100644
--- a/tests/auto/tools/uic/baseline/tetrixwindow.ui.h
+++ b/tests/auto/tools/uic/baseline/tetrixwindow.ui.h
@@ -42,7 +42,7 @@ public:
void setupUi(QWidget *TetrixWindow)
{
if (TetrixWindow->objectName().isEmpty())
- TetrixWindow->setObjectName(QStringLiteral("TetrixWindow"));
+ TetrixWindow->setObjectName(QString::fromUtf8("TetrixWindow"));
TetrixWindow->resize(537, 475);
vboxLayout = new QVBoxLayout(TetrixWindow);
#ifndef Q_OS_MAC
@@ -51,7 +51,7 @@ public:
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
gridLayout = new QGridLayout();
#ifndef Q_OS_MAC
gridLayout->setSpacing(6);
@@ -59,39 +59,39 @@ public:
#ifndef Q_OS_MAC
gridLayout->setContentsMargins(0, 0, 0, 0);
#endif
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
startButton = new QPushButton(TetrixWindow);
- startButton->setObjectName(QStringLiteral("startButton"));
+ startButton->setObjectName(QString::fromUtf8("startButton"));
startButton->setFocusPolicy(Qt::NoFocus);
gridLayout->addWidget(startButton, 4, 0, 1, 1);
linesLcd = new QLCDNumber(TetrixWindow);
- linesLcd->setObjectName(QStringLiteral("linesLcd"));
+ linesLcd->setObjectName(QString::fromUtf8("linesLcd"));
linesLcd->setSegmentStyle(QLCDNumber::Filled);
gridLayout->addWidget(linesLcd, 3, 2, 1, 1);
linesRemovedLabel = new QLabel(TetrixWindow);
- linesRemovedLabel->setObjectName(QStringLiteral("linesRemovedLabel"));
+ linesRemovedLabel->setObjectName(QString::fromUtf8("linesRemovedLabel"));
linesRemovedLabel->setAlignment(Qt::AlignBottom|Qt::AlignHCenter);
gridLayout->addWidget(linesRemovedLabel, 2, 2, 1, 1);
pauseButton = new QPushButton(TetrixWindow);
- pauseButton->setObjectName(QStringLiteral("pauseButton"));
+ pauseButton->setObjectName(QString::fromUtf8("pauseButton"));
pauseButton->setFocusPolicy(Qt::NoFocus);
gridLayout->addWidget(pauseButton, 5, 2, 1, 1);
scoreLcd = new QLCDNumber(TetrixWindow);
- scoreLcd->setObjectName(QStringLiteral("scoreLcd"));
+ scoreLcd->setObjectName(QString::fromUtf8("scoreLcd"));
scoreLcd->setSegmentStyle(QLCDNumber::Filled);
gridLayout->addWidget(scoreLcd, 1, 2, 1, 1);
board = new TetrixBoard(TetrixWindow);
- board->setObjectName(QStringLiteral("board"));
+ board->setObjectName(QString::fromUtf8("board"));
board->setFocusPolicy(Qt::StrongFocus);
board->setFrameShape(QFrame::Panel);
board->setFrameShadow(QFrame::Sunken);
@@ -99,31 +99,31 @@ public:
gridLayout->addWidget(board, 0, 1, 6, 1);
levelLabel = new QLabel(TetrixWindow);
- levelLabel->setObjectName(QStringLiteral("levelLabel"));
+ levelLabel->setObjectName(QString::fromUtf8("levelLabel"));
levelLabel->setAlignment(Qt::AlignBottom|Qt::AlignHCenter);
gridLayout->addWidget(levelLabel, 2, 0, 1, 1);
nextLabel = new QLabel(TetrixWindow);
- nextLabel->setObjectName(QStringLiteral("nextLabel"));
+ nextLabel->setObjectName(QString::fromUtf8("nextLabel"));
nextLabel->setAlignment(Qt::AlignBottom|Qt::AlignHCenter);
gridLayout->addWidget(nextLabel, 0, 0, 1, 1);
levelLcd = new QLCDNumber(TetrixWindow);
- levelLcd->setObjectName(QStringLiteral("levelLcd"));
+ levelLcd->setObjectName(QString::fromUtf8("levelLcd"));
levelLcd->setSegmentStyle(QLCDNumber::Filled);
gridLayout->addWidget(levelLcd, 3, 0, 1, 1);
scoreLabel = new QLabel(TetrixWindow);
- scoreLabel->setObjectName(QStringLiteral("scoreLabel"));
+ scoreLabel->setObjectName(QString::fromUtf8("scoreLabel"));
scoreLabel->setAlignment(Qt::AlignBottom|Qt::AlignHCenter);
gridLayout->addWidget(scoreLabel, 0, 2, 1, 1);
nextPieceLabel = new QLabel(TetrixWindow);
- nextPieceLabel->setObjectName(QStringLiteral("nextPieceLabel"));
+ nextPieceLabel->setObjectName(QString::fromUtf8("nextPieceLabel"));
nextPieceLabel->setFrameShape(QFrame::Box);
nextPieceLabel->setFrameShadow(QFrame::Raised);
nextPieceLabel->setAlignment(Qt::AlignCenter);
@@ -131,7 +131,7 @@ public:
gridLayout->addWidget(nextPieceLabel, 1, 0, 1, 1);
quitButton = new QPushButton(TetrixWindow);
- quitButton->setObjectName(QStringLiteral("quitButton"));
+ quitButton->setObjectName(QString::fromUtf8("quitButton"));
quitButton->setFocusPolicy(Qt::NoFocus);
gridLayout->addWidget(quitButton, 4, 2, 1, 1);
diff --git a/tests/auto/tools/uic/baseline/textfinder.ui.h b/tests/auto/tools/uic/baseline/textfinder.ui.h
index beae214e19..2f6bfebf98 100644
--- a/tests/auto/tools/uic/baseline/textfinder.ui.h
+++ b/tests/auto/tools/uic/baseline/textfinder.ui.h
@@ -36,7 +36,7 @@ public:
void setupUi(QWidget *Form)
{
if (Form->objectName().isEmpty())
- Form->setObjectName(QStringLiteral("Form"));
+ Form->setObjectName(QString::fromUtf8("Form"));
Form->resize(378, 158);
vboxLayout = new QVBoxLayout(Form);
#ifndef Q_OS_MAC
@@ -45,7 +45,7 @@ public:
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
gridLayout = new QGridLayout();
#ifndef Q_OS_MAC
gridLayout->setSpacing(6);
@@ -53,19 +53,19 @@ public:
#ifndef Q_OS_MAC
gridLayout->setContentsMargins(0, 0, 0, 0);
#endif
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
lineEdit = new QLineEdit(Form);
- lineEdit->setObjectName(QStringLiteral("lineEdit"));
+ lineEdit->setObjectName(QString::fromUtf8("lineEdit"));
gridLayout->addWidget(lineEdit, 0, 1, 1, 1);
searchLabel = new QLabel(Form);
- searchLabel->setObjectName(QStringLiteral("searchLabel"));
+ searchLabel->setObjectName(QString::fromUtf8("searchLabel"));
gridLayout->addWidget(searchLabel, 0, 0, 1, 1);
findButton = new QPushButton(Form);
- findButton->setObjectName(QStringLiteral("findButton"));
+ findButton->setObjectName(QString::fromUtf8("findButton"));
gridLayout->addWidget(findButton, 0, 2, 1, 1);
@@ -73,7 +73,7 @@ public:
vboxLayout->addLayout(gridLayout);
textEdit = new QTextEdit(Form);
- textEdit->setObjectName(QStringLiteral("textEdit"));
+ textEdit->setObjectName(QString::fromUtf8("textEdit"));
vboxLayout->addWidget(textEdit);
diff --git a/tests/auto/tools/uic/baseline/topicchooser.ui.h b/tests/auto/tools/uic/baseline/topicchooser.ui.h
index 2770553775..90ec485e39 100644
--- a/tests/auto/tools/uic/baseline/topicchooser.ui.h
+++ b/tests/auto/tools/uic/baseline/topicchooser.ui.h
@@ -37,7 +37,7 @@ public:
void setupUi(QDialog *TopicChooser)
{
if (TopicChooser->objectName().isEmpty())
- TopicChooser->setObjectName(QStringLiteral("TopicChooser"));
+ TopicChooser->setObjectName(QString::fromUtf8("TopicChooser"));
TopicChooser->resize(391, 223);
TopicChooser->setSizeGripEnabled(true);
vboxLayout = new QVBoxLayout(TopicChooser);
@@ -45,40 +45,40 @@ public:
vboxLayout->setSpacing(6);
#endif
vboxLayout->setContentsMargins(11, 11, 11, 11);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
- vboxLayout->setObjectName(QStringLiteral("unnamed"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("unnamed"));
label = new QLabel(TopicChooser);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
vboxLayout->addWidget(label);
listWidget = new QListWidget(TopicChooser);
- listWidget->setObjectName(QStringLiteral("listWidget"));
+ listWidget->setObjectName(QString::fromUtf8("listWidget"));
vboxLayout->addWidget(listWidget);
Layout16 = new QWidget(TopicChooser);
- Layout16->setObjectName(QStringLiteral("Layout16"));
+ Layout16->setObjectName(QString::fromUtf8("Layout16"));
hboxLayout = new QHBoxLayout(Layout16);
#ifndef Q_OS_MAC
hboxLayout->setSpacing(6);
#endif
hboxLayout->setContentsMargins(0, 0, 0, 0);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
- hboxLayout->setObjectName(QStringLiteral("unnamed"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("unnamed"));
hboxLayout->setContentsMargins(0, 0, 0, 0);
Horizontal_Spacing2 = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout->addItem(Horizontal_Spacing2);
buttonDisplay = new QPushButton(Layout16);
- buttonDisplay->setObjectName(QStringLiteral("buttonDisplay"));
+ buttonDisplay->setObjectName(QString::fromUtf8("buttonDisplay"));
buttonDisplay->setAutoDefault(true);
hboxLayout->addWidget(buttonDisplay);
buttonCancel = new QPushButton(Layout16);
- buttonCancel->setObjectName(QStringLiteral("buttonCancel"));
+ buttonCancel->setObjectName(QString::fromUtf8("buttonCancel"));
buttonCancel->setAutoDefault(true);
hboxLayout->addWidget(buttonCancel);
diff --git a/tests/auto/tools/uic/baseline/translatedialog.ui.h b/tests/auto/tools/uic/baseline/translatedialog.ui.h
index 32b73be37a..5bea11f9f2 100644
--- a/tests/auto/tools/uic/baseline/translatedialog.ui.h
+++ b/tests/auto/tools/uic/baseline/translatedialog.ui.h
@@ -79,7 +79,7 @@ public:
void setupUi(QDialog *TranslateDialog)
{
if (TranslateDialog->objectName().isEmpty())
- TranslateDialog->setObjectName(QStringLiteral("TranslateDialog"));
+ TranslateDialog->setObjectName(QString::fromUtf8("TranslateDialog"));
TranslateDialog->resize(407, 145);
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
sizePolicy.setHorizontalStretch(0);
@@ -89,35 +89,35 @@ public:
hboxLayout = new QHBoxLayout(TranslateDialog);
hboxLayout->setSpacing(6);
hboxLayout->setContentsMargins(11, 11, 11, 11);
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
hboxLayout->setContentsMargins(9, 9, 9, 9);
vboxLayout = new QVBoxLayout();
vboxLayout->setSpacing(6);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
vboxLayout->setContentsMargins(0, 0, 0, 0);
gridLayout = new QGridLayout();
gridLayout->setSpacing(6);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
gridLayout->setHorizontalSpacing(6);
gridLayout->setVerticalSpacing(6);
gridLayout->setContentsMargins(0, 0, 0, 0);
ledTranslateTo = new QLineEdit(TranslateDialog);
- ledTranslateTo->setObjectName(QStringLiteral("ledTranslateTo"));
+ ledTranslateTo->setObjectName(QString::fromUtf8("ledTranslateTo"));
gridLayout->addWidget(ledTranslateTo, 1, 1, 1, 1);
findWhat = new QLabel(TranslateDialog);
- findWhat->setObjectName(QStringLiteral("findWhat"));
+ findWhat->setObjectName(QString::fromUtf8("findWhat"));
gridLayout->addWidget(findWhat, 0, 0, 1, 1);
translateTo = new QLabel(TranslateDialog);
- translateTo->setObjectName(QStringLiteral("translateTo"));
+ translateTo->setObjectName(QString::fromUtf8("translateTo"));
gridLayout->addWidget(translateTo, 1, 0, 1, 1);
ledFindWhat = new QLineEdit(TranslateDialog);
- ledFindWhat->setObjectName(QStringLiteral("ledFindWhat"));
+ ledFindWhat->setObjectName(QString::fromUtf8("ledFindWhat"));
gridLayout->addWidget(ledFindWhat, 0, 1, 1, 1);
@@ -125,18 +125,18 @@ public:
vboxLayout->addLayout(gridLayout);
groupBox = new QGroupBox(TranslateDialog);
- groupBox->setObjectName(QStringLiteral("groupBox"));
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
vboxLayout1 = new QVBoxLayout(groupBox);
vboxLayout1->setSpacing(6);
vboxLayout1->setContentsMargins(11, 11, 11, 11);
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
ckMatchCase = new QCheckBox(groupBox);
- ckMatchCase->setObjectName(QStringLiteral("ckMatchCase"));
+ ckMatchCase->setObjectName(QString::fromUtf8("ckMatchCase"));
vboxLayout1->addWidget(ckMatchCase);
ckMarkFinished = new QCheckBox(groupBox);
- ckMarkFinished->setObjectName(QStringLiteral("ckMarkFinished"));
+ ckMarkFinished->setObjectName(QString::fromUtf8("ckMarkFinished"));
vboxLayout1->addWidget(ckMarkFinished);
@@ -152,26 +152,26 @@ public:
vboxLayout2 = new QVBoxLayout();
vboxLayout2->setSpacing(6);
- vboxLayout2->setObjectName(QStringLiteral("vboxLayout2"));
+ vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2"));
vboxLayout2->setContentsMargins(0, 0, 0, 0);
findNxt = new QPushButton(TranslateDialog);
- findNxt->setObjectName(QStringLiteral("findNxt"));
+ findNxt->setObjectName(QString::fromUtf8("findNxt"));
findNxt->setFlat(false);
vboxLayout2->addWidget(findNxt);
translate = new QPushButton(TranslateDialog);
- translate->setObjectName(QStringLiteral("translate"));
+ translate->setObjectName(QString::fromUtf8("translate"));
vboxLayout2->addWidget(translate);
translateAll = new QPushButton(TranslateDialog);
- translateAll->setObjectName(QStringLiteral("translateAll"));
+ translateAll->setObjectName(QString::fromUtf8("translateAll"));
vboxLayout2->addWidget(translateAll);
cancel = new QPushButton(TranslateDialog);
- cancel->setObjectName(QStringLiteral("cancel"));
+ cancel->setObjectName(QString::fromUtf8("cancel"));
vboxLayout2->addWidget(cancel);
diff --git a/tests/auto/tools/uic/baseline/translation/Dialog_without_Buttons_tr.h b/tests/auto/tools/uic/baseline/translation/Dialog_without_Buttons_tr.h
index 1da7140f97..eea7b7335d 100644
--- a/tests/auto/tools/uic/baseline/translation/Dialog_without_Buttons_tr.h
+++ b/tests/auto/tools/uic/baseline/translation/Dialog_without_Buttons_tr.h
@@ -23,7 +23,7 @@ public:
void setupUi(QDialog *Dialog)
{
if (Dialog->objectName().isEmpty())
- Dialog->setObjectName(QStringLiteral("Dialog"));
+ Dialog->setObjectName(QString::fromUtf8("Dialog"));
Dialog->resize(400, 300);
retranslateUi(Dialog);
diff --git a/tests/auto/tools/uic/baseline/translationsettings.ui.h b/tests/auto/tools/uic/baseline/translationsettings.ui.h
index 522c9bd4e0..764e3a85b6 100644
--- a/tests/auto/tools/uic/baseline/translationsettings.ui.h
+++ b/tests/auto/tools/uic/baseline/translationsettings.ui.h
@@ -36,7 +36,7 @@ public:
void setupUi(QDialog *TranslationSettings)
{
if (TranslationSettings->objectName().isEmpty())
- TranslationSettings->setObjectName(QStringLiteral("TranslationSettings"));
+ TranslationSettings->setObjectName(QString::fromUtf8("TranslationSettings"));
TranslationSettings->resize(346, 125);
vboxLayout = new QVBoxLayout(TranslationSettings);
#ifndef Q_OS_MAC
@@ -45,9 +45,9 @@ public:
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
groupBox = new QGroupBox(TranslationSettings);
- groupBox->setObjectName(QStringLiteral("groupBox"));
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
gridLayout = new QGridLayout(groupBox);
#ifndef Q_OS_MAC
gridLayout->setSpacing(6);
@@ -55,24 +55,24 @@ public:
#ifndef Q_OS_MAC
gridLayout->setContentsMargins(9, 9, 9, 9);
#endif
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
cbLanguageList = new QComboBox(groupBox);
- cbLanguageList->setObjectName(QStringLiteral("cbLanguageList"));
+ cbLanguageList->setObjectName(QString::fromUtf8("cbLanguageList"));
gridLayout->addWidget(cbLanguageList, 0, 1, 1, 1);
label = new QLabel(groupBox);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout->addWidget(label, 0, 0, 1, 1);
cbCountryList = new QComboBox(groupBox);
- cbCountryList->setObjectName(QStringLiteral("cbCountryList"));
+ cbCountryList->setObjectName(QString::fromUtf8("cbCountryList"));
gridLayout->addWidget(cbCountryList, 1, 1, 1, 1);
lblCountry = new QLabel(groupBox);
- lblCountry->setObjectName(QStringLiteral("lblCountry"));
+ lblCountry->setObjectName(QString::fromUtf8("lblCountry"));
gridLayout->addWidget(lblCountry, 1, 0, 1, 1);
@@ -80,7 +80,7 @@ public:
vboxLayout->addWidget(groupBox);
buttonBox = new QDialogButtonBox(TranslationSettings);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/treewidgeteditor.ui.h b/tests/auto/tools/uic/baseline/treewidgeteditor.ui.h
index 13957e843c..d432195648 100644
--- a/tests/auto/tools/uic/baseline/treewidgeteditor.ui.h
+++ b/tests/auto/tools/uic/baseline/treewidgeteditor.ui.h
@@ -96,34 +96,34 @@ public:
void setupUi(QDialog *qdesigner_internal__TreeWidgetEditor)
{
if (qdesigner_internal__TreeWidgetEditor->objectName().isEmpty())
- qdesigner_internal__TreeWidgetEditor->setObjectName(QStringLiteral("qdesigner_internal__TreeWidgetEditor"));
+ qdesigner_internal__TreeWidgetEditor->setObjectName(QString::fromUtf8("qdesigner_internal__TreeWidgetEditor"));
qdesigner_internal__TreeWidgetEditor->resize(619, 321);
gridLayout_3 = new QGridLayout(qdesigner_internal__TreeWidgetEditor);
- gridLayout_3->setObjectName(QStringLiteral("gridLayout_3"));
+ gridLayout_3->setObjectName(QString::fromUtf8("gridLayout_3"));
itemsBox = new QGroupBox(qdesigner_internal__TreeWidgetEditor);
- itemsBox->setObjectName(QStringLiteral("itemsBox"));
+ itemsBox->setObjectName(QString::fromUtf8("itemsBox"));
gridLayout = new QGridLayout(itemsBox);
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
treeWidget = new QTreeWidget(itemsBox);
- treeWidget->setObjectName(QStringLiteral("treeWidget"));
+ treeWidget->setObjectName(QString::fromUtf8("treeWidget"));
treeWidget->setFocusPolicy(Qt::TabFocus);
gridLayout->addWidget(treeWidget, 0, 0, 1, 1);
horizontalLayout_4 = new QHBoxLayout();
- horizontalLayout_4->setObjectName(QStringLiteral("horizontalLayout_4"));
+ horizontalLayout_4->setObjectName(QString::fromUtf8("horizontalLayout_4"));
newItemButton = new QToolButton(itemsBox);
- newItemButton->setObjectName(QStringLiteral("newItemButton"));
+ newItemButton->setObjectName(QString::fromUtf8("newItemButton"));
horizontalLayout_4->addWidget(newItemButton);
newSubItemButton = new QToolButton(itemsBox);
- newSubItemButton->setObjectName(QStringLiteral("newSubItemButton"));
+ newSubItemButton->setObjectName(QString::fromUtf8("newSubItemButton"));
horizontalLayout_4->addWidget(newSubItemButton);
deleteItemButton = new QToolButton(itemsBox);
- deleteItemButton->setObjectName(QStringLiteral("deleteItemButton"));
+ deleteItemButton->setObjectName(QString::fromUtf8("deleteItemButton"));
horizontalLayout_4->addWidget(deleteItemButton);
@@ -132,22 +132,22 @@ public:
horizontalLayout_4->addItem(spacerItem);
moveItemLeftButton = new QToolButton(itemsBox);
- moveItemLeftButton->setObjectName(QStringLiteral("moveItemLeftButton"));
+ moveItemLeftButton->setObjectName(QString::fromUtf8("moveItemLeftButton"));
horizontalLayout_4->addWidget(moveItemLeftButton);
moveItemRightButton = new QToolButton(itemsBox);
- moveItemRightButton->setObjectName(QStringLiteral("moveItemRightButton"));
+ moveItemRightButton->setObjectName(QString::fromUtf8("moveItemRightButton"));
horizontalLayout_4->addWidget(moveItemRightButton);
moveItemUpButton = new QToolButton(itemsBox);
- moveItemUpButton->setObjectName(QStringLiteral("moveItemUpButton"));
+ moveItemUpButton->setObjectName(QString::fromUtf8("moveItemUpButton"));
horizontalLayout_4->addWidget(moveItemUpButton);
moveItemDownButton = new QToolButton(itemsBox);
- moveItemDownButton->setObjectName(QStringLiteral("moveItemDownButton"));
+ moveItemDownButton->setObjectName(QString::fromUtf8("moveItemDownButton"));
horizontalLayout_4->addWidget(moveItemDownButton);
@@ -155,14 +155,14 @@ public:
gridLayout->addLayout(horizontalLayout_4, 1, 0, 1, 1);
horizontalLayout_2 = new QHBoxLayout();
- horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
+ horizontalLayout_2->setObjectName(QString::fromUtf8("horizontalLayout_2"));
label_2 = new QLabel(itemsBox);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
horizontalLayout_2->addWidget(label_2);
itemIconSelector = new qdesigner_internal::IconSelector(itemsBox);
- itemIconSelector->setObjectName(QStringLiteral("itemIconSelector"));
+ itemIconSelector->setObjectName(QString::fromUtf8("itemIconSelector"));
horizontalLayout_2->addWidget(itemIconSelector);
@@ -177,16 +177,16 @@ public:
gridLayout_3->addWidget(itemsBox, 0, 0, 1, 1);
columnsBox = new QGroupBox(qdesigner_internal__TreeWidgetEditor);
- columnsBox->setObjectName(QStringLiteral("columnsBox"));
+ columnsBox->setObjectName(QString::fromUtf8("columnsBox"));
QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(columnsBox->sizePolicy().hasHeightForWidth());
columnsBox->setSizePolicy(sizePolicy);
gridLayout_2 = new QGridLayout(columnsBox);
- gridLayout_2->setObjectName(QStringLiteral("gridLayout_2"));
+ gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
listWidget = new QListWidget(columnsBox);
- listWidget->setObjectName(QStringLiteral("listWidget"));
+ listWidget->setObjectName(QString::fromUtf8("listWidget"));
QSizePolicy sizePolicy1(QSizePolicy::Ignored, QSizePolicy::Expanding);
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
@@ -197,14 +197,14 @@ public:
gridLayout_2->addWidget(listWidget, 0, 0, 1, 1);
horizontalLayout_3 = new QHBoxLayout();
- horizontalLayout_3->setObjectName(QStringLiteral("horizontalLayout_3"));
+ horizontalLayout_3->setObjectName(QString::fromUtf8("horizontalLayout_3"));
newColumnButton = new QToolButton(columnsBox);
- newColumnButton->setObjectName(QStringLiteral("newColumnButton"));
+ newColumnButton->setObjectName(QString::fromUtf8("newColumnButton"));
horizontalLayout_3->addWidget(newColumnButton);
deleteColumnButton = new QToolButton(columnsBox);
- deleteColumnButton->setObjectName(QStringLiteral("deleteColumnButton"));
+ deleteColumnButton->setObjectName(QString::fromUtf8("deleteColumnButton"));
horizontalLayout_3->addWidget(deleteColumnButton);
@@ -213,12 +213,12 @@ public:
horizontalLayout_3->addItem(spacerItem1);
moveColumnUpButton = new QToolButton(columnsBox);
- moveColumnUpButton->setObjectName(QStringLiteral("moveColumnUpButton"));
+ moveColumnUpButton->setObjectName(QString::fromUtf8("moveColumnUpButton"));
horizontalLayout_3->addWidget(moveColumnUpButton);
moveColumnDownButton = new QToolButton(columnsBox);
- moveColumnDownButton->setObjectName(QStringLiteral("moveColumnDownButton"));
+ moveColumnDownButton->setObjectName(QString::fromUtf8("moveColumnDownButton"));
horizontalLayout_3->addWidget(moveColumnDownButton);
@@ -226,14 +226,14 @@ public:
gridLayout_2->addLayout(horizontalLayout_3, 1, 0, 1, 1);
horizontalLayout = new QHBoxLayout();
- horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
+ horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
label = new QLabel(columnsBox);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
horizontalLayout->addWidget(label);
columnIconSelector = new qdesigner_internal::IconSelector(columnsBox);
- columnIconSelector->setObjectName(QStringLiteral("columnIconSelector"));
+ columnIconSelector->setObjectName(QString::fromUtf8("columnIconSelector"));
horizontalLayout->addWidget(columnIconSelector);
@@ -248,7 +248,7 @@ public:
gridLayout_3->addWidget(columnsBox, 0, 1, 1, 1);
buttonBox = new QDialogButtonBox(qdesigner_internal__TreeWidgetEditor);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
diff --git a/tests/auto/tools/uic/baseline/trpreviewtool.ui.h b/tests/auto/tools/uic/baseline/trpreviewtool.ui.h
index da6e86a8ce..3fbf125a1f 100644
--- a/tests/auto/tools/uic/baseline/trpreviewtool.ui.h
+++ b/tests/auto/tools/uic/baseline/trpreviewtool.ui.h
@@ -79,58 +79,58 @@ public:
void setupUi(QMainWindow *TrPreviewToolClass)
{
if (TrPreviewToolClass->objectName().isEmpty())
- TrPreviewToolClass->setObjectName(QStringLiteral("TrPreviewToolClass"));
+ TrPreviewToolClass->setObjectName(QString::fromUtf8("TrPreviewToolClass"));
TrPreviewToolClass->resize(593, 466);
actionOpenForm = new QAction(TrPreviewToolClass);
- actionOpenForm->setObjectName(QStringLiteral("actionOpenForm"));
+ actionOpenForm->setObjectName(QString::fromUtf8("actionOpenForm"));
const QIcon icon = QIcon(QString::fromUtf8(":/images/open_form.png"));
actionOpenForm->setIcon(icon);
actionLoadTranslation = new QAction(TrPreviewToolClass);
- actionLoadTranslation->setObjectName(QStringLiteral("actionLoadTranslation"));
+ actionLoadTranslation->setObjectName(QString::fromUtf8("actionLoadTranslation"));
const QIcon icon1 = QIcon(QString::fromUtf8(":/images/load_translation.png"));
actionLoadTranslation->setIcon(icon1);
actionReloadTranslations = new QAction(TrPreviewToolClass);
- actionReloadTranslations->setObjectName(QStringLiteral("actionReloadTranslations"));
+ actionReloadTranslations->setObjectName(QString::fromUtf8("actionReloadTranslations"));
const QIcon icon2 = QIcon(QString::fromUtf8(":/images/reload_translations.png"));
actionReloadTranslations->setIcon(icon2);
actionClose = new QAction(TrPreviewToolClass);
- actionClose->setObjectName(QStringLiteral("actionClose"));
+ actionClose->setObjectName(QString::fromUtf8("actionClose"));
actionAbout = new QAction(TrPreviewToolClass);
- actionAbout->setObjectName(QStringLiteral("actionAbout"));
+ actionAbout->setObjectName(QString::fromUtf8("actionAbout"));
actionAbout_Qt = new QAction(TrPreviewToolClass);
- actionAbout_Qt->setObjectName(QStringLiteral("actionAbout_Qt"));
+ actionAbout_Qt->setObjectName(QString::fromUtf8("actionAbout_Qt"));
centralWidget = new QWidget(TrPreviewToolClass);
- centralWidget->setObjectName(QStringLiteral("centralWidget"));
+ centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
TrPreviewToolClass->setCentralWidget(centralWidget);
menuBar = new QMenuBar(TrPreviewToolClass);
- menuBar->setObjectName(QStringLiteral("menuBar"));
+ menuBar->setObjectName(QString::fromUtf8("menuBar"));
menuBar->setGeometry(QRect(0, 0, 593, 21));
menuView = new QMenu(menuBar);
- menuView->setObjectName(QStringLiteral("menuView"));
+ menuView->setObjectName(QString::fromUtf8("menuView"));
menuViewViews = new QMenu(menuView);
- menuViewViews->setObjectName(QStringLiteral("menuViewViews"));
+ menuViewViews->setObjectName(QString::fromUtf8("menuViewViews"));
menuHelp = new QMenu(menuBar);
- menuHelp->setObjectName(QStringLiteral("menuHelp"));
+ menuHelp->setObjectName(QString::fromUtf8("menuHelp"));
menuFile = new QMenu(menuBar);
- menuFile->setObjectName(QStringLiteral("menuFile"));
+ menuFile->setObjectName(QString::fromUtf8("menuFile"));
TrPreviewToolClass->setMenuBar(menuBar);
mainToolBar = new QToolBar(TrPreviewToolClass);
- mainToolBar->setObjectName(QStringLiteral("mainToolBar"));
+ mainToolBar->setObjectName(QString::fromUtf8("mainToolBar"));
mainToolBar->setOrientation(Qt::Horizontal);
TrPreviewToolClass->addToolBar(static_cast<Qt::ToolBarArea>(4), mainToolBar);
statusBar = new QStatusBar(TrPreviewToolClass);
- statusBar->setObjectName(QStringLiteral("statusBar"));
+ statusBar->setObjectName(QString::fromUtf8("statusBar"));
TrPreviewToolClass->setStatusBar(statusBar);
dwForms = new QDockWidget(TrPreviewToolClass);
- dwForms->setObjectName(QStringLiteral("dwForms"));
+ dwForms->setObjectName(QString::fromUtf8("dwForms"));
dockWidgetContents = new QWidget();
- dockWidgetContents->setObjectName(QStringLiteral("dockWidgetContents"));
+ dockWidgetContents->setObjectName(QString::fromUtf8("dockWidgetContents"));
vboxLayout = new QVBoxLayout(dockWidgetContents);
vboxLayout->setSpacing(0);
vboxLayout->setContentsMargins(0, 0, 0, 0);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
viewForms = new QListView(dockWidgetContents);
- viewForms->setObjectName(QStringLiteral("viewForms"));
+ viewForms->setObjectName(QString::fromUtf8("viewForms"));
viewForms->setEditTriggers(QAbstractItemView::NoEditTriggers);
viewForms->setAlternatingRowColors(true);
viewForms->setUniformItemSizes(true);
diff --git a/tests/auto/tools/uic/baseline/validators.ui.h b/tests/auto/tools/uic/baseline/validators.ui.h
index a28f9e8390..d0ae777f65 100644
--- a/tests/auto/tools/uic/baseline/validators.ui.h
+++ b/tests/auto/tools/uic/baseline/validators.ui.h
@@ -1,7 +1,7 @@
/********************************************************************************
** Form generated from reading UI file 'validators.ui'
**
-** Created by: Qt User Interface Compiler version 5.10.0
+** Created by: Qt User Interface Compiler version 5.12.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
@@ -76,7 +76,7 @@ public:
void setupUi(QWidget *ValidatorsForm)
{
if (ValidatorsForm->objectName().isEmpty())
- ValidatorsForm->setObjectName(QStringLiteral("ValidatorsForm"));
+ ValidatorsForm->setObjectName(QString::fromUtf8("ValidatorsForm"));
ValidatorsForm->resize(526, 668);
vboxLayout = new QVBoxLayout(ValidatorsForm);
#ifndef Q_OS_MAC
@@ -85,7 +85,7 @@ public:
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
hboxLayout = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout->setSpacing(6);
@@ -93,9 +93,9 @@ public:
#ifndef Q_OS_MAC
hboxLayout->setContentsMargins(0, 0, 0, 0);
#endif
- hboxLayout->setObjectName(QStringLiteral("hboxLayout"));
+ hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
localeSelector = new LocaleSelector(ValidatorsForm);
- localeSelector->setObjectName(QStringLiteral("localeSelector"));
+ localeSelector->setObjectName(QString::fromUtf8("localeSelector"));
hboxLayout->addWidget(localeSelector);
@@ -107,7 +107,7 @@ public:
vboxLayout->addLayout(hboxLayout);
groupBox = new QGroupBox(ValidatorsForm);
- groupBox->setObjectName(QStringLiteral("groupBox"));
+ groupBox->setObjectName(QString::fromUtf8("groupBox"));
vboxLayout1 = new QVBoxLayout(groupBox);
#ifndef Q_OS_MAC
vboxLayout1->setSpacing(6);
@@ -115,7 +115,7 @@ public:
#ifndef Q_OS_MAC
vboxLayout1->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout1->setObjectName(QStringLiteral("vboxLayout1"));
+ vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
hboxLayout1 = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout1->setSpacing(6);
@@ -123,7 +123,7 @@ public:
#ifndef Q_OS_MAC
hboxLayout1->setContentsMargins(0, 0, 0, 0);
#endif
- hboxLayout1->setObjectName(QStringLiteral("hboxLayout1"));
+ hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
gridLayout = new QGridLayout();
#ifndef Q_OS_MAC
gridLayout->setSpacing(6);
@@ -131,15 +131,15 @@ public:
#ifndef Q_OS_MAC
gridLayout->setContentsMargins(0, 0, 0, 0);
#endif
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
label = new QLabel(groupBox);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
label->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
gridLayout->addWidget(label, 0, 0, 1, 1);
minVal = new QSpinBox(groupBox);
- minVal->setObjectName(QStringLiteral("minVal"));
+ minVal->setObjectName(QString::fromUtf8("minVal"));
QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
sizePolicy.setHorizontalStretch(1);
sizePolicy.setVerticalStretch(0);
@@ -151,13 +151,13 @@ public:
gridLayout->addWidget(minVal, 0, 1, 1, 1);
label_2 = new QLabel(groupBox);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
label_2->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
gridLayout->addWidget(label_2, 1, 0, 1, 1);
maxVal = new QSpinBox(groupBox);
- maxVal->setObjectName(QStringLiteral("maxVal"));
+ maxVal->setObjectName(QString::fromUtf8("maxVal"));
sizePolicy.setHeightForWidth(maxVal->sizePolicy().hasHeightForWidth());
maxVal->setSizePolicy(sizePolicy);
maxVal->setMinimum(-1000000);
@@ -170,7 +170,7 @@ public:
hboxLayout1->addLayout(gridLayout);
frame = new QFrame(groupBox);
- frame->setObjectName(QStringLiteral("frame"));
+ frame->setObjectName(QString::fromUtf8("frame"));
frame->setFrameShape(QFrame::StyledPanel);
frame->setFrameShadow(QFrame::Sunken);
vboxLayout2 = new QVBoxLayout(frame);
@@ -180,9 +180,9 @@ public:
#ifndef Q_OS_MAC
vboxLayout2->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout2->setObjectName(QStringLiteral("vboxLayout2"));
+ vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2"));
ledWidget = new LEDWidget(frame);
- ledWidget->setObjectName(QStringLiteral("ledWidget"));
+ ledWidget->setObjectName(QString::fromUtf8("ledWidget"));
QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Fixed);
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
@@ -194,7 +194,7 @@ public:
vboxLayout2->addWidget(ledWidget);
label_7 = new QLabel(frame);
- label_7->setObjectName(QStringLiteral("label_7"));
+ label_7->setObjectName(QString::fromUtf8("label_7"));
vboxLayout2->addWidget(label_7);
@@ -209,7 +209,7 @@ public:
vboxLayout1->addItem(spacerItem1);
editor = new QLineEdit(groupBox);
- editor->setObjectName(QStringLiteral("editor"));
+ editor->setObjectName(QString::fromUtf8("editor"));
vboxLayout1->addWidget(editor);
@@ -217,7 +217,7 @@ public:
vboxLayout->addWidget(groupBox);
groupBox_2 = new QGroupBox(ValidatorsForm);
- groupBox_2->setObjectName(QStringLiteral("groupBox_2"));
+ groupBox_2->setObjectName(QString::fromUtf8("groupBox_2"));
vboxLayout3 = new QVBoxLayout(groupBox_2);
#ifndef Q_OS_MAC
vboxLayout3->setSpacing(6);
@@ -225,7 +225,7 @@ public:
#ifndef Q_OS_MAC
vboxLayout3->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout3->setObjectName(QStringLiteral("vboxLayout3"));
+ vboxLayout3->setObjectName(QString::fromUtf8("vboxLayout3"));
hboxLayout2 = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout2->setSpacing(6);
@@ -233,7 +233,7 @@ public:
#ifndef Q_OS_MAC
hboxLayout2->setContentsMargins(0, 0, 0, 0);
#endif
- hboxLayout2->setObjectName(QStringLiteral("hboxLayout2"));
+ hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2"));
gridLayout1 = new QGridLayout();
#ifndef Q_OS_MAC
gridLayout1->setSpacing(6);
@@ -241,25 +241,25 @@ public:
#ifndef Q_OS_MAC
gridLayout1->setContentsMargins(0, 0, 0, 0);
#endif
- gridLayout1->setObjectName(QStringLiteral("gridLayout1"));
+ gridLayout1->setObjectName(QString::fromUtf8("gridLayout1"));
label_3 = new QLabel(groupBox_2);
- label_3->setObjectName(QStringLiteral("label_3"));
+ label_3->setObjectName(QString::fromUtf8("label_3"));
label_3->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
gridLayout1->addWidget(label_3, 0, 0, 1, 1);
doubleMinVal = new QDoubleSpinBox(groupBox_2);
- doubleMinVal->setObjectName(QStringLiteral("doubleMinVal"));
+ doubleMinVal->setObjectName(QString::fromUtf8("doubleMinVal"));
sizePolicy.setHeightForWidth(doubleMinVal->sizePolicy().hasHeightForWidth());
doubleMinVal->setSizePolicy(sizePolicy);
- doubleMinVal->setMinimum(-100000);
- doubleMinVal->setMaximum(100000);
- doubleMinVal->setValue(0);
+ doubleMinVal->setMinimum(-100000.000000000000000);
+ doubleMinVal->setMaximum(100000.000000000000000);
+ doubleMinVal->setValue(0.000000000000000);
gridLayout1->addWidget(doubleMinVal, 0, 1, 1, 1);
label_5 = new QLabel(groupBox_2);
- label_5->setObjectName(QStringLiteral("label_5"));
+ label_5->setObjectName(QString::fromUtf8("label_5"));
label_5->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
gridLayout1->addWidget(label_5, 0, 2, 1, 1);
@@ -267,34 +267,34 @@ public:
doubleFormat = new QComboBox(groupBox_2);
doubleFormat->addItem(QString());
doubleFormat->addItem(QString());
- doubleFormat->setObjectName(QStringLiteral("doubleFormat"));
+ doubleFormat->setObjectName(QString::fromUtf8("doubleFormat"));
gridLayout1->addWidget(doubleFormat, 0, 3, 1, 1);
label_4 = new QLabel(groupBox_2);
- label_4->setObjectName(QStringLiteral("label_4"));
+ label_4->setObjectName(QString::fromUtf8("label_4"));
label_4->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
gridLayout1->addWidget(label_4, 1, 0, 1, 1);
doubleMaxVal = new QDoubleSpinBox(groupBox_2);
- doubleMaxVal->setObjectName(QStringLiteral("doubleMaxVal"));
+ doubleMaxVal->setObjectName(QString::fromUtf8("doubleMaxVal"));
sizePolicy.setHeightForWidth(doubleMaxVal->sizePolicy().hasHeightForWidth());
doubleMaxVal->setSizePolicy(sizePolicy);
- doubleMaxVal->setMinimum(-100000);
- doubleMaxVal->setMaximum(100000);
- doubleMaxVal->setValue(1000);
+ doubleMaxVal->setMinimum(-100000.000000000000000);
+ doubleMaxVal->setMaximum(100000.000000000000000);
+ doubleMaxVal->setValue(1000.000000000000000);
gridLayout1->addWidget(doubleMaxVal, 1, 1, 1, 1);
label_6 = new QLabel(groupBox_2);
- label_6->setObjectName(QStringLiteral("label_6"));
+ label_6->setObjectName(QString::fromUtf8("label_6"));
label_6->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
gridLayout1->addWidget(label_6, 1, 2, 1, 1);
doubleDecimals = new QSpinBox(groupBox_2);
- doubleDecimals->setObjectName(QStringLiteral("doubleDecimals"));
+ doubleDecimals->setObjectName(QString::fromUtf8("doubleDecimals"));
doubleDecimals->setValue(2);
gridLayout1->addWidget(doubleDecimals, 1, 3, 1, 1);
@@ -303,7 +303,7 @@ public:
hboxLayout2->addLayout(gridLayout1);
frame_2 = new QFrame(groupBox_2);
- frame_2->setObjectName(QStringLiteral("frame_2"));
+ frame_2->setObjectName(QString::fromUtf8("frame_2"));
frame_2->setFrameShape(QFrame::StyledPanel);
frame_2->setFrameShadow(QFrame::Sunken);
vboxLayout4 = new QVBoxLayout(frame_2);
@@ -313,16 +313,16 @@ public:
#ifndef Q_OS_MAC
vboxLayout4->setContentsMargins(9, 9, 9, 9);
#endif
- vboxLayout4->setObjectName(QStringLiteral("vboxLayout4"));
+ vboxLayout4->setObjectName(QString::fromUtf8("vboxLayout4"));
doubleLedWidget = new LEDWidget(frame_2);
- doubleLedWidget->setObjectName(QStringLiteral("doubleLedWidget"));
+ doubleLedWidget->setObjectName(QString::fromUtf8("doubleLedWidget"));
doubleLedWidget->setPixmap(QPixmap(QString::fromUtf8(":/ledoff.png")));
doubleLedWidget->setAlignment(Qt::AlignCenter);
vboxLayout4->addWidget(doubleLedWidget);
label_8 = new QLabel(frame_2);
- label_8->setObjectName(QStringLiteral("label_8"));
+ label_8->setObjectName(QString::fromUtf8("label_8"));
vboxLayout4->addWidget(label_8);
@@ -337,7 +337,7 @@ public:
vboxLayout3->addItem(spacerItem2);
doubleEditor = new QLineEdit(groupBox_2);
- doubleEditor->setObjectName(QStringLiteral("doubleEditor"));
+ doubleEditor->setObjectName(QString::fromUtf8("doubleEditor"));
vboxLayout3->addWidget(doubleEditor);
@@ -353,13 +353,13 @@ public:
hboxLayout3->setSpacing(6);
#endif
hboxLayout3->setContentsMargins(0, 0, 0, 0);
- hboxLayout3->setObjectName(QStringLiteral("hboxLayout3"));
+ hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3"));
spacerItem4 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout3->addItem(spacerItem4);
pushButton = new QPushButton(ValidatorsForm);
- pushButton->setObjectName(QStringLiteral("pushButton"));
+ pushButton->setObjectName(QString::fromUtf8("pushButton"));
hboxLayout3->addWidget(pushButton);
diff --git a/tests/auto/tools/uic/baseline/wateringconfigdialog.ui.h b/tests/auto/tools/uic/baseline/wateringconfigdialog.ui.h
index 1254eee3f7..d6f7ff5526 100644
--- a/tests/auto/tools/uic/baseline/wateringconfigdialog.ui.h
+++ b/tests/auto/tools/uic/baseline/wateringconfigdialog.ui.h
@@ -64,14 +64,14 @@ public:
void setupUi(QDialog *WateringConfigDialog)
{
if (WateringConfigDialog->objectName().isEmpty())
- WateringConfigDialog->setObjectName(QStringLiteral("WateringConfigDialog"));
+ WateringConfigDialog->setObjectName(QString::fromUtf8("WateringConfigDialog"));
WateringConfigDialog->resize(334, 550);
vboxLayout = new QVBoxLayout(WateringConfigDialog);
- vboxLayout->setObjectName(QStringLiteral("vboxLayout"));
+ vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
gridLayout = new QGridLayout();
- gridLayout->setObjectName(QStringLiteral("gridLayout"));
+ gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
label_3 = new QLabel(WateringConfigDialog);
- label_3->setObjectName(QStringLiteral("label_3"));
+ label_3->setObjectName(QString::fromUtf8("label_3"));
gridLayout->addWidget(label_3, 0, 0, 1, 1);
@@ -82,7 +82,7 @@ public:
plantComboBox->addItem(QString());
plantComboBox->addItem(QString());
plantComboBox->addItem(QString());
- plantComboBox->setObjectName(QStringLiteral("plantComboBox"));
+ plantComboBox->setObjectName(QString::fromUtf8("plantComboBox"));
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
@@ -96,12 +96,12 @@ public:
gridLayout->addItem(spacerItem, 1, 0, 1, 1);
label_2 = new QLabel(WateringConfigDialog);
- label_2->setObjectName(QStringLiteral("label_2"));
+ label_2->setObjectName(QString::fromUtf8("label_2"));
gridLayout->addWidget(label_2, 2, 0, 1, 1);
temperatureCheckBox = new QCheckBox(WateringConfigDialog);
- temperatureCheckBox->setObjectName(QStringLiteral("temperatureCheckBox"));
+ temperatureCheckBox->setObjectName(QString::fromUtf8("temperatureCheckBox"));
gridLayout->addWidget(temperatureCheckBox, 3, 1, 1, 3);
@@ -110,7 +110,7 @@ public:
gridLayout->addItem(spacerItem1, 4, 1, 1, 1);
temperatureSpinBox = new QSpinBox(WateringConfigDialog);
- temperatureSpinBox->setObjectName(QStringLiteral("temperatureSpinBox"));
+ temperatureSpinBox->setObjectName(QString::fromUtf8("temperatureSpinBox"));
temperatureSpinBox->setEnabled(false);
temperatureSpinBox->setMinimum(10);
temperatureSpinBox->setMaximum(60);
@@ -123,7 +123,7 @@ public:
gridLayout->addItem(spacerItem2, 4, 3, 1, 1);
rainCheckBox = new QCheckBox(WateringConfigDialog);
- rainCheckBox->setObjectName(QStringLiteral("rainCheckBox"));
+ rainCheckBox->setObjectName(QString::fromUtf8("rainCheckBox"));
gridLayout->addWidget(rainCheckBox, 5, 1, 1, 3);
@@ -132,7 +132,7 @@ public:
gridLayout->addItem(spacerItem3, 6, 1, 1, 1);
rainSpinBox = new QSpinBox(WateringConfigDialog);
- rainSpinBox->setObjectName(QStringLiteral("rainSpinBox"));
+ rainSpinBox->setObjectName(QString::fromUtf8("rainSpinBox"));
rainSpinBox->setEnabled(false);
rainSpinBox->setMinimum(1);
@@ -147,22 +147,22 @@ public:
gridLayout->addItem(spacerItem5, 7, 2, 1, 1);
label = new QLabel(WateringConfigDialog);
- label->setObjectName(QStringLiteral("label"));
+ label->setObjectName(QString::fromUtf8("label"));
gridLayout->addWidget(label, 8, 0, 1, 1);
startTimeEdit = new QTimeEdit(WateringConfigDialog);
- startTimeEdit->setObjectName(QStringLiteral("startTimeEdit"));
+ startTimeEdit->setObjectName(QString::fromUtf8("startTimeEdit"));
gridLayout->addWidget(startTimeEdit, 8, 1, 1, 3);
label_4 = new QLabel(WateringConfigDialog);
- label_4->setObjectName(QStringLiteral("label_4"));
+ label_4->setObjectName(QString::fromUtf8("label_4"));
gridLayout->addWidget(label_4, 9, 0, 1, 1);
amountSpinBox = new QSpinBox(WateringConfigDialog);
- amountSpinBox->setObjectName(QStringLiteral("amountSpinBox"));
+ amountSpinBox->setObjectName(QString::fromUtf8("amountSpinBox"));
amountSpinBox->setMinimum(100);
amountSpinBox->setMaximum(10000);
amountSpinBox->setSingleStep(100);
@@ -171,7 +171,7 @@ public:
gridLayout->addWidget(amountSpinBox, 9, 1, 1, 3);
label_5 = new QLabel(WateringConfigDialog);
- label_5->setObjectName(QStringLiteral("label_5"));
+ label_5->setObjectName(QString::fromUtf8("label_5"));
gridLayout->addWidget(label_5, 10, 0, 1, 1);
@@ -180,17 +180,17 @@ public:
sourceComboBox->addItem(QString());
sourceComboBox->addItem(QString());
sourceComboBox->addItem(QString());
- sourceComboBox->setObjectName(QStringLiteral("sourceComboBox"));
+ sourceComboBox->setObjectName(QString::fromUtf8("sourceComboBox"));
gridLayout->addWidget(sourceComboBox, 10, 1, 1, 3);
label_6 = new QLabel(WateringConfigDialog);
- label_6->setObjectName(QStringLiteral("label_6"));
+ label_6->setObjectName(QString::fromUtf8("label_6"));
gridLayout->addWidget(label_6, 11, 0, 1, 1);
filterCheckBox = new QCheckBox(WateringConfigDialog);
- filterCheckBox->setObjectName(QStringLiteral("filterCheckBox"));
+ filterCheckBox->setObjectName(QString::fromUtf8("filterCheckBox"));
gridLayout->addWidget(filterCheckBox, 11, 1, 1, 2);
@@ -206,18 +206,18 @@ public:
vboxLayout->addLayout(gridLayout);
gridLayout1 = new QGridLayout();
- gridLayout1->setObjectName(QStringLiteral("gridLayout1"));
+ gridLayout1->setObjectName(QString::fromUtf8("gridLayout1"));
spacerItem8 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
gridLayout1->addItem(spacerItem8, 0, 1, 1, 1);
helpBrowser = new HelpBrowser(WateringConfigDialog);
- helpBrowser->setObjectName(QStringLiteral("helpBrowser"));
+ helpBrowser->setObjectName(QString::fromUtf8("helpBrowser"));
gridLayout1->addWidget(helpBrowser, 1, 0, 1, 2);
helpLabel = new QLabel(WateringConfigDialog);
- helpLabel->setObjectName(QStringLiteral("helpLabel"));
+ helpLabel->setObjectName(QString::fromUtf8("helpLabel"));
gridLayout1->addWidget(helpLabel, 0, 0, 1, 1);
@@ -225,14 +225,14 @@ public:
vboxLayout->addLayout(gridLayout1);
line = new QFrame(WateringConfigDialog);
- line->setObjectName(QStringLiteral("line"));
+ line->setObjectName(QString::fromUtf8("line"));
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
vboxLayout->addWidget(line);
buttonBox = new QDialogButtonBox(WateringConfigDialog);
- buttonBox->setObjectName(QStringLiteral("buttonBox"));
+ buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok);
diff --git a/tests/auto/widgets/dialogs/dialogs.pro b/tests/auto/widgets/dialogs/dialogs.pro
index cf548f2dea..e0ebe78f33 100644
--- a/tests/auto/widgets/dialogs/dialogs.pro
+++ b/tests/auto/widgets/dialogs/dialogs.pro
@@ -18,3 +18,4 @@ SUBDIRS=\
mac:qinputdialog.CONFIG += no_check_target # QTBUG-25496
mingw: SUBDIRS -= qfilesystemmodel # QTBUG-29403
+winrt: SUBDIRS -= qfiledialog qfiledialog2 qmessagebox # QTBUG-68297
diff --git a/tests/auto/widgets/dialogs/qcolordialog/qcolordialog.pro b/tests/auto/widgets/dialogs/qcolordialog/qcolordialog.pro
index c8ddedb401..563db6e887 100644
--- a/tests/auto/widgets/dialogs/qcolordialog/qcolordialog.pro
+++ b/tests/auto/widgets/dialogs/qcolordialog/qcolordialog.pro
@@ -2,5 +2,3 @@ CONFIG += testcase
TARGET = tst_qcolordialog
QT += widgets testlib
SOURCES += tst_qcolordialog.cpp
-
-linux*: CONFIG += insignificant_test # Crashes on different Linux distros
diff --git a/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp b/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp
index 0df0544a06..6a0ad4b3a4 100644
--- a/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp
+++ b/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp
@@ -84,6 +84,9 @@ void tst_QColorDialog::testNativeActiveModalWidget()
// Check that QApplication::activeModalWidget retruns the
// color dialog when it is executing, even when using a native
// dialog:
+#if defined(Q_OS_LINUX)
+ QSKIP("This test crashes sometimes. Although rarely, but it happens. See QTBUG-50842.");
+#endif
TestNativeDialog d;
QTimer::singleShot(1000, &d, SLOT(hide()));
d.exec();
@@ -121,6 +124,9 @@ void tst_QColorDialog::testGetRgba()
void tst_QColorDialog::defaultOkButton()
{
+#if defined(Q_OS_LINUX)
+ QSKIP("This test crashes sometimes. Although rarely, but it happens. See QTBUG-50842.");
+#endif
QTimer::singleShot(4000, qApp, SLOT(quit()));
QTimer::singleShot(0, this, SLOT(testGetRgba()));
qApp->exec();
diff --git a/tests/auto/widgets/dialogs/qdialog/BLACKLIST b/tests/auto/widgets/dialogs/qdialog/BLACKLIST
index 3da7337784..dd6a8bfff9 100644
--- a/tests/auto/widgets/dialogs/qdialog/BLACKLIST
+++ b/tests/auto/widgets/dialogs/qdialog/BLACKLIST
@@ -1,2 +1,4 @@
[snapToDefaultButton]
osx
+[showFullScreen]
+osx-10.13 ci
diff --git a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
index 7e246b5366..afe49368ae 100644
--- a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
+++ b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
@@ -369,6 +369,10 @@ void tst_QDialog::showAsTool()
testWidget.activateWindow();
QVERIFY(QTest::qWaitForWindowActive(&testWidget));
dialog.exec();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "As winrt does not support child widgets, the dialog is being activated"
+ "together with the main widget.", Continue);
+#endif
if (testWidget.style()->styleHint(QStyle::SH_Widget_ShareActivation, 0, &testWidget)) {
QCOMPARE(dialog.wasActive(), true);
} else {
@@ -551,10 +555,11 @@ void tst_QDialog::snapToDefaultButton()
#ifdef QT_NO_CURSOR
QSKIP("Test relies on there being a cursor");
#else
- if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
- QSKIP("Wayland: Wayland does not support setting the cursor position.");
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)
+ || !QGuiApplication::platformName().compare(QLatin1String("winrt"), Qt::CaseInsensitive))
+ QSKIP("This platform does not support setting the cursor position.");
- const QRect dialogGeometry(QApplication::desktop()->availableGeometry().topLeft()
+ const QRect dialogGeometry(QGuiApplication::primaryScreen()->availableGeometry().topLeft()
+ QPoint(100, 100), QSize(200, 200));
const QPoint startingPos = dialogGeometry.bottomRight() + QPoint(100, 100);
QCursor::setPos(startingPos);
diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
index 47d63b7d53..ae8e4f7e04 100644
--- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
@@ -49,6 +49,7 @@
#include <qsortfilterproxymodel.h>
#include <qlineedit.h>
#include <qlayout.h>
+#include <qtemporarydir.h>
#include <private/qfiledialog_p.h>
#if defined QT_BUILD_INTERNAL
#include <private/qsidebar_p.h>
@@ -933,7 +934,6 @@ void tst_QFiledialog::selectFiles()
QSignalSpy spyDirectoryEntered(&fd, SIGNAL(directoryEntered(QString)));
QSignalSpy spyFilesSelected(&fd, SIGNAL(filesSelected(QStringList)));
QSignalSpy spyFilterSelected(&fd, SIGNAL(filterSelected(QString)));
- fd.show();
fd.setFileMode(QFileDialog::ExistingFiles);
QString filesPath = fd.directory().absolutePath();
@@ -1311,57 +1311,116 @@ void tst_QFiledialog::saveButtonText()
QCOMPARE(button->text(), caption);
}
+// Predicate for use with QTRY_VERIFY() that checks whether the file dialog list
+// has been populated (contains an entry).
+class DirPopulatedPredicate
+{
+public:
+ explicit DirPopulatedPredicate(QListView *list, const QString &needle) :
+ m_list(list), m_needle(needle) {}
+
+ operator bool() const
+ {
+ const auto model = m_list->model();
+ const auto root = m_list->rootIndex();
+ for (int r = 0, count = model->rowCount(root); r < count; ++r) {
+ if (m_needle == model->index(r, 0, root).data(Qt::DisplayRole).toString())
+ return true;
+ }
+ return false;
+ }
+
+private:
+ QListView *m_list;
+ QString m_needle;
+};
+
+// A predicate for use with QTRY_VERIFY() that ensures an entry of the file dialog
+// list is selected by pressing cursor down.
+class SelectDirTestPredicate
+{
+public:
+ explicit SelectDirTestPredicate(QListView *list, const QString &needle) :
+ m_list(list), m_needle(needle) {}
+
+ operator bool() const
+ {
+ if (m_needle == m_list->currentIndex().data(Qt::DisplayRole).toString())
+ return true;
+ QCoreApplication::processEvents();
+ QTest::keyClick(m_list, Qt::Key_Down);
+ return false;
+ }
+
+private:
+ QListView *m_list;
+ QString m_needle;
+};
+
void tst_QFiledialog::clearLineEdit()
{
- QFileDialog fd(0, "caption", "foo");
+ // Play it really safe by creating a directory which should show first in
+ // a temporary dir
+ QTemporaryDir workDir(QDir::tempPath() + QLatin1String("/tst_qfd_clearXXXXXX"));
+ QVERIFY2(workDir.isValid(), qPrintable(workDir.errorString()));
+ const QString workDirPath = workDir.path();
+ const QString dirName = QLatin1String("aaaaa");
+ QVERIFY(QDir(workDirPath).mkdir(dirName));
+
+ QFileDialog fd(nullptr,
+ QLatin1String(QTest::currentTestFunction()) + QLatin1String(" AnyFile"),
+ "foo");
fd.setViewMode(QFileDialog::List);
fd.setFileMode(QFileDialog::AnyFile);
fd.show();
- //play it really safe by creating a directory
- QDir::home().mkdir("_____aaaaaaaaaaaaaaaaaaaaaa");
-
QLineEdit *lineEdit = fd.findChild<QLineEdit*>("fileNameEdit");
QVERIFY(lineEdit);
QCOMPARE(lineEdit->text(), QLatin1String("foo"));
- fd.setDirectory(QDir::home());
QListView* list = fd.findChild<QListView*>("listView");
QVERIFY(list);
- // saving a file the text shouldn't be cleared
- fd.setDirectory(QDir::home());
+ // When in AnyFile mode, lineEdit's text shouldn't be cleared when entering
+ // a directory by activating one in the list
+ fd.setDirectory(workDirPath);
+ DirPopulatedPredicate dirPopulated(list, dirName);
+ QTRY_VERIFY(dirPopulated);
#ifdef QT_KEYPAD_NAVIGATION
list->setEditFocus(true);
#endif
- QTest::keyClick(list, Qt::Key_Down);
+
+ SelectDirTestPredicate selectTestDir(list, dirName);
+ QTRY_VERIFY(selectTestDir);
+
#ifndef Q_OS_MAC
QTest::keyClick(list, Qt::Key_Return);
#else
QTest::keyClick(list, Qt::Key_O, Qt::ControlModifier);
#endif
- QTRY_VERIFY(fd.directory().absolutePath() != QDir::home().absolutePath());
+ QTRY_VERIFY(fd.directory().absolutePath() != workDirPath);
QVERIFY(!lineEdit->text().isEmpty());
- // selecting a dir the text should be cleared so one can just hit ok
+ // When in Directory mode, lineEdit's text should be cleared when entering
+ // a directory by activating one in the list so one can just hit ok
// and it selects that directory
fd.setFileMode(QFileDialog::Directory);
- fd.setDirectory(QDir::home());
+ fd.setWindowTitle(QLatin1String(QTest::currentTestFunction()) + QLatin1String(" Directory"));
+ fd.setDirectory(workDirPath);
+ QTRY_VERIFY(dirPopulated);
+
+ QTRY_VERIFY(selectTestDir);
- QTest::keyClick(list, Qt::Key_Down);
#ifndef Q_OS_MAC
QTest::keyClick(list, Qt::Key_Return);
#else
QTest::keyClick(list, Qt::Key_O, Qt::ControlModifier);
#endif
- QTRY_VERIFY(fd.directory().absolutePath() != QDir::home().absolutePath());
+ QTRY_VERIFY(fd.directory().absolutePath() != workDirPath);
QVERIFY(lineEdit->text().isEmpty());
-
- //remove the dir
- QDir::home().rmdir("_____aaaaaaaaaaaaaaaaaaaaaa");
}
void tst_QFiledialog::enableChooseButton()
@@ -1521,7 +1580,8 @@ public:
const QWindow *window = QGuiApplication::topLevelWindows().constFirst();
const QFileDialog *fileDialog = qobject_cast<QFileDialog*>(QApplication::activeModalWidget());
- QVERIFY(fileDialog);
+ if (!fileDialog)
+ return;
// The problem in QTBUG-57193 was from a platform input context plugin that was
// connected to QWindow::focusObjectChanged(), and consequently accessed the focus
diff --git a/tests/auto/widgets/dialogs/qfiledialog2/BLACKLIST b/tests/auto/widgets/dialogs/qfiledialog2/BLACKLIST
new file mode 100644
index 0000000000..e0887d8ad1
--- /dev/null
+++ b/tests/auto/widgets/dialogs/qfiledialog2/BLACKLIST
@@ -0,0 +1,2 @@
+[QTBUG4419_lineEditSelectAll]
+osx
diff --git a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
index fca1f17a4d..8f9a8c11a7 100644
--- a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
@@ -1176,7 +1176,7 @@ void tst_QFileDialog2::QTBUG4419_lineEditSelectAll()
fd.setFileMode(QFileDialog::AnyFile);
fd.show();
- QApplication::setActiveWindow(&fd);
+ fd.activateWindow();
QVERIFY(QTest::qWaitForWindowActive(&fd));
QCOMPARE(fd.isVisible(), true);
QCOMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd));
diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
index d8a680881a..9ee5292fcb 100644
--- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
+++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
@@ -51,10 +51,15 @@
// Will try to wait for the condition while allowing event processing
// for a maximum of 5 seconds.
-#define TRY_WAIT(expr) \
+#define TRY_WAIT(expr, timedOut) \
do { \
+ *timedOut = true; \
const int step = 50; \
- for (int __i = 0; __i < 5000 && !(expr); __i+=step) { \
+ for (int __i = 0; __i < 5000; __i += step) { \
+ if (expr) { \
+ *timedOut = false; \
+ break; \
+ } \
QTest::qWait(step); \
} \
} while(0)
@@ -123,6 +128,8 @@ private slots:
protected:
bool createFiles(const QString &test_path, const QStringList &initial_files, int existingFileCount = 0, const QStringList &intial_dirs = QStringList());
+ QModelIndex prepareTestModelRoot(const QString &test_path, QSignalSpy **spy2 = nullptr,
+ QSignalSpy **spy3 = nullptr);
private:
QFileSystemModel *model;
@@ -306,7 +313,11 @@ void tst_QFileSystemModel::iconProvider()
bool tst_QFileSystemModel::createFiles(const QString &test_path, const QStringList &initial_files, int existingFileCount, const QStringList &initial_dirs)
{
//qDebug() << (model->rowCount(model->index(test_path))) << existingFileCount << initial_files;
- TRY_WAIT((model->rowCount(model->index(test_path)) == existingFileCount));
+ bool timedOut = false;
+ TRY_WAIT((model->rowCount(model->index(test_path)) == existingFileCount), &timedOut);
+ if (timedOut)
+ return false;
+
for (int i = 0; i < initial_dirs.count(); ++i) {
QDir dir(test_path);
if (!dir.exists()) {
@@ -363,23 +374,45 @@ bool tst_QFileSystemModel::createFiles(const QString &test_path, const QStringLi
return true;
}
-void tst_QFileSystemModel::rowCount()
+QModelIndex tst_QFileSystemModel::prepareTestModelRoot(const QString &test_path, QSignalSpy **spy2,
+ QSignalSpy **spy3)
{
- QString tmp = flatDirTestPath;
- QVERIFY(createFiles(tmp, QStringList()));
+ if (model->rowCount(model->index(test_path)) != 0)
+ return QModelIndex();
- QSignalSpy spy2(model, SIGNAL(rowsInserted(QModelIndex,int,int)));
- QSignalSpy spy3(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)));
+ if (spy2)
+ *spy2 = new QSignalSpy(model, &QFileSystemModel::rowsInserted);
+ if (spy3)
+ *spy3 = new QSignalSpy(model, &QFileSystemModel::rowsAboutToBeInserted);
- QStringList files = QStringList() << "b" << "d" << "f" << "h" << "j" << ".a" << ".c" << ".e" << ".g";
+ QStringList files = { "b", "d", "f", "h", "j", ".a", ".c", ".e", ".g" };
QString l = "b,d,f,h,j,.a,.c,.e,.g";
- QVERIFY(createFiles(tmp, files));
+ if (!createFiles(test_path, files))
+ return QModelIndex();
- QModelIndex root = model->setRootPath(tmp);
- QTRY_COMPARE(model->rowCount(root), 5);
- QVERIFY(spy2.count() > 0);
- QVERIFY(spy3.count() > 0);
+ QModelIndex root = model->setRootPath(test_path);
+ if (!root.isValid())
+ return QModelIndex();
+
+ bool timedOut = false;
+ TRY_WAIT(model->rowCount(root) == 5, &timedOut);
+ if (timedOut)
+ return QModelIndex();
+
+ return root;
+}
+
+void tst_QFileSystemModel::rowCount()
+{
+ const QString tmp = flatDirTestPath;
+ QSignalSpy *spy2 = nullptr;
+ QSignalSpy *spy3 = nullptr;
+ QModelIndex root = prepareTestModelRoot(flatDirTestPath, &spy2, &spy3);
+ QVERIFY(root.isValid());
+
+ QVERIFY(spy2 && spy2->count() > 0);
+ QVERIFY(spy3 && spy3->count() > 0);
}
void tst_QFileSystemModel::rowsInserted_data()
@@ -401,9 +434,9 @@ static inline QString lastEntry(const QModelIndex &root)
void tst_QFileSystemModel::rowsInserted()
{
- QString tmp = flatDirTestPath;
- rowCount();
- QModelIndex root = model->index(model->rootPath());
+ const QString tmp = flatDirTestPath;
+ QModelIndex root = prepareTestModelRoot(tmp);
+ QVERIFY(root.isValid());
QFETCH(int, ascending);
QFETCH(int, count);
@@ -454,9 +487,9 @@ void tst_QFileSystemModel::rowsRemoved_data()
void tst_QFileSystemModel::rowsRemoved()
{
- QString tmp = flatDirTestPath;
- rowCount();
- QModelIndex root = model->index(model->rootPath());
+ const QString tmp = flatDirTestPath;
+ QModelIndex root = prepareTestModelRoot(tmp);
+ QVERIFY(root.isValid());
QFETCH(int, count);
QFETCH(int, ascending);
@@ -509,9 +542,9 @@ void tst_QFileSystemModel::dataChanged()
{
QSKIP("This can't be tested right now since we don't watch files, only directories.");
- QString tmp = flatDirTestPath;
- rowCount();
- QModelIndex root = model->index(model->rootPath());
+ const QString tmp = flatDirTestPath;
+ QModelIndex root = prepareTestModelRoot(tmp);
+ QVERIFY(root.isValid());
QFETCH(int, count);
QFETCH(int, assending);
diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
index 70f5c40bcc..049468fd7c 100644
--- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
+++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
@@ -190,6 +190,8 @@ void tst_QMessageBox::sanityTest()
QSKIP("Test hangs on macOS 10.12 -- QTQAINFRA-1362");
return;
}
+#elif defined(Q_OS_WINRT)
+ QSKIP("Test hangs on winrt -- QTBUG-68297");
#endif
QMessageBox msgBox;
msgBox.setText("This is insane");
diff --git a/tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp b/tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp
index 3c189f92cc..9c5e226731 100644
--- a/tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp
+++ b/tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp
@@ -55,6 +55,9 @@ void tst_QSidebar::setUrls()
QCOMPARE(model->rowCount(), 0);
qsidebar.setUrls(urls);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "One of the URLs is not seen as valid on WinRT - QTBUG-68297", Abort);
+#endif
QCOMPARE(qsidebar.urls(), urls);
QCOMPARE(model->rowCount(), urls.count());
qsidebar.setUrls(urls);
@@ -99,6 +102,9 @@ void tst_QSidebar::addUrls()
// test < 0
qsidebar.addUrls(urls, -1);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "One of the URLs is not seen as valid on WinRT - QTBUG-68297", Abort);
+#endif
QCOMPARE(model->rowCount(), 2);
// test = 0
@@ -185,6 +191,9 @@ void tst_QSidebar::goToUrl()
QSignalSpy spy(&qsidebar, SIGNAL(goToUrl(QUrl)));
QTest::mousePress(qsidebar.viewport(), Qt::LeftButton, 0, qsidebar.visualRect(qsidebar.model()->index(0, 0)).center());
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on WinRT - QTBUG-68297", Abort);
+#endif
QCOMPARE(spy.count(), 1);
QCOMPARE((spy.value(0)).at(0).toUrl(), urls.first());
}
diff --git a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
index 6ad93b2666..a5b8646d40 100644
--- a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
+++ b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
@@ -2596,6 +2596,9 @@ void tst_QWizard::task161658_alignments()
void tst_QWizard::task177022_setFixedSize()
{
+#ifdef Q_OS_WINRT
+ QSKIP("Widgets cannot have a fixed size on WinRT.");
+#endif
int width = 300;
int height = 200;
QWizard wiz;
diff --git a/tests/auto/widgets/effects/qgraphicseffect/BLACKLIST b/tests/auto/widgets/effects/qgraphicseffect/BLACKLIST
new file mode 100644
index 0000000000..4833af527f
--- /dev/null
+++ b/tests/auto/widgets/effects/qgraphicseffect/BLACKLIST
@@ -0,0 +1,3 @@
+[prepareGeometryChangeInvalidateCache]
+opensuse
+opensuse-leap
diff --git a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
index 5b142048b5..95662a49a0 100644
--- a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
+++ b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
@@ -731,12 +731,12 @@ void tst_QGraphicsEffect::itemHasNoContents()
CustomEffect *effect = new CustomEffect;
parent->setGraphicsEffect(effect);
- QTRY_COMPARE(effect->numRepaints, 1);
+ QTRY_VERIFY(effect->numRepaints >= 1);
for (int i = 0; i < 3; ++i) {
effect->reset();
effect->update();
- QTRY_COMPARE(effect->numRepaints, 1);
+ QTRY_VERIFY(effect->numRepaints >= 1);
}
}
diff --git a/tests/auto/widgets/graphicsview/graphicsview.pro b/tests/auto/widgets/graphicsview/graphicsview.pro
index e99897a4f6..0f4c1721e3 100644
--- a/tests/auto/widgets/graphicsview/graphicsview.pro
+++ b/tests/auto/widgets/graphicsview/graphicsview.pro
@@ -30,3 +30,5 @@ SUBDIRS=\
!contains(styles, fusion):SUBDIRS -= \
qgraphicsproxywidget \
qgraphicswidget \
+
+winrt: SUBDIRS -= qgraphicsview # QTBUG-68297
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
index 6c1abaedb3..27eac03880 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -477,7 +477,7 @@ private:
void tst_QGraphicsItem::construction()
{
for (int i = 0; i < 7; ++i) {
- QGraphicsItem *item;
+ QGraphicsItem *item = nullptr;
switch (i) {
case 0:
item = new QGraphicsEllipseItem;
@@ -986,6 +986,7 @@ void tst_QGraphicsItem::inputMethodHints()
QGraphicsView view(&scene);
QApplication::setActiveWindow(&view);
view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
item->setFocus();
QTRY_VERIFY(item->hasFocus());
@@ -1036,6 +1037,7 @@ void tst_QGraphicsItem::toolTip()
view.setFixedSize(200, 200);
view.show();
QApplication::setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
{
QHelpEvent helpEvent(QEvent::ToolTip, view.viewport()->rect().topLeft(),
@@ -2204,10 +2206,11 @@ void tst_QGraphicsItem::setMatrix()
QCOMPARE(spy.count(), 3);
QList<QRectF> rlist = qvariant_cast<QList<QRectF> >(spy.last().at(0));
- QCOMPARE(rlist.size(), 3);
- QCOMPARE(rlist.at(0), rotatedRect); // From item.setMatrix() (clearing rotated rect)
- QCOMPARE(rlist.at(1), rotatedRect); // From scene.update() (updating scene rect)
- QCOMPARE(rlist.at(2), unrotatedRect); // From post-update (update current state)
+ QCOMPARE(rlist.size(), 2);
+ // From item.setMatrix() (clearing rotated rect), from scene.update() (updating scene rect),
+ // squashed into one
+ QCOMPARE(rlist.at(0), rotatedRect);
+ QCOMPARE(rlist.at(1), unrotatedRect); // From post-update (update current state)
}
static QList<QGraphicsItem *> _paintedItems;
@@ -3226,6 +3229,7 @@ void tst_QGraphicsItem::hoverEventsGenerateRepaints()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
EventTester *tester = new EventTester;
@@ -4143,10 +4147,13 @@ void tst_QGraphicsItem::ensureVisible()
void tst_QGraphicsItem::cursor()
{
QGraphicsScene scene;
- QGraphicsRectItem *item1 = scene.addRect(QRectF(0, 0, 50, 50));
- QGraphicsRectItem *item2 = scene.addRect(QRectF(0, 0, 50, 50));
- item1->setPos(-100, 0);
- item2->setPos(50, 0);
+ QWidget topLevel;
+ QGraphicsView view(&scene,&topLevel);
+ topLevel.showMaximized();
+ QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
+ view.setFixedSize(topLevel.size());
+ QGraphicsRectItem *item1 = scene.addRect(QRectF(-100, 0, 50, 50));
+ QGraphicsRectItem *item2 = scene.addRect(QRectF(50, 0, 50, 50));
QVERIFY(!item1->hasCursor());
QVERIFY(!item2->hasCursor());
@@ -4172,14 +4179,6 @@ void tst_QGraphicsItem::cursor()
item1->setCursor(Qt::IBeamCursor);
item2->setCursor(Qt::PointingHandCursor);
- QWidget topLevel;
- topLevel.resize(250, 150);
- QTestPrivate::centerOnScreen(&topLevel);
- QGraphicsView view(&scene,&topLevel);
- view.setFixedSize(200, 100);
- topLevel.show();
- QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
-
QTest::mouseMove(&view, view.rect().center());
const Qt::CursorShape viewportShape = view.viewport()->cursor().shape();
@@ -4938,6 +4937,7 @@ void tst_QGraphicsItem::sceneEventFilter()
QGraphicsView view(&scene);
view.show();
QApplication::setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QGraphicsTextItem *text1 = scene.addText(QLatin1String("Text1"));
@@ -5078,6 +5078,9 @@ void tst_QGraphicsItem::paint()
PaintTester tester2;
scene2.addItem(&tester2);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on WinRT. Figure out why - QTBUG-68297", Abort);
+#endif
//First show one paint
QTRY_COMPARE(tester2.painted, 1);
@@ -6533,6 +6536,9 @@ void tst_QGraphicsItem::ensureUpdateOnTextItem()
QVERIFY(QTest::qWaitForWindowExposed(&view));
TextItem *text1 = new TextItem(QLatin1String("123"));
scene.addItem(text1);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on WinRT. Figure out why - QTBUG-68297", Abort);
+#endif
QTRY_COMPARE(text1->updates,1);
//same bouding rect but we have to update
@@ -6802,6 +6808,7 @@ void tst_QGraphicsItem::opacity2()
MyGraphicsView view(&scene);
view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QTRY_VERIFY(view.repaints >= 1);
@@ -6874,6 +6881,7 @@ void tst_QGraphicsItem::opacityZeroUpdates()
MyGraphicsView view(&scene);
view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QTRY_VERIFY(view.repaints > 0);
@@ -6891,6 +6899,9 @@ void tst_QGraphicsItem::opacityZeroUpdates()
QRegion expectedRegion = parentDeviceBoundingRect.adjusted(-2, -2, 2, 2);
expectedRegion += childDeviceBoundingRect.adjusted(-2, -2, 2, 2);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on WinRT. Figure out why - QTBUG-68297", Abort);
+#endif
COMPARE_REGIONS(view.paintedRegion, expectedRegion);
}
@@ -7262,6 +7273,7 @@ void tst_QGraphicsItem::cacheMode()
view.resize(150, 150);
view.show();
QApplication::setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
EventTester *tester = new EventTester;
@@ -7440,6 +7452,7 @@ void tst_QGraphicsItem::cacheMode2()
view.resize(150, 150);
view.show();
QApplication::setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
EventTester *tester = new EventTester;
@@ -8093,6 +8106,7 @@ void tst_QGraphicsItem::moveLineItem()
MyGraphicsView view(&scene);
view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
view.reset();
@@ -8108,6 +8122,9 @@ void tst_QGraphicsItem::moveLineItem()
// Make sure the calculated region is correct.
item->update();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on WinRT. Figure out why - QTBUG-68297", Abort);
+#endif
QTRY_COMPARE(view.paintedRegion, expectedRegion);
view.reset();
@@ -8161,6 +8178,7 @@ void tst_QGraphicsItem::sorting()
view.setFrameStyle(0);
view.show();
qApp->setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QTRY_VERIFY(_paintedItems.count() > 0);
@@ -8197,6 +8215,7 @@ void tst_QGraphicsItem::itemHasNoContents()
QGraphicsView view(&scene);
view.show();
qApp->setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QTRY_VERIFY(!_paintedItems.isEmpty());
@@ -9204,6 +9223,7 @@ void tst_QGraphicsItem::ensureDirtySceneTransform()
QGraphicsView view(&scene);
view.show();
QApplication::setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
@@ -9590,6 +9610,7 @@ void tst_QGraphicsItem::QTBUG_4233_updateCachedWithSceneRect()
QGraphicsView view(&scene);
view.show();
QApplication::setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QCOMPARE(QApplication::activeWindow(), (QWidget *)&view);
@@ -10720,6 +10741,7 @@ void tst_QGraphicsItem::scroll()
MyGraphicsView view(&scene);
view.setFrameStyle(0);
view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QTRY_VERIFY(view.repaints > 0);
@@ -11242,6 +11264,7 @@ void tst_QGraphicsItem::QTBUG_6738_missingUpdateWithSetParent()
MyGraphicsView view(&scene);
view.show();
qApp->setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QTRY_VERIFY(view.repaints > 0);
@@ -11290,6 +11313,7 @@ void tst_QGraphicsItem::QT_2653_fullUpdateDiscardingOpacityUpdate()
parentGreen->setFlag(QGraphicsItem::ItemIgnoresTransformations);
view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
view.reset();
@@ -11332,10 +11356,14 @@ void tst_QGraphicsItem::QTBUG_7714_fullUpdateDiscardingOpacityUpdate2()
origView.reset();
childYellow->setOpacity(0.0);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on WinRT. Figure out why - QTBUG-68297", Abort);
+#endif
QTRY_COMPARE(origView.repaints, 1);
view.show();
qApp->setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
view.reset();
origView.reset();
@@ -11475,6 +11503,7 @@ void tst_QGraphicsItem::doNotMarkFullUpdateIfNotInScene()
item2->setParentItem(item);
scene.addItem(item);
view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(view.windowHandle()));
QVERIFY(QTest::qWaitForWindowActive(view.windowHandle()));
view.activateWindow();
QTRY_VERIFY(view.isActiveWindow());
@@ -11506,6 +11535,7 @@ void tst_QGraphicsItem::itemDiesDuringDraggingOperation()
scene.addItem(item);
view.show();
QApplication::setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QCOMPARE(QApplication::activeWindow(), (QWidget *)&view);
QGraphicsSceneDragDropEvent dragEnter(QEvent::GraphicsSceneDragEnter);
@@ -11533,6 +11563,7 @@ void tst_QGraphicsItem::QTBUG_12112_focusItem()
view.show();
QApplication::setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QCOMPARE(QApplication::activeWindow(), (QWidget *)&view);
diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/qgraphicsproxywidget.pro b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/qgraphicsproxywidget.pro
index e7bcccb495..c10cbe1b1a 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/qgraphicsproxywidget.pro
+++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/qgraphicsproxywidget.pro
@@ -4,5 +4,6 @@ TARGET = tst_qgraphicsproxywidget
QT += widgets widgets-private testlib
QT += core-private gui-private
+DEFINES += QTEST_QPA_MOUSE_HANDLING
SOURCES += tst_qgraphicsproxywidget.cpp
diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 4cd2fef2dc..49afc5f369 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -33,12 +33,6 @@
#include <private/qgraphicsproxywidget_p.h>
#include <private/qlayoutengine_p.h> // qSmartMin functions...
-static void sendMouseMove(QWidget *widget, const QPoint &point, Qt::MouseButton button = Qt::NoButton)
-{
- QMouseEvent event(QEvent::MouseMove, point, widget->mapToGlobal(point), button, button, 0);
- QApplication::sendEvent(widget, &event);
-}
-
/*
Notes:
@@ -95,10 +89,8 @@ private slots:
void focusNextPrevChild();
void focusOutEvent_data();
void focusOutEvent();
-#ifndef QT_NO_CURSOR
void hoverEnterLeaveEvent_data();
void hoverEnterLeaveEvent();
-#endif
void hoverMoveEvent_data();
void hoverMoveEvent();
void keyPressEvent_data();
@@ -138,9 +130,7 @@ private slots:
void setFocus_complexTwoWidgets();
void popup_basic();
void popup_subwidget();
-#ifndef QT_NO_CURSOR
void changingCursor_basic();
-#endif
void tooltip_basic();
void childPos_data();
void childPos();
@@ -685,7 +675,6 @@ void tst_QGraphicsProxyWidget::focusInEvent()
SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget;
proxy->setEnabled(true);
scene.addItem(proxy);
- proxy->setVisible(true);
QWidget *widget = new QWidget;
widget->resize(100, 100);
@@ -716,7 +705,6 @@ void tst_QGraphicsProxyWidget::focusInEventNoWidget()
SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget;
proxy->setEnabled(true);
scene.addItem(proxy);
- proxy->setVisible(true);
view.show();
proxy->setFlag(QGraphicsItem::ItemIsFocusable, true); // <- shouldn't need to do this
@@ -931,7 +919,6 @@ protected:
}
};
-#ifndef QT_NO_CURSOR
void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent_data()
{
QTest::addColumn<bool>("hasWidget");
@@ -952,8 +939,6 @@ void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent()
QGraphicsScene scene;
QGraphicsView view(&scene);
- //do not let the window manager move the window while we are moving the mouse on it
- view.setWindowFlags(Qt::X11BypassWindowManagerHint);
view.show();
QApplication::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
@@ -968,31 +953,30 @@ void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent()
if (hasWidget)
proxy->setWidget(widgetGuard.take());
proxy->setPos(50, 0);
+ QSignalSpy sceneChangedSpy(&scene, &QGraphicsScene::changed);
scene.addItem(proxy);
- QTest::qWait(30);
+ QTRY_VERIFY(sceneChangedSpy.count() > 0);
+
+ // outside graphics item
QTest::mouseMove(&view, QPoint(10, 10));
- QTest::qWait(30);
- // in
+ QCOMPARE(widget->testAttribute(Qt::WA_UnderMouse), false);
+ QCOMPARE(widget->enterCount, 0);
+ QCOMPARE(widget->hoverEnter, 0);
+ // over graphics item
QTest::mouseMove(&view, QPoint(50, 50));
- QSKIP("QTBUG-25294");
QTRY_COMPARE(widget->testAttribute(Qt::WA_UnderMouse), hasWidget);
- // ### this attribute isn't supported
QCOMPARE(widget->enterCount, hasWidget ? 1 : 0);
QCOMPARE(widget->hoverEnter, (hasWidget && hoverEnabled) ? 1 : 0);
- // does not work on all platforms
- //QCOMPARE(widget->moveCount, 0);
- // out
+ QTRY_COMPARE(widget->leaveCount, 0);
+ QTRY_COMPARE(widget->hoverLeave, 0);
+ // outside graphics item
QTest::mouseMove(&view, QPoint(10, 10));
- // QTRY_COMPARE(widget->testAttribute(Qt::WA_UnderMouse), false);
- // ### this attribute isn't supported
+ QTRY_COMPARE(widget->testAttribute(Qt::WA_UnderMouse), false);
QTRY_COMPARE(widget->leaveCount, hasWidget ? 1 : 0);
QTRY_COMPARE(widget->hoverLeave, (hasWidget && hoverEnabled) ? 1 : 0);
- // does not work on all platforms
- //QCOMPARE(widget->moveCount, 0);
}
-#endif
void tst_QGraphicsProxyWidget::hoverMoveEvent_data()
{
@@ -1174,19 +1158,20 @@ void tst_QGraphicsProxyWidget::mouseDoubleClickEvent()
widget->setText("foo");
widget->resize(50, 50);
view.resize(100, 100);
- if (hasWidget) {
+ if (hasWidget)
proxy->setWidget(widget);
- proxy->show();
- }
proxy->setPos(50, 0);
+ QSignalSpy sceneChangedSpy(&scene, &QGraphicsScene::changed);
scene.addItem(proxy);
proxy->setFocus();
- QTest::mouseMove(view.viewport(), view.mapFromScene(proxy->mapToScene(15, proxy->boundingRect().center().y())));
- QTest::mousePress(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(proxy->mapToScene(15, proxy->boundingRect().center().y())));
- QTest::mouseRelease(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(proxy->mapToScene(15, proxy->boundingRect().center().y())));
- QTest::mouseDClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(proxy->mapToScene(15, proxy->boundingRect().center().y())));
- QTest::mouseRelease(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(proxy->mapToScene(15, proxy->boundingRect().center().y())));
+ // wait for scene to be updated before doing any coordinate mappings on it
+ QTRY_VERIFY(sceneChangedSpy.count() > 0);
+
+ QPoint pointInLineEdit = view.mapFromScene(proxy->mapToScene(15, proxy->boundingRect().center().y()));
+ QTest::mousePress(view.viewport(), Qt::LeftButton, 0, pointInLineEdit);
+ QTest::mouseRelease(view.viewport(), Qt::LeftButton, 0, pointInLineEdit);
+ QTest::mouseDClick(view.viewport(), Qt::LeftButton, 0, pointInLineEdit);
QTRY_COMPARE(widget->selectedText(), hasWidget ? QString("foo") : QString());
@@ -1217,19 +1202,20 @@ void tst_QGraphicsProxyWidget::mousePressReleaseEvent()
QPushButton *widget = new QPushButton;
QSignalSpy spy(widget, SIGNAL(clicked()));
widget->resize(50, 50);
- if (hasWidget) {
+ if (hasWidget)
proxy->setWidget(widget);
- proxy->show();
- }
proxy->setPos(50, 0);
+ QSignalSpy sceneChangedSpy(&scene, &QGraphicsScene::changed);
scene.addItem(proxy);
proxy->setFocus();
- QTest::mousePress(view.viewport(), Qt::LeftButton, 0,
- view.mapFromScene(proxy->mapToScene(proxy->boundingRect().center())));
+ // wait for scene to be updated before doing any coordinate mappings on it
+ QTRY_VERIFY(sceneChangedSpy.count() > 0);
+
+ QPoint buttonCenter = view.mapFromScene(proxy->mapToScene(proxy->boundingRect().center()));
+ QTest::mousePress(view.viewport(), Qt::LeftButton, 0, buttonCenter);
QTRY_COMPARE(spy.count(), 0);
- QTest::mouseRelease(view.viewport(), Qt::LeftButton, 0,
- view.mapFromScene(proxy->mapToScene(proxy->boundingRect().center())));
+ QTest::mouseRelease(view.viewport(), Qt::LeftButton, 0, buttonCenter);
QTRY_COMPARE(spy.count(), (hasWidget) ? 1 : 0);
if (!hasWidget)
@@ -1282,16 +1268,13 @@ void tst_QGraphicsProxyWidget::paintEvent()
w->show();
QVERIFY(QTest::qWaitForWindowExposed(w));
- QApplication::processEvents();
- QTest::qWait(30);
proxy.setWidget(w);
+ QSignalSpy sceneChangedSpy(&scene, &QGraphicsScene::changed);
scene.addItem(&proxy);
- //make sure we flush all the paint events
- QTRY_VERIFY(proxy.paintCount > 1);
- QTest::qWait(30);
- proxy.paintCount = 0;
+ QTRY_VERIFY(sceneChangedSpy.count() > 0); // make sure the scene is ready
+ proxy.paintCount = 0;
w->update();
QTRY_VERIFY(proxy.paintCount >= 1); //the widget should have been painted now
}
@@ -2545,35 +2528,34 @@ void tst_QGraphicsProxyWidget::popup_subwidget()
QCOMPARE(popup->size(), child->size().toSize());
}
-#ifndef QT_NO_CURSOR
void tst_QGraphicsProxyWidget::changingCursor_basic()
{
+#if !QT_CONFIG(cursor)
+ QSKIP("This test requires the QCursor API");
+#else
// Confirm that mouse events are working properly by checking that
// when moving the mouse over a line edit it will change the cursor into the I
QGraphicsScene scene;
QGraphicsView view(&scene);
view.show();
+ QVERIFY(QTest::qWaitForWindowActive(&view));
SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget;
QLineEdit *widget = new QLineEdit;
proxy->setWidget(widget);
- proxy->show();
+ QSignalSpy sceneChangedSpy(&scene, &QGraphicsScene::changed);
scene.addItem(proxy);
- QApplication::setActiveWindow(&view);
- QVERIFY(QTest::qWaitForWindowActive(&view));
- QVERIFY(view.isActiveWindow());
+ QTRY_VERIFY(sceneChangedSpy.count() > 0); // make sure the scene is ready
// in
QTest::mouseMove(view.viewport(), view.mapFromScene(proxy->mapToScene(proxy->boundingRect().center())));
- sendMouseMove(view.viewport(), view.mapFromScene(proxy->mapToScene(proxy->boundingRect().center())));
QTRY_COMPARE(view.viewport()->cursor().shape(), Qt::IBeamCursor);
// out
QTest::mouseMove(view.viewport(), QPoint(1, 1));
- sendMouseMove(view.viewport(), QPoint(1, 1));
QTRY_COMPARE(view.viewport()->cursor().shape(), Qt::ArrowCursor);
+#endif // !QT_CONFIG(cursor)
}
-#endif
static bool findViewAndTipLabel(const QWidget *view)
{
@@ -2972,7 +2954,7 @@ void tst_QGraphicsProxyWidget::dontCrashWhenDie()
MainWidget *w = new MainWidget();
w->show();
QVERIFY(QTest::qWaitForWindowExposed(w));
- QTest::qWait(100);
+
QTest::mouseMove(w->view->viewport(), w->view->mapFromScene(w->widget->mapToScene(w->widget->boundingRect().center())));
delete w->item;
@@ -3219,9 +3201,6 @@ void tst_QGraphicsProxyWidget::bypassGraphicsProxyWidget_data()
void tst_QGraphicsProxyWidget::bypassGraphicsProxyWidget()
{
-#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
- QSKIP("Test case unstable on this platform, QTBUG-33067");
-#endif
QFETCH(bool, bypass);
QWidget *widget = new QWidget;
@@ -3230,6 +3209,7 @@ void tst_QGraphicsProxyWidget::bypassGraphicsProxyWidget()
QGraphicsScene scene;
QGraphicsView view(&scene);
view.show();
+ QVERIFY(QTest::qWaitForWindowActive(&view));
QGraphicsProxyWidget *proxy = scene.addWidget(widget);
@@ -3243,6 +3223,7 @@ void tst_QGraphicsProxyWidget::bypassGraphicsProxyWidget()
QFileDialog *dialog = new QFileDialog(widget, flags);
dialog->setOption(QFileDialog::DontUseNativeDialog, true);
dialog->show();
+ QVERIFY(QTest::qWaitForWindowActive(dialog));
QCOMPARE(proxy->childItems().size(), bypass ? 0 : 1);
if (!bypass)
@@ -3637,25 +3618,21 @@ public:
QPushButton *hideButton = new QPushButton("I'm a button with a very very long text");
hideButton->setGeometry(10, 10, 400, 50);
topButton = addWidget(hideButton);
- connect(hideButton, SIGNAL(clicked()), this, SLOT(hideButton()));
+ connect(hideButton, &QPushButton::clicked, this, [&]() { topButton->hide(); });
topButton->setFocus();
}
QGraphicsProxyWidget *topButton;
HoverButton *hoverButton;
-
-public slots:
- void hideButton() {
- QCursor::setPos(600,600);
- topButton->hide();
- }
};
void tst_QGraphicsProxyWidget::QTBUG_6986_sendMouseEventToAlienWidget()
{
-#if defined(Q_OS_DARWIN) || defined(Q_OS_WIN) || defined(QT_NO_CURSOR)
- QSKIP("Test case unstable on this platform");
-#endif
+ if (QGuiApplication::platformName() == QLatin1String("cocoa")) {
+ // The "Second button" does not receive QEvent::HoverLeave
+ QSKIP("This test fails only on Cocoa. Investigate why. See QTBUG-69219");
+ }
+
QGraphicsView view;
Scene scene;
view.setScene(&scene);
@@ -3663,9 +3640,12 @@ void tst_QGraphicsProxyWidget::QTBUG_6986_sendMouseEventToAlienWidget()
QApplication::setActiveWindow(&view);
view.show();
QVERIFY(QTest::qWaitForWindowActive(&view));
- QCOMPARE(QApplication::activeWindow(), &view);
- QCursor::setPos(view.mapToGlobal(view.mapFromScene(scene.topButton->boundingRect().center())));
- QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(scene.topButton->scenePos()));
+
+ QPoint topButtonTopLeftCorner = view.mapFromScene(scene.topButton->scenePos());
+ QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, topButtonTopLeftCorner);
+ // move to the bottom right corner (buttons are placed in the top left corner)
+ QCOMPARE(scene.hoverButton->hoverLeaveReceived, false);
+ QTest::mouseMove(view.viewport(), view.viewport()->rect().bottomRight());
QTRY_COMPARE(scene.hoverButton->hoverLeaveReceived, true);
}
diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST b/tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST
index 70170d2822..0e7a1b451f 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST
+++ b/tests/auto/widgets/graphicsview/qgraphicsscene/BLACKLIST
@@ -3,3 +3,15 @@
osx-10.11 ci
[isActive]
opensuse-42.3 ci
+[removeFullyTransparentItem]
+osx-10.11
+osx-10.12
+[tabFocus_sceneWithNestedFocusWidgets]
+opensuse
+opensuse-leap
+[inputMethod]
+opensuse
+opensuse-leap
+[hoverEvents_parentChild]
+ubuntu
+
diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
index b256aab3e7..838b1f4be6 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -254,6 +254,7 @@ private slots:
void zeroScale();
void focusItemChangedSignal();
void minimumRenderSize();
+ void focusOnTouch();
// task specific tests below me
void task139710_bspTreeCrash();
@@ -1275,10 +1276,10 @@ void tst_QGraphicsScene::removeItem()
view.show();
QApplication::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
- QTest::mouseMove(view.viewport(), view.mapFromScene(hoverItem->scenePos() + QPointF(20, 20)), Qt::NoButton);
+ QTest::mouseMove(view.windowHandle(), view.mapFromScene(hoverItem->scenePos() + QPointF(20, 20)));
QTRY_VERIFY(!hoverItem->isHovered);
- QTest::mouseMove(view.viewport(), view.mapFromScene(hoverItem->scenePos()), Qt::NoButton);
+ QTest::mouseMove(view.windowHandle(), view.mapFromScene(hoverItem->scenePos()));
QTRY_VERIFY(hoverItem->isHovered);
scene.removeItem(hoverItem);
@@ -2657,7 +2658,7 @@ void tst_QGraphicsScene::render()
void tst_QGraphicsScene::renderItemsWithNegativeWidthOrHeight()
{
-#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
+#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) || defined(Q_OS_WINRT)
QSKIP("Test only works on platforms with resizable windows");
#endif
@@ -4758,6 +4759,41 @@ void tst_QGraphicsScene::minimumRenderSize()
QVERIFY(smallChild->repaints > smallerGrandChild->repaints);
}
+void tst_QGraphicsScene::focusOnTouch()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ scene.setSceneRect(0, 0, 100, 100);
+ QGraphicsRectItem *rect = scene.addRect(0, 0, 100, 100);
+ rect->setFlag(QGraphicsItem::ItemIsFocusable, true);
+
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowActive(&view));
+
+ QVERIFY(!rect->hasFocus());
+
+ scene.setFocusOnTouch(false);
+
+ QTouchDevice device;
+ device.setType(QTouchDevice::TouchPad);
+ QList<QTouchEvent::TouchPoint> touchPoints;
+ QTouchEvent::TouchPoint point;
+ point.setScenePos(QPointF(10, 10));
+ point.setState(Qt::TouchPointPressed);
+ touchPoints.append(point);
+ QTouchEvent event(QEvent::TouchBegin, &device, Qt::NoModifier, Qt::TouchPointStates(),
+ touchPoints);
+
+ QApplication::sendEvent(&scene, &event);
+
+ QVERIFY(!rect->hasFocus());
+ scene.setFocusOnTouch(true);
+
+ QApplication::sendEvent(&scene, &event);
+ QVERIFY(rect->hasFocus());
+}
+
void tst_QGraphicsScene::taskQTBUG_15977_renderWithDeviceCoordinateCache()
{
QGraphicsScene scene;
diff --git a/tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp b/tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp
index f3ac70ddb5..baccf7bff8 100644
--- a/tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp
@@ -355,6 +355,9 @@ void tst_QGraphicsSceneIndex::clear()
MyItem *item = new MyItem;
scene.addItem(item);
qApp->processEvents();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "There is one additional paint event on WinRT - QTBUG-68297", Abort);
+#endif
QTRY_COMPARE(item->numPaints, 1);
}
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index fe5b320492..3dc110298a 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -48,7 +48,6 @@
#include <QtWidgets/QBoxLayout>
#include <QtWidgets/QStyle>
#include <QtWidgets/QPushButton>
-#include <QtWidgets/QDesktopWidget>
#ifndef QT_NO_OPENGL
#include <QtWidgets/QOpenGLWidget>
#endif
@@ -262,11 +261,11 @@ private slots:
void QTBUG_4151_clipAndIgnore_data();
void QTBUG_4151_clipAndIgnore();
void QTBUG_5859_exposedRect();
+ void hoverLeave();
+ void QTBUG_16063_microFocusRect();
#ifndef QT_NO_CURSOR
void QTBUG_7438_cursor();
#endif
- void hoverLeave();
- void QTBUG_16063_microFocusRect();
public slots:
void dummySlot() {}
@@ -431,6 +430,7 @@ void tst_QGraphicsView::interactive()
QCOMPARE(item->events.size(), 0);
view.show();
view.activateWindow();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QTRY_COMPARE(item->events.size(), 1); // activate
@@ -1646,6 +1646,7 @@ void tst_QGraphicsView::itemsInRect_cosmeticAdjust()
view.setFrameStyle(0);
view.resize(300, 300);
view.showNormal();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QTRY_VERIFY(rect->numPaints > 0);
@@ -2140,6 +2141,7 @@ void tst_QGraphicsView::sendEvent()
QGraphicsView view(&scene);
view.show();
QApplication::setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
@@ -2207,6 +2209,7 @@ void tst_QGraphicsView::wheelEvent()
QGraphicsView view(&scene);
view.show();
QApplication::setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
@@ -2435,14 +2438,15 @@ void tst_QGraphicsView::viewportUpdateMode()
scene.setBackgroundBrush(Qt::red);
CustomView view;
- QDesktopWidget desktop;
- view.setFixedSize(QSize(500, 500).boundedTo(desktop.availableGeometry().size())); // 500 is too big for all common smartphones
+ QScreen *screen = QGuiApplication::primaryScreen();
+ view.setFixedSize(QSize(500, 500).boundedTo(screen->availableGeometry().size())); // 500 is too big for all common smartphones
view.setScene(&scene);
QCOMPARE(view.viewportUpdateMode(), QGraphicsView::MinimalViewportUpdate);
// Show the view, and initialize our test.
view.show();
qApp->setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QTRY_VERIFY(!view.lastUpdateRegions.isEmpty());
view.lastUpdateRegions.clear();
@@ -2526,6 +2530,7 @@ void tst_QGraphicsView::viewportUpdateMode2()
view.resize(200 + left + right, 200 + top + bottom);
toplevel.show();
qApp->setActiveWindow(&toplevel);
+ QVERIFY(QTest::qWaitForWindowExposed(&toplevel));
QVERIFY(QTest::qWaitForWindowActive(&toplevel));
QTRY_VERIFY(view.painted);
const QRect viewportRect = view.viewport()->rect();
@@ -3170,6 +3175,7 @@ void tst_QGraphicsView::task172231_untransformableItems()
view.scale(2, 1);
view.show();
QApplication::setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
@@ -3969,6 +3975,7 @@ void tst_QGraphicsView::exposeRegion()
view.setScene(&scene);
view.show();
qApp->setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QTRY_VERIFY(item->paints > 0);
@@ -4123,6 +4130,7 @@ void tst_QGraphicsView::update2()
view.resize(200, 200);
view.show();
qApp->setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QTRY_VERIFY(rect->numPaints > 0);
@@ -4192,6 +4200,7 @@ void tst_QGraphicsView::update_ancestorClipsChildrenToShape()
CustomView view(&scene);
view.show();
qApp->setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QTRY_VERIFY(view.painted);
@@ -4245,6 +4254,7 @@ void tst_QGraphicsView::update_ancestorClipsChildrenToShape2()
CustomView view(&scene);
view.show();
qApp->setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QTRY_VERIFY(view.painted);
@@ -4305,6 +4315,7 @@ void tst_QGraphicsView::inputMethodSensitivity()
QGraphicsView view(&scene);
view.show();
QApplication::setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
@@ -4399,6 +4410,7 @@ void tst_QGraphicsView::inputContextReset()
view.show();
QApplication::setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
@@ -4546,6 +4558,7 @@ void tst_QGraphicsView::task255529_transformationAnchorMouseAndViewportMargins()
view.setWindowFlags(Qt::X11BypassWindowManagerHint);
view.show();
qApp->setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
// This is highly unstable (observed to pass on Windows and some Linux configurations).
#ifndef Q_OS_MAC
@@ -4673,6 +4686,7 @@ void tst_QGraphicsView::QTBUG_4151_clipAndIgnore()
view.resize(75, 75);
view.show();
view.activateWindow();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
QCOMPARE(QApplication::activeWindow(), (QWidget *)&view);
@@ -4710,6 +4724,7 @@ void tst_QGraphicsView::QTBUG_5859_exposedRect()
view.scale(4.15, 4.15);
view.showNormal();
qApp->setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
view.viewport()->repaint(10,10,20,20);
@@ -4834,6 +4849,7 @@ void tst_QGraphicsView::QTBUG_16063_microFocusRect()
view.setFixedSize(40, 40);
view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
scene.setFocusItem(item);
diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
index 58a66f99b4..45c86800d6 100644
--- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
+++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
@@ -1217,6 +1217,9 @@ void tst_QAbstractItemView::task250754_fontChange()
font.setPixelSize(60);
tree.setFont(font);
+#ifdef Q_OS_WINRT
+ QSKIP("Resizing the widget does not work as expected for WinRT, so the scroll bar might not be visible");
+#endif
//now with the huge items, the scrollbar must be visible
QTRY_VERIFY(tree.verticalScrollBar()->isVisible());
@@ -1534,6 +1537,9 @@ void tst_QAbstractItemView::testClickedSignal()
QSignalSpy clickedSpy(&view, SIGNAL(clicked(QModelIndex)));
QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, p);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on WinRT - QTBUG-68297", Abort);
+#endif
QCOMPARE(clickedSpy.count(), 1);
QTest::mouseClick(view.viewport(), Qt::RightButton, 0, p);
@@ -2257,6 +2263,9 @@ void tst_QAbstractItemView::QTBUG46785_mouseout_hover_state()
QTest::mouseMove(table.viewport(), QPoint(-50, 0));
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "QTest::mouseMove does not work on WinRT", Abort);
+#endif
QTRY_VERIFY(delegate.m_paintedWithoutHover);
}
diff --git a/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp b/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp
index 58b34e8aea..c58dbf599c 100644
--- a/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp
+++ b/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp
@@ -948,8 +948,10 @@ void tst_QColumnView::parentCurrentIndex()
QTRY_COMPARE(view.createdColumns[0]->currentIndex(), first);
QTRY_COMPARE(view.createdColumns[1]->currentIndex(), second);
+#ifndef Q_OS_WINRT
// The next two lines should be removed when QTBUG-22707 is resolved.
QEXPECT_FAIL("", "QTBUG-22707", Abort);
+#endif
QVERIFY(view.createdColumns[2]);
QTRY_COMPARE(view.createdColumns[2]->currentIndex(), third);
diff --git a/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp b/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp
index 48d39bbb11..d401154228 100644
--- a/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp
+++ b/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp
@@ -314,6 +314,9 @@ void tst_QDirModel::mkdir()
model.setReadOnly(false);
QModelIndex parent = model.index(SRCDIR "dirtest");
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Sandboxed applications cannot access SRCDIR - QTBUG-68297", Abort);
+#endif
QVERIFY(parent.isValid());
QCOMPARE(model.rowCount(parent), 1); // start out with only 'test1' - in's in the depot
@@ -351,6 +354,9 @@ void tst_QDirModel::rmdir()
model.setReadOnly(false);
QModelIndex parent = model.index(SRCDIR "/dirtest");
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Sandboxed applications cannot access SRCDIR - QTBUG-68297", Abort);
+#endif
QVERIFY(parent.isValid());
QCOMPARE(model.rowCount(parent), 1); // start out with only 'test1' - in's in the depot
@@ -460,6 +466,9 @@ bool tst_QDirModel::rowsAboutToBeRemoved_cleanup(const QString &test_path)
void tst_QDirModel::rowsAboutToBeRemoved()
{
+#ifdef Q_OS_WINRT
+ QSKIP("Test fails on WinRT - QTBUG-68297");
+#endif
QFETCH(QString, test_path);
QFETCH(QStringList, initial_files);
QFETCH(int, remove_row);
@@ -571,6 +580,9 @@ void tst_QDirModel::unreadable()
void tst_QDirModel::filePath()
{
QFile::remove(SRCDIR "test.lnk");
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Sandboxed applications cannot access SRCDIR - QTBUG-68297", Abort);
+#endif
QVERIFY(QFile(SRCDIR "tst_qdirmodel.cpp").link(SRCDIR "test.lnk"));
QDirModel model;
model.setResolveSymlinks(false);
@@ -629,6 +641,9 @@ void tst_QDirModel::filter()
QDirModel model;
model.setNameFilters(QStringList() << "*.nada");
QModelIndex index = model.index(SRCDIR "test");
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Sandboxed applications cannot access SRCDIR - QTBUG-68297", Abort);
+#endif
QCOMPARE(model.rowCount(index), 0);
QModelIndex index2 = model.index(SRCDIR "test/file01.tst");
QVERIFY(!index2.isValid());
@@ -638,6 +653,9 @@ void tst_QDirModel::filter()
void tst_QDirModel::task244669_remove()
{
QFile f1(SRCDIR "dirtest/f1.txt");
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Sandboxed applications cannot access SRCDIR - QTBUG-68297", Abort);
+#endif
QVERIFY(f1.open(QIODevice::WriteOnly));
f1.close();
QFile f2(SRCDIR "dirtest/f2.txt");
diff --git a/tests/auto/widgets/itemviews/qheaderview/BLACKLIST b/tests/auto/widgets/itemviews/qheaderview/BLACKLIST
new file mode 100644
index 0000000000..efb813f7d2
--- /dev/null
+++ b/tests/auto/widgets/itemviews/qheaderview/BLACKLIST
@@ -0,0 +1,3 @@
+[stretchAndRestoreLastSection]
+opensuse
+opensuse-leap
diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
index 0dd98cf61c..b6932d4892 100644
--- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
@@ -244,7 +244,9 @@ private slots:
void testMinMaxSectionSize_data();
void testMinMaxSectionSize();
void sizeHintCrash();
+ void testResetCachedSizeHint();
void statusTips();
+
protected:
void setupTestData(bool use_reset_model = false);
void additionalInit();
@@ -266,9 +268,9 @@ Q_OBJECT
public:
QtTestModel(QObject *parent = 0): QAbstractTableModel(parent),
- cols(0), rows(0), wrongIndex(false) {}
- int rowCount(const QModelIndex&) const { return rows; }
- int columnCount(const QModelIndex&) const { return cols; }
+ cols(0), rows(0), wrongIndex(false), m_bMultiLine(false) {}
+ int rowCount(const QModelIndex&) const override { return rows; }
+ int columnCount(const QModelIndex&) const override { return cols; }
bool isEditable(const QModelIndex &) const { return true; }
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const
{
@@ -280,11 +282,15 @@ public:
return QVariant();
if (orientation == Qt::Horizontal && col >= cols)
return QVariant();
+ if (m_bMultiLine)
+ return QString("%1\n%1").arg(section);
return QLatin1Char('[') + QString::number(row) + QLatin1Char(',')
+ QString::number(col) + QLatin1String(",0] -- Header");
}
- QVariant data(const QModelIndex &idx, int) const
+ QVariant data(const QModelIndex &idx, int role = Qt::DisplayRole) const override
{
+ if (role != Qt::DisplayRole)
+ return QVariant();
if (idx.row() < 0 || idx.column() < 0 || idx.column() >= cols || idx.row() >= rows) {
wrongIndex = true;
qWarning("Invalid modelIndex [%d,%d,%p]", idx.row(), idx.column(), idx.internalPointer());
@@ -367,8 +373,16 @@ public:
emit layoutChanged();
}
+ void setMultiLineHeader(bool bEnable)
+ {
+ beginResetModel();
+ m_bMultiLine = bEnable;
+ endResetModel();
+ }
+
int cols, rows;
mutable bool wrongIndex;
+ bool m_bMultiLine;
};
// Testing get/set functions
@@ -391,6 +405,7 @@ void tst_QHeaderView::getSetCheck()
// int QHeaderView::defaultSectionSize()
// void QHeaderView::setDefaultSectionSize(int)
+ obj1.setMinimumSectionSize(0);
obj1.setDefaultSectionSize(-1);
QVERIFY(obj1.defaultSectionSize() >= 0);
obj1.setDefaultSectionSize(0);
@@ -657,6 +672,8 @@ void tst_QHeaderView::sectionSize()
{
#if defined Q_OS_QNX
QSKIP("The section size is dpi dependent on QNX");
+#elif defined Q_OS_WINRT
+ QSKIP("Fails on WinRT - QTBUG-68297");
#endif
QFETCH(QList<int>, boundsCheck);
QFETCH(QList<int>, defaultSizes);
@@ -761,6 +778,8 @@ void tst_QHeaderView::visualIndexAt()
{
#if defined Q_OS_QNX
QSKIP("The section size is dpi dependent on QNX");
+#elif defined Q_OS_WINRT
+ QSKIP("Fails on WinRT - QTBUG-68297");
#endif
QFETCH(QList<int>, hidden);
QFETCH(QList<int>, from);
@@ -830,11 +849,9 @@ void tst_QHeaderView::offset()
void tst_QHeaderView::sectionSizeHint()
{
- // Test bad arguments
- view->sectionSizeHint(-1);
- view->sectionSizeHint(99999);
-
- // TODO how to test the return value?
+ QCOMPARE(view->sectionSizeHint(-1), -1);
+ QCOMPARE(view->sectionSizeHint(99999), -1);
+ QVERIFY(view->sectionSizeHint(0) >= 0);
}
void tst_QHeaderView::logicalIndex()
@@ -2044,6 +2061,7 @@ void tst_QHeaderView::defaultSectionSize()
QHeaderView h((Qt::Orientation)direction);
h.setModel(&m);
+ h.setMinimumSectionSize(0);
QCOMPARE(h.defaultSectionSize(), oldDefaultSize);
h.setDefaultSectionSize(newDefaultSize);
@@ -2144,6 +2162,9 @@ void tst_QHeaderView::preserveHiddenSectionWidth()
void tst_QHeaderView::invisibleStretchLastSection()
{
+#ifdef Q_OS_WINRT
+ QSKIP("Fails on WinRT - QTBUG-68297");
+#endif
int count = 6;
QStandardItemModel model(1, count);
QHeaderView view(Qt::Horizontal);
@@ -2281,6 +2302,7 @@ void tst_QHeaderView::QTBUG6058_reset()
QHeaderView view(Qt::Vertical);
view.setModel(&proxy);
view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
QVERIFY(QTest::qWaitForWindowActive(&view));
proxy.setSourceModel(&model1);
@@ -3306,8 +3328,16 @@ void tst_QHeaderView::testMinMaxSectionSize()
QHeaderView &header = *tv.horizontalHeader();
header.setMinimumSectionSize(sectionSizeMin);
header.setMaximumSectionSize(sectionSizeMax);
+ // check bounds for default section size
+ header.setDefaultSectionSize(sectionSizeMin - 1);
+ QCOMPARE(header.defaultSectionSize(), sectionSizeMin);
+ header.setDefaultSectionSize(sectionSizeMax + 1);
+ QCOMPARE(header.defaultSectionSize(), sectionSizeMax);
+
header.setDefaultSectionSize(defaultSectionSize);
+ QCOMPARE(header.defaultSectionSize(), defaultSectionSize);
header.setStretchLastSection(stretchLastSection);
+ QCOMPARE(header.stretchLastSection(), stretchLastSection);
// check defaults
QCOMPARE(header.sectionSize(0), defaultSectionSize);
@@ -3338,6 +3368,26 @@ void tst_QHeaderView::testMinMaxSectionSize()
QTRY_COMPARE(header.sectionSize(0), defaultSectionSize);
}
+void tst_QHeaderView::testResetCachedSizeHint()
+{
+ QtTestModel model;
+ model.rows = model.cols = 10;
+
+ QTableView tv;
+ tv.setModel(&model);
+ tv.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&tv));
+
+ QSize s1 = tv.horizontalHeader()->sizeHint();
+ model.setMultiLineHeader(true);
+ QSize s2 = tv.horizontalHeader()->sizeHint();
+ model.setMultiLineHeader(false);
+ QSize s3 = tv.horizontalHeader()->sizeHint();
+ QCOMPARE(s1, s3);
+ QVERIFY(s1 != s2);
+}
+
+
class StatusTipHeaderView : public QHeaderView
{
public:
@@ -3372,7 +3422,7 @@ void tst_QHeaderView::statusTips()
// Ensure it is moved away first and then moved to the relevant section
QTest::mouseMove(QApplication::desktop(),
headerView.rect().bottomLeft() + QPoint(20, 20));
- QPoint centerPoint = QRect(headerView.sectionPosition(0), headerView.y(),
+ QPoint centerPoint = QRect(headerView.sectionPosition(0), 0,
headerView.sectionSize(0), headerView.height()).center();
QTest::mouseMove(headerView.windowHandle(), centerPoint);
QTRY_VERIFY(headerView.gotStatusTipEvent);
@@ -3380,7 +3430,7 @@ void tst_QHeaderView::statusTips()
headerView.gotStatusTipEvent = false;
headerView.statusTipText.clear();
- centerPoint = QRect(headerView.sectionPosition(1), headerView.y(),
+ centerPoint = QRect(headerView.sectionPosition(1), 0,
headerView.sectionSize(1), headerView.height()).center();
QTest::mouseMove(headerView.windowHandle(), centerPoint);
QTRY_VERIFY(headerView.gotStatusTipEvent);
diff --git a/tests/auto/widgets/itemviews/qitemdelegate/BLACKLIST b/tests/auto/widgets/itemviews/qitemdelegate/BLACKLIST
index 0f7c377194..c6aeebc8f8 100644
--- a/tests/auto/widgets/itemviews/qitemdelegate/BLACKLIST
+++ b/tests/auto/widgets/itemviews/qitemdelegate/BLACKLIST
@@ -5,3 +5,4 @@ opensuse-42.3 ci
[comboBox]
# QTBUG-67282
opensuse
+opensuse-leap
diff --git a/tests/auto/widgets/itemviews/qitemview/BLACKLIST b/tests/auto/widgets/itemviews/qitemview/BLACKLIST
new file mode 100644
index 0000000000..d5fc89f204
--- /dev/null
+++ b/tests/auto/widgets/itemviews/qitemview/BLACKLIST
@@ -0,0 +1,2 @@
+[scrollTo]
+winrt
diff --git a/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp b/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp
index afd6d84486..bbdaac5c6f 100644
--- a/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp
+++ b/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp
@@ -546,23 +546,26 @@ void tst_QItemView::walkScreen(QAbstractItemView *view)
}
}
-void walkIndex(QModelIndex index, QAbstractItemView *view)
+void walkIndex(const QModelIndex &index, const QAbstractItemView *view)
{
- QRect visualRect = view->visualRect(index);
- //if (index.column() == 0)
- //qDebug() << index << visualRect;
- int width = visualRect.width();
- int height = visualRect.height();
+ const QRect visualRect = view->visualRect(index);
+ const int width = visualRect.width();
+ const int height = visualRect.height();
- for (int w = 0; w < width; ++w)
+ if (width == 0 || height == 0)
+ return;
+
+ const auto widths = (width < 2) ? QVector<int>({ 0, 1 }) : QVector<int>({ 0, 1, width / 2, width - 2, width - 1 });
+ const auto heights = (height < 2) ? QVector<int>({ 0, 1 }) : QVector<int>({ 0, 1, height / 2, height - 2, height - 1 });
+ for (int w : widths)
{
- for (int h = 0; h < height; ++h)
+ for (int h : heights)
{
- QPoint point(visualRect.x()+w, visualRect.y()+h);
- if (view->indexAt(point) != index) {
+ const QPoint point(visualRect.x() + w, visualRect.y() + h);
+ const auto idxAt = view->indexAt(point);
+ if (idxAt != index)
qDebug() << "index" << index << "visualRect" << visualRect << point << view->indexAt(point);
- }
- QCOMPARE(view->indexAt(point), index);
+ QCOMPARE(idxAt, index);
}
}
@@ -579,7 +582,7 @@ void walkIndex(QModelIndex index, QAbstractItemView *view)
a bug it will point it out, but the above tests should have already found the basic bugs
because it is easier to figure out the problem in those tests then this one.
*/
-void checkChildren(QAbstractItemView *currentView, const QModelIndex &parent = QModelIndex(), int currentDepth=0)
+void checkChildren(const QAbstractItemView *currentView, const QModelIndex &parent = QModelIndex(), int currentDepth = 0)
{
QAbstractItemModel *currentModel = currentView->model();
@@ -623,7 +626,6 @@ void tst_QItemView::indexAt()
view->setHorizontalScrollMode((QAbstractItemView::ScrollMode)hscroll);
view->show();
view->setModel(treeModel);
-#if 0
checkChildren(view);
QModelIndex index = view->model()->index(0, 0);
@@ -636,7 +638,6 @@ void tst_QItemView::indexAt()
QPoint p(1, view->height()/2);
QModelIndex idx = view->indexAt(p);
QCOMPARE(idx, QModelIndex());
-#endif
}
void tst_QItemView::scrollTo_data()
diff --git a/tests/auto/widgets/itemviews/qlistview/qlistview.pro b/tests/auto/widgets/itemviews/qlistview/qlistview.pro
index e49a0c5fbf..75f45ab432 100644
--- a/tests/auto/widgets/itemviews/qlistview/qlistview.pro
+++ b/tests/auto/widgets/itemviews/qlistview/qlistview.pro
@@ -3,4 +3,3 @@ TARGET = tst_qlistview
QT += widgets gui-private widgets-private core-private testlib testlib-private
SOURCES += tst_qlistview.cpp
win32:!winrt: LIBS += -luser32
-linux*: CONFIG += insignificant_test # Crashes
diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
index d0c9dae313..5227db64ec 100644
--- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
+++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
@@ -149,6 +149,8 @@ private slots:
void taskQTBUG_7232_AllowUserToControlSingleStep();
void taskQTBUG_51086_skippingIndexesInSelectedIndexes();
void taskQTBUG_47694_indexOutOfBoundBatchLayout();
+ void itemAlignment();
+ void internalDragDropMove();
};
// Testing get/set functions
@@ -1462,6 +1464,9 @@ void tst_QListView::wordWrap()
QApplication::processEvents();
QTRY_COMPARE(lv.horizontalScrollBar()->isVisible(), false);
+#ifdef Q_OS_WINRT
+QSKIP("setFixedSize does not work on WinRT. Vertical scroll bar will not be visible.");
+#endif
QTRY_COMPARE(lv.verticalScrollBar()->isVisible(), true);
}
@@ -2083,6 +2088,9 @@ void tst_QListView::taskQTBUG_21115_scrollToAndHiddenItems_data()
void tst_QListView::taskQTBUG_21115_scrollToAndHiddenItems()
{
QFETCH(int, flow);
+#ifdef Q_OS_WINRT
+ QSKIP("Fails on WinRT - QTBUG-68297");
+#endif
ScrollPerItemListView lv;
lv.setUniformItemSizes(true);
@@ -2293,6 +2301,9 @@ void tst_QListView::testScrollToWithHidden()
lv.scrollTo(model.index(26, 0));
int expectedScrollBarValue = lv.verticalScrollBar()->value();
+#ifdef Q_OS_WINRT
+ QSKIP("Might fail on WinRT - QTBUG-68297");
+#endif
QVERIFY(expectedScrollBarValue != 0);
lv.scrollTo(model.index(25, 0));
@@ -2419,6 +2430,7 @@ void tst_QListView::taskQTBUG_39902_mutualScrollBars()
void tst_QListView::horizontalScrollingByVerticalWheelEvents()
{
+#if QT_CONFIG(wheelevent)
QListView lv;
lv.setWrapping(true);
@@ -2460,6 +2472,9 @@ void tst_QListView::horizontalScrollingByVerticalWheelEvents()
int vValue = lv.verticalScrollBar()->value();
QApplication::sendEvent(lv.viewport(), &wheelDownEvent);
QVERIFY(lv.verticalScrollBar()->value() > vValue);
+#else
+ QSKIP("Built with --no-feature-wheelevent");
+#endif
}
void tst_QListView::taskQTBUG_7232_AllowUserToControlSingleStep()
@@ -2540,5 +2555,76 @@ void tst_QListView::taskQTBUG_47694_indexOutOfBoundBatchLayout()
view.scrollTo(model.index(batchSize - 1, 0));
}
+void tst_QListView::itemAlignment()
+{
+ auto item1 = new QStandardItem("111");
+ auto item2 = new QStandardItem("111111");
+ QStandardItemModel model;
+ model.appendRow(item1);
+ model.appendRow(item2);
+
+ QListView w;
+ w.setModel(&model);
+ w.setWrapping(true);
+ w.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
+
+ QVERIFY(w.visualRect(item1->index()).width() > 0);
+ QVERIFY(w.visualRect(item1->index()).width() == w.visualRect(item2->index()).width());
+
+ w.setItemAlignment(Qt::AlignLeft);
+ QApplication::processEvents();
+
+ QVERIFY(w.visualRect(item1->index()).width() < w.visualRect(item2->index()).width());
+}
+
+void tst_QListView::internalDragDropMove()
+{
+ const QString platform(QGuiApplication::platformName().toLower());
+ if (platform != QLatin1String("xcb"))
+ QSKIP("Need a window system with proper DnD support via injected mouse events");
+
+ // on an internal move, the item was deleted which should not happen
+ // see QTBUG-67440
+ class QListViewWithPublicStartDrag : public QListView
+ {
+ public:
+ using QListView::startDrag;
+ };
+
+ QStandardItemModel data(0, 1);
+ QPixmap pixmap(32, 32);
+ for (int i = 0; i < 10; ++i) {
+ pixmap.fill(Qt::GlobalColor(i + 1));
+ data.appendRow(new QStandardItem(QIcon(pixmap), QString::number(i)));
+ }
+ QItemSelectionModel selections(&data);
+ QListViewWithPublicStartDrag list;
+ list.setWindowTitle(QTest::currentTestFunction());
+ list.setViewMode(QListView::IconMode);
+ list.setDefaultDropAction(Qt::MoveAction);
+ list.setModel(&data);
+ list.setSelectionModel(&selections);
+ list.resize(300, 300);
+ list.show();
+ selections.select(data.index(1, 0), QItemSelectionModel::Select);
+ QVERIFY(QTest::qWaitForWindowExposed(&list));
+
+ // execute as soon as the eventloop is running again
+ // which is the case inside list.startDrag()
+ QTimer::singleShot(0, [&list]()
+ {
+ const QPoint pos = list.rect().center();
+ QMouseEvent mouseMove(QEvent::MouseMove, pos, list.mapToGlobal(pos), Qt::NoButton, 0, 0);
+ QApplication::sendEvent(&list, &mouseMove);
+ QMouseEvent mouseRelease(QEvent::MouseButtonRelease, pos, list.mapToGlobal(pos), Qt::LeftButton, 0, 0);
+ QApplication::sendEvent(&list, &mouseRelease);
+ });
+ const int expectedCount = data.rowCount();
+ list.startDrag(Qt::MoveAction|Qt::CopyAction);
+ QCOMPARE(expectedCount, data.rowCount());
+}
+
+
QTEST_MAIN(tst_QListView)
#include "tst_qlistview.moc"
diff --git a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
index 8427b04be7..ab746dfee8 100644
--- a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
+++ b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
@@ -1353,6 +1353,11 @@ void tst_QTableView::moveCursorBiggerJump()
QCOMPARE(view.indexAt(QPoint(0,0)), model.index(7,0));
QTest::keyClick(&view, Qt::Key_PageUp);
QCOMPARE(view.indexAt(QPoint(0,0)), model.index(0,0));
+
+ QTest::keyClick(&view, Qt::Key_PageDown);
+ view.verticalHeader()->hideSection(0);
+ QTest::keyClick(&view, Qt::Key_PageUp);
+ QTRY_COMPARE(view.currentIndex().row(), view.rowAt(0));
}
void tst_QTableView::hideRows_data()
@@ -2329,6 +2334,14 @@ void tst_QTableView::rowViewportPosition()
view.setVerticalScrollMode((QAbstractItemView::ScrollMode)verticalScrollMode);
view.verticalScrollBar()->setValue(verticalScrollValue);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("row 1, scroll per item, 1", "Fails on WinRT - QTBUG-68297", Abort);
+ QEXPECT_FAIL("row 5, scroll per item, 5", "Fails on WinRT - QTBUG-68297", Abort);
+ QEXPECT_FAIL("row 9, scroll per item, 5", "Fails on WinRT - QTBUG-68297", Abort);
+ QEXPECT_FAIL("row 1, scroll per pixel, 1", "Fails on WinRT - QTBUG-68297", Abort);
+ QEXPECT_FAIL("row 5, scroll per pixel, 5", "Fails on WinRT - QTBUG-68297", Abort);
+ QEXPECT_FAIL("row 9, scroll per pixel, 5", "Fails on WinRT - QTBUG-68297", Abort);
+#endif
QCOMPARE(view.rowViewportPosition(row), rowViewportPosition);
}
@@ -2492,6 +2505,14 @@ void tst_QTableView::columnViewportPosition()
view.setHorizontalScrollMode((QAbstractItemView::ScrollMode)horizontalScrollMode);
view.horizontalScrollBar()->setValue(horizontalScrollValue);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("column 1, scroll per item, 1", "Fails on WinRT - QTBUG-68297", Abort);
+ QEXPECT_FAIL("column 5, scroll per item, 5", "Fails on WinRT - QTBUG-68297", Abort);
+ QEXPECT_FAIL("column 9, scroll per item, 5", "Fails on WinRT - QTBUG-68297", Abort);
+ QEXPECT_FAIL("column 1, scroll per pixel 1", "Fails on WinRT - QTBUG-68297", Abort);
+ QEXPECT_FAIL("column 5, scroll per pixel 5", "Fails on WinRT - QTBUG-68297", Abort);
+ QEXPECT_FAIL("column 9, scroll per pixel 5", "Fails on WinRT - QTBUG-68297", Abort);
+#endif
QCOMPARE(view.columnViewportPosition(column), columnViewportPosition);
}
diff --git a/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp b/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp
index 4d4a95b3f5..4155ff1ec6 100644
--- a/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp
+++ b/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp
@@ -32,6 +32,7 @@
#include <qlist.h>
#include <qpair.h>
#include <qheaderview.h>
+#include <qlineedit.h>
#include <qtablewidget.h>
@@ -81,6 +82,7 @@ private slots:
void itemData();
void setItemData();
void cellWidget();
+ void cellWidgetGeometry();
void task231094();
void task219380_removeLastRow();
void task262056_sortDuplicate();
@@ -360,11 +362,18 @@ void tst_QTableWidget::takeItem()
for (int c = 0; c < testWidget->columnCount(); ++c)
QCOMPARE(testWidget->item(r, c)->text(), QString::number(r * c + c));
+ QSignalSpy spy(testWidget, &QTableWidget::cellChanged);
QTableWidgetItem *item = testWidget->takeItem(row, column);
QCOMPARE(!!item, expectItem);
if (expectItem) {
QCOMPARE(item->text(), QString::number(row * column + column));
delete item;
+
+ QTRY_COMPARE(spy.count(), 1);
+ const QList<QVariant> arguments = spy.takeFirst();
+ QCOMPARE(arguments.size(), 2);
+ QCOMPARE(arguments.at(0).toInt(), row);
+ QCOMPARE(arguments.at(1).toInt(), column);
}
QVERIFY(!testWidget->takeItem(row, column));
}
@@ -1343,27 +1352,45 @@ void tst_QTableWidget::setItemWithSorting()
}
}
+class QTableWidgetDataChanged : public QTableWidget
+{
+ Q_OBJECT
+public:
+ using QTableWidget::QTableWidget;
+
+ void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles) override
+ {
+ QTableWidget::dataChanged(topLeft, bottomRight, roles);
+ currentRoles = roles;
+ }
+ QVector<int> currentRoles;
+};
+
void tst_QTableWidget::itemData()
{
- QTableWidget widget(2, 2);
+ QTableWidgetDataChanged widget(2, 2);
widget.setItem(0, 0, new QTableWidgetItem());
QTableWidgetItem *item = widget.item(0, 0);
QVERIFY(item);
item->setFlags(item->flags() | Qt::ItemIsEditable);
item->setData(Qt::DisplayRole, QString("0"));
+ QCOMPARE(widget.currentRoles, QVector<int>({Qt::DisplayRole, Qt::EditRole}));
item->setData(Qt::CheckStateRole, Qt::PartiallyChecked);
- item->setData(Qt::UserRole + 0, QString("1"));
- item->setData(Qt::UserRole + 1, QString("2"));
- item->setData(Qt::UserRole + 2, QString("3"));
- item->setData(Qt::UserRole + 3, QString("4"));
+ QCOMPARE(widget.currentRoles, {Qt::CheckStateRole});
+ for (int i = 0; i < 4; ++i)
+ {
+ item->setData(Qt::UserRole + i, QString::number(i + 1));
+ QCOMPARE(widget.currentRoles, {Qt::UserRole + i});
+ }
QMap<int, QVariant> flags = widget.model()->itemData(widget.model()->index(0, 0));
QCOMPARE(flags.count(), 6);
- QCOMPARE(flags[(Qt::UserRole + 0)].toString(), QString("1"));
+ for (int i = 0; i < 4; ++i)
+ QCOMPARE(flags[Qt::UserRole + i].toString(), QString::number(i + 1));
}
void tst_QTableWidget::setItemData()
{
- QTableWidget table(10, 10);
+ QTableWidgetDataChanged table(10, 10);
table.setSortingEnabled(false);
QSignalSpy dataChangedSpy(table.model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)));
@@ -1376,6 +1403,7 @@ void tst_QTableWidget::setItemData()
data.insert(Qt::DisplayRole, QLatin1String("Display"));
data.insert(Qt::ToolTipRole, QLatin1String("ToolTip"));
table.model()->setItemData(idx, data);
+ QCOMPARE(table.currentRoles, QVector<int>({Qt::DisplayRole, Qt::EditRole, Qt::ToolTipRole}));
QCOMPARE(table.model()->data(idx, Qt::DisplayRole).toString(), QLatin1String("Display"));
QCOMPARE(table.model()->data(idx, Qt::ToolTipRole).toString(), QLatin1String("ToolTip"));
@@ -1404,6 +1432,28 @@ void tst_QTableWidget::cellWidget()
QCOMPARE(table.cellWidget(5, 5), static_cast<QWidget*>(0));
}
+void tst_QTableWidget::cellWidgetGeometry()
+{
+ QTableWidget tw(3,2);
+ tw.show();
+ // make sure the next row added is not completely visibile
+ tw.resize(300, tw.rowHeight(0) * 3 + tw.rowHeight(0) / 2);
+ QVERIFY(QTest::qWaitForWindowExposed(&tw));
+
+ tw.scrollToBottom();
+ tw.setRowCount(tw.rowCount() + 1);
+ auto item = new QTableWidgetItem("Hello");
+ tw.setItem(0,0,item);
+ auto le = new QLineEdit("world");
+ tw.setCellWidget(0,1,le);
+ // process delayedPendingLayout triggered by setting the row count
+ tw.doItemsLayout();
+ // so y pos is 0 for the first row
+ tw.scrollToTop();
+ // check if updateEditorGeometries has set the correct y pos for the editors
+ QCOMPARE(tw.visualItemRect(item).top(), le->geometry().top());
+}
+
void tst_QTableWidget::task231094()
{
QTableWidget tw(5, 3);
diff --git a/tests/auto/widgets/itemviews/qtreeview/BLACKLIST b/tests/auto/widgets/itemviews/qtreeview/BLACKLIST
deleted file mode 100644
index 5eb80007c4..0000000000
--- a/tests/auto/widgets/itemviews/qtreeview/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[setSortingEnabledChild]
-windows
diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
index 34cdcd5bf7..8f9afeea4d 100644
--- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
@@ -839,6 +839,9 @@ void tst_QTreeView::horizontalScrollMode()
QCOMPARE(view.horizontalScrollMode(), QAbstractItemView::ScrollPerPixel);
QCOMPARE(view.horizontalScrollBar()->minimum(), 0);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "setFixedSize does not work on WinRT - QTBUG-68297", Abort);
+#endif
QVERIFY(view.horizontalScrollBar()->maximum() > 2);
view.setHorizontalScrollMode(QAbstractItemView::ScrollPerItem);
@@ -1975,6 +1978,10 @@ void tst_QTreeView::setSelection()
QVERIFY(selectionModel);
QModelIndexList selectedIndexes = selectionModel->selectedIndexes();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("(0,-20,20,50),rows", "Fails on WinRT - QTBUG-68297", Abort);
+ QEXPECT_FAIL("(0,-50,20,90),rows", "Fails on WinRT - QTBUG-68297", Abort);
+#endif
QCOMPARE(selectedIndexes.count(), expectedItems.count());
for (int i = 0; i < selectedIndexes.count(); ++i) {
QModelIndex idx = selectedIndexes.at(i);
@@ -2600,8 +2607,10 @@ void tst_QTreeView::setSortingEnabledChild()
{
QMainWindow win;
QTreeView view;
- QStandardItemModel model(1,1);
+ // two columns to not get in trouble with stretchLastSection
+ QStandardItemModel model(1,2);
view.setModel(&model);
+ view.header()->setDefaultSectionSize(92);
win.setCentralWidget(&view);
const int size = view.header()->sectionSize(0);
view.setSortingEnabled(true);
diff --git a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
index 321e4bcd0e..8c93df9073 100644
--- a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
+++ b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
@@ -160,6 +160,7 @@ private slots:
void task20345_sortChildren();
void getMimeDataWithInvalidItem();
void testVisualItemRect();
+ void reparentHiddenItem();
public slots:
void itemSelectionChanged();
@@ -1938,23 +1939,38 @@ void tst_QTreeWidget::setData()
}
}
+class QTreeWidgetDataChanged : public QTreeWidget
+{
+ Q_OBJECT
+public:
+ using QTreeWidget::QTreeWidget;
+
+ void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles) override
+ {
+ QTreeWidget::dataChanged(topLeft, bottomRight, roles);
+ currentRoles = roles;
+ }
+ QVector<int> currentRoles;
+};
+
void tst_QTreeWidget::itemData()
{
- QTreeWidget widget;
+ QTreeWidgetDataChanged widget;
QTreeWidgetItem item(&widget);
widget.setColumnCount(2);
item.setFlags(item.flags() | Qt::ItemIsEditable);
item.setData(0, Qt::DisplayRole, QString("0"));
+ QCOMPARE(widget.currentRoles, QVector<int>({Qt::DisplayRole, Qt::EditRole}));
item.setData(0, Qt::CheckStateRole, Qt::PartiallyChecked);
- item.setData(0, Qt::UserRole + 0, QString("1"));
- item.setData(0, Qt::UserRole + 1, QString("2"));
- item.setData(0, Qt::UserRole + 2, QString("3"));
- item.setData(0, Qt::UserRole + 3, QString("4"));
-
+ QCOMPARE(widget.currentRoles, {Qt::CheckStateRole});
+ for (int i = 0; i < 4; ++i) {
+ item.setData(0, Qt::UserRole + i, QString::number(i + 1));
+ QCOMPARE(widget.currentRoles, {Qt::UserRole + i});
+ }
QMap<int, QVariant> flags = widget.model()->itemData(widget.model()->index(0, 0));
QCOMPARE(flags.count(), 6);
- QCOMPARE(flags[Qt::UserRole + 0].toString(), QString("1"));
-
+ for (int i = 0; i < 4; ++i)
+ QCOMPARE(flags[Qt::UserRole + i].toString(), QString::number(i + 1));
flags = widget.model()->itemData(widget.model()->index(0, 1));
QCOMPARE(flags.count(), 0);
}
@@ -3412,8 +3428,9 @@ void tst_QTreeWidget::taskQTBUG_34717_collapseAtBottom()
void tst_QTreeWidget::task20345_sortChildren()
{
- if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
- QSKIP("Wayland: This causes a crash triggered by setVisible(false)");
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)
+ || !QGuiApplication::platformName().compare(QLatin1String("winrt"), Qt::CaseInsensitive))
+ QSKIP("Wayland/WinRT: This causes a crash triggered by setVisible(false)");
// This test case is considered successful if it is executed (no crash in sorting)
QTreeWidget tw;
@@ -3483,5 +3500,34 @@ void tst_QTreeWidget::testVisualItemRect()
QCOMPARE(r.width(), sectionSize);
}
+void tst_QTreeWidget::reparentHiddenItem()
+{
+ QTreeWidgetItem *parent = new QTreeWidgetItem(testWidget);
+ parent->setText(0, "parent");
+ QTreeWidgetItem *otherParent = new QTreeWidgetItem(testWidget);
+ otherParent->setText(0, "other parent");
+ QTreeWidgetItem *child = new QTreeWidgetItem(parent);
+ child->setText(0, "child");
+ QTreeWidgetItem *grandChild = new QTreeWidgetItem(child);
+ grandChild->setText(0, "grandchild");
+ QVERIFY(child->parent());
+ QVERIFY(grandChild->parent());
+
+ testWidget->expandItem(parent);
+ testWidget->expandItem(otherParent);
+ testWidget->expandItem(child);
+
+ QVERIFY(!parent->isHidden());
+ QVERIFY(!child->isHidden());
+ QVERIFY(!grandChild->isHidden());
+
+ grandChild->setHidden(true);
+
+ QVERIFY(grandChild->isHidden());
+ parent->removeChild(child);
+ otherParent->addChild(child);
+ QVERIFY(grandChild->isHidden());
+}
+
QTEST_MAIN(tst_QTreeWidget)
#include "tst_qtreewidget.moc"
diff --git a/tests/auto/widgets/kernel/qapplication/BLACKLIST b/tests/auto/widgets/kernel/qapplication/BLACKLIST
index ca0efdff8a..d7de7bf16e 100644
--- a/tests/auto/widgets/kernel/qapplication/BLACKLIST
+++ b/tests/auto/widgets/kernel/qapplication/BLACKLIST
@@ -1,3 +1,4 @@
[touchEventPropagation]
# QTBUG-66745
opensuse
+opensuse-leap
diff --git a/tests/auto/widgets/kernel/qapplication/desktopsettingsaware/desktopsettingsaware.pro b/tests/auto/widgets/kernel/qapplication/desktopsettingsaware/desktopsettingsaware.pro
index a10ff71b05..442bf33b61 100644
--- a/tests/auto/widgets/kernel/qapplication/desktopsettingsaware/desktopsettingsaware.pro
+++ b/tests/auto/widgets/kernel/qapplication/desktopsettingsaware/desktopsettingsaware.pro
@@ -1,6 +1,14 @@
QT += widgets
-CONFIG -= app_bundle debug_and_release_target
+CONFIG -= app_bundle
-DESTDIR = ./
+debug_and_release {
+ CONFIG(debug, debug|release) {
+ TARGET = ../../debug/desktopsettingsaware_helper
+ } else {
+ TARGET = ../../release/desktopsettingsaware_helper
+ }
+} else {
+ TARGET = ../desktopsettingsaware_helper
+}
SOURCES += main.cpp
diff --git a/tests/auto/widgets/kernel/qapplication/modal/modal.pro b/tests/auto/widgets/kernel/qapplication/modal/modal.pro
index a34871d2aa..e832d90821 100644
--- a/tests/auto/widgets/kernel/qapplication/modal/modal.pro
+++ b/tests/auto/widgets/kernel/qapplication/modal/modal.pro
@@ -1,7 +1,15 @@
QT += widgets
SOURCES += main.cpp \
base.cpp
-DESTDIR = ./
-CONFIG -= app_bundle debug_and_release_target
+debug_and_release {
+ CONFIG(debug, debug|release) {
+ TARGET = ../../debug/modal_helper
+ } else {
+ TARGET = ../../release/modal_helper
+ }
+} else {
+ TARGET = ../modal_helper
+}
+CONFIG -= app_bundle
HEADERS += base.h
diff --git a/tests/auto/widgets/kernel/qapplication/test/test.pro b/tests/auto/widgets/kernel/qapplication/test/test.pro
index 41aad02a1b..8ade4d8364 100644
--- a/tests/auto/widgets/kernel/qapplication/test/test.pro
+++ b/tests/auto/widgets/kernel/qapplication/test/test.pro
@@ -1,18 +1,28 @@
CONFIG += testcase
-CONFIG -= debug_and_release_target
QT += widgets widgets-private testlib
QT += core-private gui-private
SOURCES += ../tst_qapplication.cpp
-TARGET = ../tst_qapplication
-TESTDATA = ../test/test.pro ../tmp/README
+builtin_testdata: DEFINES += BUILTIN_TESTDATA
-!android:!winrt {
- SUBPROGRAMS = desktopsettingsaware modal
- win32:SUBPROGRAMS += wincmdline
+TESTDATA = ../test/test.pro ../tmp/README ../modal
- for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../$${file}/$${file}"
-}
+!android:!winrt: SUBPROGRAMS = desktopsettingsaware modal
+debug_and_release {
+ CONFIG(debug, debug|release) {
+ TARGET = ../../debug/tst_qapplication
+ !android:!winrt: TEST_HELPER_INSTALLS = ../debug/helper
+ for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../debug/$${file}"
+ } else {
+ TARGET = ../../release/tst_qapplication
+ !android:!winrt: TEST_HELPER_INSTALLS = ../release/helper
+ for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../release/$${file}"
+ }
+} else {
+ TARGET = ../tst_qapplication
+ !android:!winrt: TEST_HELPER_INSTALLS = ../helper
+ for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../$${file}"
+}
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
index bd4dc3d6f3..d2a244b762 100644
--- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
+++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
@@ -96,7 +96,6 @@ public:
tst_QApplication();
private slots:
- void initTestCase();
void cleanup();
void sendEventsOnProcessEvents(); // this must be the first test
void staticSetup();
@@ -187,13 +186,6 @@ public:
}
};
-void tst_QApplication::initTestCase()
-{
- // chdir to our testdata path and execute helper apps relative to that.
- const QString testdataDir = QFileInfo(QFINDTESTDATA("desktopsettingsaware")).absolutePath();
- QVERIFY2(QDir::setCurrent(testdataDir), qPrintable("Could not chdir to " + testdataDir));
-}
-
void tst_QApplication::sendEventsOnProcessEvents()
{
int argc = 0;
@@ -277,6 +269,9 @@ public:
void tst_QApplication::alert()
{
+#ifdef Q_OS_WINRT
+ QSKIP("WinRT does not support more than 1 native widget at the same time");
+#endif
int argc = 0;
QApplication app(argc, 0);
app.alert(0, 0);
@@ -820,6 +815,9 @@ public:
void tst_QApplication::closeAllWindows()
{
+#ifdef Q_OS_WINRT
+ QSKIP("PromptOnCloseWidget does not work on WinRT - QTBUG-68297");
+#endif
int argc = 0;
QApplication app(argc, 0);
@@ -888,7 +886,11 @@ bool isPathListIncluded(const QStringList &l, const QStringList &r)
#define QT_TST_QAPP_DEBUG
void tst_QApplication::libraryPaths()
{
+#ifndef BUILTIN_TESTDATA
const QString testDir = QFileInfo(QFINDTESTDATA("test/test.pro")).absolutePath();
+#else
+ const QString testDir = QFileInfo(QFINDTESTDATA("test.pro")).absolutePath();
+#endif
QVERIFY(!testDir.isEmpty());
{
QApplication::setLibraryPaths(QStringList() << testDir);
@@ -921,6 +923,9 @@ void tst_QApplication::libraryPaths()
QStringList expected = QSet<QString>::fromList((QStringList() << installPathPlugins << appDirPath)).toList();
expected.sort();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "On WinRT PluginsPath is outside of sandbox. QTBUG-68297", Abort);
+#endif
QVERIFY2(isPathListIncluded(actual, expected),
qPrintable("actual:\n - " + actual.join("\n - ") +
"\nexpected:\n - " + expected.join("\n - ")));
@@ -1040,6 +1045,9 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2()
<< QDir(app.applicationDirPath()).canonicalPath()
<< QDir(QDir::fromNativeSeparators(QString::fromLatin1(validPath))).canonicalPath();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "On WinRT PluginsPath is outside of sandbox. QTBUG-68297", Abort);
+#endif
QVERIFY2(isPathListIncluded(app.libraryPaths(), expected),
qPrintable("actual:\n - " + app.libraryPaths().join("\n - ") +
"\nexpected:\n - " + expected.join("\n - ")));
@@ -1434,20 +1442,10 @@ void tst_QApplication::testDeleteLaterProcessEvents()
void tst_QApplication::desktopSettingsAware()
{
#if QT_CONFIG(process)
- QString path;
- {
- // We need an application object for QFINDTESTDATA to work
- // properly in all cases.
- int argc = 0;
- QCoreApplication app(argc, 0);
- path = QFINDTESTDATA("desktopsettingsaware/");
- }
- QVERIFY2(!path.isEmpty(), "Cannot locate desktopsettingsaware helper application");
- path += "desktopsettingsaware";
QProcess testProcess;
- testProcess.start(path);
+ testProcess.start("desktopsettingsaware_helper");
QVERIFY2(testProcess.waitForStarted(),
- qPrintable(QString::fromLatin1("Cannot start '%1': %2").arg(path, testProcess.errorString())));
+ qPrintable(QString::fromLatin1("Cannot start 'desktopsettingsaware_helper': %1").arg(testProcess.errorString())));
QVERIFY(testProcess.waitForFinished(10000));
QCOMPARE(int(testProcess.state()), int(QProcess::NotRunning));
QVERIFY(int(testProcess.error()) != int(QProcess::Crashed));
@@ -1744,6 +1742,9 @@ void tst_QApplication::focusMouseClick()
QSpontaneKeyEvent::setSpontaneous(&ev);
QVERIFY(ev.spontaneous());
qApp->notify(&w2, &ev);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on WinRT - QTBUG-68297", Abort);
+#endif
QTRY_COMPARE(QApplication::focusWidget(), &w2);
// now back to tab focus and click again (it already had focus) -> focus should stay
@@ -2112,23 +2113,12 @@ void tst_QApplication::touchEventPropagation()
void tst_QApplication::qtbug_12673()
{
- QString path;
- {
- // We need an application object for QFINDTESTDATA to work
- // properly in all cases.
- int argc = 0;
- QCoreApplication app(argc, 0);
- path = QFINDTESTDATA("modal/");
- }
- QVERIFY2(!path.isEmpty(), "Cannot locate modal helper application");
- path += "modal";
-
#if QT_CONFIG(process)
QProcess testProcess;
QStringList arguments;
- testProcess.start(path, arguments);
+ testProcess.start("modal_helper", arguments);
QVERIFY2(testProcess.waitForStarted(),
- qPrintable(QString::fromLatin1("Cannot start '%1': %2").arg(path, testProcess.errorString())));
+ qPrintable(QString::fromLatin1("Cannot start 'modal_helper': %1").arg(testProcess.errorString())));
QVERIFY(testProcess.waitForFinished(20000));
QCOMPARE(testProcess.exitStatus(), QProcess::NormalExit);
#else
diff --git a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
index 8314dbedf5..b2650d1f32 100644
--- a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
+++ b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
@@ -56,6 +56,7 @@ private slots:
void taskQTBUG_40609_addingWidgetToItsOwnLayout();
void taskQTBUG_40609_addingLayoutToItself();
void replaceWidget();
+ void indexOf();
};
class CustomLayoutStyle : public QProxyStyle
@@ -512,5 +513,24 @@ void tst_QBoxLayout::replaceWidget()
QCOMPARE(boxLayout->indexOf(replaceTo), 1);
}
+void tst_QBoxLayout::indexOf()
+{
+ QWidget w;
+ auto outer = new QVBoxLayout(&w);
+ auto inner = new QHBoxLayout();
+ outer->addLayout(inner);
+ auto widget1 = new QWidget();
+ QWidget widget2;
+ inner->addWidget(widget1);
+
+ QCOMPARE(inner->indexOf(widget1), 0);
+ QCOMPARE(inner->indexOf(&widget2), -1);
+ QCOMPARE(outer->indexOf(widget1), -1);
+ QCOMPARE(outer->indexOf(&widget2), -1);
+ QCOMPARE(outer->indexOf(outer), -1);
+ QCOMPARE(outer->indexOf(inner), 0);
+ QCOMPARE(inner->indexOf(inner->itemAt(0)), 0);
+}
+
QTEST_MAIN(tst_QBoxLayout)
#include "tst_qboxlayout.moc"
diff --git a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
index 162da61584..cff3dad35e 100644
--- a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
+++ b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
@@ -273,6 +273,9 @@ void tst_QFormLayout::wrapping()
w.setWindowTitle(QTest::currentTestFunction());
w.show();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "setFixedWidth does not work on WinRT", Abort);
+#endif
QCOMPARE(le->geometry().y() > lbl->geometry().y(), true);
//TODO: additional tests covering different wrapping cases
diff --git a/tests/auto/widgets/kernel/qgesturerecognizer/BLACKLIST b/tests/auto/widgets/kernel/qgesturerecognizer/BLACKLIST
deleted file mode 100644
index 7f55c2dae0..0000000000
--- a/tests/auto/widgets/kernel/qgesturerecognizer/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[panGesture:Two finger]
-xcb
diff --git a/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp b/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
index 300a8878ba..936f581d89 100644
--- a/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
+++ b/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
@@ -337,7 +337,7 @@ void tst_QLayout::adjustSizeShouldMakeSureLayoutIsActivated()
void tst_QLayout::testRetainSizeWhenHidden()
{
-#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
+#if (defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)) || defined(Q_OS_WINRT)
QSKIP("Test does not work on platforms which default to showMaximized()");
#endif
diff --git a/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp b/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp
index eb3264be53..89bb946be9 100644
--- a/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp
+++ b/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp
@@ -116,8 +116,16 @@ void tst_QSizePolicy::constExpr()
{ Q_CONSTEXPR QSizePolicy sp = QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); Q_UNUSED(sp); }
{ Q_CONSTEXPR QSizePolicy sp = QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding, QSizePolicy::DefaultType);
Q_CONSTEXPR QSizePolicy tp = sp.transposed(); Q_UNUSED(tp); }
- { Q_RELAXED_CONSTEXPR auto sp = QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed, QSizePolicy::CheckBox);
- Q_RELAXED_CONSTEXPR auto tp = sp.transposed(); Q_UNUSED(tp); }
+ {
+ // QTBUG-69983: For ControlType != QSizePolicy::DefaultType, qCountTrailingZeroBits()
+ // is used, which MSVC 15.8.1 does not consider constexpr due to built-ins
+# if defined(QT_HAS_CONSTEXPR_BUILTINS) && (!defined(Q_CC_MSVC) || _MSC_VER < 1915)
+ Q_RELAXED_CONSTEXPR auto sp = QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed, QSizePolicy::CheckBox);
+# else
+ Q_CONSTEXPR auto sp = QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding, QSizePolicy::DefaultType);
+# endif
+ Q_RELAXED_CONSTEXPR auto tp = sp.transposed(); Q_UNUSED(tp);
+ }
#else
QSKIP("QSizePolicy cannot be constexpr with this version of the compiler.");
#endif
diff --git a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp
index e02573f8e8..3d609d0b9c 100644
--- a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp
+++ b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp
@@ -46,6 +46,7 @@ private slots:
void whatsThis();
void setPalette();
void qtbug64550_stylesheet();
+ void dontCrashOutsideScreenGeometry();
};
void tst_QToolTip::init()
@@ -218,5 +219,11 @@ void tst_QToolTip::qtbug64550_stylesheet()
msgSizeTooSmall(toolTipSize, boundingRect.size()).constData());
}
+void tst_QToolTip::dontCrashOutsideScreenGeometry() {
+ QToolTip::showText(QPoint(-10000, -10000), "tip outside monitor", nullptr);
+ QTRY_VERIFY(QToolTip::isVisible());
+ QToolTip::hideText();
+}
+
QTEST_MAIN(tst_QToolTip)
#include "tst_qtooltip.moc"
diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST
index 6cebce26e8..d8654e5768 100644
--- a/tests/auto/widgets/kernel/qwidget/BLACKLIST
+++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST
@@ -2,35 +2,27 @@
[normalGeometry]
ubuntu-16.04
[saveRestoreGeometry]
-ubuntu-16.04
+xcb
b2qt
-# QTBUG-66708
-opensuse
[restoreVersion1Geometry]
-xcb
osx
[updateWhileMinimized]
ubuntu-16.04
+ubuntu-18.04
rhel-7.4
osx
[focusProxyAndInputMethods]
linux
-[showMaximized]
-osx
-[setGeometry]
-osx
[raise]
# QTBUG-68175
opensuse
-osx
-[resizeEvent]
-osx
+opensuse-leap
[setWindowGeometry]
osx
[windowMoveResize]
osx
[childEvents]
-osx
+osx ci
[renderInvisible]
osx
[optimizedResizeMove]
@@ -42,27 +34,10 @@ osx
[showMinimizedKeepsFocus]
osx-10.11 ci
osx-10.12 ci
-[moveWindowInShowEvent:1]
-osx
-[moveWindowInShowEvent:2]
-osx
-[taskQTBUG_4055_sendSyntheticEnterLeave]
-osx
-[syntheticEnterLeave]
-osx
+osx-10.13 ci
[maskedUpdate]
-osx
-opensuse-42.3
-[hideOpaqueChildWhileHidden]
-osx
-[resizeStaticContentsChildWidget_QTBUG35282]
-osx
-[lower]
-osx
-[setClearAndResizeMask]
-osx
-[setToolTip]
-osx
+opensuse
+opensuse-leap
[moveInResizeEvent]
ubuntu-16.04
[moveChild:right]
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index 6a049aedf1..360e6986f6 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -188,7 +188,8 @@ private slots:
void reverseTabOrder();
void tabOrderWithProxy();
void tabOrderWithCompoundWidgets();
-#ifdef Q_OS_WIN
+ void tabOrderNoChange();
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
void activation();
#endif
void reparent();
@@ -416,8 +417,7 @@ private:
bool tst_QWidget::ensureScreenSize(int width, int height)
{
- QSize available;
- available = QDesktopWidget().availableGeometry().size();
+ const QSize available = QGuiApplication::primaryScreen()->availableGeometry().size();
return (available.width() >= width && available.height() >= height);
}
@@ -1426,7 +1426,7 @@ void tst_QWidget::mapFromAndTo()
subWindow2->setGeometry(75, 75, 100, 100);
subSubWindow->setGeometry(10, 10, 10, 10);
-#if !defined(Q_OS_QNX)
+#if !defined(Q_OS_QNX) && !defined(Q_OS_WINRT)
//update visibility
if (windowMinimized) {
if (!windowHidden) {
@@ -1931,7 +1931,35 @@ void tst_QWidget::tabOrderWithCompoundWidgets()
QVERIFY(lastEdit->hasFocus());
}
-#ifdef Q_OS_WIN
+static QVector<QWidget*> getFocusChain(QWidget *start, bool bForward)
+{
+ QVector<QWidget*> ret;
+ QWidget *cur = start;
+ do {
+ ret += cur;
+ auto widgetPrivate = static_cast<QWidgetPrivate *>(qt_widget_private(cur));
+ cur = bForward ? widgetPrivate->focus_next : widgetPrivate->focus_prev;
+ } while (cur != start);
+ return ret;
+}
+
+void tst_QWidget::tabOrderNoChange()
+{
+ QWidget w;
+ auto *verticalLayout = new QVBoxLayout(&w);
+ auto *tabWidget = new QTabWidget(&w);
+ auto *tv = new QTreeView(tabWidget);
+ tabWidget->addTab(tv, QStringLiteral("Tab 1"));
+ verticalLayout->addWidget(tabWidget);
+
+ const auto focusChainForward = getFocusChain(&w, true);
+ const auto focusChainBackward = getFocusChain(&w, false);
+ QWidget::setTabOrder(tabWidget, tv);
+ QCOMPARE(focusChainForward, getFocusChain(&w, true));
+ QCOMPARE(focusChainBackward, getFocusChain(&w, false));
+}
+
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
void tst_QWidget::activation()
{
Q_CHECK_PAINTEVENTS
@@ -1976,7 +2004,8 @@ void tst_QWidget::windowState()
QPoint pos;
QSize size = m_testWidgetSize;
if (QGuiApplicationPrivate::platformIntegration()->defaultWindowState(Qt::Widget)
- == Qt::WindowFullScreen) {
+ == Qt::WindowFullScreen
+ || m_platform == QStringLiteral("winrt")) {
size = QGuiApplication::primaryScreen()->size();
} else {
pos = QPoint(10, 10);
@@ -2181,8 +2210,8 @@ void tst_QWidget::showFullScreen()
QSKIP("QTBUG-52974");
#endif
- if (m_platform == QStringLiteral("wayland"))
- QSKIP("Wayland: This fails. Figure out why.");
+ if (m_platform == QStringLiteral("winrt"))
+ QSKIP("WinRT: This fails. QTBUG-68297");
QWidget plain;
QHBoxLayout *layout;
QWidget layouted;
@@ -2304,6 +2333,8 @@ void tst_QWidget::resizeEvent()
wTopLevel.resize(200, 200);
wTopLevel.show();
QVERIFY(QTest::qWaitForWindowExposed(&wTopLevel));
+ if (m_platform == QStringLiteral("winrt"))
+ QEXPECT_FAIL("", "WinRT does not support resize", Abort);
QCOMPARE (wTopLevel.m_resizeEventCount, 1); // initial resize event before paint for toplevels
wTopLevel.hide();
QSize safeSize(640,480);
@@ -2319,6 +2350,12 @@ void tst_QWidget::resizeEvent()
void tst_QWidget::showMinimized()
{
+ if (m_platform == QStringLiteral("wayland")) {
+ QSKIP("Wayland: Neither xdg_shell, wl_shell or ivi_application support "
+ "letting a client know whether it's minimized. So on these shells "
+ "Qt Wayland will always report that it's unmimized.");
+ }
+
QWidget plain;
plain.move(100, 100);
plain.resize(200, 200);
@@ -2327,6 +2364,9 @@ void tst_QWidget::showMinimized()
plain.showMinimized();
QVERIFY(plain.isMinimized());
QVERIFY(plain.isVisible());
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Winrt does not support move and resize", Abort);
+#endif
QCOMPARE(plain.pos(), pos);
plain.showNormal();
@@ -2478,11 +2518,15 @@ void tst_QWidget::showMinimizedKeepsFocus()
#ifdef Q_OS_OSX
if (!macHasAccessToWindowsServer())
QEXPECT_FAIL("", "When not having WindowServer access, we lose focus.", Continue);
+#elif defined(Q_OS_WINRT)
+ QEXPECT_FAIL("", "Winrt fails here - QTBUG-68297", Continue);
#endif
QTRY_COMPARE(window.focusWidget(), firstchild);
#ifdef Q_OS_OSX
if (!macHasAccessToWindowsServer())
QEXPECT_FAIL("", "When not having WindowServer access, we lose focus.", Continue);
+#elif defined(Q_OS_WINRT)
+ QEXPECT_FAIL("", "Winrt fails here - QTBUG-68297", Continue);
#endif
QTRY_COMPARE(qApp->focusWidget(), firstchild);
}
@@ -2513,6 +2557,9 @@ void tst_QWidget::reparent()
parent.show();
childTLW.show();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "WinRT does not support more than 1 top level widget", Abort);
+#endif
QVERIFY(QTest::qWaitForWindowExposed(&parent));
parent.move(parentPosition);
@@ -2610,6 +2657,8 @@ void tst_QWidget::normalGeometry()
if (m_platform == QStringLiteral("wayland"))
QSKIP("Wayland: This fails. Figure out why.");
+ else if (m_platform == QStringLiteral("winrt"))
+ QSKIP("WinRT: This fails. Figure out why - QTBUG-68297.");
QWidget parent;
parent.setWindowTitle("NormalGeometry parent");
QWidget *child = new QWidget(&parent);
@@ -2719,12 +2768,14 @@ void tst_QWidget::setGeometry()
tlw.setGeometry(tr);
child.setGeometry(cr);
tlw.showNormal();
+ if (m_platform == QStringLiteral("winrt"))
+ QEXPECT_FAIL("", "WinRT does not support setGeometry", Abort);
QTRY_COMPARE(tlw.geometry().size(), tr.size());
QCOMPARE(child.geometry(), cr);
tlw.setParent(0, Qt::Window|Qt::FramelessWindowHint);
tr = QRect(0,0,100,100);
- tr.moveTopLeft(QApplication::desktop()->availableGeometry().topLeft());
+ tr.moveTopLeft(QGuiApplication::primaryScreen()->availableGeometry().topLeft());
tlw.setGeometry(tr);
QCOMPARE(tlw.geometry(), tr);
tlw.showNormal();
@@ -3198,6 +3249,8 @@ void tst_QWidget::saveRestoreGeometry()
QVERIFY(QTest::qWaitForWindowExposed(&widget));
QApplication::processEvents();
+ if (m_platform == QStringLiteral("winrt"))
+ QEXPECT_FAIL("", "WinRT does not support move/resize", Abort);
QTRY_COMPARE(widget.pos(), position);
QCOMPARE(widget.size(), size);
savedGeometry = widget.saveGeometry();
@@ -3338,6 +3391,7 @@ void tst_QWidget::restoreVersion1Geometry()
QFETCH(QString, fileName);
QFETCH(uint, expectedWindowState);
QFETCH(QPoint, expectedPosition);
+ Q_UNUSED(expectedPosition);
QFETCH(QSize, expectedSize);
QFETCH(QRect, expectedNormalGeometry);
@@ -3357,28 +3411,28 @@ void tst_QWidget::restoreVersion1Geometry()
QCOMPARE(uint(widget.windowState() & WindowStateMask), expectedWindowState);
if (expectedWindowState == Qt::WindowNoState) {
- QCOMPARE(widget.pos(), expectedPosition);
+ QTRY_COMPARE(widget.geometry(), expectedNormalGeometry);
QCOMPARE(widget.size(), expectedSize);
}
+
widget.showNormal();
QVERIFY(QTest::qWaitForWindowExposed(&widget));
QTest::qWait(100);
+ if (m_platform == QStringLiteral("winrt"))
+ QEXPECT_FAIL("", "WinRT does not support restoreGeometry", Abort);
+
if (expectedWindowState == Qt::WindowNoState) {
- QTRY_COMPARE(widget.pos(), expectedPosition);
QTRY_COMPARE(widget.size(), expectedSize);
+ QCOMPARE(widget.geometry(), expectedNormalGeometry);
}
widget.showNormal();
QTest::qWait(10);
- if (expectedWindowState != Qt::WindowNoState) {
- // restoring from maximized or fullscreen, we can only restore to the normal geometry
- QTRY_COMPARE(widget.geometry(), expectedNormalGeometry);
- } else {
- QTRY_COMPARE(widget.pos(), expectedPosition);
- QTRY_COMPARE(widget.size(), expectedSize);
- }
+ QTRY_COMPARE(widget.geometry(), expectedNormalGeometry);
+ if (expectedWindowState == Qt::WindowNoState)
+ QCOMPARE(widget.size(), expectedSize);
#if 0
// Code for saving a new geometry*.dat files
@@ -3413,6 +3467,8 @@ void tst_QWidget::widgetAt()
QSKIP("Wayland: This fails. Figure out why.");
if (m_platform == QStringLiteral("offscreen"))
QSKIP("Platform offscreen does not support lower()/raise() or WindowMasks");
+ if (m_platform == QStringLiteral("winrt"))
+ QSKIP("WinRT does not support more than 1 top level widget");
Q_CHECK_PAINTEVENTS
@@ -3714,6 +3770,8 @@ void tst_QWidget::optimizedResizeMove()
staticWidget.gotPaintEvent = false;
staticWidget.move(staticWidget.pos() + QPoint(10, 10));
QTest::qWait(20);
+ if (m_platform == QStringLiteral("winrt"))
+ QEXPECT_FAIL("", "WinRT does not support move/resize", Abort);
QCOMPARE(staticWidget.gotPaintEvent, false);
staticWidget.gotPaintEvent = false;
@@ -3798,9 +3856,10 @@ void tst_QWidget::optimizedResize_topLevel()
// a native function call works (it basically has to go through
// WM_RESIZE in QApplication). This is a corner case, though.
// See task 243708
- const QRect frame = topLevel.frameGeometry();
- MoveWindow(winHandleOf(&topLevel), frame.x(), frame.y(),
- frame.width() + 10, frame.height() + 10,
+ RECT rect;
+ GetWindowRect(winHandleOf(&topLevel), &rect);
+ MoveWindow(winHandleOf(&topLevel), rect.left, rect.top,
+ rect.right - rect.left + 10, rect.bottom - rect.top + 10,
true);
QTest::qWait(100);
#endif
@@ -3812,6 +3871,8 @@ void tst_QWidget::optimizedResize_topLevel()
QTRY_VERIFY(topLevel.gotPaintEvent);
if (m_platform == QStringLiteral("xcb") || m_platform == QStringLiteral("offscreen"))
QSKIP("QTBUG-26424");
+ else if (m_platform == QStringLiteral("winrt"))
+ QEXPECT_FAIL("", "WinRT does not support move/resize", Abort);
QCOMPARE(topLevel.partial, true);
QCOMPARE(topLevel.paintedRegion, expectedUpdateRegion);
}
@@ -3860,7 +3921,7 @@ void tst_QWidget::setMinimumSize()
QSize nonDefaultSize = defaultSize + QSize(5,5);
w.setMinimumSize(nonDefaultSize);
w.showNormal();
- QVERIFY(QTest::qWaitForWindowActive(&w));
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
QVERIFY2(w.height() >= nonDefaultSize.height(),
msgComparisonFailed(w.height(), ">=", nonDefaultSize.height()));
QVERIFY2(w.width() >= nonDefaultSize.width(),
@@ -3915,6 +3976,8 @@ void tst_QWidget::setFixedSize()
QVERIFY(QTest::qWaitForWindowActive(&w));
if (m_platform == QStringLiteral("xcb"))
QSKIP("QTBUG-26424");
+ else if (m_platform == QStringLiteral("winrt"))
+ QEXPECT_FAIL("", "WinRT does not support move/resize", Abort);
QCOMPARE(w.size(), defaultSize + QSize(150,150));
}
@@ -4115,6 +4178,8 @@ void tst_QWidget::transientParent()
void tst_QWidget::showNativeChild()
{
+ if (m_platform == QStringLiteral("winrt"))
+ QSKIP("WinRT does not support setGeometry");
QWidget topLevel;
topLevel.setGeometry(QRect(m_availableTopLeft + QPoint(100, 100), m_testWidgetSize));
topLevel.setWindowTitle(__FUNCTION__);
@@ -4297,6 +4362,8 @@ void tst_QWidget::update()
// widgets are transparent by default, so both should get repaints
{
+ if (m_platform == QStringLiteral("winrt"))
+ QEXPECT_FAIL("", "WinRT does not support setGeometry", Abort);
QApplication::processEvents();
QApplication::processEvents();
QCOMPARE(child.numPaintEvents, 1);
@@ -4518,8 +4585,9 @@ void tst_QWidget::scroll()
{
if (m_platform == QStringLiteral("wayland"))
QSKIP("Wayland: This fails. Figure out why.");
- const int w = qMin(500, qApp->desktop()->availableGeometry().width() / 2);
- const int h = qMin(500, qApp->desktop()->availableGeometry().height() / 2);
+ QScreen *screen = QGuiApplication::primaryScreen();
+ const int w = qMin(500, screen->availableGeometry().width() / 2);
+ const int h = qMin(500, screen->availableGeometry().height() / 2);
UpdateWidget updateWidget;
updateWidget.resize(w, h);
@@ -4536,6 +4604,8 @@ void tst_QWidget::scroll()
qApp->processEvents();
QRegion dirty(QRect(0, 0, w, 10));
dirty += QRegion(QRect(0, 10, 10, h - 10));
+ if (m_platform == QStringLiteral("winrt"))
+ QEXPECT_FAIL("", "WinRT does not support move/resize", Abort);
QTRY_COMPARE(updateWidget.paintedRegion, dirty);
}
@@ -4647,7 +4717,7 @@ void tst_QWidget::setWindowGeometry_data()
QList<QList<QRect> > rects;
const int width = m_testWidgetSize.width();
const int height = m_testWidgetSize.height();
- const QRect availableAdjusted = QApplication::desktop()->availableGeometry().adjusted(100, 100, -100, -100);
+ const QRect availableAdjusted = QGuiApplication::primaryScreen()->availableGeometry().adjusted(100, 100, -100, -100);
rects << (QList<QRect>()
<< QRect(m_availableTopLeft + QPoint(100, 100), m_testWidgetSize)
<< availableAdjusted
@@ -4711,6 +4781,8 @@ void tst_QWidget::setWindowGeometry()
{
if (m_platform == QStringLiteral("xcb"))
QSKIP("X11: Skip this test due to Window manager positioning issues.");
+ else if (m_platform == QStringLiteral("winrt"))
+ QSKIP("WinRT does not support setWindowGeometry");
QFETCH(QList<QRect>, rects);
QFETCH(int, windowFlags);
@@ -4877,6 +4949,8 @@ void tst_QWidget::windowMoveResize()
QSKIP("X11: Skip this test due to Window manager positioning issues.");
if (m_platform == QStringLiteral("wayland"))
QSKIP("Wayland: This fails. Figure out why.");
+ if (m_platform == QStringLiteral("winrt"))
+ QSKIP("WinRT does not support move/resize");
QFETCH(QList<QRect>, rects);
QFETCH(int, windowFlags);
@@ -5197,6 +5271,9 @@ void tst_QWidget::moveChild()
QTRY_COMPARE(parent.r, QRegion(parent.rect()) - child.geometry());
QTRY_COMPARE(child.r, QRegion(child.rect()));
+
+ if (m_platform == QStringLiteral("winrt"))
+ QSKIP("WinRT does not support setGeometry (and we cannot use QEXPECT_FAIL because of VERIFY_COLOR)");
VERIFY_COLOR(child, child.rect(),
child.color);
VERIFY_COLOR(parent, QRegion(parent.rect()) - child.geometry(), parent.color);
@@ -5253,6 +5330,8 @@ void tst_QWidget::showAndMoveChild()
child.move(desktopDimensions.width()/2, desktopDimensions.height()/2);
qApp->processEvents();
+ if (m_platform == QStringLiteral("winrt"))
+ QSKIP("WinRT does not support setGeometry (and we cannot use QEXPECT_FAIL because of VERIFY_COLOR)");
VERIFY_COLOR(child, child.rect(), Qt::blue);
VERIFY_COLOR(parent, QRegion(parent.rect()) - child.geometry(), Qt::red);
}
@@ -5341,6 +5420,8 @@ void tst_QWidget::multipleToplevelFocusCheck()
if (m_platform == QStringLiteral("wayland"))
QSKIP("Wayland: This fails. Figure out why.");
+ else if (m_platform == QStringLiteral("winrt"))
+ QSKIP("Winrt: Sometimes crashes in QTextLayout. - QTBUG-68297");
TopLevelFocusCheck w1;
TopLevelFocusCheck w2;
@@ -5499,6 +5580,8 @@ void tst_QWidget::setFocus()
testWidget->clearFocus();
child1.setFocus();
+ if (m_platform == QStringLiteral("winrt"))
+ QEXPECT_FAIL("", "WinRT fails here - QTBUG-68297", Abort);
QVERIFY(!child1.hasFocus());
QCOMPARE(window.focusWidget(), &child1);
QCOMPARE(QApplication::focusWidget(), nullptr);
@@ -6185,8 +6268,8 @@ QByteArray EventRecorder::msgEventListMismatch(const EventList &expected, const
void tst_QWidget::childEvents()
{
- if (m_platform == QStringLiteral("wayland"))
- QSKIP("Wayland: This fails. Figure out why.");
+ if (m_platform == QStringLiteral("winrt"))
+ QSKIP("WinRT: This fails. QTBUG-68297.");
EventRecorder::EventList expected;
// Move away the cursor; otherwise it might result in an enter event if it's
@@ -6582,6 +6665,8 @@ void tst_QWidget::renderInvisible()
{
if (m_platform == QStringLiteral("xcb"))
QSKIP("QTBUG-26424");
+ if (m_platform == QStringLiteral("winrt"))
+ QSKIP("WinRT: This fails. QTBUG-68297.");
QScopedPointer<QCalendarWidget> calendar(new QCalendarWidget);
calendar->move(m_availableTopLeft + QPoint(100, 100));
@@ -7430,7 +7515,7 @@ void tst_QWidget::moveWindowInShowEvent_data()
QTest::addColumn<QPoint>("initial");
QTest::addColumn<QPoint>("position");
- QPoint p = QApplication::desktop()->availableGeometry().topLeft();
+ QPoint p = QGuiApplication::primaryScreen()->availableGeometry().topLeft();
QTest::newRow("1") << p << (p + QPoint(10, 10));
QTest::newRow("2") << (p + QPoint(10,10)) << p;
@@ -7455,7 +7540,8 @@ void tst_QWidget::moveWindowInShowEvent()
};
MoveWindowInShowEventWidget widget;
- widget.resize(QSize(qApp->desktop()->availableGeometry().size() / 3).expandedTo(QSize(1, 1)));
+ QScreen *screen = QGuiApplication::primaryScreen();
+ widget.resize(QSize(screen->availableGeometry().size() / 3).expandedTo(QSize(1, 1)));
// move to this position in showEvent()
widget.position = position;
@@ -7524,6 +7610,8 @@ void tst_QWidget::hideOpaqueChildWhileHidden()
child.hide();
child2.hide();
+ if (m_platform == QStringLiteral("winrt"))
+ QEXPECT_FAIL("", "WinRT: This fails. QTBUG-68297.", Abort);
QTRY_COMPARE(w.r, QRegion(child.geometry()));
child.show();
@@ -7561,6 +7649,8 @@ void tst_QWidget::updateWhileMinimized()
// Make sure update requests are discarded until the widget is shown again.
widget.update(0, 0, 50, 50);
QTest::qWait(10);
+ if (m_platform == QStringLiteral("winrt"))
+ QEXPECT_FAIL("", "WinRT: This fails. QTBUG-68297.", Abort);
QCOMPARE(widget.numPaintEvents, 0);
// Restore window.
@@ -8088,6 +8178,8 @@ void tst_QWidget::doubleRepaint()
#if defined(Q_OS_QNX)
QEXPECT_FAIL("", "Platform does not support showMinimized()", Continue);
#endif
+ if (m_platform == QStringLiteral("winrt"))
+ QEXPECT_FAIL("", "WinRT: This fails. QTBUG-68297.", Abort);
QCOMPARE(widget.numPaintEvents, 0);
widget.numPaintEvents = 0;
@@ -8105,7 +8197,7 @@ void tst_QWidget::resizeInPaintEvent()
window.resize(200, 200);
window.show();
qApp->setActiveWindow(&window);
- QVERIFY(QTest::qWaitForWindowActive(&window));
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
QTRY_VERIFY(widget.numPaintEvents > 0);
widget.reset();
@@ -8217,6 +8309,8 @@ void tst_QWidget::setMaskInResizeEvent()
QRegion expectedParentUpdate(0, 0, 100, 10); // Old testWidget area.
expectedParentUpdate += testWidget.geometry(); // New testWidget area.
+ if (m_platform == QStringLiteral("winrt"))
+ QEXPECT_FAIL("", "WinRT: This fails. QTBUG-68297.", Abort);
QTRY_COMPARE(w.paintedRegion, expectedParentUpdate);
QTRY_COMPARE(testWidget.paintedRegion, testWidget.mask());
@@ -8645,7 +8739,7 @@ void tst_QWidget::translucentWidget()
ColorRedWidget label;
label.setFixedSize(16,16);
label.setAttribute(Qt::WA_TranslucentBackground);
- const QPoint labelPos = qApp->desktop()->availableGeometry().topLeft();
+ const QPoint labelPos = QGuiApplication::primaryScreen()->availableGeometry().topLeft();
label.move(labelPos);
label.show();
QVERIFY(QTest::qWaitForWindowExposed(&label));
@@ -8661,6 +8755,8 @@ void tst_QWidget::translucentWidget()
widgetSnapshot = label.grab(QRect(QPoint(0, 0), label.size()));
const QImage actual = widgetSnapshot.toImage().convertToFormat(QImage::Format_RGB32);
const QImage expected = pm.toImage().scaled(label.devicePixelRatioF() * pm.size());
+ if (m_platform == QStringLiteral("winrt"))
+ QEXPECT_FAIL("", "WinRT: This fails. QTBUG-68297.", Abort);
QCOMPARE(actual.size(),expected.size());
QCOMPARE(actual,expected);
}
@@ -8704,7 +8800,7 @@ void tst_QWidget::setClearAndResizeMask()
centerOnScreen(&topLevel);
topLevel.show();
qApp->setActiveWindow(&topLevel);
- QVERIFY(QTest::qWaitForWindowActive(&topLevel));
+ QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
QTRY_VERIFY(topLevel.numPaintEvents > 0);
topLevel.reset();
@@ -9104,7 +9200,7 @@ void tst_QWidget::syntheticEnterLeave()
void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave()
{
if (m_platform == QStringLiteral("wayland"))
- QSKIP("Wayland: This fails. Figure out why.");
+ QSKIP("Wayland: Clients can't set cursor position on wayland.");
class SELParent : public QWidget
{
public:
@@ -9122,7 +9218,8 @@ void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave()
void mouseMoveEvent(QMouseEvent *event)
{
QCOMPARE(event->button(), Qt::NoButton);
- QCOMPARE(event->buttons(), Qt::MouseButtons(Qt::NoButton));
+ QCOMPARE(event->buttons(), QApplication::mouseButtons());
+ QCOMPARE(event->modifiers(), QApplication::keyboardModifiers());
++numMouseMoveEvents;
}
void reset() { numEnterEvents = numMouseMoveEvents = 0; }
@@ -9156,11 +9253,11 @@ void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave()
child.setMouseTracking(true);
child.show();
- // Make sure the child gets enter event and mouse move event.
+ // Make sure the child gets enter event.
// Note that we verify event->button() and event->buttons()
// in SELChild::mouseMoveEvent().
QTRY_COMPARE(child.numEnterEvents, 1);
- QCOMPARE(child.numMouseMoveEvents, 1);
+ QCOMPARE(child.numMouseMoveEvents, 0);
// Sending synthetic enter/leave trough the parent's mousePressEvent handler.
parent.child = &child;
@@ -9169,12 +9266,21 @@ void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave()
child.reset();
QTest::mouseClick(&parent, Qt::LeftButton);
- // Make sure the child gets enter event and one mouse move event.
+ // Make sure the child gets enter event.
QTRY_COMPARE(child.numEnterEvents, 1);
- QCOMPARE(child.numMouseMoveEvents, 1);
+ QCOMPARE(child.numMouseMoveEvents, 0);
child.hide();
child.reset();
+ QTest::keyPress(&parent, Qt::Key_Shift);
+ QTest::mouseClick(&parent, Qt::LeftButton);
+
+ // Make sure the child gets enter event
+ QTRY_COMPARE(child.numEnterEvents, 1);
+ QCOMPARE(child.numMouseMoveEvents, 0);
+ QTest::keyRelease(&child, Qt::Key_Shift);
+ child.hide();
+ child.reset();
child.setMouseTracking(false);
QTest::mouseClick(&parent, Qt::LeftButton);
@@ -9351,6 +9457,8 @@ void tst_QWidget::rectOutsideCoordinatesLimit_task144779()
correct.fill(Qt::green);
const QPixmap mainPixmap = grabFromWidget(&main, QRect(QPoint(0, 0), QSize(-1, -1)));
+ if (m_platform == QStringLiteral("winrt"))
+ QEXPECT_FAIL("", "WinRT: This fails. QTBUG-68297.", Abort);
QTRY_COMPARE(mainPixmap.toImage().convertToFormat(QImage::Format_RGB32),
correct.toImage().convertToFormat(QImage::Format_RGB32));
#ifndef QT_NO_CURSOR
@@ -9442,6 +9550,8 @@ void tst_QWidget::activateWindow()
qApp->processEvents();
QTRY_VERIFY(mainwindow->isActiveWindow());
+ if (m_platform == QStringLiteral("winrt"))
+ QEXPECT_FAIL("", "WinRT: This fails. QTBUG-68297.", Abort);
QTRY_VERIFY(!mainwindow2->isActiveWindow());
}
@@ -9960,9 +10070,6 @@ public:
void tst_QWidget::touchEventSynthesizedMouseEvent()
{
- if (m_platform == QStringLiteral("wayland"))
- QSKIP("Wayland: This fails. Figure out why.");
-
{
// Simple case, we ignore the touch events, we get mouse events instead
TouchMouseWidget widget;
@@ -10544,7 +10651,7 @@ void tst_QWidget::keyboardModifiers()
KeyboardWidget w;
w.resize(300, 300);
w.show();
- QVERIFY(QTest::qWaitForWindowActive(&w));
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
QTest::mouseClick(&w, Qt::LeftButton, Qt::ControlModifier);
QCOMPARE(w.m_eventCounter, 1);
QCOMPARE(int(w.m_modifiers), int(Qt::ControlModifier));
@@ -10605,6 +10712,8 @@ void tst_QWidget::resizeStaticContentsChildWidget_QTBUG35282()
widget.showNormal();
QVERIFY(QTest::qWaitForWindowExposed(&widget));
+ if (m_platform == QStringLiteral("winrt"))
+ QEXPECT_FAIL("", "WinRT: This fails. QTBUG-68297.", Abort);
QCOMPARE(childWidget.numPaintEvents, 0);
childWidget.reset();
diff --git a/tests/auto/widgets/kernel/qwidget_window/BLACKLIST b/tests/auto/widgets/kernel/qwidget_window/BLACKLIST
index d3bfaba433..c980325d9a 100644
--- a/tests/auto/widgets/kernel/qwidget_window/BLACKLIST
+++ b/tests/auto/widgets/kernel/qwidget_window/BLACKLIST
@@ -2,3 +2,6 @@
# QTBUG-66345
opensuse-42.3
ubuntu-16.04
+ubuntu-18.04
+[setWindowState]
+ubuntu-18.04
diff --git a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
index b143555b0d..f4da4c3e5f 100644
--- a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
+++ b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
@@ -44,6 +44,8 @@
#include <qmainwindow.h>
#include <qtoolbar.h>
#include <private/qwindow_p.h>
+#include <private/qguiapplication_p.h>
+#include <qpa/qplatformintegration.h>
#include <QtTest/private/qtesthelpers_p.h>
@@ -79,10 +81,12 @@ private slots:
void tst_showWithoutActivating();
void tst_paintEventOnSecondShow();
+ void tst_exposeObscuredMapped_QTBUG39220();
void tst_paintEventOnResize_QTBUG50796();
#if QT_CONFIG(draganddrop)
void tst_dnd();
+ void tst_dnd_events();
#endif
void tst_qtbug35600();
@@ -156,6 +160,9 @@ void tst_QWidget_window::tst_move_show()
QWidget w;
w.move(100, 100);
w.show();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Winrt does not support move", Abort);
+#endif
QCOMPARE(w.pos(), QPoint(100, 100));
// QCoreApplication::processEvents(QEventLoop::AllEvents, 3000);
}
@@ -185,6 +192,9 @@ void tst_QWidget_window::tst_resize_show()
QWidget w;
w.resize(200, 200);
w.show();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Winrt does not support resize", Abort);
+#endif
QCOMPARE(w.size(), QSize(200, 200));
// QCoreApplication::processEvents(QEventLoop::AllEvents, 1000);
}
@@ -370,6 +380,33 @@ void tst_QWidget_window::tst_paintEventOnSecondShow()
QTRY_VERIFY(w.paintEventCount > 0);
}
+void tst_QWidget_window::tst_exposeObscuredMapped_QTBUG39220()
+{
+ const auto integration = QGuiApplicationPrivate::platformIntegration();
+ if (!integration->hasCapability(QPlatformIntegration::MultipleWindows)
+ || !integration->hasCapability(QPlatformIntegration::NonFullScreenWindows)
+ || QGuiApplication::platformName() == QLatin1String("winrt")) {
+ QSKIP("The platform does not have the required capabilities");
+ }
+ // QTBUG-39220: Fully obscured parent widgets may not receive expose
+ // events (as is the case for frameless, obscured parents on Windows).
+ // Ensure Qt::WA_Mapped is set so updating works.
+ const QRect availableGeometry = QGuiApplication::primaryScreen()->availableGeometry();
+ const QSize size = availableGeometry.size() / 6;
+ QWidget topLevel;
+ setFrameless(&topLevel);
+ topLevel.resize(size);
+ const QPoint sizeP(size.width(), size.height());
+ topLevel.move(availableGeometry.center() - sizeP / 2);
+ QWidget *child = new QWidget(&topLevel);
+ child->resize(size);
+ child->move(0, 0);
+ QVERIFY(child->winId());
+ topLevel.show();
+ QTRY_VERIFY(child->testAttribute(Qt::WA_Mapped));
+ QVERIFY(topLevel.testAttribute(Qt::WA_Mapped));
+}
+
void tst_QWidget_window::tst_paintEventOnResize_QTBUG50796()
{
const QRect availableGeo = QGuiApplication::primaryScreen()->availableGeometry();
@@ -416,6 +453,7 @@ static const char *expectedLogC[] = {
"Event at 11,81 ignored",
"Event at 11,101 ignored",
"acceptingDropsWidget1::dragEnterEvent at 1,11 action=1 MIME_DATA_ADDRESS 'testmimetext'",
+ "acceptingDropsWidget1::dragMoveEvent at 1,11 action=1 MIME_DATA_ADDRESS 'testmimetext'",
"Event at 11,121 accepted",
"acceptingDropsWidget1::dragMoveEvent at 1,31 action=1 MIME_DATA_ADDRESS 'testmimetext'",
"Event at 11,141 accepted",
@@ -426,6 +464,7 @@ static const char *expectedLogC[] = {
"acceptingDropsWidget1::dragLeaveEvent QDragLeaveEvent",
"Event at 11,201 ignored",
"acceptingDropsWidget2::dragEnterEvent at 1,11 action=1 MIME_DATA_ADDRESS 'testmimetext'",
+ "acceptingDropsWidget2::dragMoveEvent at 1,11 action=1 MIME_DATA_ADDRESS 'testmimetext'",
"Event at 11,221 accepted",
"acceptingDropsWidget2::dragMoveEvent at 1,31 action=1 MIME_DATA_ADDRESS 'testmimetext'",
"Event at 11,241 accepted",
@@ -591,6 +630,92 @@ void tst_QWidget_window::tst_dnd()
QCOMPARE(log, expectedLog);
}
+
+class DnDEventRecorder : public QWidget
+{
+ Q_OBJECT
+public:
+ QString _dndEvents;
+ DnDEventRecorder() { setAcceptDrops(true); }
+
+protected:
+ void mousePressEvent(QMouseEvent *)
+ {
+ QMimeData *mimeData = new QMimeData;
+ mimeData->setData("application/x-dnditemdata", "some data");
+ QDrag *drag = new QDrag(this);
+ drag->setMimeData(mimeData);
+ drag->exec();
+ }
+
+ void dragEnterEvent(QDragEnterEvent *e)
+ {
+ e->accept();
+ _dndEvents.append(QStringLiteral("DragEnter "));
+ }
+ void dragMoveEvent(QDragMoveEvent *e)
+ {
+ e->accept();
+ _dndEvents.append(QStringLiteral("DragMove "));
+ emit releaseMouseButton();
+ }
+ void dragLeaveEvent(QDragLeaveEvent *e)
+ {
+ e->accept();
+ _dndEvents.append(QStringLiteral("DragLeave "));
+ }
+ void dropEvent(QDropEvent *e)
+ {
+ e->accept();
+ _dndEvents.append(QStringLiteral("DropEvent "));
+ }
+
+signals:
+ void releaseMouseButton();
+};
+
+void tst_QWidget_window::tst_dnd_events()
+{
+ // Note: This test is somewhat a hack as testing DnD with qtestlib is not
+ // supported at the moment. The test verifies that we get an expected event
+ // sequence on dnd operation that does not move a mouse. This logic is implemented
+ // in QGuiApplication, so we have to go via QWindowSystemInterface API (QTest::mouse*).
+ const auto platformName = QGuiApplication::platformName().toLower();
+ // The test is known to work with XCB and platforms that use the default dnd
+ // implementation QSimpleDrag (e.g. qnx). Running on XCB should be sufficient to
+ // catch regressions at cross platform code: QGuiApplication::processDrag/Leave().
+ if (platformName != "xcb")
+ return;
+
+ const QString expectedDndEvents = "DragEnter DragMove DropEvent DragEnter DragMove "
+ "DropEvent DragEnter DragMove DropEvent ";
+ DnDEventRecorder dndWidget;
+ dndWidget.setGeometry(100, 100, 200, 200);
+ dndWidget.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&dndWidget));
+ QVERIFY(QTest::qWaitForWindowActive(&dndWidget));
+
+ // ### FIXME - QTBUG-35117 ???
+ auto targetCenter = QPoint(dndWidget.width(), dndWidget.height()) / 2;
+ auto targetCenterGlobal = dndWidget.mapToGlobal(targetCenter);
+ QCursor::setPos(targetCenterGlobal);
+ QVERIFY(QTest::qWaitFor([&]() { return QCursor::pos() == targetCenterGlobal; }));
+ QCoreApplication::processEvents(); // clear mouse events generated from cursor
+
+ auto window = dndWidget.window()->windowHandle();
+
+ // Some dnd implementation rely on running internal event loops, so we have to use
+ // the following queued signal hack to simulate mouse clicks in the widget.
+ QObject::connect(&dndWidget, &DnDEventRecorder::releaseMouseButton, this, [=]() {
+ QTest::mouseRelease(window, Qt::LeftButton);
+ }, Qt::QueuedConnection);
+
+ QTest::mousePress(window, Qt::LeftButton);
+ QTest::mousePress(window, Qt::LeftButton);
+ QTest::mousePress(window, Qt::LeftButton);
+
+ QCOMPARE(dndWidget._dndEvents, expectedDndEvents);
+}
#endif
void tst_QWidget_window::tst_qtbug35600()
@@ -704,6 +829,9 @@ void tst_QWidget_window::tst_resize_count()
ResizeWidget resize;
resize.show();
QVERIFY(QTest::qWaitForWindowExposed(&resize));
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Winrt does not support resize", Abort);
+#endif
QCOMPARE(resize.resizeCount, 1);
resize.resizeCount = 0;
QSize size = resize.size();
@@ -901,6 +1029,11 @@ void tst_QWidget_window::setWindowState()
w.setWindowState(state);
QCOMPARE(w.windowState(), state);
w.show();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("0", "Winrt windows are maximized by default", Abort);
+ QEXPECT_FAIL("Qt::WindowMinimized", "Winrt windows are maximized by default", Abort);
+ QEXPECT_FAIL("Qt::WindowFullScreen", "Winrt windows are maximized by default", Abort);
+#endif
QCOMPARE(w.windowState(), state);
QCOMPARE(w.windowHandle()->windowStates(), state);
if (!(state & Qt::WindowMinimized))
diff --git a/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp b/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp
index c9c8e193b3..693a792f0a 100644
--- a/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp
+++ b/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp
@@ -104,6 +104,9 @@ void tst_QWindowContainer::testShow()
root.show();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on WinRT - QTBUG-68297", Abort);
+#endif
QVERIFY(QTest::qWaitForWindowExposed(window));
}
@@ -140,6 +143,9 @@ void tst_QWindowContainer::testExposeObscure()
container->show();
QVERIFY(QTest::qWaitForWindowExposed(container.data()));
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on WinRT - QTBUG-68297", Abort);
+#endif
QVERIFY(QTest::qWaitForWindowExposed(window));
QVERIFY(window->numberOfExposes > 0);
@@ -255,6 +261,9 @@ void tst_QWindowContainer::testUnparentReparent()
QTRY_VERIFY(!window->isVisible());
container->show();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on WinRT - QTBUG-68297", Abort);
+#endif
QVERIFY(QTest::qWaitForWindowExposed(window));
QTRY_VERIFY(window->isVisible());
@@ -359,6 +368,9 @@ void tst_QWindowContainer::testNativeContainerParent()
root.show();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on WinRT - QTBUG-68297", Abort);
+#endif
QVERIFY(QTest::qWaitForWindowExposed(window));
QTRY_COMPARE(window->parent(), container->windowHandle());
}
diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
index e49fd701d6..587e8a080d 100644
--- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
+++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
@@ -82,7 +82,7 @@ private slots:
void testFusionStyle();
#endif
void testWindowsStyle();
-#if defined(Q_OS_WIN) && !defined(QT_NO_STYLE_WINDOWSVISTA)
+#if defined(Q_OS_WIN) && !defined(QT_NO_STYLE_WINDOWSVISTA) && !defined(Q_OS_WINRT)
void testWindowsVistaStyle();
#endif
#ifdef Q_OS_MAC
@@ -198,6 +198,9 @@ void tst_QStyle::drawItemPixmap()
QVERIFY(image.reinterpretAsFormat(QImage::Format_RGB32));
const QRgb *bits = reinterpret_cast<const QRgb *>(image.constBits());
const QRgb *end = bits + image.byteCount() / sizeof(QRgb);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "QWidget::resize does not work on WinRT", Continue);
+#endif
QVERIFY(std::all_of(bits, end, [green] (QRgb r) { return r == green; }));
testWidget->hide();
}
@@ -344,7 +347,7 @@ QImage readImage(const QString &fileName)
}
-#if defined(Q_OS_WIN) && !defined(QT_NO_STYLE_WINDOWSVISTA)
+#if defined(Q_OS_WIN) && !defined(QT_NO_STYLE_WINDOWSVISTA) && !defined(Q_OS_WINRT)
void tst_QStyle::testWindowsVistaStyle()
{
QStyle *vistastyle = QStyleFactory::create("WindowsVista");
@@ -716,6 +719,9 @@ void tst_QStyle::testFrameOnlyAroundContents()
area.verticalScrollBar()->setStyle(&frameStyle);
area.setStyle(&frameStyle);
// Test that we reserve space for scrollbar spacing
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "QWidget::setGeometry does not work on WinRT", Continue);
+#endif
QVERIFY(viewPortWidth == area.viewport()->width() + SCROLLBAR_SPACING);
delete winStyle;
}
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/images/testimage.png b/tests/auto/widgets/styles/qstylesheetstyle/images/testimage.png
index 06fb34f0d6..a4adc7a47f 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/images/testimage.png
+++ b/tests/auto/widgets/styles/qstylesheetstyle/images/testimage.png
Binary files differ
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/images/testimage@2x.png b/tests/auto/widgets/styles/qstylesheetstyle/images/testimage@2x.png
new file mode 100644
index 0000000000..d55f0c507b
--- /dev/null
+++ b/tests/auto/widgets/styles/qstylesheetstyle/images/testimage@2x.png
Binary files differ
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/resources.qrc b/tests/auto/widgets/styles/qstylesheetstyle/resources.qrc
index 248bf80f50..f523070073 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/resources.qrc
+++ b/tests/auto/widgets/styles/qstylesheetstyle/resources.qrc
@@ -2,5 +2,6 @@
<RCC version="1.0">
<qresource>
<file>images/testimage.png</file>
+ <file>images/testimage@2x.png</file>
</qresource>
</RCC> \ No newline at end of file
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
index 6d47d5cfb6..f5d9433f70 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -33,6 +33,7 @@
#include <QMetaObject>
#include <private/qstylesheetstyle_p.h>
+#include <private/qhighdpiscaling_p.h>
#include <QtTest/private/qtesthelpers_p.h>
using namespace QTestPrivate;
@@ -98,7 +99,12 @@ private slots:
void widgetStyle();
void appStyle();
void QTBUG11658_cachecrash();
+ void styleSheetTargetAttribute();
void unpolish();
+
+ void highdpiImages_data();
+ void highdpiImages();
+
private:
QColor COLOR(const QWidget& w) {
w.ensurePolished();
@@ -2000,6 +2006,59 @@ void tst_QStyleSheetStyle::widgetStylePropagation()
QCOMPARE(COLOR(childLabel), childExpectedColor);
}
+void tst_QStyleSheetStyle::styleSheetTargetAttribute()
+{
+ QGroupBox gb;
+ QLabel lb(&gb);
+ QPushButton pb(&lb);
+
+ gb.ensurePolished(); lb.ensurePolished(); pb.ensurePolished();
+ QCOMPARE(gb.testAttribute(Qt::WA_StyleSheetTarget), false);
+ QCOMPARE(lb.testAttribute(Qt::WA_StyleSheetTarget), false);
+ QCOMPARE(pb.testAttribute(Qt::WA_StyleSheetTarget), false);
+
+ qApp->setStyleSheet("QPushButton { background-color: blue; }");
+
+ gb.ensurePolished(); lb.ensurePolished(); pb.ensurePolished();
+ QCOMPARE(gb.testAttribute(Qt::WA_StyleSheetTarget), false);
+ QCOMPARE(lb.testAttribute(Qt::WA_StyleSheetTarget), false);
+ QCOMPARE(pb.testAttribute(Qt::WA_StyleSheetTarget), true);
+
+ qApp->setStyleSheet("QGroupBox { background-color: blue; }");
+
+ gb.ensurePolished(); lb.ensurePolished(); pb.ensurePolished();
+ QCOMPARE(gb.testAttribute(Qt::WA_StyleSheetTarget), true);
+ QCOMPARE(lb.testAttribute(Qt::WA_StyleSheetTarget), false);
+ QCOMPARE(pb.testAttribute(Qt::WA_StyleSheetTarget), false);
+
+ qApp->setStyleSheet("QGroupBox * { background-color: blue; }");
+
+ gb.ensurePolished(); lb.ensurePolished(); pb.ensurePolished();
+ QCOMPARE(gb.testAttribute(Qt::WA_StyleSheetTarget), false);
+ QCOMPARE(lb.testAttribute(Qt::WA_StyleSheetTarget), true);
+ QCOMPARE(pb.testAttribute(Qt::WA_StyleSheetTarget), true);
+
+ qApp->setStyleSheet("* { background-color: blue; }");
+ gb.ensurePolished(); lb.ensurePolished(); pb.ensurePolished();
+ QCOMPARE(gb.testAttribute(Qt::WA_StyleSheetTarget), true);
+ QCOMPARE(lb.testAttribute(Qt::WA_StyleSheetTarget), true);
+ QCOMPARE(pb.testAttribute(Qt::WA_StyleSheetTarget), true);
+
+ qApp->setStyleSheet("QLabel { font-size: 32pt; }");
+
+ gb.ensurePolished(); lb.ensurePolished(); pb.ensurePolished();
+ QCOMPARE(gb.testAttribute(Qt::WA_StyleSheetTarget), false);
+ QCOMPARE(lb.testAttribute(Qt::WA_StyleSheetTarget), true);
+ QCOMPARE(pb.testAttribute(Qt::WA_StyleSheetTarget), false);
+
+ qApp->setStyleSheet("");
+
+ gb.ensurePolished(); lb.ensurePolished(); pb.ensurePolished();
+ QCOMPARE(gb.testAttribute(Qt::WA_StyleSheetTarget), false);
+ QCOMPARE(lb.testAttribute(Qt::WA_StyleSheetTarget), false);
+ QCOMPARE(pb.testAttribute(Qt::WA_StyleSheetTarget), false);
+}
+
void tst_QStyleSheetStyle::unpolish()
{
QWidget w;
@@ -2011,6 +2070,35 @@ void tst_QStyleSheetStyle::unpolish()
QCOMPARE(w.minimumWidth(), 0);
}
+void tst_QStyleSheetStyle::highdpiImages_data()
+{
+ QTest::addColumn<qreal>("screenFactor");
+ QTest::addColumn<QColor>("color");
+
+ QTest::newRow("highdpi") << 2.0 << QColor(0x00, 0xFF, 0x00);
+ QTest::newRow("lowdpi") << 1.0 << QColor(0xFF, 0x00, 0x00);
+}
+
+void tst_QStyleSheetStyle::highdpiImages()
+{
+ QFETCH(qreal, screenFactor);
+ QFETCH(QColor, color);
+
+ QWidget w;
+ QScreen *screen = QGuiApplication::screenAt(w.pos());
+ QHighDpiScaling::setScreenFactor(screen, screenFactor);
+ w.setStyleSheet("QWidget { background-image: url(\":/images/testimage.png\"); }");
+ w.show();
+
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
+ QImage image(w.size(), QImage::Format_ARGB32);
+ w.render(&image);
+ QVERIFY(testForColors(image, color));
+
+ QHighDpiScaling::setScreenFactor(screen, 1.0);
+ QHighDpiScaling::updateHighDpiScaling(); // reset to normal
+}
+
QTEST_MAIN(tst_QStyleSheetStyle)
#include "tst_qstylesheetstyle.moc"
diff --git a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
index 0511c278d5..ad64f1aef7 100644
--- a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
+++ b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
@@ -621,6 +621,9 @@ void tst_QCompleter::directoryModel_data()
void tst_QCompleter::directoryModel()
{
+#ifdef Q_OS_WINRT
+ QSKIP("WinRT cannot access directories outside of the application's sandbox");
+#endif
filter();
}
@@ -667,6 +670,9 @@ void tst_QCompleter::fileSystemModel_data()
void tst_QCompleter::fileSystemModel()
{
+#ifdef Q_OS_WINRT
+ QSKIP("WinRT cannot access directories outside of the application's sandbox");
+#endif
//QFileSystemModel is assync.
filter(true);
}
@@ -1696,6 +1702,9 @@ void tst_QCompleter::QTBUG_14292_filesystem()
// Wait for all file system model slots/timers to trigger
// until the model sees the subdirectories.
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on WinRT - QTBUG-68297", Abort);
+#endif
QTRY_VERIFY(testFileSystemReady(model));
// But this should not cause the combo to pop up.
QVERIFY(!comp.popup()->isVisible());
diff --git a/tests/auto/widgets/widgets/qabstractscrollarea/tst_qabstractscrollarea.cpp b/tests/auto/widgets/widgets/qabstractscrollarea/tst_qabstractscrollarea.cpp
index 372a467ada..007825d39c 100644
--- a/tests/auto/widgets/widgets/qabstractscrollarea/tst_qabstractscrollarea.cpp
+++ b/tests/auto/widgets/widgets/qabstractscrollarea/tst_qabstractscrollarea.cpp
@@ -334,6 +334,10 @@ void tst_QAbstractScrollArea::task214488_layoutDirection()
int refValue = hbar->value();
qApp->sendEvent(&scrollArea, new QKeyEvent(QEvent::KeyPress, key, Qt::NoModifier));
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "WinRT: Scrollbar is not guaranteed to be visible, as QWidget::resize does not"
+ "work", Abort);
+#endif
QVERIFY(lessThan ? (hbar->value() < refValue) : (hbar->value() > refValue));
}
diff --git a/tests/auto/widgets/widgets/qcalendarwidget/tst_qcalendarwidget.cpp b/tests/auto/widgets/widgets/qcalendarwidget/tst_qcalendarwidget.cpp
index 5c0f4b1536..312ec0b1ec 100644
--- a/tests/auto/widgets/widgets/qcalendarwidget/tst_qcalendarwidget.cpp
+++ b/tests/auto/widgets/widgets/qcalendarwidget/tst_qcalendarwidget.cpp
@@ -153,6 +153,9 @@ void tst_QCalendarWidget::getSetCheck()
void tst_QCalendarWidget::buttonClickCheck()
{
+#ifdef Q_OS_WINRT
+ QSKIP("Fails on WinRT - QTBUG-68297");
+#endif
QCalendarWidget object;
QSize size = object.sizeHint();
object.setGeometry(0,0,size.width(), size.height());
@@ -283,6 +286,10 @@ void tst_QCalendarWidget::showPrevNext()
QFETCH(QDate, dateOrigin);
QFETCH(QDate, expectedDate);
+#ifdef Q_OS_WINRT
+ QSKIP("Fails on WinRT - QTBUG-68297");
+#endif
+
QCalendarWidget calWidget;
calWidget.show();
QVERIFY(QTest::qWaitForWindowExposed(&calWidget));
diff --git a/tests/auto/widgets/widgets/qcombobox/qcombobox.pro b/tests/auto/widgets/widgets/qcombobox/qcombobox.pro
index 939153dc88..ba25a85634 100644
--- a/tests/auto/widgets/widgets/qcombobox/qcombobox.pro
+++ b/tests/auto/widgets/widgets/qcombobox/qcombobox.pro
@@ -1,4 +1,7 @@
CONFIG += testcase
TARGET = tst_qcombobox
QT += widgets widgets-private gui-private core-private testlib testlib-private
+DEFINES += QTEST_QPA_MOUSE_HANDLING
SOURCES += tst_qcombobox.cpp
+
+TESTDATA += qtlogo.png qtlogoinverted.png
diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
index 7c1deb8fff..943fb997cd 100644
--- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
@@ -1672,6 +1672,9 @@ void tst_QComboBox::setCustomModelAndView()
const QRect subItemRect = view->visualRect(model->indexFromItem(subItem));
QWidget *window = view->window();
QTest::mouseClick(window->windowHandle(), Qt::LeftButton, 0, view->mapTo(window, subItemRect.center()));
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on WinRT - QTBUG-68297", Abort);
+#endif
QTRY_COMPARE(combo.currentText(), subItem21Text);
}
@@ -2188,8 +2191,8 @@ void tst_QComboBox::itemListPosition()
if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme())
useFullScreenForPopupMenu = theme->themeHint(QPlatformTheme::UseFullScreenForPopupMenu).toBool();
const QRect screen = useFullScreenForPopupMenu ?
- QApplication::desktop()->screenGeometry(scrNumber) :
- QApplication::desktop()->availableGeometry(scrNumber);
+ QApplication::screens().at(scrNumber)->geometry() :
+ QApplication::screens().at(scrNumber)->availableGeometry();
topLevel.move(screen.width() - topLevel.sizeHint().width() - 10, 0); //puts the combo to the top-right corner
@@ -2311,7 +2314,7 @@ void tst_QComboBox::task191329_size()
setFrameless(&tableCombo);
tableCombo.move(200, 200);
int rows;
- if (QApplication::desktop()->screenGeometry().height() < 480)
+ if (QApplication::primaryScreen()->geometry().height() < 480)
rows = 8;
else
rows = 15;
@@ -2376,6 +2379,9 @@ void tst_QComboBox::task190205_setModelAdjustToContents()
correctBox.addItems(finalContent);
correctBox.showNormal();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "WinRT does not support more than 1 native top level widget", Abort);
+#endif
QVERIFY(QTest::qWaitForWindowExposed(&box));
QVERIFY(QTest::qWaitForWindowExposed(&correctBox));
@@ -2390,8 +2396,7 @@ void tst_QComboBox::task248169_popupWithMinimalSize()
QComboBox comboBox;
comboBox.addItems(initialContent);
- QDesktopWidget desktop;
- QRect desktopSize = desktop.availableGeometry();
+ QRect desktopSize = QGuiApplication::primaryScreen()->availableGeometry();
comboBox.view()->setMinimumWidth(desktopSize.width() / 2);
comboBox.setGeometry(desktopSize.width() - (desktopSize.width() / 4), (desktopSize.width() / 4), (desktopSize.width() / 2), (desktopSize.width() / 4));
@@ -2407,6 +2412,7 @@ void tst_QComboBox::task248169_popupWithMinimalSize()
#if defined QT_BUILD_INTERNAL
QFrame *container = comboBox.findChild<QComboBoxPrivateContainer *>();
QVERIFY(container);
+ QDesktopWidget desktop;
QTRY_VERIFY(desktop.screenGeometry(container).contains(container->geometry()));
#endif
}
@@ -2719,32 +2725,18 @@ void tst_QComboBox::resetModel()
}
-static inline void centerCursor(const QWidget *w)
-{
-#ifndef QT_NO_CURSOR
- // Force cursor movement to prevent QCursor::setPos() from returning prematurely on QPA:
- const QPoint target(w->mapToGlobal(w->rect().center()));
- QCursor::setPos(QPoint(target.x() + 1, target.y()));
- QCursor::setPos(target);
-#else // !QT_NO_CURSOR
- Q_UNUSED(w)
-#endif
-}
-
void tst_QComboBox::keyBoardNavigationWithMouse()
{
QComboBox combo;
combo.setEditable(false);
setFrameless(&combo);
- combo.move(200, 200);
- for (int i = 0; i < 80; i++)
- combo.addItem( QString::number(i));
+ for (int i = 0; i < 200; i++)
+ combo.addItem(QString::number(i));
+ combo.move(200, 200);
combo.showNormal();
- centerCursor(&combo); // QTBUG-33973, cursor needs to be within view from start on Mac.
QApplication::setActiveWindow(&combo);
QVERIFY(QTest::qWaitForWindowActive(&combo));
- QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&combo));
QCOMPARE(combo.currentText(), QLatin1String("0"));
@@ -2752,18 +2744,12 @@ void tst_QComboBox::keyBoardNavigationWithMouse()
QTRY_VERIFY(combo.hasFocus());
QTest::keyClick(combo.lineEdit(), Qt::Key_Space);
- QTest::qWait(30);
QTRY_VERIFY(combo.view());
QTRY_VERIFY(combo.view()->isVisible());
- QTest::qWait(130);
QCOMPARE(combo.currentText(), QLatin1String("0"));
- // When calling cursor function, Windows CE responds with: This function is not supported on this system.
-#if !defined Q_OS_QNX
- // Force cursor movement to prevent QCursor::setPos() from returning prematurely on QPA:
- centerCursor(combo.view());
- QTest::qWait(200);
+ QTest::mouseMove(&combo, combo.rect().center());
#define GET_SELECTION(SEL) \
QCOMPARE(combo.view()->selectionModel()->selection().count(), 1); \
@@ -2771,23 +2757,19 @@ void tst_QComboBox::keyBoardNavigationWithMouse()
SEL = combo.view()->selectionModel()->selection().indexes().first().row()
int selection;
- GET_SELECTION(selection);
+ GET_SELECTION(selection); // get initial selection
- //since we moved the mouse is in the middle it should even be around 5;
- QVERIFY2(selection > 3, (QByteArrayLiteral("selection=") + QByteArray::number(selection)).constData());
-
- static const int final = 40;
+ const int final = 40;
for (int i = selection + 1; i <= final; i++)
{
QTest::keyClick(combo.view(), Qt::Key_Down);
- QTest::qWait(20);
GET_SELECTION(selection);
QCOMPARE(selection, i);
}
QTest::keyClick(combo.view(), Qt::Key_Enter);
QTRY_COMPARE(combo.currentText(), QString::number(final));
-#endif
+#undef GET_SELECTION
}
void tst_QComboBox::task_QTBUG_1071_changingFocusEmitsActivated()
@@ -3334,6 +3316,9 @@ void tst_QComboBox::task_QTBUG_56693_itemFontFromModel()
QVERIFY(container);
QVERIFY(QTest::qWaitForWindowExposed(container));
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on WinRT - QTBUG-68297", Abort);
+#endif
QCOMPARE(proxyStyle->italicItemsNo, 5);
box.hidePopup();
diff --git a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
index fa28ec2575..20aad6ba97 100644
--- a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
+++ b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
@@ -70,6 +70,7 @@
#include <QSignalSpy>
#include <QTestEventList>
#include <QDateEdit>
+#include <QProxyStyle>
#include <private/qdatetimeedit_p.h>
@@ -93,6 +94,46 @@ public:
friend class tst_QDateTimeEdit;
};
+class PressAndHoldStyle : public QProxyStyle
+{
+ Q_OBJECT
+public:
+ using QProxyStyle::QProxyStyle;
+
+ int styleHint(QStyle::StyleHint hint, const QStyleOption *option = nullptr,
+ const QWidget *widget = nullptr, QStyleHintReturn *returnData = nullptr) const override
+ {
+ switch (hint) {
+ case QStyle::SH_SpinBox_ClickAutoRepeatRate:
+ return 5;
+ case QStyle::SH_SpinBox_ClickAutoRepeatThreshold:
+ return 10;
+ default:
+ return QProxyStyle::styleHint(hint, option, widget, returnData);
+ }
+ }
+};
+
+class StepModifierStyle : public QProxyStyle
+{
+ Q_OBJECT
+public:
+ using QProxyStyle::QProxyStyle;
+
+ int styleHint(QStyle::StyleHint hint, const QStyleOption *option = nullptr,
+ const QWidget *widget = nullptr, QStyleHintReturn *returnData = nullptr) const override
+ {
+ switch (hint) {
+ case QStyle::SH_SpinBox_StepModifier:
+ return stepModifier;
+ default:
+ return QProxyStyle::styleHint(hint, option, widget, returnData);
+ }
+ }
+
+ Qt::KeyboardModifier stepModifier = Qt::ControlModifier;
+};
+
class tst_QDateTimeEdit : public QObject
{
Q_OBJECT
@@ -205,9 +246,8 @@ private slots:
void reverseTest();
void ddMMMMyyyy();
-#if QT_CONFIG(wheelevent)
+ void wheelEvent_data();
void wheelEvent();
-#endif
void specialValueCornerCase();
void cursorPositionOnInit();
@@ -245,14 +285,105 @@ private slots:
void dateEditCorrectSectionSize_data();
void dateEditCorrectSectionSize();
#endif
+
+ void stepModifierKeys_data();
+ void stepModifierKeys();
+
+ void stepModifierButtons_data();
+ void stepModifierButtons();
+
+ void stepModifierPressAndHold_data();
+ void stepModifierPressAndHold();
private:
EditorDateEdit* testWidget;
QWidget *testFocusWidget;
};
+typedef QList<QDate> DateList;
typedef QList<QTime> TimeList;
typedef QList<Qt::Key> KeyList;
+static QLatin1String modifierToName(Qt::KeyboardModifier modifier)
+{
+ switch (modifier) {
+ case Qt::NoModifier:
+ return QLatin1Literal("No");
+ break;
+ case Qt::ControlModifier:
+ return QLatin1Literal("Ctrl");
+ break;
+ case Qt::ShiftModifier:
+ return QLatin1Literal("Shift");
+ break;
+ case Qt::AltModifier:
+ return QLatin1Literal("Alt");
+ break;
+ case Qt::MetaModifier:
+ return QLatin1Literal("Meta");
+ break;
+ default:
+ qFatal("Unexpected keyboard modifier");
+ return QLatin1String();
+ }
+}
+
+static QLatin1String sectionToName(const QDateTimeEdit::Section section)
+{
+ switch (section) {
+ case QDateTimeEdit::SecondSection:
+ return QLatin1Literal("Second");
+ case QDateTimeEdit::MinuteSection:
+ return QLatin1Literal("Minute");
+ case QDateTimeEdit::HourSection:
+ return QLatin1Literal("Hours");
+ case QDateTimeEdit::DaySection:
+ return QLatin1Literal("Day");
+ case QDateTimeEdit::MonthSection:
+ return QLatin1Literal("Month");
+ case QDateTimeEdit::YearSection:
+ return QLatin1Literal("Year");
+ default:
+ qFatal("Unexpected section");
+ return QLatin1String();
+ }
+}
+
+static QDate stepDate(const QDate& startDate, const QDateTimeEdit::Section section,
+ const int steps)
+{
+ switch (section) {
+ case QDateTimeEdit::DaySection:
+ return startDate.addDays(steps);
+ case QDateTimeEdit::MonthSection:
+ return startDate.addMonths(steps);
+ case QDateTimeEdit::YearSection:
+ return startDate.addYears(steps);
+ default:
+ qFatal("Unexpected section");
+ return QDate();
+ }
+}
+
+static QTime stepTime(const QTime& startTime, const QDateTimeEdit::Section section,
+ const int steps)
+{
+ switch (section) {
+ case QDateTimeEdit::SecondSection:
+ return startTime.addSecs(steps);
+ case QDateTimeEdit::MinuteSection:
+ return QTime(startTime.hour(),
+ startTime.minute() + steps,
+ startTime.second());
+ case QDateTimeEdit::HourSection:
+ return QTime(startTime.hour() + steps,
+ startTime.minute(),
+ startTime.second());
+ default:
+ qFatal("Unexpected section");
+ return QTime();
+ }
+}
+
// Testing get/set functions
void tst_QDateTimeEdit::getSetCheck()
{
@@ -326,6 +457,8 @@ void tst_QDateTimeEdit::cleanup()
testWidget->setTimeSpec(Qt::LocalTime);
testWidget->setSpecialValueText(QString());
testWidget->setWrapping(false);
+ // Restore the default.
+ testWidget->setCalendarPopup(false);
}
void tst_QDateTimeEdit::constructor_qwidget()
@@ -3000,20 +3133,176 @@ void tst_QDateTimeEdit::ddMMMMyyyy()
QCOMPARE(testWidget->lineEdit()->text(), "01." + QDate::longMonthName(1) + ".200");
}
+void tst_QDateTimeEdit::wheelEvent_data()
+{
#if QT_CONFIG(wheelevent)
+ QTest::addColumn<QPoint>("angleDelta");
+ QTest::addColumn<int>("qt4Delta");
+ QTest::addColumn<int>("stepModifier");
+ QTest::addColumn<Qt::KeyboardModifiers>("modifiers");
+ QTest::addColumn<Qt::MouseEventSource>("source");
+ QTest::addColumn<QDateTimeEdit::Section>("section");
+ QTest::addColumn<QDate>("startDate");
+ QTest::addColumn<DateList>("expectedDates");
+
+ const auto fractions = {false, true};
+
+ const auto directions = {true, false};
+
+ const auto modifierList = {Qt::NoModifier,
+ Qt::ShiftModifier,
+ Qt::ControlModifier,
+ Qt::AltModifier,
+ Qt::MetaModifier};
+
+ const auto validStepModifierList = {Qt::NoModifier,
+ Qt::ControlModifier,
+ Qt::ShiftModifier};
+
+ const auto sources = {Qt::MouseEventNotSynthesized,
+ Qt::MouseEventSynthesizedBySystem,
+ Qt::MouseEventSynthesizedByQt,
+ Qt::MouseEventSynthesizedByApplication};
+
+ const auto sections = {QDateTimeEdit::DaySection,
+ QDateTimeEdit::MonthSection,
+ QDateTimeEdit::YearSection};
+
+ for (auto fraction : fractions) {
+ for (auto up : directions) {
+
+ const QDate startDate(2000, up ? 2 : 12, 17);
+
+ const int units = (fraction ? 60 : 120) * (up ? 1 : -1);
+
+ for (auto modifier : modifierList) {
+
+ const Qt::KeyboardModifiers modifiers(modifier);
+
+ const auto modifierName = modifierToName(modifier);
+ if (modifierName.isEmpty())
+ continue;
+
+ for (auto stepModifier : validStepModifierList) {
+
+ const auto stepModifierName = modifierToName(stepModifier);
+ if (stepModifierName.isEmpty())
+ continue;
+
+ const int steps = (modifier & stepModifier ? 10 : 1)
+ * (up ? 1 : -1);
+
+ for (auto source : sources) {
+
+#ifdef Q_OS_MACOS
+ QPoint angleDelta;
+ if ((modifier & Qt::ShiftModifier) &&
+ source == Qt::MouseEventNotSynthesized) {
+ // On macOS the Shift modifier converts vertical
+ // mouse wheel events to horizontal.
+ angleDelta = { units, 0 };
+ } else {
+ // However, this is not the case for trackpad scroll
+ // events.
+ angleDelta = { 0, units };
+ }
+#else
+ const QPoint angleDelta(0, units);
+#endif
+
+ QLatin1String sourceName;
+ switch (source) {
+ case Qt::MouseEventNotSynthesized:
+ sourceName = QLatin1Literal("NotSynthesized");
+ break;
+ case Qt::MouseEventSynthesizedBySystem:
+ sourceName = QLatin1Literal("SynthesizedBySystem");
+ break;
+ case Qt::MouseEventSynthesizedByQt:
+ sourceName = QLatin1Literal("SynthesizedByQt");
+ break;
+ case Qt::MouseEventSynthesizedByApplication:
+ sourceName = QLatin1Literal("SynthesizedByApplication");
+ break;
+ default:
+ qFatal("Unexpected wheel event source");
+ continue;
+ }
+
+ for (const auto section : sections) {
+
+ DateList expectedDates;
+ if (fraction)
+ expectedDates << startDate;
+
+ const auto expectedDate = stepDate(startDate, section, steps);
+ if (!expectedDate.isValid())
+ continue;
+
+ expectedDates << expectedDate;
+
+ const QLatin1String sectionName = sectionToName(section);
+
+ QTest::addRow("%s%s%s%sWith%sKeyboardModifier%s",
+ fraction ? "half" : "full",
+ up ? "Up" : "Down",
+ stepModifierName.latin1(),
+ sectionName.latin1(),
+ modifierName.latin1(),
+ sourceName.latin1())
+ << angleDelta
+ << units
+ << static_cast<int>(stepModifier)
+ << modifiers
+ << source
+ << section
+ << startDate
+ << expectedDates;
+ }
+ }
+ }
+ }
+ }
+ }
+#else
+ QSKIP("Built with --no-feature-wheelevent");
+#endif
+}
+
void tst_QDateTimeEdit::wheelEvent()
{
- testWidget->setDisplayFormat("dddd/MM");
- testWidget->setDate(QDate(2000, 2, 21));
- testWidget->setCurrentSection(QDateTimeEdit::DaySection);
- QWheelEvent w(testWidget->lineEdit()->geometry().center(), 120, 0, 0);
- qApp->sendEvent(testWidget, &w);
- QCOMPARE(testWidget->date(), QDate(2000, 2, 22));
- testWidget->setCurrentSection(QDateTimeEdit::MonthSection);
- qApp->sendEvent(testWidget, &w);
- QCOMPARE(testWidget->date(), QDate(2000, 3, 22));
-}
+#if QT_CONFIG(wheelevent)
+ QFETCH(QPoint, angleDelta);
+ QFETCH(int, qt4Delta);
+ QFETCH(int, stepModifier);
+ QFETCH(Qt::KeyboardModifiers, modifiers);
+ QFETCH(Qt::MouseEventSource, source);
+ QFETCH(QDateTimeEdit::Section, section);
+ QFETCH(QDate, startDate);
+ QFETCH(DateList, expectedDates);
+
+ EditorDateEdit edit(0);
+ edit.setDate(startDate);
+ edit.setCurrentSection(section);
+
+ QScopedPointer<StepModifierStyle, QScopedPointerDeleteLater> style(
+ new StepModifierStyle);
+ style->stepModifier = static_cast<Qt::KeyboardModifier>(stepModifier);
+ edit.setStyle(style.data());
+
+ QWheelEvent event(QPointF(), QPointF(), QPoint(), angleDelta, qt4Delta,
+ Qt::Vertical, Qt::NoButton, modifiers, Qt::NoScrollPhase,
+ source);
+
+ QCOMPARE(edit.date(), startDate);
+ for (QDate expected : expectedDates) {
+ qApp->sendEvent(&edit, &event);
+ QCOMPARE(edit.date(), expected);
+ }
+#else
+ QSKIP("Built with --no-feature-wheelevent");
#endif // QT_CONFIG(wheelevent)
+}
void tst_QDateTimeEdit::specialValueCornerCase()
{
@@ -3559,7 +3848,7 @@ void tst_QDateTimeEdit::dateEditCorrectSectionSize_data()
<< threeDigitDayIssueKeypresses_DayName << QString::fromLatin1("00/2/Tuesday");
QTest::newRow("no fixday, leap, yy/M/ddd") << defaultLocale << defaultDate << QString::fromLatin1("yy/M/ddd")
- << threeDigitDayIssueKeypresses_DayName << QString::fromLatin1("00/2/Tue.");
+ << threeDigitDayIssueKeypresses_DayName << QString::fromLatin1("00/2/Tue");
QTest::newRow("no fixday, leap, yy/MM/dddd") << defaultLocale << defaultDate << QString::fromLatin1("yy/MM/dddd")
<< threeDigitDayIssueKeypresses_DayName << QString::fromLatin1("00/02/Tuesday");
@@ -3607,13 +3896,13 @@ void tst_QDateTimeEdit::dateEditCorrectSectionSize_data()
<< threeDigitDayIssueKeypresses_YearDayMonth << QString::fromLatin1("2000/29/2");
QTest::newRow("fixday, leap, yyyy/MMM/dd") << defaultLocale << defaultDate << QString::fromLatin1("yyyy/MMM/dd")
- << threeDigitDayIssueKeypresses_ShortMonthName << QString::fromLatin1("2000/Feb./29");
+ << threeDigitDayIssueKeypresses_ShortMonthName << QString::fromLatin1("2000/Feb/29");
QTest::newRow("fixday, leap, yyyy/MMM/d") << defaultLocale << defaultDate << QString::fromLatin1("yyyy/MMM/d")
- << threeDigitDayIssueKeypresses_ShortMonthName << QString::fromLatin1("2000/Feb./29");
+ << threeDigitDayIssueKeypresses_ShortMonthName << QString::fromLatin1("2000/Feb/29");
QTest::newRow("fixday, leap, yy/MMM/dd") << defaultLocale << defaultDate << QString::fromLatin1("yy/MMM/dd")
- << threeDigitDayIssueKeypresses_ShortMonthName << QString::fromLatin1("00/Feb./29");
+ << threeDigitDayIssueKeypresses_ShortMonthName << QString::fromLatin1("00/Feb/29");
QTest::newRow("fixday, leap, yyyy/dddd/M") << defaultLocale << defaultDate << QString::fromLatin1("yyyy/dddd/M")
<< threeDigitDayIssueKeypresses_DayName_YearDayMonth << QString::fromLatin1("2000/Tuesday/2");
@@ -3688,16 +3977,16 @@ void tst_QDateTimeEdit::dateEditCorrectSectionSize_data()
<< threeDigitDayIssueKeypresses_MonthYearDay << QString::fromLatin1("02/2000/29");
QTest::newRow("fixday, leap, MMM/yy/d") << defaultLocale << defaultDate << QString::fromLatin1("MMM/yy/d")
- << threeDigitDayIssueKeypresses_ShortMonthName_MonthYearDay << QString::fromLatin1("Feb./00/29");
+ << threeDigitDayIssueKeypresses_ShortMonthName_MonthYearDay << QString::fromLatin1("Feb/00/29");
QTest::newRow("fixday, leap, MMM/yyyy/d") << defaultLocale << defaultDate << QString::fromLatin1("MMM/yyyy/d")
- << threeDigitDayIssueKeypresses_ShortMonthName_MonthYearDay << QString::fromLatin1("Feb./2000/29");
+ << threeDigitDayIssueKeypresses_ShortMonthName_MonthYearDay << QString::fromLatin1("Feb/2000/29");
QTest::newRow("fixday, MMM/yyyy/d") << defaultLocale << defaultDate.addYears(1) << QString::fromLatin1("MMM/yyyy/d")
- << threeDigitDayIssueKeypresses_ShortMonthName_MonthYearDay << QString::fromLatin1("Feb./2001/28");
+ << threeDigitDayIssueKeypresses_ShortMonthName_MonthYearDay << QString::fromLatin1("Feb/2001/28");
QTest::newRow("fixday, leap, MMM/yyyy/dd") << defaultLocale << defaultDate << QString::fromLatin1("MMM/yyyy/dd")
- << threeDigitDayIssueKeypresses_ShortMonthName_MonthYearDay << QString::fromLatin1("Feb./2000/29");
+ << threeDigitDayIssueKeypresses_ShortMonthName_MonthYearDay << QString::fromLatin1("Feb/2000/29");
QTest::newRow("fixday, leap, dddd, dd. MMMM yyyy") << defaultLocale
<< defaultDate << QString::fromLatin1("dddd, dd. MMMM yyyy")
@@ -3735,5 +4024,308 @@ void tst_QDateTimeEdit::dateEditCorrectSectionSize()
}
#endif
+void tst_QDateTimeEdit::stepModifierKeys_data()
+{
+ QTest::addColumn<QDate>("startDate");
+ QTest::addColumn<int>("stepModifier");
+ QTest::addColumn<QDateTimeEdit::Section>("section");
+ QTest::addColumn<QTestEventList>("keys");
+ QTest::addColumn<QDate>("expectedDate");
+
+ const auto keyList = {Qt::Key_Up, Qt::Key_Down};
+
+ const auto modifierList = {Qt::NoModifier,
+ Qt::ShiftModifier,
+ Qt::ControlModifier,
+ Qt::AltModifier,
+ Qt::MetaModifier};
+
+ const auto validStepModifierList = {Qt::NoModifier,
+ Qt::ControlModifier,
+ Qt::ShiftModifier};
+
+ const auto sections = {QDateTimeEdit::DaySection,
+ QDateTimeEdit::MonthSection,
+ QDateTimeEdit::YearSection};
+
+ for (auto key : keyList) {
+
+ const bool up = key == Qt::Key_Up;
+ Q_ASSERT(up || key == Qt::Key_Down);
+
+ const QDate startDate(2000, up ? 2 : 12, 17);
+
+ for (auto modifier : modifierList) {
+
+ QTestEventList keys;
+ keys.addKeyClick(key, modifier);
+
+ const auto modifierName = modifierToName(modifier);
+ if (modifierName.isEmpty())
+ continue;
+
+ for (auto stepModifier : validStepModifierList) {
+
+ const auto stepModifierName = modifierToName(stepModifier);
+ if (stepModifierName.isEmpty())
+ continue;
+
+ const int steps = (modifier & stepModifier ? 10 : 1)
+ * (up ? 1 : -1);
+
+ for (const auto section : sections) {
+
+ const auto expectedDate = stepDate(startDate, section, steps);
+ if (!expectedDate.isValid())
+ continue;
+
+ const auto sectionName = sectionToName(section);
+
+ QTest::addRow("%s%s%sWith%sKeyboardModifier",
+ up ? "up" : "down",
+ stepModifierName.latin1(),
+ sectionName.latin1(),
+ modifierName.latin1())
+ << startDate
+ << static_cast<int>(stepModifier)
+ << section
+ << keys
+ << expectedDate;
+ }
+ }
+ }
+ }
+}
+
+void tst_QDateTimeEdit::stepModifierKeys()
+{
+ QFETCH(QDate, startDate);
+ QFETCH(int, stepModifier);
+ QFETCH(QDateTimeEdit::Section, section);
+ QFETCH(QTestEventList, keys);
+ QFETCH(QDate, expectedDate);
+
+ // This can interfere with our stuff.
+ testWidget->hide();
+
+ QDateTimeEdit edit(0);
+ edit.setDate(startDate);
+ edit.show();
+ QVERIFY(QTest::qWaitForWindowActive(&edit));
+ edit.setCurrentSection(section);
+
+ QScopedPointer<StepModifierStyle, QScopedPointerDeleteLater> style(
+ new StepModifierStyle);
+ style->stepModifier = static_cast<Qt::KeyboardModifier>(stepModifier);
+ edit.setStyle(style.data());
+
+ QCOMPARE(edit.date(), startDate);
+ keys.simulate(&edit);
+ QCOMPARE(edit.date(), expectedDate);
+}
+
+void tst_QDateTimeEdit::stepModifierButtons_data()
+{
+ QTest::addColumn<QStyle::SubControl>("subControl");
+ QTest::addColumn<int>("stepModifier");
+ QTest::addColumn<Qt::KeyboardModifiers>("modifiers");
+ QTest::addColumn<QDateTimeEdit::Section>("section");
+ QTest::addColumn<QTime>("startTime");
+ QTest::addColumn<QTime>("expectedTime");
+
+ const auto subControls = {QStyle::SC_SpinBoxUp, QStyle::SC_SpinBoxDown};
+
+ const auto modifierList = {Qt::NoModifier,
+ Qt::ShiftModifier,
+ Qt::ControlModifier,
+ Qt::AltModifier,
+ Qt::MetaModifier};
+
+ const auto validStepModifierList = {Qt::NoModifier,
+ Qt::ControlModifier,
+ Qt::ShiftModifier};
+
+ const auto sections = {QDateTimeEdit::SecondSection,
+ QDateTimeEdit::MinuteSection,
+ QDateTimeEdit::HourSection};
+
+ const QTime startTime(12, 36, 24);
+
+ for (auto subControl : subControls) {
+
+ const bool up = subControl == QStyle::SC_SpinBoxUp;
+ Q_ASSERT(up || subControl == QStyle::SC_SpinBoxDown);
+
+ for (auto modifier : modifierList) {
+
+ const Qt::KeyboardModifiers modifiers(modifier);
+
+ const auto modifierName = modifierToName(modifier);
+ if (modifierName.isEmpty())
+ continue;
+
+ for (auto stepModifier : validStepModifierList) {
+
+ const auto stepModifierName = modifierToName(stepModifier);
+ if (stepModifierName.isEmpty())
+ continue;
+
+ const int steps = (modifier & stepModifier ? 10 : 1)
+ * (up ? 1 : -1);
+
+ for (const auto section : sections) {
+
+ const auto expectedTime = stepTime(startTime, section, steps);
+ if (!expectedTime.isValid())
+ continue;
+
+ const auto sectionName = sectionToName(section);
+
+ QTest::addRow("%s%s%sWith%sKeyboardModifier",
+ up ? "up" : "down",
+ stepModifierName.latin1(),
+ sectionName.latin1(),
+ modifierName.latin1())
+ << subControl
+ << static_cast<int>(stepModifier)
+ << modifiers
+ << section
+ << startTime
+ << expectedTime;
+ }
+ }
+ }
+ }
+}
+
+void tst_QDateTimeEdit::stepModifierButtons()
+{
+ QFETCH(QStyle::SubControl, subControl);
+ QFETCH(int, stepModifier);
+ QFETCH(Qt::KeyboardModifiers, modifiers);
+ QFETCH(QDateTimeEdit::Section, section);
+ QFETCH(QTime, startTime);
+ QFETCH(QTime, expectedTime);
+
+ testWidget->hide();
+
+ EditorDateEdit edit(0);
+ edit.setTime(startTime);
+ edit.show();
+ QVERIFY(QTest::qWaitForWindowActive(&edit));
+ edit.setCurrentSection(section);
+
+ QScopedPointer<StepModifierStyle, QScopedPointerDeleteLater> style(
+ new StepModifierStyle);
+ style->stepModifier = static_cast<Qt::KeyboardModifier>(stepModifier);
+ edit.setStyle(style.data());
+
+ QStyleOptionSpinBox spinBoxStyleOption;
+ edit.initStyleOption(&spinBoxStyleOption);
+
+ const QRect buttonRect = edit.style()->subControlRect(
+ QStyle::CC_SpinBox, &spinBoxStyleOption, subControl, &edit);
+
+ QCOMPARE(edit.time(), startTime);
+ QTest::mouseClick(&edit, Qt::LeftButton, modifiers, buttonRect.center());
+ QCOMPARE(edit.time(), expectedTime);
+}
+
+void tst_QDateTimeEdit::stepModifierPressAndHold_data()
+{
+ QTest::addColumn<QStyle::SubControl>("subControl");
+ QTest::addColumn<int>("stepModifier");
+ QTest::addColumn<Qt::KeyboardModifiers>("modifiers");
+ QTest::addColumn<int>("expectedStepModifier");
+
+ const auto subControls = {QStyle::SC_SpinBoxUp, QStyle::SC_SpinBoxDown};
+
+ const auto modifierList = {Qt::NoModifier,
+ Qt::ShiftModifier,
+ Qt::ControlModifier,
+ Qt::AltModifier,
+ Qt::MetaModifier};
+
+ const auto validStepModifierList = {Qt::NoModifier,
+ Qt::ControlModifier,
+ Qt::ShiftModifier};
+
+ for (auto subControl : subControls) {
+
+ const bool up = subControl == QStyle::SC_SpinBoxUp;
+ Q_ASSERT(up || subControl == QStyle::SC_SpinBoxDown);
+
+ for (auto modifier : modifierList) {
+
+ const Qt::KeyboardModifiers modifiers(modifier);
+
+ const auto modifierName = modifierToName(modifier);
+ if (modifierName.isEmpty())
+ continue;
+
+ for (auto stepModifier : validStepModifierList) {
+
+ const auto stepModifierName = modifierToName(stepModifier);
+ if (stepModifierName.isEmpty())
+ continue;
+
+ const int steps = (modifier & stepModifier ? 10 : 1)
+ * (up ? 1 : -1);
+
+ QTest::addRow("%s%sWith%sKeyboardModifier",
+ up ? "up" : "down",
+ stepModifierName.latin1(),
+ modifierName.latin1())
+ << subControl
+ << static_cast<int>(stepModifier)
+ << modifiers
+ << steps;
+ }
+ }
+ }
+}
+
+void tst_QDateTimeEdit::stepModifierPressAndHold()
+{
+ QFETCH(QStyle::SubControl, subControl);
+ QFETCH(int, stepModifier);
+ QFETCH(Qt::KeyboardModifiers, modifiers);
+ QFETCH(int, expectedStepModifier);
+
+ const QDate startDate(2000, 1, 1);
+
+ testWidget->hide();
+
+ EditorDateEdit edit(0);
+ edit.setDate(startDate);
+
+ QScopedPointer<StepModifierStyle, QScopedPointerDeleteLater> stepModifierStyle(
+ new StepModifierStyle(new PressAndHoldStyle));
+ stepModifierStyle->stepModifier = static_cast<Qt::KeyboardModifier>(stepModifier);
+ edit.setStyle(stepModifierStyle.data());
+
+ QSignalSpy spy(&edit, &EditorDateEdit::dateChanged);
+
+ edit.show();
+ QVERIFY(QTest::qWaitForWindowActive(&edit));
+ edit.setCurrentSection(QDateTimeEdit::YearSection);
+
+ QStyleOptionSpinBox spinBoxStyleOption;
+ edit.initStyleOption(&spinBoxStyleOption);
+
+ const QRect buttonRect = edit.style()->subControlRect(
+ QStyle::CC_SpinBox, &spinBoxStyleOption, subControl, &edit);
+
+ QTest::mousePress(&edit, Qt::LeftButton, modifiers, buttonRect.center());
+ QTRY_VERIFY(spy.length() >= 3);
+ QTest::mouseRelease(&edit, Qt::LeftButton, modifiers, buttonRect.center());
+
+ const auto value = spy.last().at(0);
+ QVERIFY(value.type() == QVariant::Date);
+ const QDate expectedDate = startDate.addYears(spy.length() *
+ expectedStepModifier);
+ QCOMPARE(value.toDate(), expectedDate);
+}
+
QTEST_MAIN(tst_QDateTimeEdit)
#include "tst_qdatetimeedit.moc"
diff --git a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
index 7d1e736f42..078a3215fd 100644
--- a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
+++ b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
@@ -36,7 +36,7 @@
#include <qmainwindow.h>
#include <qlineedit.h>
#include <qtabbar.h>
-#include <QDesktopWidget>
+#include <QScreen>
#include <QtGui/QPainter>
#include "private/qdockwidget_p.h"
@@ -338,7 +338,7 @@ void tst_QDockWidget::features()
void tst_QDockWidget::setFloating()
{
- const QRect deskRect = QApplication::desktop()->availableGeometry();
+ const QRect deskRect = QGuiApplication::primaryScreen()->availableGeometry();
QMainWindow mw;
mw.move(deskRect.left() + deskRect.width() * 2 / 3, deskRect.top() + deskRect.height() / 3);
QDockWidget dw;
@@ -756,7 +756,7 @@ void tst_QDockWidget::restoreStateWhileStillFloating()
// When the dock widget is already floating then it takes a different code path
// so this test covers the case where the restoreState() is effectively just
// moving it back and resizing it
- const QRect availGeom = QApplication::desktop()->availableGeometry();
+ const QRect availGeom = QGuiApplication::primaryScreen()->availableGeometry();
const QPoint startingDockPos = availGeom.center();
QMainWindow mw;
QDockWidget *dock = createTestDock(mw);
@@ -781,10 +781,8 @@ void tst_QDockWidget::restoreDockWidget()
QByteArray geometry;
QByteArray state;
- const bool isXcb = !QGuiApplication::platformName().compare("xcb", Qt::CaseInsensitive);
-
const QString name = QStringLiteral("main");
- const QRect availableGeometry = QApplication::desktop()->availableGeometry();
+ const QRect availableGeometry = QGuiApplication::primaryScreen()->availableGeometry();
const QSize size = availableGeometry.size() / 5;
const QPoint mainWindowPos = availableGeometry.bottomRight() - QPoint(size.width(), size.height()) - QPoint(100, 100);
const QPoint dockPos = availableGeometry.center();
@@ -815,8 +813,7 @@ void tst_QDockWidget::restoreDockWidget()
dock->show();
QVERIFY(QTest::qWaitForWindowExposed(dock));
QTRY_VERIFY(dock->isFloating());
- if (!isXcb) // Avoid Window manager positioning issues
- QTRY_COMPARE(dock->pos(), dockPos);
+ QTRY_COMPARE(dock->pos(), dockPos);
}
QVERIFY(!geometry.isEmpty());
@@ -837,8 +834,6 @@ void tst_QDockWidget::restoreDockWidget()
restoreWindow.show();
QVERIFY(QTest::qWaitForWindowExposed(&restoreWindow));
QTRY_VERIFY(dock->isFloating());
- if (isXcb)
- QSKIP("Skip due to Window manager positioning issues", Abort);
QTRY_COMPARE(dock->pos(), dockPos);
}
}
@@ -868,7 +863,7 @@ void tst_QDockWidget::task169808_setFloating()
public:
QSize sizeHint() const
{
- const QRect& deskRect = qApp->desktop()->availableGeometry();
+ const QRect& deskRect = QGuiApplication::primaryScreen()->availableGeometry();
return QSize(qMin(300, deskRect.width() / 2), qMin(300, deskRect.height() / 2));
}
@@ -892,6 +887,9 @@ void tst_QDockWidget::task169808_setFloating()
mw.show();
QVERIFY(QTest::qWaitForWindowExposed(&mw));
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Widgets are maximized on WinRT by default", Abort);
+#endif
QCOMPARE(dw->widget()->size(), dw->widget()->sizeHint());
//and now we try to test if the contents margin is taken into account
@@ -934,6 +932,9 @@ void tst_QDockWidget::task248604_infiniteResize()
d.setContentsMargins(2, 2, 2, 2);
d.setMinimumSize(320, 240);
d.showNormal();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Widgets are maximized on WinRT by default", Abort);
+#endif
QTRY_COMPARE(d.size(), QSize(320, 240));
}
diff --git a/tests/auto/widgets/widgets/qdoublespinbox/BLACKLIST b/tests/auto/widgets/widgets/qdoublespinbox/BLACKLIST
new file mode 100644
index 0000000000..c1b6c9693e
--- /dev/null
+++ b/tests/auto/widgets/widgets/qdoublespinbox/BLACKLIST
@@ -0,0 +1,2 @@
+[editingFinished]
+*
diff --git a/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp b/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp
index d44cc40527..b1610c297d 100644
--- a/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp
+++ b/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp
@@ -31,6 +31,7 @@
#include <qapplication.h>
#include <limits.h>
+#include <cmath>
#include <float.h>
#include <qspinbox.h>
@@ -40,6 +41,10 @@
#include <qlineedit.h>
#include <qdebug.h>
+#include <QStyleOptionSpinBox>
+#include <QStyle>
+#include <QProxyStyle>
+
class DoubleSpinBox : public QDoubleSpinBox
{
Q_OBJECT
@@ -59,6 +64,16 @@ public:
{
return QDoubleSpinBox::valueFromText(text);
}
+#if QT_CONFIG(wheelevent)
+ void wheelEvent(QWheelEvent *event)
+ {
+ QDoubleSpinBox::wheelEvent(event);
+ }
+#endif
+ void initStyleOption(QStyleOptionSpinBox *option) const
+ {
+ QDoubleSpinBox::initStyleOption(option);
+ }
QLineEdit* lineEdit() const { return QDoubleSpinBox::lineEdit(); }
public slots:
@@ -68,6 +83,46 @@ public slots:
}
};
+class PressAndHoldStyle : public QProxyStyle
+{
+ Q_OBJECT
+public:
+ using QProxyStyle::QProxyStyle;
+
+ int styleHint(QStyle::StyleHint hint, const QStyleOption *option = nullptr,
+ const QWidget *widget = nullptr, QStyleHintReturn *returnData = nullptr) const override
+ {
+ switch (hint) {
+ case QStyle::SH_SpinBox_ClickAutoRepeatRate:
+ return 5;
+ case QStyle::SH_SpinBox_ClickAutoRepeatThreshold:
+ return 10;
+ default:
+ return QProxyStyle::styleHint(hint, option, widget, returnData);
+ }
+ }
+};
+
+class StepModifierStyle : public QProxyStyle
+{
+ Q_OBJECT
+public:
+ using QProxyStyle::QProxyStyle;
+
+ int styleHint(QStyle::StyleHint hint, const QStyleOption *option = nullptr,
+ const QWidget *widget = nullptr, QStyleHintReturn *returnData = nullptr) const override
+ {
+ switch (hint) {
+ case QStyle::SH_SpinBox_StepModifier:
+ return stepModifier;
+ default:
+ return QProxyStyle::styleHint(hint, option, widget, returnData);
+ }
+ }
+
+ Qt::KeyboardModifier stepModifier = Qt::ControlModifier;
+};
+
class tst_QDoubleSpinBox : public QObject
{
@@ -135,6 +190,19 @@ private slots:
void setGroupSeparatorShown_data();
void setGroupSeparatorShown();
+ void adaptiveDecimalStep();
+
+ void wheelEvents_data();
+ void wheelEvents();
+
+ void stepModifierKeys_data();
+ void stepModifierKeys();
+
+ void stepModifierButtons_data();
+ void stepModifierButtons();
+
+ void stepModifierPressAndHold_data();
+ void stepModifierPressAndHold();
public slots:
void valueChangedHelper(const QString &);
void valueChangedHelper(double);
@@ -149,6 +217,30 @@ typedef QList<double> DoubleList;
Q_DECLARE_METATYPE(QLocale::Language)
Q_DECLARE_METATYPE(QLocale::Country)
+static QLatin1String modifierToName(Qt::KeyboardModifier modifier)
+{
+ switch (modifier) {
+ case Qt::NoModifier:
+ return QLatin1Literal("No");
+ break;
+ case Qt::ControlModifier:
+ return QLatin1Literal("Ctrl");
+ break;
+ case Qt::ShiftModifier:
+ return QLatin1Literal("Shift");
+ break;
+ case Qt::AltModifier:
+ return QLatin1Literal("Alt");
+ break;
+ case Qt::MetaModifier:
+ return QLatin1Literal("Meta");
+ break;
+ default:
+ qFatal("Unexpected keyboard modifier");
+ return QLatin1String();
+ }
+}
+
tst_QDoubleSpinBox::tst_QDoubleSpinBox()
{
@@ -1139,5 +1231,548 @@ void tst_QDoubleSpinBox::setGroupSeparatorShown()
QCOMPARE(spinBox.value()+1000, 33000.44);
}
+void tst_QDoubleSpinBox::adaptiveDecimalStep()
+{
+ DoubleSpinBox spinBox;
+ spinBox.setRange(-100000, 100000);
+ spinBox.setDecimals(4);
+ spinBox.setStepType(DoubleSpinBox::StepType::AdaptiveDecimalStepType);
+
+ // Positive values
+
+ spinBox.setValue(0);
+
+ // Go from 0 to 0.01
+ for (double i = 0; i < 0.00999; i += 0.0001) {
+ QVERIFY(qFuzzyCompare(spinBox.value(), i));
+ spinBox.stepBy(1);
+ }
+
+ // Go from 0.01 to 0.1
+ for (double i = 0.01; i < 0.0999; i += 0.001) {
+ QVERIFY(qFuzzyCompare(spinBox.value(), i));
+ spinBox.stepBy(1);
+ }
+
+ // Go from 0.1 to 1
+ for (double i = 0.1; i < 0.999; i += 0.01) {
+ QVERIFY(qFuzzyCompare(spinBox.value(), i));
+ spinBox.stepBy(1);
+ }
+
+ // Go from 1 to 10
+ for (double i = 1; i < 9.99; i += 0.1) {
+ QVERIFY(qFuzzyCompare(spinBox.value(), i));
+ spinBox.stepBy(1);
+ }
+
+ // Go from 10 to 100
+ for (int i = 10; i < 100; i++) {
+ QVERIFY(qFuzzyCompare(spinBox.value(), i));
+ spinBox.stepBy(1);
+ }
+
+ // Go from 100 to 1000
+ for (int i = 100; i < 1000; i += 10) {
+ QVERIFY(qFuzzyCompare(spinBox.value(), i));
+ spinBox.stepBy(1);
+ }
+
+ // Go from 1000 to 10000
+ for (int i = 1000; i < 10000; i += 100) {
+ QVERIFY(qFuzzyCompare(spinBox.value(), i));
+ spinBox.stepBy(1);
+ }
+
+ // Test decreasing the values now
+
+ // Go from 10000 down to 1000
+ for (int i = 10000; i > 1000; i -= 100) {
+ QVERIFY(qFuzzyCompare(spinBox.value(), i));
+ spinBox.stepBy(-1);
+ }
+
+ // Go from 1000 down to 100
+ for (int i = 1000; i > 100; i -= 10) {
+ QVERIFY(qFuzzyCompare(spinBox.value(), i));
+ spinBox.stepBy(-1);
+ }
+
+ // Negative values
+
+ spinBox.setValue(0);
+
+ // Go from 0 to -0.01
+ for (double i = 0; i > -0.00999; i -= 0.0001) {
+ QVERIFY(qFuzzyCompare(spinBox.value(), i));
+ spinBox.stepBy(-1);
+ }
+
+ // Go from -0.01 to -0.1
+ for (double i = -0.01; i > -0.0999; i -= 0.001) {
+ QVERIFY(qFuzzyCompare(spinBox.value(), i));
+ spinBox.stepBy(-1);
+ }
+
+ // Go from -0.1 to -1
+ for (double i = -0.1; i > -0.999; i -= 0.01) {
+ QVERIFY(qFuzzyCompare(spinBox.value(), i));
+ spinBox.stepBy(-1);
+ }
+
+ // Go from -1 to -10
+ for (double i = -1; i > -9.99; i -= 0.1) {
+ QVERIFY(qFuzzyCompare(spinBox.value(), i));
+ spinBox.stepBy(-1);
+ }
+
+ // Go from -10 to -100
+ for (int i = -10; i > -100; i--) {
+ QVERIFY(qFuzzyCompare(spinBox.value(), i));
+ spinBox.stepBy(-1);
+ }
+
+ // Go from -100 to -1000
+ for (int i = -100; i > -1000; i -= 10) {
+ QVERIFY(qFuzzyCompare(spinBox.value(), i));
+ spinBox.stepBy(-1);
+ }
+
+ // Go from 1000 to 10000
+ for (int i = -1000; i > -10000; i -= 100) {
+ QVERIFY(qFuzzyCompare(spinBox.value(), i));
+ spinBox.stepBy(-1);
+ }
+
+ // Test increasing the values now
+
+ // Go from -10000 up to -1000
+ for (int i = -10000; i < -1000; i += 100) {
+ QVERIFY(qFuzzyCompare(spinBox.value(), i));
+ spinBox.stepBy(1);
+ }
+
+ // Go from -1000 up to -100
+ for (int i = -1000; i < -100; i += 10) {
+ QVERIFY(qFuzzyCompare(spinBox.value(), i));
+ spinBox.stepBy(1);
+ }
+}
+
+void tst_QDoubleSpinBox::wheelEvents_data()
+{
+#if QT_CONFIG(wheelevent)
+ QTest::addColumn<QPoint>("angleDelta");
+ QTest::addColumn<int>("qt4Delta");
+ QTest::addColumn<int>("stepModifier");
+ QTest::addColumn<Qt::KeyboardModifiers>("modifier");
+ QTest::addColumn<Qt::MouseEventSource>("source");
+ QTest::addColumn<double>("start");
+ QTest::addColumn<DoubleList>("expectedValues");
+
+ const auto fractions = {false, true};
+
+ const auto directions = {true, false};
+
+ const auto modifierList = {Qt::NoModifier,
+ Qt::ShiftModifier,
+ Qt::ControlModifier,
+ Qt::AltModifier,
+ Qt::MetaModifier};
+
+ const auto validStepModifierList = {Qt::NoModifier,
+ Qt::ControlModifier,
+ Qt::ShiftModifier};
+
+ const auto sources = {Qt::MouseEventNotSynthesized,
+ Qt::MouseEventSynthesizedBySystem,
+ Qt::MouseEventSynthesizedByQt,
+ Qt::MouseEventSynthesizedByApplication};
+
+ const double startValue = 0.0;
+
+ for (auto fraction : fractions) {
+ for (auto up : directions) {
+
+ const int units = (fraction ? 60 : 120) * (up ? 1 : -1);
+
+ for (auto modifier : modifierList) {
+
+ const Qt::KeyboardModifiers modifiers(modifier);
+
+ const auto modifierName = modifierToName(modifier);
+ if (modifierName.isEmpty())
+ continue;
+
+ for (auto stepModifier : validStepModifierList) {
+
+ const auto stepModifierName = modifierToName(stepModifier);
+ if (stepModifierName.isEmpty())
+ continue;
+
+ const int steps = (modifier & stepModifier ? 10 : 1)
+ * (up ? 1 : -1);
+
+ for (auto source : sources) {
+
+#ifdef Q_OS_MACOS
+ QPoint angleDelta;
+ if ((modifier & Qt::ShiftModifier) &&
+ source == Qt::MouseEventNotSynthesized) {
+ // On macOS the Shift modifier converts vertical
+ // mouse wheel events to horizontal.
+ angleDelta = { units, 0 };
+ } else {
+ // However, this is not the case for trackpad scroll
+ // events.
+ angleDelta = { 0, units };
+ }
+#else
+ const QPoint angleDelta(0, units);
+#endif
+
+ QLatin1String sourceName;
+ switch (source) {
+ case Qt::MouseEventNotSynthesized:
+ sourceName = QLatin1Literal("NotSynthesized");
+ break;
+ case Qt::MouseEventSynthesizedBySystem:
+ sourceName = QLatin1Literal("SynthesizedBySystem");
+ break;
+ case Qt::MouseEventSynthesizedByQt:
+ sourceName = QLatin1Literal("SynthesizedByQt");
+ break;
+ case Qt::MouseEventSynthesizedByApplication:
+ sourceName = QLatin1Literal("SynthesizedByApplication");
+ break;
+ default:
+ qFatal("Unexpected wheel event source");
+ continue;
+ }
+
+ DoubleList expectedValues;
+ if (fraction)
+ expectedValues << startValue;
+ expectedValues << startValue + steps;
+
+ QTest::addRow("%s%s%sWith%sKeyboardModifier%s",
+ fraction ? "half" : "full",
+ up ? "Up" : "Down",
+ stepModifierName.latin1(),
+ modifierName.latin1(),
+ sourceName.latin1())
+ << angleDelta
+ << units
+ << static_cast<int>(stepModifier)
+ << modifiers
+ << source
+ << startValue
+ << expectedValues;
+ }
+ }
+ }
+ }
+ }
+#else
+ QSKIP("Built with --no-feature-wheelevent");
+#endif
+}
+
+void tst_QDoubleSpinBox::wheelEvents()
+{
+#if QT_CONFIG(wheelevent)
+ QFETCH(QPoint, angleDelta);
+ QFETCH(int, qt4Delta);
+ QFETCH(int, stepModifier);
+ QFETCH(Qt::KeyboardModifiers, modifier);
+ QFETCH(Qt::MouseEventSource, source);
+ QFETCH(double, start);
+ QFETCH(DoubleList, expectedValues);
+
+ DoubleSpinBox spinBox;
+ spinBox.setRange(-20, 20);
+ spinBox.setValue(start);
+
+ QScopedPointer<StepModifierStyle, QScopedPointerDeleteLater> style(
+ new StepModifierStyle);
+ style->stepModifier = static_cast<Qt::KeyboardModifier>(stepModifier);
+ spinBox.setStyle(style.data());
+
+ QWheelEvent event(QPointF(), QPointF(), QPoint(), angleDelta, qt4Delta,
+ Qt::Vertical, Qt::NoButton, modifier, Qt::NoScrollPhase,
+ source);
+ for (int expected : expectedValues) {
+ qApp->sendEvent(&spinBox, &event);
+ QCOMPARE(spinBox.value(), expected);
+ }
+#else
+ QSKIP("Built with --no-feature-wheelevent");
+#endif
+}
+
+void tst_QDoubleSpinBox::stepModifierKeys_data()
+{
+ QTest::addColumn<double>("startValue");
+ QTest::addColumn<int>("stepModifier");
+ QTest::addColumn<QTestEventList>("keys");
+ QTest::addColumn<double>("expectedValue");
+
+ const auto keyList = {Qt::Key_Up, Qt::Key_Down};
+
+ const auto modifierList = {Qt::NoModifier,
+ Qt::ShiftModifier,
+ Qt::ControlModifier,
+ Qt::AltModifier,
+ Qt::MetaModifier};
+
+ const auto validStepModifierList = {Qt::NoModifier,
+ Qt::ControlModifier,
+ Qt::ShiftModifier};
+
+
+ for (auto key : keyList) {
+
+ const bool up = key == Qt::Key_Up;
+ Q_ASSERT(up || key == Qt::Key_Down);
+
+ const double startValue = up ? 0.0 : 10.0;
+
+ for (auto modifier : modifierList) {
+
+ QTestEventList keys;
+ keys.addKeyClick(key, modifier);
+
+ const auto modifierName = modifierToName(modifier);
+ if (modifierName.isEmpty())
+ continue;
+
+ for (auto stepModifier : validStepModifierList) {
+
+ const auto stepModifierName = modifierToName(stepModifier);
+ if (stepModifierName.isEmpty())
+ continue;
+
+ const int steps = (modifier & stepModifier ? 10 : 1)
+ * (up ? 1 : -1);
+
+ const double expectedValue = startValue + steps;
+
+ QTest::addRow("%s%sWith%sKeyboardModifier",
+ up ? "up" : "down",
+ stepModifierName.latin1(),
+ modifierName.latin1())
+ << startValue
+ << static_cast<int>(stepModifier)
+ << keys
+ << expectedValue;
+ }
+ }
+ }
+}
+
+void tst_QDoubleSpinBox::stepModifierKeys()
+{
+ QFETCH(double, startValue);
+ QFETCH(int, stepModifier);
+ QFETCH(QTestEventList, keys);
+ QFETCH(double, expectedValue);
+
+ QDoubleSpinBox spin(0);
+ spin.setValue(startValue);
+
+ QScopedPointer<StepModifierStyle, QScopedPointerDeleteLater> style(
+ new StepModifierStyle);
+ style->stepModifier = static_cast<Qt::KeyboardModifier>(stepModifier);
+ spin.setStyle(style.data());
+
+ spin.show();
+ QVERIFY(QTest::qWaitForWindowActive(&spin));
+
+ QCOMPARE(spin.value(), startValue);
+ keys.simulate(&spin);
+ QCOMPARE(spin.value(), expectedValue);
+}
+
+void tst_QDoubleSpinBox::stepModifierButtons_data()
+{
+ QTest::addColumn<QStyle::SubControl>("subControl");
+ QTest::addColumn<int>("stepModifier");
+ QTest::addColumn<Qt::KeyboardModifiers>("modifiers");
+ QTest::addColumn<double>("startValue");
+ QTest::addColumn<double>("expectedValue");
+
+ const auto subControls = {QStyle::SC_SpinBoxUp, QStyle::SC_SpinBoxDown};
+
+ const auto modifierList = {Qt::NoModifier,
+ Qt::ShiftModifier,
+ Qt::ControlModifier,
+ Qt::AltModifier,
+ Qt::MetaModifier};
+
+ const auto validStepModifierList = {Qt::NoModifier,
+ Qt::ControlModifier,
+ Qt::ShiftModifier};
+
+ for (auto subControl : subControls) {
+
+ const bool up = subControl == QStyle::SC_SpinBoxUp;
+ Q_ASSERT(up || subControl == QStyle::SC_SpinBoxDown);
+
+ const double startValue = up ? 0 : 10;
+
+ for (auto modifier : modifierList) {
+
+ const Qt::KeyboardModifiers modifiers(modifier);
+
+ const auto modifierName = modifierToName(modifier);
+ if (modifierName.isEmpty())
+ continue;
+
+ for (auto stepModifier : validStepModifierList) {
+
+ const auto stepModifierName = modifierToName(stepModifier);
+ if (stepModifierName.isEmpty())
+ continue;
+
+ const int steps = (modifier & stepModifier ? 10 : 1)
+ * (up ? 1 : -1);
+
+ const double expectedValue = startValue + steps;
+
+ QTest::addRow("%s%sWith%sKeyboardModifier",
+ up ? "up" : "down",
+ stepModifierName.latin1(),
+ modifierName.latin1())
+ << subControl
+ << static_cast<int>(stepModifier)
+ << modifiers
+ << startValue
+ << expectedValue;
+ }
+ }
+ }
+}
+
+void tst_QDoubleSpinBox::stepModifierButtons()
+{
+ QFETCH(QStyle::SubControl, subControl);
+ QFETCH(int, stepModifier);
+ QFETCH(Qt::KeyboardModifiers, modifiers);
+ QFETCH(double, startValue);
+ QFETCH(double, expectedValue);
+
+ DoubleSpinBox spin(0);
+ spin.setRange(-20, 20);
+ spin.setValue(startValue);
+
+ QScopedPointer<StepModifierStyle, QScopedPointerDeleteLater> style(
+ new StepModifierStyle);
+ style->stepModifier = static_cast<Qt::KeyboardModifier>(stepModifier);
+ spin.setStyle(style.data());
+
+ spin.show();
+ QVERIFY(QTest::qWaitForWindowActive(&spin));
+
+ QStyleOptionSpinBox spinBoxStyleOption;
+ spin.initStyleOption(&spinBoxStyleOption);
+
+ const QRect buttonRect = spin.style()->subControlRect(
+ QStyle::CC_SpinBox, &spinBoxStyleOption, subControl, &spin);
+
+ QCOMPARE(spin.value(), startValue);
+ QTest::mouseClick(&spin, Qt::LeftButton, modifiers, buttonRect.center());
+ QCOMPARE(spin.value(), expectedValue);
+}
+
+void tst_QDoubleSpinBox::stepModifierPressAndHold_data()
+{
+ QTest::addColumn<QStyle::SubControl>("subControl");
+ QTest::addColumn<int>("stepModifier");
+ QTest::addColumn<Qt::KeyboardModifiers>("modifiers");
+ QTest::addColumn<int>("expectedStepModifier");
+
+ const auto subControls = {QStyle::SC_SpinBoxUp, QStyle::SC_SpinBoxDown};
+
+ const auto modifierList = {Qt::NoModifier,
+ Qt::ShiftModifier,
+ Qt::ControlModifier,
+ Qt::AltModifier,
+ Qt::MetaModifier};
+
+ const auto validStepModifierList = {Qt::NoModifier,
+ Qt::ControlModifier,
+ Qt::ShiftModifier};
+
+ for (auto subControl : subControls) {
+
+ const bool up = subControl == QStyle::SC_SpinBoxUp;
+ Q_ASSERT(up || subControl == QStyle::SC_SpinBoxDown);
+
+ for (auto modifier : modifierList) {
+
+ const Qt::KeyboardModifiers modifiers(modifier);
+
+ const auto modifierName = modifierToName(modifier);
+ if (modifierName.isEmpty())
+ continue;
+
+ for (auto stepModifier : validStepModifierList) {
+
+ const auto stepModifierName = modifierToName(stepModifier);
+ if (stepModifierName.isEmpty())
+ continue;
+
+ const int steps = (modifier & stepModifier ? 10 : 1)
+ * (up ? 1 : -1);
+
+ QTest::addRow("%s%sWith%sKeyboardModifier",
+ up ? "up" : "down",
+ stepModifierName.latin1(),
+ modifierName.latin1())
+ << subControl
+ << static_cast<int>(stepModifier)
+ << modifiers
+ << steps;
+ }
+ }
+ }
+}
+
+void tst_QDoubleSpinBox::stepModifierPressAndHold()
+{
+ QFETCH(QStyle::SubControl, subControl);
+ QFETCH(int, stepModifier);
+ QFETCH(Qt::KeyboardModifiers, modifiers);
+ QFETCH(int, expectedStepModifier);
+
+ DoubleSpinBox spin(0);
+ spin.setRange(-100.0, 100.0);
+ spin.setValue(0.0);
+
+ QScopedPointer<StepModifierStyle, QScopedPointerDeleteLater> stepModifierStyle(
+ new StepModifierStyle(new PressAndHoldStyle));
+ stepModifierStyle->stepModifier = static_cast<Qt::KeyboardModifier>(stepModifier);
+ spin.setStyle(stepModifierStyle.data());
+
+ QSignalSpy spy(&spin, QOverload<double>::of(&DoubleSpinBox::valueChanged));
+
+ spin.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&spin));
+
+ QStyleOptionSpinBox spinBoxStyleOption;
+ spin.initStyleOption(&spinBoxStyleOption);
+
+ const QRect buttonRect = spin.style()->subControlRect(
+ QStyle::CC_SpinBox, &spinBoxStyleOption, subControl, &spin);
+
+ QTest::mousePress(&spin, Qt::LeftButton, modifiers, buttonRect.center());
+ QTRY_VERIFY(spy.length() >= 3);
+ QTest::mouseRelease(&spin, Qt::LeftButton, modifiers, buttonRect.center());
+
+ const auto value = spy.last().at(0);
+ QVERIFY(value.type() == QVariant::Double);
+ QCOMPARE(value.toDouble(), spy.length() * expectedStepModifier);
+}
+
QTEST_MAIN(tst_QDoubleSpinBox)
#include "tst_qdoublespinbox.moc"
diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
index 17462a5f86..448e2030bc 100644
--- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
@@ -304,7 +304,7 @@ private slots:
void QTBUG59957_clearButtonLeftmostAction();
void QTBUG_60319_setInputMaskCheckImSurroundingText();
void testQuickSelectionWithMouse();
-
+ void inputRejected();
protected slots:
void editingFinished();
@@ -2279,6 +2279,16 @@ void tst_QLineEdit::deleteSelectedText()
}
+class ToUpperValidator : public QValidator
+{
+public:
+ ToUpperValidator() {}
+ State validate(QString &input, int &) const override
+ {
+ input = input.toUpper();
+ return QValidator::Acceptable;
+ }
+};
void tst_QLineEdit::textChangedAndTextEdited()
{
@@ -2320,6 +2330,23 @@ void tst_QLineEdit::textChangedAndTextEdited()
QCOMPARE(edited_count, 0);
QVERIFY(changed_string.isEmpty());
QVERIFY(!changed_string.isNull());
+
+ changed_count = 0;
+ edited_count = 0;
+ changed_string.clear();
+
+ QScopedPointer<ToUpperValidator> validator(new ToUpperValidator());
+ testWidget->setValidator(validator.data());
+ testWidget->setText("foo");
+ QCOMPARE(changed_count, 1);
+ QCOMPARE(edited_count, 0);
+ QCOMPARE(changed_string, QLatin1String("FOO"));
+ testWidget->setCursorPosition(sizeof("foo"));
+ QTest::keyClick(testWidget, 'b');
+ QCOMPARE(changed_count, 2);
+ QCOMPARE(edited_count, 1);
+ QCOMPARE(changed_string, QLatin1String("FOOB"));
+ testWidget->setValidator(nullptr);
}
void tst_QLineEdit::onTextChanged(const QString &text)
@@ -2637,9 +2664,9 @@ void tst_QLineEdit::setValidator_QIntValidator_data()
<< 0
<< 100
<< QString("153")
- << QString(useKeys ? "15" : "")
+ << QString("153")
<< bool(useKeys)
- << bool(useKeys ? true : false)
+ << bool(false)
<< uint(QLineEdit::Normal);
QTest::newRow(QString(inputMode + "range [-100,100] int '-153'").toLatin1())
<< -100
@@ -2660,7 +2687,7 @@ void tst_QLineEdit::setValidator_QIntValidator_data()
QTest::newRow(QString(inputMode + "range [3,7] int '8'").toLatin1())
<< 3
<< 7
- << QString("8")
+ << QString("")
<< QString("")
<< bool(useKeys)
<< bool(false)
@@ -3265,7 +3292,7 @@ void tst_QLineEdit::editInvalidText()
{
QLineEdit *testWidget = ensureTestWidget();
testWidget->clear();
- testWidget->setValidator(new QIntValidator(0, 120, 0));
+ testWidget->setValidator(new QIntValidator(0, 12, 0));
testWidget->setText("1234");
QVERIFY(!testWidget->hasAcceptableInput());
@@ -4726,6 +4753,9 @@ void tst_QLineEdit::testQuickSelectionWithMouse()
QTest::mousePress(lineEdit.windowHandle(), Qt::LeftButton, Qt::NoModifier, center);
QTest::mouseMove(lineEdit.windowHandle(), center + QPoint(20, 0));
qCDebug(lcTests) << "Selected text:" << lineEdit.selectedText();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "WinRT does not support QTest::mousePress/-Move", Abort);
+#endif
QVERIFY(!lineEdit.selectedText().isEmpty());
QVERIFY(!lineEdit.selectedText().endsWith(suffix));
@@ -4793,5 +4823,56 @@ void tst_QLineEdit::testQuickSelectionWithMouse()
QVERIFY(lineEdit.selectedText().endsWith(suffix));
}
+void tst_QLineEdit::inputRejected()
+{
+ QLineEdit *testWidget = ensureTestWidget();
+ QSignalSpy spyInputRejected(testWidget, SIGNAL(inputRejected()));
+
+ QTest::keyClicks(testWidget, "abcde");
+ QCOMPARE(spyInputRejected.count(), 0);
+ testWidget->setText("fghij");
+ QCOMPARE(spyInputRejected.count(), 0);
+ testWidget->insert("k");
+ QCOMPARE(spyInputRejected.count(), 0);
+
+ testWidget->clear();
+ testWidget->setMaxLength(5);
+ QTest::keyClicks(testWidget, "abcde");
+ QCOMPARE(spyInputRejected.count(), 0);
+ QTest::keyClicks(testWidget, "fgh");
+ QCOMPARE(spyInputRejected.count(), 3);
+ testWidget->clear();
+ spyInputRejected.clear();
+ QApplication::clipboard()->setText("ijklmno");
+ testWidget->paste();
+ // The first 5 characters are accepted, but
+ // the last 2 are not.
+ QCOMPARE(spyInputRejected.count(), 1);
+
+ testWidget->setMaxLength(INT_MAX);
+ testWidget->clear();
+ spyInputRejected.clear();
+ QIntValidator intValidator(1, 100);
+ testWidget->setValidator(&intValidator);
+ QTest::keyClicks(testWidget, "11");
+ QCOMPARE(spyInputRejected.count(), 0);
+ QTest::keyClicks(testWidget, "a#");
+ QCOMPARE(spyInputRejected.count(), 2);
+ testWidget->clear();
+ spyInputRejected.clear();
+ QApplication::clipboard()->setText("a#");
+ testWidget->paste();
+ QCOMPARE(spyInputRejected.count(), 1);
+
+ testWidget->clear();
+ testWidget->setValidator(0);
+ spyInputRejected.clear();
+ testWidget->setInputMask("999.999.999.999;_");
+ QTest::keyClicks(testWidget, "11");
+ QCOMPARE(spyInputRejected.count(), 0);
+ QTest::keyClicks(testWidget, "a#");
+ QCOMPARE(spyInputRejected.count(), 2);
+}
+
QTEST_MAIN(tst_QLineEdit)
#include "tst_qlineedit.moc"
diff --git a/tests/auto/widgets/widgets/qmainwindow/BLACKLIST b/tests/auto/widgets/widgets/qmainwindow/BLACKLIST
new file mode 100644
index 0000000000..a03ea11f40
--- /dev/null
+++ b/tests/auto/widgets/widgets/qmainwindow/BLACKLIST
@@ -0,0 +1,2 @@
+[resizeDocks]
+winrt
diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
index ae71663036..1acf07301c 100644
--- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
+++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
@@ -43,7 +43,7 @@
#include <qlabel.h>
#include <qtextedit.h>
#include <qstylehints.h>
-#include <qdesktopwidget.h>
+#include <qscreen.h>
#include <private/qmainwindowlayout_p.h>
#include <private/qdockarealayout_p.h>
@@ -768,7 +768,7 @@ void tst_QMainWindow::contentsMargins()
QFETCH(int, contentsMargin);
QMainWindow mw;
- const QRect availGeometry = QApplication::desktop()->availableGeometry();
+ const QRect availGeometry = QGuiApplication::primaryScreen()->availableGeometry();
mw.menuBar()->addMenu("File");
mw.setWindowTitle(QLatin1String(QTest::currentTestFunction())
+ QLatin1Char(' ') + QLatin1String(QTest::currentDataTag()));
@@ -1782,6 +1782,9 @@ void tst_QMainWindow::centralWidgetSize()
mainWindow.setCentralWidget(&widget);
mainWindow.show();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Widgets are maximized by default on WinRT - QTBUG-68297", Abort);
+#endif
QTRY_COMPARE(widget.size(), widget.sizeHint());
}
@@ -1826,6 +1829,9 @@ void tst_QMainWindow::fixedSizeCentralWidget()
// finally verify that we get the space back when we resize to the old size
mainWindow.resize(mwSize);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "QMainWindow::resize does not work on WinRT", Continue);
+#endif
QTRY_COMPARE(child->height(), childHeight);
}
diff --git a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
index ecad7267dd..6cc19051d2 100644
--- a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
+++ b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
@@ -357,6 +357,9 @@ void tst_QMdiArea::subWindowActivated()
QMdiSubWindow *window = windows.at(i);
window->showNormal();
qApp->processEvents();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("data2", "Broken on WinRT - QTBUG-68297", Abort);
+#endif
QVERIFY( window == activeWindow );
QVERIFY( activeWindow == workspace->activeSubWindow() );
}
@@ -517,6 +520,9 @@ void tst_QMdiArea::subWindowActivated2()
mdiArea.showNormal();
mdiArea.activateWindow();
QVERIFY(QTest::qWaitForWindowActive(&mdiArea));
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Broken on WinRT - QTBUG-68297", Abort);
+#endif
QTRY_COMPARE(spy.count(), 1);
QCOMPARE(mdiArea.activeSubWindow(), activeSubWindow);
spy.clear();
@@ -1191,6 +1197,9 @@ void tst_QMdiArea::addAndRemoveWindows()
// Don't occupy space.
QMdiSubWindow *window3 = workspace.addSubWindow(new QWidget);
window3->show();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Windows are maximized by default on WinRT", Abort);
+#endif
QCOMPARE(window3->geometry().topLeft(), QPoint(window2RestoreGeometry.right() + 1, 0));
}
@@ -1451,6 +1460,9 @@ void tst_QMdiArea::subWindowList()
QList<QMdiSubWindow *> widgets = workspace.subWindowList(windowOrder);
QCOMPARE(widgets.count(), windowCount);
if (windowOrder == QMdiArea::StackingOrder) {
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Broken on WinRT - QTBUG-68297", Abort);
+#endif
QCOMPARE(widgets.at(widgets.count() - 1), windows[staysOnTop2]);
QCOMPARE(widgets.at(widgets.count() - 2), windows[staysOnTop1]);
QCOMPARE(widgets.at(widgets.count() - 3), windows[activeSubWindow]);
@@ -1666,6 +1678,9 @@ void tst_QMdiArea::tileSubWindows()
// Re-tile.
workspace.tileSubWindows();
workspace.setActiveSubWindow(0);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Broken on WinRT - QTBUG-68297", Abort);
+#endif
QCOMPARE(workspace.viewport()->childrenRect(), workspace.viewport()->rect());
// Cascade and verify that the views are not tiled anymore.
@@ -1965,6 +1980,9 @@ void tst_QMdiArea::dontMaximizeSubWindowOnActivation()
// Verify that new windows are not maximized.
mdiArea.addSubWindow(new QWidget)->show();
QVERIFY(mdiArea.activeSubWindow());
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Broken on WinRT - QTBUG-68297", Abort);
+#endif
QVERIFY(!mdiArea.activeSubWindow()->isMaximized());
}
@@ -1986,6 +2004,9 @@ void tst_QMdiArea::delayedPlacement()
QVERIFY(QTest::qWaitForWindowExposed(&mdiArea));
QCOMPARE(window1->geometry().topLeft(), QPoint(0, 0));
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Broken on WinRT - QTBUG-68297", Abort);
+#endif
QCOMPARE(window2->geometry().topLeft(), window1->geometry().topRight() + QPoint(1, 0));
QCOMPARE(window3->geometry().topLeft(), window2->geometry().topRight() + QPoint(1, 0));
}
@@ -2117,6 +2138,10 @@ void tst_QMdiArea::updateScrollBars()
subWindow1->showNormal();
qApp->processEvents();
QVERIFY(!subWindow1->isMaximized());
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Widgets are maximized by default on WinRT, so scroll bars might not be"
+ "visible", Abort);
+#endif
QVERIFY(hbar->style()->styleHint(QStyle::SH_ScrollBar_Transient) || hbar->isVisible());
QVERIFY(vbar->style()->styleHint(QStyle::SH_ScrollBar_Transient) || vbar->isVisible());
if (i == 0) {
@@ -2318,6 +2343,10 @@ void tst_QMdiArea::setViewMode()
QList<QMdiSubWindow *> subWindows = mdiArea.subWindowList();
// Default.
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Widgets are maximized by default on WinRT, so scroll bars might not be"
+ "visible", Abort);
+#endif
QVERIFY(!activeSubWindow->isMaximized());
QTabBar *tabBar = mdiArea.findChild<QTabBar *>();
QVERIFY(!tabBar);
diff --git a/tests/auto/widgets/widgets/qmdisubwindow/qmdisubwindow.pro b/tests/auto/widgets/widgets/qmdisubwindow/qmdisubwindow.pro
index 4299f7711e..e33271428f 100644
--- a/tests/auto/widgets/widgets/qmdisubwindow/qmdisubwindow.pro
+++ b/tests/auto/widgets/widgets/qmdisubwindow/qmdisubwindow.pro
@@ -1,6 +1,6 @@
CONFIG += testcase
TARGET = tst_qmdisubwindow
-QT += widgets testlib
+QT += widgets widgets-private testlib
INCLUDEPATH += .
SOURCES += tst_qmdisubwindow.cpp
DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
diff --git a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
index 360e0c93c4..8b2f032172 100644
--- a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
+++ b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
@@ -30,6 +30,7 @@
#include <QtTest/QtTest>
#include "qmdisubwindow.h"
+#include "private/qmdisubwindow_p.h"
#include "qmdiarea.h"
#include <QLayout>
@@ -517,6 +518,9 @@ void tst_QMdiSubWindow::emittingOfSignals()
}
}
}
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("windowMaximized", "Broken on WinRT - QTBUG-68297", Abort);
+#endif
QCOMPARE(count, 1);
window->setParent(0);
@@ -542,6 +546,9 @@ void tst_QMdiSubWindow::showShaded()
QVERIFY(QTest::qWaitForWindowExposed(&workspace));
QVERIFY(!window->isShaded());
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Windows are maximized per default on WinRt ", Abort);
+#endif
QVERIFY(!window->isMaximized());
QCOMPARE(window->size(), QSize(300, 300));
@@ -634,6 +641,10 @@ void tst_QMdiSubWindow::showNormal()
qApp->processEvents();
window->showNormal();
qApp->processEvents();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("showMinimized", "Windows are maximized per default on WinRt ", Abort);
+ QEXPECT_FAIL("showMaximized", "Windows are maximized per default on WinRt ", Abort);
+#endif
QCOMPARE(window->geometry(), originalGeometry);
}
@@ -713,7 +724,9 @@ void tst_QMdiSubWindow::setOpaqueResizeAndMove()
resizeSpy.clear();
QCOMPARE(resizeSpy.count(), 0);
- QTest::qWait(250); // delayed update of dirty regions
+ // we need to wait for the resizeTimer to make sure updateDirtyRegions is called
+ auto priv = static_cast<QMdiSubWindowPrivate*>(qt_widget_private(window));
+ QTRY_COMPARE(priv->resizeTimerId, -1);
// Enter resize mode.
int offset = window->style()->pixelMetric(QStyle::PM_MDIFrameWidth) / 2;
@@ -740,6 +753,9 @@ void tst_QMdiSubWindow::setOpaqueResizeAndMove()
// Leave resize mode
sendMouseRelease(mouseReceiver, mousePosition);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on WinRT - QTBUG-68297", Abort);
+#endif
QCOMPARE(resizeSpy.count(), expectedGeometryCount);
QCOMPARE(window->size(), windowSize + QSize(geometryCount, geometryCount));
}
@@ -903,6 +919,9 @@ void tst_QMdiSubWindow::mouseDoubleClick()
workspace.show();
window->show();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Windows are maximized per default on WinRt ", Abort);
+#endif
QVERIFY(!window->isMaximized());
QVERIFY(!window->isShaded());
@@ -971,6 +990,9 @@ void tst_QMdiSubWindow::setSystemMenu()
QVERIFY(!qApp->activePopupWidget());
subWindow->showSystemMenu();
QTRY_COMPARE(qApp->activePopupWidget(), qobject_cast<QWidget *>(systemMenu));
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Broken on WinRT - QTBUG-68297", Abort);
+#endif
QTRY_COMPARE(systemMenu->mapToGlobal(QPoint(0, 0)),
(globalPopupPos = subWindow->mapToGlobal(subWindow->contentsRect().topLeft())) );
@@ -1196,6 +1218,9 @@ void tst_QMdiSubWindow::restoreFocusOverCreation()
QTRY_COMPARE(QApplication::focusWidget(), subWidget2->m_lineEdit1);
mdiArea.setActiveSubWindow(subWindow1);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Broken on WinRt - QTBUG-68297", Abort);
+#endif
QTRY_COMPARE(QApplication::focusWidget(), subWidget1->m_lineEdit2);
}
@@ -1404,6 +1429,9 @@ void tst_QMdiSubWindow::resizeEvents()
QCOMPARE(window->widget()->windowState(), windowState);
// Make sure we got as many resize events as expected.
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("maximized", "Broken on WinRT - QTBUG-68297", Abort);
+#endif
QCOMPARE(windowResizeEventSpy.count(), expectedWindowResizeEvents);
QCOMPARE(widgetResizeEventSpy.count(), expectedWidgetResizeEvents);
windowResizeEventSpy.clear();
@@ -1413,6 +1441,10 @@ void tst_QMdiSubWindow::resizeEvents()
window->showNormal();
// Check that the window state is correct.
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("minimized", "Broken on WinRT - QTBUG-68297", Abort);
+ QEXPECT_FAIL("shaded", "Broken on WinRT - QTBUG-68297", Abort);
+#endif
QCOMPARE(window->windowState(), Qt::WindowNoState | Qt::WindowActive);
QCOMPARE(window->widget()->windowState(), Qt::WindowNoState);
@@ -1673,6 +1705,9 @@ void tst_QMdiSubWindow::fixedMinMaxSize()
QCOMPARE(subWindow->maximumSize(), maximumSize);
mdiArea.addSubWindow(subWindow);
subWindow->show();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Windows are maximized per default on WinRt ", Abort);
+#endif
QCOMPARE(subWindow->size(), minimumSize);
// Calculate the size of a minimized sub window.
@@ -2057,6 +2092,9 @@ void tst_QMdiSubWindow::testFullScreenState()
subWindow->showFullScreen(); // QMdiSubWindow does not support the fullscreen state. This call
// should be equivalent to setVisible(true) (and not showNormal())
QVERIFY(QTest::qWaitForWindowExposed(&mdiArea));
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Windows are maximized per default on WinRt ", Abort);
+#endif
QCOMPARE(subWindow->size(), QSize(300, 300));
}
diff --git a/tests/auto/widgets/widgets/qmenu/BLACKLIST b/tests/auto/widgets/widgets/qmenu/BLACKLIST
index 1c970c43b3..89d12a259f 100644
--- a/tests/auto/widgets/widgets/qmenu/BLACKLIST
+++ b/tests/auto/widgets/widgets/qmenu/BLACKLIST
@@ -10,3 +10,5 @@ osx ci
osx
[tearOff]
osx
+[activeSubMenuPosition]
+winrt
diff --git a/tests/auto/widgets/widgets/qmenu/qmenu.pro b/tests/auto/widgets/widgets/qmenu/qmenu.pro
index 84b6530184..4a492ee941 100644
--- a/tests/auto/widgets/widgets/qmenu/qmenu.pro
+++ b/tests/auto/widgets/widgets/qmenu/qmenu.pro
@@ -5,4 +5,6 @@ SOURCES += tst_qmenu.cpp
macx:{
OBJECTIVE_SOURCES += tst_qmenu_mac.mm
LIBS += -lobjc
+} else {
+ DEFINES += QTEST_QPA_MOUSE_HANDLING
}
diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
index 0dde385bdb..a88fd8d19c 100644
--- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
+++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
@@ -29,6 +29,7 @@
#include <QtTest/QtTest>
#include <QtTest/private/qtesthelpers_p.h>
#include <qapplication.h>
+#include <private/qguiapplication_p.h>
#include <QPushButton>
#include <QMainWindow>
#include <QMenuBar>
@@ -48,6 +49,7 @@
#include <qdebug.h>
#include <qpa/qplatformtheme.h>
+#include <qpa/qplatformintegration.h>
using namespace QTestPrivate;
@@ -459,6 +461,9 @@ void tst_QMenu::focus()
void tst_QMenu::overrideMenuAction()
{
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
+ QSKIP("Window activation is not supported");
+
//test the override menu action by first creating an action to which we set its menu
QMainWindow w;
w.resize(300, 200);
@@ -614,6 +619,9 @@ static QMenu *getTornOffMenu()
void tst_QMenu::tearOff()
{
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
+ QSKIP("Window activation is not supported");
+
QWidget widget;
QScopedPointer<QMenu> menu(new QMenu(&widget));
QVERIFY(!menu->isTearOffEnabled()); //default value
@@ -686,6 +694,9 @@ void tst_QMenu::tearOff()
void tst_QMenu::submenuTearOffDontClose()
{
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
+ QSKIP("Window activation is not supported");
+
QWidget widget;
QMenu *menu = new QMenu(&widget);
QVERIFY(!menu->isTearOffEnabled()); //default value
@@ -713,7 +724,8 @@ void tst_QMenu::submenuTearOffDontClose()
// Move then click to avoid the submenu moves from causing it to close
QTest::mouseMove(menu, submenuPos, 100);
QTest::mouseClick(menu, Qt::LeftButton, 0, submenuPos, 100);
- QTRY_VERIFY(QTest::qWaitForWindowActive(submenu));
+ QVERIFY(QTest::qWaitFor([&]() { return submenu->window()->windowHandle(); }));
+ QVERIFY(QTest::qWaitForWindowActive(submenu));
// Make sure we enter the submenu frame directly on the tear-off area
QTest::mouseMove(submenu, QPoint(10, 3), 100);
if (submenu->style()->styleHint(QStyle::SH_Menu_SubMenuDontStartSloppyOnLeave)) {
@@ -843,6 +855,10 @@ private:
void tst_QMenu::activeSubMenuPositionExec()
{
+
+#ifdef Q_OS_WINRT
+ QSKIP("Broken on WinRT - QTBUG-68297");
+#endif
SubMenuPositionExecMenu menu;
menu.exec(QGuiApplication::primaryScreen()->availableGeometry().center());
}
@@ -986,9 +1002,6 @@ void tst_QMenu::task258920_mouseBorder()
QAction *action = menu.addAction("test");
const QPoint center = QApplication::desktop()->availableGeometry().center();
-#ifndef QT_NO_CURSOR
- QCursor::setPos(center - QPoint(100, 100)); // Mac: Ensure cursor is outside
-#endif
menu.popup(center);
QVERIFY(QTest::qWaitForWindowExposed(&menu));
QRect actionRect = menu.actionGeometry(action);
@@ -1082,6 +1095,9 @@ void tst_QMenu::pushButtonPopulateOnAboutToShow()
QTimer::singleShot(300, buttonMenu, SLOT(hide()));
QTest::mouseClick(&b, Qt::LeftButton, Qt::NoModifier, b.rect().center());
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "WinRT does not support QTest::mouseClick", Abort);
+#endif
QVERIFY2(!buttonMenu->geometry().intersects(b.geometry()), msgGeometryIntersects(buttonMenu->geometry(), b.geometry()));
// note: we're assuming that, if we previously got the desired geometry, we'll get it here too
@@ -1180,6 +1196,9 @@ void tst_QMenu::click_while_dismissing_submenu()
//this opens the submenu, move two times to emulate user interaction (d->motions > 0 in QMenu)
QTest::mouseMove(menuWindow, menu.rect().center() + QPoint(0,2));
QTest::mouseMove(menuWindow, menu.rect().center() + QPoint(1,3), 60);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "WinRT does not support QTest::mouseMove", Abort);
+#endif
QVERIFY(menuShownSpy.wait());
QVERIFY(sub.isVisible());
QVERIFY(QTest::qWaitForWindowExposed(&sub));
@@ -1229,96 +1248,95 @@ public:
void tst_QMenu::QTBUG47515_widgetActionEnterLeave()
{
-#if !QT_CONFIG(cursor)
- QSKIP("This test requires QCursor API");
-#else
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
+ QSKIP("Window activation is not supported");
if (QGuiApplication::platformName() == QLatin1String("cocoa"))
QSKIP("See QTBUG-63031");
- QPoint screenCenter = QGuiApplication::primaryScreen()->availableGeometry().center();
- QPoint pointOutsideMenu = screenCenter - QPoint(100, 100);
+ const QRect availableGeometry = QGuiApplication::primaryScreen()->availableGeometry();
+ QRect geometry(QPoint(), availableGeometry.size() / 3);
+ geometry.moveCenter(availableGeometry.center());
+ QPoint pointOutsideMenu = geometry.bottomRight() - QPoint(5, 5);
- QMenu menu("Menu1");
- QMenu submenu("Menu2");
+ QMainWindow topLevel;
+ topLevel.setGeometry(geometry);
- QWidgetAction menuAction(&menu);
- MyWidget w1(&menu);
- menuAction.setDefaultWidget(&w1);
+ QMenuBar *menuBar = topLevel.menuBar();
+ menuBar->setNativeMenuBar(false);
+ QMenu *menu = menuBar->addMenu("Menu1");
+ QMenu *submenu = menu->addMenu("Menu2");
- QWidgetAction submenuAction(&submenu);
- MyWidget w2(&submenu);
- submenuAction.setDefaultWidget(&w2);
+ QWidgetAction *menuAction = new QWidgetAction(menu);
+ MyWidget *w1 = new MyWidget(menu);
+ menuAction->setDefaultWidget(w1);
- QAction *nextMenuAct = menu.addMenu(&submenu);
+ QWidgetAction *submenuAction = new QWidgetAction(submenu);
+ MyWidget *w2 = new MyWidget(submenu);
+ submenuAction->setDefaultWidget(w2);
- menu.addAction(&menuAction);
- submenu.addAction(&submenuAction);
+ QAction *nextMenuAct = menu->addMenu(submenu);
- // Root menu
- {
- QCursor::setPos(pointOutsideMenu);
- QTRY_COMPARE(QCursor::pos(), pointOutsideMenu);
- menu.popup(screenCenter);
- QVERIFY(QTest::qWaitForWindowExposed(&menu));
+ menu->addAction(menuAction);
+ submenu->addAction(submenuAction);
+
+ topLevel.show();
+ topLevel.setWindowTitle(QTest::currentTestFunction());
+ QVERIFY(QTest::qWaitForWindowActive(&topLevel));
+ QWindow *topLevelWindow = topLevel.windowHandle();
+ QVERIFY(topLevelWindow);
- w1.enter = 0;
- w1.leave = 0;
- QPoint w1Center = w1.rect().center();
- const QPoint w1CenterGlobal = w1.mapToGlobal(w1Center);
- QCursor::setPos(w1CenterGlobal);
- QTRY_COMPARE(QCursor::pos(), w1CenterGlobal);
- QVERIFY(w1.isVisible());
- QTRY_COMPARE(w1.leave, 0);
- QTRY_COMPARE(w1.enter, 1);
+ // Root menu: Click on menu bar to open menu1
+ {
+ const QPoint menuActionPos = menuBar->mapTo(&topLevel, menuBar->actionGeometry(menu->menuAction()).center());
+ QTest::mouseClick(topLevelWindow, Qt::LeftButton, Qt::KeyboardModifiers(), menuActionPos);
+ QVERIFY(QTest::qWaitForWindowExposed(menu));
+
+ w1->enter = 0;
+ w1->leave = 0;
+ QPoint w1Center = topLevel.mapFromGlobal(w1->mapToGlobal(w1->rect().center()));
+ QTest::mouseMove(topLevelWindow, w1Center);
+ QVERIFY(w1->isVisible());
+ QTRY_COMPARE(w1->leave, 0);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "WinRT does not support QTest::mouseMove", Abort);
+#endif
+ QTRY_COMPARE(w1->enter, 1);
// Check whether leave event is not delivered on mouse move
- w1.move = 0;
- QWidget *nativeParent = w1.nativeParentWidget();
- QVERIFY(nativeParent);
- QWindow *window = nativeParent->windowHandle();
- QVERIFY(window);
- QTest::mouseMove(window, w1.mapTo(nativeParent, w1Center + QPoint(1, 1)));
- QTRY_COMPARE(w1.move, 1);
- QTRY_COMPARE(w1.leave, 0);
- QTRY_COMPARE(w1.enter, 1);
-
- QCursor::setPos(pointOutsideMenu);
- QTRY_COMPARE(QCursor::pos(), pointOutsideMenu);
- QTRY_COMPARE(w1.leave, 1);
- QTRY_COMPARE(w1.enter, 1);
+ w1->move = 0;
+ QTest::mouseMove(topLevelWindow, w1Center + QPoint(1, 1));
+ QTRY_COMPARE(w1->move, 1);
+ QTRY_COMPARE(w1->leave, 0);
+ QTRY_COMPARE(w1->enter, 1);
+
+ QTest::mouseMove(topLevelWindow, topLevel.mapFromGlobal(pointOutsideMenu));
+ QTRY_COMPARE(w1->leave, 1);
+ QTRY_COMPARE(w1->enter, 1);
}
// Submenu
{
- menu.setActiveAction(nextMenuAct);
- QVERIFY(QTest::qWaitForWindowExposed(&submenu));
+ menu->setActiveAction(nextMenuAct);
+ QVERIFY(QTest::qWaitForWindowExposed(submenu));
- QPoint w2Center = w2.rect().center();
- const QPoint w2CenterGlobal = w2.mapToGlobal(w2Center);
- QCursor::setPos(w2CenterGlobal);
- QTRY_COMPARE(QCursor::pos(), w2CenterGlobal);
+ QPoint w2Center = topLevel.mapFromGlobal(w2->mapToGlobal(w2->rect().center()));
+ QTest::mouseMove(topLevelWindow, w2Center);
- QVERIFY(w2.isVisible());
- QTRY_COMPARE(w2.leave, 0);
- QTRY_COMPARE(w2.enter, 1);
+ QVERIFY(w2->isVisible());
+ QTRY_COMPARE(w2->leave, 0);
+ QTRY_COMPARE(w2->enter, 1);
// Check whether leave event is not delivered on mouse move
- w2.move = 0;
- QWidget *nativeParent = w2.nativeParentWidget();
- QVERIFY(nativeParent);
- QWindow *window = nativeParent->windowHandle();
- QVERIFY(window);
- QTest::mouseMove(window, w2.mapTo(nativeParent, w2Center + QPoint(1, 1)));
- QTRY_COMPARE(w2.move, 1);
- QTRY_COMPARE(w2.leave, 0);
- QTRY_COMPARE(w2.enter, 1);
-
- QCursor::setPos(pointOutsideMenu);
- QTRY_COMPARE(QCursor::pos(), pointOutsideMenu);
- QTRY_COMPARE(w2.leave, 1);
- QTRY_COMPARE(w2.enter, 1);
+ w2->move = 0;
+ QTest::mouseMove(topLevelWindow, w2Center + QPoint(1, 1));
+ QTRY_COMPARE(w2->move, 1);
+ QTRY_COMPARE(w2->leave, 0);
+ QTRY_COMPARE(w2->enter, 1);
+
+ QTest::mouseMove(topLevelWindow, topLevel.mapFromGlobal(pointOutsideMenu));
+ QTRY_COMPARE(w2->leave, 1);
+ QTRY_COMPARE(w2->enter, 1);
}
-#endif // QT_NO_CURSOR
}
class MyMenu : public QMenu
@@ -1407,6 +1425,9 @@ void tst_QMenu::QTBUG_56917_wideMenuSize()
menu.popup(QPoint());
QVERIFY(QTest::qWaitForWindowExposed(&menu));
QVERIFY(menu.isVisible());
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Broken on WinRT - QTBUG-68297", Abort);
+#endif
QVERIFY(menu.height() <= menuSizeHint.height());
}
@@ -1542,6 +1563,9 @@ void tst_QMenu::menuSize_Scrolling()
getContentsMargins(&leftMargin, &topMargin, &rightMargin, &bottomMargin);
QRect lastItem = actionGeometry(actions().at(actions().length() - 1));
QSize s = size();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Broken on WinRT - QTBUG-68297", Abort);
+#endif
QCOMPARE( s.width(), lastItem.right() + fw + hmargin + rightMargin + 1);
QMenu::showEvent(e);
}
@@ -1610,6 +1634,12 @@ void tst_QMenu::menuSize_Scrolling()
return;
QTest::keyClick(&menu, Qt::Key_End);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("data8", "Broken on WinRT - QTBUG-68297", Abort);
+ QEXPECT_FAIL("data9", "Broken on WinRT - QTBUG-68297", Abort);
+ QEXPECT_FAIL("data10", "Broken on WinRT - QTBUG-68297", Abort);
+ QEXPECT_FAIL("data11", "Broken on WinRT - QTBUG-68297", Abort);
+#endif
QTRY_COMPARE(menu.actionGeometry(actions.last()).right(),
menu.width() - mm.fw - mm.hmargin - leftMargin - 1);
QCOMPARE(menu.actionGeometry(actions.last()).bottom(),
@@ -1618,6 +1648,8 @@ void tst_QMenu::menuSize_Scrolling()
void tst_QMenu::tearOffMenuNotDisplayed()
{
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
+ QSKIP("Window activation is not supported");
QWidget widget;
QScopedPointer<QMenu> menu(new QMenu(&widget));
menu->setTearOffEnabled(true);
@@ -1653,6 +1685,9 @@ void tst_QMenu::tearOffMenuNotDisplayed()
void tst_QMenu::QTBUG_61039_menu_shortcuts()
{
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
+ QSKIP("Window activation is not supported");
+
QAction *actionKamen = new QAction("Action Kamen");
actionKamen->setShortcut(QKeySequence(QLatin1String("K")));
diff --git a/tests/auto/widgets/widgets/qmenubar/BLACKLIST b/tests/auto/widgets/widgets/qmenubar/BLACKLIST
index 9b8e07312d..f897797f00 100644
--- a/tests/auto/widgets/widgets/qmenubar/BLACKLIST
+++ b/tests/auto/widgets/widgets/qmenubar/BLACKLIST
@@ -1,5 +1,8 @@
[check_menuPosition]
ubuntu-16.04
#QTBUG-66255
+ubuntu-18.04
[activatedCount]
*
+[QTBUG_65488_hiddenActionTriggered]
+winrt
diff --git a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
index ab82268578..3063d43aa6 100644
--- a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
@@ -1184,6 +1184,9 @@ void tst_QMenuBar::check_menuPosition()
mbItemRect.moveTo(w.menuBar()->mapToGlobal(mbItemRect.topLeft()));
QTest::keyClick(&w, Qt::Key_M, Qt::AltModifier );
QVERIFY(menu.isActiveWindow());
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "QTest::keyClick does not work on WinRT.", Abort);
+#endif
QCOMPARE(menu.pos(), QPoint(mbItemRect.x(), mbItemRect.top() - menu.height()));
menu.close();
}
@@ -1512,6 +1515,9 @@ void tst_QMenuBar::cornerWidgets()
case Qt::TopLeftCorner:
QVERIFY2(fileMenuGeometry.left() >= cornerWidgetWidth,
msgComparison(fileMenuGeometry.left(), ">=", cornerWidgetWidth));
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Broken on WinRT - QTBUG-68297", Abort);
+#endif
QVERIFY2(menuBarWidth - editMenuGeometry.right() < cornerWidgetWidth,
msgComparison(menuBarWidth - editMenuGeometry.right(), "<", cornerWidgetWidth));
break;
@@ -1754,7 +1760,6 @@ void tst_QMenuBar::QTBUG_57404_existingMenuItemException()
mb->addMenu(editMenu);
QAction *copyAction = editMenu->addAction("&Copy");
copyAction->setShortcut(QKeySequence("Ctrl+C"));
- QTest::ignoreMessage(QtWarningMsg, "Menu item \"&Copy\" has unsupported role QPlatformMenuItem::MenuRole(NoRole)");
copyAction->setMenuRole(QAction::NoRole);
QVERIFY(QTest::qWaitForWindowExposed(&mw2));
diff --git a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
index a08a8862b8..cfa2ddc4cc 100644
--- a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
+++ b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
@@ -1352,6 +1352,9 @@ void tst_QPlainTextEdit::adjustScrollbars()
QLatin1String txt("\nabc def ghi jkl mno pqr stu vwx");
ed->setPlainText(txt + txt + txt + txt);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "WinRT does not support setMinimum/MaximumSize", Abort);
+#endif
QVERIFY(ed->verticalScrollBar()->maximum() > 0);
ed->moveCursor(QTextCursor::End);
diff --git a/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp b/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp
index 39989c6dbb..df5ff9d448 100644
--- a/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp
+++ b/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp
@@ -255,6 +255,9 @@ void tst_QProgressBar::setMinMaxRepaint()
pbar.repainted = false;
pbar.setMinimum(0);
QTest::qWait(50);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Broken on WinRT - QTBUG-68297", Abort);
+#endif
QTRY_VERIFY(!pbar.repainted);
// No repaint when setting maximum to the current maximum
diff --git a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
index 625f38d8ae..66f4df4498 100644
--- a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
+++ b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
@@ -507,7 +507,7 @@ void tst_QPushButton::sizeHint_data()
#if !defined(QT_NO_STYLE_FUSION)
QTest::newRow("fusion") << QString::fromLatin1("fusion");
#endif
-#if defined(Q_OS_WIN) && !defined(QT_NO_STYLE_WINDOWSVISTA)
+#if defined(Q_OS_WIN) && !defined(QT_NO_STYLE_WINDOWSVISTA) && !defined(Q_OS_WINRT)
QTest::newRow("windowsvista") << QString::fromLatin1("windowsvista");
#endif
}
diff --git a/tests/auto/widgets/widgets/qsizegrip/BLACKLIST b/tests/auto/widgets/widgets/qsizegrip/BLACKLIST
deleted file mode 100644
index 2c874bcb57..0000000000
--- a/tests/auto/widgets/widgets/qsizegrip/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[hideAndShowOnWindowStateChange:Qt::Window]
-xcb
diff --git a/tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp b/tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp
index 7610adc155..4cc1810cd4 100644
--- a/tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp
+++ b/tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp
@@ -107,6 +107,9 @@ void tst_QSizeGrip::hideAndShowOnWindowStateChange_data()
void tst_QSizeGrip::hideAndShowOnWindowStateChange()
{
QFETCH(Qt::WindowType, windowType);
+#ifdef Q_OS_WINRT
+ QSKIP("Broken on WinRT - QTBUG-68297");
+#endif
QWidget *parentWidget = windowType == Qt::Window ? 0 : new QWidget;
TestWidget *widget = new TestWidget(parentWidget, Qt::WindowFlags(windowType));
@@ -152,6 +155,10 @@ void tst_QSizeGrip::hideAndShowOnWindowStateChange()
void tst_QSizeGrip::orientation()
{
+#ifdef Q_OS_WINRT
+ QSKIP("Broken on WinRT - QTBUG-68297");
+#endif
+
TestWidget widget;
widget.setLayout(new QVBoxLayout);
QSizeGrip *sizeGrip = new QSizeGrip(&widget);
@@ -198,7 +205,9 @@ void tst_QSizeGrip::dontCrashOnTLWChange()
// the above setup causes a change of TLW for the size grip,
// and it must not crash.
-
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Broken on WinRT - QTBUG-68297", Abort);
+#endif
QVERIFY(QTest::qWaitForWindowExposed(&mdiArea));
QVERIFY(QTest::qWaitForWindowExposed(mw));
}
diff --git a/tests/auto/widgets/widgets/qspinbox/BLACKLIST b/tests/auto/widgets/widgets/qspinbox/BLACKLIST
new file mode 100644
index 0000000000..a38511bfb4
--- /dev/null
+++ b/tests/auto/widgets/widgets/qspinbox/BLACKLIST
@@ -0,0 +1,3 @@
+[stepModifierPressAndHold]
+opensuse ci # QTBUG-69492
+opensuse-leap ci
diff --git a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
index 57816f9f70..37bb28dec9 100644
--- a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
+++ b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
@@ -50,6 +50,9 @@
#include <QKeySequence>
#include <QStackedWidget>
#include <QDebug>
+#include <QStyleOptionSpinBox>
+#include <QStyle>
+#include <QProxyStyle>
class SpinBox : public QSpinBox
{
@@ -75,10 +78,54 @@ public:
QSpinBox::wheelEvent(event);
}
#endif
+ void initStyleOption(QStyleOptionSpinBox *option) const
+ {
+ QSpinBox::initStyleOption(option);
+ }
QLineEdit *lineEdit() const { return QSpinBox::lineEdit(); }
};
+class PressAndHoldStyle : public QProxyStyle
+{
+ Q_OBJECT
+public:
+ using QProxyStyle::QProxyStyle;
+
+ int styleHint(QStyle::StyleHint hint, const QStyleOption *option = nullptr,
+ const QWidget *widget = nullptr, QStyleHintReturn *returnData = nullptr) const override
+ {
+ switch (hint) {
+ case QStyle::SH_SpinBox_ClickAutoRepeatRate:
+ return 5;
+ case QStyle::SH_SpinBox_ClickAutoRepeatThreshold:
+ return 10;
+ default:
+ return QProxyStyle::styleHint(hint, option, widget, returnData);
+ }
+ }
+};
+
+class StepModifierStyle : public QProxyStyle
+{
+ Q_OBJECT
+public:
+ using QProxyStyle::QProxyStyle;
+
+ int styleHint(QStyle::StyleHint hint, const QStyleOption *option = nullptr,
+ const QWidget *widget = nullptr, QStyleHintReturn *returnData = nullptr) const override
+ {
+ switch (hint) {
+ case QStyle::SH_SpinBox_StepModifier:
+ return stepModifier;
+ default:
+ return QProxyStyle::styleHint(hint, option, widget, returnData);
+ }
+ }
+
+ Qt::KeyboardModifier stepModifier = Qt::ControlModifier;
+};
+
class tst_QSpinBox : public QObject
{
Q_OBJECT
@@ -143,8 +190,19 @@ private slots:
void setGroupSeparatorShown_data();
void setGroupSeparatorShown();
+ void wheelEvents_data();
void wheelEvents();
+ void adaptiveDecimalStep();
+
+ void stepModifierKeys_data();
+ void stepModifierKeys();
+
+ void stepModifierButtons_data();
+ void stepModifierButtons();
+
+ void stepModifierPressAndHold_data();
+ void stepModifierPressAndHold();
public slots:
void valueChangedHelper(const QString &);
void valueChangedHelper(int);
@@ -158,6 +216,30 @@ typedef QList<int> IntList;
Q_DECLARE_METATYPE(QLocale::Language)
Q_DECLARE_METATYPE(QLocale::Country)
+static QLatin1String modifierToName(Qt::KeyboardModifier modifier)
+{
+ switch (modifier) {
+ case Qt::NoModifier:
+ return QLatin1Literal("No");
+ break;
+ case Qt::ControlModifier:
+ return QLatin1Literal("Ctrl");
+ break;
+ case Qt::ShiftModifier:
+ return QLatin1Literal("Shift");
+ break;
+ case Qt::AltModifier:
+ return QLatin1Literal("Alt");
+ break;
+ case Qt::MetaModifier:
+ return QLatin1Literal("Meta");
+ break;
+ default:
+ qFatal("Unexpected keyboard modifier");
+ return QLatin1String();
+ }
+}
+
// Testing get/set functions
void tst_QSpinBox::getSetCheck()
{
@@ -410,13 +492,17 @@ void tst_QSpinBox::setReadOnly()
QTest::keyClick(&spin, Qt::Key_Up);
QCOMPARE(spin.value(), 1);
spin.setReadOnly(true);
+#ifndef Q_OS_WINRT // QTBUG-68297
QCOMPARE(spin.eventsReceived, QList<QEvent::Type>() << QEvent::ReadOnlyChange);
+#endif
QTest::keyClick(&spin, Qt::Key_Up);
QCOMPARE(spin.value(), 1);
spin.stepBy(1);
QCOMPARE(spin.value(), 2);
spin.setReadOnly(false);
+#ifndef Q_OS_WINRT // QTBUG-68297
QCOMPARE(spin.eventsReceived, QList<QEvent::Type>() << QEvent::ReadOnlyChange << QEvent::ReadOnlyChange);
+#endif
QTest::keyClick(&spin, Qt::Key_Up);
QCOMPARE(spin.value(), 3);
}
@@ -1215,28 +1301,505 @@ void tst_QSpinBox::setGroupSeparatorShown()
QCOMPARE(spinBox.value()+1000, 33000);
}
+void tst_QSpinBox::wheelEvents_data()
+{
+#if QT_CONFIG(wheelevent)
+ QTest::addColumn<QPoint>("angleDelta");
+ QTest::addColumn<int>("qt4Delta");
+ QTest::addColumn<int>("stepModifier");
+ QTest::addColumn<Qt::KeyboardModifiers>("modifier");
+ QTest::addColumn<Qt::MouseEventSource>("source");
+ QTest::addColumn<int>("start");
+ QTest::addColumn<IntList>("expectedValues");
+
+ const auto fractions = {false, true};
+
+ const auto directions = {true, false};
+
+ const auto modifierList = {Qt::NoModifier,
+ Qt::ShiftModifier,
+ Qt::ControlModifier,
+ Qt::AltModifier,
+ Qt::MetaModifier};
+
+ const auto validStepModifierList = {Qt::NoModifier,
+ Qt::ControlModifier,
+ Qt::ShiftModifier};
+
+ const auto sources = {Qt::MouseEventNotSynthesized,
+ Qt::MouseEventSynthesizedBySystem,
+ Qt::MouseEventSynthesizedByQt,
+ Qt::MouseEventSynthesizedByApplication};
+
+ const int startValue = 0;
+
+ for (auto fraction : fractions) {
+ for (auto up : directions) {
+
+ const int units = (fraction ? 60 : 120) * (up ? 1 : -1);
+
+ for (auto modifier : modifierList) {
+
+ const Qt::KeyboardModifiers modifiers(modifier);
+
+ const auto modifierName = modifierToName(modifier);
+ if (modifierName.isEmpty())
+ continue;
+
+ for (auto stepModifier : validStepModifierList) {
+
+ const auto stepModifierName = modifierToName(stepModifier);
+ if (stepModifierName.isEmpty())
+ continue;
+
+ const int steps = (modifier & stepModifier ? 10 : 1)
+ * (up ? 1 : -1);
+
+ for (auto source : sources) {
+
+#ifdef Q_OS_MACOS
+ QPoint angleDelta;
+ if ((modifier & Qt::ShiftModifier) &&
+ source == Qt::MouseEventNotSynthesized) {
+ // On macOS the Shift modifier converts vertical
+ // mouse wheel events to horizontal.
+ angleDelta = { units, 0 };
+ } else {
+ // However, this is not the case for trackpad scroll
+ // events.
+ angleDelta = { 0, units };
+ }
+#else
+ const QPoint angleDelta(0, units);
+#endif
+
+ QLatin1String sourceName;
+ switch (source) {
+ case Qt::MouseEventNotSynthesized:
+ sourceName = QLatin1Literal("NotSynthesized");
+ break;
+ case Qt::MouseEventSynthesizedBySystem:
+ sourceName = QLatin1Literal("SynthesizedBySystem");
+ break;
+ case Qt::MouseEventSynthesizedByQt:
+ sourceName = QLatin1Literal("SynthesizedByQt");
+ break;
+ case Qt::MouseEventSynthesizedByApplication:
+ sourceName = QLatin1Literal("SynthesizedByApplication");
+ break;
+ default:
+ qFatal("Unexpected wheel event source");
+ continue;
+ }
+
+ IntList expectedValues;
+ if (fraction)
+ expectedValues << startValue;
+ expectedValues << startValue + steps;
+
+ QTest::addRow("%s%s%sWith%sKeyboardModifier%s",
+ fraction ? "half" : "full",
+ up ? "Up" : "Down",
+ stepModifierName.latin1(),
+ modifierName.latin1(),
+ sourceName.latin1())
+ << angleDelta
+ << units
+ << static_cast<int>(stepModifier)
+ << modifiers
+ << source
+ << startValue
+ << expectedValues;
+ }
+ }
+ }
+ }
+ }
+#else
+ QSKIP("Built with --no-feature-wheelevent");
+#endif
+}
+
void tst_QSpinBox::wheelEvents()
{
#if QT_CONFIG(wheelevent)
+ QFETCH(QPoint, angleDelta);
+ QFETCH(int, qt4Delta);
+ QFETCH(int, stepModifier);
+ QFETCH(Qt::KeyboardModifiers, modifier);
+ QFETCH(Qt::MouseEventSource, source);
+ QFETCH(int, start);
+ QFETCH(IntList, expectedValues);
+
SpinBox spinBox;
spinBox.setRange(-20, 20);
+ spinBox.setValue(start);
+
+ QScopedPointer<StepModifierStyle, QScopedPointerDeleteLater> style(
+ new StepModifierStyle);
+ style->stepModifier = static_cast<Qt::KeyboardModifier>(stepModifier);
+ spinBox.setStyle(style.data());
+
+ QWheelEvent event(QPointF(), QPointF(), QPoint(), angleDelta, qt4Delta,
+ Qt::Vertical, Qt::NoButton, modifier, Qt::NoScrollPhase,
+ source);
+ for (int expected : expectedValues) {
+ qApp->sendEvent(&spinBox, &event);
+ QCOMPARE(spinBox.value(), expected);
+ }
+#else
+ QSKIP("Built with --no-feature-wheelevent");
+#endif
+}
+
+void tst_QSpinBox::adaptiveDecimalStep()
+{
+ SpinBox spinBox;
+ spinBox.setRange(-100000, 100000);
+ spinBox.setStepType(SpinBox::StepType::AdaptiveDecimalStepType);
+
+ // Positive values
+
spinBox.setValue(0);
- QWheelEvent wheelUp(QPointF(), QPointF(), QPoint(), QPoint(0, 120), 120, Qt::Vertical, Qt::NoButton, Qt::NoModifier);
- spinBox.wheelEvent(&wheelUp);
- QCOMPARE(spinBox.value(), 1);
+ // Go from 0 to 100
+ for (int i = 0; i < 100; i++) {
+ QCOMPARE(spinBox.value(), i);
+ spinBox.stepBy(1);
+ }
- QWheelEvent wheelDown(QPointF(), QPointF(), QPoint(), QPoint(0, -120), -120, Qt::Vertical, Qt::NoButton, Qt::NoModifier);
- spinBox.wheelEvent(&wheelDown);
- spinBox.wheelEvent(&wheelDown);
- QCOMPARE(spinBox.value(), -1);
+ // Go from 100 to 1000
+ for (int i = 100; i < 1000; i += 10) {
+ QCOMPARE(spinBox.value(), i);
+ spinBox.stepBy(1);
+ }
- QWheelEvent wheelHalfUp(QPointF(), QPointF(), QPoint(), QPoint(0, 60), 60, Qt::Vertical, Qt::NoButton, Qt::NoModifier);
- spinBox.wheelEvent(&wheelHalfUp);
- QCOMPARE(spinBox.value(), -1);
- spinBox.wheelEvent(&wheelHalfUp);
- QCOMPARE(spinBox.value(), 0);
-#endif
+ // Go from 1000 to 10000
+ for (int i = 1000; i < 10000; i += 100) {
+ QCOMPARE(spinBox.value(), i);
+ spinBox.stepBy(1);
+ }
+
+ // Test decreasing the values now
+
+ // Go from 10000 down to 1000
+ for (int i = 10000; i > 1000; i -= 100) {
+ QCOMPARE(spinBox.value(), i);
+ spinBox.stepBy(-1);
+ }
+
+ // Go from 1000 down to 100
+ for (int i = 1000; i > 100; i -= 10) {
+ QCOMPARE(spinBox.value(), i);
+ spinBox.stepBy(-1);
+ }
+
+ // Negative values
+
+ spinBox.setValue(0);
+
+ // Go from 0 to -100
+ for (int i = 0; i > -100; i--) {
+ QCOMPARE(spinBox.value(), i);
+ spinBox.stepBy(-1);
+ }
+
+ // Go from -100 to -1000
+ for (int i = -100; i > -1000; i -= 10) {
+ QCOMPARE(spinBox.value(), i);
+ spinBox.stepBy(-1);
+ }
+
+ // Go from 1000 to 10000
+ for (int i = -1000; i > -10000; i -= 100) {
+ QCOMPARE(spinBox.value(), i);
+ spinBox.stepBy(-1);
+ }
+
+ // Test increasing the values now
+
+ // Go from -10000 up to -1000
+ for (int i = -10000; i < -1000; i += 100) {
+ QCOMPARE(spinBox.value(), i);
+ spinBox.stepBy(1);
+ }
+
+ // Go from -1000 up to -100
+ for (int i = -1000; i < -100; i += 10) {
+ QCOMPARE(spinBox.value(), i);
+ spinBox.stepBy(1);
+ }
+}
+
+void tst_QSpinBox::stepModifierKeys_data()
+{
+ QTest::addColumn<int>("startValue");
+ QTest::addColumn<int>("stepModifier");
+ QTest::addColumn<QTestEventList>("keys");
+ QTest::addColumn<int>("expectedValue");
+
+ const auto keyList = {Qt::Key_Up, Qt::Key_Down};
+
+ const auto modifierList = {Qt::NoModifier,
+ Qt::ShiftModifier,
+ Qt::ControlModifier,
+ Qt::AltModifier,
+ Qt::MetaModifier};
+
+ const auto validStepModifierList = {Qt::NoModifier,
+ Qt::ControlModifier,
+ Qt::ShiftModifier};
+
+ for (auto key : keyList) {
+
+ const bool up = key == Qt::Key_Up;
+ Q_ASSERT(up || key == Qt::Key_Down);
+
+ const int startValue = up ? 0.0 : 10.0;
+
+ for (auto modifier : modifierList) {
+
+ QTestEventList keys;
+ keys.addKeyClick(key, modifier);
+
+ const auto modifierName = modifierToName(modifier);
+ if (modifierName.isEmpty())
+ continue;
+
+ for (auto stepModifier : validStepModifierList) {
+
+ const auto stepModifierName = modifierToName(stepModifier);
+ if (stepModifierName.isEmpty())
+ continue;
+
+ const int steps = (modifier & stepModifier ? 10 : 1)
+ * (up ? 1 : -1);
+
+ const int expectedValue = startValue + steps;
+
+ QTest::addRow("%s%sWith%sKeyboardModifier",
+ up ? "up" : "down",
+ stepModifierName.latin1(),
+ modifierName.latin1())
+ << startValue
+ << static_cast<int>(stepModifier)
+ << keys
+ << expectedValue;
+ }
+ }
+ }
+}
+
+void tst_QSpinBox::stepModifierKeys()
+{
+ QFETCH(int, startValue);
+ QFETCH(int, stepModifier);
+ QFETCH(QTestEventList, keys);
+ QFETCH(int, expectedValue);
+
+ QSpinBox spin(0);
+ spin.setValue(startValue);
+
+ QScopedPointer<StepModifierStyle, QScopedPointerDeleteLater> style(
+ new StepModifierStyle);
+ style->stepModifier = static_cast<Qt::KeyboardModifier>(stepModifier);
+ spin.setStyle(style.data());
+
+ spin.show();
+ QVERIFY(QTest::qWaitForWindowActive(&spin));
+
+ QCOMPARE(spin.value(), startValue);
+ keys.simulate(&spin);
+ QCOMPARE(spin.value(), expectedValue);
+}
+
+void tst_QSpinBox::stepModifierButtons_data()
+{
+ QTest::addColumn<QStyle::SubControl>("subControl");
+ QTest::addColumn<int>("stepModifier");
+ QTest::addColumn<Qt::KeyboardModifiers>("modifiers");
+ QTest::addColumn<int>("startValue");
+ QTest::addColumn<int>("expectedValue");
+
+ const auto subControls = {QStyle::SC_SpinBoxUp, QStyle::SC_SpinBoxDown};
+
+ const auto modifierList = {Qt::NoModifier,
+ Qt::ShiftModifier,
+ Qt::ControlModifier,
+ Qt::AltModifier,
+ Qt::MetaModifier};
+
+ const auto validStepModifierList = {Qt::NoModifier,
+ Qt::ControlModifier,
+ Qt::ShiftModifier};
+
+ for (auto subControl : subControls) {
+
+ const bool up = subControl == QStyle::SC_SpinBoxUp;
+ Q_ASSERT(up || subControl == QStyle::SC_SpinBoxDown);
+
+ const int startValue = up ? 0 : 10;
+
+ for (auto modifier : modifierList) {
+
+ const Qt::KeyboardModifiers modifiers(modifier);
+
+ const auto modifierName = modifierToName(modifier);
+ if (modifierName.isEmpty())
+ continue;
+
+ for (auto stepModifier : validStepModifierList) {
+
+ const auto stepModifierName = modifierToName(stepModifier);
+ if (stepModifierName.isEmpty())
+ continue;
+
+ const int steps = (modifier & stepModifier ? 10 : 1)
+ * (up ? 1 : -1);
+
+ const int expectedValue = startValue + steps;
+
+ QTest::addRow("%s%sWith%sKeyboardModifier",
+ up ? "up" : "down",
+ stepModifierName.latin1(),
+ modifierName.latin1())
+ << subControl
+ << static_cast<int>(stepModifier)
+ << modifiers
+ << startValue
+ << expectedValue;
+ }
+ }
+ }
+}
+
+void tst_QSpinBox::stepModifierButtons()
+{
+ QFETCH(QStyle::SubControl, subControl);
+ QFETCH(int, stepModifier);
+ QFETCH(Qt::KeyboardModifiers, modifiers);
+ QFETCH(int, startValue);
+ QFETCH(int, expectedValue);
+
+ SpinBox spin(0);
+ spin.setRange(-20, 20);
+ spin.setValue(startValue);
+
+ QScopedPointer<StepModifierStyle, QScopedPointerDeleteLater> style(
+ new StepModifierStyle);
+ style->stepModifier = static_cast<Qt::KeyboardModifier>(stepModifier);
+ spin.setStyle(style.data());
+
+ spin.show();
+ QVERIFY(QTest::qWaitForWindowActive(&spin));
+
+ QStyleOptionSpinBox spinBoxStyleOption;
+ spin.initStyleOption(&spinBoxStyleOption);
+
+ const QRect buttonRect = spin.style()->subControlRect(
+ QStyle::CC_SpinBox, &spinBoxStyleOption, subControl, &spin);
+
+ QCOMPARE(spin.value(), startValue);
+ QTest::mouseClick(&spin, Qt::LeftButton, modifiers, buttonRect.center());
+ QCOMPARE(spin.value(), expectedValue);
+}
+
+void tst_QSpinBox::stepModifierPressAndHold_data()
+{
+ QTest::addColumn<QStyle::SubControl>("subControl");
+ QTest::addColumn<int>("stepModifier");
+ QTest::addColumn<Qt::KeyboardModifiers>("modifiers");
+ QTest::addColumn<int>("expectedStepModifier");
+
+ const auto subControls = {QStyle::SC_SpinBoxUp, QStyle::SC_SpinBoxDown};
+
+ const auto modifierList = {Qt::NoModifier,
+ Qt::ShiftModifier,
+ Qt::ControlModifier,
+ Qt::AltModifier,
+ Qt::MetaModifier};
+
+ const auto validStepModifierList = {Qt::NoModifier,
+ Qt::ControlModifier,
+ Qt::ShiftModifier};
+
+ for (auto subControl : subControls) {
+
+ const bool up = subControl == QStyle::SC_SpinBoxUp;
+ Q_ASSERT(up || subControl == QStyle::SC_SpinBoxDown);
+
+ for (auto modifier : modifierList) {
+
+ const Qt::KeyboardModifiers modifiers(modifier);
+
+ const auto modifierName = modifierToName(modifier);
+ if (modifierName.isEmpty())
+ continue;
+
+ for (auto stepModifier : validStepModifierList) {
+
+ const auto stepModifierName = modifierToName(stepModifier);
+ if (stepModifierName.isEmpty())
+ continue;
+
+ const int steps = (modifier & stepModifier ? 10 : 1)
+ * (up ? 1 : -1);
+
+ QTest::addRow("%s%sWith%sKeyboardModifier",
+ up ? "up" : "down",
+ stepModifierName.latin1(),
+ modifierName.latin1())
+ << subControl
+ << static_cast<int>(stepModifier)
+ << modifiers
+ << steps;
+ }
+ }
+ }
+}
+
+void tst_QSpinBox::stepModifierPressAndHold()
+{
+ QFETCH(QStyle::SubControl, subControl);
+ QFETCH(int, stepModifier);
+ QFETCH(Qt::KeyboardModifiers, modifiers);
+ QFETCH(int, expectedStepModifier);
+
+ SpinBox spin(0);
+ spin.setRange(-100, 100);
+ spin.setValue(0);
+
+ QScopedPointer<StepModifierStyle, QScopedPointerDeleteLater> stepModifierStyle(
+ new StepModifierStyle(new PressAndHoldStyle));
+ stepModifierStyle->stepModifier = static_cast<Qt::KeyboardModifier>(stepModifier);
+ spin.setStyle(stepModifierStyle.data());
+
+ QSignalSpy spy(&spin, QOverload<int>::of(&SpinBox::valueChanged));
+ // TODO: remove debug output when QTBUG-69492 is fixed
+ connect(&spin, QOverload<int>::of(&SpinBox::valueChanged), [=]() {
+ qDebug() << QTime::currentTime() << "valueChanged emitted";
+ });
+
+ spin.show();
+ QVERIFY(QTest::qWaitForWindowActive(&spin));
+
+ QStyleOptionSpinBox spinBoxStyleOption;
+ spin.initStyleOption(&spinBoxStyleOption);
+
+ const QRect buttonRect = spin.style()->subControlRect(
+ QStyle::CC_SpinBox, &spinBoxStyleOption, subControl, &spin);
+
+ // TODO: remove debug output when QTBUG-69492 is fixed
+ qDebug() << "QGuiApplication::focusWindow():" << QGuiApplication::focusWindow();
+ qDebug() << "QGuiApplication::topLevelWindows():" << QGuiApplication::topLevelWindows();
+ QTest::mousePress(&spin, Qt::LeftButton, modifiers, buttonRect.center());
+ QTRY_VERIFY2(spy.length() >= 3, qPrintable(QString::fromLatin1(
+ "Expected valueChanged() to be emitted 3 or more times, but it was only emitted %1 times").arg(spy.length())));
+ QTest::mouseRelease(&spin, Qt::LeftButton, modifiers, buttonRect.center());
+
+ const auto value = spy.last().at(0);
+ QVERIFY(value.type() == QVariant::Int);
+ QCOMPARE(value.toInt(), spy.length() * expectedStepModifier);
}
QTEST_MAIN(tst_QSpinBox)
diff --git a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
index 77abf5e5a7..d744cece9c 100644
--- a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
+++ b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
@@ -773,12 +773,16 @@ void tst_QSplitter::replaceWidget()
const int expectedResizeCount = visible ? 1 : 0; // new widget only
const int expectedPaintCount = visible && !collapsed ? 2 : 0; // splitter and new widget
QTRY_COMPARE(ef.resizeCount, expectedResizeCount);
+#ifndef Q_OS_WINRT // QTBUG-68297
QTRY_COMPARE(ef.paintCount, expectedPaintCount);
+#endif
QCOMPARE(newWidget->parentWidget(), &sp);
QCOMPARE(newWidget->isVisible(), visible);
if (visible && !collapsed)
QCOMPARE(newWidget->geometry(), oldGeom);
+#ifndef Q_OS_WINRT // QTBUG-68297
QCOMPARE(newWidget->size().isEmpty(), !visible || collapsed);
+#endif
delete res;
}
QCOMPARE(sp.count(), count);
@@ -830,7 +834,9 @@ void tst_QSplitter::replaceWidgetWithSplitterChild()
QTRY_VERIFY(ef.resizeCount > 0);
QTRY_VERIFY(ef.paintCount > 0);
QCOMPARE(sp.count(), count + 1);
+#ifndef Q_OS_WINRT // QTBUG-68297
QCOMPARE(sp.sizes().mid(0, count), sizes);
+#endif
QCOMPARE(sp.sizes().last(), sibling->width());
} else {
// No-op for the rest
diff --git a/tests/auto/widgets/widgets/qstatusbar/tst_qstatusbar.cpp b/tests/auto/widgets/widgets/qstatusbar/tst_qstatusbar.cpp
index 14ee6cb9bd..928910344c 100644
--- a/tests/auto/widgets/widgets/qstatusbar/tst_qstatusbar.cpp
+++ b/tests/auto/widgets/widgets/qstatusbar/tst_qstatusbar.cpp
@@ -141,6 +141,9 @@ void tst_QStatusBar::setSizeGripEnabled()
QTRY_VERIFY(statusBar->isVisible());
QPointer<QSizeGrip> sizeGrip = statusBar->findChild<QSizeGrip *>();
QVERIFY(sizeGrip);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on WinRT - QTBUG-68297", Abort);
+#endif
QVERIFY(sizeGrip->isVisible());
statusBar->setSizeGripEnabled(true);
diff --git a/tests/auto/widgets/widgets/qtextbrowser/qtextbrowser.pro b/tests/auto/widgets/widgets/qtextbrowser/qtextbrowser.pro
index 5416c1c71f..9680ffd871 100644
--- a/tests/auto/widgets/widgets/qtextbrowser/qtextbrowser.pro
+++ b/tests/auto/widgets/widgets/qtextbrowser/qtextbrowser.pro
@@ -5,3 +5,5 @@ SOURCES += tst_qtextbrowser.cpp
QT += widgets testlib
TESTDATA += *.html subdir/*
+
+builtin_testdata: DEFINES += BUILTIN_TESTDATA
diff --git a/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp b/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp
index 700fa505c1..8a1b228c71 100644
--- a/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp
+++ b/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp
@@ -29,7 +29,6 @@
#include <QtTest/QtTest>
#include <qtextbrowser.h>
-#include <qdatetime.h>
#include <qapplication.h>
#include <qscrollbar.h>
@@ -114,7 +113,7 @@ void tst_QTextBrowser::cleanup()
void tst_QTextBrowser::noReloadOnAnchorJump()
{
- QUrl url = QUrl::fromLocalFile("anchor.html");
+ QUrl url = QUrl::fromLocalFile(QFINDTESTDATA("anchor.html"));
browser->htmlLoadAttempts = 0;
browser->setSource(url);
@@ -130,11 +129,11 @@ void tst_QTextBrowser::noReloadOnAnchorJump()
void tst_QTextBrowser::bgColorOnSourceChange()
{
- browser->setSource(QUrl::fromLocalFile("pagewithbg.html"));
+ browser->setSource(QUrl::fromLocalFile(QFINDTESTDATA("pagewithbg.html")));
QVERIFY(browser->document()->rootFrame()->frameFormat().hasProperty(QTextFormat::BackgroundBrush));
QCOMPARE(browser->document()->rootFrame()->frameFormat().background().color(), QColor(Qt::blue));
- browser->setSource(QUrl::fromLocalFile("pagewithoutbg.html"));
+ browser->setSource(QUrl::fromLocalFile(QFINDTESTDATA("pagewithoutbg.html")));
QVERIFY(!browser->document()->rootFrame()->frameFormat().hasProperty(QTextFormat::BackgroundBrush));
}
@@ -147,7 +146,7 @@ void tst_QTextBrowser::forwardButton()
QVERIFY(browser->historyTitle(0).isEmpty());
QVERIFY(browser->historyTitle(1).isEmpty());
- browser->setSource(QUrl::fromLocalFile("pagewithbg.html"));
+ browser->setSource(QUrl::fromLocalFile(QFINDTESTDATA("pagewithbg.html")));
QVERIFY(!forwardEmissions.isEmpty());
QVariant val = forwardEmissions.takeLast()[0];
@@ -160,12 +159,12 @@ void tst_QTextBrowser::forwardButton()
QVERIFY(!val.toBool());
QVERIFY(browser->historyTitle(-1).isEmpty());
- QCOMPARE(browser->historyUrl(0), QUrl::fromLocalFile("pagewithbg.html"));
+ QCOMPARE(browser->historyUrl(0), QUrl::fromLocalFile(QFINDTESTDATA("pagewithbg.html")));
QCOMPARE(browser->documentTitle(), QString("Page With BG"));
QCOMPARE(browser->historyTitle(0), QString("Page With BG"));
QVERIFY(browser->historyTitle(1).isEmpty());
- browser->setSource(QUrl::fromLocalFile("anchor.html"));
+ browser->setSource(QUrl::fromLocalFile(QFINDTESTDATA("anchor.html")));
QVERIFY(!forwardEmissions.isEmpty());
val = forwardEmissions.takeLast()[0];
@@ -197,8 +196,11 @@ void tst_QTextBrowser::forwardButton()
QCOMPARE(browser->historyTitle(0), QString("Page With BG"));
QCOMPARE(browser->historyTitle(1), QString("Sample Anchor"));
- browser->setSource(QUrl("pagewithoutbg.html"));
+ browser->setSource(QUrl(QFINDTESTDATA("pagewithoutbg.html")));
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on WinRT - QTBUG-68297", Abort);
+#endif
QVERIFY(!forwardEmissions.isEmpty());
val = forwardEmissions.takeLast()[0];
QCOMPARE(val.type(), QVariant::Bool);
@@ -212,11 +214,11 @@ void tst_QTextBrowser::forwardButton()
void tst_QTextBrowser::viewportPositionInHistory()
{
- browser->setSource(QUrl::fromLocalFile("bigpage.html"));
+ browser->setSource(QUrl::fromLocalFile(QFINDTESTDATA("bigpage.html")));
browser->scrollToAnchor("bottom");
QVERIFY(browser->verticalScrollBar()->value() > 0);
- browser->setSource(QUrl::fromLocalFile("pagewithbg.html"));
+ browser->setSource(QUrl::fromLocalFile(QFINDTESTDATA("pagewithbg.html")));
QCOMPARE(browser->verticalScrollBar()->value(), 0);
browser->backward();
@@ -225,6 +227,9 @@ void tst_QTextBrowser::viewportPositionInHistory()
void tst_QTextBrowser::relativeLinks()
{
+#ifdef BUILTIN_TESTDATA
+ QSKIP("Relative links cannot be checked when resources are used to package tests.");
+#endif
QSignalSpy sourceChangedSpy(browser, SIGNAL(sourceChanged(QUrl)));
browser->setSource(QUrl("subdir/../qtextbrowser.html"));
QVERIFY(!browser->document()->isEmpty());
@@ -256,11 +261,11 @@ void tst_QTextBrowser::relativeLinks()
void tst_QTextBrowser::anchors()
{
- browser->setSource(QUrl::fromLocalFile("bigpage.html"));
+ browser->setSource(QUrl::fromLocalFile(QFINDTESTDATA("bigpage.html")));
browser->setSource(QUrl("#bottom"));
QVERIFY(browser->verticalScrollBar()->value() > 0);
- browser->setSource(QUrl::fromLocalFile("bigpage.html"));
+ browser->setSource(QUrl::fromLocalFile(QFINDTESTDATA("bigpage.html")));
browser->setSource(QUrl("#id-anchor"));
QVERIFY(browser->verticalScrollBar()->value() > 0);
}
@@ -420,6 +425,9 @@ void tst_QTextBrowser::clearHistory()
void tst_QTextBrowser::sourceInsideLoadResource()
{
+#ifdef Q_OS_WINRT
+ QSKIP("Paths cannot be compared if applications are sandboxed.");
+#endif
QUrl url = QUrl::fromLocalFile("pagewithimage.html");
browser->setSource(url);
QCOMPARE(browser->lastResource, QUrl::fromLocalFile(QDir::current().filePath("foobar.png")));
@@ -515,7 +523,11 @@ void tst_QTextBrowser::adjacentAnchors()
void tst_QTextBrowser::loadResourceOnRelativeLocalFiles()
{
+#ifndef BUILTIN_TESTDATA
browser->setSource(QUrl::fromLocalFile("subdir/index.html"));
+#else
+ browser->setSource(QUrl::fromLocalFile(QFINDTESTDATA("subdir/index.html")));
+#endif
QVERIFY(!browser->toPlainText().isEmpty());
QVariant v = browser->loadResource(QTextDocument::HtmlResource, QUrl("../anchor.html"));
QVERIFY(v.isValid());
@@ -526,7 +538,7 @@ void tst_QTextBrowser::loadResourceOnRelativeLocalFiles()
void tst_QTextBrowser::focusIndicator()
{
HackBrowser *browser = new HackBrowser;
- browser->setSource(QUrl::fromLocalFile("firstpage.html"));
+ browser->setSource(QUrl::fromLocalFile(QFINDTESTDATA("firstpage.html")));
QVERIFY(!browser->textCursor().hasSelection());
browser->focusTheNextChild();
@@ -578,7 +590,7 @@ void tst_QTextBrowser::focusIndicator()
void tst_QTextBrowser::focusHistory()
{
HackBrowser *browser = new HackBrowser;
- browser->setSource(QUrl::fromLocalFile("firstpage.html"));
+ browser->setSource(QUrl::fromLocalFile(QFINDTESTDATA("firstpage.html")));
QVERIFY(!browser->textCursor().hasSelection());
browser->focusTheNextChild();
diff --git a/tests/auto/widgets/widgets/qtextedit/qtextedit.pro b/tests/auto/widgets/widgets/qtextedit/qtextedit.pro
index 8b39ab59b7..de8531daec 100644
--- a/tests/auto/widgets/widgets/qtextedit/qtextedit.pro
+++ b/tests/auto/widgets/widgets/qtextedit/qtextedit.pro
@@ -6,3 +6,5 @@ QT += widgets widgets-private gui-private core-private testlib
SOURCES += tst_qtextedit.cpp
osx: LIBS += -framework AppKit
+
+TESTDATA += fullWidthSelection
diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
index f383d430d6..6a2ae4951b 100644
--- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
+++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
@@ -1702,6 +1702,9 @@ void tst_QTextEdit::adjustScrollbars()
QLatin1String txt("\nabc def ghi jkl mno pqr stu vwx");
ed->setText(txt + txt + txt + txt);
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "setMinimum/MaximumSize does not work on WinRT", Abort);
+#endif
QVERIFY(ed->verticalScrollBar()->maximum() > 0);
ed->moveCursor(QTextCursor::End);
@@ -1882,6 +1885,9 @@ void tst_QTextEdit::copyPasteBackgroundImage()
QBrush ba = a->cellAt(0, 0).format().background();
QBrush bb = b->cellAt(0, 0).format().background();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Fails on WinRT - QTBUG-68297", Abort);
+#endif
QCOMPARE(ba.style(), Qt::TexturePattern);
QCOMPARE(ba.style(), bb.style());
diff --git a/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp b/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp
index a7a62496e6..44b30fa794 100644
--- a/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp
+++ b/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp
@@ -272,6 +272,9 @@ void tst_QToolButton::qtbug_34759_sizeHintResetWhenSettingMenu()
button1.show();
button2.show();
+#ifdef Q_OS_WINRT
+ QEXPECT_FAIL("", "Winrt does not support more than 1 native top level widget.", Abort);
+#endif
QVERIFY(QTest::qWaitForWindowExposed(&button1));
QVERIFY(QTest::qWaitForWindowExposed(&button2));
diff --git a/tests/auto/widgets/widgets/widgets.pro b/tests/auto/widgets/widgets/widgets.pro
index c098108edc..c6325aac15 100644
--- a/tests/auto/widgets/widgets/widgets.pro
+++ b/tests/auto/widgets/widgets/widgets.pro
@@ -55,4 +55,4 @@ SUBDIRS=\
qtextedit \
qtoolbar \
-qtConfig(opengl): SUBDIRS += qopenglwidget
+!winrt:qtConfig(opengl): SUBDIRS += qopenglwidget