summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/auto.pro7
-rw-r--r--tests/auto/cmake/CMakeLists.txt6
-rw-r--r--tests/auto/cmake/test_interface/CMakeLists.txt2
-rw-r--r--tests/auto/cmake/test_multiple_find_package/CMakeLists.txt4
-rw-r--r--tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt2
-rw-r--r--tests/auto/cmake/test_platform_defs_include/CMakeLists.txt1
-rw-r--r--tests/auto/cmake/test_use_modules_function/CMakeLists.txt2
-rw-r--r--tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp28
-rw-r--r--tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp24
-rw-r--r--tests/auto/corelib/animation/qpauseanimation/BLACKLIST4
-rw-r--r--tests/auto/corelib/animation/qpropertyanimation/BLACKLIST4
-rw-r--r--tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST4
-rw-r--r--tests/auto/corelib/global/qflags/qflags.pro3
-rw-r--r--tests/auto/corelib/global/qglobal/tst_qglobal.cpp2
-rw-r--r--tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp21
-rw-r--r--tests/auto/corelib/global/qlogging/qlogging.pro6
-rw-r--r--tests/auto/corelib/global/qlogging/test/test.pro5
-rw-r--r--tests/auto/corelib/global/qnumeric/qnumeric.pro2
-rw-r--r--tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp160
-rw-r--r--tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp4
-rw-r--r--tests/auto/corelib/io/qdebug/tst_qdebug.cpp34
-rw-r--r--tests/auto/corelib/io/qdir/qdir.pro2
-rw-r--r--tests/auto/corelib/io/qdir/tst_qdir.cpp69
-rw-r--r--tests/auto/corelib/io/qdiriterator/qdiriterator.pro2
-rw-r--r--tests/auto/corelib/io/qfile/BLACKLIST9
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp286
-rw-r--r--tests/auto/corelib/io/qfileinfo/qfileinfo.pro2
-rw-r--r--tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp101
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+haiku/test0
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+haiku/test20
-rw-r--r--tests/auto/corelib/io/qfileselector/platforms/+unix/+haiku/test0
-rw-r--r--tests/auto/corelib/io/qfileselector/qfileselector.qrc3
-rw-r--r--tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp2
-rw-r--r--tests/auto/corelib/io/qfilesystemwatcher/BLACKLIST5
-rw-r--r--tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp15
-rw-r--r--tests/auto/corelib/io/qiodevice/BLACKLIST2
-rw-r--r--tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp41
-rw-r--r--tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp1
-rw-r--r--tests/auto/corelib/io/qprocess/BLACKLIST5
-rw-r--r--tests/auto/corelib/io/qprocess/fileWriterProcess/main.cpp14
-rw-r--r--tests/auto/corelib/io/qprocess/testDetached/main.cpp3
-rw-r--r--tests/auto/corelib/io/qprocess/testExitCodes/main.cpp4
-rw-r--r--tests/auto/corelib/io/qprocess/tst_qprocess.cpp645
-rw-r--r--tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp19
-rw-r--r--tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp22
-rw-r--r--tests/auto/corelib/io/qsettings/BLACKLIST3
-rw-r--r--tests/auto/corelib/io/qsettings/tst_qsettings.cpp99
-rw-r--r--tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp32
-rw-r--r--tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp4
-rw-r--r--tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp27
-rw-r--r--tests/auto/corelib/io/qtextstream/BLACKLIST2
-rw-r--r--tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp20
-rw-r--r--tests/auto/corelib/io/qurl/tst_qurl.cpp54
-rw-r--r--tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp3
-rw-r--r--tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp2
-rw-r--r--tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp43
-rw-r--r--tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp8
-rw-r--r--tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp96
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp27
-rw-r--r--tests/auto/corelib/json/tst_qtjson.cpp6
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro1
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp77
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h3
-rw-r--r--tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST4
-rw-r--r--tests/auto/corelib/kernel/qeventloop/BLACKLIST2
-rw-r--r--tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp15
-rw-r--r--tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp69
-rw-r--r--tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp6
-rw-r--r--tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp40
-rw-r--r--tests/auto/corelib/kernel/qobject/BLACKLIST2
-rw-r--r--tests/auto/corelib/kernel/qobject/qobject.pro6
-rw-r--r--tests/auto/corelib/kernel/qobject/test/test.pro2
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp4
-rw-r--r--tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp17
-rw-r--r--tests/auto/corelib/kernel/qsocketnotifier/BLACKLIST3
-rw-r--r--tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp27
-rw-r--r--tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp51
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp40
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h1
-rw-r--r--tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp9
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp19
-rw-r--r--tests/auto/corelib/statemachine/qstate/tst_qstate.cpp31
-rw-r--r--tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp127
-rw-r--r--tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp58
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/char/char.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/char/char.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/char16_t/char16_t.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/char16_t/char16_t.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/char32_t/char32_t.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/char32_t/char32_t.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/int/int.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/int/int.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/long/long.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/long/long.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/qlonglong/qlonglong.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/qlonglong/qlonglong.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/qptrdiff/qptrdiff.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/qptrdiff/qptrdiff.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/quintptr/quintptr.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/quintptr/quintptr.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/qulonglong/qulonglong.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/qulonglong/qulonglong.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/schar/schar.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/schar/schar.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/short/short.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/short/short.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/uchar/uchar.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/uchar/uchar.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/uint/uint.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/uint/uint.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/ulong/ulong.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/ulong/ulong.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/ushort/ushort.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/ushort/ushort.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/no-cxx11/wchar_t/wchar_t.pro (renamed from tests/auto/corelib/thread/qatomicinteger/cxx11/wchar_t/wchar_t.pro)0
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pri6
-rw-r--r--tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pro32
-rw-r--r--tests/auto/corelib/thread/qfuture/tst_qfuture.cpp34
-rw-r--r--tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp62
-rw-r--r--tests/auto/corelib/thread/qsemaphore/BLACKLIST3
-rw-r--r--tests/auto/corelib/thread/qthread/BLACKLIST2
-rw-r--r--tests/auto/corelib/thread/qthreadpool/BLACKLIST2
-rw-r--r--tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp2
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro4
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/test/test.pro2
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp2
-rw-r--r--tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp152
-rw-r--r--tests/auto/corelib/tools/collections/tst_collections.cpp4
-rw-r--r--tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp107
-rw-r--r--tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp15
-rw-r--r--tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm12
-rw-r--r--tests/auto/corelib/tools/qchar/data/NormalizationTest.txt18
-rw-r--r--tests/auto/corelib/tools/qchar/tst_qchar.cpp4
-rw-r--r--tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.cpp6
-rw-r--r--tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp39
-rw-r--r--tests/auto/corelib/tools/qdate/tst_qdate.cpp41
-rw-r--r--tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp92
-rw-r--r--tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm6
-rw-r--r--tests/auto/corelib/tools/qhash/tst_qhash.cpp29
-rw-r--r--tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp18
-rw-r--r--tests/auto/corelib/tools/qlatin1string/.gitignore1
-rw-r--r--tests/auto/corelib/tools/qlatin1string/qlatin1string.pro9
-rw-r--r--tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp126
-rw-r--r--tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp20
-rw-r--r--tests/auto/corelib/tools/qlist/tst_qlist.cpp228
-rw-r--r--tests/auto/corelib/tools/qlocale/qlocale.pro4
-rw-r--r--tests/auto/corelib/tools/qlocale/test/test.pro2
-rw-r--r--tests/auto/corelib/tools/qlocale/tst_qlocale.cpp26
-rw-r--r--tests/auto/corelib/tools/qmap/tst_qmap.cpp63
-rw-r--r--tests/auto/corelib/tools/qregexp/tst_qregexp.cpp3
-rw-r--r--tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp5
-rw-r--r--tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp129
-rw-r--r--tests/auto/corelib/tools/qset/tst_qset.cpp65
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/externaltests.cpp1
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/externaltests.pri1
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp50
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring.cpp592
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring_mac.mm8
-rw-r--r--tests/auto/corelib/tools/qstringref/tst_qstringref.cpp25
-rw-r--r--tests/auto/corelib/tools/qtextboundaryfinder/data/GraphemeBreakTest.txt6
-rw-r--r--tests/auto/corelib/tools/qtextboundaryfinder/data/LineBreakTest.txt647
-rw-r--r--tests/auto/corelib/tools/qtextboundaryfinder/data/SentenceBreakTest.txt16
-rw-r--r--tests/auto/corelib/tools/qtextboundaryfinder/data/WordBreakTest.txt125
-rw-r--r--tests/auto/corelib/tools/qtimeline/BLACKLIST4
-rw-r--r--tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp119
-rw-r--r--tests/auto/corelib/tools/qtimezone/BLACKLIST2
-rw-r--r--tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp60
-rw-r--r--tests/auto/corelib/tools/qvector/qvector.pro1
-rw-r--r--tests/auto/corelib/tools/qvector/tst_qvector.cpp261
-rw-r--r--tests/auto/corelib/tools/qversionnumber/qversionnumber.pro4
-rw-r--r--tests/auto/corelib/tools/qversionnumber/tst_qversionnumber.cpp2
-rw-r--r--tests/auto/corelib/tools/tools.pro1
-rw-r--r--tests/auto/dbus/dbus.pro9
-rw-r--r--tests/auto/dbus/qdbusabstractadaptor/BLACKLIST2
-rw-r--r--tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp2
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp10
-rw-r--r--tests/auto/dbus/qdbusconnection/qdbusconnection.pro1
-rw-r--r--tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp348
-rw-r--r--tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h287
-rw-r--r--tests/auto/dbus/qdbusconnection_delayed/qdbusconnection_delayed.pro5
-rw-r--r--tests/auto/dbus/qdbusconnection_delayed/tst_qdbusconnection_delayed.cpp113
-rw-r--r--tests/auto/dbus/qdbusconnection_no_app/qdbusconnection_no_app.pro6
-rw-r--r--tests/auto/dbus/qdbusconnection_no_app/tst_qdbusconnection_no_app.cpp37
-rw-r--r--tests/auto/dbus/qdbusconnection_no_bus/qdbusconnection_no_bus.pro2
-rw-r--r--tests/auto/dbus/qdbusconnection_no_bus/tst_qdbusconnection_no_bus.cpp4
-rw-r--r--tests/auto/dbus/qdbusconnection_no_libdbus/qdbusconnection_no_libdbus.pro5
-rw-r--r--tests/auto/dbus/qdbusmarshall/BLACKLIST3
-rw-r--r--tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp16
-rw-r--r--tests/auto/dbus/qdbusmetaobject/qdbusmetaobject.pro2
-rw-r--r--tests/auto/dbus/qdbusmetatype/qdbusmetatype.pro2
-rw-r--r--tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp33
-rw-r--r--tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp104
-rw-r--r--tests/auto/dbus/qdbustype/qdbustype.pro2
-rw-r--r--tests/auto/dbus/qdbustype/tst_qdbustype.cpp4
-rw-r--r--tests/auto/dbus/qdbusxmlparser/qdbusxmlparser.pro2
-rw-r--r--tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp7
-rw-r--r--tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp5
-rw-r--r--tests/auto/gui/image/qicon/tst_qicon.cpp31
-rw-r--r--tests/auto/gui/image/qimage/tst_qimage.cpp28
-rw-r--r--tests/auto/gui/image/qimagereader/images/longcomment.pgm12
-rw-r--r--tests/auto/gui/image/qimagereader/tst_qimagereader.cpp42
-rw-r--r--tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp18
-rw-r--r--tests/auto/gui/image/qmovie/tst_qmovie.cpp6
-rw-r--r--tests/auto/gui/image/qpixmap/tst_qpixmap.cpp24
-rw-r--r--tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp10
-rw-r--r--tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp26
-rw-r--r--tests/auto/gui/kernel/qclipboard/qclipboard.pro2
-rw-r--r--tests/auto/gui/kernel/qclipboard/test/test.pro4
-rw-r--r--tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp12
-rw-r--r--tests/auto/gui/kernel/qguivariant/no_application/main.cpp2
-rw-r--r--tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp22
-rw-r--r--tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp7
-rw-r--r--tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp4
-rw-r--r--tests/auto/gui/kernel/qpixelformat/tst_qpixelformat.cpp2
-rw-r--r--tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp136
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp194
-rw-r--r--tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp48
-rw-r--r--tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp20
-rw-r--r--tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp74
-rw-r--r--tests/auto/gui/painting/qbrush/tst_qbrush.cpp4
-rw-r--r--tests/auto/gui/painting/qcolor/tst_qcolor.cpp114
-rw-r--r--tests/auto/gui/painting/qpagelayout/tst_qpagelayout.cpp2
-rw-r--r--tests/auto/gui/painting/qpainter/qpainter.pro2
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp278
-rw-r--r--tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp34
-rw-r--r--tests/auto/gui/painting/qpdfwriter/tst_qpdfwriter.cpp6
-rw-r--r--tests/auto/gui/painting/qregion/tst_qregion.cpp2
-rw-r--r--tests/auto/gui/painting/qtransform/tst_qtransform.cpp37
-rw-r--r--tests/auto/gui/qopengl/BLACKLIST8
-rw-r--r--tests/auto/gui/qopengl/tst_qopengl.cpp201
-rw-r--r--tests/auto/gui/qopenglconfig/buglist.json22
-rw-r--r--tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp42
-rw-r--r--tests/auto/gui/text/qcssparser/tst_qcssparser.cpp38
-rw-r--r--tests/auto/gui/text/qfont/BLACKLIST2
-rw-r--r--tests/auto/gui/text/qfont/tst_qfont.cpp77
-rw-r--r--tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp12
-rw-r--r--tests/auto/gui/text/qrawfont/BLACKLIST4
-rw-r--r--tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp31
-rw-r--r--tests/auto/gui/text/qtextblock/tst_qtextblock.cpp4
-rw-r--r--tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp186
-rw-r--r--tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp37
-rw-r--r--tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp224
-rw-r--r--tests/auto/gui/text/qtextdocumentlayout/BLACKLIST2
-rw-r--r--tests/auto/gui/text/qtextformat/tst_qtextformat.cpp4
-rw-r--r--tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp36
-rw-r--r--tests/auto/gui/text/qtextlist/tst_qtextlist.cpp46
-rw-r--r--tests/auto/gui/text/qtextpiecetable/tst_qtextpiecetable.cpp336
-rw-r--r--tests/auto/gui/text/qtexttable/tst_qtexttable.cpp188
-rw-r--r--tests/auto/gui/text/qzip/tst_qzip.cpp19
-rw-r--r--tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp5
-rw-r--r--tests/auto/gui/util/qdoublevalidator/tst_qdoublevalidator.cpp32
-rw-r--r--tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp16
-rw-r--r--tests/auto/network/access/qabstractnetworkcache/BLACKLIST9
-rw-r--r--tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp3
-rw-r--r--tests/auto/network/access/qftp/BLACKLIST14
-rw-r--r--tests/auto/network/access/qftp/qftp.pro1
-rw-r--r--tests/auto/network/access/qftp/tst_qftp.cpp3
-rw-r--r--tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp4
-rw-r--r--tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp2
-rw-r--r--tests/auto/network/access/qnetworkreply/element.xml1
-rw-r--r--tests/auto/network/access/qnetworkreply/qnetworkreply.pro2
-rw-r--r--tests/auto/network/access/qnetworkreply/test/test.pro2
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp272
-rw-r--r--tests/auto/network/access/spdy/BLACKLIST4
-rw-r--r--tests/auto/network/access/spdy/spdy.pro2
-rw-r--r--tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp38
-rw-r--r--tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp4
-rw-r--r--tests/auto/network/bearer/qnetworksession/qnetworksession.pro2
-rw-r--r--tests/auto/network/bearer/qnetworksession/test/test.pro2
-rw-r--r--tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp99
-rw-r--r--tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp6
-rw-r--r--tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp74
-rw-r--r--tests/auto/network/kernel/qhostinfo/qhostinfo.pro2
-rw-r--r--tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp6
-rw-r--r--tests/auto/network/kernel/qnetworkaddressentry/tst_qnetworkaddressentry.cpp2
-rw-r--r--tests/auto/network/kernel/qnetworkinterface/BLACKLIST2
-rw-r--r--tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp67
-rw-r--r--tests/auto/network/socket/platformsocketengine/BLACKLIST1
-rw-r--r--tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp138
-rw-r--r--tests/auto/network/socket/qabstractsocket/tst_qabstractsocket.cpp53
-rw-r--r--tests/auto/network/socket/qhttpsocketengine/BLACKLIST1
-rw-r--r--tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp109
-rw-r--r--tests/auto/network/socket/qlocalsocket/BLACKLIST2
-rw-r--r--tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp30
-rw-r--r--tests/auto/network/socket/qsocks5socketengine/BLACKLIST2
-rw-r--r--tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp116
-rw-r--r--tests/auto/network/socket/qtcpserver/BLACKLIST13
-rw-r--r--tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp10
-rw-r--r--tests/auto/network/socket/qtcpsocket/test/test.pro2
-rw-r--r--tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp112
-rw-r--r--tests/auto/network/socket/qudpsocket/BLACKLIST8
-rw-r--r--tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp5
-rw-r--r--tests/auto/network/ssl/qsslcertificate/BLACKLIST3
-rw-r--r--tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp81
-rw-r--r--tests/auto/network/ssl/qsslkey/BLACKLIST1
-rw-r--r--tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp2
-rw-r--r--tests/auto/network/ssl/qsslsocket/BLACKLIST1
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp128
-rw-r--r--tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/BLACKLIST2
-rw-r--r--tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/BLACKLIST2
-rw-r--r--tests/auto/opengl/qgl/BLACKLIST16
-rw-r--r--tests/auto/opengl/qgl/tst_qgl.cpp128
-rw-r--r--tests/auto/opengl/qglbuffer/tst_qglbuffer.cpp10
-rw-r--r--tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp4
-rw-r--r--tests/auto/opengl/qglthreads/tst_qglthreads.cpp1
-rw-r--r--tests/auto/other/compiler/compiler.pro3
-rw-r--r--tests/auto/other/compiler/tst_compiler.cpp204
-rw-r--r--tests/auto/other/gestures/BLACKLIST2
-rw-r--r--tests/auto/other/gestures/tst_gestures.cpp58
-rw-r--r--tests/auto/other/lancelot/tst_lancelot.cpp6
-rw-r--r--tests/auto/other/languagechange/tst_languagechange.cpp2
-rw-r--r--tests/auto/other/macgui/guitest.cpp4
-rw-r--r--tests/auto/other/macgui/macgui.pro2
-rw-r--r--tests/auto/other/macgui/tst_macgui.cpp4
-rw-r--r--tests/auto/other/macnativeevents/BLACKLIST13
-rw-r--r--tests/auto/other/macnativeevents/qnativeevents_mac.cpp29
-rw-r--r--tests/auto/other/macnativeevents/tst_macnativeevents.cpp8
-rw-r--r--tests/auto/other/modeltest/modeltest.cpp2
-rw-r--r--tests/auto/other/networkselftest/tst_networkselftest.cpp56
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp57
-rw-r--r--tests/auto/other/qaccessibilitylinux/qaccessibilitylinux.pro3
-rw-r--r--tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp34
-rw-r--r--tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm12
-rw-r--r--tests/auto/other/qcomplextext/tst_qcomplextext.cpp2
-rw-r--r--tests/auto/other/toolsupport/tst_toolsupport.cpp4
-rw-r--r--tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp2
-rw-r--r--tests/auto/printsupport/kernel/qprintdevice/tst_qprintdevice.cpp5
-rw-r--r--tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp14
-rw-r--r--[-rwxr-xr-x]tests/auto/sql/kernel/qsqldatabase/testdata/qtest.mdbbin65536 -> 65536 bytes
-rw-r--r--tests/auto/sql/kernel/qsqldatabase/tst_databases.h4
-rw-r--r--tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp30
-rw-r--r--tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp2
-rw-r--r--tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp64
-rw-r--r--tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp13
-rw-r--r--tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp30
-rw-r--r--tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp18
-rw-r--r--tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp51
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.lightxml98
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.txt58
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.xml98
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.xunitxml22
-rw-r--r--tests/auto/testlib/selftests/expected_crashes_3.txt1
-rw-r--r--tests/auto/testlib/selftests/selftests.pro2
-rw-r--r--tests/auto/testlib/selftests/test/test.pro2
-rw-r--r--tests/auto/testlib/selftests/tst_selftests.cpp31
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp88
-rw-r--r--tests/auto/tools/qmake/qmake.pro6
-rw-r--r--tests/auto/tools/qmake/testdata/.gitignore5
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/findDeps.pro7
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/main.cpp57
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/needed.cpp1
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/objecta.h41
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/objectf.h41
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/findMocs.pro3
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/main.cpp5
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object1.h4
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object2.h4
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object3.h4
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object4.h3
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object7.h1
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object8.h50
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object9.h41
-rw-r--r--tests/auto/tools/qmake/testdata/rawString/main.cpp38
-rw-r--r--tests/auto/tools/qmake/testdata/rawString/object1.h40
-rw-r--r--tests/auto/tools/qmake/testdata/rawString/rawString.pro4
-rw-r--r--tests/auto/tools/qmake/testdata/resources/main.cpp (renamed from tests/auto/widgets/kernel/qapplication/wincmdline/main.cpp)18
-rw-r--r--tests/auto/tools/qmake/testdata/resources/resources.pro10
-rw-r--r--tests/auto/tools/qmake/testdata/resources/subdir/file.txt0
-rw-r--r--tests/auto/tools/qmake/testdata/resources/test.qrc5
-rw-r--r--tests/auto/tools/qmake/tst_qmake.cpp61
-rw-r--r--tests/auto/tools/qmakelib/evaltest.cpp11
-rw-r--r--tests/auto/tools/qmakelib/tst_qmakelib.h4
-rw-r--r--tests/auto/tools/uic/tst_uic.cpp1
-rw-r--r--tests/auto/widgets/dialogs/qcolordialog/qcolordialog.pro3
-rw-r--r--tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qdialog/BLACKLIST2
-rw-r--r--tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp35
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog/qfiledialog.pro2
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp16
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp81
-rw-r--r--tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp196
-rw-r--r--tests/auto/widgets/dialogs/qfontdialog/BLACKLIST5
-rw-r--r--tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm2
-rw-r--r--tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp274
-rw-r--r--tests/auto/widgets/dialogs/qprogressdialog/BLACKLIST2
-rw-r--r--tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp96
-rw-r--r--tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp4
-rw-r--r--tests/auto/widgets/gestures/qgesturerecognizer/BLACKLIST2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp11
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp8
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp32
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp4
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsobject/tst_qgraphicsobject.cpp38
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp113
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp47
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST18
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp13
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp18
-rw-r--r--tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp42
-rw-r--r--tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp4
-rw-r--r--tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp52
-rw-r--r--tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp16
-rw-r--r--tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp17
-rw-r--r--tests/auto/widgets/itemviews/qlistview/qlistview.pro1
-rw-r--r--tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp54
-rw-r--r--tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp10
-rw-r--r--tests/auto/widgets/itemviews/qtableview/BLACKLIST2
-rw-r--r--tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp12
-rw-r--r--tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp25
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/qtreeview.pro2
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp53
-rw-r--r--tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp53
-rw-r--r--tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp4
-rw-r--r--tests/auto/widgets/kernel/qaction/BLACKLIST2
-rw-r--r--tests/auto/widgets/kernel/qaction/tst_qaction.cpp2
-rw-r--r--tests/auto/widgets/kernel/qactiongroup/BLACKLIST2
-rw-r--r--tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp3
-rw-r--r--tests/auto/widgets/kernel/qapplication/BLACKLIST4
-rw-r--r--tests/auto/widgets/kernel/qapplication/qapplication.pro3
-rw-r--r--tests/auto/widgets/kernel/qapplication/test/BLACKLIST2
-rw-r--r--tests/auto/widgets/kernel/qapplication/test/test.pro9
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp159
-rw-r--r--tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro5
-rw-r--r--tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp103
-rw-r--r--tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp1
-rw-r--r--tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp429
-rw-r--r--tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp160
-rw-r--r--tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp7
-rw-r--r--tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp24
-rw-r--r--tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp21
-rw-r--r--tests/auto/widgets/kernel/qtooltip/BLACKLIST4
-rw-r--r--tests/auto/widgets/kernel/qwidget/BLACKLIST78
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp135
-rw-r--r--tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp91
-rw-r--r--tests/auto/widgets/kernel/qwidgetaction/tst_qwidgetaction.cpp33
-rw-r--r--tests/auto/widgets/kernel/qwidgetsvariant/tst_qwidgetsvariant.cpp6
-rw-r--r--tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp4
-rw-r--r--tests/auto/widgets/styles/qstyle/tst_qstyle.cpp10
-rw-r--r--tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp16
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST2
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp192
-rw-r--r--tests/auto/widgets/util/qcompleter/BLACKLIST2
-rw-r--r--tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp22
-rw-r--r--tests/auto/widgets/util/qscroller/tst_qscroller.cpp2
-rw-r--r--tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp2
-rw-r--r--tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp34
-rw-r--r--tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp6
-rw-r--r--tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp36
-rw-r--r--tests/auto/widgets/widgets/qcheckbox/tst_qcheckbox.cpp4
-rw-r--r--tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp44
-rw-r--r--tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp8
-rw-r--r--tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp14
-rw-r--r--tests/auto/widgets/widgets/qdialogbuttonbox/tst_qdialogbuttonbox.cpp6
-rw-r--r--tests/auto/widgets/widgets/qdockwidget/BLACKLIST2
-rw-r--r--tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp88
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_0.pngbin148 -> 148 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_1.pngbin148 -> 148 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_2.pngbin148 -> 148 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_0.pngbin148 -> 148 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_1.pngbin148 -> 148 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_2.pngbin148 -> 148 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_0.pngbin148 -> 148 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_1.pngbin148 -> 148 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_2.pngbin148 -> 148 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_0.pngbin154 -> 154 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_1.pngbin154 -> 154 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_2.pngbin154 -> 154 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_0.pngbin154 -> 154 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_1.pngbin154 -> 154 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_2.pngbin154 -> 154 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_0.pngbin154 -> 154 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_1.pngbin154 -> 154 bytes
-rw-r--r--tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_2.pngbin154 -> 154 bytes
-rw-r--r--tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp33
-rw-r--r--tests/auto/widgets/widgets/qlineedit/qlineedit.pro1
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp86
-rw-r--r--tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp159
-rw-r--r--tests/auto/widgets/widgets/qmdiarea/BLACKLIST3
-rw-r--r--tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp30
-rw-r--r--tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp20
-rw-r--r--tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp93
-rw-r--r--tests/auto/widgets/widgets/qmenubar/BLACKLIST1
-rw-r--r--tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp150
-rw-r--r--tests/auto/widgets/widgets/qopenglwidget/BLACKLIST2
-rw-r--r--tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp78
-rw-r--r--tests/auto/widgets/widgets/qplaintextedit/qplaintextedit.pro1
-rw-r--r--tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp30
-rw-r--r--tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp2
-rw-r--r--tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp4
-rw-r--r--tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp4
-rw-r--r--tests/auto/widgets/widgets/qsizegrip/BLACKLIST2
-rw-r--r--tests/auto/widgets/widgets/qspinbox/BLACKLIST3
-rw-r--r--tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp2
-rw-r--r--tests/auto/widgets/widgets/qtabbar/BLACKLIST3
-rw-r--r--tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp42
-rw-r--r--tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp60
-rw-r--r--tests/auto/widgets/widgets/qtextedit/qtextedit.pro2
-rw-r--r--tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp48
-rw-r--r--tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp32
-rw-r--r--tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp4
-rw-r--r--tests/auto/xml/dom/qdom/tst_qdom.cpp19
-rw-r--r--tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp2
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.entbin4 -> 4 bytes
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.entbin54 -> 54 bytes
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.entbin12 -> 12 bytes
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003-1.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-1.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-2.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-1.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-2.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-1.ent0
-rw-r--r--[-rwxr-xr-x]tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-2.ent0
533 files changed, 11607 insertions, 5369 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 6f06ba591f..9cab3c9e42 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -32,8 +32,11 @@ cross_compile: SUBDIRS -= tools
# Disable the QtDBus tests if we can't connect to the session bus
qtHaveModule(dbus) {
- !system("dbus-send --session --type=signal / local.AutotestCheck.Hello"): {
- warning("QtDBus is enabled but session bus is not available. Please check the installation.")
+ !system("dbus-send --session --type=signal / local.AutotestCheck.Hello >/dev/null 2>&1") {
+ contains(QT_CONFIG, dbus-linked): \
+ error("QtDBus is enabled but session bus is not available. Please check the installation.")
+ else: \
+ warning("QtDBus is enabled with runtime support, but session bus is not available. Skipping QtDBus tests.")
SUBDIRS -= dbus
}
} else {
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index 25bc8a5e45..5248f75a84 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -50,7 +50,9 @@ include("${_Qt5CTestMacros}")
if(NOT ${CMAKE_VERSION} VERSION_LESS 2.8.9)
# Requires INCLUDE_DIRECTORIES target property in CMake 2.8.8
# and POSITION_INDEPENDENT_CODE target property in 2.8.9
- expect_pass(test_use_modules_function)
+ if (NOT NO_GUI)
+ expect_pass(test_use_modules_function)
+ endif()
expect_pass(test_umbrella_config)
else()
message("CMake version older than 2.8.9 (Found ${CMAKE_VERSION}). Not running test \"test_use_modules_function\" or \"test_umbrella_config\"")
@@ -127,7 +129,7 @@ if (QT_WITH_ANGLE OR (NOT WIN32 AND NOT APPLE AND NOT NO_EGL))
endif()
expect_pass(test_opengl_lib)
-if (NOT CMAKE_VERSION VERSION_LESS 2.8.11)
+if (NOT CMAKE_VERSION VERSION_LESS 2.8.11 AND NOT NO_WIDGETS)
expect_pass(test_interface)
endif()
diff --git a/tests/auto/cmake/test_interface/CMakeLists.txt b/tests/auto/cmake/test_interface/CMakeLists.txt
index a8af92da63..2af80ea448 100644
--- a/tests/auto/cmake/test_interface/CMakeLists.txt
+++ b/tests/auto/cmake/test_interface/CMakeLists.txt
@@ -8,6 +8,8 @@ find_package(Qt5Widgets)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
+
add_executable(test_interface_exe WIN32 main.cpp mainwindow.cpp)
# No need to specify include directories, compile definitions, the PIC flag, or to
diff --git a/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt b/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt
index c0fdfd6b9a..6b11c09e7b 100644
--- a/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt
+++ b/tests/auto/cmake/test_multiple_find_package/CMakeLists.txt
@@ -9,5 +9,5 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
add_subdirectory(subdir1)
-add_executable(exe1 "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp")
-include_directories(${Qt5Core_INCLUDE_DIRS})
+add_executable(exe1 main.cpp)
+target_link_libraries(exe1 Qt5::Core)
diff --git a/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt b/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt
index 0c7a113f50..dfcc35d735 100644
--- a/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt
+++ b/tests/auto/cmake/test_multiple_find_package/subdir1/CMakeLists.txt
@@ -2,4 +2,4 @@
find_package(Qt5Core REQUIRED)
add_executable(exe2 "${CMAKE_CURRENT_SOURCE_DIR}/../main.cpp")
-include_directories(${Qt5Core_INCLUDE_DIRS})
+target_link_libraries(exe2 Qt5::Core)
diff --git a/tests/auto/cmake/test_platform_defs_include/CMakeLists.txt b/tests/auto/cmake/test_platform_defs_include/CMakeLists.txt
index 2b32a419e7..e2f72842f6 100644
--- a/tests/auto/cmake/test_platform_defs_include/CMakeLists.txt
+++ b/tests/auto/cmake/test_platform_defs_include/CMakeLists.txt
@@ -11,3 +11,4 @@ add_definitions(${Qt5Core_DEFINITIONS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
add_executable(myobject main.cpp)
+target_link_libraries(myobject Qt5::Core)
diff --git a/tests/auto/cmake/test_use_modules_function/CMakeLists.txt b/tests/auto/cmake/test_use_modules_function/CMakeLists.txt
index bfcdd9d1d7..be05c75054 100644
--- a/tests/auto/cmake/test_use_modules_function/CMakeLists.txt
+++ b/tests/auto/cmake/test_use_modules_function/CMakeLists.txt
@@ -12,5 +12,7 @@ add_executable(three three.cpp)
find_package(Qt5Core)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
+
qt5_use_modules(two Test)
qt5_use_modules(three Gui Test)
diff --git a/tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp b/tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp
index b5e3dee9a6..cadd4e82cd 100644
--- a/tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp
+++ b/tests/auto/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp
@@ -1443,45 +1443,45 @@ void tst_QtConcurrentFilter::noDetach()
QVERIFY(l.isDetached());
QList<int> ll = l;
- QVERIFY(l.isDetached() == false);
+ QVERIFY(!l.isDetached());
QtConcurrent::filtered(l, waitFilterfn).waitForFinished();
- QVERIFY(l.isDetached() == false);
- QVERIFY(ll.isDetached() == false);
+ QVERIFY(!l.isDetached());
+ QVERIFY(!ll.isDetached());
QtConcurrent::blockingFiltered(l, waitFilterfn);
- QVERIFY(l.isDetached() == false);
- QVERIFY(ll.isDetached() == false);
+ QVERIFY(!l.isDetached());
+ QVERIFY(!ll.isDetached());
QtConcurrent::filteredReduced(l, waitFilterfn, intSumReduce).waitForFinished();
- QVERIFY(l.isDetached() == false);
- QVERIFY(ll.isDetached() == false);
+ QVERIFY(!l.isDetached());
+ QVERIFY(!ll.isDetached());
QtConcurrent::filter(l, waitFilterfn).waitForFinished();
if (!l.isDetached())
QEXPECT_FAIL("", "QTBUG-20688: Known unstable failure", Abort);
- QVERIFY(l.isDetached() == true);
- QVERIFY(ll.isDetached() == true);
+ QVERIFY(l.isDetached());
+ QVERIFY(ll.isDetached());
}
{
const QList<int> l = QList<int>() << 1;
QVERIFY(l.isDetached());
const QList<int> ll = l;
- QVERIFY(l.isDetached() == false);
+ QVERIFY(!l.isDetached());
QtConcurrent::filtered(l, waitFilterfn).waitForFinished();
- QVERIFY(l.isDetached() == false);
- QVERIFY(ll.isDetached() == false);
+ QVERIFY(!l.isDetached());
+ QVERIFY(!ll.isDetached());
QtConcurrent::filteredReduced(l, waitFilterfn, intSumReduce).waitForFinished();
- QVERIFY(l.isDetached() == false);
- QVERIFY(ll.isDetached() == false);
+ QVERIFY(!l.isDetached());
+ QVERIFY(!ll.isDetached());
}
}
diff --git a/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp b/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp
index 4e19124ca8..33941d8e90 100644
--- a/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp
+++ b/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp
@@ -2250,38 +2250,38 @@ void tst_QtConcurrentMap::noDetach()
QVERIFY(l.isDetached());
QList<int> ll = l;
- QVERIFY(l.isDetached() == false);
+ QVERIFY(!l.isDetached());
QtConcurrent::mapped(l, mapper).waitForFinished();
- QVERIFY(l.isDetached() == false);
- QVERIFY(ll.isDetached() == false);
+ QVERIFY(!l.isDetached());
+ QVERIFY(!ll.isDetached());
QtConcurrent::mappedReduced(l, mapper, intSumReduce).waitForFinished();
- QVERIFY(l.isDetached() == false);
- QVERIFY(ll.isDetached() == false);
+ QVERIFY(!l.isDetached());
+ QVERIFY(!ll.isDetached());
QtConcurrent::map(l, multiplyBy2Immutable).waitForFinished();
- QVERIFY(l.isDetached() == true);
- QVERIFY(ll.isDetached() == true);
+ QVERIFY(l.isDetached());
+ QVERIFY(ll.isDetached());
}
{
const QList<int> l = QList<int>() << 1;
QVERIFY(l.isDetached());
const QList<int> ll = l;
- QVERIFY(l.isDetached() == false);
+ QVERIFY(!l.isDetached());
QtConcurrent::mapped(l, mapper).waitForFinished();
- QVERIFY(l.isDetached() == false);
- QVERIFY(ll.isDetached() == false);
+ QVERIFY(!l.isDetached());
+ QVERIFY(!ll.isDetached());
QtConcurrent::mappedReduced(l, mapper, intSumReduce).waitForFinished();
- QVERIFY(l.isDetached() == false);
- QVERIFY(ll.isDetached() == false);
+ QVERIFY(!l.isDetached());
+ QVERIFY(!ll.isDetached());
}
}
diff --git a/tests/auto/corelib/animation/qpauseanimation/BLACKLIST b/tests/auto/corelib/animation/qpauseanimation/BLACKLIST
new file mode 100644
index 0000000000..3b2cd84749
--- /dev/null
+++ b/tests/auto/corelib/animation/qpauseanimation/BLACKLIST
@@ -0,0 +1,4 @@
+[multiplePauseAnimations]
+osx-10.9
+[pauseAndPropertyAnimations]
+*
diff --git a/tests/auto/corelib/animation/qpropertyanimation/BLACKLIST b/tests/auto/corelib/animation/qpropertyanimation/BLACKLIST
new file mode 100644
index 0000000000..a7e95b1e97
--- /dev/null
+++ b/tests/auto/corelib/animation/qpropertyanimation/BLACKLIST
@@ -0,0 +1,4 @@
+[statesAndSignals:normal animation]
+windows
+[startBackwardWithoutEndValue]
+windows
diff --git a/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST b/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST
new file mode 100644
index 0000000000..e11e4ae6fb
--- /dev/null
+++ b/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST
@@ -0,0 +1,4 @@
+[startGroupWithRunningChild]
+windows
+[finishWithUncontrolledAnimation]
+windows
diff --git a/tests/auto/corelib/global/qflags/qflags.pro b/tests/auto/corelib/global/qflags/qflags.pro
index 3f78bc045b..7602008e22 100644
--- a/tests/auto/corelib/global/qflags/qflags.pro
+++ b/tests/auto/corelib/global/qflags/qflags.pro
@@ -3,4 +3,5 @@ TARGET = tst_qflags
QT = core testlib
SOURCES = tst_qflags.cpp
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
-contains(QT_CONFIG, c++11): CONFIG += c++11 c++14
+contains(QT_CONFIG, c++11): CONFIG += c++11
+contains(QT_CONFIG, c++14): CONFIG += c++14
diff --git a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
index 69bf7598fc..00f70f5380 100644
--- a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
+++ b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
@@ -457,7 +457,7 @@ void tst_QGlobal::isEnum()
// fallback type traits implementation. Any compiler
// supported by Qt that supports C++0x class enums
// should also support the __is_enum intrinsic.
- QVERIFY(Q_IS_ENUM(isEnum_G) == true);
+ QVERIFY(Q_IS_ENUM(isEnum_G));
#endif
#undef IS_ENUM_TRUE
diff --git a/tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp b/tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp
index a1cfff7e85..e9fd999e9f 100644
--- a/tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp
+++ b/tests/auto/corelib/global/qglobalstatic/tst_qglobalstatic.cpp
@@ -41,10 +41,17 @@
#include <QtCore/QThread>
#include <QtTest/QtTest>
+#if defined(Q_OS_UNIX)
+#include <sys/resource.h>
+#endif
+
class tst_QGlobalStatic : public QObject
{
Q_OBJECT
+public Q_SLOTS:
+ void initTestCase();
+
private Q_SLOTS:
void beforeInitialization();
void api();
@@ -55,6 +62,20 @@ private Q_SLOTS:
void afterDestruction();
};
+void tst_QGlobalStatic::initTestCase()
+{
+#if defined(Q_OS_UNIX)
+ // The tests create a lot of threads, which require file descriptors. On systems like
+ // OS X low defaults such as 256 as the limit for the number of simultaneously
+ // open files is not sufficient.
+ struct rlimit numFiles;
+ if (getrlimit(RLIMIT_NOFILE, &numFiles) == 0 && numFiles.rlim_cur < 1024) {
+ numFiles.rlim_cur = qMin(rlim_t(1024), numFiles.rlim_max);
+ setrlimit(RLIMIT_NOFILE, &numFiles);
+ }
+#endif
+}
+
Q_GLOBAL_STATIC_WITH_ARGS(const int, constInt, (42))
Q_GLOBAL_STATIC_WITH_ARGS(volatile int, volatileInt, (-47))
diff --git a/tests/auto/corelib/global/qlogging/qlogging.pro b/tests/auto/corelib/global/qlogging/qlogging.pro
index 4d3823cdbe..f1ca6570a0 100644
--- a/tests/auto/corelib/global/qlogging/qlogging.pro
+++ b/tests/auto/corelib/global/qlogging/qlogging.pro
@@ -1,6 +1,6 @@
TEMPLATE = subdirs
CONFIG += ordered
-SUBDIRS += \
- app \
- test
+!winrt: SUBDIRS += app
+
+SUBDIRS += test
diff --git a/tests/auto/corelib/global/qlogging/test/test.pro b/tests/auto/corelib/global/qlogging/test/test.pro
index d4dce4a0c3..64a63ce28a 100644
--- a/tests/auto/corelib/global/qlogging/test/test.pro
+++ b/tests/auto/corelib/global/qlogging/test/test.pro
@@ -1,10 +1,11 @@
CONFIG += testcase parallel_test
CONFIG -= app_bundle debug_and_release_target
-contains(QT_CONFIG, c++11): CONFIG += c++11 c++14
+contains(QT_CONFIG, c++11): CONFIG += c++11
+contains(QT_CONFIG, c++14): CONFIG += c++14
TARGET = ../tst_qlogging
QT = core testlib
SOURCES = ../tst_qlogging.cpp
DEFINES += QT_MESSAGELOGCONTEXT
-TEST_HELPER_INSTALLS = ../app/app
+!winrt: TEST_HELPER_INSTALLS = ../app/app
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/corelib/global/qnumeric/qnumeric.pro b/tests/auto/corelib/global/qnumeric/qnumeric.pro
index 00f3635be9..0772ce6aab 100644
--- a/tests/auto/corelib/global/qnumeric/qnumeric.pro
+++ b/tests/auto/corelib/global/qnumeric/qnumeric.pro
@@ -1,6 +1,6 @@
CONFIG += testcase parallel_test
TARGET = tst_qnumeric
-QT = core testlib
+QT = core-private testlib
SOURCES = tst_qnumeric.cpp
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
intel_icc: QMAKE_CXXFLAGS += -fp-model strict
diff --git a/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp b/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp
index fdc8bc6aab..6be8ff81cf 100644
--- a/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp
+++ b/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp
@@ -34,6 +34,7 @@
#include <QtTest/QtTest>
#include <QtGlobal>
+#include "private/qnumeric_p.h"
#include <math.h>
#include <float.h>
@@ -50,6 +51,10 @@ private slots:
void floatDistance();
void floatDistance_double_data();
void floatDistance_double();
+ void addOverflow_data();
+ void addOverflow();
+ void mulOverflow_data();
+ void mulOverflow();
};
void tst_QNumeric::fuzzyCompare_data()
@@ -206,5 +211,160 @@ void tst_QNumeric::floatDistance_double()
QCOMPARE(qFloatDistance(val1, val2), expectedDistance);
}
+void tst_QNumeric::addOverflow_data()
+{
+ QTest::addColumn<int>("size");
+ QTest::newRow("quint8") << 8;
+ QTest::newRow("quint16") << 16;
+ QTest::newRow("quint32") << 32;
+ QTest::newRow("quint64") << 64;
+ QTest::newRow("ulong") << 48; // it's either 32- or 64-bit, so on average it's 48 :-)
+}
+
+// Note: in release mode, all the tests may be statically determined and only the calls
+// to QTest::toString and QTest::qCompare will remain.
+template <typename Int> static void addOverflow_template()
+{
+#if defined(Q_CC_MSVC) && Q_CC_MSVC < 2000
+ QSKIP("Test disabled, this test generates an Internal Compiler Error compiling in release mode");
+#else
+ const Int max = std::numeric_limits<Int>::max();
+ Int r;
+
+ // basic values
+ QCOMPARE(add_overflow(Int(0), Int(0), &r), false);
+ QCOMPARE(r, Int(0));
+ QCOMPARE(add_overflow(Int(1), Int(0), &r), false);
+ QCOMPARE(r, Int(1));
+ QCOMPARE(add_overflow(Int(0), Int(1), &r), false);
+ QCOMPARE(r, Int(1));
+
+ // half-way through max
+ QCOMPARE(add_overflow(Int(max/2), Int(max/2), &r), false);
+ QCOMPARE(r, Int(max / 2 * 2));
+ QCOMPARE(add_overflow(Int(max/2 - 1), Int(max/2 + 1), &r), false);
+ QCOMPARE(r, Int(max / 2 * 2));
+ QCOMPARE(add_overflow(Int(max/2 + 1), Int(max/2), &r), false);
+ QCOMPARE(r, max);
+ QCOMPARE(add_overflow(Int(max/2), Int(max/2 + 1), &r), false);
+ QCOMPARE(r, max);
+
+ // more than half
+ QCOMPARE(add_overflow(Int(max/4 * 3), Int(max/4), &r), false);
+ QCOMPARE(r, Int(max / 4 * 4));
+
+ // max
+ QCOMPARE(add_overflow(max, Int(0), &r), false);
+ QCOMPARE(r, max);
+ QCOMPARE(add_overflow(Int(0), max, &r), false);
+ QCOMPARE(r, max);
+
+ // 64-bit issues
+ if (max > std::numeric_limits<uint>::max()) {
+ QCOMPARE(add_overflow(Int(std::numeric_limits<uint>::max()), Int(std::numeric_limits<uint>::max()), &r), false);
+ QCOMPARE(r, Int(2 * Int(std::numeric_limits<uint>::max())));
+ }
+
+ // overflows
+ QCOMPARE(add_overflow(max, Int(1), &r), true);
+ QCOMPARE(add_overflow(Int(1), max, &r), true);
+ QCOMPARE(add_overflow(Int(max/2 + 1), Int(max/2 + 1), &r), true);
+#endif
+}
+
+void tst_QNumeric::addOverflow()
+{
+ QFETCH(int, size);
+ if (size == 8)
+ addOverflow_template<quint8>();
+ if (size == 16)
+ addOverflow_template<quint16>();
+ if (size == 32)
+ addOverflow_template<quint32>();
+ if (size == 48)
+ addOverflow_template<ulong>(); // not really 48-bit
+ if (size == 64)
+ addOverflow_template<quint64>();
+}
+
+void tst_QNumeric::mulOverflow_data()
+{
+ addOverflow_data();
+}
+
+// Note: in release mode, all the tests may be statically determined and only the calls
+// to QTest::toString and QTest::qCompare will remain.
+template <typename Int> static void mulOverflow_template()
+{
+#if defined(Q_CC_MSVC) && Q_CC_MSVC < 1900
+ QSKIP("Test disabled, this test generates an Internal Compiler Error compiling");
+#else
+ const Int max = std::numeric_limits<Int>::max();
+ const Int middle = Int(max >> (sizeof(Int) * CHAR_BIT / 2));
+ Int r;
+
+ // basic multiplications
+ QCOMPARE(mul_overflow(Int(0), Int(0), &r), false);
+ QCOMPARE(r, Int(0));
+ QCOMPARE(mul_overflow(Int(1), Int(0), &r), false);
+ QCOMPARE(r, Int(0));
+ QCOMPARE(mul_overflow(Int(0), Int(1), &r), false);
+ QCOMPARE(r, Int(0));
+ QCOMPARE(mul_overflow(max, Int(0), &r), false);
+ QCOMPARE(r, Int(0));
+ QCOMPARE(mul_overflow(Int(0), max, &r), false);
+ QCOMPARE(r, Int(0));
+
+ QCOMPARE(mul_overflow(Int(1), Int(1), &r), false);
+ QCOMPARE(r, Int(1));
+ QCOMPARE(mul_overflow(Int(1), max, &r), false);
+ QCOMPARE(r, max);
+ QCOMPARE(mul_overflow(max, Int(1), &r), false);
+ QCOMPARE(r, max);
+
+ // almost max
+ QCOMPARE(mul_overflow(middle, middle, &r), false);
+ QCOMPARE(r, Int(max - 2 * middle));
+ QCOMPARE(mul_overflow(Int(middle + 1), middle, &r), false);
+ QCOMPARE(r, Int(middle << (sizeof(Int) * CHAR_BIT / 2)));
+ QCOMPARE(mul_overflow(middle, Int(middle + 1), &r), false);
+ QCOMPARE(r, Int(middle << (sizeof(Int) * CHAR_BIT / 2)));
+ QCOMPARE(mul_overflow(Int(max / 2), Int(2), &r), false);
+ QCOMPARE(r, Int(max & ~Int(1)));
+ QCOMPARE(mul_overflow(Int(max / 4), Int(4), &r), false);
+ QCOMPARE(r, Int(max & ~Int(3)));
+
+ // overflows
+ QCOMPARE(mul_overflow(max, Int(2), &r), true);
+ QCOMPARE(mul_overflow(Int(max / 2), Int(3), &r), true);
+ QCOMPARE(mul_overflow(Int(middle + 1), Int(middle + 1), &r), true);
+#endif
+}
+
+template <typename Int, bool enabled = sizeof(Int) <= sizeof(void*)> struct MulOverflowDispatch;
+template <typename Int> struct MulOverflowDispatch<Int, true>
+{
+ void operator()() { mulOverflow_template<Int>(); }
+};
+template <typename Int> struct MulOverflowDispatch<Int, false>
+{
+ void operator()() { QSKIP("This type is too big for this architecture"); }
+};
+
+void tst_QNumeric::mulOverflow()
+{
+ QFETCH(int, size);
+ if (size == 8)
+ MulOverflowDispatch<quint8>()();
+ if (size == 16)
+ MulOverflowDispatch<quint16>()();
+ if (size == 32)
+ MulOverflowDispatch<quint32>()();
+ if (size == 48)
+ MulOverflowDispatch<ulong>()(); // not really 48-bit
+ if (size == 64)
+ MulOverflowDispatch<quint64>()();
+}
+
QTEST_APPLESS_MAIN(tst_QNumeric)
#include "tst_qnumeric.moc"
diff --git a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
index 2cf93e1c45..d9d3f55d4a 100644
--- a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
+++ b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
@@ -264,7 +264,9 @@ static int NColorRoles[] = {
QPalette::ToolTipText + 1, // Qt_5_2
QPalette::ToolTipText + 1, // Qt_5_3
QPalette::ToolTipText + 1, // Qt_5_4
- 0 // add the correct value for Qt_5_5 here later
+ QPalette::ToolTipText + 1, // Qt_5_5
+ QPalette::ToolTipText + 1, // Qt_5_6
+ 0 // add the correct value for Qt_5_7 here later
};
// Testing get/set functions
diff --git a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
index 3e19e816c9..db2805ebf0 100644
--- a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
+++ b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
@@ -49,6 +49,7 @@ private slots:
void debugWithBool() const;
void debugSpaceHandling() const;
void debugNoQuotes() const;
+ void verbosity() const;
void stateSaver() const;
void veryLongWarningMessage() const;
void qDebugQChar() const;
@@ -192,7 +193,11 @@ public:
QDebug operator<< (QDebug s, const MyLine& line)
{
const QDebugStateSaver saver(s);
- s.nospace() << "MyLine(" << line.p1 << ", " << line.p2 << ")";
+ s.nospace();
+ s << "MyLine(" << line.p1 << ", "<< line.p2;
+ if (s.verbosity() > 2)
+ s << ", Manhattan length=" << (qAbs(line.p2.v1 - line.p1.v1) + qAbs(line.p2.v2 - line.p1.v2));
+ s << ')';
return s;
}
@@ -255,6 +260,33 @@ void tst_QDebug::debugNoQuotes() const
QCOMPARE(s_msg, QString::fromLatin1("'H' \"Hello\" \"Hello\" H Hello Hello"));
}
+void tst_QDebug::verbosity() const
+{
+ MyLine line(MyPoint(10, 11), MyPoint (12, 13));
+ QString output;
+ QDebug d(&output);
+ d.nospace();
+ d << line << '\n';
+ const int oldVerbosity = d.verbosity();
+ d.setVerbosity(0);
+ QCOMPARE(d.verbosity(), 0);
+ d.setVerbosity(7);
+ QCOMPARE(d.verbosity(), 7);
+ const int newVerbosity = oldVerbosity + 2;
+ d.setVerbosity(newVerbosity);
+ QCOMPARE(d.verbosity(), newVerbosity);
+ d << line << '\n';
+ d.setVerbosity(oldVerbosity );
+ QCOMPARE(d.verbosity(), oldVerbosity );
+ d << line;
+ const QStringList lines = output.split(QLatin1Char('\n'));
+ QCOMPARE(lines.size(), 3);
+ // Verbose should be longer
+ QVERIFY2(lines.at(1).size() > lines.at(0).size(), qPrintable(lines.join(QLatin1Char(','))));
+ // Switching back to brief produces same output
+ QCOMPARE(lines.at(0).size(), lines.at(2).size());
+}
+
void tst_QDebug::stateSaver() const
{
MessageHandlerSetter mhs(myMessageHandler);
diff --git a/tests/auto/corelib/io/qdir/qdir.pro b/tests/auto/corelib/io/qdir/qdir.pro
index d3e954bd32..0adc7e0450 100644
--- a/tests/auto/corelib/io/qdir/qdir.pro
+++ b/tests/auto/corelib/io/qdir/qdir.pro
@@ -10,3 +10,5 @@ DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
android:!android-no-sdk {
RESOURCES += android_testdata.qrc
}
+
+win32: CONFIG += insignificant_test # Crashes on Windows in release builds
diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp
index 72d036c2ae..ae6fe7eaef 100644
--- a/tests/auto/corelib/io/qdir/tst_qdir.cpp
+++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp
@@ -68,6 +68,12 @@ QT_END_NAMESPACE
#endif
+static QByteArray msgDoesNotExist(const QString &name)
+{
+ return (QLatin1Char('"') + QDir::toNativeSeparators(name)
+ + QLatin1String("\" does not exist.")).toLocal8Bit();
+}
+
class tst_QDir : public QObject
{
Q_OBJECT
@@ -354,7 +360,7 @@ void tst_QDir::mkdir()
//make sure it really exists (ie that mkdir returns the right value)
QFileInfo fi(path);
- QVERIFY(fi.exists() && fi.isDir());
+ QVERIFY2(fi.exists() && fi.isDir(), msgDoesNotExist(path).constData());
}
void tst_QDir::makedirReturnCode()
@@ -378,7 +384,7 @@ void tst_QDir::makedirReturnCode()
f.open(QIODevice::WriteOnly);
f.write("test");
f.close();
- QVERIFY(f.exists());
+ QVERIFY2(f.exists(), msgDoesNotExist(f.fileName()).constData());
QVERIFY(!QDir::current().mkdir(dirName)); // calling mkdir on an existing file will fail.
QVERIFY(!QDir::current().mkpath(dirName)); // calling mkpath on an existing file will fail.
f.remove();
@@ -474,7 +480,7 @@ void tst_QDir::removeRecursivelyFailure()
QVERIFY(!QDir().rmdir(path));
QDir dir(path);
QVERIFY(!dir.removeRecursively()); // didn't work
- QVERIFY(dir.exists()); // still exists
+ QVERIFY2(dir.exists(), msgDoesNotExist(dir.absolutePath()).constData()); // still exists
QVERIFY(dirAsFile.setPermissions(QFile::Permissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner)));
QVERIFY(dir.removeRecursively());
@@ -527,14 +533,15 @@ void tst_QDir::exists_data()
QTest::newRow("simple dir") << (m_dataPath + "/resources") << true;
QTest::newRow("simple dir with slash") << (m_dataPath + "/resources/") << true;
#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE))
- QTest::newRow("unc 1") << "//" + QtNetworkSettings::winServerName() << true;
- QTest::newRow("unc 2") << "//" + QtNetworkSettings::winServerName() + "/" << true;
- QTest::newRow("unc 3") << "//" + QtNetworkSettings::winServerName() + "/testshare" << true;
- QTest::newRow("unc 4") << "//" + QtNetworkSettings::winServerName() + "/testshare/" << true;
- QTest::newRow("unc 5") << "//" + QtNetworkSettings::winServerName() + "/testshare/tmp" << true;
- QTest::newRow("unc 6") << "//" + QtNetworkSettings::winServerName() + "/testshare/tmp/" << true;
- QTest::newRow("unc 7") << "//" + QtNetworkSettings::winServerName() + "/testshare/adirthatshouldnotexist" << false;
- QTest::newRow("unc 8") << "//" + QtNetworkSettings::winServerName() + "/asharethatshouldnotexist" << false;
+ const QString uncRoot = QStringLiteral("//") + QtNetworkSettings::winServerName();
+ QTest::newRow("unc 1") << uncRoot << true;
+ QTest::newRow("unc 2") << uncRoot + QLatin1Char('/') << true;
+ QTest::newRow("unc 3") << uncRoot + "/testshare" << true;
+ QTest::newRow("unc 4") << uncRoot + "/testshare/" << true;
+ QTest::newRow("unc 5") << uncRoot + "/testshare/tmp" << true;
+ QTest::newRow("unc 6") << uncRoot + "/testshare/tmp/" << true;
+ QTest::newRow("unc 7") << uncRoot + "/testshare/adirthatshouldnotexist" << false;
+ QTest::newRow("unc 8") << uncRoot + "/asharethatshouldnotexist" << false;
QTest::newRow("unc 9") << "//ahostthatshouldnotexist" << false;
#endif
#if (defined(Q_OS_WIN) && !defined(Q_OS_WINCE))
@@ -566,7 +573,10 @@ void tst_QDir::exists()
QFETCH(bool, expected);
QDir dir(path);
- QCOMPARE(dir.exists(), expected);
+ if (expected)
+ QVERIFY2(dir.exists(), msgDoesNotExist(path).constData());
+ else
+ QVERIFY(!dir.exists());
}
void tst_QDir::isRelativePath_data()
@@ -802,7 +812,7 @@ void tst_QDir::entryList()
#endif //Q_NO_SYMLINKS
QDir dir(dirName);
- QVERIFY(dir.exists());
+ QVERIFY2(dir.exists(), msgDoesNotExist(dirName).constData());
QStringList actual = dir.entryList(nameFilters, (QDir::Filters)filterspec,
(QDir::SortFlags)sortspec);
@@ -845,8 +855,8 @@ void tst_QDir::entryListTimedSort()
QTemporaryFile aFile(entrylistPath + "A-XXXXXX.qws");
QTemporaryFile bFile(entrylistPath + "B-XXXXXX.qws");
- QVERIFY(aFile.open());
- QVERIFY(bFile.open());
+ QVERIFY2(aFile.open(), qPrintable(aFile.errorString()));
+ QVERIFY2(bFile.open(), qPrintable(bFile.errorString()));
{
QProcess p;
p.start(touchBinary, QStringList() << "-t" << "201306021513" << aFile.fileName());
@@ -888,18 +898,25 @@ void tst_QDir::entryListSimple_data()
#endif
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
- QTest::newRow("unc 1") << "//" + QtNetworkSettings::winServerName() << 2;
- QTest::newRow("unc 2") << "//" + QtNetworkSettings::winServerName() + "/" << 2;
- QTest::newRow("unc 3") << "//" + QtNetworkSettings::winServerName() + "/testshare" << 2;
- QTest::newRow("unc 4") << "//" + QtNetworkSettings::winServerName() + "/testshare/" << 2;
- QTest::newRow("unc 5") << "//" + QtNetworkSettings::winServerName() + "/testshare/tmp" << 2;
- QTest::newRow("unc 6") << "//" + QtNetworkSettings::winServerName() + "/testshare/tmp/" << 2;
- QTest::newRow("unc 7") << "//" + QtNetworkSettings::winServerName() + "/testshare/adirthatshouldnotexist" << 0;
- QTest::newRow("unc 8") << "//" + QtNetworkSettings::winServerName() + "/asharethatshouldnotexist" << 0;
+ const QString uncRoot = QStringLiteral("//") + QtNetworkSettings::winServerName();
+ QTest::newRow("unc 1") << uncRoot << 2;
+ QTest::newRow("unc 2") << uncRoot + QLatin1Char('/') << 2;
+ QTest::newRow("unc 3") << uncRoot + "/testshare" << 2;
+ QTest::newRow("unc 4") << uncRoot + "/testshare/" << 2;
+ QTest::newRow("unc 5") << uncRoot + "/testshare/tmp" << 2;
+ QTest::newRow("unc 6") << uncRoot + "/testshare/tmp/" << 2;
+ QTest::newRow("unc 7") << uncRoot + "/testshare/adirthatshouldnotexist" << 0;
+ QTest::newRow("unc 8") << uncRoot + "/asharethatshouldnotexist" << 0;
QTest::newRow("unc 9") << "//ahostthatshouldnotexist" << 0;
#endif
}
+static QByteArray msgEntryListFailed(int actual, int expectedMin, const QString &name)
+{
+ return QByteArray::number(actual) + " < " + QByteArray::number(expectedMin) + " in \""
+ + QFile::encodeName(QDir::toNativeSeparators(name)) + '"';
+}
+
void tst_QDir::entryListSimple()
{
QFETCH(QString, dirName);
@@ -907,7 +924,7 @@ void tst_QDir::entryListSimple()
QDir dir(dirName);
QStringList actual = dir.entryList();
- QVERIFY(actual.count() >= countMin);
+ QVERIFY2(actual.count() >= countMin, msgEntryListFailed(actual.count(), countMin, dirName).constData());
}
void tst_QDir::entryListWithSymLinks()
@@ -1121,7 +1138,7 @@ void tst_QDir::setNameFilters()
QFETCH(QStringList, expected);
QDir dir(dirName);
- QVERIFY(dir.exists());
+ QVERIFY2(dir.exists(), msgDoesNotExist(dirName).constData());
dir.setNameFilters(nameFilters);
QStringList actual = dir.entryList();
@@ -1504,7 +1521,7 @@ void tst_QDir::exists2()
QDir dir;
if (exists)
- QVERIFY(dir.exists(path));
+ QVERIFY2(dir.exists(path), msgDoesNotExist(path).constData());
else
QVERIFY(!dir.exists(path));
diff --git a/tests/auto/corelib/io/qdiriterator/qdiriterator.pro b/tests/auto/corelib/io/qdiriterator/qdiriterator.pro
index 3b5d2bd931..a2429bf2f0 100644
--- a/tests/auto/corelib/io/qdiriterator/qdiriterator.pro
+++ b/tests/auto/corelib/io/qdiriterator/qdiriterator.pro
@@ -8,3 +8,5 @@ TESTDATA += entrylist
wince*mips*|wincewm50smart-msvc200*: DEFINES += WINCE_BROKEN_ITERATE=1
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+
+win32: CONFIG += insignificant_test # Crashes on Windows in release builds
diff --git a/tests/auto/corelib/io/qfile/BLACKLIST b/tests/auto/corelib/io/qfile/BLACKLIST
new file mode 100644
index 0000000000..e3bc093c83
--- /dev/null
+++ b/tests/auto/corelib/io/qfile/BLACKLIST
@@ -0,0 +1,9 @@
+# QTBUG-48455
+[readLineStdin]
+msvc-2015
+[readLineStdin_lineByLine]
+msvc-2015
+[openStandardStreamsFileDescriptors]
+osx
+[openStandardStreamsBufferedStreams]
+osx
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index b423e857d0..1c695a1113 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -390,9 +390,30 @@ tst_QFile::tst_QFile() : m_oldDir(QDir::currentPath())
{
}
+static QByteArray msgOpenFailed(QIODevice::OpenMode om, const QFile &file)
+{
+ QString result;
+ QDebug(&result).noquote().nospace() << "Could not open \""
+ << QDir::toNativeSeparators(file.fileName()) << "\" using "
+ << om << ": " << file.errorString();
+ return result.toLocal8Bit();
+}
+
+static QByteArray msgOpenFailed(const QFile &file)
+{
+ return (QLatin1String("Could not open \"") + QDir::toNativeSeparators(file.fileName())
+ + QLatin1String("\": ") + file.errorString()).toLocal8Bit();
+}
+
+static QByteArray msgFileDoesNotExist(const QString &name)
+{
+ return (QLatin1Char('"') + QDir::toNativeSeparators(name)
+ + QLatin1String("\" does not exist.")).toLocal8Bit();
+}
+
void tst_QFile::initTestCase()
{
- QVERIFY(m_temporaryDir.isValid());
+ QVERIFY2(m_temporaryDir.isValid(), qPrintable(m_temporaryDir.errorString()));
m_stdinProcessDir = QFINDTESTDATA("stdinprocess");
QVERIFY(!m_stdinProcessDir.isEmpty());
m_testSourceFile = QFINDTESTDATA("tst_qfile.cpp");
@@ -418,19 +439,19 @@ void tst_QFile::initTestCase()
// create a file and make it read-only
QFile file(QString::fromLatin1(readOnlyFile));
- QVERIFY2(file.open(QFile::WriteOnly), qPrintable(file.errorString()));
+ QVERIFY2(file.open(QFile::WriteOnly), msgOpenFailed(file).constData());
file.write("a", 1);
file.close();
QVERIFY2(file.setPermissions(QFile::ReadOwner), qPrintable(file.errorString()));
// create another file and make it not readable
file.setFileName(QString::fromLatin1(noReadFile));
- QVERIFY2(file.open(QFile::WriteOnly), qPrintable(file.errorString()));
+ QVERIFY2(file.open(QFile::WriteOnly), msgOpenFailed(file).constData());
file.write("b", 1);
file.close();
#ifndef Q_OS_WIN // Not supported on Windows.
QVERIFY2(file.setPermissions(0), qPrintable(file.errorString()));
#else
- QVERIFY2(file.open(QFile::WriteOnly), qPrintable(file.errorString()));
+ QVERIFY2(file.open(QFile::WriteOnly), msgOpenFailed(file).constData());
#endif
}
@@ -455,19 +476,19 @@ void tst_QFile::cleanupTestCase()
void tst_QFile::exists()
{
QFile f( m_testFile );
- QVERIFY(f.exists());
+ QVERIFY2(f.exists(), msgFileDoesNotExist(m_testFile));
QFile file("nobodyhassuchafile");
file.remove();
QVERIFY(!file.exists());
QFile file2("nobodyhassuchafile");
- QVERIFY(file2.open(QIODevice::WriteOnly));
+ QVERIFY2(file2.open(QIODevice::WriteOnly), msgOpenFailed(file2).constData());
file2.close();
QVERIFY(file.exists());
- QVERIFY(file.open(QIODevice::WriteOnly));
+ QVERIFY2(file.open(QIODevice::WriteOnly), msgOpenFailed(file).constData());
file.close();
QVERIFY(file.exists());
@@ -475,8 +496,9 @@ void tst_QFile::exists()
QVERIFY(!file.exists());
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
- QFile unc("//" + QtNetworkSettings::winServerName() + "/testshare/readme.txt");
- QVERIFY(unc.exists());
+ const QString uncPath = "//" + QtNetworkSettings::winServerName() + "/testshare/readme.txt";
+ QFile unc(uncPath);
+ QVERIFY2(unc.exists(), msgFileDoesNotExist(uncPath).constData());
#endif
}
@@ -558,7 +580,12 @@ void tst_QFile::open()
if (filename.isEmpty())
QTest::ignoreMessage(QtWarningMsg, "QFSFileEngine::open: No file name specified");
- QCOMPARE(f.open( QIODevice::OpenMode(mode) ), ok);
+ const QIODevice::OpenMode om(mode);
+ const bool succeeded = f.open(om);
+ if (ok)
+ QVERIFY2(succeeded, msgOpenFailed(om, f).constData());
+ else
+ QVERIFY(!succeeded);
QTEST( f.error(), "status" );
}
@@ -566,7 +593,7 @@ void tst_QFile::open()
void tst_QFile::openUnbuffered()
{
QFile file(m_testFile);
- QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Unbuffered));
+ QVERIFY2(file.open(QIODevice::ReadOnly | QIODevice::Unbuffered), msgOpenFailed(file).constData());
char c = '\0';
QVERIFY(file.seek(1));
QCOMPARE(file.pos(), qint64(1));
@@ -618,7 +645,7 @@ void tst_QFile::size()
QFile f( filename );
QCOMPARE( f.size(), size );
- QVERIFY( f.open(QIODevice::ReadOnly) );
+ QVERIFY2(f.open(QIODevice::ReadOnly), msgOpenFailed(f).constData());
QCOMPARE( f.size(), size );
}
@@ -662,7 +689,7 @@ void tst_QFile::sizeNoExist()
void tst_QFile::seek()
{
QFile file("newfile.txt");
- file.open(QIODevice::WriteOnly);
+ QVERIFY2(file.open(QIODevice::WriteOnly), msgOpenFailed(file).constData());
QCOMPARE(file.size(), qint64(0));
QCOMPARE(file.pos(), qint64(0));
QVERIFY(file.seek(10));
@@ -674,7 +701,7 @@ void tst_QFile::seek()
void tst_QFile::setSize()
{
QFile f("createme.txt");
- QVERIFY(f.open(QIODevice::Truncate | QIODevice::ReadWrite));
+ QVERIFY2(f.open(QIODevice::Truncate | QIODevice::ReadWrite), msgOpenFailed(f).constData());
f.putChar('a');
f.seek(0);
@@ -712,7 +739,7 @@ void tst_QFile::setSize()
void tst_QFile::setSizeSeek()
{
QFile f("setsizeseek.txt");
- QVERIFY(f.open(QFile::WriteOnly));
+ QVERIFY2(f.open(QFile::WriteOnly), msgOpenFailed(f).constData());
f.write("ABCD");
QCOMPARE(f.pos(), qint64(4));
@@ -734,7 +761,7 @@ void tst_QFile::setSizeSeek()
void tst_QFile::atEnd()
{
QFile f( m_testFile );
- QVERIFY(f.open( QIODevice::ReadOnly ));
+ QVERIFY2(f.open(QFile::ReadOnly), msgOpenFailed(f).constData());
int size = f.size();
f.seek( size );
@@ -747,7 +774,7 @@ void tst_QFile::atEnd()
void tst_QFile::readLine()
{
QFile f( m_testFile );
- QVERIFY(f.open( QIODevice::ReadOnly ));
+ QVERIFY2(f.open(QFile::ReadOnly), msgOpenFailed(f).constData());
int i = 0;
char p[128];
@@ -767,7 +794,8 @@ void tst_QFile::readLine()
void tst_QFile::readLine2()
{
QFile f( m_testFile );
- f.open( QIODevice::ReadOnly );
+ QVERIFY2(f.open(QFile::ReadOnly), msgOpenFailed(f).constData());
+
char p[128];
QCOMPARE(f.readLine(p, 60), qlonglong(59));
@@ -785,7 +813,7 @@ void tst_QFile::readLineNullInLine()
{
QFile::remove("nullinline.txt");
QFile file("nullinline.txt");
- QVERIFY(file.open(QIODevice::ReadWrite));
+ QVERIFY2(file.open(QFile::ReadWrite), msgOpenFailed(file).constData());
QVERIFY(file.write("linewith\0null\nanotherline\0withnull\n\0\nnull\0", 42) > 0);
QVERIFY(file.flush());
file.reset();
@@ -816,10 +844,8 @@ void tst_QFile::readAll()
QFETCH( QString, fileName );
QFile file(fileName);
- if (textMode)
- QVERIFY(file.open(QFile::Text | QFile::ReadOnly));
- else
- QVERIFY(file.open(QFile::ReadOnly));
+ const QIODevice::OpenMode om = textMode ? (QFile::Text | QFile::ReadOnly) : QFile::ReadOnly;
+ QVERIFY2(file.open(om), msgOpenFailed(om, file).constData());
QByteArray a = file.readAll();
file.reset();
@@ -848,8 +874,8 @@ void tst_QFile::readAllBuffer()
QByteArray data1("This is arguably a very simple text.");
QByteArray data2("This is surely not as simple a test.");
- QVERIFY( writer.open(QIODevice::ReadWrite | QIODevice::Unbuffered) );
- QVERIFY( reader.open(QIODevice::ReadOnly) );
+ QVERIFY2(writer.open(QIODevice::ReadWrite | QIODevice::Unbuffered), msgOpenFailed(writer).constData());
+ QVERIFY2(reader.open(QIODevice::ReadOnly), msgOpenFailed(reader).constData());
QCOMPARE( writer.write(data1), qint64(data1.size()) );
QVERIFY( writer.seek(0) );
@@ -868,6 +894,32 @@ void tst_QFile::readAllBuffer()
QFile::remove(fileName);
}
+#ifndef QT_NO_PROCESS
+class StdinReaderProcessGuard { // Ensure the stdin reader process is stopped on destruction.
+ Q_DISABLE_COPY(StdinReaderProcessGuard)
+
+public:
+ StdinReaderProcessGuard(QProcess *p) : m_process(p) {}
+ ~StdinReaderProcessGuard() { stop(); }
+
+ bool stop(int msecs = 30000)
+ {
+ if (m_process->state() != QProcess::Running)
+ return true;
+ m_process->closeWriteChannel();
+ if (m_process->waitForFinished(msecs))
+ return m_process->exitStatus() == QProcess::NormalExit && !m_process->exitCode();
+ m_process->terminate();
+ if (!m_process->waitForFinished())
+ m_process->kill();
+ return false;
+ }
+
+private:
+ QProcess *m_process;
+};
+#endif // !QT_NO_PROCESS
+
#if !defined(Q_OS_WINCE)
void tst_QFile::readAllStdin()
{
@@ -877,18 +929,17 @@ void tst_QFile::readAllStdin()
QByteArray lotsOfData(1024, '@'); // 10 megs
QProcess process;
+ StdinReaderProcessGuard processGuard(&process);
process.start(m_stdinProcessDir + QStringLiteral("/stdinprocess"), QStringList(QStringLiteral("all")));
QVERIFY2(process.waitForStarted(), qPrintable(process.errorString()));
for (int i = 0; i < 5; ++i) {
QTest::qWait(1000);
process.write(lotsOfData);
- while (process.bytesToWrite() > 0) {
+ while (process.bytesToWrite() > 0)
QVERIFY(process.waitForBytesWritten());
- }
}
- process.closeWriteChannel();
- process.waitForFinished();
+ QVERIFY(processGuard.stop());
QCOMPARE(process.readAll().size(), lotsOfData.size() * 5);
#endif
}
@@ -908,6 +959,7 @@ void tst_QFile::readLineStdin()
for (int i = 0; i < 2; ++i) {
QProcess process;
+ StdinReaderProcessGuard processGuard(&process);
process.start(m_stdinProcessDir + QStringLiteral("/stdinprocess"),
QStringList() << QStringLiteral("line") << QString::number(i),
QIODevice::Text | QIODevice::ReadWrite);
@@ -915,13 +967,11 @@ void tst_QFile::readLineStdin()
for (int i = 0; i < 5; ++i) {
QTest::qWait(1000);
process.write(lotsOfData);
- while (process.bytesToWrite() > 0) {
+ while (process.bytesToWrite() > 0)
QVERIFY(process.waitForBytesWritten());
- }
}
- process.closeWriteChannel();
- QVERIFY(process.waitForFinished(5000));
+ QVERIFY(processGuard.stop(5000));
QByteArray array = process.readAll();
QCOMPARE(array.size(), lotsOfData.size() * 5);
@@ -942,6 +992,7 @@ void tst_QFile::readLineStdin_lineByLine()
#else
for (int i = 0; i < 2; ++i) {
QProcess process;
+ StdinReaderProcessGuard processGuard(&process);
process.start(m_stdinProcessDir + QStringLiteral("/stdinprocess"),
QStringList() << QStringLiteral("line") << QString::number(i),
QIODevice::Text | QIODevice::ReadWrite);
@@ -956,8 +1007,7 @@ void tst_QFile::readLineStdin_lineByLine()
QCOMPARE(process.readAll(), line);
}
- process.closeWriteChannel();
- QVERIFY(process.waitForFinished(5000));
+ QVERIFY(processGuard.stop(5000));
}
#endif
}
@@ -967,7 +1017,7 @@ void tst_QFile::text()
{
// dosfile.txt is a binary CRLF file
QFile file(m_dosFile);
- QVERIFY(file.open(QFile::Text | QFile::ReadOnly));
+ QVERIFY2(file.open(QFile::Text | QFile::ReadOnly), msgOpenFailed(file).constData());
QCOMPARE(file.readLine(),
QByteArray("/dev/system/root / reiserfs acl,user_xattr 1 1\n"));
QCOMPARE(file.readLine(),
@@ -980,7 +1030,7 @@ void tst_QFile::text()
void tst_QFile::missingEndOfLine()
{
QFile file(m_noEndOfLineFile);
- QVERIFY(file.open(QFile::ReadOnly));
+ QVERIFY2(file.open(QFile::ReadOnly), msgOpenFailed(file).constData());
int nlines = 0;
while (!file.atEnd()) {
@@ -1026,7 +1076,7 @@ void tst_QFile::getch()
void tst_QFile::ungetChar()
{
QFile f(m_testFile);
- QVERIFY(f.open(QIODevice::ReadOnly));
+ QVERIFY2(f.open(QFile::ReadOnly), msgOpenFailed(f).constData());
QByteArray array = f.readLine();
QCOMPARE(array.constData(), "----------------------------------------------------------\n");
@@ -1044,7 +1094,7 @@ void tst_QFile::ungetChar()
QFile::remove("genfile.txt");
QFile out("genfile.txt");
- QVERIFY(out.open(QIODevice::ReadWrite));
+ QVERIFY2(out.open(QIODevice::ReadWrite), msgOpenFailed(out).constData());
out.write("123");
out.seek(0);
QCOMPARE(out.readAll().constData(), "123");
@@ -1127,7 +1177,7 @@ void tst_QFile::createFile()
QVERIFY( !QFile::exists( "createme.txt" ) );
QFile f( "createme.txt" );
- QVERIFY( f.open( QIODevice::WriteOnly ) );
+ QVERIFY2( f.open(QIODevice::WriteOnly), msgOpenFailed(f).constData());
f.close();
QVERIFY( QFile::exists( "createme.txt" ) );
}
@@ -1140,11 +1190,11 @@ void tst_QFile::append()
QVERIFY(!QFile::exists(name));
QFile f(name);
- QVERIFY(f.open(QIODevice::WriteOnly | QIODevice::Truncate));
+ QVERIFY2(f.open(QIODevice::WriteOnly | QIODevice::Truncate), msgOpenFailed(f).constData());
f.putChar('a');
f.close();
- QVERIFY(f.open(QIODevice::Append));
+ QVERIFY2(f.open(QIODevice::Append), msgOpenFailed(f).constData());
QVERIFY(f.pos() == 1);
f.putChar('a');
f.close();
@@ -1181,7 +1231,7 @@ void tst_QFile::permissions()
QFETCH(bool, create);
if (create) {
QFile fc(file);
- QVERIFY(fc.open(QFile::WriteOnly));
+ QVERIFY2(fc.open(QFile::WriteOnly), msgOpenFailed(fc).constData());
QVERIFY(fc.write("hello\n"));
fc.close();
}
@@ -1230,7 +1280,7 @@ void tst_QFile::setPermissions()
QVERIFY( !QFile::exists( "createme.txt" ) );
QFile f("createme.txt");
- QVERIFY(f.open(QIODevice::WriteOnly | QIODevice::Truncate));
+ QVERIFY2(f.open(QIODevice::WriteOnly | QIODevice::Truncate), msgOpenFailed(f).constData());
f.putChar('a');
f.close();
@@ -1247,8 +1297,8 @@ void tst_QFile::copy()
QFile::remove("test2");
QVERIFY(QFile::copy(m_testSourceFile, "tst_qfile_copy.cpp"));
QFile in1(m_testSourceFile), in2("tst_qfile_copy.cpp");
- QVERIFY(in1.open(QFile::ReadOnly));
- QVERIFY(in2.open(QFile::ReadOnly));
+ QVERIFY2(in1.open(QFile::ReadOnly), msgOpenFailed(in1).constData());
+ QVERIFY2(in2.open(QFile::ReadOnly), msgOpenFailed(in2).constData());
QByteArray data1 = in1.readAll(), data2 = in2.readAll();
QCOMPARE(data1, data2);
QFile::remove( "main_copy.cpp" );
@@ -1261,8 +1311,8 @@ void tst_QFile::copyAfterFail()
QFile file1("file-to-be-copied.txt");
QFile file2("existing-file.txt");
- QVERIFY(file1.open(QIODevice::ReadWrite) && "(test-precondition)");
- QVERIFY(file2.open(QIODevice::ReadWrite) && "(test-precondition)");
+ QVERIFY2(file1.open(QIODevice::ReadWrite), msgOpenFailed(file1).constData());
+ QVERIFY2(file2.open(QIODevice::ReadWrite), msgOpenFailed(file1).constData());
file2.close();
QVERIFY(!QFile::exists("copied-file-1.txt") && "(test-precondition)");
QVERIFY(!QFile::exists("copied-file-2.txt") && "(test-precondition)");
@@ -1331,7 +1381,7 @@ void tst_QFile::copyFallback()
QVERIFY(QFile::remove("file-copy-destination.txt"));
// Fallback copy of open file.
- QVERIFY(file.open(QIODevice::ReadOnly));
+ QVERIFY2(file.open(QIODevice::ReadOnly), msgOpenFailed(file).constData());
QVERIFY(file.copy("file-copy-destination.txt"));
QVERIFY(QFile::exists("file-copy-destination.txt"));
QVERIFY(!file.isOpen());
@@ -1401,7 +1451,7 @@ void tst_QFile::link()
QCOMPARE(info2.symLinkTarget(), referenceTarget);
QFile link("myLink.lnk");
- QVERIFY(link.open(QIODevice::ReadOnly));
+ QVERIFY2(link.open(QIODevice::ReadOnly), msgOpenFailed(link).constData());
QCOMPARE(link.symLinkTarget(), referenceTarget);
link.close();
@@ -1483,15 +1533,15 @@ void tst_QFile::readTextFile()
QFETCH(QByteArray, out);
QFile winfile("winfile.txt");
- QVERIFY(winfile.open(QFile::WriteOnly | QFile::Truncate));
+ QVERIFY2(winfile.open(QFile::WriteOnly | QFile::Truncate), msgOpenFailed(winfile).constData());
winfile.write(in);
winfile.close();
- QVERIFY(winfile.open(QFile::ReadOnly));
+ QVERIFY2(winfile.open(QFile::ReadOnly), msgOpenFailed(winfile).constData());
QCOMPARE(winfile.readAll(), in);
winfile.close();
- QVERIFY(winfile.open(QFile::ReadOnly | QFile::Text));
+ QVERIFY2(winfile.open(QFile::ReadOnly | QFile::Text), msgOpenFailed(winfile).constData());
QCOMPARE(winfile.readAll(), out);
}
@@ -1499,13 +1549,13 @@ void tst_QFile::readTextFile2()
{
{
QFile file(m_testLogFile);
- QVERIFY(file.open(QIODevice::ReadOnly));
+ QVERIFY2(file.open(QIODevice::ReadOnly), msgOpenFailed(file).constData());
file.read(4097);
}
{
QFile file(m_testLogFile);
- QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text));
+ QVERIFY2(file.open(QIODevice::ReadOnly | QIODevice::Text), msgOpenFailed(file).constData());
file.read(4097);
}
}
@@ -1532,7 +1582,8 @@ void tst_QFile::writeTextFile()
QFETCH(QByteArray, in);
QFile file("textfile.txt");
- QVERIFY(file.open(QFile::WriteOnly | QFile::Truncate | QFile::Text));
+ QVERIFY2(file.open(QFile::WriteOnly | QFile::Truncate | QFile::Text),
+ msgOpenFailed(file).constData());
QByteArray out = in;
#ifdef Q_OS_WIN
out.replace('\n', "\r\n");
@@ -1555,8 +1606,10 @@ void tst_QFile::largeUncFileSupport()
{
// 1) Native file handling.
QFile file(largeFile);
+ QVERIFY2(file.exists(), msgFileDoesNotExist(largeFile));
+
QCOMPARE(file.size(), size);
- QVERIFY(file.open(QIODevice::ReadOnly));
+ QVERIFY2(file.open(QIODevice::ReadOnly), msgOpenFailed(file).constData());
QCOMPARE(file.size(), size);
QVERIFY(file.seek(dataOffset));
QCOMPARE(file.read(knownData.size()), knownData);
@@ -1593,13 +1646,13 @@ void tst_QFile::flush()
{
QFile file(fileName);
- QVERIFY(file.open(QFile::WriteOnly));
+ QVERIFY2(file.open(QFile::WriteOnly), msgOpenFailed(file).constData());
QCOMPARE(file.write("abc", 3),qint64(3));
}
{
QFile file(fileName);
- QVERIFY(file.open(QFile::WriteOnly | QFile::Append));
+ QVERIFY2(file.open(QFile::WriteOnly | QFile::Append), msgOpenFailed(file).constData());
QCOMPARE(file.pos(), qlonglong(3));
QCOMPARE(file.write("def", 3), qlonglong(3));
QCOMPARE(file.pos(), qlonglong(6));
@@ -1607,7 +1660,7 @@ void tst_QFile::flush()
{
QFile file("stdfile.txt");
- QVERIFY(file.open(QFile::ReadOnly));
+ QVERIFY2(file.open(QFile::ReadOnly), msgOpenFailed(file).constData());
QCOMPARE(file.readAll(), QByteArray("abcdef"));
}
}
@@ -1617,7 +1670,7 @@ void tst_QFile::bufferedRead()
QFile::remove("stdfile.txt");
QFile file("stdfile.txt");
- QVERIFY(file.open(QFile::WriteOnly));
+ QVERIFY2(file.open(QFile::WriteOnly), msgOpenFailed(file).constData());
file.write("abcdef");
file.close();
@@ -1634,7 +1687,7 @@ void tst_QFile::bufferedRead()
{
QFile file;
- QVERIFY(file.open(stdFile, QFile::ReadOnly));
+ QVERIFY2(file.open(stdFile, QFile::ReadOnly), msgOpenFailed(file).constData());
QCOMPARE(file.pos(), qlonglong(1));
QCOMPARE(file.read(&c, 1), qlonglong(1));
QCOMPARE(c, 'b');
@@ -1648,7 +1701,7 @@ void tst_QFile::bufferedRead()
void tst_QFile::isSequential()
{
QFile zero("/dev/null");
- QVERIFY(zero.open(QFile::ReadOnly));
+ QVERIFY2(zero.open(QFile::ReadOnly), msgOpenFailed(zero).constData());
QVERIFY(zero.isSequential());
}
#endif
@@ -1662,15 +1715,15 @@ void tst_QFile::truncate()
{
for (int i = 0; i < 2; ++i) {
QFile file("truncate.txt");
- QVERIFY(file.open(QFile::WriteOnly));
+ QVERIFY2(file.open(QFile::WriteOnly), msgOpenFailed(file).constData());
file.write(QByteArray(200, '@'));
file.close();
- QVERIFY(file.open((i ? QFile::WriteOnly : QFile::ReadWrite) | QFile::Truncate));
+ QVERIFY2(file.open((i ? QFile::WriteOnly : QFile::ReadWrite) | QFile::Truncate), msgOpenFailed(file).constData());
file.write(QByteArray(100, '$'));
file.close();
- QVERIFY(file.open(QFile::ReadOnly));
+ QVERIFY2(file.open(QFile::ReadOnly), msgOpenFailed(file).constData());
QCOMPARE(file.readAll(), QByteArray(100, '$'));
}
}
@@ -1679,13 +1732,13 @@ void tst_QFile::seekToPos()
{
{
QFile file("seekToPos.txt");
- QVERIFY(file.open(QFile::WriteOnly));
+ QVERIFY2(file.open(QFile::WriteOnly), msgOpenFailed(file).constData());
file.write("a\r\nb\r\nc\r\n");
file.flush();
}
QFile file("seekToPos.txt");
- QVERIFY(file.open(QFile::ReadOnly | QFile::Text));
+ QVERIFY2(file.open(QFile::ReadOnly | QFile::Text), msgOpenFailed(file).constData());
file.seek(1);
char c;
QVERIFY(file.getChar(&c));
@@ -1707,7 +1760,7 @@ void tst_QFile::seekAfterEndOfFile()
QFile::remove(filename);
{
QFile file(filename);
- QVERIFY(file.open(QFile::WriteOnly));
+ QVERIFY2(file.open(QFile::WriteOnly), msgOpenFailed(file).constData());
file.write("abcd");
QCOMPARE(file.size(), qint64(4));
file.seek(8);
@@ -1723,7 +1776,7 @@ void tst_QFile::seekAfterEndOfFile()
}
QFile file(filename);
- QVERIFY(file.open(QFile::ReadOnly));
+ QVERIFY2(file.open(QFile::ReadOnly), msgOpenFailed(file).constData());
QByteArray contents = file.readAll();
QCOMPARE(contents.left(12), QByteArray("abcdefghijkl", 12));
//bytes 12-15 are uninitialised so we don't care what they read as.
@@ -1741,7 +1794,7 @@ void tst_QFile::FILEReadWrite()
// create test file
{
QFile f("FILEReadWrite.txt");
- QVERIFY(f.open(QFile::WriteOnly));
+ QVERIFY2(f.open(QFile::WriteOnly), msgOpenFailed(f).constData());
QDataStream ds(&f);
qint8 c = 0;
ds << c;
@@ -1777,7 +1830,7 @@ void tst_QFile::FILEReadWrite()
#endif
QVERIFY(fp);
QFile file;
- QVERIFY(file.open(fp, QFile::ReadWrite));
+ QVERIFY2(file.open(fp, QFile::ReadWrite), msgOpenFailed(file).constData());
QDataStream sfile(&file) ;
qint8 var1,var2,var3,var4;
@@ -1814,7 +1867,7 @@ void tst_QFile::FILEReadWrite()
// check modified file
{
QFile f("FILEReadWrite.txt");
- QVERIFY(f.open(QFile::ReadOnly));
+ QVERIFY2(f.open(QFile::ReadOnly), msgOpenFailed(file).constData());
QDataStream ds(&f);
qint8 c = 0;
ds >> c;
@@ -1928,14 +1981,14 @@ void tst_QFile::i18nFileName()
}
{
QFile file(fileName);
- QVERIFY(file.open(QFile::WriteOnly | QFile::Text));
+ QVERIFY2(file.open(QFile::WriteOnly | QFile::Text), msgOpenFailed(file).constData());
QTextStream ts(&file);
ts.setCodec("UTF-8");
ts << fileName << endl;
}
{
QFile file(fileName);
- QVERIFY(file.open(QFile::ReadOnly | QFile::Text));
+ QVERIFY2(file.open(QFile::ReadOnly | QFile::Text), msgOpenFailed(file).constData());
QTextStream ts(&file);
ts.setCodec("UTF-8");
QString line = ts.readLine();
@@ -1983,13 +2036,13 @@ void tst_QFile::longFileName()
QEXPECT_FAIL("244 chars", "Full pathname must be less than 260 chars", Abort);
QEXPECT_FAIL("244 chars to absolutepath", "Full pathname must be less than 260 chars", Abort);
#endif
- QVERIFY(file.open(QFile::WriteOnly | QFile::Text));
+ QVERIFY2(file.open(QFile::WriteOnly | QFile::Text), msgOpenFailed(file).constData());
QTextStream ts(&file);
ts << fileName << endl;
}
{
QFile file(fileName);
- QVERIFY(file.open(QFile::ReadOnly | QFile::Text));
+ QVERIFY2(file.open(QFile::ReadOnly | QFile::Text), msgOpenFailed(file).constData());
QTextStream ts(&file);
QString line = ts.readLine();
QCOMPARE(line, fileName);
@@ -1998,7 +2051,7 @@ void tst_QFile::longFileName()
{
QVERIFY(QFile::copy(fileName, newName));
QFile file(newName);
- QVERIFY(file.open(QFile::ReadOnly | QFile::Text));
+ QVERIFY2(file.open(QFile::ReadOnly | QFile::Text), msgOpenFailed(file).constData());
QTextStream ts(&file);
QString line = ts.readLine();
QCOMPARE(line, fileName);
@@ -2008,12 +2061,12 @@ void tst_QFile::longFileName()
{
QVERIFY(QFile::rename(fileName, newName));
QFile file(newName);
- QVERIFY(file.open(QFile::ReadOnly | QFile::Text));
+ QVERIFY2(file.open(QFile::ReadOnly | QFile::Text), msgOpenFailed(file).constData());
QTextStream ts(&file);
QString line = ts.readLine();
QCOMPARE(line, fileName);
}
- QVERIFY(QFile::exists(newName));
+ QVERIFY2(QFile::exists(newName), msgFileDoesNotExist(newName).constData());
}
#ifdef QT_BUILD_INTERNAL
@@ -2146,7 +2199,7 @@ void tst_QFile::remove_and_exists()
bool opened = f.open(QIODevice::WriteOnly);
QVERIFY(opened);
- f.write(QString("testing that remove/exists work...").toLatin1());
+ f.write("testing that remove/exists work...");
f.close();
QVERIFY(f.exists());
@@ -2165,7 +2218,7 @@ void tst_QFile::removeOpenFile()
QVERIFY(!f.exists());
bool opened = f.open(QIODevice::WriteOnly);
QVERIFY(opened);
- f.write(QString("testing that remove closes the file first...").toLatin1());
+ f.write("testing that remove closes the file first...");
bool removed = f.remove(); // remove should both close and remove the file
QVERIFY(removed);
@@ -2184,7 +2237,7 @@ void tst_QFile::removeOpenFile()
QVERIFY(!f.exists());
bool opened = f.open(QIODevice::WriteOnly);
QVERIFY(opened);
- f.write(QString("testing that remove closes the file first...").toLatin1());
+ f.write("testing that remove closes the file first...");
f.close();
}
@@ -2208,7 +2261,7 @@ void tst_QFile::fullDisk()
if (!file.exists())
QSKIP("/dev/full doesn't exist on this system");
- QVERIFY(file.open(QIODevice::WriteOnly));
+ QVERIFY2(file.open(QIODevice::WriteOnly), msgOpenFailed(file).constData());
file.write("foobar", 6);
QVERIFY(!file.flush());
@@ -2235,7 +2288,7 @@ void tst_QFile::fullDisk()
QCOMPARE(file.error(), QFile::NoError);
// try again without flush:
- QVERIFY(file.open(QIODevice::WriteOnly));
+ QVERIFY2(file.open(QIODevice::WriteOnly), msgOpenFailed(file).constData());
file.write("foobar", 6);
file.close();
QVERIFY(file.error() != QFile::NoError);
@@ -2288,8 +2341,7 @@ void tst_QFile::writeLargeDataBlock()
{
QFile file(fileName);
- QVERIFY2( openFile(file, QIODevice::WriteOnly, (FileType)type),
- qPrintable(QString("Couldn't open file for writing: [%1]").arg(fileName)) );
+ QVERIFY2(openFile(file, QIODevice::WriteOnly, (FileType)type), msgOpenFailed(file));
qint64 fileWriteOriginalData = file.write(originalData);
qint64 originalDataSize = (qint64)originalData.size();
#if defined(Q_OS_WIN)
@@ -2332,7 +2384,7 @@ void tst_QFile::writeLargeDataBlock()
void tst_QFile::readFromWriteOnlyFile()
{
QFile file("writeonlyfile");
- QVERIFY(file.open(QFile::WriteOnly));
+ QVERIFY2(file.open(QFile::WriteOnly), msgOpenFailed(file).constData());
char c;
QTest::ignoreMessage(QtWarningMsg, "QIODevice::read (QFile, \"writeonlyfile\"): WriteOnly device");
QCOMPARE(file.read(&c, 1), qint64(-1));
@@ -2341,7 +2393,7 @@ void tst_QFile::readFromWriteOnlyFile()
void tst_QFile::writeToReadOnlyFile()
{
QFile file("readonlyfile");
- QVERIFY(file.open(QFile::ReadOnly));
+ QVERIFY2(file.open(QFile::ReadOnly), msgOpenFailed(file).constData());
char c = 0;
QTest::ignoreMessage(QtWarningMsg, "QIODevice::write (QFile, \"readonlyfile\"): ReadOnly device");
QCOMPARE(file.write(&c, 1), qint64(-1));
@@ -2363,13 +2415,13 @@ void tst_QFile::virtualFile()
// consistency check
QFileInfo fi(fname);
- QVERIFY(fi.exists());
+ QVERIFY2(fi.exists(), msgFileDoesNotExist(fname).constData());
QVERIFY(fi.isFile());
QCOMPARE(fi.size(), Q_INT64_C(0));
// open the file
QFile f(fname);
- QVERIFY(f.open(QIODevice::ReadOnly));
+ QVERIFY2(f.open(QIODevice::ReadOnly), msgOpenFailed(f).constData());
QCOMPARE(f.size(), Q_INT64_C(0));
QVERIFY(f.atEnd());
@@ -2413,7 +2465,7 @@ void tst_QFile::textFile()
::fclose(fs);
QFile file("writeabletextfile");
- QVERIFY(file.open(QIODevice::ReadOnly));
+ QVERIFY2(file.open(QIODevice::ReadOnly), msgOpenFailed(file).constData());
QByteArray data = file.readAll();
@@ -2543,8 +2595,8 @@ void tst_QFile::renameMultiple()
// create the file if it doesn't exist
QFile file("file-to-be-renamed.txt");
QFile file2("existing-file.txt");
- QVERIFY(file.open(QIODevice::ReadWrite) && "(test-precondition)");
- QVERIFY(file2.open(QIODevice::ReadWrite) && "(test-precondition)");
+ QVERIFY2(file.open(QIODevice::ReadWrite), msgOpenFailed(file).constData());
+ QVERIFY2(file2.open(QIODevice::ReadWrite), msgOpenFailed(file2).constData());
// any stale files from previous test failures?
QFile::remove("file-renamed-once.txt");
@@ -2583,10 +2635,10 @@ void tst_QFile::renameMultiple()
void tst_QFile::appendAndRead()
{
QFile writeFile(QLatin1String("appendfile.txt"));
- QVERIFY(writeFile.open(QIODevice::WriteOnly | QIODevice::Truncate));
+ QVERIFY2(writeFile.open(QIODevice::WriteOnly | QIODevice::Truncate), msgOpenFailed(writeFile).constData());
QFile readFile(QLatin1String("appendfile.txt"));
- QVERIFY(readFile.open(QIODevice::ReadOnly));
+ 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) {
@@ -2612,11 +2664,13 @@ void tst_QFile::miscWithUncPathAsCurrentDir()
{
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
QString current = QDir::currentPath();
- QVERIFY(QDir::setCurrent("//" + QtNetworkSettings::winServerName() + "/testshare"));
+ const QString path = QLatin1String("//") + QtNetworkSettings::winServerName()
+ + QLatin1String("/testshare");
+ QVERIFY2(QDir::setCurrent(path), qPrintable(QDir::toNativeSeparators(path)));
QFile file("test.pri");
- QVERIFY(file.exists());
+ QVERIFY2(file.exists(), msgFileDoesNotExist(file.fileName()).constData());
QCOMPARE(int(file.size()), 34);
- QVERIFY(file.open(QIODevice::ReadOnly));
+ QVERIFY2(file.open(QIODevice::ReadOnly), msgOpenFailed(file).constData());
QVERIFY(QDir::setCurrent(current));
#endif
}
@@ -2634,7 +2688,7 @@ void tst_QFile::handle()
int fd;
#if !defined(Q_OS_WINCE)
QFile file(m_testSourceFile);
- QVERIFY(file.open(QIODevice::ReadOnly));
+ QVERIFY2(file.open(QIODevice::ReadOnly), msgOpenFailed(file).constData());
fd = int(file.handle());
QVERIFY(fd > 2);
QCOMPARE(int(file.handle()), fd);
@@ -2648,7 +2702,7 @@ void tst_QFile::handle()
// same, but read from QFile first now
file.close();
- QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Unbuffered));
+ QVERIFY2(file.open(QIODevice::ReadOnly | QIODevice::Unbuffered), msgOpenFailed(file).constData());
fd = int(file.handle());
QVERIFY(fd > 2);
QVERIFY(file.getChar(&c));
@@ -2690,7 +2744,7 @@ void tst_QFile::nativeHandleLeaks()
{
QFile file("qt_file.tmp");
- QVERIFY( file.open(QIODevice::ReadWrite) );
+ QVERIFY2(file.open(QIODevice::ReadWrite), msgOpenFailed(file).constData());
fd1 = file.handle();
QVERIFY( -1 != fd1 );
@@ -2709,7 +2763,7 @@ void tst_QFile::nativeHandleLeaks()
{
QFile file("qt_file.tmp");
- QVERIFY( file.open(QIODevice::ReadOnly) );
+ QVERIFY2(file.open(QIODevice::ReadOnly), msgOpenFailed(file).constData());
fd2 = file.handle();
QVERIFY( -1 != fd2 );
@@ -2755,7 +2809,7 @@ void tst_QFile::readEof()
{
QFile file(filename);
- QVERIFY(file.open(QIODevice::ReadOnly | mode));
+ QVERIFY2(file.open(QIODevice::ReadOnly | mode), msgOpenFailed(file).constData());
bool isSequential = file.isSequential();
if (!isSequential) {
QVERIFY(file.seek(245));
@@ -2777,7 +2831,7 @@ void tst_QFile::readEof()
{
QFile file(filename);
- QVERIFY(file.open(QIODevice::ReadOnly | mode));
+ QVERIFY2(file.open(QIODevice::ReadOnly | mode), msgOpenFailed(file).constData());
bool isSequential = file.isSequential();
if (!isSequential) {
QVERIFY(file.seek(245));
@@ -2798,7 +2852,7 @@ void tst_QFile::readEof()
{
QFile file(filename);
- QVERIFY(file.open(QIODevice::ReadOnly | mode));
+ QVERIFY2(file.open(QIODevice::ReadOnly | mode), msgOpenFailed(file).constData());
bool isSequential = file.isSequential();
if (!isSequential) {
QVERIFY(file.seek(245));
@@ -2820,7 +2874,7 @@ void tst_QFile::readEof()
{
QFile file(filename);
- QVERIFY(file.open(QIODevice::ReadOnly | mode));
+ QVERIFY2(file.open(QIODevice::ReadOnly | mode), msgOpenFailed(file).constData());
bool isSequential = file.isSequential();
if (!isSequential) {
QVERIFY(file.seek(245));
@@ -2841,7 +2895,7 @@ void tst_QFile::readEof()
{
QFile file(filename);
- QVERIFY(file.open(QIODevice::ReadOnly | mode));
+ QVERIFY2(file.open(QIODevice::ReadOnly | mode), msgOpenFailed(file).constData());
bool isSequential = file.isSequential();
if (!isSequential) {
QVERIFY(file.seek(245));
@@ -2867,7 +2921,7 @@ void tst_QFile::posAfterFailedStat()
QFile::remove("tmp.txt");
QFile file("tmp.txt");
QVERIFY(!file.exists());
- QVERIFY(file.open(QIODevice::Append));
+ QVERIFY2(file.open(QIODevice::Append), msgOpenFailed(file).constData());
QVERIFY(file.exists());
file.write("qt430", 5);
QVERIFY(!file.isSequential());
@@ -2922,11 +2976,11 @@ void tst_QFile::map()
QCOMPARE(file.error(), QFile::PermissionsError);
// make a file
- QVERIFY(file.open(QFile::ReadWrite));
+ QVERIFY2(file.open(QFile::ReadWrite), msgOpenFailed(file).constData());
QVERIFY(file.resize(fileSize));
QVERIFY(file.flush());
file.close();
- QVERIFY(file.open(QFile::ReadWrite));
+ QVERIFY2(file.open(QFile::ReadWrite), msgOpenFailed(file).constData());
memory = file.map(offset, size);
if (error != QFile::NoError) {
QVERIFY(file.error() != QFile::NoError);
@@ -3061,13 +3115,14 @@ void tst_QFile::mapOpenMode()
QFile file(fileName);
// make a file
- QVERIFY(file.open(QFile::ReadWrite));
+ QVERIFY2(file.open(QFile::ReadWrite), msgOpenFailed(file).constData());
QVERIFY(file.write(pattern));
QVERIFY(file.flush());
file.close();
// open according to our mode
- QVERIFY(file.open(QIODevice::OpenMode(openMode)));
+ const QIODevice::OpenMode om(openMode);
+ QVERIFY2(file.open(om), msgOpenFailed(om, file).constData());
uchar *memory = file.map(0, fileSize, QFileDevice::MemoryMapFlags(flags));
#if defined(Q_OS_WINCE)
@@ -3116,7 +3171,8 @@ void tst_QFile::mapWrittenFile()
QFile::remove(fileName);
}
QFile file(fileName);
- QVERIFY(file.open(QIODevice::ReadWrite | QFile::OpenMode(mode)));
+ const QIODevice::OpenMode om = QIODevice::ReadWrite | QIODevice::OpenMode(mode);
+ QVERIFY2(file.open(om), msgOpenFailed(om, file).constData());
QCOMPARE(file.write(data, sizeof data), qint64(sizeof data));
if ((mode & QIODevice::Unbuffered) == 0)
file.flush();
@@ -3328,7 +3384,7 @@ void tst_QFile::caseSensitivity()
QString filename("File.txt");
{
QFile f(filename);
- QVERIFY(f.open(QIODevice::WriteOnly));
+ QVERIFY2(f.open(QIODevice::WriteOnly), msgOpenFailed(f));
QVERIFY(f.write(testData));
f.close();
}
diff --git a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro
index de99447404..571637be37 100644
--- a/tests/auto/corelib/io/qfileinfo/qfileinfo.pro
+++ b/tests/auto/corelib/io/qfileinfo/qfileinfo.pro
@@ -7,3 +7,5 @@ RESOURCES += qfileinfo.qrc \
win32:!wince:!winrt:LIBS += -ladvapi32 -lnetapi32
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+
+win32: CONFIG += insignificant_test # Crashes on Windows in release builds
diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
index 96ad78a666..210fdb5a12 100644
--- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
@@ -149,6 +149,25 @@ static QString seedAndTemplate()
qsrand(QDateTime::currentDateTimeUtc().toTime_t());
return QDir::tempPath() + "/tst_qfileinfo-XXXXXX";
}
+
+static QByteArray msgDoesNotExist(const QString &name)
+{
+ return (QLatin1Char('"') + QDir::toNativeSeparators(name)
+ + QLatin1String("\" does not exist.")).toLocal8Bit();
+}
+
+static QByteArray msgIsNoDirectory(const QString &name)
+{
+ return (QLatin1Char('"') + QDir::toNativeSeparators(name)
+ + QLatin1String("\" is not a directory.")).toLocal8Bit();
+}
+
+static QByteArray msgIsNotRoot(const QString &name)
+{
+ return (QLatin1Char('"') + QDir::toNativeSeparators(name)
+ + QLatin1String("\" is no root directory.")).toLocal8Bit();
+}
+
class tst_QFileInfo : public QObject
{
Q_OBJECT
@@ -287,7 +306,8 @@ void tst_QFileInfo::initTestCase()
m_resourcesDir = dataPath + QLatin1String("/resources");
m_proFile = dataPath + QLatin1String("/tst_qfileinfo.pro");
- QVERIFY(m_dir.isValid());
+ QVERIFY2(m_dir.isValid(),
+ ("Failed to create temporary dir: " + m_dir.errorString()).toUtf8());
QVERIFY(QDir::setCurrent(m_dir.path()));
}
@@ -316,7 +336,7 @@ static QFileInfoPrivate* getPrivate(QFileInfo &info)
void tst_QFileInfo::copy()
{
QTemporaryFile t;
- t.open();
+ QVERIFY2(t.open(), qPrintable(t.errorString()));
QFileInfo info(t.fileName());
QVERIFY(info.exists());
@@ -413,13 +433,14 @@ void tst_QFileInfo::isDir_data()
//QTest::newRow("drive 2") << "t:s" << false;
#endif
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
- QTest::newRow("unc 1") << "//" + QtNetworkSettings::winServerName() << true;
- QTest::newRow("unc 2") << "//" + QtNetworkSettings::winServerName() + "/" << true;
- QTest::newRow("unc 3") << "//" + QtNetworkSettings::winServerName() + "/testshare" << true;
- QTest::newRow("unc 4") << "//" + QtNetworkSettings::winServerName() + "/testshare/" << true;
- QTest::newRow("unc 5") << "//" + QtNetworkSettings::winServerName() + "/testshare/tmp" << true;
- QTest::newRow("unc 6") << "//" + QtNetworkSettings::winServerName() + "/testshare/tmp/" << true;
- QTest::newRow("unc 7") << "//" + QtNetworkSettings::winServerName() + "/testshare/adirthatshouldnotexist" << false;
+ const QString uncRoot = QStringLiteral("//") + QtNetworkSettings::winServerName();
+ QTest::newRow("unc 1") << uncRoot << true;
+ QTest::newRow("unc 2") << uncRoot + QLatin1Char('/') << true;
+ QTest::newRow("unc 3") << uncRoot + "/testshare" << true;
+ QTest::newRow("unc 4") << uncRoot + "/testshare/" << true;
+ QTest::newRow("unc 5") << uncRoot + "/testshare/tmp" << true;
+ QTest::newRow("unc 6") << uncRoot + "/testshare/tmp/" << true;
+ QTest::newRow("unc 7") << uncRoot + "/testshare/adirthatshouldnotexist" << false;
#endif
}
@@ -428,8 +449,11 @@ void tst_QFileInfo::isDir()
QFETCH(QString, path);
QFETCH(bool, expected);
- QFileInfo fi(path);
- QCOMPARE(fi.isDir(), expected);
+ const bool isDir = QFileInfo(path).isDir();
+ if (expected)
+ QVERIFY2(isDir, msgIsNoDirectory(path).constData());
+ else
+ QVERIFY(!isDir);
}
void tst_QFileInfo::isRoot_data()
@@ -452,10 +476,11 @@ void tst_QFileInfo::isRoot_data()
#endif
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
- QTest::newRow("unc 1") << "//" + QtNetworkSettings::winServerName() << true;
- QTest::newRow("unc 2") << "//" + QtNetworkSettings::winServerName() + "/" << true;
- QTest::newRow("unc 3") << "//" + QtNetworkSettings::winServerName() + "/testshare" << false;
- QTest::newRow("unc 4") << "//" + QtNetworkSettings::winServerName() + "/testshare/" << false;
+ const QString uncRoot = QStringLiteral("//") + QtNetworkSettings::winServerName();
+ QTest::newRow("unc 1") << uncRoot << true;
+ QTest::newRow("unc 2") << uncRoot + QLatin1Char('/') << true;
+ QTest::newRow("unc 3") << uncRoot + "/testshare" << false;
+ QTest::newRow("unc 4") << uncRoot + "/testshare/" << false;
QTest::newRow("unc 7") << "//ahostthatshouldnotexist" << false;
#endif
}
@@ -465,8 +490,11 @@ void tst_QFileInfo::isRoot()
QFETCH(QString, path);
QFETCH(bool, expected);
- QFileInfo fi(path);
- QCOMPARE(fi.isRoot(), expected);
+ const bool isRoot = QFileInfo(path).isRoot();
+ if (expected)
+ QVERIFY2(isRoot, msgIsNotRoot(path).constData());
+ else
+ QVERIFY(!isRoot);
}
void tst_QFileInfo::exists_data()
@@ -492,14 +520,15 @@ void tst_QFileInfo::exists_data()
QTest::newRow("simple dir with slash") << (m_resourcesDir + QLatin1Char('/')) << true;
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
- QTest::newRow("unc 1") << "//" + QtNetworkSettings::winServerName() << true;
- QTest::newRow("unc 2") << "//" + QtNetworkSettings::winServerName() + "/" << true;
- QTest::newRow("unc 3") << "//" + QtNetworkSettings::winServerName() + "/testshare" << true;
- QTest::newRow("unc 4") << "//" + QtNetworkSettings::winServerName() + "/testshare/" << true;
- QTest::newRow("unc 5") << "//" + QtNetworkSettings::winServerName() + "/testshare/tmp" << true;
- QTest::newRow("unc 6") << "//" + QtNetworkSettings::winServerName() + "/testshare/tmp/" << true;
- QTest::newRow("unc 7") << "//" + QtNetworkSettings::winServerName() + "/testshare/adirthatshouldnotexist" << false;
- QTest::newRow("unc 8") << "//" + QtNetworkSettings::winServerName() + "/asharethatshouldnotexist" << false;
+ const QString uncRoot = QStringLiteral("//") + QtNetworkSettings::winServerName();
+ QTest::newRow("unc 1") << uncRoot << true;
+ QTest::newRow("unc 2") << uncRoot + QLatin1Char('/') << true;
+ QTest::newRow("unc 3") << uncRoot + "/testshare" << true;
+ QTest::newRow("unc 4") << uncRoot + "/testshare/" << true;
+ QTest::newRow("unc 5") << uncRoot + "/testshare/tmp" << true;
+ QTest::newRow("unc 6") << uncRoot + "/testshare/tmp/" << true;
+ QTest::newRow("unc 7") << uncRoot + "/testshare/adirthatshouldnotexist" << false;
+ QTest::newRow("unc 8") << uncRoot + "/asharethatshouldnotexist" << false;
QTest::newRow("unc 9") << "//ahostthatshouldnotexist" << false;
#endif
}
@@ -510,8 +539,12 @@ void tst_QFileInfo::exists()
QFETCH(bool, expected);
QFileInfo fi(path);
- QCOMPARE(fi.exists(), expected);
- QCOMPARE(QFileInfo::exists(path), expected);
+ const bool exists = fi.exists();
+ QCOMPARE(exists, QFileInfo::exists(path));
+ if (expected)
+ QVERIFY2(exists, msgDoesNotExist(path).constData());
+ else
+ QVERIFY(!exists);
}
void tst_QFileInfo::absolutePath_data()
@@ -611,7 +644,7 @@ void tst_QFileInfo::canonicalPath()
{
QTemporaryFile tempFile;
tempFile.setAutoRemove(true);
- tempFile.open();
+ QVERIFY2(tempFile.open(), qPrintable(tempFile.errorString()));
QFileInfo fi(tempFile.fileName());
QCOMPARE(fi.canonicalPath(), QFileInfo(QDir::tempPath()).canonicalFilePath());
}
@@ -993,7 +1026,7 @@ void tst_QFileInfo::systemFiles()
QSKIP("This is a Windows only test");
#endif
QFileInfo fi("c:\\pagefile.sys");
- QVERIFY(fi.exists());
+ QVERIFY2(fi.exists(), msgDoesNotExist(fi.absoluteFilePath()).constData());
QVERIFY(fi.size() > 0);
QVERIFY(fi.lastModified().isValid());
}
@@ -1478,7 +1511,7 @@ void tst_QFileInfo::ntfsJunctionPointsAndSymlinks_data()
QTest::newRow("dummy") << target.path() << false << "" << target.canonicalPath();
QSKIP("link not supported by FS or insufficient privilege");
}
- QVERIFY(file.exists());
+ QVERIFY2(file.exists(), msgDoesNotExist(file.fileName()).constData());
QTest::newRow("absolute dir symlink") << absSymlink << true << QDir::fromNativeSeparators(absTarget) << target.canonicalPath();
QTest::newRow("relative dir symlink") << relSymlink << true << QDir::fromNativeSeparators(relTarget) << target.canonicalPath();
@@ -1509,7 +1542,7 @@ void tst_QFileInfo::ntfsJunctionPointsAndSymlinks_data()
QFile file(fileInJunction.absoluteFilePath());
file.open(QIODevice::ReadWrite);
file.close();
- QVERIFY(file.exists());
+ QVERIFY2(file.exists(), msgDoesNotExist(file.fileName()).constData());
QTest::newRow("file in junction") << fileInJunction.absoluteFilePath() << false << "" << fileInJunction.canonicalFilePath();
target = QDir::rootPath();
@@ -1601,7 +1634,7 @@ void tst_QFileInfo::isWritable()
#else
QFileInfo fi("c:\\pagefile.sys");
#endif
- QVERIFY(fi.exists());
+ QVERIFY2(fi.exists(), msgDoesNotExist(fi.absoluteFilePath()).constData());
QVERIFY(!fi.isWritable());
#endif
#if defined (Q_OS_QNX) // On QNX /etc is usually on a read-only filesystem
@@ -1859,7 +1892,7 @@ void tst_QFileInfo::owner()
QVERIFY(testFile.write(testData) != -1);
}
QFileInfo fi(fileName);
- QVERIFY(fi.exists());
+ QVERIFY2(fi.exists(), msgDoesNotExist(fi.absoluteFilePath()).constData());
QCOMPARE(fi.owner(), userName);
QFile::remove(fileName);
@@ -1894,7 +1927,7 @@ void tst_QFileInfo::group()
QVERIFY(testFile.write(testData) != -1);
testFile.close();
QFileInfo fi(fileName);
- QVERIFY(fi.exists());
+ QVERIFY2(fi.exists(), msgDoesNotExist(fi.absoluteFilePath()).constData());
QCOMPARE(fi.group(), expected);
}
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+haiku/test b/tests/auto/corelib/io/qfileselector/platforms/+haiku/test
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+haiku/test
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+haiku/test2 b/tests/auto/corelib/io/qfileselector/platforms/+haiku/test2
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+haiku/test2
diff --git a/tests/auto/corelib/io/qfileselector/platforms/+unix/+haiku/test b/tests/auto/corelib/io/qfileselector/platforms/+unix/+haiku/test
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/io/qfileselector/platforms/+unix/+haiku/test
diff --git a/tests/auto/corelib/io/qfileselector/qfileselector.qrc b/tests/auto/corelib/io/qfileselector/qfileselector.qrc
index 661647f933..6e2699774d 100644
--- a/tests/auto/corelib/io/qfileselector/qfileselector.qrc
+++ b/tests/auto/corelib/io/qfileselector/qfileselector.qrc
@@ -19,6 +19,7 @@
<file>platforms/+unix/+darwin/+mac/+osx/test</file>
<file>platforms/+unix/+darwin/+mac/test</file>
<file>platforms/+unix/+darwin/test</file>
+ <file>platforms/+unix/+haiku/test</file>
<file>platforms/+unix/+linux/test</file>
<file>platforms/+unix/test</file>
<file>platforms/+windows/+wince/test</file>
@@ -30,6 +31,7 @@
<file>platforms/+osx/test</file>
<file>platforms/+darwin/test</file>
<file>platforms/+mac/test</file>
+ <file>platforms/+haiku/test</file>
<file>platforms/+linux/test</file>
<file>platforms/+wince/test</file>
@@ -39,6 +41,7 @@
<file>platforms/+blackberry/test2</file>
<file>platforms/+ios/test2</file>
<file>platforms/+osx/test2</file>
+ <file>platforms/+haiku/test2</file>
<file>platforms/+linux/test2</file>
<file>platforms/+wince/test2</file>
<file>platforms/+winnt/test2</file>
diff --git a/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp b/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp
index b3767b4887..87381f4c4e 100644
--- a/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp
+++ b/tests/auto/corelib/io/qfileselector/tst_qfileselector.cpp
@@ -89,7 +89,7 @@ void tst_QFileSelector::basicTest_data()
QString expectedPlatform2File(""); //Only the last selector
QString expectedPlatform3File; // Only the first selector (the family)
#if defined(Q_OS_UNIX) && !defined(Q_OS_ANDROID) && !defined(Q_OS_BLACKBERRY) && \
- !defined(Q_OS_DARWIN) && !defined(Q_OS_LINUX)
+ !defined(Q_OS_DARWIN) && !defined(Q_OS_LINUX) && !defined(Q_OS_HAIKU)
/* We are only aware of specific unixes, and do not have test files for any of the others.
However those unixes can get a selector added from the result of a uname call, so this will
lead to a case where we don't have that file so we can't expect the concatenation of platform
diff --git a/tests/auto/corelib/io/qfilesystemwatcher/BLACKLIST b/tests/auto/corelib/io/qfilesystemwatcher/BLACKLIST
index 3ac0b9dff4..90b714758a 100644
--- a/tests/auto/corelib/io/qfilesystemwatcher/BLACKLIST
+++ b/tests/auto/corelib/io/qfilesystemwatcher/BLACKLIST
@@ -1,8 +1,9 @@
# QTBUG-33574 QTBUG-30943
[signalsEmittedAfterFileMoved]
-windows 32bit msvc-2010
-windows 64bit msvc
+windows
[watchFileAndItsDirectory:native backend-testfile]
osx
+windows
[watchFileAndItsDirectory:native backend-specialchars]
osx
+windows
diff --git a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
index 7e56ecaab3..026743257c 100644
--- a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
+++ b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
@@ -126,7 +126,7 @@ void tst_QFileSystemWatcher::basicTest()
// create test file
QTemporaryDir temporaryDirectory(m_tempDirPattern);
- QVERIFY(temporaryDirectory.isValid());
+ QVERIFY2(temporaryDirectory.isValid(), qPrintable(temporaryDirectory.errorString()));
QFile testFile(temporaryDirectory.path() + QLatin1Char('/') + testFileName);
QVERIFY(testFile.open(QIODevice::WriteOnly | QIODevice::Truncate));
testFile.write(QByteArray("hello"));
@@ -263,7 +263,7 @@ void tst_QFileSystemWatcher::watchDirectory()
QFETCH(QString, backend);
QTemporaryDir temporaryDirectory(m_tempDirPattern);
- QVERIFY(temporaryDirectory.isValid());
+ QVERIFY2(temporaryDirectory.isValid(), qPrintable(temporaryDirectory.errorString()));
QDir temporaryDir(temporaryDirectory.path());
const QString testDirName = QStringLiteral("testDir");
@@ -498,7 +498,7 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory()
QFETCH(QString, backend);
QTemporaryDir temporaryDirectory(m_tempDirPattern);
- QVERIFY(temporaryDirectory.isValid());
+ QVERIFY2(temporaryDirectory.isValid(), qPrintable(temporaryDirectory.errorString()));
QDir temporaryDir(temporaryDirectory.path());
const QString testDirName = QStringLiteral("testDir");
@@ -553,7 +553,7 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory()
timer.start(3000);
eventLoop.exec();
int fileChangedSpyCount = fileChangedSpy.count();
-#ifdef Q_OS_WIN64
+#ifdef Q_OS_WIN
if (fileChangedSpyCount != 0)
QEXPECT_FAIL("", "See QTBUG-30943", Continue);
#endif
@@ -605,7 +605,7 @@ void tst_QFileSystemWatcher::nonExistingFile()
void tst_QFileSystemWatcher::removeFileAndUnWatch()
{
QTemporaryDir temporaryDirectory(m_tempDirPattern);
- QVERIFY(temporaryDirectory.isValid());
+ QVERIFY2(temporaryDirectory.isValid(), qPrintable(temporaryDirectory.errorString()));
const QString filename = temporaryDirectory.path() + QStringLiteral("/foo.txt");
@@ -664,7 +664,7 @@ void tst_QFileSystemWatcher::QTBUG2331()
QFETCH(QString, backend);
QTemporaryDir temporaryDirectory(m_tempDirPattern);
- QVERIFY(temporaryDirectory.isValid());
+ QVERIFY2(temporaryDirectory.isValid(), qPrintable(temporaryDirectory.errorString()));
QFileSystemWatcher watcher;
watcher.setObjectName(QLatin1String("_qt_autotest_force_engine_") + backend);
QVERIFY(watcher.addPath(temporaryDirectory.path()));
@@ -724,7 +724,8 @@ void tst_QFileSystemWatcher::signalsEmittedAfterFileMoved()
{
const int fileCount = 10;
QTemporaryDir temporaryDirectory(m_tempDirPattern);
- QVERIFY(temporaryDirectory.isValid());
+ QVERIFY2(temporaryDirectory.isValid(), qPrintable(temporaryDirectory.errorString()));
+
QDir testDir(temporaryDirectory.path());
QVERIFY(testDir.mkdir("movehere"));
QString movePath = testDir.filePath("movehere");
diff --git a/tests/auto/corelib/io/qiodevice/BLACKLIST b/tests/auto/corelib/io/qiodevice/BLACKLIST
new file mode 100644
index 0000000000..b8a61d3ca9
--- /dev/null
+++ b/tests/auto/corelib/io/qiodevice/BLACKLIST
@@ -0,0 +1,2 @@
+[unget]
+redhatenterpriselinuxworkstation-6.6
diff --git a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
index af79de06d5..f637ffcfc5 100644
--- a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
+++ b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
@@ -59,6 +59,7 @@ private slots:
void peekBug();
void readAllKeepPosition();
+ void writeInTextMode();
};
void tst_QIODevice::initTestCase()
@@ -627,5 +628,45 @@ void tst_QIODevice::readAllKeepPosition()
QCOMPARE(resultArray, buffer.buffer());
}
+class RandomAccessBuffer : public QIODevice
+{
+public:
+ RandomAccessBuffer(const char *data) : QIODevice(), buf(data) { }
+
+protected:
+ qint64 readData(char *data, qint64 maxSize) Q_DECL_OVERRIDE
+ {
+ maxSize = qMin(maxSize, qint64(buf.size() - pos()));
+ memcpy(data, buf.constData() + pos(), maxSize);
+ return maxSize;
+ }
+ qint64 writeData(const char *data, qint64 maxSize) Q_DECL_OVERRIDE
+ {
+ maxSize = qMin(maxSize, qint64(buf.size() - pos()));
+ memcpy(buf.data() + pos(), data, maxSize);
+ return maxSize;
+ }
+
+private:
+ QByteArray buf;
+};
+
+// Test write() on skipping correct number of bytes in read buffer
+void tst_QIODevice::writeInTextMode()
+{
+ // Unlike other platforms, Windows implementation expands '\n' into
+ // "\r\n" sequence in write(). Ensure that write() properly works with
+ // a read buffer on random-access devices.
+#ifndef Q_OS_WIN
+ QSKIP("This is a Windows-only test");
+#else
+ RandomAccessBuffer buffer("one\r\ntwo\r\nthree\r\n");
+ buffer.open(QBuffer::ReadWrite | QBuffer::Text);
+ QCOMPARE(buffer.readLine(), QByteArray("one\n"));
+ QCOMPARE(buffer.write("two\n"), 4);
+ QCOMPARE(buffer.readLine(), QByteArray("three\n"));
+#endif
+}
+
QTEST_MAIN(tst_QIODevice)
#include "tst_qiodevice.moc"
diff --git a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
index 27614e0eb8..21c5696d1d 100644
--- a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
+++ b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
@@ -80,6 +80,7 @@ void tst_QLockFile::initTestCase()
#elif defined(QT_NO_PROCESS)
QSKIP("This test requires QProcess support");
#else
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
// chdir to our testdata path and execute helper apps relative to that.
QString testdata_dir = QFileInfo(QFINDTESTDATA("qlockfiletesthelper")).absolutePath();
QVERIFY2(QDir::setCurrent(testdata_dir), qPrintable("Could not chdir to " + testdata_dir));
diff --git a/tests/auto/corelib/io/qprocess/BLACKLIST b/tests/auto/corelib/io/qprocess/BLACKLIST
new file mode 100644
index 0000000000..216faa7fb4
--- /dev/null
+++ b/tests/auto/corelib/io/qprocess/BLACKLIST
@@ -0,0 +1,5 @@
+[lockupsInStartDetached]
+redhatenterpriselinuxworkstation-6.6
+# QTBUG-48455
+[fileWriterProcess]
+msvc-2015
diff --git a/tests/auto/corelib/io/qprocess/fileWriterProcess/main.cpp b/tests/auto/corelib/io/qprocess/fileWriterProcess/main.cpp
index 411c7e334b..25cb66f9d2 100644
--- a/tests/auto/corelib/io/qprocess/fileWriterProcess/main.cpp
+++ b/tests/auto/corelib/io/qprocess/fileWriterProcess/main.cpp
@@ -33,20 +33,26 @@
#include <QCoreApplication>
#include <QFile>
+#include <stdio.h>
+
int main(int argc, char **argv)
{
QCoreApplication ca(argc, argv);
QFile f;
f.open(stdin, QIODevice::ReadOnly);
- QString input;
+ QByteArray input;
char buf[1024];
qint64 len;
while ((len = f.read(buf, 1024)) > 0)
- input += QByteArray(buf, len);
+ input.append(buf, len);
f.close();
QFile f2("fileWriterProcess.txt");
- f2.open(QIODevice::WriteOnly | QIODevice::Truncate);
- f2.write(input.toLatin1());
+ if (!f2.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
+ fprintf(stderr, "Cannot open %s for writing: %s\n",
+ qPrintable(f2.fileName()), qPrintable(f2.errorString()));
+ return 1;
+ }
+ f2.write(input);
f2.close();
return 0;
}
diff --git a/tests/auto/corelib/io/qprocess/testDetached/main.cpp b/tests/auto/corelib/io/qprocess/testDetached/main.cpp
index bbcc7033c7..760306ea17 100644
--- a/tests/auto/corelib/io/qprocess/testDetached/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testDetached/main.cpp
@@ -57,7 +57,8 @@ int main(int argc, char **argv)
QFile f(args.at(1));
if (!f.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) {
- fprintf(stderr, "Cannot open %s for writing", qPrintable(f.fileName()));
+ fprintf(stderr, "Cannot open %s for writing: %s\n",
+ qPrintable(f.fileName()), qPrintable(f.errorString()));
return 1;
}
diff --git a/tests/auto/corelib/io/qprocess/testExitCodes/main.cpp b/tests/auto/corelib/io/qprocess/testExitCodes/main.cpp
index c92d7f515f..c3cf9f56c7 100644
--- a/tests/auto/corelib/io/qprocess/testExitCodes/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testExitCodes/main.cpp
@@ -33,8 +33,8 @@
#include <stdlib.h>
-int main(int /* argc */, char **argv)
+int main(int argc, char **argv)
{
- return atoi(argv[1]);
+ return argc >= 2 ? atoi(argv[1]) : -1;
}
diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
index 0995f764b7..712e3440d8 100644
--- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
+++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
@@ -38,6 +38,7 @@
#include <QtCore/QDir>
#include <QtCore/QFile>
#include <QtCore/QThread>
+#include <QtCore/QTemporaryDir>
#include <QtCore/QRegExp>
#include <QtCore/QDebug>
#include <QtCore/QMetaType>
@@ -54,13 +55,9 @@ Q_DECLARE_METATYPE(QProcess::ExitStatus);
Q_DECLARE_METATYPE(QProcess::ProcessState);
#endif
-#define QPROCESS_VERIFY(Process, Fn) \
-{ \
-const bool ret = Process.Fn; \
-if (ret == false) \
- qWarning("QProcess error: %d: %s", Process.error(), qPrintable(Process.errorString())); \
-QVERIFY(ret); \
-}
+typedef void (QProcess::*QProcessFinishedSignal1)(int);
+typedef void (QProcess::*QProcessFinishedSignal2)(int, QProcess::ExitStatus);
+typedef void (QProcess::*QProcessErrorSignal)(QProcess::ProcessError);
class tst_QProcess : public QObject
{
@@ -69,6 +66,7 @@ class tst_QProcess : public QObject
public slots:
void initTestCase();
void cleanupTestCase();
+ void init();
#ifndef QT_NO_PROCESS
private slots:
@@ -124,9 +122,9 @@ private slots:
void removeFileWhileProcessIsRunning();
void fileWriterProcess();
void switchReadChannels();
-#ifdef Q_OS_WIN
+ void discardUnwantedOutput();
void setWorkingDirectory();
-#endif // Q_OS_WIN
+ void setNonExistentWorkingDirectory();
#endif // not Q_OS_WINCE
void exitStatus_data();
@@ -174,8 +172,8 @@ protected slots:
#endif
private:
- QProcess *process;
qint64 bytesAvailable;
+ QTemporaryDir m_temporaryDir;
#endif //QT_NO_PROCESS
};
@@ -184,6 +182,7 @@ void tst_QProcess::initTestCase()
#ifdef QT_NO_PROCESS
QSKIP("This test requires QProcess support");
#else
+ QVERIFY2(m_temporaryDir.isValid(), qPrintable(m_temporaryDir.errorString()));
// chdir to our testdata path and execute helper apps relative to that.
QString testdata_dir = QFileInfo(QFINDTESTDATA("testProcessNormal")).absolutePath();
QVERIFY2(QDir::setCurrent(testdata_dir), qPrintable("Could not chdir to " + testdata_dir));
@@ -197,6 +196,11 @@ void tst_QProcess::cleanupTestCase()
#endif
}
+void tst_QProcess::init()
+{
+ bytesAvailable = 0;
+}
+
#ifndef QT_NO_PROCESS
// Testing get/set functions
@@ -220,7 +224,6 @@ void tst_QProcess::getSetCheck()
QCOMPARE(QProcess::ProcessChannel(QProcess::StandardError), obj1.readChannel());
}
-//-----------------------------------------------------------------------------
void tst_QProcess::constructing()
{
QProcess process;
@@ -258,10 +261,10 @@ void tst_QProcess::simpleStart()
{
qRegisterMetaType<QProcess::ProcessState>("QProcess::ProcessState");
- process = new QProcess;
- QSignalSpy spy(process, &QProcess::stateChanged);
+ QScopedPointer<QProcess> process(new QProcess);
+ QSignalSpy spy(process.data(), &QProcess::stateChanged);
QVERIFY(spy.isValid());
- connect(process, SIGNAL(readyRead()), this, SLOT(readFromProcess()));
+ connect(process.data(), &QIODevice::readyRead, this, &tst_QProcess::readFromProcess);
/* valgrind dislike SUID binaries(those that have the `s'-flag set), which
* makes it fail to start the process. For this reason utilities like `ping' won't
@@ -273,8 +276,7 @@ void tst_QProcess::simpleStart()
QCOMPARE(process->state(), QProcess::Running);
QTRY_COMPARE(process->state(), QProcess::NotRunning);
- delete process;
- process = 0;
+ process.reset();
QCOMPARE(spy.count(), 3);
QCOMPARE(qvariant_cast<QProcess::ProcessState>(spy.at(0).at(0)), QProcess::Starting);
@@ -282,7 +284,6 @@ void tst_QProcess::simpleStart()
QCOMPARE(qvariant_cast<QProcess::ProcessState>(spy.at(2).at(0)), QProcess::NotRunning);
}
-//-----------------------------------------------------------------------------
void tst_QProcess::startWithOpen()
{
QProcess p;
@@ -300,7 +301,6 @@ void tst_QProcess::startWithOpen()
QVERIFY(p.waitForFinished(5000));
}
-//-----------------------------------------------------------------------------
void tst_QProcess::startWithOldOpen()
{
// similar to the above, but we start with start() actually
@@ -319,7 +319,6 @@ void tst_QProcess::startWithOldOpen()
QVERIFY(p.waitForFinished(5000));
}
-//-----------------------------------------------------------------------------
void tst_QProcess::execute()
{
QCOMPARE(QProcess::execute("testProcessNormal/testProcessNormal",
@@ -327,34 +326,32 @@ void tst_QProcess::execute()
QCOMPARE(QProcess::execute("nonexistingexe"), -2);
}
-//-----------------------------------------------------------------------------
void tst_QProcess::startDetached()
{
- QProcess proc;
- QVERIFY(proc.startDetached("testProcessNormal/testProcessNormal",
- QStringList() << "arg1" << "arg2"));
+ QVERIFY(QProcess::startDetached("testProcessNormal/testProcessNormal",
+ QStringList() << "arg1" << "arg2"));
#ifdef QPROCESS_USE_SPAWN
QEXPECT_FAIL("", "QProcess cannot detect failure to start when using posix_spawn()", Continue);
#endif
QCOMPARE(QProcess::startDetached("nonexistingexe"), false);
}
-//-----------------------------------------------------------------------------
void tst_QProcess::readFromProcess()
{
+ QProcess *process = qobject_cast<QProcess *>(sender());
+ QVERIFY(process);
int lines = 0;
while (process->canReadLine()) {
++lines;
- QByteArray line = process->readLine();
+ process->readLine();
}
}
-//-----------------------------------------------------------------------------
void tst_QProcess::crashTest()
{
qRegisterMetaType<QProcess::ProcessState>("QProcess::ProcessState");
- process = new QProcess;
- QSignalSpy stateSpy(process, &QProcess::stateChanged);
+ QScopedPointer<QProcess> process(new QProcess);
+ QSignalSpy stateSpy(process.data(), &QProcess::stateChanged);
QVERIFY(stateSpy.isValid());
process->start("testProcessCrash/testProcessCrash");
QVERIFY(process->waitForStarted(5000));
@@ -362,11 +359,13 @@ void tst_QProcess::crashTest()
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus");
- QSignalSpy spy(process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error));
- QSignalSpy spy2(process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished));
+ QSignalSpy spy(process.data(), &QProcess::errorOccurred);
+ QSignalSpy spy2(process.data(), static_cast<QProcessErrorSignal>(&QProcess::error));
+ QSignalSpy spy3(process.data(), static_cast<QProcessFinishedSignal2>(&QProcess::finished));
QVERIFY(spy.isValid());
QVERIFY(spy2.isValid());
+ QVERIFY(spy3.isValid());
QVERIFY(process->waitForFinished(30000));
@@ -374,12 +373,15 @@ void tst_QProcess::crashTest()
QCOMPARE(*static_cast<const QProcess::ProcessError *>(spy.at(0).at(0).constData()), QProcess::Crashed);
QCOMPARE(spy2.count(), 1);
- QCOMPARE(*static_cast<const QProcess::ExitStatus *>(spy2.at(0).at(1).constData()), QProcess::CrashExit);
+ QCOMPARE(*static_cast<const QProcess::ProcessError *>(spy2.at(0).at(0).constData()), QProcess::Crashed);
+
+ QCOMPARE(spy3.count(), 1);
+ QCOMPARE(*static_cast<const QProcess::ExitStatus *>(spy3.at(0).at(1).constData()), QProcess::CrashExit);
QCOMPARE(process->exitStatus(), QProcess::CrashExit);
- delete process;
- process = 0;
+ // delete process;
+ process.reset();
QCOMPARE(stateSpy.count(), 3);
QCOMPARE(qvariant_cast<QProcess::ProcessState>(stateSpy.at(0).at(0)), QProcess::Starting);
@@ -387,23 +389,23 @@ void tst_QProcess::crashTest()
QCOMPARE(qvariant_cast<QProcess::ProcessState>(stateSpy.at(2).at(0)), QProcess::NotRunning);
}
-//-----------------------------------------------------------------------------
void tst_QProcess::crashTest2()
{
- process = new QProcess;
- process->start("testProcessCrash/testProcessCrash");
- QVERIFY(process->waitForStarted(5000));
+ QProcess process;
+ process.start("testProcessCrash/testProcessCrash");
+ QVERIFY(process.waitForStarted(5000));
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus");
- QSignalSpy spy(process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error));
- QSignalSpy spy2(process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished));
+ QSignalSpy spy(&process, static_cast<QProcessErrorSignal>(&QProcess::errorOccurred));
+ QSignalSpy spy2(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
QVERIFY(spy.isValid());
QVERIFY(spy2.isValid());
- QObject::connect(process, SIGNAL(finished(int)), this, SLOT(exitLoopSlot()));
+ QObject::connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished),
+ this, &tst_QProcess::exitLoopSlot);
QTestEventLoop::instance().enterLoop(30);
if (QTestEventLoop::instance().timeout())
@@ -415,15 +417,11 @@ void tst_QProcess::crashTest2()
QCOMPARE(spy2.count(), 1);
QCOMPARE(*static_cast<const QProcess::ExitStatus *>(spy2.at(0).at(1).constData()), QProcess::CrashExit);
- QCOMPARE(process->exitStatus(), QProcess::CrashExit);
-
- delete process;
- process = 0;
+ QCOMPARE(process.exitStatus(), QProcess::CrashExit);
}
#ifndef Q_OS_WINCE
//Reading and writing to a process is not supported on Qt/CE
-//-----------------------------------------------------------------------------
void tst_QProcess::echoTest_data()
{
QTest::addColumn<QByteArray>("input");
@@ -438,30 +436,28 @@ void tst_QProcess::echoTest_data()
QTest::newRow("10000 bytes") << QByteArray(10000, '@');
}
-//-----------------------------------------------------------------------------
-
void tst_QProcess::echoTest()
{
QFETCH(QByteArray, input);
- process = new QProcess;
- connect(process, SIGNAL(readyRead()), this, SLOT(exitLoopSlot()));
+ QProcess process;
+ connect(&process, &QIODevice::readyRead, this, &tst_QProcess::exitLoopSlot);
- process->start("testProcessEcho/testProcessEcho");
- QVERIFY(process->waitForStarted(5000));
+ process.start("testProcessEcho/testProcessEcho");
+ QVERIFY(process.waitForStarted(5000));
- process->write(input);
+ process.write(input);
QTime stopWatch;
stopWatch.start();
do {
- QVERIFY(process->isOpen());
+ QVERIFY(process.isOpen());
QTestEventLoop::instance().enterLoop(2);
- } while (stopWatch.elapsed() < 60000 && process->bytesAvailable() < input.size());
+ } while (stopWatch.elapsed() < 60000 && process.bytesAvailable() < input.size());
if (stopWatch.elapsed() >= 60000)
QFAIL("Timed out");
- QByteArray message = process->readAll();
+ QByteArray message = process.readAll();
QCOMPARE(message.size(), input.size());
char *c1 = message.data();
@@ -474,40 +470,35 @@ void tst_QProcess::echoTest()
}
QCOMPARE(*c1, *c2);
- process->write("", 1);
-
- QVERIFY(process->waitForFinished(5000));
-
+ process.write("", 1);
- delete process;
- process = 0;
+ QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
#endif
-//-----------------------------------------------------------------------------
void tst_QProcess::exitLoopSlot()
{
QTestEventLoop::instance().exitLoop();
}
-//-----------------------------------------------------------------------------
-
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::echoTest2()
{
- process = new QProcess;
- connect(process, SIGNAL(readyRead()), this, SLOT(exitLoopSlot()));
+ QProcess process;
+ connect(&process, &QIODevice::readyRead, this, &tst_QProcess::exitLoopSlot);
- process->start("testProcessEcho2/testProcessEcho2");
- QVERIFY(process->waitForStarted(5000));
- QVERIFY(!process->waitForReadyRead(250));
- QCOMPARE(process->error(), QProcess::Timedout);
+ process.start("testProcessEcho2/testProcessEcho2");
+ QVERIFY(process.waitForStarted(5000));
+ QVERIFY(!process.waitForReadyRead(250));
+ QCOMPARE(process.error(), QProcess::Timedout);
- process->write("Hello");
- QSignalSpy spy1(process, &QProcess::readyReadStandardOutput);
- QSignalSpy spy2(process, &QProcess::readyReadStandardError);
+ process.write("Hello");
+ QSignalSpy spy1(&process, &QProcess::readyReadStandardOutput);
+ QSignalSpy spy2(&process, &QProcess::readyReadStandardError);
QVERIFY(spy1.isValid());
QVERIFY(spy2.isValid());
@@ -518,11 +509,11 @@ void tst_QProcess::echoTest2()
QTestEventLoop::instance().enterLoop(1);
if (stopWatch.elapsed() >= 30000)
QFAIL("Timed out");
- process->setReadChannel(QProcess::StandardOutput);
- qint64 baso = process->bytesAvailable();
+ process.setReadChannel(QProcess::StandardOutput);
+ qint64 baso = process.bytesAvailable();
- process->setReadChannel(QProcess::StandardError);
- qint64 base = process->bytesAvailable();
+ process.setReadChannel(QProcess::StandardError);
+ qint64 base = process.bytesAvailable();
if (baso == 5 && base == 5)
break;
}
@@ -530,20 +521,18 @@ void tst_QProcess::echoTest2()
QVERIFY(spy1.count() > 0);
QVERIFY(spy2.count() > 0);
- QCOMPARE(process->readAllStandardOutput(), QByteArray("Hello"));
- QCOMPARE(process->readAllStandardError(), QByteArray("Hello"));
-
- process->write("", 1);
- QVERIFY(process->waitForFinished(5000));
+ QCOMPARE(process.readAllStandardOutput(), QByteArray("Hello"));
+ QCOMPARE(process.readAllStandardError(), QByteArray("Hello"));
- delete process;
- process = 0;
+ process.write("", 1);
+ QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
#endif
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
// Reading and writing to a process is not supported on Qt/CE
-//-----------------------------------------------------------------------------
void tst_QProcess::echoTestGui()
{
QProcess process;
@@ -555,6 +544,8 @@ void tst_QProcess::echoTestGui()
process.write("q");
QVERIFY(process.waitForFinished(50000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
QCOMPARE(process.readAllStandardOutput(), QByteArray("Hello"));
QCOMPARE(process.readAllStandardError(), QByteArray("Hello"));
@@ -572,7 +563,6 @@ void tst_QProcess::testSetNamedPipeHandleState()
}
#endif // !Q_OS_WINCE && Q_OS_WIN
-//-----------------------------------------------------------------------------
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
// Batch files are not supported on Windows CE
void tst_QProcess::batFiles_data()
@@ -594,6 +584,8 @@ void tst_QProcess::batFiles()
proc.start(batFile, QStringList());
QVERIFY(proc.waitForFinished(5000));
+ QCOMPARE(proc.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(proc.exitCode(), 0);
QVERIFY(proc.bytesAvailable() > 0);
@@ -601,7 +593,6 @@ void tst_QProcess::batFiles()
}
#endif // !Q_OS_WINCE && Q_OS_WIN
-//-----------------------------------------------------------------------------
void tst_QProcess::exitStatus_data()
{
QTest::addColumn<QStringList>("processList");
@@ -628,79 +619,75 @@ void tst_QProcess::exitStatus_data()
void tst_QProcess::exitStatus()
{
- process = new QProcess;
+ QProcess process;
QFETCH(QStringList, processList);
QFETCH(QList<QProcess::ExitStatus>, exitStatus);
QCOMPARE(exitStatus.count(), processList.count());
for (int i = 0; i < processList.count(); ++i) {
- process->start(processList.at(i));
- QVERIFY(process->waitForStarted(5000));
- QVERIFY(process->waitForFinished(30000));
+ process.start(processList.at(i));
+ QVERIFY(process.waitForStarted(5000));
+ QVERIFY(process.waitForFinished(30000));
- QCOMPARE(process->exitStatus(), exitStatus.at(i));
+ QCOMPARE(process.exitStatus(), exitStatus.at(i));
}
-
- process->deleteLater();
- process = 0;
}
-//-----------------------------------------------------------------------------
+
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::loopBackTest()
{
- process = new QProcess;
- process->start("testProcessEcho/testProcessEcho");
- QVERIFY(process->waitForStarted(5000));
+ QProcess process;
+ process.start("testProcessEcho/testProcessEcho");
+ QVERIFY(process.waitForStarted(5000));
for (int i = 0; i < 100; ++i) {
- process->write("Hello");
+ process.write("Hello");
do {
- QVERIFY(process->waitForReadyRead(5000));
- } while (process->bytesAvailable() < 5);
- QCOMPARE(process->readAll(), QByteArray("Hello"));
+ QVERIFY(process.waitForReadyRead(5000));
+ } while (process.bytesAvailable() < 5);
+ QCOMPARE(process.readAll(), QByteArray("Hello"));
}
- process->write("", 1);
- QVERIFY(process->waitForFinished(5000));
-
- delete process;
- process = 0;
+ process.write("", 1);
+ QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::readTimeoutAndThenCrash()
{
- process = new QProcess;
- process->start("testProcessEcho/testProcessEcho");
- if (process->state() != QProcess::Starting)
- QCOMPARE(process->state(), QProcess::Running);
+ QProcess process;
+ process.start("testProcessEcho/testProcessEcho");
+ if (process.state() != QProcess::Starting)
+ QCOMPARE(process.state(), QProcess::Running);
- QVERIFY(process->waitForStarted(5000));
- QCOMPARE(process->state(), QProcess::Running);
+ QVERIFY(process.waitForStarted(5000));
+ QCOMPARE(process.state(), QProcess::Running);
- QVERIFY(!process->waitForReadyRead(5000));
- QCOMPARE(process->error(), QProcess::Timedout);
+ QVERIFY(!process.waitForReadyRead(5000));
+ QCOMPARE(process.error(), QProcess::Timedout);
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
- QSignalSpy spy(process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error));
+ QSignalSpy spy(&process, &QProcess::errorOccurred);
+ QSignalSpy spy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
QVERIFY(spy.isValid());
+ QVERIFY(spy2.isValid());
- process->kill();
+ process.kill();
- QVERIFY(process->waitForFinished(5000));
- QCOMPARE(process->state(), QProcess::NotRunning);
+ QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.state(), QProcess::NotRunning);
QCOMPARE(spy.count(), 1);
QCOMPARE(*static_cast<const QProcess::ProcessError *>(spy.at(0).at(0).constData()), QProcess::Crashed);
-
- delete process;
- process = 0;
+ QCOMPARE(spy2.count(), 1);
+ QCOMPARE(*static_cast<const QProcess::ProcessError *>(spy2.at(0).at(0).constData()), QProcess::Crashed);
}
#endif
@@ -747,10 +734,11 @@ void tst_QProcess::deadWhileReading()
QCOMPARE(output.count("\n"), 10*1024);
process.waitForFinished();
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::restartProcessDeadlock()
@@ -759,28 +747,31 @@ void tst_QProcess::restartProcessDeadlock()
// The purpose of this test is to detect whether restarting a
// process in the finished() connected slot causes a deadlock
// because of the way QProcessManager uses its locks.
- QProcess proc;
- process = &proc;
- connect(process, SIGNAL(finished(int)), this, SLOT(restartProcess()));
+ QProcess process;
+ connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished),
+ this, &tst_QProcess::restartProcess);
- process->start("testProcessEcho/testProcessEcho");
+ process.start("testProcessEcho/testProcessEcho");
- QCOMPARE(process->write("", 1), qlonglong(1));
- QVERIFY(process->waitForFinished(5000));
+ QCOMPARE(process.write("", 1), qlonglong(1));
+ QVERIFY(process.waitForFinished(5000));
- process->disconnect(SIGNAL(finished(int)));
+ QObject::disconnect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished), Q_NULLPTR, Q_NULLPTR);
- QCOMPARE(process->write("", 1), qlonglong(1));
- QVERIFY(process->waitForFinished(5000));
+ QCOMPARE(process.write("", 1), qlonglong(1));
+ QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
void tst_QProcess::restartProcess()
{
+ QProcess *process = qobject_cast<QProcess *>(sender());
+ QVERIFY(process);
process->start("testProcessEcho/testProcessEcho");
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::closeWriteChannel()
@@ -805,10 +796,11 @@ void tst_QProcess::closeWriteChannel()
if (more.state() == QProcess::Running)
more.write("q");
QVERIFY(more.waitForFinished(5000));
+ QCOMPARE(more.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(more.exitCode(), 0);
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE"
void tst_QProcess::closeReadChannel()
@@ -836,11 +828,12 @@ void tst_QProcess::closeReadChannel()
proc.write("", 1);
QVERIFY(proc.waitForFinished(5000));
+ QCOMPARE(proc.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(proc.exitCode(), 0);
}
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::openModes()
@@ -885,14 +878,13 @@ void tst_QProcess::openModes()
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::emitReadyReadOnlyWhenNewDataArrives()
{
QProcess proc;
- connect(&proc, SIGNAL(readyRead()), this, SLOT(exitLoopSlot()));
+ connect(&proc, &QIODevice::readyRead, this, &tst_QProcess::exitLoopSlot);
QSignalSpy spy(&proc, &QProcess::readyRead);
QVERIFY(spy.isValid());
@@ -912,16 +904,17 @@ void tst_QProcess::emitReadyReadOnlyWhenNewDataArrives()
QVERIFY(QTestEventLoop::instance().timeout());
QVERIFY(!proc.waitForReadyRead(250));
- QObject::disconnect(&proc, SIGNAL(readyRead()), 0, 0);
+ QObject::disconnect(&proc, &QIODevice::readyRead, Q_NULLPTR, Q_NULLPTR);
proc.write("B");
QVERIFY(proc.waitForReadyRead(5000));
proc.write("", 1);
QVERIFY(proc.waitForFinished(5000));
+ QCOMPARE(proc.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(proc.exitCode(), 0);
}
#endif
-//-----------------------------------------------------------------------------
void tst_QProcess::hardExit()
{
QProcess proc;
@@ -945,7 +938,6 @@ void tst_QProcess::hardExit()
QCOMPARE(int(proc.error()), int(QProcess::Crashed));
}
-//-----------------------------------------------------------------------------
void tst_QProcess::softExit()
{
QProcess proc;
@@ -976,30 +968,30 @@ public:
SoftExitProcess(int n) : waitedForFinished(false), n(n), killing(false)
{
- connect(this, SIGNAL(finished(int,QProcess::ExitStatus)),
- this, SLOT(finishedSlot(int,QProcess::ExitStatus)));
+ connect(this, static_cast<QProcessFinishedSignal2>(&QProcess::finished),
+ this, &SoftExitProcess::finishedSlot);
switch (n) {
case 0:
setReadChannelMode(QProcess::MergedChannels);
- connect(this, SIGNAL(readyRead()), this, SLOT(terminateSlot()));
+ connect(this, &QIODevice::readyRead, this, &SoftExitProcess::terminateSlot);
break;
case 1:
- connect(this, SIGNAL(readyReadStandardOutput()),
- this, SLOT(terminateSlot()));
+ connect(this, &QProcess::readyReadStandardOutput,
+ this, &SoftExitProcess::terminateSlot);
break;
case 2:
- connect(this, SIGNAL(readyReadStandardError()),
- this, SLOT(terminateSlot()));
+ connect(this, &QProcess::readyReadStandardError,
+ this, &SoftExitProcess::terminateSlot);
break;
case 3:
- connect(this, SIGNAL(started()),
- this, SLOT(terminateSlot()));
+ connect(this, &QProcess::started,
+ this, &SoftExitProcess::terminateSlot);
break;
case 4:
default:
- connect(this, SIGNAL(stateChanged(QProcess::ProcessState)),
- this, SLOT(terminateSlot()));
+ connect(this, &QProcess::stateChanged,
+ this, &SoftExitProcess::terminateSlot);
break;
}
}
@@ -1055,7 +1047,6 @@ private:
QByteArray dataToWrite;
};
-//-----------------------------------------------------------------------------
void tst_QProcess::softExitInSlots_data()
{
QTest::addColumn<QString>("appName");
@@ -1065,7 +1056,6 @@ void tst_QProcess::softExitInSlots_data()
#endif
QTest::newRow("console app") << "testProcessEcho2/testProcessEcho2";
}
-//-----------------------------------------------------------------------------
void tst_QProcess::softExitInSlots()
{
@@ -1081,7 +1071,6 @@ void tst_QProcess::softExitInSlots()
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::mergedChannels()
@@ -1103,10 +1092,11 @@ void tst_QProcess::mergedChannels()
process.closeWriteChannel();
QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
@@ -1142,6 +1132,8 @@ void tst_QProcess::forwardedChannels()
QCOMPARE(process.write("input"), 5);
process.closeWriteChannel();
QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
const char *err;
switch (process.exitCode()) {
case 0: err = "ok"; break;
@@ -1161,7 +1153,6 @@ void tst_QProcess::forwardedChannels()
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::atEnd()
@@ -1182,6 +1173,8 @@ void tst_QProcess::atEnd()
process.write("", 1);
QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
#endif
@@ -1200,8 +1193,8 @@ protected:
exitCode = 90210;
QProcess process;
- connect(&process, SIGNAL(finished(int)), this, SLOT(catchExitCode(int)),
- Qt::DirectConnection);
+ connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished),
+ this, &TestThread::catchExitCode, Qt::DirectConnection);
process.start("testProcessEcho/testProcessEcho");
@@ -1222,7 +1215,6 @@ private:
int exitCode;
};
-//-----------------------------------------------------------------------------
void tst_QProcess::processInAThread()
{
for (int i = 0; i < 10; ++i) {
@@ -1233,7 +1225,6 @@ void tst_QProcess::processInAThread()
}
}
-//-----------------------------------------------------------------------------
void tst_QProcess::processesInMultipleThreads()
{
for (int i = 0; i < 10; ++i) {
@@ -1258,61 +1249,58 @@ void tst_QProcess::processesInMultipleThreads()
}
}
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::waitForFinishedWithTimeout()
{
- process = new QProcess(this);
-
- process->start("testProcessEcho/testProcessEcho");
+ QProcess process;
- QVERIFY(process->waitForStarted(5000));
- QVERIFY(!process->waitForFinished(1));
+ process.start("testProcessEcho/testProcessEcho");
- process->write("", 1);
+ QVERIFY(process.waitForStarted(5000));
+ QVERIFY(!process.waitForFinished(1));
- QVERIFY(process->waitForFinished());
+ process.write("", 1);
- delete process;
- process = 0;
+ QVERIFY(process.waitForFinished());
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::waitForReadyReadInAReadyReadSlot()
{
- process = new QProcess(this);
- connect(process, SIGNAL(readyRead()), this, SLOT(waitForReadyReadInAReadyReadSlotSlot()));
- connect(process, SIGNAL(finished(int)), this, SLOT(exitLoopSlot()));
+ QProcess process;
+ connect(&process, &QIODevice::readyRead, this, &tst_QProcess::waitForReadyReadInAReadyReadSlotSlot);
+ connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished),
+ this, &tst_QProcess::exitLoopSlot);
bytesAvailable = 0;
- process->start("testProcessEcho/testProcessEcho");
- QVERIFY(process->waitForStarted(5000));
+ process.start("testProcessEcho/testProcessEcho");
+ QVERIFY(process.waitForStarted(5000));
- QSignalSpy spy(process, &QProcess::readyRead);
+ QSignalSpy spy(&process, &QProcess::readyRead);
QVERIFY(spy.isValid());
- process->write("foo");
+ process.write("foo");
QTestEventLoop::instance().enterLoop(30);
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(spy.count(), 1);
- process->disconnect();
- QVERIFY(process->waitForFinished(5000));
- QVERIFY(process->bytesAvailable() > bytesAvailable);
- delete process;
- process = 0;
+ process.disconnect();
+ QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
+ QVERIFY(process.bytesAvailable() > bytesAvailable);
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::waitForReadyReadInAReadyReadSlotSlot()
{
+ QProcess *process = qobject_cast<QProcess *>(sender());
+ QVERIFY(process);
bytesAvailable = process->bytesAvailable();
process->write("bar", 4);
QVERIFY(process->waitForReadyRead(5000));
@@ -1320,44 +1308,44 @@ void tst_QProcess::waitForReadyReadInAReadyReadSlotSlot()
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::waitForBytesWrittenInABytesWrittenSlot()
{
- process = new QProcess(this);
- connect(process, SIGNAL(bytesWritten(qint64)), this, SLOT(waitForBytesWrittenInABytesWrittenSlotSlot()));
+ QProcess process;
+ connect(&process, &QIODevice::bytesWritten, this, &tst_QProcess::waitForBytesWrittenInABytesWrittenSlotSlot);
bytesAvailable = 0;
- process->start("testProcessEcho/testProcessEcho");
- QVERIFY(process->waitForStarted(5000));
+ process.start("testProcessEcho/testProcessEcho");
+ QVERIFY(process.waitForStarted(5000));
- QSignalSpy spy(process, &QProcess::bytesWritten);
+ QSignalSpy spy(&process, &QProcess::bytesWritten);
QVERIFY(spy.isValid());
- process->write("f");
+ process.write("f");
QTestEventLoop::instance().enterLoop(30);
QVERIFY(!QTestEventLoop::instance().timeout());
QCOMPARE(spy.count(), 1);
- process->write("", 1);
- process->disconnect();
- QVERIFY(process->waitForFinished());
- delete process;
- process = 0;
+ process.write("", 1);
+ process.disconnect();
+ QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::waitForBytesWrittenInABytesWrittenSlotSlot()
{
+ QProcess *process = qobject_cast<QProcess *>(sender());
+ QVERIFY(process);
process->write("b");
QVERIFY(process->waitForBytesWritten(5000));
QTestEventLoop::instance().exitLoop();
}
#endif
-//-----------------------------------------------------------------------------
+
void tst_QProcess::spaceArgsTest_data()
{
QTest::addColumn<QStringList>("args");
@@ -1410,7 +1398,6 @@ static QByteArray startFailMessage(const QString &program, const QProcess &proce
return result;
}
-//-----------------------------------------------------------------------------
void tst_QProcess::spaceArgsTest()
{
QFETCH(QStringList, args);
@@ -1421,11 +1408,11 @@ void tst_QProcess::spaceArgsTest()
<< QString::fromLatin1("testProcessSpacesArgs/one space")
<< QString::fromLatin1("testProcessSpacesArgs/two space s");
- process = new QProcess(this);
+ QProcess process;
for (int i = 0; i < programs.size(); ++i) {
QString program = programs.at(i);
- process->start(program, args);
+ process.start(program, args);
#if defined(Q_OS_WINCE)
const int timeOutMS = 10000;
@@ -1433,14 +1420,16 @@ void tst_QProcess::spaceArgsTest()
const int timeOutMS = 5000;
#endif
QByteArray errorMessage;
- bool started = process->waitForStarted(timeOutMS);
+ bool started = process.waitForStarted(timeOutMS);
if (!started)
- errorMessage = startFailMessage(program, *process);
+ errorMessage = startFailMessage(program, process);
QVERIFY2(started, errorMessage.constData());
- QVERIFY(process->waitForFinished(timeOutMS));
+ QVERIFY(process.waitForFinished(timeOutMS));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
#if !defined(Q_OS_WINCE)
- QStringList actual = QString::fromLatin1(process->readAll()).split("|");
+ QStringList actual = QString::fromLatin1(process.readAll()).split("|");
#endif
#if !defined(Q_OS_WINCE)
QVERIFY(!actual.isEmpty());
@@ -1457,16 +1446,16 @@ void tst_QProcess::spaceArgsTest()
program += QString::fromLatin1(" ") + stringArgs;
errorMessage.clear();
- process->start(program);
- started = process->waitForStarted(5000);
+ process.start(program);
+ started = process.waitForStarted(5000);
if (!started)
- errorMessage = startFailMessage(program, *process);
+ errorMessage = startFailMessage(program, process);
QVERIFY2(started, errorMessage.constData());
- QVERIFY(process->waitForFinished(5000));
+ QVERIFY(process.waitForFinished(5000));
#if !defined(Q_OS_WINCE)
- actual = QString::fromLatin1(process->readAll()).split("|");
+ actual = QString::fromLatin1(process.readAll()).split("|");
#endif
#if !defined(Q_OS_WINCE)
QVERIFY(!actual.isEmpty());
@@ -1476,14 +1465,10 @@ void tst_QProcess::spaceArgsTest()
QCOMPARE(actual, args);
#endif
}
-
- delete process;
- process = 0;
}
#if defined(Q_OS_WIN)
-//-----------------------------------------------------------------------------
void tst_QProcess::nativeArguments()
{
QProcess proc;
@@ -1501,6 +1486,8 @@ void tst_QProcess::nativeArguments()
QVERIFY(proc.waitForStarted(10000));
QVERIFY(proc.waitForFinished(10000));
#endif
+ QCOMPARE(proc.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(proc.exitCode(), 0);
#if defined(Q_OS_WINCE)
// WinCE test outputs to a file, so check that
@@ -1527,7 +1514,6 @@ void tst_QProcess::nativeArguments()
#endif
-//-----------------------------------------------------------------------------
void tst_QProcess::exitCodeTest()
{
for (int i = 0; i < 255; ++i) {
@@ -1544,7 +1530,6 @@ void tst_QProcess::exitCodeTest()
}
}
-//-----------------------------------------------------------------------------
void tst_QProcess::failToStart()
{
#if defined(QPROCESS_USE_SPAWN) && !defined(Q_OS_QNX)
@@ -1556,12 +1541,14 @@ void tst_QProcess::failToStart()
QProcess process;
QSignalSpy stateSpy(&process, &QProcess::stateChanged);
- QSignalSpy errorSpy(&process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error));
- QSignalSpy finishedSpy(&process, static_cast<void (QProcess::*)(int)>(&QProcess::finished));
- QSignalSpy finishedSpy2(&process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished));
+ QSignalSpy errorSpy(&process, &QProcess::errorOccurred);
+ QSignalSpy errorSpy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
+ QSignalSpy finishedSpy(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished));
+ QSignalSpy finishedSpy2(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
QVERIFY(stateSpy.isValid());
QVERIFY(errorSpy.isValid());
+ QVERIFY(errorSpy2.isValid());
QVERIFY(finishedSpy.isValid());
QVERIFY(finishedSpy2.isValid());
@@ -1578,6 +1565,7 @@ void tst_QProcess::failToStart()
for (int j = 0; j < 8; ++j) {
for (int i = 0; i < attempts; ++i) {
QCOMPARE(errorSpy.count(), j * attempts + i);
+ QCOMPARE(errorSpy2.count(), j * attempts + i);
process.start("/blurp");
switch (j) {
@@ -1602,6 +1590,7 @@ void tst_QProcess::failToStart()
QCOMPARE(process.error(), QProcess::FailedToStart);
QCOMPARE(errorSpy.count(), j * attempts + i + 1);
+ QCOMPARE(errorSpy2.count(), j * attempts + i + 1);
QCOMPARE(finishedSpy.count(), 0);
QCOMPARE(finishedSpy2.count(), 0);
@@ -1614,7 +1603,6 @@ void tst_QProcess::failToStart()
}
}
-//-----------------------------------------------------------------------------
void tst_QProcess::failToStartWithWait()
{
#if defined(QPROCESS_USE_SPAWN) && !defined(Q_OS_QNX)
@@ -1625,11 +1613,13 @@ void tst_QProcess::failToStartWithWait()
QProcess process;
QEventLoop loop;
- QSignalSpy errorSpy(&process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error));
- QSignalSpy finishedSpy(&process, static_cast<void (QProcess::*)(int)>(&QProcess::finished));
- QSignalSpy finishedSpy2(&process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished));
+ QSignalSpy errorSpy(&process, &QProcess::errorOccurred);
+ QSignalSpy errorSpy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
+ QSignalSpy finishedSpy(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished));
+ QSignalSpy finishedSpy2(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
QVERIFY(errorSpy.isValid());
+ QVERIFY(errorSpy2.isValid());
QVERIFY(finishedSpy.isValid());
QVERIFY(finishedSpy2.isValid());
@@ -1639,12 +1629,12 @@ void tst_QProcess::failToStartWithWait()
QCOMPARE(process.error(), QProcess::FailedToStart);
QCOMPARE(errorSpy.count(), i + 1);
+ QCOMPARE(errorSpy2.count(), i + 1);
QCOMPARE(finishedSpy.count(), 0);
QCOMPARE(finishedSpy2.count(), 0);
}
}
-//-----------------------------------------------------------------------------
void tst_QProcess::failToStartWithEventLoop()
{
#if defined(QPROCESS_USE_SPAWN) && !defined(Q_OS_QNX)
@@ -1655,16 +1645,18 @@ void tst_QProcess::failToStartWithEventLoop()
QProcess process;
QEventLoop loop;
- QSignalSpy errorSpy(&process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error));
- QSignalSpy finishedSpy(&process, static_cast<void (QProcess::*)(int)>(&QProcess::finished));
- QSignalSpy finishedSpy2(&process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished));
+ QSignalSpy errorSpy(&process, &QProcess::errorOccurred);
+ QSignalSpy errorSpy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
+ QSignalSpy finishedSpy(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished));
+ QSignalSpy finishedSpy2(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
QVERIFY(errorSpy.isValid());
+ QVERIFY(errorSpy2.isValid());
QVERIFY(finishedSpy.isValid());
QVERIFY(finishedSpy2.isValid());
// The error signal may be emitted before start() returns
- connect(&process, SIGNAL(error(QProcess::ProcessError)), &loop, SLOT(quit()), Qt::QueuedConnection);
+ connect(&process, &QProcess::errorOccurred, &loop, &QEventLoop::quit, Qt::QueuedConnection);
for (int i = 0; i < 50; ++i) {
@@ -1674,6 +1666,7 @@ void tst_QProcess::failToStartWithEventLoop()
QCOMPARE(process.error(), QProcess::FailedToStart);
QCOMPARE(errorSpy.count(), i + 1);
+ QCOMPARE(errorSpy2.count(), i + 1);
QCOMPARE(finishedSpy.count(), 0);
QCOMPARE(finishedSpy2.count(), 0);
}
@@ -1693,7 +1686,7 @@ void tst_QProcess::failToStartEmptyArgs()
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
QProcess process;
- QSignalSpy errorSpy(&process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error));
+ QSignalSpy errorSpy(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
QVERIFY(errorSpy.isValid());
switch (startOverload) {
@@ -1715,12 +1708,11 @@ void tst_QProcess::failToStartEmptyArgs()
QCOMPARE(process.error(), QProcess::FailedToStart);
}
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::removeFileWhileProcessIsRunning()
{
- QFile file("removeFile.txt");
+ QFile file(m_temporaryDir.path() + QLatin1String("/removeFile.txt"));
QVERIFY(file.open(QFile::WriteOnly));
QProcess process;
@@ -1732,9 +1724,10 @@ void tst_QProcess::removeFileWhileProcessIsRunning()
process.write("", 1);
QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// OS doesn't support environment variables
void tst_QProcess::setEnvironment_data()
@@ -1812,7 +1805,6 @@ void tst_QProcess::setEnvironment()
}
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// OS doesn't support environment variables
void tst_QProcess::setProcessEnvironment_data()
@@ -1853,7 +1845,7 @@ void tst_QProcess::setProcessEnvironment()
}
}
#endif
-//-----------------------------------------------------------------------------
+
void tst_QProcess::systemEnvironment()
{
#if defined (Q_OS_WINCE)
@@ -1869,7 +1861,6 @@ void tst_QProcess::systemEnvironment()
#endif
}
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::spaceInName()
@@ -1879,10 +1870,11 @@ void tst_QProcess::spaceInName()
QVERIFY(process.waitForStarted());
process.write("", 1);
QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
#endif
-//-----------------------------------------------------------------------------
void tst_QProcess::lockupsInStartDetached()
{
// Check that QProcess doesn't cause a lock up at this program's
@@ -1896,7 +1888,6 @@ void tst_QProcess::lockupsInStartDetached()
QProcess::startDetached("yjhbrty");
}
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::atEnd2()
@@ -1915,7 +1906,6 @@ void tst_QProcess::atEnd2()
}
#endif
-//-----------------------------------------------------------------------------
void tst_QProcess::waitForReadyReadForNonexistantProcess()
{
// Start a program that doesn't exist, process events and then try to waitForReadyRead
@@ -1923,11 +1913,13 @@ void tst_QProcess::waitForReadyReadForNonexistantProcess()
qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus");
QProcess process;
- QSignalSpy errorSpy(&process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error));
- QSignalSpy finishedSpy1(&process, static_cast<void (QProcess::*)(int)>(&QProcess::finished));
- QSignalSpy finishedSpy2(&process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished));
+ QSignalSpy errorSpy(&process, &QProcess::errorOccurred);
+ QSignalSpy errorSpy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
+ QSignalSpy finishedSpy1(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished));
+ QSignalSpy finishedSpy2(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
QVERIFY(errorSpy.isValid());
+ QVERIFY(errorSpy2.isValid());
QVERIFY(finishedSpy1.isValid());
QVERIFY(finishedSpy2.isValid());
@@ -1939,27 +1931,30 @@ void tst_QProcess::waitForReadyReadForNonexistantProcess()
#endif
QCOMPARE(errorSpy.count(), 1);
QCOMPARE(errorSpy.at(0).at(0).toInt(), 0);
+ QCOMPARE(errorSpy2.count(), 1);
+ QCOMPARE(errorSpy2.at(0).at(0).toInt(), 0);
QCOMPARE(finishedSpy1.count(), 0);
QCOMPARE(finishedSpy2.count(), 0);
}
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::setStandardInputFile()
{
static const char data[] = "A bunch\1of\2data\3\4\5\6\7...";
QProcess process;
- QFile file("data");
+ QFile file(m_temporaryDir.path() + QLatin1String("/data-sif"));
QVERIFY(file.open(QIODevice::WriteOnly));
file.write(data, sizeof data);
file.close();
- process.setStandardInputFile("data");
+ process.setStandardInputFile(file.fileName());
process.start("testProcessEcho/testProcessEcho");
- QPROCESS_VERIFY(process, waitForFinished());
+ QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
QByteArray all = process.readAll();
QCOMPARE(all.size(), int(sizeof data) - 1); // testProcessEcho drops the ending \0
QVERIFY(all == data);
@@ -1967,13 +1962,12 @@ void tst_QProcess::setStandardInputFile()
QProcess process2;
process2.setStandardInputFile(QProcess::nullDevice());
process2.start("testProcessEcho/testProcessEcho");
- QPROCESS_VERIFY(process2, waitForFinished());
+ QVERIFY(process2.waitForFinished());
all = process2.readAll();
QCOMPARE(all.size(), 0);
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::setStandardOutputFile_data()
@@ -2004,7 +1998,6 @@ void tst_QProcess::setStandardOutputFile_data()
<< true;
}
-//-----------------------------------------------------------------------------
void tst_QProcess::setStandardOutputFile()
{
static const char data[] = "Original data. ";
@@ -2018,7 +2011,7 @@ void tst_QProcess::setStandardOutputFile()
QIODevice::OpenMode mode = append ? QIODevice::Append : QIODevice::Truncate;
// create the destination file with data
- QFile file("data");
+ QFile file(m_temporaryDir.path() + QLatin1String("/data-stdof-") + QLatin1String(QTest::currentDataTag()));
QVERIFY(file.open(QIODevice::WriteOnly));
file.write(data, sizeof data - 1);
file.close();
@@ -2027,13 +2020,15 @@ void tst_QProcess::setStandardOutputFile()
QProcess process;
process.setReadChannelMode(channelMode);
if (channelToTest == QProcess::StandardOutput)
- process.setStandardOutputFile("data", mode);
+ process.setStandardOutputFile(file.fileName(), mode);
else
- process.setStandardErrorFile("data", mode);
+ process.setStandardErrorFile(file.fileName(), mode);
process.start("testProcessEcho2/testProcessEcho2");
process.write(testdata, sizeof testdata);
- QPROCESS_VERIFY(process,waitForFinished());
+ QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
// open the file again and verify the data
QVERIFY(file.open(QIODevice::ReadOnly));
@@ -2062,7 +2057,9 @@ void tst_QProcess::setStandardOutputFileNullDevice()
process.setStandardOutputFile(QProcess::nullDevice());
process.start("testProcessEcho2/testProcessEcho2");
process.write(testdata, sizeof testdata);
- QPROCESS_VERIFY(process,waitForFinished());
+ QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
QCOMPARE(process.bytesAvailable(), Q_INT64_C(0));
QVERIFY(!QFileInfo(QProcess::nullDevice()).isFile());
@@ -2072,13 +2069,16 @@ void tst_QProcess::setStandardOutputFileAndWaitForBytesWritten()
{
static const char testdata[] = "Test data.";
- QFile file("data");
+ QFile file(m_temporaryDir.path() + QLatin1String("/data-stdofawfbw"));
QProcess process;
process.setStandardOutputFile(file.fileName());
process.start("testProcessEcho2/testProcessEcho2");
+ QVERIFY2(process.waitForStarted(), qPrintable(process.errorString()));
process.write(testdata, sizeof testdata);
process.waitForBytesWritten();
- QPROCESS_VERIFY(process, waitForFinished());
+ QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
// open the file again and verify the data
QVERIFY(file.open(QIODevice::ReadOnly));
@@ -2089,7 +2089,6 @@ void tst_QProcess::setStandardOutputFileAndWaitForBytesWritten()
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::setStandardOutputProcess_data()
@@ -2119,8 +2118,12 @@ void tst_QProcess::setStandardOutputProcess()
if (waitForBytesWritten)
source.waitForBytesWritten();
source.closeWriteChannel();
- QPROCESS_VERIFY(source, waitForFinished());
- QPROCESS_VERIFY(sink, waitForFinished());
+ QVERIFY(source.waitForFinished());
+ QCOMPARE(source.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(source.exitCode(), 0);
+ QVERIFY(sink.waitForFinished());
+ QCOMPARE(sink.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(sink.exitCode(), 0);
QByteArray all = sink.readAll();
if (!merged)
@@ -2130,35 +2133,43 @@ void tst_QProcess::setStandardOutputProcess()
}
#endif
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::fileWriterProcess()
{
- QString stdinStr;
- for (int i = 0; i < 5000; ++i)
- stdinStr += QString::fromLatin1("%1 -- testing testing 1 2 3\n").arg(i);
+ const QByteArray line = QByteArrayLiteral(" -- testing testing 1 2 3\n");
+ QByteArray stdinStr;
+ stdinStr.reserve(5000 * (4 + line.size()) + 1);
+ for (int i = 0; i < 5000; ++i) {
+ stdinStr += QByteArray::number(i);
+ stdinStr += line;
+ }
QTime stopWatch;
stopWatch.start();
+ const QString fileName = m_temporaryDir.path() + QLatin1String("/fileWriterProcess.txt");
+ const QString binary = QDir::currentPath() + QLatin1String("/fileWriterProcess/fileWriterProcess");
+
do {
- QFile::remove("fileWriterProcess.txt");
+ if (QFile::exists(fileName))
+ QVERIFY(QFile::remove(fileName));
QProcess process;
- process.start("fileWriterProcess/fileWriterProcess",
- QIODevice::ReadWrite | QIODevice::Text);
- process.write(stdinStr.toLatin1());
+ process.setWorkingDirectory(m_temporaryDir.path());
+ process.start(binary, QIODevice::ReadWrite | QIODevice::Text);
+ process.write(stdinStr);
process.closeWriteChannel();
while (process.bytesToWrite()) {
QVERIFY(stopWatch.elapsed() < 3500);
QVERIFY(process.waitForBytesWritten(2000));
}
QVERIFY(process.waitForFinished());
- QCOMPARE(QFile("fileWriterProcess.txt").size(), qint64(stdinStr.size()));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
+ QCOMPARE(QFile(fileName).size(), qint64(stdinStr.size()));
} while (stopWatch.elapsed() < 3000);
}
#endif
-//-----------------------------------------------------------------------------
void tst_QProcess::detachedWorkingDirectoryAndPid()
{
qint64 pid;
@@ -2167,8 +2178,9 @@ void tst_QProcess::detachedWorkingDirectoryAndPid()
QTest::qSleep(1000);
#endif
- QFile infoFile(QDir::currentPath() + QLatin1String("/detachedinfo.txt"));
- infoFile.remove();
+ QFile infoFile(m_temporaryDir.path() + QLatin1String("/detachedinfo.txt"));
+ if (infoFile.exists())
+ QVERIFY(infoFile.remove());
QString workingDir = QDir::currentPath() + "/testDetached";
@@ -2202,7 +2214,6 @@ void tst_QProcess::detachedWorkingDirectoryAndPid()
QCOMPARE(actualPid, pid);
}
-//-----------------------------------------------------------------------------
#ifndef Q_OS_WINCE
// Reading and writing to a process is not supported on Qt/CE
void tst_QProcess::switchReadChannels()
@@ -2215,6 +2226,8 @@ void tst_QProcess::switchReadChannels()
process.write(data);
process.closeWriteChannel();
QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
for (int i = 0; i < 4; ++i) {
process.setReadChannel(QProcess::StandardOutput);
@@ -2233,26 +2246,63 @@ void tst_QProcess::switchReadChannels()
}
#endif
-//-----------------------------------------------------------------------------
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
+#ifndef Q_OS_WINCE
+// Reading and writing to a process is not supported on Qt/CE
+void tst_QProcess::discardUnwantedOutput()
+{
+ QProcess process;
+
+ process.setProgram("testProcessEcho2/testProcessEcho2");
+ process.start(QIODevice::WriteOnly);
+ process.write("Hello, World");
+ process.closeWriteChannel();
+ QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
+
+ process.setReadChannel(QProcess::StandardOutput);
+ QCOMPARE(process.bytesAvailable(), Q_INT64_C(0));
+ process.setReadChannel(QProcess::StandardError);
+ QCOMPARE(process.bytesAvailable(), Q_INT64_C(0));
+}
+#endif
+
+#ifndef Q_OS_WINCE
// Q_OS_WIN - setWorkingDirectory will chdir before starting the process on unices
// Windows CE does not support working directory logic
void tst_QProcess::setWorkingDirectory()
{
- process = new QProcess;
- process->setWorkingDirectory("test");
- process->start("testSetWorkingDirectory/testSetWorkingDirectory");
- QVERIFY(process->waitForFinished());
+ QProcess process;
+ process.setWorkingDirectory("test");
+
+ // use absolute path because on Windows, the executable is relative to the parent's CWD
+ // while on Unix with fork it's relative to the child's (with posix_spawn, it could be either).
+ process.start(QFileInfo("testSetWorkingDirectory/testSetWorkingDirectory").absoluteFilePath());
+
+ QVERIFY2(process.waitForFinished(), process.errorString().toLocal8Bit());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
- QByteArray workingDir = process->readAllStandardOutput();
+ QByteArray workingDir = process.readAllStandardOutput();
QCOMPARE(QDir("test").canonicalPath(), QDir(workingDir.constData()).canonicalPath());
+}
- delete process;
- process = 0;
+void tst_QProcess::setNonExistentWorkingDirectory()
+{
+ QProcess process;
+ process.setWorkingDirectory("this/directory/should/not/exist/for/sure");
+
+ // use absolute path because on Windows, the executable is relative to the parent's CWD
+ // while on Unix with fork it's relative to the child's (with posix_spawn, it could be either).
+ process.start(QFileInfo("testSetWorkingDirectory/testSetWorkingDirectory").absoluteFilePath());
+ QVERIFY(!process.waitForFinished());
+#ifdef QPROCESS_USE_SPAWN
+ QEXPECT_FAIL("", "QProcess cannot detect failure to start when using posix_spawn()", Continue);
+#endif
+ QCOMPARE(int(process.error()), int(QProcess::FailedToStart));
}
#endif
-//-----------------------------------------------------------------------------
void tst_QProcess::startFinishStartFinish()
{
QProcess process;
@@ -2266,12 +2316,14 @@ void tst_QProcess::startFinishStartFinish()
QCOMPARE(QString::fromLatin1(process.readLine().trimmed()),
QString("0 -this is a number"));
#endif
- if (process.state() != QProcess::NotRunning)
+ if (process.state() != QProcess::NotRunning) {
QVERIFY(process.waitForFinished(10000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
+ }
}
}
-//-----------------------------------------------------------------------------
void tst_QProcess::invalidProgramString_data()
{
QTest::addColumn<QString>("programString");
@@ -2286,24 +2338,26 @@ void tst_QProcess::invalidProgramString()
QProcess process;
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
- QSignalSpy spy(&process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error));
+ QSignalSpy spy(&process, &QProcess::errorOccurred);
+ QSignalSpy spy2(&process, static_cast<QProcessErrorSignal>(&QProcess::error));
QVERIFY(spy.isValid());
+ QVERIFY(spy2.isValid());
process.start(programString);
QCOMPARE(process.error(), QProcess::FailedToStart);
QCOMPARE(spy.count(), 1);
+ QCOMPARE(spy2.count(), 1);
QVERIFY(!QProcess::startDetached(programString));
}
-//-----------------------------------------------------------------------------
void tst_QProcess::onlyOneStartedSignal()
{
qRegisterMetaType<QProcess::ExitStatus>("QProcess::ExitStatus");
QProcess process;
QSignalSpy spyStarted(&process, &QProcess::started);
- QSignalSpy spyFinished(&process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished));
+ QSignalSpy spyFinished(&process, static_cast<QProcessFinishedSignal2>(&QProcess::finished));
QVERIFY(spyStarted.isValid());
QVERIFY(spyFinished.isValid());
@@ -2319,19 +2373,19 @@ void tst_QProcess::onlyOneStartedSignal()
process.start("testProcessNormal/testProcessNormal");
QVERIFY(process.waitForFinished(5000));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
QCOMPARE(spyStarted.count(), 1);
QCOMPARE(spyFinished.count(), 1);
}
-//-----------------------------------------------------------------------------
-
class BlockOnReadStdOut : public QObject
{
Q_OBJECT
public:
BlockOnReadStdOut(QProcess *process)
{
- connect(process, SIGNAL(readyReadStandardOutput()), SLOT(block()));
+ connect(process, &QProcess::readyReadStandardOutput, this, &BlockOnReadStdOut::block);
}
public slots:
@@ -2346,7 +2400,8 @@ void tst_QProcess::finishProcessBeforeReadingDone()
QProcess process;
BlockOnReadStdOut blocker(&process);
QEventLoop loop;
- connect(&process, SIGNAL(finished(int)), &loop, SLOT(quit()));
+ connect(&process, static_cast<QProcessFinishedSignal1>(&QProcess::finished),
+ &loop, &QEventLoop::quit);
process.start("testProcessOutput/testProcessOutput");
QVERIFY(process.waitForStarted());
loop.exec();
@@ -2354,6 +2409,8 @@ void tst_QProcess::finishProcessBeforeReadingDone()
QRegExp(QStringLiteral("[\r\n]")), QString::SkipEmptyParts);
QVERIFY(!lines.isEmpty());
QCOMPARE(lines.last(), QStringLiteral("10239 -this is a number"));
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
+ QCOMPARE(process.exitCode(), 0);
}
//-----------------------------------------------------------------------------
@@ -2370,14 +2427,17 @@ void tst_QProcess::startStopStartStop()
QProcess process;
process.start("testProcessNormal/testProcessNormal");
QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
QCOMPARE(process.exitCode(), 0);
process.start("testExitCodes/testExitCodes", QStringList() << "1");
QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
QCOMPARE(process.exitCode(), 1);
process.start("testProcessNormal/testProcessNormal");
QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
QCOMPARE(process.exitCode(), 0);
}
@@ -2449,6 +2509,7 @@ void tst_QProcess::startStopStartStopBuffers()
process.write("line3\n");
process.closeWriteChannel();
QVERIFY(process.waitForFinished());
+ QCOMPARE(process.exitStatus(), QProcess::NormalExit);
QCOMPARE(process.exitCode(), 0);
if (channelMode2 == QProcess::MergedChannels) {
diff --git a/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp b/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp
index be9a38c499..2099101a91 100644
--- a/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp
+++ b/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp
@@ -66,11 +66,19 @@ void tst_QProcessEnvironment::operator_eq()
QVERIFY(e1 == e2);
e1.clear();
- QVERIFY(e1 != e2);
+ QVERIFY(e1 == e2);
e2.clear();
+ QVERIFY(e1 == e2);
+
+ e1.insert("FOO", "bar");
+ QVERIFY(e1 != e2);
+ e2.insert("FOO", "bar");
QVERIFY(e1 == e2);
+
+ e2.insert("FOO", "baz");
+ QVERIFY(e1 != e2);
}
void tst_QProcessEnvironment::clearAndIsEmpty()
@@ -196,6 +204,15 @@ void tst_QProcessEnvironment::insertEnv()
QCOMPARE(e.value("Hello"), QString("Another World"));
QCOMPARE(e.value("FOO2"), QString("bar2"));
QCOMPARE(e.value("A2"), QString("bc2"));
+
+ QProcessEnvironment e3;
+ e3.insert("FOO2", "bar2");
+ e3.insert("A2", "bc2");
+ e3.insert("Hello", "Another World");
+
+ e3.insert(e3); // mustn't deadlock
+
+ QVERIFY(e3 == e2);
}
void tst_QProcessEnvironment::caseSensitivity()
diff --git a/tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp b/tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp
index 5796636b92..6e6dc2df95 100644
--- a/tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp
+++ b/tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp
@@ -99,7 +99,7 @@ static inline QByteArray msgCannotOpen(const QFileDevice &f)
void tst_QSaveFile::transactionalWrite()
{
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
const QString targetFile = dir.path() + QString::fromLatin1("/outfile");
QFile::remove(targetFile);
QSaveFile file(targetFile);
@@ -134,7 +134,7 @@ void tst_QSaveFile::saveTwice()
// Check that we can reuse a QSaveFile object
// (and test the case of an existing target file)
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
const QString targetFile = dir.path() + QString::fromLatin1("/outfile");
QSaveFile file(targetFile);
QVERIFY2(file.open(QIODevice::WriteOnly), msgCannotOpen(file).constData());
@@ -153,7 +153,7 @@ void tst_QSaveFile::saveTwice()
void tst_QSaveFile::textStreamManualFlush()
{
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
const QString targetFile = dir.path() + QString::fromLatin1("/outfile");
QSaveFile file(targetFile);
QVERIFY2(file.open(QIODevice::WriteOnly), msgCannotOpen(file).constData());
@@ -174,7 +174,7 @@ void tst_QSaveFile::textStreamManualFlush()
void tst_QSaveFile::textStreamAutoFlush()
{
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
const QString targetFile = dir.path() + QString::fromLatin1("/outfile");
QSaveFile file(targetFile);
QVERIFY2(file.open(QIODevice::WriteOnly), msgCannotOpen(file).constData());
@@ -206,7 +206,7 @@ void tst_QSaveFile::transactionalWriteNoPermissionsOnDir()
#endif
QFETCH(bool, directWriteFallback);
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
QVERIFY(QFile(dir.path()).setPermissions(QFile::ReadOwner | QFile::ExeOwner));
PermissionRestorer permissionRestorer(dir.path());
@@ -264,7 +264,7 @@ void tst_QSaveFile::transactionalWriteNoPermissionsOnFile()
#endif
// Setup an existing but readonly file
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
const QString targetFile = dir.path() + QString::fromLatin1("/outfile");
QFile file(targetFile);
PermissionRestorer permissionRestorer(targetFile);
@@ -285,7 +285,7 @@ void tst_QSaveFile::transactionalWriteNoPermissionsOnFile()
void tst_QSaveFile::transactionalWriteCanceled()
{
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
const QString targetFile = dir.path() + QString::fromLatin1("/outfile");
QFile::remove(targetFile);
QSaveFile file(targetFile);
@@ -313,7 +313,7 @@ void tst_QSaveFile::transactionalWriteErrorRenaming()
QSKIP("Test is not applicable with root privileges");
#endif
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
const QString targetFile = dir.path() + QString::fromLatin1("/outfile");
QSaveFile file(targetFile);
QVERIFY2(file.open(QIODevice::WriteOnly), msgCannotOpen(file).constData());
@@ -347,7 +347,7 @@ void tst_QSaveFile::symlink()
#ifdef Q_OS_UNIX
QByteArray someData = "some data";
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
const QString targetFile = dir.path() + QLatin1String("/outfile");
const QString linkFile = dir.path() + QLatin1String("/linkfile");
@@ -400,7 +400,7 @@ void tst_QSaveFile::symlink()
// link to a link in another directory
QTemporaryDir dir2;
- QVERIFY(dir2.isValid());
+ QVERIFY2(dir2.isValid(), qPrintable(dir2.errorString()));
const QString linkFile2 = dir2.path() + QLatin1String("/linkfile");
QVERIFY(QFile::link(linkFile, linkFile2));
@@ -458,7 +458,7 @@ void tst_QSaveFile::symlink()
void tst_QSaveFile::directory()
{
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
const QString subdir = dir.path() + QLatin1String("/subdir");
QVERIFY(QDir(dir.path()).mkdir(QStringLiteral("subdir")));
diff --git a/tests/auto/corelib/io/qsettings/BLACKLIST b/tests/auto/corelib/io/qsettings/BLACKLIST
new file mode 100644
index 0000000000..317e97730e
--- /dev/null
+++ b/tests/auto/corelib/io/qsettings/BLACKLIST
@@ -0,0 +1,3 @@
+[isWritable:native]
+osx-10.10
+osx-10.11
diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
index e2e1d99657..19155cc3ad 100644
--- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
+++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
@@ -37,6 +37,7 @@
#include <QtCore/QSettings>
#include <private/qsettings_p.h>
#include <QtCore/QCoreApplication>
+#include <QtCore/QDateTime>
#include <QtCore/QtGlobal>
#include <QtCore/QMetaType>
#include <QtCore/QString>
@@ -88,12 +89,11 @@ class tst_QSettings : public QObject
Q_OBJECT
public:
- tst_QSettings() : m_canWriteNativeSystemSettings(canWriteNativeSystemSettings()) {}
+ tst_QSettings();
public slots:
void initTestCase();
- void init();
- void cleanup();
+ void cleanup() { cleanupTestFiles(); }
private slots:
void getSetCheck();
void ctor_data();
@@ -164,6 +164,8 @@ private slots:
void bom();
private:
+ void cleanupTestFiles();
+
const bool m_canWriteNativeSystemSettings;
};
@@ -179,39 +181,16 @@ void tst_QSettings::getSetCheck()
QCOMPARE(true, obj1.fallbacksEnabled());
}
-#if defined(Q_OS_WINCE) || defined(Q_OS_WINRT)
-static void removePath(const QString& _path)
-{
- QString path = _path;
- QDir dir(path);
- if (!dir.exists())
- return;
- QStringList entries = dir.entryList(QDir::AllEntries | QDir::NoDotAndDotDot);
- foreach(QString name, entries) {
- QString absolute = path + name;
- if (QFileInfo(absolute).isDir())
- removePath(absolute+"\\");
- else
- QFile::remove(absolute);
- }
- dir.cdUp();
- if (path[path.size()-1] == '\\')
- path = path.left(path.size()-1);
- dir.rmdir(path.mid(path.lastIndexOf('\\')+1));
-}
-#endif
-
-static QString settingsPath(const char *path = "")
+static QString settingsPath(const char *path = Q_NULLPTR)
{
// Temporary path for files that are specified explicitly in the constructor.
#ifndef Q_OS_WINRT
- QString tempPath = QDir::tempPath();
+ static const QString tempPath = QDir::tempPath() + QLatin1String("/tst_QSettings");
#else
- QString tempPath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation);
+ static const QString tempPath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)
+ + QLatin1String("/tst_QSettings");
#endif
- if (tempPath.endsWith("/"))
- tempPath.truncate(tempPath.size() - 1);
- return QDir::toNativeSeparators(tempPath + "/tst_QSettings/" + QLatin1String(path));
+ return path && *path ? tempPath + QLatin1Char('/') + QLatin1String(path) : tempPath;
}
static bool readCustom1File(QIODevice &device, QSettings::SettingsMap &map)
@@ -281,6 +260,12 @@ static void populateWithFormats()
QTest::newRow("custom2") << QSettings::CustomFormat2;
}
+tst_QSettings::tst_QSettings()
+ : m_canWriteNativeSystemSettings(canWriteNativeSystemSettings())
+{
+ QStandardPaths::setTestModeEnabled(true);
+}
+
void tst_QSettings::initTestCase()
{
if (!m_canWriteNativeSystemSettings)
@@ -293,13 +278,19 @@ void tst_QSettings::initTestCase()
);
QVERIFY(custom1 == QSettings::CustomFormat1);
QVERIFY(custom2 == QSettings::CustomFormat2);
+
+ cleanupTestFiles();
}
-void tst_QSettings::init()
+void tst_QSettings::cleanupTestFiles()
{
QSettings::setSystemIniPath(settingsPath("__system__"));
QSettings::setUserIniPath(settingsPath("__user__"));
+ QDir settingsDir(settingsPath());
+ if (settingsDir.exists())
+ QVERIFY(settingsDir.removeRecursively());
+
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
QSettings("HKEY_CURRENT_USER\\Software\\software.org", QSettings::NativeFormat).clear();
QSettings("HKEY_CURRENT_USER\\Software\\other.software.org", QSettings::NativeFormat).clear();
@@ -315,17 +306,7 @@ void tst_QSettings::init()
QSettings("HKEY_LOCAL_MACHINE\\Software\\bat", QSettings::NativeFormat).clear();
QSettings("HKEY_LOCAL_MACHINE\\Software\\baz", QSettings::NativeFormat).clear();
}
- if (QDir(settingsPath()).exists()) {
-#if defined(Q_OS_WINCE)
- removePath(settingsPath());
-#else
- if (QSysInfo::windowsVersion() & QSysInfo::WV_NT_based)
- system(QString("rmdir /Q /S %1").arg(settingsPath()).toLatin1());
- else
- system(QString("deltree /Y %1").arg(settingsPath()).toLatin1());
-#endif
- }
-#elif defined(Q_OS_DARWIN)
+#elif defined(Q_OS_DARWIN) || defined(Q_OS_WINRT)
QSettings(QSettings::UserScope, "software.org", "KillerAPP").clear();
QSettings(QSettings::SystemScope, "software.org", "KillerAPP").clear();
QSettings(QSettings::UserScope, "other.software.org", "KillerAPP").clear();
@@ -336,31 +317,16 @@ void tst_QSettings::init()
QSettings(QSettings::SystemScope, "other.software.org").clear();
#endif
-#if !defined(Q_OS_WIN)
- system(QString("chmod -R u+rw %1 2> /dev/null").arg(settingsPath()).toLatin1());
- system(QString("rm -fr %1 2> /dev/null").arg(settingsPath()).toLatin1());
-#endif
+ const QString foo(QLatin1String("foo"));
#if defined(Q_OS_WINRT)
- QSettings(QSettings::UserScope, "software.org", "KillerAPP").clear();
- QSettings(QSettings::SystemScope, "software.org", "KillerAPP").clear();
- QSettings(QSettings::UserScope, "other.software.org", "KillerAPP").clear();
- QSettings(QSettings::SystemScope, "other.software.org", "KillerAPP").clear();
- QSettings(QSettings::UserScope, "software.org").clear();
- QSettings(QSettings::SystemScope, "software.org").clear();
- QSettings(QSettings::UserScope, "other.software.org").clear();
- QSettings(QSettings::SystemScope, "other.software.org").clear();
- QSettings("foo", QSettings::NativeFormat).clear();
- removePath(settingsPath());
- QFile::remove(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/foo");
+ QSettings(foo, QSettings::NativeFormat).clear();
+ QFile fooFile(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + QLatin1Char('/') + foo);
#else
- QFile::remove("foo");
+ QFile fooFile(foo);
#endif
-}
-
-void tst_QSettings::cleanup()
-{
- init();
+ if (fooFile.exists())
+ QVERIFY2(fooFile.remove(), qPrintable(fooFile.errorString()));
}
/*
@@ -1201,6 +1167,9 @@ void tst_QSettings::testVariantTypes()
QList<QVariant> l4;
l4 << QVariant(m2) << QVariant(l2) << QVariant(l3);
testVal("key13", l4, QVariantList, List);
+ QDateTime dt = QDateTime::currentDateTime();
+ dt.setOffsetFromUtc(3600);
+ testVal("key14", dt, QDateTime, DateTime);
// We store key sequences as strings instead of binary variant blob, for improved
// readability in the resulting format.
@@ -3327,7 +3296,7 @@ void tst_QSettings::dontReorderIniKeysNeedlessly()
QString outFileName2;
QTemporaryFile outFile;
- outFile.open();
+ QVERIFY2(outFile.open(), qPrintable(outFile.errorString()));
outFile.write(contentsBefore);
outFileName = outFile.fileName();
outFile.close();
diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
index efb343cf85..50c5b938e9 100644
--- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
+++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
@@ -56,6 +56,7 @@ class tst_qstandardpaths : public QObject
Q_OBJECT
private slots:
+ void initTestCase();
void dump();
void testDefaultLocations();
void testCustomLocations();
@@ -128,6 +129,14 @@ static const char * const enumNames[MaxStandardLocation + 1 - int(QStandardPaths
"AppConfigLocation"
};
+void tst_qstandardpaths::initTestCase()
+{
+ QVERIFY2(m_localConfigTempDir.isValid(), qPrintable(m_localConfigTempDir.errorString()));
+ QVERIFY2(m_globalConfigTempDir.isValid(), qPrintable(m_globalConfigTempDir.errorString()));
+ QVERIFY2(m_localAppTempDir.isValid(), qPrintable(m_localAppTempDir.errorString()));
+ QVERIFY2(m_globalAppTempDir.isValid(), qPrintable(m_globalAppTempDir.errorString()));
+}
+
void tst_qstandardpaths::dump()
{
#ifdef Q_XDG_PLATFORM
@@ -455,6 +464,15 @@ void tst_qstandardpaths::testCustomRuntimeDirectory()
#endif
#ifdef Q_XDG_PLATFORM
+ struct EnvVarRestorer
+ {
+ EnvVarRestorer() : origRuntimeDir(qgetenv("XDG_RUNTIME_DIR")) {}
+ ~EnvVarRestorer() { qputenv("XDG_RUNTIME_DIR", origRuntimeDir.constData()); }
+ const QByteArray origRuntimeDir;
+ };
+ EnvVarRestorer restorer;
+
+ // When $XDG_RUNTIME_DIR points to a directory with wrong ownership, QStandardPaths should warn
qputenv("XDG_RUNTIME_DIR", QFile::encodeName("/tmp"));
// It's very unlikely that /tmp is 0600 or that we can chmod it
// The call below outputs
@@ -465,6 +483,20 @@ void tst_qstandardpaths::testCustomRuntimeDirectory()
qPrintable(QString::fromLatin1("QStandardPaths: wrong ownership on runtime directory /tmp, 0 instead of %1").arg(uid)));
const QString runtimeDir = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation);
QVERIFY2(runtimeDir.isEmpty(), qPrintable(runtimeDir));
+
+ // When $XDG_RUNTIME_DIR points to a non-existing directory, QStandardPaths should warn (QTBUG-48771)
+ qputenv("XDG_RUNTIME_DIR", "does_not_exist");
+ QTest::ignoreMessage(QtWarningMsg, "QStandardPaths: XDG_RUNTIME_DIR points to non-existing path 'does_not_exist', please create it with 0700 permissions.");
+ const QString nonExistingRuntimeDir = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation);
+ QVERIFY2(nonExistingRuntimeDir.isEmpty(), qPrintable(nonExistingRuntimeDir));
+
+ // When $XDG_RUNTIME_DIR points to a file, QStandardPaths should warn
+ const QString file = QFINDTESTDATA("tst_qstandardpaths.cpp");
+ QVERIFY(!file.isEmpty());
+ qputenv("XDG_RUNTIME_DIR", QFile::encodeName(file));
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(QString::fromLatin1("QStandardPaths: XDG_RUNTIME_DIR points to '%1' which is not a directory").arg(file)));
+ const QString noRuntimeDir = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation);
+ QVERIFY2(noRuntimeDir.isEmpty(), qPrintable(file));
#endif
}
diff --git a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp
index a7a0cf4ddb..efbcdc78e0 100644
--- a/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp
+++ b/tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp
@@ -153,7 +153,7 @@ void tst_QStorageInfo::storageList()
void tst_QStorageInfo::tempFile()
{
QTemporaryFile file;
- QVERIFY(file.open());
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QStorageInfo storage1(file.fileName());
#ifdef Q_OS_LINUX
@@ -174,7 +174,7 @@ void tst_QStorageInfo::tempFile()
void tst_QStorageInfo::caching()
{
QTemporaryFile file;
- QVERIFY(file.open());
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QStorageInfo storage1(file.fileName());
#ifdef Q_OS_LINUX
diff --git a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp
index 3e98a369ce..621e215d60 100644
--- a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp
+++ b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp
@@ -93,6 +93,7 @@ void tst_QTemporaryDir::construction()
QCOMPARE(dir.path().left(tmp.size()), tmp);
QVERIFY(dir.path().contains("tst_qtemporarydir"));
QVERIFY(QFileInfo(dir.path()).isDir());
+ QCOMPARE(dir.errorString(), QString());
}
// Testing get/set functions
@@ -228,6 +229,13 @@ void tst_QTemporaryDir::autoRemove()
void tst_QTemporaryDir::nonWritableCurrentDir()
{
#ifdef Q_OS_UNIX
+
+# if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
+ const char nonWritableDir[] = "/data";
+# else
+ const char nonWritableDir[] = "/home";
+# endif
+
if (::geteuid() == 0)
QSKIP("not valid running this test as root");
@@ -239,18 +247,19 @@ void tst_QTemporaryDir::nonWritableCurrentDir()
}
QString dir;
};
- ChdirOnReturn cor(QDir::currentPath());
-#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
- QDir::setCurrent("/data");
-#else
- QDir::setCurrent("/home");
-#endif
+ const QFileInfo nonWritableDirFi = QFileInfo(QLatin1String(nonWritableDir));
+ QVERIFY(nonWritableDirFi.isDir());
+ QVERIFY(!nonWritableDirFi.isWritable());
+
+ ChdirOnReturn cor(QDir::currentPath());
+ QVERIFY(QDir::setCurrent(nonWritableDirFi.absoluteFilePath()));
// QTemporaryDir("tempXXXXXX") is probably a bad idea in any app
// where the current dir could anything...
QTemporaryDir dir("tempXXXXXX");
dir.setAutoRemove(true);
QVERIFY(!dir.isValid());
+ QVERIFY(!dir.errorString().isEmpty());
QVERIFY(dir.path().isEmpty());
#endif
}
@@ -287,7 +296,11 @@ void tst_QTemporaryDir::stressTest()
for (int i = 0; i < iterations; ++i) {
QTemporaryDir dir(pattern);
dir.setAutoRemove(false);
- QVERIFY2(dir.isValid(), qPrintable(QString::fromLatin1("Failed to create #%1 under %2.").arg(i).arg(QDir::toNativeSeparators(pattern))));
+ QVERIFY2(dir.isValid(),
+ qPrintable(QString::fromLatin1("Failed to create #%1 under %2: %3.")
+ .arg(i)
+ .arg(QDir::toNativeSeparators(pattern))
+ .arg(dir.errorString())));
QVERIFY(!names.contains(dir.path()));
names.insert(dir.path());
}
diff --git a/tests/auto/corelib/io/qtextstream/BLACKLIST b/tests/auto/corelib/io/qtextstream/BLACKLIST
new file mode 100644
index 0000000000..bc3f118b33
--- /dev/null
+++ b/tests/auto/corelib/io/qtextstream/BLACKLIST
@@ -0,0 +1,2 @@
+[stillOpenWhenAtEnd]
+windows
diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
index 36da3b8770..3ab53848d8 100644
--- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
+++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
@@ -163,6 +163,7 @@ private slots:
void string_write_operator_ToDevice_data();
void string_write_operator_ToDevice();
void latin1String_write_operator_ToDevice();
+ void stringref_write_operator_ToDevice();
// other
void skipWhiteSpace_data();
@@ -258,6 +259,7 @@ tst_QTextStream::tst_QTextStream()
void tst_QTextStream::initTestCase()
{
+ QVERIFY2(tempDir.isValid(), qPrintable(tempDir.errorString()));
QVERIFY(!m_rfc3261FilePath.isEmpty());
QVERIFY(!m_shiftJisFilePath.isEmpty());
@@ -2553,6 +2555,22 @@ void tst_QTextStream::latin1String_write_operator_ToDevice()
QCOMPARE(buf.buffer().constData(), "No explicit lengthExplicit length");
}
+void tst_QTextStream::stringref_write_operator_ToDevice()
+{
+ QBuffer buf;
+ buf.open(QBuffer::WriteOnly);
+ QTextStream stream(&buf);
+ stream.setCodec(QTextCodec::codecForName("ISO-8859-1"));
+ stream.setAutoDetectUnicode(true);
+
+ const QString expected = "No explicit lengthExplicit length";
+
+ stream << expected.leftRef(18);
+ stream << expected.midRef(18);
+ stream.flush();
+ QCOMPARE(buf.buffer().constData(), "No explicit lengthExplicit length");
+}
+
// ------------------------------------------------------------------------------
void tst_QTextStream::useCase1()
{
@@ -2711,7 +2729,7 @@ void tst_QTextStream::readBomSeekBackReadBomAgain()
QFile::remove("utf8bom");
QFile file("utf8bom");
QVERIFY(file.open(QFile::ReadWrite));
- file.write("\xef\xbb\xbf" "Andreas");
+ file.write("\xef\xbb\xbf""Andreas");
file.seek(0);
QCOMPARE(file.pos(), qint64(0));
diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp
index 7579c6713d..031a35b380 100644
--- a/tests/auto/corelib/io/qurl/tst_qurl.cpp
+++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp
@@ -79,6 +79,8 @@ private slots:
void toLocalFile();
void fromLocalFile_data();
void fromLocalFile();
+ void fromLocalFileNormalize_data();
+ void fromLocalFileNormalize();
void macTypes();
void relative();
void compat_legacy();
@@ -1242,16 +1244,6 @@ void tst_QUrl::fromLocalFile_data()
<< QString::fromLatin1("/");
QTest::newRow("data7") << QString::fromLatin1("/Mambo <#5>.mp3") << QString::fromLatin1("file:///Mambo <%235>.mp3")
<< QString::fromLatin1("/Mambo <#5>.mp3");
- QTest::newRow("data8") << QString::fromLatin1("/a%.txt") << QString::fromLatin1("file:///a%25.txt")
- << QString::fromLatin1("/a%.txt");
- QTest::newRow("data9") << QString::fromLatin1("/a%25.txt") << QString::fromLatin1("file:///a%2525.txt")
- << QString::fromLatin1("/a%25.txt");
- QTest::newRow("data10") << QString::fromLatin1("/%80.txt") << QString::fromLatin1("file:///%2580.txt")
- << QString::fromLatin1("/%80.txt");
- QTest::newRow("data11") << QString::fromLatin1("./a.txt") << QString::fromLatin1("file:a.txt") << QString::fromLatin1("a.txt");
- QTest::newRow("data12") << QString::fromLatin1("././a.txt") << QString::fromLatin1("file:a.txt") << QString::fromLatin1("a.txt");
- QTest::newRow("data13") << QString::fromLatin1("b/../a.txt") << QString::fromLatin1("file:a.txt") << QString::fromLatin1("a.txt");
- QTest::newRow("data14") << QString::fromLatin1("/b/../a.txt") << QString::fromLatin1("file:///a.txt") << QString::fromLatin1("/a.txt");
}
void tst_QUrl::fromLocalFile()
@@ -1266,6 +1258,41 @@ void tst_QUrl::fromLocalFile()
QCOMPARE(url.path(), thePath);
}
+void tst_QUrl::fromLocalFileNormalize_data()
+{
+ QTest::addColumn<QString>("theFile"); // should support the fromLocalFile/toLocalFile roundtrip (so no //host or windows path)
+ QTest::addColumn<QString>("theUrl");
+ QTest::addColumn<QString>("urlWithNormalizedPath");
+
+ QTest::newRow("data0") << QString::fromLatin1("/a.txt") << QString::fromLatin1("file:///a.txt") << QString::fromLatin1("file:///a.txt");
+ QTest::newRow("data1") << QString::fromLatin1("a.txt") << QString::fromLatin1("file:a.txt") << QString::fromLatin1("file:a.txt");
+ QTest::newRow("data8") << QString::fromLatin1("/a%.txt") << QString::fromLatin1("file:///a%25.txt")
+ << QString::fromLatin1("file:///a%25.txt");
+ QTest::newRow("data9") << QString::fromLatin1("/a%25.txt") << QString::fromLatin1("file:///a%2525.txt")
+ << QString::fromLatin1("file:///a%2525.txt");
+ QTest::newRow("data10") << QString::fromLatin1("/%80.txt") << QString::fromLatin1("file:///%2580.txt")
+ << QString::fromLatin1("file:///%2580.txt");
+ QTest::newRow("data11") << QString::fromLatin1("./a.txt") << QString::fromLatin1("file:./a.txt") << QString::fromLatin1("file:a.txt");
+ QTest::newRow("data12") << QString::fromLatin1("././a.txt") << QString::fromLatin1("file:././a.txt") << QString::fromLatin1("file:a.txt");
+ QTest::newRow("data13") << QString::fromLatin1("b/../a.txt") << QString::fromLatin1("file:b/../a.txt") << QString::fromLatin1("file:a.txt");
+ QTest::newRow("data14") << QString::fromLatin1("/b/../a.txt") << QString::fromLatin1("file:///b/../a.txt") << QString::fromLatin1("file:///a.txt");
+ QTest::newRow("data15") << QString::fromLatin1("/b/.") << QString::fromLatin1("file:///b/.") << QString::fromLatin1("file:///b");
+}
+
+void tst_QUrl::fromLocalFileNormalize()
+{
+ QFETCH(QString, theFile);
+ QFETCH(QString, theUrl);
+ QFETCH(QString, urlWithNormalizedPath);
+
+ QUrl url = QUrl::fromLocalFile(theFile);
+
+ QCOMPARE(url.toString(QUrl::DecodeReserved), theUrl);
+ QCOMPARE(url.toLocalFile(), theFile); // roundtrip
+ QCOMPARE(url.path(), theFile); // works as well as long as we don't test windows paths
+ QCOMPARE(url.toString(QUrl::NormalizePathSegments), urlWithNormalizedPath);
+}
+
void tst_QUrl::macTypes()
{
#ifndef Q_OS_MAC
@@ -2960,6 +2987,9 @@ void tst_QUrl::fromUserInputWithCwd_data()
while (it.hasNext()) {
it.next();
QUrl url = QUrl::fromLocalFile(it.filePath());
+ if (it.fileName() == QLatin1String(".")) {
+ url = QUrl::fromLocalFile(QDir::currentPath()); // fromUserInput cleans the path
+ }
QTest::newRow(QString("file-%1").arg(c++).toLatin1()) << it.fileName() << QDir::currentPath() << url << url;
}
QDir parent = QDir::current();
@@ -3021,6 +3051,8 @@ void tst_QUrl::fileName_data()
<< QString() << "tmp.txt" << "tmp.txt";
QTest::newRow("encoded") << "print:/specials/Print%20To%20File%20(PDF%252FAcrobat)"
<< "/specials/" << "Print To File (PDF%252FAcrobat)" << "Print To File (PDF%2FAcrobat)";
+ QTest::newRow("endsWithDot") << "file:///temp/."
+ << "/temp/" << "." << ".";
}
void tst_QUrl::fileName()
@@ -3513,7 +3545,7 @@ void tst_QUrl::setComponents_data()
<< PrettyDecoded << "/path" << "trash:/path";
QTest::newRow("path-withdotdot") << QUrl("file:///tmp")
<< int(Path) << "//tmp/..///root/." << Tolerant << true
- << PrettyDecoded << "/root" << "file:///root";
+ << PrettyDecoded << "/tmp/..///root/." << "file:///tmp/..///root/.";
// the other fields can be present and be empty
// that is, their delimiters would be present, but there would be nothing to one side
diff --git a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp
index db0136dd20..769a96ac64 100644
--- a/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp
+++ b/tests/auto/corelib/io/qurlquery/tst_qurlquery.cpp
@@ -177,6 +177,7 @@ void tst_QUrlQuery::constructing()
QVERIFY(copy.isEmpty());
QVERIFY(!copy.isDetached());
QVERIFY(copy == empty);
+ QCOMPARE(qHash(copy), qHash(empty));
QVERIFY(!(copy != empty));
copy = empty;
@@ -184,6 +185,7 @@ void tst_QUrlQuery::constructing()
copy = QUrlQuery();
QVERIFY(copy == empty);
+ QCOMPARE(qHash(copy), qHash(empty));
}
{
QUrlQuery copy(emptyQuery());
@@ -298,6 +300,7 @@ void tst_QUrlQuery::addRemove()
QVERIFY(query == original);
QVERIFY(!(query != original));
+ QCOMPARE(qHash(query), qHash(original));
}
{
diff --git a/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp b/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp
index 64170b15dd..c4d2df7c3e 100644
--- a/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp
@@ -379,7 +379,7 @@ void tst_QAbstractItemModel::hasChildren()
{
QtTestModel model(1, 1);
QModelIndex idx = model.index(0, 0, QModelIndex());
- QVERIFY(model.hasChildren(idx) == false);
+ QVERIFY(!model.hasChildren(idx));
}
void tst_QAbstractItemModel::data()
diff --git a/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp b/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp
index ba143a31f8..e0e688cc3a 100644
--- a/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp
+++ b/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp
@@ -78,6 +78,9 @@ public:
QList<test> tests;
static void setupDatabase();
+
+private:
+ QScopedPointer<QTemporaryDir> m_dirModelTempDir;
};
@@ -306,18 +309,20 @@ QModelIndex ModelsToTest::populateTestArea(QAbstractItemModel *model)
}
if (QDirModel *dirModel = qobject_cast<QDirModel *>(model)) {
- if (!QDir::current().mkdir("test"))
- qFatal("%s: cannot create directory %s",
- Q_FUNC_INFO,
- qPrintable(QDir::toNativeSeparators(QDir::currentPath()+"/test")));
+ m_dirModelTempDir.reset(new QTemporaryDir);
+ if (!m_dirModelTempDir->isValid())
+ qFatal("Cannot create temporary directory \"%s\": %s",
+ qPrintable(QDir::toNativeSeparators(m_dirModelTempDir->path())),
+ qPrintable(m_dirModelTempDir->errorString()));
+
+ QDir tempDir(m_dirModelTempDir->path());
for (int i = 0; i < 26; ++i) {
- QString subdir = QString("test/foo_%1").arg(i);
- if (!QDir::current().mkdir(subdir))
- qFatal("%s: cannot create directory %s",
- Q_FUNC_INFO,
- qPrintable(QDir::toNativeSeparators(QDir::currentPath()+"/"+subdir)));
+ const QString subdir = QString("foo_") + QString::number(i);
+ if (!tempDir.mkdir(subdir))
+ qFatal("Cannot create directory %s",
+ qPrintable(QDir::toNativeSeparators(tempDir.path() + QLatin1Char('/') +subdir)));
}
- return dirModel->index(QDir::currentPath()+"/test");
+ return dirModel->index(tempDir.path());
}
if (QSqlQueryModel *queryModel = qobject_cast<QSqlQueryModel *>(model)) {
@@ -382,22 +387,8 @@ QModelIndex ModelsToTest::populateTestArea(QAbstractItemModel *model)
*/
void ModelsToTest::cleanupTestArea(QAbstractItemModel *model)
{
- if (qobject_cast<QDirModel *>(model))
- {
- if (QDir(QDir::currentPath()+"/test").exists())
- {
- for (int i = 0; i < 26; ++i) {
- QString subdir(QString("test/foo_%1").arg(i));
- if (!QDir::current().rmdir(subdir))
- qFatal("%s: cannot remove directory %s",
- Q_FUNC_INFO,
- qPrintable(QDir::toNativeSeparators(QDir::currentPath()+"/"+subdir)));
- }
- if (!QDir::current().rmdir("test"))
- qFatal("%s: cannot remove directory %s",
- Q_FUNC_INFO,
- qPrintable(QDir::toNativeSeparators(QDir::currentPath()+"/test")));
- }
+ if (qobject_cast<QDirModel *>(model)) {
+ m_dirModelTempDir.reset();
} else if (qobject_cast<QSqlQueryModel *>(model)) {
QSqlQuery q("DROP TABLE test");
}
diff --git a/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp b/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp
index 709b35b6e0..6971f7ef78 100644
--- a/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp
@@ -49,6 +49,9 @@ class tst_QItemModel : public QObject
{
Q_OBJECT
+public:
+ tst_QItemModel();
+
public slots:
void init();
void cleanup();
@@ -124,6 +127,11 @@ private:
bool insertRecursively;
};
+tst_QItemModel::tst_QItemModel()
+{
+ qRegisterMetaType<QAbstractItemModel::LayoutChangeHint>();
+}
+
void tst_QItemModel::init()
{
testModels = new ModelsToTest();
diff --git a/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp
index 8d331389f5..38e2900c25 100644
--- a/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp
@@ -94,6 +94,9 @@ private slots:
void testChainedSelectionClear();
void testClearCurrentIndex();
+ void QTBUG48402_data();
+ void QTBUG48402();
+
private:
QAbstractItemModel *model;
QItemSelectionModel *selection;
@@ -1530,7 +1533,7 @@ void tst_QItemSelectionModel::resetModel()
model.reset();
QVERIFY(selectionModel->selection().isEmpty());
- QVERIFY(selectionModel->hasSelection() == false);
+ QVERIFY(!selectionModel->hasSelection());
selectionModel->select(QItemSelection(model.index(0, 0), model.index(5, 5)), QItemSelectionModel::Select);
@@ -2756,5 +2759,96 @@ void tst_QItemSelectionModel::testClearCurrentIndex()
QVERIFY(currentIndexSpy.size() == 2);
}
+void tst_QItemSelectionModel::QTBUG48402_data()
+{
+ QTest::addColumn<int>("rows");
+ QTest::addColumn<int>("columns");
+
+ QTest::addColumn<int>("selectTop");
+ QTest::addColumn<int>("selectLeft");
+ QTest::addColumn<int>("selectBottom");
+ QTest::addColumn<int>("selectRight");
+
+ QTest::addColumn<int>("removeTop");
+ QTest::addColumn<int>("removeBottom");
+
+ QTest::addColumn<int>("deselectTop");
+ QTest::addColumn<int>("deselectLeft");
+ QTest::addColumn<int>("deselectBottom");
+ QTest::addColumn<int>("deselectRight");
+
+ QTest::newRow("4x4 top intersection")
+ << 4 << 4
+ << 0 << 2 << 1 << 3
+ << 1 << 1
+ << 1 << 2 << 1 << 3;
+
+ QTest::newRow("4x4 bottom intersection")
+ << 4 << 4
+ << 0 << 2 << 1 << 3
+ << 0 << 0
+ << 0 << 2 << 0 << 3;
+
+ QTest::newRow("4x4 middle intersection")
+ << 4 << 4
+ << 0 << 2 << 2 << 3
+ << 1 << 1
+ << 1 << 2 << 1 << 3;
+
+ QTest::newRow("4x4 full inclusion")
+ << 4 << 4
+ << 0 << 2 << 1 << 3
+ << 0 << 1
+ << 0 << 2 << 1 << 3;
+}
+class QTBUG48402_helper : public QObject
+{
+ Q_OBJECT
+public:
+ QModelIndex tl;
+ QModelIndex br;
+public slots:
+ void changed(const QItemSelection &, const QItemSelection &deselected)
+ {
+ tl = deselected.first().topLeft();
+ br = deselected.first().bottomRight();
+ }
+};
+
+void tst_QItemSelectionModel::QTBUG48402()
+{
+ QFETCH(int, rows);
+ QFETCH(int, columns);
+ QFETCH(int, selectTop);
+ QFETCH(int, selectLeft);
+ QFETCH(int, selectBottom);
+ QFETCH(int, selectRight);
+ QFETCH(int, removeTop);
+ QFETCH(int, removeBottom);
+ QFETCH(int, deselectTop);
+ QFETCH(int, deselectLeft);
+ QFETCH(int, deselectBottom);
+ QFETCH(int, deselectRight);
+
+ MyStandardItemModel model(rows, columns);
+ QItemSelectionModel selections(&model);
+
+ QModelIndex stl = model.index(selectTop, selectLeft);
+ QModelIndex sbr = model.index(selectBottom, selectRight);
+ QModelIndex dtl = model.index(deselectTop, deselectLeft);
+ QModelIndex dbr = model.index(deselectBottom, deselectRight);
+
+ selections.select(QItemSelection(stl, sbr), QItemSelectionModel::ClearAndSelect);
+ QTBUG48402_helper helper;
+ helper.connect(&selections, &QItemSelectionModel::selectionChanged, &helper, &QTBUG48402_helper::changed);
+ QVERIFY(selections.isSelected(stl));
+ QVERIFY(selections.isSelected(sbr));
+ QVERIFY(selections.hasSelection());
+
+ model.removeRows(removeTop, removeBottom - removeTop + 1);
+
+ QCOMPARE(QItemSelectionRange(helper.tl, helper.br), QItemSelectionRange(dtl, dbr));
+}
+
QTEST_MAIN(tst_QItemSelectionModel)
#include "tst_qitemselectionmodel.moc"
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
index 1c30adc8de..0302ae5cbf 100644
--- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
@@ -87,6 +87,7 @@ private slots:
void filter_qtbug30662();
void changeSourceLayout();
+ void changeSourceLayoutFilteredOut();
void removeSourceRows_data();
void removeSourceRows();
void insertSourceRows_data();
@@ -1533,6 +1534,32 @@ void tst_QSortFilterProxyModel::changeSourceLayout()
}
}
+void tst_QSortFilterProxyModel::changeSourceLayoutFilteredOut()
+{
+ QStandardItemModel model(2, 1);
+ model.setData(model.index(0, 0), QString("b"));
+ model.setData(model.index(1, 0), QString("a"));
+ QSortFilterProxyModel proxy;
+ proxy.setSourceModel(&model);
+
+ int beforeSortFilter = proxy.rowCount();
+
+ QSignalSpy removeSpy(&proxy, &QSortFilterProxyModel::rowsRemoved);
+ // Filter everything out
+ proxy.setFilterRegExp(QRegExp("c"));
+ QCOMPARE(removeSpy.count(), 1);
+ QCOMPARE(0, proxy.rowCount());
+
+ // change layout of source model
+ model.sort(0, Qt::AscendingOrder);
+
+ QSignalSpy insertSpy(&proxy, &QSortFilterProxyModel::rowsInserted);
+ // Remove filter; we expect an insert
+ proxy.setFilterRegExp(QRegExp(""));
+ QCOMPARE(insertSpy.count(), 1);
+ QCOMPARE(beforeSortFilter, proxy.rowCount());
+}
+
void tst_QSortFilterProxyModel::removeSourceRows_data()
{
QTest::addColumn<QStringList>("sourceItems");
diff --git a/tests/auto/corelib/json/tst_qtjson.cpp b/tests/auto/corelib/json/tst_qtjson.cpp
index 884c4b3850..1665ff696d 100644
--- a/tests/auto/corelib/json/tst_qtjson.cpp
+++ b/tests/auto/corelib/json/tst_qtjson.cpp
@@ -1137,6 +1137,12 @@ void tst_QtJson::fromVariant()
QCOMPARE(QJsonValue::fromVariant(QVariant(stringList)), QJsonValue(jsonArray_string));
QCOMPARE(QJsonValue::fromVariant(QVariant(variantList)), QJsonValue(jsonArray_variant));
QCOMPARE(QJsonValue::fromVariant(QVariant(variantMap)), QJsonValue(jsonObject));
+
+ QVERIFY(QJsonValue::fromVariant(QVariant(QJsonValue(true))).isBool());
+ QVERIFY(QJsonValue::fromVariant(QVariant(jsonArray_string)).isArray());
+ QVERIFY(QJsonValue::fromVariant(QVariant(QJsonDocument(jsonArray_string))).isArray());
+ QVERIFY(QJsonValue::fromVariant(QVariant(jsonObject)).isObject());
+ QVERIFY(QJsonValue::fromVariant(QVariant(QJsonDocument(jsonObject))).isObject());
}
void tst_QtJson::fromVariantMap()
diff --git a/tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro b/tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro
index 0602b9fc38..1039f2c08d 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro
+++ b/tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro
@@ -3,3 +3,4 @@ TARGET = tst_qcoreapplication
QT = core testlib core-private
SOURCES = tst_qcoreapplication.cpp
HEADERS = tst_qcoreapplication.h
+requires(contains(QT_CONFIG,private_tests))
diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
index 60e358232e..655719cffc 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
+++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
@@ -73,6 +73,21 @@ public:
}
};
+class Thread : public QDaemonThread
+{
+ void run() Q_DECL_OVERRIDE
+ {
+ QThreadData *data = QThreadData::current();
+ QVERIFY(!data->requiresCoreApplication); // daemon thread
+ data->requiresCoreApplication = requiresCoreApplication;
+ QThread::run();
+ }
+
+public:
+ Thread() : requiresCoreApplication(true) {}
+ bool requiresCoreApplication;
+};
+
void tst_QCoreApplication::sendEventsOnProcessEvents()
{
int argc = 1;
@@ -848,6 +863,68 @@ void tst_QCoreApplication::applicationEventFilters_auxThread()
QVERIFY(!spy.recordedEvents.contains(QEvent::User + 1));
}
+void tst_QCoreApplication::threadedEventDelivery_data()
+{
+ QTest::addColumn<bool>("requiresCoreApplication");
+ QTest::addColumn<bool>("createCoreApplication");
+ QTest::addColumn<bool>("eventsReceived");
+
+ // invalid combination:
+ //QTest::newRow("default-without-coreapp") << true << false << false;
+ QTest::newRow("default") << true << true << true;
+ QTest::newRow("independent-without-coreapp") << false << false << true;
+ QTest::newRow("independent-with-coreapp") << false << true << true;
+}
+
+// posts the event before the QCoreApplication is destroyed, starts thread after
+void tst_QCoreApplication::threadedEventDelivery()
+{
+ QFETCH(bool, requiresCoreApplication);
+ QFETCH(bool, createCoreApplication);
+ QFETCH(bool, eventsReceived);
+
+ int argc = 1;
+ char *argv[] = { const_cast<char*>(QTest::currentAppName()) };
+ QScopedPointer<TestApplication> app(createCoreApplication ? new TestApplication(argc, argv) : 0);
+
+ Thread thread;
+ thread.requiresCoreApplication = requiresCoreApplication;
+ ThreadedEventReceiver receiver;
+ receiver.moveToThread(&thread);
+ QCoreApplication::postEvent(&receiver, new QEvent(QEvent::Type(QEvent::User + 1)));
+
+ thread.start();
+ QVERIFY(thread.wait(1000));
+ QCOMPARE(receiver.recordedEvents.contains(QEvent::User + 1), eventsReceived);
+}
+
+void tst_QCoreApplication::addRemoveLibPaths()
+{
+ QStringList paths = QCoreApplication::libraryPaths();
+ if (paths.isEmpty())
+ QSKIP("Cannot add/remove library paths if there are none.");
+
+ QString currentDir = QDir().absolutePath();
+ QCoreApplication::addLibraryPath(currentDir);
+ QVERIFY(QCoreApplication::libraryPaths().contains(currentDir));
+
+ QCoreApplication::removeLibraryPath(paths[0]);
+ QVERIFY(!QCoreApplication::libraryPaths().contains(paths[0]));
+
+ int argc = 1;
+ char *argv[] = { const_cast<char*>(QTest::currentAppName()) };
+ TestApplication app(argc, argv);
+
+ // Check that modifications stay alive across the creation of an application.
+ QVERIFY(QCoreApplication::libraryPaths().contains(currentDir));
+ QVERIFY(!QCoreApplication::libraryPaths().contains(paths[0]));
+
+ QStringList replace;
+ replace << currentDir << paths[0];
+ QCoreApplication::setLibraryPaths(replace);
+ QVERIFY(QCoreApplication::libraryPaths() == replace);
+}
+
static void createQObjectOnDestruction()
{
// Make sure that we can create a QObject after the last QObject has been
diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h
index 09e15723ac..d9296b3846 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h
+++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.h
@@ -61,6 +61,9 @@ private slots:
void QTBUG31606_QEventDestructorDeadLock();
void applicationEventFilters_mainThread();
void applicationEventFilters_auxThread();
+ void threadedEventDelivery_data();
+ void threadedEventDelivery();
+ void addRemoveLibPaths();
};
#endif // TST_QCOREAPPLICATION_H
diff --git a/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST b/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST
new file mode 100644
index 0000000000..00be65751b
--- /dev/null
+++ b/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST
@@ -0,0 +1,4 @@
+[sendPostedEvents]
+windows
+[registerTimer]
+windows
diff --git a/tests/auto/corelib/kernel/qeventloop/BLACKLIST b/tests/auto/corelib/kernel/qeventloop/BLACKLIST
new file mode 100644
index 0000000000..6ea6314b0a
--- /dev/null
+++ b/tests/auto/corelib/kernel/qeventloop/BLACKLIST
@@ -0,0 +1,2 @@
+[testQuitLock]
+windows
diff --git a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp
index f555d2e58e..c8bb4cda6e 100644
--- a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp
+++ b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp
@@ -207,22 +207,11 @@ void tst_QEventLoop::processEvents()
QCOMPARE(awakeSpy.count(), 1);
// allow any session manager to complete its handshake, so that
- // there are no pending events left.
+ // there are no pending events left. This tests that we are able
+ // to process all events from the queue, otherwise it will hang.
while (eventLoop.processEvents())
;
- // On mac we get application started events at this point,
- // so process events one more time just to be sure.
- eventLoop.processEvents();
-
- // no events to process, QEventLoop::processEvents() should return
- // false
- aboutToBlockSpy.clear();
- awakeSpy.clear();
- QVERIFY(!eventLoop.processEvents());
- QCOMPARE(aboutToBlockSpy.count(), 0);
- QCOMPARE(awakeSpy.count(), 1);
-
// make sure the test doesn't block forever
int timerId = startTimer(100);
diff --git a/tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp b/tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp
index a18c9eb370..22c78f8e48 100644
--- a/tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp
+++ b/tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
-** Copyright (C) 2014 Olivier Goffart <ogoffart@woboq.com>
+** Copyright (C) 2015 Olivier Goffart <ogoffart@woboq.com>
** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -38,14 +38,29 @@
#include <qobject.h>
#include <qmetaobject.h>
+struct CustomType
+{
+ int padding;
+ QString str;
+ CustomType(const QString &str = QString()) : str(str) {}
+ operator QString() const { return str; }
+ friend bool operator!=(const CustomType &a, const CustomType &b)
+ { return a.str != b.str; }
+};
+
+Q_DECLARE_METATYPE(CustomType)
+
class tst_QMetaProperty : public QObject
{
Q_OBJECT
Q_PROPERTY(EnumType value WRITE setValue READ getValue)
Q_PROPERTY(EnumType value2 WRITE set_value READ get_value)
+ Q_PROPERTY(QString value7 MEMBER value7 RESET resetValue7)
Q_PROPERTY(int value8 READ value8)
Q_PROPERTY(int value9 READ value9 CONSTANT)
Q_PROPERTY(int value10 READ value10 FINAL)
+ Q_PROPERTY(QMap<int, int> map MEMBER map)
+ Q_PROPERTY(CustomType custom MEMBER custom)
private slots:
void hasStdCppSet();
@@ -53,6 +68,8 @@ private slots:
void isFinal();
void gadget();
void readAndWriteWithLazyRegistration();
+ void mapProperty();
+ void conversion();
public:
enum EnumType { EnumType1 };
@@ -62,9 +79,14 @@ public:
void set_value(EnumType) {}
EnumType get_value() const { return EnumType1; }
+ void resetValue7() { value7 = QStringLiteral("reset"); }
int value8() const { return 1; }
int value9() const { return 1; }
int value10() const { return 1; }
+
+ QString value7;
+ QMap<int, int> map;
+ CustomType custom;
};
void tst_QMetaProperty::hasStdCppSet()
@@ -182,6 +204,51 @@ void tst_QMetaProperty::readAndWriteWithLazyRegistration()
QCOMPARE(o.property("write").value<CustomWriteObjectChild*>(), &data);
}
+void tst_QMetaProperty::mapProperty()
+{
+ map.insert(5, 9);
+ QVariant v1 = QVariant::fromValue(map);
+ QVariant v = property("map");
+ QVERIFY(v.isValid());
+ QCOMPARE(map, (v.value<QMap<int,int> >()));
+}
+
+void tst_QMetaProperty::conversion()
+{
+ QMetaType::registerConverter<QString, CustomType>();
+ QMetaType::registerConverter<CustomType, QString>();
+
+ QString hello = QStringLiteral("Hello");
+
+ // Write to a QString property using a CustomType in a QVariant
+ QMetaProperty value7P = metaObject()->property(metaObject()->indexOfProperty("value7"));
+ QVERIFY(value7P.isValid());
+ QVERIFY(value7P.write(this, QVariant::fromValue(CustomType(hello))));
+ QCOMPARE(value7, hello);
+
+ // Write to a CustomType property using a QString in a QVariant
+ QMetaProperty customP = metaObject()->property(metaObject()->indexOfProperty("custom"));
+ QVERIFY(customP.isValid());
+ QVERIFY(customP.write(this, hello));
+ QCOMPARE(custom.str, hello);
+
+ // Something that cannot be converted should fail
+ QVERIFY(!customP.write(this, 45));
+ QVERIFY(!customP.write(this, QVariant::fromValue(this)));
+ QVERIFY(!value7P.write(this, QVariant::fromValue(this)));
+ QVERIFY(!value7P.write(this, QVariant::fromValue<QObject*>(this)));
+
+ // none of this should have changed the values
+ QCOMPARE(value7, hello);
+ QCOMPARE(custom.str, hello);
+
+ // Empty variant should be converted to default object
+ QVERIFY(customP.write(this, QVariant()));
+ QCOMPARE(custom.str, QString());
+ // or reset resetable
+ QVERIFY(value7P.write(this, QVariant()));
+ QCOMPARE(value7, QLatin1Literal("reset"));
+}
QTEST_MAIN(tst_QMetaProperty)
#include "tst_qmetaproperty.moc"
diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
index a4bfc8ac9b..c74a43b682 100644
--- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
+++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
@@ -972,7 +972,7 @@ QT_FOR_EACH_STATIC_CORE_POINTER(ADD_METATYPE_TEST_ROW)
QTest::newRow("QPair<P,C>") << ::qMetaTypeId<QPair<P,C> >() << false << true << false << false;
QTest::newRow("QPair<P,M>") << ::qMetaTypeId<QPair<P,M> >() << true << true << false << false;
QTest::newRow("QPair<P,P>") << ::qMetaTypeId<QPair<P,P> >() << true << false << false << false;
- QTest::newRow("FlagsDataEnum") << ::qMetaTypeId<FlagsDataEnum>() << false << true << false << true;
+ QTest::newRow("FlagsDataEnum") << ::qMetaTypeId<FlagsDataEnum>() << true << true << false << true;
// invalid ids.
QTest::newRow("-1") << -1 << false << false << false << false;
@@ -1052,9 +1052,9 @@ void tst_QMetaType::flagsBinaryCompatibility5_0()
QFETCH(quint32, id);
QFETCH(quint32, flags);
- quint32 mask_5_0 = 0x1ff; // Only compare the values that were already defined in 5.0
+ quint32 mask_5_0 = 0x1fb; // Only compare the values that were already defined in 5.0
- QCOMPARE(quint32(QMetaType::typeFlags(id)) & mask_5_0, flags);
+ QCOMPARE(quint32(QMetaType::typeFlags(id)) & mask_5_0, flags & mask_5_0);
}
void tst_QMetaType::construct_data()
diff --git a/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp b/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp
index 01bf16c295..d368d9961b 100644
--- a/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp
+++ b/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp
@@ -70,7 +70,7 @@ void tst_QMimeData::clear() const
mimeData.setData("text/plain", "pirates");
QVERIFY(mimeData.hasText());
mimeData.clear();
- QVERIFY(mimeData.hasText() == false);
+ QVERIFY(!mimeData.hasText());
// repopulate, verify not empty
mimeData.setData("text/plain", "pirates");
@@ -136,7 +136,7 @@ void tst_QMimeData::hasColor() const
QMimeData mimeData;
// initial state
- QVERIFY(mimeData.hasColor() == false);
+ QVERIFY(!mimeData.hasColor());
// set, verify
mimeData.setColorData(QColor(Qt::red));
@@ -144,11 +144,11 @@ void tst_QMimeData::hasColor() const
// clear, verify
mimeData.clear();
- QVERIFY(mimeData.hasColor() == false);
+ QVERIFY(!mimeData.hasColor());
// set something else, verify
mimeData.setData("text/plain", "pirates");
- QVERIFY(mimeData.hasColor() == false);
+ QVERIFY(!mimeData.hasColor());
}
void tst_QMimeData::hasFormat() const
@@ -156,17 +156,17 @@ void tst_QMimeData::hasFormat() const
QMimeData mimeData;
// initial state
- QVERIFY(mimeData.hasFormat("text/plain") == false);
+ QVERIFY(!mimeData.hasFormat("text/plain"));
// add, verify
mimeData.setData("text/plain", "pirates");
QVERIFY(mimeData.hasFormat("text/plain"));
- QVERIFY(mimeData.hasFormat("text/html") == false);
+ QVERIFY(!mimeData.hasFormat("text/html"));
// clear, verify
mimeData.clear();
- QVERIFY(mimeData.hasFormat("text/plain") == false);
- QVERIFY(mimeData.hasFormat("text/html") == false);
+ QVERIFY(!mimeData.hasFormat("text/plain"));
+ QVERIFY(!mimeData.hasFormat("text/html"));
}
void tst_QMimeData::hasHtml() const
@@ -174,11 +174,11 @@ void tst_QMimeData::hasHtml() const
QMimeData mimeData;
// initial state
- QVERIFY(mimeData.hasHtml() == false);
+ QVERIFY(!mimeData.hasHtml());
// add plain, verify false
mimeData.setData("text/plain", "pirates");
- QVERIFY(mimeData.hasHtml() == false);
+ QVERIFY(!mimeData.hasHtml());
// add html, verify
mimeData.setData("text/html", "ninjas");
@@ -186,7 +186,7 @@ void tst_QMimeData::hasHtml() const
// clear, verify
mimeData.clear();
- QVERIFY(mimeData.hasHtml() == false);
+ QVERIFY(!mimeData.hasHtml());
// readd, verify
mimeData.setData("text/html", "ninjas");
@@ -198,11 +198,11 @@ void tst_QMimeData::hasImage() const
QMimeData mimeData;
// initial state
- QVERIFY(mimeData.hasImage() == false);
+ QVERIFY(!mimeData.hasImage());
// add text, verify false
mimeData.setData("text/plain", "pirates");
- QVERIFY(mimeData.hasImage() == false);
+ QVERIFY(!mimeData.hasImage());
// add image
mimeData.setImageData(QImage());
@@ -210,7 +210,7 @@ void tst_QMimeData::hasImage() const
// clear, verify
mimeData.clear();
- QVERIFY(mimeData.hasImage() == false);
+ QVERIFY(!mimeData.hasImage());
}
void tst_QMimeData::imageData() const
@@ -244,13 +244,13 @@ void tst_QMimeData::removeFormat() const
// remove, verify
mimeData.removeFormat("text/plain");
- QVERIFY(mimeData.hasFormat("text/plain") == false);
+ QVERIFY(!mimeData.hasFormat("text/plain"));
QVERIFY(mimeData.hasFormat("text/html"));
// remove, verify
mimeData.removeFormat("text/html");
- QVERIFY(mimeData.hasFormat("text/plain") == false);
- QVERIFY(mimeData.hasFormat("text/html") == false);
+ QVERIFY(!mimeData.hasFormat("text/plain"));
+ QVERIFY(!mimeData.hasFormat("text/html"));
}
void tst_QMimeData::setHtml() const
@@ -258,7 +258,7 @@ void tst_QMimeData::setHtml() const
QMimeData mimeData;
// initial state
- QVERIFY(mimeData.hasHtml() == false);
+ QVERIFY(!mimeData.hasHtml());
// add html, verify
mimeData.setHtml("ninjas");
@@ -277,7 +277,7 @@ void tst_QMimeData::setText() const
// verify initial state
QCOMPARE(mimeData.text(), QLatin1String(""));
- QVERIFY(mimeData.hasText() == false);
+ QVERIFY(!mimeData.hasText());
// set, verify
mimeData.setText("pirates");
@@ -294,7 +294,7 @@ void tst_QMimeData::setText() const
// clear, verify
mimeData.clear();
QCOMPARE(mimeData.text(), QLatin1String(""));
- QVERIFY(mimeData.hasText() == false);
+ QVERIFY(!mimeData.hasText());
}
// Publish retrieveData for verifying content validity
diff --git a/tests/auto/corelib/kernel/qobject/BLACKLIST b/tests/auto/corelib/kernel/qobject/BLACKLIST
new file mode 100644
index 0000000000..0887a73b4c
--- /dev/null
+++ b/tests/auto/corelib/kernel/qobject/BLACKLIST
@@ -0,0 +1,2 @@
+[moveToThread]
+windows
diff --git a/tests/auto/corelib/kernel/qobject/qobject.pro b/tests/auto/corelib/kernel/qobject/qobject.pro
index 6a7cf07f51..bd83396ca0 100644
--- a/tests/auto/corelib/kernel/qobject/qobject.pro
+++ b/tests/auto/corelib/kernel/qobject/qobject.pro
@@ -1,6 +1,6 @@
TEMPLATE = subdirs
CONFIG += ordered
-SUBDIRS += \
- signalbug \
- test
+!winrt: SUBDIRS+= signalbug
+
+SUBDIRS += test
diff --git a/tests/auto/corelib/kernel/qobject/test/test.pro b/tests/auto/corelib/kernel/qobject/test/test.pro
index 0a15ae384e..3ac728931d 100644
--- a/tests/auto/corelib/kernel/qobject/test/test.pro
+++ b/tests/auto/corelib/kernel/qobject/test/test.pro
@@ -4,5 +4,5 @@ TARGET = ../tst_qobject
QT = core-private network testlib
SOURCES = ../tst_qobject.cpp
-TEST_HELPER_INSTALLS = ../signalbug/signalbug
+!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 5b1dad78cf..f7c1f03c0f 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
@@ -1925,7 +1925,7 @@ void tst_QObject::property()
QCOMPARE(object.property("string"), QVariant("String1"));
QVERIFY(object.setProperty("string", "String2"));
QCOMPARE(object.property("string"), QVariant("String2"));
- QVERIFY(!object.setProperty("string", QVariant()));
+ QVERIFY(object.setProperty("string", QVariant()));
const int idx = mo->indexOfProperty("variant");
QVERIFY(idx != -1);
@@ -2027,7 +2027,7 @@ void tst_QObject::property()
QCOMPARE(object.property("customString"), QVariant("String1"));
QVERIFY(object.setProperty("customString", "String2"));
QCOMPARE(object.property("customString"), QVariant("String2"));
- QVERIFY(!object.setProperty("customString", QVariant()));
+ QVERIFY(object.setProperty("customString", QVariant()));
}
void tst_QObject::metamethod()
diff --git a/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp b/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp
index 814c4bb691..d7cce4ada4 100644
--- a/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp
+++ b/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp
@@ -50,6 +50,7 @@ private slots:
void destructor();
void assignment_operators();
void equality_operators();
+ void swap();
void isNull();
void dereference_operators();
void disconnect();
@@ -169,6 +170,22 @@ void tst_QPointer::equality_operators()
#endif
}
+void tst_QPointer::swap()
+{
+ QPointer<QObject> c1, c2;
+ {
+ QObject o;
+ c1 = &o;
+ QVERIFY(c2.isNull());
+ QCOMPARE(c1.data(), &o);
+ c1.swap(c2);
+ QVERIFY(c1.isNull());
+ QCOMPARE(c2.data(), &o);
+ }
+ QVERIFY(c1.isNull());
+ QVERIFY(c2.isNull());
+}
+
void tst_QPointer::isNull()
{
QPointer<QObject> p1;
diff --git a/tests/auto/corelib/kernel/qsocketnotifier/BLACKLIST b/tests/auto/corelib/kernel/qsocketnotifier/BLACKLIST
new file mode 100644
index 0000000000..e68bf84268
--- /dev/null
+++ b/tests/auto/corelib/kernel/qsocketnotifier/BLACKLIST
@@ -0,0 +1,3 @@
+[unexpectedDisconnection]
+windows
+osx
diff --git a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
index 1d1432f600..b34a3a6beb 100644
--- a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
+++ b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
@@ -72,6 +72,7 @@ private slots:
void singleShotStaticFunctionZeroTimeout();
void recurseOnTimeoutAndStopTimer();
void singleShotToFunctors();
+ void crossThreadSingleShotToFunctor();
void dontBlockEvents();
void postedEventsShouldNotStarveTimers();
@@ -440,6 +441,9 @@ void tst_QTimer::deleteLaterOnQTimer()
void tst_QTimer::moveToThread()
{
+#if defined(Q_OS_WIN32)
+ QSKIP("Does not work reliably on Windows :(");
+#endif
QTimer ti1;
QTimer ti2;
ti1.start(MOVETOTHREAD_TIMEOUT);
@@ -874,5 +878,28 @@ void tst_QTimer::postedEventsShouldNotStarveTimers()
QVERIFY(timerHelper.count > 5);
}
+struct DummyFunctor {
+ void operator()() {}
+};
+
+void tst_QTimer::crossThreadSingleShotToFunctor()
+{
+ // We're testing for crashes here, so the test simply running to
+ // completion is considered a success
+ QThread t;
+ t.start();
+
+ QObject* o = new QObject();
+ o->moveToThread(&t);
+
+ for (int i = 0; i < 10000; i++) {
+ QTimer::singleShot(0, o, DummyFunctor());
+ }
+
+ t.quit();
+ t.wait();
+ delete o;
+}
+
QTEST_MAIN(tst_QTimer)
#include "tst_qtimer.moc"
diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
index a192ccde59..c91bb21399 100644
--- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
+++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
@@ -2,6 +2,7 @@
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2015 Olivier Goffart <ogoffart@woboq.com>
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -1710,12 +1711,16 @@ void tst_QVariant::compareNumbers_data() const
QTest::newRow("float3") << qVariantFromValue(0.f) << qVariantFromValue(-1.f) << +1;
QTest::newRow("float4") << qVariantFromValue(-float(qInf())) << qVariantFromValue(0.f) << -1;
QTest::newRow("float5") << qVariantFromValue(0.f) << qVariantFromValue(-float(qInf())) << +1;
+ QTest::newRow("float6") << qVariantFromValue(-float(qInf())) << qVariantFromValue(-float(qInf())) << 0;
+ QTest::newRow("float7") << qVariantFromValue(float(qInf())) << qVariantFromValue(float(qInf())) << 0;
QTest::newRow("double1") << qVariantFromValue(0.) << qVariantFromValue(0.) << 0;
QTest::newRow("double2") << qVariantFromValue(-1.) << qVariantFromValue(0.) << -1;
QTest::newRow("double3") << qVariantFromValue(0.) << qVariantFromValue(-1.) << +1;
QTest::newRow("double4") << qVariantFromValue(-qInf()) << qVariantFromValue(0.) << -1;
QTest::newRow("double5") << qVariantFromValue(0.) << qVariantFromValue(-qInf()) << +1;
+ QTest::newRow("double6") << qVariantFromValue(-double(qInf())) << qVariantFromValue(-qInf()) << 0;
+ QTest::newRow("double7") << qVariantFromValue(qInf()) << qVariantFromValue(qInf()) << 0;
// mixed comparisons
// fp + fp
@@ -1724,6 +1729,8 @@ void tst_QVariant::compareNumbers_data() const
QTest::newRow("float+double3") << qVariantFromValue(0.f) << qVariantFromValue(-1.) << +1;
QTest::newRow("float+double4") << qVariantFromValue(-float(qInf())) << qVariantFromValue(0.) << -1;
QTest::newRow("float+double5") << qVariantFromValue(0.f) << qVariantFromValue(-qInf()) << +1;
+ QTest::newRow("float+double6") << qVariantFromValue(-float(qInf())) << qVariantFromValue(qInf()) << 0;
+ QTest::newRow("float+double7") << qVariantFromValue(float(qInf())) << qVariantFromValue(qInf()) << 0;
// fp + int
QTest::newRow("float+int1") << qVariantFromValue(0.f) << qVariantFromValue(0) << 0;
@@ -1734,6 +1741,7 @@ void tst_QVariant::compareNumbers_data() const
QTest::newRow("double+int3") << qVariantFromValue(0.) << qVariantFromValue(-1) << +1;
QTest::newRow("float+int4") << qVariantFromValue(1.5f) << qVariantFromValue(1) << +1;
QTest::newRow("double+int4") << qVariantFromValue(1.5) << qVariantFromValue(1) << +1;
+ QTest::newRow("double+int5") << qVariantFromValue(qInf()) << qVariantFromValue(1) << +1;
// fp + uint
QTest::newRow("float+uint1") << qVariantFromValue(0.f) << qVariantFromValue(0U) << 0;
@@ -2491,14 +2499,26 @@ void tst_QVariant::variantMap()
QVariant v = map;
QVariantMap map2 = qvariant_cast<QVariantMap>(v);
+ QCOMPARE(map2.value("test").toInt(), 42);
+ QCOMPARE(map2, map);
+ map2 = v.toMap();
QCOMPARE(map2.value("test").toInt(), 42);
+ QCOMPARE(map2, map);
QVariant v2 = QVariant(QMetaType::type("QVariantMap"), &map);
QCOMPARE(qvariant_cast<QVariantMap>(v2).value("test").toInt(), 42);
QVariant v3 = QVariant(QMetaType::type("QMap<QString, QVariant>"), &map);
QCOMPARE(qvariant_cast<QVariantMap>(v3).value("test").toInt(), 42);
+
+ // multi-keys
+ map.insertMulti("test", 47);
+ v = map;
+ map2 = qvariant_cast<QVariantMap>(v);
+ QCOMPARE(map2, map);
+ map2 = v.toMap();
+ QCOMPARE(map2, map);
}
void tst_QVariant::variantHash()
@@ -2508,14 +2528,26 @@ void tst_QVariant::variantHash()
QVariant v = hash;
QVariantHash hash2 = qvariant_cast<QVariantHash>(v);
+ QCOMPARE(hash2.value("test").toInt(), 42);
+ QCOMPARE(hash2, hash);
+ hash2 = v.toHash();
QCOMPARE(hash2.value("test").toInt(), 42);
+ QCOMPARE(hash2, hash);
QVariant v2 = QVariant(QMetaType::type("QVariantHash"), &hash);
QCOMPARE(qvariant_cast<QVariantHash>(v2).value("test").toInt(), 42);
QVariant v3 = QVariant(QMetaType::type("QHash<QString, QVariant>"), &hash);
QCOMPARE(qvariant_cast<QVariantHash>(v3).value("test").toInt(), 42);
+
+ // multi-keys
+ hash.insertMulti("test", 47);
+ v = hash;
+ hash2 = qvariant_cast<QVariantHash>(v);
+ QCOMPARE(hash2, hash);
+ hash2 = v.toHash();
+ QCOMPARE(hash2, hash);
}
class CustomQObject : public QObject {
@@ -3233,24 +3265,40 @@ void tst_QVariant::convertIterables() const
map.insert("3", 4);
QCOMPARE(QVariant::fromValue(map).value<QVariantHash>().count(), map.count());
QCOMPARE(QVariant::fromValue(map).value<QVariantMap>().count(), map.count());
+
+ map.insertMulti("3", 5);
+ QCOMPARE(QVariant::fromValue(map).value<QVariantHash>().count(), map.count());
+ QCOMPARE(QVariant::fromValue(map).value<QVariantMap>().count(), map.count());
}
{
QVariantMap map;
map.insert("3", 4);
QCOMPARE(QVariant::fromValue(map).value<QVariantHash>().count(), map.count());
QCOMPARE(QVariant::fromValue(map).value<QVariantMap>().count(), map.count());
+
+ map.insertMulti("3", 5);
+ QCOMPARE(QVariant::fromValue(map).value<QVariantHash>().count(), map.count());
+ QCOMPARE(QVariant::fromValue(map).value<QVariantMap>().count(), map.count());
}
{
QHash<QString, int> hash;
hash.insert("3", 4);
QCOMPARE(QVariant::fromValue(hash).value<QVariantHash>().count(), hash.count());
QCOMPARE(QVariant::fromValue(hash).value<QVariantMap>().count(), hash.count());
+
+ hash.insertMulti("3", 5);
+ QCOMPARE(QVariant::fromValue(hash).value<QVariantHash>().count(), hash.count());
+ QCOMPARE(QVariant::fromValue(hash).value<QVariantMap>().count(), hash.count());
}
{
QVariantHash hash;
hash.insert("3", 4);
QCOMPARE(QVariant::fromValue(hash).value<QVariantHash>().count(), hash.count());
QCOMPARE(QVariant::fromValue(hash).value<QVariantMap>().count(), hash.count());
+
+ hash.insertMulti("3", 5);
+ QCOMPARE(QVariant::fromValue(hash).value<QVariantHash>().count(), hash.count());
+ QCOMPARE(QVariant::fromValue(hash).value<QVariantMap>().count(), hash.count());
}
}
@@ -3357,9 +3405,6 @@ void tst_QVariant::numericalConvert_data()
void tst_QVariant::numericalConvert()
{
-#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(__x86_64__)
- QSKIP("Known to fail due to a GCC bug on at least Ubuntu 10.04 32-bit - check QTBUG-8959");
-#endif
QFETCH(QVariant, v);
QFETCH(bool, isInteger);
double num = isInteger ? 5 : 5.3;
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
index 763bb58602..1b4dc020f2 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
@@ -35,6 +35,12 @@
#include "qstandardpaths.h"
+#ifdef Q_OS_UNIX
+#include <sys/types.h>
+#include <sys/stat.h>
+#endif
+
+#include <QtCore/QElapsedTimer>
#include <QtCore/QFile>
#include <QtCore/QFileInfo>
#include <QtCore/QStandardPaths>
@@ -126,6 +132,7 @@ tst_QMimeDatabase::tst_QMimeDatabase()
void tst_QMimeDatabase::initTestCase()
{
+ QVERIFY2(m_temporaryDir.isValid(), qPrintable(m_temporaryDir.errorString()));
QStandardPaths::setTestModeEnabled(true);
m_localMimeDir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/mime";
if (QDir(m_localMimeDir).exists()) {
@@ -136,7 +143,8 @@ void tst_QMimeDatabase::initTestCase()
#ifdef USE_XDG_DATA_DIRS
// Create a temporary "global" XDG data dir for later use
// It will initially contain a copy of freedesktop.org.xml
- QVERIFY(m_temporaryDir.isValid());
+ QVERIFY2(m_temporaryDir.isValid(),
+ ("Could not create temporary subdir: " + m_temporaryDir.errorString()).toUtf8());
const QDir here = QDir(m_temporaryDir.path());
m_globalXdgDir = m_temporaryDir.path() + QStringLiteral("/global");
const QString globalPackageDir = m_globalXdgDir + QStringLiteral("/mime/packages");
@@ -643,6 +651,28 @@ void tst_QMimeDatabase::knownSuffix()
QCOMPARE(db.suffixForFileName(QString::fromLatin1("foo.tar.bz2")), QString::fromLatin1("tar.bz2"));
}
+void tst_QMimeDatabase::symlinkToFifo() // QTBUG-48529
+{
+#ifdef Q_OS_UNIX
+ QTemporaryDir tempDir;
+ QVERIFY(tempDir.isValid());
+ const QString dir = tempDir.path();
+ const QString fifo = dir + "/fifo";
+ QCOMPARE(mkfifo(QFile::encodeName(fifo), 0006), 0);
+
+ QMimeDatabase db;
+ QCOMPARE(db.mimeTypeForFile(fifo).name(), QString::fromLatin1("inode/fifo"));
+
+ // Now make a symlink to the fifo
+ const QString link = dir + "/link";
+ QVERIFY(QFile::link(fifo, link));
+ QCOMPARE(db.mimeTypeForFile(link).name(), QString::fromLatin1("inode/fifo"));
+
+#else
+ QSKIP("This test requires pipes and symlinks");
+#endif
+}
+
void tst_QMimeDatabase::findByFileName_data()
{
QTest::addColumn<QString>("filePath");
@@ -825,16 +855,20 @@ static bool runUpdateMimeDatabase(const QString &path) // TODO make it a QMimeDa
return false;
}
+ QElapsedTimer timer;
QProcess proc;
proc.setProcessChannelMode(QProcess::MergedChannels); // silence output
+ qDebug().noquote() << "runUpdateMimeDatabase: running" << umd << path << "...";
+ timer.start();
proc.start(umd, QStringList(path));
if (!proc.waitForStarted()) {
qWarning("Cannot start %s: %s",
qPrintable(umd), qPrintable(proc.errorString()));
return false;
}
- proc.waitForFinished();
- //qDebug() << "runUpdateMimeDatabase" << path;
+ const bool success = proc.waitForFinished();
+ qDebug().noquote() << "runUpdateMimeDatabase: done,"
+ << success << timer.elapsed() << "ms";
return true;
}
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h
index 2827bd2dc4..4b703f15d7 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.h
@@ -70,6 +70,7 @@ private slots:
void suffixes_data();
void suffixes();
void knownSuffix();
+ void symlinkToFifo();
void fromThreads();
// shared-mime-info test suite
diff --git a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp
index e87585163b..f31a7af6dd 100644
--- a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp
+++ b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp
@@ -413,15 +413,6 @@ void tst_QLibrary::loadHints_data()
QTest::addColumn<bool>("result");
QLibrary::LoadHints lh;
-#if defined(Q_OS_AIX)
- if (QFile::exists("/usr/lib/libGL.a") || QFile::exists("/usr/X11R6/lib/libGL.a")) {
-# if QT_POINTER_SIZE == 4
- QTest::newRow( "ok03 (Archive member)" ) << "libGL.a(shr.o)" << int(QLibrary::LoadArchiveMemberHint) << true;
-# else
- QTest::newRow( "ok03 (Archive member)" ) << "libGL.a(shr_64.o)" << int(QLibrary::LoadArchiveMemberHint) << true;
-#endif
- }
-#endif
QString appDir = QCoreApplication::applicationDirPath();
diff --git a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
index bdbb291d7f..72bd38d116 100644
--- a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
+++ b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
@@ -120,6 +120,7 @@ private slots:
void loadGarbage();
#endif
void relativePath();
+ void absolutePath();
void reloadPlugin();
void preloadedPlugin_data();
void preloadedPlugin();
@@ -311,7 +312,7 @@ void tst_QPluginLoader::loadCorruptElf()
void tst_QPluginLoader::loadMachO_data()
{
-#ifdef Q_OF_MACH_O
+#if defined(QT_BUILD_INTERNAL) && defined(Q_OF_MACH_O)
QTest::addColumn<int>("parseResult");
QTest::newRow("/dev/null") << int(QMachOParser::NotSuitable);
@@ -347,7 +348,7 @@ void tst_QPluginLoader::loadMachO_data()
void tst_QPluginLoader::loadMachO()
{
-#ifdef Q_OF_MACH_O
+#if defined(QT_BUILD_INTERNAL) && defined(Q_OF_MACH_O)
QFile f(QFINDTESTDATA(QTest::currentDataTag()));
QVERIFY(f.open(QIODevice::ReadOnly));
QByteArray data = f.readAll();
@@ -406,6 +407,20 @@ void tst_QPluginLoader::relativePath()
QVERIFY(loader.unload());
}
+void tst_QPluginLoader::absolutePath()
+{
+ // 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());
+ QVERIFY(QDir::isAbsolutePath(binDir));
+ QPluginLoader loader(binDir + "/theplugin");
+ loader.load(); // not recommended, instance() should do the job.
+ PluginInterface *instance = qobject_cast<PluginInterface*>(loader.instance());
+ QVERIFY(instance);
+ QCOMPARE(instance->pluginName(), QLatin1String("Plugin ok"));
+ QVERIFY(loader.unload());
+}
+
void tst_QPluginLoader::reloadPlugin()
{
QPluginLoader loader;
diff --git a/tests/auto/corelib/statemachine/qstate/tst_qstate.cpp b/tests/auto/corelib/statemachine/qstate/tst_qstate.cpp
index ac3374b6a3..c64d55671a 100644
--- a/tests/auto/corelib/statemachine/qstate/tst_qstate.cpp
+++ b/tests/auto/corelib/statemachine/qstate/tst_qstate.cpp
@@ -47,6 +47,7 @@ private slots:
void historyInitialState();
void transitions();
void privateSignals();
+ void parallelStateAndInitialState();
};
class TestClass: public QObject
@@ -344,5 +345,35 @@ void tst_QState::privateSignals()
}
+void tst_QState::parallelStateAndInitialState()
+{
+ QStateMachine machine;
+
+ { // setting an initial state on a parallel state:
+ QState a(QState::ParallelStates, &machine);
+ QState b(&a);
+ QVERIFY(!a.initialState());
+ const QString warning
+ = QString::asprintf("QState::setInitialState: ignoring attempt to set initial state of parallel state group %p", &a);
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
+ a.setInitialState(&b); // should produce a warning and do nothing.
+ QVERIFY(!a.initialState());
+ }
+
+ { // setting the child-mode from ExclusiveStates to ParallelStates should remove the initial state:
+ QState a(QState::ExclusiveStates, &machine);
+ QState b(&a);
+ a.setInitialState(&b);
+ QCOMPARE(a.initialState(), &b);
+ const QString warning
+ = QString::asprintf("QState::setChildMode: setting the child-mode of state %p to "
+ "parallel removes the initial state", &a);
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(warning));
+ a.setChildMode(QState::ParallelStates); // should produce a warning and remove the initial state
+ QVERIFY(!a.initialState());
+ QCOMPARE(a.childMode(), QState::ParallelStates);
+ }
+}
+
QTEST_MAIN(tst_QState)
#include "tst_qstate.moc"
diff --git a/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp b/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
index e60b1c983c..8c76809c48 100644
--- a/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
+++ b/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
@@ -249,7 +249,9 @@ private slots:
void qtbug_44783();
void internalTransition();
void conflictingTransition();
+ void conflictingTransition2();
void qtbug_46059();
+ void qtbug_46703();
void postEventFromBeginSelectTransitions();
};
@@ -266,7 +268,7 @@ public:
TestState(ChildMode mode, const QString &objectName = QString())
: QState(mode)
{ setObjectName(objectName); }
- QList<QPair<int, Event> > events;
+ QVector<QPair<int, Event> > events;
protected:
virtual void onEntry(QEvent *) {
events.append(qMakePair(globalTick++, Entry));
@@ -282,7 +284,7 @@ public:
TestTransition(QAbstractState *target, const QString &objectName = QString())
: QAbstractTransition()
{ setTargetState(target); setObjectName(objectName); }
- QList<int> triggers;
+ QVector<int> triggers;
protected:
virtual bool eventTest(QEvent *) {
return true;
@@ -4861,7 +4863,7 @@ public:
signalList.append(signal);
}
- QList<QMetaMethod> signalList;
+ QVector<QMetaMethod> signalList;
};
void tst_QStateMachine::testIncrementReceivers()
@@ -6448,6 +6450,71 @@ void tst_QStateMachine::conflictingTransition()
QVERIFY(machine.isRunning());
}
+void tst_QStateMachine::conflictingTransition2()
+{
+ SignalEmitter emitter;
+
+ QStateMachine machine;
+ QState s0(&machine);
+ QState p0(QState::ParallelStates, &s0);
+ QState p0s1(&p0);
+ QState p0s2(&p0);
+ QState p0s3(&p0);
+ QState s1(&machine);
+
+ machine.setInitialState(&s0);
+ s0.setInitialState(&p0);
+
+ QSignalTransition *t1 = new QSignalTransition(&emitter, SIGNAL(signalWithNoArg()));
+ p0s1.addTransition(t1);
+ QSignalTransition *t2 = p0s2.addTransition(&emitter, SIGNAL(signalWithNoArg()), &p0s1);
+ QSignalTransition *t3 = p0s3.addTransition(&emitter, SIGNAL(signalWithNoArg()), &s1);
+ QSignalSpy t1Spy(t1, &QAbstractTransition::triggered);
+ QSignalSpy t2Spy(t2, &QAbstractTransition::triggered);
+ QSignalSpy t3Spy(t3, &QAbstractTransition::triggered);
+ QVERIFY(t1Spy.isValid());
+ QVERIFY(t2Spy.isValid());
+ QVERIFY(t3Spy.isValid());
+
+ s0.setObjectName("s0");
+ p0.setObjectName("p0");
+ p0s1.setObjectName("p0s1");
+ p0s2.setObjectName("p0s2");
+ p0s3.setObjectName("p0s3");
+ s1.setObjectName("s1");
+ t1->setObjectName("p0s1->p0s1");
+ t2->setObjectName("p0s2->p0s1");
+ t3->setObjectName("p0s3->s1");
+
+ machine.start();
+
+ QTRY_COMPARE(machine.configuration().contains(&s0), true);
+ QTRY_COMPARE(machine.configuration().contains(&p0), true);
+ QTRY_COMPARE(machine.configuration().contains(&p0s1), true);
+ QTRY_COMPARE(machine.configuration().contains(&p0s2), true);
+ QTRY_COMPARE(machine.configuration().contains(&p0s3), true);
+ QTRY_COMPARE(machine.configuration().contains(&s1), false);
+
+ QCOMPARE(t1Spy.count(), 0);
+ QCOMPARE(t2Spy.count(), 0);
+ QCOMPARE(t3Spy.count(), 0);
+
+ emitter.emitSignalWithNoArg();
+
+ QTRY_COMPARE(machine.configuration().contains(&s0), true);
+ QTRY_COMPARE(machine.configuration().contains(&p0), true);
+ QTRY_COMPARE(machine.configuration().contains(&p0s1), true);
+ QTRY_COMPARE(machine.configuration().contains(&p0s2), true);
+ QTRY_COMPARE(machine.configuration().contains(&p0s3), true);
+ QTRY_COMPARE(machine.configuration().contains(&s1), false);
+
+ QCOMPARE(t1Spy.count(), 1);
+ QCOMPARE(t2Spy.count(), 1);
+ QCOMPARE(t3Spy.count(), 0); // t3 got preempted by t2
+
+ QVERIFY(machine.isRunning());
+}
+
void tst_QStateMachine::qtbug_46059()
{
QStateMachine machine;
@@ -6486,6 +6553,60 @@ void tst_QStateMachine::qtbug_46059()
QVERIFY(machine.isRunning());
}
+void tst_QStateMachine::qtbug_46703()
+{
+ QStateMachine machine;
+ QState root(&machine);
+ QHistoryState h(&root);
+ QState p(QState::ParallelStates, &root);
+ QState a(&p);
+ QState a1(&a);
+ QState a2(&a);
+ QState a3(&a);
+ QState b(&p);
+ QState b1(&b);
+ QState b2(&b);
+
+ machine.setObjectName("machine");
+ root.setObjectName("root");
+ h.setObjectName("h");
+ p.setObjectName("p");
+ a.setObjectName("a");
+ a1.setObjectName("a1");
+ a2.setObjectName("a2");
+ a3.setObjectName("a3");
+ b.setObjectName("b");
+ b1.setObjectName("b1");
+ b2.setObjectName("b2");
+
+ machine.setInitialState(&root);
+ root.setInitialState(&h);
+ a.setInitialState(&a3);
+ b.setInitialState(&b1);
+ struct : public QAbstractTransition {
+ virtual bool eventTest(QEvent *) { return false; }
+ virtual void onTransition(QEvent *) {}
+ } defaultTransition;
+ defaultTransition.setTargetStates(QList<QAbstractState*>() << &a2 << &b2);
+ h.setDefaultTransition(&defaultTransition);
+
+ machine.start();
+ QCoreApplication::processEvents();
+
+ QTRY_COMPARE(machine.configuration().contains(&root), true);
+ QTRY_COMPARE(machine.configuration().contains(&h), false);
+ QTRY_COMPARE(machine.configuration().contains(&p), true);
+ QTRY_COMPARE(machine.configuration().contains(&a), true);
+ QTRY_COMPARE(machine.configuration().contains(&a1), false);
+ QTRY_COMPARE(machine.configuration().contains(&a2), true);
+ QTRY_COMPARE(machine.configuration().contains(&a3), false);
+ QTRY_COMPARE(machine.configuration().contains(&b), true);
+ QTRY_COMPARE(machine.configuration().contains(&b1), false);
+ QTRY_COMPARE(machine.configuration().contains(&b2), true);
+
+ QVERIFY(machine.isRunning());
+}
+
void tst_QStateMachine::postEventFromBeginSelectTransitions()
{
class StateMachine : public QStateMachine {
diff --git a/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp b/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp
index e8c58a9fa5..72ae68f81a 100644
--- a/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp
+++ b/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp
@@ -479,34 +479,34 @@ void tst_QAtomicInt::testAndSet_data()
QTest::addColumn<int>("value");
QTest::addColumn<int>("expected");
QTest::addColumn<int>("newval");
- QTest::addColumn<int>("result");
+ QTest::addColumn<bool>("result");
// these should succeed
- QTest::newRow("success0") << 0 << 0 << 0 << 1;
- QTest::newRow("success1") << 0 << 0 << 1 << 1;
- QTest::newRow("success2") << 0 << 0 << -1 << 1;
- QTest::newRow("success3") << 1 << 1 << 0 << 1;
- QTest::newRow("success4") << 1 << 1 << 1 << 1;
- QTest::newRow("success5") << 1 << 1 << -1 << 1;
- QTest::newRow("success6") << -1 << -1 << 0 << 1;
- QTest::newRow("success7") << -1 << -1 << 1 << 1;
- QTest::newRow("success8") << -1 << -1 << -1 << 1;
- QTest::newRow("success9") << INT_MIN+1 << INT_MIN+1 << INT_MIN+1 << 1;
- QTest::newRow("successA") << INT_MIN+1 << INT_MIN+1 << 1 << 1;
- QTest::newRow("successB") << INT_MIN+1 << INT_MIN+1 << -1 << 1;
- QTest::newRow("successC") << INT_MAX << INT_MAX << INT_MAX << 1;
- QTest::newRow("successD") << INT_MAX << INT_MAX << 1 << 1;
- QTest::newRow("successE") << INT_MAX << INT_MAX << -1 << 1;
+ QTest::newRow("success0") << 0 << 0 << 0 << true;
+ QTest::newRow("success1") << 0 << 0 << 1 << true;
+ QTest::newRow("success2") << 0 << 0 << -1 << true;
+ QTest::newRow("success3") << 1 << 1 << 0 << true;
+ QTest::newRow("success4") << 1 << 1 << 1 << true;
+ QTest::newRow("success5") << 1 << 1 << -1 << true;
+ QTest::newRow("success6") << -1 << -1 << 0 << true;
+ QTest::newRow("success7") << -1 << -1 << 1 << true;
+ QTest::newRow("success8") << -1 << -1 << -1 << true;
+ QTest::newRow("success9") << INT_MIN+1 << INT_MIN+1 << INT_MIN+1 << true;
+ QTest::newRow("successA") << INT_MIN+1 << INT_MIN+1 << 1 << true;
+ QTest::newRow("successB") << INT_MIN+1 << INT_MIN+1 << -1 << true;
+ QTest::newRow("successC") << INT_MAX << INT_MAX << INT_MAX << true;
+ QTest::newRow("successD") << INT_MAX << INT_MAX << 1 << true;
+ QTest::newRow("successE") << INT_MAX << INT_MAX << -1 << true;
// these should fail
- QTest::newRow("failure0") << 0 << 1 << ~0 << 0;
- QTest::newRow("failure1") << 0 << -1 << ~0 << 0;
- QTest::newRow("failure2") << 1 << 0 << ~0 << 0;
- QTest::newRow("failure3") << -1 << 0 << ~0 << 0;
- QTest::newRow("failure4") << 1 << -1 << ~0 << 0;
- QTest::newRow("failure5") << -1 << 1 << ~0 << 0;
- QTest::newRow("failure6") << INT_MIN+1 << INT_MAX << ~0 << 0;
- QTest::newRow("failure7") << INT_MAX << INT_MIN+1 << ~0 << 0;
+ QTest::newRow("failure0") << 0 << 1 << ~0 << false;
+ QTest::newRow("failure1") << 0 << -1 << ~0 << false;
+ QTest::newRow("failure2") << 1 << 0 << ~0 << false;
+ QTest::newRow("failure3") << -1 << 0 << ~0 << false;
+ QTest::newRow("failure4") << 1 << -1 << ~0 << false;
+ QTest::newRow("failure5") << -1 << 1 << ~0 << false;
+ QTest::newRow("failure6") << INT_MIN+1 << INT_MAX << ~0 << false;
+ QTest::newRow("failure7") << INT_MAX << INT_MIN+1 << ~0 << false;
}
void tst_QAtomicInt::testAndSet()
@@ -517,26 +517,26 @@ void tst_QAtomicInt::testAndSet()
{
QAtomicInt atomic = value;
- QTEST(atomic.testAndSetRelaxed(expected, newval) ? 1 : 0, "result");
+ QTEST(atomic.testAndSetRelaxed(expected, newval), "result");
}
{
QAtomicInt atomic = value;
- QTEST(atomic.testAndSetAcquire(expected, newval) ? 1 : 0, "result");
+ QTEST(atomic.testAndSetAcquire(expected, newval), "result");
}
{
QAtomicInt atomic = value;
- QTEST(atomic.testAndSetRelease(expected, newval) ? 1 : 0, "result");
+ QTEST(atomic.testAndSetRelease(expected, newval), "result");
}
{
QAtomicInt atomic = value;
- QTEST(atomic.testAndSetOrdered(expected, newval) ? 1 : 0, "result");
+ QTEST(atomic.testAndSetOrdered(expected, newval), "result");
}
#ifdef Q_ATOMIC_INT32_IS_SUPPORTED
- QFETCH(int, result);
+ QFETCH(bool, result);
// the new implementation has the version that loads the current value
{
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/char/char.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/char/char.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/char/char.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/char/char.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/char16_t/char16_t.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/char16_t/char16_t.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/char16_t/char16_t.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/char16_t/char16_t.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/char32_t/char32_t.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/char32_t/char32_t.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/char32_t/char32_t.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/char32_t/char32_t.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/int/int.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/int/int.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/int/int.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/int/int.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/long/long.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/long/long.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/long/long.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/long/long.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/qlonglong/qlonglong.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/qlonglong/qlonglong.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/qlonglong/qlonglong.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/qlonglong/qlonglong.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/qptrdiff/qptrdiff.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/qptrdiff/qptrdiff.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/qptrdiff/qptrdiff.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/qptrdiff/qptrdiff.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/quintptr/quintptr.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/quintptr/quintptr.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/quintptr/quintptr.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/quintptr/quintptr.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/qulonglong/qulonglong.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/qulonglong/qulonglong.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/qulonglong/qulonglong.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/qulonglong/qulonglong.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/schar/schar.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/schar/schar.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/schar/schar.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/schar/schar.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/short/short.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/short/short.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/short/short.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/short/short.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/uchar/uchar.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/uchar/uchar.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/uchar/uchar.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/uchar/uchar.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/uint/uint.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/uint/uint.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/uint/uint.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/uint/uint.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/ulong/ulong.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/ulong/ulong.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/ulong/ulong.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/ulong/ulong.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/ushort/ushort.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/ushort/ushort.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/ushort/ushort.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/ushort/ushort.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/cxx11/wchar_t/wchar_t.pro b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/wchar_t/wchar_t.pro
index 64401f0229..64401f0229 100644
--- a/tests/auto/corelib/thread/qatomicinteger/cxx11/wchar_t/wchar_t.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/no-cxx11/wchar_t/wchar_t.pro
diff --git a/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pri b/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pri
index d9ebe64d5b..e80e71f238 100644
--- a/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pri
+++ b/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pri
@@ -3,9 +3,9 @@ TYPE = $$basename(_PRO_FILE_PWD_)
dn = $$dirname(_PRO_FILE_PWD_)
FORCE = $$basename(dn)
-equals(FORCE, cxx11) {
- suffix = Cxx11_$$TYPE
- DEFINES += QT_ATOMIC_FORCE_CXX11
+equals(FORCE, no-cxx11) {
+ suffix = NoCxx11_$$TYPE
+ DEFINES += QT_ATOMIC_FORCE_NO_CXX11
} else: equals(FORCE, gcc) {
suffix = Gcc_$$TYPE
DEFINES += QT_ATOMIC_FORCE_GCC
diff --git a/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pro b/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pro
index 58e5b157bd..9d929e649e 100644
--- a/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pro
+++ b/tests/auto/corelib/thread/qatomicinteger/qatomicinteger.pro
@@ -19,22 +19,22 @@ SUBDIRS=\
contains(QT_CONFIG, c++11)|msvc: SUBDIRS +=\
- cxx11/char \
- cxx11/char16_t \
- cxx11/char32_t \
- cxx11/int \
- cxx11/long \
- cxx11/qlonglong \
- cxx11/qptrdiff \
- cxx11/quintptr \
- cxx11/qulonglong \
- cxx11/schar \
- cxx11/short \
- cxx11/uchar \
- cxx11/uint \
- cxx11/ulong \
- cxx11/ushort \
- cxx11/wchar_t \
+ no-cxx11/char \
+ no-cxx11/char16_t \
+ no-cxx11/char32_t \
+ no-cxx11/int \
+ no-cxx11/long \
+ no-cxx11/qlonglong \
+ no-cxx11/qptrdiff \
+ no-cxx11/quintptr \
+ no-cxx11/qulonglong \
+ no-cxx11/schar \
+ no-cxx11/short \
+ no-cxx11/uchar \
+ no-cxx11/uint \
+ no-cxx11/ulong \
+ no-cxx11/ushort \
+ no-cxx11/wchar_t \
# The GCC-style atomics only support 32-bit and pointer-sized but add
diff --git a/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp b/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp
index 99978a9923..ad690a094b 100644
--- a/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp
+++ b/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp
@@ -648,7 +648,7 @@ void tst_QFuture::cancel()
result.reportStarted();
f = result.future();
- QVERIFY(f.isCanceled() == false);
+ QVERIFY(!f.isCanceled());
result.reportCanceled();
QVERIFY(f.isCanceled());
result.reportFinished();
@@ -663,14 +663,14 @@ void tst_QFuture::cancel()
QFutureInterface<void> result;
QFuture<void> f;
- QVERIFY(f.isStarted() == true);
+ QVERIFY(f.isStarted());
result.reportStarted();
f = result.future();
- QVERIFY(f.isStarted() == true);
+ QVERIFY(f.isStarted());
- QVERIFY(result.isCanceled() == false);
+ QVERIFY(!result.isCanceled());
f.cancel();
QVERIFY(result.isCanceled());
@@ -683,12 +683,12 @@ void tst_QFuture::cancel()
QFutureInterface<void> result;
QFuture<void> f;
- QVERIFY(f.isStarted() == true);
+ QVERIFY(f.isStarted());
result.reportStarted();
f = result.future();
- QVERIFY(f.isStarted() == true);
+ QVERIFY(f.isStarted());
result.reportFinished();
@@ -805,12 +805,12 @@ void tst_QFuture::indexedResults()
{
QFutureInterface<QChar> Interface;
QFuture<QChar> f;
- QVERIFY(f.isStarted() == true);
+ QVERIFY(f.isStarted());
Interface.reportStarted();
f = Interface.future();
- QVERIFY(f.isStarted() == true);
+ QVERIFY(f.isStarted());
QChar result;
@@ -1126,14 +1126,14 @@ void tst_QFuture::iterators()
QVERIFY(it.hasNext());
QCOMPARE(it.peekNext(), resultCount - 1);
QCOMPARE(it.next(), resultCount - 1);
- QVERIFY(it.hasNext() == false);
+ QVERIFY(!it.hasNext());
}
{
QFutureIterator<int> it(f);
QVERIFY(it.hasNext());
it.toBack();
- QVERIFY(it.hasNext() == false);
+ QVERIFY(!it.hasNext());
it.toFront();
QVERIFY(it.hasNext());
}
@@ -1192,15 +1192,15 @@ void tst_QFuture::pause()
Interface.reportStarted();
QFuture<void> f = Interface.future();
- QVERIFY(Interface.isPaused() == false);
+ QVERIFY(!Interface.isPaused());
f.pause();
- QVERIFY(Interface.isPaused() == true);
+ QVERIFY(Interface.isPaused());
f.resume();
- QVERIFY(Interface.isPaused() == false);
+ QVERIFY(!Interface.isPaused());
f.togglePaused();
- QVERIFY(Interface.isPaused() == true);
+ QVERIFY(Interface.isPaused());
f.togglePaused();
- QVERIFY(Interface.isPaused() == false);
+ QVERIFY(!Interface.isPaused());
Interface.reportFinished();
}
@@ -1228,13 +1228,13 @@ void tst_QFuture::throttling()
i.reportStarted();
QFuture<void> f = i.future();
- QVERIFY(i.isThrottled() == false);
+ QVERIFY(!i.isThrottled());
i.setThrottled(true);
QVERIFY(i.isThrottled());
i.setThrottled(false);
- QVERIFY(i.isThrottled() == false);
+ QVERIFY(!i.isThrottled());
i.setThrottled(true);
QVERIFY(i.isThrottled());
diff --git a/tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp b/tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp
index 8831345ad7..c4fad93e4b 100644
--- a/tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp
+++ b/tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp
@@ -68,6 +68,7 @@ private slots:
void incrementalFilterResults();
void qfutureSynchronizer();
void warnRace();
+ void matchFlags();
};
void sleeper()
@@ -312,10 +313,16 @@ void tst_QFutureWatcher::futureSignals()
// (QSignalSpy does not trigger it.)
connect(&f, SIGNAL(resultReadyAt(int)), &object, SLOT(resultReadyAt(int)));
a.reportStarted();
- f.setFuture(a.future());
QSignalSpy progressSpy(&f, &QFutureWatcher<void>::progressValueChanged);
+ QSignalSpy finishedSpy(&f, &QFutureWatcher<void>::finished);
+ QSignalSpy resultReadySpy(&f, &QFutureWatcher<void>::resultReadyAt);
+
QVERIFY(progressSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
+ QVERIFY(resultReadySpy.isValid());
+ f.setFuture(a.future());
+
const int progress = 1;
a.setProgressValue(progress);
QTest::qWait(10);
@@ -323,12 +330,6 @@ void tst_QFutureWatcher::futureSignals()
QCOMPARE(progressSpy.takeFirst().at(0).toInt(), 0);
QCOMPARE(progressSpy.takeFirst().at(0).toInt(), 1);
- QSignalSpy finishedSpy(&f, &QFutureWatcher<void>::finished);
- QSignalSpy resultReadySpy(&f, &QFutureWatcher<void>::resultReadyAt);
-
- QVERIFY(finishedSpy.isValid());
- QVERIFY(resultReadySpy.isValid());
-
const int result = 10;
a.reportResult(&result);
QTest::qWait(10);
@@ -426,16 +427,15 @@ void tst_QFutureWatcher::disconnectRunningFuture()
QFuture<int> f = a.future();
QFutureWatcher<int> *watcher = new QFutureWatcher<int>();
- watcher->setFuture(f);
-
- SignalSlotObject object;
- connect(watcher, SIGNAL(resultReadyAt(int)), &object, SLOT(resultReadyAt(int)));
-
QSignalSpy finishedSpy(watcher, &QFutureWatcher<int>::finished);
QSignalSpy resultReadySpy(watcher, &QFutureWatcher<int>::resultReadyAt);
QVERIFY(finishedSpy.isValid());
QVERIFY(resultReadySpy.isValid());
+ watcher->setFuture(f);
+
+ SignalSlotObject object;
+ connect(watcher, SIGNAL(resultReadyAt(int)), &object, SLOT(resultReadyAt(int)));
const int result = 10;
a.reportResult(&result);
@@ -677,11 +677,6 @@ void tst_QFutureWatcher::pauseEvents()
QFutureInterface<int> iface;
iface.reportStarted();
- QFuture<int> a = iface.future();
-
- int value = 0;
- iface.reportFinished(&value);
-
QFutureWatcher<int> watcher;
SignalSlotObject object;
@@ -689,14 +684,17 @@ void tst_QFutureWatcher::pauseEvents()
QSignalSpy resultReadySpy(&watcher, &QFutureWatcher<int>::resultReadyAt);
QVERIFY(resultReadySpy.isValid());
- watcher.setFuture(a);
+ watcher.setFuture(iface.future());
watcher.pause();
+ int value = 0;
+ iface.reportFinished(&value);
+
QTest::qWait(10);
QCOMPARE(resultReadySpy.count(), 0);
watcher.resume();
- QTest::qWait(10);
+ QTRY_VERIFY2(!resultReadySpy.isEmpty(), "Result didn't arrive");
QCOMPARE(resultReadySpy.count(), 1);
}
{
@@ -705,9 +703,6 @@ void tst_QFutureWatcher::pauseEvents()
QFuture<int> a = iface.future();
- int value = 0;
- iface.reportFinished(&value);
-
QFutureWatcher<int> watcher;
SignalSlotObject object;
@@ -718,6 +713,9 @@ void tst_QFutureWatcher::pauseEvents()
watcher.setFuture(a);
a.pause();
+ int value = 0;
+ iface.reportFinished(&value);
+
QFuture<int> b;
watcher.setFuture(b); // If we watch b instead, resuming a
a.resume(); // should give us no results.
@@ -743,7 +741,7 @@ void tst_QFutureWatcher::finishedState()
iface.reportFinished();
QVERIFY(future.isFinished());
- QVERIFY(watcher.isFinished() == false);
+ QVERIFY(!watcher.isFinished());
QTest::qWait(10);
QVERIFY(watcher.isFinished());
@@ -761,18 +759,18 @@ void tst_QFutureWatcher::throttling()
QFutureWatcher<int> watcher;
watcher.setFuture(future);
- QVERIFY(iface.isThrottled() == false);
+ QVERIFY(!iface.isThrottled());
for (int i = 0; i < 1000; ++i) {
int result = 0;
iface.reportResult(result);
}
- QVERIFY(iface.isThrottled() == true);
+ QVERIFY(iface.isThrottled());
QTest::qWait(100); // process events.
- QVERIFY(iface.isThrottled() == false);
+ QVERIFY(!iface.isThrottled());
iface.reportFinished();
}
@@ -930,5 +928,17 @@ void tst_QFutureWatcher::warnRace()
future.waitForFinished();
}
+void tst_QFutureWatcher::matchFlags()
+{
+ /* Regression test: expect a default watcher to be in the same state as a
+ * default future. */
+ QFutureWatcher<int> watcher;
+ QFuture<int> future;
+ QCOMPARE(watcher.isStarted(), future.isStarted());
+ QCOMPARE(watcher.isCanceled(), future.isCanceled());
+ QCOMPARE(watcher.isFinished(), future.isFinished());
+}
+
+
QTEST_MAIN(tst_QFutureWatcher)
#include "tst_qfuturewatcher.moc"
diff --git a/tests/auto/corelib/thread/qsemaphore/BLACKLIST b/tests/auto/corelib/thread/qsemaphore/BLACKLIST
new file mode 100644
index 0000000000..9f6f6e3ba6
--- /dev/null
+++ b/tests/auto/corelib/thread/qsemaphore/BLACKLIST
@@ -0,0 +1,3 @@
+# Times out randomly on linux, windows, osx
+[tryAcquireWithTimeout]
+*
diff --git a/tests/auto/corelib/thread/qthread/BLACKLIST b/tests/auto/corelib/thread/qthread/BLACKLIST
new file mode 100644
index 0000000000..d75249454f
--- /dev/null
+++ b/tests/auto/corelib/thread/qthread/BLACKLIST
@@ -0,0 +1,2 @@
+[wait3_slowDestructor]
+windows
diff --git a/tests/auto/corelib/thread/qthreadpool/BLACKLIST b/tests/auto/corelib/thread/qthreadpool/BLACKLIST
new file mode 100644
index 0000000000..1c392ce96c
--- /dev/null
+++ b/tests/auto/corelib/thread/qthreadpool/BLACKLIST
@@ -0,0 +1,2 @@
+[expiryTimeoutRace]
+osx
diff --git a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
index c9fdb4b718..c465a07487 100644
--- a/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
+++ b/tests/auto/corelib/thread/qthreadpool/tst_qthreadpool.cpp
@@ -821,7 +821,7 @@ void tst_QThreadPool::tryStartCount()
++count;
QCOMPARE(count, QThread::idealThreadCount());
- QTest::qWait(100);
+ QTRY_COMPARE(threadPool.activeThreadCount(), 0);
}
}
diff --git a/tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro b/tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro
index 2fa973d2f7..e81038a4be 100644
--- a/tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro
+++ b/tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro
@@ -1,5 +1,7 @@
TEMPLATE = subdirs
SUBDIRS = \
- crashonexit \
test
+
+!winrt: SUBDIRS += crashonexit
+
CONFIG += ordered parallel_test
diff --git a/tests/auto/corelib/thread/qthreadstorage/test/test.pro b/tests/auto/corelib/thread/qthreadstorage/test/test.pro
index 8b7caf1e24..d97d474e51 100644
--- a/tests/auto/corelib/thread/qthreadstorage/test/test.pro
+++ b/tests/auto/corelib/thread/qthreadstorage/test/test.pro
@@ -5,6 +5,6 @@ CONFIG += console
QT = core testlib
SOURCES = ../tst_qthreadstorage.cpp
-TEST_HELPER_INSTALLS = ../crashonexit/crashonexit
+!winrt: TEST_HELPER_INSTALLS = ../crashonexit/crashonexit
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
index 5e9b7370b9..ed7b446172 100644
--- a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
+++ b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
@@ -240,7 +240,7 @@ void tst_QThreadStorage::adoptedThreads()
QTestEventLoop::instance().enterLoop(2);
QVERIFY(!QTestEventLoop::instance().timeout());
- QCOMPARE(Pointer::count, c);
+ QTRY_COMPARE(Pointer::count, c);
}
QBasicAtomicInt cleanupOrder = Q_BASIC_ATOMIC_INITIALIZER(0);
diff --git a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
index dea305e3e1..df52aa4949 100644
--- a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
+++ b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
@@ -33,6 +33,7 @@
#include <QtTest/QtTest>
+#include <qatomic.h>
#include <qcoreapplication.h>
#include <qmutex.h>
#include <qthread.h>
@@ -54,7 +55,25 @@ private slots:
static const int iterations = 4;
static const int ThreadCount = 4;
-class wait_QMutex_Thread_1 : public QThread
+// Terminate thread in destructor for threads instantiated on the stack
+class TerminatingThread : public QThread
+{
+public:
+ explicit TerminatingThread()
+ {
+ setTerminationEnabled(true);
+ }
+
+ ~TerminatingThread()
+ {
+ if (isRunning()) {
+ qWarning() << "forcibly terminating " << objectName();
+ terminate();
+ }
+ }
+};
+
+class wait_QMutex_Thread_1 : public TerminatingThread
{
public:
QMutex mutex;
@@ -72,7 +91,7 @@ public:
}
};
-class wait_QMutex_Thread_2 : public QThread
+class wait_QMutex_Thread_2 : public TerminatingThread
{
public:
QWaitCondition started;
@@ -93,7 +112,7 @@ public:
}
};
-class wait_QReadWriteLock_Thread_1 : public QThread
+class wait_QReadWriteLock_Thread_1 : public TerminatingThread
{
public:
QReadWriteLock readWriteLock;
@@ -111,7 +130,7 @@ public:
}
};
-class wait_QReadWriteLock_Thread_2 : public QThread
+class wait_QReadWriteLock_Thread_2 : public TerminatingThread
{
public:
QWaitCondition started;
@@ -155,7 +174,11 @@ void tst_QWaitCondition::wait_QMutex()
// test multiple threads waiting on separate wait conditions
wait_QMutex_Thread_1 thread[ThreadCount];
+ const QString prefix = QLatin1String(QTest::currentTestFunction()) + QLatin1String("_mutex_")
+ + QString::number(i) + QLatin1Char('_');
+
for (x = 0; x < ThreadCount; ++x) {
+ thread[x].setObjectName(prefix + QString::number(x));
thread[x].mutex.lock();
thread[x].start();
// wait for thread to start
@@ -185,8 +208,12 @@ void tst_QWaitCondition::wait_QMutex()
QWaitCondition cond1, cond2;
wait_QMutex_Thread_2 thread[ThreadCount];
+ const QString prefix = QLatin1String(QTest::currentTestFunction()) + QLatin1String("_mutex_")
+ + QString::number(i) + QLatin1Char('_');
+
mutex.lock();
for (x = 0; x < ThreadCount; ++x) {
+ thread[x].setObjectName(prefix + QString::number(x));
thread[x].mutex = &mutex;
thread[x].cond = (x < ThreadCount / 2) ? &cond1 : &cond2;
thread[x].start();
@@ -289,7 +316,10 @@ void tst_QWaitCondition::wait_QReadWriteLock()
// test multiple threads waiting on separate wait conditions
wait_QReadWriteLock_Thread_1 thread[ThreadCount];
+ const QString prefix = QLatin1String(QTest::currentTestFunction()) + QLatin1String("_lockforread_");
+
for (x = 0; x < ThreadCount; ++x) {
+ thread[x].setObjectName(prefix + QString::number(x));
thread[x].readWriteLock.lockForRead();
thread[x].start();
// wait for thread to start
@@ -319,8 +349,11 @@ void tst_QWaitCondition::wait_QReadWriteLock()
QWaitCondition cond1, cond2;
wait_QReadWriteLock_Thread_2 thread[ThreadCount];
+ const QString prefix = QLatin1String(QTest::currentTestFunction()) + QLatin1String("_lockforwrite_");
+
readWriteLock.lockForWrite();
for (x = 0; x < ThreadCount; ++x) {
+ thread[x].setObjectName(prefix + QString::number(x));
thread[x].readWriteLock = &readWriteLock;
thread[x].cond = (x < ThreadCount / 2) ? &cond1 : &cond2;
thread[x].start();
@@ -346,11 +379,17 @@ void tst_QWaitCondition::wait_QReadWriteLock()
}
}
-class wake_Thread : public QThread
+class WakeThreadBase : public TerminatingThread
{
public:
- static int count;
+ QAtomicInt *count;
+ WakeThreadBase() : count(Q_NULLPTR) {}
+};
+
+class wake_Thread : public WakeThreadBase
+{
+public:
QWaitCondition started;
QWaitCondition dummy;
@@ -366,24 +405,23 @@ public:
void run()
{
+ Q_ASSERT(count);
+ Q_ASSERT(mutex);
+ Q_ASSERT(cond);
mutex->lock();
- ++count;
+ ++*count;
dummy.wakeOne(); // this wakeup should be lost
started.wakeOne();
dummy.wakeAll(); // this one too
cond->wait(mutex);
- --count;
+ --*count;
mutex->unlock();
}
};
-int wake_Thread::count = 0;
-
-class wake_Thread_2 : public QThread
+class wake_Thread_2 : public WakeThreadBase
{
public:
- static int count;
-
QWaitCondition started;
QWaitCondition dummy;
@@ -399,22 +437,27 @@ public:
void run()
{
+ Q_ASSERT(count);
+ Q_ASSERT(readWriteLock);
+ Q_ASSERT(cond);
readWriteLock->lockForWrite();
- ++count;
+ ++*count;
dummy.wakeOne(); // this wakeup should be lost
started.wakeOne();
dummy.wakeAll(); // this one too
cond->wait(readWriteLock);
- --count;
+ --*count;
readWriteLock->unlock();
}
};
-int wake_Thread_2::count = 0;
-
void tst_QWaitCondition::wakeOne()
{
+ static const int firstWaitInterval = 1000;
+ static const int waitInterval = 30;
+
int x;
+ QAtomicInt count;
// wake up threads, one at a time
for (int i = 0; i < iterations; ++i) {
QMutex mutex;
@@ -424,8 +467,13 @@ void tst_QWaitCondition::wakeOne()
wake_Thread thread[ThreadCount];
bool thread_exited[ThreadCount];
+ QString prefix = QLatin1String(QTest::currentTestFunction()) + QLatin1String("_mutex_")
+ + QString::number(i) + QLatin1Char('_');
+
mutex.lock();
for (x = 0; x < ThreadCount; ++x) {
+ thread[x].setObjectName(prefix + QString::number(x));
+ thread[x].count = &count;
thread[x].mutex = &mutex;
thread[x].cond = &cond;
thread_exited[x] = false;
@@ -438,7 +486,7 @@ void tst_QWaitCondition::wakeOne()
}
mutex.unlock();
- QCOMPARE(wake_Thread::count, ThreadCount);
+ QCOMPARE(count.load(), ThreadCount);
// wake up threads one at a time
for (x = 0; x < ThreadCount; ++x) {
@@ -452,24 +500,29 @@ void tst_QWaitCondition::wakeOne()
for (int y = 0; y < ThreadCount; ++y) {
if (thread_exited[y])
continue;
- if (thread[y].wait(exited > 0 ? 10 : 1000)) {
+ if (thread[y].wait(exited > 0 ? waitInterval : firstWaitInterval)) {
thread_exited[y] = true;
++exited;
}
}
QCOMPARE(exited, 1);
- QCOMPARE(wake_Thread::count, ThreadCount - (x + 1));
+ QCOMPARE(count.load(), ThreadCount - (x + 1));
}
- QCOMPARE(wake_Thread::count, 0);
+ QCOMPARE(count.load(), 0);
// QReadWriteLock
QReadWriteLock readWriteLock;
wake_Thread_2 rwthread[ThreadCount];
+ prefix = QLatin1String(QTest::currentTestFunction()) + QLatin1String("_readwritelock_")
+ + QString::number(i) + QLatin1Char('_');
+
readWriteLock.lockForWrite();
for (x = 0; x < ThreadCount; ++x) {
+ rwthread[x].setObjectName(prefix + QString::number(x));
+ rwthread[x].count = &count;
rwthread[x].readWriteLock = &readWriteLock;
rwthread[x].cond = &cond;
thread_exited[x] = false;
@@ -482,7 +535,7 @@ void tst_QWaitCondition::wakeOne()
}
readWriteLock.unlock();
- QCOMPARE(wake_Thread_2::count, ThreadCount);
+ QCOMPARE(count.load(), ThreadCount);
// wake up threads one at a time
for (x = 0; x < ThreadCount; ++x) {
@@ -496,17 +549,17 @@ void tst_QWaitCondition::wakeOne()
for (int y = 0; y < ThreadCount; ++y) {
if (thread_exited[y])
continue;
- if (rwthread[y].wait(exited > 0 ? 10 : 1000)) {
+ if (rwthread[y].wait(exited > 0 ? waitInterval : firstWaitInterval)) {
thread_exited[y] = true;
++exited;
}
}
QCOMPARE(exited, 1);
- QCOMPARE(wake_Thread_2::count, ThreadCount - (x + 1));
+ QCOMPARE(count.load(), ThreadCount - (x + 1));
}
- QCOMPARE(wake_Thread_2::count, 0);
+ QCOMPARE(count.load(), 0);
}
// wake up threads, two at a time
@@ -518,8 +571,13 @@ void tst_QWaitCondition::wakeOne()
wake_Thread thread[ThreadCount];
bool thread_exited[ThreadCount];
+ QString prefix = QLatin1String(QTest::currentTestFunction()) + QLatin1String("_mutex2_")
+ + QString::number(i) + QLatin1Char('_');
+
mutex.lock();
for (x = 0; x < ThreadCount; ++x) {
+ thread[x].setObjectName(prefix + QString::number(x));
+ thread[x].count = &count;
thread[x].mutex = &mutex;
thread[x].cond = &cond;
thread_exited[x] = false;
@@ -532,7 +590,7 @@ void tst_QWaitCondition::wakeOne()
}
mutex.unlock();
- QCOMPARE(wake_Thread::count, ThreadCount);
+ QCOMPARE(count.load(), ThreadCount);
// wake up threads one at a time
for (x = 0; x < ThreadCount; x += 2) {
@@ -548,24 +606,29 @@ void tst_QWaitCondition::wakeOne()
for (int y = 0; y < ThreadCount; ++y) {
if (thread_exited[y])
continue;
- if (thread[y].wait(exited > 0 ? 10 : 1000)) {
+ if (thread[y].wait(exited > 0 ? waitInterval : firstWaitInterval)) {
thread_exited[y] = true;
++exited;
}
}
QCOMPARE(exited, 2);
- QCOMPARE(wake_Thread::count, ThreadCount - (x + 2));
+ QCOMPARE(count.load(), ThreadCount - (x + 2));
}
- QCOMPARE(wake_Thread::count, 0);
+ QCOMPARE(count.load(), 0);
// QReadWriteLock
QReadWriteLock readWriteLock;
wake_Thread_2 rwthread[ThreadCount];
+ prefix = QLatin1String(QTest::currentTestFunction()) + QLatin1String("_readwritelock_")
+ + QString::number(i) + QLatin1Char('_');
+
readWriteLock.lockForWrite();
for (x = 0; x < ThreadCount; ++x) {
+ rwthread[x].setObjectName(prefix + QString::number(x));
+ rwthread[x].count = &count;
rwthread[x].readWriteLock = &readWriteLock;
rwthread[x].cond = &cond;
thread_exited[x] = false;
@@ -578,7 +641,7 @@ void tst_QWaitCondition::wakeOne()
}
readWriteLock.unlock();
- QCOMPARE(wake_Thread_2::count, ThreadCount);
+ QCOMPARE(count.load(), ThreadCount);
// wake up threads one at a time
for (x = 0; x < ThreadCount; x += 2) {
@@ -594,23 +657,24 @@ void tst_QWaitCondition::wakeOne()
for (int y = 0; y < ThreadCount; ++y) {
if (thread_exited[y])
continue;
- if (rwthread[y].wait(exited > 0 ? 10 : 1000)) {
+ if (rwthread[y].wait(exited > 0 ? waitInterval : firstWaitInterval)) {
thread_exited[y] = true;
++exited;
}
}
QCOMPARE(exited, 2);
- QCOMPARE(wake_Thread_2::count, ThreadCount - (x + 2));
+ QCOMPARE(count.load(), ThreadCount - (x + 2));
}
- QCOMPARE(wake_Thread_2::count, 0);
+ QCOMPARE(count.load(), 0);
}
}
void tst_QWaitCondition::wakeAll()
{
int x;
+ QAtomicInt count;
for (int i = 0; i < iterations; ++i) {
QMutex mutex;
QWaitCondition cond;
@@ -618,8 +682,13 @@ void tst_QWaitCondition::wakeAll()
// QMutex
wake_Thread thread[ThreadCount];
+ QString prefix = QLatin1String(QTest::currentTestFunction()) + QLatin1String("_mutex_")
+ + QString::number(i) + QLatin1Char('_');
+
mutex.lock();
for (x = 0; x < ThreadCount; ++x) {
+ thread[x].setObjectName(prefix + QString::number(x));
+ thread[x].count = &count;
thread[x].mutex = &mutex;
thread[x].cond = &cond;
thread[x].start();
@@ -628,7 +697,7 @@ void tst_QWaitCondition::wakeAll()
}
mutex.unlock();
- QCOMPARE(wake_Thread::count, ThreadCount);
+ QCOMPARE(count.load(), ThreadCount);
// wake up all threads at once
mutex.lock();
@@ -643,14 +712,19 @@ void tst_QWaitCondition::wakeAll()
}
QCOMPARE(exited, ThreadCount);
- QCOMPARE(wake_Thread::count, 0);
+ QCOMPARE(count.load(), 0);
// QReadWriteLock
QReadWriteLock readWriteLock;
wake_Thread_2 rwthread[ThreadCount];
+ prefix = QLatin1String(QTest::currentTestFunction()) + QLatin1String("_readwritelock_")
+ + QString::number(i) + QLatin1Char('_');
+
readWriteLock.lockForWrite();
for (x = 0; x < ThreadCount; ++x) {
+ rwthread[x].setObjectName(prefix + QString::number(x));
+ rwthread[x].count = &count;
rwthread[x].readWriteLock = &readWriteLock;
rwthread[x].cond = &cond;
rwthread[x].start();
@@ -659,7 +733,7 @@ void tst_QWaitCondition::wakeAll()
}
readWriteLock.unlock();
- QCOMPARE(wake_Thread_2::count, ThreadCount);
+ QCOMPARE(count.load(), ThreadCount);
// wake up all threads at once
readWriteLock.lockForWrite();
@@ -674,11 +748,11 @@ void tst_QWaitCondition::wakeAll()
}
QCOMPARE(exited, ThreadCount);
- QCOMPARE(wake_Thread_2::count, 0);
+ QCOMPARE(count.load(), 0);
}
}
-class wait_RaceConditionThread : public QThread
+class wait_RaceConditionThread : public TerminatingThread
{
public:
wait_RaceConditionThread(QMutex *mutex, QWaitCondition *startup, QWaitCondition *waitCondition,
@@ -707,7 +781,7 @@ public:
}
};
-class wait_RaceConditionThread_2 : public QThread
+class wait_RaceConditionThread_2 : public TerminatingThread
{
public:
wait_RaceConditionThread_2(QReadWriteLock *readWriteLock,
diff --git a/tests/auto/corelib/tools/collections/tst_collections.cpp b/tests/auto/corelib/tools/collections/tst_collections.cpp
index 7eedd5bcf7..b9487cee33 100644
--- a/tests/auto/corelib/tools/collections/tst_collections.cpp
+++ b/tests/auto/corelib/tools/collections/tst_collections.cpp
@@ -90,7 +90,9 @@ void foo()
#include "qvector.h"
#include "qqueue.h"
+QT_BEGIN_NAMESPACE
template class QList<int>;
+QT_END_NAMESPACE
class tst_Collections : public QObject
{
@@ -2235,7 +2237,7 @@ void tst_Collections::qstring()
void tst_Collections::bitArray()
{
QBitArray ba(20);
- QVERIFY(ba.testBit(17) == false);
+ QVERIFY(!ba.testBit(17));
ba.setBit(17);
QVERIFY(ba.size() == 20);
QVERIFY(ba.testBit(17)==true);
diff --git a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
index 9bce948140..99e5c4c85d 100644
--- a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
+++ b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
@@ -31,6 +31,7 @@
**
****************************************************************************/
+#include "../../../../../src/corelib/tools/qalgorithms.h"
#include <QtTest/QtTest>
#include <iostream>
@@ -80,6 +81,24 @@ private slots:
void popCount32() { popCount_impl<quint32>(); }
void popCount64() { popCount_impl<quint64>(); }
+ void countTrailing08_data() { countTrailing_data_impl(sizeof(quint8 )); }
+ void countTrailing16_data() { countTrailing_data_impl(sizeof(quint16)); }
+ void countTrailing32_data() { countTrailing_data_impl(sizeof(quint32)); }
+ void countTrailing64_data() { countTrailing_data_impl(sizeof(quint64)); }
+ void countTrailing08() { countTrailing_impl<quint8 >(); }
+ void countTrailing16() { countTrailing_impl<quint16>(); }
+ void countTrailing32() { countTrailing_impl<quint32>(); }
+ void countTrailing64() { countTrailing_impl<quint64>(); }
+
+ void countLeading08_data() { countLeading_data_impl(sizeof(quint8 )); }
+ void countLeading16_data() { countLeading_data_impl(sizeof(quint16)); }
+ void countLeading32_data() { countLeading_data_impl(sizeof(quint32)); }
+ void countLeading64_data() { countLeading_data_impl(sizeof(quint64)); }
+ void countLeading08() { countLeading_impl<quint8 >(); }
+ void countLeading16() { countLeading_impl<quint16>(); }
+ void countLeading32() { countLeading_impl<quint32>(); }
+ void countLeading64() { countLeading_impl<quint64>(); }
+
private:
#if Q_TEST_PERFORMANCE
void performance();
@@ -87,6 +106,14 @@ private:
void popCount_data_impl(size_t sizeof_T_Int);
template <typename T_Int>
void popCount_impl();
+
+ void countTrailing_data_impl(size_t sizeof_T_Int);
+ template <typename T_Int>
+ void countTrailing_impl();
+
+ void countLeading_data_impl(size_t sizeof_T_Int);
+ template <typename T_Int>
+ void countLeading_impl();
};
class TestInt
@@ -1084,6 +1111,86 @@ void tst_QAlgorithms::popCount_impl()
QCOMPARE(qPopulationCount(value), expected);
}
+void tst_QAlgorithms::countTrailing_data_impl(size_t sizeof_T_Int)
+{
+ using namespace QTest;
+ addColumn<quint64>("input");
+ addColumn<uint>("expected");
+
+ int nibs = sizeof_T_Int*2;
+
+ newRow(("0x"+QByteArray::number(0,16).rightJustified(nibs,'0')).constData()) << Q_UINT64_C(0) << uint(sizeof_T_Int*8);
+ for (uint i = 0; i < sizeof_T_Int*8; ++i) {
+ const quint64 input = Q_UINT64_C(1) << i;
+ newRow(("0x"+QByteArray::number(input,16).rightJustified(nibs,'0')).constData()) << input << i;
+ }
+
+ quint64 type_mask;
+ if (sizeof_T_Int>=8)
+ type_mask = ~Q_UINT64_C(0);
+ else
+ type_mask = (Q_UINT64_C(1) << (sizeof_T_Int*8))-1;
+
+ // and some random ones:
+ for (uint i = 0; i < sizeof_T_Int*8; ++i) {
+ for (uint j = 0; j < sizeof_T_Int*3; ++j) { // 3 is arbitrary
+ const quint64 r = quint64(qrand()) << 32 | quint32(qrand());
+ const quint64 b = Q_UINT64_C(1) << i;
+ const quint64 mask = ((~(b-1)) ^ b) & type_mask;
+ const quint64 input = (r&mask) | b;
+ newRow(("0x"+QByteArray::number(input,16).rightJustified(nibs,'0')).constData()) << input << i;
+ }
+ }
+}
+
+template <typename T_Int>
+void tst_QAlgorithms::countTrailing_impl()
+{
+ QFETCH(quint64, input);
+ QFETCH(uint, expected);
+
+ const T_Int value = static_cast<T_Int>(input);
+
+ QCOMPARE(qCountTrailingZeroBits(value), expected);
+}
+
+void tst_QAlgorithms::countLeading_data_impl(size_t sizeof_T_Int)
+{
+ using namespace QTest;
+ addColumn<quint64>("input");
+ addColumn<uint>("expected");
+
+ int nibs = sizeof_T_Int*2;
+
+ newRow(("0x"+QByteArray::number(0,16).rightJustified(nibs,'0')).constData()) << Q_UINT64_C(0) << uint(sizeof_T_Int*8);
+ for (uint i = 0; i < sizeof_T_Int*8; ++i) {
+ const quint64 input = Q_UINT64_C(1) << i;
+ newRow(("0x"+QByteArray::number(input,16).rightJustified(nibs,'0')).constData()) << input << uint(sizeof_T_Int*8-i-1);
+ }
+
+ // and some random ones:
+ for (uint i = 0; i < sizeof_T_Int*8; ++i) {
+ for (uint j = 0; j < sizeof_T_Int*3; ++j) { // 3 is arbitrary
+ const quint64 r = quint64(qrand()) << 32 | quint32(qrand());
+ const quint64 b = Q_UINT64_C(1) << i;
+ const quint64 mask = b-1;
+ const quint64 input = (r&mask) | b;
+ newRow(("0x"+QByteArray::number(input,16).rightJustified(nibs,'0')).constData()) << input << uint(sizeof_T_Int*8-i-1);
+ }
+ }
+}
+
+template <typename T_Int>
+void tst_QAlgorithms::countLeading_impl()
+{
+ QFETCH(quint64, input);
+ QFETCH(uint, expected);
+
+ const T_Int value = static_cast<T_Int>(input);
+
+ QCOMPARE(qCountLeadingZeroBits(value), expected);
+}
+
QTEST_APPLESS_MAIN(tst_QAlgorithms)
#include "tst_qalgorithms.moc"
diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
index 410b34e894..f942eab800 100644
--- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
+++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
@@ -67,6 +67,7 @@ private slots:
void endsWith_data();
void endsWith();
void endsWith_char();
+ void reverseIterators();
void split_data();
void split();
void base64_data();
@@ -540,6 +541,20 @@ void tst_QByteArray::endsWith_char()
QVERIFY(!QByteArray().endsWith('\0'));
}
+void tst_QByteArray::reverseIterators()
+{
+ QByteArray s = "1234";
+ QByteArray sr = s;
+ std::reverse(sr.begin(), sr.end());
+ const QByteArray &csr = sr;
+ QVERIFY(std::equal(s.begin(), s.end(), sr.rbegin()));
+ QVERIFY(std::equal(s.begin(), s.end(), sr.crbegin()));
+ QVERIFY(std::equal(s.begin(), s.end(), csr.rbegin()));
+ QVERIFY(std::equal(sr.rbegin(), sr.rend(), s.begin()));
+ QVERIFY(std::equal(sr.crbegin(), sr.crend(), s.begin()));
+ QVERIFY(std::equal(csr.rbegin(), csr.rend(), s.begin()));
+}
+
void tst_QByteArray::split_data()
{
QTest::addColumn<QByteArray>("sample");
diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm b/tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm
index c2b76cc41a..95d05904a2 100644
--- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm
+++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray_mac.mm
@@ -72,35 +72,31 @@ void tst_QByteArray_macTypes()
}
// QByteArray <-> NSData
{
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
QByteArray qtByteArray("test bytearray");
const NSData *nsData = qtByteArray.toNSData();
QCOMPARE(QByteArray::fromNSData(nsData), qtByteArray);
- [autoreleasepool release];
}
{
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
QByteArray qtByteArray("test bytearray");
const NSData *nsData = qtByteArray.toNSData();
QByteArray qtByteArrayCopy(qtByteArray);
qtByteArray = qtByteArray.toUpper(); // modify
QCOMPARE(QByteArray::fromNSData(nsData), qtByteArrayCopy);
- [autoreleasepool release];
}
// QByteArray <-> NSData Raw
{
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
QByteArray qtByteArray("test bytearray");
const NSData *nsData = qtByteArray.toRawNSData();
QCOMPARE([nsData bytes], qtByteArray.constData());
- [autoreleasepool release];
}
{
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
const char data[] = "nsdata test";
const NSData *nsData = [NSData dataWithBytes:data length:sizeof(data)];
QByteArray qtByteArray = QByteArray::fromRawNSData(nsData);
QCOMPARE(qtByteArray.constData(), [nsData bytes]);
- [autoreleasepool release];
}
}
diff --git a/tests/auto/corelib/tools/qchar/data/NormalizationTest.txt b/tests/auto/corelib/tools/qchar/data/NormalizationTest.txt
index 23c1e51d5f..0290080998 100644
--- a/tests/auto/corelib/tools/qchar/data/NormalizationTest.txt
+++ b/tests/auto/corelib/tools/qchar/data/NormalizationTest.txt
@@ -1,8 +1,8 @@
-# NormalizationTest-7.0.0.txt
-# Date: 2013-11-27, 09:54:41 GMT [MD]
+# NormalizationTest-8.0.0.txt
+# Date: 2015-02-13, 13:30:27 GMT [MD]
#
# Unicode Character Database
-# Copyright (c) 1991-2013 Unicode, Inc.
+# Copyright (c) 1991-2015 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
# For documentation, see http://www.unicode.org/reports/tr44/
#
@@ -17523,6 +17523,8 @@ FFEE;FFEE;FFEE;25CB;25CB; # (○; ○; ○; ○; ○; ) HALFWIDTH WHITE CIRCLE
0061 085A 059A 0316 302A 0062;0061 302A 085A 0316 059A 0062;0061 302A 085A 0316 059A 0062;0061 302A 085A 0316 059A 0062;0061 302A 085A 0316 059A 0062; # (a◌࡚◌֚◌̖◌〪b; a◌〪◌࡚◌̖◌֚b; a◌〪◌࡚◌̖◌֚b; a◌〪◌࡚◌̖◌֚b; a◌〪◌࡚◌̖◌֚b; ) LATIN SMALL LETTER A, MANDAIC VOCALIZATION MARK, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B
0061 059A 0316 302A 085B 0062;0061 302A 0316 085B 059A 0062;0061 302A 0316 085B 059A 0062;0061 302A 0316 085B 059A 0062;0061 302A 0316 085B 059A 0062; # (a◌֚◌̖◌〪◌࡛b; a◌〪◌̖◌࡛◌֚b; a◌〪◌̖◌࡛◌֚b; a◌〪◌̖◌࡛◌֚b; a◌〪◌̖◌࡛◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, MANDAIC GEMINATION MARK, LATIN SMALL LETTER B
0061 085B 059A 0316 302A 0062;0061 302A 085B 0316 059A 0062;0061 302A 085B 0316 059A 0062;0061 302A 085B 0316 059A 0062;0061 302A 085B 0316 059A 0062; # (a◌࡛◌֚◌̖◌〪b; a◌〪◌࡛◌̖◌֚b; a◌〪◌࡛◌̖◌֚b; a◌〪◌࡛◌̖◌֚b; a◌〪◌࡛◌̖◌֚b; ) LATIN SMALL LETTER A, MANDAIC GEMINATION MARK, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B
+0061 059A 0316 302A 08E3 0062;0061 302A 0316 08E3 059A 0062;0061 302A 0316 08E3 059A 0062;0061 302A 0316 08E3 059A 0062;0061 302A 0316 08E3 059A 0062; # (a◌֚◌̖◌〪◌ࣣb; a◌〪◌̖◌ࣣ◌֚b; a◌〪◌̖◌ࣣ◌֚b; a◌〪◌̖◌ࣣ◌֚b; a◌〪◌̖◌ࣣ◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, ARABIC TURNED DAMMA BELOW, LATIN SMALL LETTER B
+0061 08E3 059A 0316 302A 0062;0061 302A 08E3 0316 059A 0062;0061 302A 08E3 0316 059A 0062;0061 302A 08E3 0316 059A 0062;0061 302A 08E3 0316 059A 0062; # (a◌ࣣ◌֚◌̖◌〪b; a◌〪◌ࣣ◌̖◌֚b; a◌〪◌ࣣ◌̖◌֚b; a◌〪◌ࣣ◌̖◌֚b; a◌〪◌ࣣ◌̖◌֚b; ) LATIN SMALL LETTER A, ARABIC TURNED DAMMA BELOW, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B
0061 0315 0300 05AE 08E4 0062;00E0 05AE 08E4 0315 0062;0061 05AE 0300 08E4 0315 0062;00E0 05AE 08E4 0315 0062;0061 05AE 0300 08E4 0315 0062; # (a◌̕◌̀◌֮◌ࣤb; à◌֮◌ࣤ◌̕b; a◌֮◌̀◌ࣤ◌̕b; à◌֮◌ࣤ◌̕b; a◌֮◌̀◌ࣤ◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, ARABIC CURLY FATHA, LATIN SMALL LETTER B
0061 08E4 0315 0300 05AE 0062;0061 05AE 08E4 0300 0315 0062;0061 05AE 08E4 0300 0315 0062;0061 05AE 08E4 0300 0315 0062;0061 05AE 08E4 0300 0315 0062; # (a◌ࣤ◌̕◌̀◌֮b; a◌֮◌ࣤ◌̀◌̕b; a◌֮◌ࣤ◌̀◌̕b; a◌֮◌ࣤ◌̀◌̕b; a◌֮◌ࣤ◌̀◌̕b; ) LATIN SMALL LETTER A, ARABIC CURLY FATHA, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B
0061 0315 0300 05AE 08E5 0062;00E0 05AE 08E5 0315 0062;0061 05AE 0300 08E5 0315 0062;00E0 05AE 08E5 0315 0062;0061 05AE 0300 08E5 0315 0062; # (a◌̕◌̀◌֮◌ࣥb; à◌֮◌ࣥ◌̕b; a◌֮◌̀◌ࣥ◌̕b; à◌֮◌ࣥ◌̕b; a◌֮◌̀◌ࣥ◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, ARABIC CURLY DAMMA, LATIN SMALL LETTER B
@@ -18135,6 +18137,8 @@ FFEE;FFEE;FFEE;25CB;25CB; # (○; ○; ○; ○; ○; ) HALFWIDTH WHITE CIRCLE
0061 A67C 0315 0300 05AE 0062;0061 05AE A67C 0300 0315 0062;0061 05AE A67C 0300 0315 0062;0061 05AE A67C 0300 0315 0062;0061 05AE A67C 0300 0315 0062; # (a◌꙼◌̕◌̀◌֮b; a◌֮◌꙼◌̀◌̕b; a◌֮◌꙼◌̀◌̕b; a◌֮◌꙼◌̀◌̕b; a◌֮◌꙼◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING CYRILLIC KAVYKA, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B
0061 0315 0300 05AE A67D 0062;00E0 05AE A67D 0315 0062;0061 05AE 0300 A67D 0315 0062;00E0 05AE A67D 0315 0062;0061 05AE 0300 A67D 0315 0062; # (a◌̕◌̀◌֮◌꙽b; à◌֮◌꙽◌̕b; a◌֮◌̀◌꙽◌̕b; à◌֮◌꙽◌̕b; a◌֮◌̀◌꙽◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING CYRILLIC PAYEROK, LATIN SMALL LETTER B
0061 A67D 0315 0300 05AE 0062;0061 05AE A67D 0300 0315 0062;0061 05AE A67D 0300 0315 0062;0061 05AE A67D 0300 0315 0062;0061 05AE A67D 0300 0315 0062; # (a◌꙽◌̕◌̀◌֮b; a◌֮◌꙽◌̀◌̕b; a◌֮◌꙽◌̀◌̕b; a◌֮◌꙽◌̀◌̕b; a◌֮◌꙽◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING CYRILLIC PAYEROK, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B
+0061 0315 0300 05AE A69E 0062;00E0 05AE A69E 0315 0062;0061 05AE 0300 A69E 0315 0062;00E0 05AE A69E 0315 0062;0061 05AE 0300 A69E 0315 0062; # (a◌̕◌̀◌֮◌ꚞb; à◌֮◌ꚞ◌̕b; a◌֮◌̀◌ꚞ◌̕b; à◌֮◌ꚞ◌̕b; a◌֮◌̀◌ꚞ◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING CYRILLIC LETTER EF, LATIN SMALL LETTER B
+0061 A69E 0315 0300 05AE 0062;0061 05AE A69E 0300 0315 0062;0061 05AE A69E 0300 0315 0062;0061 05AE A69E 0300 0315 0062;0061 05AE A69E 0300 0315 0062; # (a◌ꚞ◌̕◌̀◌֮b; a◌֮◌ꚞ◌̀◌̕b; a◌֮◌ꚞ◌̀◌̕b; a◌֮◌ꚞ◌̀◌̕b; a◌֮◌ꚞ◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING CYRILLIC LETTER EF, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B
0061 0315 0300 05AE A69F 0062;00E0 05AE A69F 0315 0062;0061 05AE 0300 A69F 0315 0062;00E0 05AE A69F 0315 0062;0061 05AE 0300 A69F 0315 0062; # (a◌̕◌̀◌֮◌ꚟb; à◌֮◌ꚟ◌̕b; a◌֮◌̀◌ꚟ◌̕b; à◌֮◌ꚟ◌̕b; a◌֮◌̀◌ꚟ◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING CYRILLIC LETTER IOTIFIED E, LATIN SMALL LETTER B
0061 A69F 0315 0300 05AE 0062;0061 05AE A69F 0300 0315 0062;0061 05AE A69F 0300 0315 0062;0061 05AE A69F 0300 0315 0062;0061 05AE A69F 0300 0315 0062; # (a◌ꚟ◌̕◌̀◌֮b; a◌֮◌ꚟ◌̀◌̕b; a◌֮◌ꚟ◌̀◌̕b; a◌֮◌ꚟ◌̀◌̕b; a◌֮◌ꚟ◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING CYRILLIC LETTER IOTIFIED E, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B
0061 0315 0300 05AE A6F0 0062;00E0 05AE A6F0 0315 0062;0061 05AE 0300 A6F0 0315 0062;00E0 05AE A6F0 0315 0062;0061 05AE 0300 A6F0 0315 0062; # (a◌̕◌̀◌֮◌꛰b; à◌֮◌꛰◌̕b; a◌֮◌̀◌꛰◌̕b; à◌֮◌꛰◌̕b; a◌֮◌̀◌꛰◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, BAMUM COMBINING MARK KOQNDON, LATIN SMALL LETTER B
@@ -18245,6 +18249,10 @@ FFEE;FFEE;FFEE;25CB;25CB; # (○; ○; ○; ○; ○; ) HALFWIDTH WHITE CIRCLE
0061 FE2C 059A 0316 302A 0062;0061 302A FE2C 0316 059A 0062;0061 302A FE2C 0316 059A 0062;0061 302A FE2C 0316 059A 0062;0061 302A FE2C 0316 059A 0062; # (a◌︬◌֚◌̖◌〪b; a◌〪◌︬◌̖◌֚b; a◌〪◌︬◌̖◌֚b; a◌〪◌︬◌̖◌֚b; a◌〪◌︬◌̖◌֚b; ) LATIN SMALL LETTER A, COMBINING MACRON RIGHT HALF BELOW, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B
0061 059A 0316 302A FE2D 0062;0061 302A 0316 FE2D 059A 0062;0061 302A 0316 FE2D 059A 0062;0061 302A 0316 FE2D 059A 0062;0061 302A 0316 FE2D 059A 0062; # (a◌֚◌̖◌〪◌︭b; a◌〪◌̖◌︭◌֚b; a◌〪◌̖◌︭◌֚b; a◌〪◌̖◌︭◌֚b; a◌〪◌̖◌︭◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, COMBINING CONJOINING MACRON BELOW, LATIN SMALL LETTER B
0061 FE2D 059A 0316 302A 0062;0061 302A FE2D 0316 059A 0062;0061 302A FE2D 0316 059A 0062;0061 302A FE2D 0316 059A 0062;0061 302A FE2D 0316 059A 0062; # (a◌︭◌֚◌̖◌〪b; a◌〪◌︭◌̖◌֚b; a◌〪◌︭◌̖◌֚b; a◌〪◌︭◌̖◌֚b; a◌〪◌︭◌̖◌֚b; ) LATIN SMALL LETTER A, COMBINING CONJOINING MACRON BELOW, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B
+0061 0315 0300 05AE FE2E 0062;00E0 05AE FE2E 0315 0062;0061 05AE 0300 FE2E 0315 0062;00E0 05AE FE2E 0315 0062;0061 05AE 0300 FE2E 0315 0062; # (a◌̕◌̀◌֮◌︮b; à◌֮◌︮◌̕b; a◌֮◌̀◌︮◌̕b; à◌֮◌︮◌̕b; a◌֮◌̀◌︮◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING CYRILLIC TITLO LEFT HALF, LATIN SMALL LETTER B
+0061 FE2E 0315 0300 05AE 0062;0061 05AE FE2E 0300 0315 0062;0061 05AE FE2E 0300 0315 0062;0061 05AE FE2E 0300 0315 0062;0061 05AE FE2E 0300 0315 0062; # (a◌︮◌̕◌̀◌֮b; a◌֮◌︮◌̀◌̕b; a◌֮◌︮◌̀◌̕b; a◌֮◌︮◌̀◌̕b; a◌֮◌︮◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING CYRILLIC TITLO LEFT HALF, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B
+0061 0315 0300 05AE FE2F 0062;00E0 05AE FE2F 0315 0062;0061 05AE 0300 FE2F 0315 0062;00E0 05AE FE2F 0315 0062;0061 05AE 0300 FE2F 0315 0062; # (a◌̕◌̀◌֮◌︯b; à◌֮◌︯◌̕b; a◌֮◌̀◌︯◌̕b; à◌֮◌︯◌̕b; a◌֮◌̀◌︯◌̕b; ) LATIN SMALL LETTER A, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, COMBINING CYRILLIC TITLO RIGHT HALF, LATIN SMALL LETTER B
+0061 FE2F 0315 0300 05AE 0062;0061 05AE FE2F 0300 0315 0062;0061 05AE FE2F 0300 0315 0062;0061 05AE FE2F 0300 0315 0062;0061 05AE FE2F 0300 0315 0062; # (a◌︯◌̕◌̀◌֮b; a◌֮◌︯◌̀◌̕b; a◌֮◌︯◌̀◌̕b; a◌֮◌︯◌̀◌̕b; a◌֮◌︯◌̀◌̕b; ) LATIN SMALL LETTER A, COMBINING CYRILLIC TITLO RIGHT HALF, COMBINING COMMA ABOVE RIGHT, COMBINING GRAVE ACCENT, HEBREW ACCENT ZINOR, LATIN SMALL LETTER B
0061 059A 0316 302A 101FD 0062;0061 302A 0316 101FD 059A 0062;0061 302A 0316 101FD 059A 0062;0061 302A 0316 101FD 059A 0062;0061 302A 0316 101FD 059A 0062; # (a◌֚◌̖◌〪◌𐇽b; a◌〪◌̖◌𐇽◌֚b; a◌〪◌̖◌𐇽◌֚b; a◌〪◌̖◌𐇽◌֚b; a◌〪◌̖◌𐇽◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE, LATIN SMALL LETTER B
0061 101FD 059A 0316 302A 0062;0061 302A 101FD 0316 059A 0062;0061 302A 101FD 0316 059A 0062;0061 302A 101FD 0316 059A 0062;0061 302A 101FD 0316 059A 0062; # (a◌𐇽◌֚◌̖◌〪b; a◌〪◌𐇽◌̖◌֚b; a◌〪◌𐇽◌̖◌֚b; a◌〪◌𐇽◌̖◌֚b; a◌〪◌𐇽◌̖◌֚b; ) LATIN SMALL LETTER A, PHAISTOS DISC SIGN COMBINING OBLIQUE STROKE, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, LATIN SMALL LETTER B
0061 059A 0316 302A 102E0 0062;0061 302A 0316 102E0 059A 0062;0061 302A 0316 102E0 059A 0062;0061 302A 0316 102E0 059A 0062;0061 302A 0316 102E0 059A 0062; # (a◌֚◌̖◌〪◌𐋠b; a◌〪◌̖◌𐋠◌֚b; a◌〪◌̖◌𐋠◌֚b; a◌〪◌̖◌𐋠◌֚b; a◌〪◌̖◌𐋠◌֚b; ) LATIN SMALL LETTER A, HEBREW ACCENT YETIV, COMBINING GRAVE ACCENT BELOW, IDEOGRAPHIC LEVEL TONE MARK, COPTIC EPACT THOUSANDS MARK, LATIN SMALL LETTER B
@@ -18297,6 +18305,8 @@ FFEE;FFEE;FFEE;25CB;25CB; # (○; ○; ○; ○; ○; ) HALFWIDTH WHITE CIRCLE
0061 11173 3099 093C 0334 0062;0061 0334 11173 093C 3099 0062;0061 0334 11173 093C 3099 0062;0061 0334 11173 093C 3099 0062;0061 0334 11173 093C 3099 0062; # (a◌𑅳◌゙◌़◌̴b; a◌̴◌𑅳◌़◌゙b; a◌̴◌𑅳◌़◌゙b; a◌̴◌𑅳◌़◌゙b; a◌̴◌𑅳◌़◌゙b; ) LATIN SMALL LETTER A, MAHAJANI SIGN NUKTA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, LATIN SMALL LETTER B
0061 05B0 094D 3099 111C0 0062;0061 3099 094D 111C0 05B0 0062;0061 3099 094D 111C0 05B0 0062;0061 3099 094D 111C0 05B0 0062;0061 3099 094D 111C0 05B0 0062; # (a◌ְ◌्◌゙𑇀b; a◌゙◌्𑇀◌ְb; a◌゙◌्𑇀◌ְb; a◌゙◌्𑇀◌ְb; a◌゙◌्𑇀◌ְb; ) LATIN SMALL LETTER A, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, SHARADA SIGN VIRAMA, LATIN SMALL LETTER B
0061 111C0 05B0 094D 3099 0062;0061 3099 111C0 094D 05B0 0062;0061 3099 111C0 094D 05B0 0062;0061 3099 111C0 094D 05B0 0062;0061 3099 111C0 094D 05B0 0062; # (a𑇀◌ְ◌्◌゙b; a◌゙𑇀◌्◌ְb; a◌゙𑇀◌्◌ְb; a◌゙𑇀◌्◌ְb; a◌゙𑇀◌्◌ְb; ) LATIN SMALL LETTER A, SHARADA SIGN VIRAMA, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, LATIN SMALL LETTER B
+0061 3099 093C 0334 111CA 0062;0061 0334 093C 111CA 3099 0062;0061 0334 093C 111CA 3099 0062;0061 0334 093C 111CA 3099 0062;0061 0334 093C 111CA 3099 0062; # (a◌゙◌़◌̴◌𑇊b; a◌̴◌़◌𑇊◌゙b; a◌̴◌़◌𑇊◌゙b; a◌̴◌़◌𑇊◌゙b; a◌̴◌़◌𑇊◌゙b; ) LATIN SMALL LETTER A, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, SHARADA SIGN NUKTA, LATIN SMALL LETTER B
+0061 111CA 3099 093C 0334 0062;0061 0334 111CA 093C 3099 0062;0061 0334 111CA 093C 3099 0062;0061 0334 111CA 093C 3099 0062;0061 0334 111CA 093C 3099 0062; # (a◌𑇊◌゙◌़◌̴b; a◌̴◌𑇊◌़◌゙b; a◌̴◌𑇊◌़◌゙b; a◌̴◌𑇊◌़◌゙b; a◌̴◌𑇊◌़◌゙b; ) LATIN SMALL LETTER A, SHARADA SIGN NUKTA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, LATIN SMALL LETTER B
0061 05B0 094D 3099 11235 0062;0061 3099 094D 11235 05B0 0062;0061 3099 094D 11235 05B0 0062;0061 3099 094D 11235 05B0 0062;0061 3099 094D 11235 05B0 0062; # (a◌ְ◌्◌゙𑈵b; a◌゙◌्𑈵◌ְb; a◌゙◌्𑈵◌ְb; a◌゙◌्𑈵◌ְb; a◌゙◌्𑈵◌ְb; ) LATIN SMALL LETTER A, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, KHOJKI SIGN VIRAMA, LATIN SMALL LETTER B
0061 11235 05B0 094D 3099 0062;0061 3099 11235 094D 05B0 0062;0061 3099 11235 094D 05B0 0062;0061 3099 11235 094D 05B0 0062;0061 3099 11235 094D 05B0 0062; # (a𑈵◌ְ◌्◌゙b; a◌゙𑈵◌्◌ְb; a◌゙𑈵◌्◌ְb; a◌゙𑈵◌्◌ְb; a◌゙𑈵◌्◌ְb; ) LATIN SMALL LETTER A, KHOJKI SIGN VIRAMA, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, LATIN SMALL LETTER B
0061 3099 093C 0334 11236 0062;0061 0334 093C 11236 3099 0062;0061 0334 093C 11236 3099 0062;0061 0334 093C 11236 3099 0062;0061 0334 093C 11236 3099 0062; # (a◌゙◌़◌̴◌𑈶b; a◌̴◌़◌𑈶◌゙b; a◌̴◌़◌𑈶◌゙b; a◌̴◌़◌𑈶◌゙b; a◌̴◌़◌𑈶◌゙b; ) LATIN SMALL LETTER A, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, KHOJKI SIGN NUKTA, LATIN SMALL LETTER B
@@ -18347,6 +18357,8 @@ FFEE;FFEE;FFEE;25CB;25CB; # (○; ○; ○; ○; ○; ) HALFWIDTH WHITE CIRCLE
0061 116B6 05B0 094D 3099 0062;0061 3099 116B6 094D 05B0 0062;0061 3099 116B6 094D 05B0 0062;0061 3099 116B6 094D 05B0 0062;0061 3099 116B6 094D 05B0 0062; # (a𑚶◌ְ◌्◌゙b; a◌゙𑚶◌्◌ְb; a◌゙𑚶◌्◌ְb; a◌゙𑚶◌्◌ְb; a◌゙𑚶◌्◌ְb; ) LATIN SMALL LETTER A, TAKRI SIGN VIRAMA, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, LATIN SMALL LETTER B
0061 3099 093C 0334 116B7 0062;0061 0334 093C 116B7 3099 0062;0061 0334 093C 116B7 3099 0062;0061 0334 093C 116B7 3099 0062;0061 0334 093C 116B7 3099 0062; # (a◌゙◌़◌̴◌𑚷b; a◌̴◌़◌𑚷◌゙b; a◌̴◌़◌𑚷◌゙b; a◌̴◌़◌𑚷◌゙b; a◌̴◌़◌𑚷◌゙b; ) LATIN SMALL LETTER A, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, TAKRI SIGN NUKTA, LATIN SMALL LETTER B
0061 116B7 3099 093C 0334 0062;0061 0334 116B7 093C 3099 0062;0061 0334 116B7 093C 3099 0062;0061 0334 116B7 093C 3099 0062;0061 0334 116B7 093C 3099 0062; # (a◌𑚷◌゙◌़◌̴b; a◌̴◌𑚷◌़◌゙b; a◌̴◌𑚷◌़◌゙b; a◌̴◌𑚷◌़◌゙b; a◌̴◌𑚷◌़◌゙b; ) LATIN SMALL LETTER A, TAKRI SIGN NUKTA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, LATIN SMALL LETTER B
+0061 05B0 094D 3099 1172B 0062;0061 3099 094D 1172B 05B0 0062;0061 3099 094D 1172B 05B0 0062;0061 3099 094D 1172B 05B0 0062;0061 3099 094D 1172B 05B0 0062; # (a◌ְ◌्◌゙◌𑜫b; a◌゙◌्◌𑜫◌ְb; a◌゙◌्◌𑜫◌ְb; a◌゙◌्◌𑜫◌ְb; a◌゙◌्◌𑜫◌ְb; ) LATIN SMALL LETTER A, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, AHOM SIGN KILLER, LATIN SMALL LETTER B
+0061 1172B 05B0 094D 3099 0062;0061 3099 1172B 094D 05B0 0062;0061 3099 1172B 094D 05B0 0062;0061 3099 1172B 094D 05B0 0062;0061 3099 1172B 094D 05B0 0062; # (a◌𑜫◌ְ◌्◌゙b; a◌゙◌𑜫◌्◌ְb; a◌゙◌𑜫◌्◌ְb; a◌゙◌𑜫◌्◌ְb; a◌゙◌𑜫◌्◌ְb; ) LATIN SMALL LETTER A, AHOM SIGN KILLER, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, LATIN SMALL LETTER B
0061 093C 0334 16AF0 0062;0061 0334 16AF0 093C 0062;0061 0334 16AF0 093C 0062;0061 0334 16AF0 093C 0062;0061 0334 16AF0 093C 0062; # (a◌़◌̴◌𖫰b; a◌̴◌𖫰◌़b; a◌̴◌𖫰◌़b; a◌̴◌𖫰◌़b; a◌̴◌𖫰◌़b; ) LATIN SMALL LETTER A, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, BASSA VAH COMBINING HIGH TONE, LATIN SMALL LETTER B
0061 16AF0 093C 0334 0062;0061 16AF0 0334 093C 0062;0061 16AF0 0334 093C 0062;0061 16AF0 0334 093C 0062;0061 16AF0 0334 093C 0062; # (a◌𖫰◌़◌̴b; a◌𖫰◌̴◌़b; a◌𖫰◌̴◌़b; a◌𖫰◌̴◌़b; a◌𖫰◌̴◌़b; ) LATIN SMALL LETTER A, BASSA VAH COMBINING HIGH TONE, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, LATIN SMALL LETTER B
0061 093C 0334 16AF1 0062;0061 0334 16AF1 093C 0062;0061 0334 16AF1 093C 0062;0061 0334 16AF1 093C 0062;0061 0334 16AF1 093C 0062; # (a◌़◌̴◌𖫱b; a◌̴◌𖫱◌़b; a◌̴◌𖫱◌़b; a◌̴◌𖫱◌़b; a◌̴◌𖫱◌़b; ) LATIN SMALL LETTER A, DEVANAGARI SIGN NUKTA, COMBINING TILDE OVERLAY, BASSA VAH COMBINING LOW TONE, LATIN SMALL LETTER B
diff --git a/tests/auto/corelib/tools/qchar/tst_qchar.cpp b/tests/auto/corelib/tools/qchar/tst_qchar.cpp
index f80d6e6d93..22fbce9f8e 100644
--- a/tests/auto/corelib/tools/qchar/tst_qchar.cpp
+++ b/tests/auto/corelib/tools/qchar/tst_qchar.cpp
@@ -594,6 +594,10 @@ void tst_QChar::unicodeVersion()
QVERIFY(QChar::unicodeVersion(0x20bd) == QChar::Unicode_7_0);
QVERIFY(QChar::unicodeVersion(0x16b00) == QChar::Unicode_7_0);
+ QVERIFY(QChar(0x08b3).unicodeVersion() == QChar::Unicode_8_0);
+ QVERIFY(QChar::unicodeVersion(0x08b3) == QChar::Unicode_8_0);
+ QVERIFY(QChar::unicodeVersion(0x108e0) == QChar::Unicode_8_0);
+
QVERIFY(QChar(0x09ff).unicodeVersion() == QChar::Unicode_Unassigned);
QVERIFY(QChar::unicodeVersion(0x09ff) == QChar::Unicode_Unassigned);
QVERIFY(QChar::unicodeVersion(0x110000) == QChar::Unicode_Unassigned);
diff --git a/tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.cpp b/tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.cpp
index 7b1b7ce963..6e09ebb09b 100644
--- a/tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.cpp
+++ b/tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.cpp
@@ -73,6 +73,12 @@ int main(int argc, char *argv[])
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"));
parser.addOption(newlineOption);
+ // A hidden option
+ QCommandLineOption hiddenOption(QStringList() << QStringLiteral("hidden"));
+ hiddenOption.setDescription(QStringLiteral("THIS SHOULD NEVER APPEAR"));
+ hiddenOption.setHidden(true);
+ parser.addOption(hiddenOption);
+
// This program supports different options depending on the "command" (first argument).
// Call parse() to find out the positional arguments.
parser.parse(QCoreApplication::arguments());
diff --git a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
index 6ff46ed20b..fb0b971602 100644
--- a/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
+++ b/tests/auto/corelib/tools/qcommandlineparser/tst_qcommandlineparser.cpp
@@ -35,6 +35,7 @@
#include <QtCore/QCommandLineParser>
Q_DECLARE_METATYPE(char**)
+Q_DECLARE_METATYPE(QCommandLineParser::OptionsAfterPositionalArgumentsMode)
class tst_QCommandLineParser : public QObject
{
@@ -51,6 +52,8 @@ private slots:
void testPositionalArguments();
void testBooleanOption_data();
void testBooleanOption();
+ void testOptionsAndPositional_data();
+ void testOptionsAndPositional();
void testMultipleNames_data();
void testMultipleNames();
void testSingleValueOption_data();
@@ -130,7 +133,7 @@ void tst_QCommandLineParser::testBooleanOption()
QFETCH(bool, expectedIsSet);
QCoreApplication app(empty_argc, empty_argv);
QCommandLineParser parser;
- QVERIFY(parser.addOption(QCommandLineOption(QStringLiteral("b"), QStringLiteral("a boolean option"))));
+ QVERIFY(parser.addOption(QCommandLineOption(QStringLiteral("b"))));
QVERIFY(parser.parse(args));
QCOMPARE(parser.optionNames(), expectedOptionNames);
QCOMPARE(parser.isSet("b"), expectedIsSet);
@@ -141,6 +144,40 @@ void tst_QCommandLineParser::testBooleanOption()
QVERIFY(!parser.isSet("c"));
}
+void tst_QCommandLineParser::testOptionsAndPositional_data()
+{
+ QTest::addColumn<QStringList>("args");
+ QTest::addColumn<QStringList>("expectedOptionNames");
+ QTest::addColumn<bool>("expectedIsSet");
+ QTest::addColumn<QStringList>("expectedPositionalArguments");
+ QTest::addColumn<QCommandLineParser::OptionsAfterPositionalArgumentsMode>("parsingMode");
+
+ const QStringList arg = QStringList() << "arg";
+ QTest::newRow("before_positional_default") << (QStringList() << "tst_qcommandlineparser" << "-b" << "arg") << (QStringList() << "b") << true << arg << QCommandLineParser::ParseAsOptions;
+ QTest::newRow("after_positional_default") << (QStringList() << "tst_qcommandlineparser" << "arg" << "-b") << (QStringList() << "b") << true << arg << QCommandLineParser::ParseAsOptions;
+ QTest::newRow("before_positional_parseAsArg") << (QStringList() << "tst_qcommandlineparser" << "-b" << "arg") << (QStringList() << "b") << true << arg << QCommandLineParser::ParseAsPositionalArguments;
+ QTest::newRow("after_positional_parseAsArg") << (QStringList() << "tst_qcommandlineparser" << "arg" << "-b") << (QStringList()) << false << (QStringList() << "arg" << "-b") << QCommandLineParser::ParseAsPositionalArguments;
+}
+
+void tst_QCommandLineParser::testOptionsAndPositional()
+{
+ QFETCH(QStringList, args);
+ QFETCH(QStringList, expectedOptionNames);
+ QFETCH(bool, expectedIsSet);
+ QFETCH(QStringList, expectedPositionalArguments);
+ QFETCH(QCommandLineParser::OptionsAfterPositionalArgumentsMode, parsingMode);
+
+ QCoreApplication app(empty_argc, empty_argv);
+ QCommandLineParser parser;
+ parser.setOptionsAfterPositionalArgumentsMode(parsingMode);
+ QVERIFY(parser.addOption(QCommandLineOption(QStringLiteral("b"), QStringLiteral("a boolean option"))));
+ QVERIFY(parser.parse(args));
+ QCOMPARE(parser.optionNames(), expectedOptionNames);
+ QCOMPARE(parser.isSet("b"), expectedIsSet);
+ QCOMPARE(parser.values("b"), QStringList());
+ QCOMPARE(parser.positionalArguments(), expectedPositionalArguments);
+}
+
void tst_QCommandLineParser::testMultipleNames_data()
{
QTest::addColumn<QStringList>("args");
diff --git a/tests/auto/corelib/tools/qdate/tst_qdate.cpp b/tests/auto/corelib/tools/qdate/tst_qdate.cpp
index e515fcf5b9..937a490da2 100644
--- a/tests/auto/corelib/tools/qdate/tst_qdate.cpp
+++ b/tests/auto/corelib/tools/qdate/tst_qdate.cpp
@@ -392,16 +392,37 @@ void tst_QDate::weekNumber_data()
QTest::addColumn<int>("month");
QTest::addColumn<int>("day");
- //next we fill it with data
- QTest::newRow( "data0" ) << 10 << 2002 << 2002 << 3 << 8;
- QTest::newRow( "data1" ) << 10 << 2002 << 2002 << 3 << 8;
- QTest::newRow( "data2" ) << 52 << 1999 << 2000 << 1 << 1;
- QTest::newRow( "data3" ) << 52 << 1999 << 1999 << 12 << 31;
- QTest::newRow( "data4" ) << 1 << 2001 << 2001 << 1 << 1;
- QTest::newRow( "data5" ) << 53 << 1998 << 1998 << 12 << 31;
- QTest::newRow( "data6" ) << 1 << 1985 << 1984 << 12 << 31;
- QTest::newRow( "data7" ) << 52 << 2006 << 2006 << 12 << 31;
- QTest::newRow( "data8" ) << 53 << 2004 << 2005 << 1 << 1;
+ enum { Thursday = 4 };
+ bool wasLastYearLong = false; // 1999 was not a long (53-week) year
+ bool isLongYear;
+
+ // full 400-year cycle for Jan 1, 4 and Dec 28, 31
+ for (int yr = 2000; yr < 2400; ++yr, wasLastYearLong = isLongYear) {
+ QByteArray yrstr = QByteArray::number(yr);
+ int wday = QDate(yr, 1, 1).dayOfWeek();
+
+ // the year is 53-week long if Jan 1 is Thursday or, if it's a leap year, a Wednesday
+ isLongYear = (wday == Thursday) || (QDate::isLeapYear(yr) && wday == Thursday - 1);
+
+ // Jan 4 is always on week 1
+ QTest::newRow(yrstr + "-01-04") << 1 << yr << yr << 1 << 4;
+
+ // Dec 28 is always on the last week
+ QTest::newRow(yrstr + "-12-28") << (52 + isLongYear) << yr << yr << 12 << 28;
+
+ // Jan 1 is on either on week 1 or on the last week of the previous year
+ QTest::newRow(yrstr + "-01-01")
+ << (wday <= Thursday ? 1 : 52 + wasLastYearLong)
+ << (wday <= Thursday ? yr : yr - 1)
+ << yr << 1 << 1;
+
+ // Dec 31 is either on the last week or week 1 of the next year
+ wday = QDate(yr, 12, 31).dayOfWeek();
+ QTest::newRow(yrstr + "-12-31")
+ << (wday >= Thursday ? 52 + isLongYear : 1)
+ << (wday >= Thursday ? yr : yr + 1)
+ << yr << 12 << 31;
+ }
}
void tst_QDate::weekNumber()
diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
index df9089057d..228ce73c6b 100644
--- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
+++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
@@ -68,7 +68,10 @@ private slots:
void timeSpec();
void toTime_t_data();
void toTime_t();
+ void daylightSavingsTimeChange_data();
void daylightSavingsTimeChange();
+ void springForward_data();
+ void springForward();
void setDate();
void setTime_data();
void setTime();
@@ -188,10 +191,10 @@ tst_QDateTime::tst_QDateTime()
void tst_QDateTime::initTestCase()
{
// Never construct a message like this in an i18n context...
- const char *typemsg1, *typemsg2 = "and therefore not";
+ const char *typemsg1 = "exactly";
+ const char *typemsg2 = "and therefore not";
switch (localTimeType) {
case LocalTimeIsUtc:
- typemsg1 = "exactly";
break;
case LocalTimeBehindUtc:
typemsg1 = "behind";
@@ -1561,36 +1564,87 @@ void tst_QDateTime::toTime_t()
}
}
+void tst_QDateTime::daylightSavingsTimeChange_data()
+{
+ QTest::addColumn<QDate>("inDST");
+ QTest::addColumn<QDate>("outDST");
+ QTest::newRow("Autumn") << QDate(2006, 8, 1) << QDate(2006, 12, 1);
+ QTest::newRow("Spring") << QDate(2006, 5, 1) << QDate(2006, 2, 1);
+}
+
void tst_QDateTime::daylightSavingsTimeChange()
{
- // This is a regression test for an old bug where starting with a date in
- // DST and then moving to a date outside it (or vice-versa) caused 1-hour
- // jumps in time when addSecs() was called.
+ // This has grown from a regression test for an old bug where starting with
+ // a date in DST and then moving to a date outside it (or vice-versa) caused
+ // 1-hour jumps in time when addSecs() was called.
//
// The bug was caused by QDateTime knowing more than it lets show.
// Internally, if it knows, QDateTime stores a flag indicating if the time is
// DST or not. If it doesn't, it sets to "LocalUnknown". The problem happened
// because some functions did not reset the flag when moving in or out of DST.
- // WARNING: This test only works if there's a Daylight Savings Time change
- // in the current locale between 2006-11-06 and 2006-10-16
- // This is true for Central European Time
+ // WARNING: This only tests anything if there's a Daylight Savings Time change
+ // in the current locale between inDST and outDST.
+ // This is true for Central European Time and may be elsewhere.
+
+ QFETCH(QDate, inDST);
+ QFETCH(QDate, outDST);
- if (!europeanTimeZone)
- QSKIP("Not tested with timezone other than Central European (CET/CEST)");
+ // First with simple construction
+ QDateTime dt = QDateTime(outDST, QTime(0, 0, 0), Qt::LocalTime);
+ int outDSTsecs = dt.toTime_t();
- QDateTime dt = QDateTime(QDate(2006, 11, 6), QTime(0, 0, 0), Qt::LocalTime);
- dt.setDate(QDate(2006, 10, 16));
+ dt.setDate(inDST);
dt = dt.addSecs(1);
- QCOMPARE(dt.date(), QDate(2006, 10, 16));
- QCOMPARE(dt.time(), QTime(0, 0, 1));
+ QCOMPARE(dt, QDateTime(inDST, QTime(0, 0, 1)));
// now using fromTime_t
- dt = QDateTime::fromTime_t(1162767600); // 2006-11-06 00:00:00 +0100
- dt.setDate(QDate(2006, 10, 16));
- dt = dt.addSecs (1);
- QCOMPARE(dt.date(), QDate(2006, 10, 16));
- QCOMPARE(dt.time(), QTime(0, 0, 1));
+ dt = QDateTime::fromTime_t(outDSTsecs);
+ QCOMPARE(dt, QDateTime(outDST, QTime(0, 0, 0)));
+
+ dt.setDate(inDST);
+ dt = dt.addSecs(60);
+ QCOMPARE(dt, QDateTime(inDST, QTime(0, 1, 0)));
+}
+
+void tst_QDateTime::springForward_data()
+{
+ QTest::addColumn<QDate>("day"); // day of DST transition
+ QTest::addColumn<QTime>("time"); // in the "missing hour"
+ QTest::addColumn<int>("step"); // days to step; +ve from before, -ve from after
+ QTest::addColumn<int>("adjust"); // minutes ahead of UTC on day stepped from
+
+ if (europeanTimeZone) {
+ QTest::newRow("Europe from day before") << QDate(2015, 3, 29) << QTime(2, 30, 0) << 1 << 60;
+ QTest::newRow("Europe from day after") << QDate(2015, 3, 29) << QTime(2, 30, 0) << -1 << 120;
+ // } else if (otherZone) {
+ } else {
+ QSKIP("No spring forward test data for this TZ");
+ }
+}
+
+void tst_QDateTime::springForward()
+{
+ QFETCH(QDate, day);
+ QFETCH(QTime, time);
+ QFETCH(int, step);
+ QFETCH(int, adjust);
+
+ QDateTime direct = QDateTime(day.addDays(-step), time, Qt::LocalTime).addDays(step);
+ QCOMPARE(direct.date(), day);
+ QCOMPARE(direct.time().minute(), time.minute());
+ QCOMPARE(direct.time().second(), time.second());
+ int off = direct.time().hour() - time.hour();
+ QVERIFY(off == 1 || off == -1);
+ // Note: function doc claims always +1, but this should be reviewed !
+
+ // Repeat, but getting there via .toLocalTime():
+ QDateTime detour = QDateTime(day.addDays(-step),
+ time.addSecs(-60 * adjust),
+ Qt::UTC).toLocalTime();
+ QCOMPARE(detour.time(), time);
+ detour = detour.addDays(step);
+ QCOMPARE(detour, direct); // Insist on consistency.
}
void tst_QDateTime::operator_eqeq_data()
diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm b/tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm
index 6bdaa94e49..0ad9a8253b 100644
--- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm
+++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime_mac.mm
@@ -56,19 +56,17 @@ void tst_QDateTime_macTypes()
}
// QDateTime <-> NSDate
{
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
QDateTime qtDateTime = QDateTime::fromMSecsSinceEpoch(0);
const NSDate *nsDate = qtDateTime.toNSDate();
QCOMPARE(QDateTime::fromNSDate(nsDate), qtDateTime);
- [autoreleasepool release];
}
{
- NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
QDateTime qtDateTime = QDateTime::fromMSecsSinceEpoch(0);
const NSDate *nsDate = qtDateTime.toNSDate();
QDateTime qtDateTimeCopy(qtDateTime);
qtDateTime.setTime_t(10000); // modify
QCOMPARE(QDateTime::fromNSDate(nsDate), qtDateTimeCopy);
- [autoreleasepool release];
}
}
diff --git a/tests/auto/corelib/tools/qhash/tst_qhash.cpp b/tests/auto/corelib/tools/qhash/tst_qhash.cpp
index 6ea33fb37f..6a5c6b5670 100644
--- a/tests/auto/corelib/tools/qhash/tst_qhash.cpp
+++ b/tests/auto/corelib/tools/qhash/tst_qhash.cpp
@@ -62,6 +62,7 @@ private slots:
void compare();
void compare2();
void iterators(); // sligthly modified from tst_QMap
+ void keyIterator();
void keys_values_uniqueKeys(); // slightly modified from tst_QMap
void noNeedlessRehashes();
@@ -965,6 +966,34 @@ void tst_QHash::iterators()
}
}
+void tst_QHash::keyIterator()
+{
+ QHash<int, int> hash;
+
+ for (int i = 0; i < 100; ++i)
+ hash.insert(i, i*100);
+
+ QHash<int, int>::key_iterator key_it = hash.keyBegin();
+ QHash<int, int>::const_iterator it = hash.cbegin();
+ for (int i = 0; i < 100; ++i) {
+ QCOMPARE(*key_it, it.key());
+ key_it++;
+ it++;
+ }
+
+ key_it = std::find(hash.keyBegin(), hash.keyEnd(), 50);
+ it = std::find(hash.cbegin(), hash.cend(), 50 * 100);
+
+ QVERIFY(key_it != hash.keyEnd());
+ QCOMPARE(*key_it, it.key());
+ QCOMPARE(*(key_it++), (it++).key());
+ QCOMPARE(*(key_it--), (it--).key());
+ QCOMPARE(*(++key_it), (++it).key());
+ QCOMPARE(*(--key_it), (--it).key());
+
+ QCOMPARE(std::count(hash.keyBegin(), hash.keyEnd(), 99), 1);
+}
+
void tst_QHash::rehash_isnt_quadratic()
{
// this test should be incredibly slow if rehash() is quadratic
diff --git a/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp b/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp
index 6961426f59..bde9433a24 100644
--- a/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp
+++ b/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp
@@ -50,6 +50,8 @@ private Q_SLOTS:
void qthash();
void range();
void rangeCommutative();
+
+ void setGlobalQHashSeed();
};
void tst_QHashFunctions::qhash()
@@ -207,5 +209,21 @@ void tst_QHashFunctions::rangeCommutative()
(void)qHashRangeCommutative(hashables, hashables + numHashables);
}
+void tst_QHashFunctions::setGlobalQHashSeed()
+{
+ // Setter works as advertised
+ qSetGlobalQHashSeed(0x10101010);
+ QCOMPARE(qGlobalQHashSeed(), 0x10101010);
+
+ // Creating a new QHash doesn't reset the seed
+ QHash<QString, int> someHash;
+ someHash.insert("foo", 42);
+ QCOMPARE(qGlobalQHashSeed(), 0x10101010);
+
+ // Reset works as advertised
+ qSetGlobalQHashSeed(-1);
+ QVERIFY(qGlobalQHashSeed() != -1);
+}
+
QTEST_APPLESS_MAIN(tst_QHashFunctions)
#include "tst_qhashfunctions.moc"
diff --git a/tests/auto/corelib/tools/qlatin1string/.gitignore b/tests/auto/corelib/tools/qlatin1string/.gitignore
new file mode 100644
index 0000000000..dddf56b2df
--- /dev/null
+++ b/tests/auto/corelib/tools/qlatin1string/.gitignore
@@ -0,0 +1 @@
+tst_qlatin1string
diff --git a/tests/auto/corelib/tools/qlatin1string/qlatin1string.pro b/tests/auto/corelib/tools/qlatin1string/qlatin1string.pro
new file mode 100644
index 0000000000..a996dab23e
--- /dev/null
+++ b/tests/auto/corelib/tools/qlatin1string/qlatin1string.pro
@@ -0,0 +1,9 @@
+CONFIG += testcase parallel_test
+TARGET = tst_qlatin1string
+QT = core testlib
+SOURCES = tst_qlatin1string.cpp
+DEFINES += QT_NO_CAST_TO_ASCII
+contains(QT_CONFIG,c++11): CONFIG += c++11
+contains(QT_CONFIG,c++14): CONFIG += c++14
+
+DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp b/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp
new file mode 100644
index 0000000000..290c9fc12a
--- /dev/null
+++ b/tests/auto/corelib/tools/qlatin1string/tst_qlatin1string.cpp
@@ -0,0 +1,126 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+
+#include <QString>
+
+class tst_QLatin1String : public QObject
+{
+ Q_OBJECT
+
+private Q_SLOTS:
+ void nullString();
+ void emptyString();
+};
+
+void tst_QLatin1String::nullString()
+{
+ // default ctor
+ {
+ QLatin1String l1;
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(Q_NULLPTR));
+ QCOMPARE(l1.size(), 0);
+
+ QString s = l1;
+ QVERIFY(s.isNull());
+ }
+
+ // from nullptr
+ {
+ const char *null = Q_NULLPTR;
+ QLatin1String l1(null);
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(Q_NULLPTR));
+ QCOMPARE(l1.size(), 0);
+
+ QString s = l1;
+ QVERIFY(s.isNull());
+ }
+
+ // from null QByteArray
+ {
+ const QByteArray null;
+ QVERIFY(null.isNull());
+
+ QLatin1String l1(null);
+ QEXPECT_FAIL("", "null QByteArrays become non-null QLatin1Strings...", Continue);
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(Q_NULLPTR));
+ QCOMPARE(l1.size(), 0);
+
+ QString s = l1;
+ QEXPECT_FAIL("", "null QByteArrays become non-null QLatin1Strings become non-null QStrings...", Continue);
+ QVERIFY(s.isNull());
+ }
+}
+
+void tst_QLatin1String::emptyString()
+{
+ {
+ const char *empty = "";
+ QLatin1String l1(empty);
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(empty));
+ QCOMPARE(l1.size(), 0);
+
+ QString s = l1;
+ QVERIFY(s.isEmpty());
+ QVERIFY(!s.isNull());
+ }
+
+ {
+ const char *notEmpty = "foo";
+ QLatin1String l1(notEmpty, 0);
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(notEmpty));
+ QCOMPARE(l1.size(), 0);
+
+ QString s = l1;
+ QVERIFY(s.isEmpty());
+ QVERIFY(!s.isNull());
+ }
+
+ {
+ const QByteArray empty = "";
+ QLatin1String l1(empty);
+ QCOMPARE(static_cast<const void*>(l1.data()), static_cast<const void*>(empty.constData()));
+ QCOMPARE(l1.size(), 0);
+
+ QString s = l1;
+ QVERIFY(s.isEmpty());
+ QVERIFY(!s.isNull());
+ }
+}
+
+
+
+QTEST_APPLESS_MAIN(tst_QLatin1String)
+
+#include "tst_qlatin1string.moc"
diff --git a/tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp b/tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp
index 82303b4f72..d3ace40164 100644
--- a/tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp
+++ b/tests/auto/corelib/tools/qlinkedlist/tst_qlinkedlist.cpp
@@ -204,6 +204,7 @@ private slots:
void removeOneInt() const;
void removeOneMovable() const;
void removeOneComplex() const;
+ void reverseIterators() const;
void startsWithInt() const;
void startsWithMovable() const;
void startsWithComplex() const;
@@ -527,12 +528,12 @@ void tst_QLinkedList::contains() const
QLinkedList<T> list;
list << T_FOO << T_BAR << T_BAZ;
- QVERIFY(list.contains(T_FOO) == true);
+ QVERIFY(list.contains(T_FOO));
QVERIFY(list.contains(T_BLAH) != true);
// add it and make sure it matches
list.append(T_BLAH);
- QVERIFY(list.contains(T_BLAH) == true);
+ QVERIFY(list.contains(T_BLAH));
}
void tst_QLinkedList::containsInt() const
@@ -754,6 +755,21 @@ void tst_QLinkedList::removeOneComplex() const
QCOMPARE(liveCount, Complex::getLiveCount());
}
+void tst_QLinkedList::reverseIterators() const
+{
+ QLinkedList<int> l;
+ l << 1 << 2 << 3 << 4;
+ QLinkedList<int> lr = l;
+ std::reverse(lr.begin(), lr.end());
+ const QLinkedList<int> &clr = lr;
+ QVERIFY(std::equal(l.begin(), l.end(), lr.rbegin()));
+ QVERIFY(std::equal(l.begin(), l.end(), lr.crbegin()));
+ QVERIFY(std::equal(l.begin(), l.end(), clr.rbegin()));
+ QVERIFY(std::equal(lr.rbegin(), lr.rend(), l.begin()));
+ QVERIFY(std::equal(lr.crbegin(), lr.crend(), l.begin()));
+ QVERIFY(std::equal(clr.rbegin(), clr.rend(), l.begin()));
+}
+
template<typename T>
void tst_QLinkedList::startsWith() const
{
diff --git a/tests/auto/corelib/tools/qlist/tst_qlist.cpp b/tests/auto/corelib/tools/qlist/tst_qlist.cpp
index 1207986dde..1bb31afa9c 100644
--- a/tests/auto/corelib/tools/qlist/tst_qlist.cpp
+++ b/tests/auto/corelib/tools/qlist/tst_qlist.cpp
@@ -76,6 +76,13 @@ struct Movable {
return i == other.i;
}
+ bool operator<(const Movable &other) const
+ {
+ check(state, Constructed);
+ check(other.state, Constructed);
+ return i < other.i;
+ }
+
Movable &operator=(const Movable &other)
{
check(state, Constructed);
@@ -144,6 +151,13 @@ struct Optimal
return i == other.i;
}
+ bool operator<(const Optimal &other) const
+ {
+ check(state, Constructed);
+ check(other.state, Constructed);
+ return i < other.i;
+ }
+
Optimal &operator=(const Optimal &other)
{
check(state, Constructed);
@@ -220,6 +234,12 @@ struct Complex
return value == other.value;
}
+ bool operator<(Complex const &other) const
+ {
+ check(); other.check();
+ return value < other.value;
+ }
+
void check() const
{
QVERIFY(this == checkSum);
@@ -293,6 +313,8 @@ private slots:
void lastOptimal() const;
void lastMovable() const;
void lastComplex() const;
+ void constFirst() const;
+ void constLast() const;
void beginOptimal() const;
void beginMovable() const;
void beginComplex() const;
@@ -329,6 +351,9 @@ private slots:
void replaceOptimal() const;
void replaceMovable() const;
void replaceComplex() const;
+ void reverseIteratorsOptimal() const;
+ void reverseIteratorsMovable() const;
+ void reverseIteratorsComplex() const;
void startsWithOptimal() const;
void startsWithMovable() const;
void startsWithComplex() const;
@@ -376,6 +401,9 @@ private slots:
void eraseValidIteratorsOnSharedList() const;
void insertWithValidIteratorsOnSharedList() const;
+ void qhashOptimal() const { qhash<Optimal>(); }
+ void qhashMovable() const { qhash<Movable>(); }
+ void qhashComplex() const { qhash<Complex>(); }
void reserve() const;
private:
template<typename T> void length() const;
@@ -392,10 +420,12 @@ private:
template<typename T> void endsWith() const;
template<typename T> void lastIndexOf() const;
template<typename T> void move() const;
+ template<typename T> void qhash() const;
template<typename T> void removeAll() const;
template<typename T> void removeAt() const;
template<typename T> void removeOne() const;
template<typename T> void replace() const;
+ template<typename T> void reverseIterators() const;
template<typename T> void startsWith() const;
template<typename T> void swap() const;
template<typename T> void takeAt() const;
@@ -701,6 +731,140 @@ void tst_QList::firstComplex() const
QCOMPARE(liveCount, Complex::getLiveCount());
}
+void tst_QList::constFirst() const
+{
+ // Based on tst_QVector::constFirst()
+ QList<int> list;
+ list << 69 << 42 << 3;
+
+ // test it starts ok
+ QCOMPARE(list.constFirst(), 69);
+ QVERIFY(list.isDetached());
+
+ QList<int> listCopy = list;
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+
+ QCOMPARE(list.constFirst(), 69);
+ QCOMPARE(listCopy.constFirst(), 69);
+
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+
+ // test removal changes
+ list.removeAt(0);
+ QVERIFY(list.isDetached());
+ QVERIFY(!list.isSharedWith(listCopy));
+ QCOMPARE(list.constFirst(), 42);
+ QCOMPARE(listCopy.constFirst(), 69);
+
+ listCopy = list;
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+
+ QCOMPARE(list.constFirst(), 42);
+ QCOMPARE(listCopy.constFirst(), 42);
+
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+
+ // test prepend changes
+ list.prepend(23);
+ QVERIFY(list.isDetached());
+ QVERIFY(!list.isSharedWith(listCopy));
+ QCOMPARE(list.constFirst(), 23);
+ QCOMPARE(listCopy.constFirst(), 42);
+
+ listCopy = list;
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+
+ QCOMPARE(list.constFirst(), 23);
+ QCOMPARE(listCopy.constFirst(), 23);
+
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+}
+
+void tst_QList::constLast() const
+{
+ // Based on tst_QVector::constLast()
+ QList<int> list;
+ list << 69 << 42 << 3;
+
+ // test it starts ok
+ QCOMPARE(list.constLast(), 3);
+ QVERIFY(list.isDetached());
+
+ QList<int> listCopy = list;
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+
+ QCOMPARE(list.constLast(), 3);
+ QCOMPARE(listCopy.constLast(), 3);
+
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+
+ // test removal changes
+ list.removeLast();
+ QVERIFY(list.isDetached());
+ QVERIFY(!list.isSharedWith(listCopy));
+ QCOMPARE(list.constLast(), 42);
+ QCOMPARE(listCopy.constLast(), 3);
+
+ listCopy = list;
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+
+ QCOMPARE(list.constLast(), 42);
+ QCOMPARE(listCopy.constLast(), 42);
+
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+
+ // test prepend changes
+ list.append(23);
+ QVERIFY(list.isDetached());
+ QVERIFY(!list.isSharedWith(listCopy));
+ QCOMPARE(list.constLast(), 23);
+ QCOMPARE(listCopy.constLast(), 42);
+
+ listCopy = list;
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+
+ QCOMPARE(list.constLast(), 23);
+ QCOMPARE(listCopy.constLast(), 23);
+
+ QVERIFY(!list.isDetached());
+ QVERIFY(!listCopy.isDetached());
+ QVERIFY(list.isSharedWith(listCopy));
+ QVERIFY(listCopy.isSharedWith(list));
+}
+
template<typename T>
void tst_QList::last() const
{
@@ -812,12 +976,12 @@ void tst_QList::contains() const
QList<T> list;
list << T_FOO << T_BAR << T_BAZ;
- QVERIFY(list.contains(T_FOO) == true);
+ QVERIFY(list.contains(T_FOO));
QVERIFY(list.contains(T_BLAH) != true);
// add it and make sure it matches
list.append(T_BLAH);
- QVERIFY(list.contains(T_BLAH) == true);
+ QVERIFY(list.contains(T_BLAH));
}
void tst_QList::containsOptimal() const
@@ -1220,6 +1384,43 @@ void tst_QList::replaceComplex() const
}
template<typename T>
+void tst_QList::reverseIterators() const
+{
+ QList<T> v;
+ v << T_CAT << T_DOG << T_BLAH << T_BAZ;
+ QList<T> vr = v;
+ std::reverse(vr.begin(), vr.end());
+ const QList<T> &cvr = vr;
+ QVERIFY(std::equal(v.begin(), v.end(), vr.rbegin()));
+ QVERIFY(std::equal(v.begin(), v.end(), vr.crbegin()));
+ QVERIFY(std::equal(v.begin(), v.end(), cvr.rbegin()));
+ QVERIFY(std::equal(vr.rbegin(), vr.rend(), v.begin()));
+ QVERIFY(std::equal(vr.crbegin(), vr.crend(), v.begin()));
+ QVERIFY(std::equal(cvr.rbegin(), cvr.rend(), v.begin()));
+}
+
+void tst_QList::reverseIteratorsOptimal() const
+{
+ const int liveCount = Optimal::getLiveCount();
+ reverseIterators<Optimal>();
+ QCOMPARE(liveCount, Optimal::getLiveCount());
+}
+
+void tst_QList::reverseIteratorsMovable() const
+{
+ const int liveCount = Movable::getLiveCount();
+ reverseIterators<Movable>();
+ QCOMPARE(liveCount, Movable::getLiveCount());
+}
+
+void tst_QList::reverseIteratorsComplex() const
+{
+ const int liveCount = Complex::getLiveCount();
+ reverseIterators<Complex>();
+ QCOMPARE(liveCount, Complex::getLiveCount());
+}
+
+template<typename T>
void tst_QList::startsWith() const
{
QList<T> list;
@@ -1576,6 +1777,19 @@ void tst_QList::testOperators() const
// []
QCOMPARE(list[0], T_FOO);
QCOMPARE(list[list.size() - 1], T_CAT);
+
+ // <, >, <=, >=
+ QVERIFY(!(list < listtwo));
+ QVERIFY(!(list > listtwo));
+ QVERIFY( list <= listtwo);
+ QVERIFY( list >= listtwo);
+ listtwo.push_back(T_CAT);
+ QVERIFY( list < listtwo);
+ QVERIFY(!(list > listtwo));
+ QVERIFY( list <= listtwo);
+ QVERIFY(!(list >= listtwo));
+ QVERIFY(listtwo > list);
+ QVERIFY(listtwo >= list);
}
void tst_QList::testOperatorsOptimal() const
@@ -1834,6 +2048,16 @@ void tst_QList::insertWithValidIteratorsOnSharedList() const
QCOMPARE(a.at(1), 15);
}
+template <typename T>
+void tst_QList::qhash() const
+{
+ QList<T> l1, l2;
+ QCOMPARE(qHash(l1), qHash(l2));
+ l1 << T_BAR;
+ l2 << T_BAR;
+ QCOMPARE(qHash(l1), qHash(l2));
+}
+
void tst_QList::reserve() const
{
// Note:
diff --git a/tests/auto/corelib/tools/qlocale/qlocale.pro b/tests/auto/corelib/tools/qlocale/qlocale.pro
index abbe31d1ef..5161200260 100644
--- a/tests/auto/corelib/tools/qlocale/qlocale.pro
+++ b/tests/auto/corelib/tools/qlocale/qlocale.pro
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
-SUBDIRS += test \
- syslocaleapp
+SUBDIRS += test
+!winrt: SUBDIRS+=syslocaleapp
diff --git a/tests/auto/corelib/tools/qlocale/test/test.pro b/tests/auto/corelib/tools/qlocale/test/test.pro
index df12d35a09..60afb29233 100644
--- a/tests/auto/corelib/tools/qlocale/test/test.pro
+++ b/tests/auto/corelib/tools/qlocale/test/test.pro
@@ -14,7 +14,7 @@ win32 {
}
}
-TEST_HELPER_INSTALLS = ../syslocaleapp/syslocaleapp
+!winrt: TEST_HELPER_INSTALLS = ../syslocaleapp/syslocaleapp
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
blackberry:LIBS += -lpps
diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
index b1e13a0384..5f046575c4 100644
--- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
+++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
@@ -371,6 +371,8 @@ void tst_QLocale::ctor()
QString("requested: \"" + QString(req_lc) + "\", got: " \
+ QLocale::languageToString(l.language()) \
+ "/" + 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))); \
}
QLocale::setDefault(QLocale(QLocale::C));
@@ -611,7 +613,8 @@ void tst_QLocale::legacyNames()
TEST_CTOR("no", Norwegian, Norway)
TEST_CTOR("sh_ME", Serbian, Montenegro)
TEST_CTOR("tl", Filipino, Philippines)
-
+ TEST_CTOR("iw", Hebrew, Israel)
+ TEST_CTOR("in", Indonesian, Indonesia)
#undef TEST_CTOR
}
@@ -900,6 +903,7 @@ void tst_QLocale::long_long_conversion()
void tst_QLocale::long_long_conversion_extra()
{
QLocale l(QLocale::C);
+ l.setNumberOptions(0);
QCOMPARE(l.toString((qlonglong)1), QString("1"));
QCOMPARE(l.toString((qlonglong)12), QString("12"));
QCOMPARE(l.toString((qlonglong)123), QString("123"));
@@ -1611,20 +1615,20 @@ void tst_QLocale::numberOptions()
bool ok;
QLocale locale(QLocale::C);
- QCOMPARE(locale.numberOptions(), 0);
- QCOMPARE(locale.toInt(QString("12,345"), &ok), 12345);
+ QCOMPARE(locale.numberOptions(), QLocale::OmitGroupSeparator);
+ QCOMPARE(locale.toInt(QString("12345"), &ok), 12345);
QVERIFY(ok);
QCOMPARE(locale.toInt(QString("12345"), &ok), 12345);
QVERIFY(ok);
- QCOMPARE(locale.toString(12345), QString("12,345"));
+ QCOMPARE(locale.toString(12345), QString("12345"));
- locale.setNumberOptions(QLocale::OmitGroupSeparator);
- QCOMPARE(locale.numberOptions(), QLocale::OmitGroupSeparator);
+ locale.setNumberOptions(0);
+ QCOMPARE(locale.numberOptions(), 0);
QCOMPARE(locale.toInt(QString("12,345"), &ok), 12345);
QVERIFY(ok);
QCOMPARE(locale.toInt(QString("12345"), &ok), 12345);
QVERIFY(ok);
- QCOMPARE(locale.toString(12345), QString("12345"));
+ QCOMPARE(locale.toString(12345), QString("12,345"));
locale.setNumberOptions(QLocale::RejectGroupSeparator);
QCOMPARE(locale.numberOptions(), QLocale::RejectGroupSeparator);
@@ -2031,10 +2035,10 @@ void tst_QLocale::standaloneMonthName()
void tst_QLocale::currency()
{
const QLocale c(QLocale::C);
- QCOMPARE(c.toCurrencyString(qulonglong(1234)), QString("1,234"));
- QCOMPARE(c.toCurrencyString(qlonglong(-1234)), QString("-1,234"));
- QCOMPARE(c.toCurrencyString(double(1234.56)), QString("1,234.56"));
- QCOMPARE(c.toCurrencyString(double(-1234.56)), QString("-1,234.56"));
+ QCOMPARE(c.toCurrencyString(qulonglong(1234)), QString("1234"));
+ QCOMPARE(c.toCurrencyString(qlonglong(-1234)), QString("-1234"));
+ QCOMPARE(c.toCurrencyString(double(1234.56)), QString("1234.56"));
+ QCOMPARE(c.toCurrencyString(double(-1234.56)), QString("-1234.56"));
const QLocale en_US("en_US");
QCOMPARE(en_US.toCurrencyString(qulonglong(1234)), QString("$1,234"));
diff --git a/tests/auto/corelib/tools/qmap/tst_qmap.cpp b/tests/auto/corelib/tools/qmap/tst_qmap.cpp
index 8560a2f18c..bb6535b635 100644
--- a/tests/auto/corelib/tools/qmap/tst_qmap.cpp
+++ b/tests/auto/corelib/tools/qmap/tst_qmap.cpp
@@ -65,6 +65,7 @@ private slots:
void take();
void iterators();
+ void keyIterator();
void keys_values_uniqueKeys();
void qmultimap_specific();
@@ -835,6 +836,34 @@ void tst_QMap::iterators()
}
}
+void tst_QMap::keyIterator()
+{
+ QMap<int, int> map;
+
+ for (int i = 0; i < 100; ++i)
+ map.insert(i, i*100);
+
+ QMap<int, int>::key_iterator key_it = map.keyBegin();
+ QMap<int, int>::const_iterator it = map.cbegin();
+ for (int i = 0; i < 100; ++i) {
+ QCOMPARE(*key_it, it.key());
+ ++key_it;
+ ++it;
+ }
+
+ key_it = std::find(map.keyBegin(), map.keyEnd(), 50);
+ it = std::find(map.cbegin(), map.cend(), 50 * 100);
+
+ QVERIFY(key_it != map.keyEnd());
+ QCOMPARE(*key_it, it.key());
+ QCOMPARE(*(key_it++), (it++).key());
+ QCOMPARE(*(key_it--), (it--).key());
+ QCOMPARE(*(++key_it), (++it).key());
+ QCOMPARE(*(--key_it), (--it).key());
+
+ QCOMPARE(std::count(map.keyBegin(), map.keyEnd(), 99), 1);
+}
+
void tst_QMap::keys_values_uniqueKeys()
{
QMap<QString, int> map;
@@ -996,11 +1025,16 @@ void tst_QMap::const_shared_null()
void tst_QMap::equal_range()
{
QMap<int, QString> map;
+ const QMap<int, QString> &cmap = map;
QPair<QMap<int, QString>::iterator, QMap<int, QString>::iterator> result = map.equal_range(0);
QCOMPARE(result.first, map.end());
QCOMPARE(result.second, map.end());
+ QPair<QMap<int, QString>::const_iterator, QMap<int, QString>::const_iterator> cresult = cmap.equal_range(0);
+ QCOMPARE(cresult.first, cmap.cend());
+ QCOMPARE(cresult.second, cmap.cend());
+
map.insert(1, "one");
result = map.equal_range(0);
@@ -1015,6 +1049,18 @@ void tst_QMap::equal_range()
QCOMPARE(result.first, map.end());
QCOMPARE(result.second, map.end());
+ cresult = cmap.equal_range(0);
+ QCOMPARE(cresult.first, cmap.find(1));
+ QCOMPARE(cresult.second, cmap.find(1));
+
+ cresult = cmap.equal_range(1);
+ QCOMPARE(cresult.first, cmap.find(1));
+ QCOMPARE(cresult.second, cmap.cend());
+
+ cresult = cmap.equal_range(2);
+ QCOMPARE(cresult.first, cmap.cend());
+ QCOMPARE(cresult.second, cmap.cend());
+
for (int i = -10; i < 10; i += 2)
map.insert(i, QString("%1").arg(i));
@@ -1030,11 +1076,28 @@ void tst_QMap::equal_range()
QCOMPARE(result.first, map.find(2));
QCOMPARE(result.second, map.find(4));
+ cresult = cmap.equal_range(0);
+ QCOMPARE(cresult.first, cmap.find(0));
+ QCOMPARE(cresult.second, cmap.find(1));
+
+ cresult = cmap.equal_range(1);
+ QCOMPARE(cresult.first, cmap.find(1));
+ QCOMPARE(cresult.second, cmap.find(2));
+
+ cresult = cmap.equal_range(2);
+ QCOMPARE(cresult.first, cmap.find(2));
+ QCOMPARE(cresult.second, cmap.find(4));
+
map.insertMulti(1, "another one");
+
result = map.equal_range(1);
QCOMPARE(result.first, map.find(1));
QCOMPARE(result.second, map.find(2));
+ cresult = cmap.equal_range(1);
+ QCOMPARE(cresult.first, cmap.find(1));
+ QCOMPARE(cresult.second, cmap.find(2));
+
QCOMPARE(map.count(1), 2);
}
diff --git a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp
index fefdec7496..b9a3fc13c5 100644
--- a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp
+++ b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp
@@ -1224,6 +1224,9 @@ void tst_QRegExp::operator_eq()
for (int j = 0; j < I * J * K * ELL; ++j) {
QCOMPARE(rxtable[i] == rxtable[j], i / ELL == j / ELL);
QCOMPARE(rxtable[i] != rxtable[j], i / ELL != j / ELL);
+ // this just happens to have no hash collisions. If at some point
+ // we get collisions, restrict the test to only equal elements:
+ QCOMPARE(qHash(rxtable[i]) == qHash(rxtable[j]), i / ELL == j / ELL);
}
}
}
diff --git a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
index d185e64251..8ddd4979b6 100644
--- a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
+++ b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
@@ -1423,6 +1423,7 @@ static void verifyEquality(const QRegularExpression &re1, const QRegularExpressi
{
QVERIFY(re1 == re2);
QVERIFY(re2 == re1);
+ QCOMPARE(qHash(re1), qHash(re2));
QVERIFY(!(re1 != re2));
QVERIFY(!(re2 != re1));
@@ -1430,22 +1431,26 @@ static void verifyEquality(const QRegularExpression &re1, const QRegularExpressi
QVERIFY(re1 == re3);
QVERIFY(re3 == re1);
+ QCOMPARE(qHash(re1), qHash(re3));
QVERIFY(!(re1 != re3));
QVERIFY(!(re3 != re1));
QVERIFY(re2 == re3);
QVERIFY(re3 == re2);
+ QCOMPARE(qHash(re2), qHash(re3));
QVERIFY(!(re2 != re3));
QVERIFY(!(re3 != re2));
re3 = re2;
QVERIFY(re1 == re3);
QVERIFY(re3 == re1);
+ QCOMPARE(qHash(re1), qHash(re3));
QVERIFY(!(re1 != re3));
QVERIFY(!(re3 != re1));
QVERIFY(re2 == re3);
QVERIFY(re3 == re2);
+ QCOMPARE(qHash(re2), qHash(re3));
QVERIFY(!(re2 != re3));
QVERIFY(!(re3 != re2));
}
diff --git a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp
index 8c29064457..77fc6ad6ae 100644
--- a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp
+++ b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp
@@ -48,10 +48,12 @@ private slots:
void sizeWhenReserved();
void free();
void reserveAndRead();
+ void reserveFrontAndRead();
void chop();
void ungetChar();
void indexOf();
void appendAndRead();
+ void peek();
void readLine();
};
@@ -60,7 +62,7 @@ void tst_QRingBuffer::sizeWhenReserved()
QRingBuffer ringBuffer;
ringBuffer.reserve(5);
- QCOMPARE(ringBuffer.size(), 5);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(5));
}
void tst_QRingBuffer::sizeWhenReservedAndChopped()
@@ -69,14 +71,14 @@ void tst_QRingBuffer::sizeWhenReservedAndChopped()
ringBuffer.reserve(31337);
ringBuffer.chop(31337);
- QCOMPARE(ringBuffer.size(), 0);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(0));
}
void tst_QRingBuffer::sizeWhenEmpty()
{
QRingBuffer ringBuffer;
- QCOMPARE(ringBuffer.size(), 0);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(0));
}
void tst_QRingBuffer::readPointerAtPositionReadTooMuch()
@@ -86,7 +88,7 @@ void tst_QRingBuffer::readPointerAtPositionReadTooMuch()
qint64 length;
const char *buf = ringBuffer.readPointerAtPosition(42, length);
QVERIFY(buf == 0);
- QVERIFY(length == 0);
+ QCOMPARE(length, Q_INT64_C(0));
}
void tst_QRingBuffer::readPointerAtPositionWithHead()
@@ -101,22 +103,22 @@ void tst_QRingBuffer::readPointerAtPositionWithHead()
qint64 length;
const char* buf2 = ringBuffer.readPointerAtPosition(0, length);
- QCOMPARE(length, qint64(2));
- QVERIFY(*buf2 == '2');
- QVERIFY(*(buf2+1) == '3');
+ QCOMPARE(length, Q_INT64_C(2));
+ QCOMPARE(*buf2, '2');
+ QCOMPARE(*(buf2 + 1), '3');
// advance 2 more, ringBuffer should be empty then
ringBuffer.free(2);
buf2 = ringBuffer.readPointerAtPosition(0, length);
- QCOMPARE(length, qint64(0));
+ QCOMPARE(length, Q_INT64_C(0));
QVERIFY(buf2 == 0);
// check buffer with 2 blocks
memcpy(ringBuffer.reserve(4), "0123", 4);
ringBuffer.append(QByteArray("45678", 5));
ringBuffer.free(3);
- buf2 = ringBuffer.readPointerAtPosition(1, length);
- QCOMPARE(length, qint64(5));
+ buf2 = ringBuffer.readPointerAtPosition(Q_INT64_C(1), length);
+ QCOMPARE(length, Q_INT64_C(5));
}
void tst_QRingBuffer::readPointerAtPositionEmptyRead()
@@ -126,7 +128,7 @@ void tst_QRingBuffer::readPointerAtPositionEmptyRead()
qint64 length;
const char *buf = ringBuffer.readPointerAtPosition(0, length);
QVERIFY(buf == 0);
- QVERIFY(length == 0);
+ QCOMPARE(length, Q_INT64_C(0));
}
void tst_QRingBuffer::readPointerAtPositionWriteRead()
@@ -149,14 +151,14 @@ void tst_QRingBuffer::readPointerAtPositionWriteRead()
// write in chunks of 50 bytes
// this ensures there will be multiple QByteArrays inside the QRingBuffer
// since QRingBuffer is then only using individual arrays of around 4000 bytes
- qint64 thisWrite = qMin(remaining, qint64(50));
+ qint64 thisWrite = qMin(remaining, Q_INT64_C(50));
char *pos = ringBuffer.reserve(thisWrite);
inData.read(pos, thisWrite);
remaining -= thisWrite;
}
// was data put into it?
QVERIFY(ringBuffer.size() > 0);
- QCOMPARE(qint64(ringBuffer.size()), inData.size());
+ QCOMPARE(ringBuffer.size(), inData.size());
//read from the QRingBuffer in loop, put back into another QBuffer
QBuffer outData;
@@ -187,12 +189,12 @@ void tst_QRingBuffer::free()
ringBuffer.append(QByteArray("01234", 5));
ringBuffer.free(1);
- QCOMPARE(ringBuffer.size(), 4095 + 2048 + 5);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(4095 + 2048 + 5));
ringBuffer.free(4096);
- QCOMPARE(ringBuffer.size(), 2047 + 5);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(2047 + 5));
ringBuffer.free(48);
ringBuffer.free(2000);
- QCOMPARE(ringBuffer.size(), 4);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(4));
QVERIFY(memcmp(ringBuffer.readPointer(), "1234", 4) == 0);
}
@@ -211,11 +213,33 @@ void tst_QRingBuffer::reserveAndRead()
for (int i = 1; i < 256; ++i) {
QByteArray ba;
ba.resize(i);
- int thisRead = ringBuffer.read(ba.data(), i);
- QCOMPARE(thisRead, i);
- QVERIFY(ba.count(char(i)) == i);
+ qint64 thisRead = ringBuffer.read(ba.data(), i);
+ QCOMPARE(thisRead, qint64(i));
+ QCOMPARE(ba.count(char(i)), i);
}
- QVERIFY(ringBuffer.size() == 0);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(0));
+}
+
+void tst_QRingBuffer::reserveFrontAndRead()
+{
+ QRingBuffer ringBuffer;
+ // fill buffer with an arithmetic progression
+ for (int i = 1; i < 256; ++i) {
+ QByteArray ba(i, char(i));
+ char *ringPos = ringBuffer.reserveFront(i);
+ QVERIFY(ringPos);
+ memcpy(ringPos, ba.constData(), i);
+ }
+
+ // readback and check stored data
+ for (int i = 255; i > 0; --i) {
+ QByteArray ba;
+ ba.resize(i);
+ qint64 thisRead = ringBuffer.read(ba.data(), i);
+ QCOMPARE(thisRead, qint64(i));
+ QCOMPARE(ba.count(char(i)), i);
+ }
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(0));
}
void tst_QRingBuffer::chop()
@@ -227,12 +251,12 @@ void tst_QRingBuffer::chop()
ringBuffer.reserve(4096);
ringBuffer.chop(1);
- QCOMPARE(ringBuffer.size(), 5 + 2048 + 4095);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(5 + 2048 + 4095));
ringBuffer.chop(4096);
- QCOMPARE(ringBuffer.size(), 5 + 2047);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(5 + 2047));
ringBuffer.chop(48);
ringBuffer.chop(2000);
- QCOMPARE(ringBuffer.size(), 4);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(4));
QVERIFY(memcmp(ringBuffer.readPointer(), "0123", 4) == 0);
}
@@ -244,11 +268,11 @@ void tst_QRingBuffer::ungetChar()
for (int i = 1; i < 31; ++i) {
int c = ringBuffer.getChar();
- QVERIFY(c == 1);
+ QCOMPARE(c, 1);
ringBuffer.getChar();
ringBuffer.ungetChar(char(c)); // unget first char
}
- QCOMPARE(ringBuffer.size(), 1);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(1));
}
void tst_QRingBuffer::indexOf()
@@ -258,10 +282,10 @@ void tst_QRingBuffer::indexOf()
ringBuffer.putChar(char(i));
for (int i = 1; i < 256; ++i) {
- int index = ringBuffer.indexOf(char(i));
- QCOMPARE(i - 1, index);
- QCOMPARE(index, ringBuffer.indexOf(char(i), i));
- QVERIFY(ringBuffer.indexOf(char(i), i - 1) == -1); // test for absent char
+ qint64 index = ringBuffer.indexOf(char(i));
+ QCOMPARE(index, qint64(i - 1));
+ QCOMPARE(ringBuffer.indexOf(char(i), i), index);
+ QCOMPARE(ringBuffer.indexOf(char(i), i - 1), -1); // test for absent char
}
}
@@ -275,9 +299,34 @@ void tst_QRingBuffer::appendAndRead()
ringBuffer.append(ba2);
ringBuffer.append(ba3);
- QVERIFY(ringBuffer.read() == ba1);
- QVERIFY(ringBuffer.read() == ba2);
- QVERIFY(ringBuffer.read() == ba3);
+ QCOMPARE(ringBuffer.read(), ba1);
+ QCOMPARE(ringBuffer.read(), ba2);
+ QCOMPARE(ringBuffer.read(), ba3);
+}
+
+void tst_QRingBuffer::peek()
+{
+ QRingBuffer ringBuffer;
+ QByteArray testBuffer;
+ // fill buffer with an arithmetic progression
+ for (int i = 1; i < 256; ++i) {
+ char *ringPos = ringBuffer.reserve(i);
+ QVERIFY(ringPos);
+ memset(ringPos, i, i);
+ testBuffer.append(ringPos, i);
+ }
+
+ // check stored data
+ QByteArray resultBuffer;
+ int peekPosition = testBuffer.size();
+ for (int i = 1; i < 256; ++i) {
+ QByteArray ba(i, 0);
+ peekPosition -= i;
+ qint64 thisPeek = ringBuffer.peek(ba.data(), i, peekPosition);
+ QCOMPARE(thisPeek, qint64(i));
+ resultBuffer.prepend(ba);
+ }
+ QCOMPARE(resultBuffer, testBuffer);
}
void tst_QRingBuffer::readLine()
@@ -293,18 +342,18 @@ void tst_QRingBuffer::readLine()
char stringBuf[102];
stringBuf[101] = 0; // non-crash terminator
- QVERIFY(ringBuffer.readLine(stringBuf, sizeof(stringBuf) - 2) == ba1.size());
- QVERIFY(QByteArray(stringBuf, int(strlen(stringBuf))) == ba1);
+ QCOMPARE(ringBuffer.readLine(stringBuf, sizeof(stringBuf) - 2), qint64(ba1.size()));
+ QCOMPARE(QByteArray(stringBuf, int(strlen(stringBuf))), ba1);
// check first empty string reading
stringBuf[0] = char(0xFF);
- QCOMPARE(ringBuffer.readLine(stringBuf, int(sizeof(stringBuf)) - 2), ba2.size());
- QVERIFY(stringBuf[0] == ba2[0]);
+ QCOMPARE(ringBuffer.readLine(stringBuf, int(sizeof(stringBuf)) - 2), qint64(ba2.size()));
+ QCOMPARE(stringBuf[0], ba2.at(0));
- QVERIFY(ringBuffer.readLine(stringBuf, int(sizeof(stringBuf)) - 2) == (ba3.size() + ba4.size()
- + ba2.size()));
- QVERIFY(QByteArray(stringBuf, int(strlen(stringBuf))) == (ba3 + ba4 + ba2));
- QVERIFY(ringBuffer.size() == 0);
+ QCOMPARE(ringBuffer.readLine(stringBuf, int(sizeof(stringBuf)) - 2),
+ qint64(ba3.size() + ba4.size() + ba2.size()));
+ QCOMPARE(QByteArray(stringBuf, int(strlen(stringBuf))), ba3 + ba4 + ba2);
+ QCOMPARE(ringBuffer.size(), Q_INT64_C(0));
}
QTEST_APPLESS_MAIN(tst_QRingBuffer)
diff --git a/tests/auto/corelib/tools/qset/tst_qset.cpp b/tests/auto/corelib/tools/qset/tst_qset.cpp
index f13d69514a..fe4d81085c 100644
--- a/tests/auto/corelib/tools/qset/tst_qset.cpp
+++ b/tests/auto/corelib/tools/qset/tst_qset.cpp
@@ -65,6 +65,7 @@ private slots:
void begin();
void end();
void insert();
+ void reverseIterators();
void setOperations();
void stlIterator();
void stlMutableIterator();
@@ -73,6 +74,7 @@ private slots:
void makeSureTheComfortFunctionsCompile();
void initializerList();
void qhash();
+ void intersects();
};
struct IdentityTracker {
@@ -554,6 +556,21 @@ void tst_QSet::insert()
}
}
+void tst_QSet::reverseIterators()
+{
+ QSet<int> s;
+ s << 1 << 17 << 61 << 127 << 911;
+ std::vector<int> v(s.begin(), s.end());
+ std::reverse(v.begin(), v.end());
+ const QSet<int> &cs = s;
+ QVERIFY(std::equal(v.begin(), v.end(), s.rbegin()));
+ QVERIFY(std::equal(v.begin(), v.end(), s.crbegin()));
+ QVERIFY(std::equal(v.begin(), v.end(), cs.rbegin()));
+ QVERIFY(std::equal(s.rbegin(), s.rend(), v.begin()));
+ QVERIFY(std::equal(s.crbegin(), s.crend(), v.begin()));
+ QVERIFY(std::equal(cs.rbegin(), cs.rend(), v.begin()));
+}
+
void tst_QSet::setOperations()
{
QSet<QString> set1, set2;
@@ -969,24 +986,6 @@ void tst_QSet::initializerList()
#endif
}
-QT_BEGIN_NAMESPACE
-extern Q_CORE_EXPORT QBasicAtomicInt qt_qhash_seed; // from qhash.cpp
-QT_END_NAMESPACE
-
-class QtQHashSeedSaver {
- int oldSeed, newSeed;
-public:
- explicit QtQHashSeedSaver(int seed)
- : oldSeed(qt_qhash_seed.fetchAndStoreRelaxed(seed)),
- newSeed(seed)
- {}
- ~QtQHashSeedSaver()
- {
- // only restore when no-one else changed the seed in the meantime:
- qt_qhash_seed.testAndSetRelaxed(newSeed, oldSeed);
- }
-};
-
void tst_QSet::qhash()
{
//
@@ -994,14 +993,14 @@ void tst_QSet::qhash()
//
{
// create some deterministic initial state:
- const QtQHashSeedSaver seed1(0);
+ qSetGlobalQHashSeed(0);
QSet<int> s1;
s1.reserve(4);
s1 << 400 << 300 << 200 << 100;
// also change the seed:
- const QtQHashSeedSaver seed2(0x10101010);
+ qSetGlobalQHashSeed(0x10101010);
QSet<int> s2;
s2.reserve(100); // provoke different bucket counts
@@ -1030,6 +1029,32 @@ void tst_QSet::qhash()
}
}
+void tst_QSet::intersects()
+{
+ QSet<int> s1;
+ QSet<int> s2;
+
+ QVERIFY(!s1.intersects(s1));
+ QVERIFY(!s1.intersects(s2));
+
+ s1 << 100;
+ QVERIFY(s1.intersects(s1));
+ QVERIFY(!s1.intersects(s2));
+
+ s2 << 200;
+ QVERIFY(!s1.intersects(s2));
+
+ s1 << 200;
+ QVERIFY(s1.intersects(s2));
+
+ qSetGlobalQHashSeed(0x10101010);
+ QSet<int> s3;
+ s3 << 500;
+ QVERIFY(!s1.intersects(s3));
+ s3 << 200;
+ QVERIFY(s1.intersects(s3));
+}
+
QTEST_APPLESS_MAIN(tst_QSet)
#include "tst_qset.moc"
diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp
index c3a615fdff..2128eeb164 100644
--- a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp
@@ -641,6 +641,7 @@ namespace QTest {
make.setProcessChannelMode(channelMode);
static const char makes[] =
+ "jom.exe\0" //preferred for visual c++ or mingw
"nmake.exe\0" //for visual c++
"mingw32-make.exe\0" //for mingw
"gmake\0"
diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.pri b/tests/auto/corelib/tools/qsharedpointer/externaltests.pri
index cac94bb522..604bd7f59f 100644
--- a/tests/auto/corelib/tools/qsharedpointer/externaltests.pri
+++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.pri
@@ -4,4 +4,3 @@ cleanedQMAKESPEC = $$replace(QMAKESPEC, \\\\, /)
DEFINES += DEFAULT_MAKESPEC=\\\"$$cleanedQMAKESPEC\\\"
cross_compile:DEFINES += QTEST_NO_RTTI QTEST_CROSS_COMPILED
-wince: DEFINES += QTEST_CROSS_COMPILED QTEST_NO_RTTI
diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
index 7538eaf378..ab5bc410f6 100644
--- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
@@ -94,18 +94,18 @@ private slots:
void creatingQObject();
void mixTrackingPointerCode();
void reentrancyWhileDestructing();
+ void map();
+ void hash();
+ void qvariantCast();
+ void sharedFromThis();
void threadStressTest_data();
void threadStressTest();
- void map();
- void hash();
void validConstructs();
void invalidConstructs_data();
void invalidConstructs();
-
- void qvariantCast();
- void sharedFromThis();
-
+ // let invalidConstructs be the last test, because it's the slowest;
+ // add new tests above this block
public slots:
void cleanup() { safetyCheck(); }
@@ -231,6 +231,14 @@ void tst_QSharedPointer::basics()
QCOMPARE(sizeof(weakref), 2*sizeof(void*));
}
+ {
+ QSharedPointer<const Data> ptr;
+ QWeakPointer<const Data> weakref;
+
+ QCOMPARE(sizeof(ptr), 2*sizeof(void*));
+ QCOMPARE(sizeof(weakref), 2*sizeof(void*));
+ }
+
QFETCH(bool, isNull);
Data *aData = 0;
if (!isNull)
@@ -2173,6 +2181,16 @@ void tst_QSharedPointer::sharedFromThis()
QVERIFY(const_scp.isNull());
QCOMPARE(Data::generationCounter, generations + 1);
QCOMPARE(Data::destructorCounter, destructions);
+
+ QWeakPointer<SomeClass> wcp = sc.sharedFromThis();
+ QVERIFY(wcp.isNull());
+ QCOMPARE(Data::generationCounter, generations + 1);
+ QCOMPARE(Data::destructorCounter, destructions);
+
+ QWeakPointer<const SomeClass> const_wcp = sc.sharedFromThis();
+ QVERIFY(const_wcp.isNull());
+ QCOMPARE(Data::generationCounter, generations + 1);
+ QCOMPARE(Data::destructorCounter, destructions);
}
QCOMPARE(Data::generationCounter, generations + 1);
@@ -2184,6 +2202,11 @@ void tst_QSharedPointer::sharedFromThis()
QVERIFY(const_scp.isNull());
QCOMPARE(Data::generationCounter, generations + 2);
QCOMPARE(Data::destructorCounter, destructions + 1);
+
+ QWeakPointer<const SomeClass> const_wcp = sc.sharedFromThis();
+ QVERIFY(const_wcp.isNull());
+ QCOMPARE(Data::generationCounter, generations + 2);
+ QCOMPARE(Data::destructorCounter, destructions + 1);
}
QCOMPARE(Data::generationCounter, generations + 2);
@@ -2375,6 +2398,21 @@ void tst_QSharedPointer::sharedFromThis()
QCOMPARE(Data::generationCounter, generations + 5);
QCOMPARE(Data::destructorCounter, destructions + 5);
+
+ {
+ QSharedPointer<const SomeClass> scp2(new SomeClass());
+ QVERIFY(!scp2.isNull());
+ QCOMPARE(Data::generationCounter, generations + 6);
+ QCOMPARE(Data::destructorCounter, destructions + 5);
+
+ QWeakPointer<const SomeClass> wcp2(scp2.constCast<SomeClass>());
+ QVERIFY(!wcp2.isNull());
+ QCOMPARE(Data::generationCounter, generations + 6);
+ QCOMPARE(Data::destructorCounter, destructions + 5);
+ }
+
+ QCOMPARE(Data::generationCounter, generations + 6);
+ QCOMPARE(Data::destructorCounter, destructions + 6);
}
namespace ReentrancyWhileDestructing {
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
index 0d10a9c5bd..a922e3ad27 100644
--- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
@@ -60,11 +60,241 @@
#include <qhash.h>
#include <string>
+#include <algorithm>
#define CREATE_REF(string) \
const QString padded = QString::fromLatin1(" %1 ").arg(string); \
QStringRef ref = padded.midRef(1, padded.size() - 2);
+namespace {
+
+// this wraps an argument to a QString function, as well as how to apply
+// the argument to a given QString member function.
+template <typename T>
+class Arg;
+
+template <typename T>
+class Reversed {}; // marker for Arg<QChar> to apply the operation in reverse order (for prepend())
+
+class ArgBase
+{
+protected:
+ QString pinned;
+ explicit ArgBase(const char *str)
+ : pinned(QString::fromLatin1(str)) {}
+};
+
+template <>
+class Arg<QChar> : protected ArgBase
+{
+public:
+ explicit Arg(const char *str) : ArgBase(str) {}
+
+ template <typename MemFun>
+ void apply0(QString &s, MemFun mf) const
+ { Q_FOREACH (QChar ch, this->pinned) (s.*mf)(ch); }
+
+ template <typename MemFun, typename A1>
+ void apply1(QString &s, MemFun mf, A1 a1) const
+ { Q_FOREACH (QChar ch, this->pinned) (s.*mf)(a1, ch); }
+};
+
+template <>
+class Arg<Reversed<QChar> > : private Arg<QChar>
+{
+public:
+ explicit Arg(const char *str) : Arg<QChar>(str)
+ {
+ std::reverse(this->pinned.begin(), this->pinned.end());
+ }
+
+ using Arg<QChar>::apply0;
+ using Arg<QChar>::apply1;
+};
+
+template <>
+class Arg<QString> : ArgBase
+{
+public:
+ explicit Arg(const char *str) : ArgBase(str) {}
+
+ template <typename MemFun>
+ void apply0(QString &s, MemFun mf) const
+ { (s.*mf)(this->pinned); }
+
+ template <typename MemFun, typename A1>
+ void apply1(QString &s, MemFun mf, A1 a1) const
+ { (s.*mf)(a1, this->pinned); }
+};
+
+template <>
+class Arg<QStringRef> : ArgBase
+{
+ QStringRef ref() const
+ { return this->pinned.isNull() ? QStringRef() : this->pinned.midRef(0) ; }
+public:
+ explicit Arg(const char *str) : ArgBase(str) {}
+
+ template <typename MemFun>
+ void apply0(QString &s, MemFun mf) const
+ { (s.*mf)(ref()); }
+
+ template <typename MemFun, typename A1>
+ void apply1(QString &s, MemFun mf, A1 a1) const
+ { (s.*mf)(a1, ref()); }
+};
+
+template <>
+class Arg<QPair<const QChar *, int> > : ArgBase
+{
+public:
+ explicit Arg(const char *str) : ArgBase(str) {}
+
+ template <typename MemFun>
+ void apply0(QString &s, MemFun mf) const
+ { (s.*mf)(this->pinned.constData(), this->pinned.length()); }
+
+ template <typename MemFun, typename A1>
+ void apply1(QString &s, MemFun mf, A1 a1) const
+ { (s.*mf)(a1, this->pinned.constData(), this->pinned.length()); }
+};
+
+template <>
+class Arg<QLatin1String>
+{
+ QLatin1String l1;
+public:
+ explicit Arg(const char *str) : l1(str) {}
+
+ template <typename MemFun>
+ void apply0(QString &s, MemFun mf) const
+ { (s.*mf)(l1); }
+
+ template <typename MemFun, typename A1>
+ void apply1(QString &s, MemFun mf, A1 a1) const
+ { (s.*mf)(a1, l1); }
+};
+
+template <>
+class Arg<char>
+{
+protected:
+ const char *str;
+public:
+ explicit Arg(const char *str) : str(str) {}
+
+ template <typename MemFun>
+ void apply0(QString &s, MemFun mf) const
+ {
+ if (str) {
+ for (const char *it = str; *it; ++it)
+ (s.*mf)(*it);
+ }
+ }
+
+ template <typename MemFun, typename A1>
+ void apply1(QString &s, MemFun mf, A1 a1) const
+ {
+ if (str) {
+ for (const char *it = str; *it; ++it)
+ (s.*mf)(a1, *it);
+ }
+ }
+};
+
+template <>
+class Arg<Reversed<char> > : private Arg<char>
+{
+ static const char *dupAndReverse(const char *s)
+ {
+ char *s2 = qstrdup(s);
+ std::reverse(s2, s2 + qstrlen(s2));
+ return s2;
+ }
+public:
+ explicit Arg(const char *str) : Arg<char>(dupAndReverse(str)) {}
+ ~Arg() { delete[] str; }
+
+ using Arg<char>::apply0;
+ using Arg<char>::apply1;
+};
+
+template <>
+class Arg<const char*>
+{
+ const char *str;
+public:
+ explicit Arg(const char *str) : str(str) {}
+
+ template <typename MemFun>
+ void apply0(QString &s, MemFun mf) const
+ { (s.*mf)(str); }
+
+ template <typename MemFun, typename A1>
+ void apply1(QString &s, MemFun mf, A1 a1) const
+ { (s.*mf)(a1, str); }
+};
+
+template <>
+class Arg<QByteArray>
+{
+ QByteArray ba;
+public:
+ explicit Arg(const char *str) : ba(str) {}
+
+ template <typename MemFun>
+ void apply0(QString &s, MemFun mf) const
+ { (s.*mf)(ba); }
+
+ template <typename MemFun, typename A1>
+ void apply1(QString &s, MemFun mf, A1 a1) const
+ { (s.*mf)(a1, ba); }
+};
+
+// const char* is not allowed as columns in data-driven tests (causes static_assert failure),
+// so wrap it in a container (default ctor is a QMetaType/QVariant requirement):
+class CharStarContainer
+{
+ const char *str;
+public:
+ explicit Q_DECL_CONSTEXPR CharStarContainer(const char *s = Q_NULLPTR) : str(s) {}
+ Q_DECL_CONSTEXPR operator const char *() const { return str; }
+};
+
+} // unnamed namespace
+
+Q_DECLARE_METATYPE(CharStarContainer)
+
+// implementation helpers for append_impl/prepend_impl etc
+template <typename ArgType, typename MemFun>
+static void do_apply0(MemFun mf)
+{
+ QFETCH(QString, s);
+ QFETCH(CharStarContainer, arg);
+ QFETCH(QString, expected);
+
+ Arg<ArgType>(arg).apply0(s, mf);
+
+ QCOMPARE(s, expected);
+ QCOMPARE(s.isEmpty(), expected.isEmpty());
+ QCOMPARE(s.isNull(), expected.isNull());
+}
+
+template <typename ArgType, typename A1, typename MemFun>
+static void do_apply1(MemFun mf)
+{
+ QFETCH(QString, s);
+ QFETCH(CharStarContainer, arg);
+ QFETCH(A1, a1);
+ QFETCH(QString, expected);
+
+ Arg<ArgType>(arg).apply1(s, mf, a1);
+
+ QCOMPARE(s, expected);
+ QCOMPARE(s.isEmpty(), expected.isEmpty());
+ QCOMPARE(s.isNull(), expected.isNull());
+}
+
class tst_QString : public QObject
{
Q_OBJECT
@@ -73,6 +303,27 @@ class tst_QString : public QObject
void split_regexp(const QString &string, const QString &pattern, QStringList result);
template<typename List>
void split(const QString &string, const QString &separator, QStringList result);
+
+ template <typename ArgType, typename MemFun>
+ void append_impl() const { do_apply0<ArgType>(MemFun(&QString::append)); }
+ template <typename ArgType>
+ void append_impl() const { append_impl<ArgType, QString &(QString::*)(const ArgType&)>(); }
+ void append_data(bool emptyIsNoop = false);
+ template <typename ArgType, typename MemFun>
+ void operator_pluseq_impl() const { do_apply0<ArgType>(MemFun(&QString::operator+=)); }
+ template <typename ArgType>
+ void operator_pluseq_impl() const { operator_pluseq_impl<ArgType, QString &(QString::*)(const ArgType&)>(); }
+ void operator_pluseq_data(bool emptyIsNoop = false);
+ template <typename ArgType, typename MemFun>
+ void prepend_impl() const { do_apply0<ArgType>(MemFun(&QString::prepend)); }
+ template <typename ArgType>
+ void prepend_impl() const { prepend_impl<ArgType, QString &(QString::*)(const ArgType&)>(); }
+ void prepend_data(bool emptyIsNoop = false);
+ template <typename ArgType, typename MemFun>
+ void insert_impl() const { do_apply1<ArgType, int>(MemFun(&QString::insert)); }
+ template <typename ArgType>
+ void insert_impl() const { insert_impl<ArgType, QString &(QString::*)(int, const ArgType&)>(); }
+ void insert_data(bool emptyIsNoop = false);
public:
tst_QString();
public slots:
@@ -121,19 +372,86 @@ private slots:
void remove_regexp_data();
void remove_regexp();
void swap();
- void prepend();
- void prepend_bytearray_data();
- void prepend_bytearray();
- void append();
- void append_bytearray_data();
- void append_bytearray();
- void operator_pluseq_bytearray_data();
- void operator_pluseq_bytearray();
+
+ void prepend_qstring() { prepend_impl<QString>(); }
+ void prepend_qstring_data() { prepend_data(true); }
+ void prepend_qstringref() { prepend_impl<QStringRef>(); }
+ void prepend_qstringref_data() { prepend_data(true); }
+ void prepend_qlatin1string() { prepend_impl<QLatin1String, QString &(QString::*)(QLatin1String)>(); }
+ void prepend_qlatin1string_data() { prepend_data(true); }
+ void prepend_qcharstar_int() { prepend_impl<QPair<const QChar *, int>, QString &(QString::*)(const QChar *, int)>(); }
+ void prepend_qcharstar_int_data() { prepend_data(true); }
+ void prepend_qchar() { prepend_impl<Reversed<QChar>, QString &(QString::*)(QChar)>(); }
+ void prepend_qchar_data() { prepend_data(true); }
+ void prepend_qbytearray() { prepend_impl<QByteArray>(); }
+ void prepend_qbytearray_data() { prepend_data(true); }
+ void prepend_char() { prepend_impl<Reversed<char>, QString &(QString::*)(QChar)>(); }
+ void prepend_char_data() { prepend_data(true); }
+ void prepend_charstar() { prepend_impl<const char *, QString &(QString::*)(const char *)>(); }
+ void prepend_charstar_data() { prepend_data(true); }
+ void prepend_bytearray_special_cases_data();
+ void prepend_bytearray_special_cases();
+
+ void append_qstring() { append_impl<QString>(); }
+ void append_qstring_data() { append_data(); }
+ void append_qstringref() { append_impl<QStringRef>(); }
+ void append_qstringref_data() { append_data(); }
+ void append_qlatin1string() { append_impl<QLatin1String, QString &(QString::*)(QLatin1String)>(); }
+ void append_qlatin1string_data() { append_data(); }
+ void append_qcharstar_int() { append_impl<QPair<const QChar *, int>, QString&(QString::*)(const QChar *, int)>(); }
+ void append_qcharstar_int_data() { append_data(true); }
+ void append_qchar() { append_impl<QChar, QString &(QString::*)(QChar)>(); }
+ void append_qchar_data() { append_data(true); }
+ void append_qbytearray() { append_impl<QByteArray>(); }
+ void append_qbytearray_data() { append_data(); }
+ void append_char() { append_impl<char, QString &(QString::*)(QChar)>(); }
+ void append_char_data() { append_data(true); }
+ void append_charstar() { append_impl<const char *, QString &(QString::*)(const char *)>(); }
+ void append_charstar_data() { append_data(); }
+ void append_special_cases();
+ void append_bytearray_special_cases_data();
+ void append_bytearray_special_cases();
+
+ void operator_pluseq_qstring() { operator_pluseq_impl<QString>(); }
+ void operator_pluseq_qstring_data() { operator_pluseq_data(); }
+ void operator_pluseq_qstringref() { operator_pluseq_impl<QStringRef>(); }
+ void operator_pluseq_qstringref_data() { operator_pluseq_data(); }
+ void operator_pluseq_qlatin1string() { operator_pluseq_impl<QLatin1String, QString &(QString::*)(QLatin1String)>(); }
+ void operator_pluseq_qlatin1string_data() { operator_pluseq_data(); }
+ void operator_pluseq_qchar() { operator_pluseq_impl<QChar, QString &(QString::*)(QChar)>(); }
+ void operator_pluseq_qchar_data() { operator_pluseq_data(true); }
+ void operator_pluseq_qbytearray() { operator_pluseq_impl<QByteArray>(); }
+ void operator_pluseq_qbytearray_data() { operator_pluseq_data(); }
+ void operator_pluseq_char() { operator_pluseq_impl<char, QString &(QString::*)(char)>(); }
+ void operator_pluseq_char_data() { operator_pluseq_data(true); }
+ void operator_pluseq_charstar() { operator_pluseq_impl<const char *, QString &(QString::*)(const char *)>(); }
+ void operator_pluseq_charstar_data() { operator_pluseq_data(); }
+ void operator_pluseq_bytearray_special_cases_data();
+ void operator_pluseq_bytearray_special_cases();
+
void operator_eqeq_bytearray_data();
void operator_eqeq_bytearray();
void operator_eqeq_nullstring();
void operator_smaller();
- void insert();
+
+ void insert_qstring() { insert_impl<QString>(); }
+ void insert_qstring_data() { insert_data(true); }
+ void insert_qstringref() { insert_impl<QStringRef>(); }
+ void insert_qstringref_data() { insert_data(true); }
+ void insert_qlatin1string() { insert_impl<QLatin1String, QString &(QString::*)(int, QLatin1String)>(); }
+ void insert_qlatin1string_data() { insert_data(true); }
+ void insert_qcharstar_int() { insert_impl<QPair<const QChar *, int>, QString &(QString::*)(int, const QChar*, int) >(); }
+ void insert_qcharstar_int_data() { insert_data(true); }
+ void insert_qchar() { insert_impl<Reversed<QChar>, QString &(QString::*)(int, QChar)>(); }
+ void insert_qchar_data() { insert_data(true); }
+ void insert_qbytearray() { insert_impl<QByteArray>(); }
+ void insert_qbytearray_data() { insert_data(true); }
+ void insert_char() { insert_impl<Reversed<char>, QString &(QString::*)(int, QChar)>(); }
+ void insert_char_data() { insert_data(true); }
+ void insert_charstar() { insert_impl<const char *, QString &(QString::*)(int, const char*) >(); }
+ void insert_charstar_data() { insert_data(true); }
+ void insert_special_cases();
+
void simplified_data();
void simplified();
void trimmed();
@@ -183,6 +501,7 @@ private slots:
void fromLocal8Bit();
void local8Bit_data();
void local8Bit();
+ void nullFromLocal8Bit();
void fromLatin1Roundtrip_data();
void fromLatin1Roundtrip();
void toLatin1Roundtrip_data();
@@ -215,6 +534,7 @@ private slots:
void localeAwareCompare_data();
void localeAwareCompare();
#endif
+ void reverseIterators();
void split_data();
void split();
void split_regexp_data();
@@ -262,6 +582,7 @@ private slots:
void compareQLatin1Strings();
void fromQLatin1StringWithLength();
void assignQLatin1String();
+ void assignQChar();
void isRightToLeft_data();
void isRightToLeft();
void unicodeStrings();
@@ -1830,6 +2151,22 @@ void tst_QString::toUpper()
QCOMPARE( QString("`abyz{").toUpper(), QString("`ABYZ{"));
QCOMPARE( QString(1, QChar(0xdf)).toUpper(), QString("SS"));
+ {
+ QString s = QString::fromUtf8("Gro\xc3\x9fstra\xc3\x9f""e");
+
+ // call lvalue-ref version, mustn't change the original
+ QCOMPARE(s.toUpper(), QString("GROSSSTRASSE"));
+ QCOMPARE(s, QString::fromUtf8("Gro\xc3\x9fstra\xc3\x9f""e"));
+
+ // call rvalue-ref while shared (the original mustn't change)
+ QString copy = s;
+ QCOMPARE(qMove(copy).toUpper(), QString("GROSSSTRASSE"));
+ QCOMPARE(s, QString::fromUtf8("Gro\xc3\x9fstra\xc3\x9f""e"));
+
+ // call rvalue-ref version on detached case
+ copy.clear();
+ QCOMPARE(qMove(s).toUpper(), QString("GROSSSTRASSE"));
+ }
QString lower, upper;
lower += QChar(QChar::highSurrogate(0x10428));
@@ -2066,7 +2403,46 @@ void tst_QString::simplified()
QCOMPARE(qMove(full).simplified(), simple);
}
-void tst_QString::insert()
+void tst_QString::insert_data(bool emptyIsNoop)
+{
+ QTest::addColumn<QString>("s");
+ QTest::addColumn<CharStarContainer>("arg");
+ QTest::addColumn<int>("a1");
+ QTest::addColumn<QString>("expected");
+
+ const CharStarContainer nullC;
+ const CharStarContainer emptyC("");
+ const CharStarContainer aC("a");
+ const CharStarContainer bC("b");
+ //const CharStarContainer abC("ab");
+ const CharStarContainer baC("ba");
+
+ const QString null;
+ const QString empty("");
+ const QString a("a");
+ const QString b("b");
+ const QString ab("ab");
+ const QString ba("ba");
+
+ QTest::newRow("null.insert(0, null)") << null << nullC << 0 << null;
+ QTest::newRow("null.insert(0, empty)") << null << emptyC << 0 << (emptyIsNoop ? null : empty);
+ QTest::newRow("null.insert(0, a)") << null << aC << 0 << a;
+ QTest::newRow("empty.insert(0, null)") << empty << nullC << 0 << empty;
+ QTest::newRow("empty.insert(0, empty)") << empty << emptyC << 0 << empty;
+ QTest::newRow("empty.insert(0, a)") << empty << aC << 0 << a;
+ QTest::newRow("a.insert(0, null)") << a << nullC << 0 << a;
+ QTest::newRow("a.insert(0, empty)") << a << emptyC << 0 << a;
+ QTest::newRow("a.insert(0, b)") << a << bC << 0 << ba;
+ QTest::newRow("a.insert(0, ba)") << a << baC << 0 << (ba + a);
+ QTest::newRow("a.insert(1, null)") << a << nullC << 1 << a;
+ QTest::newRow("a.insert(1, empty)") << a << emptyC << 1 << a;
+ QTest::newRow("a.insert(1, b)") << a << bC << 1 << ab;
+ QTest::newRow("a.insert(1, ba)") << a << baC << 1 << (a + ba);
+ QTest::newRow("ba.insert(1, a)") << ba << aC << 1 << (ba + a);
+ QTest::newRow("ba.insert(2, b)") << ba << bC << 2 << (ba + b);
+}
+
+void tst_QString::insert_special_cases()
{
QString a;
@@ -2097,14 +2473,37 @@ void tst_QString::insert()
QCOMPARE(a.insert(0, QLatin1String("a")), QString("aMontreal"));
}
-void tst_QString::append()
+void tst_QString::append_data(bool emptyIsNoop)
{
- {
- QString a;
- a = "<>ABCABCABCABC";
- QCOMPARE(a.append(">"),QString("<>ABCABCABCABC>"));
- }
+ QTest::addColumn<QString>("s");
+ QTest::addColumn<CharStarContainer>("arg");
+ QTest::addColumn<QString>("expected");
+ const CharStarContainer nullC;
+ const CharStarContainer emptyC("");
+ const CharStarContainer aC("a");
+ const CharStarContainer bC("b");
+ //const CharStarContainer abC("ab");
+
+ const QString null;
+ const QString empty("");
+ const QString a("a");
+ //const QString b("b");
+ const QString ab("ab");
+
+ QTest::newRow("null + null") << null << nullC << null;
+ QTest::newRow("null + empty") << null << emptyC << (emptyIsNoop ? null : empty);
+ QTest::newRow("null + a") << null << aC << a;
+ QTest::newRow("empty + null") << empty << nullC << empty;
+ QTest::newRow("empty + empty") << empty << emptyC << empty;
+ QTest::newRow("empty + a") << empty << aC << a;
+ QTest::newRow("a + null") << a << nullC << a;
+ QTest::newRow("a + empty") << a << emptyC << a;
+ QTest::newRow("a + b") << a << bC << ab;
+}
+
+void tst_QString::append_special_cases()
+{
{
QString a;
static const QChar unicode[] = { 'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!' };
@@ -2124,7 +2523,7 @@ void tst_QString::append()
}
}
-void tst_QString::append_bytearray_data()
+void tst_QString::append_bytearray_special_cases_data()
{
QTest::addColumn<QString>("str" );
QTest::addColumn<QByteArray>("ba" );
@@ -2158,7 +2557,7 @@ void tst_QString::append_bytearray_data()
QTest::newRow( "nonAsciiByteArray2") << QString() << QByteArray("\xc3\xa9") << QString::fromUtf8("\xc3\xa9");
}
-void tst_QString::append_bytearray()
+void tst_QString::append_bytearray_special_cases()
{
{
QFETCH( QString, str );
@@ -2186,12 +2585,17 @@ void tst_QString::append_bytearray()
}
}
-void tst_QString::operator_pluseq_bytearray_data()
+void tst_QString::operator_pluseq_data(bool emptyIsNoop)
{
- append_bytearray_data();
+ append_data(emptyIsNoop);
}
-void tst_QString::operator_pluseq_bytearray()
+void tst_QString::operator_pluseq_bytearray_special_cases_data()
+{
+ append_bytearray_special_cases_data();
+}
+
+void tst_QString::operator_pluseq_bytearray_special_cases()
{
{
QFETCH( QString, str );
@@ -2248,14 +2652,37 @@ void tst_QString::swap()
QCOMPARE(s2,QLatin1String("s1"));
}
-void tst_QString::prepend()
+void tst_QString::prepend_data(bool emptyIsNoop)
{
- QString a;
- a = "<>ABCABCABCABC>";
- QCOMPARE(a.prepend("-"),(QString)"-<>ABCABCABCABC>");
+ QTest::addColumn<QString>("s");
+ QTest::addColumn<CharStarContainer>("arg");
+ QTest::addColumn<QString>("expected");
+
+ const CharStarContainer nullC;
+ const CharStarContainer emptyC("");
+ const CharStarContainer aC("a");
+ const CharStarContainer bC("b");
+ const CharStarContainer baC("ba");
+
+ const QString null;
+ const QString empty("");
+ const QString a("a");
+ //const QString b("b");
+ const QString ba("ba");
+
+ QTest::newRow("null.prepend(null)") << null << nullC << null;
+ QTest::newRow("null.prepend(empty)") << null << emptyC << (emptyIsNoop ? null : empty);
+ QTest::newRow("null.prepend(a)") << null << aC << a;
+ QTest::newRow("empty.prepend(null)") << empty << nullC << empty;
+ QTest::newRow("empty.prepend(empty)") << empty << emptyC << empty;
+ QTest::newRow("empty.prepend(a)") << empty << aC << a;
+ QTest::newRow("a.prepend(null)") << a << nullC << a;
+ QTest::newRow("a.prepend(empty)") << a << emptyC << a;
+ QTest::newRow("a.prepend(b)") << a << bC << ba;
+ QTest::newRow("a.prepend(ba)") << a << baC << (ba + a);
}
-void tst_QString::prepend_bytearray_data()
+void tst_QString::prepend_bytearray_special_cases_data()
{
QTest::addColumn<QString>("str" );
QTest::addColumn<QByteArray>("ba" );
@@ -2281,7 +2708,7 @@ void tst_QString::prepend_bytearray_data()
QTest::newRow( "nonAsciiByteArray2") << QString() << QByteArray("\xc3\xa9") << QString::fromUtf8("\xc3\xa9");
}
-void tst_QString::prepend_bytearray()
+void tst_QString::prepend_bytearray_special_cases()
{
{
QFETCH( QString, str );
@@ -3697,6 +4124,12 @@ void tst_QString::nullFromUtf8()
a = QString::fromUtf8("");
QVERIFY(!a.isNull());
QVERIFY(a.isEmpty());
+ a = QString::fromUtf8(QByteArray());
+ QVERIFY(a.isNull());
+ QVERIFY(a.isEmpty());
+ a = QString::fromUtf8(QByteArray(""));
+ QVERIFY(!a.isNull());
+ QVERIFY(a.isEmpty());
}
void tst_QString::fromLocal8Bit_data()
@@ -3779,6 +4212,23 @@ void tst_QString::local8Bit()
QCOMPARE(local8Bit.toLocal8Bit(), QByteArray(result));
}
+void tst_QString::nullFromLocal8Bit()
+{
+ QString a;
+ a = QString::fromLocal8Bit(0);
+ QVERIFY(a.isNull());
+ QVERIFY(a.isEmpty());
+ a = QString::fromLocal8Bit("");
+ QVERIFY(!a.isNull());
+ QVERIFY(a.isEmpty());
+ a = QString::fromLocal8Bit(QByteArray());
+ QVERIFY(a.isNull());
+ QVERIFY(a.isEmpty());
+ a = QString::fromLocal8Bit(QByteArray(""));
+ QVERIFY(!a.isNull());
+ QVERIFY(a.isEmpty());
+}
+
void tst_QString::stringRef_local8Bit_data()
{
local8Bit_data();
@@ -3945,6 +4395,12 @@ void tst_QString::fromLatin1()
a = QString::fromLatin1( "" );
QVERIFY( !a.isNull() );
QVERIFY( a.isEmpty() );
+ a = QString::fromLatin1(QByteArray());
+ QVERIFY(a.isNull());
+ QVERIFY(a.isEmpty());
+ a = QString::fromLatin1(QByteArray(""));
+ QVERIFY(!a.isNull());
+ QVERIFY(a.isEmpty());
a = QString::fromLatin1(0, 0);
QVERIFY(a.isNull());
@@ -5012,6 +5468,20 @@ void tst_QString::localeAwareCompare()
}
#endif //!defined(Q_OS_WIN) || defined(Q_OS_WIN_AND_WINCE)
+void tst_QString::reverseIterators()
+{
+ QString s = "1234";
+ QString sr = s;
+ std::reverse(sr.begin(), sr.end());
+ const QString &csr = sr;
+ QVERIFY(std::equal(s.begin(), s.end(), sr.rbegin()));
+ QVERIFY(std::equal(s.begin(), s.end(), sr.crbegin()));
+ QVERIFY(std::equal(s.begin(), s.end(), csr.rbegin()));
+ QVERIFY(std::equal(sr.rbegin(), sr.rend(), s.begin()));
+ QVERIFY(std::equal(sr.crbegin(), sr.crend(), s.begin()));
+ QVERIFY(std::equal(csr.rbegin(), csr.rend(), s.begin()));
+}
+
void tst_QString::split_data()
{
QTest::addColumn<QString>("str");
@@ -5837,14 +6307,15 @@ void tst_QString::arg_locale()
QLocale l(QLocale::English, QLocale::UnitedKingdom);
QString str("*%L1*%L2*");
- QCOMPARE(str.arg(123456).arg(1234.56), QString::fromLatin1("*123,456*1,234.56*"));
QLocale::setDefault(l);
+ QCOMPARE(str.arg(123456).arg(1234.56), QString::fromLatin1("*123,456*1,234.56*"));
l.setNumberOptions(QLocale::OmitGroupSeparator);
QLocale::setDefault(l);
QCOMPARE(str.arg(123456).arg(1234.56), QString::fromLatin1("*123456*1234.56*"));
QLocale::setDefault(QLocale::C);
+ QCOMPARE(str.arg(123456).arg(1234.56), QString::fromLatin1("*123456*1234.56*"));
}
@@ -6163,6 +6634,71 @@ void tst_QString::assignQLatin1String()
QCOMPARE(foo.size(), latin1subfoo.size());
QCOMPARE(foo, QString::fromLatin1("foo"));
+ // check capacity re-use:
+ QString s;
+ QCOMPARE(s.capacity(), 0);
+
+ // assign to null QString:
+ s = latin1foo;
+ QCOMPARE(s, QString::fromLatin1("foo"));
+ QCOMPARE(s.capacity(), 3);
+
+ // assign to non-null QString with enough capacity:
+ s = QString::fromLatin1("foofoo");
+ const int capacity = s.capacity();
+ s = latin1foo;
+ QCOMPARE(s, QString::fromLatin1("foo"));
+ QCOMPARE(s.capacity(), capacity);
+
+ // assign to shared QString (enough capacity, but can't use):
+ s = QString::fromLatin1("foofoo");
+ QString s2 = s;
+ s = latin1foo;
+ QCOMPARE(s, QString::fromLatin1("foo"));
+ QCOMPARE(s.capacity(), 3);
+
+ // assign to QString with too little capacity:
+ s = QString::fromLatin1("fo");
+ QCOMPARE(s.capacity(), 2);
+ s = latin1foo;
+ QCOMPARE(s, QString::fromLatin1("foo"));
+ QCOMPARE(s.capacity(), 3);
+
+}
+
+void tst_QString::assignQChar()
+{
+ const QChar sp = QLatin1Char(' ');
+ QString s;
+ QCOMPARE(s.capacity(), 0);
+
+ // assign to null QString:
+ s = sp;
+ QCOMPARE(s, QString(sp));
+ QCOMPARE(s.capacity(), 1);
+
+ // assign to non-null QString with enough capacity:
+ s = QLatin1String("foo");
+ const int capacity = s.capacity();
+ QCOMPARE(capacity, 3);
+ s = sp;
+ QCOMPARE(s, QString(sp));
+ QCOMPARE(s.capacity(), capacity);
+
+ // assign to shared QString (enough capacity, but can't use):
+ s = QLatin1String("foo");
+ QString s2 = s;
+ s = sp;
+ QCOMPARE(s, QString(sp));
+ QCOMPARE(s.capacity(), 1);
+
+ // assign to empty QString:
+ s = QString("");
+ s.detach();
+ QCOMPARE(s.capacity(), 0);
+ s = sp;
+ QCOMPARE(s, QString(sp));
+ QCOMPARE(s.capacity(), 1);
}
void tst_QString::isRightToLeft_data()
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm b/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm
index f4b748e62a..550f835bea 100644
--- a/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm
+++ b/tests/auto/corelib/tools/qstring/tst_qstring_mac.mm
@@ -55,23 +55,19 @@ void tst_QString_macTypes()
}
// QString <-> NSString
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
QString qtString("test string");
const NSString *nsString = qtString.toNSString();
QCOMPARE(QString::fromNSString(nsString), qtString);
-
- [pool release];
}
{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ QMacAutoReleasePool pool;
QString qtString("test string");
const NSString *nsString = qtString.toNSString();
QString qtStringCopy(qtString);
qtString = qtString.toUpper(); // modify
QCOMPARE(QString::fromNSString(nsString), qtStringCopy);
-
- [pool release];
}
}
diff --git a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp b/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp
index 7fc855a359..82d103c460 100644
--- a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp
+++ b/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp
@@ -82,6 +82,7 @@ private slots:
void integer_conversion_data();
void integer_conversion();
void trimmed();
+ void truncate();
void left();
void right();
void mid();
@@ -1839,6 +1840,30 @@ void tst_QStringRef::trimmed()
QCOMPARE(b.trimmed().compare(QStringLiteral("a")), 0);
}
+void tst_QStringRef::truncate()
+{
+ const QString str = "OriginalString~";
+ const QStringRef cref = str.midRef(0);
+ {
+ QStringRef ref = cref;
+ ref.truncate(1000);
+ QCOMPARE(ref, cref);
+ for (int i = str.size(); i >= 0; --i) {
+ ref.truncate(i);
+ QCOMPARE(ref.size(), i);
+ QCOMPARE(ref, cref.left(i));
+ }
+ QVERIFY(ref.isEmpty());
+ }
+
+ {
+ QStringRef ref = cref;
+ QVERIFY(!ref.isEmpty());
+ ref.truncate(-1);
+ QVERIFY(ref.isEmpty());
+ }
+}
+
void tst_QStringRef::left()
{
QString originalString = "OrginalString~";
diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/data/GraphemeBreakTest.txt b/tests/auto/corelib/tools/qtextboundaryfinder/data/GraphemeBreakTest.txt
index d39f2c760a..a3ed239c95 100644
--- a/tests/auto/corelib/tools/qtextboundaryfinder/data/GraphemeBreakTest.txt
+++ b/tests/auto/corelib/tools/qtextboundaryfinder/data/GraphemeBreakTest.txt
@@ -1,8 +1,8 @@
-# GraphemeBreakTest-7.0.0.txt
-# Date: 2013-11-27, 09:54:39 GMT [MD]
+# GraphemeBreakTest-8.0.0.txt
+# Date: 2015-02-13, 13:47:15 GMT [MD]
#
# Unicode Character Database
-# Copyright (c) 1991-2013 Unicode, Inc.
+# Copyright (c) 1991-2015 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
# For documentation, see http://www.unicode.org/reports/tr44/
#
diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/data/LineBreakTest.txt b/tests/auto/corelib/tools/qtextboundaryfinder/data/LineBreakTest.txt
index f06917bb77..7f2e2cc54f 100644
--- a/tests/auto/corelib/tools/qtextboundaryfinder/data/LineBreakTest.txt
+++ b/tests/auto/corelib/tools/qtextboundaryfinder/data/LineBreakTest.txt
@@ -1,8 +1,8 @@
-# LineBreakTest-7.0.0.txt
-# Date: 2014-02-19, 15:51:25 GMT [MD]
+# LineBreakTest-8.0.0.txt
+# Date: 2015-04-30, 09:40:15 GMT [MD]
#
# Unicode Character Database
-# Copyright (c) 1991-2014 Unicode, Inc.
+# Copyright (c) 1991-2015 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
# For documentation, see http://www.unicode.org/reports/tr44/
#
@@ -166,10 +166,10 @@
× 0023 × 0020 ÷ 00A7 ÷ # × [0.3] NUMBER SIGN (AL) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0023 × 0308 × 00A7 ÷ # × [0.3] NUMBER SIGN (AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0023 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] NUMBER SIGN (AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0023 × E000 ÷ # × [0.3] NUMBER SIGN (AL) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0023 × 0020 ÷ E000 ÷ # × [0.3] NUMBER SIGN (AL) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0023 × 0308 × E000 ÷ # × [0.3] NUMBER SIGN (AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0023 × 0308 × 0020 ÷ E000 ÷ # × [0.3] NUMBER SIGN (AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0023 × 50005 ÷ # × [0.3] NUMBER SIGN (AL) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0023 × 0020 ÷ 50005 ÷ # × [0.3] NUMBER SIGN (AL) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0023 × 0308 × 50005 ÷ # × [0.3] NUMBER SIGN (AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0023 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] NUMBER SIGN (AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0023 × 0E01 ÷ # × [0.3] NUMBER SIGN (AL) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0023 × 0020 ÷ 0E01 ÷ # × [0.3] NUMBER SIGN (AL) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0023 × 0308 × 0E01 ÷ # × [0.3] NUMBER SIGN (AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -322,10 +322,10 @@
× 2014 × 0020 ÷ 00A7 ÷ # × [0.3] EM DASH (B2) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 2014 × 0308 ÷ 00A7 ÷ # × [0.3] EM DASH (B2) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 2014 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] EM DASH (B2) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 2014 ÷ E000 ÷ # × [0.3] EM DASH (B2) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 2014 × 0020 ÷ E000 ÷ # × [0.3] EM DASH (B2) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 2014 × 0308 ÷ E000 ÷ # × [0.3] EM DASH (B2) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 2014 × 0308 × 0020 ÷ E000 ÷ # × [0.3] EM DASH (B2) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 2014 ÷ 50005 ÷ # × [0.3] EM DASH (B2) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 2014 × 0020 ÷ 50005 ÷ # × [0.3] EM DASH (B2) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 2014 × 0308 ÷ 50005 ÷ # × [0.3] EM DASH (B2) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 2014 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] EM DASH (B2) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 2014 ÷ 0E01 ÷ # × [0.3] EM DASH (B2) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 2014 × 0020 ÷ 0E01 ÷ # × [0.3] EM DASH (B2) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 2014 × 0308 ÷ 0E01 ÷ # × [0.3] EM DASH (B2) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -478,10 +478,10 @@
× 0009 × 0020 ÷ 00A7 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0009 × 0308 ÷ 00A7 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0009 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0009 ÷ E000 ÷ # × [0.3] <CHARACTER TABULATION> (BA) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0009 × 0020 ÷ E000 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0009 × 0308 ÷ E000 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0009 × 0308 × 0020 ÷ E000 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0009 ÷ 50005 ÷ # × [0.3] <CHARACTER TABULATION> (BA) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0009 × 0020 ÷ 50005 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0009 × 0308 ÷ 50005 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0009 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0009 ÷ 0E01 ÷ # × [0.3] <CHARACTER TABULATION> (BA) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0009 × 0020 ÷ 0E01 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0009 × 0308 ÷ 0E01 ÷ # × [0.3] <CHARACTER TABULATION> (BA) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -634,10 +634,10 @@
× 00B4 × 0020 ÷ 00A7 ÷ # × [0.3] ACUTE ACCENT (BB) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 00B4 × 0308 × 00A7 ÷ # × [0.3] ACUTE ACCENT (BB) × [9.0] COMBINING DIAERESIS (CM) × [21.04] SECTION SIGN (AI_AL) ÷ [0.3]
× 00B4 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] ACUTE ACCENT (BB) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 00B4 × E000 ÷ # × [0.3] ACUTE ACCENT (BB) × [21.04] <private-use-E000> (XX_AL) ÷ [0.3]
-× 00B4 × 0020 ÷ E000 ÷ # × [0.3] ACUTE ACCENT (BB) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 00B4 × 0308 × E000 ÷ # × [0.3] ACUTE ACCENT (BB) × [9.0] COMBINING DIAERESIS (CM) × [21.04] <private-use-E000> (XX_AL) ÷ [0.3]
-× 00B4 × 0308 × 0020 ÷ E000 ÷ # × [0.3] ACUTE ACCENT (BB) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 00B4 × 50005 ÷ # × [0.3] ACUTE ACCENT (BB) × [21.04] <reserved-50005> (XX_AL) ÷ [0.3]
+× 00B4 × 0020 ÷ 50005 ÷ # × [0.3] ACUTE ACCENT (BB) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 00B4 × 0308 × 50005 ÷ # × [0.3] ACUTE ACCENT (BB) × [9.0] COMBINING DIAERESIS (CM) × [21.04] <reserved-50005> (XX_AL) ÷ [0.3]
+× 00B4 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] ACUTE ACCENT (BB) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 00B4 × 0E01 ÷ # × [0.3] ACUTE ACCENT (BB) × [21.04] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 00B4 × 0020 ÷ 0E01 ÷ # × [0.3] ACUTE ACCENT (BB) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 00B4 × 0308 × 0E01 ÷ # × [0.3] ACUTE ACCENT (BB) × [9.0] COMBINING DIAERESIS (CM) × [21.04] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -790,10 +790,10 @@
× 000B ÷ 0020 ÷ 00A7 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 000B ÷ 0308 × 00A7 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 000B ÷ 0308 × 0020 ÷ 00A7 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 000B ÷ E000 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 000B ÷ 0020 ÷ E000 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 000B ÷ 0308 × E000 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 000B ÷ 0308 × 0020 ÷ E000 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 000B ÷ 50005 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 000B ÷ 0020 ÷ 50005 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 000B ÷ 0308 × 50005 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 000B ÷ 0308 × 0020 ÷ 50005 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 000B ÷ 0E01 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 000B ÷ 0020 ÷ 0E01 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 000B ÷ 0308 × 0E01 ÷ # × [0.3] <LINE TABULATION> (BK) ÷ [4.0] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -946,10 +946,10 @@
× FFFC × 0020 ÷ 00A7 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× FFFC × 0308 ÷ 00A7 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [9.0] COMBINING DIAERESIS (CM) ÷ [20.02] SECTION SIGN (AI_AL) ÷ [0.3]
× FFFC × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× FFFC ÷ E000 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) ÷ [20.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× FFFC × 0020 ÷ E000 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× FFFC × 0308 ÷ E000 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [9.0] COMBINING DIAERESIS (CM) ÷ [20.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× FFFC × 0308 × 0020 ÷ E000 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× FFFC ÷ 50005 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) ÷ [20.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× FFFC × 0020 ÷ 50005 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× FFFC × 0308 ÷ 50005 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [9.0] COMBINING DIAERESIS (CM) ÷ [20.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× FFFC × 0308 × 0020 ÷ 50005 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× FFFC ÷ 0E01 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) ÷ [20.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× FFFC × 0020 ÷ 0E01 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× FFFC × 0308 ÷ 0E01 ÷ # × [0.3] OBJECT REPLACEMENT CHARACTER (CB) × [9.0] COMBINING DIAERESIS (CM) ÷ [20.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -1102,10 +1102,10 @@
× 007D × 0020 ÷ 00A7 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 007D × 0308 ÷ 00A7 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 007D × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 007D ÷ E000 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 007D × 0020 ÷ E000 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 007D × 0308 ÷ E000 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 007D × 0308 × 0020 ÷ E000 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 007D ÷ 50005 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 007D × 0020 ÷ 50005 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 007D × 0308 ÷ 50005 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 007D × 0308 × 0020 ÷ 50005 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 007D ÷ 0E01 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 007D × 0020 ÷ 0E01 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 007D × 0308 ÷ 0E01 ÷ # × [0.3] RIGHT CURLY BRACKET (CL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -1258,10 +1258,10 @@
× 0029 × 0020 ÷ 00A7 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0029 × 0308 × 00A7 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [9.0] COMBINING DIAERESIS (CM) × [30.02] SECTION SIGN (AI_AL) ÷ [0.3]
× 0029 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0029 × E000 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [30.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0029 × 0020 ÷ E000 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0029 × 0308 × E000 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [9.0] COMBINING DIAERESIS (CM) × [30.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0029 × 0308 × 0020 ÷ E000 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0029 × 50005 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [30.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0029 × 0020 ÷ 50005 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0029 × 0308 × 50005 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [9.0] COMBINING DIAERESIS (CM) × [30.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0029 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0029 × 0E01 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [30.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0029 × 0020 ÷ 0E01 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0029 × 0308 × 0E01 ÷ # × [0.3] RIGHT PARENTHESIS (CP) × [9.0] COMBINING DIAERESIS (CM) × [30.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -1414,10 +1414,10 @@
× 0001 × 0020 ÷ 00A7 ÷ # × [0.3] <START OF HEADING> (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0001 × 0308 × 00A7 ÷ # × [0.3] <START OF HEADING> (CM) × [9.0] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0001 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] <START OF HEADING> (CM) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0001 × E000 ÷ # × [0.3] <START OF HEADING> (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0001 × 0020 ÷ E000 ÷ # × [0.3] <START OF HEADING> (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0001 × 0308 × E000 ÷ # × [0.3] <START OF HEADING> (CM) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0001 × 0308 × 0020 ÷ E000 ÷ # × [0.3] <START OF HEADING> (CM) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0001 × 50005 ÷ # × [0.3] <START OF HEADING> (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0001 × 0020 ÷ 50005 ÷ # × [0.3] <START OF HEADING> (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0001 × 0308 × 50005 ÷ # × [0.3] <START OF HEADING> (CM) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0001 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] <START OF HEADING> (CM) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0001 × 0E01 ÷ # × [0.3] <START OF HEADING> (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0001 × 0020 ÷ 0E01 ÷ # × [0.3] <START OF HEADING> (CM) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0001 × 0308 × 0E01 ÷ # × [0.3] <START OF HEADING> (CM) × [9.0] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -1570,10 +1570,10 @@
× 000D ÷ 0020 ÷ 00A7 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 000D ÷ 0308 × 00A7 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 000D ÷ 0308 × 0020 ÷ 00A7 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 000D ÷ E000 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× 000D ÷ 0020 ÷ E000 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 000D ÷ 0308 × E000 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 000D ÷ 0308 × 0020 ÷ E000 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 000D ÷ 50005 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× 000D ÷ 0020 ÷ 50005 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 000D ÷ 0308 × 50005 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 000D ÷ 0308 × 0020 ÷ 50005 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 000D ÷ 0E01 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 000D ÷ 0020 ÷ 0E01 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 000D ÷ 0308 × 0E01 ÷ # × [0.3] <CARRIAGE RETURN (CR)> (CR) ÷ [5.02] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -1650,9 +1650,9 @@
× 0021 × 0020 ÷ 231A ÷ # × [0.3] EXCLAMATION MARK (EX) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
× 0021 × 0308 ÷ 231A ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] WATCH (ID) ÷ [0.3]
× 0021 × 0308 × 0020 ÷ 231A ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
-× 0021 ÷ 2024 ÷ # × [0.3] EXCLAMATION MARK (EX) ÷ [999.0] ONE DOT LEADER (IN) ÷ [0.3]
+× 0021 × 2024 ÷ # × [0.3] EXCLAMATION MARK (EX) × [22.02] ONE DOT LEADER (IN) ÷ [0.3]
× 0021 × 0020 ÷ 2024 ÷ # × [0.3] EXCLAMATION MARK (EX) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
-× 0021 × 0308 ÷ 2024 ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] ONE DOT LEADER (IN) ÷ [0.3]
+× 0021 × 0308 × 2024 ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) × [22.02] ONE DOT LEADER (IN) ÷ [0.3]
× 0021 × 0308 × 0020 ÷ 2024 ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
× 0021 × 002C ÷ # × [0.3] EXCLAMATION MARK (EX) × [13.02] COMMA (IS) ÷ [0.3]
× 0021 × 0020 × 002C ÷ # × [0.3] EXCLAMATION MARK (EX) × [7.01] SPACE (SP) × [13.02] COMMA (IS) ÷ [0.3]
@@ -1726,10 +1726,10 @@
× 0021 × 0020 ÷ 00A7 ÷ # × [0.3] EXCLAMATION MARK (EX) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0021 × 0308 ÷ 00A7 ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0021 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0021 ÷ E000 ÷ # × [0.3] EXCLAMATION MARK (EX) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0021 × 0020 ÷ E000 ÷ # × [0.3] EXCLAMATION MARK (EX) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0021 × 0308 ÷ E000 ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0021 × 0308 × 0020 ÷ E000 ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0021 ÷ 50005 ÷ # × [0.3] EXCLAMATION MARK (EX) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0021 × 0020 ÷ 50005 ÷ # × [0.3] EXCLAMATION MARK (EX) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0021 × 0308 ÷ 50005 ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0021 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0021 ÷ 0E01 ÷ # × [0.3] EXCLAMATION MARK (EX) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0021 × 0020 ÷ 0E01 ÷ # × [0.3] EXCLAMATION MARK (EX) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0021 × 0308 ÷ 0E01 ÷ # × [0.3] EXCLAMATION MARK (EX) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -1882,10 +1882,10 @@
× 00A0 × 0020 ÷ 00A7 ÷ # × [0.3] NO-BREAK SPACE (GL) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 00A0 × 0308 × 00A7 ÷ # × [0.3] NO-BREAK SPACE (GL) × [9.0] COMBINING DIAERESIS (CM) × [12.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 00A0 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] NO-BREAK SPACE (GL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 00A0 × E000 ÷ # × [0.3] NO-BREAK SPACE (GL) × [12.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 00A0 × 0020 ÷ E000 ÷ # × [0.3] NO-BREAK SPACE (GL) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 00A0 × 0308 × E000 ÷ # × [0.3] NO-BREAK SPACE (GL) × [9.0] COMBINING DIAERESIS (CM) × [12.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 00A0 × 0308 × 0020 ÷ E000 ÷ # × [0.3] NO-BREAK SPACE (GL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 00A0 × 50005 ÷ # × [0.3] NO-BREAK SPACE (GL) × [12.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 00A0 × 0020 ÷ 50005 ÷ # × [0.3] NO-BREAK SPACE (GL) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 00A0 × 0308 × 50005 ÷ # × [0.3] NO-BREAK SPACE (GL) × [9.0] COMBINING DIAERESIS (CM) × [12.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 00A0 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] NO-BREAK SPACE (GL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 00A0 × 0E01 ÷ # × [0.3] NO-BREAK SPACE (GL) × [12.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 00A0 × 0020 ÷ 0E01 ÷ # × [0.3] NO-BREAK SPACE (GL) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 00A0 × 0308 × 0E01 ÷ # × [0.3] NO-BREAK SPACE (GL) × [9.0] COMBINING DIAERESIS (CM) × [12.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -2038,10 +2038,10 @@
× AC00 × 0020 ÷ 00A7 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× AC00 × 0308 ÷ 00A7 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× AC00 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× AC00 ÷ E000 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× AC00 × 0020 ÷ E000 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× AC00 × 0308 ÷ E000 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× AC00 × 0308 × 0020 ÷ E000 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× AC00 ÷ 50005 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× AC00 × 0020 ÷ 50005 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× AC00 × 0308 ÷ 50005 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× AC00 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× AC00 ÷ 0E01 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× AC00 × 0020 ÷ 0E01 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× AC00 × 0308 ÷ 0E01 ÷ # × [0.3] HANGUL SYLLABLE GA (H2) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -2194,10 +2194,10 @@
× AC01 × 0020 ÷ 00A7 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× AC01 × 0308 ÷ 00A7 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× AC01 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× AC01 ÷ E000 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× AC01 × 0020 ÷ E000 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× AC01 × 0308 ÷ E000 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× AC01 × 0308 × 0020 ÷ E000 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× AC01 ÷ 50005 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× AC01 × 0020 ÷ 50005 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× AC01 × 0308 ÷ 50005 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× AC01 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× AC01 ÷ 0E01 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× AC01 × 0020 ÷ 0E01 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× AC01 × 0308 ÷ 0E01 ÷ # × [0.3] HANGUL SYLLABLE GAG (H3) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -2350,10 +2350,10 @@
× 05D0 × 0020 ÷ 00A7 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 05D0 × 0308 × 00A7 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 05D0 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 05D0 × E000 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 05D0 × 0020 ÷ E000 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 05D0 × 0308 × E000 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 05D0 × 0308 × 0020 ÷ E000 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 05D0 × 50005 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 05D0 × 0020 ÷ 50005 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 05D0 × 0308 × 50005 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 05D0 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 05D0 × 0E01 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 05D0 × 0020 ÷ 0E01 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 05D0 × 0308 × 0E01 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -2506,10 +2506,10 @@
× 002D × 0020 ÷ 00A7 ÷ # × [0.3] HYPHEN-MINUS (HY) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 002D × 0308 ÷ 00A7 ÷ # × [0.3] HYPHEN-MINUS (HY) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 002D × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] HYPHEN-MINUS (HY) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 002D ÷ E000 ÷ # × [0.3] HYPHEN-MINUS (HY) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 002D × 0020 ÷ E000 ÷ # × [0.3] HYPHEN-MINUS (HY) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 002D × 0308 ÷ E000 ÷ # × [0.3] HYPHEN-MINUS (HY) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 002D × 0308 × 0020 ÷ E000 ÷ # × [0.3] HYPHEN-MINUS (HY) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 002D ÷ 50005 ÷ # × [0.3] HYPHEN-MINUS (HY) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 002D × 0020 ÷ 50005 ÷ # × [0.3] HYPHEN-MINUS (HY) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 002D × 0308 ÷ 50005 ÷ # × [0.3] HYPHEN-MINUS (HY) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 002D × 0308 × 0020 ÷ 50005 ÷ # × [0.3] HYPHEN-MINUS (HY) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 002D ÷ 0E01 ÷ # × [0.3] HYPHEN-MINUS (HY) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 002D × 0020 ÷ 0E01 ÷ # × [0.3] HYPHEN-MINUS (HY) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 002D × 0308 ÷ 0E01 ÷ # × [0.3] HYPHEN-MINUS (HY) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -2586,9 +2586,9 @@
× 231A × 0020 ÷ 231A ÷ # × [0.3] WATCH (ID) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
× 231A × 0308 ÷ 231A ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] WATCH (ID) ÷ [0.3]
× 231A × 0308 × 0020 ÷ 231A ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
-× 231A × 2024 ÷ # × [0.3] WATCH (ID) × [22.02] ONE DOT LEADER (IN) ÷ [0.3]
+× 231A × 2024 ÷ # × [0.3] WATCH (ID) × [22.03] ONE DOT LEADER (IN) ÷ [0.3]
× 231A × 0020 ÷ 2024 ÷ # × [0.3] WATCH (ID) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
-× 231A × 0308 × 2024 ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) × [22.02] ONE DOT LEADER (IN) ÷ [0.3]
+× 231A × 0308 × 2024 ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) × [22.03] ONE DOT LEADER (IN) ÷ [0.3]
× 231A × 0308 × 0020 ÷ 2024 ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
× 231A × 002C ÷ # × [0.3] WATCH (ID) × [13.02] COMMA (IS) ÷ [0.3]
× 231A × 0020 × 002C ÷ # × [0.3] WATCH (ID) × [7.01] SPACE (SP) × [13.02] COMMA (IS) ÷ [0.3]
@@ -2662,10 +2662,10 @@
× 231A × 0020 ÷ 00A7 ÷ # × [0.3] WATCH (ID) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 231A × 0308 ÷ 00A7 ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 231A × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 231A ÷ E000 ÷ # × [0.3] WATCH (ID) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 231A × 0020 ÷ E000 ÷ # × [0.3] WATCH (ID) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 231A × 0308 ÷ E000 ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 231A × 0308 × 0020 ÷ E000 ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 231A ÷ 50005 ÷ # × [0.3] WATCH (ID) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 231A × 0020 ÷ 50005 ÷ # × [0.3] WATCH (ID) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 231A × 0308 ÷ 50005 ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 231A × 0308 × 0020 ÷ 50005 ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 231A ÷ 0E01 ÷ # × [0.3] WATCH (ID) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 231A × 0020 ÷ 0E01 ÷ # × [0.3] WATCH (ID) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 231A × 0308 ÷ 0E01 ÷ # × [0.3] WATCH (ID) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -2742,9 +2742,9 @@
× 2024 × 0020 ÷ 231A ÷ # × [0.3] ONE DOT LEADER (IN) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
× 2024 × 0308 ÷ 231A ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] WATCH (ID) ÷ [0.3]
× 2024 × 0308 × 0020 ÷ 231A ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
-× 2024 × 2024 ÷ # × [0.3] ONE DOT LEADER (IN) × [22.03] ONE DOT LEADER (IN) ÷ [0.3]
+× 2024 × 2024 ÷ # × [0.3] ONE DOT LEADER (IN) × [22.04] ONE DOT LEADER (IN) ÷ [0.3]
× 2024 × 0020 ÷ 2024 ÷ # × [0.3] ONE DOT LEADER (IN) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
-× 2024 × 0308 × 2024 ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) × [22.03] ONE DOT LEADER (IN) ÷ [0.3]
+× 2024 × 0308 × 2024 ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) × [22.04] ONE DOT LEADER (IN) ÷ [0.3]
× 2024 × 0308 × 0020 ÷ 2024 ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
× 2024 × 002C ÷ # × [0.3] ONE DOT LEADER (IN) × [13.02] COMMA (IS) ÷ [0.3]
× 2024 × 0020 × 002C ÷ # × [0.3] ONE DOT LEADER (IN) × [7.01] SPACE (SP) × [13.02] COMMA (IS) ÷ [0.3]
@@ -2818,10 +2818,10 @@
× 2024 × 0020 ÷ 00A7 ÷ # × [0.3] ONE DOT LEADER (IN) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 2024 × 0308 ÷ 00A7 ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 2024 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 2024 ÷ E000 ÷ # × [0.3] ONE DOT LEADER (IN) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 2024 × 0020 ÷ E000 ÷ # × [0.3] ONE DOT LEADER (IN) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 2024 × 0308 ÷ E000 ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 2024 × 0308 × 0020 ÷ E000 ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 2024 ÷ 50005 ÷ # × [0.3] ONE DOT LEADER (IN) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 2024 × 0020 ÷ 50005 ÷ # × [0.3] ONE DOT LEADER (IN) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 2024 × 0308 ÷ 50005 ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 2024 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 2024 ÷ 0E01 ÷ # × [0.3] ONE DOT LEADER (IN) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 2024 × 0020 ÷ 0E01 ÷ # × [0.3] ONE DOT LEADER (IN) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 2024 × 0308 ÷ 0E01 ÷ # × [0.3] ONE DOT LEADER (IN) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -2974,10 +2974,10 @@
× 002C × 0020 ÷ 00A7 ÷ # × [0.3] COMMA (IS) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 002C × 0308 × 00A7 ÷ # × [0.3] COMMA (IS) × [9.0] COMBINING DIAERESIS (CM) × [29.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 002C × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] COMMA (IS) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 002C × E000 ÷ # × [0.3] COMMA (IS) × [29.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 002C × 0020 ÷ E000 ÷ # × [0.3] COMMA (IS) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 002C × 0308 × E000 ÷ # × [0.3] COMMA (IS) × [9.0] COMBINING DIAERESIS (CM) × [29.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 002C × 0308 × 0020 ÷ E000 ÷ # × [0.3] COMMA (IS) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 002C × 50005 ÷ # × [0.3] COMMA (IS) × [29.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 002C × 0020 ÷ 50005 ÷ # × [0.3] COMMA (IS) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 002C × 0308 × 50005 ÷ # × [0.3] COMMA (IS) × [9.0] COMBINING DIAERESIS (CM) × [29.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 002C × 0308 × 0020 ÷ 50005 ÷ # × [0.3] COMMA (IS) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 002C × 0E01 ÷ # × [0.3] COMMA (IS) × [29.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 002C × 0020 ÷ 0E01 ÷ # × [0.3] COMMA (IS) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 002C × 0308 × 0E01 ÷ # × [0.3] COMMA (IS) × [9.0] COMBINING DIAERESIS (CM) × [29.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -3130,10 +3130,10 @@
× 1100 × 0020 ÷ 00A7 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 1100 × 0308 ÷ 00A7 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 1100 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 1100 ÷ E000 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 1100 × 0020 ÷ E000 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 1100 × 0308 ÷ E000 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 1100 × 0308 × 0020 ÷ E000 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 1100 ÷ 50005 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 1100 × 0020 ÷ 50005 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 1100 × 0308 ÷ 50005 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 1100 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 1100 ÷ 0E01 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 1100 × 0020 ÷ 0E01 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 1100 × 0308 ÷ 0E01 ÷ # × [0.3] HANGUL CHOSEONG KIYEOK (JL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -3286,10 +3286,10 @@
× 11A8 × 0020 ÷ 00A7 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 11A8 × 0308 ÷ 00A7 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 11A8 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 11A8 ÷ E000 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 11A8 × 0020 ÷ E000 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 11A8 × 0308 ÷ E000 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 11A8 × 0308 × 0020 ÷ E000 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 11A8 ÷ 50005 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 11A8 × 0020 ÷ 50005 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 11A8 × 0308 ÷ 50005 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 11A8 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 11A8 ÷ 0E01 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 11A8 × 0020 ÷ 0E01 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 11A8 × 0308 ÷ 0E01 ÷ # × [0.3] HANGUL JONGSEONG KIYEOK (JT) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -3442,10 +3442,10 @@
× 1160 × 0020 ÷ 00A7 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 1160 × 0308 ÷ 00A7 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 1160 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 1160 ÷ E000 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 1160 × 0020 ÷ E000 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 1160 × 0308 ÷ E000 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 1160 × 0308 × 0020 ÷ E000 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 1160 ÷ 50005 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 1160 × 0020 ÷ 50005 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 1160 × 0308 ÷ 50005 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 1160 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 1160 ÷ 0E01 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 1160 × 0020 ÷ 0E01 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 1160 × 0308 ÷ 0E01 ÷ # × [0.3] HANGUL JUNGSEONG FILLER (JV) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -3598,10 +3598,10 @@
× 000A ÷ 0020 ÷ 00A7 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 000A ÷ 0308 × 00A7 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 000A ÷ 0308 × 0020 ÷ 00A7 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 000A ÷ E000 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] <private-use-E000> (XX_AL) ÷ [0.3]
-× 000A ÷ 0020 ÷ E000 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 000A ÷ 0308 × E000 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 000A ÷ 0308 × 0020 ÷ E000 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 000A ÷ 50005 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] <reserved-50005> (XX_AL) ÷ [0.3]
+× 000A ÷ 0020 ÷ 50005 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 000A ÷ 0308 × 50005 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 000A ÷ 0308 × 0020 ÷ 50005 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 000A ÷ 0E01 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 000A ÷ 0020 ÷ 0E01 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 000A ÷ 0308 × 0E01 ÷ # × [0.3] <LINE FEED (LF)> (LF) ÷ [5.03] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -3754,10 +3754,10 @@
× 0085 ÷ 0020 ÷ 00A7 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0085 ÷ 0308 × 00A7 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0085 ÷ 0308 × 0020 ÷ 00A7 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0085 ÷ E000 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0085 ÷ 0020 ÷ E000 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0085 ÷ 0308 × E000 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0085 ÷ 0308 × 0020 ÷ E000 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0085 ÷ 50005 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0085 ÷ 0020 ÷ 50005 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0085 ÷ 0308 × 50005 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0085 ÷ 0308 × 0020 ÷ 50005 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0085 ÷ 0E01 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0085 ÷ 0020 ÷ 0E01 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0085 ÷ 0308 × 0E01 ÷ # × [0.3] <NEXT LINE (NEL)> (NL) ÷ [5.04] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -3910,10 +3910,10 @@
× 17D6 × 0020 ÷ 00A7 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 17D6 × 0308 ÷ 00A7 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 17D6 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 17D6 ÷ E000 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 17D6 × 0020 ÷ E000 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 17D6 × 0308 ÷ E000 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 17D6 × 0308 × 0020 ÷ E000 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 17D6 ÷ 50005 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 17D6 × 0020 ÷ 50005 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 17D6 × 0308 ÷ 50005 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 17D6 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 17D6 ÷ 0E01 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 17D6 × 0020 ÷ 0E01 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 17D6 × 0308 ÷ 0E01 ÷ # × [0.3] KHMER SIGN CAMNUC PII KUUH (NS) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -3990,9 +3990,9 @@
× 0030 × 0020 ÷ 231A ÷ # × [0.3] DIGIT ZERO (NU) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
× 0030 × 0308 ÷ 231A ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] WATCH (ID) ÷ [0.3]
× 0030 × 0308 × 0020 ÷ 231A ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
-× 0030 × 2024 ÷ # × [0.3] DIGIT ZERO (NU) × [22.04] ONE DOT LEADER (IN) ÷ [0.3]
+× 0030 × 2024 ÷ # × [0.3] DIGIT ZERO (NU) × [22.05] ONE DOT LEADER (IN) ÷ [0.3]
× 0030 × 0020 ÷ 2024 ÷ # × [0.3] DIGIT ZERO (NU) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
-× 0030 × 0308 × 2024 ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [22.04] ONE DOT LEADER (IN) ÷ [0.3]
+× 0030 × 0308 × 2024 ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [22.05] ONE DOT LEADER (IN) ÷ [0.3]
× 0030 × 0308 × 0020 ÷ 2024 ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
× 0030 × 002C ÷ # × [0.3] DIGIT ZERO (NU) × [25.03] COMMA (IS) ÷ [0.3]
× 0030 × 0020 × 002C ÷ # × [0.3] DIGIT ZERO (NU) × [7.01] SPACE (SP) × [13.02] COMMA (IS) ÷ [0.3]
@@ -4066,10 +4066,10 @@
× 0030 × 0020 ÷ 00A7 ÷ # × [0.3] DIGIT ZERO (NU) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0030 × 0308 × 00A7 ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [23.03] SECTION SIGN (AI_AL) ÷ [0.3]
× 0030 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0030 × E000 ÷ # × [0.3] DIGIT ZERO (NU) × [23.03] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0030 × 0020 ÷ E000 ÷ # × [0.3] DIGIT ZERO (NU) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0030 × 0308 × E000 ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [23.03] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0030 × 0308 × 0020 ÷ E000 ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0030 × 50005 ÷ # × [0.3] DIGIT ZERO (NU) × [23.03] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0030 × 0020 ÷ 50005 ÷ # × [0.3] DIGIT ZERO (NU) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0030 × 0308 × 50005 ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [23.03] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0030 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0030 × 0E01 ÷ # × [0.3] DIGIT ZERO (NU) × [23.03] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0030 × 0020 ÷ 0E01 ÷ # × [0.3] DIGIT ZERO (NU) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0030 × 0308 × 0E01 ÷ # × [0.3] DIGIT ZERO (NU) × [9.0] COMBINING DIAERESIS (CM) × [23.03] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -4222,10 +4222,10 @@
× 0028 × 0020 × 00A7 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [7.01] SPACE (SP) × [14.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0028 × 0308 × 00A7 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [9.0] COMBINING DIAERESIS (CM) × [14.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0028 × 0308 × 0020 × 00A7 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [14.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0028 × E000 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [14.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0028 × 0020 × E000 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [7.01] SPACE (SP) × [14.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0028 × 0308 × E000 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [9.0] COMBINING DIAERESIS (CM) × [14.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0028 × 0308 × 0020 × E000 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [14.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0028 × 50005 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [14.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0028 × 0020 × 50005 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [7.01] SPACE (SP) × [14.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0028 × 0308 × 50005 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [9.0] COMBINING DIAERESIS (CM) × [14.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0028 × 0308 × 0020 × 50005 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [14.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0028 × 0E01 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [14.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0028 × 0020 × 0E01 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [7.01] SPACE (SP) × [14.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0028 × 0308 × 0E01 ÷ # × [0.3] LEFT PARENTHESIS (OP) × [9.0] COMBINING DIAERESIS (CM) × [14.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -4378,10 +4378,10 @@
× 0025 × 0020 ÷ 00A7 ÷ # × [0.3] PERCENT SIGN (PO) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0025 × 0308 × 00A7 ÷ # × [0.3] PERCENT SIGN (PO) × [9.0] COMBINING DIAERESIS (CM) × [24.03] SECTION SIGN (AI_AL) ÷ [0.3]
× 0025 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] PERCENT SIGN (PO) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0025 × E000 ÷ # × [0.3] PERCENT SIGN (PO) × [24.03] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0025 × 0020 ÷ E000 ÷ # × [0.3] PERCENT SIGN (PO) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0025 × 0308 × E000 ÷ # × [0.3] PERCENT SIGN (PO) × [9.0] COMBINING DIAERESIS (CM) × [24.03] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0025 × 0308 × 0020 ÷ E000 ÷ # × [0.3] PERCENT SIGN (PO) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0025 × 50005 ÷ # × [0.3] PERCENT SIGN (PO) × [24.03] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0025 × 0020 ÷ 50005 ÷ # × [0.3] PERCENT SIGN (PO) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0025 × 0308 × 50005 ÷ # × [0.3] PERCENT SIGN (PO) × [9.0] COMBINING DIAERESIS (CM) × [24.03] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0025 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] PERCENT SIGN (PO) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0025 × 0E01 ÷ # × [0.3] PERCENT SIGN (PO) × [24.03] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0025 × 0020 ÷ 0E01 ÷ # × [0.3] PERCENT SIGN (PO) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0025 × 0308 × 0E01 ÷ # × [0.3] PERCENT SIGN (PO) × [9.0] COMBINING DIAERESIS (CM) × [24.03] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -4534,10 +4534,10 @@
× 0024 × 0020 ÷ 00A7 ÷ # × [0.3] DOLLAR SIGN (PR) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0024 × 0308 × 00A7 ÷ # × [0.3] DOLLAR SIGN (PR) × [9.0] COMBINING DIAERESIS (CM) × [24.02] SECTION SIGN (AI_AL) ÷ [0.3]
× 0024 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] DOLLAR SIGN (PR) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0024 × E000 ÷ # × [0.3] DOLLAR SIGN (PR) × [24.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0024 × 0020 ÷ E000 ÷ # × [0.3] DOLLAR SIGN (PR) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0024 × 0308 × E000 ÷ # × [0.3] DOLLAR SIGN (PR) × [9.0] COMBINING DIAERESIS (CM) × [24.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0024 × 0308 × 0020 ÷ E000 ÷ # × [0.3] DOLLAR SIGN (PR) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0024 × 50005 ÷ # × [0.3] DOLLAR SIGN (PR) × [24.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0024 × 0020 ÷ 50005 ÷ # × [0.3] DOLLAR SIGN (PR) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0024 × 0308 × 50005 ÷ # × [0.3] DOLLAR SIGN (PR) × [9.0] COMBINING DIAERESIS (CM) × [24.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0024 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] DOLLAR SIGN (PR) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0024 × 0E01 ÷ # × [0.3] DOLLAR SIGN (PR) × [24.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0024 × 0020 ÷ 0E01 ÷ # × [0.3] DOLLAR SIGN (PR) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0024 × 0308 × 0E01 ÷ # × [0.3] DOLLAR SIGN (PR) × [9.0] COMBINING DIAERESIS (CM) × [24.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -4690,10 +4690,10 @@
× 0022 × 0020 ÷ 00A7 ÷ # × [0.3] QUOTATION MARK (QU) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0022 × 0308 × 00A7 ÷ # × [0.3] QUOTATION MARK (QU) × [9.0] COMBINING DIAERESIS (CM) × [19.02] SECTION SIGN (AI_AL) ÷ [0.3]
× 0022 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] QUOTATION MARK (QU) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0022 × E000 ÷ # × [0.3] QUOTATION MARK (QU) × [19.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0022 × 0020 ÷ E000 ÷ # × [0.3] QUOTATION MARK (QU) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0022 × 0308 × E000 ÷ # × [0.3] QUOTATION MARK (QU) × [9.0] COMBINING DIAERESIS (CM) × [19.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0022 × 0308 × 0020 ÷ E000 ÷ # × [0.3] QUOTATION MARK (QU) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0022 × 50005 ÷ # × [0.3] QUOTATION MARK (QU) × [19.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0022 × 0020 ÷ 50005 ÷ # × [0.3] QUOTATION MARK (QU) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0022 × 0308 × 50005 ÷ # × [0.3] QUOTATION MARK (QU) × [9.0] COMBINING DIAERESIS (CM) × [19.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0022 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] QUOTATION MARK (QU) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0022 × 0E01 ÷ # × [0.3] QUOTATION MARK (QU) × [19.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0022 × 0020 ÷ 0E01 ÷ # × [0.3] QUOTATION MARK (QU) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0022 × 0308 × 0E01 ÷ # × [0.3] QUOTATION MARK (QU) × [9.0] COMBINING DIAERESIS (CM) × [19.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -4846,10 +4846,10 @@
× 0020 × 0020 ÷ 00A7 ÷ # × [0.3] SPACE (SP) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0020 ÷ 0308 × 00A7 ÷ # × [0.3] SPACE (SP) ÷ [18.0] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0020 ÷ 0308 × 0020 ÷ 00A7 ÷ # × [0.3] SPACE (SP) ÷ [18.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0020 ÷ E000 ÷ # × [0.3] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0020 × 0020 ÷ E000 ÷ # × [0.3] SPACE (SP) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0020 ÷ 0308 × E000 ÷ # × [0.3] SPACE (SP) ÷ [18.0] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0020 ÷ 0308 × 0020 ÷ E000 ÷ # × [0.3] SPACE (SP) ÷ [18.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0020 ÷ 50005 ÷ # × [0.3] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0020 × 0020 ÷ 50005 ÷ # × [0.3] SPACE (SP) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0020 ÷ 0308 × 50005 ÷ # × [0.3] SPACE (SP) ÷ [18.0] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0020 ÷ 0308 × 0020 ÷ 50005 ÷ # × [0.3] SPACE (SP) ÷ [18.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0020 ÷ 0E01 ÷ # × [0.3] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0020 × 0020 ÷ 0E01 ÷ # × [0.3] SPACE (SP) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0020 ÷ 0308 × 0E01 ÷ # × [0.3] SPACE (SP) ÷ [18.0] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -4914,9 +4914,9 @@
× 002F × 0020 ÷ AC01 ÷ # × [0.3] SOLIDUS (SY) × [7.01] SPACE (SP) ÷ [18.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
× 002F × 0308 ÷ AC01 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
× 002F × 0308 × 0020 ÷ AC01 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
-× 002F ÷ 05D0 ÷ # × [0.3] SOLIDUS (SY) ÷ [999.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
+× 002F × 05D0 ÷ # × [0.3] SOLIDUS (SY) × [21.2] HEBREW LETTER ALEF (HL) ÷ [0.3]
× 002F × 0020 ÷ 05D0 ÷ # × [0.3] SOLIDUS (SY) × [7.01] SPACE (SP) ÷ [18.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
-× 002F × 0308 ÷ 05D0 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
+× 002F × 0308 × 05D0 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) × [21.2] HEBREW LETTER ALEF (HL) ÷ [0.3]
× 002F × 0308 × 0020 ÷ 05D0 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
× 002F × 002D ÷ # × [0.3] SOLIDUS (SY) × [21.02] HYPHEN-MINUS (HY) ÷ [0.3]
× 002F × 0020 ÷ 002D ÷ # × [0.3] SOLIDUS (SY) × [7.01] SPACE (SP) ÷ [18.0] HYPHEN-MINUS (HY) ÷ [0.3]
@@ -5002,10 +5002,10 @@
× 002F × 0020 ÷ 00A7 ÷ # × [0.3] SOLIDUS (SY) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 002F × 0308 ÷ 00A7 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 002F × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 002F ÷ E000 ÷ # × [0.3] SOLIDUS (SY) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 002F × 0020 ÷ E000 ÷ # × [0.3] SOLIDUS (SY) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 002F × 0308 ÷ E000 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 002F × 0308 × 0020 ÷ E000 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 002F ÷ 50005 ÷ # × [0.3] SOLIDUS (SY) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 002F × 0020 ÷ 50005 ÷ # × [0.3] SOLIDUS (SY) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 002F × 0308 ÷ 50005 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 002F × 0308 × 0020 ÷ 50005 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 002F ÷ 0E01 ÷ # × [0.3] SOLIDUS (SY) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 002F × 0020 ÷ 0E01 ÷ # × [0.3] SOLIDUS (SY) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 002F × 0308 ÷ 0E01 ÷ # × [0.3] SOLIDUS (SY) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -5158,10 +5158,10 @@
× 2060 × 0020 ÷ 00A7 ÷ # × [0.3] WORD JOINER (WJ) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 2060 × 0308 × 00A7 ÷ # × [0.3] WORD JOINER (WJ) × [9.0] COMBINING DIAERESIS (CM) × [11.02] SECTION SIGN (AI_AL) ÷ [0.3]
× 2060 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] WORD JOINER (WJ) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 2060 × E000 ÷ # × [0.3] WORD JOINER (WJ) × [11.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× 2060 × 0020 ÷ E000 ÷ # × [0.3] WORD JOINER (WJ) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 2060 × 0308 × E000 ÷ # × [0.3] WORD JOINER (WJ) × [9.0] COMBINING DIAERESIS (CM) × [11.02] <private-use-E000> (XX_AL) ÷ [0.3]
-× 2060 × 0308 × 0020 ÷ E000 ÷ # × [0.3] WORD JOINER (WJ) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 2060 × 50005 ÷ # × [0.3] WORD JOINER (WJ) × [11.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× 2060 × 0020 ÷ 50005 ÷ # × [0.3] WORD JOINER (WJ) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 2060 × 0308 × 50005 ÷ # × [0.3] WORD JOINER (WJ) × [9.0] COMBINING DIAERESIS (CM) × [11.02] <reserved-50005> (XX_AL) ÷ [0.3]
+× 2060 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] WORD JOINER (WJ) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 2060 × 0E01 ÷ # × [0.3] WORD JOINER (WJ) × [11.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 2060 × 0020 ÷ 0E01 ÷ # × [0.3] WORD JOINER (WJ) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 2060 × 0308 × 0E01 ÷ # × [0.3] WORD JOINER (WJ) × [9.0] COMBINING DIAERESIS (CM) × [11.02] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -5314,10 +5314,10 @@
× 200B × 0020 ÷ 00A7 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) × [7.01] SPACE (SP) ÷ [8.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 200B ÷ 0308 × 00A7 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) ÷ [8.0] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 200B ÷ 0308 × 0020 ÷ 00A7 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) ÷ [8.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 200B ÷ E000 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) ÷ [8.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 200B × 0020 ÷ E000 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) × [7.01] SPACE (SP) ÷ [8.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 200B ÷ 0308 × E000 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) ÷ [8.0] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 200B ÷ 0308 × 0020 ÷ E000 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) ÷ [8.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 200B ÷ 50005 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) ÷ [8.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 200B × 0020 ÷ 50005 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) × [7.01] SPACE (SP) ÷ [8.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 200B ÷ 0308 × 50005 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) ÷ [8.0] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 200B ÷ 0308 × 0020 ÷ 50005 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) ÷ [8.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 200B ÷ 0E01 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) ÷ [8.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 200B × 0020 ÷ 0E01 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) × [7.01] SPACE (SP) ÷ [8.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 200B ÷ 0308 × 0E01 ÷ # × [0.3] ZERO WIDTH SPACE (ZW) ÷ [8.0] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -5470,10 +5470,10 @@
× 1F1E6 × 0020 ÷ 00A7 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 1F1E6 × 0308 ÷ 00A7 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 1F1E6 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 1F1E6 ÷ E000 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 1F1E6 × 0020 ÷ E000 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 1F1E6 × 0308 ÷ E000 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 1F1E6 × 0308 × 0020 ÷ E000 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 1F1E6 ÷ 50005 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 1F1E6 × 0020 ÷ 50005 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 1F1E6 × 0308 ÷ 50005 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 1F1E6 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 1F1E6 ÷ 0E01 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 1F1E6 × 0020 ÷ 0E01 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 1F1E6 × 0308 ÷ 0E01 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -5626,10 +5626,10 @@
× 00A7 × 0020 ÷ 00A7 ÷ # × [0.3] SECTION SIGN (AI_AL) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 00A7 × 0308 × 00A7 ÷ # × [0.3] SECTION SIGN (AI_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 00A7 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] SECTION SIGN (AI_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 00A7 × E000 ÷ # × [0.3] SECTION SIGN (AI_AL) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 00A7 × 0020 ÷ E000 ÷ # × [0.3] SECTION SIGN (AI_AL) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 00A7 × 0308 × E000 ÷ # × [0.3] SECTION SIGN (AI_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 00A7 × 0308 × 0020 ÷ E000 ÷ # × [0.3] SECTION SIGN (AI_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 00A7 × 50005 ÷ # × [0.3] SECTION SIGN (AI_AL) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 00A7 × 0020 ÷ 50005 ÷ # × [0.3] SECTION SIGN (AI_AL) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 00A7 × 0308 × 50005 ÷ # × [0.3] SECTION SIGN (AI_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 00A7 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] SECTION SIGN (AI_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 00A7 × 0E01 ÷ # × [0.3] SECTION SIGN (AI_AL) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 00A7 × 0020 ÷ 0E01 ÷ # × [0.3] SECTION SIGN (AI_AL) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 00A7 × 0308 × 0E01 ÷ # × [0.3] SECTION SIGN (AI_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -5638,162 +5638,162 @@
× 00A7 × 0020 ÷ 3041 ÷ # × [0.3] SECTION SIGN (AI_AL) × [7.01] SPACE (SP) ÷ [18.0] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
× 00A7 × 0308 × 3041 ÷ # × [0.3] SECTION SIGN (AI_AL) × [9.0] COMBINING DIAERESIS (CM) × [21.03] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
× 00A7 × 0308 × 0020 ÷ 3041 ÷ # × [0.3] SECTION SIGN (AI_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
-× E000 × 0023 ÷ # × [0.3] <private-use-E000> (XX_AL) × [28.0] NUMBER SIGN (AL) ÷ [0.3]
-× E000 × 0020 ÷ 0023 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] NUMBER SIGN (AL) ÷ [0.3]
-× E000 × 0308 × 0023 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] NUMBER SIGN (AL) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 0023 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] NUMBER SIGN (AL) ÷ [0.3]
-× E000 ÷ 2014 ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] EM DASH (B2) ÷ [0.3]
-× E000 × 0020 ÷ 2014 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] EM DASH (B2) ÷ [0.3]
-× E000 × 0308 ÷ 2014 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] EM DASH (B2) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 2014 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] EM DASH (B2) ÷ [0.3]
-× E000 × 0009 ÷ # × [0.3] <private-use-E000> (XX_AL) × [21.01] <CHARACTER TABULATION> (BA) ÷ [0.3]
-× E000 × 0020 ÷ 0009 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] <CHARACTER TABULATION> (BA) ÷ [0.3]
-× E000 × 0308 × 0009 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [21.01] <CHARACTER TABULATION> (BA) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 0009 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <CHARACTER TABULATION> (BA) ÷ [0.3]
-× E000 ÷ 00B4 ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] ACUTE ACCENT (BB) ÷ [0.3]
-× E000 × 0020 ÷ 00B4 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] ACUTE ACCENT (BB) ÷ [0.3]
-× E000 × 0308 ÷ 00B4 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] ACUTE ACCENT (BB) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 00B4 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] ACUTE ACCENT (BB) ÷ [0.3]
-× E000 × 000B ÷ # × [0.3] <private-use-E000> (XX_AL) × [6.0] <LINE TABULATION> (BK) ÷ [0.3]
-× E000 × 0020 × 000B ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [6.0] <LINE TABULATION> (BK) ÷ [0.3]
-× E000 × 0308 × 000B ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [6.0] <LINE TABULATION> (BK) ÷ [0.3]
-× E000 × 0308 × 0020 × 000B ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [6.0] <LINE TABULATION> (BK) ÷ [0.3]
-× E000 ÷ FFFC ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [20.01] OBJECT REPLACEMENT CHARACTER (CB) ÷ [0.3]
-× E000 × 0020 ÷ FFFC ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] OBJECT REPLACEMENT CHARACTER (CB) ÷ [0.3]
-× E000 × 0308 ÷ FFFC ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [20.01] OBJECT REPLACEMENT CHARACTER (CB) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ FFFC ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] OBJECT REPLACEMENT CHARACTER (CB) ÷ [0.3]
-× E000 × 007D ÷ # × [0.3] <private-use-E000> (XX_AL) × [13.02] RIGHT CURLY BRACKET (CL) ÷ [0.3]
-× E000 × 0020 × 007D ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [13.02] RIGHT CURLY BRACKET (CL) ÷ [0.3]
-× E000 × 0308 × 007D ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [13.03] RIGHT CURLY BRACKET (CL) ÷ [0.3]
-× E000 × 0308 × 0020 × 007D ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [13.02] RIGHT CURLY BRACKET (CL) ÷ [0.3]
-× E000 × 0029 ÷ # × [0.3] <private-use-E000> (XX_AL) × [13.02] RIGHT PARENTHESIS (CP) ÷ [0.3]
-× E000 × 0020 × 0029 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [13.02] RIGHT PARENTHESIS (CP) ÷ [0.3]
-× E000 × 0308 × 0029 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [13.03] RIGHT PARENTHESIS (CP) ÷ [0.3]
-× E000 × 0308 × 0020 × 0029 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [13.02] RIGHT PARENTHESIS (CP) ÷ [0.3]
-× E000 × 0001 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] <START OF HEADING> (CM) ÷ [0.3]
-× E000 × 0020 ÷ 0001 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] <START OF HEADING> (CM) ÷ [0.3]
-× E000 × 0308 × 0001 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [9.0] <START OF HEADING> (CM) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 0001 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <START OF HEADING> (CM) ÷ [0.3]
-× E000 × 000D ÷ # × [0.3] <private-use-E000> (XX_AL) × [6.0] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
-× E000 × 0020 × 000D ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [6.0] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
-× E000 × 0308 × 000D ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [6.0] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
-× E000 × 0308 × 0020 × 000D ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [6.0] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
-× E000 × 0021 ÷ # × [0.3] <private-use-E000> (XX_AL) × [13.01] EXCLAMATION MARK (EX) ÷ [0.3]
-× E000 × 0020 × 0021 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [13.01] EXCLAMATION MARK (EX) ÷ [0.3]
-× E000 × 0308 × 0021 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [13.01] EXCLAMATION MARK (EX) ÷ [0.3]
-× E000 × 0308 × 0020 × 0021 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [13.01] EXCLAMATION MARK (EX) ÷ [0.3]
-× E000 × 00A0 ÷ # × [0.3] <private-use-E000> (XX_AL) × [12.1] NO-BREAK SPACE (GL) ÷ [0.3]
-× E000 × 0020 ÷ 00A0 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] NO-BREAK SPACE (GL) ÷ [0.3]
-× E000 × 0308 × 00A0 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [12.2] NO-BREAK SPACE (GL) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 00A0 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] NO-BREAK SPACE (GL) ÷ [0.3]
-× E000 ÷ AC00 ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] HANGUL SYLLABLE GA (H2) ÷ [0.3]
-× E000 × 0020 ÷ AC00 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HANGUL SYLLABLE GA (H2) ÷ [0.3]
-× E000 × 0308 ÷ AC00 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL SYLLABLE GA (H2) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ AC00 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL SYLLABLE GA (H2) ÷ [0.3]
-× E000 ÷ AC01 ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
-× E000 × 0020 ÷ AC01 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
-× E000 × 0308 ÷ AC01 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ AC01 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
-× E000 × 05D0 ÷ # × [0.3] <private-use-E000> (XX_AL) × [28.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
-× E000 × 0020 ÷ 05D0 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
-× E000 × 0308 × 05D0 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 05D0 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
-× E000 × 002D ÷ # × [0.3] <private-use-E000> (XX_AL) × [21.02] HYPHEN-MINUS (HY) ÷ [0.3]
-× E000 × 0020 ÷ 002D ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HYPHEN-MINUS (HY) ÷ [0.3]
-× E000 × 0308 × 002D ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [21.02] HYPHEN-MINUS (HY) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 002D ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HYPHEN-MINUS (HY) ÷ [0.3]
-× E000 ÷ 231A ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] WATCH (ID) ÷ [0.3]
-× E000 × 0020 ÷ 231A ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
-× E000 × 0308 ÷ 231A ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] WATCH (ID) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 231A ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
-× E000 × 2024 ÷ # × [0.3] <private-use-E000> (XX_AL) × [22.01] ONE DOT LEADER (IN) ÷ [0.3]
-× E000 × 0020 ÷ 2024 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
-× E000 × 0308 × 2024 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [22.01] ONE DOT LEADER (IN) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 2024 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
-× E000 × 002C ÷ # × [0.3] <private-use-E000> (XX_AL) × [13.02] COMMA (IS) ÷ [0.3]
-× E000 × 0020 × 002C ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [13.02] COMMA (IS) ÷ [0.3]
-× E000 × 0308 × 002C ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [13.03] COMMA (IS) ÷ [0.3]
-× E000 × 0308 × 0020 × 002C ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [13.02] COMMA (IS) ÷ [0.3]
-× E000 ÷ 1100 ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] HANGUL CHOSEONG KIYEOK (JL) ÷ [0.3]
-× E000 × 0020 ÷ 1100 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HANGUL CHOSEONG KIYEOK (JL) ÷ [0.3]
-× E000 × 0308 ÷ 1100 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL CHOSEONG KIYEOK (JL) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 1100 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL CHOSEONG KIYEOK (JL) ÷ [0.3]
-× E000 ÷ 11A8 ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] HANGUL JONGSEONG KIYEOK (JT) ÷ [0.3]
-× E000 × 0020 ÷ 11A8 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HANGUL JONGSEONG KIYEOK (JT) ÷ [0.3]
-× E000 × 0308 ÷ 11A8 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL JONGSEONG KIYEOK (JT) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 11A8 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL JONGSEONG KIYEOK (JT) ÷ [0.3]
-× E000 ÷ 1160 ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] HANGUL JUNGSEONG FILLER (JV) ÷ [0.3]
-× E000 × 0020 ÷ 1160 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HANGUL JUNGSEONG FILLER (JV) ÷ [0.3]
-× E000 × 0308 ÷ 1160 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL JUNGSEONG FILLER (JV) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 1160 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL JUNGSEONG FILLER (JV) ÷ [0.3]
-× E000 × 000A ÷ # × [0.3] <private-use-E000> (XX_AL) × [6.0] <LINE FEED (LF)> (LF) ÷ [0.3]
-× E000 × 0020 × 000A ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [6.0] <LINE FEED (LF)> (LF) ÷ [0.3]
-× E000 × 0308 × 000A ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [6.0] <LINE FEED (LF)> (LF) ÷ [0.3]
-× E000 × 0308 × 0020 × 000A ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [6.0] <LINE FEED (LF)> (LF) ÷ [0.3]
-× E000 × 0085 ÷ # × [0.3] <private-use-E000> (XX_AL) × [6.0] <NEXT LINE (NEL)> (NL) ÷ [0.3]
-× E000 × 0020 × 0085 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [6.0] <NEXT LINE (NEL)> (NL) ÷ [0.3]
-× E000 × 0308 × 0085 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [6.0] <NEXT LINE (NEL)> (NL) ÷ [0.3]
-× E000 × 0308 × 0020 × 0085 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [6.0] <NEXT LINE (NEL)> (NL) ÷ [0.3]
-× E000 × 17D6 ÷ # × [0.3] <private-use-E000> (XX_AL) × [21.03] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [0.3]
-× E000 × 0020 ÷ 17D6 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [0.3]
-× E000 × 0308 × 17D6 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [21.03] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 17D6 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [0.3]
-× E000 × 0030 ÷ # × [0.3] <private-use-E000> (XX_AL) × [23.02] DIGIT ZERO (NU) ÷ [0.3]
-× E000 × 0020 ÷ 0030 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] DIGIT ZERO (NU) ÷ [0.3]
-× E000 × 0308 × 0030 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [23.02] DIGIT ZERO (NU) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 0030 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] DIGIT ZERO (NU) ÷ [0.3]
-× E000 × 0028 ÷ # × [0.3] <private-use-E000> (XX_AL) × [30.01] LEFT PARENTHESIS (OP) ÷ [0.3]
-× E000 × 0020 ÷ 0028 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] LEFT PARENTHESIS (OP) ÷ [0.3]
-× E000 × 0308 × 0028 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [30.01] LEFT PARENTHESIS (OP) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 0028 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] LEFT PARENTHESIS (OP) ÷ [0.3]
-× E000 ÷ 0025 ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] PERCENT SIGN (PO) ÷ [0.3]
-× E000 × 0020 ÷ 0025 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] PERCENT SIGN (PO) ÷ [0.3]
-× E000 × 0308 ÷ 0025 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] PERCENT SIGN (PO) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 0025 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] PERCENT SIGN (PO) ÷ [0.3]
-× E000 ÷ 0024 ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] DOLLAR SIGN (PR) ÷ [0.3]
-× E000 × 0020 ÷ 0024 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] DOLLAR SIGN (PR) ÷ [0.3]
-× E000 × 0308 ÷ 0024 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] DOLLAR SIGN (PR) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 0024 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] DOLLAR SIGN (PR) ÷ [0.3]
-× E000 × 0022 ÷ # × [0.3] <private-use-E000> (XX_AL) × [19.01] QUOTATION MARK (QU) ÷ [0.3]
-× E000 × 0020 ÷ 0022 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] QUOTATION MARK (QU) ÷ [0.3]
-× E000 × 0308 × 0022 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [19.01] QUOTATION MARK (QU) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 0022 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] QUOTATION MARK (QU) ÷ [0.3]
-× E000 × 0020 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [0.3]
-× E000 × 0020 × 0020 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [7.01] SPACE (SP) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [0.3]
-× E000 × 0308 × 0020 × 0020 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [7.01] SPACE (SP) ÷ [0.3]
-× E000 × 002F ÷ # × [0.3] <private-use-E000> (XX_AL) × [13.02] SOLIDUS (SY) ÷ [0.3]
-× E000 × 0020 × 002F ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [13.02] SOLIDUS (SY) ÷ [0.3]
-× E000 × 0308 × 002F ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [13.03] SOLIDUS (SY) ÷ [0.3]
-× E000 × 0308 × 0020 × 002F ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [13.02] SOLIDUS (SY) ÷ [0.3]
-× E000 × 2060 ÷ # × [0.3] <private-use-E000> (XX_AL) × [11.01] WORD JOINER (WJ) ÷ [0.3]
-× E000 × 0020 × 2060 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [11.01] WORD JOINER (WJ) ÷ [0.3]
-× E000 × 0308 × 2060 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [11.01] WORD JOINER (WJ) ÷ [0.3]
-× E000 × 0308 × 0020 × 2060 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [11.01] WORD JOINER (WJ) ÷ [0.3]
-× E000 × 200B ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.02] ZERO WIDTH SPACE (ZW) ÷ [0.3]
-× E000 × 0020 × 200B ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) × [7.02] ZERO WIDTH SPACE (ZW) ÷ [0.3]
-× E000 × 0308 × 200B ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.02] ZERO WIDTH SPACE (ZW) ÷ [0.3]
-× E000 × 0308 × 0020 × 200B ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [7.02] ZERO WIDTH SPACE (ZW) ÷ [0.3]
-× E000 ÷ 1F1E6 ÷ # × [0.3] <private-use-E000> (XX_AL) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3]
-× E000 × 0020 ÷ 1F1E6 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3]
-× E000 × 0308 ÷ 1F1E6 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 1F1E6 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3]
-× E000 × 00A7 ÷ # × [0.3] <private-use-E000> (XX_AL) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× E000 × 0020 ÷ 00A7 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× E000 × 0308 × 00A7 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× E000 × E000 ÷ # × [0.3] <private-use-E000> (XX_AL) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× E000 × 0020 ÷ E000 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× E000 × 0308 × E000 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ E000 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× E000 × 0E01 ÷ # × [0.3] <private-use-E000> (XX_AL) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
-× E000 × 0020 ÷ 0E01 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
-× E000 × 0308 × 0E01 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 0E01 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
-× E000 × 3041 ÷ # × [0.3] <private-use-E000> (XX_AL) × [21.03] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
-× E000 × 0020 ÷ 3041 ÷ # × [0.3] <private-use-E000> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
-× E000 × 0308 × 3041 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [21.03] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
-× E000 × 0308 × 0020 ÷ 3041 ÷ # × [0.3] <private-use-E000> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
+× 50005 × 0023 ÷ # × [0.3] <reserved-50005> (XX_AL) × [28.0] NUMBER SIGN (AL) ÷ [0.3]
+× 50005 × 0020 ÷ 0023 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] NUMBER SIGN (AL) ÷ [0.3]
+× 50005 × 0308 × 0023 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] NUMBER SIGN (AL) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 0023 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] NUMBER SIGN (AL) ÷ [0.3]
+× 50005 ÷ 2014 ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] EM DASH (B2) ÷ [0.3]
+× 50005 × 0020 ÷ 2014 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] EM DASH (B2) ÷ [0.3]
+× 50005 × 0308 ÷ 2014 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] EM DASH (B2) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 2014 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] EM DASH (B2) ÷ [0.3]
+× 50005 × 0009 ÷ # × [0.3] <reserved-50005> (XX_AL) × [21.01] <CHARACTER TABULATION> (BA) ÷ [0.3]
+× 50005 × 0020 ÷ 0009 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] <CHARACTER TABULATION> (BA) ÷ [0.3]
+× 50005 × 0308 × 0009 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [21.01] <CHARACTER TABULATION> (BA) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 0009 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <CHARACTER TABULATION> (BA) ÷ [0.3]
+× 50005 ÷ 00B4 ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] ACUTE ACCENT (BB) ÷ [0.3]
+× 50005 × 0020 ÷ 00B4 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] ACUTE ACCENT (BB) ÷ [0.3]
+× 50005 × 0308 ÷ 00B4 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] ACUTE ACCENT (BB) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 00B4 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] ACUTE ACCENT (BB) ÷ [0.3]
+× 50005 × 000B ÷ # × [0.3] <reserved-50005> (XX_AL) × [6.0] <LINE TABULATION> (BK) ÷ [0.3]
+× 50005 × 0020 × 000B ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [6.0] <LINE TABULATION> (BK) ÷ [0.3]
+× 50005 × 0308 × 000B ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [6.0] <LINE TABULATION> (BK) ÷ [0.3]
+× 50005 × 0308 × 0020 × 000B ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [6.0] <LINE TABULATION> (BK) ÷ [0.3]
+× 50005 ÷ FFFC ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [20.01] OBJECT REPLACEMENT CHARACTER (CB) ÷ [0.3]
+× 50005 × 0020 ÷ FFFC ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] OBJECT REPLACEMENT CHARACTER (CB) ÷ [0.3]
+× 50005 × 0308 ÷ FFFC ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [20.01] OBJECT REPLACEMENT CHARACTER (CB) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ FFFC ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] OBJECT REPLACEMENT CHARACTER (CB) ÷ [0.3]
+× 50005 × 007D ÷ # × [0.3] <reserved-50005> (XX_AL) × [13.02] RIGHT CURLY BRACKET (CL) ÷ [0.3]
+× 50005 × 0020 × 007D ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [13.02] RIGHT CURLY BRACKET (CL) ÷ [0.3]
+× 50005 × 0308 × 007D ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [13.03] RIGHT CURLY BRACKET (CL) ÷ [0.3]
+× 50005 × 0308 × 0020 × 007D ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [13.02] RIGHT CURLY BRACKET (CL) ÷ [0.3]
+× 50005 × 0029 ÷ # × [0.3] <reserved-50005> (XX_AL) × [13.02] RIGHT PARENTHESIS (CP) ÷ [0.3]
+× 50005 × 0020 × 0029 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [13.02] RIGHT PARENTHESIS (CP) ÷ [0.3]
+× 50005 × 0308 × 0029 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [13.03] RIGHT PARENTHESIS (CP) ÷ [0.3]
+× 50005 × 0308 × 0020 × 0029 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [13.02] RIGHT PARENTHESIS (CP) ÷ [0.3]
+× 50005 × 0001 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] <START OF HEADING> (CM) ÷ [0.3]
+× 50005 × 0020 ÷ 0001 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] <START OF HEADING> (CM) ÷ [0.3]
+× 50005 × 0308 × 0001 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [9.0] <START OF HEADING> (CM) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 0001 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <START OF HEADING> (CM) ÷ [0.3]
+× 50005 × 000D ÷ # × [0.3] <reserved-50005> (XX_AL) × [6.0] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+× 50005 × 0020 × 000D ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [6.0] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+× 50005 × 0308 × 000D ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [6.0] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+× 50005 × 0308 × 0020 × 000D ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [6.0] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+× 50005 × 0021 ÷ # × [0.3] <reserved-50005> (XX_AL) × [13.01] EXCLAMATION MARK (EX) ÷ [0.3]
+× 50005 × 0020 × 0021 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [13.01] EXCLAMATION MARK (EX) ÷ [0.3]
+× 50005 × 0308 × 0021 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [13.01] EXCLAMATION MARK (EX) ÷ [0.3]
+× 50005 × 0308 × 0020 × 0021 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [13.01] EXCLAMATION MARK (EX) ÷ [0.3]
+× 50005 × 00A0 ÷ # × [0.3] <reserved-50005> (XX_AL) × [12.1] NO-BREAK SPACE (GL) ÷ [0.3]
+× 50005 × 0020 ÷ 00A0 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] NO-BREAK SPACE (GL) ÷ [0.3]
+× 50005 × 0308 × 00A0 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [12.2] NO-BREAK SPACE (GL) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 00A0 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] NO-BREAK SPACE (GL) ÷ [0.3]
+× 50005 ÷ AC00 ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] HANGUL SYLLABLE GA (H2) ÷ [0.3]
+× 50005 × 0020 ÷ AC00 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HANGUL SYLLABLE GA (H2) ÷ [0.3]
+× 50005 × 0308 ÷ AC00 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL SYLLABLE GA (H2) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ AC00 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL SYLLABLE GA (H2) ÷ [0.3]
+× 50005 ÷ AC01 ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
+× 50005 × 0020 ÷ AC01 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
+× 50005 × 0308 ÷ AC01 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ AC01 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL SYLLABLE GAG (H3) ÷ [0.3]
+× 50005 × 05D0 ÷ # × [0.3] <reserved-50005> (XX_AL) × [28.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
+× 50005 × 0020 ÷ 05D0 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
+× 50005 × 0308 × 05D0 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 05D0 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HEBREW LETTER ALEF (HL) ÷ [0.3]
+× 50005 × 002D ÷ # × [0.3] <reserved-50005> (XX_AL) × [21.02] HYPHEN-MINUS (HY) ÷ [0.3]
+× 50005 × 0020 ÷ 002D ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HYPHEN-MINUS (HY) ÷ [0.3]
+× 50005 × 0308 × 002D ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [21.02] HYPHEN-MINUS (HY) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 002D ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HYPHEN-MINUS (HY) ÷ [0.3]
+× 50005 ÷ 231A ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] WATCH (ID) ÷ [0.3]
+× 50005 × 0020 ÷ 231A ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
+× 50005 × 0308 ÷ 231A ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] WATCH (ID) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 231A ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] WATCH (ID) ÷ [0.3]
+× 50005 × 2024 ÷ # × [0.3] <reserved-50005> (XX_AL) × [22.01] ONE DOT LEADER (IN) ÷ [0.3]
+× 50005 × 0020 ÷ 2024 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
+× 50005 × 0308 × 2024 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [22.01] ONE DOT LEADER (IN) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 2024 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] ONE DOT LEADER (IN) ÷ [0.3]
+× 50005 × 002C ÷ # × [0.3] <reserved-50005> (XX_AL) × [13.02] COMMA (IS) ÷ [0.3]
+× 50005 × 0020 × 002C ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [13.02] COMMA (IS) ÷ [0.3]
+× 50005 × 0308 × 002C ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [13.03] COMMA (IS) ÷ [0.3]
+× 50005 × 0308 × 0020 × 002C ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [13.02] COMMA (IS) ÷ [0.3]
+× 50005 ÷ 1100 ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] HANGUL CHOSEONG KIYEOK (JL) ÷ [0.3]
+× 50005 × 0020 ÷ 1100 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HANGUL CHOSEONG KIYEOK (JL) ÷ [0.3]
+× 50005 × 0308 ÷ 1100 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL CHOSEONG KIYEOK (JL) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 1100 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL CHOSEONG KIYEOK (JL) ÷ [0.3]
+× 50005 ÷ 11A8 ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] HANGUL JONGSEONG KIYEOK (JT) ÷ [0.3]
+× 50005 × 0020 ÷ 11A8 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HANGUL JONGSEONG KIYEOK (JT) ÷ [0.3]
+× 50005 × 0308 ÷ 11A8 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL JONGSEONG KIYEOK (JT) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 11A8 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL JONGSEONG KIYEOK (JT) ÷ [0.3]
+× 50005 ÷ 1160 ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] HANGUL JUNGSEONG FILLER (JV) ÷ [0.3]
+× 50005 × 0020 ÷ 1160 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HANGUL JUNGSEONG FILLER (JV) ÷ [0.3]
+× 50005 × 0308 ÷ 1160 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] HANGUL JUNGSEONG FILLER (JV) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 1160 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HANGUL JUNGSEONG FILLER (JV) ÷ [0.3]
+× 50005 × 000A ÷ # × [0.3] <reserved-50005> (XX_AL) × [6.0] <LINE FEED (LF)> (LF) ÷ [0.3]
+× 50005 × 0020 × 000A ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [6.0] <LINE FEED (LF)> (LF) ÷ [0.3]
+× 50005 × 0308 × 000A ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [6.0] <LINE FEED (LF)> (LF) ÷ [0.3]
+× 50005 × 0308 × 0020 × 000A ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [6.0] <LINE FEED (LF)> (LF) ÷ [0.3]
+× 50005 × 0085 ÷ # × [0.3] <reserved-50005> (XX_AL) × [6.0] <NEXT LINE (NEL)> (NL) ÷ [0.3]
+× 50005 × 0020 × 0085 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [6.0] <NEXT LINE (NEL)> (NL) ÷ [0.3]
+× 50005 × 0308 × 0085 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [6.0] <NEXT LINE (NEL)> (NL) ÷ [0.3]
+× 50005 × 0308 × 0020 × 0085 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [6.0] <NEXT LINE (NEL)> (NL) ÷ [0.3]
+× 50005 × 17D6 ÷ # × [0.3] <reserved-50005> (XX_AL) × [21.03] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [0.3]
+× 50005 × 0020 ÷ 17D6 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [0.3]
+× 50005 × 0308 × 17D6 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [21.03] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 17D6 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] KHMER SIGN CAMNUC PII KUUH (NS) ÷ [0.3]
+× 50005 × 0030 ÷ # × [0.3] <reserved-50005> (XX_AL) × [23.02] DIGIT ZERO (NU) ÷ [0.3]
+× 50005 × 0020 ÷ 0030 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] DIGIT ZERO (NU) ÷ [0.3]
+× 50005 × 0308 × 0030 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [23.02] DIGIT ZERO (NU) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 0030 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] DIGIT ZERO (NU) ÷ [0.3]
+× 50005 × 0028 ÷ # × [0.3] <reserved-50005> (XX_AL) × [30.01] LEFT PARENTHESIS (OP) ÷ [0.3]
+× 50005 × 0020 ÷ 0028 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] LEFT PARENTHESIS (OP) ÷ [0.3]
+× 50005 × 0308 × 0028 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [30.01] LEFT PARENTHESIS (OP) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 0028 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] LEFT PARENTHESIS (OP) ÷ [0.3]
+× 50005 ÷ 0025 ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] PERCENT SIGN (PO) ÷ [0.3]
+× 50005 × 0020 ÷ 0025 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] PERCENT SIGN (PO) ÷ [0.3]
+× 50005 × 0308 ÷ 0025 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] PERCENT SIGN (PO) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 0025 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] PERCENT SIGN (PO) ÷ [0.3]
+× 50005 ÷ 0024 ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] DOLLAR SIGN (PR) ÷ [0.3]
+× 50005 × 0020 ÷ 0024 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] DOLLAR SIGN (PR) ÷ [0.3]
+× 50005 × 0308 ÷ 0024 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] DOLLAR SIGN (PR) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 0024 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] DOLLAR SIGN (PR) ÷ [0.3]
+× 50005 × 0022 ÷ # × [0.3] <reserved-50005> (XX_AL) × [19.01] QUOTATION MARK (QU) ÷ [0.3]
+× 50005 × 0020 ÷ 0022 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] QUOTATION MARK (QU) ÷ [0.3]
+× 50005 × 0308 × 0022 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [19.01] QUOTATION MARK (QU) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 0022 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] QUOTATION MARK (QU) ÷ [0.3]
+× 50005 × 0020 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [0.3]
+× 50005 × 0020 × 0020 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [7.01] SPACE (SP) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [0.3]
+× 50005 × 0308 × 0020 × 0020 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [7.01] SPACE (SP) ÷ [0.3]
+× 50005 × 002F ÷ # × [0.3] <reserved-50005> (XX_AL) × [13.02] SOLIDUS (SY) ÷ [0.3]
+× 50005 × 0020 × 002F ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [13.02] SOLIDUS (SY) ÷ [0.3]
+× 50005 × 0308 × 002F ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [13.03] SOLIDUS (SY) ÷ [0.3]
+× 50005 × 0308 × 0020 × 002F ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [13.02] SOLIDUS (SY) ÷ [0.3]
+× 50005 × 2060 ÷ # × [0.3] <reserved-50005> (XX_AL) × [11.01] WORD JOINER (WJ) ÷ [0.3]
+× 50005 × 0020 × 2060 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [11.01] WORD JOINER (WJ) ÷ [0.3]
+× 50005 × 0308 × 2060 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [11.01] WORD JOINER (WJ) ÷ [0.3]
+× 50005 × 0308 × 0020 × 2060 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [11.01] WORD JOINER (WJ) ÷ [0.3]
+× 50005 × 200B ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.02] ZERO WIDTH SPACE (ZW) ÷ [0.3]
+× 50005 × 0020 × 200B ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) × [7.02] ZERO WIDTH SPACE (ZW) ÷ [0.3]
+× 50005 × 0308 × 200B ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.02] ZERO WIDTH SPACE (ZW) ÷ [0.3]
+× 50005 × 0308 × 0020 × 200B ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) × [7.02] ZERO WIDTH SPACE (ZW) ÷ [0.3]
+× 50005 ÷ 1F1E6 ÷ # × [0.3] <reserved-50005> (XX_AL) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3]
+× 50005 × 0020 ÷ 1F1E6 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3]
+× 50005 × 0308 ÷ 1F1E6 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 1F1E6 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] REGIONAL INDICATOR SYMBOL LETTER A (RI) ÷ [0.3]
+× 50005 × 00A7 ÷ # × [0.3] <reserved-50005> (XX_AL) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
+× 50005 × 0020 ÷ 00A7 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
+× 50005 × 0308 × 00A7 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
+× 50005 × 50005 ÷ # × [0.3] <reserved-50005> (XX_AL) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 50005 × 0020 ÷ 50005 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 50005 × 0308 × 50005 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 50005 × 0E01 ÷ # × [0.3] <reserved-50005> (XX_AL) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
+× 50005 × 0020 ÷ 0E01 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
+× 50005 × 0308 × 0E01 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 0E01 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
+× 50005 × 3041 ÷ # × [0.3] <reserved-50005> (XX_AL) × [21.03] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
+× 50005 × 0020 ÷ 3041 ÷ # × [0.3] <reserved-50005> (XX_AL) × [7.01] SPACE (SP) ÷ [18.0] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
+× 50005 × 0308 × 3041 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [21.03] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
+× 50005 × 0308 × 0020 ÷ 3041 ÷ # × [0.3] <reserved-50005> (XX_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [0.3]
× 0E01 × 0023 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [28.0] NUMBER SIGN (AL) ÷ [0.3]
× 0E01 × 0020 ÷ 0023 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [7.01] SPACE (SP) ÷ [18.0] NUMBER SIGN (AL) ÷ [0.3]
× 0E01 × 0308 × 0023 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] NUMBER SIGN (AL) ÷ [0.3]
@@ -5938,10 +5938,10 @@
× 0E01 × 0020 ÷ 00A7 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0E01 × 0308 × 00A7 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 0E01 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 0E01 × E000 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0E01 × 0020 ÷ E000 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0E01 × 0308 × E000 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 0E01 × 0308 × 0020 ÷ E000 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 0E01 × 50005 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0E01 × 0020 ÷ 50005 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0E01 × 0308 × 50005 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 0E01 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 0E01 × 0E01 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0E01 × 0020 ÷ 0E01 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 0E01 × 0308 × 0E01 ÷ # × [0.3] THAI CHARACTER KO KAI (SA_AL) × [9.0] COMBINING DIAERESIS (CM) × [28.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -6094,10 +6094,10 @@
× 3041 × 0020 ÷ 00A7 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 3041 × 0308 ÷ 00A7 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] SECTION SIGN (AI_AL) ÷ [0.3]
× 3041 × 0308 × 0020 ÷ 00A7 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] SECTION SIGN (AI_AL) ÷ [0.3]
-× 3041 ÷ E000 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 3041 × 0020 ÷ E000 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 3041 × 0308 ÷ E000 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <private-use-E000> (XX_AL) ÷ [0.3]
-× 3041 × 0308 × 0020 ÷ E000 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <private-use-E000> (XX_AL) ÷ [0.3]
+× 3041 ÷ 50005 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 3041 × 0020 ÷ 50005 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 3041 × 0308 ÷ 50005 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] <reserved-50005> (XX_AL) ÷ [0.3]
+× 3041 × 0308 × 0020 ÷ 50005 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [9.0] COMBINING DIAERESIS (CM) × [7.01] SPACE (SP) ÷ [18.0] <reserved-50005> (XX_AL) ÷ [0.3]
× 3041 ÷ 0E01 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 3041 × 0020 ÷ 0E01 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [7.01] SPACE (SP) ÷ [18.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
× 3041 × 0308 ÷ 0E01 ÷ # × [0.3] HIRAGANA LETTER SMALL A (CJ_NS) × [9.0] COMBINING DIAERESIS (CM) ÷ [999.0] THAI CHARACTER KO KAI (SA_AL) ÷ [0.3]
@@ -6297,7 +6297,7 @@
× 672C × 003A × 0020 ÷ # × [0.3] CJK UNIFIED IDEOGRAPH-672C (ID) × [13.02] COLON (IS) × [7.01] SPACE (SP) ÷ [0.3]
× 672C × 003A × 0020 ÷ 30AF ÷ # × [0.3] CJK UNIFIED IDEOGRAPH-672C (ID) × [13.02] COLON (IS) × [7.01] SPACE (SP) ÷ [18.0] KATAKANA LETTER KU (ID) ÷ [0.3]
× 51FA ÷ 5178 × 003A × 0020 ÷ 30D5 ÷ 30EA × 30FC ÷ 767E ÷ # × [0.3] CJK UNIFIED IDEOGRAPH-51FA (ID) ÷ [999.0] CJK UNIFIED IDEOGRAPH-5178 (ID) × [13.02] COLON (IS) × [7.01] SPACE (SP) ÷ [18.0] KATAKANA LETTER HU (ID) ÷ [999.0] KATAKANA LETTER RI (ID) × [21.03] KATAKANA-HIRAGANA PROLONGED SOUND MARK (CJ_NS) ÷ [999.0] CJK UNIFIED IDEOGRAPH-767E (ID) ÷ [0.3]
-× 5F8C × 2026 ÷ 306B ÷ # × [0.3] CJK UNIFIED IDEOGRAPH-5F8C (ID) × [22.02] HORIZONTAL ELLIPSIS (IN) ÷ [999.0] HIRAGANA LETTER NI (ID) ÷ [0.3]
+× 5F8C × 2026 ÷ 306B ÷ # × [0.3] CJK UNIFIED IDEOGRAPH-5F8C (ID) × [22.03] HORIZONTAL ELLIPSIS (IN) ÷ [999.0] HIRAGANA LETTER NI (ID) ÷ [0.3]
× 3057 × 3087 ÷ 3046 × 3002 × 3002 × 3002 ÷ # × [0.3] HIRAGANA LETTER SI (ID) × [21.03] HIRAGANA LETTER SMALL YO (CJ_NS) ÷ [999.0] HIRAGANA LETTER U (ID) × [13.02] IDEOGRAPHIC FULL STOP (CL) × [13.02] IDEOGRAPHIC FULL STOP (CL) × [13.02] IDEOGRAPHIC FULL STOP (CL) ÷ [0.3]
× 304D × 3001 × 0021 × 0021 × 3001 × 0021 × 0021 × 0021 ÷ 3068 ÷ # × [0.3] HIRAGANA LETTER KI (ID) × [13.02] IDEOGRAPHIC COMMA (CL) × [13.01] EXCLAMATION MARK (EX) × [13.01] EXCLAMATION MARK (EX) × [13.02] IDEOGRAPHIC COMMA (CL) × [13.01] EXCLAMATION MARK (EX) × [13.01] EXCLAMATION MARK (EX) × [13.01] EXCLAMATION MARK (EX) ÷ [999.0] HIRAGANA LETTER TO (ID) ÷ [0.3]
× 306F × 3001 × 003F ÷ 3068 × 0021 ÷ 3092 ÷ # × [0.3] HIRAGANA LETTER HA (ID) × [13.02] IDEOGRAPHIC COMMA (CL) × [13.01] QUESTION MARK (EX) ÷ [999.0] HIRAGANA LETTER TO (ID) × [13.01] EXCLAMATION MARK (EX) ÷ [999.0] HIRAGANA LETTER WO (ID) ÷ [0.3]
@@ -6327,12 +6327,13 @@
× 1F1F7 × 1F1FA × 1F1F8 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER R (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER U (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER S (RI) ÷ [0.3]
× 1F1F7 × 1F1FA × 1F1F8 × 1F1EA ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER R (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER U (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER S (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER E (RI) ÷ [0.3]
× 1F1F7 × 1F1FA × 200B ÷ 1F1F8 × 1F1EA ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER R (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER U (RI) × [7.02] ZERO WIDTH SPACE (ZW) ÷ [8.0] REGIONAL INDICATOR SYMBOL LETTER S (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER E (RI) ÷ [0.3]
+× 05D0 × 002D × 05D0 ÷ # × [0.3] HEBREW LETTER ALEF (HL) × [21.02] HYPHEN-MINUS (HY) × [21.1] HEBREW LETTER ALEF (HL) ÷ [0.3]
× 1F1E6 × 1F1E7 × 1F1E8 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER B (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER C (RI) ÷ [0.3]
× 1F1E6 × 200D × 1F1E7 × 1F1E8 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [9.0] ZERO WIDTH JOINER (CM) × [30.11] REGIONAL INDICATOR SYMBOL LETTER B (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER C (RI) ÷ [0.3]
× 1F1E6 × 1F1E7 × 200D × 1F1E8 ÷ # × [0.3] REGIONAL INDICATOR SYMBOL LETTER A (RI) × [30.11] REGIONAL INDICATOR SYMBOL LETTER B (RI) × [9.0] ZERO WIDTH JOINER (CM) × [30.11] REGIONAL INDICATOR SYMBOL LETTER C (RI) ÷ [0.3]
× 0020 ÷ 200D × 0646 ÷ # × [0.3] SPACE (SP) ÷ [18.0] ZERO WIDTH JOINER (CM) × [28.0] ARABIC LETTER NOON (AL) ÷ [0.3]
× 0646 × 200D × 0020 ÷ # × [0.3] ARABIC LETTER NOON (AL) × [9.0] ZERO WIDTH JOINER (CM) × [7.01] SPACE (SP) ÷ [0.3]
#
-# Lines: 6310
+# Lines: 6311
#
# EOF
diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/data/SentenceBreakTest.txt b/tests/auto/corelib/tools/qtextboundaryfinder/data/SentenceBreakTest.txt
index 638b22a378..279e6db06d 100644
--- a/tests/auto/corelib/tools/qtextboundaryfinder/data/SentenceBreakTest.txt
+++ b/tests/auto/corelib/tools/qtextboundaryfinder/data/SentenceBreakTest.txt
@@ -1,8 +1,8 @@
-# SentenceBreakTest-7.0.0.txt
-# Date: 2013-11-27, 09:54:53 GMT [MD]
+# SentenceBreakTest-8.0.0.txt
+# Date: 2015-04-30, 09:40:15 GMT [MD]
#
# Unicode Character Database
-# Copyright (c) 1991-2013 Unicode, Inc.
+# Copyright (c) 1991-2015 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
# For documentation, see http://www.unicode.org/reports/tr44/
#
@@ -477,6 +477,9 @@
÷ 0055 × 002E × 0053 × 002E × 0041 × 0300 × 002E ÷ # ÷ [0.2] LATIN CAPITAL LETTER U (Upper) × [12.0] FULL STOP (ATerm) × [7.0] LATIN CAPITAL LETTER S (Upper) × [12.0] FULL STOP (ATerm) × [7.0] LATIN CAPITAL LETTER A (Upper) × [5.0] COMBINING GRAVE ACCENT (Extend_FE) × [12.0] FULL STOP (ATerm) ÷ [0.3]
÷ 0033 × 002E × 0034 ÷ # ÷ [0.2] DIGIT THREE (Numeric) × [12.0] FULL STOP (ATerm) × [6.0] DIGIT FOUR (Numeric) ÷ [0.3]
÷ 0063 × 002E × 0064 ÷ # ÷ [0.2] LATIN SMALL LETTER C (Lower) × [12.0] FULL STOP (ATerm) × [8.0] LATIN SMALL LETTER D (Lower) ÷ [0.3]
+÷ 0043 × 002E × 0064 ÷ # ÷ [0.2] LATIN CAPITAL LETTER C (Upper) × [12.0] FULL STOP (ATerm) × [8.0] LATIN SMALL LETTER D (Lower) ÷ [0.3]
+÷ 0063 × 002E × 0044 ÷ # ÷ [0.2] LATIN SMALL LETTER C (Lower) × [12.0] FULL STOP (ATerm) × [7.0] LATIN CAPITAL LETTER D (Upper) ÷ [0.3]
+÷ 0043 × 002E × 0044 ÷ # ÷ [0.2] LATIN CAPITAL LETTER C (Upper) × [12.0] FULL STOP (ATerm) × [7.0] LATIN CAPITAL LETTER D (Upper) ÷ [0.3]
÷ 0065 × 0074 × 0063 × 002E × 0029 × 2019 × 00A0 × 0074 × 0068 × 0065 ÷ # ÷ [0.2] LATIN SMALL LETTER E (Lower) × [12.0] LATIN SMALL LETTER T (Lower) × [12.0] LATIN SMALL LETTER C (Lower) × [12.0] FULL STOP (ATerm) × [8.0] RIGHT PARENTHESIS (Close) × [8.0] RIGHT SINGLE QUOTATION MARK (Close) × [8.0] NO-BREAK SPACE (Sp) × [8.0] LATIN SMALL LETTER T (Lower) × [12.0] LATIN SMALL LETTER H (Lower) × [12.0] LATIN SMALL LETTER E (Lower) ÷ [0.3]
÷ 0065 × 0074 × 0063 × 002E × 0029 × 2019 × 00A0 ÷ 0054 × 0068 × 0065 ÷ # ÷ [0.2] LATIN SMALL LETTER E (Lower) × [12.0] LATIN SMALL LETTER T (Lower) × [12.0] LATIN SMALL LETTER C (Lower) × [12.0] FULL STOP (ATerm) × [9.0] RIGHT PARENTHESIS (Close) × [9.0] RIGHT SINGLE QUOTATION MARK (Close) × [9.0] NO-BREAK SPACE (Sp) ÷ [11.0] LATIN CAPITAL LETTER T (Upper) × [12.0] LATIN SMALL LETTER H (Lower) × [12.0] LATIN SMALL LETTER E (Lower) ÷ [0.3]
÷ 0065 × 0074 × 0063 × 002E × 0029 × 2019 × 00A0 × 2018 × 0028 × 0074 × 0068 × 0065 ÷ # ÷ [0.2] LATIN SMALL LETTER E (Lower) × [12.0] LATIN SMALL LETTER T (Lower) × [12.0] LATIN SMALL LETTER C (Lower) × [12.0] FULL STOP (ATerm) × [8.0] RIGHT PARENTHESIS (Close) × [8.0] RIGHT SINGLE QUOTATION MARK (Close) × [8.0] NO-BREAK SPACE (Sp) × [8.0] LEFT SINGLE QUOTATION MARK (Close) × [12.0] LEFT PARENTHESIS (Close) × [12.0] LATIN SMALL LETTER T (Lower) × [12.0] LATIN SMALL LETTER H (Lower) × [12.0] LATIN SMALL LETTER E (Lower) ÷ [0.3]
@@ -490,6 +493,7 @@
÷ 0065 × 0074 × 0063 × 002E ÷ 5B83 ÷ # ÷ [0.2] LATIN SMALL LETTER E (Lower) × [12.0] LATIN SMALL LETTER T (Lower) × [12.0] LATIN SMALL LETTER C (Lower) × [12.0] FULL STOP (ATerm) ÷ [11.0] CJK UNIFIED IDEOGRAPH-5B83 (OLetter) ÷ [0.3]
÷ 0065 × 0074 × 0063 × 002E × 3002 ÷ # ÷ [0.2] LATIN SMALL LETTER E (Lower) × [12.0] LATIN SMALL LETTER T (Lower) × [12.0] LATIN SMALL LETTER C (Lower) × [12.0] FULL STOP (ATerm) × [8.1] IDEOGRAPHIC FULL STOP (STerm) ÷ [0.3]
÷ 5B57 × 3002 ÷ 5B83 ÷ # ÷ [0.2] CJK UNIFIED IDEOGRAPH-5B57 (OLetter) × [12.0] IDEOGRAPHIC FULL STOP (STerm) ÷ [11.0] CJK UNIFIED IDEOGRAPH-5B83 (OLetter) ÷ [0.3]
+÷ 0021 × 0020 × 0020 ÷ # ÷ [0.2] EXCLAMATION MARK (STerm) × [9.0] SPACE (Sp) × [10.0] SPACE (Sp) ÷ [0.3]
÷ 2060 × 0028 × 2060 × 0022 × 2060 × 0047 × 2060 × 006F × 2060 × 002E × 2060 × 0022 × 2060 × 0029 × 2060 × 0020 × 2060 ÷ 0028 × 2060 × 0048 × 2060 × 0065 × 2060 × 0020 × 2060 × 0064 × 2060 × 0069 × 2060 × 0064 × 2060 × 002E × 2060 × 0029 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LEFT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [12.0] QUOTATION MARK (Close) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN CAPITAL LETTER G (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER O (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [9.0] QUOTATION MARK (Close) × [5.0] WORD JOINER (Format_FE) × [9.0] RIGHT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [9.0] SPACE (Sp) × [5.0] WORD JOINER (Format_FE) ÷ [11.0] LEFT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN CAPITAL LETTER H (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER E (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] SPACE (Sp) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER D (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER I (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER D (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [9.0] RIGHT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 × 0028 × 2060 × 201C × 2060 × 0047 × 2060 × 006F × 2060 × 003F × 2060 × 201D × 2060 × 0029 × 2060 × 0020 × 2060 ÷ 0028 × 2060 × 0048 × 2060 × 0065 × 2060 × 0020 × 2060 × 0064 × 2060 × 0069 × 2060 × 0064 × 2060 × 002E × 2060 × 0029 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LEFT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [12.0] LEFT DOUBLE QUOTATION MARK (Close) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN CAPITAL LETTER G (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER O (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] QUESTION MARK (STerm) × [5.0] WORD JOINER (Format_FE) × [9.0] RIGHT DOUBLE QUOTATION MARK (Close) × [5.0] WORD JOINER (Format_FE) × [9.0] RIGHT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [9.0] SPACE (Sp) × [5.0] WORD JOINER (Format_FE) ÷ [11.0] LEFT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN CAPITAL LETTER H (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER E (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] SPACE (Sp) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER D (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER I (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER D (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [9.0] RIGHT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 × 0055 × 2060 × 002E × 2060 × 0053 × 2060 × 002E × 2060 × 0041 × 2060 × 0300 × 002E × 2060 × 0020 × 2060 × 0069 × 2060 × 0073 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN CAPITAL LETTER U (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [7.0] LATIN CAPITAL LETTER S (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [7.0] LATIN CAPITAL LETTER A (Upper) × [5.0] WORD JOINER (Format_FE) × [5.0] COMBINING GRAVE ACCENT (Extend_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [8.0] SPACE (Sp) × [5.0] WORD JOINER (Format_FE) × [8.0] LATIN SMALL LETTER I (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER S (Lower) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
@@ -497,6 +501,9 @@
÷ 2060 × 0055 × 2060 × 002E × 2060 × 0053 × 2060 × 002E × 2060 × 0041 × 2060 × 0300 × 002E × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN CAPITAL LETTER U (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [7.0] LATIN CAPITAL LETTER S (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [7.0] LATIN CAPITAL LETTER A (Upper) × [5.0] WORD JOINER (Format_FE) × [5.0] COMBINING GRAVE ACCENT (Extend_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 × 0033 × 2060 × 002E × 2060 × 0034 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] DIGIT THREE (Numeric) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [6.0] DIGIT FOUR (Numeric) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 × 0063 × 2060 × 002E × 2060 × 0064 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER C (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [8.0] LATIN SMALL LETTER D (Lower) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
+÷ 2060 × 0043 × 2060 × 002E × 2060 × 0064 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN CAPITAL LETTER C (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [8.0] LATIN SMALL LETTER D (Lower) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
+÷ 2060 × 0063 × 2060 × 002E × 2060 × 0044 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER C (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [7.0] LATIN CAPITAL LETTER D (Upper) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
+÷ 2060 × 0043 × 2060 × 002E × 2060 × 0044 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN CAPITAL LETTER C (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [7.0] LATIN CAPITAL LETTER D (Upper) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 × 0065 × 2060 × 0074 × 2060 × 0063 × 2060 × 002E × 2060 × 0029 × 2060 × 2019 × 2060 × 00A0 × 2060 × 0074 × 2060 × 0068 × 2060 × 0065 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER E (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER T (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER C (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [8.0] RIGHT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [8.0] RIGHT SINGLE QUOTATION MARK (Close) × [5.0] WORD JOINER (Format_FE) × [8.0] NO-BREAK SPACE (Sp) × [5.0] WORD JOINER (Format_FE) × [8.0] LATIN SMALL LETTER T (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER H (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER E (Lower) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 × 0065 × 2060 × 0074 × 2060 × 0063 × 2060 × 002E × 2060 × 0029 × 2060 × 2019 × 2060 × 00A0 × 2060 ÷ 0054 × 2060 × 0068 × 2060 × 0065 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER E (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER T (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER C (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [9.0] RIGHT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [9.0] RIGHT SINGLE QUOTATION MARK (Close) × [5.0] WORD JOINER (Format_FE) × [9.0] NO-BREAK SPACE (Sp) × [5.0] WORD JOINER (Format_FE) ÷ [11.0] LATIN CAPITAL LETTER T (Upper) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER H (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER E (Lower) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 × 0065 × 2060 × 0074 × 2060 × 0063 × 2060 × 002E × 2060 × 0029 × 2060 × 2019 × 2060 × 00A0 × 2060 × 2018 × 2060 × 0028 × 2060 × 0074 × 2060 × 0068 × 2060 × 0065 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER E (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER T (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER C (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [8.0] RIGHT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [8.0] RIGHT SINGLE QUOTATION MARK (Close) × [5.0] WORD JOINER (Format_FE) × [8.0] NO-BREAK SPACE (Sp) × [5.0] WORD JOINER (Format_FE) × [8.0] LEFT SINGLE QUOTATION MARK (Close) × [5.0] WORD JOINER (Format_FE) × [12.0] LEFT PARENTHESIS (Close) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER T (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER H (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER E (Lower) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
@@ -510,12 +517,13 @@
÷ 2060 × 0065 × 2060 × 0074 × 2060 × 0063 × 2060 × 002E × 2060 ÷ 5B83 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER E (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER T (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER C (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) ÷ [11.0] CJK UNIFIED IDEOGRAPH-5B83 (OLetter) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 × 0065 × 2060 × 0074 × 2060 × 0063 × 2060 × 002E × 2060 × 3002 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER E (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER T (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] LATIN SMALL LETTER C (Lower) × [5.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (ATerm) × [5.0] WORD JOINER (Format_FE) × [8.1] IDEOGRAPHIC FULL STOP (STerm) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 × 5B57 × 2060 × 3002 × 2060 ÷ 5B83 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] CJK UNIFIED IDEOGRAPH-5B57 (OLetter) × [5.0] WORD JOINER (Format_FE) × [12.0] IDEOGRAPHIC FULL STOP (STerm) × [5.0] WORD JOINER (Format_FE) ÷ [11.0] CJK UNIFIED IDEOGRAPH-5B83 (OLetter) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
+÷ 2060 × 0021 × 2060 × 0020 × 2060 × 0020 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) × [12.0] EXCLAMATION MARK (STerm) × [5.0] WORD JOINER (Format_FE) × [9.0] SPACE (Sp) × [5.0] WORD JOINER (Format_FE) × [10.0] SPACE (Sp) × [5.0] WORD JOINER (Format_FE) × [5.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 1F1E6 × 1F1E7 × 1F1E8 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (Other) × [12.0] REGIONAL INDICATOR SYMBOL LETTER B (Other) × [12.0] REGIONAL INDICATOR SYMBOL LETTER C (Other) ÷ [0.3]
÷ 1F1E6 × 200D × 1F1E7 × 1F1E8 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (Other) × [5.0] ZERO WIDTH JOINER (Extend_FE) × [12.0] REGIONAL INDICATOR SYMBOL LETTER B (Other) × [12.0] REGIONAL INDICATOR SYMBOL LETTER C (Other) ÷ [0.3]
÷ 1F1E6 × 1F1E7 × 200D × 1F1E8 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (Other) × [12.0] REGIONAL INDICATOR SYMBOL LETTER B (Other) × [5.0] ZERO WIDTH JOINER (Extend_FE) × [12.0] REGIONAL INDICATOR SYMBOL LETTER C (Other) ÷ [0.3]
÷ 0020 × 200D × 0646 ÷ # ÷ [0.2] SPACE (Sp) × [5.0] ZERO WIDTH JOINER (Extend_FE) × [12.0] ARABIC LETTER NOON (OLetter) ÷ [0.3]
÷ 0646 × 200D × 0020 ÷ # ÷ [0.2] ARABIC LETTER NOON (OLetter) × [5.0] ZERO WIDTH JOINER (Extend_FE) × [12.0] SPACE (Sp) ÷ [0.3]
#
-# Lines: 495
+# Lines: 503
#
# EOF
diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/data/WordBreakTest.txt b/tests/auto/corelib/tools/qtextboundaryfinder/data/WordBreakTest.txt
index 1f812f63bf..7e163f1e41 100644
--- a/tests/auto/corelib/tools/qtextboundaryfinder/data/WordBreakTest.txt
+++ b/tests/auto/corelib/tools/qtextboundaryfinder/data/WordBreakTest.txt
@@ -1,8 +1,8 @@
-# WordBreakTest-7.0.0.txt
-# Date: 2013-11-27, 09:54:53 GMT [MD]
+# WordBreakTest-8.0.0.txt
+# Date: 2015-05-02, 14:48:55 GMT [MD]
#
# Unicode Character Database
-# Copyright (c) 1991-2013 Unicode, Inc.
+# Copyright (c) 1991-2015 Unicode, Inc.
# For terms of use, see http://www.unicode.org/terms_of_use.html
# For documentation, see http://www.unicode.org/reports/tr44/
#
@@ -1377,22 +1377,139 @@
÷ 0061 × 0062 × 00AD × 0062 × 0079 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [5.0] LATIN SMALL LETTER B (ALetter) × [4.0] SOFT HYPHEN (Format_FE) × [5.0] LATIN SMALL LETTER B (ALetter) × [5.0] LATIN SMALL LETTER Y (ALetter) ÷ [0.3]
÷ 0061 ÷ 0024 ÷ 002D ÷ 0033 × 0034 × 002C × 0035 × 0036 × 0037 × 002E × 0031 × 0034 ÷ 0025 ÷ 0062 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] DOLLAR SIGN (Other) ÷ [999.0] HYPHEN-MINUS (Other) ÷ [999.0] DIGIT THREE (Numeric) × [8.0] DIGIT FOUR (Numeric) × [12.0] COMMA (MidNum) × [11.0] DIGIT FIVE (Numeric) × [8.0] DIGIT SIX (Numeric) × [8.0] DIGIT SEVEN (Numeric) × [12.0] FULL STOP (MidNumLet) × [11.0] DIGIT ONE (Numeric) × [8.0] DIGIT FOUR (Numeric) ÷ [999.0] PERCENT SIGN (Other) ÷ [999.0] LATIN SMALL LETTER B (ALetter) ÷ [0.3]
÷ 0033 × 0061 ÷ # ÷ [0.2] DIGIT THREE (Numeric) × [10.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0063 × 002E × 0064 ÷ # ÷ [0.2] LATIN SMALL LETTER C (ALetter) × [6.0] FULL STOP (MidNumLet) × [7.0] LATIN SMALL LETTER D (ALetter) ÷ [0.3]
+÷ 0043 × 002E × 0064 ÷ # ÷ [0.2] LATIN CAPITAL LETTER C (ALetter) × [6.0] FULL STOP (MidNumLet) × [7.0] LATIN SMALL LETTER D (ALetter) ÷ [0.3]
+÷ 0063 × 002E × 0044 ÷ # ÷ [0.2] LATIN SMALL LETTER C (ALetter) × [6.0] FULL STOP (MidNumLet) × [7.0] LATIN CAPITAL LETTER D (ALetter) ÷ [0.3]
+÷ 0043 × 002E × 0044 ÷ # ÷ [0.2] LATIN CAPITAL LETTER C (ALetter) × [6.0] FULL STOP (MidNumLet) × [7.0] LATIN CAPITAL LETTER D (ALetter) ÷ [0.3]
÷ 2060 ÷ 0063 × 2060 × 0061 × 2060 × 006E × 2060 × 0027 × 2060 × 0074 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) ÷ [999.0] LATIN SMALL LETTER C (ALetter) × [4.0] WORD JOINER (Format_FE) × [5.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) × [5.0] LATIN SMALL LETTER N (ALetter) × [4.0] WORD JOINER (Format_FE) × [6.0] APOSTROPHE (Single_Quote) × [4.0] WORD JOINER (Format_FE) × [7.0] LATIN SMALL LETTER T (ALetter) × [4.0] WORD JOINER (Format_FE) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 ÷ 0063 × 2060 × 0061 × 2060 × 006E × 2060 × 2019 × 2060 × 0074 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) ÷ [999.0] LATIN SMALL LETTER C (ALetter) × [4.0] WORD JOINER (Format_FE) × [5.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) × [5.0] LATIN SMALL LETTER N (ALetter) × [4.0] WORD JOINER (Format_FE) × [6.0] RIGHT SINGLE QUOTATION MARK (MidNumLet) × [4.0] WORD JOINER (Format_FE) × [7.0] LATIN SMALL LETTER T (ALetter) × [4.0] WORD JOINER (Format_FE) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 ÷ 0061 × 2060 × 0062 × 2060 × 00AD × 2060 × 0062 × 2060 × 0079 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) × [5.0] LATIN SMALL LETTER B (ALetter) × [4.0] WORD JOINER (Format_FE) × [4.0] SOFT HYPHEN (Format_FE) × [4.0] WORD JOINER (Format_FE) × [5.0] LATIN SMALL LETTER B (ALetter) × [4.0] WORD JOINER (Format_FE) × [5.0] LATIN SMALL LETTER Y (ALetter) × [4.0] WORD JOINER (Format_FE) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 ÷ 0061 × 2060 ÷ 0024 × 2060 ÷ 002D × 2060 ÷ 0033 × 2060 × 0034 × 2060 × 002C × 2060 × 0035 × 2060 × 0036 × 2060 × 0037 × 2060 × 002E × 2060 × 0031 × 2060 × 0034 × 2060 ÷ 0025 × 2060 ÷ 0062 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) ÷ [999.0] DOLLAR SIGN (Other) × [4.0] WORD JOINER (Format_FE) ÷ [999.0] HYPHEN-MINUS (Other) × [4.0] WORD JOINER (Format_FE) ÷ [999.0] DIGIT THREE (Numeric) × [4.0] WORD JOINER (Format_FE) × [8.0] DIGIT FOUR (Numeric) × [4.0] WORD JOINER (Format_FE) × [12.0] COMMA (MidNum) × [4.0] WORD JOINER (Format_FE) × [11.0] DIGIT FIVE (Numeric) × [4.0] WORD JOINER (Format_FE) × [8.0] DIGIT SIX (Numeric) × [4.0] WORD JOINER (Format_FE) × [8.0] DIGIT SEVEN (Numeric) × [4.0] WORD JOINER (Format_FE) × [12.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) × [11.0] DIGIT ONE (Numeric) × [4.0] WORD JOINER (Format_FE) × [8.0] DIGIT FOUR (Numeric) × [4.0] WORD JOINER (Format_FE) ÷ [999.0] PERCENT SIGN (Other) × [4.0] WORD JOINER (Format_FE) ÷ [999.0] LATIN SMALL LETTER B (ALetter) × [4.0] WORD JOINER (Format_FE) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 2060 ÷ 0033 × 2060 × 0061 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) ÷ [999.0] DIGIT THREE (Numeric) × [4.0] WORD JOINER (Format_FE) × [10.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+÷ 2060 ÷ 0063 × 2060 × 002E × 2060 × 0064 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) ÷ [999.0] LATIN SMALL LETTER C (ALetter) × [4.0] WORD JOINER (Format_FE) × [6.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) × [7.0] LATIN SMALL LETTER D (ALetter) × [4.0] WORD JOINER (Format_FE) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+÷ 2060 ÷ 0043 × 2060 × 002E × 2060 × 0064 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) ÷ [999.0] LATIN CAPITAL LETTER C (ALetter) × [4.0] WORD JOINER (Format_FE) × [6.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) × [7.0] LATIN SMALL LETTER D (ALetter) × [4.0] WORD JOINER (Format_FE) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+÷ 2060 ÷ 0063 × 2060 × 002E × 2060 × 0044 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) ÷ [999.0] LATIN SMALL LETTER C (ALetter) × [4.0] WORD JOINER (Format_FE) × [6.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) × [7.0] LATIN CAPITAL LETTER D (ALetter) × [4.0] WORD JOINER (Format_FE) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+÷ 2060 ÷ 0043 × 2060 × 002E × 2060 × 0044 × 2060 × 2060 ÷ # ÷ [0.2] WORD JOINER (Format_FE) ÷ [999.0] LATIN CAPITAL LETTER C (ALetter) × [4.0] WORD JOINER (Format_FE) × [6.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) × [7.0] LATIN CAPITAL LETTER D (ALetter) × [4.0] WORD JOINER (Format_FE) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
÷ 0061 ÷ 1F1E6 ÷ 0062 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) ÷ [999.0] LATIN SMALL LETTER B (ALetter) ÷ [0.3]
÷ 1F1F7 × 1F1FA ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER R (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER U (Regional_Indicator) ÷ [0.3]
÷ 1F1F7 × 1F1FA × 1F1F8 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER R (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER U (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER S (Regional_Indicator) ÷ [0.3]
÷ 1F1F7 × 1F1FA × 1F1F8 × 1F1EA ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER R (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER U (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER S (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER E (Regional_Indicator) ÷ [0.3]
÷ 1F1F7 × 1F1FA ÷ 200B ÷ 1F1F8 × 1F1EA ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER R (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER U (Regional_Indicator) ÷ [999.0] ZERO WIDTH SPACE (Other) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER S (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER E (Regional_Indicator) ÷ [0.3]
+÷ 05D0 × 0022 × 05D0 ÷ # ÷ [0.2] HEBREW LETTER ALEF (Hebrew_Letter) × [7.2] QUOTATION MARK (Double_Quote) × [7.3] HEBREW LETTER ALEF (Hebrew_Letter) ÷ [0.3]
÷ 1F1E6 × 1F1E7 × 1F1E8 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER B (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER C (Regional_Indicator) ÷ [0.3]
÷ 1F1E6 × 200D × 1F1E7 × 1F1E8 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) × [4.0] ZERO WIDTH JOINER (Extend_FE) × [13.3] REGIONAL INDICATOR SYMBOL LETTER B (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER C (Regional_Indicator) ÷ [0.3]
÷ 1F1E6 × 1F1E7 × 200D × 1F1E8 ÷ # ÷ [0.2] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) × [13.3] REGIONAL INDICATOR SYMBOL LETTER B (Regional_Indicator) × [4.0] ZERO WIDTH JOINER (Extend_FE) × [13.3] REGIONAL INDICATOR SYMBOL LETTER C (Regional_Indicator) ÷ [0.3]
÷ 0020 × 200D ÷ 0646 ÷ # ÷ [0.2] SPACE (Other) × [4.0] ZERO WIDTH JOINER (Extend_FE) ÷ [999.0] ARABIC LETTER NOON (ALetter) ÷ [0.3]
÷ 0646 × 200D ÷ 0020 ÷ # ÷ [0.2] ARABIC LETTER NOON (ALetter) × [4.0] ZERO WIDTH JOINER (Extend_FE) ÷ [999.0] SPACE (Other) ÷ [0.3]
+÷ 0031 ÷ 003A ÷ 003A ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 003A ÷ 003A ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 003A ÷ 003A ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 ÷ 003A ÷ 003A ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 003A ÷ 003A ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 003A ÷ 003A ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 ÷ 003A ÷ 002E ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 003A ÷ 002E ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 003A ÷ 002E ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 ÷ 003A ÷ 002E ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 003A ÷ 002E ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 003A ÷ 002E ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 ÷ 003A ÷ 002C ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 003A ÷ 002C ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 003A ÷ 002C ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 ÷ 003A ÷ 002C ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 003A ÷ 002C ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 003A ÷ 002C ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 ÷ 002E ÷ 003A ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002E ÷ 003A ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002E ÷ 003A ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 ÷ 002E ÷ 003A ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002E ÷ 003A ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002E ÷ 003A ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 ÷ 002E ÷ 002E ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002E ÷ 002E ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002E ÷ 002E ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 ÷ 002E ÷ 002E ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002E ÷ 002E ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002E ÷ 002E ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 ÷ 002E ÷ 002C ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002E ÷ 002C ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002E ÷ 002C ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 ÷ 002E ÷ 002C ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002E ÷ 002C ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002E ÷ 002C ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 ÷ 002C ÷ 003A ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002C ÷ 003A ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002C ÷ 003A ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 ÷ 002C ÷ 003A ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002C ÷ 003A ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002C ÷ 003A ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 ÷ 002C ÷ 002E ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002C ÷ 002E ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002C ÷ 002E ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 ÷ 002C ÷ 002E ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002C ÷ 002E ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002C ÷ 002E ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 ÷ 002C ÷ 002C ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002C ÷ 002C ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002C ÷ 002C ÷ 0031 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0031 ÷ 002C ÷ 002C ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0031 ÷ 002C ÷ 002C ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0031 × 005F × 0061 ÷ 002C ÷ 002C ÷ 0061 ÷ # ÷ [0.2] DIGIT ONE (Numeric) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 ÷ 003A ÷ 003A ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 003A ÷ 003A ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 003A ÷ 003A ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 ÷ 003A ÷ 003A ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 003A ÷ 003A ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 003A ÷ 003A ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 ÷ 003A ÷ 002E ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 003A ÷ 002E ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 003A ÷ 002E ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 ÷ 003A ÷ 002E ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 003A ÷ 002E ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 003A ÷ 002E ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 ÷ 003A ÷ 002C ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 003A ÷ 002C ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 003A ÷ 002C ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 ÷ 003A ÷ 002C ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 003A ÷ 002C ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 003A ÷ 002C ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 ÷ 002E ÷ 003A ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002E ÷ 003A ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002E ÷ 003A ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 ÷ 002E ÷ 003A ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002E ÷ 003A ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002E ÷ 003A ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 ÷ 002E ÷ 002E ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002E ÷ 002E ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002E ÷ 002E ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 ÷ 002E ÷ 002E ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002E ÷ 002E ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002E ÷ 002E ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 ÷ 002E ÷ 002C ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002E ÷ 002C ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002E ÷ 002C ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 ÷ 002E ÷ 002C ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002E ÷ 002C ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002E ÷ 002C ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 ÷ 002C ÷ 003A ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002C ÷ 003A ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002C ÷ 003A ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 ÷ 002C ÷ 003A ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002C ÷ 003A ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002C ÷ 003A ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 ÷ 002C ÷ 002E ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002C ÷ 002E ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002C ÷ 002E ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 ÷ 002C ÷ 002E ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002C ÷ 002E ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002C ÷ 002E ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 ÷ 002C ÷ 002C ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002C ÷ 002C ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002C ÷ 002C ÷ 0031 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] DIGIT ONE (Numeric) ÷ [0.3]
+÷ 0061 ÷ 002C ÷ 002C ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0031 ÷ 002C ÷ 002C ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
+÷ 0061 × 005F × 0061 ÷ 002C ÷ 002C ÷ 0061 ÷ # ÷ [0.2] LATIN SMALL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) × [13.2] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [0.3]
#
-# Lines: 1372
+# Lines: 1489
#
# EOF
diff --git a/tests/auto/corelib/tools/qtimeline/BLACKLIST b/tests/auto/corelib/tools/qtimeline/BLACKLIST
new file mode 100644
index 0000000000..b5861756d8
--- /dev/null
+++ b/tests/auto/corelib/tools/qtimeline/BLACKLIST
@@ -0,0 +1,4 @@
+[interpolation]
+windows
+[duration]
+windows
diff --git a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp
index 975ed129fc..b588e1fe82 100644
--- a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp
+++ b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp
@@ -93,29 +93,20 @@ void tst_QTimeLine::range()
QCOMPARE(timeLine.endFrame(), 16);
// Verify that you can change the range in the timeLine
- timeLine.setFrameRange(10, 20);
+ timeLine.setFrameRange(1000, 2000);
QSignalSpy spy(&timeLine, &QTimeLine::frameChanged);
QVERIFY(spy.isValid());
- timeLine.start();
-#ifdef Q_OS_WINCE
- QTest::qWait(1000);
-#else
- QTest::qWait(100);
-#endif
- QCOMPARE(timeLine.state(), QTimeLine::Running);
+ timeLine.start(); // make sure that the logic works for a running timeline
+ QTRY_COMPARE(timeLine.state(), QTimeLine::Running);
+ timeLine.setCurrentTime(timeLine.duration()/2);
int oldValue = timeLine.currentFrame();
- timeLine.setFrameRange(0, 5);
+ timeLine.setFrameRange(0, 500);
QVERIFY(timeLine.currentFrame() < oldValue);
- timeLine.setEndFrame(100);
- timeLine.setStartFrame(50);
+ timeLine.setEndFrame(10000);
+ timeLine.setStartFrame(5000);
QVERIFY(timeLine.currentFrame() > oldValue);
- timeLine.setFrameRange(0, 5);
-#ifdef Q_OS_WINCE
- QTest::qWait(500);
-#else
- QTest::qWait(50);
-#endif
- QVERIFY(spy.count() > 1);
+ timeLine.setFrameRange(0, 500);
+ QTRY_VERIFY(spy.count() > 1);
QVERIFY(timeLine.currentFrame() < oldValue);
}
@@ -123,19 +114,17 @@ void tst_QTimeLine::currentTime()
{
QTimeLine timeLine(2000);
timeLine.setUpdateInterval((timeLine.duration()/2) / 33);
- QSignalSpy spy(&timeLine, &QTimeLine::valueChanged);
- QVERIFY(spy.isValid());
timeLine.setFrameRange(10, 20);
QCOMPARE(timeLine.currentTime(), 0);
timeLine.start();
- QTest::qWait(timeLine.duration()/2);
- QCOMPARE(timeLine.state(), QTimeLine::Running);
- QVERIFY(timeLine.currentTime() > timeLine.duration()/2 - timeLine.duration()/10);
- QVERIFY(timeLine.currentTime() < timeLine.duration()/2 + timeLine.duration()/10);
- QTest::qWait(timeLine.duration()/4 + timeLine.duration());
- QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
+ QTRY_COMPARE(timeLine.state(), QTimeLine::Running);
+ QTRY_VERIFY(timeLine.currentTime() > timeLine.duration()/2 - timeLine.duration()/4);
+ QVERIFY(timeLine.currentTime() < timeLine.duration()/2 + timeLine.duration()/4);
+ QTRY_COMPARE(timeLine.state(), QTimeLine::NotRunning);
QCOMPARE(timeLine.currentTime(), timeLine.duration());
+ QSignalSpy spy(&timeLine, &QTimeLine::valueChanged);
+ QVERIFY(spy.isValid());
spy.clear();
timeLine.setCurrentTime(timeLine.duration()/2);
timeLine.setCurrentTime(timeLine.duration()/2);
@@ -144,24 +133,22 @@ void tst_QTimeLine::currentTime()
QCOMPARE(timeLine.currentTime(), timeLine.duration()/2);
timeLine.resume();
// Let it update on its own
- QTest::qWait(timeLine.duration()/4);
QCOMPARE(timeLine.state(), QTimeLine::Running);
- QVERIFY(timeLine.currentTime() > timeLine.duration()/2);
+ QTRY_VERIFY(timeLine.currentTime() > timeLine.duration()/2);
QVERIFY(timeLine.currentTime() < timeLine.duration());
- QTest::qWait(timeLine.duration()/4 + timeLine.duration());
- QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
- QVERIFY(timeLine.currentTime() == timeLine.duration());
+ QTRY_COMPARE(timeLine.state(), QTimeLine::NotRunning);
+ QCOMPARE(timeLine.currentTime(), timeLine.duration());
// Reverse should decrease the currentTime
timeLine.setCurrentTime(timeLine.duration()/2);
timeLine.start();
// Let it update on its own
- QTest::qWait(timeLine.duration()/4);
- QCOMPARE(timeLine.state(), QTimeLine::Running);
int currentTime = timeLine.currentTime();
+ QTRY_VERIFY(timeLine.currentTime() > currentTime);
+ QCOMPARE(timeLine.state(), QTimeLine::Running);
+ currentTime = timeLine.currentTime();
timeLine.setDirection(QTimeLine::Backward);
- QTest::qWait(timeLine.duration()/4);
- QVERIFY(timeLine.currentTime() < currentTime);
+ QTRY_VERIFY(timeLine.currentTime() < currentTime);
timeLine.stop();
}
@@ -174,11 +161,9 @@ void tst_QTimeLine::duration()
QCOMPARE(timeLine.duration(), 1000);
timeLine.start();
- QTest::qWait(999);
- QCOMPARE(timeLine.state(), QTimeLine::Running);
- QVERIFY(timeLine.currentTime() > 900);
- QTest::qWait(100);
- QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
+ QTRY_COMPARE(timeLine.state(), QTimeLine::Running);
+ QTRY_VERIFY(timeLine.currentTime() > 0);
+ QTRY_COMPARE(timeLine.state(), QTimeLine::NotRunning);
QCOMPARE(timeLine.currentTime(), 1000);
// The duration shouldn't change
QCOMPARE(timeLine.duration(), 1000);
@@ -187,7 +172,7 @@ void tst_QTimeLine::duration()
void tst_QTimeLine::frameRate()
{
QTimeLine timeLine;
- timeLine.setFrameRange(10, 20);
+ timeLine.setFrameRange(100, 2000);
QCOMPARE(timeLine.updateInterval(), 1000 / 25);
timeLine.setUpdateInterval(1000 / 60);
QCOMPARE(timeLine.updateInterval(), 1000 / 60);
@@ -208,36 +193,32 @@ void tst_QTimeLine::frameRate()
timeLine.start();
QTest::qWait(timeLine.duration()*2);
QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
- QVERIFY(slowCount < spy.count());
+ QVERIFY2(slowCount < spy.count(), QByteArray::number(spy.count()));
}
void tst_QTimeLine::value()
{
- QTimeLine timeLine(2000);
- QVERIFY(timeLine.currentValue() == 0.0);
+ QTimeLine timeLine(5000);
+ QCOMPARE(timeLine.currentValue(), 0.0);
// Default speed
QSignalSpy spy(&timeLine, &QTimeLine::valueChanged);
QVERIFY(spy.isValid());
timeLine.start();
- QTest::qWait(timeLine.duration()/3);
- QVERIFY(timeLine.currentValue() > 0);
- QTest::qWait(timeLine.duration());
- QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
- qreal currentValue = timeLine.currentValue();
- QVERIFY(currentValue == 1);
+ QTRY_VERIFY(timeLine.currentValue() > 0);
+ QTRY_COMPARE(timeLine.state(), QTimeLine::NotRunning);
+ QCOMPARE(timeLine.currentValue(), 1.0);
QVERIFY(spy.count() > 0);
// Reverse should decrease the value
timeLine.setCurrentTime(100);
timeLine.start();
// Let it update on its own
- QTest::qWait(500);
QCOMPARE(timeLine.state(), QTimeLine::Running);
+ QTRY_VERIFY(timeLine.currentValue());
qreal value = timeLine.currentValue();
timeLine.setDirection(QTimeLine::Backward);
- QTest::qWait(1000);
- QVERIFY(timeLine.currentValue() < value);
+ QTRY_VERIFY(timeLine.currentValue() < value);
timeLine.stop();
}
@@ -251,22 +232,19 @@ void tst_QTimeLine::currentFrame()
QSignalSpy spy(&timeLine, &QTimeLine::frameChanged);
QVERIFY(spy.isValid());
timeLine.start();
- QTest::qWait(timeLine.duration()/3);
- QVERIFY(timeLine.currentFrame() > 10);
- QTest::qWait(timeLine.duration());
- QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
+ QTRY_VERIFY(timeLine.currentFrame() > 10);
+ QTRY_COMPARE(timeLine.state(), QTimeLine::NotRunning);
QCOMPARE(timeLine.currentFrame(), 20);
// Reverse should decrease the value
timeLine.setCurrentTime(timeLine.duration()/2);
timeLine.start();
// Let it update on its own
- QTest::qWait(timeLine.duration()/4);
QCOMPARE(timeLine.state(), QTimeLine::Running);
+ QTRY_VERIFY(timeLine.currentTime() > timeLine.duration()/2); // wait for continuation
int value = timeLine.currentFrame();
timeLine.setDirection(QTimeLine::Backward);
- QTest::qWait(timeLine.duration()/2);
- QVERIFY(timeLine.currentFrame() < value);
+ QTRY_VERIFY(timeLine.currentFrame() < value);
timeLine.stop();
}
@@ -505,9 +483,8 @@ void tst_QTimeLine::finished()
QSignalSpy spy(&timeLine, &QTimeLine::finished);
QVERIFY(spy.isValid());
timeLine.start();
- QTest::qWait(timeLine.duration()*2);
+ QTRY_COMPARE(spy.count(), 1);
QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
- QCOMPARE(spy.count(), 1);
spy.clear();
timeLine.start();
@@ -606,16 +583,15 @@ void tst_QTimeLine::resume()
{
QCOMPARE(timeLine.currentTime(), 0);
timeLine.start();
- QTest::qWait(250);
+ QTRY_VERIFY(timeLine.currentTime() > 0);
timeLine.stop();
int oldCurrentTime = timeLine.currentTime();
QVERIFY(oldCurrentTime > 0);
QVERIFY(oldCurrentTime < 1000);
timeLine.resume();
- QTest::qWait(250);
+ QTRY_VERIFY(timeLine.currentTime() > oldCurrentTime);
timeLine.stop();
int currentTime = timeLine.currentTime();
- QVERIFY(currentTime > oldCurrentTime);
QVERIFY(currentTime < 1000);
}
timeLine.setDirection(QTimeLine::Backward);
@@ -623,13 +599,13 @@ void tst_QTimeLine::resume()
timeLine.setCurrentTime(1000);
QCOMPARE(timeLine.currentTime(), 1000);
timeLine.start();
- QTest::qWait(250);
+ QTRY_VERIFY(timeLine.currentTime() < 1000);
timeLine.stop();
int oldCurrentTime = timeLine.currentTime();
QVERIFY(oldCurrentTime < 1000);
QVERIFY(oldCurrentTime > 0);
timeLine.resume();
- QTest::qWait(250);
+ QTRY_VERIFY(timeLine.currentTime() < oldCurrentTime);
timeLine.stop();
int currentTime = timeLine.currentTime();
QVERIFY(currentTime < oldCurrentTime);
@@ -643,8 +619,7 @@ void tst_QTimeLine::restart()
timeLine.setFrameRange(0,9);
timeLine.start();
- QTest::qWait(timeLine.duration()*2);
- QCOMPARE(timeLine.currentFrame(), timeLine.endFrame());
+ QTRY_COMPARE(timeLine.currentFrame(), timeLine.endFrame());
QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
// A restart with the same duration
@@ -652,8 +627,7 @@ void tst_QTimeLine::restart()
QCOMPARE(timeLine.state(), QTimeLine::Running);
QCOMPARE(timeLine.currentFrame(), timeLine.startFrame());
QCOMPARE(timeLine.currentTime(), 0);
- QTest::qWait(250);
- QCOMPARE(timeLine.currentFrame(), timeLine.endFrame());
+ QTRY_COMPARE(timeLine.currentFrame(), timeLine.endFrame());
QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
// Set a smaller duration and restart
@@ -662,8 +636,7 @@ void tst_QTimeLine::restart()
QCOMPARE(timeLine.state(), QTimeLine::Running);
QCOMPARE(timeLine.currentFrame(), timeLine.startFrame());
QCOMPARE(timeLine.currentTime(), 0);
- QTest::qWait(250);
- QCOMPARE(timeLine.currentFrame(), timeLine.endFrame());
+ QTRY_COMPARE(timeLine.currentFrame(), timeLine.endFrame());
QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
// Set a longer duration and restart
diff --git a/tests/auto/corelib/tools/qtimezone/BLACKLIST b/tests/auto/corelib/tools/qtimezone/BLACKLIST
new file mode 100644
index 0000000000..665e78bc08
--- /dev/null
+++ b/tests/auto/corelib/tools/qtimezone/BLACKLIST
@@ -0,0 +1,2 @@
+[tzTest]
+opensuse-13.1
diff --git a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp
index 94d81e0a5a..82f78b2b0b 100644
--- a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp
+++ b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp
@@ -47,10 +47,12 @@ private slots:
void appendCausingRealloc();
void resize();
void realloc();
+ void reverseIterators();
void count();
void first();
void last();
void squeeze();
+ void operators();
void indexOf();
void lastIndexOf();
void contains();
@@ -563,6 +565,21 @@ void tst_QVarLengthArray::realloc()
QVERIFY(reallocTestProceed);
}
+void tst_QVarLengthArray::reverseIterators()
+{
+ QVarLengthArray<int> v;
+ v << 1 << 2 << 3 << 4;
+ QVarLengthArray<int> vr = v;
+ std::reverse(vr.begin(), vr.end());
+ const QVarLengthArray<int> &cvr = vr;
+ QVERIFY(std::equal(v.begin(), v.end(), vr.rbegin()));
+ QVERIFY(std::equal(v.begin(), v.end(), vr.crbegin()));
+ QVERIFY(std::equal(v.begin(), v.end(), cvr.rbegin()));
+ QVERIFY(std::equal(vr.rbegin(), vr.rend(), v.begin()));
+ QVERIFY(std::equal(vr.crbegin(), vr.crend(), v.begin()));
+ QVERIFY(std::equal(cvr.rbegin(), cvr.rend(), v.begin()));
+}
+
void tst_QVarLengthArray::count()
{
// tests size(), count() and length(), since they're the same thing
@@ -691,6 +708,49 @@ void tst_QVarLengthArray::squeeze()
QCOMPARE(list.capacity(), sizeOnHeap);
}
+void tst_QVarLengthArray::operators()
+{
+ QVarLengthArray<QString> myvla;
+ myvla << "A" << "B" << "C";
+ QVarLengthArray<QString> myvlatwo;
+ myvlatwo << "D" << "E" << "F";
+ QVarLengthArray<QString> combined;
+ combined << "A" << "B" << "C" << "D" << "E" << "F";
+
+ // !=
+ QVERIFY(myvla != myvlatwo);
+
+ // +=: not provided, emulate
+ //myvla += myvlatwo;
+ Q_FOREACH (const QString &s, myvlatwo)
+ myvla.push_back(s);
+ QCOMPARE(myvla, combined);
+
+ // ==
+ QVERIFY(myvla == combined);
+
+ // <, >, <=, >=
+ QVERIFY(!(myvla < combined));
+ QVERIFY(!(myvla > combined));
+ QVERIFY( myvla <= combined);
+ QVERIFY( myvla >= combined);
+ combined.push_back("G");
+ QVERIFY( myvla < combined);
+ QVERIFY(!(myvla > combined));
+ QVERIFY( myvla <= combined);
+ QVERIFY(!(myvla >= combined));
+ QVERIFY(combined > myvla);
+ QVERIFY(combined >= myvla);
+
+ // []
+ QCOMPARE(myvla[0], QLatin1String("A"));
+ QCOMPARE(myvla[1], QLatin1String("B"));
+ QCOMPARE(myvla[2], QLatin1String("C"));
+ QCOMPARE(myvla[3], QLatin1String("D"));
+ QCOMPARE(myvla[4], QLatin1String("E"));
+ QCOMPARE(myvla[5], QLatin1String("F"));
+}
+
void tst_QVarLengthArray::indexOf()
{
QVarLengthArray<QString> myvec;
diff --git a/tests/auto/corelib/tools/qvector/qvector.pro b/tests/auto/corelib/tools/qvector/qvector.pro
index 22edde3412..c1e0564915 100644
--- a/tests/auto/corelib/tools/qvector/qvector.pro
+++ b/tests/auto/corelib/tools/qvector/qvector.pro
@@ -1,4 +1,5 @@
CONFIG += testcase parallel_test
+contains(QT_CONFIG, c++11):CONFIG += c++11
TARGET = tst_qvector
QT = core testlib
SOURCES = $$PWD/tst_qvector.cpp
diff --git a/tests/auto/corelib/tools/qvector/tst_qvector.cpp b/tests/auto/corelib/tools/qvector/tst_qvector.cpp
index 69da6e450e..87822bca6f 100644
--- a/tests/auto/corelib/tools/qvector/tst_qvector.cpp
+++ b/tests/auto/corelib/tools/qvector/tst_qvector.cpp
@@ -86,6 +86,8 @@ private:
}
};
+inline uint qHash(const Movable &key, uint seed = 0) { return qHash(key.i, seed); }
+
QAtomicInt Movable::counter = 0;
QT_BEGIN_NAMESPACE
Q_DECLARE_TYPEINFO(Movable, Q_MOVABLE_TYPE);
@@ -123,6 +125,13 @@ struct Custom {
return i == other.i;
}
+ bool operator<(const Custom &other) const
+ {
+ check(&other);
+ check(this);
+ return i < other.i;
+ }
+
Custom &operator=(const Custom &other)
{
check(&other);
@@ -148,6 +157,8 @@ private:
};
QAtomicInt Custom::counter = 0;
+inline uint qHash(const Custom &key, uint seed = 0) { return qHash(key.i, seed); }
+
Q_DECLARE_METATYPE(Custom);
// tests depends on the fact that:
@@ -179,6 +190,7 @@ private slots:
void appendInt() const;
void appendMovable() const;
void appendCustom() const;
+ void appendRvalue() const;
void at() const;
void capacityInt() const;
void capacityMovable() const;
@@ -187,6 +199,8 @@ private slots:
void clearMovable() const;
void clearCustom() const;
void constData() const;
+ void constFirst() const;
+ void constLast() const;
void contains() const;
void countInt() const;
void countMovable() const;
@@ -227,9 +241,15 @@ private slots:
void last() const;
void lastIndexOf() const;
void mid() const;
+ void moveInt() const;
+ void moveMovable() const;
+ void moveCustom() const;
void prependInt() const;
void prependMovable() const;
void prependCustom() const;
+ void qhashInt() const { qhash<int>(); }
+ void qhashMovable() const { qhash<Movable>(); }
+ void qhashCustom() const { qhash<Custom>(); }
void removeInt() const;
void removeMovable() const;
void removeCustom() const;
@@ -241,6 +261,7 @@ private slots:
void resizeComplex_data() const;
void resizeComplex() const;
void resizeCtorAndDtor() const;
+ void reverseIterators() const;
void sizeInt() const;
void sizeMovable() const;
void sizeCustom() const;
@@ -294,6 +315,8 @@ private:
template<typename T> void fill() const;
template<typename T> void fromList() const;
template<typename T> void insert() const;
+ template<typename T> void qhash() const;
+ template<typename T> void move() const;
template<typename T> void prepend() const;
template<typename T> void remove() const;
template<typename T> void size() const;
@@ -332,6 +355,14 @@ const Movable SimpleValue<Movable>::Values[] = { 110, 105, 101, 114, 111, 98 };
template<>
const Custom SimpleValue<Custom>::Values[] = { 110, 105, 101, 114, 111, 98 };
+// Make some macros for the tests to use in order to be slightly more readable...
+#define T_FOO SimpleValue<T>::at(0)
+#define T_BAR SimpleValue<T>::at(1)
+#define T_BAZ SimpleValue<T>::at(2)
+#define T_CAT SimpleValue<T>::at(3)
+#define T_DOG SimpleValue<T>::at(4)
+#define T_BLAH SimpleValue<T>::at(5)
+
void tst_QVector::constructors_empty() const
{
QVector<int> emptyInt;
@@ -608,6 +639,21 @@ void tst_QVector::appendCustom() const
QCOMPARE(instancesCount, Custom::counter.loadAcquire());
}
+void tst_QVector::appendRvalue() const
+{
+#ifdef Q_COMPILER_RVALUE_REFS
+ QVector<QString> v;
+ v.append("hello");
+ QString world = "world";
+ v.append(std::move(world));
+ QVERIFY(world.isEmpty());
+ QCOMPARE(v.front(), QString("hello"));
+ QCOMPARE(v.back(), QString("world"));
+#else
+ QSKIP("This test requires that C++11 move semantics support is enabled in the compiler");
+#endif
+}
+
void tst_QVector::at() const
{
QVector<QString> myvec;
@@ -1206,16 +1252,86 @@ void tst_QVector::first() const
// test it starts ok
QCOMPARE(myvec.first(), 69);
+ QCOMPARE(myvec.constFirst(), 69);
// test removal changes
myvec.remove(0);
QCOMPARE(myvec.first(), 42);
+ QCOMPARE(myvec.constFirst(), 42);
// test prepend changes
myvec.prepend(23);
QCOMPARE(myvec.first(), 23);
+ QCOMPARE(myvec.constFirst(), 23);
+}
+
+void tst_QVector::constFirst() const
+{
+ QVector<int> myvec;
+ myvec << 69 << 42 << 3;
+
+ // test it starts ok
+ QCOMPARE(myvec.constFirst(), 69);
+ QVERIFY(myvec.isDetached());
+
+ QVector<int> myvecCopy = myvec;
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
+
+ QCOMPARE(myvec.constFirst(), 69);
+ QCOMPARE(myvecCopy.constFirst(), 69);
+
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
+
+ // test removal changes
+ myvec.remove(0);
+ QVERIFY(myvec.isDetached());
+ QVERIFY(!myvec.isSharedWith(myvecCopy));
+ QCOMPARE(myvec.constFirst(), 42);
+ QCOMPARE(myvecCopy.constFirst(), 69);
+
+ myvecCopy = myvec;
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
+
+ QCOMPARE(myvec.constFirst(), 42);
+ QCOMPARE(myvecCopy.constFirst(), 42);
+
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
+
+ // test prepend changes
+ myvec.prepend(23);
+ QVERIFY(myvec.isDetached());
+ QVERIFY(!myvec.isSharedWith(myvecCopy));
+ QCOMPARE(myvec.constFirst(), 23);
+ QCOMPARE(myvecCopy.constFirst(), 42);
+
+ myvecCopy = myvec;
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
+
+ QCOMPARE(myvec.constFirst(), 23);
+ QCOMPARE(myvecCopy.constFirst(), 23);
+
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
}
+
template<typename T>
void tst_QVector::fromList() const
{
@@ -1393,14 +1509,83 @@ void tst_QVector::last() const
// test starts ok
QCOMPARE(myvec.last(), QLatin1String("C"));
+ QCOMPARE(myvec.constLast(), QLatin1String("C"));
// test it changes ok
myvec.append(QLatin1String("X"));
QCOMPARE(myvec.last(), QLatin1String("X"));
+ QCOMPARE(myvec.constLast(), QLatin1String("X"));
// and remove again
myvec.remove(3);
QCOMPARE(myvec.last(), QLatin1String("C"));
+ QCOMPARE(myvec.constLast(), QLatin1String("C"));
+}
+
+void tst_QVector::constLast() const
+{
+ QVector<int> myvec;
+ myvec << 69 << 42 << 3;
+
+ // test it starts ok
+ QCOMPARE(myvec.constLast(), 3);
+ QVERIFY(myvec.isDetached());
+
+ QVector<int> myvecCopy = myvec;
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
+
+ QCOMPARE(myvec.constLast(), 3);
+ QCOMPARE(myvecCopy.constLast(), 3);
+
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
+
+ // test removal changes
+ myvec.removeLast();
+ QVERIFY(myvec.isDetached());
+ QVERIFY(!myvec.isSharedWith(myvecCopy));
+ QCOMPARE(myvec.constLast(), 42);
+ QCOMPARE(myvecCopy.constLast(), 3);
+
+ myvecCopy = myvec;
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
+
+ QCOMPARE(myvec.constLast(), 42);
+ QCOMPARE(myvecCopy.constLast(), 42);
+
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
+
+ // test prepend changes
+ myvec.append(23);
+ QVERIFY(myvec.isDetached());
+ QVERIFY(!myvec.isSharedWith(myvecCopy));
+ QCOMPARE(myvec.constLast(), 23);
+ QCOMPARE(myvecCopy.constLast(), 42);
+
+ myvecCopy = myvec;
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
+
+ QCOMPARE(myvec.constLast(), 23);
+ QCOMPARE(myvecCopy.constLast(), 23);
+
+ QVERIFY(!myvec.isDetached());
+ QVERIFY(!myvecCopy.isDetached());
+ QVERIFY(myvec.isSharedWith(myvecCopy));
+ QVERIFY(myvecCopy.isSharedWith(myvec));
}
void tst_QVector::lastIndexOf() const
@@ -1437,6 +1622,54 @@ void tst_QVector::mid() const
QCOMPARE(list.mid(4), QVector<QString>() << "buck" << "hello" << "kitty");
}
+template <typename T>
+void tst_QVector::qhash() const
+{
+ QVector<T> l1, l2;
+ QCOMPARE(qHash(l1), qHash(l2));
+ l1 << SimpleValue<T>::at(0);
+ l2 << SimpleValue<T>::at(0);
+ QCOMPARE(qHash(l1), qHash(l2));
+}
+
+template <typename T>
+void tst_QVector::move() const
+{
+ QVector<T> list;
+ list << T_FOO << T_BAR << T_BAZ;
+
+ // move an item
+ list.move(0, list.count() - 1);
+ QCOMPARE(list, QVector<T>() << T_BAR << T_BAZ << T_FOO);
+
+ // move it back
+ list.move(list.count() - 1, 0);
+ QCOMPARE(list, QVector<T>() << T_FOO << T_BAR << T_BAZ);
+
+ // move an item in the middle
+ list.move(1, 0);
+ QCOMPARE(list, QVector<T>() << T_BAR << T_FOO << T_BAZ);
+}
+
+void tst_QVector::moveInt() const
+{
+ move<int>();
+}
+
+void tst_QVector::moveMovable() const
+{
+ const int instancesCount = Movable::counter.loadAcquire();
+ move<Movable>();
+ QCOMPARE(instancesCount, Movable::counter.loadAcquire());
+}
+
+void tst_QVector::moveCustom() const
+{
+ const int instancesCount = Custom::counter.loadAcquire();
+ move<Custom>();
+ QCOMPARE(instancesCount, Custom::counter.loadAcquire());
+}
+
template<typename T>
void tst_QVector::prepend() const
{
@@ -1907,6 +2140,21 @@ void tst_QVector::resizeCtorAndDtor() const
QCOMPARE(Custom::counter.loadAcquire(), items);
}
+void tst_QVector::reverseIterators() const
+{
+ QVector<int> v;
+ v << 1 << 2 << 3 << 4;
+ QVector<int> vr = v;
+ std::reverse(vr.begin(), vr.end());
+ const QVector<int> &cvr = vr;
+ QVERIFY(std::equal(v.begin(), v.end(), vr.rbegin()));
+ QVERIFY(std::equal(v.begin(), v.end(), vr.crbegin()));
+ QVERIFY(std::equal(v.begin(), v.end(), cvr.rbegin()));
+ QVERIFY(std::equal(vr.rbegin(), vr.rend(), v.begin()));
+ QVERIFY(std::equal(vr.crbegin(), vr.crend(), v.begin()));
+ QVERIFY(std::equal(cvr.rbegin(), cvr.rend(), v.begin()));
+}
+
template<typename T>
void tst_QVector::size() const
{
@@ -2076,6 +2324,19 @@ void tst_QVector::testOperators() const
// ==
QVERIFY(myvec == combined);
+ // <, >, <=, >=
+ QVERIFY(!(myvec < combined));
+ QVERIFY(!(myvec > combined));
+ QVERIFY( myvec <= combined);
+ QVERIFY( myvec >= combined);
+ combined.push_back("G");
+ QVERIFY( myvec < combined);
+ QVERIFY(!(myvec > combined));
+ QVERIFY( myvec <= combined);
+ QVERIFY(!(myvec >= combined));
+ QVERIFY(combined > myvec);
+ QVERIFY(combined >= myvec);
+
// []
QCOMPARE(myvec[0], QLatin1String("A"));
QCOMPARE(myvec[1], QLatin1String("B"));
diff --git a/tests/auto/corelib/tools/qversionnumber/qversionnumber.pro b/tests/auto/corelib/tools/qversionnumber/qversionnumber.pro
index 1e74d42bbd..e83a2b507c 100644
--- a/tests/auto/corelib/tools/qversionnumber/qversionnumber.pro
+++ b/tests/auto/corelib/tools/qversionnumber/qversionnumber.pro
@@ -1,4 +1,6 @@
CONFIG += testcase parallel_test
+contains(QT_CONFIG, c++11):CONFIG += c++11
+contains(QT_CONFIG, c++14):CONFIG += c++14
TARGET = tst_qversionnumber
-QT = core-private testlib
+QT = core testlib
SOURCES = tst_qversionnumber.cpp
diff --git a/tests/auto/corelib/tools/qversionnumber/tst_qversionnumber.cpp b/tests/auto/corelib/tools/qversionnumber/tst_qversionnumber.cpp
index 4202b87b2d..0b8b63a1e8 100644
--- a/tests/auto/corelib/tools/qversionnumber/tst_qversionnumber.cpp
+++ b/tests/auto/corelib/tools/qversionnumber/tst_qversionnumber.cpp
@@ -33,7 +33,7 @@
****************************************************************************/
#include <QtTest/QtTest>
-#include <private/qversionnumber_p.h>
+#include <QtCore/qversionnumber.h>
class tst_QVersionNumber : public QObject
{
diff --git a/tests/auto/corelib/tools/tools.pro b/tests/auto/corelib/tools/tools.pro
index 9024a1a1bb..f9e1c454e7 100644
--- a/tests/auto/corelib/tools/tools.pro
+++ b/tests/auto/corelib/tools/tools.pro
@@ -24,6 +24,7 @@ SUBDIRS=\
qhash \
qhash_strictiterators \
qhashfunctions \
+ qlatin1string \
qline \
qlinkedlist \
qlist \
diff --git a/tests/auto/dbus/dbus.pro b/tests/auto/dbus/dbus.pro
index cd845d7043..67cbc4bfef 100644
--- a/tests/auto/dbus/dbus.pro
+++ b/tests/auto/dbus/dbus.pro
@@ -1,9 +1,16 @@
TEMPLATE=subdirs
+
+# Run this test first
SUBDIRS=\
+ qdbusconnection_delayed
+
+SUBDIRS+=\
qdbusabstractadaptor \
qdbusabstractinterface \
qdbusconnection \
+ qdbusconnection_no_app \
qdbusconnection_no_bus \
+ qdbusconnection_no_libdbus \
qdbuscontext \
qdbusinterface \
qdbuslocalcalls \
@@ -16,7 +23,7 @@ SUBDIRS=\
qdbusservicewatcher \
qdbustype \
qdbusthreading \
- qdbusxmlparser \
+ qdbusxmlparser
!contains(QT_CONFIG,private_tests): SUBDIRS -= \
qdbusmarshall \
diff --git a/tests/auto/dbus/qdbusabstractadaptor/BLACKLIST b/tests/auto/dbus/qdbusabstractadaptor/BLACKLIST
new file mode 100644
index 0000000000..d3d970f4f4
--- /dev/null
+++ b/tests/auto/dbus/qdbusabstractadaptor/BLACKLIST
@@ -0,0 +1,2 @@
+[overloadedSignalEmission]
+linux
diff --git a/tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp b/tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp
index e51d03c811..d26af847cf 100644
--- a/tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp
+++ b/tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp
@@ -346,7 +346,7 @@ void syncPeer()
// wait for the sync signal with the right ID
QEventLoop loop;
QDBusConnection con("peer");
- con.connect(serviceName, objectPath, interfaceName, "syncReceived",
+ con.connect(QString(), objectPath, interfaceName, "syncReceived",
QStringList() << reqId, QString(), &loop, SLOT(quit()));
QDBusMessage req = QDBusMessage::createMethodCall(serviceName, objectPath, interfaceName, "requestSync");
diff --git a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp
index 403e500d8c..cd23f2cb47 100644
--- a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp
+++ b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp
@@ -1012,8 +1012,14 @@ void tst_QDBusAbstractInterface::followSignal()
QVERIFY(!con.interface()->isServiceRegistered(serviceToFollow));
Pinger control = getPinger("");
- // we need to connect the signal somewhere in order for D-Bus to enable the rules
- QTestEventLoop::instance().connect(p.data(), SIGNAL(voidSignal()), SLOT(exitLoop()));
+ // connect our test signal
+ // FRAGILE CODE AHEAD:
+ // Connection order is important: we connect the control first because that
+ // needs to be delivered last, to ensure that we don't exitLoop() before
+ // the signal delivery to QSignalSpy is posted to the current thread. That
+ // happens because QDBusConnectionPrivate runs in a separate thread and
+ // uses a QMultiHash and insertMulti prepends to the list of items with the
+ // same key.
QTestEventLoop::instance().connect(control.data(), SIGNAL(voidSignal()), SLOT(exitLoop()));
QSignalSpy s(p.data(), SIGNAL(voidSignal()));
diff --git a/tests/auto/dbus/qdbusconnection/qdbusconnection.pro b/tests/auto/dbus/qdbusconnection/qdbusconnection.pro
index 2fd62a234b..83ae29de0a 100644
--- a/tests/auto/dbus/qdbusconnection/qdbusconnection.pro
+++ b/tests/auto/dbus/qdbusconnection/qdbusconnection.pro
@@ -2,4 +2,5 @@ CONFIG += testcase
TARGET = tst_qdbusconnection
QT = core dbus testlib
SOURCES += tst_qdbusconnection.cpp
+HEADERS += tst_qdbusconnection.h
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
index 32c228c186..e91f87d6c8 100644
--- a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
+++ b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -30,34 +31,15 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
+#include "tst_qdbusconnection.h"
+
#include <qcoreapplication.h>
#include <qdebug.h>
#include <QtTest/QtTest>
#include <QtDBus/QtDBus>
-class BaseObject: public QObject
-{
- Q_OBJECT
- Q_CLASSINFO("D-Bus Interface", "local.BaseObject")
-public:
- BaseObject(QObject *parent = 0) : QObject(parent) { }
-public slots:
- void anotherMethod() { }
-};
-
-class MyObject: public BaseObject
-{
- Q_OBJECT
-public slots:
- void method(const QDBusMessage &msg);
-
-public:
- static QString path;
- int callCount;
- MyObject(QObject *parent = 0) : BaseObject(parent), callCount(0) {}
-};
-
void MyObject::method(const QDBusMessage &msg)
{
path = msg.path();
@@ -65,19 +47,6 @@ void MyObject::method(const QDBusMessage &msg)
//qDebug() << msg;
}
-class MyObjectWithoutInterface: public QObject
-{
- Q_OBJECT
-public slots:
- void method(const QDBusMessage &msg);
-
-public:
- static QString path;
- static QString interface;
- int callCount;
- MyObjectWithoutInterface(QObject *parent = 0) : QObject(parent), callCount(0) {}
-};
-
void MyObjectWithoutInterface::method(const QDBusMessage &msg)
{
path = msg.path();
@@ -86,70 +55,6 @@ void MyObjectWithoutInterface::method(const QDBusMessage &msg)
//qDebug() << msg;
}
-class tst_QDBusConnection: public QObject
-{
- Q_OBJECT
-
- int signalsReceived;
-public slots:
- void oneSlot() { ++signalsReceived; }
- void exitLoop() { ++signalsReceived; QTestEventLoop::instance().exitLoop(); }
- void secondCallWithCallback();
-
-private slots:
- void noConnection();
- void connectToBus();
- void connectToPeer();
- void connect();
- void send();
- void sendWithGui();
- void sendAsync();
- void sendSignal();
-
- void registerObject_data();
- void registerObject();
- void registerObjectWithInterface_data();
- void registerObjectWithInterface();
- void registerObjectPeer_data();
- void registerObjectPeer();
- void registerObject2();
- void registerObjectPeer2();
-
- void registerQObjectChildren();
- void registerQObjectChildrenPeer();
-
- void callSelf();
- void callSelfByAnotherName_data();
- void callSelfByAnotherName();
- void multipleInterfacesInQObject();
-
- void slotsWithLessParameters();
- void nestedCallWithCallback();
-
- void serviceRegistrationRaceCondition();
-
- void registerVirtualObject();
- void callVirtualObject();
- void callVirtualObjectLocal();
-
-public:
- QString serviceName() const { return "org.qtproject.Qt.Autotests.QDBusConnection"; }
- bool callMethod(const QDBusConnection &conn, const QString &path);
- bool callMethod(const QDBusConnection &conn, const QString &path, const QString &interface);
- bool callMethodPeer(const QDBusConnection &conn, const QString &path);
-};
-
-class QDBusSpy: public QObject
-{
- Q_OBJECT
-public slots:
- void handlePing(const QString &str) { args.clear(); args << str; }
- void asyncReply(const QDBusMessage &msg) { args = msg.arguments(); }
-
-public:
- QList<QVariant> args;
-};
-
void tst_QDBusConnection::noConnection()
{
QDBusConnection con = QDBusConnection::connectToBus("unix:path=/dev/null", "testconnection");
@@ -185,8 +90,55 @@ void tst_QDBusConnection::sendSignal()
msg << QLatin1String("ping");
QVERIFY(con.send(msg));
+}
+
+void tst_QDBusConnection::sendSignalToName()
+{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication"); // because of the qWait()
+
+ QDBusSpy spy;
+
+ QDBusConnection con = QDBusConnection::sessionBus();
+
+ con.connect(con.baseService(), "/org/kde/selftest", "org.kde.selftest", "ping", &spy,
+ SLOT(handlePing(QString)));
+
+ QDBusMessage msg =
+ QDBusMessage::createTargetedSignal(con.baseService(), "/org/kde/selftest",
+ "org.kde.selftest", "ping");
+ msg << QLatin1String("ping");
+
+ QVERIFY(con.send(msg));
+
+ QTest::qWait(1000);
+
+ QCOMPARE(spy.args.count(), 1);
+ QCOMPARE(spy.args.at(0).toString(), QString("ping"));
+}
+
+void tst_QDBusConnection::sendSignalToOtherName()
+{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication"); // because of the qWait()
+
+ QDBusSpy spy;
+
+ QDBusConnection con = QDBusConnection::sessionBus();
+
+ con.connect(con.baseService(), "/org/kde/selftest", "org.kde.selftest", "ping", &spy,
+ SLOT(handlePing(QString)));
+
+ QDBusMessage msg =
+ QDBusMessage::createTargetedSignal("some.other.service", "/org/kde/selftest",
+ "org.kde.selftest", "ping");
+ msg << QLatin1String("ping");
+
+ QVERIFY(con.send(msg));
QTest::qWait(1000);
+
+ QCOMPARE(spy.args.count(), 0);
}
void tst_QDBusConnection::send()
@@ -207,6 +159,9 @@ void tst_QDBusConnection::send()
void tst_QDBusConnection::sendWithGui()
{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication");
+
QDBusConnection con = QDBusConnection::sessionBus();
QVERIFY(con.isConnected());
@@ -223,6 +178,9 @@ void tst_QDBusConnection::sendWithGui()
void tst_QDBusConnection::sendAsync()
{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication");
+
QDBusConnection con = QDBusConnection::sessionBus();
QVERIFY(con.isConnected());
@@ -244,6 +202,9 @@ void tst_QDBusConnection::connect()
QDBusConnection con = QDBusConnection::sessionBus();
+ if (!QCoreApplication::instance())
+ return; // cannot receive signals in this thread without QCoreApplication
+
con.connect(con.baseService(), "/org/kde/selftest", "org.kde.selftest", "ping", &spy,
SLOT(handlePing(QString)));
@@ -437,58 +398,6 @@ void tst_QDBusConnection::registerObjectWithInterface()
QVERIFY(!callMethod(con, path, interface));
}
-class MyServer : public QDBusServer
-{
- Q_OBJECT
-public:
- MyServer(QString path) : m_path(path), m_connections()
- {
- connect(this, SIGNAL(newConnection(QDBusConnection)), SLOT(handleConnection(QDBusConnection)));
- }
-
- bool registerObject(const QDBusConnection& c)
- {
- QDBusConnection conn(c);
- if (!conn.registerObject(m_path, &m_obj, QDBusConnection::ExportAllSlots))
- return false;
- if (!(conn.objectRegisteredAt(m_path) == &m_obj))
- return false;
- return true;
- }
-
- bool registerObject()
- {
- Q_FOREACH (const QString &name, m_connections) {
- if (!registerObject(QDBusConnection(name)))
- return false;
- }
- return true;
- }
-
- void unregisterObject()
- {
- Q_FOREACH (const QString &name, m_connections) {
- QDBusConnection c(name);
- c.unregisterObject(m_path);
- }
- }
-
-public slots:
- void handleConnection(const QDBusConnection& c)
- {
- m_connections << c.name();
- QVERIFY(isConnected());
- QVERIFY(c.isConnected());
- QVERIFY(registerObject(c));
- }
-
-private:
- MyObject m_obj;
- QString m_path;
- QStringList m_connections;
-};
-
-
void tst_QDBusConnection::registerObjectPeer_data()
{
QTest::addColumn<QString>("path");
@@ -502,16 +411,22 @@ void tst_QDBusConnection::registerObjectPeer_data()
void tst_QDBusConnection::registerObjectPeer()
{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication");
+
QFETCH(QString, path);
MyServer server(path);
QDBusConnection::connectToPeer(server.address(), "beforeFoo");
+ QTestEventLoop::instance().enterLoop(2);
+ QVERIFY(!QTestEventLoop::instance().timeout());
{
QDBusConnection con = QDBusConnection::connectToPeer(server.address(), "foo");
- QCoreApplication::processEvents();
+ QTestEventLoop::instance().enterLoop(2);
+ QVERIFY(!QTestEventLoop::instance().timeout());
QVERIFY(con.isConnected());
MyObject obj;
@@ -520,6 +435,7 @@ void tst_QDBusConnection::registerObjectPeer()
}
QDBusConnection::connectToPeer(server.address(), "afterFoo");
+ QTestEventLoop::instance().enterLoop(2);
{
QDBusConnection con("foo");
@@ -572,7 +488,6 @@ void tst_QDBusConnection::registerObject2()
MyObject obj;
QVERIFY(con.registerObject("/", &obj, QDBusConnection::ExportAllSlots));
QVERIFY(callMethod(con, "/"));
- qDebug() << obj.path;
QCOMPARE(obj.path, QString("/"));
}
// make sure it's gone
@@ -584,7 +499,6 @@ void tst_QDBusConnection::registerObject2()
QVERIFY(con.registerObject("/p1", &obj, QDBusConnection::ExportAllSlots));
QVERIFY(!callMethod(con, "/"));
QVERIFY(callMethod(con, "/p1"));
- qDebug() << obj.path;
QCOMPARE(obj.path, QString("/p1"));
// re-register it somewhere else
@@ -648,38 +562,15 @@ void tst_QDBusConnection::registerObject2()
}
}
-class MyServer2 : public QDBusServer
-{
- Q_OBJECT
-public:
- MyServer2() : m_conn("none")
- {
- connect(this, SIGNAL(newConnection(QDBusConnection)), SLOT(handleConnection(QDBusConnection)));
- }
-
- QDBusConnection connection()
- {
- return m_conn;
- }
-
-public slots:
- void handleConnection(const QDBusConnection& c)
- {
- m_conn = c;
- QVERIFY(isConnected());
- QVERIFY(m_conn.isConnected());
- }
-
-private:
- MyObject m_obj;
- QDBusConnection m_conn;
-};
-
void tst_QDBusConnection::registerObjectPeer2()
{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication");
+
MyServer2 server;
QDBusConnection con = QDBusConnection::connectToPeer(server.address(), "foo");
- QCoreApplication::processEvents();
+ QTestEventLoop::instance().enterLoop(2);
+ QVERIFY(!QTestEventLoop::instance().timeout());
QVERIFY(con.isConnected());
QDBusConnection srv_con = server.connection();
@@ -696,7 +587,6 @@ void tst_QDBusConnection::registerObjectPeer2()
MyObject obj;
QVERIFY(con.registerObject("/", &obj, QDBusConnection::ExportAllSlots));
QVERIFY(callMethodPeer(srv_con, "/"));
- qDebug() << obj.path;
QCOMPARE(obj.path, QString("/"));
}
// make sure it's gone
@@ -708,7 +598,6 @@ void tst_QDBusConnection::registerObjectPeer2()
QVERIFY(con.registerObject("/p1", &obj, QDBusConnection::ExportAllSlots));
QVERIFY(!callMethodPeer(srv_con, "/"));
QVERIFY(callMethodPeer(srv_con, "/p1"));
- qDebug() << obj.path;
QCOMPARE(obj.path, QString("/p1"));
// re-register it somewhere else
@@ -832,8 +721,13 @@ void tst_QDBusConnection::registerQObjectChildren()
void tst_QDBusConnection::registerQObjectChildrenPeer()
{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication");
+
MyServer2 server;
QDBusConnection con = QDBusConnection::connectToPeer(server.address(), "foo");
+ QTestEventLoop::instance().enterLoop(2);
+ QVERIFY(!QTestEventLoop::instance().timeout());
QCoreApplication::processEvents();
QVERIFY(con.isConnected());
@@ -923,22 +817,6 @@ bool tst_QDBusConnection::callMethodPeer(const QDBusConnection &conn, const QStr
return (MyObject::path == path);
}
-class TestObject : public QObject
-{
-Q_OBJECT
-public:
- TestObject(QObject *parent = 0) : QObject(parent) {}
- ~TestObject() {}
-
- QString func;
-
-public slots:
- void test0() { func = "test0"; }
- void test1(int i) { func = "test1 " + QString::number(i); }
- int test2() { func = "test2"; return 43; }
- int test3(int i) { func = "test2"; return i + 1; }
-};
-
void tst_QDBusConnection::callSelf()
{
TestObject testObject;
@@ -975,6 +853,9 @@ void tst_QDBusConnection::callSelfByAnotherName_data()
void tst_QDBusConnection::callSelfByAnotherName()
{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication");
+
static int counter = 0;
QString sname = serviceName() + QString::number(counter++);
@@ -1047,6 +928,9 @@ void tst_QDBusConnection::multipleInterfacesInQObject()
void tst_QDBusConnection::slotsWithLessParameters()
{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication");
+
QDBusConnection con = QDBusConnection::sessionBus();
QDBusMessage signal = QDBusMessage::createSignal("/", "org.qtproject.TestCase",
@@ -1073,7 +957,6 @@ void tst_QDBusConnection::slotsWithLessParameters()
void tst_QDBusConnection::secondCallWithCallback()
{
- qDebug("Hello");
QDBusConnection con = QDBusConnection::sessionBus();
QDBusMessage msg = QDBusMessage::createMethodCall(con.baseService(), "/test", QString(),
"test0");
@@ -1082,6 +965,9 @@ void tst_QDBusConnection::secondCallWithCallback()
void tst_QDBusConnection::nestedCallWithCallback()
{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication");
+
TestObject testObject;
QDBusConnection connection = QDBusConnection::sessionBus();
QVERIFY(connection.registerObject("/test", &testObject,
@@ -1097,22 +983,11 @@ void tst_QDBusConnection::nestedCallWithCallback()
QCOMPARE(signalsReceived, 1);
}
-class RaceConditionSignalWaiter : public QObject
-{
- Q_OBJECT
-public:
- int count;
- RaceConditionSignalWaiter() : count (0) {}
- virtual ~RaceConditionSignalWaiter() {}
-
-public slots:
- void countUp() { ++count; emit done(); }
-signals:
- void done();
-};
-
void tst_QDBusConnection::serviceRegistrationRaceCondition()
{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication");
+
// There was a race condition in the updating of list of name owners in
// Qt D-Bus. When the user connects to a signal coming from a given
// service, we must listen for NameOwnerChanged signals relevant to that
@@ -1164,39 +1039,6 @@ void tst_QDBusConnection::serviceRegistrationRaceCondition()
QCOMPARE(recv.count, 1);
}
-class VirtualObject: public QDBusVirtualObject
-{
- Q_OBJECT
-public:
- VirtualObject() :success(true) {}
-
- QString introspect(const QString & /* path */) const
- {
- return QString();
- }
-
- bool handleMessage(const QDBusMessage &message, const QDBusConnection &connection) {
- ++callCount;
- lastMessage = message;
-
- if (success) {
- QDBusMessage reply = message.createReply(replyArguments);
- connection.send(reply);
- }
- emit messageReceived(message);
- return success;
- }
-signals:
- void messageReceived(const QDBusMessage &message) const;
-
-public:
- mutable QDBusMessage lastMessage;
- QVariantList replyArguments;
- mutable int callCount;
- bool success;
-};
-
-
void tst_QDBusConnection::registerVirtualObject()
{
QDBusConnection con = QDBusConnection::sessionBus();
@@ -1279,6 +1121,9 @@ void tst_QDBusConnection::registerVirtualObject()
void tst_QDBusConnection::callVirtualObject()
{
+ if (!QCoreApplication::instance())
+ QSKIP("Test requires a QCoreApplication");
+
QDBusConnection con = QDBusConnection::sessionBus();
QVERIFY(con.isConnected());
@@ -1336,7 +1181,6 @@ void tst_QDBusConnection::callVirtualObject()
QVERIFY(!QTestEventLoop::instance().timeout());
QTest::qWait(100);
QVERIFY(errorReply.isError());
- qDebug() << errorReply.reply().arguments();
QCOMPARE(errorReply.reply().errorName(), QString("org.freedesktop.DBus.Error.UnknownObject"));
QDBusConnection::disconnectFromBus("con2");
@@ -1377,7 +1221,7 @@ void tst_QDBusConnection::callVirtualObjectLocal()
QString MyObject::path;
QString MyObjectWithoutInterface::path;
QString MyObjectWithoutInterface::interface;
-QTEST_MAIN(tst_QDBusConnection)
-
-#include "tst_qdbusconnection.moc"
+#ifndef tst_QDBusConnection
+QTEST_MAIN(tst_QDBusConnection)
+#endif
diff --git a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h
new file mode 100644
index 0000000000..a53ba320f8
--- /dev/null
+++ b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h
@@ -0,0 +1,287 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef TST_QDBUSCONNECTION_H
+#define TST_QDBUSCONNECTION_H
+
+#include <QObject>
+#include <QtDBus/QtDBus>
+#include <QtTest/QtTest>
+
+class BaseObject: public QObject
+{
+ Q_OBJECT
+ Q_CLASSINFO("D-Bus Interface", "local.BaseObject")
+public:
+ BaseObject(QObject *parent = 0) : QObject(parent) { }
+public slots:
+ void anotherMethod() { }
+};
+
+class MyObject: public BaseObject
+{
+ Q_OBJECT
+public slots:
+ void method(const QDBusMessage &msg);
+
+public:
+ static QString path;
+ int callCount;
+ MyObject(QObject *parent = 0) : BaseObject(parent), callCount(0) {}
+};
+
+class MyObjectWithoutInterface: public QObject
+{
+ Q_OBJECT
+public slots:
+ void method(const QDBusMessage &msg);
+
+public:
+ static QString path;
+ static QString interface;
+ int callCount;
+ MyObjectWithoutInterface(QObject *parent = 0) : QObject(parent), callCount(0) {}
+};
+
+class tst_QDBusConnection: public QObject
+{
+ Q_OBJECT
+
+ int signalsReceived;
+public slots:
+ void oneSlot() { ++signalsReceived; }
+ void exitLoop() { ++signalsReceived; QTestEventLoop::instance().exitLoop(); }
+ void secondCallWithCallback();
+
+private slots:
+ void noConnection();
+ void connectToBus();
+ void connectToPeer();
+ void connect();
+ void send();
+ void sendWithGui();
+ void sendAsync();
+ void sendSignal();
+ void sendSignalToName();
+ void sendSignalToOtherName();
+
+ void registerObject_data();
+ void registerObject();
+ void registerObjectWithInterface_data();
+ void registerObjectWithInterface();
+ void registerObjectPeer_data();
+ void registerObjectPeer();
+ void registerObject2();
+ void registerObjectPeer2();
+
+ void registerQObjectChildren();
+ void registerQObjectChildrenPeer();
+
+ void callSelf();
+ void callSelfByAnotherName_data();
+ void callSelfByAnotherName();
+ void multipleInterfacesInQObject();
+
+ void slotsWithLessParameters();
+ void nestedCallWithCallback();
+
+ void serviceRegistrationRaceCondition();
+
+ void registerVirtualObject();
+ void callVirtualObject();
+ void callVirtualObjectLocal();
+
+public:
+ QString serviceName() const { return "org.qtproject.Qt.Autotests.QDBusConnection"; }
+ bool callMethod(const QDBusConnection &conn, const QString &path);
+ bool callMethod(const QDBusConnection &conn, const QString &path, const QString &interface);
+ bool callMethodPeer(const QDBusConnection &conn, const QString &path);
+};
+
+class QDBusSpy: public QObject
+{
+ Q_OBJECT
+public slots:
+ void handlePing(const QString &str) { args.clear(); args << str; }
+ void asyncReply(const QDBusMessage &msg) { args = msg.arguments(); }
+
+public:
+ QList<QVariant> args;
+};
+
+class MyServer : public QDBusServer
+{
+ Q_OBJECT
+public:
+ MyServer(QString path) : m_path(path), m_connections()
+ {
+ connect(this, SIGNAL(newConnection(QDBusConnection)), SLOT(handleConnection(QDBusConnection)));
+ }
+
+ bool registerObject(const QDBusConnection& c)
+ {
+ QDBusConnection conn(c);
+ if (!conn.registerObject(m_path, &m_obj, QDBusConnection::ExportAllSlots))
+ return false;
+ if (!(conn.objectRegisteredAt(m_path) == &m_obj))
+ return false;
+ return true;
+ }
+
+ bool registerObject()
+ {
+ Q_FOREACH (const QString &name, m_connections) {
+ if (!registerObject(QDBusConnection(name)))
+ return false;
+ }
+ return true;
+ }
+
+ void unregisterObject()
+ {
+ Q_FOREACH (const QString &name, m_connections) {
+ QDBusConnection c(name);
+ c.unregisterObject(m_path);
+ }
+ }
+
+public slots:
+ void handleConnection(const QDBusConnection& c)
+ {
+ m_connections << c.name();
+ QVERIFY(isConnected());
+ QVERIFY(c.isConnected());
+ QVERIFY(registerObject(c));
+ QTestEventLoop::instance().exitLoop();
+ }
+
+private:
+ MyObject m_obj;
+ QString m_path;
+ QStringList m_connections;
+};
+
+class MyServer2 : public QDBusServer
+{
+ Q_OBJECT
+public:
+ MyServer2() : m_conn("none")
+ {
+ connect(this, SIGNAL(newConnection(QDBusConnection)), SLOT(handleConnection(QDBusConnection)));
+ }
+
+ QDBusConnection connection()
+ {
+ return m_conn;
+ }
+
+public slots:
+ void handleConnection(const QDBusConnection& c)
+ {
+ m_conn = c;
+ QVERIFY(isConnected());
+ QVERIFY(m_conn.isConnected());
+ QTestEventLoop::instance().exitLoop();
+ }
+
+private:
+ MyObject m_obj;
+ QDBusConnection m_conn;
+};
+
+class TestObject : public QObject
+{
+Q_OBJECT
+public:
+ TestObject(QObject *parent = 0) : QObject(parent) {}
+ ~TestObject() {}
+
+ QString func;
+
+public slots:
+ void test0() { func = "test0"; }
+ void test1(int i) { func = "test1 " + QString::number(i); }
+ int test2() { func = "test2"; return 43; }
+ int test3(int i) { func = "test2"; return i + 1; }
+};
+
+class RaceConditionSignalWaiter : public QObject
+{
+ Q_OBJECT
+public:
+ int count;
+ RaceConditionSignalWaiter() : count (0) {}
+ virtual ~RaceConditionSignalWaiter() {}
+
+public slots:
+ void countUp() { ++count; emit done(); }
+signals:
+ void done();
+};
+
+class VirtualObject: public QDBusVirtualObject
+{
+ Q_OBJECT
+public:
+ VirtualObject() :success(true) {}
+
+ QString introspect(const QString & /* path */) const
+ {
+ return QString();
+ }
+
+ bool handleMessage(const QDBusMessage &message, const QDBusConnection &connection) {
+ ++callCount;
+ lastMessage = message;
+
+ if (success) {
+ QDBusMessage reply = message.createReply(replyArguments);
+ connection.send(reply);
+ }
+ emit messageReceived(message);
+ return success;
+ }
+signals:
+ void messageReceived(const QDBusMessage &message) const;
+
+public:
+ mutable QDBusMessage lastMessage;
+ QVariantList replyArguments;
+ mutable int callCount;
+ bool success;
+};
+
+
+#endif // TST_QDBUSCONNECTION_H
+
diff --git a/tests/auto/dbus/qdbusconnection_delayed/qdbusconnection_delayed.pro b/tests/auto/dbus/qdbusconnection_delayed/qdbusconnection_delayed.pro
new file mode 100644
index 0000000000..71a75c644d
--- /dev/null
+++ b/tests/auto/dbus/qdbusconnection_delayed/qdbusconnection_delayed.pro
@@ -0,0 +1,5 @@
+CONFIG += testcase parallel_test
+TARGET = tst_qdbusconnection_delayed
+QT = core dbus testlib
+SOURCES += tst_qdbusconnection_delayed.cpp
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
diff --git a/tests/auto/dbus/qdbusconnection_delayed/tst_qdbusconnection_delayed.cpp b/tests/auto/dbus/qdbusconnection_delayed/tst_qdbusconnection_delayed.cpp
new file mode 100644
index 0000000000..c4f3063169
--- /dev/null
+++ b/tests/auto/dbus/qdbusconnection_delayed/tst_qdbusconnection_delayed.cpp
@@ -0,0 +1,113 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Intel Corporation.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtDBus>
+#include <QtTest>
+
+#ifdef Q_OS_WIN
+# include <process.h>
+# define getpid _getpid
+#else
+# include <sys/types.h>
+# include <unistd.h>
+#endif
+
+class tst_QDBusConnection_Delayed : public QObject
+{
+ Q_OBJECT
+private slots:
+ void delayedMessages();
+};
+
+class Foo : public QObject
+{
+ Q_OBJECT
+ Q_CLASSINFO("D-Bus Interface", "org.qtproject.tst_qdbusconnection_delayed.Foo")
+public slots:
+ int bar() { return 42; }
+};
+
+static bool executedOnce = false;
+
+void tst_QDBusConnection_Delayed::delayedMessages()
+{
+ if (executedOnce)
+ QSKIP("This test can only be executed once");
+ executedOnce = true;
+
+ int argc = 1;
+ char *argv[] = { const_cast<char *>("tst_qdbusconnection_delayed"), 0 };
+ QCoreApplication app(argc, argv);
+
+ QDBusConnection session = QDBusConnection::sessionBus();
+ QVERIFY(session.isConnected());
+ QVERIFY(!session.baseService().isEmpty());
+
+ QDBusConnection other = QDBusConnection::connectToBus(QDBusConnection::SessionBus, "other");
+ QVERIFY(other.isConnected());
+ QVERIFY(!other.baseService().isEmpty());
+
+ // make a method call: those should work even if delivery is disabled
+ QVERIFY(session.interface()->isServiceRegistered(other.baseService()));
+
+ // acquire a name in the main session bus connection: the effect is immediate
+ QString name = "org.qtproject.tst_qdbusconnection_delayed-" +
+ QString::number(getpid());
+ QVERIFY(session.registerService(name));
+ QVERIFY(other.interface()->isServiceRegistered(name));
+
+ // make an asynchronous call to a yet-unregistered object
+ QDBusPendingCallWatcher pending(other.asyncCall(QDBusMessage::createMethodCall(name, "/foo", QString(), "bar")));
+
+ // sleep the main thread without running the event loop;
+ // the call must not be delivered
+ QTest::qSleep(1000);
+ QVERIFY(!pending.isFinished());
+
+ // now register the object
+ Foo foo;
+ session.registerObject("/foo", &foo, QDBusConnection::ExportAllSlots);
+
+ connect(&pending, &QDBusPendingCallWatcher::finished,
+ &QTestEventLoop::instance(), &QTestEventLoop::exitLoop);
+ QTestEventLoop::instance().enterLoop(2);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ QVERIFY(pending.isFinished());
+ QVERIFY2(!pending.isError(), pending.error().name().toLatin1());
+ QVERIFY(!pending.reply().arguments().isEmpty());
+ QCOMPARE(pending.reply().arguments().at(0), QVariant(42));
+}
+
+QTEST_APPLESS_MAIN(tst_QDBusConnection_Delayed)
+
+#include "tst_qdbusconnection_delayed.moc"
diff --git a/tests/auto/dbus/qdbusconnection_no_app/qdbusconnection_no_app.pro b/tests/auto/dbus/qdbusconnection_no_app/qdbusconnection_no_app.pro
new file mode 100644
index 0000000000..ba3a13caa9
--- /dev/null
+++ b/tests/auto/dbus/qdbusconnection_no_app/qdbusconnection_no_app.pro
@@ -0,0 +1,6 @@
+CONFIG += testcase
+TARGET = tst_qdbusconnection_no_app
+QT = core dbus testlib
+SOURCES += tst_qdbusconnection_no_app.cpp
+HEADERS += ../qdbusconnection/tst_qdbusconnection.h
+DEFINES += SRCDIR=\\\"$$PWD/\\\" tst_QDBusConnection=tst_QDBusConnection_NoApplication
diff --git a/tests/auto/dbus/qdbusconnection_no_app/tst_qdbusconnection_no_app.cpp b/tests/auto/dbus/qdbusconnection_no_app/tst_qdbusconnection_no_app.cpp
new file mode 100644
index 0000000000..816f75f82e
--- /dev/null
+++ b/tests/auto/dbus/qdbusconnection_no_app/tst_qdbusconnection_no_app.cpp
@@ -0,0 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 Intel Corporation.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Ugly hack, look away
+#include "../qdbusconnection/tst_qdbusconnection.cpp"
+
+QTEST_APPLESS_MAIN(tst_QDBusConnection_NoApplication)
diff --git a/tests/auto/dbus/qdbusconnection_no_bus/qdbusconnection_no_bus.pro b/tests/auto/dbus/qdbusconnection_no_bus/qdbusconnection_no_bus.pro
index 7b15a4fb81..57712f0689 100644
--- a/tests/auto/dbus/qdbusconnection_no_bus/qdbusconnection_no_bus.pro
+++ b/tests/auto/dbus/qdbusconnection_no_bus/qdbusconnection_no_bus.pro
@@ -1,4 +1,4 @@
-CONFIG += testcase
+CONFIG += testcase parallel_test
TARGET = tst_qdbusconnection_no_bus
QT = core dbus testlib
SOURCES += tst_qdbusconnection_no_bus.cpp
diff --git a/tests/auto/dbus/qdbusconnection_no_bus/tst_qdbusconnection_no_bus.cpp b/tests/auto/dbus/qdbusconnection_no_bus/tst_qdbusconnection_no_bus.cpp
index 21f8f11f80..5a74096059 100644
--- a/tests/auto/dbus/qdbusconnection_no_bus/tst_qdbusconnection_no_bus.cpp
+++ b/tests/auto/dbus/qdbusconnection_no_bus/tst_qdbusconnection_no_bus.cpp
@@ -52,7 +52,9 @@ public:
tst_QDBusConnectionNoBus()
{
qputenv("DBUS_SESSION_BUS_ADDRESS", "unix:abstract=/tmp/does_not_exist");
+#ifdef SIMULATE_LOAD_FAIL
qputenv("QT_SIMULATE_DBUS_LIBFAIL", "1");
+#endif
}
private slots:
@@ -67,7 +69,7 @@ void tst_QDBusConnectionNoBus::connectToBus()
QDBusConnection con = QDBusConnection::sessionBus();
- QVERIFY(true); // if we didn't crash here, the test passed :)
+ QVERIFY(!con.isConnected()); // if we didn't crash here, the test passed :)
}
QTEST_APPLESS_MAIN(tst_QDBusConnectionNoBus)
diff --git a/tests/auto/dbus/qdbusconnection_no_libdbus/qdbusconnection_no_libdbus.pro b/tests/auto/dbus/qdbusconnection_no_libdbus/qdbusconnection_no_libdbus.pro
new file mode 100644
index 0000000000..cb0eab1a18
--- /dev/null
+++ b/tests/auto/dbus/qdbusconnection_no_libdbus/qdbusconnection_no_libdbus.pro
@@ -0,0 +1,5 @@
+CONFIG += testcase parallel_test
+TARGET = tst_qdbusconnection_no_libdbus
+QT = core dbus testlib
+DEFINES += SIMULATE_LOAD_FAIL
+SOURCES += ../qdbusconnection_no_bus/tst_qdbusconnection_no_bus.cpp
diff --git a/tests/auto/dbus/qdbusmarshall/BLACKLIST b/tests/auto/dbus/qdbusmarshall/BLACKLIST
new file mode 100644
index 0000000000..036378d204
--- /dev/null
+++ b/tests/auto/dbus/qdbusmarshall/BLACKLIST
@@ -0,0 +1,3 @@
+[receiveUnknownType]
+ubuntu-14.04
+opensuse-13.1
diff --git a/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp b/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
index 16314a5dc5..57fd5084be 100644
--- a/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
+++ b/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
@@ -150,7 +150,11 @@ int tst_QDBusMarshall::fileDescriptorForTest()
{
if (!tempFile.isOpen()) {
tempFile.setFileTemplate(QDir::tempPath() + "/qdbusmarshalltestXXXXXX.tmp");
- tempFile.open();
+ if (!tempFile.open()) {
+ qWarning("%s: Cannot create temporary file: %s", Q_FUNC_INFO,
+ qPrintable(tempFile.errorString()));
+ return 0;
+ }
}
return tempFile.handle();
}
@@ -869,7 +873,7 @@ void tst_QDBusMarshall::sendSignalErrors()
"signalName");
msg << QVariant::fromValue(QDBusObjectPath());
- QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal path \"/foo\" interface \"local.interfaceName\" member \"signalName\": Marshalling failed: Invalid object path passed in arguments");
+ QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal to service \"\" path \"/foo\" interface \"local.interfaceName\" member \"signalName\": Marshalling failed: Invalid object path passed in arguments");
QVERIFY(!con.send(msg));
msg.setArguments(QVariantList());
@@ -879,19 +883,19 @@ void tst_QDBusMarshall::sendSignalErrors()
path.setPath("abc");
msg << QVariant::fromValue(path);
- QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal path \"/foo\" interface \"local.interfaceName\" member \"signalName\": Marshalling failed: Invalid object path passed in arguments");
+ QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal to service \"\" path \"/foo\" interface \"local.interfaceName\" member \"signalName\": Marshalling failed: Invalid object path passed in arguments");
QVERIFY(!con.send(msg));
QDBusSignature sig;
msg.setArguments(QVariantList() << QVariant::fromValue(sig));
- QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal path \"/foo\" interface \"local.interfaceName\" member \"signalName\": Marshalling failed: Invalid signature passed in arguments");
+ QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal to service \"\" path \"/foo\" interface \"local.interfaceName\" member \"signalName\": Marshalling failed: Invalid signature passed in arguments");
QVERIFY(!con.send(msg));
QTest::ignoreMessage(QtWarningMsg, "QDBusSignature: invalid signature \"a\"");
sig.setSignature("a");
msg.setArguments(QVariantList());
msg << QVariant::fromValue(sig);
- QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal path \"/foo\" interface \"local.interfaceName\" member \"signalName\": Marshalling failed: Invalid signature passed in arguments");
+ QTest::ignoreMessage(QtWarningMsg, "QDBusConnection: error: could not send signal to service \"\" path \"/foo\" interface \"local.interfaceName\" member \"signalName\": Marshalling failed: Invalid signature passed in arguments");
QVERIFY(!con.send(msg));
}
@@ -1079,7 +1083,7 @@ static bool canSendUnixFd(DBusConnection *connection)
# if DBUS_VERSION-0 >= 0x010400
can_send_type = dbus_connection_can_send_type;
# endif
-#else
+#elif !defined(QT_NO_LIBRARY)
// run-time check if the next functions are available
can_send_type = (can_send_type_t)qdbus_resolve_conditionally("dbus_connection_can_send_type");
#endif
diff --git a/tests/auto/dbus/qdbusmetaobject/qdbusmetaobject.pro b/tests/auto/dbus/qdbusmetaobject/qdbusmetaobject.pro
index c0b38cf478..26dd58a010 100644
--- a/tests/auto/dbus/qdbusmetaobject/qdbusmetaobject.pro
+++ b/tests/auto/dbus/qdbusmetaobject/qdbusmetaobject.pro
@@ -1,4 +1,4 @@
-CONFIG += testcase
+CONFIG += testcase parallel_test
TARGET = tst_qdbusmetaobject
QT = core dbus-private testlib
SOURCES += tst_qdbusmetaobject.cpp
diff --git a/tests/auto/dbus/qdbusmetatype/qdbusmetatype.pro b/tests/auto/dbus/qdbusmetatype/qdbusmetatype.pro
index aef9bc73cb..ac020b435a 100644
--- a/tests/auto/dbus/qdbusmetatype/qdbusmetatype.pro
+++ b/tests/auto/dbus/qdbusmetatype/qdbusmetatype.pro
@@ -1,4 +1,4 @@
-CONFIG += testcase
+CONFIG += testcase parallel_test
TARGET = tst_qdbusmetatype
QT = core dbus testlib
SOURCES += tst_qdbusmetatype.cpp
diff --git a/tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp b/tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp
index 9c334f77a2..cc12ef8bcc 100644
--- a/tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp
+++ b/tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2015 Intel Corporation.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -172,10 +173,6 @@ QDBusPendingCall tst_QDBusPendingCall::sendError()
void tst_QDBusPendingCall::waitForFinished()
{
QDBusPendingCall ac = sendMessage();
- QVERIFY(!ac.isFinished());
- QVERIFY(!ac.isError());
- QVERIFY(ac.reply().type() == QDBusMessage::InvalidMessage);
-
ac.waitForFinished();
QVERIFY(ac.isFinished());
QVERIFY(!ac.isError());
@@ -195,10 +192,6 @@ void tst_QDBusPendingCall::waitForFinished()
void tst_QDBusPendingCall::waitForFinished_error()
{
QDBusPendingCall ac = sendError();
- QVERIFY(!ac.isFinished());
- QVERIFY(!ac.isError());
- QVERIFY(ac.reply().type() == QDBusMessage::InvalidMessage);
-
ac.waitForFinished();
QVERIFY(ac.isFinished());
QVERIFY(ac.isError());
@@ -254,10 +247,6 @@ void tst_QDBusPendingCall::callWithCallback_localLoop_errorReply()
void tst_QDBusPendingCall::watcher()
{
QDBusPendingCall ac = sendMessage();
- QVERIFY(!ac.isFinished());
- QVERIFY(!ac.isError());
- QVERIFY(ac.reply().type() == QDBusMessage::InvalidMessage);
-
callCount = 0;
watchArgument = 0;
@@ -284,10 +273,6 @@ void tst_QDBusPendingCall::watcher()
void tst_QDBusPendingCall::watcher_error()
{
QDBusPendingCall ac = sendError();
- QVERIFY(!ac.isFinished());
- QVERIFY(!ac.isError());
- QVERIFY(ac.reply().type() == QDBusMessage::InvalidMessage);
-
callCount = 0;
watchArgument = 0;
@@ -312,10 +297,6 @@ void tst_QDBusPendingCall::watcher_error()
void tst_QDBusPendingCall::watcher_waitForFinished()
{
QDBusPendingCall ac = sendMessage();
- QVERIFY(!ac.isFinished());
- QVERIFY(!ac.isError());
- QVERIFY(ac.reply().type() == QDBusMessage::InvalidMessage);
-
callCount = 0;
watchArgument = 0;
@@ -391,10 +372,6 @@ void tst_QDBusPendingCall::watcher_waitForFinished_threaded()
void tst_QDBusPendingCall::watcher_waitForFinished_alreadyFinished()
{
QDBusPendingCall ac = sendMessage();
- QVERIFY(!ac.isFinished());
- QVERIFY(!ac.isError());
- QVERIFY(ac.reply().type() == QDBusMessage::InvalidMessage);
-
ac.waitForFinished();
QVERIFY(ac.isFinished());
QVERIFY(!ac.isError());
@@ -425,10 +402,6 @@ void tst_QDBusPendingCall::watcher_waitForFinished_alreadyFinished()
void tst_QDBusPendingCall::watcher_waitForFinished_alreadyFinished_eventLoop()
{
QDBusPendingCall ac = sendMessage();
- QVERIFY(!ac.isFinished());
- QVERIFY(!ac.isError());
- QVERIFY(ac.reply().type() == QDBusMessage::InvalidMessage);
-
ac.waitForFinished();
QVERIFY(ac.isFinished());
QVERIFY(!ac.isError());
@@ -462,10 +435,6 @@ void tst_QDBusPendingCall::watcher_waitForFinished_alreadyFinished_eventLoop()
void tst_QDBusPendingCall::watcher_waitForFinished_error()
{
QDBusPendingCall ac = sendError();
- QVERIFY(!ac.isFinished());
- QVERIFY(!ac.isError());
- QVERIFY(ac.reply().type() == QDBusMessage::InvalidMessage);
-
callCount = 0;
watchArgument = 0;
diff --git a/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp b/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp
index 9dd2e4bb83..e7fa1e6484 100644
--- a/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp
+++ b/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp
@@ -49,8 +49,11 @@ private slots:
void watchForCreation();
void watchForDisappearance();
+ void watchForDisappearanceUniqueConnection();
void watchForOwnerChange();
void modeChange();
+ void disconnectedConnection();
+ void setConnection();
};
tst_QDBusServiceWatcher::tst_QDBusServiceWatcher()
@@ -155,6 +158,40 @@ void tst_QDBusServiceWatcher::watchForDisappearance()
QVERIFY(spyO.at(0).at(2).toString().isEmpty());
}
+void tst_QDBusServiceWatcher::watchForDisappearanceUniqueConnection()
+{
+ QDBusConnection con = QDBusConnection::sessionBus();
+ QVERIFY(con.isConnected());
+
+ // second connection
+ QString watchedName = QDBusConnection::connectToBus(QDBusConnection::SessionBus, "session2").baseService();
+ QVERIFY(!watchedName.isEmpty());
+
+ QDBusServiceWatcher watcher(watchedName, con, QDBusServiceWatcher::WatchForUnregistration);
+ watcher.setObjectName("watcher for disappearance");
+
+ QSignalSpy spyR(&watcher, SIGNAL(serviceRegistered(QString)));
+ QSignalSpy spyU(&watcher, SIGNAL(serviceUnregistered(QString)));
+ QSignalSpy spyO(&watcher, SIGNAL(serviceOwnerChanged(QString,QString,QString)));
+ QTestEventLoop::instance().connect(&watcher, SIGNAL(serviceUnregistered(QString)), SLOT(exitLoop()));
+
+ // unregister it:
+ QDBusConnection::disconnectFromBus("session2");
+
+ QTestEventLoop::instance().enterLoop(1);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QCOMPARE(spyR.count(), 0);
+
+ QCOMPARE(spyU.count(), 1);
+ QCOMPARE(spyU.at(0).at(0).toString(), watchedName);
+
+ QCOMPARE(spyO.count(), 1);
+ QCOMPARE(spyO.at(0).at(0).toString(), watchedName);
+ QCOMPARE(spyO.at(0).at(1).toString(), watchedName);
+ QVERIFY(spyO.at(0).at(2).toString().isEmpty());
+}
+
void tst_QDBusServiceWatcher::watchForOwnerChange()
{
QDBusConnection con = QDBusConnection::sessionBus();
@@ -263,5 +300,72 @@ void tst_QDBusServiceWatcher::modeChange()
QVERIFY(spyO.at(0).at(2).toString().isEmpty());
}
+void tst_QDBusServiceWatcher::disconnectedConnection()
+{
+ QDBusConnection con("");
+ QVERIFY(!con.isConnected());
+
+ QDBusServiceWatcher watcher(serviceName, con, QDBusServiceWatcher::WatchForRegistration);
+ watcher.addWatchedService("com.example.somethingelse");
+ watcher.addWatchedService("org.freedesktop.DBus");
+
+ watcher.setWatchMode(QDBusServiceWatcher::WatchForUnregistration);
+ watcher.setWatchMode(QDBusServiceWatcher::WatchForOwnerChange);
+
+ watcher.setWatchedServices(QStringList());
+}
+
+void tst_QDBusServiceWatcher::setConnection()
+{
+ // begin with a disconnected connection
+ QDBusConnection con("");
+ QVERIFY(!con.isConnected());
+
+ QDBusServiceWatcher watcher(serviceName, con, QDBusServiceWatcher::WatchForRegistration);
+
+ QSignalSpy spyR(&watcher, SIGNAL(serviceRegistered(QString)));
+ QSignalSpy spyU(&watcher, SIGNAL(serviceUnregistered(QString)));
+ QTestEventLoop::instance().connect(&watcher, SIGNAL(serviceOwnerChanged(QString,QString,QString)), SLOT(exitLoop()));
+
+ // move to the session bus
+ con = QDBusConnection::sessionBus();
+ QVERIFY(con.isConnected());
+ watcher.setConnection(con);
+
+ // register a name
+ QVERIFY(con.registerService(serviceName));
+
+ QTestEventLoop::instance().enterLoop(1);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QCOMPARE(spyR.count(), 1);
+ QCOMPARE(spyR.at(0).at(0).toString(), serviceName);
+ QCOMPARE(spyU.count(), 0);
+
+ // is the system bus available?
+ if (!QDBusConnection::systemBus().isConnected())
+ return;
+
+ // connect to the system bus and ask to watch that base service
+ QString watchedName = QDBusConnection::connectToBus(QDBusConnection::SystemBus, "system2").baseService();
+ watcher.setWatchedServices(QStringList() << watchedName);
+ watcher.setWatchMode(QDBusServiceWatcher::WatchForUnregistration);
+
+ // move to the system bus
+ watcher.setConnection(QDBusConnection::systemBus());
+ spyR.clear();
+ spyU.clear();
+
+ QDBusConnection::disconnectFromBus("system2");
+
+ QTestEventLoop::instance().enterLoop(1);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QCOMPARE(spyR.count(), 0);
+
+ QCOMPARE(spyU.count(), 1);
+ QCOMPARE(spyU.at(0).at(0).toString(), watchedName);
+}
+
QTEST_MAIN(tst_QDBusServiceWatcher)
#include "tst_qdbusservicewatcher.moc"
diff --git a/tests/auto/dbus/qdbustype/qdbustype.pro b/tests/auto/dbus/qdbustype/qdbustype.pro
index 21df33d2c7..7db87d279e 100644
--- a/tests/auto/dbus/qdbustype/qdbustype.pro
+++ b/tests/auto/dbus/qdbustype/qdbustype.pro
@@ -1,4 +1,4 @@
-CONFIG += testcase
+CONFIG += testcase parallel_test
TARGET = tst_qdbustype
QT = core-private dbus-private testlib
SOURCES += tst_qdbustype.cpp
diff --git a/tests/auto/dbus/qdbustype/tst_qdbustype.cpp b/tests/auto/dbus/qdbustype/tst_qdbustype.cpp
index 63444b61ad..4408729e7c 100644
--- a/tests/auto/dbus/qdbustype/tst_qdbustype.cpp
+++ b/tests/auto/dbus/qdbustype/tst_qdbustype.cpp
@@ -94,7 +94,11 @@ static void addFixedTypes()
// the library recognizes this as valid type first.
// The following function was added for Unix FD support, so if it is
// present, so is support for Unix FDs.
+# ifndef QT_NO_LIBRARY
bool supportsUnixFds = qdbus_resolve_conditionally("dbus_connection_can_send_type");
+# else
+ bool supportsUnixFds = false;
+# endif
# else
bool supportsUnixFds = true;
# endif
diff --git a/tests/auto/dbus/qdbusxmlparser/qdbusxmlparser.pro b/tests/auto/dbus/qdbusxmlparser/qdbusxmlparser.pro
index a7186c341b..6cdd09007c 100644
--- a/tests/auto/dbus/qdbusxmlparser/qdbusxmlparser.pro
+++ b/tests/auto/dbus/qdbusxmlparser/qdbusxmlparser.pro
@@ -1,4 +1,4 @@
-CONFIG += testcase
+CONFIG += testcase parallel_test
TARGET = tst_qdbusxmlparser
QT = core-private dbus-private xml testlib
SOURCES += tst_qdbusxmlparser.cpp
diff --git a/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp b/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp
index 4dbe0aae7d..c57292b7db 100644
--- a/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp
+++ b/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp
@@ -64,15 +64,10 @@ private slots:
void properties();
};
-QT_BEGIN_NAMESPACE
-// Avoid QHash randomization so that the order of the XML attributes is stable
-extern Q_CORE_EXPORT QBasicAtomicInt qt_qhash_seed; // from qhash.cpp
-QT_END_NAMESPACE
-
void tst_QDBusXmlParser::initTestCase()
{
// Always initialize the hash seed to 0 to get reliable test results
- qt_qhash_seed.store(0);
+ qSetGlobalQHashSeed(0);
}
void tst_QDBusXmlParser::parsing_data()
diff --git a/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp b/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp
index d2fae0e5e3..bff762fd04 100644
--- a/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp
+++ b/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp
@@ -324,6 +324,11 @@ void tst_QIcoImageFormat::pngCompression()
QImage image;
reader.jumpToImage(index);
+
+ QSize size = reader.size();
+ QCOMPARE(size.width(), width);
+ QCOMPARE(size.height(), height);
+
reader.read(&image);
QCOMPARE(image.width(), width);
diff --git a/tests/auto/gui/image/qicon/tst_qicon.cpp b/tests/auto/gui/image/qicon/tst_qicon.cpp
index 20a08e10a2..7333dd739f 100644
--- a/tests/auto/gui/image/qicon/tst_qicon.cpp
+++ b/tests/auto/gui/image/qicon/tst_qicon.cpp
@@ -53,6 +53,7 @@ private slots:
void actualSize2_data(); // test with 2 pixmaps with different aspect ratio
void actualSize2();
void isNull();
+ void isMask();
void swap();
void bestMatch();
void cacheKey();
@@ -75,14 +76,8 @@ private:
const QString m_pngImageFileName;
const QString m_pngRectFileName;
const QString m_sourceFileName;
-
- const static QIcon staticIcon;
};
-// Creating an icon statically should not cause a crash.
-// But we do not officially support this. See QTBUG-8666
-const QIcon tst_QIcon::staticIcon = QIcon::fromTheme("edit-find");
-
bool tst_QIcon::haveImageFormat(QByteArray const& desiredFormat)
{
return QImageReader::supportedImageFormats().contains(desiredFormat);
@@ -224,6 +219,20 @@ void tst_QIcon::isNull() {
QVERIFY(iconSupportedFormat.actualSize(QSize(32, 32)).isValid());
}
+void tst_QIcon::isMask()
+{
+ QIcon icon;
+ icon.setIsMask(true);
+ icon.addPixmap(QPixmap());
+ QVERIFY(icon.isMask());
+
+ QIcon icon2;
+ icon2.setIsMask(true);
+ QVERIFY(icon2.isMask());
+ icon2.setIsMask(false);
+ QVERIFY(!icon2.isMask());
+}
+
void tst_QIcon::swap()
{
QPixmap p1(1, 1), p2(2, 2);
@@ -354,10 +363,10 @@ void tst_QIcon::cacheKey()
qint64 icon1_key = icon1.cacheKey();
QIcon icon2 = icon1;
- QVERIFY(icon2.cacheKey() == icon1.cacheKey());
+ QCOMPARE(icon2.cacheKey(), icon1.cacheKey());
icon2.detach();
QVERIFY(icon2.cacheKey() != icon1.cacheKey());
- QVERIFY(icon1.cacheKey() == icon1_key);
+ QCOMPARE(icon1.cacheKey(), icon1_key);
}
void tst_QIcon::detach()
@@ -374,7 +383,7 @@ void tst_QIcon::detach()
img1 = icon1.pixmap(32, 32).toImage();
img2 = icon2.pixmap(32, 32).toImage();
- QVERIFY(img1 == img2);
+ QCOMPARE(img1, img2);
}
void tst_QIcon::addFile()
@@ -562,7 +571,7 @@ void tst_QIcon::fromTheme()
QString firstSearchPath = QLatin1String(":/icons");
QString secondSearchPath = QLatin1String(":/second_icons");
QIcon::setThemeSearchPaths(QStringList() << firstSearchPath << secondSearchPath);
- QVERIFY(QIcon::themeSearchPaths().size() == 2);
+ QCOMPARE(QIcon::themeSearchPaths().size(), 2);
QCOMPARE(firstSearchPath, QIcon::themeSearchPaths()[0]);
QCOMPARE(secondSearchPath, QIcon::themeSearchPaths()[1]);
@@ -599,7 +608,7 @@ void tst_QIcon::fromTheme()
// Test non existing icon with fallback
noIcon = QIcon::fromTheme("broken-icon", abIcon);
- QVERIFY(noIcon.cacheKey() == abIcon.cacheKey());
+ QCOMPARE(noIcon.cacheKey(), abIcon.cacheKey());
// Test svg-only icon
noIcon = QIcon::fromTheme("svg-icon", abIcon);
diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp
index 939226e2b0..23ddfbdd58 100644
--- a/tests/auto/gui/image/qimage/tst_qimage.cpp
+++ b/tests/auto/gui/image/qimage/tst_qimage.cpp
@@ -196,6 +196,8 @@ private slots:
void metadataPassthrough();
+ void pixelColor();
+
private:
const QString m_prefix;
};
@@ -478,7 +480,7 @@ void tst_QImage::setAlphaChannel()
image.setAlphaChannel(alphaChannel);
image = image.convertToFormat(QImage::Format_ARGB32);
- QVERIFY(image.format() == QImage::Format_ARGB32);
+ QCOMPARE(image.format(), QImage::Format_ARGB32);
// alpha of 0 becomes black at a=0 due to premultiplication
QRgb pixel = alpha == 0 ? 0 : qRgba(red, green, blue, alpha);
@@ -1565,12 +1567,12 @@ void tst_QImage::createHeuristicMask()
// line 2
QVERIFY(newMask.pixel(0,1) != newMask.pixel(1,1));
- QVERIFY(newMask.pixel(1,1) == newMask.pixel(2,1));
+ QCOMPARE(newMask.pixel(1,1), newMask.pixel(2,1));
QVERIFY(newMask.pixel(2,1) != newMask.pixel(3,1));
// line 3
QVERIFY(newMask.pixel(0,2) != newMask.pixel(1,2));
- QVERIFY(newMask.pixel(1,2) == newMask.pixel(2,2));
+ QCOMPARE(newMask.pixel(1,2), newMask.pixel(2,2));
QVERIFY(newMask.pixel(2,2) != newMask.pixel(3,2));
}
#endif
@@ -1581,10 +1583,10 @@ void tst_QImage::cacheKey()
qint64 image1_key = image1.cacheKey();
QImage image2 = image1;
- QVERIFY(image2.cacheKey() == image1.cacheKey());
+ QCOMPARE(image2.cacheKey(), image1.cacheKey());
image2.detach();
QVERIFY(image2.cacheKey() != image1.cacheKey());
- QVERIFY(image1.cacheKey() == image1_key);
+ QCOMPARE(image1.cacheKey(), image1_key);
}
void tst_QImage::smoothScale()
@@ -3020,5 +3022,21 @@ void tst_QImage::metadataPassthrough()
QCOMPARE(swapped.devicePixelRatio(), a.devicePixelRatio());
}
+void tst_QImage::pixelColor()
+{
+ QImage argb32(1, 1, QImage::Format_ARGB32);
+ QImage argb32pm(1, 1, QImage::Format_ARGB32_Premultiplied);
+
+ QColor c(Qt::red);
+ c.setAlpha(128);
+ argb32.setPixelColor(QPoint(0, 0), c);
+ argb32pm.setPixelColor(QPoint(0, 0), c);
+ QCOMPARE(argb32.pixelColor(QPoint(0, 0)), c);
+ QCOMPARE(argb32pm.pixelColor(QPoint(0, 0)), c);
+
+ QImage t = argb32.convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ QCOMPARE(t.pixel(0,0), argb32pm.pixel(0,0));
+}
+
QTEST_GUILESS_MAIN(tst_QImage)
#include "tst_qimage.moc"
diff --git a/tests/auto/gui/image/qimagereader/images/longcomment.pgm b/tests/auto/gui/image/qimagereader/images/longcomment.pgm
new file mode 100644
index 0000000000..a5624b6c73
--- /dev/null
+++ b/tests/auto/gui/image/qimagereader/images/longcomment.pgm
@@ -0,0 +1,12 @@
+P2
+# A short comment
+# A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment A very long comment
+24 7
+15
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 3 3 3 3 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 15 15 15 0
+0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 15 0
+0 3 3 3 0 0 0 7 7 7 0 0 0 11 11 11 0 0 0 15 15 15 15 0
+0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 0 0
+0 3 0 0 0 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
index 4b3e2606fd..86dd8c4daf 100644
--- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
@@ -36,7 +36,6 @@
#include <QBuffer>
#include <QDebug>
-#include <QFile>
#include <QImage>
#include <QImageReader>
#include <QImageWriter>
@@ -46,6 +45,7 @@
#include <QTcpServer>
#include <QTimer>
#include <QTemporaryDir>
+#include <QTemporaryFile>
#include <algorithm>
@@ -53,6 +53,22 @@ typedef QMap<QString, QString> QStringMap;
typedef QList<int> QIntList;
Q_DECLARE_METATYPE(QImage::Format)
+static QByteArray msgFileOpenWriteFailed(const QFile &file)
+{
+ const QString result = QLatin1String("Cannot open \"")
+ + QDir::toNativeSeparators(file.fileName())
+ + QLatin1String("\" for writing: ") + file.errorString();
+ return result.toLocal8Bit();
+}
+
+static QByteArray msgFileOpenReadFailed(const QFile &file)
+{
+ const QString result = QLatin1String("Cannot open \"")
+ + QDir::toNativeSeparators(file.fileName())
+ + QLatin1String("\" for reading: ") + file.errorString();
+ return result.toLocal8Bit();
+}
+
class tst_QImageReader : public QObject
{
Q_OBJECT
@@ -194,7 +210,7 @@ void tst_QImageReader::initTestCase()
prefix = QFINDTESTDATA("images/");
if (prefix.isEmpty())
QFAIL("Can't find images directory!");
- QVERIFY(m_temporaryDir.isValid());
+ QVERIFY2(m_temporaryDir.isValid(), qPrintable(m_temporaryDir.errorString()));
}
void tst_QImageReader::cleanupTestCase()
@@ -224,6 +240,7 @@ void tst_QImageReader::readImage_data()
QTest::newRow("PPM: runners") << QString("runners.ppm") << true << QByteArray("ppm");
QTest::newRow("PPM: test") << QString("test.ppm") << true << QByteArray("ppm");
QTest::newRow("XBM: gnus") << QString("gnus.xbm") << true << QByteArray("xbm");
+ QTest::newRow("PGM: longcomment") << QString("longcomment.pgm") << true << QByteArray("pgm");
QTest::newRow("JPEG: beavis") << QString("beavis.jpg") << true << QByteArray("jpeg");
QTest::newRow("JPEG: qtbug13653") << QString("qtbug13653-no_eoi.jpg") << true << QByteArray("jpeg");
@@ -733,7 +750,7 @@ void tst_QImageReader::gifHandlerBugs()
QVERIFY(io.loopCount() != 1);
int count=0;
for (; io.canRead(); io.read(), ++count) ;
- QVERIFY(count == 34);
+ QCOMPARE(count, 34);
}
// Task 95166
@@ -810,7 +827,7 @@ void tst_QImageReader::gifImageCount()
QVERIFY(io.canRead());
QImage greenFrame = io.read();
- QVERIFY(io.imageCount() == 4);
+ QCOMPARE(io.imageCount(), 4);
QVERIFY(io.canRead());
QImage blueFrame = io.read();
@@ -925,8 +942,8 @@ void tst_QImageReader::gifImageCount()
}
{
QImageReader io(":images/trolltech.gif");
- QVERIFY(io.imageCount() == 34);
- QVERIFY(io.size() == QSize(128,64));
+ QCOMPARE(io.imageCount(), 34);
+ QCOMPARE(io.size(), QSize(128,64));
}
}
@@ -1050,7 +1067,7 @@ void tst_QImageReader::readFromDevice()
const QString imageFileName = prefix + fileName;
QImage expectedImage(imageFileName, format);
QFile file(imageFileName);
- QVERIFY(file.open(QFile::ReadOnly));
+ QVERIFY2(file.open(QFile::ReadOnly), msgFileOpenReadFailed(file).constData());
QByteArray imageData = file.readAll();
QVERIFY(!imageData.isEmpty());
{
@@ -1128,12 +1145,11 @@ void tst_QImageReader::readFromFileAfterJunk()
SKIP_IF_UNSUPPORTED(format);
- QFile::remove("junk");
- QFile junkFile("junk");
- QVERIFY(junkFile.open(QFile::WriteOnly));
+ QTemporaryFile junkFile(m_temporaryDir.path() + QLatin1String("/junkXXXXXX"));
+ QVERIFY2(junkFile.open(), msgFileOpenWriteFailed(junkFile).constData());
QFile imageFile(prefix + fileName);
- QVERIFY(imageFile.open(QFile::ReadOnly));
+ QVERIFY2(imageFile.open(QFile::ReadOnly), msgFileOpenReadFailed(imageFile).constData());
QByteArray imageData = imageFile.readAll();
QVERIFY(!imageData.isNull());
@@ -1154,7 +1170,7 @@ void tst_QImageReader::readFromFileAfterJunk()
}
}
junkFile.close();
- junkFile.open(QFile::ReadOnly);
+ QVERIFY2(junkFile.open(), msgFileOpenReadFailed(junkFile).constData());
for (int i = 0; i < iterations; ++i) {
QByteArray ole = junkFile.read(9);
@@ -1204,7 +1220,7 @@ void tst_QImageReader::devicePosition()
QVERIFY(!expected.isNull());
QFile imageFile(prefix + fileName);
- QVERIFY(imageFile.open(QFile::ReadOnly));
+ QVERIFY2(imageFile.open(QFile::ReadOnly), msgFileOpenReadFailed(imageFile).constData());
QByteArray imageData = imageFile.readAll();
QVERIFY(!imageData.isNull());
int imageDataSize = imageData.size();
diff --git a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
index 4f04e50294..1dd4d69ea8 100644
--- a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
+++ b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
@@ -89,6 +89,7 @@ private slots:
void saveToTemporaryFile();
private:
+ QTemporaryDir m_temporaryDir;
QString prefix;
QString writePrefix;
};
@@ -112,14 +113,11 @@ static void initializePadding(QImage *image)
void tst_QImageWriter::initTestCase()
{
+ QVERIFY(m_temporaryDir.isValid());
prefix = QFINDTESTDATA("images/");
if (prefix.isEmpty())
QFAIL("Can't find images directory!");
-#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
- writePrefix = QDir::homePath();
-#else
- writePrefix = prefix;
-#endif
+ writePrefix = m_temporaryDir.path();
}
// Testing get/set functions
@@ -416,7 +414,7 @@ void tst_QImageWriter::testCanWrite()
{
// check if canWrite won't leave an empty file
QTemporaryDir dir;
- QVERIFY(dir.isValid());
+ QVERIFY2(dir.isValid(), qPrintable(dir.errorString()));
QString fileName(dir.path() + QLatin1String("/001.garble"));
QVERIFY(!QFileInfo(fileName).exists());
QImageWriter writer(fileName);
@@ -524,7 +522,7 @@ void tst_QImageWriter::saveToTemporaryFile()
{
// 1) Via QImageWriter's API, with a standard temp file name
QTemporaryFile file;
- QVERIFY(file.open());
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QImageWriter writer(&file, "PNG");
if (writer.canWrite())
QVERIFY(writer.write(image));
@@ -538,7 +536,7 @@ void tst_QImageWriter::saveToTemporaryFile()
{
// 2) Via QImage's API, with a standard temp file name
QTemporaryFile file;
- QVERIFY(file.open());
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QVERIFY(image.save(&file, "PNG"));
file.reset();
QImage tmp;
@@ -548,7 +546,7 @@ void tst_QImageWriter::saveToTemporaryFile()
{
// 3) Via QImageWriter's API, with a named temp file
QTemporaryFile file("tempXXXXXX");
- QVERIFY(file.open());
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QImageWriter writer(&file, "PNG");
QVERIFY(writer.write(image));
#if defined(Q_OS_WINCE)
@@ -559,7 +557,7 @@ void tst_QImageWriter::saveToTemporaryFile()
{
// 4) Via QImage's API, with a named temp file
QTemporaryFile file("tempXXXXXX");
- QVERIFY(file.open());
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QVERIFY(image.save(&file, "PNG"));
file.reset();
QImage tmp;
diff --git a/tests/auto/gui/image/qmovie/tst_qmovie.cpp b/tests/auto/gui/image/qmovie/tst_qmovie.cpp
index c61c88d1a6..b8c99ca324 100644
--- a/tests/auto/gui/image/qmovie/tst_qmovie.cpp
+++ b/tests/auto/gui/image/qmovie/tst_qmovie.cpp
@@ -188,8 +188,8 @@ void tst_QMovie::jumpToFrame()
QMovie movie(QFINDTESTDATA(fileName));
movie.start();
movie.stop();
- QVERIFY(movie.jumpToFrame(-1) == false);
- QVERIFY(movie.currentFrameNumber() == 0);
+ QVERIFY(!movie.jumpToFrame(-1));
+ QCOMPARE(movie.currentFrameNumber(), 0);
}
void tst_QMovie::changeMovieFile()
@@ -198,7 +198,7 @@ void tst_QMovie::changeMovieFile()
movie.start();
movie.stop();
movie.setFileName(QFINDTESTDATA("animations/trolltech.gif"));
- QVERIFY(movie.currentFrameNumber() == -1);
+ QCOMPARE(movie.currentFrameNumber(), -1);
}
#ifndef QT_NO_WIDGETS
diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
index 58cc5824bd..67d7e57fd4 100644
--- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
@@ -447,7 +447,7 @@ void tst_QPixmap::scroll()
QString fileName = QString(":/images/%1.png").arg(QTest::currentDataTag());
QPixmap output(fileName);
- QVERIFY(input.isNull() == output.isNull());
+ QCOMPARE(input.isNull(), output.isNull());
QVERIFY(lenientCompare(pixmap, output));
QCOMPARE(exp, exposed);
}
@@ -713,11 +713,11 @@ void tst_QPixmap::cacheKey()
QVERIFY(pixmap1.cacheKey() != pixmap2.cacheKey());
pixmap2 = pixmap1;
- QVERIFY(pixmap2.cacheKey() == pixmap1.cacheKey());
+ QCOMPARE(pixmap2.cacheKey(), pixmap1.cacheKey());
pixmap2.detach();
QVERIFY(pixmap2.cacheKey() != pixmap1.cacheKey());
- QVERIFY(pixmap1.cacheKey() == pixmap1_key);
+ QCOMPARE(pixmap1.cacheKey(), pixmap1_key);
}
// Test drawing a bitmap on a pixmap.
@@ -743,7 +743,7 @@ void tst_QPixmap::isNull()
{
{
QPixmap pixmap(1,1);
- QVERIFY(pixmap.isNull() == false);
+ QVERIFY(!pixmap.isNull());
}
{
QPixmap pixmap(0,0);
@@ -783,11 +783,11 @@ void tst_QPixmap::convertFromImageNoDetach()
QPixmap pix = QPixmap::fromImage(orig);
QImage copy = pix.toImage();
- QVERIFY(copy.format() == screenFormat);
+ QCOMPARE(copy.format(), screenFormat);
const QImage constOrig = orig;
const QImage constCopy = copy;
- QVERIFY(constOrig.bits() == constCopy.bits());
+ QCOMPARE(constOrig.bits(), constCopy.bits());
}
void tst_QPixmap::convertFromImageDetach()
@@ -821,7 +821,7 @@ void tst_QPixmap::convertFromImageCacheKey()
QPixmap pix = QPixmap::fromImage(orig);
QImage copy = pix.toImage();
- QVERIFY(copy.format() == screenFormat);
+ QCOMPARE(copy.format(), screenFormat);
QCOMPARE(orig.cacheKey(), pix.cacheKey());
QCOMPARE(copy.cacheKey(), pix.cacheKey());
@@ -1135,9 +1135,9 @@ void tst_QPixmap::copy()
void tst_QPixmap::depthOfNullObjects()
{
QBitmap b1;
- QVERIFY(b1.depth() == 0);
+ QCOMPARE(b1.depth(), 0);
QPixmap p4;
- QVERIFY(p4.depth() == 0);
+ QCOMPARE(p4.depth(), 0);
}
void tst_QPixmap::transformed()
@@ -1437,7 +1437,7 @@ void tst_QPixmap::task_246446()
{
QPixmap pm2(pm);
}
- QVERIFY(pm.width() == 10);
+ QCOMPARE(pm.width(), 10);
QVERIFY(pm.mask().isNull());
}
@@ -1490,14 +1490,14 @@ void tst_QPixmap::loadAsBitmapOrPixmap()
// The do the same check for bitmaps..
QBitmap bitmap("temp_image.png");
QVERIFY(!bitmap.isNull());
- QVERIFY(bitmap.depth() == 1);
+ QCOMPARE(bitmap.depth(), 1);
QVERIFY(bitmap.isQBitmap());
bitmap = QBitmap();
ok = bitmap.load("temp_image.png");
QVERIFY(ok);
QVERIFY(!bitmap.isNull());
- QVERIFY(bitmap.depth() == 1);
+ QCOMPARE(bitmap.depth(), 1);
QVERIFY(bitmap.isQBitmap());
}
diff --git a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
index f22aa63112..a3cf66da18 100644
--- a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
+++ b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
@@ -111,7 +111,7 @@ void tst_QPixmapCache::setCacheLimit()
delete p1;
QPixmapCache::setCacheLimit(0);
- QVERIFY(QPixmapCache::find("P1") == 0);
+ QVERIFY(!QPixmapCache::find("P1"));
p1 = new QPixmap(2, 3);
QPixmapCache::setCacheLimit(1000);
@@ -346,12 +346,12 @@ void tst_QPixmapCache::remove()
QVERIFY(p1.toImage() == p1.toImage()); // sanity check
QPixmapCache::remove("red");
- QVERIFY(QPixmapCache::find("red") == 0);
+ QVERIFY(!QPixmapCache::find("red"));
QPixmapCache::remove("red");
- QVERIFY(QPixmapCache::find("red") == 0);
+ QVERIFY(!QPixmapCache::find("red"));
QPixmapCache::remove("green");
- QVERIFY(QPixmapCache::find("green") == 0);
+ QVERIFY(!QPixmapCache::find("green"));
//The int part of the API
QPixmapCache::clear();
@@ -424,7 +424,7 @@ void tst_QPixmapCache::clear()
QPixmapCache::clear();
for (int k = 0; k < numberOfKeys; ++k)
- QVERIFY(QPixmapCache::find(QString::number(k)) == 0);
+ QVERIFY(!QPixmapCache::find(QString::number(k)));
//The int part of the API
QPixmap p2(10, 10);
diff --git a/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp b/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp
index 2448b89296..ff263c166a 100644
--- a/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp
+++ b/tests/auto/gui/itemmodels/qstandarditem/tst_qstandarditem.cpp
@@ -278,9 +278,12 @@ void tst_QStandardItem::getSetFlags()
QVERIFY(item.isCheckable());
QCOMPARE(item.checkState(), Qt::Unchecked);
QVERIFY(item.flags() & Qt::ItemIsUserCheckable);
- item.setTristate(true);
- QVERIFY(item.isTristate());
- QVERIFY(item.flags() & Qt::ItemIsTristate);
+ item.setUserTristate(true);
+ QVERIFY(item.isUserTristate());
+ QVERIFY(item.flags() & Qt::ItemIsUserTristate);
+ item.setAutoTristate(true);
+ QVERIFY(item.isAutoTristate());
+ QVERIFY(item.flags() & Qt::ItemIsAutoTristate);
#ifndef QT_NO_DRAGANDDROP
item.setDragEnabled(true);
QVERIFY(item.isDragEnabled());
@@ -306,10 +309,12 @@ void tst_QStandardItem::getSetFlags()
item.setCheckable(false);
QVERIFY(!item.isCheckable());
QVERIFY(!(item.flags() & Qt::ItemIsUserCheckable));
- QVERIFY(item.isTristate());
- item.setTristate(false);
- QVERIFY(!item.isTristate());
- QVERIFY(!(item.flags() & Qt::ItemIsTristate));
+ item.setUserTristate(false);
+ QVERIFY(!item.isUserTristate());
+ QVERIFY(!(item.flags() & Qt::ItemIsUserTristate));
+ item.setAutoTristate(false);
+ QVERIFY(!item.isAutoTristate());
+ QVERIFY(!(item.flags() & Qt::ItemIsAutoTristate));
#ifndef QT_NO_DRAGANDDROP
QVERIFY(item.isDragEnabled());
item.setDragEnabled(false);
@@ -325,6 +330,13 @@ void tst_QStandardItem::getSetFlags()
item.setCheckState(Qt::Checked);
item.setCheckable(true);
QCOMPARE(item.checkState(), Qt::Checked);
+
+ // deprecated API
+ item.setTristate(true);
+ QVERIFY(item.isTristate());
+ QVERIFY(item.flags() & Qt::ItemIsTristate);
+ item.setTristate(false);
+ QVERIFY(!(item.flags() & Qt::ItemIsTristate));
}
void tst_QStandardItem::getSetRowAndColumnCount()
diff --git a/tests/auto/gui/kernel/qclipboard/qclipboard.pro b/tests/auto/gui/kernel/qclipboard/qclipboard.pro
index d97c58dea0..b9fd2080e7 100644
--- a/tests/auto/gui/kernel/qclipboard/qclipboard.pro
+++ b/tests/auto/gui/kernel/qclipboard/qclipboard.pro
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
-SUBDIRS = copier paster
+!winrt: SUBDIRS = copier paster
test.depends += $$SUBDIRS
SUBDIRS += test
diff --git a/tests/auto/gui/kernel/qclipboard/test/test.pro b/tests/auto/gui/kernel/qclipboard/test/test.pro
index 586404871f..40bf9c8d8e 100644
--- a/tests/auto/gui/kernel/qclipboard/test/test.pro
+++ b/tests/auto/gui/kernel/qclipboard/test/test.pro
@@ -3,6 +3,8 @@ SOURCES += ../tst_qclipboard.cpp
TARGET = ../tst_qclipboard
QT += testlib
+osx: LIBS += -framework AppKit
+
win32 {
CONFIG(debug, debug|release) {
TARGET = ../../debug/tst_qclipboard
@@ -15,6 +17,6 @@ wince* {
DEPLOYMENT += rsc reg_resource
}
-TEST_HELPER_INSTALLS = \
+!winrt: TEST_HELPER_INSTALLS = \
../copier/copier \
../paster/paster
diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
index d573d97495..d18f9664fc 100644
--- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
+++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
@@ -171,7 +171,7 @@ void tst_QGuiApplication::focusObject()
int argc = 0;
QGuiApplication app(argc, 0);
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
QObject obj1, obj2, obj3;
@@ -342,7 +342,7 @@ void tst_QGuiApplication::changeFocusWindow()
int argc = 0;
QGuiApplication app(argc, 0);
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
const QRect screenGeometry = QGuiApplication::primaryScreen()->availableVirtualGeometry();
@@ -416,11 +416,11 @@ void tst_QGuiApplication::keyboardModifiers()
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::ControlModifier);
// shortcut events
- QWindowSystemInterface::tryHandleShortcutEvent(window.data(), Qt::Key_5, Qt::MetaModifier);
+ QTest::keyEvent(QTest::Shortcut, window.data(), Qt::Key_5, Qt::MetaModifier);
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::MetaModifier);
- QWindowSystemInterface::tryHandleShortcutEvent(window.data(), Qt::Key_Period, Qt::NoModifier);
+ QTest::keyEvent(QTest::Shortcut, window.data(), Qt::Key_Period, Qt::NoModifier);
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::NoModifier);
- QWindowSystemInterface::tryHandleShortcutEvent(window.data(), Qt::Key_0, Qt::ControlModifier);
+ QTest::keyEvent(QTest::Shortcut, window.data(), Qt::Key_0, Qt::ControlModifier);
QCOMPARE(QGuiApplication::keyboardModifiers(), Qt::ControlModifier);
// key events
@@ -928,7 +928,7 @@ void tst_QGuiApplication::genericPluginsAndWindowSystemEvents()
QGuiApplication app(argc, argv);
QVERIFY(QGuiApplication::primaryScreen());
- QVERIFY(QGuiApplication::primaryScreen()->orientation() == testOrientationToSend);
+ QCOMPARE(QGuiApplication::primaryScreen()->orientation(), testOrientationToSend);
QCOMPARE(testReceiver.customEvents, 0);
QCoreApplication::sendPostedEvents(&testReceiver);
diff --git a/tests/auto/gui/kernel/qguivariant/no_application/main.cpp b/tests/auto/gui/kernel/qguivariant/no_application/main.cpp
index c37e633d75..1294751224 100644
--- a/tests/auto/gui/kernel/qguivariant/no_application/main.cpp
+++ b/tests/auto/gui/kernel/qguivariant/no_application/main.cpp
@@ -56,7 +56,7 @@ void tst_QGuiVariantNoApplication::variantWithoutApplication()
{
QVariant v = QString("red");
- QVERIFY(qvariant_cast<QColor>(v) == QColor(Qt::red));
+ QCOMPARE(qvariant_cast<QColor>(v), QColor(Qt::red));
}
diff --git a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp
index 58c595ad07..0a704b9f64 100644
--- a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp
+++ b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp
@@ -140,13 +140,13 @@ void tst_QGuiVariant::constructor_invalid()
QTest::ignoreMessage(QtWarningMsg, QRegularExpression("^Trying to construct an instance of an invalid type, type id:"));
QVariant variant(static_cast<QVariant::Type>(typeId));
QVERIFY(!variant.isValid());
- QVERIFY(variant.userType() == QMetaType::UnknownType);
+ QCOMPARE(variant.userType(), int(QMetaType::UnknownType));
}
{
QTest::ignoreMessage(QtWarningMsg, QRegularExpression("^Trying to construct an instance of an invalid type, type id:"));
QVariant variant(typeId, /* copy */ 0);
QVERIFY(!variant.isValid());
- QVERIFY(variant.userType() == QMetaType::UnknownType);
+ QCOMPARE(variant.userType(), int(QMetaType::UnknownType));
}
}
@@ -250,6 +250,14 @@ void tst_QGuiVariant::toColor_data()
QColor c("red");
QTest::newRow( "string" ) << QVariant( QString( "red" ) ) << c;
QTest::newRow( "solid brush" ) << QVariant( QBrush(c) ) << c;
+ QTest::newRow("qbytearray") << QVariant(QByteArray("red")) << c;
+ QTest::newRow("same color") << QVariant(c) << c;
+ QTest::newRow("qstring(#ff0000)") << QVariant(QString::fromUtf8("#ff0000")) << c;
+ QTest::newRow("qbytearray(#ff0000)") << QVariant(QByteArray("#ff0000")) << c;
+
+ c.setNamedColor("#88112233");
+ QTest::newRow("qstring(#88112233)") << QVariant(QString::fromUtf8("#88112233")) << c;
+ QTest::newRow("qbytearray(#88112233)") << QVariant(QByteArray("#88112233")) << c;
}
void tst_QGuiVariant::toColor()
@@ -260,6 +268,8 @@ void tst_QGuiVariant::toColor()
QVERIFY( value.canConvert( QVariant::Color ) );
QColor d = qvariant_cast<QColor>(value);
QCOMPARE( d, result );
+ QVERIFY(value.convert(QMetaType::QColor));
+ QCOMPARE(d, QColor(value.toString()));
}
void tst_QGuiVariant::toPixmap_data()
@@ -611,9 +621,9 @@ void tst_QGuiVariant::writeToReadFromDataStream()
// the uninitialized float can be NaN (observed on Windows Mobile 5 ARMv4i)
float readFloat = qvariant_cast<float>(readVariant);
float writtenFloat = qvariant_cast<float>(writeVariant);
- QVERIFY(qIsNaN(readFloat) == qIsNaN(writtenFloat));
+ QCOMPARE(qIsNaN(readFloat), qIsNaN(writtenFloat));
if (!qIsNaN(readFloat))
- QVERIFY(readFloat == writtenFloat);
+ QCOMPARE(readFloat, writtenFloat);
}
break;
}
@@ -632,7 +642,7 @@ void tst_QGuiVariant::writeToReadFromOldDataStream()
dataFileStream.setVersion(QDataStream::Qt_4_9);
QVariant readVariant;
dataFileStream >> readVariant;
- QVERIFY(readVariant.userType() == QMetaType::QPolygonF);
+ QCOMPARE(readVariant.userType(), int(QMetaType::QPolygonF));
QCOMPARE(testVariant, readVariant);
file.close();
}
@@ -656,7 +666,7 @@ void tst_QGuiVariant::writeToReadFromOldDataStream()
QDataStream readVarData(variantData);
readVarData >> dummy;
readVarData >> polyData50;
- QVERIFY(polyData49 == polyData50);
+ QCOMPARE(polyData49, polyData50);
}
}
diff --git a/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp b/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp
index a36e31e2e2..e3b71e40d1 100644
--- a/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp
+++ b/tests/auto/gui/kernel/qinputmethod/tst_qinputmethod.cpp
@@ -191,7 +191,7 @@ void tst_qinputmethod::cursorRectangle()
{
QCOMPARE(qApp->inputMethod()->cursorRectangle(), QRectF());
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
DummyWindow window;
@@ -289,9 +289,12 @@ void tst_qinputmethod::inputDirection()
void tst_qinputmethod::inputMethodAccepted()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
+ if (!QGuiApplication::platformName().compare(QLatin1String("xcb"), Qt::CaseInsensitive))
+ QSKIP("XCB: depends on dedicated platform context.");
+
InputItem disabledItem;
disabledItem.setEnabled(false);
diff --git a/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp b/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp
index dcead8bfbf..1fc4967b12 100644
--- a/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp
+++ b/tests/auto/gui/kernel/qopenglwindow/tst_qopenglwindow.cpp
@@ -248,7 +248,7 @@ public:
GLuint fbo = 0xFFFF;
QOpenGLContext::currentContext()->functions()->glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint *) &fbo);
- QVERIFY(fbo == 0);
+ QCOMPARE(fbo, GLuint(0));
}
void paintGL() Q_DECL_OVERRIDE {
@@ -272,7 +272,7 @@ public:
GLuint fbo = 0xFFFF;
QOpenGLContext::currentContext()->functions()->glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint *) &fbo);
- QVERIFY(fbo == 0);
+ QCOMPARE(fbo, GLuint(0));
}
};
diff --git a/tests/auto/gui/kernel/qpixelformat/tst_qpixelformat.cpp b/tests/auto/gui/kernel/qpixelformat/tst_qpixelformat.cpp
index 0d5991ef41..a5f86c6c09 100644
--- a/tests/auto/gui/kernel/qpixelformat/tst_qpixelformat.cpp
+++ b/tests/auto/gui/kernel/qpixelformat/tst_qpixelformat.cpp
@@ -53,7 +53,7 @@ void tst_QPixelFormat::testOperators()
{
QPixelFormat first = qPixelFormatRgba(8,8,8,8,QPixelFormat::UsesAlpha, QPixelFormat::AtBeginning, QPixelFormat::Premultiplied);
QPixelFormat second = qPixelFormatRgba(8,8,8,8,QPixelFormat::UsesAlpha, QPixelFormat::AtBeginning, QPixelFormat::Premultiplied);
- QVERIFY(first == second);
+ QCOMPARE(first, second);
QPixelFormat third = qPixelFormatRgba(8,8,8,8,QPixelFormat::UsesAlpha, QPixelFormat::AtEnd, QPixelFormat::NotPremultiplied);
QVERIFY(first != third);
diff --git a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
index fd3cfd55ff..d754e0b3c3 100644
--- a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
+++ b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
@@ -39,33 +39,8 @@
#include <QtWidgets/QWidget>
#include <QtTest>
#include <qpa/qwindowsysteminterface.h>
-
-// FIXME: Use static functions of QWindowSystemInterface introduced with HighDPI scaling in 5.6 instead.
-static QWindowSystemInterface::TouchPoint touchPoint(const QTouchEvent::TouchPoint& pt)
-{
- QWindowSystemInterface::TouchPoint p;
- p.id = pt.id();
- p.flags = pt.flags();
- p.normalPosition = pt.normalizedPos();
- p.area = pt.screenRect();
- p.pressure = pt.pressure();
- p.state = pt.state();
- p.velocity = pt.velocity();
- p.rawPositions = pt.rawScreenPositions();
- return p;
-}
-
-static QList<struct QWindowSystemInterface::TouchPoint> touchPointList(const QList<QTouchEvent::TouchPoint>& pointList)
-{
- QList<struct QWindowSystemInterface::TouchPoint> newList;
-
- Q_FOREACH (QTouchEvent::TouchPoint p, pointList)
- {
- newList.append(touchPoint(p));
- }
- return newList;
-}
-
+#include <qpa/qwindowsysteminterface_p.h>
+#include <private/qhighdpiscaling_p.h>
class tst_QTouchEventWidget : public QWidget
{
@@ -622,11 +597,10 @@ void tst_QTouchEvent::basicRawEventTranslation()
rawPosList << QPointF(12, 34) << QPointF(56, 78);
rawTouchPoint.setRawScreenPositions(rawPosList);
const ulong timestamp = 1234;
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- timestamp,
- touchScreenDevice,
- touchPointList(
- QList<QTouchEvent::TouchPoint>() << rawTouchPoint));
+ QWindow *window = touchWidget.windowHandle();
+ QList<QWindowSystemInterface::TouchPoint> nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(QList<QTouchEvent::TouchPoint>() << rawTouchPoint, window);
+ QWindowSystemInterface::handleTouchEvent(window, timestamp, touchScreenDevice, nativeTouchPoints);
QCoreApplication::processEvents();
QVERIFY(touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
@@ -653,16 +627,16 @@ void tst_QTouchEvent::basicRawEventTranslation()
QCOMPARE(touchBeginPoint.sceneRect(), touchBeginPoint.screenRect());
QCOMPARE(touchBeginPoint.pressure(), qreal(1.));
QCOMPARE(touchBeginPoint.velocity(), QVector2D());
- QCOMPARE(touchBeginPoint.rawScreenPositions(), rawPosList);
+ if (!QHighDpiScaling::isActive())
+ QCOMPARE(touchBeginPoint.rawScreenPositions(), rawPosList);
// moving the point should translate to TouchUpdate
rawTouchPoint.setState(Qt::TouchPointMoved);
rawTouchPoint.setScreenPos(screenPos + delta);
rawTouchPoint.setNormalizedPos(normalized(rawTouchPoint.pos(), screenGeometry));
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchScreenDevice,
- touchPointList(QList<QTouchEvent::TouchPoint>() << rawTouchPoint));
+ nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(QList<QTouchEvent::TouchPoint>() << rawTouchPoint, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchScreenDevice, nativeTouchPoints);
QCoreApplication::processEvents();
QVERIFY(touchWidget.seenTouchBegin);
QVERIFY(touchWidget.seenTouchUpdate);
@@ -692,10 +666,9 @@ void tst_QTouchEvent::basicRawEventTranslation()
rawTouchPoint.setState(Qt::TouchPointReleased);
rawTouchPoint.setScreenPos(screenPos + delta + delta);
rawTouchPoint.setNormalizedPos(normalized(rawTouchPoint.pos(), screenGeometry));
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchScreenDevice,
- touchPointList(QList<QTouchEvent::TouchPoint>() << rawTouchPoint));
+ nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(QList<QTouchEvent::TouchPoint>() << rawTouchPoint, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchScreenDevice, nativeTouchPoints);
QCoreApplication::processEvents();
QVERIFY(touchWidget.seenTouchBegin);
QVERIFY(touchWidget.seenTouchUpdate);
@@ -762,10 +735,10 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchScreen()
rawTouchPoints[1].setState(Qt::TouchPointPressed);
rawTouchPoints[1].setScreenPos(rightScreenPos);
rawTouchPoints[1].setNormalizedPos(normalized(rawTouchPoints[1].pos(), screenGeometry));
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchScreenDevice,
- touchPointList(rawTouchPoints));
+ QWindow *window = touchWidget.windowHandle();
+ QList<QWindowSystemInterface::TouchPoint> nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(rawTouchPoints, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchScreenDevice, nativeTouchPoints);
QCoreApplication::processEvents();
QVERIFY(!touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
@@ -827,10 +800,9 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchScreen()
rawTouchPoints[1].setState(Qt::TouchPointMoved);
rawTouchPoints[1].setScreenPos(centerScreenPos);
rawTouchPoints[1].setNormalizedPos(normalized(rawTouchPoints[1].pos(), screenGeometry));
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchScreenDevice,
- touchPointList(rawTouchPoints));
+ nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(rawTouchPoints, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchScreenDevice, nativeTouchPoints);
QCoreApplication::processEvents();
QVERIFY(!touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
@@ -892,10 +864,9 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchScreen()
rawTouchPoints[1].setState(Qt::TouchPointReleased);
rawTouchPoints[1].setScreenPos(centerScreenPos);
rawTouchPoints[1].setNormalizedPos(normalized(rawTouchPoints[1].pos(), screenGeometry));
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchScreenDevice,
- touchPointList(rawTouchPoints));
+ nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(rawTouchPoints, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchScreenDevice, nativeTouchPoints);
QCoreApplication::processEvents();
QVERIFY(!touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
@@ -992,10 +963,10 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchPad()
rawTouchPoints[1].setState(Qt::TouchPointPressed);
rawTouchPoints[1].setScreenPos(rightScreenPos);
rawTouchPoints[1].setNormalizedPos(normalized(rawTouchPoints[1].pos(), screenGeometry));
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchPadDevice,
- touchPointList(rawTouchPoints));
+ QWindow *window = touchWidget.windowHandle();
+ QList<QWindowSystemInterface::TouchPoint> nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(rawTouchPoints, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchPadDevice, nativeTouchPoints);
QCoreApplication::processEvents();
QVERIFY(!touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
@@ -1058,10 +1029,9 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchPad()
rawTouchPoints[1].setState(Qt::TouchPointMoved);
rawTouchPoints[1].setScreenPos(centerScreenPos);
rawTouchPoints[1].setNormalizedPos(normalized(rawTouchPoints[1].pos(), screenGeometry));
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchPadDevice,
- touchPointList(rawTouchPoints));
+ nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(rawTouchPoints, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchPadDevice, nativeTouchPoints);
QCoreApplication::processEvents();
QVERIFY(!touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
@@ -1123,10 +1093,9 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchPad()
rawTouchPoints[1].setState(Qt::TouchPointReleased);
rawTouchPoints[1].setScreenPos(centerScreenPos);
rawTouchPoints[1].setNormalizedPos(normalized(rawTouchPoints[1].pos(), screenGeometry));
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchPadDevice,
- touchPointList(rawTouchPoints));
+ nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(rawTouchPoints, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchPadDevice, nativeTouchPoints);
QCoreApplication::processEvents();
QVERIFY(!touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
@@ -1385,10 +1354,10 @@ void tst_QTouchEvent::deleteInRawEventTranslation()
rawTouchPoints[2].setNormalizedPos(normalized(rawTouchPoints[2].pos(), screenGeometry));
// generate begin events on all widgets, the left widget should die
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchScreenDevice,
- touchPointList(rawTouchPoints));
+ QWindow *window = touchWidget.windowHandle();
+ QList<QWindowSystemInterface::TouchPoint> nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(rawTouchPoints, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchScreenDevice, nativeTouchPoints);
QCoreApplication::processEvents();
QVERIFY(leftWidget.isNull());
QVERIFY(!centerWidget.isNull());
@@ -1398,20 +1367,18 @@ void tst_QTouchEvent::deleteInRawEventTranslation()
rawTouchPoints[0].setState(Qt::TouchPointMoved);
rawTouchPoints[1].setState(Qt::TouchPointMoved);
rawTouchPoints[2].setState(Qt::TouchPointMoved);
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchScreenDevice,
- touchPointList(rawTouchPoints));
+ nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(rawTouchPoints, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchScreenDevice, nativeTouchPoints);
QCoreApplication::processEvents();
// generate end events on all widget, the right widget should die
rawTouchPoints[0].setState(Qt::TouchPointReleased);
rawTouchPoints[1].setState(Qt::TouchPointReleased);
rawTouchPoints[2].setState(Qt::TouchPointReleased);
- QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
- 0,
- touchScreenDevice,
- touchPointList(rawTouchPoints));
+ nativeTouchPoints =
+ QWindowSystemInterfacePrivate::toNativeTouchPoints(rawTouchPoints, window);
+ QWindowSystemInterface::handleTouchEvent(window, 0, touchScreenDevice, nativeTouchPoints);
QCoreApplication::processEvents();
}
@@ -1447,6 +1414,8 @@ void tst_QTouchEvent::crashInQGraphicsSceneAfterNotHandlingTouchBegin()
void tst_QTouchEvent::touchBeginWithGraphicsWidget()
{
+ if (QHighDpiScaling::isActive())
+ QSKIP("Fails when scaling is active");
QGraphicsScene scene;
QGraphicsView view(&scene);
view.setWindowTitle(QTest::currentTestFunction());
@@ -1605,12 +1574,15 @@ void tst_QTouchEvent::testMultiDevice()
QWindowSystemInterface::TouchPoint tp;
tp.id = 0;
tp.state = Qt::TouchPointPressed;
- tp.area = QRectF(120, 120, 20, 20);
+ const QPoint screenOrigin = w.screen()->geometry().topLeft();
+ const QRect area0(120, 120, 20, 20);
+ tp.area = QHighDpi::toNative(area0, QHighDpiScaling::factor(&w), screenOrigin);
pointsOne.append(tp);
pointsTwo.append(tp);
tp.id = 1;
- tp.area = QRectF(140, 140, 20, 20);
+ const QRect area1(140, 140, 20, 20);
+ tp.area = QHighDpi::toNative(area1, QHighDpiScaling::factor(&w), screenOrigin);
pointsTwo.append(tp);
QWindowSystemInterface::handleTouchEvent(&w, deviceOne, pointsOne);
@@ -1625,12 +1597,12 @@ void tst_QTouchEvent::testMultiDevice()
QCOMPARE(filter.d.value(deviceOne).points.count(), 1);
QCOMPARE(filter.d.value(deviceTwo).points.count(), 2);
- QCOMPARE(filter.d.value(deviceOne).points.at(0).screenRect(), pointsOne[0].area);
+ QCOMPARE(filter.d.value(deviceOne).points.at(0).screenRect(), QRectF(area0));
QCOMPARE(filter.d.value(deviceOne).points.at(0).state(), pointsOne[0].state);
- QCOMPARE(filter.d.value(deviceTwo).points.at(0).screenRect(), pointsTwo[0].area);
+ QCOMPARE(filter.d.value(deviceTwo).points.at(0).screenRect(), QRectF(area0));
QCOMPARE(filter.d.value(deviceTwo).points.at(0).state(), pointsTwo[0].state);
- QCOMPARE(filter.d.value(deviceTwo).points.at(1).screenRect(), pointsTwo[1].area);
+ QCOMPARE(filter.d.value(deviceTwo).points.at(1).screenRect(), QRectF(area1));
QCOMPARE(filter.d.value(deviceTwo).points.at(1).state(), pointsTwo[1].state);
}
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index d361aa12a6..a89f0da4d2 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -35,6 +35,7 @@
#include <qpa/qwindowsysteminterface.h>
#include <qpa/qplatformintegration.h>
#include <private/qguiapplication_p.h>
+#include <private/qhighdpiscaling_p.h>
#include <QtGui/QPainter>
#include <QtTest/QtTest>
@@ -94,6 +95,8 @@ private slots:
void windowsTransientChildren();
void requestUpdate();
void initTestCase();
+ void stateChange_data();
+ void stateChange();
void cleanup();
private:
@@ -265,6 +268,38 @@ void tst_QWindow::positioning_data()
#endif
}
+// Compare a window position that may go through scaling in the platform plugin with fuzz.
+static inline bool qFuzzyCompareWindowPosition(const QPoint &p1, const QPoint p2, int fuzz)
+{
+ return (p1 - p2).manhattanLength() <= fuzz;
+}
+
+static inline bool qFuzzyCompareWindowSize(const QSize &s1, const QSize &s2, int fuzz)
+{
+ const int manhattanLength = qAbs(s1.width() - s2.width()) + qAbs(s1.height() - s2.height());
+ return manhattanLength <= fuzz;
+}
+
+static inline bool qFuzzyCompareWindowGeometry(const QRect &r1, const QRect &r2, int fuzz)
+{
+ return qFuzzyCompareWindowPosition(r1.topLeft(), r2.topLeft(), fuzz)
+ && qFuzzyCompareWindowSize(r1.size(), r2.size(), fuzz);
+}
+
+static QString msgPointMismatch(const QPoint &p1, const QPoint p2)
+{
+ QString result;
+ QDebug(&result) << p1 << "!=" << p2 << ", manhattanLength=" << (p1 - p2).manhattanLength();
+ return result;
+}
+
+static QString msgRectMismatch(const QRect &r1, const QRect &r2)
+{
+ QString result;
+ QDebug(&result) << r1 << "!=" << r2;
+ return result;
+}
+
void tst_QWindow::positioning()
{
if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(
@@ -272,7 +307,7 @@ void tst_QWindow::positioning()
QSKIP("This platform does not support non-fullscreen windows");
}
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
// Some platforms enforce minimum widths for windows, which can cause extra resize
@@ -327,21 +362,25 @@ void tst_QWindow::positioning()
// if our positioning is actually fully respected by the window manager
// test whether it correctly handles frame positioning as well
if (originalPos == geometry.topLeft() && (originalMargins.top() != 0 || originalMargins.left() != 0)) {
- QPoint framePos = QPlatformScreen::platformScreenForWindow(&window)->availableGeometry().center();
+ const QScreen *screen = window.screen();
+ const QRect availableGeometry = screen->availableGeometry();
+ const QPoint framePos = availableGeometry.center();
window.reset();
const QPoint oldFramePos = window.framePosition();
window.setFramePosition(framePos);
QTRY_VERIFY(window.received(QEvent::Move));
- if (window.framePosition() != framePos) {
+ const int fuzz = int(QHighDpiScaling::factor(&window));
+ if (!qFuzzyCompareWindowPosition(window.framePosition(), framePos, fuzz)) {
qDebug() << "About to fail auto-test. Here is some additional information:";
qDebug() << "window.framePosition() == " << window.framePosition();
qDebug() << "old frame position == " << oldFramePos;
qDebug() << "We received " << window.received(QEvent::Move) << " move events";
qDebug() << "frame positions after each move event:" << window.m_framePositionsOnMove;
}
- QTRY_COMPARE(framePos, window.framePosition());
+ QTRY_VERIFY2(qFuzzyCompareWindowPosition(window.framePosition(), framePos, fuzz),
+ qPrintable(msgPointMismatch(window.framePosition(), framePos)));
QTRY_COMPARE(originalMargins, window.frameMargins());
QCOMPARE(window.position(), window.framePosition() + QPoint(originalMargins.left(), originalMargins.top()));
@@ -357,7 +396,8 @@ void tst_QWindow::positioning()
void tst_QWindow::positioningDuringMinimized()
{
// QTBUG-39544, setting a geometry in minimized state should work as well.
- if (QGuiApplication::platformName().compare("windows", Qt::CaseInsensitive))
+ if (QGuiApplication::platformName().compare("windows", Qt::CaseInsensitive) != 0
+ && QGuiApplication::platformName().compare("cocoa", Qt::CaseInsensitive) != 0)
QSKIP("Not supported on this platform");
Window window;
window.setTitle(QStringLiteral("positioningDuringMinimized"));
@@ -375,6 +415,52 @@ void tst_QWindow::positioningDuringMinimized()
QTRY_COMPARE(window.geometry(), newGeometry);
}
+// QTBUG-49709: Verify that the normal geometry is correctly restored
+// when executing a sequence of window state changes. So far, Windows
+// only where state changes have immediate effect.
+
+typedef QList<Qt::WindowState> WindowStateList;
+
+Q_DECLARE_METATYPE(WindowStateList)
+
+void tst_QWindow::stateChange_data()
+{
+ QTest::addColumn<WindowStateList>("stateSequence");
+
+ QTest::newRow("normal->min->normal") <<
+ (WindowStateList() << Qt::WindowMinimized << Qt::WindowNoState);
+ QTest::newRow("normal->maximized->normal") <<
+ (WindowStateList() << Qt::WindowMaximized << Qt::WindowNoState);
+ QTest::newRow("normal->fullscreen->normal") <<
+ (WindowStateList() << Qt::WindowFullScreen << Qt::WindowNoState);
+ QTest::newRow("normal->maximized->fullscreen->normal") <<
+ (WindowStateList() << Qt::WindowMaximized << Qt::WindowFullScreen << Qt::WindowNoState);
+}
+
+void tst_QWindow::stateChange()
+{
+ QFETCH(WindowStateList, stateSequence);
+
+ if (QGuiApplication::platformName().compare(QLatin1String("windows"), Qt::CaseInsensitive))
+ QSKIP("Windows-only test");
+
+ Window window;
+ window.setTitle(QLatin1String(QTest::currentTestFunction()) + QLatin1Char(' ') + QLatin1String(QTest::currentDataTag()));
+ const QRect normalGeometry(m_availableTopLeft + QPoint(40, 40), m_testWindowSize);
+ window.setGeometry(normalGeometry);
+ // explicitly use non-fullscreen show. show() can be fullscreen on some platforms
+ window.showNormal();
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
+ foreach (Qt::WindowState state, stateSequence) {
+ window.setWindowState(state);
+ QCoreApplication::processEvents();
+ }
+ const QRect geometry = window.geometry();
+ const int fuzz = int(QHighDpiScaling::factor(&window));
+ QVERIFY2(qFuzzyCompareWindowGeometry(geometry, normalGeometry, fuzz),
+ qPrintable(msgRectMismatch(geometry, normalGeometry)));
+}
+
class PlatformWindowFilter : public QObject
{
Q_OBJECT
@@ -418,14 +504,14 @@ void tst_QWindow::platformSurface()
QCOMPARE(window.geometry(), geometry);
window.create();
- QTRY_VERIFY(window.received(QEvent::PlatformSurface) == 1);
- QTRY_VERIFY(window.surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated);
+ QTRY_COMPARE(window.received(QEvent::PlatformSurface), 1);
+ QTRY_COMPARE(window.surfaceEventType(), QPlatformSurfaceEvent::SurfaceCreated);
QTRY_VERIFY(window.handle() != Q_NULLPTR);
window.destroy();
- QTRY_VERIFY(window.received(QEvent::PlatformSurface) == 2);
- QTRY_VERIFY(window.surfaceEventType() == QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed);
- QTRY_VERIFY(window.handle() == Q_NULLPTR);
+ QTRY_COMPARE(window.received(QEvent::PlatformSurface), 2);
+ QTRY_COMPARE(window.surfaceEventType(), QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed);
+ QTRY_VERIFY(!window.handle());
// Check for synchronous delivery of platform surface events and that the platform
// surface always existed upon event delivery
@@ -457,7 +543,7 @@ void tst_QWindow::isExposed()
window.hide();
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This is flaky. Figure out why.");
QCoreApplication::processEvents();
@@ -468,7 +554,7 @@ void tst_QWindow::isExposed()
void tst_QWindow::isActive()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
Window window;
@@ -487,7 +573,7 @@ void tst_QWindow::isActive()
context.swapBuffers(&window);
#endif
QTRY_COMPARE(window.received(QEvent::Resize), 1);
- QTRY_VERIFY(QGuiApplication::focusWindow() == &window);
+ QTRY_COMPARE(QGuiApplication::focusWindow(), &window);
QVERIFY(window.isActive());
Window child;
@@ -499,7 +585,7 @@ void tst_QWindow::isActive()
child.requestActivate();
- QTRY_VERIFY(QGuiApplication::focusWindow() == &child);
+ QTRY_COMPARE(QGuiApplication::focusWindow(), &child);
QVERIFY(child.isActive());
// parent shouldn't receive new resize events from child being shown
@@ -522,7 +608,7 @@ void tst_QWindow::isActive()
QTRY_VERIFY(dialog.isExposed());
QCoreApplication::processEvents();
QTRY_COMPARE(dialog.received(QEvent::Resize), 1);
- QTRY_VERIFY(QGuiApplication::focusWindow() == &dialog);
+ QTRY_COMPARE(QGuiApplication::focusWindow(), &dialog);
QVERIFY(dialog.isActive());
// transient child has focus
@@ -533,7 +619,7 @@ void tst_QWindow::isActive()
window.requestActivate();
- QTRY_VERIFY(QGuiApplication::focusWindow() == &window);
+ QTRY_COMPARE(QGuiApplication::focusWindow(), &window);
QCoreApplication::processEvents();
QTRY_COMPARE(dialog.received(QEvent::FocusOut), 1);
QTRY_COMPARE(window.received(QEvent::FocusIn), 2);
@@ -654,15 +740,13 @@ void tst_QWindow::testInputEvents()
window.showNormal();
QVERIFY(QTest::qWaitForWindowExposed(&window));
- QWindowSystemInterface::handleKeyEvent(&window, QEvent::KeyPress, Qt::Key_A, Qt::NoModifier);
- QWindowSystemInterface::handleKeyEvent(&window, QEvent::KeyRelease, Qt::Key_A, Qt::NoModifier);
+ QTest::keyClick(&window, Qt::Key_A, Qt::NoModifier);
QCoreApplication::processEvents();
QCOMPARE(window.keyPressCode, int(Qt::Key_A));
QCOMPARE(window.keyReleaseCode, int(Qt::Key_A));
QPointF local(12, 34);
- QWindowSystemInterface::handleMouseEvent(&window, local, local, Qt::LeftButton);
- QWindowSystemInterface::handleMouseEvent(&window, local, local, Qt::NoButton);
+ QTest::mouseClick(&window, Qt::LeftButton, Qt::NoModifier, local.toPoint());
QCoreApplication::processEvents();
QCOMPARE(window.mousePressButton, int(Qt::LeftButton));
QCOMPARE(window.mouseReleaseButton, int(Qt::LeftButton));
@@ -688,15 +772,17 @@ void tst_QWindow::testInputEvents()
// Now with null pointer as window. local param should not be utilized:
// handleMouseEvent() with tlw == 0 means the event is in global coords only.
window.mousePressButton = window.mouseReleaseButton = 0;
- QPointF nonWindowGlobal(window.geometry().topRight() + QPoint(200, 50)); // not inside the window
- QWindowSystemInterface::handleMouseEvent(0, nonWindowGlobal, nonWindowGlobal, Qt::LeftButton);
- QWindowSystemInterface::handleMouseEvent(0, nonWindowGlobal, nonWindowGlobal, Qt::NoButton);
+ const QPointF nonWindowGlobal(window.geometry().topRight() + QPoint(200, 50)); // not inside the window
+ const QPointF deviceNonWindowGlobal = QHighDpi::toNativePixels(nonWindowGlobal, window.screen());
+ QWindowSystemInterface::handleMouseEvent(0, deviceNonWindowGlobal, deviceNonWindowGlobal, Qt::LeftButton);
+ QWindowSystemInterface::handleMouseEvent(0, deviceNonWindowGlobal, deviceNonWindowGlobal, Qt::NoButton);
QCoreApplication::processEvents();
QCOMPARE(window.mousePressButton, 0);
QCOMPARE(window.mouseReleaseButton, 0);
- QPointF windowGlobal = window.mapToGlobal(local.toPoint());
- QWindowSystemInterface::handleMouseEvent(0, windowGlobal, windowGlobal, Qt::LeftButton);
- QWindowSystemInterface::handleMouseEvent(0, windowGlobal, windowGlobal, Qt::NoButton);
+ const QPointF windowGlobal = window.mapToGlobal(local.toPoint());
+ const QPointF deviceWindowGlobal = QHighDpi::toNativePixels(windowGlobal, window.screen());
+ QWindowSystemInterface::handleMouseEvent(0, deviceWindowGlobal, deviceWindowGlobal, Qt::LeftButton);
+ QWindowSystemInterface::handleMouseEvent(0, deviceWindowGlobal, deviceWindowGlobal, Qt::NoButton);
QCoreApplication::processEvents();
QCOMPARE(window.mousePressButton, int(Qt::LeftButton));
QCOMPARE(window.mouseReleaseButton, int(Qt::LeftButton));
@@ -718,7 +804,7 @@ void tst_QWindow::touchToMouseTranslation()
const QRectF moveArea(105, 108, 4, 4);
tp1.id = 1;
tp1.state = Qt::TouchPointPressed;
- tp1.area = pressArea;
+ tp1.area = QHighDpi::toNativePixels(pressArea, &window);
tp2.id = 2;
tp2.state = Qt::TouchPointPressed;
points << tp1 << tp2;
@@ -729,7 +815,7 @@ void tst_QWindow::touchToMouseTranslation()
tp1.state = Qt::TouchPointStationary;
tp2.id = 1;
tp2.state = Qt::TouchPointMoved;
- tp2.area = moveArea;
+ tp2.area = QHighDpi::toNativePixels(moveArea, &window);
points.clear();
points << tp1 << tp2;
QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points);
@@ -946,12 +1032,15 @@ void tst_QWindow::touchCancelWithTouchToMouse()
tp1.id = 1;
tp1.state = Qt::TouchPointPressed;
- tp1.area = QRect(100, 100, 4, 4);
+ const QRect area(100, 100, 4, 4);
+ tp1.area = QHighDpi::toNativePixels(area, &window);
points << tp1;
QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points);
QCoreApplication::processEvents();
QTRY_COMPARE(window.mousePressButton, int(Qt::LeftButton));
- QTRY_COMPARE(window.mousePressScreenPos, points[0].area.center());
+ const int fuzz = 2 * int(QHighDpiScaling::factor(&window));
+ QTRY_VERIFY2(qFuzzyCompareWindowPosition(window.mousePressScreenPos.toPoint(), area.center(), fuzz),
+ qPrintable(msgPointMismatch(window.mousePressScreenPos.toPoint(), area.center())));
// Cancel the touch. Should result in a mouse release for windows that have
// have an active touch-to-mouse sequence.
@@ -1112,7 +1201,7 @@ void tst_QWindow::close()
void tst_QWindow::activateAndClose()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
for (int i = 0; i < 10; ++i) {
@@ -1149,8 +1238,9 @@ void tst_QWindow::mouseEventSequence()
ulong timestamp = 0;
QPointF local(12, 34);
- QWindowSystemInterface::handleMouseEvent(&window, timestamp++, local, local, Qt::LeftButton);
- QWindowSystemInterface::handleMouseEvent(&window, timestamp++, local, local, Qt::NoButton);
+ const QPointF deviceLocal = QHighDpi::toNativePixels(local, &window);
+ QWindowSystemInterface::handleMouseEvent(&window, timestamp++, deviceLocal, deviceLocal, Qt::LeftButton);
+ QWindowSystemInterface::handleMouseEvent(&window, timestamp++, deviceLocal, deviceLocal, Qt::NoButton);
QCoreApplication::processEvents();
QCOMPARE(window.mousePressedCount, 1);
QCOMPARE(window.mouseReleasedCount, 1);
@@ -1308,14 +1398,14 @@ void tst_QWindow::inputReentrancy()
class TabletTestWindow : public QWindow
{
public:
- TabletTestWindow() : eventType(0) { }
+ TabletTestWindow() : eventType(QEvent::None) { }
void tabletEvent(QTabletEvent *ev) {
eventType = ev->type();
eventGlobal = ev->globalPosF();
eventLocal = ev->posF();
eventDevice = ev->device();
}
- int eventType;
+ QEvent::Type eventType;
QPointF eventGlobal, eventLocal;
int eventDevice;
bool eventFilter(QObject *obj, QEvent *ev) {
@@ -1337,25 +1427,27 @@ void tst_QWindow::tabletEvents()
window.setGeometry(QRect(m_availableTopLeft + QPoint(10, 10), m_testWindowSize));
qGuiApp->installEventFilter(&window);
- QPoint local(10, 10);
- QPoint global = window.mapToGlobal(local);
- QWindowSystemInterface::handleTabletEvent(&window, true, local, global, 1, 2, 0.5, 1, 2, 0.1, 0, 0, 0);
+ const QPoint local(10, 10);
+ const QPoint global = window.mapToGlobal(local);
+ const QPoint deviceLocal = QHighDpi::toNativeLocalPosition(local, &window);
+ const QPoint deviceGlobal = QHighDpi::toNativePixels(global, window.screen());
+ QWindowSystemInterface::handleTabletEvent(&window, true, deviceLocal, deviceGlobal, 1, 2, 0.5, 1, 2, 0.1, 0, 0, 0);
QCoreApplication::processEvents();
QTRY_VERIFY(window.eventType == QEvent::TabletPress);
QTRY_COMPARE(window.eventGlobal.toPoint(), global);
QTRY_COMPARE(window.eventLocal.toPoint(), local);
- QWindowSystemInterface::handleTabletEvent(&window, false, local, global, 1, 2, 0.5, 1, 2, 0.1, 0, 0, 0);
+ QWindowSystemInterface::handleTabletEvent(&window, false, deviceLocal, deviceGlobal, 1, 2, 0.5, 1, 2, 0.1, 0, 0, 0);
QCoreApplication::processEvents();
- QTRY_VERIFY(window.eventType == QEvent::TabletRelease);
+ QTRY_COMPARE(window.eventType, QEvent::TabletRelease);
QWindowSystemInterface::handleTabletEnterProximityEvent(1, 2, 3);
QCoreApplication::processEvents();
- QTRY_VERIFY(window.eventType == QEvent::TabletEnterProximity);
+ QTRY_COMPARE(window.eventType, QEvent::TabletEnterProximity);
QTRY_COMPARE(window.eventDevice, 1);
QWindowSystemInterface::handleTabletLeaveProximityEvent(1, 2, 3);
QCoreApplication::processEvents();
- QTRY_VERIFY(window.eventType == QEvent::TabletLeaveProximity);
+ QTRY_COMPARE(window.eventType, QEvent::TabletLeaveProximity);
QTRY_COMPARE(window.eventDevice, 1);
#endif
@@ -1363,7 +1455,7 @@ void tst_QWindow::tabletEvents()
void tst_QWindow::windowModality_QTBUG27039()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
QWindow parent;
@@ -1458,7 +1550,7 @@ void tst_QWindow::mask()
void tst_QWindow::initialSize()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
QSize defaultSize(0,0);
@@ -1499,7 +1591,7 @@ void tst_QWindow::initialSize()
void tst_QWindow::modalDialog()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
QWindow normalWindow;
@@ -1525,7 +1617,7 @@ void tst_QWindow::modalDialog()
void tst_QWindow::modalDialogClosingOneOfTwoModal()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
QWindow normalWindow;
@@ -1563,7 +1655,7 @@ void tst_QWindow::modalDialogClosingOneOfTwoModal()
void tst_QWindow::modalWithChildWindow()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
QWindow normalWindow;
@@ -1597,7 +1689,7 @@ void tst_QWindow::modalWithChildWindow()
void tst_QWindow::modalWindowModallity()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
QWindow normal_window;
@@ -1703,13 +1795,13 @@ void tst_QWindow::requestUpdate()
QCoreApplication::processEvents();
QTRY_VERIFY(window.isExposed());
- QVERIFY(window.received(QEvent::UpdateRequest) == 0);
+ QCOMPARE(window.received(QEvent::UpdateRequest), 0);
window.requestUpdate();
- QTRY_VERIFY(window.received(QEvent::UpdateRequest) == 1);
+ QTRY_COMPARE(window.received(QEvent::UpdateRequest), 1);
window.requestUpdate();
- QTRY_VERIFY(window.received(QEvent::UpdateRequest) == 2);
+ QTRY_COMPARE(window.received(QEvent::UpdateRequest), 2);
}
#include <tst_qwindow.moc>
diff --git a/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp b/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
index e7659a25bd..463322ff2a 100644
--- a/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
+++ b/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
@@ -673,7 +673,7 @@ void tst_QMatrixNxN::compare2x2()
QMatrix2x2 m2(uniqueValues2);
QMatrix2x2 m3(transposedValues2);
- QVERIFY(m1 == m2);
+ QCOMPARE(m1, m2);
QVERIFY(!(m1 != m2));
QVERIFY(m1 != m3);
QVERIFY(!(m1 == m3));
@@ -686,7 +686,7 @@ void tst_QMatrixNxN::compare3x3()
QMatrix3x3 m2(uniqueValues3);
QMatrix3x3 m3(transposedValues3);
- QVERIFY(m1 == m2);
+ QCOMPARE(m1, m2);
QVERIFY(!(m1 != m2));
QVERIFY(m1 != m3);
QVERIFY(!(m1 == m3));
@@ -699,7 +699,7 @@ void tst_QMatrixNxN::compare4x4()
QMatrix4x4 m2(uniqueValues4);
QMatrix4x4 m3(transposedValues4);
- QVERIFY(m1 == m2);
+ QCOMPARE(m1, m2);
QVERIFY(!(m1 != m2));
QVERIFY(m1 != m3);
QVERIFY(!(m1 == m3));
@@ -712,7 +712,7 @@ void tst_QMatrixNxN::compare4x3()
QMatrix4x3 m2(uniqueValues4x3);
QMatrix4x3 m3(transposedValues3x4);
- QVERIFY(m1 == m2);
+ QCOMPARE(m1, m2);
QVERIFY(!(m1 != m2));
QVERIFY(m1 != m3);
QVERIFY(!(m1 == m3));
@@ -1858,7 +1858,7 @@ void tst_QMatrixNxN::inverted4x4()
if (invertible)
QVERIFY(m1.determinant() != 0.0f);
else
- QVERIFY(m1.determinant() == 0.0f);
+ QCOMPARE(m1.determinant(), 0.0f);
Matrix4 m1alt;
memcpy(m1alt.v, (const float *)m1Values, sizeof(m1alt.v));
@@ -1992,7 +1992,7 @@ void tst_QMatrixNxN::scale4x4()
if (z == 1.0f) {
QMatrix4x4 m2b;
m2b.scale(x, y);
- QVERIFY(m2b == m2);
+ QCOMPARE(m2b, m2);
}
QVector3D v1(2.0f, 3.0f, -4.0f);
@@ -2051,7 +2051,7 @@ void tst_QMatrixNxN::scale4x4()
if (z == 1.0f) {
QMatrix4x4 m4b(m3);
m4b.scale(x, y);
- QVERIFY(m4b == m4);
+ QCOMPARE(m4b, m4);
}
// Test coverage when the special matrix type is unknown.
@@ -2138,7 +2138,7 @@ void tst_QMatrixNxN::translate4x4()
if (z == 0.0f) {
QMatrix4x4 m2b;
m2b.translate(x, y);
- QVERIFY(m2b == m2);
+ QCOMPARE(m2b, m2);
}
QVector3D v1(2.0f, 3.0f, -4.0f);
@@ -2179,7 +2179,7 @@ void tst_QMatrixNxN::translate4x4()
if (z == 0.0f) {
QMatrix4x4 m4b(m3);
m4b.translate(x, y);
- QVERIFY(m4b == m4);
+ QCOMPARE(m4b, m4);
}
}
@@ -3073,7 +3073,7 @@ void tst_QMatrixNxN::convertQMatrix()
QPointF p2 = m2 * QPointF(100.0, 150.0);
QCOMPARE((double)p2.x(), 100.0 - 3.5);
QCOMPARE((double)p2.y(), 150.0 + 2.0);
- QVERIFY(m1 == m2.toAffine());
+ QCOMPARE(m1, m2.toAffine());
QMatrix m3;
m3.scale(1.5, -2.0);
@@ -3085,7 +3085,7 @@ void tst_QMatrixNxN::convertQMatrix()
QPointF p4 = m4 * QPointF(100.0, 150.0);
QCOMPARE((double)p4.x(), 1.5 * 100.0);
QCOMPARE((double)p4.y(), -2.0 * 150.0);
- QVERIFY(m3 == m4.toAffine());
+ QCOMPARE(m3, m4.toAffine());
QMatrix m5;
m5.rotate(45.0);
@@ -3120,7 +3120,7 @@ void tst_QMatrixNxN::convertQTransform()
QPointF p2 = m2 * QPointF(100.0, 150.0);
QCOMPARE((double)p2.x(), 100.0 - 3.5);
QCOMPARE((double)p2.y(), 150.0 + 2.0);
- QVERIFY(m1 == m2.toTransform());
+ QCOMPARE(m1, m2.toTransform());
QTransform m3;
m3.scale(1.5, -2.0);
@@ -3132,7 +3132,7 @@ void tst_QMatrixNxN::convertQTransform()
QPointF p4 = m4 * QPointF(100.0, 150.0);
QCOMPARE((double)p4.x(), 1.5 * 100.0);
QCOMPARE((double)p4.y(), -2.0 * 150.0);
- QVERIFY(m3 == m4.toTransform());
+ QCOMPARE(m3, m4.toTransform());
QTransform m5;
m5.rotate(45.0);
@@ -3206,16 +3206,16 @@ void tst_QMatrixNxN::mapRect()
QRect recti(qRound(x), qRound(y), qRound(width), qRound(height));
QMatrix4x4 m1;
- QVERIFY(m1.mapRect(rect) == rect);
- QVERIFY(m1.mapRect(recti) == recti);
+ QCOMPARE(m1.mapRect(rect), rect);
+ QCOMPARE(m1.mapRect(recti), recti);
QMatrix4x4 m2;
m2.translate(-100.5f, 64.0f);
QRectF translated = rect.translated(-100.5f, 64.0f);
QRect translatedi = QRect(qRound(recti.x() - 100.5f), recti.y() + 64,
recti.width(), recti.height());
- QVERIFY(m2.mapRect(rect) == translated);
- QVERIFY(m2.mapRect(recti) == translatedi);
+ QCOMPARE(m2.mapRect(rect), translated);
+ QCOMPARE(m2.mapRect(recti), translatedi);
QMatrix4x4 m3;
m3.scale(-100.5f, 64.0f);
@@ -3232,7 +3232,7 @@ void tst_QMatrixNxN::mapRect()
scaley -= scaleht;
}
QRectF scaled(scalex, scaley, scalewid, scaleht);
- QVERIFY(m3.mapRect(rect) == scaled);
+ QCOMPARE(m3.mapRect(rect), scaled);
scalex = recti.x() * -100.5f;
scaley = recti.y() * 64.0f;
scalewid = recti.width() * -100.5f;
@@ -3247,7 +3247,7 @@ void tst_QMatrixNxN::mapRect()
}
QRect scaledi(qRound(scalex), qRound(scaley),
qRound(scalewid), qRound(scaleht));
- QVERIFY(m3.mapRect(recti) == scaledi);
+ QCOMPARE(m3.mapRect(recti), scaledi);
QMatrix4x4 m4;
m4.translate(-100.5f, 64.0f);
@@ -3261,7 +3261,7 @@ void tst_QMatrixNxN::mapRect()
if (transy1 > transy2)
qSwap(transy1, transy2);
QRectF trans(transx1, transy1, transx2 - transx1, transy2 - transy1);
- QVERIFY(m4.mapRect(rect) == trans);
+ QCOMPARE(m4.mapRect(rect), trans);
transx1 = recti.x() * -2.5f - 100.5f;
transy1 = recti.y() * 4.0f + 64.0f;
transx2 = (recti.x() + recti.width()) * -2.5f - 100.5f;
@@ -3273,7 +3273,7 @@ void tst_QMatrixNxN::mapRect()
QRect transi(qRound(transx1), qRound(transy1),
qRound(transx2) - qRound(transx1),
qRound(transy2) - qRound(transy1));
- QVERIFY(m4.mapRect(recti) == transi);
+ QCOMPARE(m4.mapRect(recti), transi);
m4.rotate(45.0f, 0.0f, 0.0f, 1.0f);
@@ -3290,7 +3290,7 @@ void tst_QMatrixNxN::mapRect()
QRect mri = m4.mapRect(recti);
QRect tri = t4.mapRect(recti);
- QVERIFY(mri == tri);
+ QCOMPARE(mri, tri);
}
void tst_QMatrixNxN::mapVector_data()
@@ -3389,14 +3389,14 @@ void tst_QMatrixNxN::properties()
void tst_QMatrixNxN::metaTypes()
{
- QVERIFY(QMetaType::type("QMatrix4x4") == QMetaType::QMatrix4x4);
+ QCOMPARE(QMetaType::type("QMatrix4x4"), int(QMetaType::QMatrix4x4));
QCOMPARE(QByteArray(QMetaType::typeName(QMetaType::QMatrix4x4)),
QByteArray("QMatrix4x4"));
QVERIFY(QMetaType::isRegistered(QMetaType::QMatrix4x4));
- QVERIFY(qMetaTypeId<QMatrix4x4>() == QMetaType::QMatrix4x4);
+ QCOMPARE(qMetaTypeId<QMatrix4x4>(), int(QMetaType::QMatrix4x4));
}
QTEST_APPLESS_MAIN(tst_QMatrixNxN)
diff --git a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
index ec7af97f07..1fbad5b829 100644
--- a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
+++ b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
@@ -446,7 +446,7 @@ void tst_QQuaternion::compare()
QQuaternion v5(8, 1, 2, 3);
QQuaternion v6(3, 1, 2, 4);
- QVERIFY(v1 == v2);
+ QCOMPARE(v1, v2);
QVERIFY(v1 != v3);
QVERIFY(v1 != v4);
QVERIFY(v1 != v5);
@@ -522,7 +522,7 @@ void tst_QQuaternion::add()
QQuaternion v4(v1);
v4 += v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() + v2.x());
QCOMPARE(v4.y(), v1.y() + v2.y());
@@ -560,7 +560,7 @@ void tst_QQuaternion::subtract()
QQuaternion v4(v3);
v4 -= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() - v1.x());
QCOMPARE(v4.y(), v3.y() - v1.y());
@@ -569,7 +569,7 @@ void tst_QQuaternion::subtract()
QQuaternion v5(v3);
v5 -= v2;
- QVERIFY(v5 == v1);
+ QCOMPARE(v5, v1);
QCOMPARE(v5.x(), v3.x() - v2.x());
QCOMPARE(v5.y(), v3.y() - v2.y());
@@ -704,7 +704,7 @@ void tst_QQuaternion::multiplyFactor()
QQuaternion v3(v1);
v3 *= factor;
- QVERIFY(v3 == v2);
+ QCOMPARE(v3, v2);
QCOMPARE(v3.x(), v1.x() * factor);
QCOMPARE(v3.y(), v1.y() * factor);
@@ -740,7 +740,7 @@ void tst_QQuaternion::divide()
QQuaternion v3(v2);
v3 /= factor;
- QVERIFY(v3 == v1);
+ QCOMPARE(v3, v1);
QCOMPARE(v3.x(), v2.x() / factor);
QCOMPARE(v3.y(), v2.y() / factor);
@@ -764,7 +764,7 @@ void tst_QQuaternion::negate()
QQuaternion v1(w1, x1, y1, z1);
QQuaternion v2(-w1, -x1, -y1, -z1);
- QVERIFY(-v1 == v2);
+ QCOMPARE(-v1, v2);
}
// Test quaternion conjugate calculations.
@@ -783,7 +783,7 @@ void tst_QQuaternion::conjugate()
QQuaternion v1(w1, x1, y1, z1);
QQuaternion v2(w1, -x1, -y1, -z1);
- QVERIFY(v1.conjugate() == v2);
+ QCOMPARE(v1.conjugate(), v2);
}
// Test quaternion creation from an axis and an angle.
@@ -1325,14 +1325,14 @@ void tst_QQuaternion::properties()
void tst_QQuaternion::metaTypes()
{
- QVERIFY(QMetaType::type("QQuaternion") == QMetaType::QQuaternion);
+ QCOMPARE(QMetaType::type("QQuaternion"), int(QMetaType::QQuaternion));
QCOMPARE(QByteArray(QMetaType::typeName(QMetaType::QQuaternion)),
QByteArray("QQuaternion"));
QVERIFY(QMetaType::isRegistered(QMetaType::QQuaternion));
- QVERIFY(qMetaTypeId<QQuaternion>() == QMetaType::QQuaternion);
+ QCOMPARE(qMetaTypeId<QQuaternion>(), int(QMetaType::QQuaternion));
}
QTEST_APPLESS_MAIN(tst_QQuaternion)
diff --git a/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp b/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp
index d2e0bbe375..eeff2c3bae 100644
--- a/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp
+++ b/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp
@@ -885,7 +885,7 @@ void tst_QVectorND::compare2()
QVector2D v3(3, 2);
QVector2D v4(1, 3);
- QVERIFY(v1 == v2);
+ QCOMPARE(v1, v2);
QVERIFY(v1 != v3);
QVERIFY(v1 != v4);
}
@@ -899,7 +899,7 @@ void tst_QVectorND::compare3()
QVector3D v4(1, 3, 4);
QVector3D v5(1, 2, 3);
- QVERIFY(v1 == v2);
+ QCOMPARE(v1, v2);
QVERIFY(v1 != v3);
QVERIFY(v1 != v4);
QVERIFY(v1 != v5);
@@ -915,7 +915,7 @@ void tst_QVectorND::compare4()
QVector4D v5(1, 2, 3, 8);
QVector4D v6(1, 2, 4, 3);
- QVERIFY(v1 == v2);
+ QCOMPARE(v1, v2);
QVERIFY(v1 != v3);
QVERIFY(v1 != v4);
QVERIFY(v1 != v5);
@@ -969,7 +969,7 @@ void tst_QVectorND::add2()
QVector2D v4(v1);
v4 += v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() + v2.x());
QCOMPARE(v4.y(), v1.y() + v2.y());
@@ -1033,7 +1033,7 @@ void tst_QVectorND::add3()
QVector3D v4(v1);
v4 += v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() + v2.x());
QCOMPARE(v4.y(), v1.y() + v2.y());
@@ -1109,7 +1109,7 @@ void tst_QVectorND::add4()
QVector4D v4(v1);
v4 += v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() + v2.x());
QCOMPARE(v4.y(), v1.y() + v2.y());
@@ -1141,14 +1141,14 @@ void tst_QVectorND::subtract2()
QVector2D v4(v3);
v4 -= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() - v1.x());
QCOMPARE(v4.y(), v3.y() - v1.y());
QVector2D v5(v3);
v5 -= v2;
- QVERIFY(v5 == v1);
+ QCOMPARE(v5, v1);
QCOMPARE(v5.x(), v3.x() - v2.x());
QCOMPARE(v5.y(), v3.y() - v2.y());
@@ -1181,7 +1181,7 @@ void tst_QVectorND::subtract3()
QVector3D v4(v3);
v4 -= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() - v1.x());
QCOMPARE(v4.y(), v3.y() - v1.y());
@@ -1189,7 +1189,7 @@ void tst_QVectorND::subtract3()
QVector3D v5(v3);
v5 -= v2;
- QVERIFY(v5 == v1);
+ QCOMPARE(v5, v1);
QCOMPARE(v5.x(), v3.x() - v2.x());
QCOMPARE(v5.y(), v3.y() - v2.y());
@@ -1226,7 +1226,7 @@ void tst_QVectorND::subtract4()
QVector4D v4(v3);
v4 -= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() - v1.x());
QCOMPARE(v4.y(), v3.y() - v1.y());
@@ -1235,7 +1235,7 @@ void tst_QVectorND::subtract4()
QVector4D v5(v3);
v5 -= v2;
- QVERIFY(v5 == v1);
+ QCOMPARE(v5, v1);
QCOMPARE(v5.x(), v3.x() - v2.x());
QCOMPARE(v5.y(), v3.y() - v2.y());
@@ -1290,7 +1290,7 @@ void tst_QVectorND::multiply2()
QVector2D v4(v1);
v4 *= v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() * v2.x());
QCOMPARE(v4.y(), v1.y() * v2.y());
@@ -1354,7 +1354,7 @@ void tst_QVectorND::multiply3()
QVector3D v4(v1);
v4 *= v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() * v2.x());
QCOMPARE(v4.y(), v1.y() * v2.y());
@@ -1430,7 +1430,7 @@ void tst_QVectorND::multiply4()
QVector4D v4(v1);
v4 *= v2;
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
QCOMPARE(v4.x(), v1.x() * v2.x());
QCOMPARE(v4.y(), v1.y() * v2.y());
@@ -1488,7 +1488,7 @@ void tst_QVectorND::multiplyFactor2()
QVector2D v3(v1);
v3 *= factor;
- QVERIFY(v3 == v2);
+ QCOMPARE(v3, v2);
QCOMPARE(v3.x(), v1.x() * factor);
QCOMPARE(v3.y(), v1.y() * factor);
@@ -1553,7 +1553,7 @@ void tst_QVectorND::multiplyFactor3()
QVector3D v3(v1);
v3 *= factor;
- QVERIFY(v3 == v2);
+ QCOMPARE(v3, v2);
QCOMPARE(v3.x(), v1.x() * factor);
QCOMPARE(v3.y(), v1.y() * factor);
@@ -1628,7 +1628,7 @@ void tst_QVectorND::multiplyFactor4()
QVector4D v3(v1);
v3 *= factor;
- QVERIFY(v3 == v2);
+ QCOMPARE(v3, v2);
QCOMPARE(v3.x(), v1.x() * factor);
QCOMPARE(v3.y(), v1.y() * factor);
@@ -1660,7 +1660,7 @@ void tst_QVectorND::divide2()
QVector2D v4(v3);
v4 /= v2;
- QVERIFY(v4 == v1);
+ QCOMPARE(v4, v1);
QCOMPARE(v4.x(), v3.x() / v2.x());
QCOMPARE(v4.y(), v3.y() / v2.y());
@@ -1670,7 +1670,7 @@ void tst_QVectorND::divide2()
QVector2D v4(v3);
v4 /= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() / v1.x());
QCOMPARE(v4.y(), v3.y() / v1.y());
@@ -1704,7 +1704,7 @@ void tst_QVectorND::divide3()
QVector3D v4(v3);
v4 /= v2;
- QVERIFY(v4 == v1);
+ QCOMPARE(v4, v1);
QCOMPARE(v4.x(), v3.x() / v2.x());
QCOMPARE(v4.y(), v3.y() / v2.y());
@@ -1715,7 +1715,7 @@ void tst_QVectorND::divide3()
QVector3D v4(v3);
v4 /= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() / v1.x());
QCOMPARE(v4.y(), v3.y() / v1.y());
@@ -1753,7 +1753,7 @@ void tst_QVectorND::divide4()
QVector4D v4(v3);
v4 /= v2;
- QVERIFY(v4 == v1);
+ QCOMPARE(v4, v1);
QCOMPARE(v4.x(), v3.x() / v2.x());
QCOMPARE(v4.y(), v3.y() / v2.y());
@@ -1765,7 +1765,7 @@ void tst_QVectorND::divide4()
QVector4D v4(v3);
v4 /= v1;
- QVERIFY(v4 == v2);
+ QCOMPARE(v4, v2);
QCOMPARE(v4.x(), v3.x() / v1.x());
QCOMPARE(v4.y(), v3.y() / v1.y());
@@ -1798,7 +1798,7 @@ void tst_QVectorND::divideFactor2()
QVector2D v3(v2);
v3 /= factor;
- QVERIFY(v3 == v1);
+ QCOMPARE(v3, v1);
QCOMPARE(v3.x(), v2.x() / factor);
QCOMPARE(v3.y(), v2.y() / factor);
@@ -1830,7 +1830,7 @@ void tst_QVectorND::divideFactor3()
QVector3D v3(v2);
v3 /= factor;
- QVERIFY(v3 == v1);
+ QCOMPARE(v3, v1);
QCOMPARE(v3.x(), v2.x() / factor);
QCOMPARE(v3.y(), v2.y() / factor);
@@ -1865,7 +1865,7 @@ void tst_QVectorND::divideFactor4()
QVector4D v3(v2);
v3 /= factor;
- QVERIFY(v3 == v1);
+ QCOMPARE(v3, v1);
QCOMPARE(v3.x(), v2.x() / factor);
QCOMPARE(v3.y(), v2.y() / factor);
@@ -1887,7 +1887,7 @@ void tst_QVectorND::negate2()
QVector2D v1(x1, y1);
QVector2D v2(-x1, -y1);
- QVERIFY(-v1 == v2);
+ QCOMPARE(-v1, v2);
}
// Test vector negation for 3D vectors.
@@ -1905,7 +1905,7 @@ void tst_QVectorND::negate3()
QVector3D v1(x1, y1, z1);
QVector3D v2(-x1, -y1, -z1);
- QVERIFY(-v1 == v2);
+ QCOMPARE(-v1, v2);
}
// Test vector negation for 4D vectors.
@@ -1924,7 +1924,7 @@ void tst_QVectorND::negate4()
QVector4D v1(x1, y1, z1, w1);
QVector4D v2(-x1, -y1, -z1, -w1);
- QVERIFY(-v1 == v2);
+ QCOMPARE(-v1, v2);
}
// Test the computation of vector cross-products.
@@ -1976,7 +1976,7 @@ void tst_QVectorND::crossProduct()
QVector3D v3(x3, y3, z3);
QVector3D v4 = QVector3D::crossProduct(v1, v2);
- QVERIFY(v4 == v3);
+ QCOMPARE(v4, v3);
// Compute the cross-product long-hand and check again.
float xres = y1 * z2 - z1 * y2;
@@ -2667,9 +2667,9 @@ void tst_QVectorND::properties()
void tst_QVectorND::metaTypes()
{
- QVERIFY(QMetaType::type("QVector2D") == QMetaType::QVector2D);
- QVERIFY(QMetaType::type("QVector3D") == QMetaType::QVector3D);
- QVERIFY(QMetaType::type("QVector4D") == QMetaType::QVector4D);
+ QCOMPARE(QMetaType::type("QVector2D"), int(QMetaType::QVector2D));
+ QCOMPARE(QMetaType::type("QVector3D"), int(QMetaType::QVector3D));
+ QCOMPARE(QMetaType::type("QVector4D"), int(QMetaType::QVector4D));
QCOMPARE(QByteArray(QMetaType::typeName(QMetaType::QVector2D)),
QByteArray("QVector2D"));
@@ -2682,9 +2682,9 @@ void tst_QVectorND::metaTypes()
QVERIFY(QMetaType::isRegistered(QMetaType::QVector3D));
QVERIFY(QMetaType::isRegistered(QMetaType::QVector4D));
- QVERIFY(qMetaTypeId<QVector2D>() == QMetaType::QVector2D);
- QVERIFY(qMetaTypeId<QVector3D>() == QMetaType::QVector3D);
- QVERIFY(qMetaTypeId<QVector4D>() == QMetaType::QVector4D);
+ QCOMPARE(qMetaTypeId<QVector2D>(), int(QMetaType::QVector2D));
+ QCOMPARE(qMetaTypeId<QVector3D>(), int(QMetaType::QVector3D));
+ QCOMPARE(qMetaTypeId<QVector4D>(), int(QMetaType::QVector4D));
}
QTEST_APPLESS_MAIN(tst_QVectorND)
diff --git a/tests/auto/gui/painting/qbrush/tst_qbrush.cpp b/tests/auto/gui/painting/qbrush/tst_qbrush.cpp
index 4f58178f2c..30982f1e24 100644
--- a/tests/auto/gui/painting/qbrush/tst_qbrush.cpp
+++ b/tests/auto/gui/painting/qbrush/tst_qbrush.cpp
@@ -461,8 +461,8 @@ void tst_QBrush::textureBrushComparison()
imageBrush1.setTextureImage(image1);
imageBrush2.setTextureImage(image2);
- QVERIFY(imageBrush1 == imageBrush2);
- QVERIFY(pixmapBrush == imageBrush1);
+ QCOMPARE(imageBrush1, imageBrush2);
+ QCOMPARE(pixmapBrush, imageBrush1);
}
QTEST_MAIN(tst_QBrush)
diff --git a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
index 4fafbf9827..b81a4e2c4c 100644
--- a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
+++ b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
@@ -39,6 +39,7 @@
#include <qcolor.h>
#include <qdebug.h>
#include <private/qdrawingprimitive_sse2_p.h>
+#include <qrgba64.h>
class tst_QColor : public QObject
{
@@ -105,6 +106,10 @@ private slots:
void premultiply();
void unpremultiply_sse4();
+ void qrgba64();
+ void qrgba64MemoryLayout();
+ void qrgba64Premultiply();
+ void qrgba64Equivalence();
#ifdef Q_DEAD_CODE_FROM_QT4_X11
void setallowX11ColorNames();
@@ -249,7 +254,7 @@ void tst_QColor::isValid()
{
QFETCH(QColor, color);
QFETCH(bool, isValid);
- QVERIFY(color.isValid() == isValid);
+ QCOMPARE(color.isValid(), isValid);
}
Q_DECLARE_METATYPE(QColor::NameFormat);
@@ -1321,19 +1326,19 @@ void tst_QColor::convertTo()
QColor color(Qt::black);
QColor rgb = color.convertTo(QColor::Rgb);
- QVERIFY(rgb.spec() == QColor::Rgb);
+ QCOMPARE(rgb.spec(), QColor::Rgb);
QColor hsv = color.convertTo(QColor::Hsv);
- QVERIFY(hsv.spec() == QColor::Hsv);
+ QCOMPARE(hsv.spec(), QColor::Hsv);
QColor cmyk = color.convertTo(QColor::Cmyk);
- QVERIFY(cmyk.spec() == QColor::Cmyk);
+ QCOMPARE(cmyk.spec(), QColor::Cmyk);
QColor hsl = color.convertTo(QColor::Hsl);
- QVERIFY(hsl.spec() == QColor::Hsl);
+ QCOMPARE(hsl.spec(), QColor::Hsl);
QColor invalid = color.convertTo(QColor::Invalid);
- QVERIFY(invalid.spec() == QColor::Invalid);
+ QCOMPARE(invalid.spec(), QColor::Invalid);
}
void tst_QColor::light()
@@ -1464,5 +1469,102 @@ void tst_QColor::unpremultiply_sse4()
QSKIP("SSE4 not supported on this CPU.");
}
+void tst_QColor::qrgba64()
+{
+ QRgba64 rgb64 = QRgba64::fromRgba(0x22, 0x33, 0x44, 0xff);
+ QCOMPARE(rgb64.red(), quint16(0x2222));
+ QCOMPARE(rgb64.green(), quint16(0x3333));
+ QCOMPARE(rgb64.blue(), quint16(0x4444));
+ QCOMPARE(rgb64.alpha(), quint16(0xffff));
+
+ QColor c(rgb64);
+ QCOMPARE(c.red(), 0x22);
+ QCOMPARE(c.green(), 0x33);
+ QCOMPARE(c.blue(), 0x44);
+
+ QCOMPARE(c.rgba64(), rgb64);
+
+ QColor c2 = QColor::fromRgb(0x22, 0x33, 0x44, 0xff);
+ QCOMPARE(c, c2);
+ QCOMPARE(c2.rgba64(), rgb64);
+
+ rgb64.setAlpha(0x8000);
+ rgb64.setGreen(0x8844);
+ rgb64 = rgb64.premultiplied();
+ QCOMPARE(rgb64.red(), quint16(0x1111));
+ QCOMPARE(rgb64.blue(), quint16(0x2222));
+ QCOMPARE(rgb64.green(), quint16(0x4422));
+}
+
+void tst_QColor::qrgba64MemoryLayout()
+{
+ QRgba64 rgb64 = QRgba64::fromRgba64(0x0123, 0x4567, 0x89ab, 0xcdef);
+ QCOMPARE(rgb64.red(), quint16(0x0123));
+ QCOMPARE(rgb64.green(), quint16(0x4567));
+ QCOMPARE(rgb64.blue(), quint16(0x89ab));
+ QCOMPARE(rgb64.alpha(), quint16(0xcdef));
+
+ // Check in-memory order, so it can be used by things like SSE
+ Q_STATIC_ASSERT(sizeof(QRgba64) == sizeof(quint64));
+ quint16 memory[4];
+ memcpy(memory, &rgb64, sizeof(QRgba64));
+ QCOMPARE(memory[0], quint16(0x0123));
+ QCOMPARE(memory[1], quint16(0x4567));
+ QCOMPARE(memory[2], quint16(0x89ab));
+ QCOMPARE(memory[3], quint16(0xcdef));
+}
+
+void tst_QColor::qrgba64Premultiply()
+{
+ // Tests that qPremultiply(qUnpremultiply(rgba64)) returns rgba64.
+ for (uint a = 0; a < 0x10000; a+=7) {
+ const uint step = std::max(a/1024, 1u);
+ for (uint c = 0; c <= a; c+=step) {
+ QRgba64 p = qRgba64(c, a-c, a-c/2, a);
+ QRgba64 pp = qPremultiply(qUnpremultiply(p));
+ QCOMPARE(pp, p);
+ }
+ }
+}
+
+void tst_QColor::qrgba64Equivalence()
+{
+ // Any ARGB32 converted back and forth.
+ for (uint a = 0; a < 256; a++) {
+ for (uint c = 0; c < 256; c++) {
+ QRgb p1 = qRgba(c, 255-c, 255-c, a);
+ QRgba64 p64 = QRgba64::fromArgb32(p1);
+ QCOMPARE(p64.toArgb32(), p1);
+ }
+ }
+ // Any unpremultiplied ARGB32 value premultipled in RGB64 (except alpha 0).
+ for (uint a = 1; a < 256; a++) {
+ for (uint c = 0; c < 256; c++) {
+ QRgb p1 = qRgba(c, 255-c, 255-c, a);
+ QRgb pp1 = qPremultiply(p1);
+ QRgba64 pp64 = qPremultiply(QRgba64::fromArgb32(p1));
+ QRgb pp2 = pp64.toArgb32();
+ // 64bit premultiplied is more accurate than 32bit, so allow slight difference.
+ QCOMPARE(qAlpha(pp2), qAlpha(pp1));
+ QVERIFY(qAbs(qRed(pp2)-qRed(pp1)) <= 1);
+ QVERIFY(qAbs(qGreen(pp2)-qGreen(pp1)) <= 1);
+ QVERIFY(qAbs(qBlue(pp2)-qBlue(pp1)) <= 1);
+ // But verify the added accuracy means we can return to accurate unpremultiplied ARGB32.
+ QRgba64 pu64 = qUnpremultiply(pp64);
+ QRgb p2 = pu64.toArgb32();
+ QCOMPARE(p2, p1);
+ }
+ }
+ // Any premultiplied ARGB32 value unpremultipled in RGB64.
+ for (uint a = 0; a < 256; a++) {
+ for (uint c = 0; c <= a; c++) {
+ QRgb pp = qRgba(c, a-c, a-c, a);
+ QRgb pu = qUnpremultiply(pp);
+ QRgba64 pu64 = qUnpremultiply(QRgba64::fromArgb32(pp));
+ QCOMPARE(pu64.toArgb32(), pu);
+ }
+ }
+}
+
QTEST_MAIN(tst_QColor)
#include "tst_qcolor.moc"
diff --git a/tests/auto/gui/painting/qpagelayout/tst_qpagelayout.cpp b/tests/auto/gui/painting/qpagelayout/tst_qpagelayout.cpp
index 964487f566..0f2f51d9b6 100644
--- a/tests/auto/gui/painting/qpagelayout/tst_qpagelayout.cpp
+++ b/tests/auto/gui/painting/qpagelayout/tst_qpagelayout.cpp
@@ -76,7 +76,7 @@ void tst_QPageLayout::basics()
QCOMPARE(simple.paintRectPixels(72), QRect(0, 0, 595, 842));
const QPageLayout a4portrait = simple;
- QVERIFY(a4portrait == simple);
+ QCOMPARE(a4portrait, simple);
// Change orientation
simple.setOrientation(QPageLayout::Landscape);
diff --git a/tests/auto/gui/painting/qpainter/qpainter.pro b/tests/auto/gui/painting/qpainter/qpainter.pro
index 7e9d438e1b..e90b516ef2 100644
--- a/tests/auto/gui/painting/qpainter/qpainter.pro
+++ b/tests/auto/gui/painting/qpainter/qpainter.pro
@@ -2,7 +2,7 @@ CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qpainter
-QT += testlib
+QT += testlib gui-private core-private
qtHaveModule(widgets): QT += widgets widgets-private
SOURCES += tst_qpainter.cpp
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index 752ab0fd8c..1ed78fa0ef 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -53,6 +53,7 @@
#endif
#include <qpixmap.h>
+#include <private/qdrawhelper_p.h>
#include <qpainter.h>
#ifndef QT_NO_WIDGETS
@@ -125,8 +126,12 @@ private slots:
void fillRect3();
void fillRect4_data() { fillRect2_data(); }
void fillRect4();
+ void fillRectNonPremul_data();
void fillRectNonPremul();
+ void fillRectRGB30_data();
+ void fillRectRGB30();
+
void drawEllipse_data();
void drawEllipse();
void drawClippedEllipse_data();
@@ -198,6 +203,11 @@ private slots:
void gradientPixelFormat_data();
void gradientPixelFormat();
+ void linearGradientRgb30_data();
+ void linearGradientRgb30();
+ void radialGradientRgb30_data();
+ void radialGradientRgb30();
+
void fpe_pixmapTransform();
void fpe_zeroLengthLines();
void fpe_divByZero();
@@ -789,7 +799,7 @@ void tst_QPainter::drawPixmapFragments()
QImage origImage = origPixmap.toImage().convertToFormat(QImage::Format_ARGB32);
QImage resImage = resPixmap.toImage().convertToFormat(QImage::Format_ARGB32);
- QVERIFY(resImage.size() == resPixmap.size());
+ QCOMPARE(resImage.size(), resPixmap.size());
QVERIFY(resImage.pixel(5, 5) == origImage.pixel(15, 15));
QVERIFY(resImage.pixel(5, 15) == origImage.pixel(15, 5));
QVERIFY(resImage.pixel(15, 5) == origImage.pixel(5, 15));
@@ -797,16 +807,16 @@ void tst_QPainter::drawPixmapFragments()
QPainter::PixmapFragment fragment = QPainter::PixmapFragment::create(QPointF(20, 20), QRectF(30, 30, 2, 2));
- QVERIFY(fragment.x == 20);
- QVERIFY(fragment.y == 20);
- QVERIFY(fragment.sourceLeft == 30);
- QVERIFY(fragment.sourceTop == 30);
- QVERIFY(fragment.width == 2);
- QVERIFY(fragment.height == 2);
- QVERIFY(fragment.scaleX == 1);
- QVERIFY(fragment.scaleY == 1);
- QVERIFY(fragment.rotation == 0);
- QVERIFY(fragment.opacity == 1);
+ QCOMPARE(fragment.x, qreal(20));
+ QCOMPARE(fragment.y, qreal(20));
+ QCOMPARE(fragment.sourceLeft, qreal(30));
+ QCOMPARE(fragment.sourceTop, qreal(30));
+ QCOMPARE(fragment.width, qreal(2));
+ QCOMPARE(fragment.height, qreal(2));
+ QCOMPARE(fragment.scaleX, qreal(1));
+ QCOMPARE(fragment.scaleY, qreal(1));
+ QCOMPARE(fragment.rotation, qreal(0));
+ QCOMPARE(fragment.opacity, qreal(1));
}
void tst_QPainter::drawPixmapNegativeScale()
@@ -1245,22 +1255,87 @@ void tst_QPainter::fillRect4()
QCOMPARE(image, expected);
}
+void tst_QPainter::fillRectNonPremul_data()
+{
+ QTest::addColumn<QImage::Format>("format");
+ QTest::addColumn<uint>("color");
+
+ QTest::newRow("argb32 7f1f3f7f") << QImage::Format_ARGB32 << qRgba(31, 63, 127, 127);
+ QTest::newRow("rgba8888 7f1f3f7f") << QImage::Format_RGBA8888 << qRgba(31, 63, 127, 127);
+
+ QTest::newRow("argb32 3f1f3f7f") << QImage::Format_ARGB32 << qRgba(31, 63, 127, 63);
+ QTest::newRow("rgba8888 3f1f3f7f") << QImage::Format_RGBA8888 << qRgba(31, 63, 127, 63);
+
+ QTest::newRow("argb32 070375f4") << QImage::Format_ARGB32 << qRgba(3, 117, 244, 7);
+ QTest::newRow("rgba8888 070375f4") << QImage::Format_RGBA8888 << qRgba(3, 117, 244, 7);
+
+ QTest::newRow("argb32 0301fe0c") << QImage::Format_ARGB32 << qRgba(1, 254, 12, 3);
+ QTest::newRow("rgba8888 0301fe0c") << QImage::Format_RGBA8888 << qRgba(1, 254, 12, 3);
+
+ QTest::newRow("argb32 01804010") << QImage::Format_ARGB32 << qRgba(128, 64, 32, 1);
+ QTest::newRow("rgba8888 01804010") << QImage::Format_RGBA8888 << qRgba(128, 64, 32, 1);
+}
+
void tst_QPainter::fillRectNonPremul()
{
- QImage img1(1, 1, QImage::Format_ARGB32);
- QImage img2(1, 1, QImage::Format_RGBA8888);
+ QFETCH(QImage::Format, format);
+ QFETCH(uint, color);
+
+ QImage image(1, 1, format);
+ QRectF rect(0, 0, 1, 1);
+
+ // Fill with CompositionMode_SourceOver tests blend_color
+ image.fill(Qt::transparent);
+ QPainter painter(&image);
+ painter.fillRect(rect, QColor::fromRgba(color));
+ painter.end();
+
+ // Fill with CompositionMode_Source tests rectfill.
+ painter.begin(&image);
+ painter.setCompositionMode(QPainter::CompositionMode_Source);
+ painter.fillRect(rect, QColor::fromRgba(color));
+ painter.end();
+
+ QRgb p = image.pixel(0, 0);
+ QCOMPARE(qAlpha(p), qAlpha(color));
+ QVERIFY(qAbs(qRed(p)-qRed(color)) <= 1);
+ QVERIFY(qAbs(qGreen(p)-qGreen(color)) <= 1);
+ QVERIFY(qAbs(qBlue(p)-qBlue(color)) <= 1);
+}
+
+void tst_QPainter::fillRectRGB30_data()
+{
+ QTest::addColumn<uint>("color");
- QPainter p1(&img1);
- QPainter p2(&img2);
+ QTest::newRow("17|43|259") << (0xc0000000 | (17 << 20) | (43 << 10) | 259);
+ QTest::newRow("2|33|444") << (0xc0000000 | (2 << 20) | (33 << 10) | 444);
+ QTest::newRow("1000|1000|1000") << (0xc0000000 | (1000 << 20) | (1000 << 10) | 1000);
+}
+void tst_QPainter::fillRectRGB30()
+{
+ QFETCH(uint, color);
QRectF rect(0, 0, 1, 1);
- p1.fillRect(rect, qRgba(31, 63, 127, 127));
- p2.fillRect(rect, qRgba(31, 63, 127, 127));
- p1.end();
- p2.end();
+ // Fill with CompositionMode_SourceOver tests blend_color
+ QImage image1(1, 1, QImage::Format_A2BGR30_Premultiplied);
+ image1.fill(Qt::transparent);
+ QPainter painter(&image1);
+ painter.fillRect(rect, QColor::fromRgba64(qConvertA2rgb30ToRgb64<PixelOrderBGR>(color)));
+ painter.end();
+
+ uint pixel1 = ((const uint*)(image1.bits()))[0];
+ QCOMPARE(pixel1, color);
+
+ // Fill with CompositionMode_Source tests rectfill.
+ QImage image2(1, 1, QImage::Format_RGB30);
+ painter.begin(&image2);
+ painter.setCompositionMode(QPainter::CompositionMode_Source);
+ painter.fillRect(rect, QColor::fromRgba64(qConvertA2rgb30ToRgb64<PixelOrderRGB>(color)));
+ painter.end();
- QCOMPARE(img1.pixel(0, 0), img2.pixel(0,0));
+ uint pixel2 = ((const uint*)(image2.bits()))[0];
+ QCOMPARE(pixel2, color);
}
void tst_QPainter::drawPath_data()
@@ -1406,7 +1481,7 @@ void tst_QPainter::drawPath3()
p.drawPath(path);
p.end();
- QVERIFY(imgA == imgB);
+ QCOMPARE(imgA, imgB);
imgA.invertPixels();
imgB.fill(0xffffff);
@@ -1420,7 +1495,7 @@ void tst_QPainter::drawPath3()
p.drawPath(path);
p.end();
- QVERIFY(imgA == imgB);
+ QCOMPARE(imgA, imgB);
path.setFillRule(Qt::WindingFill);
imgB.fill(0xffffff);
@@ -2381,36 +2456,50 @@ void tst_QPainter::setOpacity_data()
QTest::newRow("RGBx8888 on RGBx8888") << QImage::Format_RGBX8888
<< QImage::Format_RGBX8888;
- QTest::newRow("RGBA8888P on ARGB32P") << QImage::Format_RGBA8888_Premultiplied
+ QTest::newRow("RGBA8888P on ARGB32P") << QImage::Format_ARGB32_Premultiplied
+ << QImage::Format_RGBA8888_Premultiplied;
+
+ QTest::newRow("RGBx8888 on ARGB32P") << QImage::Format_ARGB32_Premultiplied
+ << QImage::Format_RGBX8888;
+
+ QTest::newRow("ARGB32P on RGBA8888P") << QImage::Format_RGBA8888_Premultiplied
<< QImage::Format_ARGB32_Premultiplied;
- QTest::newRow("RGBx8888 on ARGB32P") << QImage::Format_RGBX8888
- << QImage::Format_ARGB32_Premultiplied;
+ QTest::newRow("RGB32 on RGBx8888") << QImage::Format_RGBX8888
+ << QImage::Format_RGB32;
- QTest::newRow("ARGB32P on RGBA8888P") << QImage::Format_ARGB32_Premultiplied
- << QImage::Format_RGBA8888_Premultiplied;
+ QTest::newRow("RGB30 on RGB32") << QImage::Format_RGB32
+ << QImage::Format_BGR30;
- QTest::newRow("RGB32 on RGBx8888") << QImage::Format_RGB32
- << QImage::Format_RGBX8888;
+ QTest::newRow("BGR30 on ARGB32P") << QImage::Format_ARGB32_Premultiplied
+ << QImage::Format_BGR30;
+
+ QTest::newRow("A2RGB30P on ARGB32P") << QImage::Format_ARGB32_Premultiplied
+ << QImage::Format_A2BGR30_Premultiplied;
QTest::newRow("A2RGB30P on A2RGB30P") << QImage::Format_A2RGB30_Premultiplied
<< QImage::Format_A2RGB30_Premultiplied;
- QTest::newRow("ARGB32P on A2RGB30P") << QImage::Format_ARGB32_Premultiplied
- << QImage::Format_A2RGB30_Premultiplied;
+ QTest::newRow("ARGB32P on A2RGB30P") << QImage::Format_A2RGB30_Premultiplied
+ << QImage::Format_ARGB32_Premultiplied;
+ QTest::newRow("RGB32 on A2BGR30P") << QImage::Format_A2BGR30_Premultiplied
+ << QImage::Format_RGB32;
- QTest::newRow("RGB32 on A2BGR30P") << QImage::Format_ARGB32_Premultiplied
- << QImage::Format_A2BGR30_Premultiplied;
+ QTest::newRow("RGB30 on A2BGR30P") << QImage::Format_A2BGR30_Premultiplied
+ << QImage::Format_RGB30;
- QTest::newRow("A2RGB30P on A2BGR30P") << QImage::Format_A2RGB30_Premultiplied
- << QImage::Format_A2BGR30_Premultiplied;
+ QTest::newRow("A2RGB30P on A2BGR30P") << QImage::Format_A2BGR30_Premultiplied
+ << QImage::Format_A2RGB30_Premultiplied;
- QTest::newRow("ARGB32P on BGR30") << QImage::Format_ARGB32_Premultiplied
- << QImage::Format_BGR30;
+ QTest::newRow("ARGB32P on BGR30") << QImage::Format_BGR30
+ << QImage::Format_ARGB32_Premultiplied;
- QTest::newRow("ARGB32P on RGB30") << QImage::Format_A2RGB30_Premultiplied
- << QImage::Format_RGB30;
+ QTest::newRow("ARGB32P on RGB30") << QImage::Format_RGB30
+ << QImage::Format_ARGB32_Premultiplied;
+
+ QTest::newRow("A2RGB30P on RGB30") << QImage::Format_RGB30
+ << QImage::Format_A2RGB30_Premultiplied;
}
@@ -2492,7 +2581,7 @@ void tst_QPainter::drawhelper_blend_untransformed()
QImage expected(size - 2, size, destFormat);
p.begin(&expected);
p.fillRect(0, 0, expected.width(), expected.height(),
- QColor(dest.pixel(1, 0)));
+ dest.pixelColor(1, 0));
p.end();
const QImage subDest(dest.bits() + dest.depth() / 8,
@@ -2500,9 +2589,7 @@ void tst_QPainter::drawhelper_blend_untransformed()
dest.bytesPerLine(), dest.format());
if (dest.format() == QImage::Format_ARGB8565_Premultiplied ||
- dest.format() == QImage::Format_ARGB8555_Premultiplied ||
- dest.format() == QImage::Format_A2BGR30_Premultiplied ||
- dest.format() == QImage::Format_A2RGB30_Premultiplied ) {
+ dest.format() == QImage::Format_ARGB8555_Premultiplied) {
// Test skipped due to rounding errors...
continue;
}
@@ -2551,7 +2638,7 @@ void tst_QPainter::drawhelper_blend_tiled_untransformed()
QImage expected(size - 2, size, destFormat);
p.begin(&expected);
p.fillRect(0, 0, expected.width(), expected.height(),
- QColor(dest.pixel(1, 0)));
+ dest.pixelColor(1, 0));
p.end();
const QImage subDest(dest.bits() + dest.depth() / 8,
@@ -2619,28 +2706,6 @@ void tst_QPainter::porterDuff_warning()
QVERIFY(qInstallMessageHandler(old) == porterDuff_warningChecker);
}
-class quint24
-{
-public:
- inline quint24(quint32 v)
- {
- data[0] = qBlue(v);
- data[1] = qGreen(v);
- data[2] = qRed(v);
- }
-
- inline operator quint32 ()
- {
- return qRgb(data[2], data[1], data[0]);
- }
-
- inline bool operator==(const quint24 &v) const {
- return (data[0] == v.data[0] && data[1] == v.data[1] && data[2] == v.data[2]);
- }
-
- uchar data[3];
-};
-
void tst_QPainter::drawhelper_blend_color()
{
QImage dest(32, 32, QImage::Format_ARGB8555_Premultiplied);
@@ -3889,6 +3954,65 @@ void tst_QPainter::gradientInterpolation()
}
}
+void tst_QPainter::linearGradientRgb30_data()
+{
+ QTest::addColumn<QColor>("stop0");
+ QTest::addColumn<QColor>("stop1");
+
+ QTest::newRow("white->black") << QColor(Qt::white) << QColor(Qt::black);
+ QTest::newRow("blue->black") << QColor(Qt::blue) << QColor(Qt::black);
+ QTest::newRow("white->red") << QColor(Qt::white) << QColor(Qt::red);
+}
+
+void tst_QPainter::linearGradientRgb30()
+{
+ QFETCH(QColor, stop0);
+ QFETCH(QColor, stop1);
+
+ QLinearGradient gradient(0, 0, 1000, 1);
+ gradient.setColorAt(0.0, stop0);
+ gradient.setColorAt(1.0, stop1);
+
+ QImage image(1000, 1, QImage::Format_RGB30);
+ QPainter painter(&image);
+ painter.fillRect(image.rect(), gradient);
+ painter.end();
+
+ for (int i = 1; i < 1000; ++i) {
+ QColor p1 = image.pixelColor(i - 1, 0);
+ QColor p2 = image.pixelColor(i, 0);
+ QVERIFY(p1 != p2);
+ QVERIFY(qGray(p1.rgb()) >= qGray(p2.rgb()));
+ }
+}
+
+void tst_QPainter::radialGradientRgb30_data()
+{
+ linearGradientRgb30_data();
+}
+
+void tst_QPainter::radialGradientRgb30()
+{
+ QFETCH(QColor, stop0);
+ QFETCH(QColor, stop1);
+
+ QRadialGradient gradient(0, 0, 1000);
+ gradient.setColorAt(0.0, stop0);
+ gradient.setColorAt(1.0, stop1);
+
+ QImage image(1000, 1, QImage::Format_A2BGR30_Premultiplied);
+ QPainter painter(&image);
+ painter.fillRect(image.rect(), gradient);
+ painter.end();
+
+ for (int i = 1; i < 1000; ++i) {
+ QColor p1 = image.pixelColor(i - 1, 0);
+ QColor p2 = image.pixelColor(i, 0);
+ QVERIFY(p1 != p2);
+ QVERIFY(qGray(p1.rgb()) >= qGray(p2.rgb()));
+ }
+}
+
void tst_QPainter::drawPolygon()
{
QImage img(128, 128, QImage::Format_ARGB32_Premultiplied);
@@ -4064,10 +4188,10 @@ void tst_QPainter::extendedBlendModes()
QVERIFY(testCompositionMode(255, 255, 255, QPainter::CompositionMode_Plus, 0.3));
QVERIFY(testCompositionMode( 0, 0, 0, QPainter::CompositionMode_Plus, 0.3));
- QVERIFY(testCompositionMode(127, 128, 165, QPainter::CompositionMode_Plus, 0.3));
- QVERIFY(testCompositionMode(127, 0, 37, QPainter::CompositionMode_Plus, 0.3));
+ QVERIFY(testCompositionMode(126, 128, 165, QPainter::CompositionMode_Plus, 0.3));
+ QVERIFY(testCompositionMode(127, 0, 38, QPainter::CompositionMode_Plus, 0.3));
QVERIFY(testCompositionMode( 0, 127, 127, QPainter::CompositionMode_Plus, 0.3));
- QVERIFY(testCompositionMode(255, 0, 75, QPainter::CompositionMode_Plus, 0.3));
+ QVERIFY(testCompositionMode(255, 0, 76, QPainter::CompositionMode_Plus, 0.3));
QVERIFY(testCompositionMode( 0, 255, 255, QPainter::CompositionMode_Plus, 0.3));
QVERIFY(testCompositionMode(128, 128, 166, QPainter::CompositionMode_Plus, 0.3));
QVERIFY(testCompositionMode(186, 200, 255, QPainter::CompositionMode_Plus, 0.3));
@@ -4752,6 +4876,22 @@ void tst_QPainter::blendARGBonRGB_data()
<< QPainter::CompositionMode_SourceIn << qRgba(255, 0, 0, 127) << 125;
QTest::newRow("ARGB_PM source-in RGB666") << QImage::Format_RGB666 << QImage::Format_ARGB32_Premultiplied
<< QPainter::CompositionMode_SourceIn << qRgba(127, 0, 0, 127) << 125;
+ QTest::newRow("ARGB over RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32
+ << QPainter::CompositionMode_SourceOver << qRgba(255, 0, 0, 85) << 85;
+ QTest::newRow("ARGB_PM over RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32_Premultiplied
+ << QPainter::CompositionMode_SourceOver << qRgba(85, 0, 0, 85) << 85;
+ QTest::newRow("ARGB source RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32
+ << QPainter::CompositionMode_Source << qRgba(255, 0, 0, 85) << 85;
+ QTest::newRow("ARGB source RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32
+ << QPainter::CompositionMode_Source << qRgba(255, 0, 0, 120) << 85;
+ QTest::newRow("ARGB_PM source RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32_Premultiplied
+ << QPainter::CompositionMode_Source << qRgba(85, 0, 0, 85) << 85;
+ QTest::newRow("ARGB_PM source RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32_Premultiplied
+ << QPainter::CompositionMode_Source << qRgba(180, 0, 0, 180) << 170;
+ QTest::newRow("ARGB source-in RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32
+ << QPainter::CompositionMode_SourceIn << qRgba(255, 0, 0, 85) << 85;
+ QTest::newRow("ARGB_PM source-in RGB30") << QImage::Format_RGB30 << QImage::Format_ARGB32_Premultiplied
+ << QPainter::CompositionMode_SourceIn << qRgba(85, 0, 0, 85) << 85;
}
void tst_QPainter::blendARGBonRGB()
diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
index 0a073f5c84..ae30719ee7 100644
--- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
+++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
@@ -602,16 +602,16 @@ void tst_QPainterPath::testOperatorEquals()
{
QPainterPath empty1;
QPainterPath empty2;
- QVERIFY(empty1 == empty2);
+ QCOMPARE(empty1, empty2);
QPainterPath rect1;
rect1.addRect(100, 100, 100, 100);
- QVERIFY(rect1 == rect1);
+ QCOMPARE(rect1, rect1);
QVERIFY(rect1 != empty1);
QPainterPath rect2;
rect2.addRect(100, 100, 100, 100);
- QVERIFY(rect1 == rect2);
+ QCOMPARE(rect1, rect2);
rect2.setFillRule(Qt::WindingFill);
QVERIFY(rect1 != rect2);
@@ -622,7 +622,7 @@ void tst_QPainterPath::testOperatorEquals()
QPainterPath ellipse2;
ellipse2.addEllipse(50, 50, 100, 100);
- QVERIFY(ellipse1 == ellipse2);
+ QCOMPARE(ellipse1, ellipse2);
}
void tst_QPainterPath::testOperatorEquals_fuzzy()
@@ -638,12 +638,12 @@ void tst_QPainterPath::testOperatorEquals_fuzzy()
QPainterPath pb;
pb.addRect(b);
- QVERIFY(pa == pb);
+ QCOMPARE(pa, pb);
QTransform transform;
transform.translate(-100, -100);
- QVERIFY(transform.map(pa) == transform.map(pb));
+ QCOMPARE(transform.map(pa), transform.map(pb));
}
// higher tolerance for error when path's bounding rect is big
@@ -656,12 +656,12 @@ void tst_QPainterPath::testOperatorEquals_fuzzy()
QPainterPath pb;
pb.addRect(b);
- QVERIFY(pa == pb);
+ QCOMPARE(pa, pb);
QTransform transform;
transform.translate(-1, -1);
- QVERIFY(transform.map(pa) == transform.map(pb));
+ QCOMPARE(transform.map(pa), transform.map(pb));
}
// operator== should return true for a path that has
@@ -676,7 +676,7 @@ void tst_QPainterPath::testOperatorEquals_fuzzy()
QPainterPath b = transform.inverted().map(transform.map(a));
- QVERIFY(a == b);
+ QCOMPARE(a, b);
}
{
@@ -720,7 +720,7 @@ void tst_QPainterPath::testOperatorDatastream()
stream >> other;
}
- QVERIFY(other == path);
+ QCOMPARE(other, path);
}
void tst_QPainterPath::closing()
@@ -1066,19 +1066,19 @@ void tst_QPainterPath::setElementPositionAt()
{
QPainterPath path(QPointF(42., 42.));
QCOMPARE(path.elementCount(), 1);
- QVERIFY(path.elementAt(0).type == QPainterPath::MoveToElement);
+ QCOMPARE(path.elementAt(0).type, QPainterPath::MoveToElement);
QCOMPARE(path.elementAt(0).x, qreal(42.));
QCOMPARE(path.elementAt(0).y, qreal(42.));
QPainterPath copy = path;
copy.setElementPositionAt(0, qreal(0), qreal(0));
QCOMPARE(copy.elementCount(), 1);
- QVERIFY(copy.elementAt(0).type == QPainterPath::MoveToElement);
+ QCOMPARE(copy.elementAt(0).type, QPainterPath::MoveToElement);
QCOMPARE(copy.elementAt(0).x, qreal(0));
QCOMPARE(copy.elementAt(0).y, qreal(0));
QCOMPARE(path.elementCount(), 1);
- QVERIFY(path.elementAt(0).type == QPainterPath::MoveToElement);
+ QCOMPARE(path.elementAt(0).type, QPainterPath::MoveToElement);
QCOMPARE(path.elementAt(0).x, qreal(42.));
QCOMPARE(path.elementAt(0).y, qreal(42.));
}
@@ -1253,10 +1253,10 @@ void tst_QPainterPath::connectPathMoveTo()
path1.connectPath(path2);
- QVERIFY(path1.elementAt(0).type == QPainterPath::MoveToElement);
- QVERIFY(path2.elementAt(0).type == QPainterPath::MoveToElement);
- QVERIFY(path3.elementAt(0).type == QPainterPath::MoveToElement);
- QVERIFY(path4.elementAt(0).type == QPainterPath::MoveToElement);
+ QCOMPARE(path1.elementAt(0).type, QPainterPath::MoveToElement);
+ QCOMPARE(path2.elementAt(0).type, QPainterPath::MoveToElement);
+ QCOMPARE(path3.elementAt(0).type, QPainterPath::MoveToElement);
+ QCOMPARE(path4.elementAt(0).type, QPainterPath::MoveToElement);
}
void tst_QPainterPath::translate()
diff --git a/tests/auto/gui/painting/qpdfwriter/tst_qpdfwriter.cpp b/tests/auto/gui/painting/qpdfwriter/tst_qpdfwriter.cpp
index 4bc31baba8..5eaee1192a 100644
--- a/tests/auto/gui/painting/qpdfwriter/tst_qpdfwriter.cpp
+++ b/tests/auto/gui/painting/qpdfwriter/tst_qpdfwriter.cpp
@@ -50,8 +50,7 @@ private slots:
void tst_QPdfWriter::basics()
{
QTemporaryFile file;
- if (!file.open())
- QSKIP("Couldn't open temp file!");
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QPdfWriter writer(file.fileName());
QCOMPARE(writer.title(), QString());
@@ -150,8 +149,7 @@ void tst_QPdfWriter::testPageMetrics()
QSizeF sizeMMf = QSizeF(widthMMf, heightMMf);
QTemporaryFile file;
- if (!file.open())
- QSKIP("Couldn't open temp file!");
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QPdfWriter writer(file.fileName());
QCOMPARE(writer.pageLayout().orientation(), QPageLayout::Portrait);
diff --git a/tests/auto/gui/painting/qregion/tst_qregion.cpp b/tests/auto/gui/painting/qregion/tst_qregion.cpp
index c0e3c6d187..33f81cc10e 100644
--- a/tests/auto/gui/painting/qregion/tst_qregion.cpp
+++ b/tests/auto/gui/painting/qregion/tst_qregion.cpp
@@ -173,7 +173,7 @@ void tst_QRegion::setRects()
QRect rect;
region.setRects(&rect, 0);
QVERIFY(region.isEmpty());
- QVERIFY(region == QRegion());
+ QCOMPARE(region, QRegion());
QVERIFY(!region.boundingRect().isValid());
QVERIFY(region.rects().isEmpty());
}
diff --git a/tests/auto/gui/painting/qtransform/tst_qtransform.cpp b/tests/auto/gui/painting/qtransform/tst_qtransform.cpp
index 13b15d09dd..60b89aa6ab 100644
--- a/tests/auto/gui/painting/qtransform/tst_qtransform.cpp
+++ b/tests/auto/gui/painting/qtransform/tst_qtransform.cpp
@@ -57,6 +57,7 @@ private slots:
void mapRect();
void assignments();
void mapToPolygon();
+ void qhash();
void translate();
void scale();
void matrix();
@@ -361,6 +362,22 @@ void tst_QTransform::mapToPolygon()
QVERIFY(equal);
}
+void tst_QTransform::qhash()
+{
+ QMatrix m1;
+ m1.shear(3.0, 2.0);
+ m1.rotate(44);
+
+ QMatrix m2 = m1;
+
+ QTransform t1(m1);
+ QTransform t2(m2);
+
+ // not really much to test here, so just the bare minimum:
+ QCOMPARE(qHash(m1), qHash(m2));
+ QCOMPARE(qHash(t1), qHash(t2));
+}
+
void tst_QTransform::translate()
{
@@ -411,14 +428,14 @@ void tst_QTransform::matrix()
mat1.m21(), mat1.m22(), 0,
mat1.dx(), mat1.dy(), 1);
- QVERIFY(tran1 == dummy);
- QVERIFY(tran1.inverted() == dummy.inverted());
- QVERIFY(tran1.inverted() == QTransform(mat1.inverted()));
- QVERIFY(tran2.inverted() == QTransform(mat2.inverted()));
+ QCOMPARE(tran1, dummy);
+ QCOMPARE(tran1.inverted(), dummy.inverted());
+ QCOMPARE(tran1.inverted(), QTransform(mat1.inverted()));
+ QCOMPARE(tran2.inverted(), QTransform(mat2.inverted()));
QMatrix mat3 = mat1 * mat2;
QTransform tran3 = tran1 * tran2;
- QVERIFY(QTransform(mat3) == tran3);
+ QCOMPARE(QTransform(mat3), tran3);
/* QMatrix::operator==() doesn't use qFuzzyCompare(), which
* on win32-g++ results in a failure. So we work around it by
@@ -430,15 +447,15 @@ void tst_QTransform::matrix()
QRect rect(43, 70, 200, 200);
QPoint pt(43, 66);
- QVERIFY(tranInv.map(pt) == matInv.map(pt));
- QVERIFY(tranInv.map(pt) == matInv.map(pt));
+ QCOMPARE(tranInv.map(pt), matInv.map(pt));
+ QCOMPARE(tranInv.map(pt), matInv.map(pt));
QPainterPath path;
path.moveTo(55, 60);
path.lineTo(110, 110);
path.quadTo(220, 50, 10, 20);
path.closeSubpath();
- QVERIFY(tranInv.map(path) == matInv.map(path));
+ QCOMPARE(tranInv.map(path), matInv.map(path));
}
void tst_QTransform::testOffset()
@@ -724,8 +741,8 @@ void tst_QTransform::inverted()
const QTransform inverted = matrix.inverted();
- QVERIFY(matrix.isIdentity() == inverted.isIdentity());
- QVERIFY(matrix.type() == inverted.type());
+ QCOMPARE(matrix.isIdentity(), inverted.isIdentity());
+ QCOMPARE(matrix.type(), inverted.type());
QVERIFY((matrix * inverted).isIdentity());
QVERIFY((inverted * matrix).isIdentity());
diff --git a/tests/auto/gui/qopengl/BLACKLIST b/tests/auto/gui/qopengl/BLACKLIST
new file mode 100644
index 0000000000..7f167d81df
--- /dev/null
+++ b/tests/auto/gui/qopengl/BLACKLIST
@@ -0,0 +1,8 @@
+[fboRendering]
+windows
+[QTBUG15621_triangulatingStrokerDivZero]
+windows
+[imageFormatPainting]
+windows
+[openGLPaintDevice]
+windows
diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp
index 3e66bcbf70..e2ad502a52 100644
--- a/tests/auto/gui/qopengl/tst_qopengl.cpp
+++ b/tests/auto/gui/qopengl/tst_qopengl.cpp
@@ -87,6 +87,8 @@ private slots:
void fboRenderingRGB30_data();
void fboRenderingRGB30();
void fboHandleNulledAfterContextDestroyed();
+ void fboMRT();
+ void fboMRT_differentFormats();
void openGLPaintDevice_data();
void openGLPaintDevice();
void aboutToBeDestroyed();
@@ -515,7 +517,7 @@ void tst_QOpenGL::fboTextureOwnership()
// pull out the texture
GLuint texture = fbo->takeTexture();
QVERIFY(texture != 0);
- QVERIFY(fbo->texture() == 0);
+ QCOMPARE(fbo->texture(), GLuint(0));
// verify that the next bind() creates a new texture
fbo->bind();
@@ -595,6 +597,14 @@ void tst_QOpenGL::fboRenderingRGB30_data()
common_data();
}
+#ifndef GL_RGB5_A1
+#define GL_RGB5_A1 0x8057
+#endif
+
+#ifndef GL_RGBA8
+#define GL_RGBA8 0x8058
+#endif
+
#ifndef GL_RGB10_A2
#define GL_RGB10_A2 0x8059
#endif
@@ -607,6 +617,24 @@ void tst_QOpenGL::fboRenderingRGB30_data()
#define GL_FULL_SUPPORT 0x82B7
#endif
+static bool hasRGB10A2(QOpenGLContext *ctx)
+{
+ if (ctx->format().majorVersion() < 3)
+ return false;
+#ifndef QT_OPENGL_ES_2
+ if (!ctx->isOpenGLES() && ctx->format().majorVersion() >= 4) {
+ 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);
+ if (value != GL_FULL_SUPPORT)
+ return false;
+ }
+ }
+#endif
+ return true;
+}
+
void tst_QOpenGL::fboRenderingRGB30()
{
#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(__x86_64__)
@@ -624,24 +652,9 @@ void tst_QOpenGL::fboRenderingRGB30()
if (!QOpenGLFramebufferObject::hasOpenGLFramebufferObjects())
QSKIP("QOpenGLFramebufferObject not supported on this platform");
- if (ctx.format().majorVersion() < 3)
+ if (!hasRGB10A2(&ctx))
QSKIP("An internal RGB30_A2 format is not guaranteed on this platform");
-#if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2)
- // NVidia currently only supports RGB30 and RGB30_A2 in their Quadro drivers,
- // but they do provide an extension for querying the support. We use the query
- // in case they implement the required formats later.
- if (!ctx.isOpenGLES() && ctx.format().majorVersion() >= 4) {
- 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);
- if (value != GL_FULL_SUPPORT)
- QSKIP("The required RGB30_A2 format is not supported by this driver");
- }
- }
-#endif
-
// No multisample with combined depth/stencil attachment:
QOpenGLFramebufferObjectFormat fboFormat;
fboFormat.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
@@ -721,6 +734,150 @@ void tst_QOpenGL::fboHandleNulledAfterContextDestroyed()
QCOMPARE(fbo->handle(), 0U);
}
+void tst_QOpenGL::fboMRT()
+{
+ QWindow window;
+ window.setSurfaceType(QWindow::OpenGLSurface);
+ window.setGeometry(0, 0, 10, 10);
+ window.create();
+
+ QOpenGLContext ctx;
+ QVERIFY(ctx.create());
+ ctx.makeCurrent(&window);
+
+ if (!QOpenGLFramebufferObject::hasOpenGLFramebufferObjects())
+ QSKIP("QOpenGLFramebufferObject not supported on this platform");
+
+ if (!ctx.functions()->hasOpenGLFeature(QOpenGLFunctions::MultipleRenderTargets))
+ QSKIP("Multiple render targets not supported on this platform");
+
+ QOpenGLExtraFunctions *ef = ctx.extraFunctions();
+
+ {
+ // 3 color attachments, different sizes, same internal format, no depth/stencil.
+ QVector<QSize> sizes;
+ sizes << QSize(128, 128) << QSize(192, 128) << QSize(432, 123);
+ QOpenGLFramebufferObject fbo(sizes[0]);
+ fbo.addColorAttachment(sizes[1]);
+ fbo.addColorAttachment(sizes[2]);
+ QVERIFY(fbo.bind());
+ QCOMPARE(fbo.attachment(), QOpenGLFramebufferObject::NoAttachment);
+ QCOMPARE(sizes, fbo.sizes());
+ QCOMPARE(sizes[0], fbo.size());
+ // Clear the three buffers to red, green and blue.
+ GLenum drawBuf = GL_COLOR_ATTACHMENT0;
+ ef->glDrawBuffers(1, &drawBuf);
+ ef->glClearColor(1, 0, 0, 1);
+ ef->glClear(GL_COLOR_BUFFER_BIT);
+ drawBuf = GL_COLOR_ATTACHMENT0 + 1;
+ ef->glDrawBuffers(1, &drawBuf);
+ ef->glClearColor(0, 1, 0, 1);
+ ef->glClear(GL_COLOR_BUFFER_BIT);
+ drawBuf = GL_COLOR_ATTACHMENT0 + 2;
+ ef->glDrawBuffers(1, &drawBuf);
+ ef->glClearColor(0, 0, 1, 1);
+ ef->glClear(GL_COLOR_BUFFER_BIT);
+ // Verify, keeping in mind that only a 128x123 area is touched in the buffers.
+ // Some drivers do not get this right, unfortunately, so do not rely on it.
+ const char *vendor = (const char *) ef->glGetString(GL_VENDOR);
+ bool hasCorrectMRT = false;
+ if (vendor && strstr(vendor, "NVIDIA")) // maybe others too
+ hasCorrectMRT = true;
+ QImage img = fbo.toImage(false, 0);
+ QCOMPARE(img.size(), sizes[0]);
+ QCOMPARE(img.pixel(0, 0), qRgb(255, 0, 0));
+ if (hasCorrectMRT)
+ QCOMPARE(img.pixel(127, 122), qRgb(255, 0, 0));
+ img = fbo.toImage(false, 1);
+ QCOMPARE(img.size(), sizes[1]);
+ QCOMPARE(img.pixel(0, 0), qRgb(0, 255, 0));
+ if (hasCorrectMRT)
+ QCOMPARE(img.pixel(127, 122), qRgb(0, 255, 0));
+ img = fbo.toImage(false, 2);
+ QCOMPARE(img.size(), sizes[2]);
+ QCOMPARE(img.pixel(0, 0), qRgb(0, 0, 255));
+ if (hasCorrectMRT)
+ QCOMPARE(img.pixel(127, 122), qRgb(0, 0, 255));
+ fbo.release();
+ }
+
+ {
+ // 2 color attachments, same size, same internal format, depth/stencil.
+ QVector<QSize> sizes;
+ sizes.fill(QSize(128, 128), 2);
+ QOpenGLFramebufferObject fbo(sizes[0], QOpenGLFramebufferObject::CombinedDepthStencil);
+ fbo.addColorAttachment(sizes[1]);
+ QVERIFY(fbo.bind());
+ QCOMPARE(fbo.attachment(), QOpenGLFramebufferObject::CombinedDepthStencil);
+ QCOMPARE(sizes, fbo.sizes());
+ QCOMPARE(sizes[0], fbo.size());
+ ef->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ ef->glFinish();
+ fbo.release();
+ }
+}
+
+void tst_QOpenGL::fboMRT_differentFormats()
+{
+ QWindow window;
+ window.setSurfaceType(QWindow::OpenGLSurface);
+ window.setGeometry(0, 0, 10, 10);
+ window.create();
+
+ QOpenGLContext ctx;
+ QVERIFY(ctx.create());
+ ctx.makeCurrent(&window);
+
+ QOpenGLFunctions *f = ctx.functions();
+ const char * vendor = (const char *) f->glGetString(GL_VENDOR);
+ if (vendor && strstr(vendor, "VMware, Inc."))
+ QSKIP("The tested formats may not be supported on this platform");
+
+ if (!QOpenGLFramebufferObject::hasOpenGLFramebufferObjects())
+ QSKIP("QOpenGLFramebufferObject not supported on this platform");
+
+ if (!f->hasOpenGLFeature(QOpenGLFunctions::MultipleRenderTargets))
+ QSKIP("Multiple render targets not supported on this platform");
+
+ if (!hasRGB10A2(&ctx))
+ QSKIP("RGB10_A2 not supported on this platform");
+
+ // 3 color attachments, same size, different internal format, depth/stencil.
+ QVector<QSize> sizes;
+ sizes.fill(QSize(128, 128), 3);
+ QOpenGLFramebufferObjectFormat format;
+ format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
+ QVector<GLenum> internalFormats;
+ internalFormats << GL_RGBA8 << GL_RGB10_A2 << GL_RGB5_A1;
+ format.setInternalTextureFormat(internalFormats[0]);
+ QOpenGLFramebufferObject fbo(sizes[0], format);
+ fbo.addColorAttachment(sizes[1], internalFormats[1]);
+ fbo.addColorAttachment(sizes[2], internalFormats[2]);
+
+ QVERIFY(fbo.bind());
+ QCOMPARE(fbo.attachment(), QOpenGLFramebufferObject::CombinedDepthStencil);
+ QCOMPARE(sizes, fbo.sizes());
+ QCOMPARE(sizes[0], fbo.size());
+
+ QOpenGLExtraFunctions *ef = ctx.extraFunctions();
+ QVERIFY(ef->glGetError() == 0);
+ ef->glClearColor(1, 0, 0, 1);
+ GLenum drawBuf[] = { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT0 + 1, GL_COLOR_ATTACHMENT0 + 2 };
+ ef->glDrawBuffers(3, drawBuf);
+ ef->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ QVERIFY(ef->glGetError() == 0);
+
+ QImage img = fbo.toImage(true, 0);
+ QCOMPARE(img.size(), sizes[0]);
+ QCOMPARE(img.pixel(0, 0), qRgb(255, 0, 0));
+ img = fbo.toImage(true, 1);
+ QCOMPARE(img.size(), sizes[1]);
+ QCOMPARE(img.format(), QImage::Format_A2BGR30_Premultiplied);
+ QCOMPARE(img.pixel(0, 0), qRgb(255, 0, 0));
+
+ fbo.release();
+}
+
void tst_QOpenGL::imageFormatPainting()
{
QScopedPointer<QSurface> surface(createSurface(QSurface::Window));
@@ -1175,18 +1332,18 @@ void tst_QOpenGL::textureblitterPartTargetRectTransform()
void tst_QOpenGL::defaultSurfaceFormat()
{
QSurfaceFormat fmt;
- QVERIFY(QSurfaceFormat::defaultFormat() == fmt);
+ QCOMPARE(QSurfaceFormat::defaultFormat(), fmt);
fmt.setDepthBufferSize(16);
QSurfaceFormat::setDefaultFormat(fmt);
- QVERIFY(QSurfaceFormat::defaultFormat() == fmt);
+ QCOMPARE(QSurfaceFormat::defaultFormat(), fmt);
QCOMPARE(QSurfaceFormat::defaultFormat().depthBufferSize(), 16);
QScopedPointer<QWindow> window(new QWindow);
- QVERIFY(window->requestedFormat() == fmt);
+ QCOMPARE(window->requestedFormat(), fmt);
QScopedPointer<QOpenGLContext> context(new QOpenGLContext);
- QVERIFY(context->format() == fmt);
+ QCOMPARE(context->format(), fmt);
}
#ifdef USE_GLX
@@ -1215,7 +1372,7 @@ void tst_QOpenGL::glxContextWrap()
QOpenGLContext *ctx = new QOpenGLContext;
ctx->setNativeHandle(QVariant::fromValue<QGLXNativeContext>(QGLXNativeContext(context)));
QVERIFY(ctx->create());
- QVERIFY(ctx->nativeHandle().value<QGLXNativeContext>().context() == context);
+ QCOMPARE(ctx->nativeHandle().value<QGLXNativeContext>().context(), context);
QVERIFY(nativeIf->nativeResourceForContext(QByteArrayLiteral("glxcontext"), ctx) == (void *) context);
QVERIFY(ctx->makeCurrent(window));
diff --git a/tests/auto/gui/qopenglconfig/buglist.json b/tests/auto/gui/qopenglconfig/buglist.json
index c7b8e61bc8..ef311612b2 100644
--- a/tests/auto/gui/qopenglconfig/buglist.json
+++ b/tests/auto/gui/qopenglconfig/buglist.json
@@ -103,6 +103,28 @@
]
},
{
+ "id": 7,
+ "description": "driver description test",
+ "driver_description": "Long And Special Driver Description",
+ "os": {
+ "type": "win"
+ },
+ "features": [
+ "feature2"
+ ]
+ },
+ {
+ "id": 8,
+ "description": "Windows version test",
+ "os": {
+ "type": "win",
+ "release": [ "10" ]
+ },
+ "features": [
+ "win10_feature"
+ ]
+ },
+ {
"id": 128,
"description": "check for matching GL_VENDOR",
"gl_vendor": "The Qt Company",
diff --git a/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp b/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp
index f88cbdc758..1cb7972cc6 100644
--- a/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp
+++ b/tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp
@@ -47,6 +47,7 @@
#include <QtCore/QVariant>
#include <QtCore/QDebug>
#include <QtCore/QTextStream>
+#include <QtCore/QJsonDocument>
#include <algorithm>
@@ -107,6 +108,7 @@ private slots:
void testConfiguration();
void testGlConfiguration();
void testBugList();
+ void testDefaultWindowsBlacklist();
};
static void dumpConfiguration(QTextStream &str)
@@ -243,29 +245,61 @@ void tst_QOpenGlConfig::testBugList()
QSet<QString> expectedFeatures;
expectedFeatures << "feature1";
+ // adapter info
QVersionNumber driverVersion(QVector<int>() << 9 << 18 << 13 << 4460);
- QOpenGLConfig::Gpu gpu = QOpenGLConfig::Gpu::fromDevice(0x10DE, 0x0DE9, driverVersion);
+ QOpenGLConfig::Gpu gpu = QOpenGLConfig::Gpu::fromDevice(0x10DE, 0x0DE9, driverVersion, QByteArrayLiteral("Unknown"));
QSet<QString> actualFeatures = QOpenGLConfig::gpuFeatures(gpu, QStringLiteral("win"),
- QVersionNumber(6, 3), fileName);
+ QVersionNumber(6, 3), QStringLiteral("7"), fileName);
QVERIFY2(expectedFeatures == actualFeatures,
msgSetMismatch(expectedFeatures, actualFeatures));
+ // driver_description
+ gpu = QOpenGLConfig::Gpu::fromDevice(0xDEAD, 0xBEEF, driverVersion, QByteArrayLiteral("Very Long And Special Driver Description"));
+ actualFeatures = QOpenGLConfig::gpuFeatures(gpu, QStringLiteral("win"),
+ QVersionNumber(6, 3), QStringLiteral("8"), fileName);
+ expectedFeatures = QSet<QString>() << "feature2";
+ QVERIFY2(expectedFeatures == actualFeatures,
+ msgSetMismatch(expectedFeatures, actualFeatures));
+
+ // os.release
+ gpu = QOpenGLConfig::Gpu::fromDevice(0xDEAD, 0xBEEF, driverVersion, QByteArrayLiteral("WinVerTest"));
+ actualFeatures = QOpenGLConfig::gpuFeatures(gpu, QStringLiteral("win"),
+ QVersionNumber(12, 34), QStringLiteral("10"), fileName);
+ expectedFeatures = QSet<QString>() << "win10_feature";
+ QVERIFY2(expectedFeatures == actualFeatures,
+ msgSetMismatch(expectedFeatures, actualFeatures));
+
+ // gl_vendor
gpu = QOpenGLConfig::Gpu::fromGLVendor(QByteArrayLiteral("Somebody Else"));
expectedFeatures.clear();
actualFeatures = QOpenGLConfig::gpuFeatures(gpu, QStringLiteral("linux"),
- QVersionNumber(1, 0), fileName);
+ QVersionNumber(1, 0), QString(), fileName);
QVERIFY2(expectedFeatures == actualFeatures,
msgSetMismatch(expectedFeatures, actualFeatures));
gpu = QOpenGLConfig::Gpu::fromGLVendor(QByteArrayLiteral("The Qt Company"));
expectedFeatures = QSet<QString>() << "cool_feature";
actualFeatures = QOpenGLConfig::gpuFeatures(gpu, QStringLiteral("linux"),
- QVersionNumber(1, 0), fileName);
+ QVersionNumber(1, 0), QString(), fileName);
QVERIFY2(expectedFeatures == actualFeatures,
msgSetMismatch(expectedFeatures, actualFeatures));
}
+void tst_QOpenGlConfig::testDefaultWindowsBlacklist()
+{
+ if (QGuiApplication::platformName().compare(QLatin1String("windows"), Qt::CaseInsensitive))
+ QSKIP("Only applicable to Windows");
+
+ QFile f(QStringLiteral(":/qt-project.org/windows/openglblacklists/default.json"));
+ QVERIFY(f.open(QIODevice::ReadOnly | QIODevice::Text));
+ QJsonParseError err;
+ QJsonDocument doc = QJsonDocument::fromJson(f.readAll(), &err);
+ QVERIFY2(err.error == 0,
+ QStringLiteral("Failed to parse built-in Windows GPU blacklist. %1 : %2")
+ .arg(err.offset).arg(err.errorString()).toLatin1());
+}
+
QTEST_MAIN(tst_QOpenGlConfig)
#include "tst_qopenglconfig.moc"
diff --git a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
index 5d78bc1d01..b1beb0ffd0 100644
--- a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
+++ b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
@@ -203,8 +203,8 @@ void tst_QCssParser::scanner()
QCss::Scanner::scan(QCss::Scanner::preprocess(QString::fromUtf8(inputFile.readAll())), &symbols);
QVERIFY(symbols.count() > 1);
- QVERIFY(symbols.last().token == QCss::S);
- QVERIFY(symbols.last().lexem() == QLatin1String("\n"));
+ QCOMPARE(symbols.last().token, QCss::S);
+ QCOMPARE(symbols.last().lexem(), QLatin1String("\n"));
symbols.remove(symbols.count() - 1, 1);
QFile outputFile(output);
@@ -861,7 +861,7 @@ void tst_QCssParser::colorValue()
QCss::Declaration decl;
QVERIFY(parser.parseNextDeclaration(&decl));
const QColor col = decl.colorValue();
- QVERIFY(expectedColor.isValid() == col.isValid());
+ QCOMPARE(expectedColor.isValid(), col.isValid());
QCOMPARE(col, expectedColor);
}
@@ -1304,7 +1304,7 @@ void tst_QCssParser::rulesForNode()
decls += rules.at(i).declarations;
}
- QVERIFY(decls.count() == declCount);
+ QCOMPARE(decls.count(), declCount);
if (declCount > 0)
QCOMPARE(decls.at(0).d->values.at(0).variant.toString(), value0);
@@ -1364,7 +1364,7 @@ void tst_QCssParser::shorthandBackgroundProperty()
v.extractBackground(&brush, &image, &repeat, &alignment, &origin, &attachment, &ignoredOrigin);
QFETCH(QBrush, expectedBrush);
- QVERIFY(expectedBrush.color() == brush.color());
+ QCOMPARE(expectedBrush.color(), brush.color());
QTEST(image, "expectedImage");
QTEST(int(repeat), "expectedRepeatValue");
@@ -1372,7 +1372,7 @@ void tst_QCssParser::shorthandBackgroundProperty()
//QTBUG-9674 : a second evaluation should give the same results
QVERIFY(v.extractBackground(&brush, &image, &repeat, &alignment, &origin, &attachment, &ignoredOrigin));
- QVERIFY(expectedBrush.color() == brush.color());
+ QCOMPARE(expectedBrush.color(), brush.color());
QTEST(image, "expectedImage");
QTEST(int(repeat), "expectedRepeatValue");
QTEST(int(alignment), "expectedAlignment");
@@ -1438,7 +1438,7 @@ void tst_QCssParser::pseudoElement()
decls += rules.at(i).declarations;
}
- QVERIFY(decls.count() == declCount);
+ QCOMPARE(decls.count(), declCount);
}
void tst_QCssParser::gradient_data()
@@ -1517,21 +1517,21 @@ void tst_QCssParser::gradient()
QBrush sbg, abg;
QVERIFY(ve.extractPalette(&fg, &sfg, &sbg, &abg));
if (type == "linear") {
- QVERIFY(sbg.style() == Qt::LinearGradientPattern);
+ QCOMPARE(sbg.style(), Qt::LinearGradientPattern);
const QLinearGradient *lg = static_cast<const QLinearGradient *>(sbg.gradient());
QCOMPARE(lg->start(), start);
QCOMPARE(lg->finalStop(), finalStop);
} else if (type == "conical") {
- QVERIFY(sbg.style() == Qt::ConicalGradientPattern);
+ QCOMPARE(sbg.style(), Qt::ConicalGradientPattern);
const QConicalGradient *cg = static_cast<const QConicalGradient *>(sbg.gradient());
QCOMPARE(cg->center(), start);
}
const QGradient *g = sbg.gradient();
QCOMPARE(g->spread(), QGradient::Spread(spread));
- QVERIFY(g->stops().at(0).first == stop0);
- QVERIFY(g->stops().at(0).second == color0);
- QVERIFY(g->stops().at(1).first == stop1);
- QVERIFY(g->stops().at(1).second == color1);
+ QCOMPARE(g->stops().at(0).first, stop0);
+ QCOMPARE(g->stops().at(0).second, color0);
+ QCOMPARE(g->stops().at(1).first, stop1);
+ QCOMPARE(g->stops().at(1).second, color1);
}
void tst_QCssParser::extractFontFamily_data()
@@ -1637,15 +1637,15 @@ void tst_QCssParser::extractBorder()
QSize radii[4];
extractor.extractBorder(widths, colors, styles, radii);
- QVERIFY(widths[QCss::TopEdge] == expectedTopWidth);
- QVERIFY(styles[QCss::TopEdge] == expectedTopStyle);
- QVERIFY(colors[QCss::TopEdge] == expectedTopColor);
+ QCOMPARE(widths[QCss::TopEdge], expectedTopWidth);
+ QCOMPARE(int(styles[QCss::TopEdge]), expectedTopStyle);
+ QCOMPARE(colors[QCss::TopEdge].color(), expectedTopColor);
//QTBUG-9674 : a second evaluation should give the same results
QVERIFY(extractor.extractBorder(widths, colors, styles, radii));
- QVERIFY(widths[QCss::TopEdge] == expectedTopWidth);
- QVERIFY(styles[QCss::TopEdge] == expectedTopStyle);
- QVERIFY(colors[QCss::TopEdge] == expectedTopColor);
+ QCOMPARE(widths[QCss::TopEdge], expectedTopWidth);
+ QCOMPARE(int(styles[QCss::TopEdge]), expectedTopStyle);
+ QCOMPARE(colors[QCss::TopEdge].color(), expectedTopColor);
}
void tst_QCssParser::noTextDecoration()
diff --git a/tests/auto/gui/text/qfont/BLACKLIST b/tests/auto/gui/text/qfont/BLACKLIST
new file mode 100644
index 0000000000..d859dee03e
--- /dev/null
+++ b/tests/auto/gui/text/qfont/BLACKLIST
@@ -0,0 +1,2 @@
+[exactMatch]
+opensuse-13.1
diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp
index 64b06e9856..93e308b96a 100644
--- a/tests/auto/gui/text/qfont/tst_qfont.cpp
+++ b/tests/auto/gui/text/qfont/tst_qfont.cpp
@@ -149,7 +149,7 @@ void tst_QFont::exactMatch()
#endif
- if (QGuiApplication::platformName() == QLatin1String("xcb")) {
+ if (!QGuiApplication::platformName().compare("xcb", Qt::CaseInsensitive)) {
QVERIFY(QFont("sans").exactMatch());
QVERIFY(QFont("sans-serif").exactMatch());
QVERIFY(QFont("serif").exactMatch());
@@ -217,15 +217,15 @@ void tst_QFont::exactMatch()
|| fontinfo.family().isEmpty());
}
if (font.pointSize() != -1) {
- QVERIFY(font.pointSize() == fontinfo.pointSize());
+ QCOMPARE(font.pointSize(), fontinfo.pointSize());
} else {
- QVERIFY(font.pixelSize() == fontinfo.pixelSize());
+ QCOMPARE(font.pixelSize(), fontinfo.pixelSize());
}
- QVERIFY(font.italic() == fontinfo.italic());
+ QCOMPARE(font.italic(), fontinfo.italic());
if (font.weight() != fontinfo.weight()) {
qDebug("font is %s", font.toString().toLatin1().constData());
}
- QVERIFY(font.weight() == fontinfo.weight());
+ QCOMPARE(font.weight(), fontinfo.weight());
} else {
font.setFixedPitch(!fontinfo.fixedPitch());
QFontInfo fontinfo1(font);
@@ -274,12 +274,12 @@ void tst_QFont::exactMatch()
|| fontinfo.family().contains(font.family())
|| fontinfo.family().isEmpty());
if (font.pointSize() != -1) {
- QVERIFY(font.pointSize() == fontinfo.pointSize());
+ QCOMPARE(font.pointSize(), fontinfo.pointSize());
} else {
- QVERIFY(font.pixelSize() == fontinfo.pixelSize());
+ QCOMPARE(font.pixelSize(), fontinfo.pixelSize());
}
- QVERIFY(font.italic() == fontinfo.italic());
- QVERIFY(font.weight() == fontinfo.weight());
+ QCOMPARE(font.italic(), fontinfo.italic());
+ QCOMPARE(font.weight(), fontinfo.weight());
} else {
font.setFixedPitch(!fontinfo.fixedPitch());
QFontInfo fontinfo1(font, (QFont::Script) script);
@@ -371,42 +371,42 @@ void tst_QFont::compare()
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
font2.setItalic(false);
- QVERIFY(font == font2);
+ QCOMPARE(font, font2);
QVERIFY(!(font < font2));
font2.setWeight(QFont::Bold);
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
font2.setWeight(QFont::Normal);
- QVERIFY(font == font2);
+ QCOMPARE(font, font2);
QVERIFY(!(font < font2));
font.setUnderline(true);
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
font.setUnderline(false);
- QVERIFY(font == font2);
+ QCOMPARE(font, font2);
QVERIFY(!(font < font2));
font.setStrikeOut(true);
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
font.setStrikeOut(false);
- QVERIFY(font == font2);
+ QCOMPARE(font, font2);
QVERIFY(!(font < font2));
font.setOverline(true);
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
font.setOverline(false);
- QVERIFY(font == font2);
+ QCOMPARE(font, font2);
QVERIFY(!(font < font2));
font.setCapitalization(QFont::SmallCaps);
QVERIFY(font != font2);
QCOMPARE(font < font2,!(font2 < font));
font.setCapitalization(QFont::MixedCase);
- QVERIFY(font == font2);
+ QCOMPARE(font, font2);
QVERIFY(!(font < font2));
}
}
@@ -426,27 +426,27 @@ void tst_QFont::resolve()
font1.setWeight(QFont::Bold);
QFont font2 = font1.resolve(font);
- QVERIFY(font2.weight() == font1.weight());
+ QCOMPARE(font2.weight(), font1.weight());
- QVERIFY(font2.pointSize() == font.pointSize());
- QVERIFY(font2.italic() == font.italic());
- QVERIFY(font2.underline() == font.underline());
- QVERIFY(font2.overline() == font.overline());
- QVERIFY(font2.strikeOut() == font.strikeOut());
- QVERIFY(font2.stretch() == font.stretch());
+ QCOMPARE(font2.pointSize(), font.pointSize());
+ QCOMPARE(font2.italic(), font.italic());
+ QCOMPARE(font2.underline(), font.underline());
+ QCOMPARE(font2.overline(), font.overline());
+ QCOMPARE(font2.strikeOut(), font.strikeOut());
+ QCOMPARE(font2.stretch(), font.stretch());
QFont font3;
font3.setStretch(QFont::UltraCondensed);
QFont font4 = font3.resolve(font1).resolve(font);
- QVERIFY(font4.stretch() == font3.stretch());
+ QCOMPARE(font4.stretch(), font3.stretch());
- QVERIFY(font4.weight() == font.weight());
- QVERIFY(font4.pointSize() == font.pointSize());
- QVERIFY(font4.italic() == font.italic());
- QVERIFY(font4.underline() == font.underline());
- QVERIFY(font4.overline() == font.overline());
- QVERIFY(font4.strikeOut() == font.strikeOut());
+ QCOMPARE(font4.weight(), font.weight());
+ QCOMPARE(font4.pointSize(), font.pointSize());
+ QCOMPARE(font4.italic(), font.italic());
+ QCOMPARE(font4.underline(), font.underline());
+ QCOMPARE(font4.overline(), font.overline());
+ QCOMPARE(font4.strikeOut(), font.strikeOut());
QFont f1,f2,f3;
@@ -479,8 +479,8 @@ void tst_QFont::resetFont()
child->setFont(QFont()); // reset font
- QVERIFY(child->font().resolve() == 0);
- QVERIFY(child->font().pointSize() == parent.font().pointSize());
+ QCOMPARE(child->font().resolve(), uint(0));
+ QCOMPARE(child->font().pointSize(), parent.font().pointSize());
QVERIFY(parent.font().resolve() != 0);
}
#endif
@@ -608,6 +608,11 @@ void tst_QFont::serialize_data()
font.setStyleName("Regular Black Condensed");
// This wasn't read until 5.4.
QTest::newRow("styleName") << font << QDataStream::Qt_5_4;
+
+ font = basicFont;
+ font.setCapitalization(QFont::AllUppercase);
+ // This wasn't read until 5.6.
+ QTest::newRow("capitalization") << font << QDataStream::Qt_5_6;
}
void tst_QFont::serialize()
@@ -728,24 +733,24 @@ void tst_QFont::sharing()
QCOMPARE(QFontPrivate::get(f)->engineData->ref.load(), 1 + refs_by_cache);
QFont f2(f);
- QVERIFY(QFontPrivate::get(f2) == QFontPrivate::get(f));
+ QCOMPARE(QFontPrivate::get(f2), QFontPrivate::get(f));
QCOMPARE(QFontPrivate::get(f2)->ref.load(), 2);
QVERIFY(QFontPrivate::get(f2)->engineData);
- QVERIFY(QFontPrivate::get(f2)->engineData == QFontPrivate::get(f)->engineData);
+ QCOMPARE(QFontPrivate::get(f2)->engineData, QFontPrivate::get(f)->engineData);
QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 1 + refs_by_cache);
f2.setKerning(!f.kerning());
QVERIFY(QFontPrivate::get(f2) != QFontPrivate::get(f));
QCOMPARE(QFontPrivate::get(f2)->ref.load(), 1);
QVERIFY(QFontPrivate::get(f2)->engineData);
- QVERIFY(QFontPrivate::get(f2)->engineData == QFontPrivate::get(f)->engineData);
+ QCOMPARE(QFontPrivate::get(f2)->engineData, QFontPrivate::get(f)->engineData);
QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 2 + refs_by_cache);
f2 = f;
- QVERIFY(QFontPrivate::get(f2) == QFontPrivate::get(f));
+ QCOMPARE(QFontPrivate::get(f2), QFontPrivate::get(f));
QCOMPARE(QFontPrivate::get(f2)->ref.load(), 2);
QVERIFY(QFontPrivate::get(f2)->engineData);
- QVERIFY(QFontPrivate::get(f2)->engineData == QFontPrivate::get(f)->engineData);
+ QCOMPARE(QFontPrivate::get(f2)->engineData, QFontPrivate::get(f)->engineData);
QCOMPARE(QFontPrivate::get(f2)->engineData->ref.load(), 1 + refs_by_cache);
if (f.pointSize() > 0)
diff --git a/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp
index d8e9836112..ec62bafd6c 100644
--- a/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp
+++ b/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp
@@ -65,6 +65,7 @@ private slots:
void inFontUcs4();
void lineWidth();
void mnemonicTextWidth();
+ void leadingBelowLine();
};
tst_QFontMetrics::tst_QFontMetrics()
@@ -343,5 +344,16 @@ void tst_QFontMetrics::mnemonicTextWidth()
QCOMPARE(fm.size(Qt::TextShowMnemonic, f1), fm.size(Qt::TextShowMnemonic, f2));
QCOMPARE(fm.size(Qt::TextHideMnemonic, f1), fm.size(Qt::TextHideMnemonic, f2));
}
+
+void tst_QFontMetrics::leadingBelowLine()
+{
+ QScriptLine line;
+ line.leading = 10;
+ line.leadingIncluded = true;
+ line.ascent = 5;
+ QCOMPARE(line.height(), line.ascent + line.descent + line.leading);
+ QCOMPARE(line.base(), line.ascent);
+}
+
QTEST_MAIN(tst_QFontMetrics)
#include "tst_qfontmetrics.moc"
diff --git a/tests/auto/gui/text/qrawfont/BLACKLIST b/tests/auto/gui/text/qrawfont/BLACKLIST
new file mode 100644
index 0000000000..a614595689
--- /dev/null
+++ b/tests/auto/gui/text/qrawfont/BLACKLIST
@@ -0,0 +1,4 @@
+[correctFontData]
+osx-10.8
+[unsupportedWritingSystem]
+osx-10.8
diff --git a/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp b/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp
index 014ed4c7c8..06448d11fe 100644
--- a/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp
+++ b/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp
@@ -120,7 +120,7 @@ void tst_QSyntaxHighlighter::cleanup()
class TestHighlighter : public QSyntaxHighlighter
{
public:
- inline TestHighlighter(const QList<QTextLayout::FormatRange> &fmts, QTextDocument *parent)
+ inline TestHighlighter(const QVector<QTextLayout::FormatRange> &fmts, QTextDocument *parent)
: QSyntaxHighlighter(parent), formats(fmts), highlighted(false), callCount(0) {}
inline TestHighlighter(QObject *parent)
: QSyntaxHighlighter(parent) {}
@@ -138,24 +138,15 @@ public:
++callCount;
}
- QList<QTextLayout::FormatRange> formats;
+ QVector<QTextLayout::FormatRange> formats;
bool highlighted;
int callCount;
QString highlightedText;
};
-QT_BEGIN_NAMESPACE
-bool operator==(const QTextLayout::FormatRange &lhs, const QTextLayout::FormatRange &rhs)
-{
- return lhs.start == rhs.start
- && lhs.length == rhs.length
- && lhs.format == rhs.format;
-}
-QT_END_NAMESPACE
-
void tst_QSyntaxHighlighter::basic()
{
- QList<QTextLayout::FormatRange> formats;
+ QVector<QTextLayout::FormatRange> formats;
QTextLayout::FormatRange range;
range.start = 0;
range.length = 2;
@@ -179,7 +170,7 @@ void tst_QSyntaxHighlighter::basic()
QVERIFY(hl->highlighted);
QVERIFY(lout->documentChangedCalled);
- QVERIFY(doc->begin().layout()->additionalFormats() == formats);
+ QCOMPARE(doc->begin().layout()->formats(), formats);
}
class CommentTestHighlighter : public QSyntaxHighlighter
@@ -222,7 +213,7 @@ void tst_QSyntaxHighlighter::basicTwo()
void tst_QSyntaxHighlighter::removeFormatsOnDelete()
{
- QList<QTextLayout::FormatRange> formats;
+ QVector<QTextLayout::FormatRange> formats;
QTextLayout::FormatRange range;
range.start = 0;
range.length = 9;
@@ -237,9 +228,9 @@ void tst_QSyntaxHighlighter::removeFormatsOnDelete()
QVERIFY(lout->documentChangedCalled);
lout->documentChangedCalled = false;
- QVERIFY(!doc->begin().layout()->additionalFormats().isEmpty());
+ QVERIFY(!doc->begin().layout()->formats().isEmpty());
delete hl;
- QVERIFY(doc->begin().layout()->additionalFormats().isEmpty());
+ QVERIFY(doc->begin().layout()->formats().isEmpty());
QVERIFY(lout->documentChangedCalled);
}
@@ -405,7 +396,7 @@ void tst_QSyntaxHighlighter::highlightToEndOfDocument2()
void tst_QSyntaxHighlighter::preservePreeditArea()
{
- QList<QTextLayout::FormatRange> formats;
+ QVector<QTextLayout::FormatRange> formats;
QTextLayout::FormatRange range;
range.start = 0;
range.length = 8;
@@ -432,12 +423,12 @@ void tst_QSyntaxHighlighter::preservePreeditArea()
hl->callCount = 0;
cursor.beginEditBlock();
- layout->setAdditionalFormats(formats);
+ layout->setFormats(formats);
cursor.endEditBlock();
QCOMPARE(hl->callCount, 1);
- formats = layout->additionalFormats();
+ formats = layout->formats();
QCOMPARE(formats.count(), 3);
range = formats.at(0);
@@ -483,7 +474,7 @@ void tst_QSyntaxHighlighter::avoidUnnecessaryRehighlight()
void tst_QSyntaxHighlighter::noContentsChangedDuringHighlight()
{
- QList<QTextLayout::FormatRange> formats;
+ QVector<QTextLayout::FormatRange> formats;
QTextLayout::FormatRange range;
range.start = 0;
range.length = 10;
diff --git a/tests/auto/gui/text/qtextblock/tst_qtextblock.cpp b/tests/auto/gui/text/qtextblock/tst_qtextblock.cpp
index 967fe3114e..49300871d9 100644
--- a/tests/auto/gui/text/qtextblock/tst_qtextblock.cpp
+++ b/tests/auto/gui/text/qtextblock/tst_qtextblock.cpp
@@ -102,7 +102,7 @@ void tst_QTextBlock::fragmentOverBlockBoundaries()
// Block separators are always a fragment of their self. Thus:
// |Hello|\b|World|\b|
#if !defined(Q_OS_WIN)
- QVERIFY(doc->docHandle()->fragmentMap().numNodes() == 4);
+ QCOMPARE(doc->docHandle()->fragmentMap().numNodes(), 4);
#endif
QCOMPARE(cursor.block().text(), QString("Hello"));
cursor.movePosition(QTextCursor::NextBlock);
@@ -126,7 +126,7 @@ void tst_QTextBlock::excludeParagraphSeparatorFragment()
++it;
QVERIFY(it.atEnd());
- QVERIFY(it == block.end());
+ QCOMPARE(it, block.end());
}
void tst_QTextBlock::backwardsBlockIterator()
diff --git a/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp b/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp
index 42b3c53bc5..9396cd678b 100644
--- a/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp
+++ b/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp
@@ -178,15 +178,15 @@ void tst_QTextCursor::navigation1()
QVERIFY(doc->toPlainText() == "Hello World");
cursor.movePosition(QTextCursor::End);
- QVERIFY(cursor.position() == 11);
+ QCOMPARE(cursor.position(), 11);
cursor.deletePreviousChar();
- QVERIFY(cursor.position() == 10);
+ QCOMPARE(cursor.position(), 10);
cursor.deletePreviousChar();
cursor.deletePreviousChar();
cursor.deletePreviousChar();
cursor.deletePreviousChar();
cursor.deletePreviousChar();
- QVERIFY(doc->toPlainText() == "Hello");
+ QCOMPARE(doc->toPlainText(), QLatin1String("Hello"));
QTextCursor otherCursor(doc);
otherCursor.movePosition(QTextCursor::Start);
@@ -195,12 +195,12 @@ void tst_QTextCursor::navigation1()
cursor.movePosition(QTextCursor::Right);
QVERIFY(cursor != otherCursor);
otherCursor.insertText("Hey");
- QVERIFY(cursor.position() == 5);
+ QCOMPARE(cursor.position(), 5);
doc->undo();
- QVERIFY(cursor.position() == 2);
+ QCOMPARE(cursor.position(), 2);
doc->redo();
- QVERIFY(cursor.position() == 5);
+ QCOMPARE(cursor.position(), 5);
doc->undo();
@@ -209,29 +209,29 @@ void tst_QTextCursor::navigation1()
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::Right, QTextCursor::MoveAnchor, 6);
- QVERIFY(cursor.position() == 6);
+ QCOMPARE(cursor.position(), 6);
otherCursor = cursor;
otherCursor.movePosition(QTextCursor::Right, QTextCursor::MoveAnchor, 2);
otherCursor.deletePreviousChar();
otherCursor.deletePreviousChar();
otherCursor.deletePreviousChar();
- QVERIFY(cursor.position() == 5);
+ QCOMPARE(cursor.position(), 5);
cursor.movePosition(QTextCursor::End);
cursor.insertBlock();
{
int oldPos = cursor.position();
cursor.movePosition(QTextCursor::End);
- QVERIFY(cursor.position() == oldPos);
+ QCOMPARE(cursor.position(), oldPos);
}
QVERIFY(cursor.atBlockStart());
- QVERIFY(cursor.position() == 9);
+ QCOMPARE(cursor.position(), 9);
QTextCharFormat fmt;
fmt.setForeground(Qt::blue);
cursor.insertText("Test", fmt);
- QVERIFY(fmt == cursor.charFormat());
- QVERIFY(cursor.position() == 13);
+ QCOMPARE(fmt, cursor.charFormat());
+ QCOMPARE(cursor.position(), 13);
}
void tst_QTextCursor::navigation2_data()
@@ -497,7 +497,7 @@ void tst_QTextCursor::navigation10()
QVERIFY(ok);
QCOMPARE(cursor.position(), 99);
ok = cursor.movePosition(QTextCursor::NextCell);
- QVERIFY(ok == false);
+ QVERIFY(!ok);
QCOMPARE(cursor.position(), 99); // didn't move.
QVERIFY(cursor.currentTable());
@@ -573,8 +573,8 @@ void tst_QTextCursor::insertBlock()
QTextBlockFormat fmt;
fmt.setTopMargin(100);
cursor.insertBlock(fmt);
- QVERIFY(cursor.position() == 1);
- QVERIFY(cursor.blockFormat() == fmt);
+ QCOMPARE(cursor.position(), 1);
+ QCOMPARE(cursor.blockFormat(), fmt);
}
void tst_QTextCursor::insertWithBlockSeparator1()
@@ -584,28 +584,28 @@ void tst_QTextCursor::insertWithBlockSeparator1()
cursor.insertText(text);
cursor.movePosition(QTextCursor::PreviousBlock);
- QVERIFY(cursor.position() == 0);
+ QCOMPARE(cursor.position(), 0);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.position() == 6);
+ QCOMPARE(cursor.position(), 6);
}
void tst_QTextCursor::insertWithBlockSeparator2()
{
cursor.insertText(QString(QChar::ParagraphSeparator));
- QVERIFY(cursor.position() == 1);
+ QCOMPARE(cursor.position(), 1);
}
void tst_QTextCursor::insertWithBlockSeparator3()
{
cursor.insertText(QString(QChar::ParagraphSeparator) + "Hi" + QString(QChar::ParagraphSeparator));
- QVERIFY(cursor.position() == 4);
+ QCOMPARE(cursor.position(), 4);
}
void tst_QTextCursor::insertWithBlockSeparator4()
{
cursor.insertText(QString(QChar::ParagraphSeparator) + QString(QChar::ParagraphSeparator));
- QVERIFY(cursor.position() == 2);
+ QCOMPARE(cursor.position(), 2);
}
void tst_QTextCursor::clearObjectType1()
@@ -656,7 +656,7 @@ void tst_QTextCursor::comparisonOperators1()
midCursor.movePosition(QTextCursor::NextWord);
QVERIFY(midCursor <= cursor);
- QVERIFY(midCursor == cursor);
+ QCOMPARE(midCursor, cursor);
QVERIFY(midCursor >= cursor);
QVERIFY(midCursor > startCursor);
@@ -690,7 +690,7 @@ void tst_QTextCursor::comparisonOperators2()
QTextCursor cursor2(&doc2);
QVERIFY(cursor1 != cursor2);
- QVERIFY(cursor1 == QTextCursor(&doc1));
+ QCOMPARE(cursor1, QTextCursor(&doc1));
}
void tst_QTextCursor::selection1()
@@ -718,97 +718,97 @@ void tst_QTextCursor::dontCopyTableAttributes()
void tst_QTextCursor::checkFrame1()
{
- QVERIFY(cursor.position() == 0);
+ QCOMPARE(cursor.position(), 0);
QPointer<QTextFrame> frame = cursor.insertFrame(QTextFrameFormat());
QVERIFY(frame != 0);
QTextFrame *root = frame->parentFrame();
QVERIFY(root != 0);
- QVERIFY(frame->firstPosition() == 1);
- QVERIFY(frame->lastPosition() == 1);
+ QCOMPARE(frame->firstPosition(), 1);
+ QCOMPARE(frame->lastPosition(), 1);
QVERIFY(frame->parentFrame() != 0);
- QVERIFY(root->childFrames().size() == 1);
+ QCOMPARE(root->childFrames().size(), 1);
- QVERIFY(cursor.position() == 1);
- QVERIFY(cursor.selectionStart() == 1);
- QVERIFY(cursor.selectionEnd() == 1);
+ QCOMPARE(cursor.position(), 1);
+ QCOMPARE(cursor.selectionStart(), 1);
+ QCOMPARE(cursor.selectionEnd(), 1);
doc->undo();
QVERIFY(!frame);
- QVERIFY(root->childFrames().size() == 0);
+ QCOMPARE(root->childFrames().size(), 0);
- QVERIFY(cursor.position() == 0);
- QVERIFY(cursor.selectionStart() == 0);
- QVERIFY(cursor.selectionEnd() == 0);
+ QCOMPARE(cursor.position(), 0);
+ QCOMPARE(cursor.selectionStart(), 0);
+ QCOMPARE(cursor.selectionEnd(), 0);
doc->redo();
frame = doc->frameAt(1);
QVERIFY(frame);
- QVERIFY(frame->firstPosition() == 1);
- QVERIFY(frame->lastPosition() == 1);
+ QCOMPARE(frame->firstPosition(), 1);
+ QCOMPARE(frame->lastPosition(), 1);
QVERIFY(frame->parentFrame() != 0);
- QVERIFY(root->childFrames().size() == 1);
+ QCOMPARE(root->childFrames().size(), 1);
- QVERIFY(cursor.position() == 1);
- QVERIFY(cursor.selectionStart() == 1);
- QVERIFY(cursor.selectionEnd() == 1);
+ QCOMPARE(cursor.position(), 1);
+ QCOMPARE(cursor.selectionStart(), 1);
+ QCOMPARE(cursor.selectionEnd(), 1);
// cursor.movePosition(QTextCursor::Right, QTextCursor::KeepAnchor);
-// QVERIFY(cursor.position() == 2);
-// QVERIFY(cursor.selectionStart() == 0);
-// QVERIFY(cursor.selectionEnd() == 2);
+// QCOMPARE(cursor.position(), 2);
+// QCOMPARE(cursor.selectionStart(), 0);
+// QCOMPARE(cursor.selectionEnd(), 2);
}
void tst_QTextCursor::checkFrame2()
{
- QVERIFY(cursor.position() == 0);
+ QCOMPARE(cursor.position(), 0);
cursor.insertText("A");
- QVERIFY(cursor.position() == 1);
+ QCOMPARE(cursor.position(), 1);
cursor.movePosition(QTextCursor::Start, QTextCursor::KeepAnchor);
QPointer<QTextFrame> frame = cursor.insertFrame(QTextFrameFormat());
QTextFrame *root = frame->parentFrame();
- QVERIFY(frame->firstPosition() == 1);
- QVERIFY(frame->lastPosition() == 2);
+ QCOMPARE(frame->firstPosition(), 1);
+ QCOMPARE(frame->lastPosition(), 2);
QVERIFY(frame->parentFrame() != 0);
- QVERIFY(root->childFrames().size() == 1);
+ QCOMPARE(root->childFrames().size(), 1);
- QVERIFY(cursor.position() == 1);
- QVERIFY(cursor.selectionStart() == 1);
- QVERIFY(cursor.selectionEnd() == 2);
+ QCOMPARE(cursor.position(), 1);
+ QCOMPARE(cursor.selectionStart(), 1);
+ QCOMPARE(cursor.selectionEnd(), 2);
doc->undo();
QVERIFY(!frame);
- QVERIFY(root->childFrames().size() == 0);
+ QCOMPARE(root->childFrames().size(), 0);
- QVERIFY(cursor.position() == 0);
- QVERIFY(cursor.selectionStart() == 0);
- QVERIFY(cursor.selectionEnd() == 1);
+ QCOMPARE(cursor.position(), 0);
+ QCOMPARE(cursor.selectionStart(), 0);
+ QCOMPARE(cursor.selectionEnd(), 1);
doc->redo();
frame = doc->frameAt(1);
QVERIFY(frame);
- QVERIFY(frame->firstPosition() == 1);
- QVERIFY(frame->lastPosition() == 2);
+ QCOMPARE(frame->firstPosition(), 1);
+ QCOMPARE(frame->lastPosition(), 2);
QVERIFY(frame->parentFrame() != 0);
- QVERIFY(root->childFrames().size() == 1);
+ QCOMPARE(root->childFrames().size(), 1);
- QVERIFY(cursor.position() == 1);
- QVERIFY(cursor.selectionStart() == 1);
- QVERIFY(cursor.selectionEnd() == 2);
+ QCOMPARE(cursor.position(), 1);
+ QCOMPARE(cursor.selectionStart(), 1);
+ QCOMPARE(cursor.selectionEnd(), 2);
cursor.movePosition(QTextCursor::Left, QTextCursor::KeepAnchor);
- QVERIFY(cursor.position() == 0);
- QVERIFY(cursor.selectionStart() == 0);
- QVERIFY(cursor.selectionEnd() == 3);
+ QCOMPARE(cursor.position(), 0);
+ QCOMPARE(cursor.selectionStart(), 0);
+ QCOMPARE(cursor.selectionEnd(), 3);
}
void tst_QTextCursor::insertBlockToUseCharFormat()
@@ -833,9 +833,9 @@ void tst_QTextCursor::insertBlockToUseCharFormat()
void tst_QTextCursor::tableMovement()
{
- QVERIFY(cursor.position() == 0);
+ QCOMPARE(cursor.position(), 0);
cursor.insertText("AA");
- QVERIFY(cursor.position() == 2);
+ QCOMPARE(cursor.position(), 2);
cursor.movePosition(QTextCursor::Left);
cursor.insertTable(3, 3);
@@ -1030,7 +1030,7 @@ void tst_QTextCursor::insertBlockShouldRemoveSelection()
cursor.insertBlock();
QVERIFY(!cursor.hasSelection());
- QVERIFY(doc->toPlainText().indexOf("Hello") == -1);
+ QCOMPARE(doc->toPlainText().indexOf("Hello"), -1);
}
void tst_QTextCursor::insertBlockShouldRemoveSelection2()
@@ -1046,7 +1046,7 @@ void tst_QTextCursor::insertBlockShouldRemoveSelection2()
cursor.insertBlock(fmt);
QVERIFY(!cursor.hasSelection());
- QVERIFY(doc->toPlainText().indexOf("Hello") == -1);
+ QCOMPARE(doc->toPlainText().indexOf("Hello"), -1);
}
void tst_QTextCursor::mergeCellShouldUpdateSelection()
@@ -1159,7 +1159,7 @@ void tst_QTextCursor::setBlockFormatInTable()
cursor.setBlockFormat(fmt);
cursor.movePosition(QTextCursor::Start);
- QVERIFY(cursor.blockFormat().background().color() == Qt::blue);
+ QCOMPARE(cursor.blockFormat().background().color(), QColor(Qt::blue));
}
void tst_QTextCursor::blockCharFormat2()
@@ -1174,7 +1174,7 @@ void tst_QTextCursor::blockCharFormat2()
cursor.movePosition(QTextCursor::Start);
cursor.insertText("Red");
cursor.movePosition(QTextCursor::PreviousCharacter);
- QVERIFY(cursor.charFormat().foreground().color() == Qt::red);
+ QCOMPARE(cursor.charFormat().foreground().color(), QColor(Qt::red));
}
void tst_QTextCursor::blockCharFormat3()
@@ -1189,21 +1189,23 @@ void tst_QTextCursor::blockCharFormat3()
cursor.insertText("Test");
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextCharacter);
- QVERIFY(cursor.charFormat().foreground().color() == Qt::green);
+ const QColor red(Qt::red);
+ const QColor green(Qt::green);
+ QCOMPARE(cursor.charFormat().foreground().color(), green);
cursor.movePosition(QTextCursor::Start);
- QVERIFY(cursor.charFormat().foreground().color() == Qt::green);
+ QCOMPARE(cursor.charFormat().foreground().color(), green);
fmt.setForeground(Qt::red);
cursor.setBlockCharFormat(fmt);
- QVERIFY(cursor.blockCharFormat().foreground().color() == Qt::red);
+ QCOMPARE(cursor.blockCharFormat().foreground().color(), red);
cursor.movePosition(QTextCursor::End);
cursor.movePosition(QTextCursor::Start);
- QVERIFY(cursor.charFormat().foreground().color() == Qt::green);
+ QCOMPARE(cursor.charFormat().foreground().color(), green);
cursor.insertText("Test");
- QVERIFY(cursor.charFormat().foreground().color() == Qt::green);
+ QCOMPARE(cursor.charFormat().foreground().color(), green);
cursor.select(QTextCursor::Document);
cursor.removeSelectedText();
@@ -1212,7 +1214,7 @@ void tst_QTextCursor::blockCharFormat3()
QVERIFY(cursor.atStart());
cursor.insertText("Test");
- QVERIFY(cursor.charFormat().foreground().color() == Qt::red);
+ QCOMPARE(cursor.charFormat().foreground().color(), red);
}
void tst_QTextCursor::blockCharFormat()
@@ -1222,12 +1224,12 @@ void tst_QTextCursor::blockCharFormat()
cursor.insertBlock(QTextBlockFormat(), fmt);
cursor.insertText("Hm");
- QVERIFY(cursor.blockCharFormat().foreground().color() == Qt::blue);
+ QCOMPARE(cursor.blockCharFormat().foreground().color(), QColor(Qt::blue));
fmt.setForeground(Qt::red);
cursor.setBlockCharFormat(fmt);
- QVERIFY(cursor.blockCharFormat().foreground().color() == Qt::red);
+ QCOMPARE(cursor.blockCharFormat().foreground().color(), QColor(Qt::red));
}
void tst_QTextCursor::blockCharFormatOnSelection()
@@ -1249,11 +1251,11 @@ void tst_QTextCursor::blockCharFormatOnSelection()
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.blockCharFormat().foreground().color() == Qt::blue);
+ QCOMPARE(cursor.blockCharFormat().foreground().color(), QColor(Qt::blue));
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.blockCharFormat().foreground().color() == Qt::red);
+ QCOMPARE(cursor.blockCharFormat().foreground().color(), QColor(Qt::red));
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.blockCharFormat().foreground().color() == Qt::white);
+ QCOMPARE(cursor.blockCharFormat().foreground().color(), QColor(Qt::white));
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextBlock);
@@ -1264,17 +1266,17 @@ void tst_QTextCursor::blockCharFormatOnSelection()
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.blockCharFormat().foreground().color() == Qt::cyan);
+ QCOMPARE(cursor.blockCharFormat().foreground().color(), QColor(Qt::cyan));
cursor.movePosition(QTextCursor::Right);
cursor.movePosition(QTextCursor::Right);
- QVERIFY(cursor.charFormat().foreground().color() == Qt::green);
+ QCOMPARE(cursor.charFormat().foreground().color(), QColor(Qt::green));
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.blockCharFormat().foreground().color() == Qt::cyan);
+ QCOMPARE(cursor.blockCharFormat().foreground().color(), QColor(Qt::cyan));
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.blockCharFormat().foreground().color() == Qt::white);
+ QCOMPARE(cursor.blockCharFormat().foreground().color(), QColor(Qt::white));
}
void tst_QTextCursor::anchorInitialized1()
@@ -1404,7 +1406,7 @@ void tst_QTextCursor::selectBlock()
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.blockFormat().alignment() == Qt::AlignHCenter);
+ QCOMPARE(cursor.blockFormat().alignment(), Qt::AlignHCenter);
QCOMPARE(cursor.block().text(), QString("blah"));
}
@@ -1449,7 +1451,7 @@ void tst_QTextCursor::insertFragmentShouldUseCurrentCharFormat()
cursor.insertFragment(fragment);
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextCharacter);
- QVERIFY(cursor.charFormat() == fmt);
+ QCOMPARE(cursor.charFormat(), fmt);
}
int tst_QTextCursor::blockCount()
@@ -1910,15 +1912,15 @@ void tst_QTextCursor::cursorPositionWithBlockUndoAndRedo()
int cursorPositionAfter = cursor.position();
cursor.endEditBlock();
- QVERIFY(doc->toPlainText() == "*AAAA*BBBB*CCCC*DDDD");
+ QCOMPARE(doc->toPlainText(), QLatin1String("*AAAA*BBBB*CCCC*DDDD"));
QCOMPARE(12, cursorPositionBefore);
QCOMPARE(1, cursorPositionAfter);
doc->undo(&cursor);
- QVERIFY(doc->toPlainText() == "AAAABBBBCCCCDDDD");
+ QCOMPARE(doc->toPlainText(), QLatin1String("AAAABBBBCCCCDDDD"));
QCOMPARE(cursor.position(), cursorPositionBefore);
doc->redo(&cursor);
- QVERIFY(doc->toPlainText() == "*AAAA*BBBB*CCCC*DDDD");
+ QCOMPARE(doc->toPlainText(), QLatin1String("*AAAA*BBBB*CCCC*DDDD"));
QCOMPARE(cursor.position(), cursorPositionAfter);
}
@@ -1932,11 +1934,11 @@ void tst_QTextCursor::cursorPositionWithBlockUndoAndRedo2()
cursor.insertText("AAAABBBBCCCCDDDD");
cursor.endEditBlock();
doc->undo(&cursor);
- QVERIFY(doc->toPlainText() == "AAAABBBB");
+ QCOMPARE(doc->toPlainText(), QLatin1String("AAAABBBB"));
QCOMPARE(cursor.position(), cursorPositionBefore);
cursor.insertText("CCCC");
- QVERIFY(doc->toPlainText() == "AAAABBBBCCCC");
+ QCOMPARE(doc->toPlainText(), QLatin1String("AAAABBBBCCCC"));
cursorPositionBefore = cursor.position();
cursor.setPosition(0, QTextCursor::KeepAnchor);
@@ -1951,7 +1953,7 @@ void tst_QTextCursor::cursorPositionWithBlockUndoAndRedo2()
doc->undo(&cursor);
- QVERIFY(doc->toPlainText() == "AAAABBBBCCCC");
+ QCOMPARE(doc->toPlainText(), QLatin1String("AAAABBBBCCCC"));
QCOMPARE(cursor.position(), cursorPositionBefore);
}
diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
index 5e6b606d83..7378ca85ee 100644
--- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
+++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
@@ -744,7 +744,7 @@ void tst_QTextDocument::mightBeRichText()
{
QFETCH(QString, input);
QFETCH(bool, result);
- QVERIFY(result == Qt::mightBeRichText(input));
+ QCOMPARE(result, Qt::mightBeRichText(input));
}
Q_DECLARE_METATYPE(QTextDocumentFragment)
@@ -2222,7 +2222,7 @@ void tst_QTextDocument::clonePreservesUserStates()
b2 = b2.next();
QCOMPARE(b1.userState(), b2.userState());
}
- QVERIFY(b2 == clone->end());
+ QCOMPARE(b2, clone->end());
delete clone;
}
@@ -2269,7 +2269,7 @@ void tst_QTextDocument::resolvedFontInEmptyFormat()
doc->setDefaultFont(font);
QTextCharFormat fmt = doc->begin().charFormat();
QVERIFY(fmt.properties().isEmpty());
- QVERIFY(fmt.font() == font);
+ QCOMPARE(fmt.font(), font);
}
void tst_QTextDocument::defaultRootFrameMargin()
@@ -2369,6 +2369,7 @@ void tst_QTextDocument::deleteTextObjectsOnClear()
void tst_QTextDocument::defaultStyleSheet()
{
+ const QColor green("green");
const QString sheet("p { background-color: green; }");
QVERIFY(doc->defaultStyleSheet().isEmpty());
doc->setDefaultStyleSheet(sheet);
@@ -2376,30 +2377,30 @@ void tst_QTextDocument::defaultStyleSheet()
cursor.insertHtml("<p>test");
QTextBlockFormat fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), green);
doc->clear();
cursor.insertHtml("<p>test");
fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), green);
QTextDocument *clone = doc->clone();
QCOMPARE(clone->defaultStyleSheet(), sheet);
cursor = QTextCursor(clone);
cursor.insertHtml("<p>test");
fmt = clone->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), green);
delete clone;
cursor = QTextCursor(doc);
cursor.insertHtml("<p>test");
fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), green);
doc->clear();
cursor.insertHtml("<style>p { background-color: red; }</style><p>test");
fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("red"));
+ QCOMPARE(fmt.background().color(), QColor(Qt::red));
doc->clear();
doc->setDefaultStyleSheet("invalid style sheet....");
@@ -2567,7 +2568,7 @@ void tst_QTextDocument::setTextPreservesUndoRedoEnabled()
void tst_QTextDocument::firstLast()
{
QCOMPARE(doc->blockCount(), 1);
- QVERIFY(doc->firstBlock() == doc->lastBlock());
+ QCOMPARE(doc->firstBlock(), doc->lastBlock());
doc->setPlainText("Hello\nTest\nWorld");
@@ -3013,8 +3014,8 @@ void tst_QTextDocument::QTBUG27354_spaceAndSoftSpace()
QTextBlock block = td.begin();
while (block.isValid()) {
QTextBlockFormat fmt = block.blockFormat();
- QVERIFY(fmt.lineHeightType() == QTextBlockFormat::SingleHeight);
- QVERIFY(fmt.lineHeight() == 0);
+ QCOMPARE(fmt.lineHeightType(), int(QTextBlockFormat::SingleHeight));
+ QCOMPARE(fmt.lineHeight(), qreal(0));
block = block.next();
}
}
@@ -3164,8 +3165,8 @@ void tst_QTextDocument::cssInheritance()
QTextBlock block = td.begin();
while (block.isValid()) {
QTextBlockFormat fmt = block.blockFormat();
- QVERIFY(fmt.lineHeightType() == QTextBlockFormat::ProportionalHeight);
- QVERIFY(fmt.lineHeight() == 200);
+ QCOMPARE(fmt.lineHeightType(), int(QTextBlockFormat::ProportionalHeight));
+ QCOMPARE(fmt.lineHeight(), qreal(200));
block = block.next();
}
}
@@ -3175,12 +3176,12 @@ void tst_QTextDocument::cssInheritance()
"<p style=\"line-height: 40px\">Foo</p><p>Bar</p><p>Baz</p></body></html>");
QTextBlock block = td.begin();
QTextBlockFormat fmt = block.blockFormat();
- QVERIFY(fmt.lineHeightType() == QTextBlockFormat::FixedHeight);
- QVERIFY(fmt.lineHeight() == 40);
+ QCOMPARE(fmt.lineHeightType(), int(QTextBlockFormat::FixedHeight));
+ QCOMPARE(fmt.lineHeight(), qreal(40));
block = block.next();
fmt = block.blockFormat();
- QVERIFY(fmt.lineHeightType() == QTextBlockFormat::ProportionalHeight);
- QVERIFY(fmt.lineHeight() == 300);
+ QCOMPARE(fmt.lineHeightType(), int(QTextBlockFormat::ProportionalHeight));
+ QCOMPARE(fmt.lineHeight(), qreal(300));
}
{
QTextDocument td;
@@ -3188,7 +3189,7 @@ void tst_QTextDocument::cssInheritance()
"<p>Foo</p><p>Bar</p><p>Baz</p></body></html>");
QTextBlock block = td.begin();
while (block.isValid()) {
- QVERIFY(block.blockFormat().background() == QBrush());
+ QCOMPARE(block.blockFormat().background(), QBrush());
QVERIFY(block.charFormat().font().bold());
block = block.next();
}
diff --git a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
index 8f0d306cba..1cd9d9bcbe 100644
--- a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
+++ b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
@@ -727,7 +727,7 @@ void tst_QTextDocumentFragment::html_listIndents5()
QCOMPARE(list->format().indent(), 1);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.currentList() == list);
+ QCOMPARE(cursor.currentList(), list);
QCOMPARE(cursor.blockFormat().indent(), 0);
}
@@ -778,7 +778,7 @@ void tst_QTextDocumentFragment::blockCharFormatCopied()
cleanup();
init();
cursor.insertFragment(frag);
- QVERIFY(cursor.blockCharFormat() == fmt);
+ QCOMPARE(cursor.blockCharFormat(), fmt);
}
void tst_QTextDocumentFragment::initialBlock()
@@ -794,19 +794,19 @@ void tst_QTextDocumentFragment::clone()
mod.setAlignment(Qt::AlignCenter);
cursor.mergeBlockFormat(mod);
cursor.insertText("Blah");
- QVERIFY(cursor.blockFormat().alignment() == Qt::AlignCenter);
+ QCOMPARE(cursor.blockFormat().alignment(), Qt::AlignCenter);
QTextDocumentFragment frag(doc);
cleanup();
init();
cursor.insertFragment(frag);
cursor.movePosition(QTextCursor::Start);
- QVERIFY(cursor.blockFormat().alignment() == Qt::AlignCenter);
+ QCOMPARE(cursor.blockFormat().alignment(), Qt::AlignCenter);
}
void tst_QTextDocumentFragment::dontRemoveInitialBlockIfItHoldsObjectIndexedCharFormat()
{
const char html[] = "<table><tr><td>cell one<td>cell two</tr><tr><td>cell three<td>cell four</tr></table>";
- QVERIFY(doc->begin().charFormat().objectIndex() == -1);
+ QCOMPARE(doc->begin().charFormat().objectIndex(), -1);
setHtml(QString::fromLatin1(html));
int cnt = 0;
@@ -841,13 +841,13 @@ void tst_QTextDocumentFragment::unorderedListEnumeration()
setHtml(QString::fromLatin1(html));
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListDisc);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListDisc);
const char html2[] = "<ul><ul><ul type=circle><li>Blah</li></ul></ul>";
setHtml(QString::fromLatin1(html2));
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListCircle);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListCircle);
}
@@ -873,7 +873,7 @@ void tst_QTextDocumentFragment::hrefAnchor()
setHtml(QString::fromLatin1(html));
QVERIFY(doc->begin().begin().fragment().charFormat().isAnchor());
QCOMPARE(doc->begin().begin().fragment().charFormat().anchorHref(), QString::fromLatin1("test"));
- QVERIFY(doc->begin().begin().fragment().charFormat().fontUnderline() == true);
+ QVERIFY(doc->begin().begin().fragment().charFormat().fontUnderline());
}
{
@@ -881,7 +881,7 @@ void tst_QTextDocumentFragment::hrefAnchor()
const char html[] = "<a>blah</a>";
setHtml(QString::fromLatin1(html));
QVERIFY(doc->begin().begin().fragment().charFormat().isAnchor());
- QVERIFY(doc->begin().begin().fragment().charFormat().fontUnderline() == false);
+ QVERIFY(!doc->begin().begin().fragment().charFormat().fontUnderline());
}
}
@@ -901,7 +901,7 @@ void tst_QTextDocumentFragment::namedAnchorFragments()
// the 'a'
QVERIFY(it.fragment().isValid());
QCOMPARE(it.fragment().text(), QString::fromLatin1("a"));
- QVERIFY(it.fragment().charFormat().isAnchor() == false);
+ QVERIFY(!it.fragment().charFormat().isAnchor());
// the 'b' of 'blah' as separate fragment with the anchor attribute
++it;
@@ -913,7 +913,7 @@ void tst_QTextDocumentFragment::namedAnchorFragments()
++it;
QVERIFY(it.fragment().isValid());
QVERIFY(it.fragment().text().startsWith("lah"));
- QVERIFY(it.fragment().charFormat().isAnchor() == false);
+ QVERIFY(!it.fragment().charFormat().isAnchor());
}
void tst_QTextDocumentFragment::namedAnchorFragments2()
@@ -982,7 +982,7 @@ void tst_QTextDocumentFragment::cellBlockCount()
int blockCount = 0;
for (QTextFrame::iterator it = cell.begin(); !it.atEnd(); ++it) {
- QVERIFY(it.currentFrame() == 0);
+ QVERIFY(!it.currentFrame());
QVERIFY(it.currentBlock().isValid());
++blockCount;
}
@@ -1003,7 +1003,7 @@ void tst_QTextDocumentFragment::cellBlockCount2()
int blockCount = 0;
for (QTextFrame::iterator it = cell.begin(); !it.atEnd(); ++it) {
- QVERIFY(it.currentFrame() == 0);
+ QVERIFY(!it.currentFrame());
QVERIFY(it.currentBlock().isValid());
++blockCount;
}
@@ -1037,7 +1037,7 @@ void tst_QTextDocumentFragment::emptyTable3()
QCOMPARE(table->columns(), 2);
QTextTableCell cell = table->cellAt(0, 0);
QVERIFY(cell.isValid());
- QVERIFY(cell.firstPosition() == cell.lastPosition());
+ QCOMPARE(cell.firstPosition(), cell.lastPosition());
cell = table->cellAt(0, 1);
QTextCursor cursor = cell.firstCursorPosition();
cursor.setPosition(cell.lastPosition(), QTextCursor::KeepAnchor);
@@ -1065,7 +1065,7 @@ void tst_QTextDocumentFragment::inheritAlignment()
const char html[] = "<body align=right><p>Hey";
setHtml(QString::fromLatin1(html));
// html alignment is absolute
- QVERIFY(doc->begin().blockFormat().alignment() == Qt::Alignment(Qt::AlignRight|Qt::AlignAbsolute));
+ QCOMPARE(doc->begin().blockFormat().alignment(), Qt::Alignment(Qt::AlignRight|Qt::AlignAbsolute));
}
void tst_QTextDocumentFragment::dontEmitEmptyNodeWhenEmptyTagIsFollowedByCloseTag()
@@ -1073,8 +1073,8 @@ void tst_QTextDocumentFragment::dontEmitEmptyNodeWhenEmptyTagIsFollowedByCloseTa
// make sure the Hey does not end up as tag text for the img tag
const char html[] = "<body align=right><p align=left>Blah<img></img><p>Hey";
setHtml(QString::fromLatin1(html));
- QVERIFY(doc->begin().blockFormat().alignment() == Qt::Alignment(Qt::AlignLeft|Qt::AlignAbsolute));
- QVERIFY(doc->begin().next().blockFormat().alignment() == Qt::Alignment(Qt::AlignRight|Qt::AlignAbsolute));
+ QCOMPARE(doc->begin().blockFormat().alignment(), Qt::Alignment(Qt::AlignLeft|Qt::AlignAbsolute));
+ QCOMPARE(doc->begin().next().blockFormat().alignment(), Qt::Alignment(Qt::AlignRight|Qt::AlignAbsolute));
}
void tst_QTextDocumentFragment::toPlainText()
@@ -1378,8 +1378,8 @@ void tst_QTextDocumentFragment::html_listStart1()
{
// don't create a block for the <ul> element, even if there's some whitespace between
// it and the <li>
- const char html[] = "<ul> <li>list item</li><ul>";
- cursor.insertFragment(QTextDocumentFragment::fromHtml(QByteArray::fromRawData(html, sizeof(html) / sizeof(html[0]))));
+ const QString html = QStringLiteral("<ul> <li>list item</li><ul>");
+ cursor.insertFragment(QTextDocumentFragment::fromHtml(html));
QCOMPARE(doc->blockCount(), 1);
}
@@ -1387,8 +1387,8 @@ void tst_QTextDocumentFragment::html_listStart1()
void tst_QTextDocumentFragment::html_listStart2()
{
// unlike with html_listStart1 we want a block showing the 'buggy' text here
- const char html[] = "<ul>buggy, but text should appear<li>list item</li><ul>";
- cursor.insertFragment(QTextDocumentFragment::fromHtml(QByteArray::fromRawData(html, sizeof(html) / sizeof(html[0]))));
+ const QString html = QStringLiteral("<ul>buggy, but text should appear<li>list item</li><ul>");
+ cursor.insertFragment(QTextDocumentFragment::fromHtml(html));
QCOMPARE(doc->blockCount(), 2);
}
@@ -1480,19 +1480,19 @@ void tst_QTextDocumentFragment::html_subAndSuperScript()
const char alignmentInherited[] = "<sub><font face=\"Verdana\">Subby</font></sub>";
setHtml(subHtml);
- QVERIFY(cursor.charFormat().verticalAlignment() == QTextCharFormat::AlignSubScript);
+ QCOMPARE(cursor.charFormat().verticalAlignment(), QTextCharFormat::AlignSubScript);
setHtml(subHtmlCss);
- QVERIFY(cursor.charFormat().verticalAlignment() == QTextCharFormat::AlignSubScript);
+ QCOMPARE(cursor.charFormat().verticalAlignment(), QTextCharFormat::AlignSubScript);
setHtml(superHtml);
- QVERIFY(cursor.charFormat().verticalAlignment() == QTextCharFormat::AlignSuperScript);
+ QCOMPARE(cursor.charFormat().verticalAlignment(), QTextCharFormat::AlignSuperScript);
setHtml(superHtmlCss);
- QVERIFY(cursor.charFormat().verticalAlignment() == QTextCharFormat::AlignSuperScript);
+ QCOMPARE(cursor.charFormat().verticalAlignment(), QTextCharFormat::AlignSuperScript);
setHtml(alignmentInherited);
- QVERIFY(cursor.charFormat().verticalAlignment() == QTextCharFormat::AlignSubScript);
+ QCOMPARE(cursor.charFormat().verticalAlignment(), QTextCharFormat::AlignSubScript);
}
void tst_QTextDocumentFragment::html_cssColors()
@@ -1695,7 +1695,7 @@ void tst_QTextDocumentFragment::html_bodyBackground()
const char html[] = "<body background=\"foo.png\">Foo</body>";
doc->setHtml(html);
- QVERIFY(doc->rootFrame()->frameFormat().background().style() == Qt::TexturePattern);
+ QCOMPARE(doc->rootFrame()->frameFormat().background().style(), Qt::TexturePattern);
}
void tst_QTextDocumentFragment::html_tableCellBackground()
@@ -1709,7 +1709,7 @@ void tst_QTextDocumentFragment::html_tableCellBackground()
QVERIFY(table);
QTextTableCell cell = table->cellAt(0, 0);
- QVERIFY(cell.format().background().style() == Qt::TexturePattern);
+ QCOMPARE(cell.format().background().style(), Qt::TexturePattern);
}
void tst_QTextDocumentFragment::css_bodyBackground()
@@ -1717,7 +1717,7 @@ void tst_QTextDocumentFragment::css_bodyBackground()
const char html[] = "<body style=\"background-image:url('foo.png')\">Foo</body>";
doc->setHtml(html);
- QVERIFY(doc->rootFrame()->frameFormat().background().style() == Qt::TexturePattern);
+ QCOMPARE(doc->rootFrame()->frameFormat().background().style(), Qt::TexturePattern);
}
void tst_QTextDocumentFragment::css_tableCellBackground()
@@ -1731,7 +1731,7 @@ void tst_QTextDocumentFragment::css_tableCellBackground()
QVERIFY(table);
QTextTableCell cell = table->cellAt(0, 0);
- QVERIFY(cell.format().background().style() == Qt::TexturePattern);
+ QCOMPARE(cell.format().background().style(), Qt::TexturePattern);
}
void tst_QTextDocumentFragment::css_cellPaddings()
@@ -1767,7 +1767,7 @@ void tst_QTextDocumentFragment::html_blockLevelDiv()
setHtml(html);
QCOMPARE(doc->begin().blockFormat().alignment(), Qt::AlignRight|Qt::AlignAbsolute);
- QVERIFY(doc->begin().next() == doc->end());
+ QCOMPARE(doc->begin().next(), doc->end());
}
void tst_QTextDocumentFragment::html_spanNesting()
@@ -1805,7 +1805,7 @@ void tst_QTextDocumentFragment::html_nestedLists()
cursor.movePosition(QTextCursor::NextBlock);
QTextList *thirdList = cursor.currentList();
QVERIFY(thirdList);
- QVERIFY(thirdList == firstList);
+ QCOMPARE(thirdList, firstList);
}
void tst_QTextDocumentFragment::noSpecialCharactersInPlainText()
@@ -1837,7 +1837,7 @@ void tst_QTextDocumentFragment::html_doNotInheritBackground()
for (QTextBlock block = doc->begin();
block.isValid(); block = block.next()) {
- QVERIFY(block.blockFormat().hasProperty(QTextFormat::BackgroundBrush) == false);
+ QVERIFY(!block.blockFormat().hasProperty(QTextFormat::BackgroundBrush));
}
QVERIFY(doc->rootFrame()->frameFormat().hasProperty(QTextFormat::BackgroundBrush));
@@ -2022,7 +2022,7 @@ void tst_QTextDocumentFragment::html_frameImport()
cursor.insertFragment(frag);
QList<QTextFrame *> childFrames = doc->rootFrame()->childFrames();
- QVERIFY(childFrames.count() == 1);
+ QCOMPARE(childFrames.count(), 1);
QTextFrame *frame = childFrames.first();
QCOMPARE(frame->frameFormat().margin(), ffmt.margin());
QCOMPARE(frame->frameFormat().border(), ffmt.border());
@@ -2050,7 +2050,7 @@ void tst_QTextDocumentFragment::html_frameImport2()
cursor.insertFragment(frag);
QList<QTextFrame *> childFrames = doc->rootFrame()->childFrames();
- QVERIFY(childFrames.count() == 1);
+ QCOMPARE(childFrames.count(), 1);
QTextFrame *frame = childFrames.first();
QCOMPARE(frame->frameFormat().topMargin(), ffmt.topMargin());
QCOMPARE(frame->frameFormat().bottomMargin(), ffmt.bottomMargin());
@@ -2065,7 +2065,7 @@ void tst_QTextDocumentFragment::html_dontAddMarginsAcrossTableCells()
cursor.insertFragment(QTextDocumentFragment::fromHtml(QString::fromLatin1(html)));
QList<QTextFrame *> childFrames = doc->rootFrame()->childFrames();
- QVERIFY(childFrames.count() == 1);
+ QCOMPARE(childFrames.count(), 1);
QTextFrame *frame = childFrames.first();
cursor = frame->firstCursorPosition();
QCOMPARE(cursor.blockFormat().leftMargin(), qreal(50.0));
@@ -2078,7 +2078,7 @@ void tst_QTextDocumentFragment::html_dontMergeCenterBlocks()
QCOMPARE(doc->blockCount(), 2);
QTextBlock blk = doc->begin();
- QVERIFY(blk.blockFormat().alignment() == Qt::AlignCenter);
+ QCOMPARE(blk.blockFormat().alignment(), Qt::AlignCenter);
blk = blk.next();
QVERIFY(blk.blockFormat().alignment() != Qt::AlignCenter);
}
@@ -2112,7 +2112,7 @@ void tst_QTextDocumentFragment::html_tableCellBgColor2()
QTextFrame::Iterator it = cell.begin();
QVERIFY(!it.atEnd());
- QVERIFY(it.currentFrame() == 0);
+ QVERIFY(!it.currentFrame());
QVERIFY(it.currentBlock().isValid());
++it;
@@ -2122,9 +2122,9 @@ void tst_QTextDocumentFragment::html_tableCellBgColor2()
++it;
QVERIFY(!it.atEnd());
- QVERIFY(it.currentFrame() == 0);
+ QVERIFY(!it.currentFrame());
QVERIFY(it.currentBlock().isValid());
- QVERIFY(it.currentBlock().blockFormat().background() == QBrush(Qt::NoBrush));
+ QCOMPARE(it.currentBlock().blockFormat().background(), QBrush(Qt::NoBrush));
++it;
QVERIFY(it.atEnd());
@@ -2245,8 +2245,8 @@ void tst_QTextDocumentFragment::html_blockVsInline()
{
{
setHtml("<html><body><div><b>Foo<div>Bar");
- QVERIFY(cursor.charFormat().fontWeight() == QFont::Bold);
- QVERIFY(cursor.blockCharFormat().fontWeight() == QFont::Bold);
+ QCOMPARE(cursor.charFormat().fontWeight(), int(QFont::Bold));
+ QCOMPARE(cursor.blockCharFormat().fontWeight(), int(QFont::Bold));
}
{
setHtml("<html><body><p><b>Foo<p>Bar");
@@ -2255,23 +2255,23 @@ void tst_QTextDocumentFragment::html_blockVsInline()
}
{
setHtml("<html><body><b><center>Foo</center></b>");
- QVERIFY(cursor.charFormat().fontWeight() == QFont::Bold);
- QVERIFY(cursor.blockCharFormat().fontWeight() == QFont::Bold);
+ QCOMPARE(cursor.charFormat().fontWeight(), int(QFont::Bold));
+ QCOMPARE(cursor.blockCharFormat().fontWeight(), int(QFont::Bold));
}
{
setHtml("<html><body><b><p>Foo");
- QVERIFY(cursor.charFormat().fontWeight() == QFont::Bold);
- QVERIFY(cursor.blockCharFormat().fontWeight() == QFont::Bold);
+ QCOMPARE(cursor.charFormat().fontWeight(), int(QFont::Bold));
+ QCOMPARE(cursor.blockCharFormat().fontWeight(), int(QFont::Bold));
}
{
setHtml("<html><body><b><p>Foo<p>Bar");
- QVERIFY(cursor.charFormat().fontWeight() == QFont::Bold);
- QVERIFY(cursor.blockCharFormat().fontWeight() == QFont::Bold);
+ QCOMPARE(cursor.charFormat().fontWeight(), int(QFont::Bold));
+ QCOMPARE(cursor.blockCharFormat().fontWeight(), int(QFont::Bold));
}
{
setHtml("<div><b>Foo<div>Bar");
- QVERIFY(cursor.charFormat().fontWeight() == QFont::Bold);
- QVERIFY(cursor.blockCharFormat().fontWeight() == QFont::Bold);
+ QCOMPARE(cursor.charFormat().fontWeight(), int(QFont::Bold));
+ QCOMPARE(cursor.blockCharFormat().fontWeight(), int(QFont::Bold));
}
{
setHtml("<p><b>Foo<p>Bar");
@@ -2280,18 +2280,18 @@ void tst_QTextDocumentFragment::html_blockVsInline()
}
{
setHtml("<b><center>Foo</center></b>");
- QVERIFY(cursor.charFormat().fontWeight() == QFont::Bold);
- QVERIFY(cursor.blockCharFormat().fontWeight() == QFont::Bold);
+ QCOMPARE(cursor.charFormat().fontWeight(), int(QFont::Bold));
+ QCOMPARE(cursor.blockCharFormat().fontWeight(), int(QFont::Bold));
}
{
setHtml("<b><p>Foo");
- QVERIFY(cursor.charFormat().fontWeight() == QFont::Bold);
- QVERIFY(cursor.blockCharFormat().fontWeight() == QFont::Bold);
+ QCOMPARE(cursor.charFormat().fontWeight(), int(QFont::Bold));
+ QCOMPARE(cursor.blockCharFormat().fontWeight(), int(QFont::Bold));
}
{
setHtml("<b><p>Foo<p>Bar");
- QVERIFY(cursor.charFormat().fontWeight() == QFont::Bold);
- QVERIFY(cursor.blockCharFormat().fontWeight() == QFont::Bold);
+ QCOMPARE(cursor.charFormat().fontWeight(), int(QFont::Bold));
+ QCOMPARE(cursor.blockCharFormat().fontWeight(), int(QFont::Bold));
}
}
@@ -2338,7 +2338,7 @@ void tst_QTextDocumentFragment::html_nestedTables()
QTextTable *firstNestedTable = cursor.currentTable();
QVERIFY(firstNestedTable);
- QVERIFY(firstNestedTable->parentFrame() == table);
+ QCOMPARE(firstNestedTable->parentFrame(), table);
QCOMPARE(firstNestedTable->rows(), 1);
QCOMPARE(firstNestedTable->columns(), 1);
QCOMPARE(firstNestedTable->cellAt(0, 0).firstCursorPosition().block().text(), QString("Hello"));
@@ -2348,13 +2348,13 @@ void tst_QTextDocumentFragment::html_nestedTables()
;
QVERIFY(!cursor.isNull());
- QVERIFY(cursor.currentTable() == table);
+ QCOMPARE(cursor.currentTable(), table);
cursor.movePosition(QTextCursor::NextBlock);
QTextTable *secondNestedTable = cursor.currentTable();
QVERIFY(secondNestedTable);
- QVERIFY(secondNestedTable->parentFrame() == table);
+ QCOMPARE(secondNestedTable->parentFrame(), table);
QCOMPARE(secondNestedTable->rows(), 1);
QCOMPARE(secondNestedTable->columns(), 1);
QCOMPARE(secondNestedTable->cellAt(0, 0).firstCursorPosition().block().text(), QString("World"));
@@ -2454,7 +2454,7 @@ void tst_QTextDocumentFragment::html_anchorColor()
setHtml("<span style=\"color: red;\"><a href=\"http://www.kde.org/\">Blue</a></span>");
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextCharacter);
- QVERIFY(cursor.charFormat().foreground().color() == QGuiApplication::palette().link().color());
+ QCOMPARE(cursor.charFormat().foreground().color(), QGuiApplication::palette().link().color());
setHtml("<span style=\"color: red;\"><a href=\"http://www.kde.org/\" style=\"color: yellow;\">Green</a></span>");
cursor.movePosition(QTextCursor::Start);
@@ -2525,17 +2525,17 @@ void tst_QTextDocumentFragment::html_columnWidths()
const QVector<QTextLength> columnWidths = fmt.columnWidthConstraints();
QCOMPARE(columnWidths.count(), 2);
- QVERIFY(columnWidths.at(0).type() == QTextLength::VariableLength);
- QVERIFY(columnWidths.at(1).type() == QTextLength::PercentageLength);
- QVERIFY(columnWidths.at(1).rawValue() == 1);
+ QCOMPARE(columnWidths.at(0).type(), QTextLength::VariableLength);
+ QCOMPARE(columnWidths.at(1).type(), QTextLength::PercentageLength);
+ QCOMPARE(columnWidths.at(1).rawValue(), qreal(1));
}
void tst_QTextDocumentFragment::css_fontWeight()
{
setHtml("<p style=\"font-weight:bold\">blah</p>");
- QVERIFY(doc->begin().charFormat().fontWeight() == QFont::Bold);
+ QCOMPARE(doc->begin().charFormat().fontWeight(), int(QFont::Bold));
setHtml("<p style=\"font-weight:600\">blah</p>");
- QVERIFY(doc->begin().charFormat().fontWeight() == QFont::Bold);
+ QCOMPARE(doc->begin().charFormat().fontWeight(), int(QFont::Bold));
}
@@ -2548,7 +2548,7 @@ void tst_QTextDocumentFragment::css_float()
QVERIFY(o);
QTextFormat f = o->format();
QVERIFY(f.isFrameFormat());
- QVERIFY(f.toFrameFormat().position() == QTextFrameFormat::FloatRight);
+ QCOMPARE(f.toFrameFormat().position(), QTextFrameFormat::FloatRight);
setHtml("<img src=\"foo\" align=right>");
fmt = doc->begin().begin().fragment().charFormat();
@@ -2557,7 +2557,7 @@ void tst_QTextDocumentFragment::css_float()
QVERIFY(o);
f = o->format();
QVERIFY(f.isFrameFormat());
- QVERIFY(f.toFrameFormat().position() == QTextFrameFormat::FloatRight);
+ QCOMPARE(f.toFrameFormat().position(), QTextFrameFormat::FloatRight);
setHtml("<img src=\"foo\" align=left>");
fmt = doc->begin().begin().fragment().charFormat();
@@ -2566,7 +2566,7 @@ void tst_QTextDocumentFragment::css_float()
QVERIFY(o);
f = o->format();
QVERIFY(f.isFrameFormat());
- QVERIFY(f.toFrameFormat().position() == QTextFrameFormat::FloatLeft);
+ QCOMPARE(f.toFrameFormat().position(), QTextFrameFormat::FloatLeft);
}
void tst_QTextDocumentFragment::css_textIndent()
@@ -2585,7 +2585,7 @@ void tst_QTextDocumentFragment::css_inline()
"<p>test</p>"
);
QTextBlockFormat fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), QColor("green"));
}
void tst_QTextDocumentFragment::css_external()
@@ -2596,11 +2596,12 @@ void tst_QTextDocumentFragment::css_external()
"<p>test</p>"
);
QTextBlockFormat fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), QColor("green"));
}
void tst_QTextDocumentFragment::css_import()
{
+ const QColor green("green");
doc->addResource(QTextDocument::StyleSheetResource, QUrl("test.css"), QString("@import \"other.css\";"));
doc->addResource(QTextDocument::StyleSheetResource, QUrl("other.css"), QString("@import url(\"other2.css\");"));
doc->addResource(QTextDocument::StyleSheetResource, QUrl("other2.css"), QString("p { background-color: green; }"));
@@ -2609,14 +2610,14 @@ void tst_QTextDocumentFragment::css_import()
"<p>test</p>"
);
QTextBlockFormat fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), green);
doc->setHtml(""
"<style>@import \"test.css\" screen;</style>"
"<p>test</p>"
);
fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), green);
}
void tst_QTextDocumentFragment::css_selectors_data()
@@ -2662,9 +2663,9 @@ void tst_QTextDocumentFragment::css_selectors()
QTextBlockFormat fmt = doc->begin().blockFormat();
if (match)
- QVERIFY(fmt.background().color() == QColor("red"));
+ QCOMPARE(fmt.background().color(), QColor("red"));
else
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), QColor("green"));
}
void tst_QTextDocumentFragment::css_nodeNameCaseInsensitivity()
@@ -2674,7 +2675,7 @@ void tst_QTextDocumentFragment::css_nodeNameCaseInsensitivity()
"</style>"
"<p>test</p>");
QTextBlockFormat fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), QColor("green"));
}
void tst_QTextDocumentFragment::css_textUnderlineStyle_data()
@@ -2710,14 +2711,14 @@ void tst_QTextDocumentFragment::css_textUnderlineStyleAndDecoration()
QTextFragment fragment = doc->begin().begin().fragment();
QVERIFY(fragment.isValid());
- QVERIFY(fragment.charFormat().underlineStyle() == QTextCharFormat::SingleUnderline);
+ QCOMPARE(fragment.charFormat().underlineStyle(), QTextCharFormat::SingleUnderline);
QVERIFY(fragment.charFormat().fontOverline());
doc->setHtml("<span style=\"text-underline-style: solid; text-decoration: overline\">Test</span>");
fragment = doc->begin().begin().fragment();
QVERIFY(fragment.isValid());
- QVERIFY(fragment.charFormat().underlineStyle() == QTextCharFormat::SingleUnderline);
+ QCOMPARE(fragment.charFormat().underlineStyle(), QTextCharFormat::SingleUnderline);
QVERIFY(fragment.charFormat().fontOverline());
}
@@ -2726,48 +2727,48 @@ void tst_QTextDocumentFragment::css_listStyleType()
doc->setHtml("<ol style=\"list-style-type: disc\"><li>Blah</li></ol>");
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListDisc);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListDisc);
doc->setHtml("<ul style=\"list-style-type: square\"><li>Blah</li></ul>");
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListSquare);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListSquare);
doc->setHtml("<ul style=\"list-style-type: circle\"><li>Blah</li></ul>");
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListCircle);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListCircle);
doc->setHtml("<ul style=\"list-style-type: decimal\"><li>Blah</li></ul>");
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListDecimal);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListDecimal);
doc->setHtml("<ul style=\"list-style-type: lower-alpha\"><li>Blah</li></ul>");
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListLowerAlpha);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListLowerAlpha);
doc->setHtml("<ul style=\"list-style-type: upper-alpha\"><li>Blah</li></ul>");
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListUpperAlpha);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListUpperAlpha);
doc->setHtml("<ul style=\"list-style-type: upper-roman\"><li>Blah</li></ul>");
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListUpperRoman);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListUpperRoman);
doc->setHtml("<ul style=\"list-style-type: lower-roman\"><li>Blah</li></ul>");
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListLowerRoman);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListLowerRoman);
// ignore the unsupported list-style-position inside the list-style shorthand property
doc->setHtml("<ul style=\"list-style: outside decimal\"><li>Blah</li></ul>");
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListDecimal);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListDecimal);
}
void tst_QTextDocumentFragment::css_linkPseudo()
@@ -2785,13 +2786,13 @@ void tst_QTextDocumentFragment::css_linkPseudo()
void tst_QTextDocumentFragment::css_pageBreaks()
{
doc->setHtml("<p>Foo</p>");
- QVERIFY(doc->begin().blockFormat().pageBreakPolicy() == QTextFormat::PageBreak_Auto);
+ QCOMPARE(doc->begin().blockFormat().pageBreakPolicy(), QTextFormat::PageBreak_Auto);
doc->setHtml("<p style=\" page-break-before:always;\">Foo</p>");
- QVERIFY(doc->begin().blockFormat().pageBreakPolicy() == QTextFormat::PageBreak_AlwaysBefore);
+ QCOMPARE(doc->begin().blockFormat().pageBreakPolicy(), QTextFormat::PageBreak_AlwaysBefore);
doc->setHtml("<p style=\" page-break-after:always;\">Foo</p>");
- QVERIFY(doc->begin().blockFormat().pageBreakPolicy() == QTextFormat::PageBreak_AlwaysAfter);
+ QCOMPARE(doc->begin().blockFormat().pageBreakPolicy(), QTextFormat::PageBreak_AlwaysAfter);
doc->setHtml("<p style=\" page-break-before:always; page-break-after:always;\">Foo</p>");
QVERIFY(doc->begin().blockFormat().pageBreakPolicy() == (QTextFormat::PageBreak_AlwaysAfter | QTextFormat::PageBreak_AlwaysBefore));
@@ -2832,13 +2833,14 @@ void tst_QTextDocumentFragment::universalSelectors()
QTextBlockFormat fmt = doc->begin().blockFormat();
if (match)
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), QColor("green"));
else
QVERIFY(!fmt.hasProperty(QTextFormat::BackgroundBrush));
}
void tst_QTextDocumentFragment::screenMedia()
{
+ const QColor green("green");
setHtml("<style>"
"@media screen {"
"p { background-color: green }"
@@ -2847,7 +2849,7 @@ void tst_QTextDocumentFragment::screenMedia()
"<p>test</p>"
"");
QTextBlockFormat fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), green);
setHtml("<style>"
"@media foobar {"
@@ -2857,7 +2859,7 @@ void tst_QTextDocumentFragment::screenMedia()
"<p>test</p>"
"");
fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() != QColor("green"));
+ QVERIFY(fmt.background().color() != green);
setHtml("<style>"
"@media sCrEeN {"
@@ -2867,7 +2869,7 @@ void tst_QTextDocumentFragment::screenMedia()
"<p>test</p>"
"");
fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), green);
}
void tst_QTextDocumentFragment::htmlResourceLoading()
@@ -2881,7 +2883,7 @@ void tst_QTextDocumentFragment::htmlResourceLoading()
doc->clear();
QTextCursor(doc).insertFragment(frag);
QTextBlockFormat fmt = doc->begin().blockFormat();
- QVERIFY(fmt.background().color() == QColor("green"));
+ QCOMPARE(fmt.background().color(), QColor("green"));
}
void tst_QTextDocumentFragment::someCaseInsensitiveAttributeValues()
@@ -2890,7 +2892,7 @@ void tst_QTextDocumentFragment::someCaseInsensitiveAttributeValues()
setHtml(QString::fromLatin1(html1));
cursor.movePosition(QTextCursor::End);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->format().style() == QTextListFormat::ListSquare);
+ QCOMPARE(cursor.currentList()->format().style(), QTextListFormat::ListSquare);
const char html2[] = "<div align=ceNTeR><b>Hello World";
setHtml(html2);
@@ -2925,7 +2927,7 @@ void tst_QTextDocumentFragment::backgroundImage()
doc.testPixmap.fill(Qt::blue);
doc.setHtml("<p style=\"background-image: url(testPixmap)\">Hello</p>");
QBrush bg = doc.begin().blockFormat().background();
- QVERIFY(bg.style() == Qt::TexturePattern);
+ QCOMPARE(bg.style(), Qt::TexturePattern);
QCOMPARE(bg.texture().cacheKey(), doc.testPixmap.cacheKey());
}
@@ -3109,7 +3111,7 @@ void tst_QTextDocumentFragment::html_tableStrangeNewline()
QCOMPARE(table->columns(), 1);
const QTextTableCell cell = table->cellAt(0, 0);
QCOMPARE(cell.firstCursorPosition().block().text(), QString("Foo"));
- QVERIFY(cell.firstCursorPosition().block() == cell.lastCursorPosition().block());
+ QCOMPARE(cell.firstCursorPosition().block(), cell.lastCursorPosition().block());
}
void tst_QTextDocumentFragment::html_tableStrangeNewline2()
@@ -3123,7 +3125,7 @@ void tst_QTextDocumentFragment::html_tableStrangeNewline2()
QCOMPARE(table->columns(), 1);
const QTextTableCell cell = table->cellAt(0, 0);
QCOMPARE(cell.firstCursorPosition().block().text(), QString("Foo"));
- QVERIFY(cell.firstCursorPosition().block() == cell.lastCursorPosition().block());
+ QCOMPARE(cell.firstCursorPosition().block(), cell.lastCursorPosition().block());
}
void tst_QTextDocumentFragment::html_tableStrangeNewline3()
@@ -3152,11 +3154,11 @@ void tst_QTextDocumentFragment::html_tableStrangeNewline3()
QTextTableCell cell = table->cellAt(0, 0);
QCOMPARE(cell.firstCursorPosition().block().text(), QString("Meh"));
- QVERIFY(cell.firstCursorPosition().block() == cell.lastCursorPosition().block());
+ QCOMPARE(cell.firstCursorPosition().block(), cell.lastCursorPosition().block());
cell = table->cellAt(0, 1);
QCOMPARE(cell.firstCursorPosition().block().text(), QString("Foo"));
- QVERIFY(cell.firstCursorPosition().block() == cell.lastCursorPosition().block());
+ QCOMPARE(cell.firstCursorPosition().block(), cell.lastCursorPosition().block());
}
void tst_QTextDocumentFragment::html_caption()
@@ -3170,7 +3172,7 @@ void tst_QTextDocumentFragment::html_caption()
cursor.movePosition(QTextCursor::NextBlock);
QCOMPARE(cursor.block().text(), QString("This is a Caption!"));
- QVERIFY(cursor.blockFormat().alignment() == Qt::AlignHCenter);
+ QCOMPARE(cursor.blockFormat().alignment(), Qt::AlignHCenter);
cursor.movePosition(QTextCursor::NextBlock);
QTextTable *table = cursor.currentTable();
@@ -3427,7 +3429,7 @@ void tst_QTextDocumentFragment::html_dontInheritAlignmentForFloatingImages()
QVERIFY(o);
QTextFormat f = o->format();
QVERIFY(f.isFrameFormat());
- QVERIFY(f.toFrameFormat().position() == QTextFrameFormat::InFlow);
+ QCOMPARE(f.toFrameFormat().position(), QTextFrameFormat::InFlow);
}
void tst_QTextDocumentFragment::html_verticalImageAlignment()
@@ -3437,35 +3439,35 @@ void tst_QTextDocumentFragment::html_verticalImageAlignment()
cursor.movePosition(QTextCursor::NextCharacter);
QVERIFY(cursor.charFormat().isImageFormat());
QTextImageFormat fmt = cursor.charFormat().toImageFormat();
- QVERIFY(fmt.verticalAlignment() == QTextCharFormat::AlignNormal);
+ QCOMPARE(fmt.verticalAlignment(), QTextCharFormat::AlignNormal);
doc->setHtml("<img src=\"foo\" align=middle />");
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextCharacter);
QVERIFY(cursor.charFormat().isImageFormat());
fmt = cursor.charFormat().toImageFormat();
- QVERIFY(fmt.verticalAlignment() == QTextCharFormat::AlignMiddle);
+ QCOMPARE(fmt.verticalAlignment(), QTextCharFormat::AlignMiddle);
doc->setHtml("<img src=\"foo\" style=\"vertical-align: middle\" />");
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextCharacter);
QVERIFY(cursor.charFormat().isImageFormat());
fmt = cursor.charFormat().toImageFormat();
- QVERIFY(fmt.verticalAlignment() == QTextCharFormat::AlignMiddle);
+ QCOMPARE(fmt.verticalAlignment(), QTextCharFormat::AlignMiddle);
doc->setHtml("<img src=\"foo\" align=top />");
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextCharacter);
QVERIFY(cursor.charFormat().isImageFormat());
fmt = cursor.charFormat().toImageFormat();
- QVERIFY(fmt.verticalAlignment() == QTextCharFormat::AlignTop);
+ QCOMPARE(fmt.verticalAlignment(), QTextCharFormat::AlignTop);
doc->setHtml("<img src=\"foo\" style=\"vertical-align: top\" />");
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextCharacter);
QVERIFY(cursor.charFormat().isImageFormat());
fmt = cursor.charFormat().toImageFormat();
- QVERIFY(fmt.verticalAlignment() == QTextCharFormat::AlignTop);
+ QCOMPARE(fmt.verticalAlignment(), QTextCharFormat::AlignTop);
}
void tst_QTextDocumentFragment::html_verticalCellAlignment()
@@ -3944,11 +3946,11 @@ void tst_QTextDocumentFragment::html_directionWithHtml()
block = block.next();
QVERIFY(block.blockFormat().hasProperty(QTextFormat::LayoutDirection));
- QVERIFY(block.blockFormat().layoutDirection() == Qt::RightToLeft);
+ QCOMPARE(block.blockFormat().layoutDirection(), Qt::RightToLeft);
block = block.next();
QVERIFY(block.blockFormat().hasProperty(QTextFormat::LayoutDirection));
- QVERIFY(block.blockFormat().layoutDirection() == Qt::LeftToRight);
+ QCOMPARE(block.blockFormat().layoutDirection(), Qt::LeftToRight);
}
void tst_QTextDocumentFragment::html_directionWithRichText()
@@ -3961,11 +3963,11 @@ void tst_QTextDocumentFragment::html_directionWithRichText()
block = block.next();
QVERIFY(block.blockFormat().hasProperty(QTextFormat::LayoutDirection));
- QVERIFY(block.blockFormat().layoutDirection() == Qt::RightToLeft);
+ QCOMPARE(block.blockFormat().layoutDirection(), Qt::RightToLeft);
block = block.next();
QVERIFY(block.blockFormat().hasProperty(QTextFormat::LayoutDirection));
- QVERIFY(block.blockFormat().layoutDirection() == Qt::LeftToRight);
+ QCOMPARE(block.blockFormat().layoutDirection(), Qt::LeftToRight);
}
void tst_QTextDocumentFragment::html_metaInBody()
diff --git a/tests/auto/gui/text/qtextdocumentlayout/BLACKLIST b/tests/auto/gui/text/qtextdocumentlayout/BLACKLIST
new file mode 100644
index 0000000000..b13b2497d3
--- /dev/null
+++ b/tests/auto/gui/text/qtextdocumentlayout/BLACKLIST
@@ -0,0 +1,2 @@
+[imageAtRightAlignedTab]
+linux
diff --git a/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp b/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp
index 7c742bc864..5a401031e2 100644
--- a/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp
+++ b/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp
@@ -101,7 +101,7 @@ void tst_QTextFormat::defaultAlignment()
QTextBlockFormat fmt;
QVERIFY(!fmt.hasProperty(QTextFormat::BlockAlignment));
QCOMPARE(fmt.intProperty(QTextFormat::BlockAlignment), 0);
- QVERIFY(fmt.alignment() == Qt::AlignLeft);
+ QCOMPARE(fmt.alignment(), Qt::AlignLeft);
}
void tst_QTextFormat::testUnderlinePropertyPrecedence()
@@ -209,7 +209,7 @@ void tst_QTextFormat::resolveFont()
QVector<QTextFormat> formats = doc.allFormats();
QCOMPARE(formats.count(), 3);
- QVERIFY(formats.at(2).type() == QTextFormat::CharFormat);
+ QCOMPARE(formats.at(2).type(), int(QTextFormat::CharFormat));
fmt = formats.at(2).toCharFormat();
QVERIFY(!fmt.font().underline());
diff --git a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
index 51f726ac86..de0c2d6dbe 100644
--- a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
+++ b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
@@ -1675,6 +1675,7 @@ void tst_QTextLayout::testTabDPIScale()
case QPaintDevice::PdmPhysicalDpiY:
return 72;
case QPaintDevice::PdmDevicePixelRatio:
+ case QPaintDevice::PdmDevicePixelRatioScaled:
; // fall through
}
return 0;
@@ -1744,7 +1745,7 @@ void tst_QTextLayout::capitalization_allUpperCase()
QTextEngine *engine = layout.engine();
engine->itemize();
QCOMPARE(engine->layoutData->items.count(), 1);
- QVERIFY(engine->layoutData->items.at(0).analysis.flags == QScriptAnalysis::Uppercase);
+ QCOMPARE(engine->layoutData->items.at(0).analysis.flags, ushort(QScriptAnalysis::Uppercase));
}
void tst_QTextLayout::capitalization_allUpperCase_newline()
@@ -1764,9 +1765,9 @@ void tst_QTextLayout::capitalization_allUpperCase_newline()
QTextEngine *engine = layout.engine();
engine->itemize();
QCOMPARE(engine->layoutData->items.count(), 3);
- QVERIFY(engine->layoutData->items.at(0).analysis.flags == QScriptAnalysis::Uppercase);
- QVERIFY(engine->layoutData->items.at(1).analysis.flags == QScriptAnalysis::LineOrParagraphSeparator);
- QVERIFY(engine->layoutData->items.at(2).analysis.flags == QScriptAnalysis::Uppercase);
+ QCOMPARE(engine->layoutData->items.at(0).analysis.flags, ushort(QScriptAnalysis::Uppercase));
+ QCOMPARE(engine->layoutData->items.at(1).analysis.flags, ushort(QScriptAnalysis::LineOrParagraphSeparator));
+ QCOMPARE(engine->layoutData->items.at(2).analysis.flags, ushort(QScriptAnalysis::Uppercase));
}
void tst_QTextLayout::capitalization_allLowerCase()
@@ -1782,7 +1783,7 @@ void tst_QTextLayout::capitalization_allLowerCase()
QTextEngine *engine = layout.engine();
engine->itemize();
QCOMPARE(engine->layoutData->items.count(), 1);
- QVERIFY(engine->layoutData->items.at(0).analysis.flags == QScriptAnalysis::Lowercase);
+ QCOMPARE(engine->layoutData->items.at(0).analysis.flags, ushort(QScriptAnalysis::Lowercase));
}
void tst_QTextLayout::capitalization_smallCaps()
@@ -1798,8 +1799,8 @@ void tst_QTextLayout::capitalization_smallCaps()
QTextEngine *engine = layout.engine();
engine->itemize();
QCOMPARE(engine->layoutData->items.count(), 2);
- QVERIFY(engine->layoutData->items.at(0).analysis.flags == QScriptAnalysis::None);
- QVERIFY(engine->layoutData->items.at(1).analysis.flags == QScriptAnalysis::SmallCaps);
+ QCOMPARE(engine->layoutData->items.at(0).analysis.flags, ushort(QScriptAnalysis::None));
+ QCOMPARE(engine->layoutData->items.at(1).analysis.flags, ushort(QScriptAnalysis::SmallCaps));
}
void tst_QTextLayout::capitalization_capitalize()
@@ -1815,11 +1816,11 @@ void tst_QTextLayout::capitalization_capitalize()
QTextEngine *engine = layout.engine();
engine->itemize();
QCOMPARE(engine->layoutData->items.count(), 5);
- QVERIFY(engine->layoutData->items.at(0).analysis.flags == QScriptAnalysis::Uppercase);
- QVERIFY(engine->layoutData->items.at(1).analysis.flags == QScriptAnalysis::None);
- QVERIFY(engine->layoutData->items.at(2).analysis.flags == QScriptAnalysis::Tab);
- QVERIFY(engine->layoutData->items.at(3).analysis.flags == QScriptAnalysis::Uppercase);
- QVERIFY(engine->layoutData->items.at(4).analysis.flags == QScriptAnalysis::None);
+ QCOMPARE(engine->layoutData->items.at(0).analysis.flags, ushort(QScriptAnalysis::Uppercase));
+ QCOMPARE(engine->layoutData->items.at(1).analysis.flags, ushort(QScriptAnalysis::None));
+ QCOMPARE(engine->layoutData->items.at(2).analysis.flags, ushort(QScriptAnalysis::Tab));
+ QCOMPARE(engine->layoutData->items.at(3).analysis.flags, ushort(QScriptAnalysis::Uppercase));
+ QCOMPARE(engine->layoutData->items.at(4).analysis.flags, ushort(QScriptAnalysis::None));
}
void tst_QTextLayout::longText()
@@ -1984,7 +1985,12 @@ void tst_QTextLayout::textWidthVsWIdth()
"./libs -I/home/ettrich/dev/creator/tools -I../../plugins -I../../shared/scriptwrapper -I../../libs/3rdparty/botan/build -Idialogs -Iactionmanager -Ieditorma"
"nager -Iprogressmanager -Iscriptmanager -I.moc/debug-shared -I.uic -o .obj/debug-shared/sidebar.o sidebar.cpp"));
- // textWidth includes right bearing, but it should never be LARGER than width if there is space for at least one character
+ // The naturalTextWidth includes right bearing, but should never be LARGER than line width if
+ // there is space for at least one character. Unfortunately that assumption may not hold if the
+ // font engine fails to report an accurate minimum right bearing for the font, eg. when the
+ // minimum right bearing reported by the font engine doesn't cover all the glyphs in the font.
+ // The result is that this test may fail in some cases. We should fix this by running the test
+ // with a font that we know have no suprising right bearings. See qtextlayout.cpp for details.
for (int width = 100; width < 1000; ++width) {
layout.beginLayout();
QTextLine line = layout.createLine();
@@ -2096,8 +2102,8 @@ void tst_QTextLayout::cursorInNonStopChars()
QTextLine line = layout.createLine();
layout.endLayout();
- QVERIFY(line.cursorToX(1) == line.cursorToX(3));
- QVERIFY(line.cursorToX(2) == line.cursorToX(3));
+ QCOMPARE(line.cursorToX(1), line.cursorToX(3));
+ QCOMPARE(line.cursorToX(2), line.cursorToX(3));
}
void tst_QTextLayout::justifyTrailingSpaces()
diff --git a/tests/auto/gui/text/qtextlist/tst_qtextlist.cpp b/tests/auto/gui/text/qtextlist/tst_qtextlist.cpp
index c57123af61..03e557d8dd 100644
--- a/tests/auto/gui/text/qtextlist/tst_qtextlist.cpp
+++ b/tests/auto/gui/text/qtextlist/tst_qtextlist.cpp
@@ -113,11 +113,11 @@ void tst_QTextList::autoNumbering()
for (int i = 0; i < 27; ++i)
cursor.insertBlock();
- QVERIFY(list->count() == 28);
+ QCOMPARE(list->count(), 28);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->itemNumber(cursor.block()) == 27);
- QVERIFY(cursor.currentList()->itemText(cursor.block()) == "ab.");
+ QCOMPARE(cursor.currentList()->itemNumber(cursor.block()), 27);
+ QCOMPARE(cursor.currentList()->itemText(cursor.block()), QLatin1String("ab."));
}
void tst_QTextList::autoNumberingPrefixAndSuffix()
@@ -132,11 +132,11 @@ void tst_QTextList::autoNumberingPrefixAndSuffix()
for (int i = 0; i < 27; ++i)
cursor.insertBlock();
- QVERIFY(list->count() == 28);
+ QCOMPARE(list->count(), 28);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->itemNumber(cursor.block()) == 27);
- QVERIFY(cursor.currentList()->itemText(cursor.block()) == "-ab)");
+ QCOMPARE(cursor.currentList()->itemNumber(cursor.block()), 27);
+ QCOMPARE(cursor.currentList()->itemText(cursor.block()), QLatin1String("-ab)"));
}
void tst_QTextList::autoNumberingPrefixAndSuffixRTL()
@@ -154,9 +154,9 @@ void tst_QTextList::autoNumberingPrefixAndSuffixRTL()
cursor.insertBlock();
- QVERIFY(list->count() == 2);
+ QCOMPARE(list->count(), 2);
- QVERIFY(cursor.currentList()->itemText(cursor.block()) == "*B-");
+ QCOMPARE(cursor.currentList()->itemText(cursor.block()), QLatin1String("*B-"));
}
void tst_QTextList::autoNumberingPrefixAndSuffixHtmlExportImport()
@@ -174,7 +174,7 @@ void tst_QTextList::autoNumberingPrefixAndSuffixHtmlExportImport()
for (int i = 0; i < 27; ++i)
cursor.insertBlock();
- QVERIFY(list->count() == 28);
+ QCOMPARE(list->count(), 28);
QString htmlExport = doc->toHtml();
QTextDocument importDoc;
@@ -185,9 +185,9 @@ void tst_QTextList::autoNumberingPrefixAndSuffixHtmlExportImport()
importCursor.movePosition(QTextCursor::NextBlock);
QVERIFY(importCursor.currentList());
- QVERIFY(importCursor.currentList()->itemNumber(importCursor.block()) == 27);
- QVERIFY(importCursor.currentList()->itemText(importCursor.block()) == "\"ab#");
- QVERIFY(importCursor.currentList()->format().indent() == 10);
+ QCOMPARE(importCursor.currentList()->itemNumber(importCursor.block()), 27);
+ QCOMPARE(importCursor.currentList()->itemText(importCursor.block()), QLatin1String("\"ab#"));
+ QCOMPARE(importCursor.currentList()->format().indent(), 10);
}
void tst_QTextList::autoNumberingRTL()
@@ -203,9 +203,9 @@ void tst_QTextList::autoNumberingRTL()
cursor.insertBlock();
- QVERIFY(list->count() == 2);
+ QCOMPARE(list->count(), 2);
- QVERIFY(cursor.currentList()->itemText(cursor.block()) == ".B");
+ QCOMPARE(cursor.currentList()->itemText(cursor.block()), QLatin1String(".B"));
}
void tst_QTextList::romanNumbering()
@@ -218,11 +218,11 @@ void tst_QTextList::romanNumbering()
for (int i = 0; i < 4998; ++i)
cursor.insertBlock();
- QVERIFY(list->count() == 4999);
+ QCOMPARE(list->count(), 4999);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->itemNumber(cursor.block()) == 4998);
- QVERIFY(cursor.currentList()->itemText(cursor.block()) == "MMMMCMXCIX.");
+ QCOMPARE(cursor.currentList()->itemNumber(cursor.block()), 4998);
+ QCOMPARE(cursor.currentList()->itemText(cursor.block()), QLatin1String("MMMMCMXCIX."));
}
void tst_QTextList::romanNumberingLimit()
@@ -235,11 +235,11 @@ void tst_QTextList::romanNumberingLimit()
for (int i = 0; i < 4999; ++i)
cursor.insertBlock();
- QVERIFY(list->count() == 5000);
+ QCOMPARE(list->count(), 5000);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->itemNumber(cursor.block()) == 4999);
- QVERIFY(cursor.currentList()->itemText(cursor.block()) == "?.");
+ QCOMPARE(cursor.currentList()->itemNumber(cursor.block()), 4999);
+ QCOMPARE(cursor.currentList()->itemText(cursor.block()), QLatin1String("?."));
}
void tst_QTextList::formatChange()
@@ -257,12 +257,12 @@ void tst_QTextList::formatChange()
QVERIFY(list && list->count() == 2);
QTextBlockFormat bfmt = cursor.blockFormat();
-// QVERIFY(bfmt.object() == list);
+// QCOMPARE(bfmt.object(), list);
bfmt.setObjectIndex(-1);
cursor.setBlockFormat(bfmt);
- QVERIFY(firstList->count() == 1);
+ QCOMPARE(firstList->count(), 1);
}
void tst_QTextList::cursorNavigation()
@@ -282,7 +282,7 @@ void tst_QTextList::cursorNavigation()
QVERIFY(cursor.currentList());
cursor.movePosition(QTextCursor::PreviousBlock);
QVERIFY(cursor.currentList());
- QVERIFY(cursor.currentList()->itemNumber(cursor.block()) == 0);
+ QCOMPARE(cursor.currentList()->itemNumber(cursor.block()), 0);
}
void tst_QTextList::partialRemoval()
diff --git a/tests/auto/gui/text/qtextpiecetable/tst_qtextpiecetable.cpp b/tests/auto/gui/text/qtextpiecetable/tst_qtextpiecetable.cpp
index ae8948a61f..cd43849729 100644
--- a/tests/auto/gui/text/qtextpiecetable/tst_qtextpiecetable.cpp
+++ b/tests/auto/gui/text/qtextpiecetable/tst_qtextpiecetable.cpp
@@ -157,7 +157,7 @@ void tst_QTextPieceTable::insertion3()
table->insert(pos, str, charFormatIndex);
compare.insert(pos, str);
}
- QVERIFY(table->plainText() == compare);
+ QCOMPARE(table->plainText(), compare);
}
void tst_QTextPieceTable::insertion4()
@@ -176,7 +176,7 @@ void tst_QTextPieceTable::insertion4()
// exit(12);
// }
}
- QVERIFY(table->plainText() == compare);
+ QCOMPARE(table->plainText(), compare);
}
void tst_QTextPieceTable::insertion5()
@@ -196,10 +196,10 @@ void tst_QTextPieceTable::insertion5()
}
compare.insert(pos, str);
}
- QVERIFY(table->plainText() == compare);
+ QCOMPARE(table->plainText(), compare);
for (QTextBlock it = table->blocksBegin(); it != table->blocksEnd(); it = it.next()) {
QTextDocumentPrivate::FragmentIterator fit = table->find(it.position());
- QVERIFY(fit.position() == it.position());
+ QCOMPARE(fit.position(), it.position());
}
}
@@ -260,7 +260,7 @@ void tst_QTextPieceTable::removal3()
// exit(12);
// }
}
- QVERIFY(table->plainText() == compare);
+ QCOMPARE(table->plainText(), compare);
}
void tst_QTextPieceTable::removal4()
@@ -294,7 +294,7 @@ void tst_QTextPieceTable::removal4()
// exit(12);
// }
}
- QVERIFY(table->plainText() == compare);
+ QCOMPARE(table->plainText(), compare);
}
void tst_QTextPieceTable::undoRedo1()
@@ -392,7 +392,7 @@ void tst_QTextPieceTable::undoRedo6()
QTextBlockFormat bfmt;
bfmt.setAlignment(Qt::AlignHCenter);
cursor.setBlockFormat(bfmt);
- QVERIFY(cursor.blockFormat().alignment() == Qt::AlignHCenter);
+ QCOMPARE(cursor.blockFormat().alignment(), Qt::AlignHCenter);
QTextCursor range = cursor;
range.clearSelection();
@@ -404,11 +404,11 @@ void tst_QTextPieceTable::undoRedo6()
range.mergeCharFormat(modifier);
cursor.movePosition(QTextCursor::Start);
- QVERIFY(cursor.blockFormat().alignment() == Qt::AlignHCenter);
+ QCOMPARE(cursor.blockFormat().alignment(), Qt::AlignHCenter);
doc.undo();
- QVERIFY(cursor.blockFormat().alignment() == Qt::AlignHCenter);
+ QCOMPARE(cursor.blockFormat().alignment(), Qt::AlignHCenter);
}
void tst_QTextPieceTable::undoRedo7()
@@ -497,13 +497,13 @@ void tst_QTextPieceTable::undoRedo11()
}
l += remove ? -1 : 2;
}
- QVERIFY(table->plainText() == compare);
+ QCOMPARE(table->plainText(), compare);
for (int i = 0; i < loops; ++i)
table->undo();
- QVERIFY(table->plainText() == QString(""));
+ QCOMPARE(table->plainText(), QString(""));
for (int i = 0; i < loops; ++i)
table->redo();
- QVERIFY(table->plainText() == compare);
+ QCOMPARE(table->plainText(), compare);
}
@@ -693,9 +693,9 @@ void tst_QTextPieceTable::setBlockFormat()
QTextBlock b = table->blocksFind(1);
table->setBlockFormat(b, b, newbfmt);
- QVERIFY(table->blocksFind(0).blockFormat() == bfmt);
- QVERIFY(table->blocksFind(1).blockFormat() == newbfmt);
- QVERIFY(table->blocksFind(2).blockFormat() == bfmt);
+ QCOMPARE(table->blocksFind(0).blockFormat(), bfmt);
+ QCOMPARE(table->blocksFind(1).blockFormat(), newbfmt);
+ QCOMPARE(table->blocksFind(2).blockFormat(), bfmt);
}
@@ -705,19 +705,19 @@ void tst_QTextPieceTable::blockInsertion()
fmt.setTopMargin(100);
int idx = table->formatCollection()->indexForFormat(fmt);
int charFormat = table->formatCollection()->indexForFormat(QTextCharFormat());
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
table->insertBlock(0, idx, charFormat);
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(1).blockFormat() == fmt);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(1).blockFormat(), fmt);
table->undo();
- QVERIFY(table->blockMap().length() == 1);
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
+ QCOMPARE(table->blockMap().length(), 1);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
table->redo();
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(1).blockFormat() == fmt);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(1).blockFormat(), fmt);
}
void tst_QTextPieceTable::blockInsertion2()
@@ -755,37 +755,37 @@ void tst_QTextPieceTable::blockRemoval1()
table->insertBlock(9, idx2, charFormatIndex);
table->insert(10, "0123", charFormatIndex);
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt1);
- QVERIFY(table->blocksFind(10).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 5);
- QVERIFY(table->blocksFind(11).position() == 10);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt1);
+ QCOMPARE(table->blocksFind(10).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 5);
+ QCOMPARE(table->blocksFind(11).position(), 10);
table->beginEditBlock();
table->remove(5, 5);
table->endEditBlock();
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(4).position() == 0);
- QVERIFY(table->blocksFind(5).position() == 5);
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(4).position(), 0);
+ QCOMPARE(table->blocksFind(5).position(), 5);
table->undo();
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt1);
- QVERIFY(table->blocksFind(10).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 5);
- QVERIFY(table->blocksFind(11).position() == 10);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt1);
+ QCOMPARE(table->blocksFind(10).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 5);
+ QCOMPARE(table->blocksFind(11).position(), 10);
table->redo();
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(4).position() == 0);
- QVERIFY(table->blocksFind(5).position() == 5);
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(4).position(), 0);
+ QCOMPARE(table->blocksFind(5).position(), 5);
}
void tst_QTextPieceTable::blockRemoval2()
@@ -803,35 +803,35 @@ void tst_QTextPieceTable::blockRemoval2()
table->insertBlock(9, idx2, charFormatIndex);
table->insert(10, "0123", charFormatIndex);
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt1);
- QVERIFY(table->blocksFind(10).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 5);
- QVERIFY(table->blocksFind(11).position() == 10);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt1);
+ QCOMPARE(table->blocksFind(10).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 5);
+ QCOMPARE(table->blocksFind(11).position(), 10);
table->remove(4, 1);
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(6).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 0);
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(6).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 0);
table->undo();
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt1);
- QVERIFY(table->blocksFind(10).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 5);
- QVERIFY(table->blocksFind(11).position() == 10);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt1);
+ QCOMPARE(table->blocksFind(10).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 5);
+ QCOMPARE(table->blocksFind(11).position(), 10);
table->redo();
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(6).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 0);
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(6).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 0);
}
void tst_QTextPieceTable::blockRemoval3()
@@ -849,38 +849,38 @@ void tst_QTextPieceTable::blockRemoval3()
table->insertBlock(9, idx2, charFormatIndex);
table->insert(10, "0123", charFormatIndex);
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt1);
- QVERIFY(table->blocksFind(10).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 5);
- QVERIFY(table->blocksFind(11).position() == 10);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt1);
+ QCOMPARE(table->blocksFind(10).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 5);
+ QCOMPARE(table->blocksFind(11).position(), 10);
table->beginEditBlock();
table->remove(3, 4);
table->endEditBlock();
- QVERIFY(table->blocksFind(1).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(5).position() == 0);
+ QCOMPARE(table->blocksFind(1).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(5).position(), 0);
table->undo();
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt1);
- QVERIFY(table->blocksFind(10).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 5);
- QVERIFY(table->blocksFind(11).position() == 10);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt1);
+ QCOMPARE(table->blocksFind(10).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 5);
+ QCOMPARE(table->blocksFind(11).position(), 10);
table->redo();
- QVERIFY(table->blocksFind(1).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(5).position() == 0);
+ QCOMPARE(table->blocksFind(1).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(5).position(), 0);
}
void tst_QTextPieceTable::blockRemoval4()
@@ -899,35 +899,35 @@ void tst_QTextPieceTable::blockRemoval4()
table->insertBlock(9, idx2, charFormatIndex);
table->insert(10, "0123", charFormatIndex);
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt1);
- QVERIFY(table->blocksFind(10).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 5);
- QVERIFY(table->blocksFind(11).position() == 10);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt1);
+ QCOMPARE(table->blocksFind(10).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 5);
+ QCOMPARE(table->blocksFind(11).position(), 10);
table->remove(3, 7);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(5).position() == 0);
- QVERIFY(table->blocksFind(1).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == QTextBlockFormat());
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(5).position(), 0);
+ QCOMPARE(table->blocksFind(1).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), QTextBlockFormat());
table->undo();
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt1);
- QVERIFY(table->blocksFind(10).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 5);
- QVERIFY(table->blocksFind(11).position() == 10);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt1);
+ QCOMPARE(table->blocksFind(10).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 5);
+ QCOMPARE(table->blocksFind(11).position(), 10);
table->redo();
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(5).position() == 0);
- QVERIFY(table->blocksFind(1).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == QTextBlockFormat());
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(5).position(), 0);
+ QCOMPARE(table->blocksFind(1).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), QTextBlockFormat());
#endif
}
@@ -946,38 +946,38 @@ void tst_QTextPieceTable::blockRemoval5()
table->insertBlock(9, idx2, charFormatIndex);
table->insert(10, "0123", charFormatIndex);
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt1);
- QVERIFY(table->blocksFind(10).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 5);
- QVERIFY(table->blocksFind(11).position() == 10);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt1);
+ QCOMPARE(table->blocksFind(10).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 5);
+ QCOMPARE(table->blocksFind(11).position(), 10);
table->beginEditBlock();
table->remove(3, 8);
table->endEditBlock();
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(5).position() == 0);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(5).position(), 0);
table->undo();
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(4).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == fmt1);
- QVERIFY(table->blocksFind(10).blockFormat() == fmt2);
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(6).position() == 5);
- QVERIFY(table->blocksFind(11).position() == 10);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(4).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), fmt1);
+ QCOMPARE(table->blocksFind(10).blockFormat(), fmt2);
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(6).position(), 5);
+ QCOMPARE(table->blocksFind(11).position(), 10);
table->redo();
- QVERIFY(table->blocksFind(0).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(5).blockFormat() == QTextBlockFormat());
- QVERIFY(table->blocksFind(1).position() == 0);
- QVERIFY(table->blocksFind(5).position() == 0);
+ QCOMPARE(table->blocksFind(0).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(5).blockFormat(), QTextBlockFormat());
+ QCOMPARE(table->blocksFind(1).position(), 0);
+ QCOMPARE(table->blocksFind(5).position(), 0);
}
@@ -996,66 +996,66 @@ void tst_QTextPieceTable::checkFrames1()
QPointer<QTextFrame> frame = table->insertFrame(1, 3, ffmt);
QTextFrame *root = table->rootFrame();
- QVERIFY(root == frame->parentFrame());
+ QCOMPARE(root, frame->parentFrame());
QVERIFY(root);
- QVERIFY(root->parentFrame() == 0);
+ QVERIFY(!root->parentFrame());
- QVERIFY(root->childFrames().count() == 1);
+ QCOMPARE(root->childFrames().count(), 1);
QVERIFY(frame->format() == ffmt);
- QVERIFY(frame->firstPosition() == 2);
- QVERIFY(frame->lastPosition() == 4);
+ QCOMPARE(frame->firstPosition(), 2);
+ QCOMPARE(frame->lastPosition(), 4);
QPointer<QTextFrame> frame2 = table->insertFrame(2, 3, ffmt);
- QVERIFY(root->childFrames().count() == 1);
- QVERIFY(root->childFrames().at(0) == frame);
- QVERIFY(frame->childFrames().count() == 1);
- QVERIFY(frame2->childFrames().count() == 0);
- QVERIFY(frame2->parentFrame() == frame);
- QVERIFY(frame2->firstPosition() == 3);
- QVERIFY(frame2->lastPosition() == 4);
+ QCOMPARE(root->childFrames().count(), 1);
+ QCOMPARE(root->childFrames().at(0), frame.data());
+ QCOMPARE(frame->childFrames().count(), 1);
+ QCOMPARE(frame2->childFrames().count(), 0);
+ QCOMPARE(frame2->parentFrame(), frame.data());
+ QCOMPARE(frame2->firstPosition(), 3);
+ QCOMPARE(frame2->lastPosition(), 4);
QVERIFY(frame->format() == ffmt);
- QVERIFY(frame->firstPosition() == 2);
- QVERIFY(frame->lastPosition() == 6);
+ QCOMPARE(frame->firstPosition(), 2);
+ QCOMPARE(frame->lastPosition(), 6);
table->removeFrame(frame);
- QVERIFY(root->childFrames().count() == 1);
- QVERIFY(root->childFrames().at(0) == frame2);
+ QCOMPARE(root->childFrames().count(), 1);
+ QCOMPARE(root->childFrames().at(0), frame2.data());
QVERIFY(!frame);
- QVERIFY(frame2->childFrames().count() == 0);
- QVERIFY(frame2->parentFrame() == root);
- QVERIFY(frame2->firstPosition() == 2);
- QVERIFY(frame2->lastPosition() == 3);
+ QCOMPARE(frame2->childFrames().count(), 0);
+ QCOMPARE(frame2->parentFrame(), root);
+ QCOMPARE(frame2->firstPosition(), 2);
+ QCOMPARE(frame2->lastPosition(), 3);
table->undo();
frame = table->frameAt(2);
- QVERIFY(root->childFrames().count() == 1);
- QVERIFY(root->childFrames().at(0) == frame);
- QVERIFY(frame->childFrames().count() == 1);
- QVERIFY(frame->childFrames().at(0) == frame2);
- QVERIFY(frame2->childFrames().count() == 0);
- QVERIFY(frame2->parentFrame() == frame);
- QVERIFY(frame2->firstPosition() == 3);
- QVERIFY(frame2->lastPosition() == 4);
+ QCOMPARE(root->childFrames().count(), 1);
+ QCOMPARE(root->childFrames().at(0), frame.data());
+ QCOMPARE(frame->childFrames().count(), 1);
+ QCOMPARE(frame->childFrames().at(0), frame2.data());
+ QCOMPARE(frame2->childFrames().count(), 0);
+ QCOMPARE(frame2->parentFrame(), frame.data());
+ QCOMPARE(frame2->firstPosition(), 3);
+ QCOMPARE(frame2->lastPosition(), 4);
- QVERIFY(frame->firstPosition() == 2);
- QVERIFY(frame->lastPosition() == 6);
+ QCOMPARE(frame->firstPosition(), 2);
+ QCOMPARE(frame->lastPosition(), 6);
table->undo();
- QVERIFY(root->childFrames().count() == 1);
- QVERIFY(root->childFrames().at(0) == frame);
- QVERIFY(frame->childFrames().count() == 0);
+ QCOMPARE(root->childFrames().count(), 1);
+ QCOMPARE(root->childFrames().at(0), frame.data());
+ QCOMPARE(frame->childFrames().count(), 0);
QVERIFY(!frame2);
- QVERIFY(frame->firstPosition() == 2);
- QVERIFY(frame->lastPosition() == 4);
+ QCOMPARE(frame->firstPosition(), 2);
+ QCOMPARE(frame->lastPosition(), 4);
}
void tst_QTextPieceTable::removeFrameDirect()
@@ -1065,7 +1065,7 @@ void tst_QTextPieceTable::removeFrameDirect()
QTextFrame *frame = table->insertFrame(1, 5, ffmt);
- QVERIFY(frame->parentFrame() == table->rootFrame());
+ QCOMPARE(frame->parentFrame(), table->rootFrame());
const int start = frame->firstPosition() - 1;
const int end = frame->lastPosition();
diff --git a/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp b/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
index c8d3122e6d..1c099acc56 100644
--- a/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
+++ b/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
@@ -146,87 +146,87 @@ void tst_QTextTable::variousTableModifications()
QTextTableFormat tableFmt;
QTextTable *tab = cursor.insertTable(2, 2, tableFmt);
- QVERIFY(doc->toPlainText().length() == 5);
- QVERIFY(tab == cursor.currentTable());
- QVERIFY(tab->columns() == 2);
- QVERIFY(tab->rows() == 2);
+ QCOMPARE(doc->toPlainText().length(), 5);
+ QCOMPARE(tab, cursor.currentTable());
+ QCOMPARE(tab->columns(), 2);
+ QCOMPARE(tab->rows(), 2);
- QVERIFY(cursor.position() == 1);
+ QCOMPARE(cursor.position(), 1);
QTextCharFormat fmt = cursor.charFormat();
- QVERIFY(fmt.objectIndex() == -1);
+ QCOMPARE(fmt.objectIndex(), -1);
QTextTableCell cell = tab->cellAt(cursor);
QVERIFY(cell.isValid());
- QVERIFY(cell.row() == 0);
- QVERIFY(cell.column() == 0);
+ QCOMPARE(cell.row(), 0);
+ QCOMPARE(cell.column(), 0);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.position() == 2);
+ QCOMPARE(cursor.position(), 2);
fmt = cursor.charFormat();
- QVERIFY(fmt.objectIndex() == -1);
+ QCOMPARE(fmt.objectIndex(), -1);
cell = tab->cellAt(cursor);
QVERIFY(cell.isValid());
- QVERIFY(cell.row() == 0);
- QVERIFY(cell.column() == 1);
+ QCOMPARE(cell.row(), 0);
+ QCOMPARE(cell.column(), 1);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.position() == 3);
+ QCOMPARE(cursor.position(), 3);
fmt = cursor.charFormat();
- QVERIFY(fmt.objectIndex() == -1);
+ QCOMPARE(fmt.objectIndex(), -1);
cell = tab->cellAt(cursor);
QVERIFY(cell.isValid());
- QVERIFY(cell.row() == 1);
- QVERIFY(cell.column() == 0);
+ QCOMPARE(cell.row(), 1);
+ QCOMPARE(cell.column(), 0);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.position() == 4);
+ QCOMPARE(cursor.position(), 4);
fmt = cursor.charFormat();
- QVERIFY(fmt.objectIndex() == -1);
+ QCOMPARE(fmt.objectIndex(), -1);
cell = tab->cellAt(cursor);
QVERIFY(cell.isValid());
- QVERIFY(cell.row() == 1);
- QVERIFY(cell.column() == 1);
+ QCOMPARE(cell.row(), 1);
+ QCOMPARE(cell.column(), 1);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.position() == 5);
+ QCOMPARE(cursor.position(), 5);
fmt = cursor.charFormat();
- QVERIFY(fmt.objectIndex() == -1);
+ QCOMPARE(fmt.objectIndex(), -1);
cell = tab->cellAt(cursor);
QVERIFY(!cell.isValid());
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.position() == 5);
+ QCOMPARE(cursor.position(), 5);
// check we can't delete the cells with the cursor
cursor.movePosition(QTextCursor::Start);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.position() == 1);
+ QCOMPARE(cursor.position(), 1);
cursor.deleteChar();
- QVERIFY(doc->toPlainText().length() == 5);
+ QCOMPARE(doc->toPlainText().length(), 5);
cursor.movePosition(QTextCursor::NextBlock);
- QVERIFY(cursor.position() == 2);
+ QCOMPARE(cursor.position(), 2);
cursor.deleteChar();
- QVERIFY(doc->toPlainText().length() == 5);
+ QCOMPARE(doc->toPlainText().length(), 5);
cursor.deletePreviousChar();
- QVERIFY(cursor.position() == 2);
- QVERIFY(doc->toPlainText().length() == 5);
+ QCOMPARE(cursor.position(), 2);
+ QCOMPARE(doc->toPlainText().length(), 5);
QTextTable *table = cursor.currentTable();
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 2);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 2);
table->insertRows(2, 1);
- QVERIFY(table->rows() == 3);
- QVERIFY(table->columns() == 2);
- QVERIFY(doc->toPlainText().length() == 7);
+ QCOMPARE(table->rows(), 3);
+ QCOMPARE(table->columns(), 2);
+ QCOMPARE(doc->toPlainText().length(), 7);
table->insertColumns(2, 2);
- QVERIFY(table->rows() == 3);
- QVERIFY(table->columns() == 4);
- QVERIFY(doc->toPlainText().length() == 13);
+ QCOMPARE(table->rows(), 3);
+ QCOMPARE(table->columns(), 4);
+ QCOMPARE(doc->toPlainText().length(), 13);
table->resize(4, 5);
- QVERIFY(table->rows() == 4);
- QVERIFY(table->columns() == 5);
- QVERIFY(doc->toPlainText().length() == 21);
+ QCOMPARE(table->rows(), 4);
+ QCOMPARE(table->columns(), 5);
+ QCOMPARE(doc->toPlainText().length(), 21);
}
void tst_QTextTable::tableShrinking()
@@ -234,25 +234,25 @@ void tst_QTextTable::tableShrinking()
QTextTableFormat tableFmt;
cursor.insertTable(3, 4, tableFmt);
- QVERIFY(doc->toPlainText().length() == 13);
+ QCOMPARE(doc->toPlainText().length(), 13);
QTextTable *table = cursor.currentTable();
- QVERIFY(table->rows() == 3);
- QVERIFY(table->columns() == 4);
+ QCOMPARE(table->rows(), 3);
+ QCOMPARE(table->columns(), 4);
table->removeRows(1, 1);
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 4);
- QVERIFY(doc->toPlainText().length() == 9);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 4);
+ QCOMPARE(doc->toPlainText().length(), 9);
table->removeColumns(1, 2);
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 2);
- QVERIFY(doc->toPlainText().length() == 5);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 2);
+ QCOMPARE(doc->toPlainText().length(), 5);
table->resize(1, 1);
- QVERIFY(table->rows() == 1);
- QVERIFY(table->columns() == 1);
- QVERIFY(doc->toPlainText().length() == 2);
+ QCOMPARE(table->rows(), 1);
+ QCOMPARE(table->columns(), 1);
+ QCOMPARE(doc->toPlainText().length(), 2);
}
void tst_QTextTable::spans()
@@ -264,12 +264,12 @@ void tst_QTextTable::spans()
QTextTable *table = cursor.currentTable();
QVERIFY(table->cellAt(0, 0) != table->cellAt(0, 1));
table->mergeCells(0, 0, 1, 2);
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 2);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 2);
QVERIFY(table->cellAt(0, 0) == table->cellAt(0, 1));
table->mergeCells(0, 0, 2, 2);
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 2);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 2);
}
void tst_QTextTable::variousModifications2()
@@ -277,45 +277,45 @@ void tst_QTextTable::variousModifications2()
QTextTableFormat tableFmt;
cursor.insertTable(2, 5, tableFmt);
- QVERIFY(doc->toPlainText().length() == 11);
+ QCOMPARE(doc->toPlainText().length(), 11);
QTextTable *table = cursor.currentTable();
- QVERIFY(cursor.position() == 1);
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 5);
+ QCOMPARE(cursor.position(), 1);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 5);
table->insertColumns(0, 1);
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 6);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 6);
table->insertColumns(6, 1);
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 7);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 7);
table->insertRows(0, 1);
- QVERIFY(table->rows() == 3);
- QVERIFY(table->columns() == 7);
+ QCOMPARE(table->rows(), 3);
+ QCOMPARE(table->columns(), 7);
table->insertRows(3, 1);
- QVERIFY(table->rows() == 4);
- QVERIFY(table->columns() == 7);
+ QCOMPARE(table->rows(), 4);
+ QCOMPARE(table->columns(), 7);
table->removeRows(0, 1);
- QVERIFY(table->rows() == 3);
- QVERIFY(table->columns() == 7);
+ QCOMPARE(table->rows(), 3);
+ QCOMPARE(table->columns(), 7);
table->removeRows(2, 1);
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 7);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 7);
table->removeColumns(0, 1);
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 6);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 6);
table->removeColumns(5, 1);
- QVERIFY(table->rows() == 2);
- QVERIFY(table->columns() == 5);
+ QCOMPARE(table->rows(), 2);
+ QCOMPARE(table->columns(), 5);
tableFmt = table->format();
table->insertColumns(2, 1);
table->setFormat(tableFmt);
table->insertColumns(2, 1);
- QVERIFY(table->columns() == 7);
+ QCOMPARE(table->columns(), 7);
}
void tst_QTextTable::tableManager_undo()
@@ -325,16 +325,16 @@ void tst_QTextTable::tableManager_undo()
QTextTable *table = cursor.insertTable(2, 2, fmt);
QVERIFY(table);
- QVERIFY(table->format().border() == 10);
+ QCOMPARE(table->format().border(), qreal(10));
fmt.setBorder(20);
table->setFormat(fmt);
- QVERIFY(table->format().border() == 20);
+ QCOMPARE(table->format().border(), qreal(20));
doc->undo();
- QVERIFY(table->format().border() == 10);
+ QCOMPARE(table->format().border(), qreal(10));
}
void tst_QTextTable::tableManager_removeCell()
@@ -360,10 +360,10 @@ void tst_QTextTable::rowAt()
QTextCursor cell20Cursor = table->cellAt(2, 0).firstCursorPosition();
QTextCursor cell21Cursor = table->cellAt(2, 1).firstCursorPosition();
QTextCursor cell30Cursor = table->cellAt(3, 0).firstCursorPosition();
- QVERIFY(table->cellAt(cell00Cursor).firstCursorPosition() == cell00Cursor);
- QVERIFY(table->cellAt(cell10Cursor).firstCursorPosition() == cell10Cursor);
- QVERIFY(table->cellAt(cell20Cursor).firstCursorPosition() == cell20Cursor);
- QVERIFY(table->cellAt(cell30Cursor).firstCursorPosition() == cell30Cursor);
+ QCOMPARE(table->cellAt(cell00Cursor).firstCursorPosition(), cell00Cursor);
+ QCOMPARE(table->cellAt(cell10Cursor).firstCursorPosition(), cell10Cursor);
+ QCOMPARE(table->cellAt(cell20Cursor).firstCursorPosition(), cell20Cursor);
+ QCOMPARE(table->cellAt(cell30Cursor).firstCursorPosition(), cell30Cursor);
table->mergeCells(1, 0, 2, 1);
@@ -433,16 +433,16 @@ void tst_QTextTable::insertRows()
QVERIFY(cursor == table->cellAt(0, 0).firstCursorPosition());
table->insertRows(0, 1);
- QVERIFY(table->rows() == 3);
+ QCOMPARE(table->rows(), 3);
table->insertRows(1, 1);
- QVERIFY(table->rows() == 4);
+ QCOMPARE(table->rows(), 4);
table->insertRows(-1, 1);
- QVERIFY(table->rows() == 5);
+ QCOMPARE(table->rows(), 5);
table->insertRows(5, 2);
- QVERIFY(table->rows() == 7);
+ QCOMPARE(table->rows(), 7);
}
@@ -552,9 +552,9 @@ void tst_QTextTable::mergeCells()
QTextBlock block = table->cellAt(0, 0).firstCursorPosition().block();
- QVERIFY(block.text() == "Blah Foo");
- QVERIFY(block.next().text() == "Hah");
- QVERIFY(block.next().next().text() == "Bar");
+ QCOMPARE(block.text(), QLatin1String("Blah Foo"));
+ QCOMPARE(block.next().text(), QLatin1String("Hah"));
+ QCOMPARE(block.next().next().text(), QLatin1String("Bar"));
table = create4x4Table();
@@ -580,7 +580,7 @@ void tst_QTextTable::mergeCells()
if (table) {
cursor = table->cellAt(0, 0).firstCursorPosition();
- QVERIFY(cursor.block().text() == "Test");
+ QCOMPARE(cursor.block().text(), QLatin1String("Test"));
}
table = create2x2Table();
@@ -750,7 +750,7 @@ void tst_QTextTable::setCellFormat()
fmt.setTableCellColumnSpan(25);
fmt.setTableCellRowSpan(42);
cell.setFormat(fmt);
- QVERIFY(cell.format().background().color() == QColor(Qt::blue));
+ QCOMPARE(cell.format().background().color(), QColor(Qt::blue));
QCOMPARE(cell.format().tableCellColumnSpan(), 1);
QCOMPARE(cell.format().tableCellRowSpan(), 1);
}
@@ -1086,6 +1086,8 @@ public:
{
if (PdmDevicePixelRatio == metric)
return 1;
+ if (PdmDevicePixelRatioScaled == metric)
+ return 1 * QPaintDevice::devicePixelRatioFScale();
if (PdmDpiY == metric)
return 96;
if (PdmDpiX == metric)
diff --git a/tests/auto/gui/text/qzip/tst_qzip.cpp b/tests/auto/gui/text/qzip/tst_qzip.cpp
index 90e93881b9..8381c93bc2 100644
--- a/tests/auto/gui/text/qzip/tst_qzip.cpp
+++ b/tests/auto/gui/text/qzip/tst_qzip.cpp
@@ -39,9 +39,6 @@
class tst_QZip : public QObject
{
Q_OBJECT
-public slots:
- void init();
- void cleanup();
private slots:
void basicUnpack();
@@ -50,18 +47,10 @@ private slots:
void createArchive();
};
-void tst_QZip::init()
-{
-}
-
-void tst_QZip::cleanup()
-{
-}
-
void tst_QZip::basicUnpack()
{
QZipReader zip(QFINDTESTDATA("/testdata/test.zip"), QIODevice::ReadOnly);
- QList<QZipReader::FileInfo> files = zip.fileInfoList();
+ QVector<QZipReader::FileInfo> files = zip.fileInfoList();
QCOMPARE(files.count(), 2);
QZipReader::FileInfo fi = files.at(0);
@@ -97,7 +86,7 @@ void tst_QZip::basicUnpack()
void tst_QZip::symlinks()
{
QZipReader zip(QFINDTESTDATA("/testdata/symlink.zip"), QIODevice::ReadOnly);
- QList<QZipReader::FileInfo> files = zip.fileInfoList();
+ QVector<QZipReader::FileInfo> files = zip.fileInfoList();
QCOMPARE(files.count(), 2);
QZipReader::FileInfo fi = files.at(0);
@@ -120,7 +109,7 @@ void tst_QZip::symlinks()
void tst_QZip::readTest()
{
QZipReader zip("foobar.zip", QIODevice::ReadOnly); // non existing file.
- QList<QZipReader::FileInfo> files = zip.fileInfoList();
+ QVector<QZipReader::FileInfo> files = zip.fileInfoList();
QCOMPARE(files.count(), 0);
QByteArray b = zip.fileData("foobar");
QCOMPARE(b.size(), 0);
@@ -139,7 +128,7 @@ void tst_QZip::createArchive()
QBuffer buffer2(&zipFile);
QZipReader zip2(&buffer2);
- QList<QZipReader::FileInfo> files = zip2.fileInfoList();
+ QVector<QZipReader::FileInfo> files = zip2.fileInfoList();
QCOMPARE(files.count(), 1);
QZipReader::FileInfo file = files.at(0);
QCOMPARE(file.filePath, QString("My Filename"));
diff --git a/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp b/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
index c8964eb02c..db4b15530c 100644
--- a/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
+++ b/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
@@ -35,6 +35,7 @@
#include <QtTest/QtTest>
#include <qdebug.h>
#include <qdesktopservices.h>
+#include <qregularexpression.h>
class tst_qdesktopservices : public QObject
{
@@ -74,7 +75,9 @@ void tst_qdesktopservices::openUrl()
QCOMPARE(QDesktopServices::openUrl(QUrl()), false);
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
// this test is only valid on windows on other systems it might mean open a new document in the application handling .file
- QTest::ignoreMessage(QtWarningMsg, "ShellExecute 'file://invalid.file' failed (error 3).");
+ const QRegularExpression messagePattern("ShellExecute 'file://invalid\\.file' failed \\(error \\d+\\)\\.");
+ QVERIFY(messagePattern.isValid());
+ QTest::ignoreMessage(QtWarningMsg, messagePattern);
QCOMPARE(QDesktopServices::openUrl(QUrl("file://invalid.file")), false);
#endif
}
diff --git a/tests/auto/gui/util/qdoublevalidator/tst_qdoublevalidator.cpp b/tests/auto/gui/util/qdoublevalidator/tst_qdoublevalidator.cpp
index c2833d9e67..78ab769137 100644
--- a/tests/auto/gui/util/qdoublevalidator/tst_qdoublevalidator.cpp
+++ b/tests/auto/gui/util/qdoublevalidator/tst_qdoublevalidator.cpp
@@ -256,41 +256,41 @@ void tst_QDoubleValidator::notifySignals()
dv.setTop(0.8);
QCOMPARE(topSpy.count(), 1);
QCOMPARE(changedSpy.count(), 1);
- QVERIFY(dv.top() == 0.8);
+ QCOMPARE(dv.top(), 0.8);
dv.setBottom(0.2);
QCOMPARE(bottomSpy.count(), 1);
QCOMPARE(changedSpy.count(), 2);
- QVERIFY(dv.bottom() == 0.2);
+ QCOMPARE(dv.bottom(), 0.2);
dv.setRange(0.2, 0.7);
QCOMPARE(topSpy.count(), 2);
QCOMPARE(bottomSpy.count(), 1);
QCOMPARE(decSpy.count(), 1);
QCOMPARE(changedSpy.count(), 3);
- QVERIFY(dv.bottom() == 0.2);
- QVERIFY(dv.top() == 0.7);
- QVERIFY(dv.decimals() == 0.);
+ QCOMPARE(dv.bottom(), 0.2);
+ QCOMPARE(dv.top(), 0.7);
+ QCOMPARE(dv.decimals(), 0);
dv.setRange(0.3, 0.7);
QCOMPARE(topSpy.count(), 2);
QCOMPARE(bottomSpy.count(), 2);
QCOMPARE(changedSpy.count(), 4);
- QVERIFY(dv.bottom() == 0.3);
- QVERIFY(dv.top() == 0.7);
- QVERIFY(dv.decimals() == 0.);
+ QCOMPARE(dv.bottom(), 0.3);
+ QCOMPARE(dv.top(), 0.7);
+ QCOMPARE(dv.decimals(), 0);
dv.setRange(0.4, 0.6);
QCOMPARE(topSpy.count(), 3);
QCOMPARE(bottomSpy.count(), 3);
QCOMPARE(changedSpy.count(), 5);
- QVERIFY(dv.bottom() == 0.4);
- QVERIFY(dv.top() == 0.6);
- QVERIFY(dv.decimals() == 0.);
+ QCOMPARE(dv.bottom(), 0.4);
+ QCOMPARE(dv.top(), 0.6);
+ QCOMPARE(dv.decimals(), 0);
dv.setDecimals(10);
QCOMPARE(decSpy.count(), 2);
QCOMPARE(changedSpy.count(), 6);
- QVERIFY(dv.decimals() == 10.);
+ QCOMPARE(dv.decimals(), 10);
dv.setRange(0.4, 0.6, 100);
@@ -298,14 +298,14 @@ void tst_QDoubleValidator::notifySignals()
QCOMPARE(bottomSpy.count(), 3);
QCOMPARE(decSpy.count(), 3);
QCOMPARE(changedSpy.count(), 7);
- QVERIFY(dv.bottom() == 0.4);
- QVERIFY(dv.top() == 0.6);
- QVERIFY(dv.decimals() == 100.);
+ QCOMPARE(dv.bottom(), 0.4);
+ QCOMPARE(dv.top(), 0.6);
+ QCOMPARE(dv.decimals(), 100);
dv.setNotation(QDoubleValidator::StandardNotation);
QCOMPARE(notSpy.count(), 1);
QCOMPARE(changedSpy.count(), 8);
- QVERIFY(dv.notation() == QDoubleValidator::StandardNotation);
+ QCOMPARE(dv.notation(), QDoubleValidator::StandardNotation);
dv.setRange(dv.bottom(), dv.top(), dv.decimals());
QCOMPARE(topSpy.count(), 3);
diff --git a/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp b/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp
index 43f7b58439..a683d903df 100644
--- a/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp
+++ b/tests/auto/gui/util/qintvalidator/tst_qintvalidator.cpp
@@ -239,32 +239,32 @@ void tst_QIntValidator::notifySignals()
iv.setTop(9);
QCOMPARE(topSpy.count(), 1);
QCOMPARE(changedSpy.count(), 1);
- QVERIFY(iv.top() == 9);
+ QCOMPARE(iv.top(), 9);
iv.setBottom(1);
QCOMPARE(bottomSpy.count(), 1);
QCOMPARE(changedSpy.count(), 2);
- QVERIFY(iv.bottom() == 1);
+ QCOMPARE(iv.bottom(), 1);
iv.setRange(1, 8);
QCOMPARE(topSpy.count(), 2);
QCOMPARE(bottomSpy.count(), 1);
QCOMPARE(changedSpy.count(), 3);
- QVERIFY(iv.top() == 8);
- QVERIFY(iv.bottom() == 1);
+ QCOMPARE(iv.top(), 8);
+ QCOMPARE(iv.bottom(), 1);
iv.setRange(2, 8);
QCOMPARE(topSpy.count(), 2);
QCOMPARE(bottomSpy.count(), 2);
QCOMPARE(changedSpy.count(), 4);
- QVERIFY(iv.top() == 8);
- QVERIFY(iv.bottom() == 2);
+ QCOMPARE(iv.top(), 8);
+ QCOMPARE(iv.bottom(), 2);
iv.setRange(3, 7);
QCOMPARE(topSpy.count(), 3);
QCOMPARE(bottomSpy.count(), 3);
QCOMPARE(changedSpy.count(), 5);
- QVERIFY(iv.top() == 7);
- QVERIFY(iv.bottom() == 3);
+ QCOMPARE(iv.top(), 7);
+ QCOMPARE(iv.bottom(), 3);
iv.setRange(3, 7);
QCOMPARE(topSpy.count(), 3);
diff --git a/tests/auto/network/access/qabstractnetworkcache/BLACKLIST b/tests/auto/network/access/qabstractnetworkcache/BLACKLIST
new file mode 100644
index 0000000000..3bd3350e4b
--- /dev/null
+++ b/tests/auto/network/access/qabstractnetworkcache/BLACKLIST
@@ -0,0 +1,9 @@
+[cacheControl]
+windows
+osx
+[expires]
+osx
+[etag]
+osx
+[lastModified]
+osx
diff --git a/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp b/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
index 4cbdef2bbe..fd48ec3253 100644
--- a/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
+++ b/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
@@ -294,6 +294,7 @@ void tst_QAbstractNetworkCache::runTest()
QNetworkAccessManager manager;
NetworkDiskCache *diskCache = new NetworkDiskCache(&manager);
+ QVERIFY2(diskCache->tempDir.isValid(), qPrintable(diskCache->tempDir.errorString()));
manager.setCache(diskCache);
QCOMPARE(diskCache->gotData, false);
@@ -344,6 +345,7 @@ void tst_QAbstractNetworkCache::checkSynchronous()
QNetworkAccessManager manager;
NetworkDiskCache *diskCache = new NetworkDiskCache(&manager);
+ QVERIFY2(diskCache->tempDir.isValid(), qPrintable(diskCache->tempDir.errorString()));
manager.setCache(diskCache);
QCOMPARE(diskCache->gotData, false);
@@ -392,6 +394,7 @@ void tst_QAbstractNetworkCache::deleteCache()
{
QNetworkAccessManager manager;
NetworkDiskCache *diskCache = new NetworkDiskCache(&manager);
+ QVERIFY2(diskCache->tempDir.isValid(), qPrintable(diskCache->tempDir.errorString()));
manager.setCache(diskCache);
QString url = "httpcachetest_cachecontrol.cgi?max-age=1000";
diff --git a/tests/auto/network/access/qftp/BLACKLIST b/tests/auto/network/access/qftp/BLACKLIST
new file mode 100644
index 0000000000..92ad1aee8f
--- /dev/null
+++ b/tests/auto/network/access/qftp/BLACKLIST
@@ -0,0 +1,14 @@
+# QTBUG-15111
+
+[activeMode:WithoutProxy]
+opensuse-13.1 64bit
+redhatenterpriselinuxworkstation-6.6
+osx-10.10
+
+[activeMode:WithoutProxyWithSession]
+opensuse-13.1 64bit
+redhatenterpriselinuxworkstation-6.6
+osx-10.10
+
+[list:epsvNotSupported]
+*
diff --git a/tests/auto/network/access/qftp/qftp.pro b/tests/auto/network/access/qftp/qftp.pro
index 850e1a9417..4294f27e74 100644
--- a/tests/auto/network/access/qftp/qftp.pro
+++ b/tests/auto/network/access/qftp/qftp.pro
@@ -11,4 +11,3 @@ wince {
DEPLOYMENT += addFiles
}
-CONFIG+=insignificant_test # QTBUG-15111: uses live qt-test-server, inherently unstable
diff --git a/tests/auto/network/access/qftp/tst_qftp.cpp b/tests/auto/network/access/qftp/tst_qftp.cpp
index 7ea1859938..795548ccc8 100644
--- a/tests/auto/network/access/qftp/tst_qftp.cpp
+++ b/tests/auto/network/access/qftp/tst_qftp.cpp
@@ -390,8 +390,7 @@ void tst_QFtp::connectToUnresponsiveHost()
a lot of other stuff in QFtp, so we just expect this test to fail on Windows.
*/
QEXPECT_FAIL("", "timeout not working due to strange Windows socket behaviour (see source file of this test for explanation)", Abort);
-#else
- QEXPECT_FAIL("", "QTBUG-20687", Abort);
+
#endif
QVERIFY2(! QTestEventLoop::instance().timeout(), "Network timeout longer than expected (should have been 60 seconds)");
diff --git a/tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp b/tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp
index 1d04921c9a..be3e839725 100644
--- a/tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp
+++ b/tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp
@@ -83,7 +83,7 @@ void tst_QNetworkCookie::getterSetter()
QNetworkCookie cookie;
QNetworkCookie otherCookie;
- QVERIFY(cookie == otherCookie);
+ QCOMPARE(cookie, otherCookie);
QCOMPARE(cookie, otherCookie);
QVERIFY(!(cookie != otherCookie));
@@ -133,7 +133,7 @@ void tst_QNetworkCookie::getterSetter()
cookie.setSecure(false);
QVERIFY(!cookie.isSecure());
- QVERIFY(cookie == otherCookie);
+ QCOMPARE(cookie, otherCookie);
}
void tst_QNetworkCookie::parseSingleCookie_data()
diff --git a/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp b/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
index 708e7ebca8..1685838e9e 100644
--- a/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
+++ b/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
@@ -563,7 +563,7 @@ void tst_QNetworkDiskCache::oldCacheVersionFile()
{
QTemporaryFile file(cache.cacheDirectory() + "/XXXXXX.d");
file.setAutoRemove(false);
- QVERIFY(file.open());
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QDataStream out(&file);
out << qint32(0xe8);
out << qint32(2);
diff --git a/tests/auto/network/access/qnetworkreply/element.xml b/tests/auto/network/access/qnetworkreply/element.xml
new file mode 100644
index 0000000000..071ffae057
--- /dev/null
+++ b/tests/auto/network/access/qnetworkreply/element.xml
@@ -0,0 +1 @@
+<root attr="value" attr2="value2"><person /><fruit /></root>
diff --git a/tests/auto/network/access/qnetworkreply/qnetworkreply.pro b/tests/auto/network/access/qnetworkreply/qnetworkreply.pro
index 7cb6fddbaf..bd10c77252 100644
--- a/tests/auto/network/access/qnetworkreply/qnetworkreply.pro
+++ b/tests/auto/network/access/qnetworkreply/qnetworkreply.pro
@@ -1,5 +1,5 @@
TEMPLATE = subdirs
-!wince: SUBDIRS += echo
+!winrt:!wince: SUBDIRS += echo
test.depends += $$SUBDIRS
SUBDIRS += test
diff --git a/tests/auto/network/access/qnetworkreply/test/test.pro b/tests/auto/network/access/qnetworkreply/test/test.pro
index b683f620df..772bb55990 100644
--- a/tests/auto/network/access/qnetworkreply/test/test.pro
+++ b/tests/auto/network/access/qnetworkreply/test/test.pro
@@ -13,4 +13,4 @@ TESTDATA += ../empty ../rfc3252.txt ../resource ../bigfile ../*.jpg ../certs \
contains(QT_CONFIG,xcb): CONFIG+=insignificant_test # unstable, QTBUG-21102
win32:CONFIG += insignificant_test # QTBUG-24226
-TEST_HELPER_INSTALLS = ../echo/echo
+!winrt: TEST_HELPER_INSTALLS = ../echo/echo
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 4ed175ff7f..ce56dcacba 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -129,6 +129,14 @@ class tst_QNetworkReply: public QObject
return s;
};
+ static QString tempRedirectReplyStr() {
+ QString s = "HTTP/1.1 307 Temporary Redirect\r\n"
+ "Content-Type: text/plain\r\n"
+ "location: %1\r\n"
+ "\r\n";
+ return s;
+ };
+
QEventLoop *loop;
enum RunSimpleRequestReturn { Timeout = 0, Success, Failure };
int returnCode;
@@ -192,8 +200,7 @@ protected Q_SLOTS:
void nestedEventLoops_slot();
private Q_SLOTS:
- void init();
- void cleanup();
+ void cleanup() { cleanupTestData(); }
void initTestCase();
void cleanupTestCase();
@@ -426,6 +433,8 @@ private Q_SLOTS:
void qtbug28035browserDoesNotLoadQtProjectOrgCorrectly();
+ void qtbug45581WrongReplyStatusCode();
+
void synchronousRequest_data();
void synchronousRequest();
#ifndef QT_NO_SSL
@@ -464,6 +473,10 @@ private Q_SLOTS:
void putWithRateLimiting();
+ void ioHttpSingleRedirect();
+ void ioHttpChangeMaxRedirects();
+ void ioHttpRedirectErrors_data();
+ void ioHttpRedirectErrors();
#ifndef QT_NO_SSL
void putWithServerClosingConnectionImmediately();
#endif
@@ -471,6 +484,8 @@ private Q_SLOTS:
// NOTE: This test must be last!
void parentingRepliesToTheApp();
private:
+ void cleanupTestData();
+
QString testDataDir;
};
@@ -605,10 +620,16 @@ protected:
virtual void reply() {
Q_ASSERT(!client.isNull());
// we need to emulate the bytesWrittenSlot call if the data is empty.
- if (dataToTransmit.size() == 0)
+ if (dataToTransmit.size() == 0) {
QMetaObject::invokeMethod(this, "bytesWrittenSlot", Qt::QueuedConnection);
- else
+ } else {
client->write(dataToTransmit);
+ // FIXME: For SSL connections, if we don't flush the socket, the
+ // client never receives the data and since we're doing a disconnect
+ // immediately afterwards, it causes a RemoteHostClosedError for the
+ // client
+ client->flush();
+ }
}
private:
void connectSocketSignals()
@@ -1472,6 +1493,8 @@ void tst_QNetworkReply::initTestCase()
echoProcessDir = QFINDTESTDATA("echo");
QVERIFY2(!echoProcessDir.isEmpty(), qPrintable(
QString::fromLatin1("Couldn't find echo dir starting from %1.").arg(QDir::currentPath())));
+
+ cleanupTestData();
}
void tst_QNetworkReply::cleanupTestCase()
@@ -1487,12 +1510,7 @@ void tst_QNetworkReply::cleanupTestCase()
#endif
}
-void tst_QNetworkReply::init()
-{
- cleanup();
-}
-
-void tst_QNetworkReply::cleanup()
+void tst_QNetworkReply::cleanupTestData()
{
QFile file(testFileName);
QVERIFY(!file.exists() || file.remove());
@@ -1659,14 +1677,14 @@ void tst_QNetworkReply::getFromFile()
// create the file:
QTemporaryFile file(QDir::currentPath() + "/temp-XXXXXX");
file.setAutoRemove(true);
- QVERIFY(file.open());
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QNetworkRequest request(QUrl::fromLocalFile(file.fileName()));
QNetworkReplyPtr reply;
static const char fileData[] = "This is some data that is in the file.\r\n";
QByteArray data = QByteArray::fromRawData(fileData, sizeof fileData - 1);
- QVERIFY(file.write(data) == data.size());
+ QCOMPARE(file.write(data), data.size());
file.flush();
QCOMPARE(file.size(), qint64(data.size()));
@@ -2914,9 +2932,9 @@ void tst_QNetworkReply::connectToIPv6Address()
//qDebug() << server.receivedData;
QByteArray hostinfo = "\r\nHost: " + hostfield + ":" + QByteArray::number(server.serverPort()) + "\r\n";
QVERIFY(server.receivedData.contains(hostinfo));
- QVERIFY(content == dataToSend);
+ QCOMPARE(content, dataToSend);
QCOMPARE(reply->url(), request.url());
- QVERIFY(reply->error() == error);
+ QCOMPARE(reply->error(), error);
}
void tst_QNetworkReply::sendCustomRequestToHttp_data()
@@ -3045,10 +3063,10 @@ void tst_QNetworkReply::ioGetFromFile()
{
QTemporaryFile file(QDir::currentPath() + "/temp-XXXXXX");
file.setAutoRemove(true);
- QVERIFY(file.open());
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QFETCH(QByteArray, data);
- QVERIFY(file.write(data) == data.size());
+ QCOMPARE(file.write(data), data.size());
file.flush();
QCOMPARE(file.size(), qint64(data.size()));
@@ -3118,8 +3136,8 @@ void tst_QNetworkReply::ioGetFromFtpWithReuse()
DataReader reader2(reply2);
QSignalSpy spy(reply1.data(), SIGNAL(finished()));
- QVERIFY(waitForFinish(reply1) == Success);
- QVERIFY(waitForFinish(reply2) == Success);
+ QCOMPARE(waitForFinish(reply1), int(Success));
+ QCOMPARE(waitForFinish(reply2), int(Success));
QCOMPARE(reply1->url(), request.url());
QCOMPARE(reply2->url(), request.url());
@@ -3169,8 +3187,8 @@ void tst_QNetworkReply::ioGetFromHttpWithReuseParallel()
DataReader reader2(reply2);
QSignalSpy spy(reply1.data(), SIGNAL(finished()));
- QVERIFY(waitForFinish(reply2) == Success);
- QVERIFY(waitForFinish(reply1) == Success);
+ QCOMPARE(waitForFinish(reply2), int(Success));
+ QCOMPARE(waitForFinish(reply1), int(Success));
QCOMPARE(reply1->url(), request.url());
QCOMPARE(reply2->url(), request.url());
@@ -3272,8 +3290,8 @@ void tst_QNetworkReply::ioGetFromHttpWithAuth()
connect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*)));
- QVERIFY(waitForFinish(reply2) == Success);
- QVERIFY(waitForFinish(reply1) == Success);
+ QCOMPARE(waitForFinish(reply2), int(Success));
+ QCOMPARE(waitForFinish(reply1), int(Success));
manager.disconnect(SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
this, SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*)));
@@ -3402,8 +3420,8 @@ void tst_QNetworkReply::ioGetFromHttpWithProxyAuth()
connect(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
- QVERIFY(waitForFinish(reply2) == Success);
- QVERIFY(waitForFinish(reply1) == Success);
+ QCOMPARE(waitForFinish(reply2), int(Success));
+ QCOMPARE(waitForFinish(reply1), int(Success));
manager.disconnect(SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
@@ -3525,7 +3543,7 @@ void tst_QNetworkReply::ioGetFromHttpWithSocksProxy()
connect(&manager, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
- QVERIFY(waitForFinish(reply) == Failure);
+ QCOMPARE(waitForFinish(reply), int(Failure));
manager.disconnect(SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
@@ -3613,7 +3631,7 @@ void tst_QNetworkReply::ioGetFromHttpsWithSslHandshakeError()
QSignalSpy sslspy(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)));
connect(reply, SIGNAL(metaDataChanged()), SLOT(storeSslConfiguration()));
- QVERIFY(waitForFinish(reply) == Failure);
+ QCOMPARE(waitForFinish(reply), int(Failure));
QCOMPARE(reply->error(), QNetworkReply::SslHandshakeFailedError);
QCOMPARE(sslspy.count(), 0);
@@ -3671,7 +3689,7 @@ void tst_QNetworkReply::ioGetFromHttpBrokenServer()
QNetworkReplyPtr reply(manager.get(request));
QSignalSpy spy(reply.data(), SIGNAL(error(QNetworkReply::NetworkError)));
- QVERIFY(waitForFinish(reply) == Failure);
+ QCOMPARE(waitForFinish(reply), int(Failure));
QCOMPARE(reply->url(), request.url());
QCOMPARE(spy.count(), 1);
@@ -4722,7 +4740,7 @@ void tst_QNetworkReply::ioPostToHttpNoBufferFlag()
connect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*)));
- QVERIFY(waitForFinish(reply) == Failure);
+ QCOMPARE(waitForFinish(reply), int(Failure));
disconnect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
this, SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*)));
@@ -5092,7 +5110,7 @@ void tst_QNetworkReply::ioPostToHttpEmptyUploadProgress()
QVERIFY(!QTestEventLoop::instance().timeout());
// final check: only 1 uploadProgress has been emitted
- QVERIFY(spy.length() == 1);
+ QCOMPARE(spy.length(), 1);
QList<QVariant> args = spy.last();
QVERIFY(!args.isEmpty());
QCOMPARE(args.at(0).toLongLong(), buffer.size());
@@ -5333,10 +5351,10 @@ void tst_QNetworkReply::chaining()
{
QTemporaryFile sourceFile(QDir::currentPath() + "/temp-XXXXXX");
sourceFile.setAutoRemove(true);
- QVERIFY(sourceFile.open());
+ QVERIFY2(sourceFile.open(), qPrintable(sourceFile.errorString()));
QFETCH(QByteArray, data);
- QVERIFY(sourceFile.write(data) == data.size());
+ QCOMPARE(sourceFile.write(data), data.size());
sourceFile.flush();
QCOMPARE(sourceFile.size(), qint64(data.size()));
@@ -5348,7 +5366,7 @@ void tst_QNetworkReply::chaining()
request.setUrl(url);
QNetworkReplyPtr putReply(manager.put(request, getReply.data()));
- QVERIFY(waitForFinish(putReply) == Success);
+ QCOMPARE(waitForFinish(putReply), int(Success));
QCOMPARE(getReply->url(), QUrl::fromLocalFile(sourceFile.fileName()));
QCOMPARE(getReply->error(), QNetworkReply::NoError);
@@ -5755,7 +5773,7 @@ void tst_QNetworkReply::proxyChange()
// verify that the replies succeeded
QCOMPARE(reply1->error(), QNetworkReply::NoError);
QCOMPARE(reply1->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200);
- QVERIFY(reply1->size() == 1);
+ QCOMPARE(reply1->size(), 1);
QCOMPARE(reply2->error(), QNetworkReply::NoError);
QCOMPARE(reply2->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200);
@@ -5772,7 +5790,7 @@ void tst_QNetworkReply::proxyChange()
manager.setProxy(dummyProxy);
QNetworkReplyPtr reply3(manager.get(req));
- QVERIFY(waitForFinish(reply3) == Failure);
+ QCOMPARE(waitForFinish(reply3), int(Failure));
QVERIFY(int(reply3->error()) > 0);
}
@@ -5808,7 +5826,7 @@ void tst_QNetworkReply::authorizationError()
QSignalSpy errorSpy(reply.data(), SIGNAL(error(QNetworkReply::NetworkError)));
QSignalSpy finishedSpy(reply.data(), SIGNAL(finished()));
// now run the request:
- QVERIFY(waitForFinish(reply) == Failure);
+ QCOMPARE(waitForFinish(reply), int(Failure));
QFETCH(int, errorSignalCount);
QCOMPARE(errorSpy.count(), errorSignalCount);
@@ -5983,7 +6001,7 @@ public slots:
QNetworkReply *reply = qobject_cast<QNetworkReply*>(sender());
QVERIFY(!reply->error());
- QVERIFY(reply->bytesAvailable() == 27906);
+ QCOMPARE(reply->bytesAvailable(), 27906);
if (requestsFinishedCount == 60) {
QTestEventLoop::instance().exitLoop();
@@ -6153,6 +6171,10 @@ void tst_QNetworkReply::sslSessionSharing_data()
void tst_QNetworkReply::sslSessionSharing()
{
+#ifdef QT_SECURETRANSPORT
+ QSKIP("Not implemented with SecureTransport");
+#endif
+
QString urlString("https://" + QtNetworkSettings::serverName());
QList<QNetworkReplyPtr> replies;
@@ -6217,6 +6239,10 @@ void tst_QNetworkReply::sslSessionSharingFromPersistentSession_data()
void tst_QNetworkReply::sslSessionSharingFromPersistentSession()
{
+#ifdef QT_SECURETRANSPORT
+ QSKIP("Not implemented with SecureTransport");
+#endif
+
QString urlString("https://" + QtNetworkSettings::serverName());
// warm up SSL session cache to get a working session
@@ -6501,7 +6527,7 @@ public:
void finishedSlot() {
// We should have already received all readyRead
QVERIFY(!bytesAvailableList.isEmpty());
- QVERIFY(bytesAvailableList.last() == uploadSize);
+ QCOMPARE(bytesAvailableList.last(), uploadSize);
}
};
@@ -6584,7 +6610,7 @@ void tst_QNetworkReply::ioGetFromHttpWithoutContentLength()
QCOMPARE(reply->url(), request.url());
QVERIFY(reply->isFinished());
- QVERIFY(reply->error() == QNetworkReply::NoError);
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
}
// Is handled somewhere else too, introduced this special test to have it more accessible
@@ -6651,7 +6677,7 @@ void tst_QNetworkReply::compressedHttpReplyBrokenGzip()
QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort())));
QNetworkReplyPtr reply(manager.get(request));
- QVERIFY(waitForFinish(reply) == Failure);
+ QCOMPARE(waitForFinish(reply), int(Failure));
QCOMPARE(reply->error(), QNetworkReply::ProtocolFailure);
}
@@ -6664,7 +6690,7 @@ void tst_QNetworkReply::getFromUnreachableIp()
QNetworkRequest request(QUrl("http://255.255.255.255/42/23/narf/narf/narf"));
QNetworkReplyPtr reply(manager.get(request));
- QVERIFY(waitForFinish(reply) == Failure);
+ QCOMPARE(waitForFinish(reply), int(Failure));
QVERIFY(reply->error() != QNetworkReply::NoError);
}
@@ -7166,6 +7192,7 @@ void tst_QNetworkReply::qtbug28035browserDoesNotLoadQtProjectOrgCorrectly() {
QByteArray postData = "ACT=100";
QTemporaryDir tempDir(QDir::tempPath() + "/tmp_cache_28035");
+ QVERIFY2(tempDir.isValid(), qPrintable(tempDir.errorString()));
tempDir.setAutoRemove(true);
QNetworkDiskCache *diskCache = new QNetworkDiskCache();
@@ -7255,6 +7282,34 @@ void tst_QNetworkReply::qtbug28035browserDoesNotLoadQtProjectOrgCorrectly() {
QCOMPARE(reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool(), true);
}
+void tst_QNetworkReply::qtbug45581WrongReplyStatusCode()
+{
+ const QUrl url("file:" + testDataDir + "/element.xml");
+ QNetworkRequest request(url);
+
+ QNetworkReplyPtr reply;
+ QSignalSpy finishedSpy(&manager, SIGNAL(finished(QNetworkReply*)));
+ QSignalSpy sslErrorsSpy(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)));
+ RUN_REQUEST(runSimpleRequest(QNetworkAccessManager::GetOperation, request, reply, 0));
+ QVERIFY(reply->isFinished());
+
+ const QByteArray expectedContent =
+ "<root attr=\"value\" attr2=\"value2\">"
+ "<person /><fruit /></root>\n";
+
+ QCOMPARE(reply->readAll(), expectedContent);
+
+ QCOMPARE(finishedSpy.count(), 0);
+ QCOMPARE(sslErrorsSpy.count(), 0);
+
+ QCOMPARE(reply->header(QNetworkRequest::ContentLengthHeader).toLongLong(), expectedContent.size());
+
+ QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200);
+ QCOMPARE(reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toString(), QLatin1String("OK"));
+
+ reply->deleteLater();
+}
+
void tst_QNetworkReply::synchronousRequest_data()
{
QTest::addColumn<QUrl>("url");
@@ -7425,7 +7480,7 @@ void tst_QNetworkReply::httpAbort()
QNetworkRequest request3("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt");
QNetworkReplyPtr reply3(manager.get(request3));
- QVERIFY(waitForFinish(reply3) == Success);
+ QCOMPARE(waitForFinish(reply3), int(Success));
QVERIFY(reply3->isFinished());
reply3->abort();
@@ -7980,7 +8035,142 @@ void tst_QNetworkReply::putWithRateLimiting()
QCOMPARE(uploadedData, data);
}
+void tst_QNetworkReply::ioHttpSingleRedirect()
+{
+ QUrl localhost = QUrl("http://localhost");
+ QByteArray http200Reply = "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n";
+
+ // Setup server to which the second server will redirect to
+ MiniHttpServer server2(http200Reply);
+
+ QUrl redirectUrl = QUrl(localhost);
+ redirectUrl.setPort(server2.serverPort());
+
+ QByteArray tempRedirectReply =
+ tempRedirectReplyStr().arg(QString(redirectUrl.toEncoded())).toLatin1();
+
+
+ // Setup redirect server
+ MiniHttpServer server(tempRedirectReply);
+
+ localhost.setPort(server.serverPort());
+ QNetworkRequest request(localhost);
+ request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
+
+ QNetworkReplyPtr reply(manager.get(request));
+ QSignalSpy redSpy(reply.data(), SIGNAL(redirected(QUrl)));
+ QSignalSpy finSpy(reply.data(), SIGNAL(finished()));
+
+ QVERIFY2(waitForFinish(reply) == Success, msgWaitForFinished(reply));
+
+ // Redirected and finished should be emitted exactly once
+ QCOMPARE(redSpy.count(), 1);
+ QCOMPARE(finSpy.count(), 1);
+
+ // Original URL should not be changed after redirect
+ QCOMPARE(request.url(), localhost);
+
+ // Verify Redirect url
+ QList<QVariant> args = redSpy.takeFirst();
+ QCOMPARE(args.at(0).toUrl(), redirectUrl);
+
+ // Reply url is set to the redirect url
+ QCOMPARE(reply->url(), redirectUrl);
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
+}
+
+void tst_QNetworkReply::ioHttpChangeMaxRedirects()
+{
+ QUrl localhost = QUrl("http://localhost");
+
+ QByteArray http200Reply = "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n";
+
+ MiniHttpServer server1("");
+ MiniHttpServer server2("");
+ MiniHttpServer server3(http200Reply);
+
+ QUrl server2Url(localhost);
+ server2Url.setPort(server2.serverPort());
+ server1.setDataToTransmit(tempRedirectReplyStr().arg(
+ QString(server2Url.toEncoded())).toLatin1());
+
+ QUrl server3Url(localhost);
+ server3Url.setPort(server3.serverPort());
+ server2.setDataToTransmit(tempRedirectReplyStr().arg(
+ QString(server3Url.toEncoded())).toLatin1());
+
+ localhost.setPort(server1.serverPort());
+ QNetworkRequest request(localhost);
+ request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
+
+ // Set Max redirects to 1. This will cause TooManyRedirectsError
+ request.setMaximumRedirectsAllowed(1);
+
+ QNetworkReplyPtr reply(manager.get(request));
+ QSignalSpy redSpy(reply.data(), SIGNAL(redirected(QUrl)));
+ QSignalSpy spy(reply.data(), SIGNAL(error(QNetworkReply::NetworkError)));
+
+ QCOMPARE(waitForFinish(reply), int(Failure));
+
+ QCOMPARE(redSpy.count(), request.maximumRedirectsAllowed());
+ QCOMPARE(spy.count(), 1);
+ QCOMPARE(reply->error(), QNetworkReply::TooManyRedirectsError);
+
+ // Increase max redirects to allow successful completion
+ request.setMaximumRedirectsAllowed(3);
+
+ QNetworkReplyPtr reply2(manager.get(request));
+ QSignalSpy redSpy2(reply2.data(), SIGNAL(redirected(QUrl)));
+
+ QVERIFY2(waitForFinish(reply2) == Success, msgWaitForFinished(reply2));
+ QCOMPARE(redSpy2.count(), 2);
+ QCOMPARE(reply2->url(), server3Url);
+ QCOMPARE(reply2->error(), QNetworkReply::NoError);
+}
+
+void tst_QNetworkReply::ioHttpRedirectErrors_data()
+{
+ QTest::addColumn<QString>("url");
+ QTest::addColumn<QString>("dataToSend");
+ QTest::addColumn<QNetworkReply::NetworkError>("error");
+
+ QString tempRedirectReply = QString("HTTP/1.1 307 Temporary Redirect\r\n"
+ "Content-Type: text/plain\r\n"
+ "location: http://localhost:%1\r\n\r\n");
+
+ QTest::newRow("too-many-redirects") << "http://localhost" << tempRedirectReply << QNetworkReply::TooManyRedirectsError;
+ QTest::newRow("insecure-redirect") << "https://localhost" << tempRedirectReply << QNetworkReply::InsecureRedirectError;
+ QTest::newRow("unknown-redirect") << "http://localhost"<< tempRedirectReply.replace("http", "bad_protocol") << QNetworkReply::ProtocolUnknownError;
+}
+
+void tst_QNetworkReply::ioHttpRedirectErrors()
+{
+ QFETCH(QString, url);
+ QFETCH(QString, dataToSend);
+ QFETCH(QNetworkReply::NetworkError, error);
+
+ QUrl localhost(url);
+ MiniHttpServer server("", localhost.scheme() == "https");
+
+ localhost.setPort(server.serverPort());
+
+ QByteArray d2s = dataToSend.arg(
+ QString::number(server.serverPort())).toLatin1();
+ server.setDataToTransmit(d2s);
+
+ QNetworkRequest request(localhost);
+ request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
+ QNetworkReplyPtr reply(manager.get(request));
+ if (localhost.scheme() == "https")
+ reply.data()->ignoreSslErrors();
+ QSignalSpy spy(reply.data(), SIGNAL(error(QNetworkReply::NetworkError)));
+
+ QCOMPARE(waitForFinish(reply), int(Failure));
+
+ QCOMPARE(spy.count(), 1);
+ QCOMPARE(reply->error(), error);
+}
#ifndef QT_NO_SSL
class PutWithServerClosingConnectionImmediatelyHandler: public QObject
diff --git a/tests/auto/network/access/spdy/BLACKLIST b/tests/auto/network/access/spdy/BLACKLIST
new file mode 100644
index 0000000000..b13eae1000
--- /dev/null
+++ b/tests/auto/network/access/spdy/BLACKLIST
@@ -0,0 +1,4 @@
+[download]
+linux
+[upload]
+linux
diff --git a/tests/auto/network/access/spdy/spdy.pro b/tests/auto/network/access/spdy/spdy.pro
index 6bfc6d84e0..23efa85b47 100644
--- a/tests/auto/network/access/spdy/spdy.pro
+++ b/tests/auto/network/access/spdy/spdy.pro
@@ -5,3 +5,5 @@ SOURCES += tst_spdy.cpp
QT = core core-private network network-private testlib
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+
+win32:CONFIG += insignificant_test # QTBUG-47128
diff --git a/tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp b/tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
index 7dfc02463e..09ccff4968 100644
--- a/tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
+++ b/tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
@@ -68,7 +68,7 @@ void tst_QNetworkConfiguration::invalidPoint()
QVERIFY(pt.name().isEmpty());
QVERIFY(!pt.isValid());
- QVERIFY(pt.type() == QNetworkConfiguration::Invalid);
+ QCOMPARE(pt.type(), QNetworkConfiguration::Invalid);
QVERIFY(!(pt.state() & QNetworkConfiguration::Defined));
QVERIFY(!(pt.state() & QNetworkConfiguration::Discovered));
QVERIFY(!(pt.state() & QNetworkConfiguration::Active));
@@ -77,7 +77,7 @@ void tst_QNetworkConfiguration::invalidPoint()
QNetworkConfiguration pt2(pt);
QVERIFY(pt2.name().isEmpty());
QVERIFY(!pt2.isValid());
- QVERIFY(pt2.type() == QNetworkConfiguration::Invalid);
+ QCOMPARE(pt2.type(), QNetworkConfiguration::Invalid);
QVERIFY(!(pt2.state() & QNetworkConfiguration::Defined));
QVERIFY(!(pt2.state() & QNetworkConfiguration::Discovered));
QVERIFY(!(pt2.state() & QNetworkConfiguration::Active));
@@ -91,27 +91,27 @@ void tst_QNetworkConfiguration::comparison()
//compare invalid connection points
QNetworkConfiguration pt1;
QVERIFY(!pt1.isValid());
- QVERIFY(pt1.type() == QNetworkConfiguration::Invalid);
+ QCOMPARE(pt1.type(), QNetworkConfiguration::Invalid);
QNetworkConfiguration pt2(pt1);
QVERIFY(pt1==pt2);
QVERIFY(!(pt1!=pt2));
- QVERIFY(pt1.name() == pt2.name());
- QVERIFY(pt1.isValid() == pt2.isValid());
- QVERIFY(pt1.type() == pt2.type());
- QVERIFY(pt1.state() == pt2.state());
- QVERIFY(pt1.purpose() == pt2.purpose());
+ QCOMPARE(pt1.name(), pt2.name());
+ QCOMPARE(pt1.isValid(), pt2.isValid());
+ QCOMPARE(pt1.type(), pt2.type());
+ QCOMPARE(pt1.state(), pt2.state());
+ QCOMPARE(pt1.purpose(), pt2.purpose());
QNetworkConfiguration pt3;
pt3 = pt1;
QVERIFY(pt1==pt3);
QVERIFY(!(pt1!=pt3));
- QVERIFY(pt1.name() == pt3.name());
- QVERIFY(pt1.isValid() == pt3.isValid());
- QVERIFY(pt1.type() == pt3.type());
- QVERIFY(pt1.state() == pt3.state());
- QVERIFY(pt1.purpose() == pt3.purpose());
+ QCOMPARE(pt1.name(), pt3.name());
+ QCOMPARE(pt1.isValid(), pt3.isValid());
+ QCOMPARE(pt1.type(), pt3.type());
+ QCOMPARE(pt1.state(), pt3.state());
+ QCOMPARE(pt1.purpose(), pt3.purpose());
//test case must run on machine that has valid connection points
QNetworkConfigurationManager manager;
@@ -131,11 +131,11 @@ void tst_QNetworkConfiguration::comparison()
pt3 = defaultConfig;
QVERIFY(defaultConfig==pt3);
QVERIFY(!(defaultConfig!=pt3));
- QVERIFY(defaultConfig.name() == pt3.name());
- QVERIFY(defaultConfig.isValid() == pt3.isValid());
- QVERIFY(defaultConfig.type() == pt3.type());
- QVERIFY(defaultConfig.state() == pt3.state());
- QVERIFY(defaultConfig.purpose() == pt3.purpose());
+ QCOMPARE(defaultConfig.name(), pt3.name());
+ QCOMPARE(defaultConfig.isValid(), pt3.isValid());
+ QCOMPARE(defaultConfig.type(), pt3.type());
+ QCOMPARE(defaultConfig.state(), pt3.state());
+ QCOMPARE(defaultConfig.purpose(), pt3.purpose());
}
void tst_QNetworkConfiguration::children()
@@ -178,7 +178,7 @@ void tst_QNetworkConfiguration::isRoamingAvailable()
if ( c.children().count() <= 1 )
QVERIFY(!c.isRoamingAvailable());
foreach(QNetworkConfiguration child, c.children()) {
- QVERIFY(QNetworkConfiguration::InternetAccessPoint == child.type());
+ QCOMPARE(QNetworkConfiguration::InternetAccessPoint, child.type());
QCOMPARE(child.children().count(), 0);
}
} else {
diff --git a/tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp b/tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
index afe1fc274e..94c4d903b2 100644
--- a/tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
+++ b/tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
@@ -168,7 +168,7 @@ void tst_QNetworkConfigurationManager::defaultConfiguration()
QVERIFY(!defaultConfig.isRoamingAvailable());
QCOMPARE(defaultConfig.state(), QNetworkConfiguration::Discovered);
QNetworkConfiguration copy = manager.configurationFromIdentifier(defaultConfig.identifier());
- QVERIFY(copy == defaultConfig);
+ QCOMPARE(copy, defaultConfig);
}
}
@@ -190,7 +190,7 @@ void tst_QNetworkConfigurationManager::configurationFromIdentifier()
QNetworkConfiguration direct = manager.configurationFromIdentifier(c.identifier());
QVERIFY(direct.isValid());
- QVERIFY(direct == c);
+ QCOMPARE(direct, c);
}
//assume that there is no item with identifier 'FooBar'
diff --git a/tests/auto/network/bearer/qnetworksession/qnetworksession.pro b/tests/auto/network/bearer/qnetworksession/qnetworksession.pro
index f1cb47d14e..cd480fb73b 100644
--- a/tests/auto/network/bearer/qnetworksession/qnetworksession.pro
+++ b/tests/auto/network/bearer/qnetworksession/qnetworksession.pro
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
-SUBDIRS = lackey
+!winrt:SUBDIRS = lackey
test.depends = $$SUBDIRS
SUBDIRS += test
diff --git a/tests/auto/network/bearer/qnetworksession/test/test.pro b/tests/auto/network/bearer/qnetworksession/test/test.pro
index dd7618b4ad..c95baa2b81 100644
--- a/tests/auto/network/bearer/qnetworksession/test/test.pro
+++ b/tests/auto/network/bearer/qnetworksession/test/test.pro
@@ -15,4 +15,4 @@ CONFIG(debug_and_release) {
DESTDIR = ..
}
-TEST_HELPER_INSTALLS = ../lackey/lackey
+!winrt: TEST_HELPER_INSTALLS = ../lackey/lackey
diff --git a/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp b/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp
index 2fd80b3e71..cd510ddfa8 100644
--- a/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp
+++ b/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp
@@ -187,19 +187,19 @@ void tst_QNetworkSession::invalidSession()
// 1. Verify that session created with invalid configuration remains in invalid state
QNetworkSession session(QNetworkConfiguration(), 0);
QVERIFY(!session.isOpen());
- QVERIFY(session.state() == QNetworkSession::Invalid);
- QVERIFY(session.error() == QNetworkSession::InvalidConfigurationError);
+ QCOMPARE(session.state(), QNetworkSession::Invalid);
+ QCOMPARE(session.error(), QNetworkSession::InvalidConfigurationError);
// 2. Verify that opening session with invalid configuration both 1) emits invalidconfigurationerror and 2) sets session's state as invalid.
QSignalSpy errorSpy(&session, SIGNAL(error(QNetworkSession::SessionError)));
session.open();
session.waitForOpened(1000); // Should bail out right away
- QVERIFY(errorSpy.count() == 1);
+ QCOMPARE(errorSpy.count(), 1);
QNetworkSession::SessionError error =
qvariant_cast<QNetworkSession::SessionError> (errorSpy.first().at(0));
- QVERIFY(error == QNetworkSession::InvalidConfigurationError);
- QVERIFY(session.error() == QNetworkSession::InvalidConfigurationError);
- QVERIFY(session.state() == QNetworkSession::Invalid);
+ QCOMPARE(error, QNetworkSession::InvalidConfigurationError);
+ QCOMPARE(session.error(), QNetworkSession::InvalidConfigurationError);
+ QCOMPARE(session.state(), QNetworkSession::Invalid);
#ifdef QNETWORKSESSION_MANUAL_TESTS
@@ -210,7 +210,7 @@ void tst_QNetworkSession::invalidSession()
qDebug() << "Delete the WLAN IAP from phone now (waiting 60 seconds): " << invalidatedConfig.name();
QTest::qWait(60000);
QVERIFY(!invalidatedConfig.isValid());
- QVERIFY(invalidatedSession.state() == QNetworkSession::Invalid);
+ QCOMPARE(invalidatedSession.state(), QNetworkSession::Invalid);
qDebug() << "Add the WLAN IAP back (waiting 60 seconds): " << invalidatedConfig.name();
QTest::qWait(60000);
}
@@ -235,11 +235,11 @@ void tst_QNetworkSession::invalidSession()
QVERIFY(definedSession.state() == QNetworkSession::NotAvailable); // State is not available because WLAN is not in coverage
QVERIFY(!errorSpy.isEmpty()); // Session tells with error about invalidated configuration
sessionError = qvariant_cast<QNetworkSession::SessionError> (errorSpy.first().at(0));
- QVERIFY(sessionError == QNetworkSession::InvalidConfigurationError);
+ QCOMPARE(sessionError, QNetworkSession::InvalidConfigurationError);
qDebug() << "Turn the WLAN IAP back on (waiting 60 seconds): " << definedConfig.name();
QTest::qWait(60000);
updateConfigurations();
- QVERIFY(definedConfig.state() == QNetworkConfiguration::Discovered);
+ QCOMPARE(definedConfig.state(), QNetworkConfiguration::Discovered);
}
#endif
}
@@ -260,7 +260,7 @@ void tst_QNetworkSession::sessionProperties()
{
QFETCH(QNetworkConfiguration, configuration);
QNetworkSession session(configuration);
- QVERIFY(session.configuration() == configuration);
+ QCOMPARE(session.configuration(), configuration);
QStringList validBearerNames = QStringList() << QLatin1String("Unknown")
<< QLatin1String("Ethernet")
<< QLatin1String("WLAN")
@@ -303,10 +303,10 @@ void tst_QNetworkSession::sessionProperties()
} else {
switch (configuration.state()) {
case QNetworkConfiguration::Undefined:
- QVERIFY(session.state() == QNetworkSession::NotAvailable);
+ QCOMPARE(session.state(), QNetworkSession::NotAvailable);
break;
case QNetworkConfiguration::Defined:
- QVERIFY(session.state() == QNetworkSession::NotAvailable);
+ QCOMPARE(session.state(), QNetworkSession::NotAvailable);
break;
case QNetworkConfiguration::Discovered:
QVERIFY(session.state() == QNetworkSession::Connecting ||
@@ -372,12 +372,12 @@ void tst_QNetworkSession::userChoiceSession()
{
QFETCH(QNetworkConfiguration, configuration);
- QVERIFY(configuration.type() == QNetworkConfiguration::UserChoice);
+ QCOMPARE(configuration.type(), QNetworkConfiguration::UserChoice);
QNetworkSession session(configuration);
// Check that configuration was really set
- QVERIFY(session.configuration() == configuration);
+ QCOMPARE(session.configuration(), configuration);
QVERIFY(!session.isOpen());
@@ -431,7 +431,7 @@ void tst_QNetworkSession::userChoiceSession()
if (expectStateChange)
QTRY_VERIFY_WITH_TIMEOUT(!stateChangedSpy.isEmpty(), TestTimeOut);
- QVERIFY(session.state() == QNetworkSession::Connected);
+ QCOMPARE(session.state(), QNetworkSession::Connected);
#ifndef QT_NO_NETWORKINTERFACE
QVERIFY(session.interface().isValid());
#endif
@@ -462,16 +462,16 @@ void tst_QNetworkSession::userChoiceSession()
manager.configurationFromIdentifier(activeIdentifier);
QVERIFY(activeConfiguration.isValid());
- QVERIFY(activeConfiguration.type() == QNetworkConfiguration::InternetAccessPoint);
+ QCOMPARE(activeConfiguration.type(), QNetworkConfiguration::InternetAccessPoint);
//resetting ActiveConfiguration is ignored (read only property)
session.setSessionProperty("ActiveConfiguration", testIdentifier);
QVERIFY(session.sessionProperty("ActiveConfiguration").toString() != testIdentifier);
if (userChoiceConfiguration.type() == QNetworkConfiguration::InternetAccessPoint) {
- QVERIFY(userChoiceConfiguration == activeConfiguration);
+ QCOMPARE(userChoiceConfiguration, activeConfiguration);
} else {
- QVERIFY(userChoiceConfiguration.type() == QNetworkConfiguration::ServiceNetwork);
+ QCOMPARE(userChoiceConfiguration.type(), QNetworkConfiguration::ServiceNetwork);
QVERIFY(userChoiceConfiguration.children().contains(activeConfiguration));
}
} else {
@@ -500,18 +500,21 @@ void tst_QNetworkSession::sessionOpenCloseStop()
{
QFETCH(QNetworkConfiguration, configuration);
QFETCH(bool, forceSessionStop);
+#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
+ QSKIP("Deadlocks on Linux due to QTBUG-45655");
+#endif
QNetworkSession session(configuration);
// Test initial state of the session.
{
- QVERIFY(session.configuration() == configuration);
+ QCOMPARE(session.configuration(), configuration);
QVERIFY(!session.isOpen());
// session may be invalid if configuration is removed between when
// sessionOpenCloseStop_data() is called and here.
QVERIFY((configuration.isValid() && (session.state() != QNetworkSession::Invalid)) ||
(!configuration.isValid() && (session.state() == QNetworkSession::Invalid)));
- QVERIFY(session.error() == QNetworkSession::UnknownSessionError);
+ QCOMPARE(session.error(), QNetworkSession::UnknownSessionError);
}
// The remaining tests require the session to be not NotAvailable.
@@ -541,7 +544,7 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QNetworkSession::SessionError error =
qvariant_cast<QNetworkSession::SessionError>(errorSpy.first().at(0));
- QVERIFY(session.state() == previousState);
+ QCOMPARE(session.state(), previousState);
if (error == QNetworkSession::OperationNotSupportedError) {
// The session needed to bring up the interface,
@@ -571,13 +574,13 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QNetworkSession::State state =
qvariant_cast<QNetworkSession::State>(stateChangedSpy.at(0).at(0));
- QVERIFY(state == QNetworkSession::Connecting);
+ QCOMPARE(state, QNetworkSession::Connecting);
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy.at(1).at(0));
- QVERIFY(state == QNetworkSession::Connected);
+ QCOMPARE(state, QNetworkSession::Connected);
}
- QVERIFY(session.state() == QNetworkSession::Connected);
+ QCOMPARE(session.state(), QNetworkSession::Connected);
#ifndef QT_NO_NETWORKINTERFACE
QVERIFY(session.interface().isValid());
#endif
@@ -600,10 +603,10 @@ void tst_QNetworkSession::sessionOpenCloseStop()
// Test opening a second session.
{
- QVERIFY(session2.configuration() == configuration);
+ QCOMPARE(session2.configuration(), configuration);
QVERIFY(!session2.isOpen());
- QVERIFY(session2.state() == QNetworkSession::Connected);
- QVERIFY(session.error() == QNetworkSession::UnknownSessionError);
+ QCOMPARE(session2.state(), QNetworkSession::Connected);
+ QCOMPARE(session.error(), QNetworkSession::UnknownSessionError);
session2.open();
@@ -611,10 +614,10 @@ void tst_QNetworkSession::sessionOpenCloseStop()
if (errorSpy2.isEmpty()) {
QVERIFY(session2.isOpen());
- QVERIFY(session2.state() == QNetworkSession::Connected);
+ QCOMPARE(session2.state(), QNetworkSession::Connected);
}
QVERIFY(session.isOpen());
- QVERIFY(session.state() == QNetworkSession::Connected);
+ QCOMPARE(session.state(), QNetworkSession::Connected);
#ifndef QT_NO_NETWORKINTERFACE
QVERIFY(session.interface().isValid());
if (errorSpy2.isEmpty()) {
@@ -648,8 +651,8 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QNetworkSession::SessionError error2 =
qvariant_cast<QNetworkSession::SessionError>(errorSpy2.first().at(0));
- QVERIFY(error == QNetworkSession::SessionAbortedError);
- QVERIFY(error2 == QNetworkSession::SessionAbortedError);
+ QCOMPARE(error, QNetworkSession::SessionAbortedError);
+ QCOMPARE(error2, QNetworkSession::SessionAbortedError);
QCOMPARE(errorSpy.count(), 1);
QCOMPARE(errorSpy2.count(), 1);
@@ -668,8 +671,8 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QTRY_VERIFY_WITH_TIMEOUT(stateChangedSpy2.count() >= 1 || !errorSpy2.isEmpty(), TestTimeOut);
if (!errorSpy2.isEmpty()) {
- QVERIFY(session2.state() == previousState);
- QVERIFY(session.state() == previousState);
+ QCOMPARE(session2.state(), previousState);
+ QCOMPARE(session.state(), previousState);
QNetworkSession::SessionError error =
qvariant_cast<QNetworkSession::SessionError>(errorSpy2.first().at(0));
@@ -697,22 +700,22 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QNetworkSession::State state;
if (stateChangedSpy2.count() == 4) {
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(0).at(0));
- QVERIFY(state == QNetworkSession::Connecting);
+ QCOMPARE(state, QNetworkSession::Connecting);
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(1).at(0));
- QVERIFY(state == QNetworkSession::Connected);
+ QCOMPARE(state, QNetworkSession::Connected);
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(2).at(0));
- QVERIFY(state == QNetworkSession::Closing);
+ QCOMPARE(state, QNetworkSession::Closing);
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(3).at(0));
- QVERIFY(state == QNetworkSession::Disconnected);
+ QCOMPARE(state, QNetworkSession::Disconnected);
} else if (stateChangedSpy2.count() == 2) {
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(0).at(0));
- QVERIFY(state == QNetworkSession::Closing);
+ QCOMPARE(state, QNetworkSession::Closing);
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(1).at(0));
- QVERIFY(state == QNetworkSession::Disconnected);
+ QCOMPARE(state, QNetworkSession::Disconnected);
} else {
QFAIL("Unexpected amount of state changes when roaming.");
}
@@ -748,7 +751,7 @@ void tst_QNetworkSession::sessionOpenCloseStop()
if (stateChangedSpy.count() > 1) {
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy.at(stateChangedSpy.count() - 2).at(0));
- QVERIFY(state == QNetworkSession::Roaming);
+ QCOMPARE(state, QNetworkSession::Roaming);
}
roamedSuccessfully = true;
}
@@ -776,9 +779,9 @@ void tst_QNetworkSession::sessionOpenCloseStop()
if (stateChangedSpy2.count() == 2) {
QNetworkSession::State state =
qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(0).at(0));
- QVERIFY(state == QNetworkSession::Closing);
+ QCOMPARE(state, QNetworkSession::Closing);
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(1).at(0));
- QVERIFY(state == QNetworkSession::Disconnected);
+ QCOMPARE(state, QNetworkSession::Disconnected);
} else {
QVERIFY(stateChangedSpy2.count() >= 1);
@@ -791,7 +794,7 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QNetworkSession::State state =
qvariant_cast<QNetworkSession::State>(stateChangedSpy2.at(stateChangedSpy2.count() - 1).at(0));
- QVERIFY(state == QNetworkSession::Disconnected);
+ QCOMPARE(state, QNetworkSession::Disconnected);
}
}
@@ -818,14 +821,14 @@ void tst_QNetworkSession::sessionOpenCloseStop()
session2.close();
QTRY_VERIFY_WITH_TIMEOUT(!sessionClosedSpy2.isEmpty(), TestTimeOut);
- QVERIFY(stateChangedSpy2.count() == stateChangedCountBeforeClose);
+ QCOMPARE(stateChangedSpy2.count(), stateChangedCountBeforeClose);
QVERIFY(sessionClosedSpy.isEmpty());
QVERIFY(session.isOpen());
QVERIFY(!session2.isOpen());
- QVERIFY(session.state() == QNetworkSession::Connected);
- QVERIFY(session2.state() == QNetworkSession::Connected);
+ QCOMPARE(session.state(), QNetworkSession::Connected);
+ QCOMPARE(session2.state(), QNetworkSession::Connected);
#ifndef QT_NO_NETWORKINTERFACE
QVERIFY(session.interface().isValid());
QCOMPARE(session.interface().hardwareAddress(), session2.interface().hardwareAddress());
@@ -1233,7 +1236,7 @@ void tst_QNetworkSession::sessionAutoClose()
QNetworkSession session(configuration);
- QVERIFY(session.configuration() == configuration);
+ QCOMPARE(session.configuration(), configuration);
QVariant autoCloseSession = session.sessionProperty(QLatin1String("AutoCloseSessionTimeout"));
@@ -1259,7 +1262,7 @@ void tst_QNetworkSession::sessionAutoClose()
QVERIFY(!session.isOpen());
- QVERIFY(session.configuration() == configuration);
+ QCOMPARE(session.configuration(), configuration);
autoCloseSession = session.sessionProperty(QLatin1String("AutoCloseSessionTimeout"));
diff --git a/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp b/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp
index f6b7dfa3af..026a2a2722 100644
--- a/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp
+++ b/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp
@@ -82,7 +82,7 @@ void tst_QAuthenticator::basicAuth()
QAuthenticator auth;
auth.detach();
QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(auth);
- QVERIFY(priv->phase == QAuthenticatorPrivate::Start);
+ QCOMPARE(priv->phase, QAuthenticatorPrivate::Start);
QList<QPair<QByteArray, QByteArray> > headers;
headers << qMakePair<QByteArray, QByteArray>(QByteArray("WWW-Authenticate"), "Basic " + data.toUtf8());
@@ -94,7 +94,7 @@ void tst_QAuthenticator::basicAuth()
auth.setUser(user);
auth.setPassword(password);
- QVERIFY(priv->phase == QAuthenticatorPrivate::Start);
+ QCOMPARE(priv->phase, QAuthenticatorPrivate::Start);
QCOMPARE(priv->calculateResponse("GET", "/").constData(), QByteArray("Basic " + expectedReply).constData());
}
@@ -125,7 +125,7 @@ void tst_QAuthenticator::ntlmAuth()
auth.detach();
QAuthenticatorPrivate *priv = QAuthenticatorPrivate::getPrivate(auth);
- QVERIFY(priv->phase == QAuthenticatorPrivate::Start);
+ QCOMPARE(priv->phase, QAuthenticatorPrivate::Start);
QList<QPair<QByteArray, QByteArray> > headers;
diff --git a/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp b/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp
index ef24cbf3c8..8069865d93 100644
--- a/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp
+++ b/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp
@@ -83,22 +83,12 @@ private slots:
void isInSubnet();
void isLoopback_data();
void isLoopback();
+ void isMulticast_data();
+ void isMulticast();
void convertv4v6_data();
void convertv4v6();
};
-QT_BEGIN_NAMESPACE
-namespace QTest {
- template<>
- char *toString(const QHostAddress &addr)
- {
- if (addr.protocol() == QAbstractSocket::UnknownNetworkLayerProtocol)
- return qstrdup("<invalid>");
- return qstrdup(addr.toString().toLatin1());
- }
-}
-QT_END_NAMESPACE
-
tst_QHostAddress::tst_QHostAddress()
{
}
@@ -234,7 +224,7 @@ void tst_QHostAddress::setAddress_QString()
QFETCH(int, protocol);
QHostAddress hostAddr;
- QVERIFY(hostAddr.setAddress(address) == ok);
+ QCOMPARE(hostAddr.setAddress(address), ok);
if (ok)
QTEST(hostAddr.toString(), "resAddr");
@@ -316,7 +306,7 @@ void tst_QHostAddress::compare_data()
QTest::newRow("6") << QHostAddress(QHostAddress::LocalHost) << QHostAddress(QHostAddress::LocalHostIPv6) << false;
QTest::newRow("7") << QHostAddress() << QHostAddress(QHostAddress::LocalHostIPv6) << false;
- Q_IPV6ADDR localhostv4mapped = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 127, 0, 0, 1 };
+ Q_IPV6ADDR localhostv4mapped = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 127, 0, 0, 1 } };
QTest::newRow("v4-v4mapped") << QHostAddress(QHostAddress::LocalHost) << QHostAddress("::ffff:127.0.0.1") << false;
QTest::newRow("v4-v4mapped-2") << QHostAddress(QHostAddress::LocalHost) << QHostAddress(localhostv4mapped) << false;
}
@@ -330,7 +320,7 @@ void tst_QHostAddress::compare()
QCOMPARE(first == second, result);
QCOMPARE(second == first, result);
if (result == true)
- QVERIFY(qHash(first) == qHash(second));
+ QCOMPARE(qHash(first), qHash(second));
}
void tst_QHostAddress::assignment()
@@ -399,11 +389,11 @@ void tst_QHostAddress::streaming()
QByteArray ba;
QDataStream ds1(&ba, QIODevice::WriteOnly);
ds1 << address;
- QVERIFY(ds1.status() == QDataStream::Ok);
+ QCOMPARE(ds1.status(), QDataStream::Ok);
QDataStream ds2(&ba, QIODevice::ReadOnly);
QHostAddress address2;
ds2 >> address2;
- QVERIFY(ds2.status() == QDataStream::Ok);
+ QCOMPARE(ds2.status(), QDataStream::Ok);
QCOMPARE(address, address2);
}
@@ -631,6 +621,9 @@ void tst_QHostAddress::isLoopback_data()
QTest::addColumn<QHostAddress>("address");
QTest::addColumn<bool>("result");
+ QTest::newRow("default") << QHostAddress() << false;
+ QTest::newRow("invalid") << QHostAddress("&&&") << false;
+
QTest::newRow("ipv6_loop") << QHostAddress(QHostAddress::LocalHostIPv6) << true;
QTest::newRow("::1") << QHostAddress("::1") << true;
@@ -639,7 +632,6 @@ void tst_QHostAddress::isLoopback_data()
QTest::newRow("127.0.0.2") << QHostAddress("127.0.0.2") << true;
QTest::newRow("127.3.2.1") << QHostAddress("127.3.2.1") << true;
- QTest::newRow("default") << QHostAddress() << false;
QTest::newRow("1.2.3.4") << QHostAddress("1.2.3.4") << false;
QTest::newRow("10.0.0.4") << QHostAddress("10.0.0.4") << false;
QTest::newRow("192.168.3.4") << QHostAddress("192.168.3.4") << false;
@@ -650,10 +642,12 @@ void tst_QHostAddress::isLoopback_data()
QTest::newRow("AnyIPv6") << QHostAddress(QHostAddress::AnyIPv6) << false;
QTest::newRow("Broadcast") << QHostAddress(QHostAddress::Broadcast) << false;
QTest::newRow("Null") << QHostAddress(QHostAddress::Null) << false;
+ QTest::newRow("ipv6-all-ffff") << QHostAddress("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff") << false;
QTest::newRow("::ffff:127.0.0.1") << QHostAddress("::ffff:127.0.0.1") << true;
QTest::newRow("::ffff:127.0.0.2") << QHostAddress("::ffff:127.0.0.2") << true;
QTest::newRow("::ffff:127.3.2.1") << QHostAddress("::ffff:127.3.2.1") << true;
+
}
void tst_QHostAddress::isLoopback()
@@ -664,6 +658,50 @@ void tst_QHostAddress::isLoopback()
QCOMPARE(address.isLoopback(), result);
}
+void tst_QHostAddress::isMulticast_data()
+{
+ QTest::addColumn<QHostAddress>("address");
+ QTest::addColumn<bool>("result");
+
+ QTest::newRow("default") << QHostAddress() << false;
+ QTest::newRow("invalid") << QHostAddress("&&&") << false;
+
+ QTest::newRow("ipv6_loop") << QHostAddress(QHostAddress::LocalHostIPv6) << false;
+ QTest::newRow("::1") << QHostAddress("::1") << false;
+ QTest::newRow("ipv4_loop") << QHostAddress(QHostAddress::LocalHost) << false;
+ QTest::newRow("127.0.0.1") << QHostAddress("127.0.0.1") << false;
+ QTest::newRow("::") << QHostAddress("::") << false;
+ QTest::newRow("Any") << QHostAddress(QHostAddress::Any) << false;
+ QTest::newRow("AnyIPv4") << QHostAddress(QHostAddress::AnyIPv4) << false;
+ QTest::newRow("AnyIPv6") << QHostAddress(QHostAddress::AnyIPv6) << false;
+ QTest::newRow("Broadcast") << QHostAddress(QHostAddress::Broadcast) << false;
+ QTest::newRow("Null") << QHostAddress(QHostAddress::Null) << false;
+
+ QTest::newRow("223.255.255.255") << QHostAddress("223.255.255.255") << false;
+ QTest::newRow("224.0.0.0") << QHostAddress("224.0.0.0") << true;
+ QTest::newRow("239.255.255.255") << QHostAddress("239.255.255.255") << true;
+ QTest::newRow("240.0.0.0") << QHostAddress("240.0.0.0") << false;
+
+ QTest::newRow("::ffff:223.255.255.255") << QHostAddress("::ffff:223.255.255.255") << false;
+ QTest::newRow("::ffff:224.0.0.0") << QHostAddress("::ffff:224.0.0.0") << true;
+ QTest::newRow("::ffff:239.255.255.255") << QHostAddress("::ffff:239.255.255.255") << true;
+ QTest::newRow("::ffff:240.0.0.0") << QHostAddress("::ffff:240.0.0.0") << false;
+
+ QTest::newRow("fc00::") << QHostAddress("fc00::") << false;
+ QTest::newRow("fe80::") << QHostAddress("fe80::") << false;
+ QTest::newRow("fec0::") << QHostAddress("fec0::") << false;
+ QTest::newRow("ff00::") << QHostAddress("ff00::") << true;
+ QTest::newRow("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff") << QHostAddress("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff") << true;
+}
+
+void tst_QHostAddress::isMulticast()
+{
+ QFETCH(QHostAddress, address);
+ QFETCH(bool, result);
+
+ QCOMPARE(address.isMulticast(), result);
+}
+
void tst_QHostAddress::convertv4v6_data()
{
QTest::addColumn<QHostAddress>("source");
diff --git a/tests/auto/network/kernel/qhostinfo/qhostinfo.pro b/tests/auto/network/kernel/qhostinfo/qhostinfo.pro
index c9b795d098..12858c97ee 100644
--- a/tests/auto/network/kernel/qhostinfo/qhostinfo.pro
+++ b/tests/auto/network/kernel/qhostinfo/qhostinfo.pro
@@ -14,3 +14,5 @@ wince {
# needed for getaddrinfo with official MinGW
mingw:DEFINES += _WIN32_WINNT=0x0501
+
+winrt: WINRT_MANIFEST.capabilities += internetClientServer
diff --git a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
index 599e475beb..5f0addba98 100644
--- a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
+++ b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
@@ -561,13 +561,13 @@ void tst_QHostInfo::cache()
QHostInfo result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid, &id);
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
- QVERIFY(valid == false);
+ QVERIFY(!valid);
QVERIFY(result.addresses().isEmpty());
// loopkup second time, result should come directly
valid = false;
result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid, &id);
- QVERIFY(valid == true);
+ QVERIFY(valid);
QVERIFY(!result.addresses().isEmpty());
// clear the cache
@@ -578,7 +578,7 @@ void tst_QHostInfo::cache()
result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid, &id);
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
- QVERIFY(valid == false);
+ QVERIFY(!valid);
QVERIFY(result.addresses().isEmpty());
// the slot should have been called 2 times.
diff --git a/tests/auto/network/kernel/qnetworkaddressentry/tst_qnetworkaddressentry.cpp b/tests/auto/network/kernel/qnetworkaddressentry/tst_qnetworkaddressentry.cpp
index d88b2e222c..cca670e13a 100644
--- a/tests/auto/network/kernel/qnetworkaddressentry/tst_qnetworkaddressentry.cpp
+++ b/tests/auto/network/kernel/qnetworkaddressentry/tst_qnetworkaddressentry.cpp
@@ -76,7 +76,7 @@ void tst_QNetworkAddressEntry::getSetCheck()
entry = entry2;
QCOMPARE(entry, entry2);
- QVERIFY(entry == entry);
+ QCOMPARE(entry, entry);
QVERIFY(!(entry != entry2));
}
diff --git a/tests/auto/network/kernel/qnetworkinterface/BLACKLIST b/tests/auto/network/kernel/qnetworkinterface/BLACKLIST
new file mode 100644
index 0000000000..23bb688d9a
--- /dev/null
+++ b/tests/auto/network/kernel/qnetworkinterface/BLACKLIST
@@ -0,0 +1,2 @@
+[localAddress]
+linux
diff --git a/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp b/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp
index b3ffe74b67..519ee0dc84 100644
--- a/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp
+++ b/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp
@@ -55,9 +55,11 @@ private slots:
void initTestCase();
void cleanupTestCase();
void dump();
+ void consistencyCheck();
void loopbackIPv4();
void loopbackIPv6();
void localAddress();
+ void interfaceFromXXX_data();
void interfaceFromXXX();
void copyInvalidInterface();
@@ -147,6 +149,24 @@ void tst_QNetworkInterface::dump()
}
}
+void tst_QNetworkInterface::consistencyCheck()
+{
+ QList<QNetworkInterface> ifaces = QNetworkInterface::allInterfaces();
+ QSet<QString> interfaceNames;
+ QVector<int> interfaceIndexes;
+
+ foreach (const QNetworkInterface &iface, ifaces) {
+ QVERIFY2(!interfaceNames.contains(iface.name()),
+ "duplicate name = " + iface.name().toLocal8Bit());
+ interfaceNames << iface.name();
+
+ QVERIFY2(!interfaceIndexes.contains(iface.index()),
+ "duplicate index = " + QByteArray::number(iface.index()));
+ if (iface.index())
+ interfaceIndexes << iface.index();
+ }
+}
+
void tst_QNetworkInterface::loopbackIPv4()
{
QList<QHostAddress> all = QNetworkInterface::allAddresses();
@@ -188,35 +208,42 @@ void tst_QNetworkInterface::localAddress()
QVERIFY(all.contains(local));
}
-void tst_QNetworkInterface::interfaceFromXXX()
+void tst_QNetworkInterface::interfaceFromXXX_data()
{
+ QTest::addColumn<QNetworkInterface>("iface");
+
QList<QNetworkInterface> allInterfaces = QNetworkInterface::allInterfaces();
+ foreach (QNetworkInterface iface, allInterfaces)
+ QTest::newRow(iface.name().toLocal8Bit()) << iface;
+}
+
+void tst_QNetworkInterface::interfaceFromXXX()
+{
+ QFETCH(QNetworkInterface, iface);
- foreach (QNetworkInterface iface, allInterfaces) {
- QVERIFY(QNetworkInterface::interfaceFromName(iface.name()).isValid());
- foreach (QNetworkAddressEntry entry, iface.addressEntries()) {
- QVERIFY(!entry.ip().isNull());
+ QVERIFY(QNetworkInterface::interfaceFromName(iface.name()).isValid());
+ foreach (QNetworkAddressEntry entry, iface.addressEntries()) {
+ QVERIFY(!entry.ip().isNull());
- if (!entry.netmask().isNull()) {
- QCOMPARE(entry.netmask().protocol(), entry.ip().protocol());
+ if (!entry.netmask().isNull()) {
+ QCOMPARE(entry.netmask().protocol(), entry.ip().protocol());
- // if the netmask is known, the broadcast is known
- // but only for IPv4 (there is no such thing as broadcast in IPv6)
- if (entry.ip().protocol() == QAbstractSocket::IPv4Protocol) {
- QVERIFY(!entry.broadcast().isNull());
+ // if the netmask is known, the broadcast is known
+ // but only for IPv4 (there is no such thing as broadcast in IPv6)
+ if (entry.ip().protocol() == QAbstractSocket::IPv4Protocol) {
+ QVERIFY(!entry.broadcast().isNull());
- // verify that the broadcast address is correct
- quint32 ip = entry.ip().toIPv4Address();
- quint32 mask = entry.netmask().toIPv4Address();
- quint32 bcast = entry.broadcast().toIPv4Address();
+ // verify that the broadcast address is correct
+ quint32 ip = entry.ip().toIPv4Address();
+ quint32 mask = entry.netmask().toIPv4Address();
+ quint32 bcast = entry.broadcast().toIPv4Address();
- QCOMPARE(bcast, ip | ~mask);
- }
+ QCOMPARE(bcast, ip | ~mask);
}
-
- if (!entry.broadcast().isNull())
- QCOMPARE(entry.broadcast().protocol(), entry.ip().protocol());
}
+
+ if (!entry.broadcast().isNull())
+ QCOMPARE(entry.broadcast().protocol(), entry.ip().protocol());
}
}
diff --git a/tests/auto/network/socket/platformsocketengine/BLACKLIST b/tests/auto/network/socket/platformsocketengine/BLACKLIST
new file mode 100644
index 0000000000..8e1a55995e
--- /dev/null
+++ b/tests/auto/network/socket/platformsocketengine/BLACKLIST
@@ -0,0 +1 @@
+windows
diff --git a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
index 9bd89cdf4f..71125f463a 100644
--- a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
+++ b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
@@ -130,18 +130,18 @@ void tst_PlatformSocketEngine::construction()
// Initialize device
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QVERIFY(socketDevice.isValid());
- QVERIFY(socketDevice.protocol() == QAbstractSocket::IPv4Protocol);
- QVERIFY(socketDevice.socketType() == QAbstractSocket::TcpSocket);
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.protocol(), QAbstractSocket::IPv4Protocol);
+ QCOMPARE(socketDevice.socketType(), QAbstractSocket::TcpSocket);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
QVERIFY(socketDevice.socketDescriptor() != -1);
- QVERIFY(socketDevice.localAddress() == QHostAddress());
- QVERIFY(socketDevice.localPort() == 0);
- QVERIFY(socketDevice.peerAddress() == QHostAddress());
- QVERIFY(socketDevice.peerPort() == 0);
- QVERIFY(socketDevice.error() == QAbstractSocket::UnknownSocketError);
+ QCOMPARE(socketDevice.localAddress(), QHostAddress());
+ QCOMPARE(socketDevice.localPort(), quint16(0));
+ QCOMPARE(socketDevice.peerAddress(), QHostAddress());
+ QCOMPARE(socketDevice.peerPort(), quint16(0));
+ QCOMPARE(socketDevice.error(), QAbstractSocket::UnknownSocketError);
QTest::ignoreMessage(QtWarningMsg, PLATFORMSOCKETENGINESTRING "::bytesAvailable() was called in QAbstractSocket::UnconnectedState");
- QVERIFY(socketDevice.bytesAvailable() == -1);
+ QCOMPARE(socketDevice.bytesAvailable(), -1);
QTest::ignoreMessage(QtWarningMsg, PLATFORMSOCKETENGINESTRING "::hasPendingDatagrams() was called in QAbstractSocket::UnconnectedState");
QVERIFY(!socketDevice.hasPendingDatagrams());
@@ -154,16 +154,16 @@ void tst_PlatformSocketEngine::simpleConnectToIMAP()
// Initialize device
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
const bool isConnected = socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143);
if (!isConnected) {
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectedState);
}
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
- QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP());
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectedState);
+ QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::serverIP());
// Wait for the greeting
QVERIFY(socketDevice.waitForRead());
@@ -200,8 +200,8 @@ void tst_PlatformSocketEngine::simpleConnectToIMAP()
QVERIFY(socketDevice.waitForRead());
char c;
QVERIFY(socketDevice.read(&c, sizeof(c)) == -1);
- QVERIFY(socketDevice.error() == QAbstractSocket::RemoteHostClosedError);
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.error(), QAbstractSocket::RemoteHostClosedError);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
}
//---------------------------------------------------------------------------
@@ -213,13 +213,13 @@ void tst_PlatformSocketEngine::udpLoopbackTest()
QVERIFY(udpSocket.initialize(QAbstractSocket::UdpSocket));
QVERIFY(udpSocket.isValid());
QVERIFY(udpSocket.socketDescriptor() != -1);
- QVERIFY(udpSocket.protocol() == QAbstractSocket::IPv4Protocol);
- QVERIFY(udpSocket.socketType() == QAbstractSocket::UdpSocket);
- QVERIFY(udpSocket.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(udpSocket.protocol(), QAbstractSocket::IPv4Protocol);
+ QCOMPARE(udpSocket.socketType(), QAbstractSocket::UdpSocket);
+ QCOMPARE(udpSocket.state(), QAbstractSocket::UnconnectedState);
// Bind #1 to localhost
QVERIFY(udpSocket.bind(QHostAddress("127.0.0.1"), 0));
- QVERIFY(udpSocket.state() == QAbstractSocket::BoundState);
+ QCOMPARE(udpSocket.state(), QAbstractSocket::BoundState);
quint16 port = udpSocket.localPort();
QVERIFY(port != 0);
@@ -229,7 +229,7 @@ void tst_PlatformSocketEngine::udpLoopbackTest()
// Connect device #2 to #1
QVERIFY(udpSocket2.connectToHost(QHostAddress("127.0.0.1"), port));
- QVERIFY(udpSocket2.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(udpSocket2.state(), QAbstractSocket::ConnectedState);
// Write a message to #1
QByteArray message1 = "hei der";
@@ -243,13 +243,13 @@ void tst_PlatformSocketEngine::udpLoopbackTest()
QVERIFY(available > 0);
QByteArray answer;
answer.resize(available);
- QHostAddress senderAddress;
- quint16 senderPort = 0;
- QVERIFY(udpSocket.readDatagram(answer.data(), answer.size(),
- &senderAddress,
- &senderPort) == message1.size());
- QVERIFY(senderAddress == QHostAddress("127.0.0.1"));
- QVERIFY(senderPort != 0);
+ QIpPacketHeader header;
+ QCOMPARE(udpSocket.readDatagram(answer.data(), answer.size(),
+ &header, QAbstractSocketEngine::WantDatagramSender),
+ qint64(message1.size()));
+ QVERIFY(header.senderAddress == QHostAddress("127.0.0.1"));
+ QCOMPARE(header.senderAddress, QHostAddress("127.0.0.1"));
+ QVERIFY(header.senderPort != 0);
}
//---------------------------------------------------------------------------
@@ -261,13 +261,13 @@ void tst_PlatformSocketEngine::udpIPv6LoopbackTest()
bool init = udpSocket.initialize(QAbstractSocket::UdpSocket, QAbstractSocket::IPv6Protocol);
if (!init) {
- QVERIFY(udpSocket.error() == QAbstractSocket::UnsupportedSocketOperationError);
+ QCOMPARE(udpSocket.error(), QAbstractSocket::UnsupportedSocketOperationError);
} else {
- QVERIFY(udpSocket.protocol() == QAbstractSocket::IPv6Protocol);
+ QCOMPARE(udpSocket.protocol(), QAbstractSocket::IPv6Protocol);
// Bind #1 to localhost
QVERIFY(udpSocket.bind(QHostAddress("::1"), 0));
- QVERIFY(udpSocket.state() == QAbstractSocket::BoundState);
+ QCOMPARE(udpSocket.state(), QAbstractSocket::BoundState);
quint16 port = udpSocket.localPort();
QVERIFY(port != 0);
@@ -277,7 +277,7 @@ void tst_PlatformSocketEngine::udpIPv6LoopbackTest()
// Connect device #2 to #1
QVERIFY(udpSocket2.connectToHost(QHostAddress("::1"), port));
- QVERIFY(udpSocket2.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(udpSocket2.state(), QAbstractSocket::ConnectedState);
// Write a message to #1
QByteArray message1 = "hei der";
@@ -291,13 +291,13 @@ void tst_PlatformSocketEngine::udpIPv6LoopbackTest()
QVERIFY(available > 0);
QByteArray answer;
answer.resize(available);
- QHostAddress senderAddress;
- quint16 senderPort = 0;
- QVERIFY(udpSocket.readDatagram(answer.data(), answer.size(),
- &senderAddress,
- &senderPort) == message1.size());
- QVERIFY(senderAddress == QHostAddress("::1"));
- QVERIFY(senderPort != 0);
+ QIpPacketHeader header;
+ QCOMPARE(udpSocket.readDatagram(answer.data(), answer.size(),
+ &header, QAbstractSocketEngine::WantDatagramSender),
+ qint64(message1.size()));
+ QVERIFY(header.senderAddress == QHostAddress("::1"));
+ QCOMPARE(header.senderAddress, QHostAddress("::1"));
+ QVERIFY(header.senderPort != 0);
}
}
@@ -314,7 +314,7 @@ void tst_PlatformSocketEngine::broadcastTest()
// Bind to any port on all interfaces
QVERIFY(broadcastSocket.bind(QHostAddress::Any, 0));
- QVERIFY(broadcastSocket.state() == QAbstractSocket::BoundState);
+ QCOMPARE(broadcastSocket.state(), QAbstractSocket::BoundState);
quint16 port = broadcastSocket.localPort();
QVERIFY(port > 0);
@@ -323,9 +323,9 @@ void tst_PlatformSocketEngine::broadcastTest()
= "MOOT wtf is a MOOT? talk english not your sutpiD ENGLISH.";
qint64 written = broadcastSocket.writeDatagram(trollMessage.data(),
trollMessage.size(),
- QHostAddress::Broadcast,
- port);
+ QIpPacketHeader(QHostAddress::Broadcast, port));
+ QVERIFY2(written != -1, qt_error_string().toLocal8Bit());
QCOMPARE((int)written, trollMessage.size());
// Wait until we receive it ourselves
@@ -354,20 +354,20 @@ void tst_PlatformSocketEngine::serverTest()
// Bind to any port on all interfaces
QVERIFY(server.bind(QHostAddress("0.0.0.0"), 0));
- QVERIFY(server.state() == QAbstractSocket::BoundState);
+ QCOMPARE(server.state(), QAbstractSocket::BoundState);
quint16 port = server.localPort();
// Listen for incoming connections
QVERIFY(server.listen());
- QVERIFY(server.state() == QAbstractSocket::ListeningState);
+ QCOMPARE(server.state(), QAbstractSocket::ListeningState);
// Initialize a Tcp socket
PLATFORMSOCKETENGINE client;
QVERIFY(client.initialize(QAbstractSocket::TcpSocket));
if (!client.connectToHost(QHostAddress("127.0.0.1"), port)) {
- QVERIFY(client.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectingState);
QVERIFY(client.waitForWrite());
- QVERIFY(client.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectedState);
}
// The server accepts the connection
@@ -378,7 +378,7 @@ void tst_PlatformSocketEngine::serverTest()
// socket descriptor from accept(). It's pre-connected.
PLATFORMSOCKETENGINE serverSocket;
QVERIFY(serverSocket.initialize(socketDescriptor));
- QVERIFY(serverSocket.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(serverSocket.state(), QAbstractSocket::ConnectedState);
// The server socket sends a greeting to the clietn
QByteArray greeting = "Greetings!";
@@ -407,13 +407,13 @@ void tst_PlatformSocketEngine::udpLoopbackPerformance()
QVERIFY(udpSocket.initialize(QAbstractSocket::UdpSocket));
QVERIFY(udpSocket.isValid());
QVERIFY(udpSocket.socketDescriptor() != -1);
- QVERIFY(udpSocket.protocol() == QAbstractSocket::IPv4Protocol);
- QVERIFY(udpSocket.socketType() == QAbstractSocket::UdpSocket);
- QVERIFY(udpSocket.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(udpSocket.protocol(), QAbstractSocket::IPv4Protocol);
+ QCOMPARE(udpSocket.socketType(), QAbstractSocket::UdpSocket);
+ QCOMPARE(udpSocket.state(), QAbstractSocket::UnconnectedState);
// Bind #1 to localhost
QVERIFY(udpSocket.bind(QHostAddress("127.0.0.1"), 0));
- QVERIFY(udpSocket.state() == QAbstractSocket::BoundState);
+ QCOMPARE(udpSocket.state(), QAbstractSocket::BoundState);
quint16 port = udpSocket.localPort();
QVERIFY(port != 0);
@@ -423,7 +423,7 @@ void tst_PlatformSocketEngine::udpLoopbackPerformance()
// Connect device #2 to #1
QVERIFY(udpSocket2.connectToHost(QHostAddress("127.0.0.1"), port));
- QVERIFY(udpSocket2.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(udpSocket2.state(), QAbstractSocket::ConnectedState);
const int messageSize = 8192;
QByteArray message1(messageSize, '@');
@@ -459,12 +459,12 @@ void tst_PlatformSocketEngine::tcpLoopbackPerformance()
// Bind to any port on all interfaces
QVERIFY(server.bind(QHostAddress("0.0.0.0"), 0));
- QVERIFY(server.state() == QAbstractSocket::BoundState);
+ QCOMPARE(server.state(), QAbstractSocket::BoundState);
quint16 port = server.localPort();
// Listen for incoming connections
QVERIFY(server.listen());
- QVERIFY(server.state() == QAbstractSocket::ListeningState);
+ QCOMPARE(server.state(), QAbstractSocket::ListeningState);
// Initialize a Tcp socket
PLATFORMSOCKETENGINE client;
@@ -472,9 +472,9 @@ void tst_PlatformSocketEngine::tcpLoopbackPerformance()
// Connect to our server
if (!client.connectToHost(QHostAddress("127.0.0.1"), port)) {
- QVERIFY(client.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectingState);
QVERIFY(client.waitForWrite());
- QVERIFY(client.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectedState);
}
// The server accepts the connection
@@ -485,7 +485,7 @@ void tst_PlatformSocketEngine::tcpLoopbackPerformance()
// socket descriptor from accept(). It's pre-connected.
PLATFORMSOCKETENGINE serverSocket;
QVERIFY(serverSocket.initialize(socketDescriptor));
- QVERIFY(serverSocket.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(serverSocket.state(), QAbstractSocket::ConnectedState);
const int messageSize = 1024 * 256;
QByteArray message1(messageSize, '@');
@@ -562,7 +562,7 @@ void tst_PlatformSocketEngine::bind()
PLATFORMSOCKETENGINE binder;
QVERIFY(binder.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QVERIFY(!binder.bind(QHostAddress::AnyIPv4, 82));
- QVERIFY(binder.error() == QAbstractSocket::SocketAccessError);
+ QCOMPARE(binder.error(), QAbstractSocket::SocketAccessError);
#endif
PLATFORMSOCKETENGINE binder2;
@@ -572,7 +572,7 @@ void tst_PlatformSocketEngine::bind()
PLATFORMSOCKETENGINE binder3;
QVERIFY(binder3.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QVERIFY(!binder3.bind(QHostAddress::AnyIPv4, 31180));
- QVERIFY(binder3.error() == QAbstractSocket::AddressInUseError);
+ QCOMPARE(binder3.error(), QAbstractSocket::AddressInUseError);
if (QtNetworkSettings::hasIPv6()) {
PLATFORMSOCKETENGINE binder4;
@@ -582,7 +582,7 @@ void tst_PlatformSocketEngine::bind()
PLATFORMSOCKETENGINE binder5;
QVERIFY(binder5.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv6Protocol));
QVERIFY(!binder5.bind(QHostAddress::AnyIPv6, 31180));
- QVERIFY(binder5.error() == QAbstractSocket::AddressInUseError);
+ QCOMPARE(binder5.error(), QAbstractSocket::AddressInUseError);
}
PLATFORMSOCKETENGINE binder6;
@@ -599,11 +599,11 @@ void tst_PlatformSocketEngine::networkError()
const bool isConnected = client.connectToHost(QtNetworkSettings::serverIP(), 143);
if (!isConnected) {
- QVERIFY(client.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectingState);
QVERIFY(client.waitForWrite());
- QVERIFY(client.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectedState);
}
- QVERIFY(client.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectedState);
// An unexpected network error!
#ifdef Q_OS_WINRT
@@ -636,7 +636,7 @@ void tst_PlatformSocketEngine::invalidSend()
QTest::ignoreMessage(QtWarningMsg, PLATFORMSOCKETENGINESTRING "::writeDatagram() was"
" called by a socket other than QAbstractSocket::UdpSocket");
- QCOMPARE(socket.writeDatagram("hei", 3, QHostAddress::LocalHost, 143),
+ QCOMPARE(socket.writeDatagram("hei", 3, QIpPacketHeader(QHostAddress::LocalHost, 143)),
(qlonglong) -1);
}
@@ -650,19 +650,19 @@ void tst_PlatformSocketEngine::receiveUrgentData()
// Bind to any port on all interfaces
QVERIFY(server.bind(QHostAddress("0.0.0.0"), 0));
- QVERIFY(server.state() == QAbstractSocket::BoundState);
+ QCOMPARE(server.state(), QAbstractSocket::BoundState);
quint16 port = server.localPort();
QVERIFY(server.listen());
- QVERIFY(server.state() == QAbstractSocket::ListeningState);
+ QCOMPARE(server.state(), QAbstractSocket::ListeningState);
PLATFORMSOCKETENGINE client;
QVERIFY(client.initialize(QAbstractSocket::TcpSocket));
if (!client.connectToHost(QHostAddress("127.0.0.1"), port)) {
- QVERIFY(client.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectingState);
QVERIFY(client.waitForWrite());
- QVERIFY(client.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectedState);
}
int socketDescriptor = server.accept();
@@ -670,7 +670,7 @@ void tst_PlatformSocketEngine::receiveUrgentData()
PLATFORMSOCKETENGINE serverSocket;
QVERIFY(serverSocket.initialize(socketDescriptor));
- QVERIFY(serverSocket.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(serverSocket.state(), QAbstractSocket::ConnectedState);
char msg;
int available;
diff --git a/tests/auto/network/socket/qabstractsocket/tst_qabstractsocket.cpp b/tests/auto/network/socket/qabstractsocket/tst_qabstractsocket.cpp
index 76c36831bd..1c79b6c016 100644
--- a/tests/auto/network/socket/qabstractsocket/tst_qabstractsocket.cpp
+++ b/tests/auto/network/socket/qabstractsocket/tst_qabstractsocket.cpp
@@ -37,11 +37,6 @@
#include <qcoreapplication.h>
#include <qdebug.h>
#include <qabstractsocket.h>
-#include <qtcpserver.h>
-#include <qtcpsocket.h>
-#ifndef QT_NO_SSL
-#include <qsslsocket.h>
-#endif
class tst_QAbstractSocket : public QObject
{
@@ -52,9 +47,7 @@ public:
virtual ~tst_QAbstractSocket();
private slots:
- void initTestCase();
void getSetCheck();
- void serverDisconnectWithBuffered();
};
tst_QAbstractSocket::tst_QAbstractSocket()
@@ -73,11 +66,6 @@ public:
void setPeerPort(quint16 port) { QAbstractSocket::setPeerPort(port); }
};
-void tst_QAbstractSocket::initTestCase()
-{
- qRegisterMetaType<QAbstractSocket::SocketState>("QAbstractSocket::SocketState");
-}
-
// Testing get/set functions
void tst_QAbstractSocket::getSetCheck()
{
@@ -106,46 +94,5 @@ void tst_QAbstractSocket::getSetCheck()
QCOMPARE(quint16(0xffff), obj1.peerPort());
}
-// Test buffered socket being properly closed on remote disconnect
-void tst_QAbstractSocket::serverDisconnectWithBuffered()
-{
- QTcpServer tcpServer;
-#ifndef QT_NO_SSL
- QSslSocket testSocket;
-#else
- QTcpSocket testSocket;
-#endif
-
- QVERIFY(tcpServer.listen(QHostAddress::LocalHost));
- testSocket.connectToHost(tcpServer.serverAddress(), tcpServer.serverPort());
- // Accept connection on server side
- QVERIFY(tcpServer.waitForNewConnection(5000));
- QTcpSocket *newConnection = tcpServer.nextPendingConnection();
- // Send one char and drop link
- QVERIFY(newConnection != NULL);
- QVERIFY(newConnection->putChar(0));
- QVERIFY(newConnection->flush());
- delete newConnection;
-
- QVERIFY(testSocket.waitForConnected(5000)); // ready for write
- QVERIFY(testSocket.state() == QAbstractSocket::ConnectedState);
-
- QSignalSpy spyStateChanged(&testSocket, SIGNAL(stateChanged(QAbstractSocket::SocketState)));
- QSignalSpy spyDisconnected(&testSocket, SIGNAL(disconnected()));
-
- QVERIFY(testSocket.waitForReadyRead(5000)); // have one char already in internal buffer
- char buf[128];
- QCOMPARE(testSocket.read(buf, sizeof(buf)), Q_INT64_C(1));
- if (testSocket.state() != QAbstractSocket::UnconnectedState) {
- QVERIFY(testSocket.waitForDisconnected(5000));
- QVERIFY(testSocket.state() == QAbstractSocket::UnconnectedState);
- }
- // Test signal emitting
- QVERIFY(spyDisconnected.count() == 1);
- QVERIFY(spyStateChanged.count() > 0);
- QVERIFY(qvariant_cast<QAbstractSocket::SocketState>(spyStateChanged.last().first())
- == QAbstractSocket::UnconnectedState);
-}
-
QTEST_MAIN(tst_QAbstractSocket)
#include "tst_qabstractsocket.moc"
diff --git a/tests/auto/network/socket/qhttpsocketengine/BLACKLIST b/tests/auto/network/socket/qhttpsocketengine/BLACKLIST
new file mode 100644
index 0000000000..8e1a55995e
--- /dev/null
+++ b/tests/auto/network/socket/qhttpsocketengine/BLACKLIST
@@ -0,0 +1 @@
+windows
diff --git a/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp b/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp
index 10e8c95fc0..f6662b6712 100644
--- a/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp
+++ b/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp
@@ -72,6 +72,7 @@ private slots:
void downloadBigFile();
// void tcpLoopbackPerformance();
void passwordAuth();
+ void ensureEofTriggersNotification();
protected slots:
void tcpSocketNonBlocking_hostFound();
@@ -164,18 +165,18 @@ void tst_QHttpSocketEngine::construction()
// Initialize device
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QVERIFY(socketDevice.isValid());
- QVERIFY(socketDevice.protocol() == QAbstractSocket::IPv4Protocol);
- QVERIFY(socketDevice.socketType() == QAbstractSocket::TcpSocket);
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.protocol(), QAbstractSocket::IPv4Protocol);
+ QCOMPARE(socketDevice.socketType(), QAbstractSocket::TcpSocket);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
// QVERIFY(socketDevice.socketDescriptor() != -1);
- QVERIFY(socketDevice.localAddress() == QHostAddress());
- QVERIFY(socketDevice.localPort() == 0);
- QVERIFY(socketDevice.peerAddress() == QHostAddress());
- QVERIFY(socketDevice.peerPort() == 0);
- QVERIFY(socketDevice.error() == QAbstractSocket::UnknownSocketError);
+ QCOMPARE(socketDevice.localAddress(), QHostAddress());
+ QCOMPARE(socketDevice.localPort(), quint16(0));
+ QCOMPARE(socketDevice.peerAddress(), QHostAddress());
+ QCOMPARE(socketDevice.peerPort(), quint16(0));
+ QCOMPARE(socketDevice.error(), QAbstractSocket::UnknownSocketError);
//QTest::ignoreMessage(QtWarningMsg, "QSocketLayer::bytesAvailable() was called in QAbstractSocket::UnconnectedState");
- QVERIFY(socketDevice.bytesAvailable() == 0);
+ QCOMPARE(socketDevice.bytesAvailable(), 0);
//QTest::ignoreMessage(QtWarningMsg, "QSocketLayer::hasPendingDatagrams() was called in QAbstractSocket::UnconnectedState");
QVERIFY(!socketDevice.hasPendingDatagrams());
@@ -299,15 +300,15 @@ void tst_QHttpSocketEngine::simpleConnectToIMAP()
// Initialize device
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128));
QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143));
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
- QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP());
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectedState);
+ QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::serverIP());
QVERIFY(!socketDevice.localAddress().isNull());
QVERIFY(socketDevice.localPort() > 0);
@@ -345,8 +346,8 @@ void tst_QHttpSocketEngine::simpleConnectToIMAP()
QVERIFY(socketDevice.waitForRead());
char c;
QCOMPARE(socketDevice.read(&c, sizeof(c)), (qint64) -1);
- QVERIFY(socketDevice.error() == QAbstractSocket::RemoteHostClosedError);
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.error(), QAbstractSocket::RemoteHostClosedError);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
}
//---------------------------------------------------------------------------
@@ -360,14 +361,14 @@ void tst_QHttpSocketEngine::simpleErrorsAndStates()
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128));
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
QVERIFY(!socketDevice.connectToHost(QHostAddress(QtNetworkSettings::serverName()), 8088));
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
if (socketDevice.waitForWrite(30000)) {
QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState ||
socketDevice.state() == QAbstractSocket::UnconnectedState);
} else {
- QVERIFY(socketDevice.error() == QAbstractSocket::SocketTimeoutError);
+ QCOMPARE(socketDevice.error(), QAbstractSocket::SocketTimeoutError);
}
}
@@ -381,12 +382,12 @@ void tst_QHttpSocketEngine::tcpLoopbackPerformance()
// Bind to any port on all interfaces
QVERIFY(server.bind(QHostAddress("0.0.0.0"), 0));
- QVERIFY(server.state() == QAbstractSocket::BoundState);
+ QCOMPARE(server.state(), QAbstractSocket::BoundState);
quint16 port = server.localPort();
// Listen for incoming connections
QVERIFY(server.listen());
- QVERIFY(server.state() == QAbstractSocket::ListeningState);
+ QCOMPARE(server.state(), QAbstractSocket::ListeningState);
// Initialize a Tcp socket
QHttpSocketEngine client;
@@ -408,7 +409,7 @@ void tst_QHttpSocketEngine::tcpLoopbackPerformance()
// socket descriptor from accept(). It's pre-connected.
QSocketLayer serverSocket;
QVERIFY(serverSocket.initialize(socketDescriptor));
- QVERIFY(serverSocket.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(serverSocket.state(), QAbstractSocket::ConnectedState);
const int messageSize = 1024 * 256;
QByteArray message1(messageSize, '@');
@@ -544,7 +545,7 @@ void tst_QHttpSocketEngine::tcpSocketNonBlockingTest()
QFAIL("Timed out");
}
- QVERIFY(tcpSocketNonBlocking_totalWritten == 8);
+ QCOMPARE(tcpSocketNonBlocking_totalWritten, 8);
QTestEventLoop::instance().enterLoop(30);
@@ -569,7 +570,7 @@ void tst_QHttpSocketEngine::tcpSocketNonBlockingTest()
QFAIL("Timed out");
}
- QVERIFY(tcpSocketNonBlocking_totalWritten == 10);
+ QCOMPARE(tcpSocketNonBlocking_totalWritten, 10);
// Wait for greeting
QTestEventLoop::instance().enterLoop(30);
@@ -637,7 +638,7 @@ void tst_QHttpSocketEngine::downloadBigFile()
QFAIL("Network operation timed out");
QByteArray hostName = QtNetworkSettings::serverName().toLatin1();
- QVERIFY(tmpSocket->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(tmpSocket->state(), QAbstractSocket::ConnectedState);
QVERIFY(tmpSocket->write("GET /qtest/mediumfile HTTP/1.0\r\n") > 0);
QVERIFY(tmpSocket->write("Host: ") > 0);
QVERIFY(tmpSocket->write(hostName.data()) > 0);
@@ -659,7 +660,7 @@ void tst_QHttpSocketEngine::downloadBigFile()
QVERIFY(bytesAvailable >= 10000000);
- QVERIFY(tmpSocket->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(tmpSocket->state(), QAbstractSocket::ConnectedState);
qDebug("\t\t%.1fMB/%.1fs: %.1fMB/s",
bytesAvailable / (1024.0 * 1024.0),
@@ -689,15 +690,15 @@ void tst_QHttpSocketEngine::passwordAuth()
// Initialize device
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128, "qsockstest", "password"));
QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143));
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
- QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP());
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectedState);
+ QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::serverIP());
// Wait for the greeting
QVERIFY(socketDevice.waitForRead());
@@ -733,11 +734,57 @@ void tst_QHttpSocketEngine::passwordAuth()
QVERIFY(socketDevice.waitForRead());
char c;
QVERIFY(socketDevice.read(&c, sizeof(c)) == -1);
- QVERIFY(socketDevice.error() == QAbstractSocket::RemoteHostClosedError);
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.error(), QAbstractSocket::RemoteHostClosedError);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
}
//----------------------------------------------------------------------------------
+void tst_QHttpSocketEngine::ensureEofTriggersNotification()
+{
+ QList<QByteArray> serverData;
+ // Set the handshake and server response data
+ serverData << "HTTP/1.0 200 Connection established\r\n\r\n" << "0";
+ MiniHttpServer server(serverData);
+
+ QTcpSocket socket;
+ connect(&socket, SIGNAL(connected()), SLOT(exitLoopSlot()));
+ socket.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, server.serverAddress().toString(),
+ server.serverPort()));
+ socket.connectToHost("0.1.2.3", 12345);
+
+ QTestEventLoop::instance().enterLoop(5);
+ if (QTestEventLoop::instance().timeout())
+ QFAIL("Connect timed out");
+
+ QCOMPARE(socket.state(), QTcpSocket::ConnectedState);
+ // Disable read notification on server response
+ socket.setReadBufferSize(1);
+ socket.putChar(0);
+
+ // Wait for the response
+ connect(&socket, SIGNAL(readyRead()), SLOT(exitLoopSlot()));
+ QTestEventLoop::instance().enterLoop(5);
+ if (QTestEventLoop::instance().timeout())
+ QFAIL("Read timed out");
+
+ QCOMPARE(socket.state(), QTcpSocket::ConnectedState);
+ QCOMPARE(socket.bytesAvailable(), 1);
+ // Trigger a read notification
+ socket.readAll();
+ // Check for pending EOF at input
+ QCOMPARE(socket.bytesAvailable(), 0);
+ QCOMPARE(socket.state(), QTcpSocket::ConnectedState);
+
+ // Try to read EOF
+ connect(&socket, SIGNAL(disconnected()), SLOT(exitLoopSlot()));
+ QTestEventLoop::instance().enterLoop(5);
+ if (QTestEventLoop::instance().timeout())
+ QFAIL("Disconnect timed out");
+
+ // Check that it's closed
+ QCOMPARE(socket.state(), QTcpSocket::UnconnectedState);
+}
+
QTEST_MAIN(tst_QHttpSocketEngine)
#include "tst_qhttpsocketengine.moc"
diff --git a/tests/auto/network/socket/qlocalsocket/BLACKLIST b/tests/auto/network/socket/qlocalsocket/BLACKLIST
new file mode 100644
index 0000000000..11ddef30a5
--- /dev/null
+++ b/tests/auto/network/socket/qlocalsocket/BLACKLIST
@@ -0,0 +1,2 @@
+[processConnection:1 client]
+windows
diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
index 9130aff4e2..d7480a4109 100644
--- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
@@ -247,8 +247,8 @@ void tst_QLocalSocket::socket_basic()
QCOMPARE(socket.serverName(), QString());
QCOMPARE(socket.fullServerName(), QString());
socket.abort();
- QVERIFY(socket.bytesAvailable() == 0);
- QVERIFY(socket.bytesToWrite() == 0);
+ QCOMPARE(socket.bytesAvailable(), 0);
+ QCOMPARE(socket.bytesToWrite(), 0);
QCOMPARE(socket.canReadLine(), false);
socket.close();
socket.disconnectFromServer();
@@ -256,7 +256,7 @@ void tst_QLocalSocket::socket_basic()
QVERIFY(!socket.errorString().isEmpty());
QCOMPARE(socket.flush(), false);
QCOMPARE(socket.isValid(), false);
- QVERIFY(socket.readBufferSize() == 0);
+ QCOMPARE(socket.readBufferSize(), 0);
socket.setReadBufferSize(0);
//QCOMPARE(socket.socketDescriptor(), (qintptr)-1);
QCOMPARE(socket.state(), QLocalSocket::UnconnectedState);
@@ -376,13 +376,13 @@ void tst_QLocalSocket::listenAndConnect()
QVERIFY(!socket->errorString().isEmpty());
QVERIFY(socket->error() != QLocalSocket::UnknownSocketError);
QCOMPARE(socket->state(), QLocalSocket::UnconnectedState);
- //QVERIFY(socket->socketDescriptor() == -1);
+ //QCOMPARE(socket->socketDescriptor(), -1);
QCOMPARE(qvariant_cast<QLocalSocket::LocalSocketError>(spyError.first()[0]),
QLocalSocket::ServerNotFoundError);
}
- QVERIFY(socket->bytesAvailable() == 0);
- QVERIFY(socket->bytesToWrite() == 0);
+ QCOMPARE(socket->bytesAvailable(), 0);
+ QCOMPARE(socket->bytesToWrite(), 0);
QCOMPARE(socket->canReadLine(), false);
QCOMPARE(socket->flush(), false);
QCOMPARE(socket->isValid(), canListen);
@@ -433,7 +433,7 @@ void tst_QLocalSocket::listenAndConnect()
} else {
QVERIFY(server.serverName().isEmpty());
QVERIFY(server.fullServerName().isEmpty());
- QVERIFY(server.nextPendingConnection() == (QLocalSocket*)0);
+ QCOMPARE(server.nextPendingConnection(), (QLocalSocket*)0);
QCOMPARE(spyNewConnection.count(), 0);
QCOMPARE(server.hits.count(), 0);
QVERIFY(!server.errorString().isEmpty());
@@ -617,7 +617,7 @@ void tst_QLocalSocket::readBufferOverflow()
QVERIFY(client.waitForReadyRead());
QCOMPARE(client.read(buffer, readBufferSize), qint64(readBufferSize));
// no more bytes available
- QVERIFY(client.bytesAvailable() == 0);
+ QCOMPARE(client.bytesAvailable(), 0);
}
// QLocalSocket/Server can take a name or path, check that it works as expected
@@ -732,7 +732,10 @@ public:
int done = clients;
while (done > 0) {
bool timedOut = true;
- QVERIFY(server.waitForNewConnection(7000, &timedOut));
+ QVERIFY2(server.waitForNewConnection(7000, &timedOut),
+ (QByteArrayLiteral("done=") + QByteArray::number(done)
+ + QByteArrayLiteral(", timedOut=")
+ + (timedOut ? "true" : "false")).constData());
QVERIFY(!timedOut);
QLocalSocket *serverSocket = server.nextPendingConnection();
QVERIFY(serverSocket);
@@ -913,7 +916,7 @@ void tst_QLocalSocket::waitForDisconnectByServer()
QLocalSocket *serverSocket = server.nextPendingConnection();
QVERIFY(serverSocket);
serverSocket->close();
- QVERIFY(serverSocket->state() == QLocalSocket::UnconnectedState);
+ QCOMPARE(serverSocket->state(), QLocalSocket::UnconnectedState);
QVERIFY(socket.waitForDisconnected(3000));
QCOMPARE(spy.count(), 1);
}
@@ -1226,11 +1229,12 @@ void tst_QLocalSocket::verifyListenWithDescriptor()
QVERIFY2(server.listen(listenSocket), "failed to start create QLocalServer with local socket");
#ifdef Q_OS_LINUX
+ const QChar at(QLatin1Char('@'));
if (!bound) {
- QVERIFY(server.serverName().at(0) == QLatin1Char('@'));
- QVERIFY(server.fullServerName().at(0) == QLatin1Char('@'));
+ QCOMPARE(server.serverName().at(0), at);
+ QCOMPARE(server.fullServerName().at(0), at);
} else if (abstract) {
- QVERIFY2(server.fullServerName().at(0) == QLatin1Char('@'), "abstract sockets should start with a '@'");
+ QVERIFY2(server.fullServerName().at(0) == at, "abstract sockets should start with a '@'");
} else {
QCOMPARE(server.fullServerName(), path);
if (path.contains(QLatin1String("/"))) {
diff --git a/tests/auto/network/socket/qsocks5socketengine/BLACKLIST b/tests/auto/network/socket/qsocks5socketengine/BLACKLIST
index bf4afa8c45..2a32a326d0 100644
--- a/tests/auto/network/socket/qsocks5socketengine/BLACKLIST
+++ b/tests/auto/network/socket/qsocks5socketengine/BLACKLIST
@@ -2,3 +2,5 @@
*
[passwordAuth]
*
+[serverTest]
+windows
diff --git a/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp
index 0ae9887773..8da656aab7 100644
--- a/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp
+++ b/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp
@@ -193,18 +193,18 @@ void tst_QSocks5SocketEngine::construction()
// Initialize device
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
QVERIFY(socketDevice.isValid());
- QVERIFY(socketDevice.protocol() == QAbstractSocket::IPv4Protocol);
- QVERIFY(socketDevice.socketType() == QAbstractSocket::TcpSocket);
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.protocol(), QAbstractSocket::IPv4Protocol);
+ QCOMPARE(socketDevice.socketType(), QAbstractSocket::TcpSocket);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
// QVERIFY(socketDevice.socketDescriptor() != -1);
- QVERIFY(socketDevice.localAddress() == QHostAddress());
- QVERIFY(socketDevice.localPort() == 0);
- QVERIFY(socketDevice.peerAddress() == QHostAddress());
- QVERIFY(socketDevice.peerPort() == 0);
- QVERIFY(socketDevice.error() == QAbstractSocket::UnknownSocketError);
+ QCOMPARE(socketDevice.localAddress(), QHostAddress());
+ QCOMPARE(socketDevice.localPort(), quint16(0));
+ QCOMPARE(socketDevice.peerAddress(), QHostAddress());
+ QCOMPARE(socketDevice.peerPort(), quint16(0));
+ QCOMPARE(socketDevice.error(), QAbstractSocket::UnknownSocketError);
//QTest::ignoreMessage(QtWarningMsg, "QSocketLayer::bytesAvailable() was called in QAbstractSocket::UnconnectedState");
- QVERIFY(socketDevice.bytesAvailable() == 0);
+ QCOMPARE(socketDevice.bytesAvailable(), 0);
//QTest::ignoreMessage(QtWarningMsg, "QSocketLayer::hasPendingDatagrams() was called in QAbstractSocket::UnconnectedState");
QVERIFY(!socketDevice.hasPendingDatagrams());
@@ -334,15 +334,15 @@ void tst_QSocks5SocketEngine::simpleConnectToIMAP()
// Initialize device
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080));
QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143));
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
- QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP());
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectedState);
+ QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::serverIP());
// Wait for the greeting
QVERIFY(socketDevice.waitForRead());
@@ -377,8 +377,8 @@ void tst_QSocks5SocketEngine::simpleConnectToIMAP()
QVERIFY(socketDevice.waitForRead());
char c;
QVERIFY(socketDevice.read(&c, sizeof(c)) == -1);
- QVERIFY(socketDevice.error() == QAbstractSocket::RemoteHostClosedError);
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.error(), QAbstractSocket::RemoteHostClosedError);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
}
//---------------------------------------------------------------------------
@@ -392,14 +392,14 @@ void tst_QSocks5SocketEngine::simpleErrorsAndStates()
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080));
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
QVERIFY(!socketDevice.connectToHost(QHostInfo::fromName(QtNetworkSettings::serverName()).addresses().first(), 8088));
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
if (socketDevice.waitForWrite(15000)) {
QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState ||
socketDevice.state() == QAbstractSocket::ConnectedState);
} else {
- QVERIFY(socketDevice.error() == QAbstractSocket::SocketTimeoutError);
+ QCOMPARE(socketDevice.error(), QAbstractSocket::SocketTimeoutError);
}
}
@@ -413,12 +413,12 @@ void tst_QSocks5SocketEngine::tcpLoopbackPerformance()
// Bind to any port on all interfaces
QVERIFY(server.bind(QHostAddress("0.0.0.0"), 0));
- QVERIFY(server.state() == QAbstractSocket::BoundState);
+ QCOMPARE(server.state(), QAbstractSocket::BoundState);
quint16 port = server.localPort();
// Listen for incoming connections
QVERIFY(server.listen());
- QVERIFY(server.state() == QAbstractSocket::ListeningState);
+ QCOMPARE(server.state(), QAbstractSocket::ListeningState);
// Initialize a Tcp socket
QSocks5SocketEngine client;
@@ -440,7 +440,7 @@ void tst_QSocks5SocketEngine::tcpLoopbackPerformance()
// socket descriptor from accept(). It's pre-connected.
QSocketLayer serverSocket;
QVERIFY(serverSocket.initialize(socketDescriptor));
- QVERIFY(serverSocket.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(serverSocket.state(), QAbstractSocket::ConnectedState);
const int messageSize = 1024 * 256;
QByteArray message1(messageSize, '@');
@@ -482,11 +482,11 @@ void tst_QSocks5SocketEngine::serverTest()
// Bind to any port on all interfaces
QVERIFY(server.bind(QHostAddress("0.0.0.0"), 0));
- QVERIFY(server.state() == QAbstractSocket::BoundState);
+ QCOMPARE(server.state(), QAbstractSocket::BoundState);
// Listen for incoming connections
QVERIFY(server.listen());
- QVERIFY(server.state() == QAbstractSocket::ListeningState);
+ QCOMPARE(server.state(), QAbstractSocket::ListeningState);
// Initialize a Tcp socket
QSocks5SocketEngine client;
@@ -501,7 +501,7 @@ void tst_QSocks5SocketEngine::serverTest()
if (!client.connectToHost(server.localAddress(), server.localPort())) {
QVERIFY(client.waitForWrite());
// QTest::wait(100); // ### timing problem on win32
- QVERIFY(client.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(client.state(), QAbstractSocket::ConnectedState);
//QTest::wait(100);
}
@@ -516,14 +516,14 @@ void tst_QSocks5SocketEngine::serverTest()
QSocks5SocketEngine serverSocket;
QVERIFY(serverSocket.initialize(socketDescriptor));
- QVERIFY(serverSocket.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(serverSocket.state(), QAbstractSocket::ConnectedState);
- QVERIFY(serverSocket.localAddress() == client.peerAddress());
- QVERIFY(serverSocket.localPort() == client.peerPort());
+ QCOMPARE(serverSocket.localAddress(), client.peerAddress());
+ QCOMPARE(serverSocket.localPort(), client.peerPort());
// this seems depends on the socks server implementation, especially
// when connecting /to/ the socks server /through/ the same socks server
- //QVERIFY(serverSocket.peerAddress() == client.localAddress());
- //QVERIFY(serverSocket.peerPort() == client.localPort());
+ //QCOMPARE(serverSocket.peerAddress(), client.localAddress());
+ //QCOMPARE(serverSocket.peerPort(), client.localPort());
// The server socket sends a greeting to the client
QByteArray greeting = "Greetings!";
@@ -557,16 +557,16 @@ void tst_QSocks5SocketEngine::udpTest()
udpSocket.setProxy(proxy);
- QVERIFY(udpSocket.protocol() == QAbstractSocket::IPv4Protocol);
- QVERIFY(udpSocket.socketType() == QAbstractSocket::UdpSocket);
- QVERIFY(udpSocket.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(udpSocket.protocol(), QAbstractSocket::IPv4Protocol);
+ QCOMPARE(udpSocket.socketType(), QAbstractSocket::UdpSocket);
+ QCOMPARE(udpSocket.state(), QAbstractSocket::UnconnectedState);
// Bind #1
bool bindSuccessful = udpSocket.bind(QHostAddress("0.0.0.0"), 0);
if (!bindSuccessful)
QEXPECT_FAIL("", "QTBUG-23380 / QTBUG-35490: Fails on some Ubuntu 11.10 x64 configurations and on new network test server", Abort);
QVERIFY(bindSuccessful);
- QVERIFY(udpSocket.state() == QAbstractSocket::BoundState);
+ QCOMPARE(udpSocket.state(), QAbstractSocket::BoundState);
QVERIFY(udpSocket.localPort() != 0);
// Initialize device #2
@@ -577,7 +577,7 @@ void tst_QSocks5SocketEngine::udpTest()
// Connect device #2 to #1
QVERIFY(udpSocket2.connectToHost(udpSocket.localAddress(), udpSocket.localPort()));
- QVERIFY(udpSocket2.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(udpSocket2.state(), QAbstractSocket::ConnectedState);
// Write a message to #1
QByteArray message1 = "hei der";
@@ -591,13 +591,13 @@ void tst_QSocks5SocketEngine::udpTest()
QVERIFY(available > 0);
QByteArray answer;
answer.resize(available);
- QHostAddress senderAddress;
- quint16 senderPort = 0;
- QVERIFY(udpSocket.readDatagram(answer.data(), answer.size(),
- &senderAddress,
- &senderPort) == message1.size());
- QVERIFY(senderAddress == udpSocket2.localAddress());
- QVERIFY(senderPort == udpSocket2.localPort());
+ QIpPacketHeader header;
+ QCOMPARE(udpSocket.readDatagram(answer.data(), answer.size(),
+ &header, QAbstractSocketEngine::WantDatagramSender),
+ qint64(message1.size()));
+ QVERIFY(header.senderAddress == udpSocket2.localAddress());
+ QCOMPARE(header.senderAddress, udpSocket2.localAddress());
+ QCOMPARE(header.senderPort, udpSocket2.localPort());
}
void tst_QSocks5SocketEngine::tcpSocketBlockingTest()
@@ -705,7 +705,7 @@ void tst_QSocks5SocketEngine::tcpSocketNonBlockingTest()
QFAIL("Timed out");
}
- QVERIFY(tcpSocketNonBlocking_totalWritten == 8);
+ QCOMPARE(tcpSocketNonBlocking_totalWritten, 8);
QTestEventLoop::instance().enterLoop(30);
@@ -729,7 +729,7 @@ void tst_QSocks5SocketEngine::tcpSocketNonBlockingTest()
QFAIL("Timed out");
}
- QVERIFY(tcpSocketNonBlocking_totalWritten == 10);
+ QCOMPARE(tcpSocketNonBlocking_totalWritten, 10);
// Wait for greeting
QTestEventLoop::instance().enterLoop(30);
@@ -797,7 +797,7 @@ void tst_QSocks5SocketEngine::downloadBigFile()
QFAIL("Network operation timed out");
QByteArray hostName = QtNetworkSettings::serverName().toLatin1();
- QVERIFY(tmpSocket->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(tmpSocket->state(), QAbstractSocket::ConnectedState);
QVERIFY(tmpSocket->write("GET /qtest/mediumfile HTTP/1.0\r\n") > 0);
QVERIFY(tmpSocket->write("HOST: ") > 0);
QVERIFY(tmpSocket->write(hostName.data()) > 0);
@@ -819,7 +819,7 @@ void tst_QSocks5SocketEngine::downloadBigFile()
QCOMPARE(bytesAvailable, qint64(10000000));
- QVERIFY(tmpSocket->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(tmpSocket->state(), QAbstractSocket::ConnectedState);
/*qDebug("\t\t%.1fMB/%.1fs: %.1fMB/s",
bytesAvailable / (1024.0 * 1024.0),
@@ -852,19 +852,19 @@ void tst_QSocks5SocketEngine::passwordAuth()
// Initialize device
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080, "qsockstest", "password"));
// Connect to imap.trolltech.com's IP
QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143));
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
QVERIFY(socketDevice.waitForWrite());
if (!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143)) {
qDebug("%d, %s", socketDevice.error(), socketDevice.errorString().toLatin1().constData());
}
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
- QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP());
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectedState);
+ QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::serverIP());
// Wait for the greeting
QVERIFY(socketDevice.waitForRead());
@@ -899,8 +899,8 @@ void tst_QSocks5SocketEngine::passwordAuth()
QVERIFY(socketDevice.waitForRead());
char c;
QVERIFY(socketDevice.read(&c, sizeof(c)) == -1);
- QVERIFY(socketDevice.error() == QAbstractSocket::RemoteHostClosedError);
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.error(), QAbstractSocket::RemoteHostClosedError);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
}
//----------------------------------------------------------------------------------
@@ -918,21 +918,21 @@ void tst_QSocks5SocketEngine::passwordAuth2()
// Initialize device
QVERIFY(socketDevice.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol));
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
socketDevice.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1081));
socketDevice.setReceiver(this);
QVERIFY(!socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143));
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectingState);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectingState);
while (socketDevice.state() == QAbstractSocket::ConnectingState) {
QVERIFY(socketDevice.waitForWrite());
socketDevice.connectToHost(QtNetworkSettings::serverIP(), 143);
}
if (socketDevice.state() != QAbstractSocket::ConnectedState)
qDebug("%d, %s", socketDevice.error(), socketDevice.errorString().toLatin1().constData());
- QVERIFY(socketDevice.state() == QAbstractSocket::ConnectedState);
- QVERIFY(socketDevice.peerAddress() == QtNetworkSettings::serverIP());
+ QCOMPARE(socketDevice.state(), QAbstractSocket::ConnectedState);
+ QCOMPARE(socketDevice.peerAddress(), QtNetworkSettings::serverIP());
// Wait for the greeting
QVERIFY(socketDevice.waitForRead());
@@ -967,8 +967,8 @@ void tst_QSocks5SocketEngine::passwordAuth2()
QVERIFY(socketDevice.waitForRead());
char c;
QVERIFY(socketDevice.read(&c, sizeof(c)) == -1);
- QVERIFY(socketDevice.error() == QAbstractSocket::RemoteHostClosedError);
- QVERIFY(socketDevice.state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socketDevice.error(), QAbstractSocket::RemoteHostClosedError);
+ QCOMPARE(socketDevice.state(), QAbstractSocket::UnconnectedState);
}
void tst_QSocks5SocketEngine::fragmentation_data()
@@ -1017,7 +1017,7 @@ void tst_QSocks5SocketEngine::fragmentation()
QVERIFY(!QTestEventLoop::instance().timeout());
QVERIFY(socket.localAddress() == QHostAddress("1.2.3.4") || socket.localAddress() == QHostAddress("0123:4567:89ab:cdef:0123:4567:89ab:cdef"));
- QVERIFY(socket.localPort() == 0x0506);
+ QCOMPARE(socket.localPort(), quint16(0x0506));
}
void tst_QSocks5SocketEngine::incomplete_data()
diff --git a/tests/auto/network/socket/qtcpserver/BLACKLIST b/tests/auto/network/socket/qtcpserver/BLACKLIST
new file mode 100644
index 0000000000..f8b61808cc
--- /dev/null
+++ b/tests/auto/network/socket/qtcpserver/BLACKLIST
@@ -0,0 +1,13 @@
+windows
+[linkLocal]
+linux
+[listenWhileListening:WithSocks5Proxy]
+linux
+windows
+[ipv6Server:WithoutProxy]
+windows
+osx
+[clientServerLoop:WithSocks5Proxy]
+linux
+[crashTests:WithSocks5Proxy]
+linux
diff --git a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp
index e0a6e3699d..5df5432cdd 100644
--- a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp
+++ b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp
@@ -265,11 +265,11 @@ void tst_QTcpServer::ipv6Server()
//### need to enter the event loop for the server to get the connection ?? ( windows)
QTcpServer server;
if (!server.listen(QHostAddress::LocalHostIPv6, 8944)) {
- QVERIFY(server.serverError() == QAbstractSocket::UnsupportedSocketOperationError);
+ QCOMPARE(server.serverError(), QAbstractSocket::UnsupportedSocketOperationError);
return;
}
- QVERIFY(server.serverPort() == 8944);
+ QCOMPARE(server.serverPort(), quint16(8944));
QVERIFY(server.serverAddress() == QHostAddress::LocalHostIPv6);
QTcpSocket client;
@@ -835,17 +835,17 @@ void tst_QTcpServer::qtbug14268_peek()
client.write("abc\n");
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
- QVERIFY(helper.lastDataPeeked == QByteArray("6162630a"));
+ QCOMPARE(helper.lastDataPeeked, QByteArray("6162630a"));
client.write("def\n");
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
- QVERIFY(helper.lastDataPeeked == QByteArray("6162630a6465660a"));
+ QCOMPARE(helper.lastDataPeeked, QByteArray("6162630a6465660a"));
client.write("ghi\n");
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
- QVERIFY(helper.lastDataPeeked == QByteArray("6162630a6465660a6768690a"));
+ QCOMPARE(helper.lastDataPeeked, QByteArray("6162630a6465660a6768690a"));
}
void tst_QTcpServer::serverAddress_data()
diff --git a/tests/auto/network/socket/qtcpsocket/test/test.pro b/tests/auto/network/socket/qtcpsocket/test/test.pro
index 3e64b87b53..325abcaab8 100644
--- a/tests/auto/network/socket/qtcpsocket/test/test.pro
+++ b/tests/auto/network/socket/qtcpsocket/test/test.pro
@@ -21,3 +21,5 @@ win32 {
} else {
DESTDIR = ../
}
+
+win32: CONFIG += insignificant_test # Hangs in release builds
diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
index e8a942e6c4..cde453c191 100644
--- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
+++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
@@ -200,6 +200,7 @@ private slots:
void setSocketOption();
void clientSendDataOnDelayedDisconnect();
+ void serverDisconnectWithBuffered();
void readNotificationsAfterBind();
protected slots:
@@ -242,7 +243,6 @@ private:
mutable int proxyAuthCalled;
- int numConnections;
static int loopLevel;
SocketPair *earlyConstructedSockets;
@@ -484,9 +484,9 @@ void tst_QTcpSocket::constructing()
QCOMPARE(socket->readLine(), QByteArray());
QCOMPARE(socket->socketDescriptor(), (qintptr)-1);
QCOMPARE((int) socket->localPort(), 0);
- QVERIFY(socket->localAddress() == QHostAddress());
+ QCOMPARE(socket->localAddress(), QHostAddress());
QCOMPARE((int) socket->peerPort(), 0);
- QVERIFY(socket->peerAddress() == QHostAddress());
+ QCOMPARE(socket->peerAddress(), QHostAddress());
QCOMPARE(socket->error(), QTcpSocket::UnknownSocketError);
QCOMPARE(socket->errorString(), QString("Unknown error"));
@@ -756,7 +756,7 @@ void tst_QTcpSocket::socketDescriptor()
QVERIFY(socket->state() == QAbstractSocket::HostLookupState ||
socket->state() == QAbstractSocket::ConnectingState);
QVERIFY(socket->waitForConnected(10000));
- QVERIFY(socket->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(socket->state(), QAbstractSocket::ConnectedState);
QVERIFY(socket->socketDescriptor() != -1);
delete socket;
@@ -937,7 +937,7 @@ void tst_QTcpSocket::nonBlockingIMAP()
QFAIL("Timed out");
}
- QVERIFY(nonBlockingIMAP_totalWritten == 8);
+ QCOMPARE(nonBlockingIMAP_totalWritten, 8);
enterLoop(30);
@@ -962,7 +962,7 @@ void tst_QTcpSocket::nonBlockingIMAP()
QFAIL("Timed out");
}
- QVERIFY(nonBlockingIMAP_totalWritten == 10);
+ QCOMPARE(nonBlockingIMAP_totalWritten, 10);
// Wait for greeting
enterLoop(30);
@@ -1087,7 +1087,7 @@ void tst_QTcpSocket::partialRead()
QTcpSocket *socket = newSocket();
socket->connectToHost(QtNetworkSettings::serverName(), 143);
QVERIFY(socket->waitForConnected(10000));
- QVERIFY(socket->state() == QTcpSocket::ConnectedState);
+ QCOMPARE(socket->state(), QTcpSocket::ConnectedState);
char buf[512];
QByteArray greeting = expectedReplyIMAP();
@@ -1111,7 +1111,7 @@ void tst_QTcpSocket::unget()
QTcpSocket *socket = newSocket();
socket->connectToHost(QtNetworkSettings::serverName(), 143);
QVERIFY(socket->waitForConnected(10000));
- QVERIFY(socket->state() == QTcpSocket::ConnectedState);
+ QCOMPARE(socket->state(), QTcpSocket::ConnectedState);
char buf[512];
QByteArray greeting = expectedReplyIMAP();
@@ -1169,7 +1169,7 @@ void tst_QTcpSocket::openCloseOpenClose()
QCOMPARE(int(socket->openMode()), int(QIODevice::NotOpen));
QVERIFY(socket->isSequential());
QVERIFY(!socket->isOpen());
- QVERIFY(socket->socketType() == QTcpSocket::TcpSocket);
+ QCOMPARE(socket->socketType(), QTcpSocket::TcpSocket);
char c;
QCOMPARE(socket->getChar(&c), false);
@@ -1178,13 +1178,13 @@ void tst_QTcpSocket::openCloseOpenClose()
QCOMPARE(socket->readLine(), QByteArray());
QCOMPARE(socket->socketDescriptor(), (qintptr)-1);
QCOMPARE((int) socket->localPort(), 0);
- QVERIFY(socket->localAddress() == QHostAddress());
+ QCOMPARE(socket->localAddress(), QHostAddress());
QCOMPARE((int) socket->peerPort(), 0);
- QVERIFY(socket->peerAddress() == QHostAddress());
+ QCOMPARE(socket->peerAddress(), QHostAddress());
QCOMPARE(socket->error(), QTcpSocket::UnknownSocketError);
QCOMPARE(socket->errorString(), QString("Unknown error"));
- QVERIFY(socket->state() == QTcpSocket::UnconnectedState);
+ QCOMPARE(socket->state(), QTcpSocket::UnconnectedState);
socket->connectToHost(QtNetworkSettings::serverName(), 143);
QVERIFY(socket->waitForConnected(10000));
@@ -1201,7 +1201,7 @@ void tst_QTcpSocket::connectDisconnectConnectDisconnect()
for (int i = 0; i < 3; ++i) {
QCOMPARE(socket->state(), QTcpSocket::UnconnectedState);
- QVERIFY(socket->socketType() == QTcpSocket::TcpSocket);
+ QCOMPARE(socket->socketType(), QTcpSocket::TcpSocket);
socket->connectToHost(QtNetworkSettings::serverName(), 143);
QVERIFY(socket->waitForReadyRead(10000));
@@ -1261,7 +1261,7 @@ void tst_QTcpSocket::disconnectWhileConnecting()
connect(socket, SIGNAL(disconnected()), SLOT(exitLoopSlot()));
enterLoop(10);
QVERIFY2(!timeout(), "Network timeout");
- QVERIFY(socket->state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socket->state(), QAbstractSocket::UnconnectedState);
if (!closeDirectly) {
QCOMPARE(int(socket->openMode()), int(QIODevice::ReadWrite));
socket->close();
@@ -1273,7 +1273,7 @@ void tst_QTcpSocket::disconnectWhileConnecting()
QTcpSocket *othersocket = server.nextPendingConnection();
if (othersocket->state() != QAbstractSocket::UnconnectedState)
QVERIFY2(othersocket->waitForDisconnected(10000), "Network timeout");
- QVERIFY(othersocket->state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(othersocket->state(), QAbstractSocket::UnconnectedState);
QCOMPARE(othersocket->readAll(), data);
delete socket;
@@ -1376,7 +1376,7 @@ void tst_QTcpSocket::disconnectWhileConnectingNoEventLoop()
}
QVERIFY2(socket->waitForDisconnected(10000), "Network timeout");
- QVERIFY(socket->state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socket->state(), QAbstractSocket::UnconnectedState);
if (!closeDirectly) {
QCOMPARE(int(socket->openMode()), int(QIODevice::ReadWrite));
socket->close();
@@ -1415,10 +1415,10 @@ void tst_QTcpSocket::disconnectWhileLookingUp()
QFETCH(bool, doClose);
if (doClose) {
socket->close();
- QVERIFY(socket->openMode() == QIODevice::NotOpen);
+ QCOMPARE(socket->openMode(), QIODevice::NotOpen);
} else {
socket->disconnectFromHost();
- QVERIFY(socket->openMode() == QIODevice::ReadWrite);
+ QCOMPARE(socket->openMode(), QIODevice::ReadWrite);
QVERIFY(socket->waitForDisconnected(5000));
}
@@ -1429,12 +1429,12 @@ void tst_QTcpSocket::disconnectWhileLookingUp()
// recheck
if (doClose) {
- QVERIFY(socket->openMode() == QIODevice::NotOpen);
+ QCOMPARE(socket->openMode(), QIODevice::NotOpen);
} else {
- QVERIFY(socket->openMode() == QIODevice::ReadWrite);
+ QCOMPARE(socket->openMode(), QIODevice::ReadWrite);
}
- QVERIFY(socket->state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socket->state(), QAbstractSocket::UnconnectedState);
}
//----------------------------------------------------------------------------------
@@ -1458,7 +1458,7 @@ void tst_QTcpSocket::downloadBigFile()
}
QByteArray hostName = QtNetworkSettings::serverName().toLatin1();
- QVERIFY(tmpSocket->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(tmpSocket->state(), QAbstractSocket::ConnectedState);
QVERIFY(tmpSocket->write("GET /qtest/mediumfile HTTP/1.0\r\n") > 0);
QVERIFY(tmpSocket->write("HOST: ") > 0);
QVERIFY(tmpSocket->write(hostName.data()) > 0);
@@ -1831,7 +1831,6 @@ private slots:
}
#endif // !QT_NO_NETWORKPROXY
private:
- int exitCode;
QTcpSocket *socket;
QByteArray socketData;
};
@@ -2687,12 +2686,12 @@ void tst_QTcpSocket::taskQtBug7054TimeoutErrorResetting()
socket->connectToHost(QtNetworkSettings::serverName(), 443);
QVERIFY(socket->waitForConnected(5*1000));
- QVERIFY(socket->error() == QAbstractSocket::UnknownSocketError);
+ QCOMPARE(socket->error(), QAbstractSocket::UnknownSocketError);
// We connected to the HTTPS port. Wait two seconds to receive data. We will receive
// nothing because we would need to start the SSL handshake
QVERIFY(!socket->waitForReadyRead(2*1000));
- QVERIFY(socket->error() == QAbstractSocket::SocketTimeoutError);
+ QCOMPARE(socket->error(), QAbstractSocket::SocketTimeoutError);
// Now write some crap to make the server disconnect us. 4 lines are enough.
socket->write("a\r\nb\r\nc\r\nd\r\n");
@@ -2702,7 +2701,7 @@ void tst_QTcpSocket::taskQtBug7054TimeoutErrorResetting()
// should get a better error since the server disconnected us
QVERIFY(!socket->waitForReadyRead(2*1000));
// It must NOT be the SocketTimeoutError that had been set before
- QVERIFY(socket->error() == QAbstractSocket::RemoteHostClosedError);
+ QCOMPARE(socket->error(), QAbstractSocket::RemoteHostClosedError);
}
#ifndef QT_NO_NETWORKPROXY
@@ -2896,25 +2895,25 @@ void tst_QTcpSocket::qtbug14268_peek()
QTcpSocket *outgoing = socketPair.endPoints[0];
QTcpSocket *incoming = socketPair.endPoints[1];
- QVERIFY(incoming->state() == QTcpSocket::ConnectedState);
- QVERIFY(outgoing->state() == QTcpSocket::ConnectedState);
+ QCOMPARE(incoming->state(), QTcpSocket::ConnectedState);
+ QCOMPARE(outgoing->state(), QTcpSocket::ConnectedState);
outgoing->write("abc\n");
QVERIFY(outgoing->waitForBytesWritten(2000));
QVERIFY(incoming->waitForReadyRead(2000));
- QVERIFY(incoming->peek(128*1024) == QByteArray("abc\n"));
+ QCOMPARE(incoming->peek(128*1024), QByteArray("abc\n"));
outgoing->write("def\n");
QVERIFY(outgoing->waitForBytesWritten(2000));
QVERIFY(incoming->waitForReadyRead(2000));
- QVERIFY(incoming->peek(128*1024) == QByteArray("abc\ndef\n"));
+ QCOMPARE(incoming->peek(128*1024), QByteArray("abc\ndef\n"));
outgoing->write("ghi\n");
QVERIFY(outgoing->waitForBytesWritten(2000));
QVERIFY(incoming->waitForReadyRead(2000));
- QVERIFY(incoming->peek(128*1024) == QByteArray("abc\ndef\nghi\n"));
+ QCOMPARE(incoming->peek(128*1024), QByteArray("abc\ndef\nghi\n"));
- QVERIFY(incoming->read(128*1024) == QByteArray("abc\ndef\nghi\n"));
+ QCOMPARE(incoming->read(128*1024), QByteArray("abc\ndef\nghi\n"));
}
void tst_QTcpSocket::setSocketOption()
@@ -2928,8 +2927,8 @@ void tst_QTcpSocket::setSocketOption()
QTcpSocket *outgoing = socketPair.endPoints[0];
QTcpSocket *incoming = socketPair.endPoints[1];
- QVERIFY(incoming->state() == QTcpSocket::ConnectedState);
- QVERIFY(outgoing->state() == QTcpSocket::ConnectedState);
+ QCOMPARE(incoming->state(), QTcpSocket::ConnectedState);
+ QCOMPARE(outgoing->state(), QTcpSocket::ConnectedState);
outgoing->setSocketOption(QAbstractSocket::LowDelayOption, true);
QVariant v = outgoing->socketOption(QAbstractSocket::LowDelayOption);
@@ -2985,6 +2984,51 @@ void tst_QTcpSocket::clientSendDataOnDelayedDisconnect()
delete socket;
}
+// Test buffered socket being properly closed on remote disconnect
+void tst_QTcpSocket::serverDisconnectWithBuffered()
+{
+ QFETCH_GLOBAL(bool, setProxy);
+ if (setProxy)
+ return;
+
+ qRegisterMetaType<QAbstractSocket::SocketState>("QAbstractSocket::SocketState");
+
+ QTcpServer tcpServer;
+ QTcpSocket *socket = newSocket();
+
+ QVERIFY(tcpServer.listen(QHostAddress::LocalHost));
+ socket->connectToHost(tcpServer.serverAddress(), tcpServer.serverPort());
+ // Accept connection on server side
+ QVERIFY(tcpServer.waitForNewConnection(5000));
+ QTcpSocket *newConnection = tcpServer.nextPendingConnection();
+ // Send one char and drop link
+ QVERIFY(newConnection != NULL);
+ QVERIFY(newConnection->putChar(0));
+ QVERIFY(newConnection->flush());
+ delete newConnection;
+
+ QVERIFY(socket->waitForConnected(5000)); // ready for write
+ QCOMPARE(socket->state(), QAbstractSocket::ConnectedState);
+
+ QSignalSpy spyStateChanged(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)));
+ QSignalSpy spyDisconnected(socket, SIGNAL(disconnected()));
+
+ QVERIFY(socket->waitForReadyRead(5000)); // have one char already in internal buffer
+ char buf[128];
+ QCOMPARE(socket->read(buf, sizeof(buf)), Q_INT64_C(1));
+ if (socket->state() != QAbstractSocket::UnconnectedState) {
+ QVERIFY(socket->waitForDisconnected(5000));
+ QCOMPARE(socket->state(), QAbstractSocket::UnconnectedState);
+ }
+ // Test signal emitting
+ QCOMPARE(spyDisconnected.count(), 1);
+ QVERIFY(spyStateChanged.count() > 0);
+ QVERIFY(qvariant_cast<QAbstractSocket::SocketState>(spyStateChanged.last().first())
+ == QAbstractSocket::UnconnectedState);
+
+ delete socket;
+}
+
// Test that the socket does not enable the read notifications in bind()
void tst_QTcpSocket::readNotificationsAfterBind()
{
diff --git a/tests/auto/network/socket/qudpsocket/BLACKLIST b/tests/auto/network/socket/qudpsocket/BLACKLIST
new file mode 100644
index 0000000000..3e936aebf6
--- /dev/null
+++ b/tests/auto/network/socket/qudpsocket/BLACKLIST
@@ -0,0 +1,8 @@
+[multicast:same bind, group ipv6 address]
+*
+[multicast:valid bind, group ipv6 address]
+osx
+[multicast:dual bind, group ipv6 address]
+osx
+[multicast:same bind, group ipv4 address]
+osx
diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
index 6f96e6d6f5..0ee3255502 100644
--- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
+++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
@@ -56,7 +56,6 @@
#endif
Q_DECLARE_METATYPE(QHostAddress)
-Q_DECLARE_METATYPE(QNetworkInterface)
QT_FORWARD_DECLARE_CLASS(QUdpSocket)
@@ -228,7 +227,7 @@ void tst_QUdpSocket::constructing()
QVERIFY(socket.isSequential());
QVERIFY(!socket.isOpen());
- QVERIFY(socket.socketType() == QUdpSocket::UdpSocket);
+ QCOMPARE(socket.socketType(), QUdpSocket::UdpSocket);
QCOMPARE((int) socket.bytesAvailable(), 0);
QCOMPARE(socket.canReadLine(), false);
QCOMPARE(socket.readLine(), QByteArray());
@@ -754,7 +753,7 @@ void tst_QUdpSocket::writeDatagram()
QCOMPARE(client.error(), QUdpSocket::DatagramTooLargeError);
break;
}
- QVERIFY(bytesspy.count() == 1);
+ QCOMPARE(bytesspy.count(), 1);
QCOMPARE(*static_cast<const qint64 *>(bytesspy.at(0).at(0).constData()),
qint64(i * 1024));
QCOMPARE(errorspy.count(), 0);
diff --git a/tests/auto/network/ssl/qsslcertificate/BLACKLIST b/tests/auto/network/ssl/qsslcertificate/BLACKLIST
new file mode 100644
index 0000000000..25509a5ca8
--- /dev/null
+++ b/tests/auto/network/ssl/qsslcertificate/BLACKLIST
@@ -0,0 +1,3 @@
+# OpenSSL version is too new. Rich will fix :)
+[subjectAndIssuerAttributes]
+*
diff --git a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
index 748c240f3d..4c288fffaf 100644
--- a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
+++ b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
@@ -775,7 +775,7 @@ void tst_QSslCertificate::certInfo()
QVERIFY(cert.expiryDate() < QDateTime::currentDateTime()); // cert has expired
QSslCertificate copy = cert;
- QVERIFY(cert == copy);
+ QCOMPARE(cert, copy);
QVERIFY(!(cert != copy));
QCOMPARE(cert, QSslCertificate(pem, QSsl::Pem));
@@ -833,6 +833,9 @@ void tst_QSslCertificate::task256066toPem()
void tst_QSslCertificate::nulInCN()
{
+#ifdef QT_SECURETRANSPORT
+ QSKIP("Generic QSslCertificatePrivate fails this test");
+#endif
QList<QSslCertificate> certList =
QSslCertificate::fromPath(testDataDir + "/more-certificates/badguy-nul-cn.crt");
QCOMPARE(certList.size(), 1);
@@ -849,6 +852,9 @@ void tst_QSslCertificate::nulInCN()
void tst_QSslCertificate::nulInSan()
{
+#ifdef QT_SECURETRANSPORT
+ QSKIP("Generic QSslCertificatePrivate fails this test");
+#endif
QList<QSslCertificate> certList =
QSslCertificate::fromPath(testDataDir + "/more-certificates/badguy-nul-san.crt");
QCOMPARE(certList.size(), 1);
@@ -976,6 +982,9 @@ void tst_QSslCertificate::subjectAndIssuerAttributes()
void tst_QSslCertificate::verify()
{
+#ifdef QT_SECURETRANSPORT
+ QSKIP("Not implemented in SecureTransport");
+#endif
QList<QSslError> errors;
QList<QSslCertificate> toVerify;
@@ -1069,7 +1078,7 @@ void tst_QSslCertificate::extensions()
QSslCertificate cert = certList[0];
QList<QSslCertificateExtension> extensions = cert.extensions();
- QVERIFY(extensions.count() == 9);
+ QCOMPARE(extensions.count(), 9);
int unknown_idx = -1;
int authority_info_idx = -1;
@@ -1101,8 +1110,8 @@ void tst_QSslCertificate::extensions()
// Unknown
QSslCertificateExtension unknown = extensions[unknown_idx];
- QVERIFY(unknown.oid() == QStringLiteral("1.3.6.1.5.5.7.1.12"));
- QVERIFY(unknown.name() == QStringLiteral("1.3.6.1.5.5.7.1.12"));
+ QCOMPARE(unknown.oid(), QStringLiteral("1.3.6.1.5.5.7.1.12"));
+ QCOMPARE(unknown.name(), QStringLiteral("1.3.6.1.5.5.7.1.12"));
QVERIFY(!unknown.isCritical());
QVERIFY(!unknown.isSupported());
@@ -1114,8 +1123,8 @@ void tst_QSslCertificate::extensions()
// Authority Info Access
QSslCertificateExtension aia = extensions[authority_info_idx];
- QVERIFY(aia.oid() == QStringLiteral("1.3.6.1.5.5.7.1.1"));
- QVERIFY(aia.name() == QStringLiteral("authorityInfoAccess"));
+ QCOMPARE(aia.oid(), QStringLiteral("1.3.6.1.5.5.7.1.1"));
+ QCOMPARE(aia.name(), QStringLiteral("authorityInfoAccess"));
QVERIFY(!aia.isCritical());
QVERIFY(aia.isSupported());
@@ -1124,32 +1133,32 @@ void tst_QSslCertificate::extensions()
QString ocsp = aiaValue[QStringLiteral("OCSP")].toString();
QString caIssuers = aiaValue[QStringLiteral("caIssuers")].toString();
- QVERIFY(ocsp == QStringLiteral("http://EVIntl-ocsp.verisign.com"));
- QVERIFY(caIssuers == QStringLiteral("http://EVIntl-aia.verisign.com/EVIntl2006.cer"));
+ QCOMPARE(ocsp, QStringLiteral("http://EVIntl-ocsp.verisign.com"));
+ QCOMPARE(caIssuers, QStringLiteral("http://EVIntl-aia.verisign.com/EVIntl2006.cer"));
// Basic constraints
QSslCertificateExtension basic = extensions[basic_constraints_idx];
- QVERIFY(basic.oid() == QStringLiteral("2.5.29.19"));
- QVERIFY(basic.name() == QStringLiteral("basicConstraints"));
+ QCOMPARE(basic.oid(), QStringLiteral("2.5.29.19"));
+ QCOMPARE(basic.name(), QStringLiteral("basicConstraints"));
QVERIFY(!basic.isCritical());
QVERIFY(basic.isSupported());
QVariantMap basicValue = basic.value().toMap();
QCOMPARE(basicValue.keys(), QList<QString>() << QStringLiteral("ca"));
- QVERIFY(basicValue[QStringLiteral("ca")].toBool() == false);
+ QVERIFY(!basicValue[QStringLiteral("ca")].toBool());
// Subject key identifier
QSslCertificateExtension subjectKey = extensions[subject_key_idx];
- QVERIFY(subjectKey.oid() == QStringLiteral("2.5.29.14"));
- QVERIFY(subjectKey.name() == QStringLiteral("subjectKeyIdentifier"));
+ QCOMPARE(subjectKey.oid(), QStringLiteral("2.5.29.14"));
+ QCOMPARE(subjectKey.name(), QStringLiteral("subjectKeyIdentifier"));
QVERIFY(!subjectKey.isCritical());
QVERIFY(subjectKey.isSupported());
- QVERIFY(subjectKey.value().toString() == QStringLiteral("5F:90:23:CD:24:CA:52:C9:36:29:F0:7E:9D:B1:FE:08:E0:EE:69:F0"));
+ QCOMPARE(subjectKey.value().toString(), QStringLiteral("5F:90:23:CD:24:CA:52:C9:36:29:F0:7E:9D:B1:FE:08:E0:EE:69:F0"));
// Authority key identifier
QSslCertificateExtension authKey = extensions[auth_key_idx];
- QVERIFY(authKey.oid() == QStringLiteral("2.5.29.35"));
- QVERIFY(authKey.name() == QStringLiteral("authorityKeyIdentifier"));
+ QCOMPARE(authKey.oid(), QStringLiteral("2.5.29.35"));
+ QCOMPARE(authKey.name(), QStringLiteral("authorityKeyIdentifier"));
QVERIFY(!authKey.isCritical());
QVERIFY(authKey.isSupported());
@@ -1167,7 +1176,7 @@ void tst_QSslCertificate::extensionsCritical()
QSslCertificate cert = certList[0];
QList<QSslCertificateExtension> extensions = cert.extensions();
- QVERIFY(extensions.count() == 9);
+ QCOMPARE(extensions.count(), 9);
int basic_constraints_idx = -1;
int key_usage_idx = -1;
@@ -1186,19 +1195,19 @@ void tst_QSslCertificate::extensionsCritical()
// Basic constraints
QSslCertificateExtension basic = extensions[basic_constraints_idx];
- QVERIFY(basic.oid() == QStringLiteral("2.5.29.19"));
- QVERIFY(basic.name() == QStringLiteral("basicConstraints"));
+ QCOMPARE(basic.oid(), QStringLiteral("2.5.29.19"));
+ QCOMPARE(basic.name(), QStringLiteral("basicConstraints"));
QVERIFY(basic.isCritical());
QVERIFY(basic.isSupported());
QVariantMap basicValue = basic.value().toMap();
QCOMPARE(basicValue.keys(), QList<QString>() << QStringLiteral("ca"));
- QVERIFY(basicValue[QStringLiteral("ca")].toBool() == false);
+ QVERIFY(!basicValue[QStringLiteral("ca")].toBool());
// Key Usage
QSslCertificateExtension keyUsage = extensions[key_usage_idx];
- QVERIFY(keyUsage.oid() == QStringLiteral("2.5.29.15"));
- QVERIFY(keyUsage.name() == QStringLiteral("keyUsage"));
+ QCOMPARE(keyUsage.oid(), QStringLiteral("2.5.29.15"));
+ QCOMPARE(keyUsage.name(), QStringLiteral("keyUsage"));
QVERIFY(keyUsage.isCritical());
QVERIFY(!keyUsage.isSupported());
}
@@ -1257,21 +1266,21 @@ void tst_QSslCertificate::threadSafeConstMethods()
t2.start();
QVERIFY(t1.wait(5000));
QVERIFY(t2.wait(5000));
- QVERIFY(t1.cert == t2.cert);
- QVERIFY(t1.effectiveDate == t2.effectiveDate);
- QVERIFY(t1.expiryDate == t2.expiryDate);
+ QCOMPARE(t1.cert, t2.cert);
+ QCOMPARE(t1.effectiveDate, t2.effectiveDate);
+ QCOMPARE(t1.expiryDate, t2.expiryDate);
//QVERIFY(t1.extensions == t2.extensions); // no equality operator, so not tested
- QVERIFY(t1.isBlacklisted == t2.isBlacklisted);
- QVERIFY(t1.issuerInfo == t2.issuerInfo);
- QVERIFY(t1.issuerInfoAttributes == t2.issuerInfoAttributes);
- QVERIFY(t1.publicKey == t2.publicKey);
- QVERIFY(t1.serialNumber == t2.serialNumber);
- QVERIFY(t1.subjectInfo == t2.subjectInfo);
- QVERIFY(t1.subjectInfoAttributes == t2.subjectInfoAttributes);
- QVERIFY(t1.toDer == t2.toDer);
- QVERIFY(t1.toPem == t2.toPem);
- QVERIFY(t1.toText == t2.toText);
- QVERIFY(t1.version == t2.version);
+ QCOMPARE(t1.isBlacklisted, t2.isBlacklisted);
+ QCOMPARE(t1.issuerInfo, t2.issuerInfo);
+ QCOMPARE(t1.issuerInfoAttributes, t2.issuerInfoAttributes);
+ QCOMPARE(t1.publicKey, t2.publicKey);
+ QCOMPARE(t1.serialNumber, t2.serialNumber);
+ QCOMPARE(t1.subjectInfo, t2.subjectInfo);
+ QCOMPARE(t1.subjectInfoAttributes, t2.subjectInfoAttributes);
+ QCOMPARE(t1.toDer, t2.toDer);
+ QCOMPARE(t1.toPem, t2.toPem);
+ QCOMPARE(t1.toText, t2.toText);
+ QCOMPARE(t1.version, t2.version);
}
diff --git a/tests/auto/network/ssl/qsslkey/BLACKLIST b/tests/auto/network/ssl/qsslkey/BLACKLIST
new file mode 100644
index 0000000000..a08e1f35eb
--- /dev/null
+++ b/tests/auto/network/ssl/qsslkey/BLACKLIST
@@ -0,0 +1 @@
+linux
diff --git a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
index d570037015..a7957d3288 100644
--- a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
+++ b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
@@ -39,7 +39,7 @@
#include <QtNetwork/qhostaddress.h>
#include <QtNetwork/qnetworkproxy.h>
-#if !defined(QT_NO_SSL) && defined(QT_NO_OPENSSL) && defined(QT_BUILD_INTERNAL)
+#if !defined(QT_NO_SSL) && defined(QT_BUILD_INTERNAL)
#include "private/qsslkey_p.h"
#define TEST_CRYPTO
#endif
diff --git a/tests/auto/network/ssl/qsslsocket/BLACKLIST b/tests/auto/network/ssl/qsslsocket/BLACKLIST
index 17b606e2be..4146a352e9 100644
--- a/tests/auto/network/ssl/qsslsocket/BLACKLIST
+++ b/tests/auto/network/ssl/qsslsocket/BLACKLIST
@@ -1,2 +1,3 @@
+windows
[waitForConnectedEncryptedReadyRead:WithSocks5ProxyAuth]
*
diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
index b95b72a41e..257df13343 100644
--- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -170,6 +170,9 @@ private slots:
void protocol();
void protocolServerSide_data();
void protocolServerSide();
+#ifndef QT_NO_OPENSSL
+ void serverCipherPreferences();
+#endif // QT_NO_OPENSSL
void setCaCertificates();
void setLocalCertificate();
void localCertificateChain();
@@ -463,7 +466,9 @@ void tst_QSslSocket::constructing()
QCOMPARE(socket.peerAddress(), QHostAddress());
QVERIFY(socket.peerName().isEmpty());
QCOMPARE(socket.peerPort(), quint16(0));
+#ifndef QT_NO_NETWORKPROXY
QCOMPARE(socket.proxy().type(), QNetworkProxy::DefaultProxy);
+#endif
QCOMPARE(socket.readBufferSize(), qint64(0));
QCOMPARE(socket.socketDescriptor(), (qintptr)-1);
QCOMPARE(socket.socketType(), QAbstractSocket::TcpSocket);
@@ -817,7 +822,7 @@ void tst_QSslSocket::peerCertificateChain()
this->socket = socket.data();
QList<QSslCertificate> caCertificates = QSslCertificate::fromPath(QLatin1String(SRCDIR "certs/qt-test-server-cacert.pem"));
- QVERIFY(caCertificates.count() == 1);
+ QCOMPARE(caCertificates.count(), 1);
socket->addCaCertificates(caCertificates);
#ifdef QSSLSOCKET_CERTUNTRUSTED_WORKAROUND
connect(socket.data(), SIGNAL(sslErrors(QList<QSslError>)),
@@ -863,7 +868,7 @@ void tst_QSslSocket::peerCertificateChain()
QSKIP("Skipping flaky test - See QTBUG-29941");
QCOMPARE(socket->peerCertificateChain().first(), socket->peerCertificate());
- QVERIFY(socket->peerCertificateChain() == certChain);
+ QCOMPARE(socket->peerCertificateChain(), certChain);
socket->disconnectFromHost();
QVERIFY(socket->waitForDisconnected());
@@ -1063,6 +1068,7 @@ public:
const QString &certFile = SRCDIR "certs/fluke.cert",
const QString &interFile = QString())
: socket(0),
+ config(QSslConfiguration::defaultConfiguration()),
ignoreSslErrors(true),
peerVerifyMode(QSslSocket::AutoVerifyPeer),
protocol(QSsl::TlsV1_0),
@@ -1071,6 +1077,7 @@ public:
m_interFile(interFile)
{ }
QSslSocket *socket;
+ QSslConfiguration config;
QString addCaCertificates;
bool ignoreSslErrors;
QSslSocket::PeerVerifyMode peerVerifyMode;
@@ -1084,6 +1091,7 @@ protected:
void incomingConnection(qintptr socketDescriptor)
{
socket = new QSslSocket(this);
+ socket->setSslConfiguration(config);
socket->setPeerVerifyMode(peerVerifyMode);
socket->setProtocol(protocol);
if (ignoreSslErrors)
@@ -1254,6 +1262,78 @@ void tst_QSslSocket::protocolServerSide()
QCOMPARE(client->isEncrypted(), works);
}
+#ifndef QT_NO_OPENSSL
+
+void tst_QSslSocket::serverCipherPreferences()
+{
+ if (!QSslSocket::supportsSsl()) {
+ qWarning("SSL not supported, skipping test");
+ return;
+ }
+
+ QFETCH_GLOBAL(bool, setProxy);
+ if (setProxy)
+ return;
+
+ // First using the default (server preference)
+ {
+ SslServer server;
+ server.ciphers = QString("AES128-SHA:AES256-SHA");
+ QVERIFY(server.listen());
+
+ QEventLoop loop;
+ QTimer::singleShot(5000, &loop, SLOT(quit()));
+
+ QSslSocketPtr client(new QSslSocket);
+ socket = client.data();
+ socket->setCiphers("AES256-SHA:AES128-SHA");
+
+ // upon SSL wrong version error, error will be triggered, not sslErrors
+ connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit()));
+ connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
+ connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit()));
+
+ client->connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
+
+ loop.exec();
+
+ QVERIFY(client->isEncrypted());
+ QCOMPARE(client->sessionCipher().name(), QString("AES128-SHA"));
+ }
+
+ {
+ // Now using the client preferences
+ SslServer server;
+ QSslConfiguration config = QSslConfiguration::defaultConfiguration();
+ config.setSslOption(QSsl::SslOptionDisableServerCipherPreference, true);
+ server.config = config;
+ server.ciphers = QString("AES128-SHA:AES256-SHA");
+ QVERIFY(server.listen());
+
+ QEventLoop loop;
+ QTimer::singleShot(5000, &loop, SLOT(quit()));
+
+ QSslSocketPtr client(new QSslSocket);
+ socket = client.data();
+ socket->setCiphers("AES256-SHA:AES128-SHA");
+
+ // upon SSL wrong version error, error will be triggered, not sslErrors
+ connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit()));
+ connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
+ connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit()));
+
+ client->connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
+
+ loop.exec();
+
+ QVERIFY(client->isEncrypted());
+ QCOMPARE(client->sessionCipher().name(), QString("AES256-SHA"));
+ }
+}
+
+#endif // QT_NO_OPENSSL
+
+
void tst_QSslSocket::setCaCertificates()
{
if (!QSslSocket::supportsSsl())
@@ -1655,7 +1735,7 @@ void tst_QSslSocket::spontaneousWrite()
QSslSocket *sender = server.socket;
QVERIFY(sender);
- QVERIFY(sender->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(sender->state(), QAbstractSocket::ConnectedState);
receiver->setObjectName("receiver");
sender->setObjectName("sender");
receiver->ignoreSslErrors();
@@ -1700,7 +1780,7 @@ void tst_QSslSocket::setReadBufferSize()
QSslSocket *sender = server.socket;
QVERIFY(sender);
- QVERIFY(sender->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(sender->state(), QAbstractSocket::ConnectedState);
receiver->setObjectName("receiver");
sender->setObjectName("sender");
receiver->ignoreSslErrors();
@@ -2109,6 +2189,7 @@ void tst_QSslSocket::disconnectFromHostWhenConnected()
void tst_QSslSocket::resetProxy()
{
+#ifndef QT_NO_NETWORKPROXY
QFETCH_GLOBAL(bool, setProxy);
if (setProxy)
return;
@@ -2148,6 +2229,7 @@ void tst_QSslSocket::resetProxy()
socket2.setProxy(goodProxy);
socket2.connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
QVERIFY2(socket2.waitForConnected(10000), qPrintable(socket.errorString()));
+#endif // QT_NO_NETWORKPROXY
}
void tst_QSslSocket::ignoreSslErrorsList_data()
@@ -2254,7 +2336,7 @@ void tst_QSslSocket::readFromClosedSocket()
socket->close();
QVERIFY(!socket->bytesAvailable());
QVERIFY(!socket->bytesToWrite());
- QVERIFY(socket->state() == QAbstractSocket::UnconnectedState);
+ QCOMPARE(socket->state(), QAbstractSocket::UnconnectedState);
}
void tst_QSslSocket::writeBigChunk()
@@ -2281,7 +2363,7 @@ void tst_QSslSocket::writeBigChunk()
QString errorBefore = socket->errorString();
int ret = socket->write(data.constData(), data.size());
- QVERIFY(data.size() == ret);
+ QCOMPARE(data.size(), ret);
// spin the event loop once so QSslSocket::transmit() gets called
QCoreApplication::processEvents();
@@ -2298,7 +2380,7 @@ void tst_QSslSocket::writeBigChunk()
QByteArray("unexpected error: ").append(qPrintable(errorAfter)));
// check that everything has been written to OpenSSL
- QVERIFY(socket->bytesToWrite() == 0);
+ QCOMPARE(socket->bytesToWrite(), 0);
socket->close();
}
@@ -2322,7 +2404,7 @@ void tst_QSslSocket::blacklistedCertificates()
QSslSocket *sender = server.socket;
QVERIFY(sender);
- QVERIFY(sender->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(sender->state(), QAbstractSocket::ConnectedState);
receiver->setObjectName("receiver");
sender->setObjectName("sender");
receiver->startClientEncryption();
@@ -2354,28 +2436,28 @@ void tst_QSslSocket::sslOptions()
#ifdef SSL_OP_NO_COMPRESSION
QCOMPARE(QSslSocketBackendPrivate::setupOpenSslOptions(QSsl::SecureProtocols,
QSslConfigurationPrivate::defaultSslOptions),
- long(SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_COMPRESSION));
+ long(SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_COMPRESSION|SSL_OP_CIPHER_SERVER_PREFERENCE));
#else
QCOMPARE(QSslSocketBackendPrivate::setupOpenSslOptions(QSsl::SecureProtocols,
QSslConfigurationPrivate::defaultSslOptions),
- long(SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3));
+ long(SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_CIPHER_SERVER_PREFERENCE));
#endif
QCOMPARE(QSslSocketBackendPrivate::setupOpenSslOptions(QSsl::SecureProtocols,
QSsl::SslOptionDisableEmptyFragments
|QSsl::SslOptionDisableLegacyRenegotiation),
- long(SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3));
+ long(SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_CIPHER_SERVER_PREFERENCE));
#ifdef SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION
QCOMPARE(QSslSocketBackendPrivate::setupOpenSslOptions(QSsl::SecureProtocols,
QSsl::SslOptionDisableEmptyFragments),
- long((SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)));
+ long((SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION|SSL_OP_CIPHER_SERVER_PREFERENCE)));
#endif
#ifdef SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
QCOMPARE(QSslSocketBackendPrivate::setupOpenSslOptions(QSsl::SecureProtocols,
QSsl::SslOptionDisableLegacyRenegotiation),
- long((SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3) & ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS));
+ long((SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_CIPHER_SERVER_PREFERENCE) & ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS));
#endif
#ifdef SSL_OP_NO_TICKET
@@ -2383,7 +2465,7 @@ void tst_QSslSocket::sslOptions()
QSsl::SslOptionDisableEmptyFragments
|QSsl::SslOptionDisableLegacyRenegotiation
|QSsl::SslOptionDisableSessionTickets),
- long((SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TICKET)));
+ long((SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TICKET|SSL_OP_CIPHER_SERVER_PREFERENCE)));
#endif
#ifdef SSL_OP_NO_TICKET
@@ -2393,7 +2475,7 @@ void tst_QSslSocket::sslOptions()
|QSsl::SslOptionDisableLegacyRenegotiation
|QSsl::SslOptionDisableSessionTickets
|QSsl::SslOptionDisableCompression),
- long((SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TICKET|SSL_OP_NO_COMPRESSION)));
+ long((SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TICKET|SSL_OP_NO_COMPRESSION|SSL_OP_CIPHER_SERVER_PREFERENCE)));
#endif
#endif
}
@@ -2648,9 +2730,9 @@ void tst_QSslSocket::qtbug18498_peek2()
while (client->bytesAvailable() < 7 && stopwatch.elapsed() < 5000)
QTest::qWait(100);
char c;
- QVERIFY(client->peek(&c,1) == 1);
+ QCOMPARE(client->peek(&c,1), 1);
QCOMPARE(c, 'H');
- QVERIFY(client->read(&c,1) == 1);
+ QCOMPARE(client->read(&c,1), 1);
QCOMPARE(c, 'H');
QByteArray b = client->peek(2);
QCOMPARE(b, QByteArray("EL"));
@@ -2686,7 +2768,7 @@ void tst_QSslSocket::qtbug18498_peek2()
// ### Qt5 use QTRY_VERIFY
while (server->bytesAvailable() < 10 && stopwatch.elapsed() < 5000)
QTest::qWait(100);
- QVERIFY(server->peek(&c,1) == 1);
+ QCOMPARE(server->peek(&c,1), 1);
QCOMPARE(c, 'S');
b = server->peek(3);
QCOMPARE(b, QByteArray("STA"));
@@ -2722,9 +2804,9 @@ void tst_QSslSocket::qtbug18498_peek2()
while (client->bytesAvailable() < 7 && stopwatch.elapsed() < 5000)
QTest::qWait(100);
QVERIFY(server->mode() == QSslSocket::SslServerMode && client->mode() == QSslSocket::SslClientMode);
- QVERIFY(client->peek(&c,1) == 1);
+ QCOMPARE(client->peek(&c,1), 1);
QCOMPARE(c, 'h');
- QVERIFY(client->read(&c,1) == 1);
+ QCOMPARE(client->read(&c,1), 1);
QCOMPARE(c, 'h');
b = client->peek(2);
QCOMPARE(b, QByteArray("el"));
@@ -2734,7 +2816,7 @@ void tst_QSslSocket::qtbug18498_peek2()
stopwatch.start();
while (server->bytesAvailable() < 9 && stopwatch.elapsed() < 5000)
QTest::qWait(100);
- QVERIFY(server->peek(&c,1) == 1);
+ QCOMPARE(server->peek(&c,1), 1);
QCOMPARE(c, 'g');
QCOMPARE(server->readAll(), QByteArray("goodbye\r\n"));
client->disconnectFromHost();
@@ -2768,7 +2850,7 @@ void tst_QSslSocket::dhServer()
client->connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
loop.exec();
- QVERIFY(client->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(client->state(), QAbstractSocket::ConnectedState);
}
void tst_QSslSocket::ecdhServer()
@@ -2798,7 +2880,7 @@ void tst_QSslSocket::ecdhServer()
client->connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort());
loop.exec();
- QVERIFY(client->state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(client->state(), QAbstractSocket::ConnectedState);
}
void tst_QSslSocket::verifyClientCertificate_data()
diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/BLACKLIST b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/BLACKLIST
new file mode 100644
index 0000000000..c9b628d79b
--- /dev/null
+++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/BLACKLIST
@@ -0,0 +1,2 @@
+[onDemandRootCertLoadingMemberMethods]
+linux
diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/BLACKLIST b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/BLACKLIST
new file mode 100644
index 0000000000..52bd2bc86d
--- /dev/null
+++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/BLACKLIST
@@ -0,0 +1,2 @@
+[onDemandRootCertLoadingStaticMethods:WithSocks5ProxyAuth]
+windows
diff --git a/tests/auto/opengl/qgl/BLACKLIST b/tests/auto/opengl/qgl/BLACKLIST
new file mode 100644
index 0000000000..fa7c829b30
--- /dev/null
+++ b/tests/auto/opengl/qgl/BLACKLIST
@@ -0,0 +1,16 @@
+[glWidgetRendering]
+windows
+[glFBORendering]
+windows
+[multipleFBOInterleavedRendering]
+windows
+[glPBufferRendering]
+windows
+[replaceClipping]
+windows
+[clipTest]
+windows
+[graphicsViewClipping]
+windows
+[glFBOUseInGLWidget]
+windows
diff --git a/tests/auto/opengl/qgl/tst_qgl.cpp b/tests/auto/opengl/qgl/tst_qgl.cpp
index 9bd82559b7..7970725355 100644
--- a/tests/auto/opengl/qgl/tst_qgl.cpp
+++ b/tests/auto/opengl/qgl/tst_qgl.cpp
@@ -459,113 +459,113 @@ void tst_QGL::getSetCheck()
QGLFormat format1;
QGLFormat format2;
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setDoubleBuffer(false);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setDoubleBuffer(false);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setDepthBufferSize(8);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setDepthBufferSize(8);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setAccumBufferSize(8);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setAccumBufferSize(8);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setRedBufferSize(8);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setRedBufferSize(8);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setGreenBufferSize(8);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setGreenBufferSize(8);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setBlueBufferSize(8);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setBlueBufferSize(8);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setAlphaBufferSize(8);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setAlphaBufferSize(8);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setStencilBufferSize(8);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setStencilBufferSize(8);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setSamples(8);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setSamples(8);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setSwapInterval(8);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setSwapInterval(8);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setPlane(8);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setPlane(8);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setVersion(3, 2);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setVersion(3, 2);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setProfile(QGLFormat::CoreProfile);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setProfile(QGLFormat::CoreProfile);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
format1.setOption(QGL::NoDeprecatedFunctions);
QVERIFY(!(format1 == format2));
QVERIFY(format1 != format2);
format2.setOption(QGL::NoDeprecatedFunctions);
- QVERIFY(format1 == format2);
+ QCOMPARE(format1, format2);
QVERIFY(!(format1 != format2));
// Copy constructor and assignment for QGLFormat.
QGLFormat format3(format1);
QGLFormat format4;
- QVERIFY(format1 == format3);
+ QCOMPARE(format1, format3);
QVERIFY(format1 != format4);
format4 = format1;
- QVERIFY(format1 == format4);
+ QCOMPARE(format1, format4);
// Check that modifying a copy doesn't affect the original.
format3.setRedBufferSize(16);
@@ -584,15 +584,15 @@ void tst_QGL::getSetCheck()
QCOMPARE(format5.plane(), 3);
// The default format should be the same as QGLFormat().
- QVERIFY(QGLFormat::defaultFormat() == QGLFormat());
+ QCOMPARE(QGLFormat::defaultFormat(), QGLFormat());
// Modify the default format and check that it was changed.
QGLFormat::setDefaultFormat(format1);
- QVERIFY(QGLFormat::defaultFormat() == format1);
+ QCOMPARE(QGLFormat::defaultFormat(), format1);
// Restore the default format.
QGLFormat::setDefaultFormat(QGLFormat());
- QVERIFY(QGLFormat::defaultFormat() == QGLFormat());
+ QCOMPARE(QGLFormat::defaultFormat(), QGLFormat());
// Check the default overlay format's expected values.
QGLFormat overlay(QGLFormat::defaultOverlayFormat());
@@ -618,11 +618,11 @@ void tst_QGL::getSetCheck()
// Modify the default overlay format and check that it was changed.
QGLFormat::setDefaultOverlayFormat(format1);
- QVERIFY(QGLFormat::defaultOverlayFormat() == format1);
+ QCOMPARE(QGLFormat::defaultOverlayFormat(), format1);
// Restore the default overlay format.
QGLFormat::setDefaultOverlayFormat(overlay);
- QVERIFY(QGLFormat::defaultOverlayFormat() == overlay);
+ QCOMPARE(QGLFormat::defaultOverlayFormat(), overlay);
MyGLContext obj2(obj1);
// bool QGLContext::windowCreated()
@@ -1512,9 +1512,9 @@ void tst_QGL::colormap()
QGLColormap cmap1;
QVERIFY(cmap1.isEmpty());
QCOMPARE(cmap1.size(), 0);
- QVERIFY(cmap1.entryRgb(0) == 0);
- QVERIFY(cmap1.entryRgb(-1) == 0);
- QVERIFY(cmap1.entryRgb(100) == 0);
+ QCOMPARE(cmap1.entryRgb(0), QRgb(0));
+ QCOMPARE(cmap1.entryRgb(-1), QRgb(0));
+ QCOMPARE(cmap1.entryRgb(100), QRgb(0));
QVERIFY(!cmap1.entryColor(0).isValid());
QVERIFY(!cmap1.entryColor(-1).isValid());
QVERIFY(!cmap1.entryColor(100).isValid());
@@ -1529,7 +1529,7 @@ void tst_QGL::colormap()
// not to detect when it is empty!
QVERIFY(cmap1.isEmpty());
QCOMPARE(cmap1.size(), 256);
- QVERIFY(cmap1.entryRgb(0) == 0);
+ QCOMPARE(cmap1.entryRgb(0), QRgb(0));
QVERIFY(cmap1.entryColor(0) == QColor(0, 0, 0, 255));
QVERIFY(cmap1.entryRgb(56) == qRgb(255, 0, 0));
QVERIFY(cmap1.entryColor(56) == QColor(255, 0, 0, 255));
@@ -1611,7 +1611,7 @@ void tst_QGL::colormap()
QVERIFY(cmap4.isEmpty());
QCOMPARE(cmap4.size(), 256);
cmap4.setHandle(Qt::HANDLE(42));
- QVERIFY(cmap4.handle() == Qt::HANDLE(42));
+ QCOMPARE(cmap4.handle(), Qt::HANDLE(42));
QVERIFY(!cmap4.isEmpty());
QCOMPARE(cmap4.size(), 256);
}
@@ -1629,7 +1629,7 @@ void tst_QGL::fboFormat()
// Check the initial conditions.
QGLFramebufferObjectFormat format1;
QCOMPARE(format1.samples(), 0);
- QVERIFY(format1.attachment() == QGLFramebufferObject::NoAttachment);
+ QCOMPARE(format1.attachment(), QGLFramebufferObject::NoAttachment);
QCOMPARE(int(format1.textureTarget()), int(GL_TEXTURE_2D));
int expectedFormat =
#ifdef QT_OPENGL_ES_2
@@ -1645,7 +1645,7 @@ void tst_QGL::fboFormat()
format1.setTextureTarget(GL_TEXTURE_3D);
format1.setInternalTextureFormat(GL_RGB16);
QCOMPARE(format1.samples(), 8);
- QVERIFY(format1.attachment() == QGLFramebufferObject::CombinedDepthStencil);
+ QCOMPARE(format1.attachment(), QGLFramebufferObject::CombinedDepthStencil);
QCOMPARE(int(format1.textureTarget()), int(GL_TEXTURE_3D));
QCOMPARE(int(format1.internalTextureFormat()), int(GL_RGB16));
@@ -1653,12 +1653,12 @@ void tst_QGL::fboFormat()
QGLFramebufferObjectFormat format2(format1);
QGLFramebufferObjectFormat format3;
QCOMPARE(format2.samples(), 8);
- QVERIFY(format2.attachment() == QGLFramebufferObject::CombinedDepthStencil);
+ QCOMPARE(format2.attachment(), QGLFramebufferObject::CombinedDepthStencil);
QCOMPARE(int(format2.textureTarget()), int(GL_TEXTURE_3D));
QCOMPARE(int(format2.internalTextureFormat()), int(GL_RGB16));
format3 = format1;
QCOMPARE(format3.samples(), 8);
- QVERIFY(format3.attachment() == QGLFramebufferObject::CombinedDepthStencil);
+ QCOMPARE(format3.attachment(), QGLFramebufferObject::CombinedDepthStencil);
QCOMPARE(int(format3.textureTarget()), int(GL_TEXTURE_3D));
QCOMPARE(int(format3.internalTextureFormat()), int(GL_RGB16));
@@ -1666,7 +1666,7 @@ void tst_QGL::fboFormat()
format2.setSamples(9);
format3.setTextureTarget(GL_TEXTURE_2D);
QCOMPARE(format1.samples(), 8);
- QVERIFY(format1.attachment() == QGLFramebufferObject::CombinedDepthStencil);
+ QCOMPARE(format1.attachment(), QGLFramebufferObject::CombinedDepthStencil);
QCOMPARE(int(format1.textureTarget()), int(GL_TEXTURE_3D));
QCOMPARE(int(format1.internalTextureFormat()), int(GL_RGB16));
@@ -1674,39 +1674,39 @@ void tst_QGL::fboFormat()
QGLFramebufferObjectFormat format1c;
QGLFramebufferObjectFormat format2c;
- QVERIFY(format1c == format2c);
+ QCOMPARE(format1c, format2c);
QVERIFY(!(format1c != format2c));
format1c.setSamples(8);
QVERIFY(!(format1c == format2c));
QVERIFY(format1c != format2c);
format2c.setSamples(8);
- QVERIFY(format1c == format2c);
+ QCOMPARE(format1c, format2c);
QVERIFY(!(format1c != format2c));
format1c.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
QVERIFY(!(format1c == format2c));
QVERIFY(format1c != format2c);
format2c.setAttachment(QGLFramebufferObject::CombinedDepthStencil);
- QVERIFY(format1c == format2c);
+ QCOMPARE(format1c, format2c);
QVERIFY(!(format1c != format2c));
format1c.setTextureTarget(GL_TEXTURE_3D);
QVERIFY(!(format1c == format2c));
QVERIFY(format1c != format2c);
format2c.setTextureTarget(GL_TEXTURE_3D);
- QVERIFY(format1c == format2c);
+ QCOMPARE(format1c, format2c);
QVERIFY(!(format1c != format2c));
format1c.setInternalTextureFormat(GL_RGB16);
QVERIFY(!(format1c == format2c));
QVERIFY(format1c != format2c);
format2c.setInternalTextureFormat(GL_RGB16);
- QVERIFY(format1c == format2c);
+ QCOMPARE(format1c, format2c);
QVERIFY(!(format1c != format2c));
QGLFramebufferObjectFormat format3c(format1c);
QGLFramebufferObjectFormat format4c;
- QVERIFY(format1c == format3c);
+ QCOMPARE(format1c, format3c);
QVERIFY(!(format1c != format3c));
format3c.setInternalTextureFormat(
#ifdef QT_OPENGL_ES_2
@@ -1719,7 +1719,7 @@ void tst_QGL::fboFormat()
QVERIFY(format1c != format3c);
format4c = format1c;
- QVERIFY(format1c == format4c);
+ QCOMPARE(format1c, format4c);
QVERIFY(!(format1c != format4c));
format4c.setInternalTextureFormat(
#ifdef QT_OPENGL_ES_2
@@ -1947,7 +1947,7 @@ void tst_QGL::destroyFBOAfterContext()
delete glw;
// The handle should now be zero.
- QVERIFY(fbo->handle() == 0);
+ QVERIFY(!fbo->handle());
QVERIFY(!fbo->isValid());
delete fbo;
@@ -1984,14 +1984,14 @@ void tst_QGL::shareRegister()
// Create a guard for the first context.
QOpenGLSharedResourceGuard guard(glw1->context()->contextHandle());
- QVERIFY(guard.id() == 0);
+ QCOMPARE(guard.id(), 0);
guard.setId(3);
- QVERIFY(guard.id() == 3);
+ QCOMPARE(guard.id(), 3);
// Request a tst_QGLResource object for the first context.
tst_QGLResource *res1 = qt_shared_test()->value(glw1->context()->contextHandle());
QVERIFY(res1);
- QVERIFY(qt_shared_test()->value(glw1->context()->contextHandle()) == res1);
+ QCOMPARE(qt_shared_test()->value(glw1->context()->contextHandle()), res1);
// Create another context that shares with the first.
QVERIFY(!glw1->isSharing());
@@ -2005,12 +2005,12 @@ void tst_QGL::shareRegister()
QVERIFY(glw1->context() != glw2->context());
// Check that the first context's resource is also on the second.
- QVERIFY(qt_shared_test()->value(glw1->context()) == res1);
- QVERIFY(qt_shared_test()->value(glw2->context()) == res1);
+ QCOMPARE(qt_shared_test()->value(glw1->context()), res1);
+ QCOMPARE(qt_shared_test()->value(glw2->context()), res1);
// Guard should still be the same.
- QVERIFY(guard.context() == glw1->context());
- QVERIFY(guard.id() == 3);
+ QCOMPARE(guard.context(), glw1->context());
+ QCOMPARE(guard.id(), 3);
// Check the sharing relationships.
QVERIFY(QGLContext::areSharing(glw1->context(), glw1->context()));
@@ -2032,9 +2032,9 @@ void tst_QGL::shareRegister()
// Request a resource to the third context.
tst_QGLResource *res3 = qt_shared_test()->value(glw3->context());
QVERIFY(res3);
- QVERIFY(qt_shared_test()->value(glw1->context()) == res1);
- QVERIFY(qt_shared_test()->value(glw2->context()) == res1);
- QVERIFY(qt_shared_test()->value(glw3->context()) == res3);
+ QCOMPARE(qt_shared_test()->value(glw1->context()), res1);
+ QCOMPARE(qt_shared_test()->value(glw2->context()), res1);
+ QCOMPARE(qt_shared_test()->value(glw3->context()), res3);
// Check the sharing relationships again.
QVERIFY(QGLContext::areSharing(glw1->context(), glw1->context()));
@@ -2053,8 +2053,8 @@ void tst_QGL::shareRegister()
QVERIFY(!QGLContext::areSharing(0, 0));
// Shared guard should still be the same.
- QVERIFY(guard.context() == glw1->context());
- QVERIFY(guard.id() == 3);
+ QCOMPARE(guard.context(), glw1->context());
+ QCOMPARE(guard.id(), 3);
// Delete the first context.
delete glw1;
@@ -2064,14 +2064,14 @@ void tst_QGL::shareRegister()
// The first context's resource should transfer to the second context.
QCOMPARE(tst_QGLResource::deletions, 0);
- QVERIFY(qt_shared_test()->value(glw2->context()) == res1);
- QVERIFY(qt_shared_test()->value(glw3->context()) == res3);
+ QCOMPARE(qt_shared_test()->value(glw2->context()), res1);
+ QCOMPARE(qt_shared_test()->value(glw3->context()), res3);
// Shared guard should now be the second context, with the id the same.
- QVERIFY(guard.context() == glw2->context());
- QVERIFY(guard.id() == 3);
- QVERIFY(guard3.context() == glw3->context());
- QVERIFY(guard3.id() == 5);
+ QCOMPARE(guard.context(), glw2->context());
+ QCOMPARE(guard.id(), 3);
+ QCOMPARE(guard3.context(), glw3->context());
+ QCOMPARE(guard3.id(), 5);
// Clean up and check that the resources are properly deleted.
delete glw2;
@@ -2115,25 +2115,25 @@ void tst_QGL::qglContextDefaultBindTexture()
QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions();
// Make sure the texture IDs returned are valid:
- QCOMPARE((bool)funcs->glIsTexture(boundImageTextureId), GL_TRUE);
- QCOMPARE((bool)funcs->glIsTexture(boundPixmapTextureId), GL_TRUE);
+ QCOMPARE(funcs->glIsTexture(boundImageTextureId), GLboolean(GL_TRUE));
+ QCOMPARE(funcs->glIsTexture(boundPixmapTextureId), GLboolean(GL_TRUE));
// Make sure the textures are still valid after we delete the image/pixmap:
// Also check that although the textures are left intact, the cache entries are removed:
delete boundImage;
boundImage = 0;
- QCOMPARE((bool)funcs->glIsTexture(boundImageTextureId), GL_TRUE);
+ QCOMPARE(funcs->glIsTexture(boundImageTextureId), GLboolean(GL_TRUE));
QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount+1);
delete boundPixmap;
boundPixmap = 0;
- QCOMPARE((bool)funcs->glIsTexture(boundPixmapTextureId), GL_TRUE);
+ QCOMPARE(funcs->glIsTexture(boundPixmapTextureId), GLboolean(GL_TRUE));
QCOMPARE(QGLTextureCache::instance()->size(), startCacheItemCount);
// Finally, make sure QGLContext::deleteTexture deletes the texture IDs:
ctx->deleteTexture(boundImageTextureId);
ctx->deleteTexture(boundPixmapTextureId);
- QCOMPARE((bool)funcs->glIsTexture(boundImageTextureId), GL_FALSE);
- QCOMPARE((bool)funcs->glIsTexture(boundPixmapTextureId), GL_FALSE);
+ QCOMPARE(funcs->glIsTexture(boundImageTextureId), GLboolean(GL_FALSE));
+ QCOMPARE(funcs->glIsTexture(boundPixmapTextureId), GLboolean(GL_FALSE));
}
#endif
diff --git a/tests/auto/opengl/qglbuffer/tst_qglbuffer.cpp b/tests/auto/opengl/qglbuffer/tst_qglbuffer.cpp
index b0409d46d0..f96e3514a7 100644
--- a/tests/auto/opengl/qglbuffer/tst_qglbuffer.cpp
+++ b/tests/auto/opengl/qglbuffer/tst_qglbuffer.cpp
@@ -86,14 +86,14 @@ void tst_QGLBuffer::testBuffer(QGLBuffer::Type type)
// Create the local object, but not the buffer in the server.
QGLBuffer buffer(type);
- QVERIFY(buffer.usagePattern() == QGLBuffer::StaticDraw);
+ QCOMPARE(buffer.usagePattern(), QGLBuffer::StaticDraw);
buffer.setUsagePattern(QGLBuffer::UsagePattern(usagePattern));
// Check the initial state.
- QVERIFY(buffer.type() == type);
+ QCOMPARE(buffer.type(), type);
QVERIFY(!buffer.isCreated());
- QVERIFY(buffer.bufferId() == 0);
- QVERIFY(buffer.usagePattern() == QGLBuffer::UsagePattern(usagePattern));
+ QCOMPARE(buffer.bufferId(), GLuint(0));
+ QCOMPARE(buffer.usagePattern(), QGLBuffer::UsagePattern(usagePattern));
QCOMPARE(buffer.size(), -1);
// Should not be able to bind it yet because it isn't created.
@@ -253,7 +253,7 @@ void tst_QGLBuffer::bufferSharing()
delete w2;
// The buffer should now be invalid.
- QVERIFY(buffer.bufferId() == 0);
+ QCOMPARE(buffer.bufferId(), GLuint(0));
QVERIFY(!buffer.isCreated());
}
diff --git a/tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp b/tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp
index 866cd57381..07fdba4664 100644
--- a/tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp
+++ b/tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp
@@ -200,13 +200,13 @@ void tst_QGLFunctions::multitexture()
GLint active = 0;
funcs.glGetIntegerv(GL_ACTIVE_TEXTURE, &active);
- QVERIFY(active == GL_TEXTURE1);
+ QCOMPARE(active, GL_TEXTURE1);
funcs.glActiveTexture(GL_TEXTURE0);
active = 0;
funcs.glGetIntegerv(GL_ACTIVE_TEXTURE, &active);
- QVERIFY(active == GL_TEXTURE0);
+ QCOMPARE(active, GL_TEXTURE0);
}
// Verify that the glBlendColor() function appears to resolve and work.
diff --git a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
index ff5a18dedb..6a726ac62d 100644
--- a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
+++ b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
@@ -796,7 +796,6 @@ void tst_QGLThreads::painterOnFboInThread()
int main(int argc, char **argv)
{
- QApplication::setAttribute(Qt::AA_X11InitThreads);
QApplication app(argc, argv);
QTEST_DISABLE_KEYPAD_NAVIGATION \
diff --git a/tests/auto/other/compiler/compiler.pro b/tests/auto/other/compiler/compiler.pro
index 213429050f..356013c8f1 100644
--- a/tests/auto/other/compiler/compiler.pro
+++ b/tests/auto/other/compiler/compiler.pro
@@ -3,7 +3,8 @@ TARGET = tst_compiler
SOURCES += tst_compiler.cpp baseclass.cpp derivedclass.cpp othersource.cpp
HEADERS += baseclass.h derivedclass.h
QT = core testlib
-contains(QT_CONFIG, c++11): CONFIG += c++14 c++11
+contains(QT_CONFIG, c++11): CONFIG += c++11
+contains(QT_CONFIG, c++14): CONFIG += c++14
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/other/compiler/tst_compiler.cpp b/tests/auto/other/compiler/tst_compiler.cpp
index 8f7dcdb3c5..af0fa4682d 100644
--- a/tests/auto/other/compiler/tst_compiler.cpp
+++ b/tests/auto/other/compiler/tst_compiler.cpp
@@ -336,17 +336,17 @@ struct Qxxx {};
void tst_Compiler::detectDataStream()
{
- QVERIFY(QtTestInternal::DataStreamChecker<int>::HasDataStream == true);
- QVERIFY(QtTestInternal::DataStreamChecker<uint>::HasDataStream == true);
+ QVERIFY(QtTestInternal::DataStreamChecker<int>::HasDataStream);
+ QVERIFY(QtTestInternal::DataStreamChecker<uint>::HasDataStream);
QVERIFY(QtTestInternal::DataStreamChecker<char *>::HasDataStream == true);
QVERIFY(QtTestInternal::DataStreamChecker<const int>::HasInDataStream == true);
QVERIFY(QtTestInternal::DataStreamChecker<const int>::HasOutDataStream == false);
QVERIFY(QtTestInternal::DataStreamChecker<const int>::HasDataStream == false);
- QVERIFY(QtTestInternal::DataStreamChecker<double>::HasDataStream == true);
+ QVERIFY(QtTestInternal::DataStreamChecker<double>::HasDataStream);
- QVERIFY(QtTestInternal::DataStreamChecker<QString>::HasDataStream == true);
- QVERIFY(QtTestInternal::DataStreamChecker<MyString>::HasDataStream == true);
- QVERIFY(QtTestInternal::DataStreamChecker<Qxxx>::HasDataStream == false);
+ QVERIFY(QtTestInternal::DataStreamChecker<QString>::HasDataStream);
+ QVERIFY(QtTestInternal::DataStreamChecker<MyString>::HasDataStream);
+ QVERIFY(!QtTestInternal::DataStreamChecker<Qxxx>::HasDataStream);
QVERIFY(QtTestInternal::getSaveOperator<int>() != 0);
QVERIFY(QtTestInternal::getSaveOperator<uint>() != 0);
@@ -354,7 +354,7 @@ void tst_Compiler::detectDataStream()
QVERIFY(QtTestInternal::getSaveOperator<double>() != 0);
QVERIFY(QtTestInternal::getSaveOperator<QString>() != 0);
QVERIFY(QtTestInternal::getSaveOperator<MyString>() != 0);
- QVERIFY(QtTestInternal::getSaveOperator<Qxxx>() == 0);
+ QVERIFY(!QtTestInternal::getSaveOperator<Qxxx>());
}
#else
void tst_Compiler::detectDataStream()
@@ -637,7 +637,8 @@ void tst_Compiler::cxx11_alignas()
QSKIP("Compiler does not support C++11 feature");
#else
alignas(double) char c;
- QVERIFY(Q_ALIGNOF(c) == Q_ALIGNOF(double));
+ Q_UNUSED(c);
+ QCOMPARE(Q_ALIGNOF(c), Q_ALIGNOF(double));
#endif
}
@@ -978,6 +979,20 @@ void tst_Compiler::cxx11_nullptr()
#endif
}
+namespace SomeNamespace {
+class AdlOnly {
+ QVector<int> v;
+public:
+ AdlOnly() : v(5) { std::fill_n(v.begin(), v.size(), 42); }
+
+private:
+ friend QVector<int>::const_iterator begin(const AdlOnly &x) { return x.v.begin(); }
+ friend QVector<int>::const_iterator end(const AdlOnly &x) { return x.v.end(); }
+ friend QVector<int>::iterator begin(AdlOnly &x) { return x.v.begin(); }
+ friend QVector<int>::iterator end(AdlOnly &x) { return x.v.end(); }
+};
+}
+
void tst_Compiler::cxx11_range_for()
{
#ifndef Q_COMPILER_RANGE_FOR
@@ -997,6 +1012,85 @@ void tst_Compiler::cxx11_range_for()
l << 2;
for (int i : ll)
QCOMPARE(i, 2);
+
+ {
+ const int array[] = { 0, 1, 2, 3, 4 };
+ int i = 0;
+ for (const int &e : array)
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (int e : array)
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (const int e : array)
+ QCOMPARE(e, array[i++]);
+#ifdef Q_COMPILER_AUTO_TYPE
+ i = 0;
+ for (const auto &e : array)
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (auto &e : array) // auto deducing const
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (auto e : array)
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (const auto e : array)
+ QCOMPARE(e, array[i++]);
+#endif
+ }
+
+ {
+ int array[] = { 0, 1, 2, 3, 4 };
+ const int array2[] = { 10, 11, 12, 13, 14 };
+ int i = 0;
+ for (const int &e : array)
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (int &e : array)
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (int e : array)
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (const int e : array)
+ QCOMPARE(e, array[i++]);
+#ifdef Q_COMPILER_AUTO_TYPE
+ i = 0;
+ for (const auto &e : array)
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (auto &e : array)
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (auto e : array)
+ QCOMPARE(e, array[i++]);
+ i = 0;
+ for (const auto e : array)
+ QCOMPARE(e, array[i++]);
+#endif
+ for (int &e : array)
+ e += 10;
+ i = 0;
+ for (const int &e : array)
+ QCOMPARE(e, array2[i++]);
+ }
+
+ {
+ const SomeNamespace::AdlOnly x;
+ for (const int &e : x)
+ QCOMPARE(e, 42);
+ }
+
+ {
+ SomeNamespace::AdlOnly x;
+ for (const int &e : x)
+ QCOMPARE(e, 42);
+ for (int &e : x)
+ e += 10;
+ for (const int &e : x)
+ QCOMPARE(e, 52);
+ }
#endif
}
@@ -1034,24 +1128,88 @@ void tst_Compiler::cxx11_ref_qualifiers()
#endif
}
+class MoveDefinedQString {
+ QString s;
+public:
+ MoveDefinedQString() : s() {}
+ explicit MoveDefinedQString(const QString &s) : s(s) {}
+ MoveDefinedQString(const MoveDefinedQString &other) : s(other.s) {}
+#ifdef Q_COMPILER_RVALUE_REFS
+ MoveDefinedQString(MoveDefinedQString &&other) : s(std::move(other.s)) { other.s.clear(); }
+ MoveDefinedQString &operator=(MoveDefinedQString &&other)
+ { s = std::move(other.s); other.s.clear(); return *this; }
+#endif
+ MoveDefinedQString &operator=(const MoveDefinedQString &other) { s = other.s; return *this; }
+
+private:
+ friend bool operator==(const MoveDefinedQString &lhs, const MoveDefinedQString &rhs)
+ { return lhs.s == rhs.s; }
+ friend bool operator!=(const MoveDefinedQString &lhs, const MoveDefinedQString &rhs)
+ { return !operator==(lhs, rhs); }
+ friend char* toString(const MoveDefinedQString &mds)
+ { using namespace QTest; return toString(mds.s); }
+};
+
void tst_Compiler::cxx11_rvalue_refs()
{
#ifndef Q_COMPILER_RVALUE_REFS
QSKIP("Compiler does not support C++11 feature");
#else
- int i = 1;
- i = std::move(i);
-
- QString s = "Hello";
- QString t = std::move(s);
- QCOMPARE(t, QString("Hello"));
+ // we require std::move:
+ {
+ int i = 1;
+ i = std::move(i);
+
+ MoveDefinedQString s("Hello");
+ MoveDefinedQString t = std::move(s);
+ QCOMPARE(t, MoveDefinedQString("Hello"));
+ QCOMPARE(s, MoveDefinedQString());
+
+ s = t;
+ t = std::move(s);
+ QCOMPARE(t, MoveDefinedQString("Hello"));
+ QCOMPARE(s, MoveDefinedQString());
+
+ MoveDefinedQString &&r = std::move(t); // no actual move!
+ QCOMPARE(r, MoveDefinedQString("Hello"));
+ QCOMPARE(t, MoveDefinedQString("Hello")); // so 't' is unchanged
+ }
- s = t;
- t = std::move(s);
- QCOMPARE(t, QString("Hello"));
+ // we require std::forward:
+ {
+ MoveDefinedQString s("Hello");
+ MoveDefinedQString s2 = std::forward<MoveDefinedQString>(s); // forward as rvalue
+ QCOMPARE(s2, MoveDefinedQString("Hello"));
+ QCOMPARE(s, MoveDefinedQString());
+
+ MoveDefinedQString s3 = std::forward<MoveDefinedQString&>(s2); // forward as lvalue
+ QCOMPARE(s2, MoveDefinedQString("Hello"));
+ QCOMPARE(s3, MoveDefinedQString("Hello"));
+ }
- QString &&r = std::move(s);
- QCOMPARE(r, QString("Hello"));
+ // supported by MSVC only from November 2013 CTP, but only check for VC2015:
+# if !defined(Q_CC_MSVC) || defined(Q_CC_INTEL) || _MSC_VER >= 1900 // VS14 == VC2015
+ // we require automatic generation of move special member functions:
+ {
+ struct M { MoveDefinedQString s1, s2; };
+ M m1 = { MoveDefinedQString("Hello"), MoveDefinedQString("World") };
+ QCOMPARE(m1.s1, MoveDefinedQString("Hello"));
+ QCOMPARE(m1.s2, MoveDefinedQString("World"));
+ M m2 = std::move(m1);
+ QCOMPARE(m1.s1, MoveDefinedQString());
+ QCOMPARE(m1.s2, MoveDefinedQString());
+ QCOMPARE(m2.s1, MoveDefinedQString("Hello"));
+ QCOMPARE(m2.s2, MoveDefinedQString("World"));
+ M m3;
+ QCOMPARE(m3.s1, MoveDefinedQString());
+ QCOMPARE(m3.s2, MoveDefinedQString());
+ m3 = std::move(m2);
+ QCOMPARE(m2.s1, MoveDefinedQString());
+ QCOMPARE(m2.s2, MoveDefinedQString());
+ QCOMPARE(m3.s1, MoveDefinedQString("Hello"));
+ QCOMPARE(m3.s2, MoveDefinedQString("World"));
+ }
+# endif // MSVC < 2015
#endif
}
@@ -1264,9 +1422,11 @@ void tst_Compiler::cxx14_decltype_auto()
}
#if __cpp_return_type_deduction >= 201304
-auto returnTypeDeduction()
+auto returnTypeDeduction(bool choice)
{
- return 1U;
+ if (choice)
+ return 1U;
+ return returnTypeDeduction(!choice);
}
#endif
@@ -1275,7 +1435,7 @@ void tst_Compiler::cxx14_return_type_deduction()
#if __cpp_return_type_deduction-0 < 201304
QSKIP("Compiler does not support this C++14 feature");
#else
- QCOMPARE(returnTypeDeduction(), 1U);
+ QCOMPARE(returnTypeDeduction(false), 1U);
#endif
}
diff --git a/tests/auto/other/gestures/BLACKLIST b/tests/auto/other/gestures/BLACKLIST
new file mode 100644
index 0000000000..4e8745ca78
--- /dev/null
+++ b/tests/auto/other/gestures/BLACKLIST
@@ -0,0 +1,2 @@
+[customGesture]
+opensuse-13.1
diff --git a/tests/auto/other/gestures/tst_gestures.cpp b/tests/auto/other/gestures/tst_gestures.cpp
index 43ce6b2d72..6db918cffd 100644
--- a/tests/auto/other/gestures/tst_gestures.cpp
+++ b/tests/auto/other/gestures/tst_gestures.cpp
@@ -48,6 +48,24 @@
#include <qdebug.h>
+static bool waitForWindowExposed(QWindow *window)
+{
+ if (!window)
+ return false;
+#ifdef Q_OS_OSX
+ QTest::qWait(100);
+ return window->isExposed();
+#endif
+ return QTest::qWaitForWindowExposed(window);
+}
+
+static bool waitForWindowExposed(QWidget *widget)
+{
+ if (!widget)
+ return false;
+ return waitForWindowExposed(widget->windowHandle());
+}
+
static QPointF mapToGlobal(const QPointF &pt, QGraphicsItem *item, QGraphicsView *view)
{
return view->viewport()->mapToGlobal(view->mapFromScene(item->mapToScene(pt)));
@@ -387,7 +405,7 @@ void tst_Gestures::customGesture()
GestureWidget widget;
widget.grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
widget.show();
- QVERIFY(QTest::qWaitForWindowExposed(&widget));
+ QVERIFY(waitForWindowExposed(&widget));
CustomEvent event;
event.hotSpot = widget.mapToGlobal(QPoint(5,5));
@@ -856,7 +874,7 @@ void tst_Gestures::graphicsItemGesture()
item->setPos(100, 100);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item->grabGesture(CustomGesture::GestureType);
@@ -918,7 +936,7 @@ void tst_Gestures::graphicsView()
item->setPos(100, 100);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item->grabGesture(CustomGesture::GestureType);
@@ -994,7 +1012,7 @@ void tst_Gestures::graphicsItemTreeGesture()
item1_child2->setParentItem(item1);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item1->grabGesture(CustomGesture::GestureType);
@@ -1051,7 +1069,7 @@ void tst_Gestures::explicitGraphicsObjectTarget()
item2_child1->setPos(10, 10);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item1->grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
@@ -1110,7 +1128,7 @@ void tst_Gestures::gestureOverChildGraphicsItem()
item2_child1->setPos(0, 0);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item1->grabGesture(CustomGesture::GestureType);
@@ -1408,7 +1426,7 @@ void tst_Gestures::testMapToScene()
item0->setPos(14, 16);
view.show(); // need to show to give it a global coordinate
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
QPoint origin = view.mapToGlobal(QPoint());
@@ -1461,7 +1479,7 @@ void tst_Gestures::ungrabGesture() // a method on QWidget
QPointer<QGesture> customGestureB;
customGestureB = *(b->gestures.begin());
QVERIFY(!customGestureB.isNull());
- QVERIFY(customGestureA.data() == customGestureB.data());
+ QCOMPARE(customGestureA.data(), customGestureB.data());
QCOMPARE(customGestureB->gestureType(), CustomGesture::GestureType);
a->gestures.clear();
@@ -1534,7 +1552,7 @@ void tst_Gestures::autoCancelGestures()
parent.grabGesture(CustomGesture::GestureType);
child->grabGesture(secondGesture);
parent.show();
- QVERIFY(QTest::qWaitForWindowExposed(&parent));
+ QVERIFY(waitForWindowExposed(&parent));
/*
An event is sent to both the child and the parent, when the child gets it a gesture is triggered
@@ -1593,7 +1611,7 @@ void tst_Gestures::autoCancelGestures2()
child->grabGesture(secondGesture);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
CustomEvent event;
@@ -1639,7 +1657,7 @@ void tst_Gestures::graphicsViewParentPropagation()
item1_c1_c1->setPos(0, 0);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item0->grabGesture(CustomGesture::GestureType, Qt::ReceivePartialGestures | Qt::IgnoredGesturesPropagateToParent);
@@ -1709,7 +1727,7 @@ void tst_Gestures::panelPropagation()
item1_child1_child1->setZValue(10);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
static const int TotalGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialStartedThreshold + 1;
@@ -1820,7 +1838,7 @@ void tst_Gestures::panelStacksBehindParent()
panel->setZValue(5);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
static const int TotalGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialStartedThreshold + 1;
@@ -1904,7 +1922,7 @@ void tst_Gestures::deleteGestureTargetItem()
items.insert(item2->objectName(), item2);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
if (propagateUpdateGesture)
@@ -1949,7 +1967,7 @@ void tst_Gestures::viewportCoordinates()
scene.addItem(item1);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
CustomEvent event;
@@ -1986,7 +2004,7 @@ void tst_Gestures::partialGesturePropagation()
scene.addItem(item4);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
item1->ignoredUpdatedGestures << CustomGesture::GestureType;
@@ -2074,7 +2092,7 @@ void tst_Gestures::testQGestureRecognizerCleanup()
//QGestureRecognizer::registerRecognizer(new PanRecognizer(PanRecognizer::Custom));
w->show();
- QVERIFY(QTest::qWaitForWindowExposed(w));
+ QVERIFY(waitForWindowExposed(w));
delete w;
}
@@ -2195,7 +2213,7 @@ void tst_Gestures::testReuseCanceledGestures()
gv->viewport()->grabGesture(tapGestureTypeId);
mw.show();
- QVERIFY(QTest::qWaitForWindowExposed(&mw));
+ QVERIFY(waitForWindowExposed(&mw));
QPoint targetPos(gv->mapFromScene(target->mapToScene(target->rect().center())));
targetPos = gv->viewport()->mapFromParent(targetPos);
@@ -2261,7 +2279,7 @@ void tst_Gestures::conflictingGesturesInGraphicsView()
scene.addItem(item2);
view.show();
- QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QVERIFY(waitForWindowExposed(&view));
view.ensureVisible(scene.sceneRect());
static const int TotalGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialStartedThreshold + 1;
@@ -2326,7 +2344,7 @@ void tst_Gestures::bug_13501_gesture_not_accepted()
NoConsumeWidgetBug13501 w;
w.grabGesture(Qt::TapGesture);
w.show();
- QVERIFY(QTest::qWaitForWindowExposed(&w));
+ QVERIFY(waitForWindowExposed(&w));
//QTest::mousePress(&ignoreEvent, Qt::LeftButton);
QTouchDevice *device = new QTouchDevice;
device->setType(QTouchDevice::TouchScreen);
diff --git a/tests/auto/other/lancelot/tst_lancelot.cpp b/tests/auto/other/lancelot/tst_lancelot.cpp
index 6da3d06ba8..3022114403 100644
--- a/tests/auto/other/lancelot/tst_lancelot.cpp
+++ b/tests/auto/other/lancelot/tst_lancelot.cpp
@@ -259,13 +259,9 @@ void tst_Lancelot::paint(QPaintDevice *device, GraphicsEngine engine, const QStr
QTEST_MAIN(tst_Lancelot)
#undef main
-QT_BEGIN_NAMESPACE
-extern Q_DECL_IMPORT QBasicAtomicInt qt_qhash_seed; // from qhash.cpp
-QT_END_NAMESPACE
-
int main(int argc, char *argv[])
{
- qt_qhash_seed.store(0); // Avoid rendering variations caused by QHash randomization
+ qSetGlobalQHashSeed(0); // Avoid rendering variations caused by QHash randomization
QBaselineTest::handleCmdLineArgs(&argc, &argv);
return _realmain(argc, argv);
diff --git a/tests/auto/other/languagechange/tst_languagechange.cpp b/tests/auto/other/languagechange/tst_languagechange.cpp
index 788993ef35..68d604547d 100644
--- a/tests/auto/other/languagechange/tst_languagechange.cpp
+++ b/tests/auto/other/languagechange/tst_languagechange.cpp
@@ -276,7 +276,7 @@ void tst_languageChange::retranslatability()
tempDirPattern += QStringLiteral("languagechangetestdirXXXXXX");
QTemporaryDir temporaryDir(tempDirPattern);
temporaryDir.setAutoRemove(true);
- QVERIFY(temporaryDir.isValid());
+ QVERIFY2(temporaryDir.isValid(), qPrintable(temporaryDir.errorString()));
const QString finalDir = temporaryDir.path() + QStringLiteral("/finaldir");
const QString fooName = temporaryDir.path() + QStringLiteral("/foo");
QDir dir;
diff --git a/tests/auto/other/macgui/guitest.cpp b/tests/auto/other/macgui/guitest.cpp
index 1ddd0ca870..dee7ace1b9 100644
--- a/tests/auto/other/macgui/guitest.cpp
+++ b/tests/auto/other/macgui/guitest.cpp
@@ -145,7 +145,9 @@ namespace NativeEvents {
CGEventType mouseDownType = (buttons & Qt::LeftButton) ? kCGEventLeftMouseDown :
(buttons & Qt::RightButton) ? kCGEventRightMouseDown :
kCGEventOtherMouseDown;
- CGMouseButton mouseButton = mouseDownType == kCGEventOtherMouseDown ? kCGMouseButtonCenter : kCGEventLeftMouseDown;
+ // The mouseButton argument to CGEventCreateMouseEvent() is ignored unless the type
+ // is kCGEventOtherMouseDown, so defaulting to kCGMouseButtonLeft is fine.
+ CGMouseButton mouseButton = mouseDownType == kCGEventOtherMouseDown ? kCGMouseButtonCenter : kCGMouseButtonLeft;
CGEventRef mouseEvent = CGEventCreateMouseEvent(NULL, mouseDownType, position, mouseButton);
CGEventPost(kCGHIDEventTap, mouseEvent);
diff --git a/tests/auto/other/macgui/macgui.pro b/tests/auto/other/macgui/macgui.pro
index bf805ccd75..a793a304ca 100644
--- a/tests/auto/other/macgui/macgui.pro
+++ b/tests/auto/other/macgui/macgui.pro
@@ -6,5 +6,7 @@ HEADERS += guitest.h
QT = core-private widgets-private testlib
+osx: LIBS += -framework ApplicationServices
+
requires(mac)
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/other/macgui/tst_macgui.cpp b/tests/auto/other/macgui/tst_macgui.cpp
index 56035f4be4..ba6ac536f2 100644
--- a/tests/auto/other/macgui/tst_macgui.cpp
+++ b/tests/auto/other/macgui/tst_macgui.cpp
@@ -146,7 +146,7 @@ void tst_MacGui::splashScreenModality()
connect(wn.getWidget(interface), SIGNAL(clicked()), SLOT(exitLoopSlot()));
const int timeout = 4;
QTestEventLoop::instance().enterLoop(timeout);
- QVERIFY(QTestEventLoop::instance().timeout() == false);
+ QVERIFY(!QTestEventLoop::instance().timeout());
}
class PrimaryWindowDialog : public QDialog
@@ -231,7 +231,7 @@ void tst_MacGui::spinBoxArrowButtons()
const QRect lessRect = lessInterface->rect();
const QRect lessLocalRect(colorWidget.mapFromGlobal(lessRect.topLeft()), colorWidget.mapFromGlobal(lessRect.bottomRight()));
const QRect compareRect = lessLocalRect.adjusted(5, 3, -5, -7);
- QVERIFY(noFocus.copy(compareRect) == focus.copy(compareRect));
+ QCOMPARE(noFocus.copy(compareRect), focus.copy(compareRect));
}
QTEST_MAIN(tst_MacGui)
diff --git a/tests/auto/other/macnativeevents/BLACKLIST b/tests/auto/other/macnativeevents/BLACKLIST
index 2820457075..4129868022 100644
--- a/tests/auto/other/macnativeevents/BLACKLIST
+++ b/tests/auto/other/macnativeevents/BLACKLIST
@@ -3,9 +3,22 @@
osx
[testMouseEnter]
osx-10.9
+osx-10.8
[testChildDialogInFrontOfModalParent]
osx
[testChildWindowInFrontOfStaysOnTopParentWindow]
osx
[testModifierCtrlWithDontSwapCtrlAndMeta]
osx
+[testMouseMoveLocation]
+osx
+[testMouseLeftDoubleClick]
+osx
+[stressTestMouseLeftDoubleClick]
+osx
+[testMouseDragInside]
+osx
+[testMouseDragOutside]
+osx
+[testMouseDragToNonClientArea]
+osx
diff --git a/tests/auto/other/macnativeevents/qnativeevents_mac.cpp b/tests/auto/other/macnativeevents/qnativeevents_mac.cpp
index 6053a649a1..d3b50a5405 100644
--- a/tests/auto/other/macnativeevents/qnativeevents_mac.cpp
+++ b/tests/auto/other/macnativeevents/qnativeevents_mac.cpp
@@ -56,15 +56,15 @@ static Qt::KeyboardModifiers getModifiersFromQuartzEvent(CGEventRef inEvent)
static void setModifiersFromQNativeEvent(CGEventRef inEvent, const QNativeEvent &event)
{
- CGEventFlags flags = 0;
+ CGEventFlags flags = CGEventFlags(0);
if (event.modifiers.testFlag(Qt::ShiftModifier))
- flags |= kCGEventFlagMaskShift;
+ flags = CGEventFlags(flags | kCGEventFlagMaskShift);
if (event.modifiers.testFlag(Qt::ControlModifier))
- flags |= kCGEventFlagMaskControl;
+ flags = CGEventFlags(flags | kCGEventFlagMaskControl);
if (event.modifiers.testFlag(Qt::AltModifier))
- flags |= kCGEventFlagMaskAlternate;
+ flags = CGEventFlags(flags | kCGEventFlagMaskAlternate);
if (event.modifiers.testFlag(Qt::MetaModifier))
- flags |= kCGEventFlagMaskCommand;
+ flags = CGEventFlags(flags | kCGEventFlagMaskCommand);
CGEventSetFlags(inEvent, flags);
}
@@ -240,7 +240,7 @@ Qt::Native::Status sendNativeMouseMoveEvent_Quartz(const QNativeMouseMoveEvent &
pos.x = event.globalPos.x();
pos.y = event.globalPos.y();
- CGEventRef e = CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, 0);
+ CGEventRef e = CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, kCGMouseButtonLeft /* ignored */);
setModifiersFromQNativeEvent(e, event);
CGEventPost(kCGHIDEventTap, e);
CFRelease(e);
@@ -253,7 +253,7 @@ Qt::Native::Status sendNativeMouseButtonEvent_Quartz(const QNativeMouseButtonEve
pos.x = event.globalPos.x();
pos.y = event.globalPos.y();
- CGEventType type = 0;
+ CGEventType type = kCGEventNull;
if (event.button == Qt::LeftButton)
type = (event.clickCount > 0) ? kCGEventLeftMouseDown : kCGEventLeftMouseUp;
else if (event.button == Qt::RightButton)
@@ -261,7 +261,12 @@ Qt::Native::Status sendNativeMouseButtonEvent_Quartz(const QNativeMouseButtonEve
else
type = (event.clickCount > 0) ? kCGEventOtherMouseDown : kCGEventOtherMouseUp;
- CGEventRef e = CGEventCreateMouseEvent(0, type, pos, event.button);
+ // The mouseButton argument to CGEventCreateMouseEvent() is ignored unless the type
+ // is kCGEventOtherSomething, so defaulting to kCGMouseButtonLeft is fine.
+ CGMouseButton mouseButton = (type == kCGEventOtherMouseDown || type == kCGEventOtherMouseUp) ?
+ kCGMouseButtonCenter : kCGMouseButtonLeft;
+
+ CGEventRef e = CGEventCreateMouseEvent(0, type, pos, mouseButton);
setModifiersFromQNativeEvent(e, event);
CGEventSetIntegerValueField(e, kCGMouseEventClickState, event.clickCount);
CGEventPost(kCGHIDEventTap, e);
@@ -275,7 +280,7 @@ Qt::Native::Status sendNativeMouseDragEvent_Quartz(const QNativeMouseDragEvent &
pos.x = event.globalPos.x();
pos.y = event.globalPos.y();
- CGEventType type = 0;
+ CGEventType type = kCGEventNull;
if (event.button == Qt::LeftButton)
type = kCGEventLeftMouseDragged;
else if (event.button == Qt::RightButton)
@@ -283,7 +288,11 @@ Qt::Native::Status sendNativeMouseDragEvent_Quartz(const QNativeMouseDragEvent &
else
type = kCGEventOtherMouseDragged;
- CGEventRef e = CGEventCreateMouseEvent(0, type, pos, event.button);
+ // The mouseButton argument to CGEventCreateMouseEvent() is ignored unless the type
+ // is kCGEventOtherSomething, so defaulting to kCGMouseButtonLeft is fine.
+ CGMouseButton mouseButton = type == kCGEventOtherMouseDragged ? kCGMouseButtonCenter : kCGMouseButtonLeft;
+
+ CGEventRef e = CGEventCreateMouseEvent(0, type, pos, mouseButton);
setModifiersFromQNativeEvent(e, event);
CGEventPost(kCGHIDEventTap, e);
CFRelease(e);
diff --git a/tests/auto/other/macnativeevents/tst_macnativeevents.cpp b/tests/auto/other/macnativeevents/tst_macnativeevents.cpp
index 5d24655144..d1c5e4a35e 100644
--- a/tests/auto/other/macnativeevents/tst_macnativeevents.cpp
+++ b/tests/auto/other/macnativeevents/tst_macnativeevents.cpp
@@ -457,8 +457,8 @@ void tst_MacNativeEvents::testModifierCtrl()
QWidget w;
w.show();
- QVERIFY(kControlUnicode == QKeySequence(Qt::Key_Meta).toString(QKeySequence::NativeText)[0]);
- QVERIFY(kCommandUnicode == QKeySequence(Qt::Key_Control).toString(QKeySequence::NativeText)[0]);
+ QCOMPARE(ushort(kControlUnicode), QKeySequence(Qt::Key_Meta).toString(QKeySequence::NativeText).at(0).unicode());
+ QCOMPARE(ushort(kCommandUnicode), QKeySequence(Qt::Key_Control).toString(QKeySequence::NativeText).at(0).unicode());
NativeEventList native;
native.append(new QNativeModifierEvent(Qt::ControlModifier));
@@ -490,8 +490,8 @@ void tst_MacNativeEvents::testModifierCtrlWithDontSwapCtrlAndMeta()
QWidget w;
w.show();
- QVERIFY(kCommandUnicode == QKeySequence(Qt::Key_Meta).toString(QKeySequence::NativeText)[0]);
- QVERIFY(kControlUnicode == QKeySequence(Qt::Key_Control).toString(QKeySequence::NativeText)[0]);
+ QCOMPARE(ushort(kCommandUnicode), QKeySequence(Qt::Key_Meta).toString(QKeySequence::NativeText).at(0).unicode());
+ QCOMPARE(ushort(kControlUnicode), QKeySequence(Qt::Key_Control).toString(QKeySequence::NativeText).at(0).unicode());
NativeEventList native;
native.append(new QNativeModifierEvent(Qt::ControlModifier));
diff --git a/tests/auto/other/modeltest/modeltest.cpp b/tests/auto/other/modeltest/modeltest.cpp
index 72a4a0ad29..c119fdaa4e 100644
--- a/tests/auto/other/modeltest/modeltest.cpp
+++ b/tests/auto/other/modeltest/modeltest.cpp
@@ -569,7 +569,7 @@ void ModelTest::dataChanged(const QModelIndex &topLeft, const QModelIndex &botto
QVERIFY(topLeft.isValid());
QVERIFY(bottomRight.isValid());
QModelIndex commonParent = bottomRight.parent();
- QVERIFY(topLeft.parent() == commonParent);
+ QCOMPARE(topLeft.parent(), commonParent);
QVERIFY(topLeft.row() <= bottomRight.row());
QVERIFY(topLeft.column() <= bottomRight.column());
int rowCount = model->rowCount(commonParent);
diff --git a/tests/auto/other/networkselftest/tst_networkselftest.cpp b/tests/auto/other/networkselftest/tst_networkselftest.cpp
index ca321fb6fd..7ef830d89f 100644
--- a/tests/auto/other/networkselftest/tst_networkselftest.cpp
+++ b/tests/auto/other/networkselftest/tst_networkselftest.cpp
@@ -34,6 +34,8 @@
#include <QtTest/QtTest>
#include <QtNetwork/QtNetwork>
#include <QtCore/QDateTime>
+#include <QtCore/QTextStream>
+#include <QtCore/QStandardPaths>
#include <QtCore/private/qiodevice_p.h>
#ifndef QT_NO_BEARERMANAGEMENT
@@ -464,7 +466,7 @@ void tst_NetworkSelfTest::remotePortsOpen()
else
QFAIL(QString("Error connecting to server on port %1: %2").arg(portNumber).arg(socket.errorString()).toLocal8Bit());
}
- QVERIFY(socket.state() == QAbstractSocket::ConnectedState);
+ QCOMPARE(socket.state(), QAbstractSocket::ConnectedState);
}
static QList<Chat> ftpChat(const QByteArray &userSuffix = QByteArray())
@@ -964,6 +966,25 @@ void tst_NetworkSelfTest::supportsSsl()
#endif
}
+#ifndef QT_NO_PROCESS
+static const QByteArray msgProcessError(const QProcess &process, const char *what)
+{
+ QString result;
+ QTextStream(&result) << what << ": \"" << process.program() << ' '
+ << process.arguments().join(QLatin1Char(' ')) << "\": " << process.errorString();
+ return result.toLocal8Bit();
+}
+
+static void ensureTermination(QProcess &process)
+{
+ if (process.state() == QProcess::Running) {
+ process.terminate();
+ if (!process.waitForFinished(300))
+ process.kill();
+ }
+}
+#endif // !QT_NO_PROCESS
+
void tst_NetworkSelfTest::smbServer()
{
static const char contents[] = "This is 34 bytes. Do not change...";
@@ -981,19 +1002,24 @@ void tst_NetworkSelfTest::smbServer()
QVERIFY(memcmp(buf, contents, strlen(contents)) == 0);
#else
#ifndef QT_NO_PROCESS
+ enum { sambaTimeOutSecs = 5 };
// try to use Samba
- QString progname = "smbclient";
- QProcess smbclient;
- smbclient.start(progname, QIODevice::ReadOnly);
- if (!smbclient.waitForStarted(2000))
+ const QString progname = "smbclient";
+ const QString binary = QStandardPaths::findExecutable(progname);
+ if (binary.isEmpty())
QSKIP("Could not find smbclient (from Samba), cannot continue testing");
- if (!smbclient.waitForFinished(2000) || smbclient.exitStatus() != QProcess::NormalExit)
- QSKIP("smbclient isn't working, cannot continue testing");
- smbclient.close();
// try listing the server
- smbclient.start(progname, QStringList() << "-g" << "-N" << "-L" << QtNetworkSettings::winServerName(), QIODevice::ReadOnly);
- QVERIFY(smbclient.waitForFinished(5000));
+ const QStringList timeOutArguments = QStringList()
+ << "--timeout" << QString::number(sambaTimeOutSecs);
+ QStringList arguments = timeOutArguments;
+ arguments << "-g" << "-N" << "-L" << QtNetworkSettings::winServerName();
+ QProcess smbclient;
+ smbclient.start(binary, arguments, QIODevice::ReadOnly);
+ QVERIFY2(smbclient.waitForStarted(), msgProcessError(smbclient, "Unable to start"));
+ const bool listFinished = smbclient.waitForFinished((1 + sambaTimeOutSecs) * 1000);
+ ensureTermination(smbclient);
+ QVERIFY2(listFinished, msgProcessError(smbclient, "Listing servers timed out"));
if (smbclient.exitStatus() != QProcess::NormalExit)
QSKIP("smbclient crashed");
QVERIFY2(smbclient.exitCode() == 0, "Test server not found");
@@ -1008,9 +1034,13 @@ void tst_NetworkSelfTest::smbServer()
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("PAGER", "/bin/cat"); // just in case
smbclient.setProcessEnvironment(env);
- smbclient.start(progname, QStringList() << "-N" << "-c" << "more test.pri"
- << QString("\\\\%1\\testshare").arg(QtNetworkSettings::winServerName()), QIODevice::ReadOnly);
- QVERIFY(smbclient.waitForFinished(5000));
+ arguments = timeOutArguments;
+ arguments << "-N" << "-c" << "more test.pri"
+ << ("\\\\" + QtNetworkSettings::winServerName() + "\\testshare");
+ smbclient.start(binary, arguments, QIODevice::ReadOnly);
+ const bool fileFinished = smbclient.waitForFinished((1 + sambaTimeOutSecs) * 1000);
+ ensureTermination(smbclient);
+ QVERIFY2(fileFinished, msgProcessError(smbclient, "Timed out"));
if (smbclient.exitStatus() != QProcess::NormalExit)
QSKIP("smbclient crashed");
QVERIFY2(smbclient.exitCode() == 0, "File //qt-test-server/testshare/test.pri not found");
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index 4f891fcda0..62c2c0a916 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -162,16 +162,6 @@ static inline bool verifyChild(QWidget *child, QAccessibleInterface *interface,
return true;
}
-static inline int indexOfChild(QAccessibleInterface *parentInterface, QWidget *childWidget)
-{
- if (!parentInterface || !childWidget)
- return -1;
- QAccessibleInterface *childInterface(QAccessible::queryAccessibleInterface(childWidget));
- if (!childInterface)
- return -1;
- return parentInterface->indexOfChild(childInterface);
-}
-
#define EXPECT(cond) \
do { \
if (!errorAt && !(cond)) { \
@@ -462,15 +452,15 @@ void tst_QAccessibility::statesStructTest()
QVERIFY(s1.modal == 0);
QAccessible::State s2;
- QVERIFY(s2 == s1);
+ QCOMPARE(s2, s1);
s2.busy = true;
QVERIFY(!(s2 == s1));
s1.busy = true;
- QVERIFY(s2 == s1);
+ QCOMPARE(s2, s1);
s1 = QAccessible::State();
QVERIFY(!(s2 == s1));
s1 = s2;
- QVERIFY(s2 == s1);
+ QCOMPARE(s2, s1);
QVERIFY(s1.busy == 1);
}
@@ -533,9 +523,9 @@ void tst_QAccessibility::navigateHierarchy()
QVERIFY(ifaceW->isValid());
QAccessibleInterface *target = ifaceW->child(14);
- QVERIFY(target == 0);
+ QVERIFY(!target);
target = ifaceW->child(-1);
- QVERIFY(target == 0);
+ QVERIFY(!target);
target = ifaceW->child(0);
QAccessibleInterface *interfaceW1(ifaceW->child(0));
QVERIFY(target);
@@ -551,7 +541,7 @@ void tst_QAccessibility::navigateHierarchy()
QCOMPARE(target->object(), (QObject*)w3);
QAccessibleInterface *child = target->child(1);
- QVERIFY(child == 0);
+ QVERIFY(!child);
child = target->child(0);
QVERIFY(child != 0);
QVERIFY(child->isValid());
@@ -969,7 +959,7 @@ void tst_QAccessibility::mainWindowTest()
QWindow window;
window.setGeometry(80, 80, 40, 40);
window.show();
- QTRY_VERIFY(QGuiApplication::focusWindow() == &window);
+ QTRY_COMPARE(QGuiApplication::focusWindow(), &window);
// We currently don't have an accessible interface for QWindow
// the active state is either in the QMainWindow or QQuickView
@@ -1313,7 +1303,7 @@ void tst_QAccessibility::tabTest()
QCOMPARE(child1->text(QAccessible::Description), QLatin1String("Cool tool tip"));
QCOMPARE(child1->text(QAccessible::Help), QLatin1String("I don't know"));
- QVERIFY((child1->state().invisible) == false);
+ QVERIFY(!(child1->state().invisible));
tabBar->hide();
QCoreApplication::processEvents();
@@ -1660,7 +1650,7 @@ void tst_QAccessibility::spinBoxTest()
// make sure that the line edit is not there
const int numChildren = interface->childCount();
QCOMPARE(numChildren, 0);
- QVERIFY(interface->child(0) == Q_NULLPTR);
+ QVERIFY(!interface->child(0));
QVERIFY(interface->valueInterface());
QCOMPARE(interface->valueInterface()->currentValue().toInt(), 3);
@@ -1746,6 +1736,13 @@ static bool fuzzyRectCompare(const QRect &a, const QRect &b)
&& qAbs(delta.right()) <= MAX_ACCEPTABLE_DELTA && qAbs(delta.bottom()) <= MAX_ACCEPTABLE_DELTA;
}
+static QByteArray msgRectMismatch(const QRect &a, const QRect &b)
+{
+ QString result;
+ QDebug(&result) << a << "!=" << b;
+ return result.toLocal8Bit();
+}
+
void tst_QAccessibility::textEditTest()
{
for (int pass = 0; pass < 2; ++pass) {
@@ -1791,16 +1788,24 @@ void tst_QAccessibility::textEditTest()
int offset = 10;
QCOMPARE(textIface->text(offset, offset + 1), QStringLiteral("d"));
- QVERIFY(fuzzyRectCompare(textIface->characterRect(offset), characterRect(edit, offset)));
+ const QRect actual10 = textIface->characterRect(offset);
+ const QRect expected10 = characterRect(edit, offset);
+ QVERIFY2(fuzzyRectCompare(actual10, expected10), msgRectMismatch(actual10, expected10).constData());
offset = 13;
QCOMPARE(textIface->text(offset, offset + 1), QStringLiteral("H"));
- QVERIFY(fuzzyRectCompare(textIface->characterRect(offset), characterRect(edit, offset)));
+ const QRect actual13 = textIface->characterRect(offset);
+ const QRect expected13 = characterRect(edit, offset);
+ QVERIFY2(fuzzyRectCompare(actual13, expected13), msgRectMismatch(actual13, expected13).constData());
offset = 21;
QCOMPARE(textIface->text(offset, offset + 1), QStringLiteral("y"));
- QVERIFY(fuzzyRectCompare(textIface->characterRect(offset), characterRect(edit, offset)));
+ const QRect actual21 = textIface->characterRect(offset);
+ const QRect expected21 = characterRect(edit, offset);
+ QVERIFY2(fuzzyRectCompare(actual21, expected21), msgRectMismatch(actual21, expected21).constData());
offset = 32;
QCOMPARE(textIface->text(offset, offset + 1), QStringLiteral("I"));
- QVERIFY(fuzzyRectCompare(textIface->characterRect(offset), characterRect(edit, offset)));
+ const QRect actual32 = textIface->characterRect(offset);
+ const QRect expected32 = characterRect(edit, offset);
+ QVERIFY2(fuzzyRectCompare(actual32, expected32), msgRectMismatch(actual32, expected32).constData());
QTestAccessibility::clearEvents();
@@ -2481,7 +2486,7 @@ void tst_QAccessibility::groupBoxTest()
QCOMPARE(iface->text(QAccessible::Name), QLatin1String("Test QGroupBox"));
QCOMPARE(iface->text(QAccessible::Description), QLatin1String("This group box will be used to test accessibility"));
QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > relations = rButtonIface->relations();
- QVERIFY(relations.size() == 1);
+ QCOMPARE(relations.size(), 1);
QPair<QAccessibleInterface*, QAccessible::Relation> relation = relations.first();
QCOMPARE(relation.first->object(), groupBox);
QCOMPARE(relation.second, QAccessible::Label);
@@ -3526,13 +3531,13 @@ void tst_QAccessibility::dockWidgetTest()
QPoint buttonPoint = pb2->mapToGlobal(QPoint(pb2->width()/2, pb2->height()/2));
QAccessibleInterface *childAt = accDock2->childAt(buttonPoint.x(), buttonPoint.y());
QVERIFY(childAt);
- QVERIFY(childAt->object() == pb2);
+ QCOMPARE(childAt->object(), pb2);
QWidget *close1 = qobject_cast<QWidget*>(dock1Close->object());
QPoint close1ButtonPoint = close1->mapToGlobal(QPoint(close1->width()/2, close1->height()/2));
QAccessibleInterface *childAt2 = accDock1->childAt(close1ButtonPoint.x(), close1ButtonPoint.y());
QVERIFY(childAt2);
- QVERIFY(childAt2->object() == close1);
+ QCOMPARE(childAt2->object(), close1);
// custom title bar widget
QDockWidget *dock3 = new QDockWidget(mw);
diff --git a/tests/auto/other/qaccessibilitylinux/qaccessibilitylinux.pro b/tests/auto/other/qaccessibilitylinux/qaccessibilitylinux.pro
index 2ea54ab603..10d950541a 100644
--- a/tests/auto/other/qaccessibilitylinux/qaccessibilitylinux.pro
+++ b/tests/auto/other/qaccessibilitylinux/qaccessibilitylinux.pro
@@ -1,8 +1,5 @@
CONFIG += testcase
-# This is temporary to start running the test as part of normal CI.
-CONFIG += insignificant_test # QTBUG-27732
-
include($$QT_SOURCE_TREE/src/platformsupport/accessibility/accessibility.pri)
include($$QT_SOURCE_TREE/src/platformsupport/linuxaccessibility/linuxaccessibility.pri)
diff --git a/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp b/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp
index 5f0eed5afe..4885a5f037 100644
--- a/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp
+++ b/tests/auto/other/qaccessibilitylinux/tst_qaccessibilitylinux.cpp
@@ -84,7 +84,15 @@ class tst_QAccessibilityLinux : public QObject
Q_OBJECT
public:
- tst_QAccessibilityLinux() : m_window(0), root(0), rootApplication(0), mainWindow(0) {}
+ tst_QAccessibilityLinux() : m_window(0), root(0), rootApplication(0), mainWindow(0)
+ {
+ qputenv("QT_LINUX_ACCESSIBILITY_ALWAYS_ON", QByteArrayLiteral("1"));
+ dbus = new DBusConnection();
+ }
+ ~tst_QAccessibilityLinux()
+ {
+ delete dbus;
+ }
private slots:
void initTestCase();
@@ -112,7 +120,7 @@ private:
QDBusInterface *rootApplication;
QDBusInterface *mainWindow;
- DBusConnection dbus;
+ DBusConnection *dbus;
};
// helper to find children of a dbus object
@@ -149,7 +157,7 @@ QString tst_QAccessibilityLinux::getParent(QDBusInterface *interface)
// helper to get dbus object
QDBusInterface *tst_QAccessibilityLinux::getInterface(const QString &path, const QString &interfaceName)
{
- return new QDBusInterface(address, path, interfaceName, dbus.connection(), this);
+ return new QDBusInterface(address, path, interfaceName, dbus->connection(), this);
}
void tst_QAccessibilityLinux::initTestCase()
@@ -158,14 +166,22 @@ void tst_QAccessibilityLinux::initTestCase()
qApp->setStyle("fusion");
qApp->setApplicationName("tst_QAccessibilityLinux app");
- // Pretend we are a screen reader
+
+ // trigger launching of at-spi if it isn't running already
QDBusConnection c = QDBusConnection::sessionBus();
OrgA11yStatusInterface *a11yStatus = new OrgA11yStatusInterface(QStringLiteral("org.a11y.Bus"), QStringLiteral("/org/a11y/bus"), c, this);
- a11yStatus->setScreenReaderEnabled(true);
+ // don't care about the result, calling any function on "org.a11y.Bus" will launch the service
+ a11yStatus->isEnabled();
+ for (int i = 0; i < 5; ++i) {
+ if (!dbus->isEnabled())
+ QTest::qWait(100);
+ }
- QTRY_VERIFY(dbus.isEnabled());
- QTRY_VERIFY(dbus.connection().isConnected());
- address = dbus.connection().baseService().toLatin1().data();
+ if (!dbus->isEnabled())
+ QSKIP("Could not connect to AT-SPI, make sure lib atspi2 is installed.");
+ QTRY_VERIFY(dbus->isEnabled());
+ QTRY_VERIFY(dbus->connection().isConnected());
+ address = dbus->connection().baseService().toLatin1().data();
QVERIFY(!address.isEmpty());
m_window = new AccessibleTestWindow();
@@ -185,7 +201,7 @@ void tst_QAccessibilityLinux::cleanupTestCase()
void tst_QAccessibilityLinux::registerDbus()
{
- QVERIFY(dbus.connection().isConnected());
+ QVERIFY(dbus->connection().isConnected());
root = getInterface("/org/a11y/atspi/accessible/root",
"org.a11y.atspi.Accessible");
diff --git a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
index 3056904dcf..65dbff4f92 100644
--- a/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
+++ b/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
@@ -199,7 +199,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err)
CFRange cfRange;
NSRange range = NSMakeRange(0, 0);
- if (!AXValueGetValue((AXValueRef)value, kAXValueCFRangeType, &cfRange))
+ if (!AXValueGetValue(AXValueRef(value), AXValueType(kAXValueCFRangeType), &cfRange))
qDebug() << "Could not get CFRange value out of AXValueRef";
else if (cfRange.location < 0 || cfRange.length < 0)
qDebug() << "Cannot convert CFRange with negative location or length to NSRange";
@@ -217,7 +217,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err)
+ (NSRect)_rectFromValue:(CFTypeRef)value
{
NSRect rect = NSMakeRect(0, 0, 0, 0);
- if (!AXValueGetValue((AXValueRef)value, kAXValueCGRectType, reinterpret_cast<CGRect*>(&rect)))
+ if (!AXValueGetValue(AXValueRef(value), AXValueType(kAXValueCGRectType), reinterpret_cast<CGRect*>(&rect)))
{
qDebug() << "Could not get CGRect value out of AXValueRef";
}
@@ -227,7 +227,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err)
+ (NSPoint)_pointFromValue:(CFTypeRef)value
{
NSPoint point = NSMakePoint(0, 0);
- if (!AXValueGetValue((AXValueRef)value, kAXValueCGPointType, reinterpret_cast<CGPoint*>(&point)))
+ if (!AXValueGetValue(AXValueRef(value), AXValueType(kAXValueCGPointType), reinterpret_cast<CGPoint*>(&point)))
{
qDebug() << "Could not get CGPoint value out of AXValueRef";
}
@@ -237,7 +237,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err)
+ (NSSize)_sizeFromValue:(CFTypeRef)value
{
NSSize size = NSMakeSize(0, 0);
- if (!AXValueGetValue((AXValueRef)value, kAXValueCGSizeType, reinterpret_cast<CGSize*>(&size)))
+ if (!AXValueGetValue(AXValueRef(value), AXValueType(kAXValueCGSizeType), reinterpret_cast<CGSize*>(&size)))
{
qDebug() << "Could not get CGSize value out of AXValueRef";
}
@@ -308,7 +308,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err)
- (CFTypeRef)_attributeValue:(CFStringRef)attribute forRange:(NSRange)aRange
{
CFRange cfRange = CFRangeMake(aRange.location, aRange.length);
- AXValueRef range = AXValueCreate(kAXValueCFRangeType, &cfRange);
+ AXValueRef range = AXValueCreate(AXValueType(kAXValueCFRangeType), &cfRange);
CFTypeRef value = [self _attributeValue:attribute forParameter:range];
CFRelease(range);
return value;
@@ -324,7 +324,7 @@ QDebug operator<<(QDebug dbg, AXErrorTag err)
- (CFTypeRef)_attributeValue:(CFStringRef)attribute forPoint:(CGPoint)aPoint
{
- AXValueRef point = AXValueCreate(kAXValueCGPointType, &aPoint);
+ AXValueRef point = AXValueCreate(AXValueType(kAXValueCGPointType), &aPoint);
CFTypeRef value = [self _attributeValue:attribute forParameter:point];
CFRelease(point);
return value;
diff --git a/tests/auto/other/qcomplextext/tst_qcomplextext.cpp b/tests/auto/other/qcomplextext/tst_qcomplextext.cpp
index a9234b7060..1428a63123 100644
--- a/tests/auto/other/qcomplextext/tst_qcomplextext.cpp
+++ b/tests/auto/other/qcomplextext/tst_qcomplextext.cpp
@@ -173,7 +173,7 @@ void tst_QComplexText::bidiCursor_qtbug2795()
qreal x2 = line2.cursorToX(0) - line2.cursorToX(str.size());
// The cursor should remain at the same position after a digit is appended
- QVERIFY(x1 == x2);
+ QCOMPARE(x1, x2);
}
void tst_QComplexText::bidiCursorMovement_data()
diff --git a/tests/auto/other/toolsupport/tst_toolsupport.cpp b/tests/auto/other/toolsupport/tst_toolsupport.cpp
index bbd787bf38..92127fcd5c 100644
--- a/tests/auto/other/toolsupport/tst_toolsupport.cpp
+++ b/tests/auto/other/toolsupport/tst_toolsupport.cpp
@@ -111,10 +111,10 @@ void tst_toolsupport::offsets_data()
}
#ifdef Q_OS_LINUX
- if (sizeof(void *) == 8) {
+ {
QTestData &data = QTest::newRow("QFilePrivate::fileName")
<< pmm_to_offsetof(&QFilePrivate::fileName);
- data << -1 << 248;
+ data << 168 << 248;
}
#endif
diff --git a/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp b/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp
index b161dccb88..acb0d28c6b 100644
--- a/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp
+++ b/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp
@@ -132,7 +132,7 @@ void compareScreenshots(const QString &image1, const QString &image2)
//screenShot.save("scr2.png", "PNG");
//original.save("orig1.png", "PNG");
- QVERIFY(original == screenShot);
+ QCOMPARE(original, screenShot);
}
void takeScreenShot(const QString filename)
diff --git a/tests/auto/printsupport/kernel/qprintdevice/tst_qprintdevice.cpp b/tests/auto/printsupport/kernel/qprintdevice/tst_qprintdevice.cpp
index 598abca43b..f3b865ed92 100644
--- a/tests/auto/printsupport/kernel/qprintdevice/tst_qprintdevice.cpp
+++ b/tests/auto/printsupport/kernel/qprintdevice/tst_qprintdevice.cpp
@@ -57,7 +57,6 @@ void tst_QPrintDevice::basics()
if (defaultId.isEmpty()) {
qDebug() << "No default printer found";
} else {
- qDebug() << "Default Printer ID :" << defaultId;
QVERIFY(ps->availablePrintDeviceIds().contains(defaultId));
}
@@ -66,7 +65,9 @@ void tst_QPrintDevice::basics()
// Just exercise the api for now as we don't know what is installed
foreach (const QString id, ps->availablePrintDeviceIds()) {
QPrintDevice printDevice = ps->createPrintDevice(id);
- qDebug() << "Created printer" << id;
+ const char quote = id == defaultId ? '*' : '"';
+ qDebug().noquote().nospace() << "\nCreated printer " << quote << id
+ << quote << ":\n" << printDevice << '\n';
QCOMPARE(printDevice.isValid(), true);
printDevice.id();
printDevice.name();
diff --git a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
index c256d9ba82..aa72be3ea8 100644
--- a/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
+++ b/tests/auto/printsupport/kernel/qprinter/tst_qprinter.cpp
@@ -425,12 +425,12 @@ void tst_QPrinter::outputFormatFromSuffix()
if (QPrinterInfo::availablePrinters().size() == 0)
QSKIP("No printers available.");
QPrinter p;
- QVERIFY(p.outputFormat() == QPrinter::NativeFormat);
+ QCOMPARE(p.outputFormat(), QPrinter::NativeFormat);
p.setOutputFileName("test.pdf");
TempFileCleanup tmpFile("test.pdf");
- QVERIFY(p.outputFormat() == QPrinter::PdfFormat);
+ QCOMPARE(p.outputFormat(), QPrinter::PdfFormat);
p.setOutputFileName(QString());
- QVERIFY(p.outputFormat() == QPrinter::NativeFormat);
+ QCOMPARE(p.outputFormat(), QPrinter::NativeFormat);
}
void tst_QPrinter::testPageMargins_data()
@@ -1090,12 +1090,12 @@ void tst_QPrinter::doubleSidedPrinting()
QPrinter native;
if (native.outputFormat() == QPrinter::NativeFormat) {
// Test default
- QPrinterInfo printerInfo;
+ QPrinterInfo printerInfo(native);
bool expected = (printerInfo.defaultDuplexMode() != QPrinter::DuplexNone);
- QCOMPARE(native.doubleSidedPrinting(), false);
+ QCOMPARE(native.doubleSidedPrinting(), expected);
- // Test set/get
- expected = (printerInfo.supportedDuplexModes().count() > 1);
+ // Test set/get, changing the expected value if possible
+ expected = expected ? false : (printerInfo.supportedDuplexModes().count() > 1);
native.setDoubleSidedPrinting(expected);
QCOMPARE(native.doubleSidedPrinting(), expected);
diff --git a/tests/auto/sql/kernel/qsqldatabase/testdata/qtest.mdb b/tests/auto/sql/kernel/qsqldatabase/testdata/qtest.mdb
index f388f192ac..f388f192ac 100755..100644
--- a/tests/auto/sql/kernel/qsqldatabase/testdata/qtest.mdb
+++ b/tests/auto/sql/kernel/qsqldatabase/testdata/qtest.mdb
Binary files differ
diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_databases.h b/tests/auto/sql/kernel/qsqldatabase/tst_databases.h
index c499aed481..fe8a3689b0 100644
--- a/tests/auto/sql/kernel/qsqldatabase/tst_databases.h
+++ b/tests/auto/sql/kernel/qsqldatabase/tst_databases.h
@@ -261,8 +261,8 @@ public:
// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.qt-project.org" );
// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.qt-project.org", 3307 );
-// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.qt-project.org", 3308, "CLIENT_COMPRESS=1;CLIENT_SSL=1" ); // MySQL 4.1.1
-// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.qt-project.org", 3309, "CLIENT_COMPRESS=1;CLIENT_SSL=1" ); // MySQL 5.0.18 Linux
+// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.qt-project.org", 3308, "CLIENT_COMPRESS=1" ); // MySQL 4.1.1
+// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.qt-project.org", 3309, "CLIENT_COMPRESS=1" ); // MySQL 5.0.18 Linux
// addDb( "QMYSQL3", "testdb", "troll", "trond", "silence.qt-project.org" ); // MySQL 5.1.36 Windows
// addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "bq-mysql41.qt-project.org" ); // MySQL 4.1.22-2.el4 linux
diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp
index 1993f23672..83cf0394f9 100644
--- a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp
+++ b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp
@@ -1569,11 +1569,11 @@ void tst_QSqlDatabase::ibase_numericFields()
QCOMPARE(q.value(2).toString(), QString("%1").arg(num2));
QCOMPARE(QString("%1").arg(q.value(3).toDouble()), QString("%1").arg(num3));
QCOMPARE(QString("%1").arg(q.value(4).toDouble()), QString("%1").arg(num4));
- QVERIFY(q.value(0).type() == QVariant::Int);
- QVERIFY(q.value(1).type() == QVariant::Double);
- QVERIFY(q.value(2).type() == QVariant::Double);
- QVERIFY(q.value(3).type() == QVariant::Double);
- QVERIFY(q.value(4).type() == QVariant::Double);
+ QCOMPARE(q.value(0).type(), QVariant::Int);
+ QCOMPARE(q.value(1).type(), QVariant::Double);
+ QCOMPARE(q.value(2).type(), QVariant::Double);
+ QCOMPARE(q.value(3).type(), QVariant::Double);
+ QCOMPARE(q.value(4).type(), QVariant::Double);
QCOMPARE(q.record().field(1).length(), 2);
QCOMPARE(q.record().field(1).precision(), 1);
@@ -1583,16 +1583,16 @@ void tst_QSqlDatabase::ibase_numericFields()
QCOMPARE(q.record().field(3).precision(), 3);
QCOMPARE(q.record().field(4).length(), 18);
QCOMPARE(q.record().field(4).precision(), 4);
- QVERIFY(q.record().field(0).requiredStatus() == QSqlField::Required);
- QVERIFY(q.record().field(1).requiredStatus() == QSqlField::Optional);
+ QCOMPARE(q.record().field(0).requiredStatus(), QSqlField::Required);
+ QCOMPARE(q.record().field(1).requiredStatus(), QSqlField::Optional);
}
QSqlRecord r = db.record(tableName);
- QVERIFY(r.field(0).type() == QVariant::Int);
- QVERIFY(r.field(1).type() == QVariant::Double);
- QVERIFY(r.field(2).type() == QVariant::Double);
- QVERIFY(r.field(3).type() == QVariant::Double);
- QVERIFY(r.field(4).type() == QVariant::Double);
+ QCOMPARE(r.field(0).type(), QVariant::Int);
+ QCOMPARE(r.field(1).type(), QVariant::Double);
+ QCOMPARE(r.field(2).type(), QVariant::Double);
+ QCOMPARE(r.field(3).type(), QVariant::Double);
+ QCOMPARE(r.field(4).type(), QVariant::Double);
QCOMPARE(r.field(1).length(), 2);
QCOMPARE(r.field(1).precision(), 1);
QCOMPARE(r.field(2).length(), 5);
@@ -1601,8 +1601,8 @@ void tst_QSqlDatabase::ibase_numericFields()
QCOMPARE(r.field(3).precision(), 3);
QCOMPARE(r.field(4).length(), 18);
QCOMPARE(r.field(4).precision(), 4);
- QVERIFY(r.field(0).requiredStatus() == QSqlField::Required);
- QVERIFY(r.field(1).requiredStatus() == QSqlField::Optional);
+ QCOMPARE(r.field(0).requiredStatus(), QSqlField::Required);
+ QCOMPARE(r.field(1).requiredStatus(), QSqlField::Optional);
}
void tst_QSqlDatabase::ibase_fetchBlobs()
@@ -2086,7 +2086,7 @@ void tst_QSqlDatabase::eventNotificationIBase()
QCOMPARE(spy.count(), 1);
QList<QVariant> arguments = spy.takeFirst();
- QVERIFY(arguments.at(0).toString() == procedureName);
+ QCOMPARE(arguments.at(0).toString(), procedureName);
QVERIFY_SQL(*driver, unsubscribeFromNotification(procedureName));
q.exec(QString("DROP PROCEDURE %1").arg(procedureName));
}
diff --git a/tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp b/tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp
index 7a12f66452..70e09a2b80 100644
--- a/tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp
+++ b/tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp
@@ -160,7 +160,7 @@ void tst_QSqlError::operators()
error2.setType(QSqlError::NoError);
error3.setType(QSqlError::UnknownError);
- QVERIFY(error1 == error2);
+ QCOMPARE(error1, error2);
QVERIFY(error1 != error3);
}
diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
index 61586eb841..b98ab68ae9 100644
--- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
@@ -241,6 +241,10 @@ private slots:
void aggregateFunctionTypes_data() { generic_data(); }
void aggregateFunctionTypes();
+
+ void integralTypesMysql_data() { generic_data("QMYSQL"); }
+ void integralTypesMysql();
+
private:
// returns all database connections
void generic_data(const QString &engine=QString());
@@ -3974,5 +3978,65 @@ void tst_QSqlQuery::aggregateFunctionTypes()
}
}
+template<typename T>
+void runIntegralTypesMysqlTest(QSqlDatabase &db, const QString &tableName, const QString &type, const bool withPreparedStatement,
+ const T min = std::numeric_limits<T>::min(), const T max = std::numeric_limits<T>::max())
+{
+ QSqlQuery q(db);
+ QVERIFY_SQL(q, exec("DROP TABLE IF EXISTS " + tableName));
+ QVERIFY_SQL(q, exec("CREATE TABLE " + tableName + " (id " + type + ")"));
+
+ const int steps = 20;
+ const T increment = max / steps - min / steps;
+
+ // insert some values
+ QVector<T> values;
+ values.resize(steps);
+ T v = min;
+ if (withPreparedStatement) {
+ QVERIFY_SQL(q, prepare("INSERT INTO " + tableName + " (id) VALUES (?)"));
+ }
+ for (int i = 0; i < values.size(); ++i) {
+ if (withPreparedStatement) {
+ q.bindValue(0, v);
+ QVERIFY_SQL(q, exec());
+ } else {
+ QVERIFY_SQL(q, exec("INSERT INTO " + tableName + " (id) VALUES (" + QString::number(v) + ")"));
+ }
+ values[i] = v;
+ v += increment;
+ }
+
+ // ensure we can read them back properly
+ QVERIFY_SQL(q, exec("SELECT id FROM " + tableName));
+ QVector<T> actualValues;
+ actualValues.reserve(values.size());
+ while (q.next()) {
+ actualValues << q.value(0).value<T>();
+ }
+ QCOMPARE(actualValues, values);
+}
+
+void tst_QSqlQuery::integralTypesMysql()
+{
+ QFETCH(QString, dbName);
+ QSqlDatabase db = QSqlDatabase::database(dbName);
+ CHECK_DATABASE(db);
+
+ for (int i = 0; i < 2; ++i) {
+ const bool withPreparedStatement = (i == 1);
+ runIntegralTypesMysqlTest<char>(db, "tinyIntTest", "TINYINT", withPreparedStatement);
+ runIntegralTypesMysqlTest<unsigned char>(db, "unsignedTinyIntTest", "TINYINT UNSIGNED", withPreparedStatement);
+ runIntegralTypesMysqlTest<char>(db, "smallIntTest", "SMALLINT", withPreparedStatement);
+ runIntegralTypesMysqlTest<unsigned char>(db, "unsignedSmallIntTest", "SMALLINT UNSIGNED", withPreparedStatement);
+ runIntegralTypesMysqlTest<int>(db, "mediumIntTest", "MEDIUMINT", withPreparedStatement, -(1 << 23), (1 << 23) - 1);
+ runIntegralTypesMysqlTest<unsigned int>(db, "unsignedMediumIntTest", "MEDIUMINT UNSIGNED", withPreparedStatement, 0, (1 << 24) - 1);
+ runIntegralTypesMysqlTest<int>(db, "intTest", "INT", withPreparedStatement);
+ runIntegralTypesMysqlTest<unsigned int>(db, "unsignedIntTest", "INT UNSIGNED", withPreparedStatement);
+ runIntegralTypesMysqlTest<long long>(db, "bigIntTest", "BIGINT", withPreparedStatement);
+ runIntegralTypesMysqlTest<unsigned long long>(db, "unsignedBigIntTest", "BIGINT UNSIGNED", withPreparedStatement);
+ }
+}
+
QTEST_MAIN( tst_QSqlQuery )
#include "tst_qsqlquery.moc"
diff --git a/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp b/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp
index ae2f8dde5f..52baa0070b 100644
--- a/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp
+++ b/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp
@@ -593,7 +593,7 @@ public:
connect(this, SIGNAL(modelReset()), this, SLOT(modelResetSlot()));
}
- void testme()
+ void testNested()
{
// Only the outermost beginResetModel/endResetModel should
// emit signals.
@@ -618,6 +618,14 @@ public:
QCOMPARE(gotReset, true);
}
+ void testClear() // QTBUG-49404: Basic test whether clear() emits signals.
+ {
+ gotAboutToBeReset = gotReset = false;
+ clear();
+ QVERIFY(gotAboutToBeReset);
+ QVERIFY(gotReset);
+ }
+
private slots:
void modelAboutToBeResetSlot() { gotAboutToBeReset = true; }
void modelResetSlot() { gotReset = true; }
@@ -634,7 +642,8 @@ void tst_QSqlQueryModel::nestedResets()
CHECK_DATABASE(db);
NestedResetsTest t;
- t.testme();
+ t.testClear();
+ t.testNested();
}
// For task 180617
diff --git a/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp b/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp
index 71ec2b6588..3702631275 100644
--- a/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp
+++ b/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp
@@ -858,7 +858,7 @@ static void testRevert(QSqlRelationalTableModel &model)
/* Now revert the newly inserted rows */
model.revertAll();
- QVERIFY(model.rowCount() == initialRowCount);
+ QCOMPARE(model.rowCount(), initialRowCount);
/* Insert rows again */
QVERIFY(model.insertRows(4, 4));
@@ -1026,7 +1026,7 @@ void tst_QSqlRelationalTableModel::invalidData()
QCOMPARE(model.data(model.index(0, 2)).toString(), QString("herr"));
//try to set data in non valid index
- QVERIFY(model.setData(model.index(0,10),5) == false);
+ QVERIFY(!model.setData(model.index(0,10),5));
//same test with LeftJoin mode
model.setJoinMode(QSqlRelationalTableModel::LeftJoin);
@@ -1037,7 +1037,7 @@ void tst_QSqlRelationalTableModel::invalidData()
QCOMPARE(model.data(model.index(0, 2)).toString(), QString("herr"));
//try to set data in non valid index
- QVERIFY(model.setData(model.index(0,10),5) == false);
+ QVERIFY(!model.setData(model.index(0,10),5));
}
void tst_QSqlRelationalTableModel::relationModel()
@@ -1051,20 +1051,20 @@ void tst_QSqlRelationalTableModel::relationModel()
model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
QVERIFY_SQL(model, select());
- QVERIFY(model.relationModel(0) == NULL);
- QVERIFY(model.relationModel(1) == NULL);
+ QVERIFY(!model.relationModel(0));
+ QVERIFY(!model.relationModel(1));
QVERIFY(model.relationModel(2) != NULL);
- QVERIFY(model.relationModel(3) == NULL);
- QVERIFY(model.relationModel(4) == NULL);
+ QVERIFY(!model.relationModel(3));
+ QVERIFY(!model.relationModel(4));
model.setRelation(3, QSqlRelation(reltest4, "id", "name"));
QVERIFY_SQL(model, select());
- QVERIFY(model.relationModel(0) == NULL);
- QVERIFY(model.relationModel(1) == NULL);
+ QVERIFY(!model.relationModel(0));
+ QVERIFY(!model.relationModel(1));
QVERIFY(model.relationModel(2) != NULL);
QVERIFY(model.relationModel(3) != NULL);
- QVERIFY(model.relationModel(4) == NULL);
+ QVERIFY(!model.relationModel(4));
QSqlTableModel *rel_model = model.relationModel(2);
QCOMPARE(rel_model->data(rel_model->index(0,1)).toString(), QString("herr"));
@@ -1073,11 +1073,11 @@ void tst_QSqlRelationalTableModel::relationModel()
model.setJoinMode(QSqlRelationalTableModel::LeftJoin);
QVERIFY_SQL(model, select());
- QVERIFY(model.relationModel(0) == NULL);
- QVERIFY(model.relationModel(1) == NULL);
+ QVERIFY(!model.relationModel(0));
+ QVERIFY(!model.relationModel(1));
QVERIFY(model.relationModel(2) != NULL);
QVERIFY(model.relationModel(3) != NULL);
- QVERIFY(model.relationModel(4) == NULL);
+ QVERIFY(!model.relationModel(4));
QSqlTableModel *rel_model2 = model.relationModel(2);
QCOMPARE(rel_model2->data(rel_model->index(0,1)).toString(), QString("herr"));
@@ -1487,13 +1487,13 @@ void tst_QSqlRelationalTableModel::selectAfterUpdate()
model.setTable(reltest1);
model.setRelation(2, QSqlRelation(reltest2, "tid", "title"));
QVERIFY_SQL(model, select());
- QVERIFY(model.relationModel(2)->rowCount() == 2);
+ QCOMPARE(model.relationModel(2)->rowCount(), 2);
{
QSqlQuery q(db);
QVERIFY_SQL(q, exec("insert into " + reltest2 + " values(3, 'mrs')"));
model.relationModel(2)->select();
}
- QVERIFY(model.relationModel(2)->rowCount() == 3);
+ QCOMPARE(model.relationModel(2)->rowCount(), 3);
QVERIFY(model.setData(model.index(0,2), 3));
QVERIFY(model.submitAll());
QCOMPARE(model.data(model.index(0,2)), QVariant("mrs"));
diff --git a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp
index 9c351f4657..2ace79973b 100644
--- a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp
+++ b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp
@@ -533,7 +533,7 @@ void tst_QSqlTableModel::setData()
idx = model.index(0, 0);
QVERIFY_SQL(model, setData(idx, QVariant(QVariant::Int)));
val = model.data(idx);
- QVERIFY(val == QVariant(QVariant::Int));
+ QCOMPARE(val, QVariant(QVariant::Int));
QVERIFY(val.isNull());
QVERIFY_SQL(model, isDirty(idx));
QVERIFY_SQL(model, submitAll());
@@ -560,13 +560,13 @@ void tst_QSqlTableModel::setData()
// initial state
idx = model.index(0, 0);
QSqlRecord rec = model.record(0);
- QVERIFY(rec.value(0) == QVariant(QVariant::Int));
+ QCOMPARE(rec.value(0), QVariant(QVariant::Int));
QVERIFY(rec.isNull(0));
QVERIFY(!rec.isGenerated(0));
// unchanged value, but causes column to be included in INSERT
QVERIFY_SQL(model, setData(idx, QVariant(QVariant::Int)));
rec = model.record(0);
- QVERIFY(rec.value(0) == QVariant(QVariant::Int));
+ QCOMPARE(rec.value(0), QVariant(QVariant::Int));
QVERIFY(rec.isNull(0));
QVERIFY(rec.isGenerated(0));
QVERIFY_SQL(model, submitAll());
@@ -1136,8 +1136,8 @@ void tst_QSqlTableModel::removeRows()
QVERIFY_SQL(model, removeRows(0, 1));
QVERIFY_SQL(model, removeRows(1, 1));
QCOMPARE(beforeDeleteSpy.count(), 2);
- QVERIFY(beforeDeleteSpy.at(0).at(0).toInt() == 0);
- QVERIFY(beforeDeleteSpy.at(1).at(0).toInt() == 1);
+ QCOMPARE(beforeDeleteSpy.at(0).at(0).toInt(), 0);
+ QCOMPARE(beforeDeleteSpy.at(1).at(0).toInt(), 1);
// deleted rows shown as empty until select
QCOMPARE(model.rowCount(), 3);
QCOMPARE(model.data(model.index(0, 1)).toString(), QString(""));
@@ -1172,11 +1172,11 @@ void tst_QSqlTableModel::removeRows()
QCOMPARE(headerDataChangedSpy.at(1).at(1).toInt(), 0);
QCOMPARE(headerDataChangedSpy.at(1).at(2).toInt(), 0);
QCOMPARE(model.rowCount(), 3);
- QVERIFY(beforeDeleteSpy.count() == 0);
+ QCOMPARE(beforeDeleteSpy.count(), 0);
QVERIFY(model.submitAll());
- QVERIFY(beforeDeleteSpy.count() == 2);
- QVERIFY(beforeDeleteSpy.at(0).at(0).toInt() == 0);
- QVERIFY(beforeDeleteSpy.at(1).at(0).toInt() == 1);
+ QCOMPARE(beforeDeleteSpy.count(), 2);
+ QCOMPARE(beforeDeleteSpy.at(0).at(0).toInt(), 0);
+ QCOMPARE(beforeDeleteSpy.at(1).at(0).toInt(), 1);
QCOMPARE(model.rowCount(), 1);
QCOMPARE(model.data(model.index(0, 1)).toString(), QString("vohi"));
}
diff --git a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
index 6b94dfb529..6446fec510 100644
--- a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+++ b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
@@ -124,6 +124,8 @@ class tst_Cmptest: public QObject
Q_OBJECT
private slots:
+ void compare_unregistered_enums();
+ void compare_registered_enums();
void compare_boolfuncs();
void compare_pointerfuncs();
void compare_tostring();
@@ -138,8 +140,26 @@ private slots:
void compareQImages();
void compareQImages_data();
#endif
+ void verify();
+ void verify2();
+ void tryVerify();
+ void tryVerify2();
};
+enum MyUnregisteredEnum { MyUnregisteredEnumValue1, MyUnregisteredEnumValue2 };
+
+void tst_Cmptest::compare_unregistered_enums()
+{
+ QCOMPARE(MyUnregisteredEnumValue1, MyUnregisteredEnumValue1);
+ QCOMPARE(MyUnregisteredEnumValue1, MyUnregisteredEnumValue2);
+}
+
+void tst_Cmptest::compare_registered_enums()
+{
+ QCOMPARE(Qt::ArrowCursor, Qt::ArrowCursor);
+ QCOMPARE(Qt::ArrowCursor, Qt::BusyCursor);
+}
+
static bool boolfunc() { return true; }
static bool boolfunc2() { return true; }
@@ -371,7 +391,36 @@ void tst_Cmptest::compareQImages()
QCOMPARE(opA, opB);
}
-#endif
+#endif // QT_GUI_LIB
+
+static int opaqueFunc()
+{
+ return 42;
+}
+
+void tst_Cmptest::verify()
+{
+ QVERIFY(opaqueFunc() > 2);
+ QVERIFY(opaqueFunc() < 2);
+}
+
+void tst_Cmptest::verify2()
+{
+ QVERIFY2(opaqueFunc() > 2, QByteArray::number(opaqueFunc()).constData());
+ QVERIFY2(opaqueFunc() < 2, QByteArray::number(opaqueFunc()).constData());
+}
+
+void tst_Cmptest::tryVerify()
+{
+ QTRY_VERIFY(opaqueFunc() > 2);
+ QTRY_VERIFY_WITH_TIMEOUT(opaqueFunc() < 2, 1);
+}
+
+void tst_Cmptest::tryVerify2()
+{
+ QTRY_VERIFY2(opaqueFunc() > 2, QByteArray::number(opaqueFunc()).constData());
+ QTRY_VERIFY2_WITH_TIMEOUT(opaqueFunc() < 2, QByteArray::number(opaqueFunc()).constData(), 1);
+}
QTEST_MAIN(tst_Cmptest)
#include "tst_cmptest.moc"
diff --git a/tests/auto/testlib/selftests/expected_cmptest.lightxml b/tests/auto/testlib/selftests/expected_cmptest.lightxml
index 4a376b5c8b..36929cec6b 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.lightxml
+++ b/tests/auto/testlib/selftests/expected_cmptest.lightxml
@@ -5,18 +5,32 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="compare_unregistered_enums">
+<Incident type="fail" file="tst_cmptest.cpp" line="154">
+ <Description><![CDATA[Compared values are not the same]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="compare_registered_enums">
+<Incident type="fail" file="tst_cmptest.cpp" line="160">
+ <Description><![CDATA[Compared values are not the same
+ Actual (Qt::ArrowCursor): ArrowCursor
+ Expected (Qt::BusyCursor) : BusyCursor]]></Description>
+</Incident>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compare_boolfuncs">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compare_pointerfuncs">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compare_tostring">
-<Incident type="fail" file="tst_cmptest.cpp" line="219">
+<Incident type="fail" file="tst_cmptest.cpp" line="231">
<DataTag><![CDATA[int, string]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual) : QVariant(int,123)
@@ -25,25 +39,25 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[both invalid]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="219">
+<Incident type="fail" file="tst_cmptest.cpp" line="231">
<DataTag><![CDATA[null hash, invalid]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual) : QVariant(QVariantHash)
Expected (expected): QVariant()]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="219">
+<Incident type="fail" file="tst_cmptest.cpp" line="231">
<DataTag><![CDATA[string, null user type]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual) : QVariant(QString,A simple string)
Expected (expected): QVariant(PhonyClass)]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="219">
+<Incident type="fail" file="tst_cmptest.cpp" line="231">
<DataTag><![CDATA[both non-null user type]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual) : QVariant(PhonyClass,<value not representable as string>)
Expected (expected): QVariant(PhonyClass,<value not representable as string>)]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQStringLists">
<Incident type="pass" file="" line="0">
@@ -52,65 +66,65 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[equal lists]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="313">
+<Incident type="fail" file="tst_cmptest.cpp" line="325">
<DataTag><![CDATA[last item different]]></DataTag>
<Description><![CDATA[Compared lists differ at index 2.
Actual (opA): "string3"
Expected (opB): "DIFFERS"]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="313">
+<Incident type="fail" file="tst_cmptest.cpp" line="325">
<DataTag><![CDATA[second-last item different]]></DataTag>
<Description><![CDATA[Compared lists differ at index 2.
Actual (opA): "string3"
Expected (opB): "DIFFERS"]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="313">
+<Incident type="fail" file="tst_cmptest.cpp" line="325">
<DataTag><![CDATA[prefix]]></DataTag>
<Description><![CDATA[Compared lists have different sizes.
Actual (opA) size: 2
Expected (opB) size: 1]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="313">
+<Incident type="fail" file="tst_cmptest.cpp" line="325">
<DataTag><![CDATA[short list second]]></DataTag>
<Description><![CDATA[Compared lists have different sizes.
Actual (opA) size: 12
Expected (opB) size: 1]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="313">
+<Incident type="fail" file="tst_cmptest.cpp" line="325">
<DataTag><![CDATA[short list first]]></DataTag>
<Description><![CDATA[Compared lists have different sizes.
Actual (opA) size: 1
Expected (opB) size: 12]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQListInt">
-<Incident type="fail" file="tst_cmptest.cpp" line="320">
+<Incident type="fail" file="tst_cmptest.cpp" line="332">
<Description><![CDATA[Compared lists differ at index 2.
Actual (int1): 3
Expected (int2): 4]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQListDouble">
-<Incident type="fail" file="tst_cmptest.cpp" line="327">
+<Incident type="fail" file="tst_cmptest.cpp" line="339">
<Description><![CDATA[Compared lists differ at index 0.
Actual (double1): 1.5
Expected (double2): 1]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQPixmaps">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[both null]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="353">
+<Incident type="fail" file="tst_cmptest.cpp" line="365">
<DataTag><![CDATA[one null]]></DataTag>
<Description><![CDATA[Compared QPixmaps differ.
Actual (opA).isNull(): 1
Expected (opB).isNull(): 0]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="353">
+<Incident type="fail" file="tst_cmptest.cpp" line="365">
<DataTag><![CDATA[other null]]></DataTag>
<Description><![CDATA[Compared QPixmaps differ.
Actual (opA).isNull(): 0
@@ -119,29 +133,29 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[equal]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="353">
+<Incident type="fail" file="tst_cmptest.cpp" line="365">
<DataTag><![CDATA[different size]]></DataTag>
<Description><![CDATA[Compared QPixmaps differ in size.
Actual (opA): 11x20
Expected (opB): 20x20]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="353">
+<Incident type="fail" file="tst_cmptest.cpp" line="365">
<DataTag><![CDATA[different pixels]]></DataTag>
<Description><![CDATA[Compared values are not the same]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQImages">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[both null]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="380">
+<Incident type="fail" file="tst_cmptest.cpp" line="392">
<DataTag><![CDATA[one null]]></DataTag>
<Description><![CDATA[Compared QImages differ.
Actual (opA).isNull(): 1
Expected (opB).isNull(): 0]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="380">
+<Incident type="fail" file="tst_cmptest.cpp" line="392">
<DataTag><![CDATA[other null]]></DataTag>
<Description><![CDATA[Compared QImages differ.
Actual (opA).isNull(): 0
@@ -150,26 +164,50 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[equal]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="380">
+<Incident type="fail" file="tst_cmptest.cpp" line="392">
<DataTag><![CDATA[different size]]></DataTag>
<Description><![CDATA[Compared QImages differ in size.
Actual (opA): 11x20
Expected (opB): 20x20]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="380">
+<Incident type="fail" file="tst_cmptest.cpp" line="392">
<DataTag><![CDATA[different format]]></DataTag>
<Description><![CDATA[Compared QImages differ in format.
Actual (opA): 6
Expected (opB): 3]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="380">
+<Incident type="fail" file="tst_cmptest.cpp" line="392">
<DataTag><![CDATA[different pixels]]></DataTag>
<Description><![CDATA[Compared values are not the same]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="verify">
+<Incident type="fail" file="tst_cmptest.cpp" line="404">
+ <Description><![CDATA['opaqueFunc() < 2' returned FALSE. ()]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="verify2">
+<Incident type="fail" file="tst_cmptest.cpp" line="410">
+ <Description><![CDATA['opaqueFunc() < 2' returned FALSE. (42)]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="tryVerify">
+<Incident type="fail" file="tst_cmptest.cpp" line="416">
+ <Description><![CDATA['opaqueFunc() < 2' returned FALSE. ()]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="tryVerify2">
+<Incident type="fail" file="tst_cmptest.cpp" line="422">
+ <Description><![CDATA['opaqueFunc() < 2' returned FALSE. (42)]]></Description>
+</Incident>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
diff --git a/tests/auto/testlib/selftests/expected_cmptest.txt b/tests/auto/testlib/selftests/expected_cmptest.txt
index 9e8c56ed99..70c54704f9 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.txt
+++ b/tests/auto/testlib/selftests/expected_cmptest.txt
@@ -1,91 +1,105 @@
********* Start testing of tst_Cmptest *********
-Config: Using QtTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE@
+Config: Using QtTest library
PASS : tst_Cmptest::initTestCase()
+FAIL! : tst_Cmptest::compare_unregistered_enums() Compared values are not the same
+ Loc: [tst_cmptest.cpp(154)]
+FAIL! : tst_Cmptest::compare_registered_enums() Compared values are not the same
+ Actual (Qt::ArrowCursor): ArrowCursor
+ Expected (Qt::BusyCursor) : BusyCursor
+ Loc: [tst_cmptest.cpp(160)]
PASS : tst_Cmptest::compare_boolfuncs()
PASS : tst_Cmptest::compare_pointerfuncs()
FAIL! : tst_Cmptest::compare_tostring(int, string) Compared values are not the same
Actual (actual) : QVariant(int,123)
Expected (expected): QVariant(QString,hi)
- Loc: [tst_cmptest.cpp(219)]
+ Loc: [tst_cmptest.cpp(231)]
PASS : tst_Cmptest::compare_tostring(both invalid)
FAIL! : tst_Cmptest::compare_tostring(null hash, invalid) Compared values are not the same
Actual (actual) : QVariant(QVariantHash)
Expected (expected): QVariant()
- Loc: [tst_cmptest.cpp(219)]
+ Loc: [tst_cmptest.cpp(231)]
FAIL! : tst_Cmptest::compare_tostring(string, null user type) Compared values are not the same
Actual (actual) : QVariant(QString,A simple string)
Expected (expected): QVariant(PhonyClass)
- Loc: [tst_cmptest.cpp(219)]
+ Loc: [tst_cmptest.cpp(231)]
FAIL! : tst_Cmptest::compare_tostring(both non-null user type) Compared values are not the same
Actual (actual) : QVariant(PhonyClass,<value not representable as string>)
Expected (expected): QVariant(PhonyClass,<value not representable as string>)
- Loc: [tst_cmptest.cpp(219)]
+ Loc: [tst_cmptest.cpp(231)]
PASS : tst_Cmptest::compareQStringLists(empty lists)
PASS : tst_Cmptest::compareQStringLists(equal lists)
FAIL! : tst_Cmptest::compareQStringLists(last item different) Compared lists differ at index 2.
Actual (opA): "string3"
Expected (opB): "DIFFERS"
- Loc: [tst_cmptest.cpp(313)]
+ Loc: [tst_cmptest.cpp(325)]
FAIL! : tst_Cmptest::compareQStringLists(second-last item different) Compared lists differ at index 2.
Actual (opA): "string3"
Expected (opB): "DIFFERS"
- Loc: [tst_cmptest.cpp(313)]
+ Loc: [tst_cmptest.cpp(325)]
FAIL! : tst_Cmptest::compareQStringLists(prefix) Compared lists have different sizes.
Actual (opA) size: 2
Expected (opB) size: 1
- Loc: [tst_cmptest.cpp(313)]
+ Loc: [tst_cmptest.cpp(325)]
FAIL! : tst_Cmptest::compareQStringLists(short list second) Compared lists have different sizes.
Actual (opA) size: 12
Expected (opB) size: 1
- Loc: [tst_cmptest.cpp(313)]
+ Loc: [tst_cmptest.cpp(325)]
FAIL! : tst_Cmptest::compareQStringLists(short list first) Compared lists have different sizes.
Actual (opA) size: 1
Expected (opB) size: 12
- Loc: [tst_cmptest.cpp(313)]
+ Loc: [tst_cmptest.cpp(325)]
FAIL! : tst_Cmptest::compareQListInt() Compared lists differ at index 2.
Actual (int1): 3
Expected (int2): 4
- Loc: [tst_cmptest.cpp(320)]
+ Loc: [tst_cmptest.cpp(332)]
FAIL! : tst_Cmptest::compareQListDouble() Compared lists differ at index 0.
Actual (double1): 1.5
Expected (double2): 1
- Loc: [tst_cmptest.cpp(327)]
+ Loc: [tst_cmptest.cpp(339)]
PASS : tst_Cmptest::compareQPixmaps(both null)
FAIL! : tst_Cmptest::compareQPixmaps(one null) Compared QPixmaps differ.
Actual (opA).isNull(): 1
Expected (opB).isNull(): 0
- Loc: [tst_cmptest.cpp(353)]
+ Loc: [tst_cmptest.cpp(365)]
FAIL! : tst_Cmptest::compareQPixmaps(other null) Compared QPixmaps differ.
Actual (opA).isNull(): 0
Expected (opB).isNull(): 1
- Loc: [tst_cmptest.cpp(353)]
+ Loc: [tst_cmptest.cpp(365)]
PASS : tst_Cmptest::compareQPixmaps(equal)
FAIL! : tst_Cmptest::compareQPixmaps(different size) Compared QPixmaps differ in size.
Actual (opA): 11x20
Expected (opB): 20x20
- Loc: [tst_cmptest.cpp(353)]
+ Loc: [tst_cmptest.cpp(365)]
FAIL! : tst_Cmptest::compareQPixmaps(different pixels) Compared values are not the same
- Loc: [tst_cmptest.cpp(353)]
+ Loc: [tst_cmptest.cpp(365)]
PASS : tst_Cmptest::compareQImages(both null)
FAIL! : tst_Cmptest::compareQImages(one null) Compared QImages differ.
Actual (opA).isNull(): 1
Expected (opB).isNull(): 0
- Loc: [tst_cmptest.cpp(380)]
+ Loc: [tst_cmptest.cpp(392)]
FAIL! : tst_Cmptest::compareQImages(other null) Compared QImages differ.
Actual (opA).isNull(): 0
Expected (opB).isNull(): 1
- Loc: [tst_cmptest.cpp(380)]
+ Loc: [tst_cmptest.cpp(392)]
PASS : tst_Cmptest::compareQImages(equal)
FAIL! : tst_Cmptest::compareQImages(different size) Compared QImages differ in size.
Actual (opA): 11x20
Expected (opB): 20x20
- Loc: [tst_cmptest.cpp(380)]
+ Loc: [tst_cmptest.cpp(392)]
FAIL! : tst_Cmptest::compareQImages(different format) Compared QImages differ in format.
Actual (opA): 6
Expected (opB): 3
- Loc: [tst_cmptest.cpp(380)]
+ Loc: [tst_cmptest.cpp(392)]
FAIL! : tst_Cmptest::compareQImages(different pixels) Compared values are not the same
- Loc: [tst_cmptest.cpp(380)]
+ Loc: [tst_cmptest.cpp(392)]
+FAIL! : tst_Cmptest::verify() 'opaqueFunc() < 2' returned FALSE. ()
+ Loc: [tst_cmptest.cpp(404)]
+FAIL! : tst_Cmptest::verify2() 'opaqueFunc() < 2' returned FALSE. (42)
+ Loc: [tst_cmptest.cpp(410)]
+FAIL! : tst_Cmptest::tryVerify() 'opaqueFunc() < 2' returned FALSE. ()
+ Loc: [tst_cmptest.cpp(416)]
+FAIL! : tst_Cmptest::tryVerify2() 'opaqueFunc() < 2' returned FALSE. (42)
+ Loc: [tst_cmptest.cpp(422)]
PASS : tst_Cmptest::cleanupTestCase()
-Totals: 11 passed, 20 failed, 0 skipped, 0 blacklisted
+Totals: 11 passed, 26 failed, 0 skipped, 0 blacklisted
********* Finished testing of tst_Cmptest *********
diff --git a/tests/auto/testlib/selftests/expected_cmptest.xml b/tests/auto/testlib/selftests/expected_cmptest.xml
index aefb1b5f4c..9437e8e4b7 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.xml
+++ b/tests/auto/testlib/selftests/expected_cmptest.xml
@@ -7,18 +7,32 @@
</Environment>
<TestFunction name="initTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="compare_unregistered_enums">
+<Incident type="fail" file="tst_cmptest.cpp" line="154">
+ <Description><![CDATA[Compared values are not the same]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="compare_registered_enums">
+<Incident type="fail" file="tst_cmptest.cpp" line="160">
+ <Description><![CDATA[Compared values are not the same
+ Actual (Qt::ArrowCursor): ArrowCursor
+ Expected (Qt::BusyCursor) : BusyCursor]]></Description>
+</Incident>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compare_boolfuncs">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compare_pointerfuncs">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compare_tostring">
-<Incident type="fail" file="tst_cmptest.cpp" line="219">
+<Incident type="fail" file="tst_cmptest.cpp" line="231">
<DataTag><![CDATA[int, string]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual) : QVariant(int,123)
@@ -27,25 +41,25 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[both invalid]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="219">
+<Incident type="fail" file="tst_cmptest.cpp" line="231">
<DataTag><![CDATA[null hash, invalid]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual) : QVariant(QVariantHash)
Expected (expected): QVariant()]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="219">
+<Incident type="fail" file="tst_cmptest.cpp" line="231">
<DataTag><![CDATA[string, null user type]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual) : QVariant(QString,A simple string)
Expected (expected): QVariant(PhonyClass)]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="219">
+<Incident type="fail" file="tst_cmptest.cpp" line="231">
<DataTag><![CDATA[both non-null user type]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual) : QVariant(PhonyClass,<value not representable as string>)
Expected (expected): QVariant(PhonyClass,<value not representable as string>)]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQStringLists">
<Incident type="pass" file="" line="0">
@@ -54,65 +68,65 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[equal lists]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="313">
+<Incident type="fail" file="tst_cmptest.cpp" line="325">
<DataTag><![CDATA[last item different]]></DataTag>
<Description><![CDATA[Compared lists differ at index 2.
Actual (opA): "string3"
Expected (opB): "DIFFERS"]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="313">
+<Incident type="fail" file="tst_cmptest.cpp" line="325">
<DataTag><![CDATA[second-last item different]]></DataTag>
<Description><![CDATA[Compared lists differ at index 2.
Actual (opA): "string3"
Expected (opB): "DIFFERS"]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="313">
+<Incident type="fail" file="tst_cmptest.cpp" line="325">
<DataTag><![CDATA[prefix]]></DataTag>
<Description><![CDATA[Compared lists have different sizes.
Actual (opA) size: 2
Expected (opB) size: 1]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="313">
+<Incident type="fail" file="tst_cmptest.cpp" line="325">
<DataTag><![CDATA[short list second]]></DataTag>
<Description><![CDATA[Compared lists have different sizes.
Actual (opA) size: 12
Expected (opB) size: 1]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="313">
+<Incident type="fail" file="tst_cmptest.cpp" line="325">
<DataTag><![CDATA[short list first]]></DataTag>
<Description><![CDATA[Compared lists have different sizes.
Actual (opA) size: 1
Expected (opB) size: 12]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQListInt">
-<Incident type="fail" file="tst_cmptest.cpp" line="320">
+<Incident type="fail" file="tst_cmptest.cpp" line="332">
<Description><![CDATA[Compared lists differ at index 2.
Actual (int1): 3
Expected (int2): 4]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQListDouble">
-<Incident type="fail" file="tst_cmptest.cpp" line="327">
+<Incident type="fail" file="tst_cmptest.cpp" line="339">
<Description><![CDATA[Compared lists differ at index 0.
Actual (double1): 1.5
Expected (double2): 1]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQPixmaps">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[both null]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="353">
+<Incident type="fail" file="tst_cmptest.cpp" line="365">
<DataTag><![CDATA[one null]]></DataTag>
<Description><![CDATA[Compared QPixmaps differ.
Actual (opA).isNull(): 1
Expected (opB).isNull(): 0]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="353">
+<Incident type="fail" file="tst_cmptest.cpp" line="365">
<DataTag><![CDATA[other null]]></DataTag>
<Description><![CDATA[Compared QPixmaps differ.
Actual (opA).isNull(): 0
@@ -121,29 +135,29 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[equal]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="353">
+<Incident type="fail" file="tst_cmptest.cpp" line="365">
<DataTag><![CDATA[different size]]></DataTag>
<Description><![CDATA[Compared QPixmaps differ in size.
Actual (opA): 11x20
Expected (opB): 20x20]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="353">
+<Incident type="fail" file="tst_cmptest.cpp" line="365">
<DataTag><![CDATA[different pixels]]></DataTag>
<Description><![CDATA[Compared values are not the same]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQImages">
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[both null]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="380">
+<Incident type="fail" file="tst_cmptest.cpp" line="392">
<DataTag><![CDATA[one null]]></DataTag>
<Description><![CDATA[Compared QImages differ.
Actual (opA).isNull(): 1
Expected (opB).isNull(): 0]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="380">
+<Incident type="fail" file="tst_cmptest.cpp" line="392">
<DataTag><![CDATA[other null]]></DataTag>
<Description><![CDATA[Compared QImages differ.
Actual (opA).isNull(): 0
@@ -152,27 +166,51 @@
<Incident type="pass" file="" line="0">
<DataTag><![CDATA[equal]]></DataTag>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="380">
+<Incident type="fail" file="tst_cmptest.cpp" line="392">
<DataTag><![CDATA[different size]]></DataTag>
<Description><![CDATA[Compared QImages differ in size.
Actual (opA): 11x20
Expected (opB): 20x20]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="380">
+<Incident type="fail" file="tst_cmptest.cpp" line="392">
<DataTag><![CDATA[different format]]></DataTag>
<Description><![CDATA[Compared QImages differ in format.
Actual (opA): 6
Expected (opB): 3]]></Description>
</Incident>
-<Incident type="fail" file="tst_cmptest.cpp" line="380">
+<Incident type="fail" file="tst_cmptest.cpp" line="392">
<DataTag><![CDATA[different pixels]]></DataTag>
<Description><![CDATA[Compared values are not the same]]></Description>
</Incident>
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="verify">
+<Incident type="fail" file="tst_cmptest.cpp" line="404">
+ <Description><![CDATA['opaqueFunc() < 2' returned FALSE. ()]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="verify2">
+<Incident type="fail" file="tst_cmptest.cpp" line="410">
+ <Description><![CDATA['opaqueFunc() < 2' returned FALSE. (42)]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="tryVerify">
+<Incident type="fail" file="tst_cmptest.cpp" line="416">
+ <Description><![CDATA['opaqueFunc() < 2' returned FALSE. ()]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="tryVerify2">
+<Incident type="fail" file="tst_cmptest.cpp" line="422">
+ <Description><![CDATA['opaqueFunc() < 2' returned FALSE. (42)]]></Description>
+</Incident>
+ <Duration msecs="0"/>
</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
-<Duration msecs="0"/>
+ <Duration msecs="0"/>
</TestFunction>
<Duration msecs="0"/>
</TestCase>
diff --git a/tests/auto/testlib/selftests/expected_cmptest.xunitxml b/tests/auto/testlib/selftests/expected_cmptest.xunitxml
index 7502d3cc54..fa970d4172 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.xunitxml
+++ b/tests/auto/testlib/selftests/expected_cmptest.xunitxml
@@ -1,11 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<testsuite errors="0" failures="20" tests="10" name="tst_Cmptest">
+<testsuite errors="0" failures="26" tests="16" name="tst_Cmptest">
<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="fail" name="compare_unregistered_enums">
+ <failure message="Compared values are not the same" result="fail"/>
+ </testcase>
+ <testcase result="fail" name="compare_registered_enums">
+ <failure message="Compared values are not the same
+ Actual (Qt::ArrowCursor): ArrowCursor
+ Expected (Qt::BusyCursor) : BusyCursor" result="fail"/>
+ </testcase>
<testcase result="pass" name="compare_boolfuncs"/>
<testcase result="pass" name="compare_pointerfuncs"/>
<testcase result="fail" name="compare_tostring">
@@ -76,6 +84,18 @@
Expected (opB): 3" result="fail"/>
<failure tag="different pixels" message="Compared values are not the same" result="fail"/>
</testcase>
+ <testcase result="fail" name="verify">
+ <failure message="&apos;opaqueFunc() &lt; 2&apos; returned FALSE. ()" result="fail"/>
+ </testcase>
+ <testcase result="fail" name="verify2">
+ <failure message="&apos;opaqueFunc() &lt; 2&apos; returned FALSE. (42)" result="fail"/>
+ </testcase>
+ <testcase result="fail" name="tryVerify">
+ <failure message="&apos;opaqueFunc() &lt; 2&apos; returned FALSE. ()" result="fail"/>
+ </testcase>
+ <testcase result="fail" name="tryVerify2">
+ <failure message="&apos;opaqueFunc() &lt; 2&apos; returned FALSE. (42)" result="fail"/>
+ </testcase>
<testcase result="pass" name="cleanupTestCase"/>
<system-err/>
</testsuite>
diff --git a/tests/auto/testlib/selftests/expected_crashes_3.txt b/tests/auto/testlib/selftests/expected_crashes_3.txt
index 57c3ddc2ba..0e3f60dd1b 100644
--- a/tests/auto/testlib/selftests/expected_crashes_3.txt
+++ b/tests/auto/testlib/selftests/expected_crashes_3.txt
@@ -2,6 +2,7 @@
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)]
Totals: 1 passed, 1 failed, 0 skipped, 0 blacklisted
diff --git a/tests/auto/testlib/selftests/selftests.pro b/tests/auto/testlib/selftests/selftests.pro
index 1d39e6a899..091f0dd5a1 100644
--- a/tests/auto/testlib/selftests/selftests.pro
+++ b/tests/auto/testlib/selftests/selftests.pro
@@ -1,6 +1,6 @@
TEMPLATE = subdirs
-include(selftests.pri)
+!winrt: include(selftests.pri)
SUBDIRS = $$SUBPROGRAMS test
diff --git a/tests/auto/testlib/selftests/test/test.pro b/tests/auto/testlib/selftests/test/test.pro
index 0a31810105..d94b45ce89 100644
--- a/tests/auto/testlib/selftests/test/test.pro
+++ b/tests/auto/testlib/selftests/test/test.pro
@@ -16,5 +16,5 @@ win32 {
RESOURCES += ../selftests.qrc
include(../selftests.pri)
-for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../$${file}/$${file}"
+!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 6536f103ac..63c48fc809 100644
--- a/tests/auto/testlib/selftests/tst_selftests.cpp
+++ b/tests/auto/testlib/selftests/tst_selftests.cpp
@@ -316,6 +316,7 @@ tst_Selftests::tst_Selftests()
void tst_Selftests::initTestCase()
{
+ QVERIFY2(tempDir.isValid(), qPrintable(tempDir.errorString()));
//Detect the location of the sub programs
QString subProgram = QLatin1String("float/float");
#if defined(Q_OS_WIN)
@@ -571,7 +572,9 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge
#endif
QProcess proc;
- static const QProcessEnvironment environment = processEnvironment();
+ QProcessEnvironment environment = processEnvironment();
+ if (crashes)
+ environment.insert("QTEST_DISABLE_STACK_DUMP", "1");
proc.setProcessEnvironment(environment);
const QString path = subdir + QLatin1Char('/') + subdir;
proc.start(path, arguments);
@@ -623,11 +626,33 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge
for (int n = 0; n < loggers.count(); ++n) {
QString logger = loggers[n];
+ if (n == 0 && subdir == QLatin1String("crashes")) {
+ QByteArray &actual = actualOutputs[0];
+#ifndef Q_OS_WIN
+ // Remove digits of times to match the expected file.
+ const QLatin1String timePattern("Function time:");
+ int timePos = actual.indexOf(timePattern);
+ if (timePos >= 0) {
+ timePos += timePattern.size();
+ const int nextLinePos = actual.indexOf('\n', timePos);
+ for (int c = (nextLinePos != -1 ? nextLinePos : actual.size()) - 1; c >= timePos; --c) {
+ if (actual.at(c) >= '0' && actual.at(c) <= '9')
+ actual.remove(c, 1);
+ }
+ }
+#else // !Q_OS_WIN
+ // Remove stack trace which is output to stdout.
+ const int exceptionLogStart = actual.indexOf("A crash occurred in ");
+ if (exceptionLogStart >= 0)
+ actual.truncate(exceptionLogStart);
+#endif // Q_OS_WIN
+ }
+
QList<QByteArray> res = splitLines(actualOutputs[n]);
const QString expectedFileName = expectedFileNameFromTest(subdir, logger);
QList<QByteArray> exp = expectedResult(expectedFileName);
-#if defined (Q_CC_MSVC) || defined(Q_CC_MINGW)
- // MSVC, MinGW format double numbers differently
+#if (defined (Q_CC_MSVC) && _MSC_VER < 1900)|| defined(Q_CC_MINGW)
+ // MSVC up to MSVC2013, MinGW format double numbers differently
if (n == 0 && subdir == QStringLiteral("float")) {
for (int i = 0; i < exp.size(); ++i) {
exp[i].replace("e-07", "e-007");
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 350c6142d2..c113b7cd60 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -513,6 +513,8 @@ class tst_Moc : public QObject
Q_PROPERTY(QString member4 MEMBER sMember NOTIFY member4Changed)
Q_PROPERTY(QString member5 MEMBER sMember NOTIFY member5Changed)
Q_PROPERTY(QString member6 MEMBER sConst CONSTANT)
+ Q_PROPERTY(QString sub1 MEMBER (sub.m_string))
+ Q_PROPERTY(QString sub2 READ (sub.string) WRITE (sub.setString))
public:
inline tst_Moc() : sConst("const") {}
@@ -626,6 +628,13 @@ private:
QString sMember;
const QString sConst;
PrivatePropertyTest *pPPTest;
+
+ struct {
+ QString m_string;
+ void setString(const QString &s) { m_string = s; }
+ QString string() { return m_string; }
+ } sub;
+
};
void tst_Moc::initTestCase()
@@ -880,7 +889,7 @@ void tst_Moc::preprocessorConditionals()
QVERIFY(mobj->indexOfSignal("signalInIf1()") != -1);
QVERIFY(mobj->indexOfSignal("signalInIf2()") != -1);
QVERIFY(mobj->indexOfSignal("signalInIf3()") != -1);
- QVERIFY(mobj->indexOfSignal("doNotExist()") == -1);
+ QCOMPARE(mobj->indexOfSignal("doNotExist()"), -1);
}
void tst_Moc::blackslashNewlines()
@@ -888,7 +897,7 @@ void tst_Moc::blackslashNewlines()
BackslashNewlines tst;
const QMetaObject *mobj = tst.metaObject();
QVERIFY(mobj->indexOfSlot("works()") != -1);
- QVERIFY(mobj->indexOfSlot("buggy()") == -1);
+ QCOMPARE(mobj->indexOfSlot("buggy()"), -1);
}
void tst_Moc::slotWithSillyConst()
@@ -928,8 +937,8 @@ void tst_Moc::testExtraDataForEnum()
const QMetaObject * const *objects = mobjUser->d.relatedMetaObjects;
QVERIFY(objects);
- QVERIFY(objects[0] == mobjSource);
- QVERIFY(objects[1] == 0);
+ QCOMPARE(objects[0], mobjSource);
+ QVERIFY(!objects[1]);
}
void tst_Moc::namespaceTypeProperty()
@@ -982,7 +991,7 @@ void tst_Moc::namespacedFlags()
const QVariant v = bar.property("flags");
QVERIFY(v.isValid());
QVERIFY(baz.setProperty("flags", v));
- QVERIFY(baz.flags() == bar.flags());
+ QCOMPARE(baz.flags(), bar.flags());
QList<Foo::Bar::Flags> l;
l << baz.flags();
@@ -1104,7 +1113,7 @@ void tst_Moc::winNewline()
if (data.at(i) == QLatin1Char('\r')) {
QVERIFY(i < data.count() - 1);
++i;
- QVERIFY(data.at(i) == '\n');
+ QCOMPARE(data.at(i), '\n');
} else {
QVERIFY(data.at(i) != '\n');
}
@@ -1255,14 +1264,14 @@ void tst_Moc::invokable()
{
const QMetaObject &mobj = InvokableBeforeReturnType::staticMetaObject;
QCOMPARE(mobj.methodCount(), 6);
- QVERIFY(mobj.method(5).methodSignature() == QByteArray("foo()"));
+ QCOMPARE(mobj.method(5).methodSignature(), QByteArray("foo()"));
}
{
const QMetaObject &mobj = InvokableBeforeInline::staticMetaObject;
QCOMPARE(mobj.methodCount(), 7);
- QVERIFY(mobj.method(5).methodSignature() == QByteArray("foo()"));
- QVERIFY(mobj.method(6).methodSignature() == QByteArray("bar()"));
+ QCOMPARE(mobj.method(5).methodSignature(), QByteArray("foo()"));
+ QCOMPARE(mobj.method(6).methodSignature(), QByteArray("bar()"));
}
}
@@ -1271,22 +1280,22 @@ void tst_Moc::singleFunctionKeywordSignalAndSlot()
{
const QMetaObject &mobj = SingleFunctionKeywordBeforeReturnType::staticMetaObject;
QCOMPARE(mobj.methodCount(), 7);
- QVERIFY(mobj.method(5).methodSignature() == QByteArray("mySignal()"));
- QVERIFY(mobj.method(6).methodSignature() == QByteArray("mySlot()"));
+ QCOMPARE(mobj.method(5).methodSignature(), QByteArray("mySignal()"));
+ QCOMPARE(mobj.method(6).methodSignature(), QByteArray("mySlot()"));
}
{
const QMetaObject &mobj = SingleFunctionKeywordBeforeInline::staticMetaObject;
QCOMPARE(mobj.methodCount(), 7);
- QVERIFY(mobj.method(5).methodSignature() == QByteArray("mySignal()"));
- QVERIFY(mobj.method(6).methodSignature() == QByteArray("mySlot()"));
+ QCOMPARE(mobj.method(5).methodSignature(), QByteArray("mySignal()"));
+ QCOMPARE(mobj.method(6).methodSignature(), QByteArray("mySlot()"));
}
{
const QMetaObject &mobj = SingleFunctionKeywordAfterInline::staticMetaObject;
QCOMPARE(mobj.methodCount(), 7);
- QVERIFY(mobj.method(5).methodSignature() == QByteArray("mySignal()"));
- QVERIFY(mobj.method(6).methodSignature() == QByteArray("mySlot()"));
+ QCOMPARE(mobj.method(5).methodSignature(), QByteArray("mySignal()"));
+ QCOMPARE(mobj.method(6).methodSignature(), QByteArray("mySlot()"));
}
}
@@ -1740,34 +1749,34 @@ template <class T>
void tst_Moc::revisions_T()
{
int idx = T::staticMetaObject.indexOfProperty("prop1");
- QVERIFY(T::staticMetaObject.property(idx).revision() == 0);
+ QCOMPARE(T::staticMetaObject.property(idx).revision(), 0);
idx = T::staticMetaObject.indexOfProperty("prop2");
- QVERIFY(T::staticMetaObject.property(idx).revision() == 2);
+ QCOMPARE(T::staticMetaObject.property(idx).revision(), 2);
idx = T::staticMetaObject.indexOfMethod("method1()");
- QVERIFY(T::staticMetaObject.method(idx).revision() == 0);
+ QCOMPARE(T::staticMetaObject.method(idx).revision(), 0);
idx = T::staticMetaObject.indexOfMethod("method2()");
- QVERIFY(T::staticMetaObject.method(idx).revision() == 4);
+ QCOMPARE(T::staticMetaObject.method(idx).revision(), 4);
idx = T::staticMetaObject.indexOfSlot("slot1()");
- QVERIFY(T::staticMetaObject.method(idx).revision() == 0);
+ QCOMPARE(T::staticMetaObject.method(idx).revision(), 0);
idx = T::staticMetaObject.indexOfSlot("slot2()");
- QVERIFY(T::staticMetaObject.method(idx).revision() == 3);
+ QCOMPARE(T::staticMetaObject.method(idx).revision(), 3);
idx = T::staticMetaObject.indexOfSlot("slot3()");
- QVERIFY(T::staticMetaObject.method(idx).revision() == 6);
+ QCOMPARE(T::staticMetaObject.method(idx).revision(), 6);
idx = T::staticMetaObject.indexOfSlot("slot4()");
- QVERIFY(T::staticMetaObject.method(idx).revision() == 6);
+ QCOMPARE(T::staticMetaObject.method(idx).revision(), 6);
idx = T::staticMetaObject.indexOfSignal("signal1()");
- QVERIFY(T::staticMetaObject.method(idx).revision() == 0);
+ QCOMPARE(T::staticMetaObject.method(idx).revision(), 0);
idx = T::staticMetaObject.indexOfSignal("signal2()");
- QVERIFY(T::staticMetaObject.method(idx).revision() == 5);
+ QCOMPARE(T::staticMetaObject.method(idx).revision(), 5);
idx = T::staticMetaObject.indexOfSignal("signal3()");
- QVERIFY(T::staticMetaObject.method(idx).revision() == 7);
+ QCOMPARE(T::staticMetaObject.method(idx).revision(), 7);
idx = T::staticMetaObject.indexOfSignal("signal4()");
- QVERIFY(T::staticMetaObject.method(idx).revision() == 7);
+ QCOMPARE(T::staticMetaObject.method(idx).revision(), 7);
idx = T::staticMetaObject.indexOfEnumerator("TestEnum");
QCOMPARE(T::staticMetaObject.enumerator(idx).keyCount(), 2);
@@ -1883,12 +1892,19 @@ void tst_Moc::warnings_data()
<< QString()
<< QString("standard input:5: Error: Class declaration lacks Q_OBJECT macro.");
- QTest::newRow("QTBUG-46210: crash on invalid macro")
- << QByteArray("#define Foo(a, b, c) a b c #a #b #c a##b##c #d\n Foo(45);")
+ QTest::newRow("Invalid macro definition")
+ << QByteArray("#define Foo(a, b, c) a b c #a #b #c a##b##c #d\n Foo(45, 42, 39);")
<< QStringList()
<< 1
<< QString("IGNORE_ALL_STDOUT")
<< QString(":2: Error: '#' is not followed by a macro parameter");
+
+ QTest::newRow("QTBUG-46210: crash on invalid macro invocation")
+ << QByteArray("#define Foo(a, b, c) a b c #a #b #c a##b##c\n Foo(45);")
+ << QStringList()
+ << 1
+ << QString("IGNORE_ALL_STDOUT")
+ << QString(":2: Error: Macro invoked with too few parameters for a use of '#'");
}
void tst_Moc::warnings()
@@ -1947,7 +1963,7 @@ public:
void tst_Moc::privateClass()
{
- QVERIFY(PrivateClass::staticMetaObject.indexOfConstructor("PrivateClass()") == 0);
+ QCOMPARE(PrivateClass::staticMetaObject.indexOfConstructor("PrivateClass()"), 0);
QVERIFY(PrivateClass::staticMetaObject.indexOfSignal("someSignal()") > 0);
}
@@ -2037,6 +2053,10 @@ void tst_Moc::memberProperties_data()
<< 1 << "blub5" << "blub5Changed(const QString&)" << "mno" << true << "mno";
QTest::newRow("private MEMBER property with CONSTANT")
<< 1 << "blub6" << "" << "test" << false << "const";
+ QTest::newRow("sub1")
+ << 0 << "sub1" << "" << "helloSub1" << true << "helloSub1";
+ QTest::newRow("sub2")
+ << 0 << "sub2" << "" << "helloSub2" << true << "helloSub2";
}
void tst_Moc::memberProperties()
@@ -3068,7 +3088,7 @@ void tst_Moc::parseDefines()
int index = mo->indexOfSlot("stringMethod()");
QVERIFY(index != -1);
- QVERIFY(mo->method(index).returnType() == QMetaType::QString);
+ QCOMPARE(mo->method(index).returnType(), int(QMetaType::QString));
index = mo->indexOfSlot("combined1()");
QVERIFY(index != -1);
@@ -3127,7 +3147,7 @@ void tst_Moc::parseDefines()
QVERIFY(!qstrcmp(mci.value(), "TestValue"));
}
}
- QVERIFY(count == 3);
+ QCOMPARE(count, 3);
index = mo->indexOfSlot("PD_DEFINE_ITSELF_SUFFIX(int)");
QVERIFY(index != -1);
@@ -3253,7 +3273,7 @@ void tst_Moc::relatedMetaObjectsWithinNamespaces()
const QMetaObject *testMo = &QTBUG_2151::B::staticMetaObject;
QVERIFY(testMo->d.relatedMetaObjects);
- QVERIFY(testMo->d.relatedMetaObjects[0] == relatedMo);
+ QCOMPARE(testMo->d.relatedMetaObjects[0], relatedMo);
}
void tst_Moc::relatedMetaObjectsInGadget()
@@ -3262,7 +3282,7 @@ void tst_Moc::relatedMetaObjectsInGadget()
const QMetaObject *testMo = &QTBUG_35657::B::staticMetaObject;
QVERIFY(testMo->d.relatedMetaObjects);
- QVERIFY(testMo->d.relatedMetaObjects[0] == relatedMo);
+ QCOMPARE(testMo->d.relatedMetaObjects[0], relatedMo);
}
void tst_Moc::relatedMetaObjectsNameConflict_data()
diff --git a/tests/auto/tools/qmake/qmake.pro b/tests/auto/tools/qmake/qmake.pro
index 5ed3073e20..d0817247db 100644
--- a/tests/auto/tools/qmake/qmake.pro
+++ b/tests/auto/tools/qmake/qmake.pro
@@ -8,5 +8,11 @@ SOURCES += tst_qmake.cpp testcompiler.cpp
QT = core testlib
cross_compile: DEFINES += QMAKE_CROSS_COMPILED
+debug_and_release {
+ CONFIG(debug, debug|release): \
+ DEFINES += DEBUG_BUILD
+ else: \
+ DEFINES += RELEASE_BUILD
+}
TESTDATA += testdata/*
diff --git a/tests/auto/tools/qmake/testdata/.gitignore b/tests/auto/tools/qmake/testdata/.gitignore
new file mode 100644
index 0000000000..1e997b287b
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/.gitignore
@@ -0,0 +1,5 @@
+# Created by various tests, even for shadow builds:
+/pro_file_cache/include.pri
+/quotedfilenames/cpp folder/
+/quotedfilenames/quotedfilenames
+/resources/resources
diff --git a/tests/auto/tools/qmake/testdata/findDeps/findDeps.pro b/tests/auto/tools/qmake/testdata/findDeps/findDeps.pro
index 442c9c767f..afb3f65297 100644
--- a/tests/auto/tools/qmake/testdata/findDeps/findDeps.pro
+++ b/tests/auto/tools/qmake/testdata/findDeps/findDeps.pro
@@ -1,4 +1,5 @@
DESTDIR = ./
+gcc: QMAKE_CXXFLAGS += -Wno-comment
HEADERS += object1.h \
object2.h \
@@ -8,5 +9,7 @@ HEADERS += object1.h \
object6.h \
object7.h \
object8.h \
- object9.h
-SOURCES += main.cpp
+ object9.h \
+ objecta.h \
+ objectf.h
+SOURCES += main.cpp needed.cpp
diff --git a/tests/auto/tools/qmake/testdata/findDeps/main.cpp b/tests/auto/tools/qmake/testdata/findDeps/main.cpp
index e4aa5c6251..3f4f5def3c 100644
--- a/tests/auto/tools/qmake/testdata/findDeps/main.cpp
+++ b/tests/auto/tools/qmake/testdata/findDeps/main.cpp
@@ -31,23 +31,60 @@
**
****************************************************************************/
+#define spurious \
+ / #include "needed.cpp"
+// if not ignored, symbol needed() won't be available ...
- #include <moc_object1.cpp>
-/**/ #include <moc_object2.cpp>
-/**//**/ #include <moc_object3.cpp>
-/*'*/ #include <moc_object4.cpp>
-/*
-*/ #include <moc_object5.cpp>
+// Check we're not confused by string juxtaposition:
+static const char text[] = "lorem ""ipsum /*";
-//
+ #include <moc_object1.cpp>
+/**/ #include "\
+moc_object2.cpp\
+"
+/**//**/ #include <moc_\
+o\
+b\
+j\
+e\
+c\
+t\
+3\
+.cpp>
+/*'"*/ #include <moc_object4.cpp>
+/*"'
+*/ #include <moc_object5.cpp> /*
+#include "missing.cpp"
+*/// a backslash newline does make the next line part of this comment \
+/* so this text is in last line's C++-style comment, not a C-comment !
#include <moc_object6.cpp>
+#if 0
+#pragma "ignore me" '&' L"me"
+#line 4321 "main.cpp" more /* preprocessing */ tokens
+#endif
static void function1();
-#include <moc_object7.cpp>
+#include/* every comment
+gets replaced (in phase 3) by a single
+space */<moc_object7.cpp>
static void function2(); /**/
-#include <moc_object8.cpp>
+#include \
+<moc_object8.cpp>
static void function3(); //
#include <moc_object9.cpp>
+/* backslash-newline elimination happens in phase 2 *\
+/ # /* and that's valid here, too. *\
+/ include/* and, of course, here *\
+/<moc_objecta.cpp>// while we're here, ... \
+#include "needed.cpp"
-int main () {}
+int main () {
+ extern int needed(void);
+ return needed();
+}
+/*
+ Deliberately end file in a #include, with nothing after it but the mandatory
+ (unescaped) newline at the end of every source file.
+*/
+#include "moc_objectf.cpp"
diff --git a/tests/auto/tools/qmake/testdata/findDeps/needed.cpp b/tests/auto/tools/qmake/testdata/findDeps/needed.cpp
new file mode 100644
index 0000000000..698d0aaa12
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/findDeps/needed.cpp
@@ -0,0 +1 @@
+extern int needed(void) { return 1; }
diff --git a/tests/auto/tools/qmake/testdata/findDeps/objecta.h b/tests/auto/tools/qmake/testdata/findDeps/objecta.h
new file mode 100644
index 0000000000..b9813b9e18
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/findDeps/objecta.h
@@ -0,0 +1,41 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QObject>
+
+class ObjectA : public QObject
+{
+ Q_OBJECT
+};
+
diff --git a/tests/auto/tools/qmake/testdata/findDeps/objectf.h b/tests/auto/tools/qmake/testdata/findDeps/objectf.h
new file mode 100644
index 0000000000..5dead815a0
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/findDeps/objectf.h
@@ -0,0 +1,41 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QObject>
+
+class ObjectF : public QObject
+{
+ Q_OBJECT
+};
+
diff --git a/tests/auto/tools/qmake/testdata/findMocs/findMocs.pro b/tests/auto/tools/qmake/testdata/findMocs/findMocs.pro
index a4a7dc987d..af672c2621 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/findMocs.pro
+++ b/tests/auto/tools/qmake/testdata/findMocs/findMocs.pro
@@ -1,4 +1,5 @@
DESTDIR = ./
-HEADERS += object1.h object2.h object3.h object4.h object5.h object6.h object7.h
+HEADERS += object1.h object2.h object3.h object4.h \
+ object5.h object6.h object7.h object8.h object9.h
SOURCES += main.cpp
diff --git a/tests/auto/tools/qmake/testdata/findMocs/main.cpp b/tests/auto/tools/qmake/testdata/findMocs/main.cpp
index 8e0ef9fc41..3f566c4af4 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/main.cpp
+++ b/tests/auto/tools/qmake/testdata/findMocs/main.cpp
@@ -39,6 +39,7 @@
#include <moc_object5.cpp>
#include <moc_object6.cpp>
#include <moc_object7.cpp>
+#include "object8.h"
+#include <moc_object9.cpp>
-int main () {}
-
+int main() { return 0; }
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object1.h b/tests/auto/tools/qmake/testdata/findMocs/object1.h
index e0857f4297..1fcac5f511 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/object1.h
+++ b/tests/auto/tools/qmake/testdata/findMocs/object1.h
@@ -37,6 +37,6 @@
class Object1 : public QObject
{
- Q_OBJECT
+ Q\
+_OBJECT
};
-
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object2.h b/tests/auto/tools/qmake/testdata/findMocs/object2.h
index cc60269cd3..a52489b44c 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/object2.h
+++ b/tests/auto/tools/qmake/testdata/findMocs/object2.h
@@ -36,6 +36,6 @@
class Object2 : public QObject
{
- Q_OBJECT
+ Q_\
+OBJECT
};
-
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object3.h b/tests/auto/tools/qmake/testdata/findMocs/object3.h
index c66edee6e1..c481a0796d 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/object3.h
+++ b/tests/auto/tools/qmake/testdata/findMocs/object3.h
@@ -37,6 +37,6 @@
class Object3 : public QObject
{
- Q_OBJECT
+ Q_OBJ\
+ECT
};
-
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object4.h b/tests/auto/tools/qmake/testdata/findMocs/object4.h
index 73bf9cdaa3..eb38652f14 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/object4.h
+++ b/tests/auto/tools/qmake/testdata/findMocs/object4.h
@@ -44,10 +44,9 @@ class Object4 : public QObject
Comment ends there --> /*/
// Now we poison moc, just to make sure this doesn't get moc'ed :)
-class NonMocObject
+class NonMocObject4
/* : QObject */
{
/* qmake ignore Q_OBJECT */
Q_OBJECT
};
-
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object7.h b/tests/auto/tools/qmake/testdata/findMocs/object7.h
index 92b4672d6b..3922a542e0 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/object7.h
+++ b/tests/auto/tools/qmake/testdata/findMocs/object7.h
@@ -33,6 +33,7 @@
/**//*'*/
#include <QObject>
+#define bogon /"/*"
class Object7 : public QObject
{
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object8.h b/tests/auto/tools/qmake/testdata/findMocs/object8.h
new file mode 100644
index 0000000000..51096e4c27
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/findMocs/object8.h
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QObject>
+#define Q_OBJECTOID_THING // empty
+
+class Object8 : public QObject
+{
+ Q_OBJECT\
+OID_THING
+};
+
+// Now we poison moc, just to make sure this doesn't get moc'ed :)
+class NonMocObject8
+/* : QObject */
+{
+ /* qmake ignore Q_OBJECT */
+ Q_OBJECT
+};
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object9.h b/tests/auto/tools/qmake/testdata/findMocs/object9.h
new file mode 100644
index 0000000000..bda50355d9
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/findMocs/object9.h
@@ -0,0 +1,41 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QObject>
+#define juxtaposed "lorem ""ipsum /*"
+
+class Object9 : public QObject
+{
+ Q_OBJECT
+};
diff --git a/tests/auto/tools/qmake/testdata/rawString/main.cpp b/tests/auto/tools/qmake/testdata/rawString/main.cpp
new file mode 100644
index 0000000000..604986666a
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/rawString/main.cpp
@@ -0,0 +1,38 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+static const char raw[] = R"blah(lorem " ipsum /*)blah"\
+;
+#include <moc_object1.cpp>
+
+int main () { return 0; }
diff --git a/tests/auto/tools/qmake/testdata/rawString/object1.h b/tests/auto/tools/qmake/testdata/rawString/object1.h
new file mode 100644
index 0000000000..1435624f7b
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/rawString/object1.h
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://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 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#define rawstring R"blah(lorem " ipsum /*)blah";
+#include <QObject>
+
+class Object1 : public QObject
+{
+ Q_OBJECT
+};
diff --git a/tests/auto/tools/qmake/testdata/rawString/rawString.pro b/tests/auto/tools/qmake/testdata/rawString/rawString.pro
new file mode 100644
index 0000000000..d2d8132ceb
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/rawString/rawString.pro
@@ -0,0 +1,4 @@
+DESTDIR = ./
+
+HEADERS += object1.h
+SOURCES += main.cpp
diff --git a/tests/auto/widgets/kernel/qapplication/wincmdline/main.cpp b/tests/auto/tools/qmake/testdata/resources/main.cpp
index 2d86b46875..78f9814396 100644
--- a/tests/auto/widgets/kernel/qapplication/wincmdline/main.cpp
+++ b/tests/auto/tools/qmake/testdata/resources/main.cpp
@@ -30,17 +30,13 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include <QApplication>
-#include <stdio.h>
-int main(int argc, char *argv[])
+
+
+#include <qguiapplication.h>
+
+int main( int argc, char **argv )
{
- QApplication app(argc, argv);
- if (argc > 1)
- fprintf(stderr, "%s", argv[1]);
- else
- fprintf(stderr, "Failed");
- fflush(stderr);
- return 0;
+ QGuiApplication a( argc, argv );
+ return a.exec();
}
-
diff --git a/tests/auto/tools/qmake/testdata/resources/resources.pro b/tests/auto/tools/qmake/testdata/resources/resources.pro
new file mode 100644
index 0000000000..f024fe5617
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/resources/resources.pro
@@ -0,0 +1,10 @@
+TEMPLATE = app
+SOURCES = main.cpp
+
+pro_file.files = resources.pro
+pro_file.prefix = /prefix
+
+subdir.files = subdir/file.txt
+subdir.base = subdir
+
+RESOURCES = test.qrc main.cpp pro_file subdir
diff --git a/tests/auto/tools/qmake/testdata/resources/subdir/file.txt b/tests/auto/tools/qmake/testdata/resources/subdir/file.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/resources/subdir/file.txt
diff --git a/tests/auto/tools/qmake/testdata/resources/test.qrc b/tests/auto/tools/qmake/testdata/resources/test.qrc
new file mode 100644
index 0000000000..decde3dd24
--- /dev/null
+++ b/tests/auto/tools/qmake/testdata/resources/test.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>test.qrc</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/tools/qmake/tst_qmake.cpp b/tests/auto/tools/qmake/tst_qmake.cpp
index da5314c83b..d216a54575 100644
--- a/tests/auto/tools/qmake/tst_qmake.cpp
+++ b/tests/auto/tools/qmake/tst_qmake.cpp
@@ -39,6 +39,14 @@
#include <QStandardPaths>
#include <QDir>
+#if defined(DEBUG_BUILD)
+# define DIR_INFIX "debug/"
+#elif defined(RELEASE_BUILD)
+# define DIR_INFIX "release/"
+#else
+# define DIR_INFIX ""
+#endif
+
class tst_qmake : public QObject
{
Q_OBJECT
@@ -71,12 +79,14 @@ private slots:
void one_space();
void findMocs();
void findDeps();
+ void rawString();
#if defined(Q_OS_MAC)
void bundle_spaces();
#endif
void substitutes();
void project();
void proFileCache();
+ void resources();
private:
TestCompiler test_compiler;
@@ -397,6 +407,24 @@ void tst_qmake::findDeps()
QVERIFY( test_compiler.removeMakefile(workDir) );
}
+void tst_qmake::rawString()
+{
+#ifdef Q_COMPILER_RAW_STRINGS
+ QString workDir = base_path + "/testdata/rawString";
+
+ QVERIFY( test_compiler.qmake(workDir, "rawString") );
+ QVERIFY( test_compiler.make(workDir) );
+ QVERIFY( test_compiler.exists(workDir, "rawString", Exe, "1.0.0" ) );
+ QVERIFY( test_compiler.makeClean(workDir) );
+ QVERIFY( test_compiler.exists(workDir, "rawString", Exe, "1.0.0" ) );
+ QVERIFY( test_compiler.makeDistClean(workDir ) );
+ QVERIFY( !test_compiler.exists(workDir, "rawString", Exe, "1.0.0" ) );
+ QVERIFY( test_compiler.removeMakefile(workDir) );
+#else
+ QSKIP("Test for C++11 raw strings depends on compiler support for them");
+#endif
+}
+
struct TempFile
: QFile
{
@@ -490,5 +518,38 @@ void tst_qmake::proFileCache()
QVERIFY( test_compiler.qmake( workDir, "pro_file_cache" ));
}
+void tst_qmake::resources()
+{
+ QString workDir = base_path + "/testdata/resources";
+ QVERIFY(test_compiler.qmake(workDir, "resources"));
+
+ {
+ QFile qrcFile(workDir + "/.rcc/" DIR_INFIX "qmake_pro_file.qrc");
+ QVERIFY(qrcFile.exists());
+ QVERIFY(qrcFile.open(QFile::ReadOnly));
+ QByteArray qrcXml = qrcFile.readAll();
+ QVERIFY(qrcXml.contains("alias=\"resources.pro\""));
+ QVERIFY(qrcXml.contains("prefix=\"/prefix\""));
+ }
+
+ {
+ QFile qrcFile(workDir + "/.rcc/" DIR_INFIX "qmake_subdir.qrc");
+ QVERIFY(qrcFile.exists());
+ QVERIFY(qrcFile.open(QFile::ReadOnly));
+ QByteArray qrcXml = qrcFile.readAll();
+ QVERIFY(qrcXml.contains("alias=\"file.txt\""));
+ }
+
+ {
+ QFile qrcFile(workDir + "/.rcc/" DIR_INFIX "qmake_qmake_immediate.qrc");
+ QVERIFY(qrcFile.exists());
+ QVERIFY(qrcFile.open(QFile::ReadOnly));
+ QByteArray qrcXml = qrcFile.readAll();
+ QVERIFY(qrcXml.contains("alias=\"main.cpp\""));
+ }
+
+ QVERIFY(test_compiler.make(workDir));
+}
+
QTEST_MAIN(tst_qmake)
#include "tst_qmake.moc"
diff --git a/tests/auto/tools/qmakelib/evaltest.cpp b/tests/auto/tools/qmakelib/evaltest.cpp
index bed4c792a1..beafef5ad2 100644
--- a/tests/auto/tools/qmakelib/evaltest.cpp
+++ b/tests/auto/tools/qmakelib/evaltest.cpp
@@ -2205,9 +2205,10 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
<< ""
<< true;
+ // FIXME: This also tests that 'exe' is accepted, but does not test whether it actually works.
QTest::newRow("write_file(): append")
<< "VAR = 'one more line'\n"
- "write_file(" + wpath + ", VAR, append): OK = 1\n"
+ "write_file(" + wpath + ", VAR, append exe): OK = 1\n"
"OUT = $$cat(" + wpath + ", lines)"
<< "OK = 1\nOUT = 'other content' 'one more line'"
<< ""
@@ -2227,7 +2228,13 @@ void tst_qmakelib::addTestFunctions(const QString &qindir)
QTest::newRow("write_file(): bad number of arguments")
<< "write_file(1, 2, 3, 4): OK = 1"
<< "OK = UNDEF"
- << "##:1: write_file(name, [content var, [append]]) requires one to three arguments."
+ << "##:1: write_file(name, [content var, [append] [exe]]) requires one to three arguments."
+ << true;
+
+ QTest::newRow("write_file(): invalid flag")
+ << "write_file(file, VAR, fail): OK = 1"
+ << "OK = UNDEF"
+ << "##:1: write_file(): invalid flag fail."
<< true;
// FIXME: This doesn't test whether it actually works.
diff --git a/tests/auto/tools/qmakelib/tst_qmakelib.h b/tests/auto/tools/qmakelib/tst_qmakelib.h
index c4716ca65e..b043d31e21 100644
--- a/tests/auto/tools/qmakelib/tst_qmakelib.h
+++ b/tests/auto/tools/qmakelib/tst_qmakelib.h
@@ -90,8 +90,8 @@ public:
virtual void message(int type, const QString &msg, const QString &fileName, int lineNo)
{ print(fileName, lineNo, type, msg); }
- virtual void fileMessage(const QString &msg)
- { doPrint(msg); }
+ virtual void fileMessage(int type, const QString &msg)
+ { Q_UNUSED(type) doPrint(msg); }
virtual void aboutToEval(ProFile *, ProFile *, EvalFileType) {}
virtual void doneWithEval(ProFile *) {}
diff --git a/tests/auto/tools/uic/tst_uic.cpp b/tests/auto/tools/uic/tst_uic.cpp
index eac80bed7a..42c8e3e7b9 100644
--- a/tests/auto/tools/uic/tst_uic.cpp
+++ b/tests/auto/tools/uic/tst_uic.cpp
@@ -86,6 +86,7 @@ static QByteArray msgProcessStartFailed(const QString &command, const QString &w
void tst_uic::initTestCase()
{
+ QVERIFY2(m_generated.isValid(), qPrintable(m_generated.errorString()));
QVERIFY(m_versionRegexp.isValid());
m_baseline = QFINDTESTDATA("baseline");
QVERIFY2(!m_baseline.isEmpty(), "Could not find 'baseline'.");
diff --git a/tests/auto/widgets/dialogs/qcolordialog/qcolordialog.pro b/tests/auto/widgets/dialogs/qcolordialog/qcolordialog.pro
index 22f6bab497..c379e67ec5 100644
--- a/tests/auto/widgets/dialogs/qcolordialog/qcolordialog.pro
+++ b/tests/auto/widgets/dialogs/qcolordialog/qcolordialog.pro
@@ -4,5 +4,4 @@ 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 59227a6168..c5e31a4bd4 100644
--- a/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp
+++ b/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp
@@ -98,7 +98,7 @@ void tst_QColorDialog::testNativeActiveModalWidget()
TestNativeDialog d;
QTimer::singleShot(1000, &d, SLOT(hide()));
d.exec();
- QVERIFY(&d == d.m_activeModalWidget);
+ QCOMPARE(&d, d.m_activeModalWidget);
}
void tst_QColorDialog::native_activeModalWidget()
diff --git a/tests/auto/widgets/dialogs/qdialog/BLACKLIST b/tests/auto/widgets/dialogs/qdialog/BLACKLIST
new file mode 100644
index 0000000000..3da7337784
--- /dev/null
+++ b/tests/auto/widgets/dialogs/qdialog/BLACKLIST
@@ -0,0 +1,2 @@
+[snapToDefaultButton]
+osx
diff --git a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
index a23938959b..37afa7f0a5 100644
--- a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
+++ b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
@@ -42,6 +42,8 @@
#include <QVBoxLayout>
#include <QSizeGrip>
#include <QDesktopWidget>
+#include <QGraphicsProxyWidget>
+#include <QGraphicsView>
#include <QWindow>
#include <private/qguiapplication_p.h>
#include <qpa/qplatformtheme.h>
@@ -88,6 +90,7 @@ private slots:
void snapToDefaultButton();
void transientParent_data();
void transientParent();
+ void dialogInGraphicsView();
private:
DummyDialog *testWidget;
@@ -119,9 +122,11 @@ void tst_QDialog::getSetCheck()
class ToolDialog : public QDialog
{
public:
- ToolDialog(QWidget *parent = 0) : QDialog(parent, Qt::Tool), mWasActive(false), tId(-1) {
- }
+ ToolDialog(QWidget *parent = 0)
+ : QDialog(parent, Qt::Tool), mWasActive(false), mWasModalWindow(false), tId(-1) {}
+
bool wasActive() const { return mWasActive; }
+ bool wasModalWindow() const { return mWasModalWindow; }
int exec() {
tId = startTimer(300);
@@ -132,12 +137,14 @@ protected:
if (tId == event->timerId()) {
killTimer(tId);
mWasActive = isActiveWindow();
+ mWasModalWindow = QGuiApplication::modalWindow() == windowHandle();
reject();
}
}
private:
int mWasActive;
+ bool mWasModalWindow;
int tId;
};
@@ -558,7 +565,7 @@ void tst_QDialog::snapToDefaultButton()
#ifdef QT_NO_CURSOR
QSKIP("Test relies on there being a cursor");
#else
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: Wayland does not support setting the cursor position.");
QPoint topLeftPos = QApplication::desktop()->availableGeometry().topLeft();
@@ -617,5 +624,27 @@ void tst_QDialog::transientParent()
QCOMPARE(dialog.windowHandle()->transientParent(), topLevel.windowHandle());
}
+void tst_QDialog::dialogInGraphicsView()
+{
+ // QTBUG-49124: A dialog embedded into QGraphicsView has Qt::WA_DontShowOnScreen
+ // set (as has a native dialog). It must not trigger the modal handling though
+ // as not to lock up.
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ view.setWindowTitle(QTest::currentTestFunction());
+ const QRect availableGeometry = QGuiApplication::primaryScreen()->availableGeometry();
+ view.resize(availableGeometry.size() / 2);
+ view.move(availableGeometry.left() + availableGeometry.width() / 4,
+ availableGeometry.top() + availableGeometry.height() / 4);
+ ToolDialog *dialog = new ToolDialog;
+ scene.addWidget(dialog);
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+ for (int i = 0; i < 3; ++i) {
+ dialog->exec();
+ QVERIFY(!dialog->wasModalWindow());
+ }
+}
+
QTEST_MAIN(tst_QDialog)
#include "tst_qdialog.moc"
diff --git a/tests/auto/widgets/dialogs/qfiledialog/qfiledialog.pro b/tests/auto/widgets/dialogs/qfiledialog/qfiledialog.pro
index 3a96827352..2a11a29420 100644
--- a/tests/auto/widgets/dialogs/qfiledialog/qfiledialog.pro
+++ b/tests/auto/widgets/dialogs/qfiledialog/qfiledialog.pro
@@ -21,3 +21,5 @@ wince* {
} else {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
+
+linux*: CONFIG += insignificant_test # Crashes on different Linux distros
diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
index 59288bd764..42e2bd09a5 100644
--- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
@@ -484,11 +484,11 @@ void tst_QFiledialog::completer()
if (startPath.isEmpty()) {
tempDir.reset(new QTemporaryDir);
- QVERIFY(tempDir->isValid());
+ QVERIFY2(tempDir->isValid(), qPrintable(tempDir->errorString()));
startPath = tempDir->path();
for (int i = 0; i < 10; ++i) {
TemporaryFilePtr file(new QTemporaryFile(startPath + QStringLiteral("/rXXXXXX")));
- QVERIFY(file->open());
+ QVERIFY2(file->open(), qPrintable(file->errorString()));
files.append(file);
}
}
@@ -678,7 +678,7 @@ void tst_QFiledialog::filters()
// effects
QList<QComboBox*> views = fd.findChildren<QComboBox*>("fileTypeCombo");
- QVERIFY(views.count() == 1);
+ QCOMPARE(views.count(), 1);
QCOMPARE(views.at(0)->isVisible(), false);
QStringList filters;
@@ -890,7 +890,7 @@ void tst_QFiledialog::selectFile()
QScopedPointer<QTemporaryFile> tempFile;
if (file == QLatin1String("temp")) {
tempFile.reset(new QTemporaryFile(QDir::tempPath() + QStringLiteral("/aXXXXXX")));
- QVERIFY(tempFile->open());
+ QVERIFY2(tempFile->open(), qPrintable(tempFile->errorString()));
file = tempFile->fileName();
}
@@ -928,7 +928,7 @@ void tst_QFiledialog::selectFileWrongCaseSaveAs()
void tst_QFiledialog::selectFiles()
{
QTemporaryDir tempDir;
- QVERIFY(tempDir.isValid());
+ QVERIFY2(tempDir.isValid(), qPrintable(tempDir.errorString()));
const QString tempPath = tempDir.path();
{
QNonNativeFileDialog fd;
@@ -1297,7 +1297,7 @@ void tst_QFiledialog::clearLineEdit()
QLineEdit *lineEdit = fd.findChild<QLineEdit*>("fileNameEdit");
QVERIFY(lineEdit);
- QVERIFY(lineEdit->text() == "foo");
+ QCOMPARE(lineEdit->text(), QLatin1String("foo"));
fd.setDirectory(QDir::home());
QListView* list = fd.findChild<QListView*>("listView");
@@ -1394,12 +1394,12 @@ void tst_QFiledialog::trailingDotsAndSpaces()
QTest::keyClick(lineEdit, Qt::Key_Space);
QTest::keyClick(lineEdit, Qt::Key_Period);
QTest::qWait(1000);
- QVERIFY(currentChildrenCount == list->model()->rowCount(list->rootIndex()));
+ QCOMPARE(currentChildrenCount, list->model()->rowCount(list->rootIndex()));
lineEdit->clear();
QTest::keyClick(lineEdit, Qt::Key_Period);
QTest::keyClick(lineEdit, Qt::Key_Space);
QTest::qWait(1000);
- QVERIFY(currentChildrenCount == list->model()->rowCount(list->rootIndex()));
+ QCOMPARE(currentChildrenCount, list->model()->rowCount(list->rootIndex()));
}
#ifdef Q_OS_UNIX
diff --git a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
index ed34c67aad..b457558879 100644
--- a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
@@ -57,6 +57,8 @@
#include "../../../../../src/widgets/dialogs/qfilesystemmodel_p.h"
#include "../../../../../src/widgets/dialogs/qfiledialog_p.h"
+#include <qpa/qplatformdialoghelper.h>
+
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
#include "../../../network-settings.h"
#endif
@@ -79,6 +81,12 @@ public:
}
};
+static QByteArray msgDoesNotExist(const QString &name)
+{
+ return (QLatin1Char('"') + QDir::toNativeSeparators(name)
+ + QLatin1String("\" does not exist.")).toLocal8Bit();
+}
+
class tst_QFileDialog2 : public QObject
{
Q_OBJECT
@@ -122,6 +130,7 @@ private slots:
#endif
void completionOnLevelAfterRoot();
void task233037_selectingDirectory();
+ void task235069_hideOnEscape_data();
void task235069_hideOnEscape();
void task203703_returnProperSeparator();
void task228844_ensurePreviousSorting();
@@ -134,6 +143,8 @@ private slots:
void QTBUG6558_showDirsOnly();
void QTBUG4842_selectFilterWithHideNameFilterDetails();
void dontShowCompleterOnRoot();
+ void nameFilterParsing_data();
+ void nameFilterParsing();
private:
void cleanupSettingsFile();
@@ -167,7 +178,7 @@ void tst_QFileDialog2::cleanupSettingsFile()
void tst_QFileDialog2::initTestCase()
{
- QVERIFY(tempDir.isValid());
+ QVERIFY2(tempDir.isValid(), qPrintable(tempDir.errorString()));
QStandardPaths::setTestModeEnabled(true);
cleanupSettingsFile();
}
@@ -239,13 +250,13 @@ void tst_QFileDialog2::deleteDirAndFiles()
QTemporaryFile *t;
t = new QTemporaryFile(tempPath + "/foo/aXXXXXX");
t->setAutoRemove(false);
- t->open();
+ QVERIFY2(t->open(), qPrintable(t->errorString()));
t->close();
delete t;
t = new QTemporaryFile(tempPath + "/foo/B/yXXXXXX");
t->setAutoRemove(false);
- t->open();
+ QVERIFY2(t->open(), qPrintable(t->errorString()));
t->close();
delete t;
FriendlyQFileDialog fd;
@@ -303,7 +314,7 @@ void tst_QFileDialog2::unc()
#else
QString dir(QDir::currentPath());
#endif
- QVERIFY(QFile::exists(dir));
+ QVERIFY2(QFile::exists(dir), msgDoesNotExist(dir).constData());
QNonNativeFileDialog fd(0, QString(), dir);
QFileSystemModel *model = fd.findChild<QFileSystemModel*>("qt_filesystem_model");
QVERIFY(model);
@@ -459,7 +470,7 @@ void tst_QFileDialog2::task180459_lastDirectory_data()
void tst_QFileDialog2::task180459_lastDirectory()
{
- if (qApp->platformName().toLower() == QStringLiteral("cocoa"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("cocoa"), Qt::CaseInsensitive))
QSKIP("Insignificant on OSX"); //QTBUG-39183
//first visit the temp directory and close the dialog
QNonNativeFileDialog *dlg = new QNonNativeFileDialog(0, "", tempDir.path());
@@ -760,26 +771,38 @@ void tst_QFileDialog2::task233037_selectingDirectory()
current.rmdir("test");
}
+void tst_QFileDialog2::task235069_hideOnEscape_data()
+{
+ QTest::addColumn<QString>("childName");
+ QTest::addColumn<QFileDialog::ViewMode>("viewMode");
+ QTest::newRow("listView") << QStringLiteral("listView") << QFileDialog::List;
+ QTest::newRow("fileNameEdit") << QStringLiteral("fileNameEdit") << QFileDialog::List;
+ QTest::newRow("treeView") << QStringLiteral("treeView") << QFileDialog::Detail;
+}
+
void tst_QFileDialog2::task235069_hideOnEscape()
{
+ QFETCH(QString, childName);
+ QFETCH(QFileDialog::ViewMode, viewMode);
QDir current = QDir::currentPath();
+
QNonNativeFileDialog fd;
- fd.setViewMode(QFileDialog::List);
+ QSignalSpy spyFinished(&fd, &QDialog::finished);
+ QVERIFY(spyFinished.isValid());
+ QSignalSpy spyRejected(&fd, &QDialog::rejected);
+ QVERIFY(spyRejected.isValid());
+ fd.setViewMode(viewMode);
fd.setDirectory(current.absolutePath());
- fd.setAcceptMode( QFileDialog::AcceptSave);
+ fd.setAcceptMode(QFileDialog::AcceptSave);
fd.show();
- QListView *list = fd.findChild<QListView*>("listView");
- list->setFocus();
+ QWidget *child = fd.findChild<QWidget *>(childName);
+ QVERIFY(child);
+ child->setFocus();
QTest::qWait(200);
- QTest::keyClick(list, Qt::Key_Escape);
+ QTest::keyClick(child, Qt::Key_Escape);
QCOMPARE(fd.isVisible(), false);
- QNonNativeFileDialog fd2;
- fd2.setDirectory(current.absolutePath());
- fd2.setAcceptMode( QFileDialog::AcceptSave);
- fd2.show();
- QLineEdit *edit = fd2.findChild<QLineEdit*>("fileNameEdit");
- QTest::keyClick(edit, Qt::Key_Escape);
- QCOMPARE(fd2.isVisible(), false);
+ QCOMPARE(spyFinished.count(), 1); // QTBUG-7690
+ QCOMPARE(spyRejected.count(), 1); // reject(), don't hide()
}
#ifdef QT_BUILD_INTERNAL
@@ -845,7 +868,7 @@ void tst_QFileDialog2::task228844_ensurePreviousSorting()
current.mkdir("f");
current.mkdir("g");
QTemporaryFile *tempFile = new QTemporaryFile(current.absolutePath() + "/rXXXXXX");
- tempFile->open();
+ QVERIFY2(tempFile->open(), qPrintable(tempFile->errorString()));
current.cdUp();
QNonNativeFileDialog fd;
@@ -1104,6 +1127,7 @@ void tst_QFileDialog2::task254490_selectFileMultipleTimes()
QString tempPath = tempDir.path();
QTemporaryFile *t;
t = new QTemporaryFile;
+ QVERIFY2(t->open(), qPrintable(t->errorString()));
t->open();
QNonNativeFileDialog fd(0, "TestFileDialog");
@@ -1205,7 +1229,7 @@ void tst_QFileDialog2::QTBUG4419_lineEditSelectAll()
{
QString tempPath = tempDir.path();
QTemporaryFile temporaryFile(tempPath + "/tst_qfiledialog2_lineEditSelectAll.XXXXXX");
- QVERIFY(temporaryFile.open());
+ QVERIFY2(temporaryFile.open(), qPrintable(temporaryFile.errorString()));
QNonNativeFileDialog fd(0, "TestFileDialog", temporaryFile.fileName());
fd.setDirectory(tempPath);
@@ -1353,5 +1377,24 @@ void tst_QFileDialog2::dontShowCompleterOnRoot()
QTRY_VERIFY(lineEdit->completer()->popup()->isHidden());
}
+void tst_QFileDialog2::nameFilterParsing_data()
+{
+ QTest::addColumn<QString>("filterString");
+ QTest::addColumn<QStringList>("filters");
+
+ // QTBUG-47923: Do not trip over "*,v".
+ QTest::newRow("text") << "plain text document (*.txt *.asc *,v *.doc)"
+ << (QStringList() << "*.txt" << "*.asc" << "*,v" << "*.doc");
+ QTest::newRow("html") << "HTML document (*.html *.htm)"
+ << (QStringList() << "*.html" << "*.htm");
+}
+
+void tst_QFileDialog2::nameFilterParsing()
+{
+ QFETCH(QString, filterString);
+ QFETCH(QStringList, filters);
+ QCOMPARE(QPlatformFileDialogHelper::cleanFilterList(filterString), filters);
+}
+
QTEST_MAIN(tst_QFileDialog2)
#include "tst_qfiledialog2.moc"
diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
index 03f0d25375..d370a647b4 100644
--- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
+++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
@@ -78,10 +78,6 @@ private slots:
void indexPath();
void rootPath();
-#ifdef QT_BUILD_INTERNAL
- void naturalCompare_data();
- void naturalCompare();
-#endif
void readOnly();
void iconProvider();
@@ -127,6 +123,9 @@ private slots:
void permissions_data();
void permissions();
+ void doNotUnwatchOnFailedRmdir();
+ void specialFiles();
+
protected:
bool createFiles(const QString &test_path, const QStringList &initial_files, int existingFileCount = 0, const QStringList &intial_dirs = QStringList());
@@ -167,13 +166,13 @@ void tst_QFileSystemModel::cleanup()
QVERIFY(dir.rmdir(list.at(i)));
}
list = dir.entryList(QDir::AllEntries | QDir::System | QDir::Hidden | QDir::NoDotAndDotDot);
- QVERIFY(list.count() == 0);
+ QCOMPARE(list.count(), 0);
}
}
void tst_QFileSystemModel::initTestCase()
{
- QVERIFY(m_tempDir.isValid());
+ QVERIFY2(m_tempDir.isValid(), qPrintable(m_tempDir.errorString()));
flatDirTestPath = m_tempDir.path();
}
@@ -242,83 +241,11 @@ void tst_QFileSystemModel::rootPath()
}
}
-#ifdef QT_BUILD_INTERNAL
-void tst_QFileSystemModel::naturalCompare_data()
-{
- QTest::addColumn<QString>("s1");
- QTest::addColumn<QString>("s2");
- QTest::addColumn<int>("caseSensitive");
- QTest::addColumn<int>("result");
- QTest::addColumn<int>("swap");
-
-#define ROWNAME(name) (qPrintable(QString("prefix=%1, postfix=%2, num=%3, i=%4, test=%5").arg(prefix).arg(postfix).arg(num).arg(i).arg(name)))
-
- for (int j = 0; j < 4; ++j) { // <- set a prefix and a postfix string (not numbers)
- QString prefix = (j == 0 || j == 1) ? "b" : "";
- QString postfix = (j == 1 || j == 2) ? "y" : "";
-
- for (int k = 0; k < 3; ++k) { // <- make 0 not a special case
- QString num = QString("%1").arg(k);
- QString nump = QString("%1").arg(k + 1);
- for (int i = 10; i < 12; ++i) { // <- swap s1 and s2 and reverse the result
- QTest::newRow(ROWNAME("basic")) << prefix + "0" + postfix << prefix + "0" + postfix << int(Qt::CaseInsensitive) << 0;
-
- // s1 should always be less then s2
- QTest::newRow(ROWNAME("just text")) << prefix + "fred" + postfix << prefix + "jane" + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("just numbers")) << prefix + num + postfix << prefix + "9" + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("zero")) << prefix + num + postfix << prefix + "0" + nump + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("space b")) << prefix + num + postfix << prefix + " " + nump + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("space a")) << prefix + num + postfix << prefix + nump + " " + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("tab b")) << prefix + num + postfix << prefix + " " + nump + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("tab a")) << prefix + num + postfix << prefix + nump + " " + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("10 vs 2")) << prefix + num + postfix << prefix + "10" + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("diff len")) << prefix + num + postfix << prefix + nump + postfix + "x" << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("01 before 1")) << prefix + "0" + num + postfix << prefix + nump + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("mul nums 2nd 1")) << prefix + "1-" + num + postfix << prefix + "1-" + nump + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("mul nums 2nd 2")) << prefix + "10-" + num + postfix<< prefix + "10-10" + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("mul nums 2nd 3")) << prefix + "10-0"+ num + postfix<< prefix + "10-10" + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("mul nums 2nd 4")) << prefix + "10-" + num + postfix<< prefix + "10-010" + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("mul nums big 1")) << prefix + "10-" + num + postfix<< prefix + "20-0" + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("mul nums big 2")) << prefix + "2-" + num + postfix << prefix + "10-0" + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("mul alphabet 1")) << prefix + num + "-a" + postfix << prefix + num + "-c" + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("mul alphabet 2")) << prefix + num + "-a9" + postfix<< prefix + num + "-c0" + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("mul nums w\\0")) << prefix + num + "-"+ num + postfix<< prefix + num+"-0"+nump + postfix << int(Qt::CaseInsensitive) << i;
- QTest::newRow(ROWNAME("num first")) << prefix + num + postfix << prefix + "a" + postfix << int(Qt::CaseInsensitive) << i;
- }
- }
- }
-#undef ROWNAME
-}
-#endif
-
-#ifdef QT_BUILD_INTERNAL
-void tst_QFileSystemModel::naturalCompare()
-{
- QFETCH(QString, s1);
- QFETCH(QString, s2);
- QFETCH(int, caseSensitive);
- QFETCH(int, result);
-
- if (result == 10)
- QCOMPARE(QFileSystemModelPrivate::naturalCompare(s1, s2, Qt::CaseSensitivity(caseSensitive)), -1);
- else
- if (result == 11)
- QCOMPARE(QFileSystemModelPrivate::naturalCompare(s2, s1, Qt::CaseSensitivity(caseSensitive)), 1);
- else
- QCOMPARE(QFileSystemModelPrivate::naturalCompare(s2, s1, Qt::CaseSensitivity(caseSensitive)), result);
-#if defined(Q_OS_WINCE)
- // On Windows CE we need to wait after each test, otherwise no new threads can be
- // created. The scheduler takes its time to recognize ended threads.
- QTest::qWait(300);
-#endif
-}
-#endif
-
void tst_QFileSystemModel::readOnly()
{
QCOMPARE(model->isReadOnly(), true);
QTemporaryFile file(flatDirTestPath + QStringLiteral("/XXXXXX.dat"));
- file.open();
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QModelIndex root = model->setRootPath(flatDirTestPath);
QTRY_VERIFY(model->rowCount(root) > 0);
@@ -523,8 +450,14 @@ void tst_QFileSystemModel::rowsInserted()
QVERIFY(createFiles(tmp, QStringList(".hidden_file"), 5 + count));
- if (count != 0) QTRY_VERIFY(spy0.count() >= 1); else QTRY_VERIFY(spy0.count() == 0);
- if (count != 0) QTRY_VERIFY(spy1.count() >= 1); else QTRY_VERIFY(spy1.count() == 0);
+ if (count != 0)
+ QTRY_VERIFY(spy0.count() >= 1);
+ else
+ QTRY_COMPARE(spy0.count(), 0);
+ if (count != 0)
+ QTRY_VERIFY(spy1.count() >= 1);
+ else
+ QTRY_COMPARE(spy1.count(), 0);
}
void tst_QFileSystemModel::rowsRemoved_data()
@@ -563,8 +496,8 @@ void tst_QFileSystemModel::rowsRemoved()
}
} else {
if (i == 10 || spy0.count() == 0) {
- QVERIFY(spy0.count() == 0);
- QVERIFY(spy1.count() == 0);
+ QCOMPARE(spy0.count(), 0);
+ QCOMPARE(spy1.count(), 0);
}
}
QStringList lst;
@@ -583,8 +516,8 @@ void tst_QFileSystemModel::rowsRemoved()
QVERIFY(QFile::remove(tmp + '/' + QString(".c")));
QTest::qWait(WAITTIME);
- if (count != 0) QVERIFY(spy0.count() >= 1); else QVERIFY(spy0.count() == 0);
- if (count != 0) QVERIFY(spy1.count() >= 1); else QVERIFY(spy1.count() == 0);
+ if (count != 0) QVERIFY(spy0.count() >= 1); else QCOMPARE(spy0.count(), 0);
+ if (count != 0) QVERIFY(spy1.count() >= 1); else QCOMPARE(spy1.count(), 0);
}
void tst_QFileSystemModel::dataChanged_data()
@@ -614,7 +547,7 @@ void tst_QFileSystemModel::dataChanged()
QTest::qWait(WAITTIME);
- if (count != 0) QVERIFY(spy.count() >= 1); else QVERIFY(spy.count() == 0);
+ if (count != 0) QVERIFY(spy.count() >= 1); else QCOMPARE(spy.count(), 0);
*/
}
@@ -813,7 +746,7 @@ void tst_QFileSystemModel::setData()
void tst_QFileSystemModel::sortPersistentIndex()
{
QTemporaryFile file(flatDirTestPath + QStringLiteral("/XXXXXX.dat"));
- file.open();
+ QVERIFY2(file.open(), qPrintable(file.errorString()));
QModelIndex root = model->setRootPath(flatDirTestPath);
QTRY_VERIFY(model->rowCount(root) > 0);
@@ -890,18 +823,21 @@ void tst_QFileSystemModel::sort()
QModelIndex parent = myModel->index(dirPath, 0);
QList<QString> expectedOrder;
expectedOrder << tempFile2.fileName() << tempFile.fileName() << dirPath + QChar('/') + ".." << dirPath + QChar('/') + ".";
- //File dialog Mode means sub trees are not sorted, only the current root
+
if (fileDialogMode) {
- // FIXME: we were only able to disableRecursiveSort in developer builds, so we can only
- // stably perform this test for developer builds
-#ifdef QT_BUILD_INTERNAL
- QList<QString> actualRows;
+ // File dialog Mode means sub trees are not sorted, only the current root.
+ // There's no way we can check that the sub tree is "not sorted"; just check if it
+ // has the same contents of the expected list
+ QList<QString> actualRows;
for(int i = 0; i < myModel->rowCount(parent); ++i)
{
actualRows << dirPath + QChar('/') + myModel->index(i, 1, parent).data(QFileSystemModel::FileNameRole).toString();
}
- QVERIFY(actualRows != expectedOrder);
-#endif
+
+ std::sort(expectedOrder.begin(), expectedOrder.end());
+ std::sort(actualRows.begin(), actualRows.end());
+
+ QCOMPARE(actualRows, expectedOrder);
} else {
for(int i = 0; i < myModel->rowCount(parent); ++i)
{
@@ -1113,6 +1049,78 @@ void tst_QFileSystemModel::permissions() // checks QTBUG-20503
QCOMPARE(fileInfoPermissions, modelPermissions);
}
+void tst_QFileSystemModel::doNotUnwatchOnFailedRmdir()
+{
+ const QString tmp = flatDirTestPath;
+
+ QFileSystemModel model;
+
+ const QTemporaryDir tempDir(tmp + '/' + QStringLiteral("doNotUnwatchOnFailedRmdir-XXXXXX"));
+ QVERIFY(tempDir.isValid());
+
+ const QModelIndex rootIndex = model.setRootPath(tempDir.path());
+
+ // create a file in the directory so to prevent it from deletion
+ {
+ QFile file(tempDir.path() + '/' + QStringLiteral("file1"));
+ QVERIFY(file.open(QIODevice::WriteOnly));
+ }
+
+ QCOMPARE(model.rmdir(rootIndex), false);
+
+ // create another file
+ {
+ QFile file(tempDir.path() + '/' + QStringLiteral("file2"));
+ QVERIFY(file.open(QIODevice::WriteOnly));
+ }
+
+ // the model must now detect this second file
+ QTRY_COMPARE(model.rowCount(rootIndex), 2);
+}
+
+static QSet<QString> fileListUnderIndex(const QFileSystemModel *model, const QModelIndex &parent)
+{
+ QSet<QString> fileNames;
+ const int rowCount = model->rowCount(parent);
+ for (int i = 0; i < rowCount; ++i)
+ fileNames.insert(model->index(i, 0, parent).data(QFileSystemModel::FileNameRole).toString());
+ return fileNames;
+}
+
+void tst_QFileSystemModel::specialFiles()
+{
+ QFileSystemModel model;
+
+ model.setFilter(QDir::AllEntries | QDir::System | QDir::Hidden);
+
+ // Can't simply verify if the model returns a valid model index for a special file
+ // as it will always return a valid index for existing files,
+ // even if the file is not visible with the given filter.
+
+#if defined(Q_OS_UNIX)
+ const QModelIndex rootIndex = model.setRootPath(QStringLiteral("/dev/"));
+ const QString testFileName = QStringLiteral("null");
+#elif defined(Q_OS_WIN)
+ const QModelIndex rootIndex = model.setRootPath(flatDirTestPath);
+
+ const QString testFileName = QStringLiteral("linkSource.lnk");
+
+ QFile file(flatDirTestPath + QLatin1String("/linkTarget.txt"));
+ QVERIFY(file.open(QIODevice::WriteOnly));
+ file.close();
+ QVERIFY(file.link(flatDirTestPath + '/' + testFileName));
+#else
+ QSKIP("Not implemented");
+ QModelIndex rootIndex;
+ QString testFileName;
+#endif
+
+ QTRY_VERIFY(fileListUnderIndex(&model, rootIndex).contains(testFileName));
+
+ model.setFilter(QDir::AllEntries | QDir::Hidden);
+
+ QTRY_VERIFY(!fileListUnderIndex(&model, rootIndex).contains(testFileName));
+}
QTEST_MAIN(tst_QFileSystemModel)
#include "tst_qfilesystemmodel.moc"
diff --git a/tests/auto/widgets/dialogs/qfontdialog/BLACKLIST b/tests/auto/widgets/dialogs/qfontdialog/BLACKLIST
new file mode 100644
index 0000000000..6d3c17f35f
--- /dev/null
+++ b/tests/auto/widgets/dialogs/qfontdialog/BLACKLIST
@@ -0,0 +1,5 @@
+[task256466_wrongStyle]
+opensuse-13.1
+[setFont]
+ubuntu-14.04
+redhatenterpriselinuxworkstation-6.6
diff --git a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm
index 6e4ad29190..0d29f5b7a2 100644
--- a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm
+++ b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm
@@ -36,7 +36,7 @@
void click_cocoa_button()
{
- QMacCocoaAutoReleasePool pool;
+ QMacAutoReleasePool pool;
NSArray *windows = [NSApp windows];
for (NSWindow *window in windows) {
// This is NOT how one should do RTTI, but since I don't want to leak the class too much...
diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
index cb816a7e85..1a4f9077d9 100644
--- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
+++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
@@ -89,13 +89,6 @@
class tst_QMessageBox : public QObject
{
Q_OBJECT
-public:
- tst_QMessageBox();
- int exec(QMessageBox *msgBox, int key = -1);
- void sendKeySoon();
-
-public slots:
- void sendKey();
private slots:
void sanityTest();
@@ -122,12 +115,7 @@ private slots:
void setInformativeText();
void iconPixmap();
- void init();
- void initTestCase();
-
-private:
- int keyToSend;
- QTimer keySendTimer;
+ void cleanup();
};
class tst_ResizingMessageBox : public QMessageBox
@@ -143,51 +131,61 @@ protected:
}
};
-tst_QMessageBox::tst_QMessageBox() : keyToSend(-1)
+// ExecCloseHelper: Closes a modal QDialog during its exec() function by either
+// sending a key event or closing it (CloseWindow) once it becomes the active
+// modal window. Pass nullptr to "autodetect" the instance for static methods.
+class ExecCloseHelper : public QObject
{
-}
+public:
+ enum { CloseWindow = -1 };
-int tst_QMessageBox::exec(QMessageBox *msgBox, int key)
-{
- if (key == -1) {
- QTimer::singleShot(1000, msgBox, SLOT(close()));
- } else {
- keyToSend = key;
- sendKeySoon();
+ explicit ExecCloseHelper(QObject *parent = Q_NULLPTR)
+ : QObject(parent), m_key(0), m_timerId(0), m_testCandidate(Q_NULLPTR) { }
+
+ void start(int key, QWidget *testCandidate = Q_NULLPTR)
+ {
+ m_key = key;
+ m_testCandidate = testCandidate;
+ m_timerId = startTimer(50);
}
- return msgBox->exec();
-}
-void tst_QMessageBox::sendKey()
+ bool done() const { return !m_timerId; }
+
+protected:
+ void timerEvent(QTimerEvent *te) Q_DECL_OVERRIDE;
+
+private:
+ int m_key;
+ int m_timerId;
+ QWidget *m_testCandidate;
+};
+
+void ExecCloseHelper::timerEvent(QTimerEvent *te)
{
- if (keyToSend == -2) {
- QApplication::activeModalWidget()->close();
- keyToSend = -1;
- return;
- }
- if (keyToSend == -1)
+ if (te->timerId() != m_timerId)
return;
- QKeyEvent *ke = new QKeyEvent(QEvent::KeyPress, keyToSend, Qt::NoModifier);
- qApp->postEvent(QApplication::activeModalWidget(), ke);
- keyToSend = -1;
-}
-void tst_QMessageBox::sendKeySoon()
-{
- keySendTimer.start();
-}
+ QWidget *modalWidget = QApplication::activeModalWidget();
-void tst_QMessageBox::init()
-{
- // if there is any pending key send from the last test, cancel it.
- keySendTimer.stop();
+ if (!m_testCandidate && modalWidget)
+ m_testCandidate = modalWidget;
+
+ if (m_testCandidate && m_testCandidate == modalWidget) {
+ if (m_key == CloseWindow) {
+ m_testCandidate->close();
+ } else {
+ QKeyEvent *ke = new QKeyEvent(QEvent::KeyPress, m_key, Qt::NoModifier);
+ QCoreApplication::postEvent(m_testCandidate, ke);
+ }
+ m_testCandidate = Q_NULLPTR;
+ killTimer(m_timerId);
+ m_timerId = m_key = 0;
+ }
}
-void tst_QMessageBox::initTestCase()
+void tst_QMessageBox::cleanup()
{
- keySendTimer.setInterval(1000);
- keySendTimer.setSingleShot(true);
- QVERIFY(QObject::connect(&keySendTimer, SIGNAL(timeout()), this, SLOT(sendKey())));
+ QTRY_VERIFY(QApplication::topLevelWidgets().isEmpty()); // OS X requires TRY
}
void tst_QMessageBox::sanityTest()
@@ -200,7 +198,9 @@ void tst_QMessageBox::sanityTest()
msgBox.setIconPixmap(QPixmap("whatever.png"));
msgBox.setTextFormat(Qt::RichText);
msgBox.setTextFormat(Qt::PlainText);
- exec(&msgBox);
+ ExecCloseHelper closeHelper;
+ closeHelper.start(ExecCloseHelper::CloseWindow, &msgBox);
+ msgBox.exec();
}
void tst_QMessageBox::button()
@@ -216,7 +216,7 @@ void tst_QMessageBox::button()
// remove the cancel, should not exist anymore
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
- QVERIFY(msgBox.button(QMessageBox::Cancel) == 0);
+ QVERIFY(!msgBox.button(QMessageBox::Cancel));
QVERIFY(msgBox.button(QMessageBox::Yes) != 0);
// should not crash
@@ -228,92 +228,105 @@ void tst_QMessageBox::button()
void tst_QMessageBox::defaultButton()
{
QMessageBox msgBox;
- QVERIFY(msgBox.defaultButton() == 0);
+ QVERIFY(!msgBox.defaultButton());
msgBox.addButton(QMessageBox::Ok);
msgBox.addButton(QMessageBox::Cancel);
- QVERIFY(msgBox.defaultButton() == 0);
+ QVERIFY(!msgBox.defaultButton());
QPushButton pushButton;
msgBox.setDefaultButton(&pushButton);
QVERIFY(msgBox.defaultButton() == 0); // we have not added it yet
QPushButton *retryButton = msgBox.addButton(QMessageBox::Retry);
msgBox.setDefaultButton(retryButton);
QCOMPARE(msgBox.defaultButton(), retryButton);
- exec(&msgBox);
+ ExecCloseHelper closeHelper;
+ closeHelper.start(ExecCloseHelper::CloseWindow, &msgBox);
+ msgBox.exec();
QCOMPARE(msgBox.clickedButton(), msgBox.button(QMessageBox::Cancel));
- exec(&msgBox, Qt::Key_Enter);
+ closeHelper.start(Qt::Key_Enter, &msgBox);
+ msgBox.exec();
QCOMPARE(msgBox.clickedButton(), (QAbstractButton *)retryButton);
QAbstractButton *okButton = msgBox.button(QMessageBox::Ok);
msgBox.setDefaultButton(QMessageBox::Ok);
QCOMPARE(msgBox.defaultButton(), (QPushButton *)okButton);
- exec(&msgBox, Qt::Key_Enter);
+ closeHelper.start(Qt::Key_Enter, &msgBox);
+ msgBox.exec();
QCOMPARE(msgBox.clickedButton(), okButton);
msgBox.setDefaultButton(QMessageBox::Yes); // its not in there!
- QVERIFY(msgBox.defaultButton() == okButton);
+ QCOMPARE(msgBox.defaultButton(), okButton);
msgBox.removeButton(okButton);
delete okButton;
okButton = 0;
- QVERIFY(msgBox.defaultButton() == 0);
+ QVERIFY(!msgBox.defaultButton());
msgBox.setDefaultButton(QMessageBox::Ok);
- QVERIFY(msgBox.defaultButton() == 0);
+ QVERIFY(!msgBox.defaultButton());
}
void tst_QMessageBox::escapeButton()
{
QMessageBox msgBox;
- QVERIFY(msgBox.escapeButton() == 0);
+ QVERIFY(!msgBox.escapeButton());
msgBox.addButton(QMessageBox::Ok);
- exec(&msgBox);
+ ExecCloseHelper closeHelper;
+ closeHelper.start(ExecCloseHelper::CloseWindow, &msgBox);
+ msgBox.exec();
QVERIFY(msgBox.clickedButton() == msgBox.button(QMessageBox::Ok)); // auto detected (one button only)
msgBox.addButton(QMessageBox::Cancel);
- QVERIFY(msgBox.escapeButton() == 0);
+ QVERIFY(!msgBox.escapeButton());
QPushButton invalidButton;
msgBox.setEscapeButton(&invalidButton);
- QVERIFY(msgBox.escapeButton() == 0);
+ QVERIFY(!msgBox.escapeButton());
QAbstractButton *retryButton = msgBox.addButton(QMessageBox::Retry);
- exec(&msgBox);
+ closeHelper.start(ExecCloseHelper::CloseWindow, &msgBox);
+ msgBox.exec();
QVERIFY(msgBox.clickedButton() == msgBox.button(QMessageBox::Cancel)); // auto detected (cancel)
msgBox.setEscapeButton(retryButton);
QCOMPARE(msgBox.escapeButton(), (QAbstractButton *)retryButton);
// with escape
- exec(&msgBox, Qt::Key_Escape);
+ closeHelper.start(Qt::Key_Escape, &msgBox);
+ msgBox.exec();
QCOMPARE(msgBox.clickedButton(), retryButton);
// with close
- exec(&msgBox);
+ closeHelper.start(ExecCloseHelper::CloseWindow, &msgBox);
+ msgBox.exec();
QCOMPARE(msgBox.clickedButton(), (QAbstractButton *)retryButton);
QAbstractButton *okButton = msgBox.button(QMessageBox::Ok);
msgBox.setEscapeButton(QMessageBox::Ok);
QCOMPARE(msgBox.escapeButton(), okButton);
- exec(&msgBox, Qt::Key_Escape);
+ closeHelper.start(Qt::Key_Escape, &msgBox);
+ msgBox.exec();
QCOMPARE(msgBox.clickedButton(), okButton);
msgBox.setEscapeButton(QMessageBox::Yes); // its not in there!
- QVERIFY(msgBox.escapeButton() == okButton);
+ QCOMPARE(msgBox.escapeButton(), okButton);
msgBox.removeButton(okButton);
delete okButton;
okButton = 0;
- QVERIFY(msgBox.escapeButton() == 0);
+ QVERIFY(!msgBox.escapeButton());
msgBox.setEscapeButton(QMessageBox::Ok);
- QVERIFY(msgBox.escapeButton() == 0);
+ QVERIFY(!msgBox.escapeButton());
QMessageBox msgBox2;
msgBox2.addButton(QMessageBox::Yes);
msgBox2.addButton(QMessageBox::No);
- exec(&msgBox2);
+ closeHelper.start(ExecCloseHelper::CloseWindow, &msgBox2);
+ msgBox2.exec();
QVERIFY(msgBox2.clickedButton() == msgBox2.button(QMessageBox::No)); // auto detected (one No button only)
QPushButton *rejectButton = new QPushButton;
msgBox2.addButton(rejectButton, QMessageBox::RejectRole);
- exec(&msgBox2);
+ closeHelper.start(ExecCloseHelper::CloseWindow, &msgBox2);
+ msgBox2.exec();
QVERIFY(msgBox2.clickedButton() == rejectButton); // auto detected (one reject button only)
msgBox2.addButton(new QPushButton, QMessageBox::RejectRole);
- exec(&msgBox2);
+ closeHelper.start(ExecCloseHelper::CloseWindow, &msgBox2);
+ msgBox2.exec();
QVERIFY(msgBox2.clickedButton() == msgBox2.button(QMessageBox::No)); // auto detected (one No button only)
}
@@ -328,38 +341,35 @@ void tst_QMessageBox::statics()
statics[2] = QMessageBox::question;
statics[3] = QMessageBox::warning;
+ ExecCloseHelper closeHelper;
for (int i = 0; i < 4; i++) {
- keyToSend = Qt::Key_Escape;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Escape);
QMessageBox::StandardButton sb = (*statics[i])(0, "caption",
"text", QMessageBox::Yes | QMessageBox::No | QMessageBox::Help | QMessageBox::Cancel,
QMessageBox::NoButton);
QCOMPARE(sb, QMessageBox::Cancel);
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
- keyToSend = -2; // close()
- sendKeySoon();
+ closeHelper.start(ExecCloseHelper::CloseWindow);
sb = (*statics[i])(0, "caption",
"text", QMessageBox::Yes | QMessageBox::No | QMessageBox::Help | QMessageBox::Cancel,
QMessageBox::NoButton);
QCOMPARE(sb, QMessageBox::Cancel);
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
- keyToSend = Qt::Key_Enter;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Enter);
sb = (*statics[i])(0, "caption",
"text", QMessageBox::Yes | QMessageBox::No | QMessageBox::Help,
QMessageBox::Yes);
QCOMPARE(sb, QMessageBox::Yes);
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
- keyToSend = Qt::Key_Enter;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Enter);
sb = (*statics[i])(0, "caption",
"text", QMessageBox::Yes | QMessageBox::No | QMessageBox::Help,
QMessageBox::No);
QCOMPARE(sb, QMessageBox::No);
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
}
}
@@ -371,34 +381,36 @@ void tst_QMessageBox::shortcut()
msgBox.addButton("O&k", QMessageBox::YesRole);
msgBox.addButton("&No", QMessageBox::YesRole);
msgBox.addButton("&Maybe", QMessageBox::YesRole);
- QCOMPARE(exec(&msgBox, Qt::Key_M), 2);
+ ExecCloseHelper closeHelper;
+ closeHelper.start(Qt::Key_M, &msgBox);
+ QCOMPARE(msgBox.exec(), 2);
}
#endif
void tst_QMessageBox::about()
{
- keyToSend = Qt::Key_Escape;
- sendKeySoon();
+ ExecCloseHelper closeHelper;
+ closeHelper.start(Qt::Key_Escape);
QMessageBox::about(0, "Caption", "This is an auto test");
// On Mac, about and aboutQt are not modal, so we need to
// explicitly run the event loop
#ifdef Q_OS_MAC
- QTRY_COMPARE(keyToSend, -1);
+ QTRY_VERIFY(closeHelper.done());
#else
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
#endif
#if !defined(Q_OS_WINCE)
- keyToSend = Qt::Key_Enter;
+ const int keyToSend = Qt::Key_Enter;
#else
- keyToSend = Qt::Key_Escape;
+ const keyToSend = Qt::Key_Escape;
#endif
- sendKeySoon();
+ closeHelper.start(keyToSend);
QMessageBox::aboutQt(0, "Caption");
#ifdef Q_OS_MAC
- QTRY_COMPARE(keyToSend, -1);
+ QTRY_VERIFY(closeHelper.done());
#else
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
#endif
}
@@ -407,8 +419,8 @@ void tst_QMessageBox::staticSourceCompat()
int ret;
// source compat tests for < 4.2
- keyToSend = Qt::Key_Enter;
- sendKeySoon();
+ ExecCloseHelper closeHelper;
+ closeHelper.start(Qt::Key_Enter);
ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes, QMessageBox::No);
int expectedButton = int(QMessageBox::Yes);
if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) {
@@ -418,51 +430,44 @@ void tst_QMessageBox::staticSourceCompat()
expectedButton = int(QMessageBox::No);
}
QCOMPARE(ret, expectedButton);
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
- keyToSend = Qt::Key_Enter;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Enter);
ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No);
QCOMPARE(ret, int(QMessageBox::Yes));
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
- keyToSend = Qt::Key_Enter;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Enter);
ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes, QMessageBox::No | QMessageBox::Default);
QCOMPARE(ret, int(QMessageBox::No));
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
- keyToSend = Qt::Key_Enter;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Enter);
ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape);
QCOMPARE(ret, int(QMessageBox::Yes));
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
- keyToSend = Qt::Key_Enter;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Enter);
ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes | QMessageBox::Escape, QMessageBox::No | QMessageBox::Default);
QCOMPARE(ret, int(QMessageBox::No));
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
// the button text versions
- keyToSend = Qt::Key_Enter;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Enter);
ret = QMessageBox::information(0, "title", "text", "Yes", "No", QString(), 1);
QCOMPARE(ret, 1);
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
if (0) { // don't run these tests since the dialog won't close!
- keyToSend = Qt::Key_Escape;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Escape);
ret = QMessageBox::information(0, "title", "text", "Yes", "No", QString(), 1);
QCOMPARE(ret, -1);
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
- keyToSend = Qt::Key_Escape;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Escape);
ret = QMessageBox::information(0, "title", "text", "Yes", "No", QString(), 0, 1);
QCOMPARE(ret, 1);
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
}
}
@@ -480,12 +485,17 @@ void tst_QMessageBox::instanceSourceCompat()
mb.addButton("&Revert", QMessageBox::RejectRole);
mb.addButton("&Zoo", QMessageBox::ActionRole);
- QCOMPARE(exec(&mb, Qt::Key_Enter), int(QMessageBox::Yes));
- QCOMPARE(exec(&mb, Qt::Key_Escape), int(QMessageBox::Cancel));
+ ExecCloseHelper closeHelper;
+ closeHelper.start(Qt::Key_Enter, &mb);
+ QCOMPARE(mb.exec(), int(QMessageBox::Yes));
+ closeHelper.start(Qt::Key_Escape, &mb);
+ QCOMPARE(mb.exec(), int(QMessageBox::Cancel));
#ifndef Q_OS_MAC
// mnemonics are not used on OS X
- QCOMPARE(exec(&mb, Qt::ALT + Qt::Key_R), 0);
- QCOMPARE(exec(&mb, Qt::ALT + Qt::Key_Z), 1);
+ closeHelper.start(Qt::ALT + Qt::Key_R, &mb);
+ QCOMPARE(mb.exec(), 0);
+ closeHelper.start(Qt::ALT + Qt::Key_Z, &mb);
+ QCOMPARE(mb.exec(), 1);
#endif
}
@@ -527,13 +537,13 @@ void tst_QMessageBox::testSymbols()
QCOMPARE(mb1.text(), text);
icon = mb1.icon();
- QVERIFY(icon == QMessageBox::NoIcon);
+ QCOMPARE(icon, QMessageBox::NoIcon);
mb1.setIcon(QMessageBox::Question);
- QVERIFY(mb1.icon() == QMessageBox::Question);
+ QCOMPARE(mb1.icon(), QMessageBox::Question);
QPixmap iconPixmap = mb1.iconPixmap();
mb1.setIconPixmap(iconPixmap);
- QVERIFY(mb1.icon() == QMessageBox::NoIcon);
+ QCOMPARE(mb1.icon(), QMessageBox::NoIcon);
QCOMPARE(mb1.buttonText(QMessageBox::Ok), QLatin1String("OK"));
QCOMPARE(mb1.buttonText(QMessageBox::Cancel), QString());
@@ -647,26 +657,24 @@ void tst_QMessageBox::expandDetails_QTBUG_32473()
void tst_QMessageBox::incorrectDefaultButton()
{
- keyToSend = Qt::Key_Escape;
- sendKeySoon();
+ ExecCloseHelper closeHelper;
+ closeHelper.start(Qt::Key_Escape);
//Do not crash here
QTest::ignoreMessage(QtWarningMsg, "QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
QMessageBox::question( 0, "", "I've been hit!",QMessageBox::Ok | QMessageBox::Cancel,QMessageBox::Save );
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
- keyToSend = Qt::Key_Escape;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Escape);
QTest::ignoreMessage(QtWarningMsg, "QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
QMessageBox::question( 0, "", "I've been hit!",QFlag(QMessageBox::Ok | QMessageBox::Cancel),QMessageBox::Save );
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
- keyToSend = Qt::Key_Escape;
- sendKeySoon();
+ closeHelper.start(Qt::Key_Escape);
QTest::ignoreMessage(QtWarningMsg, "QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
QTest::ignoreMessage(QtWarningMsg, "QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
//do not crash here -> call old function of QMessageBox in this case
QMessageBox::question( 0, "", "I've been hit!",QMessageBox::Ok | QMessageBox::Cancel,QMessageBox::Save | QMessageBox::Cancel,QMessageBox::Ok);
- QCOMPARE(keyToSend, -1);
+ QVERIFY(closeHelper.done());
}
void tst_QMessageBox::updateSize()
diff --git a/tests/auto/widgets/dialogs/qprogressdialog/BLACKLIST b/tests/auto/widgets/dialogs/qprogressdialog/BLACKLIST
new file mode 100644
index 0000000000..a2670e8f36
--- /dev/null
+++ b/tests/auto/widgets/dialogs/qprogressdialog/BLACKLIST
@@ -0,0 +1,2 @@
+[autoShow:50_to_100_fast_0_compat]
+osx
diff --git a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
index 21c15edff2..b2bdbac79a 100644
--- a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
+++ b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
@@ -400,7 +400,7 @@ void tst_QWizard::setButton()
// revert to default button
wizard.setButton(QWizard::NextButton, 0);
- QVERIFY(toolButton == 0);
+ QVERIFY(toolButton.isNull());
QVERIFY(qobject_cast<QPushButton *>(wizard.button(QWizard::NextButton)));
QVERIFY(wizard.button(QWizard::NextButton)->text().contains("Next"));
}
@@ -408,16 +408,16 @@ void tst_QWizard::setButton()
void tst_QWizard::setTitleFormatEtc()
{
QWizard wizard;
- QVERIFY(wizard.titleFormat() == Qt::AutoText);
- QVERIFY(wizard.subTitleFormat() == Qt::AutoText);
+ QCOMPARE(wizard.titleFormat(), Qt::AutoText);
+ QCOMPARE(wizard.subTitleFormat(), Qt::AutoText);
wizard.setTitleFormat(Qt::RichText);
- QVERIFY(wizard.titleFormat() == Qt::RichText);
- QVERIFY(wizard.subTitleFormat() == Qt::AutoText);
+ QCOMPARE(wizard.titleFormat(), Qt::RichText);
+ QCOMPARE(wizard.subTitleFormat(), Qt::AutoText);
wizard.setSubTitleFormat(Qt::PlainText);
- QVERIFY(wizard.titleFormat() == Qt::RichText);
- QVERIFY(wizard.subTitleFormat() == Qt::PlainText);
+ QCOMPARE(wizard.titleFormat(), Qt::RichText);
+ QCOMPARE(wizard.subTitleFormat(), Qt::PlainText);
}
void tst_QWizard::setPixmap()
@@ -439,7 +439,7 @@ void tst_QWizard::setPixmap()
QVERIFY(wizard.pixmap(QWizard::LogoPixmap).isNull());
QVERIFY(wizard.pixmap(QWizard::WatermarkPixmap).isNull());
#ifdef Q_OS_OSX
- QVERIFY(wizard.pixmap(QWizard::BackgroundPixmap).isNull() == false);
+ QVERIFY(!wizard.pixmap(QWizard::BackgroundPixmap).isNull());
#else
QVERIFY(wizard.pixmap(QWizard::BackgroundPixmap).isNull());
#endif
@@ -448,7 +448,7 @@ void tst_QWizard::setPixmap()
QVERIFY(page->pixmap(QWizard::LogoPixmap).isNull());
QVERIFY(page->pixmap(QWizard::WatermarkPixmap).isNull());
#ifdef Q_OS_OSX
- QVERIFY(wizard.pixmap(QWizard::BackgroundPixmap).isNull() == false);
+ QVERIFY(!wizard.pixmap(QWizard::BackgroundPixmap).isNull());
#else
QVERIFY(page->pixmap(QWizard::BackgroundPixmap).isNull());
#endif
@@ -459,20 +459,20 @@ void tst_QWizard::setPixmap()
page->setPixmap(QWizard::LogoPixmap, p5);
- QVERIFY(wizard.pixmap(QWizard::BannerPixmap).size() == p1.size());
- QVERIFY(wizard.pixmap(QWizard::LogoPixmap).size() == p2.size());
- QVERIFY(wizard.pixmap(QWizard::WatermarkPixmap).size() == p3.size());
- QVERIFY(wizard.pixmap(QWizard::BackgroundPixmap).size() == p4.size());
+ QCOMPARE(wizard.pixmap(QWizard::BannerPixmap).size(), p1.size());
+ QCOMPARE(wizard.pixmap(QWizard::LogoPixmap).size(), p2.size());
+ QCOMPARE(wizard.pixmap(QWizard::WatermarkPixmap).size(), p3.size());
+ QCOMPARE(wizard.pixmap(QWizard::BackgroundPixmap).size(), p4.size());
- QVERIFY(page->pixmap(QWizard::BannerPixmap).size() == p1.size());
- QVERIFY(page->pixmap(QWizard::LogoPixmap).size() == p5.size());
- QVERIFY(page->pixmap(QWizard::WatermarkPixmap).size() == p3.size());
- QVERIFY(page->pixmap(QWizard::BackgroundPixmap).size() == p4.size());
+ QCOMPARE(page->pixmap(QWizard::BannerPixmap).size(), p1.size());
+ QCOMPARE(page->pixmap(QWizard::LogoPixmap).size(), p5.size());
+ QCOMPARE(page->pixmap(QWizard::WatermarkPixmap).size(), p3.size());
+ QCOMPARE(page->pixmap(QWizard::BackgroundPixmap).size(), p4.size());
- QVERIFY(page2->pixmap(QWizard::BannerPixmap).size() == p1.size());
- QVERIFY(page2->pixmap(QWizard::LogoPixmap).size() == p2.size());
- QVERIFY(page2->pixmap(QWizard::WatermarkPixmap).size() == p3.size());
- QVERIFY(page2->pixmap(QWizard::BackgroundPixmap).size() == p4.size());
+ QCOMPARE(page2->pixmap(QWizard::BannerPixmap).size(), p1.size());
+ QCOMPARE(page2->pixmap(QWizard::LogoPixmap).size(), p2.size());
+ QCOMPARE(page2->pixmap(QWizard::WatermarkPixmap).size(), p3.size());
+ QCOMPARE(page2->pixmap(QWizard::BackgroundPixmap).size(), p4.size());
}
class MyPage1 : public QWizardPage
@@ -571,7 +571,7 @@ void tst_QWizard::addPage()
}
for (int i = 0; i < N; ++i) {
- QVERIFY(pages[i] == wizard.page(i));
+ QCOMPARE(pages[i], wizard.page(i));
}
QVERIFY(!wizard.page(-1));
QVERIFY(!wizard.page(N));
@@ -667,7 +667,7 @@ void tst_QWizard::setPage()
QCOMPARE(wizard.page(-2), page);
QCOMPARE(wizard.startId(), -2);
QCOMPARE(wizard.currentId(), -2);
- QVERIFY(wizard.currentPage() == page);
+ QCOMPARE(wizard.currentPage(), page);
QCOMPARE(wizard.nextId(), 0);
CHECK_VISITED(wizard, QList<int>() << -2);
@@ -679,14 +679,14 @@ void tst_QWizard::setPage()
QCOMPARE(wizard.page(2), page);
QCOMPARE(wizard.startId(), -2);
QCOMPARE(wizard.currentId(), -2);
- QVERIFY(wizard.currentPage() == wizard.page(-2));
+ QCOMPARE(wizard.currentPage(), wizard.page(-2));
QCOMPARE(wizard.nextId(), 0);
CHECK_VISITED(wizard, QList<int>() << -2);
wizard.restart();
QCOMPARE(wizard.startId(), -2);
QCOMPARE(wizard.currentId(), -2);
- QVERIFY(wizard.currentPage() == wizard.page(-2));
+ QCOMPARE(wizard.currentPage(), wizard.page(-2));
QCOMPARE(wizard.nextId(), 0);
CHECK_VISITED(wizard, QList<int>() << -2);
@@ -698,28 +698,28 @@ void tst_QWizard::setPage()
QCOMPARE(wizard.page(-3), page);
QCOMPARE(wizard.startId(), -3);
QCOMPARE(wizard.currentId(), -2);
- QVERIFY(wizard.currentPage() == wizard.page(-2));
+ QCOMPARE(wizard.currentPage(), wizard.page(-2));
QCOMPARE(wizard.nextId(), 0);
CHECK_VISITED(wizard, QList<int>() << -2);
wizard.restart();
QCOMPARE(wizard.startId(), -3);
QCOMPARE(wizard.currentId(), -3);
- QVERIFY(wizard.currentPage() == wizard.page(-3));
+ QCOMPARE(wizard.currentPage(), wizard.page(-3));
QCOMPARE(wizard.nextId(), -2);
CHECK_VISITED(wizard, QList<int>() << -3);
wizard.next();
QCOMPARE(wizard.startId(), -3);
QCOMPARE(wizard.currentId(), -2);
- QVERIFY(wizard.currentPage() == wizard.page(-2));
+ QCOMPARE(wizard.currentPage(), wizard.page(-2));
QCOMPARE(wizard.nextId(), 0);
CHECK_VISITED(wizard, QList<int>() << -3 << -2);
wizard.next();
QCOMPARE(wizard.startId(), -3);
QCOMPARE(wizard.currentId(), 0);
- QVERIFY(wizard.currentPage() == wizard.page(0));
+ QCOMPARE(wizard.currentPage(), wizard.page(0));
QCOMPARE(wizard.nextId(), 2);
CHECK_VISITED(wizard, QList<int>() << -3 << -2 << 0);
@@ -727,7 +727,7 @@ void tst_QWizard::setPage()
wizard.next();
QCOMPARE(wizard.startId(), -3);
QCOMPARE(wizard.currentId(), 2);
- QVERIFY(wizard.currentPage() == wizard.page(2));
+ QCOMPARE(wizard.currentPage(), wizard.page(2));
QCOMPARE(wizard.nextId(), -1);
CHECK_VISITED(wizard, QList<int>() << -3 << -2 << 0 << 2);
}
@@ -735,14 +735,14 @@ void tst_QWizard::setPage()
wizard.back();
QCOMPARE(wizard.startId(), -3);
QCOMPARE(wizard.currentId(), 0);
- QVERIFY(wizard.currentPage() == wizard.page(0));
+ QCOMPARE(wizard.currentPage(), wizard.page(0));
QCOMPARE(wizard.nextId(), 2);
CHECK_VISITED(wizard, QList<int>() << -3 << -2 << 0);
wizard.back();
QCOMPARE(wizard.startId(), -3);
QCOMPARE(wizard.currentId(), -2);
- QVERIFY(wizard.currentPage() == wizard.page(-2));
+ QCOMPARE(wizard.currentPage(), wizard.page(-2));
QCOMPARE(wizard.nextId(), 0);
CHECK_VISITED(wizard, QList<int>() << -3 << -2);
@@ -750,7 +750,7 @@ void tst_QWizard::setPage()
wizard.back();
QCOMPARE(wizard.startId(), -3);
QCOMPARE(wizard.currentId(), -3);
- QVERIFY(wizard.currentPage() == wizard.page(-3));
+ QCOMPARE(wizard.currentPage(), wizard.page(-3));
QCOMPARE(wizard.nextId(), -2);
CHECK_VISITED(wizard, QList<int>() << -3);
}
@@ -759,7 +759,7 @@ void tst_QWizard::setPage()
wizard.restart();
QCOMPARE(wizard.startId(), -3);
QCOMPARE(wizard.currentId(), -3);
- QVERIFY(wizard.currentPage() == wizard.page(-3));
+ QCOMPARE(wizard.currentPage(), wizard.page(-3));
QCOMPARE(wizard.nextId(), -2);
CHECK_VISITED(wizard, QList<int>() << -3);
}
@@ -808,31 +808,31 @@ void tst_QWizard::setStartId()
wizard.restart();
QCOMPARE(wizard.startId(), -2);
QCOMPARE(wizard.currentId(), -2);
- QVERIFY(wizard.currentPage() == wizard.page(-2));
+ QCOMPARE(wizard.currentPage(), wizard.page(-2));
QCOMPARE(wizard.nextId(), 0);
wizard.next();
QCOMPARE(wizard.startId(), -2);
QCOMPARE(wizard.currentId(), 0);
- QVERIFY(wizard.currentPage() == wizard.page(0));
+ QCOMPARE(wizard.currentPage(), wizard.page(0));
QCOMPARE(wizard.nextId(), 1);
wizard.setStartId(INT_MIN);
QCOMPARE(wizard.startId(), INT_MIN);
QCOMPARE(wizard.currentId(), 0);
- QVERIFY(wizard.currentPage() == wizard.page(0));
+ QCOMPARE(wizard.currentPage(), wizard.page(0));
QCOMPARE(wizard.nextId(), 1);
wizard.next();
QCOMPARE(wizard.startId(), INT_MIN);
QCOMPARE(wizard.currentId(), 1);
- QVERIFY(wizard.currentPage() == wizard.page(1));
+ QCOMPARE(wizard.currentPage(), wizard.page(1));
QCOMPARE(wizard.nextId(), INT_MAX);
wizard.next();
QCOMPARE(wizard.startId(), INT_MIN);
QCOMPARE(wizard.currentId(), INT_MAX);
- QVERIFY(wizard.currentPage() == wizard.page(INT_MAX));
+ QCOMPARE(wizard.currentPage(), wizard.page(INT_MAX));
QCOMPARE(wizard.nextId(), -1);
CHECK_VISITED(wizard, QList<int>() << -2 << 0 << 1 << INT_MAX);
}
@@ -1143,12 +1143,12 @@ void tst_QWizard::setOption_ExtendedWatermarkPixmap()
}
if (wizard1.wizardStyle() == QWizard::MacStyle) {
- QVERIFY(i1[0] == i1[1]);
- QVERIFY(i2[0] == i2[1]);
- QVERIFY(i1[0] == i2[0]);
+ QCOMPARE(i1[0], i1[1]);
+ QCOMPARE(i2[0], i2[1]);
+ QCOMPARE(i1[0], i2[0]);
} else {
QVERIFY(i1[0] != i1[1]);
- QVERIFY(i2[0] == i2[1]);
+ QCOMPARE(i2[0], i2[1]);
QVERIFY(i1[0] != i2[0]);
QVERIFY(i1[1] != i2[1]);
}
@@ -2425,19 +2425,19 @@ void tst_QWizard::sideWidget()
QWizard wizard;
wizard.setSideWidget(0);
- QVERIFY(wizard.sideWidget() == 0);
+ QVERIFY(!wizard.sideWidget());
QScopedPointer<QWidget> w1(new QWidget(&wizard));
wizard.setSideWidget(w1.data());
QCOMPARE(wizard.sideWidget(), w1.data());
QWidget *w2 = new QWidget(&wizard);
wizard.setSideWidget(w2);
- QVERIFY(wizard.sideWidget() == w2);
+ QCOMPARE(wizard.sideWidget(), w2);
QVERIFY(w1->parent() != 0);
QCOMPARE(w1->window(), static_cast<QWidget *>(&wizard));
QCOMPARE(w2->window(), static_cast<QWidget *>(&wizard));
w1->setParent(0);
wizard.setSideWidget(0);
- QVERIFY(wizard.sideWidget() == 0);
+ QVERIFY(!wizard.sideWidget());
}
void tst_QWizard::objectNames_data()
@@ -2558,7 +2558,7 @@ void tst_QWizard::task183550_stretchFactor()
page2->disableVerticalExpansion();
wizard.next();
QCOMPARE(wizard.currentPage(), static_cast<QWizardPage*>(page2));
- QVERIFY(page2->treeWidgetHeight() == page2->treeWidgetSizeHintHeight());
+ QCOMPARE(page2->treeWidgetHeight(), page2->treeWidgetSizeHintHeight());
wizard.back();
QCOMPARE(wizard.currentPage(), static_cast<QWizardPage*>(page1));
@@ -2576,7 +2576,7 @@ void tst_QWizard::task183550_stretchFactor()
page2->disableVerticalExpansion();
wizard.next();
QCOMPARE(wizard.currentPage(), static_cast<QWizardPage*>(page2));
- QVERIFY(page2->treeWidgetHeight() == page2->treeWidgetSizeHintHeight());
+ QCOMPARE(page2->treeWidgetHeight(), page2->treeWidgetSizeHintHeight());
}
void tst_QWizard::task161658_alignments()
diff --git a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
index 4d7f55f37d..c7d1dd0aa1 100644
--- a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
+++ b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
@@ -520,7 +520,7 @@ public:
void draw(QPainter *painter)
{
- QVERIFY(sourcePixmap(Qt::LogicalCoordinates).handle() == pixmap.handle());
+ QCOMPARE(sourcePixmap(Qt::LogicalCoordinates).handle(), pixmap.handle());
QVERIFY((painter->worldTransform().type() <= QTransform::TxTranslate) == (sourcePixmap(Qt::DeviceCoordinates).handle() == pixmap.handle()));
++repaints;
@@ -595,7 +595,7 @@ void tst_QGraphicsEffect::deviceCoordinateTranslateCaching()
item->translate(10, 0);
- QTRY_VERIFY(item->numRepaints == numRepaints);
+ QTRY_COMPARE(item->numRepaints, numRepaints);
}
void tst_QGraphicsEffect::inheritOpacity()
diff --git a/tests/auto/widgets/gestures/qgesturerecognizer/BLACKLIST b/tests/auto/widgets/gestures/qgesturerecognizer/BLACKLIST
new file mode 100644
index 0000000000..7f55c2dae0
--- /dev/null
+++ b/tests/auto/widgets/gestures/qgesturerecognizer/BLACKLIST
@@ -0,0 +1,2 @@
+[panGesture:Two finger]
+xcb
diff --git a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
index ca01b27bee..f71308cdaf 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
@@ -133,7 +133,6 @@ static bool checkReverseDirection(QGraphicsWidget *widget)
layout->getContentsMargins(&left, &top, &right, &bottom);
widget->setLayoutDirection(Qt::LeftToRight);
QApplication::processEvents();
- const QRectF layoutGeometry = layout->geometry();
QMap<QGraphicsLayoutItem *, QRectF> geometries;
for (int i = 0; i < layout->count(); ++i) {
QGraphicsLayoutItem *item = layout->itemAt(i);
@@ -141,7 +140,7 @@ static bool checkReverseDirection(QGraphicsWidget *widget)
}
widget->setLayoutDirection(Qt::RightToLeft);
QApplication::processEvents();
- layoutGeometry.adjusted(+right, +top, -left, -bottom);
+ const QRectF layoutGeometry = layout->geometry().adjusted(+right, +top, -left, -bottom);
for (int i = 0; i < layout->count(); ++i) {
QGraphicsLayoutItem *item = layout->itemAt(i);
const QRectF rightToLeftGeometry = item->geometry();
@@ -653,7 +652,7 @@ void tst_QGraphicsAnchorLayout::snake()
QCOMPARE(c->geometry(), QRectF(90.0, 200.0, 100.0, 100.0));
QCOMPARE(p.size(), layoutMaximumSize);
- QVERIFY(layoutHasConflict(l) == false);
+ QVERIFY(!layoutHasConflict(l));
// Test QSizePolicy::ExpandFlag, it shouldn't change the extreme
// points of the layout...
@@ -2041,9 +2040,9 @@ void tst_QGraphicsAnchorLayout::graphicsAnchorHandling()
QGraphicsAnchor *invalidAnchor = l->anchor(a, Qt::AnchorTop, l, Qt::AnchorBottom);
// Ensure none of these anchors are accessible.
- QVERIFY(layoutAnchor == 0);
- QVERIFY(itemAnchor == 0);
- QVERIFY(invalidAnchor == 0);
+ QVERIFY(!layoutAnchor);
+ QVERIFY(!itemAnchor);
+ QVERIFY(!invalidAnchor);
// Hook the anchors to a QObject
QObject object;
diff --git a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
index a2108dd494..a58f295575 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
@@ -715,7 +715,7 @@ void tst_QGraphicsAnchorLayout1::testSpecialCases()
widget1->setGeometry(QRectF(0,0,100,100));
QCOMPARE(childWidget->geometry(), QRectF(1,1,98,98));
- QVERIFY(childWidget->parentLayoutItem() == layout1);
+ QCOMPARE(childWidget->parentLayoutItem(), layout1);
QGraphicsWidget *widget2 = new QGraphicsWidget;
TheAnchorLayout *layout2 = new TheAnchorLayout();
widget2->setLayout(layout2);
@@ -739,10 +739,10 @@ void tst_QGraphicsAnchorLayout1::testSpecialCases()
widget2->setGeometry(QRectF(0,0,100,100));
QCOMPARE(childWidget->geometry(), QRectF(1,1,98,98));
- QVERIFY(childWidget->parentLayoutItem() == layout2);
+ QCOMPARE(childWidget->parentLayoutItem(), layout2);
QCOMPARE(widget4->geometry(), QRectF(1,1,98,98));
- QVERIFY(widget4->parentLayoutItem() == layout2);
- QVERIFY(widget4->parentItem() == widget2);
+ QCOMPARE(widget4->parentLayoutItem(), layout2);
+ QCOMPARE(widget4->parentItem(), widget2);
delete widget4;
delete widget3;
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
index 0dd1161dcf..835aeaa4df 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -4274,7 +4274,7 @@ void tst_QGraphicsItem::cursor()
void tst_QGraphicsItem::textControlGetterSetter()
{
QGraphicsTextItem *item = new QGraphicsTextItem;
- QVERIFY(item->textControl()->parent() == item);
+ QCOMPARE(item->textControl()->parent(), item);
QPointer<QWidgetTextControl> control = item->textControl();
delete item;
QVERIFY(!control);
@@ -4285,7 +4285,7 @@ void tst_QGraphicsItem::textControlGetterSetter()
control = new QWidgetTextControl;
item->setTextControl(control);
- QVERIFY(item->textControl() == control);
+ QCOMPARE(item->textControl(), control);
QVERIFY(!control->parent());
QVERIFY(!oldControl);
@@ -5141,19 +5141,19 @@ void tst_QGraphicsItem::paint()
//nominal case, update call paint
tester2.update();
qApp->processEvents();
- QTRY_VERIFY(tester2.painted == 2);
+ QTRY_COMPARE(tester2.painted, 2);
//we remove the item from the scene, number of updates is still the same
tester2.update();
scene2.removeItem(&tester2);
qApp->processEvents();
- QTRY_VERIFY(tester2.painted == 2);
+ QTRY_COMPARE(tester2.painted, 2);
//We re-add the item, the number of paint should increase
scene2.addItem(&tester2);
tester2.update();
qApp->processEvents();
- QTRY_VERIFY(tester2.painted == 3);
+ QTRY_COMPARE(tester2.painted, 3);
}
class HarakiriItem : public QGraphicsRectItem
@@ -5878,7 +5878,7 @@ void tst_QGraphicsItem::itemContainsChildrenInShape()
scene.setItemIndexMethod(QGraphicsScene::NoIndex);
scene.addItem(parent);
- QVERIFY(parent->boundingRectCalls == childOutsideShape->boundingRectCalls);
+ QCOMPARE(parent->boundingRectCalls, childOutsideShape->boundingRectCalls);
int oldParentBoundingRectCalls = parent->boundingRectCalls;
int oldChildBoundingRectCalls = childOutsideShape->boundingRectCalls;
@@ -5886,10 +5886,10 @@ void tst_QGraphicsItem::itemContainsChildrenInShape()
// First test that both items are searched if no optimization flags are set
QGraphicsItem* item = scene.itemAt(25,5);
- QVERIFY(item == childOutsideShape);
+ QCOMPARE(item, childOutsideShape);
QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls);
QVERIFY(childOutsideShape->boundingRectCalls > oldChildBoundingRectCalls);
- QVERIFY(parent->boundingRectCalls == childOutsideShape->boundingRectCalls);
+ QCOMPARE(parent->boundingRectCalls, childOutsideShape->boundingRectCalls);
oldParentBoundingRectCalls = parent->boundingRectCalls;
oldChildBoundingRectCalls = childOutsideShape->boundingRectCalls;
@@ -5897,10 +5897,10 @@ void tst_QGraphicsItem::itemContainsChildrenInShape()
// Repeat the test to make sure that no caching/indexing is in effect
item = scene.itemAt(25,5);
- QVERIFY(item == childOutsideShape);
+ QCOMPARE(item, childOutsideShape);
QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls);
QVERIFY(childOutsideShape->boundingRectCalls > oldChildBoundingRectCalls);
- QVERIFY(parent->boundingRectCalls == childOutsideShape->boundingRectCalls);
+ QCOMPARE(parent->boundingRectCalls, childOutsideShape->boundingRectCalls);
oldParentBoundingRectCalls = parent->boundingRectCalls;
oldChildBoundingRectCalls = childOutsideShape->boundingRectCalls;
@@ -5912,7 +5912,7 @@ void tst_QGraphicsItem::itemContainsChildrenInShape()
QVERIFY(!(item));
QVERIFY(parent->boundingRectCalls > oldParentBoundingRectCalls);
- QVERIFY(childOutsideShape->boundingRectCalls == oldChildBoundingRectCalls);
+ QCOMPARE(childOutsideShape->boundingRectCalls, oldChildBoundingRectCalls);
QVERIFY(parent->boundingRectCalls > childOutsideShape->boundingRectCalls);
}
@@ -11205,21 +11205,21 @@ void tst_QGraphicsItem::QTBUG_6738_missingUpdateWithSetParent()
child2->setVisible(false);
child2->setParentItem(child);
- QTRY_VERIFY(view.repaints == 1);
+ QTRY_COMPARE(view.repaints, 1);
// test case #2
view.reset();
child3->setOpacity(0.0);
child3->setParentItem(child);
- QTRY_VERIFY(view.repaints == 1);
+ QTRY_COMPARE(view.repaints, 1);
// test case #3
view.reset();
child4->setParentItem(child);
child4->setVisible(false);
- QTRY_VERIFY(view.repaints == 1);
+ QTRY_COMPARE(view.repaints, 1);
}
void tst_QGraphicsItem::QT_2653_fullUpdateDiscardingOpacityUpdate()
@@ -11469,9 +11469,9 @@ void tst_QGraphicsItem::itemDiesDuringDraggingOperation()
QGraphicsSceneDragDropEvent event(QEvent::GraphicsSceneDragMove);
event.setScenePos(item->boundingRect().center());
QApplication::sendEvent(&scene, &event);
- QVERIFY(QGraphicsScenePrivate::get(&scene)->dragDropItem == item);
+ QCOMPARE(QGraphicsScenePrivate::get(&scene)->dragDropItem, item);
delete item;
- QVERIFY(QGraphicsScenePrivate::get(&scene)->dragDropItem == 0);
+ QVERIFY(!QGraphicsScenePrivate::get(&scene)->dragDropItem);
}
void tst_QGraphicsItem::QTBUG_12112_focusItem()
diff --git a/tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp b/tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
index bd104539ac..a2740edc54 100644
--- a/tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
@@ -948,7 +948,7 @@ void tst_QGraphicsLayout::ownership()
destructedSet.clear();
window->setLayout(0);
- QVERIFY(destructedSet.count() == 0);
+ QCOMPARE(destructedSet.count(), 0);
delete window;
}
diff --git a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
index 6a8b690560..8bebd4eddd 100644
--- a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
@@ -1230,8 +1230,8 @@ void tst_QGraphicsLinearLayout::testStretch()
layout->addStretch(2);
layout->addItem(w2);
QCOMPARE(layout->count(), 2);
- QVERIFY(layout->itemAt(0) == w1);
- QVERIFY(layout->itemAt(1) == w2);
+ QCOMPARE(layout->itemAt(0), w1);
+ QCOMPARE(layout->itemAt(1), w2);
layout->activate();
//view->setSceneRect(-50, -50, 800, 800);
diff --git a/tests/auto/widgets/graphicsview/qgraphicsobject/tst_qgraphicsobject.cpp b/tests/auto/widgets/graphicsview/qgraphicsobject/tst_qgraphicsobject.cpp
index 84c39bbb98..0f9e8c101e 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsobject/tst_qgraphicsobject.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsobject/tst_qgraphicsobject.cpp
@@ -102,7 +102,7 @@ void tst_QGraphicsObject::pos()
QCOMPARE(xSpy.count(), 1);
QCOMPARE(ySpy.count(), 1);
- QVERIFY(object.pos() == QPointF(10,10));
+ QCOMPARE(object.pos(), QPointF(10,10));
object.setPos(10, 10);
QCOMPARE(xSpy.count(), 1);
@@ -111,12 +111,12 @@ void tst_QGraphicsObject::pos()
object.setProperty("pos", QPointF(0, 0));
QCOMPARE(xSpy.count(), 2);
QCOMPARE(ySpy.count(), 2);
- QVERIFY(object.property("pos") == QPointF(0,0));
+ QCOMPARE(object.property("pos").toPointF(), QPointF(0,0));
object.setProperty("pos", QPointF(10, 0));
QCOMPARE(xSpy.count(), 3);
QCOMPARE(ySpy.count(), 2);
- QVERIFY(object.property("pos") == QPointF(10,0));
+ QCOMPARE(object.property("pos").toPointF(), QPointF(10,0));
object.setProperty("pos", QPointF(10, 10));
QCOMPARE(xSpy.count(), 3);
@@ -135,7 +135,7 @@ void tst_QGraphicsObject::x()
QCOMPARE(ySpy.count(), 0);
QVERIFY(object.pos() == QPointF(10, 0));
- QVERIFY(object.x() == 10);
+ QCOMPARE(object.x(), qreal(10));
object.setX(10);
QCOMPARE(xSpy.count(), 1);
@@ -144,7 +144,7 @@ void tst_QGraphicsObject::x()
object.setProperty("x", 0);
QCOMPARE(xSpy.count(), 2);
QCOMPARE(ySpy.count(), 0);
- QVERIFY(object.property("x") == 0);
+ QCOMPARE(object.property("x").toDouble(), double(0));
}
void tst_QGraphicsObject::y()
@@ -158,7 +158,7 @@ void tst_QGraphicsObject::y()
QCOMPARE(ySpy.count(), 1);
QVERIFY(object.pos() == QPointF(0, 10));
- QVERIFY(object.y() == 10);
+ QCOMPARE(object.y(), qreal(10));
object.setY(10);
QCOMPARE(xSpy.count(), 0);
@@ -167,79 +167,79 @@ void tst_QGraphicsObject::y()
object.setProperty("y", 0);
QCOMPARE(xSpy.count(), 0);
QCOMPARE(ySpy.count(), 2);
- QVERIFY(object.property("y") == 0);
+ QCOMPARE(object.property("y").toDouble(), qreal(0));
}
void tst_QGraphicsObject::z()
{
MyGraphicsObject object;
QSignalSpy zSpy(&object, SIGNAL(zChanged()));
- QVERIFY(object.zValue() == 0);
+ QCOMPARE(object.zValue(), qreal(0));
object.setZValue(10);
QCOMPARE(zSpy.count(), 1);
- QVERIFY(object.zValue() == 10);
+ QCOMPARE(object.zValue(), qreal(10));
object.setZValue(10);
QCOMPARE(zSpy.count(), 1);
object.setProperty("z", 0);
QCOMPARE(zSpy.count(), 2);
- QVERIFY(object.property("z") == 0);
+ QCOMPARE(object.property("z").toDouble(), double(0));
}
void tst_QGraphicsObject::opacity()
{
MyGraphicsObject object;
QSignalSpy spy(&object, SIGNAL(opacityChanged()));
- QVERIFY(object.opacity() == 1.);
+ QCOMPARE(object.opacity(), 1.);
object.setOpacity(0);
QCOMPARE(spy.count(), 1);
- QVERIFY(object.opacity() == 0.);
+ QCOMPARE(object.opacity(), 0.);
object.setOpacity(0);
QCOMPARE(spy.count(), 1);
object.setProperty("opacity", .5);
QCOMPARE(spy.count(), 2);
- QVERIFY(object.property("opacity") == .5);
+ QCOMPARE(object.property("opacity").toDouble(), .5);
}
void tst_QGraphicsObject::enabled()
{
MyGraphicsObject object;
QSignalSpy spy(&object, SIGNAL(enabledChanged()));
- QVERIFY(object.isEnabled() == true);
+ QVERIFY(object.isEnabled());
object.setEnabled(false);
QCOMPARE(spy.count(), 1);
- QVERIFY(object.isEnabled() == false);
+ QVERIFY(!object.isEnabled());
object.setEnabled(false);
QCOMPARE(spy.count(), 1);
object.setProperty("enabled", true);
QCOMPARE(spy.count(), 2);
- QVERIFY(object.property("enabled") == true);
+ QVERIFY(object.property("enabled").toBool());
}
void tst_QGraphicsObject::visible()
{
MyGraphicsObject object;
QSignalSpy spy(&object, SIGNAL(visibleChanged()));
- QVERIFY(object.isVisible() == true);
+ QVERIFY(object.isVisible());
object.setVisible(false);
QCOMPARE(spy.count(), 1);
- QVERIFY(object.isVisible() == false);
+ QVERIFY(!object.isVisible());
object.setVisible(false);
QCOMPARE(spy.count(), 1);
object.setProperty("visible", true);
QCOMPARE(spy.count(), 2);
- QVERIFY(object.property("visible") == true);
+ QVERIFY(object.property("visible").toBool());
}
class DeleteTester : public QGraphicsObject
diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index f3a683fe8b..d8a8ed6b4b 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -97,8 +97,8 @@ private slots:
void paint_2();
void setWidget_data();
void setWidget();
- void eventFilter_data();
- void eventFilter();
+ void testEventFilter_data();
+ void testEventFilter();
void focusInEvent_data();
void focusInEvent();
void focusInEventNoWidget();
@@ -179,6 +179,7 @@ private slots:
void mapToGlobal();
void mapToGlobalWithoutScene();
void QTBUG_43780_visibility();
+ void forwardTouchEvent();
};
// Subclass that exposes the protected functions.
@@ -314,7 +315,7 @@ void tst_QGraphicsProxyWidget::qgraphicsproxywidget()
SubQGraphicsProxyWidget proxy;
proxy.paint(0, 0, 0);
proxy.setWidget(0);
- QVERIFY(proxy.type() == QGraphicsProxyWidget::Type);
+ QCOMPARE(proxy.type(), int(QGraphicsProxyWidget::Type));
QVERIFY(!proxy.widget());
QEvent event(QEvent::None);
proxy.call_eventFilter(0, &event);
@@ -533,7 +534,7 @@ void tst_QGraphicsProxyWidget::setWidget()
}
Q_DECLARE_METATYPE(QEvent::Type)
-void tst_QGraphicsProxyWidget::eventFilter_data()
+void tst_QGraphicsProxyWidget::testEventFilter_data()
{
QTest::addColumn<QEvent::Type>("eventType");
QTest::addColumn<bool>("fromObject"); // big grin evil
@@ -552,7 +553,7 @@ void tst_QGraphicsProxyWidget::eventFilter_data()
}
// protected bool eventFilter(QObject* object, QEvent* event)
-void tst_QGraphicsProxyWidget::eventFilter()
+void tst_QGraphicsProxyWidget::testEventFilter()
{
QFETCH(QEvent::Type, eventType);
QFETCH(bool, fromObject);
@@ -1223,6 +1224,7 @@ void tst_QGraphicsProxyWidget::mousePressReleaseEvent()
QGraphicsScene scene;
QGraphicsView view(&scene);
+ view.resize(500, 500);
view.show();
QVERIFY(QTest::qWaitForWindowExposed(&view));
@@ -1231,7 +1233,6 @@ void tst_QGraphicsProxyWidget::mousePressReleaseEvent()
QPushButton *widget = new QPushButton;
QSignalSpy spy(widget, SIGNAL(clicked()));
widget->resize(50, 50);
- view.resize(100, 100);
if (hasWidget) {
proxy->setWidget(widget);
proxy->show();
@@ -3017,36 +3018,36 @@ void tst_QGraphicsProxyWidget::createProxyForChildWidget()
layout->addWidget(rightDial);
window.setLayout(layout);
- QVERIFY(window.graphicsProxyWidget() == 0);
- QVERIFY(checkbox->graphicsProxyWidget() == 0);
+ QVERIFY(!window.graphicsProxyWidget());
+ QVERIFY(!checkbox->graphicsProxyWidget());
QGraphicsProxyWidget *windowProxy = scene.addWidget(&window);
QGraphicsView view(&scene);
view.show();
view.resize(500,500);
- QVERIFY(window.graphicsProxyWidget() == windowProxy);
- QVERIFY(box->graphicsProxyWidget() == 0);
- QVERIFY(checkbox->graphicsProxyWidget() == 0);
+ QCOMPARE(window.graphicsProxyWidget(), windowProxy);
+ QVERIFY(!box->graphicsProxyWidget());
+ QVERIFY(!checkbox->graphicsProxyWidget());
QPointer<QGraphicsProxyWidget> checkboxProxy = windowProxy->createProxyForChildWidget(checkbox);
QGraphicsProxyWidget *boxProxy = box->graphicsProxyWidget();
QVERIFY(boxProxy);
- QVERIFY(checkbox->graphicsProxyWidget() == checkboxProxy);
- QVERIFY(checkboxProxy->parentItem() == boxProxy);
- QVERIFY(boxProxy->parentItem() == windowProxy);
+ QCOMPARE(checkbox->graphicsProxyWidget(), checkboxProxy.data());
+ QCOMPARE(checkboxProxy->parentItem(), boxProxy);
+ QCOMPARE(boxProxy->parentItem(), windowProxy);
QVERIFY(checkboxProxy->mapToScene(QPointF()) == checkbox->mapTo(&window, QPoint()));
- QVERIFY(checkboxProxy->size() == checkbox->size());
- QVERIFY(boxProxy->size() == box->size());
+ QCOMPARE(checkboxProxy->size().toSize(), checkbox->size());
+ QCOMPARE(boxProxy->size().toSize(), box->size());
window.resize(500,500);
- QVERIFY(windowProxy->size() == QSize(500,500));
+ QCOMPARE(windowProxy->size().toSize(), QSize(500,500));
QVERIFY(checkboxProxy->mapToScene(QPointF()) == checkbox->mapTo(&window, QPoint()));
- QVERIFY(checkboxProxy->size() == checkbox->size());
- QVERIFY(boxProxy->size() == box->size());
+ QCOMPARE(checkboxProxy->size().toSize(), checkbox->size());
+ QCOMPARE(boxProxy->size().toSize(), box->size());
QTest::qWait(10);
@@ -3064,9 +3065,9 @@ void tst_QGraphicsProxyWidget::createProxyForChildWidget()
boxProxy->setWidget(0);
- QVERIFY(checkbox->graphicsProxyWidget() == 0);
- QVERIFY(box->graphicsProxyWidget() == 0);
- QVERIFY(checkboxProxy == 0);
+ QVERIFY(!checkbox->graphicsProxyWidget());
+ QVERIFY(!box->graphicsProxyWidget());
+ QVERIFY(checkboxProxy.isNull());
delete boxProxy;
}
@@ -3766,5 +3767,73 @@ void tst_QGraphicsProxyWidget::QTBUG_43780_visibility()
QVERIFY(comboPopup->isVisible());
}
+class TouchWidget : public QWidget
+{
+public:
+ TouchWidget(QWidget *parent = 0) : QWidget(parent) {}
+
+ bool event(QEvent *event)
+ {
+ switch (event->type()) {
+ case QEvent::TouchBegin:
+ case QEvent::TouchUpdate:
+ case QEvent::TouchEnd:
+ event->accept();
+ return true;
+ break;
+ default:
+ break;
+ }
+
+ return QWidget::event(event);
+ }
+};
+
+// QTBUG_45737
+void tst_QGraphicsProxyWidget::forwardTouchEvent()
+{
+ QGraphicsScene *scene = new QGraphicsScene;
+
+ TouchWidget *widget = new TouchWidget;
+
+ widget->setAttribute(Qt::WA_AcceptTouchEvents);
+
+ QGraphicsProxyWidget *proxy = new QGraphicsProxyWidget;
+
+ proxy->setAcceptTouchEvents(true);
+ proxy->setWidget(widget);
+
+ scene->addItem(proxy);
+
+ QGraphicsView *view = new QGraphicsView(scene);
+
+ view->show();
+
+ EventSpy eventSpy(widget);
+
+ QTouchDevice *device = new QTouchDevice;
+ device->setType(QTouchDevice::TouchScreen);
+ QWindowSystemInterface::registerTouchDevice(device);
+
+ QCOMPARE(eventSpy.counts[QEvent::TouchBegin], 0);
+ QCOMPARE(eventSpy.counts[QEvent::TouchUpdate], 0);
+ QCOMPARE(eventSpy.counts[QEvent::TouchEnd], 0);
+
+ QTest::touchEvent(view, device).press(0, QPoint(10, 10), view);
+ QTest::touchEvent(view, device).move(0, QPoint(15, 15), view);
+ QTest::touchEvent(view, device).move(0, QPoint(16, 16), view);
+ QTest::touchEvent(view, device).release(0, QPoint(15, 15), view);
+
+ QApplication::processEvents();
+
+ QCOMPARE(eventSpy.counts[QEvent::TouchBegin], 1);
+ QCOMPARE(eventSpy.counts[QEvent::TouchUpdate], 2);
+ QCOMPARE(eventSpy.counts[QEvent::TouchEnd], 1);
+
+ delete view;
+ delete proxy;
+ delete scene;
+}
+
QTEST_MAIN(tst_QGraphicsProxyWidget)
#include "tst_qgraphicsproxywidget.moc"
diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
index 7bd0393760..ae71b0412f 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -1282,33 +1282,16 @@ void tst_QGraphicsScene::removeItem()
view.show();
QApplication::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
- QTest::mouseMove(view.viewport(), QPoint(-1, -1));
- {
- QMouseEvent moveEvent(QEvent::MouseMove, view.mapFromScene(hoverItem->scenePos() + QPointF(20, 20)), Qt::NoButton, 0, 0);
- QApplication::sendEvent(view.viewport(), &moveEvent);
- }
- qApp->processEvents(); // update
- qApp->processEvents(); // draw
- QVERIFY(!hoverItem->isHovered);
+ QTest::mouseMove(view.viewport(), view.mapFromScene(hoverItem->scenePos() + QPointF(20, 20)), Qt::NoButton);
+ QTRY_VERIFY(!hoverItem->isHovered);
- {
- QTest::qWait(250);
- QTest::mouseMove(view.viewport(), view.mapFromScene(hoverItem->scenePos()), Qt::NoButton);
- QTest::qWait(10);
- QMouseEvent moveEvent(QEvent::MouseMove, view.mapFromScene(hoverItem->scenePos()), Qt::NoButton, 0, 0);
- QApplication::sendEvent(view.viewport(), &moveEvent);
- }
- qApp->processEvents(); // update
- qApp->processEvents(); // draw
- QVERIFY(hoverItem->isHovered);
+ QTest::mouseMove(view.viewport(), view.mapFromScene(hoverItem->scenePos()), Qt::NoButton);
+ QTRY_VERIFY(hoverItem->isHovered);
scene.removeItem(hoverItem);
hoverItem->setAcceptsHoverEvents(false);
scene.addItem(hoverItem);
- qApp->processEvents(); // <- delayed update is called
- qApp->processEvents(); // <- scene schedules pending update
- qApp->processEvents(); // <- pending update is sent to view
- QVERIFY(!hoverItem->isHovered);
+ QTRY_VERIFY(!hoverItem->isHovered);
}
void tst_QGraphicsScene::focusItem()
@@ -3509,6 +3492,8 @@ void tst_QGraphicsScene::task160653_selectionChanged()
QSignalSpy spy(&scene, SIGNAL(selectionChanged()));
QGraphicsView view(&scene);
+ view.show();
+ QVERIFY(QTest::qWaitForWindowActive(&view));
QTest::mouseClick(
view.viewport(), Qt::LeftButton, 0, view.mapFromScene(scene.items().first()->scenePos()));
QCOMPARE(spy.count(), 1);
@@ -4742,9 +4727,9 @@ void tst_QGraphicsScene::minimumRenderSize()
QTRY_VERIFY(view.repaints > viewRepaints);
viewRepaints = view.repaints;
- QVERIFY(viewRepaints == bigParent->repaints);
- QVERIFY(viewRepaints == smallChild->repaints);
- QVERIFY(viewRepaints == smallerGrandChild->repaints);
+ QCOMPARE(viewRepaints, bigParent->repaints);
+ QCOMPARE(viewRepaints, smallChild->repaints);
+ QCOMPARE(viewRepaints, smallerGrandChild->repaints);
// Setting a minimum render size should cause a repaint
scene.setMinimumRenderSize(0.5);
@@ -4753,9 +4738,9 @@ void tst_QGraphicsScene::minimumRenderSize()
QTRY_VERIFY(view.repaints > viewRepaints);
viewRepaints = view.repaints;
- QVERIFY(viewRepaints == bigParent->repaints);
- QVERIFY(viewRepaints == smallChild->repaints);
- QVERIFY(viewRepaints == smallerGrandChild->repaints);
+ QCOMPARE(viewRepaints, bigParent->repaints);
+ QCOMPARE(viewRepaints, smallChild->repaints);
+ QCOMPARE(viewRepaints, smallerGrandChild->repaints);
// Scaling should cause a repaint of big items only.
view.scale(0.1, 0.1);
@@ -4764,8 +4749,8 @@ void tst_QGraphicsScene::minimumRenderSize()
QTRY_VERIFY(view.repaints > viewRepaints);
viewRepaints = view.repaints;
- QVERIFY(viewRepaints == bigParent->repaints);
- QVERIFY(viewRepaints == smallChild->repaints);
+ QCOMPARE(viewRepaints, bigParent->repaints);
+ QCOMPARE(viewRepaints, smallChild->repaints);
QVERIFY(smallChild->repaints > smallerGrandChild->repaints);
// Scaling further should cause even fewer items to be repainted
@@ -4775,7 +4760,7 @@ void tst_QGraphicsScene::minimumRenderSize()
QTRY_VERIFY(view.repaints > viewRepaints);
viewRepaints = view.repaints;
- QVERIFY(viewRepaints == bigParent->repaints);
+ QCOMPARE(viewRepaints, bigParent->repaints);
QVERIFY(bigParent->repaints > smallChild->repaints);
QVERIFY(smallChild->repaints > smallerGrandChild->repaints);
}
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST b/tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST
index be7a7e398b..3cba8bad7e 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/BLACKLIST
@@ -1,4 +1,18 @@
[task255529_transformationAnchorMouseAndViewportMargins]
-ubuntu-14.04
+xcb
[cursor]
-ubuntu-14.04
+xcb
+[cursor2]
+xcb
+[rubberBandExtendSelection]
+xcb
+[rotated_rubberBand]
+xcb
+[sendEvent]
+xcb
+[forwardMousePress]
+xcb
+[hoverLeave]
+xcb
+[resizeAnchor]
+xcb
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index d1d4c1ab86..98473fb5cc 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -145,7 +145,7 @@ class tst_QGraphicsView : public QObject
public:
tst_QGraphicsView()
- : platformName(qApp->platformName().toLower())
+ : platformName(QGuiApplication::platformName().toLower())
{ }
private slots:
void initTestCase();
@@ -255,7 +255,6 @@ private slots:
void task186827_deleteReplayedItem();
void task207546_focusCrash();
void task210599_unsetDragWhileDragging();
- void task236394_sendShortcutOverrideEvent();
void task239729_noViewUpdate_data();
void task239729_noViewUpdate();
void task239047_fitInViewSmallViewport();
@@ -3369,14 +3368,6 @@ void tst_QGraphicsView::task210599_unsetDragWhileDragging()
QCOMPARE(basePos, view.mapFromScene(0, 0));
}
-void tst_QGraphicsView::task236394_sendShortcutOverrideEvent()
-{
- QGraphicsView view;
- view.show();
- QKeyEvent event(QEvent::ShortcutOverride, Qt::Key_A, 0, QString("A"));
- QApplication::sendEvent(&view, &event);
-}
-
class ChangedListener : public QObject
{
Q_OBJECT
@@ -3525,7 +3516,7 @@ void tst_QGraphicsView::embeddedViews()
v2->QWidget::render(&actual);
QTransform b = item->transform;
- QVERIFY(a == b);
+ QCOMPARE(a, b);
delete v1;
}
diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
index 9b92c34fb5..ec2203e615 100644
--- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -182,14 +182,6 @@ private slots:
void QTBUG_45867_send_itemChildAddedChange_to_parent();
};
-
-static void sendMouseMove(QWidget *widget, const QPoint &point, Qt::MouseButton button = Qt::NoButton, Qt::MouseButtons buttons = 0)
-{
- QTest::mouseMove(widget, point);
- QMouseEvent event(QEvent::MouseMove, point, button, buttons, 0);
- QApplication::sendEvent(widget, &event);
-}
-
// Subclass that exposes the protected functions.
class SubQGraphicsWidget : public QGraphicsWidget {
public:
@@ -197,7 +189,7 @@ public:
: QGraphicsWidget(parent, windowFlags), eventCount(0)
{ }
- void initStyleOption(QStyleOption *option)
+ void initStyleOption(QStyleOption *option) const
{ QGraphicsWidget::initStyleOption(option); }
void call_changeEvent(QEvent* event)
@@ -1110,8 +1102,8 @@ void tst_QGraphicsWidget::initStyleOption()
{
QGraphicsScene scene;
QGraphicsView view(&scene);
+ view.resize(300, 300);
view.show();
- QApplication::setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowActive(&view));
view.setAlignment(Qt::AlignTop | Qt::AlignLeft);
@@ -1133,10 +1125,8 @@ void tst_QGraphicsWidget::initStyleOption()
}
QFETCH(bool, underMouse);
if (underMouse) {
- view.resize(300, 300);
- view.show();
- QVERIFY(QTest::qWaitForWindowActive(&view));
- sendMouseMove(view.viewport(), view.mapFromScene(widget->mapToScene(widget->boundingRect().center())));
+ QCursor::setPos(view.viewport()->mapToGlobal(view.mapFromScene(widget->mapToScene(widget->boundingRect().center()))));
+ QTest::qWait(100);
}
QFETCH(QPalette, palette);
diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
index eed38752d9..3a17f7c690 100644
--- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
+++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
@@ -250,6 +250,7 @@ private slots:
void QTBUG39324_settingSameInstanceOfIndexWidget();
void sizeHintChangeTriggersLayout();
void shiftSelectionAfterChangingModelContents();
+ void QTBUG48968_reentrant_updateEditorGeometries();
};
class MyAbstractItemDelegate : public QAbstractItemDelegate
@@ -1036,7 +1037,7 @@ void tst_QAbstractItemView::dragAndDropOnChild()
++successes;
}
- QVERIFY(successes == 0);
+ QCOMPARE(successes, 0);
}
#endif // 0
@@ -1214,7 +1215,7 @@ void tst_QAbstractItemView::setCurrentIndex()
view->setModel(model);
view->setCurrentIndex(model->index(0,0));
- QVERIFY(view->currentIndex() == model->index(0,0));
+ QCOMPARE(view->currentIndex(), model->index(0,0));
view->setCurrentIndex(model->index(1,0));
QVERIFY(view->currentIndex() == model->index(result ? 1 : 0,0));
}
@@ -1990,5 +1991,42 @@ void tst_QAbstractItemView::shiftSelectionAfterChangingModelContents()
QVERIFY(selected.contains(indexE));
}
+void tst_QAbstractItemView::QTBUG48968_reentrant_updateEditorGeometries()
+{
+
+ QStandardItemModel *m = new QStandardItemModel(this);
+ for (int i=0; i<10; ++i) {
+ QStandardItem *item = new QStandardItem(QString("Item number %1").arg(i));
+ item->setEditable(true);
+ for (int j=0; j<5; ++j) {
+ QStandardItem *child = new QStandardItem(QString("Child Item number %1").arg(j));
+ item->setChild(j, 0, child);
+ }
+ m->setItem(i, 0, item);
+ }
+
+ QTreeView tree;
+ tree.setModel(m);
+ tree.setRootIsDecorated(false);
+ QObject::connect(&tree, SIGNAL(doubleClicked(QModelIndex)), &tree, SLOT(setRootIndex(QModelIndex)));
+ tree.show();
+ QTest::qWaitForWindowActive(&tree);
+
+ // Trigger editing idx
+ QModelIndex idx = m->index(1, 0);
+ const QPoint pos = tree.visualRect(idx).center();
+ QTest::mouseClick(tree.viewport(), Qt::LeftButton, Qt::NoModifier, pos);
+ QTest::mouseDClick(tree.viewport(), Qt::LeftButton, Qt::NoModifier, pos);
+
+ // Add more children to idx
+ QStandardItem *item = m->itemFromIndex(idx);
+ for (int j=5; j<10; ++j) {
+ QStandardItem *child = new QStandardItem(QString("Child Item number %1").arg(j));
+ item->setChild(j, 0, child);
+ }
+
+ // No crash, all fine.
+}
+
QTEST_MAIN(tst_QAbstractItemView)
#include "tst_qabstractitemview.moc"
diff --git a/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp b/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp
index f5e6facaad..6645da727c 100644
--- a/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp
+++ b/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp
@@ -292,7 +292,7 @@ void tst_QColumnView::grips()
for (int i = 0 ; i < list.count(); ++i) {
if (QAbstractItemView *view = qobject_cast<QAbstractItemView*>(list.at(i))) {
if (view->isVisible())
- QVERIFY(view->cornerWidget() == 0);
+ QVERIFY(!view->cornerWidget());
}
}
}
@@ -587,7 +587,7 @@ void tst_QColumnView::selectAll()
QVERIFY(view.selectionModel()->selectedIndexes().count() > 0);
view.setCurrentIndex(QModelIndex());
- QVERIFY(view.selectionModel()->selectedIndexes().count() == 0);
+ QCOMPARE(view.selectionModel()->selectedIndexes().count(), 0);
}
void tst_QColumnView::clicked()
diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
index 21e4b82366..55fcf04846 100644
--- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
@@ -239,6 +239,8 @@ private slots:
void testStreamWithHide();
void testStylePosition();
+ void sizeHintCrash();
+
protected:
void setupTestData(bool use_reset_model = false);
void additionalInit();
@@ -403,7 +405,7 @@ void tst_QHeaderView::init()
view = new QHeaderView(Qt::Vertical,topLevel);
// Some initial value tests before a model is added
QCOMPARE(view->length(), 0);
- QVERIFY(view->sizeHint() == QSize(0,0));
+ QCOMPARE(view->sizeHint(), QSize(0,0));
QCOMPARE(view->sectionSizeHint(0), -1);
/*
@@ -925,9 +927,9 @@ void tst_QHeaderView::moveSection()
QFETCH(QList<int>, logical);
QFETCH(int, count);
- QVERIFY(from.count() == to.count());
- QVERIFY(from.count() == moved.count());
- QVERIFY(view->count() == logical.count());
+ QCOMPARE(from.count(), to.count());
+ QCOMPARE(from.count(), moved.count());
+ QCOMPARE(view->count(), logical.count());
QSignalSpy spy1(view, SIGNAL(sectionMoved(int,int,int)));
QCOMPARE(view->sectionsMoved(), false);
@@ -1370,15 +1372,15 @@ void tst_QHeaderView::unhideSection()
QCOMPARE(view->sectionsHidden(), false);
view->setSectionHidden(0, true);
QCOMPARE(view->sectionsHidden(), true);
- QVERIFY(view->sectionSize(0) == 0);
+ QCOMPARE(view->sectionSize(0), 0);
view->setSectionResizeMode(QHeaderView::Interactive);
view->setSectionHidden(0, false);
QVERIFY(view->sectionSize(0) > 0);
view->setSectionHidden(0, true);
- QVERIFY(view->sectionSize(0) == 0);
+ QCOMPARE(view->sectionSize(0), 0);
view->setSectionHidden(0, true);
- QVERIFY(view->sectionSize(0) == 0);
+ QCOMPARE(view->sectionSize(0), 0);
view->setSectionResizeMode(QHeaderView::Stretch);
view->setSectionHidden(0, false);
QVERIFY(view->sectionSize(0) > 0);
@@ -1645,7 +1647,7 @@ void tst_QHeaderView::saveRestore()
QByteArray s2 = h2.saveState();
- QVERIFY(s1 == s2);
+ QCOMPARE(s1, s2);
QVERIFY(!h2.restoreState(QByteArrayLiteral("Garbage")));
// QTBUG-40462
@@ -1659,7 +1661,7 @@ void tst_QHeaderView::saveRestore()
int sectionItemsLengthTotal = 0;
for (int i = 0; i < h2.count(); ++i)
sectionItemsLengthTotal += h2.sectionSize(i);
- QVERIFY(sectionItemsLengthTotal == h2.length());
+ QCOMPARE(sectionItemsLengthTotal, h2.length());
// Buggy setting where sum(sectionItems) != length. Check false is returned and this corrupted
// state isn't restored
@@ -1676,8 +1678,8 @@ void tst_QHeaderView::saveRestore()
// Check setting is correctly recognized as corrupted
QVERIFY(!h2.restoreState(settings_buggy_length));
// Check nothing has been actually restored
- QVERIFY(h2.length() == old_length);
- QVERIFY(h2.saveState() == old_state);
+ QCOMPARE(h2.length(), old_length);
+ QCOMPARE(h2.saveState(), old_state);
}
void tst_QHeaderView::defaultSectionSizeTest()
@@ -1699,7 +1701,7 @@ void tst_QHeaderView::defaultSectionSizeTest()
// no hidden Sections
hv->resizeSection(1, 0);
hv->setDefaultSectionSize(defaultSize);
- QVERIFY(hv->sectionSize(1) == defaultSize);
+ QCOMPARE(hv->sectionSize(1), defaultSize);
// with hidden sections
hv->resizeSection(1, 0);
@@ -2277,7 +2279,7 @@ void tst_QHeaderView::QTBUG14242_hideSectionAutoSize()
for (int u = 0; u < hv->count(); ++u)
calced_length += hv->sectionSize(u);
- QVERIFY(calced_length == afterlength);
+ QCOMPARE(calced_length, afterlength);
}
void tst_QHeaderView::ensureNoIndexAtLength()
@@ -2286,9 +2288,9 @@ void tst_QHeaderView::ensureNoIndexAtLength()
QStandardItemModel amodel(4, 4);
qtv.setModel(&amodel);
QHeaderView *hv = qtv.verticalHeader();
- QVERIFY(hv->visualIndexAt(hv->length()) == -1);
+ QCOMPARE(hv->visualIndexAt(hv->length()), -1);
hv->resizeSection(hv->count() - 1, 0);
- QVERIFY(hv->visualIndexAt(hv->length()) == -1);
+ QCOMPARE(hv->visualIndexAt(hv->length()), -1);
}
void tst_QHeaderView::offsetConsistent()
@@ -2307,7 +2309,7 @@ void tst_QHeaderView::offsetConsistent()
hv->hideSection(sectionToHide);
hv->setOffsetToSectionPosition(150);
int offset2 = hv->offset();
- QVERIFY(offset1 == offset2);
+ QCOMPARE(offset1, offset2);
// Ensure that hidden indexes (still) is considered.
hv->resizeSection(sectionToHide, hv->sectionSize(200) * 2);
hv->setOffsetToSectionPosition(800);
@@ -2600,8 +2602,8 @@ void tst_QHeaderView::logicalIndexAtTest()
//qDebug() << "logicalIndexAtTest" << check1 << check2;
const int precalced_check1 = 106327;
const int precalced_check2 = 29856418;
- QVERIFY(precalced_check1 == check1);
- QVERIFY(precalced_check2 == check2);
+ QCOMPARE(precalced_check1, check1);
+ QCOMPARE(precalced_check2, check2);
const int precalced_results[] = { 1145298384, -1710423344, -650981936, 372919464, -1544372176, -426463328, 12124 };
calculateAndCheck(__LINE__, precalced_results);
@@ -2628,8 +2630,8 @@ void tst_QHeaderView::visualIndexAtTest()
//qDebug() << "visualIndexAtTest" << check1 << check2;
const int precalced_check1 = 72665;
const int precalced_check2 = 14015890;
- QVERIFY(precalced_check1 == check1);
- QVERIFY(precalced_check2 == check2);
+ QCOMPARE(precalced_check1, check1);
+ QCOMPARE(precalced_check2, check2);
const int precalced_results[] = { 1145298384, -1710423344, -1457520212, 169223959, 557466160, -324939600, 5453 };
calculateAndCheck(__LINE__, precalced_results);
@@ -2879,5 +2881,15 @@ void tst_QHeaderView::testStylePosition()
QCOMPARE(proxy.lastPosition, QStyleOptionHeader::OnlyOneSection);
}
+void tst_QHeaderView::sizeHintCrash()
+{
+ QTreeView treeView;
+ QStandardItemModel *model = new QStandardItemModel(&treeView);
+ model->appendRow(new QStandardItem("QTBUG-48543"));
+ treeView.setModel(model);
+ treeView.header()->sizeHintForColumn(0);
+ treeView.header()->sizeHintForRow(0);
+}
+
QTEST_MAIN(tst_QHeaderView)
#include "tst_qheaderview.moc"
diff --git a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
index 439eeff005..25f27cb0c7 100644
--- a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
+++ b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
@@ -804,9 +804,9 @@ void tst_QItemDelegate::dateTimeEditor()
dateTimeEditor->setTime(time.addSecs(600));
widget.clearFocus();
- QVERIFY(item1->data(Qt::EditRole).userType() == QMetaType::QTime);
- QVERIFY(item2->data(Qt::EditRole).userType() == QMetaType::QDate);
- QVERIFY(item3->data(Qt::EditRole).userType() == QMetaType::QDateTime);
+ QCOMPARE(item1->data(Qt::EditRole).userType(), int(QMetaType::QTime));
+ QCOMPARE(item2->data(Qt::EditRole).userType(), int(QMetaType::QDate));
+ QCOMPARE(item3->data(Qt::EditRole).userType(), int(QMetaType::QDateTime));
}
// A delegate where we can either enforce a certain widget or use the standard widget.
@@ -901,9 +901,9 @@ void tst_QItemDelegate::dateAndTimeEditorTest2()
s.setData(i1, datetime2);
editor = w.fastEdit(i1);
timeEdit = qobject_cast<QTimeEdit*>(editor);
- QVERIFY(timeEdit == 0);
+ QVERIFY(!timeEdit);
dateEdit = qobject_cast<QDateEdit*>(editor);
- QVERIFY(dateEdit == 0);
+ QVERIFY(!dateEdit);
dateTimeEdit = qobject_cast<QDateTimeEdit*>(editor);
QVERIFY(dateTimeEdit);
QCOMPARE(dateTimeEdit->dateTime(), datetime2);
@@ -1154,7 +1154,7 @@ void tst_QItemDelegate::editorEvent_data()
QTest::newRow("unchecked, tristate, release")
<< (int)(Qt::Unchecked)
- << (int)(defaultFlags | Qt::ItemIsTristate)
+ << (int)(defaultFlags | Qt::ItemIsAutoTristate)
<< true
<< (int)(QEvent::MouseButtonRelease)
<< (int)(Qt::LeftButton)
@@ -1163,7 +1163,7 @@ void tst_QItemDelegate::editorEvent_data()
QTest::newRow("partially checked, tristate, release")
<< (int)(Qt::PartiallyChecked)
- << (int)(defaultFlags | Qt::ItemIsTristate)
+ << (int)(defaultFlags | Qt::ItemIsAutoTristate)
<< true
<< (int)(QEvent::MouseButtonRelease)
<< (int)(Qt::LeftButton)
@@ -1172,7 +1172,7 @@ void tst_QItemDelegate::editorEvent_data()
QTest::newRow("checked, tristate, release")
<< (int)(Qt::Checked)
- << (int)(defaultFlags | Qt::ItemIsTristate)
+ << (int)(defaultFlags | Qt::ItemIsAutoTristate)
<< true
<< (int)(QEvent::MouseButtonRelease)
<< (int)(Qt::LeftButton)
diff --git a/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp b/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp
index 3a6f1f933d..8fd86ea467 100644
--- a/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp
+++ b/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp
@@ -483,6 +483,7 @@ void tst_QItemView::spider()
view->setHorizontalScrollMode((QAbstractItemView::ScrollMode)hscroll);
view->setModel(treeModel);
view->show();
+ QVERIFY(QTest::qWaitForWindowActive(view));
#if defined(Q_OS_WINCE)
srandom(0);
#else
@@ -551,7 +552,7 @@ void tst_QItemView::visualRect()
QFETCH(bool, displays);
if (!displays){
- QVERIFY(view->visualRect(topIndex) == QRect());
+ QCOMPARE(view->visualRect(topIndex), QRect());
return;
}
@@ -559,15 +560,15 @@ void tst_QItemView::visualRect()
view->show();
QVERIFY(view->visualRect(topIndex) != QRect());
- QVERIFY(topIndex == view->indexAt(view->visualRect(topIndex).center()));
- QVERIFY(topIndex == view->indexAt(view->visualRect(topIndex).bottomLeft()));
- QVERIFY(topIndex == view->indexAt(view->visualRect(topIndex).bottomRight()));
- QVERIFY(topIndex == view->indexAt(view->visualRect(topIndex).topLeft()));
- QVERIFY(topIndex == view->indexAt(view->visualRect(topIndex).topRight()));
+ QCOMPARE(topIndex, view->indexAt(view->visualRect(topIndex).center()));
+ QCOMPARE(topIndex, view->indexAt(view->visualRect(topIndex).bottomLeft()));
+ QCOMPARE(topIndex, view->indexAt(view->visualRect(topIndex).bottomRight()));
+ QCOMPARE(topIndex, view->indexAt(view->visualRect(topIndex).topLeft()));
+ QCOMPARE(topIndex, view->indexAt(view->visualRect(topIndex).topRight()));
testViews->hideIndexes(view);
QModelIndex hiddenIndex = treeModel->index(1, 0);
- QVERIFY(view->visualRect(hiddenIndex) == QRect());
+ QCOMPARE(view->visualRect(hiddenIndex), QRect());
}
void tst_QItemView::walkScreen(QAbstractItemView *view)
@@ -615,7 +616,7 @@ void walkIndex(QModelIndex index, QAbstractItemView *view)
if (view->indexAt(point) != index) {
qDebug() << "index" << index << "visualRect" << visualRect << point << view->indexAt(point);
}
- QVERIFY(view->indexAt(point) == index);
+ QCOMPARE(view->indexAt(point), index);
}
}
diff --git a/tests/auto/widgets/itemviews/qlistview/qlistview.pro b/tests/auto/widgets/itemviews/qlistview/qlistview.pro
index 0623fc8ede..509303b62e 100644
--- a/tests/auto/widgets/itemviews/qlistview/qlistview.pro
+++ b/tests/auto/widgets/itemviews/qlistview/qlistview.pro
@@ -3,3 +3,4 @@ TARGET = tst_qlistview
QT += widgets gui-private widgets-private core-private testlib
SOURCES += tst_qlistview.cpp
win32:!wince:!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 1b21096b44..5b206af357 100644
--- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
+++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
@@ -38,6 +38,7 @@
#include <qapplication.h>
#include <qlistview.h>
#include <private/qlistview_p.h>
+#include <private/qcoreapplication_p.h>
#include <qlistwidget.h>
#include <qitemdelegate.h>
#include <qstandarditemmodel.h>
@@ -150,6 +151,7 @@ private slots:
void testViewOptions();
void taskQTBUG_39902_mutualScrollBars_data();
void taskQTBUG_39902_mutualScrollBars();
+ void horizontalScrollingByVerticalWheelEvents();
};
// Testing get/set functions
@@ -1209,7 +1211,7 @@ void tst_QListView::scrollTo()
list << "Short item";
model.setStringList(list);
lv.setModel(&model);
- lv.setFixedSize(100, 200);
+ lv.setFixedSize(110, 200);
topLevel.show();
QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
@@ -2018,8 +2020,7 @@ void tst_QListView::styleOptionViewItem()
public:
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
- QVERIFY(qstyleoption_cast<const QStyleOptionViewItemV4 *>(&option));
- QStyleOptionViewItemV4 opt(option);
+ QStyleOptionViewItem opt(option);
initStyleOption(&opt, index);
QCOMPARE(opt.index, index);
@@ -2445,5 +2446,52 @@ void tst_QListView::taskQTBUG_39902_mutualScrollBars()
QTRY_VERIFY(view->verticalScrollBar()->isVisible());
}
+void tst_QListView::horizontalScrollingByVerticalWheelEvents()
+{
+ QListView lv;
+ lv.setWrapping(true);
+
+ TestDelegate *delegate = new TestDelegate(&lv);
+ delegate->m_sizeHint = QSize(100, 100);
+ lv.setItemDelegate(delegate);
+
+ QtTestModel model;
+ model.colCount = 1;
+ model.rCount = 100;
+
+ lv.setModel(&model);
+
+ lv.resize(300, 300);
+ lv.show();
+ QTest::qWaitForWindowExposed(&lv);
+
+ QPoint globalPos = lv.geometry().center();
+ QPoint pos = lv.viewport()->geometry().center();
+
+ QWheelEvent wheelDownEvent(pos, globalPos, QPoint(0, 0), QPoint(0, -120), -120, Qt::Vertical, 0, 0);
+ QWheelEvent wheelUpEvent(pos, globalPos, QPoint(0, 0), QPoint(0, 120), 120, Qt::Vertical, 0, 0);
+ QWheelEvent wheelLeftDownEvent(pos, globalPos, QPoint(0, 0), QPoint(120, -120), -120, Qt::Vertical, 0, 0);
+
+ int hValue = lv.horizontalScrollBar()->value();
+ QApplication::sendEvent(lv.viewport(), &wheelDownEvent);
+ QVERIFY(lv.horizontalScrollBar()->value() > hValue);
+
+ QApplication::sendEvent(lv.viewport(), &wheelUpEvent);
+ QCOMPARE(lv.horizontalScrollBar()->value(), hValue);
+
+ QApplication::sendEvent(lv.viewport(), &wheelLeftDownEvent);
+ QCOMPARE(lv.horizontalScrollBar()->value(), hValue);
+
+ // ensure that vertical wheel events are not converted when vertical
+ // scroll bar is not visible but vertical scrolling is possible
+ lv.setWrapping(false);
+ lv.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ QApplication::processEvents();
+
+ int vValue = lv.verticalScrollBar()->value();
+ QApplication::sendEvent(lv.viewport(), &wheelDownEvent);
+ QVERIFY(lv.verticalScrollBar()->value() > vValue);
+}
+
QTEST_MAIN(tst_QListView)
#include "tst_qlistview.moc"
diff --git a/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp b/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp
index dcbdbe824a..ecf72613da 100644
--- a/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp
+++ b/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp
@@ -427,9 +427,9 @@ void tst_QListWidget::currentItem()
// actual test
QModelIndex currentIndex = testWidget->selectionModel()->currentIndex();
if (currentIndex.isValid())
- QVERIFY(testWidget->currentItem() == testWidget->item(currentIndex.row()));
+ QCOMPARE(testWidget->currentItem(), testWidget->item(currentIndex.row()));
else
- QVERIFY(testWidget->currentItem() == (QListWidgetItem*)0);
+ QCOMPARE(testWidget->currentItem(), (QListWidgetItem*)0);
}
void tst_QListWidget::currentRow()
@@ -742,7 +742,7 @@ void tst_QListWidget::selectedItems()
QFETCH(IntList, selectedRows);
QFETCH(IntList, expectedRows);
- QVERIFY(testWidget->count() == 0);
+ QCOMPARE(testWidget->count(), 0);
//insert items
for (int i=0; i<itemCount; ++i)
@@ -1159,7 +1159,7 @@ void tst_QListWidget::setData()
QFETCH(int, expectedSignalCount);
qRegisterMetaType<QListWidgetItem *>("QListWidgetItem*");
- QVERIFY(roles.count() == values.count());
+ QCOMPARE(roles.count(), values.count());
for (int manipulateModel=0; manipulateModel<2; ++manipulateModel) {
testWidget->clear();
@@ -1711,7 +1711,7 @@ void tst_QListWidget::mimeData()
QVERIFY(data->hasFormat(format));
QVERIFY(data2->hasFormat(format));
- QVERIFY(data->data(format) == data2->data(format));
+ QCOMPARE(data->data(format), data2->data(format));
delete data;
delete data2;
diff --git a/tests/auto/widgets/itemviews/qtableview/BLACKLIST b/tests/auto/widgets/itemviews/qtableview/BLACKLIST
index fc231a4e30..329010a86e 100644
--- a/tests/auto/widgets/itemviews/qtableview/BLACKLIST
+++ b/tests/auto/widgets/itemviews/qtableview/BLACKLIST
@@ -1,2 +1,4 @@
[moveCursorBiggerJump]
osx
+[resizeColumnsToContents]
+ubuntu-14.04
diff --git a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
index 75f77f8107..e5abd6bc46 100644
--- a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
+++ b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
@@ -2249,11 +2249,11 @@ void tst_QTableView::resizeColumnsToContents_data()
QTest::addColumn<int>("rowHeight");
QTest::addColumn<int>("columnWidth");
- QTest::newRow("10x10 grid shown 40x40")
- << 10 << 10 << false << 40 << 40 << 40 << 40;
+ QTest::newRow("10x10 grid not shown 60x60")
+ << 10 << 10 << false << 60 << 60 << 60 << 60;
- QTest::newRow("10x10 grid not shown 40x40")
- << 10 << 10 << true << 40 << 40 << 41 << 41;
+ QTest::newRow("10x10 grid shown 60x60")
+ << 10 << 10 << true << 60 << 60 << 61 << 61;
}
void tst_QTableView::resizeColumnsToContents()
@@ -4051,9 +4051,9 @@ void tst_QTableView::mouseWheel()
QWheelEvent verticalEvent(pos, delta, 0, 0, Qt::Vertical);
QWheelEvent horizontalEvent(pos, delta, 0, 0, Qt::Horizontal);
QApplication::sendEvent(view.viewport(), &horizontalEvent);
- QVERIFY(qAbs(view.horizontalScrollBar()->value() - horizontalPositon) < 10);
+ QVERIFY(qAbs(view.horizontalScrollBar()->value() - horizontalPositon) < 15);
QApplication::sendEvent(view.viewport(), &verticalEvent);
- QVERIFY(qAbs(view.verticalScrollBar()->value() - verticalPosition) < 10);
+ QVERIFY(qAbs(view.verticalScrollBar()->value() - verticalPosition) < 15);
}
#endif // !QT_NO_WHEELEVENT
diff --git a/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp b/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp
index 36bc23910c..ea31fd19dd 100644
--- a/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp
+++ b/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp
@@ -94,6 +94,7 @@ private slots:
void task262056_sortDuplicate();
void itemWithHeaderItems();
void mimeData();
+ void selectedRowAfterSorting();
private:
QTableWidget *testWidget;
@@ -196,9 +197,9 @@ void tst_QTableWidget::clearContents()
{
QTableWidgetItem *item = new QTableWidgetItem("test");
testWidget->setHorizontalHeaderItem(0, item);
- QVERIFY(testWidget->horizontalHeaderItem(0) == item);
+ QCOMPARE(testWidget->horizontalHeaderItem(0), item);
testWidget->clearContents();
- QVERIFY(testWidget->horizontalHeaderItem(0) == item);
+ QCOMPARE(testWidget->horizontalHeaderItem(0), item);
}
void tst_QTableWidget::clear()
@@ -1559,11 +1560,29 @@ void tst_QTableWidget::mimeData()
QVERIFY(data->hasFormat(format));
QVERIFY(data2->hasFormat(format));
- QVERIFY(data->data(format) == data2->data(format));
+ QCOMPARE(data->data(format), data2->data(format));
delete data;
delete data2;
}
+void tst_QTableWidget::selectedRowAfterSorting()
+{
+ TestTableWidget table(3,3);
+ table.setSelectionBehavior(QAbstractItemView::SelectRows);
+ for (int r = 0; r < 3; r++)
+ for (int c = 0; c < 3; c++)
+ table.setItem(r,c,new QTableWidgetItem(QStringLiteral("0")));
+ QHeaderView *localHorizontalHeader = table.horizontalHeader();
+ localHorizontalHeader->setSortIndicator(1,Qt::DescendingOrder);
+ table.setProperty("sortingEnabled",true);
+ table.selectRow(1);
+ table.item(1,1)->setText("9");
+ QCOMPARE(table.selectedItems().count(),3);
+ foreach (QTableWidgetItem *item, table.selectedItems()) {
+ QCOMPARE(item->row(),0);
+ }
+}
+
QTEST_MAIN(tst_QTableWidget)
#include "tst_qtablewidget.moc"
diff --git a/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro b/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro
index 3abd58e73d..e8406dab7b 100644
--- a/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro
+++ b/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro
@@ -4,3 +4,5 @@ QT += widgets testlib
QT += widgets-private gui-private core-private
SOURCES += tst_qtreeview.cpp
HEADERS += ../../../../shared/fakedirmodel.h
+
+win32: CONFIG += insignificant_test
diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
index 340637513c..033464c9db 100644
--- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
@@ -253,7 +253,6 @@ private slots:
void taskQTBUG_25333_adjustViewOptionsForIndex();
void taskQTBUG_18539_emitLayoutChanged();
void taskQTBUG_8176_emitOnExpandAll();
- void taskQTBUG_34717_collapseAtBottom();
void taskQTBUG_37813_crash();
void taskQTBUG_45697_crash();
void testInitialFocus();
@@ -2365,7 +2364,7 @@ void tst_QTreeView::selectionOrderTest()
void tst_QTreeView::selection()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This causes a crash triggered by setVisible(false)");
QTreeView treeView;
@@ -3076,7 +3075,7 @@ void tst_QTreeView::styleOptionViewItem()
{
class MyDelegate : public QStyledItemDelegate
{
- static QString posToString(QStyleOptionViewItemV4::ViewItemPosition pos) {
+ static QString posToString(QStyleOptionViewItem::ViewItemPosition pos) {
static const char* s_pos[] = { "Invalid", "Beginning", "Middle", "End", "OnlyOne" };
return s_pos[pos];
}
@@ -3089,8 +3088,7 @@ void tst_QTreeView::styleOptionViewItem()
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const
{
- QVERIFY(qstyleoption_cast<const QStyleOptionViewItemV4 *>(&option));
- QStyleOptionViewItemV4 opt(option);
+ QStyleOptionViewItem opt(option);
initStyleOption(&opt, index);
QVERIFY(!opt.text.isEmpty());
@@ -3098,20 +3096,20 @@ void tst_QTreeView::styleOptionViewItem()
//qDebug() << index << opt.text;
if (allCollapsed)
- QCOMPARE(!(opt.features & QStyleOptionViewItemV2::Alternate), !(index.row() % 2));
- QCOMPARE(!(opt.features & QStyleOptionViewItemV2::HasCheckIndicator), !opt.text.contains("Checkable"));
+ QCOMPARE(!(opt.features & QStyleOptionViewItem::Alternate), !(index.row() % 2));
+ QCOMPARE(!(opt.features & QStyleOptionViewItem::HasCheckIndicator), !opt.text.contains("Checkable"));
if (opt.text.contains("Beginning"))
- QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItemV4::Beginning));
+ QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItem::Beginning));
if (opt.text.contains("Middle"))
- QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItemV4::Middle));
+ QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItem::Middle));
if (opt.text.contains("End"))
- QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItemV4::End));
+ QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItem::End));
if (opt.text.contains("OnlyOne"))
- QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItemV4::OnlyOne));
+ QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItem::OnlyOne));
if (opt.text.contains("Checked"))
QCOMPARE(opt.checkState, Qt::Checked);
@@ -3657,7 +3655,7 @@ void tst_QTreeView::task202039_closePersistentEditor()
QVERIFY(view.indexWidget(current));
view.closePersistentEditor(current);
- QVERIFY(view.indexWidget(current) == 0);
+ QVERIFY(!view.indexWidget(current));
//here was the bug: closing the persistent editor would not reset the state
//and it was impossible to go into editinon again
@@ -4193,7 +4191,7 @@ void tst_QTreeView::taskQTBUG_25333_adjustViewOptionsForIndex()
#ifdef QT_BUILD_INTERNAL
{
- QStyleOptionViewItemV4 option;
+ QStyleOptionViewItem option;
view.aiv_priv()->adjustViewOptionsForIndex(&option, model.indexFromItem(item1));
@@ -4283,35 +4281,6 @@ void tst_QTreeView::taskQTBUG_8176_emitOnExpandAll()
QCOMPARE(spy2.size(), 1); // item2 is collapsed
}
-// From QTBUG_34717 (QTreeWidget crashes when scrolling to the end
-// of an expanded tree, then collapse all)
-// The test passes simply if it doesn't crash.
-void tst_QTreeView::taskQTBUG_34717_collapseAtBottom()
-{
- QTreeWidget treeWidget;
- treeWidget.header()->setSectionResizeMode(QHeaderView::ResizeToContents);
- treeWidget.setColumnCount(2);
- QTreeWidgetItem *mainItem = new QTreeWidgetItem(&treeWidget, QStringList() << "Root");
- for (int i = 0; i < 200; ++i) {
- QTreeWidgetItem *item = new QTreeWidgetItem(mainItem, QStringList(QString("Item")));
- new QTreeWidgetItem(item, QStringList() << "Child" << "1");
- new QTreeWidgetItem(item, QStringList() << "Child" << "2");
- new QTreeWidgetItem(item, QStringList() << "Child" << "3");
- }
- treeWidget.show();
- treeWidget.expandAll();
- treeWidget.scrollToBottom();
- treeWidget.collapseAll();
-
- treeWidget.setAnimated(true);
- treeWidget.expandAll();
- treeWidget.scrollToBottom();
- mainItem->setExpanded(false);
-
- PublicView *pview = (PublicView*) &treeWidget;
- QVERIFY(pview->sizeHintForColumn(1) >= 0);
-}
-
void tst_QTreeView::testInitialFocus()
{
QTreeWidget treeWidget;
diff --git a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
index 5c881369a0..117c53a2bb 100644
--- a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
+++ b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
@@ -161,6 +161,7 @@ private slots:
void taskQTBUG2844_visualItemRect();
void setChildIndicatorPolicy();
+ void taskQTBUG_34717_collapseAtBottom();
void task20345_sortChildren();
void getMimeDataWithInvalidItem();
@@ -1037,7 +1038,7 @@ void tst_QTreeWidget::checkState()
QCOMPARE(firstChild->checkState(0), Qt::Checked);
QCOMPARE(seccondChild->checkState(0), Qt::Unchecked);
- item->setFlags(item->flags()|Qt::ItemIsTristate);
+ item->setFlags(item->flags()|Qt::ItemIsAutoTristate);
QCOMPARE(item->checkState(0), Qt::PartiallyChecked);
QCOMPARE(firstChild->checkState(0), Qt::Checked);
QCOMPARE(seccondChild->checkState(0), Qt::Unchecked);
@@ -1586,7 +1587,7 @@ void tst_QTreeWidget::scrollToItem()
testWidget->setHeaderLabels(QStringList() << "foo");
testWidget->scrollToItem(search);
- QVERIFY(search->text(0) == "111");
+ QCOMPARE(search->text(0), QLatin1String("111"));
bar = search->parent();
QVERIFY(testWidget->isItemExpanded(bar));
@@ -2287,7 +2288,7 @@ void tst_QTreeWidget::insertExpandedItemsWithSorting()
QCOMPARE(parent->childCount(), childText.count());
QVERIFY(parent->isExpanded());
}
- QVERIFY(tree.model()->rowCount() == parentText.count());
+ QCOMPARE(tree.model()->rowCount(), parentText.count());
// verify that the items are still expanded
foreach (QTreeWidgetItem *item, items) {
@@ -2659,7 +2660,7 @@ void tst_QTreeWidget::sortedIndexOfChild()
tw.sortItems(0, (Qt::SortOrder)sortOrder);
tw.expandAll();
- QVERIFY(itms.count() == expectedIndexes.count());
+ QCOMPARE(itms.count(), expectedIndexes.count());
for (int j = 0; j < expectedIndexes.count(); ++j)
QCOMPARE(top->indexOfChild(itms.at(j)), expectedIndexes.at(j));
}
@@ -3155,11 +3156,11 @@ void tst_QTreeWidget::setSelectionModel()
void tst_QTreeWidget::task217309()
{
QTreeWidgetItem item;
- item.setFlags(item.flags() | Qt::ItemIsTristate);
+ item.setFlags(item.flags() | Qt::ItemIsAutoTristate);
QTreeWidgetItem subitem1;
- subitem1.setFlags(subitem1.flags() | Qt::ItemIsTristate);
+ subitem1.setFlags(subitem1.flags() | Qt::ItemIsAutoTristate);
QTreeWidgetItem subitem2;
- subitem2.setFlags(subitem2.flags() | Qt::ItemIsTristate);
+ subitem2.setFlags(subitem2.flags() | Qt::ItemIsAutoTristate);
item.addChild(&subitem1);
item.addChild(&subitem2);
subitem1.setCheckState(0, Qt::Checked);
@@ -3180,7 +3181,7 @@ void tst_QTreeWidget::nonEditableTristate()
QTreeWidget *tree = new QTreeWidget;
QTreeWidgetItem *item = new QTreeWidgetItem();
tree->insertTopLevelItem(0, item);
- item->setFlags(item->flags() | Qt::ItemIsTristate);
+ item->setFlags(item->flags() | Qt::ItemIsAutoTristate);
item->setCheckState(0, Qt::Unchecked);
QTreeWidgetItem *subitem1 = new QTreeWidgetItem(item);
subitem1->setCheckState(0, Qt::Unchecked);
@@ -3235,7 +3236,7 @@ void tst_QTreeWidget::setCurrentItemExpandsParent()
QTreeWidgetItem *i1 = new QTreeWidgetItem(&w, QStringList() << "parent");
QTreeWidgetItem *i2 = new QTreeWidgetItem(i1, QStringList() << "child");
QVERIFY(!i2->isExpanded());
- QVERIFY(w.currentItem() == 0);
+ QVERIFY(!w.currentItem());
w.setCurrentItem(i2);
QVERIFY(!i2->isExpanded());
QCOMPARE(w.currentItem(), i2);
@@ -3378,9 +3379,41 @@ void tst_QTreeWidget::setChildIndicatorPolicy()
QTRY_COMPARE(delegate.numPaints, 1);
}
+// From QTBUG_34717 (QTreeWidget crashes when scrolling to the end
+// of an expanded tree, then collapse all)
+// The test passes simply if it doesn't crash.
+void tst_QTreeWidget::taskQTBUG_34717_collapseAtBottom()
+{
+ struct PublicTreeWidget: public QTreeWidget
+ {
+ inline int sizeHintForColumn(int column) const { return QTreeWidget::sizeHintForColumn(column); }
+ };
+ PublicTreeWidget treeWidget;
+ treeWidget.header()->setSectionResizeMode(QHeaderView::ResizeToContents);
+ treeWidget.setColumnCount(2);
+ QTreeWidgetItem *mainItem = new QTreeWidgetItem(&treeWidget, QStringList() << "Root");
+ for (int i = 0; i < 200; ++i) {
+ QTreeWidgetItem *item = new QTreeWidgetItem(mainItem, QStringList(QString("Item")));
+ new QTreeWidgetItem(item, QStringList() << "Child" << "1");
+ new QTreeWidgetItem(item, QStringList() << "Child" << "2");
+ new QTreeWidgetItem(item, QStringList() << "Child" << "3");
+ }
+ treeWidget.show();
+ treeWidget.expandAll();
+ treeWidget.scrollToBottom();
+ treeWidget.collapseAll();
+
+ treeWidget.setAnimated(true);
+ treeWidget.expandAll();
+ treeWidget.scrollToBottom();
+ mainItem->setExpanded(false);
+
+ QVERIFY(treeWidget.sizeHintForColumn(1) >= 0);
+}
+
void tst_QTreeWidget::task20345_sortChildren()
{
- if (qApp->platformName().toLower() == QLatin1String("wayland"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This causes a crash triggered by setVisible(false)");
// This test case is considered successful if it is executed (no crash in sorting)
diff --git a/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp b/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp
index 490f87a7ef..c52198fa2c 100644
--- a/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp
+++ b/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp
@@ -1112,13 +1112,13 @@ void tst_QTreeWidgetItemIterator::updateIfModifiedFromWidget()
delete item;
item = *it;
if (expecteditemIsNull) {
- QVERIFY(item == 0);
+ QVERIFY(!item);
} else {
QVERIFY(item);
QCOMPARE(item->text(0), expecteditemvalue);
item = *itRemove;
if (expectedUpdatedCurrent.isNull()) {
- QVERIFY(item == 0);
+ QVERIFY(!item);
} else {
QCOMPARE(item->text(0), expectedUpdatedCurrent);
}
diff --git a/tests/auto/widgets/kernel/qaction/BLACKLIST b/tests/auto/widgets/kernel/qaction/BLACKLIST
index f67a3c471e..1ad524fdbf 100644
--- a/tests/auto/widgets/kernel/qaction/BLACKLIST
+++ b/tests/auto/widgets/kernel/qaction/BLACKLIST
@@ -1,2 +1,2 @@
[setStandardKeys]
-ubuntu-14.04
+linux
diff --git a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
index 897128d40e..71b55d71ea 100644
--- a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
+++ b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
@@ -242,7 +242,7 @@ void tst_QAction::setStandardKeys()
QList<QKeySequence> list;
act.setShortcuts(list);
act.setShortcuts(QKeySequence::Copy);
- QVERIFY(act.shortcut() == act.shortcuts().first());
+ QCOMPARE(act.shortcut(), act.shortcuts().first());
QList<QKeySequence> expected;
const QKeySequence ctrlC = QKeySequence(QStringLiteral("CTRL+C"));
diff --git a/tests/auto/widgets/kernel/qactiongroup/BLACKLIST b/tests/auto/widgets/kernel/qactiongroup/BLACKLIST
new file mode 100644
index 0000000000..fdc424b6ac
--- /dev/null
+++ b/tests/auto/widgets/kernel/qactiongroup/BLACKLIST
@@ -0,0 +1,2 @@
+[QTBUG_14292_filesystem]
+linux
diff --git a/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp b/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp
index 8ce9941238..81e5542e91 100644
--- a/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp
+++ b/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp
@@ -42,6 +42,7 @@ class tst_QActionGroup : public QObject
Q_OBJECT
private slots:
+ void cleanup() { QVERIFY(QApplication::topLevelWidgets().isEmpty()); }
void enabledPropagation();
void visiblePropagation();
void exclusive();
@@ -223,7 +224,7 @@ void tst_QActionGroup::unCheckCurrentAction()
current->setChecked(false);
QVERIFY(!action1.isChecked());
QVERIFY(!action2.isChecked());
- QVERIFY(group.checkedAction() == 0);
+ QVERIFY(!group.checkedAction());
}
diff --git a/tests/auto/widgets/kernel/qapplication/BLACKLIST b/tests/auto/widgets/kernel/qapplication/BLACKLIST
new file mode 100644
index 0000000000..6abb1d9988
--- /dev/null
+++ b/tests/auto/widgets/kernel/qapplication/BLACKLIST
@@ -0,0 +1,4 @@
+[quitOnLastWindowClosed]
+osx-10.10
+[touchEventPropagation]
+xcb
diff --git a/tests/auto/widgets/kernel/qapplication/qapplication.pro b/tests/auto/widgets/kernel/qapplication/qapplication.pro
index 3d167827a3..21bfb50aee 100644
--- a/tests/auto/widgets/kernel/qapplication/qapplication.pro
+++ b/tests/auto/widgets/kernel/qapplication/qapplication.pro
@@ -1,7 +1,6 @@
TEMPLATE = subdirs
-SUBDIRS = desktopsettingsaware modal
+!winrt: SUBDIRS = desktopsettingsaware modal
-win32:!wince: SUBDIRS += wincmdline
test.depends += $$SUBDIRS
SUBDIRS += test
diff --git a/tests/auto/widgets/kernel/qapplication/test/BLACKLIST b/tests/auto/widgets/kernel/qapplication/test/BLACKLIST
new file mode 100644
index 0000000000..f4a9cb6166
--- /dev/null
+++ b/tests/auto/widgets/kernel/qapplication/test/BLACKLIST
@@ -0,0 +1,2 @@
+[quitOnLastWindowClosed]
+osx-10.10
diff --git a/tests/auto/widgets/kernel/qapplication/test/test.pro b/tests/auto/widgets/kernel/qapplication/test/test.pro
index b617c228ac..908aa846c0 100644
--- a/tests/auto/widgets/kernel/qapplication/test/test.pro
+++ b/tests/auto/widgets/kernel/qapplication/test/test.pro
@@ -9,7 +9,10 @@ TARGET = ../tst_qapplication
TESTDATA = ../test/test.pro ../tmp/README
-SUBPROGRAMS = desktopsettingsaware modal
-win32:!wince: SUBPROGRAMS += wincmdline
+!winrt {
+ SUBPROGRAMS = desktopsettingsaware modal
+ win32:!wince: SUBPROGRAMS += wincmdline
+
+ for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../$${file}/$${file}"
+}
-for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../$${file}/$${file}"
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
index 84956d0a02..878136b4a0 100644
--- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
+++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
@@ -62,6 +62,7 @@
#endif
#include <qpa/qwindowsysteminterface.h>
+#include <private/qhighdpiscaling_p.h>
#include "../../../qtest-config.h"
@@ -162,9 +163,6 @@ private slots:
void setAttribute();
- void windowsCommandLine_data();
- void windowsCommandLine();
-
void touchEventPropagation();
void qtbug_12673();
@@ -1160,7 +1158,7 @@ void tst_QApplication::sendPostedEvents()
QMetaObject::invokeMethod(&app, "quit", Qt::QueuedConnection);
QPointer<SendPostedEventsTester> p = tester;
(void) app.exec();
- QVERIFY(p == 0);
+ QVERIFY(p.isNull());
}
void tst_QApplication::thread()
@@ -1178,8 +1176,8 @@ void tst_QApplication::thread()
// *before* the QApplication has a thread
QObject object;
QObject child(&object);
- QVERIFY(object.thread() == currentThread);
- QVERIFY(child.thread() == currentThread);
+ QCOMPARE(object.thread(), currentThread);
+ QCOMPARE(child.thread(), currentThread);
{
int argc = 0;
@@ -1209,8 +1207,8 @@ void tst_QApplication::thread()
QVERIFY(!currentThread->isFinished());
// should still have a thread
- QVERIFY(object.thread() == currentThread);
- QVERIFY(child.thread() == currentThread);
+ QCOMPARE(object.thread(), currentThread);
+ QCOMPARE(child.thread(), currentThread);
// do the test again, making sure that the thread is the same as
// before
@@ -1231,8 +1229,8 @@ void tst_QApplication::thread()
QVERIFY(!currentThread->isFinished());
// should still have a thread
- QVERIFY(object.thread() == currentThread);
- QVERIFY(child.thread() == currentThread);
+ QCOMPARE(object.thread(), currentThread);
+ QCOMPARE(child.thread(), currentThread);
QTestEventLoop::instance().enterLoop(1);
}
@@ -1246,8 +1244,8 @@ void tst_QApplication::thread()
QVERIFY(!currentThread->isFinished());
// should still have a thread
- QVERIFY(object.thread() == currentThread);
- QVERIFY(child.thread() == currentThread);
+ QCOMPARE(object.thread(), currentThread);
+ QCOMPARE(child.thread(), currentThread);
}
class DeleteLaterWidget : public QWidget
@@ -1561,9 +1559,9 @@ void tst_QApplication::focusChanged()
QCOMPARE(spy.at(0).count(), 2);
old = qvariant_cast<QWidget*>(spy.at(0).at(0));
now = qvariant_cast<QWidget*>(spy.at(0).at(1));
- QVERIFY(now == &le1);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == 0);
+ QCOMPARE(now, &le1);
+ QCOMPARE(now, QApplication::focusWidget());
+ QVERIFY(!old);
spy.clear();
QCOMPARE(spy.count(), 0);
@@ -1571,27 +1569,27 @@ void tst_QApplication::focusChanged()
QCOMPARE(spy.count(), 1);
old = qvariant_cast<QWidget*>(spy.at(0).at(0));
now = qvariant_cast<QWidget*>(spy.at(0).at(1));
- QVERIFY(now == &pb1);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == &le1);
+ QCOMPARE(now, &pb1);
+ QCOMPARE(now, QApplication::focusWidget());
+ QCOMPARE(old, &le1);
spy.clear();
lb1.setFocus();
QCOMPARE(spy.count(), 1);
old = qvariant_cast<QWidget*>(spy.at(0).at(0));
now = qvariant_cast<QWidget*>(spy.at(0).at(1));
- QVERIFY(now == &lb1);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == &pb1);
+ QCOMPARE(now, &lb1);
+ QCOMPARE(now, QApplication::focusWidget());
+ QCOMPARE(old, &pb1);
spy.clear();
lb1.clearFocus();
QCOMPARE(spy.count(), 1);
old = qvariant_cast<QWidget*>(spy.at(0).at(0));
now = qvariant_cast<QWidget*>(spy.at(0).at(1));
- QVERIFY(now == 0);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == &lb1);
+ QVERIFY(!now);
+ QCOMPARE(now, QApplication::focusWidget());
+ QCOMPARE(old, &lb1);
spy.clear();
QWidget parent2;
@@ -1608,9 +1606,9 @@ void tst_QApplication::focusChanged()
QVERIFY(spy.count() > 0); // one for deactivation, one for activation on Windows
old = qvariant_cast<QWidget*>(spy.at(spy.count()-1).at(0));
now = qvariant_cast<QWidget*>(spy.at(spy.count()-1).at(1));
- QVERIFY(now == &le2);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == 0);
+ QCOMPARE(now, &le2);
+ QCOMPARE(now, QApplication::focusWidget());
+ QVERIFY(!old);
spy.clear();
QTestKeyEvent tab(QTest::Press, Qt::Key_Tab, 0, 0);
@@ -1632,82 +1630,82 @@ void tst_QApplication::focusChanged()
tab.simulate(now);
if (!tabAllControls) {
- QVERIFY(spy.count() == 0);
- QVERIFY(now == QApplication::focusWidget());
+ QCOMPARE(spy.count(), 0);
+ QCOMPARE(now, QApplication::focusWidget());
} else {
QVERIFY(spy.count() > 0);
old = qvariant_cast<QWidget*>(spy.at(0).at(0));
now = qvariant_cast<QWidget*>(spy.at(0).at(1));
- QVERIFY(now == &pb2);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == &le2);
+ QCOMPARE(now, &pb2);
+ QCOMPARE(now, QApplication::focusWidget());
+ QCOMPARE(old, &le2);
spy.clear();
}
if (!tabAllControls) {
- QVERIFY(spy.count() == 0);
- QVERIFY(now == QApplication::focusWidget());
+ QCOMPARE(spy.count(), 0);
+ QCOMPARE(now, QApplication::focusWidget());
} else {
tab.simulate(now);
QVERIFY(spy.count() > 0);
old = qvariant_cast<QWidget*>(spy.at(0).at(0));
now = qvariant_cast<QWidget*>(spy.at(0).at(1));
- QVERIFY(now == &le2);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == &pb2);
+ QCOMPARE(now, &le2);
+ QCOMPARE(now, QApplication::focusWidget());
+ QCOMPARE(old, &pb2);
spy.clear();
}
if (!tabAllControls) {
- QVERIFY(spy.count() == 0);
- QVERIFY(now == QApplication::focusWidget());
+ QCOMPARE(spy.count(), 0);
+ QCOMPARE(now, QApplication::focusWidget());
} else {
backtab.simulate(now);
QVERIFY(spy.count() > 0);
old = qvariant_cast<QWidget*>(spy.at(0).at(0));
now = qvariant_cast<QWidget*>(spy.at(0).at(1));
- QVERIFY(now == &pb2);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == &le2);
+ QCOMPARE(now, &pb2);
+ QCOMPARE(now, QApplication::focusWidget());
+ QCOMPARE(old, &le2);
spy.clear();
}
if (!tabAllControls) {
- QVERIFY(spy.count() == 0);
- QVERIFY(now == QApplication::focusWidget());
+ QCOMPARE(spy.count(), 0);
+ QCOMPARE(now, QApplication::focusWidget());
old = &pb2;
} else {
backtab.simulate(now);
QVERIFY(spy.count() > 0);
old = qvariant_cast<QWidget*>(spy.at(0).at(0));
now = qvariant_cast<QWidget*>(spy.at(0).at(1));
- QVERIFY(now == &le2);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == &pb2);
+ QCOMPARE(now, &le2);
+ QCOMPARE(now, QApplication::focusWidget());
+ QCOMPARE(old, &pb2);
spy.clear();
}
click.simulate(old);
if (!(pb2.focusPolicy() & Qt::ClickFocus)) {
- QVERIFY(spy.count() == 0);
- QVERIFY(now == QApplication::focusWidget());
+ QCOMPARE(spy.count(), 0);
+ QCOMPARE(now, QApplication::focusWidget());
} else {
QVERIFY(spy.count() > 0);
old = qvariant_cast<QWidget*>(spy.at(0).at(0));
now = qvariant_cast<QWidget*>(spy.at(0).at(1));
- QVERIFY(now == &pb2);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == &le2);
+ QCOMPARE(now, &pb2);
+ QCOMPARE(now, QApplication::focusWidget());
+ QCOMPARE(old, &le2);
spy.clear();
click.simulate(old);
QVERIFY(spy.count() > 0);
old = qvariant_cast<QWidget*>(spy.at(0).at(0));
now = qvariant_cast<QWidget*>(spy.at(0).at(1));
- QVERIFY(now == &le2);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == &pb2);
+ QCOMPARE(now, &le2);
+ QCOMPARE(now, QApplication::focusWidget());
+ QCOMPARE(old, &pb2);
spy.clear();
}
@@ -1722,9 +1720,9 @@ void tst_QApplication::focusChanged()
else
old = qvariant_cast<QWidget*>(spy.at(spy.count()-2).at(0));
now = qvariant_cast<QWidget*>(spy.at(spy.count()-1).at(1));
- QVERIFY(now == &le1);
- QVERIFY(now == QApplication::focusWidget());
- QVERIFY(old == &le2);
+ QCOMPARE(now, &le1);
+ QCOMPARE(now, QApplication::focusWidget());
+ QCOMPARE(old, &le2);
spy.clear();
}
@@ -1933,39 +1931,6 @@ void tst_QApplication::setAttribute()
delete w;
}
-void tst_QApplication::windowsCommandLine_data()
-{
-#if defined(Q_OS_WIN)
- QTest::addColumn<QString>("args");
- QTest::addColumn<QString>("expected");
-
- QTest::newRow("hello world")
- << QString("Hello \"World\"")
- << QString("Hello \"World\"");
- QTest::newRow("sql")
- << QString("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'PNR' AND TABLE_TYPE = 'VIEW' ORDER BY TABLE_NAME")
- << QString("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'PNR' AND TABLE_TYPE = 'VIEW' ORDER BY TABLE_NAME");
-#endif
-}
-
-void tst_QApplication::windowsCommandLine()
-{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
- QFETCH(QString, args);
- QFETCH(QString, expected);
-
- QProcess testProcess;
- const QString path = QStringLiteral("wincmdline/wincmdline");
- testProcess.start(path, QStringList(args));
- QVERIFY2(testProcess.waitForStarted(),
- qPrintable(QString::fromLatin1("Cannot start '%1': %2").arg(path, testProcess.errorString())));
- QVERIFY(testProcess.waitForFinished(10000));
- QByteArray error = testProcess.readAllStandardError();
- QString procError(error);
- QCOMPARE(procError, expected);
-#endif
-}
-
class TouchEventPropagationTestWidget : public QWidget
{
Q_OBJECT
@@ -2038,8 +2003,10 @@ void tst_QApplication::touchEventPropagation()
QVERIFY(QTest::qWaitForWindowExposed(&window));
// QPA always takes screen positions and since we map the TouchPoint back to QPA's structure first,
// we must ensure there is a screen position in the TouchPoint that maps to a local 0, 0.
- pressedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(0, 0)));
- releasedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(0, 0)));
+ const QPoint deviceGlobalPos =
+ QHighDpi::toNativePixels(window.mapToGlobal(QPoint(0, 0)), window.windowHandle()->screen());
+ pressedTouchPoints[0].setScreenPos(deviceGlobalPos);
+ releasedTouchPoints[0].setScreenPos(deviceGlobalPos);
QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
0,
@@ -2092,8 +2059,10 @@ void tst_QApplication::touchEventPropagation()
widget.setObjectName("2. widget");
window.show();
QVERIFY(QTest::qWaitForWindowExposed(&window));
- pressedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(50, 50)));
- releasedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(50, 50)));
+ const QPoint deviceGlobalPos =
+ QHighDpi::toNativePixels(window.mapToGlobal(QPoint(50, 50)), window.windowHandle()->screen());
+ pressedTouchPoints[0].setScreenPos(deviceGlobalPos);
+ releasedTouchPoints[0].setScreenPos(deviceGlobalPos);
QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
0,
diff --git a/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro b/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro
deleted file mode 100644
index 3e32a6798d..0000000000
--- a/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-QT += widgets
-CONFIG -= app_bundle debug_and_release_target
-SOURCES += main.cpp
-DESTDIR = ./
-
diff --git a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
index 35a8636f0b..aeaf1e7bf0 100644
--- a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
+++ b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
@@ -48,17 +48,8 @@ class tst_QBoxLayout : public QObject
{
Q_OBJECT
-public:
- tst_QBoxLayout();
- virtual ~tst_QBoxLayout();
-
-public slots:
- void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
-
private slots:
+ void cleanup();
void insertSpacerItem();
void insertLayout();
void sizeHint();
@@ -120,34 +111,15 @@ int CustomLayoutStyle::pixelMetric(PixelMetric metric, const QStyleOption * opti
return QProxyStyle::pixelMetric(metric, option, widget);
}
-
-tst_QBoxLayout::tst_QBoxLayout()
-{
-}
-
-tst_QBoxLayout::~tst_QBoxLayout()
-{
-}
-
-void tst_QBoxLayout::initTestCase()
-{
-}
-
-void tst_QBoxLayout::cleanupTestCase()
-{
-}
-
-void tst_QBoxLayout::init()
-{
-}
-
void tst_QBoxLayout::cleanup()
{
+ QVERIFY(QApplication::topLevelWidgets().isEmpty());
}
void tst_QBoxLayout::insertSpacerItem()
{
- QWidget *window = new QWidget;
+ QWidget window;
+ window.setWindowTitle(QTest::currentTestFunction());
QSpacerItem *spacer1 = new QSpacerItem(20, 10, QSizePolicy::Expanding, QSizePolicy::Expanding);
QSpacerItem *spacer2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Expanding);
@@ -157,44 +129,43 @@ void tst_QBoxLayout::insertSpacerItem()
layout->addSpacerItem(spacer1);
layout->addWidget(new QLineEdit("Baaaaaaaaaaaaaaaaaaaaaaaaar"));
layout->insertSpacerItem(0, spacer2);
- window->setLayout(layout);
+ window.setLayout(layout);
- QVERIFY(layout->itemAt(0) == spacer2);
- QVERIFY(layout->itemAt(2) == spacer1);
+ QCOMPARE(layout->itemAt(0), spacer2);
+ QCOMPARE(layout->itemAt(2), spacer1);
- window->show();
+ window.show();
}
void tst_QBoxLayout::insertLayout()
{
- QWidget *window = new QWidget;
- QVBoxLayout *vbox = new QVBoxLayout(window);
- QVBoxLayout *dummyParentLayout = new QVBoxLayout;
+ QWidget window;
+ QVBoxLayout *vbox = new QVBoxLayout(&window);
+ QScopedPointer<QVBoxLayout> dummyParentLayout(new QVBoxLayout);
QHBoxLayout *subLayout = new QHBoxLayout;
dummyParentLayout->addLayout(subLayout);
- QCOMPARE(subLayout->parent(), dummyParentLayout);
+ QCOMPARE(subLayout->parent(), dummyParentLayout.data());
QCOMPARE(dummyParentLayout->count(), 1);
// add subLayout to another layout
QTest::ignoreMessage(QtWarningMsg, "QLayout::addChildLayout: layout \"\" already has a parent");
vbox->addLayout(subLayout);
QCOMPARE((subLayout->parent() == vbox), (vbox->count() == 1));
-
- delete dummyParentLayout;
- delete window;
}
void tst_QBoxLayout::sizeHint()
{
- QWidget *window = new QWidget;
+ QWidget window;
+ window.setWindowTitle(QTest::currentTestFunction());
QHBoxLayout *lay1 = new QHBoxLayout;
QHBoxLayout *lay2 = new QHBoxLayout;
QLabel *label = new QLabel("widget twooooooooooooooooooooooooooooooooooooooooooooooooooooooo");
lay2->addWidget(label);
lay1->addLayout(lay2);
- window->setLayout(lay1);
- window->show();
+ window.setLayout(lay1);
+ window.show();
+ QTest::qWaitForWindowExposed(&window);
label->setText("foooooooo baaaaaaar");
QSize sh = lay1->sizeHint();
QApplication::processEvents();
@@ -207,24 +178,26 @@ void tst_QBoxLayout::sizeHint()
void tst_QBoxLayout::sizeConstraints()
{
- QWidget *window = new QWidget;
+ QWidget window;
+ window.setWindowTitle(QTest::currentTestFunction());
QHBoxLayout *lay = new QHBoxLayout;
lay->addWidget(new QLabel("foooooooooooooooooooooooooooooooooooo"));
lay->addWidget(new QLabel("baaaaaaaaaaaaaaaaaaaaaaaaaaaaaar"));
lay->setSizeConstraint(QLayout::SetFixedSize);
- window->setLayout(lay);
- window->show();
- QApplication::processEvents();
- QSize sh = window->sizeHint();
+ window.setLayout(lay);
+ window.show();
+ QTest::qWaitForWindowExposed(&window);
+ QSize sh = window.sizeHint();
lay->takeAt(1);
- QVERIFY(sh.width() >= window->sizeHint().width() &&
- sh.height() >= window->sizeHint().height());
+ QVERIFY(sh.width() >= window.sizeHint().width() &&
+ sh.height() >= window.sizeHint().height());
}
void tst_QBoxLayout::setGeometry()
{
QWidget toplevel;
+ toplevel.setWindowTitle(QTest::currentTestFunction());
setFrameless(&toplevel);
QWidget w(&toplevel);
QVBoxLayout *lay = new QVBoxLayout;
@@ -247,33 +220,30 @@ void tst_QBoxLayout::setGeometry()
void tst_QBoxLayout::setStyleShouldChangeSpacing()
{
- QWidget *window = new QWidget;
- QHBoxLayout *hbox = new QHBoxLayout(window);
+ QWidget window;
+ window.setWindowTitle(QTest::currentTestFunction());
+ QHBoxLayout *hbox = new QHBoxLayout(&window);
QPushButton *pb1 = new QPushButton(tr("The spacing between this"));
QPushButton *pb2 = new QPushButton(tr("and this button should depend on the style of the parent widget"));;
pb1->setAttribute(Qt::WA_LayoutUsesWidgetRect);
pb2->setAttribute(Qt::WA_LayoutUsesWidgetRect);
hbox->addWidget(pb1);
hbox->addWidget(pb2);
- CustomLayoutStyle *style1 = new CustomLayoutStyle;
+ QScopedPointer<CustomLayoutStyle> style1(new CustomLayoutStyle);
style1->hspacing = 6;
- window->setStyle(style1);
- window->show();
+ window.setStyle(style1.data());
+ window.show();
+ QTest::qWaitForWindowExposed(&window);
- QTest::qWait(100);
int spacing = pb2->geometry().left() - pb1->geometry().right() - 1;
QCOMPARE(spacing, 6);
- CustomLayoutStyle *style2 = new CustomLayoutStyle();
+ QScopedPointer<CustomLayoutStyle> style2(new CustomLayoutStyle());
style2->hspacing = 10;
- window->setStyle(style2);
+ window.setStyle(style2.data());
QTest::qWait(100);
spacing = pb2->geometry().left() - pb1->geometry().right() - 1;
QCOMPARE(spacing, 10);
-
- delete window;
- delete style1;
- delete style2;
}
void tst_QBoxLayout::taskQTBUG_7103_minMaxWidthNotRespected()
@@ -287,6 +257,7 @@ void tst_QBoxLayout::taskQTBUG_7103_minMaxWidthNotRespected()
layout->addSpacerItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::Expanding));
QWidget widget;
+ widget.setWindowTitle(QTest::currentTestFunction());
widget.setLayout(layout);
widget.show();
QVERIFY(QTest::qWaitForWindowExposed(&widget));
@@ -325,6 +296,7 @@ void tst_QBoxLayout::taskQTBUG_27420_takeAtShouldUnparentLayout()
void tst_QBoxLayout::taskQTBUG_40609_addingWidgetToItsOwnLayout(){
QWidget widget;
+ widget.setWindowTitle(QTest::currentTestFunction());
widget.setObjectName("347b469225a24a0ef05150a");
QVBoxLayout layout(&widget);
layout.setObjectName("ef9e2b42298e0e6420105bb");
@@ -340,6 +312,7 @@ void tst_QBoxLayout::taskQTBUG_40609_addingWidgetToItsOwnLayout(){
void tst_QBoxLayout::taskQTBUG_40609_addingLayoutToItself(){
QWidget widget;
+ widget.setWindowTitle(QTest::currentTestFunction());
widget.setObjectName("fe44e5cb6c08006597126a");
QVBoxLayout layout(&widget);
layout.setObjectName("cc751dd0f50f62b05a62da");
diff --git a/tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp b/tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp
index b717c1deb1..e94dfa5754 100644
--- a/tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp
+++ b/tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp
@@ -73,6 +73,7 @@ void tst_QDesktopWidget::init()
void tst_QDesktopWidget::cleanup()
{
+ QVERIFY(QApplication::topLevelWidgets().isEmpty());
}
void tst_QDesktopWidget::numScreens()
diff --git a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
index 8588df7afa..e1b494c9f1 100644
--- a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
+++ b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
@@ -60,17 +60,8 @@ class tst_QFormLayout : public QObject
{
Q_OBJECT
-public:
- tst_QFormLayout();
- ~tst_QFormLayout();
-
-public slots:
- void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
-
private slots:
+ void cleanup();
void rowCount();
void buddies();
void getItemPosition();
@@ -132,34 +123,15 @@ private slots:
};
-tst_QFormLayout::tst_QFormLayout()
-{
-}
-
-tst_QFormLayout::~tst_QFormLayout()
-{
-}
-
-void tst_QFormLayout::initTestCase()
-{
-}
-
-void tst_QFormLayout::cleanupTestCase()
-{
-}
-
-void tst_QFormLayout::init()
-{
-}
-
void tst_QFormLayout::cleanup()
{
+ QVERIFY(QApplication::topLevelWidgets().isEmpty());
}
void tst_QFormLayout::rowCount()
{
- QWidget *w = new QWidget;
- QFormLayout *fl = new QFormLayout(w);
+ QWidget w;
+ QFormLayout *fl = new QFormLayout(&w);
fl->addRow(tr("Label 1"), new QLineEdit);
fl->addRow(tr("Label 2"), new QLineEdit);
@@ -174,14 +146,12 @@ void tst_QFormLayout::rowCount()
QCOMPARE(fl->rowCount(), 6);
//TODO: remove items
-
- delete w;
}
void tst_QFormLayout::buddies()
{
- QWidget *w = new QWidget;
- QFormLayout *fl = new QFormLayout(w);
+ QWidget w;
+ QFormLayout *fl = new QFormLayout(&w);
//normal buddy case
QLineEdit *le = new QLineEdit;
@@ -195,23 +165,21 @@ void tst_QFormLayout::buddies()
QLineEdit *le2 = new QLineEdit;
fl->addRow(0, le2);
QWidget *label2 = fl->labelForField(le2);
- QVERIFY(label2 == 0);
+ QVERIFY(!label2);
//no label
QLineEdit *le3 = new QLineEdit;
fl->addRow(le3);
QWidget *label3 = fl->labelForField(le3);
- QVERIFY(label3 == 0);
+ QVERIFY(!label3);
//TODO: empty label?
-
- delete w;
}
void tst_QFormLayout::getItemPosition()
{
- QWidget *w = new QWidget;
- QFormLayout *fl = new QFormLayout(w);
+ QWidget w;
+ QFormLayout *fl = new QFormLayout(&w);
QList<QLabel*> labels;
QList<QLineEdit*> fields;
@@ -249,14 +217,12 @@ void tst_QFormLayout::getItemPosition()
QCOMPARE(row, 2);
QCOMPARE(role, QFormLayout::FieldRole);
}
-
- delete w;
}
void tst_QFormLayout::wrapping()
{
- QWidget *w = new QWidget;
- QFormLayout *fl = new QFormLayout(w);
+ QWidget w;
+ QFormLayout *fl = new QFormLayout(&w);
fl->setRowWrapPolicy(QFormLayout::WrapLongRows);
QLineEdit *le = new QLineEdit;
@@ -264,14 +230,13 @@ void tst_QFormLayout::wrapping()
le->setMinimumWidth(200);
fl->addRow(lbl, le);
- w->setFixedWidth(240);
- w->show();
+ w.setFixedWidth(240);
+ w.setWindowTitle(QTest::currentTestFunction());
+ w.show();
QCOMPARE(le->geometry().y() > lbl->geometry().y(), true);
//TODO: additional tests covering different wrapping cases
-
- delete w;
}
class CustomLayoutStyle : public QProxyStyle
@@ -309,12 +274,12 @@ int CustomLayoutStyle::pixelMetric(PixelMetric metric, const QStyleOption * opti
void tst_QFormLayout::spacing()
{
//TODO: confirm spacing behavior
- QWidget *w = new QWidget;
- CustomLayoutStyle *style = new CustomLayoutStyle;
+ QWidget w;
+ QScopedPointer<CustomLayoutStyle> style(new CustomLayoutStyle);
style->hspacing = 5;
style->vspacing = 10;
- w->setStyle(style);
- QFormLayout *fl = new QFormLayout(w);
+ w.setStyle(style.data());
+ QFormLayout *fl = new QFormLayout(&w);
QCOMPARE(style->hspacing, fl->horizontalSpacing());
QCOMPARE(style->vspacing, fl->verticalSpacing());
@@ -351,12 +316,10 @@ void tst_QFormLayout::spacing()
QCheckBox *checkBox = new QCheckBox(tr("Yes"));
fl->setWidget(0, QFormLayout::LabelRole, label);
fl->setWidget(1, QFormLayout::FieldRole, checkBox);
- w->resize(200, 100);
- w->show();
- QVERIFY(QTest::qWaitForWindowExposed(w));
-
- delete w;
- delete style;
+ w.resize(200, 100);
+ w.setWindowTitle(QTest::currentTestFunction());
+ w.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
}
void tst_QFormLayout::contentsRect()
@@ -366,6 +329,7 @@ void tst_QFormLayout::contentsRect()
QFormLayout form;
w.setLayout(&form);
form.addRow("Label", new QPushButton(&w));
+ w.setWindowTitle(QTest::currentTestFunction());
w.show();
QVERIFY(QTest::qWaitForWindowExposed(&w));
int l, t, r, b;
@@ -425,18 +389,18 @@ void tst_QFormLayout::setFormStyle()
#if 0 // QT_NO_STYLE_PLASTIQUE
widget.setStyle(new QPlastiqueStyle());
- QVERIFY(layout.labelAlignment() == Qt::AlignRight);
+ QCOMPARE(layout.labelAlignment(), Qt::AlignRight);
QVERIFY(layout.formAlignment() == (Qt::AlignLeft | Qt::AlignTop));
- QVERIFY(layout.fieldGrowthPolicy() == QFormLayout::ExpandingFieldsGrow);
- QVERIFY(layout.rowWrapPolicy() == QFormLayout::DontWrapRows);
+ QCOMPARE(layout.fieldGrowthPolicy(), QFormLayout::ExpandingFieldsGrow);
+ QCOMPARE(layout.rowWrapPolicy(), QFormLayout::DontWrapRows);
#endif
widget.setStyle(QStyleFactory::create("windows"));
- QVERIFY(layout.labelAlignment() == Qt::AlignLeft);
+ QCOMPARE(layout.labelAlignment(), Qt::AlignLeft);
QVERIFY(layout.formAlignment() == (Qt::AlignLeft | Qt::AlignTop));
- QVERIFY(layout.fieldGrowthPolicy() == QFormLayout::AllNonFixedFieldsGrow);
- QVERIFY(layout.rowWrapPolicy() == QFormLayout::DontWrapRows);
+ QCOMPARE(layout.fieldGrowthPolicy(), QFormLayout::AllNonFixedFieldsGrow);
+ QCOMPARE(layout.rowWrapPolicy(), QFormLayout::DontWrapRows);
/* can't directly create mac style or qtopia style, since
this test is cross platform.. so create dummy styles that
@@ -444,17 +408,17 @@ void tst_QFormLayout::setFormStyle()
*/
widget.setStyle(new DummyMacStyle());
- QVERIFY(layout.labelAlignment() == Qt::AlignRight);
+ QCOMPARE(layout.labelAlignment(), Qt::AlignRight);
QVERIFY(layout.formAlignment() == (Qt::AlignHCenter | Qt::AlignTop));
- QVERIFY(layout.fieldGrowthPolicy() == QFormLayout::FieldsStayAtSizeHint);
- QVERIFY(layout.rowWrapPolicy() == QFormLayout::DontWrapRows);
+ QCOMPARE(layout.fieldGrowthPolicy(), QFormLayout::FieldsStayAtSizeHint);
+ QCOMPARE(layout.rowWrapPolicy(), QFormLayout::DontWrapRows);
widget.setStyle(new DummyQtopiaStyle());
- QVERIFY(layout.labelAlignment() == Qt::AlignRight);
+ QCOMPARE(layout.labelAlignment(), Qt::AlignRight);
QVERIFY(layout.formAlignment() == (Qt::AlignLeft | Qt::AlignTop));
- QVERIFY(layout.fieldGrowthPolicy() == QFormLayout::AllNonFixedFieldsGrow);
- QVERIFY(layout.rowWrapPolicy() == QFormLayout::WrapLongRows);
+ QCOMPARE(layout.fieldGrowthPolicy(), QFormLayout::AllNonFixedFieldsGrow);
+ QCOMPARE(layout.rowWrapPolicy(), QFormLayout::WrapLongRows);
}
void tst_QFormLayout::setFieldGrowthPolicy()
@@ -479,14 +443,14 @@ void tst_QFormLayout::setFieldGrowthPolicy()
layout.activate();
if (i == 0) {
- QVERIFY(fld1.width() == fld2.width());
- QVERIFY(fld2.width() == fld3.width());
+ QCOMPARE(fld1.width(), fld2.width());
+ QCOMPARE(fld2.width(), fld3.width());
} else if (i == 1) {
- QVERIFY(fld1.width() == fld2.width());
+ QCOMPARE(fld1.width(), fld2.width());
QVERIFY(fld2.width() < fld3.width());
} else {
QVERIFY(fld1.width() < fld2.width());
- QVERIFY(fld2.width() == fld3.width());
+ QCOMPARE(fld2.width(), fld3.width());
}
}
}
@@ -505,33 +469,39 @@ void tst_QFormLayout::setFormAlignment()
void tst_QFormLayout::addRow()
{
- QFormLayout layout;
- QWidget w1, w2, w3;
- QHBoxLayout l1, l2, l3;
- QLabel lbl1, lbl2;
-
- QCOMPARE(layout.rowCount(), 0);
-
- layout.addRow(&lbl1, &w1);
- layout.addRow(&lbl2, &l1);
- layout.addRow("Foo:", &w2);
- layout.addRow("Bar:", &l2);
- layout.addRow(&w3);
- layout.addRow(&l3);
-
- QCOMPARE(layout.rowCount(), 6);
-
- QVERIFY(layout.itemAt(0, QFormLayout::LabelRole)->widget() == &lbl1);
- QVERIFY(layout.itemAt(1, QFormLayout::LabelRole)->widget() == &lbl2);
- QVERIFY(layout.itemAt(2, QFormLayout::LabelRole)->widget()->property("text") == "Foo:");
- QVERIFY(layout.itemAt(3, QFormLayout::LabelRole)->widget()->property("text") == "Bar:");
- QVERIFY(layout.itemAt(4, QFormLayout::LabelRole) == 0);
- QVERIFY(layout.itemAt(5, QFormLayout::LabelRole) == 0);
-
- QVERIFY(layout.itemAt(0, QFormLayout::FieldRole)->widget() == &w1);
- QVERIFY(layout.itemAt(1, QFormLayout::FieldRole)->layout() == &l1);
- QVERIFY(layout.itemAt(2, QFormLayout::FieldRole)->widget() == &w2);
- QVERIFY(layout.itemAt(3, QFormLayout::FieldRole)->layout() == &l2);
+ QWidget topLevel;
+ QFormLayout *layout = new QFormLayout(&topLevel);
+ QWidget *w1 = new QWidget(&topLevel);
+ QWidget *w2 = new QWidget(&topLevel);
+ QWidget *w3 = new QWidget(&topLevel);
+ QHBoxLayout *l1 = new QHBoxLayout;
+ QHBoxLayout *l2 = new QHBoxLayout;
+ QHBoxLayout *l3 = new QHBoxLayout;
+ QLabel *lbl1 = new QLabel(&topLevel);
+ QLabel *lbl2 = new QLabel(&topLevel);
+
+ QCOMPARE(layout->rowCount(), 0);
+
+ layout->addRow(lbl1, w1);
+ layout->addRow(lbl2, l1);
+ layout->addRow("Foo:", w2);
+ layout->addRow("Bar:", l2);
+ layout->addRow(w3);
+ layout->addRow(l3);
+
+ QCOMPARE(layout->rowCount(), 6);
+
+ QVERIFY(layout->itemAt(0, QFormLayout::LabelRole)->widget() == lbl1);
+ QVERIFY(layout->itemAt(1, QFormLayout::LabelRole)->widget() == lbl2);
+ QVERIFY(layout->itemAt(2, QFormLayout::LabelRole)->widget()->property("text") == "Foo:");
+ QVERIFY(layout->itemAt(3, QFormLayout::LabelRole)->widget()->property("text") == "Bar:");
+ QVERIFY(layout->itemAt(4, QFormLayout::LabelRole) == 0);
+ QVERIFY(layout->itemAt(5, QFormLayout::LabelRole) == 0);
+
+ QVERIFY(layout->itemAt(0, QFormLayout::FieldRole)->widget() == w1);
+ QVERIFY(layout->itemAt(1, QFormLayout::FieldRole)->layout() == l1);
+ QVERIFY(layout->itemAt(2, QFormLayout::FieldRole)->widget() == w2);
+ QVERIFY(layout->itemAt(3, QFormLayout::FieldRole)->layout() == l2);
// ### should have a third role, FullRowRole?
// QVERIFY(layout.itemAt(4, QFormLayout::FieldRole) == 0);
// QVERIFY(layout.itemAt(5, QFormLayout::FieldRole) == 0);
@@ -539,17 +509,24 @@ void tst_QFormLayout::addRow()
void tst_QFormLayout::insertRow_QWidget_QWidget()
{
- QFormLayout layout;
- QLabel lbl1, lbl2, lbl3, lbl4;
- QLineEdit fld1, fld2, fld3, fld4;
+ QWidget topLevel;
+ QFormLayout *layout = new QFormLayout(&topLevel);
+ QLabel *lbl1 = new QLabel(&topLevel);
+ QLabel *lbl2 = new QLabel(&topLevel);
+ QLabel *lbl3 = new QLabel(&topLevel);
+ QLabel *lbl4 = new QLabel(&topLevel);
+ QLineEdit *fld1 = new QLineEdit(&topLevel);
+ QLineEdit *fld2 = new QLineEdit(&topLevel);
+ QLineEdit *fld3 = new QLineEdit(&topLevel);
+ QLineEdit *fld4 = new QLineEdit(&topLevel);
- layout.insertRow(0, &lbl1, &fld1);
- QCOMPARE(layout.rowCount(), 1);
+ layout->insertRow(0, lbl1, fld1);
+ QCOMPARE(layout->rowCount(), 1);
{
int row = -1;
QFormLayout::ItemRole role = QFormLayout::ItemRole(-123);
- layout.getWidgetPosition(&lbl1, &row, &role);
+ layout->getWidgetPosition(lbl1, &row, &role);
QCOMPARE(row, 0);
QCOMPARE(int(role), int(QFormLayout::LabelRole));
}
@@ -557,63 +534,68 @@ void tst_QFormLayout::insertRow_QWidget_QWidget()
{
int row = -1;
QFormLayout::ItemRole role = QFormLayout::ItemRole(-123);
- layout.getWidgetPosition(&fld1, &row, &role);
+ layout->getWidgetPosition(fld1, &row, &role);
QCOMPARE(row, 0);
QCOMPARE(int(role), int(QFormLayout::FieldRole));
}
// check that negative values append
- layout.insertRow(-2, &lbl2, &fld2);
- QCOMPARE(layout.rowCount(), 2);
+ layout->insertRow(-2, lbl2, fld2);
+ QCOMPARE(layout->rowCount(), 2);
- QVERIFY(layout.itemAt(0, QFormLayout::LabelRole)->widget() == &lbl1);
- QVERIFY(layout.itemAt(1, QFormLayout::LabelRole)->widget() == &lbl2);
+ QVERIFY(layout->itemAt(0, QFormLayout::LabelRole)->widget() == lbl1);
+ QVERIFY(layout->itemAt(1, QFormLayout::LabelRole)->widget() == lbl2);
// check that too large values append
- layout.insertRow(100, &lbl3, &fld3);
- QCOMPARE(layout.rowCount(), 3);
- QCOMPARE(layout.count(), 6);
+ layout->insertRow(100, lbl3, fld3);
+ QCOMPARE(layout->rowCount(), 3);
+ QCOMPARE(layout->count(), 6);
- layout.insertRow(3, (QWidget *)0, (QWidget *)0);
- QCOMPARE(layout.rowCount(), 4);
- QCOMPARE(layout.count(), 6);
+ layout->insertRow(3, (QWidget *)0, (QWidget *)0);
+ QCOMPARE(layout->rowCount(), 4);
+ QCOMPARE(layout->count(), 6);
- layout.insertRow(4, (QWidget *)0, &fld4);
- QCOMPARE(layout.rowCount(), 5);
- QCOMPARE(layout.count(), 7);
+ layout->insertRow(4, (QWidget *)0, fld4);
+ QCOMPARE(layout->rowCount(), 5);
+ QCOMPARE(layout->count(), 7);
- layout.insertRow(5, &lbl4, (QWidget *)0);
- QCOMPARE(layout.rowCount(), 6);
- QCOMPARE(layout.count(), 8);
-
- QVERIFY(layout.itemAt(0, QFormLayout::LabelRole)->widget() == &lbl1);
- QVERIFY(layout.itemAt(1, QFormLayout::LabelRole)->widget() == &lbl2);
- QVERIFY(layout.itemAt(2, QFormLayout::LabelRole)->widget() == &lbl3);
- QVERIFY(layout.itemAt(3, QFormLayout::LabelRole) == 0);
- QVERIFY(layout.itemAt(4, QFormLayout::LabelRole) == 0);
- QVERIFY(layout.itemAt(5, QFormLayout::LabelRole)->widget() == &lbl4);
-
- QVERIFY(layout.itemAt(0, QFormLayout::FieldRole)->widget() == &fld1);
- QVERIFY(layout.itemAt(1, QFormLayout::FieldRole)->widget() == &fld2);
- QVERIFY(layout.itemAt(2, QFormLayout::FieldRole)->widget() == &fld3);
- QVERIFY(layout.itemAt(3, QFormLayout::FieldRole) == 0);
- QVERIFY(layout.itemAt(4, QFormLayout::FieldRole)->widget() == &fld4);
- QVERIFY(layout.itemAt(5, QFormLayout::FieldRole) == 0);
+ layout->insertRow(5, lbl4, (QWidget *)0);
+ QCOMPARE(layout->rowCount(), 6);
+ QCOMPARE(layout->count(), 8);
+
+ QVERIFY(layout->itemAt(0, QFormLayout::LabelRole)->widget() == lbl1);
+ QVERIFY(layout->itemAt(1, QFormLayout::LabelRole)->widget() == lbl2);
+ QVERIFY(layout->itemAt(2, QFormLayout::LabelRole)->widget() == lbl3);
+ QVERIFY(layout->itemAt(3, QFormLayout::LabelRole) == 0);
+ QVERIFY(layout->itemAt(4, QFormLayout::LabelRole) == 0);
+ QVERIFY(layout->itemAt(5, QFormLayout::LabelRole)->widget() == lbl4);
+
+ QVERIFY(layout->itemAt(0, QFormLayout::FieldRole)->widget() == fld1);
+ QVERIFY(layout->itemAt(1, QFormLayout::FieldRole)->widget() == fld2);
+ QVERIFY(layout->itemAt(2, QFormLayout::FieldRole)->widget() == fld3);
+ QVERIFY(layout->itemAt(3, QFormLayout::FieldRole) == 0);
+ QVERIFY(layout->itemAt(4, QFormLayout::FieldRole)->widget() == fld4);
+ QVERIFY(layout->itemAt(5, QFormLayout::FieldRole) == 0);
}
void tst_QFormLayout::insertRow_QWidget_QLayout()
{
- QFormLayout layout;
- QLabel lbl1, lbl2, lbl3, lbl4;
- QHBoxLayout fld1, fld2, fld3, fld4;
+ QWidget topLevel;
+ QFormLayout *layout = new QFormLayout(&topLevel);
+ QLabel *lbl1 = new QLabel(&topLevel);
+ QLabel *lbl2 = new QLabel(&topLevel);
+ QLabel *lbl3 = new QLabel(&topLevel);
+ QHBoxLayout *fld1 = new QHBoxLayout;
+ QHBoxLayout *fld2 = new QHBoxLayout;
+ QHBoxLayout *fld3 = new QHBoxLayout;
- layout.insertRow(0, &lbl1, &fld1);
- QCOMPARE(layout.rowCount(), 1);
+ layout->insertRow(0, lbl1, fld1);
+ QCOMPARE(layout->rowCount(), 1);
{
int row = -1;
QFormLayout::ItemRole role = QFormLayout::ItemRole(-123);
- layout.getWidgetPosition(&lbl1, &row, &role);
+ layout->getWidgetPosition(lbl1, &row, &role);
QCOMPARE(row, 0);
QCOMPARE(int(role), int(QFormLayout::LabelRole));
}
@@ -621,77 +603,83 @@ void tst_QFormLayout::insertRow_QWidget_QLayout()
{
int row = -1;
QFormLayout::ItemRole role = QFormLayout::ItemRole(-123);
- layout.getLayoutPosition(&fld1, &row, &role);
+ layout->getLayoutPosition(fld1, &row, &role);
QCOMPARE(row, 0);
QCOMPARE(int(role), int(QFormLayout::FieldRole));
}
// check that negative values append
- layout.insertRow(-2, &lbl2, &fld2);
- QCOMPARE(layout.rowCount(), 2);
+ layout->insertRow(-2, lbl2, fld2);
+ QCOMPARE(layout->rowCount(), 2);
- QVERIFY(layout.itemAt(0, QFormLayout::LabelRole)->widget() == &lbl1);
- QVERIFY(layout.itemAt(1, QFormLayout::LabelRole)->widget() == &lbl2);
+ QVERIFY(layout->itemAt(0, QFormLayout::LabelRole)->widget() == lbl1);
+ QVERIFY(layout->itemAt(1, QFormLayout::LabelRole)->widget() == lbl2);
// check that too large values append
- layout.insertRow(100, &lbl3, &fld3);
- QCOMPARE(layout.rowCount(), 3);
+ layout->insertRow(100, lbl3, fld3);
+ QCOMPARE(layout->rowCount(), 3);
- QVERIFY(layout.itemAt(0, QFormLayout::LabelRole)->widget() == &lbl1);
- QVERIFY(layout.itemAt(1, QFormLayout::LabelRole)->widget() == &lbl2);
- QVERIFY(layout.itemAt(2, QFormLayout::LabelRole)->widget() == &lbl3);
+ QVERIFY(layout->itemAt(0, QFormLayout::LabelRole)->widget() == lbl1);
+ QVERIFY(layout->itemAt(1, QFormLayout::LabelRole)->widget() == lbl2);
+ QVERIFY(layout->itemAt(2, QFormLayout::LabelRole)->widget() == lbl3);
- QVERIFY(layout.itemAt(0, QFormLayout::FieldRole)->layout() == &fld1);
- QVERIFY(layout.itemAt(1, QFormLayout::FieldRole)->layout() == &fld2);
- QVERIFY(layout.itemAt(2, QFormLayout::FieldRole)->layout() == &fld3);
+ QVERIFY(layout->itemAt(0, QFormLayout::FieldRole)->layout() == fld1);
+ QVERIFY(layout->itemAt(1, QFormLayout::FieldRole)->layout() == fld2);
+ QVERIFY(layout->itemAt(2, QFormLayout::FieldRole)->layout() == fld3);
}
void tst_QFormLayout::insertRow_QString_QWidget()
{
- QFormLayout layout;
- QLineEdit fld1, fld2, fld3;
+ QWidget topLevel;
+ QFormLayout *layout = new QFormLayout(&topLevel);
+ QLineEdit *fld1 = new QLineEdit(&topLevel);
+ QLineEdit *fld2 = new QLineEdit(&topLevel);
+ QLineEdit *fld3 = new QLineEdit(&topLevel);
- layout.insertRow(-5, "&Name:", &fld1);
- QLabel *label1 = qobject_cast<QLabel *>(layout.itemAt(0, QFormLayout::LabelRole)->widget());
+ layout->insertRow(-5, "&Name:", fld1);
+ QLabel *label1 = qobject_cast<QLabel *>(layout->itemAt(0, QFormLayout::LabelRole)->widget());
QVERIFY(label1 != 0);
- QVERIFY(label1->buddy() == &fld1);
+ QCOMPARE(label1->buddy(), fld1);
- layout.insertRow(0, "&Email:", &fld2);
- QLabel *label2 = qobject_cast<QLabel *>(layout.itemAt(0, QFormLayout::LabelRole)->widget());
+ layout->insertRow(0, "&Email:", fld2);
+ QLabel *label2 = qobject_cast<QLabel *>(layout->itemAt(0, QFormLayout::LabelRole)->widget());
QVERIFY(label2 != 0);
- QVERIFY(label2->buddy() == &fld2);
+ QCOMPARE(label2->buddy(), fld2);
- layout.insertRow(5, "&Age:", &fld3);
- QLabel *label3 = qobject_cast<QLabel *>(layout.itemAt(2, QFormLayout::LabelRole)->widget());
+ layout->insertRow(5, "&Age:", fld3);
+ QLabel *label3 = qobject_cast<QLabel *>(layout->itemAt(2, QFormLayout::LabelRole)->widget());
QVERIFY(label3 != 0);
- QVERIFY(label3->buddy() == &fld3);
+ QCOMPARE(label3->buddy(), fld3);
}
void tst_QFormLayout::insertRow_QString_QLayout()
{
- QFormLayout layout;
- QHBoxLayout fld1, fld2, fld3;
+ QWidget topLevel;
+ QFormLayout *layout = new QFormLayout(&topLevel);
+ QHBoxLayout *fld1 = new QHBoxLayout;
+ QHBoxLayout *fld2 = new QHBoxLayout;
+ QHBoxLayout *fld3 = new QHBoxLayout;
- layout.insertRow(-5, "&Name:", &fld1);
- QLabel *label1 = qobject_cast<QLabel *>(layout.itemAt(0, QFormLayout::LabelRole)->widget());
+ layout->insertRow(-5, "&Name:", fld1);
+ QLabel *label1 = qobject_cast<QLabel *>(layout->itemAt(0, QFormLayout::LabelRole)->widget());
QVERIFY(label1 != 0);
- QVERIFY(label1->buddy() == 0);
+ QVERIFY(!label1->buddy());
- QCOMPARE(layout.rowCount(), 1);
+ QCOMPARE(layout->rowCount(), 1);
- layout.insertRow(0, "&Email:", &fld2);
- QLabel *label2 = qobject_cast<QLabel *>(layout.itemAt(0, QFormLayout::LabelRole)->widget());
+ layout->insertRow(0, "&Email:", fld2);
+ QLabel *label2 = qobject_cast<QLabel *>(layout->itemAt(0, QFormLayout::LabelRole)->widget());
QVERIFY(label2 != 0);
- QVERIFY(label2->buddy() == 0);
+ QVERIFY(!label2->buddy());
- QCOMPARE(layout.rowCount(), 2);
+ QCOMPARE(layout->rowCount(), 2);
- layout.insertRow(5, "&Age:", &fld3);
- QLabel *label3 = qobject_cast<QLabel *>(layout.itemAt(2, QFormLayout::LabelRole)->widget());
+ layout->insertRow(5, "&Age:", fld3);
+ QLabel *label3 = qobject_cast<QLabel *>(layout->itemAt(2, QFormLayout::LabelRole)->widget());
QVERIFY(label3 != 0);
- QVERIFY(label3->buddy() == 0);
+ QVERIFY(!label3->buddy());
- QCOMPARE(layout.rowCount(), 3);
+ QCOMPARE(layout->rowCount(), 3);
}
void tst_QFormLayout::insertRow_QWidget()
@@ -840,39 +828,40 @@ void tst_QFormLayout::setLayout()
void tst_QFormLayout::itemAt()
{
- QFormLayout layout;
+ QWidget topLevel;
+ QFormLayout *layout = new QFormLayout(&topLevel);
- QWidget w1;
- QWidget w2;
- QWidget w3;
- QWidget w4;
- QWidget w5;
- QHBoxLayout l6;
+ QWidget *w1 = new QWidget(&topLevel);
+ QWidget *w2 = new QWidget(&topLevel);
+ QWidget *w3 = new QWidget(&topLevel);
+ QWidget *w4 = new QWidget(&topLevel);
+ QWidget *w5 = new QWidget(&topLevel);
+ QHBoxLayout *l6 = new QHBoxLayout;
- layout.setWidget(5, QFormLayout::LabelRole, &w1);
- layout.setWidget(3, QFormLayout::FieldRole, &w2);
- layout.setWidget(3, QFormLayout::LabelRole, &w3);
- layout.addRow(&w4, &w5);
- layout.addRow("Foo:", &l6);
+ layout->setWidget(5, QFormLayout::LabelRole, w1);
+ layout->setWidget(3, QFormLayout::FieldRole, w2);
+ layout->setWidget(3, QFormLayout::LabelRole, w3);
+ layout->addRow(w4, w5);
+ layout->addRow("Foo:", l6);
- QCOMPARE(layout.count(), 7);
+ QCOMPARE(layout->count(), 7);
QBitArray scoreBoard(7);
for (int i = 0; i < 7; ++i) {
- QLayoutItem *item = layout.itemAt(i);
+ QLayoutItem *item = layout->itemAt(i);
QVERIFY(item != 0);
- if (item->widget() == &w1) {
+ if (item->widget() == w1) {
scoreBoard[0] = true;
- } else if (item->widget() == &w2) {
+ } else if (item->widget() == w2) {
scoreBoard[1] = true;
- } else if (item->widget() == &w3) {
+ } else if (item->widget() == w3) {
scoreBoard[2] = true;
- } else if (item->widget() == &w4) {
+ } else if (item->widget() == w4) {
scoreBoard[3] = true;
- } else if (item->widget() == &w5) {
+ } else if (item->widget() == w5) {
scoreBoard[4] = true;
- } else if (item->layout() == &l6) {
+ } else if (item->layout() == l6) {
scoreBoard[5] = true;
} else if (qobject_cast<QLabel *>(item->widget())) {
scoreBoard[6] = true;
@@ -883,26 +872,27 @@ void tst_QFormLayout::itemAt()
void tst_QFormLayout::takeAt()
{
- QFormLayout layout;
+ QWidget topLevel;
+ QFormLayout *layout = new QFormLayout(&topLevel);
- QWidget w1;
- QWidget w2;
- QWidget w3;
- QWidget w4;
- QWidget w5;
- QHBoxLayout l6;
+ QWidget *w1 = new QWidget(&topLevel);
+ QWidget *w2 = new QWidget(&topLevel);
+ QWidget *w3 = new QWidget(&topLevel);
+ QWidget *w4 = new QWidget(&topLevel);
+ QWidget *w5 = new QWidget(&topLevel);
+ QHBoxLayout *l6 = new QHBoxLayout;
- layout.setWidget(5, QFormLayout::LabelRole, &w1);
- layout.setWidget(3, QFormLayout::FieldRole, &w2);
- layout.setWidget(3, QFormLayout::LabelRole, &w3);
- layout.addRow(&w4, &w5);
- layout.addRow("Foo:", &l6);
+ layout->setWidget(5, QFormLayout::LabelRole, w1);
+ layout->setWidget(3, QFormLayout::FieldRole, w2);
+ layout->setWidget(3, QFormLayout::LabelRole, w3);
+ layout->addRow(w4, w5);
+ layout->addRow("Foo:", l6);
- QCOMPARE(layout.count(), 7);
+ QCOMPARE(layout->count(), 7);
for (int i = 6; i >= 0; --i) {
- layout.takeAt(0);
- QCOMPARE(layout.count(), i);
+ layout->takeAt(0);
+ QCOMPARE(layout->count(), i);
}
}
@@ -917,6 +907,7 @@ void tst_QFormLayout::layoutAlone()
QHBoxLayout hlay;
layout.setLayout(1, QFormLayout::LabelRole, &hlay);
QCOMPARE(layout.count(), 2);
+ w.setWindowTitle(QTest::currentTestFunction());
w.show();
layout.activate();
QTest::qWait(500);
diff --git a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
index 7f3c289fb4..1e67c675ef 100644
--- a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
+++ b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
@@ -60,18 +60,9 @@ class tst_QGridLayout : public QObject
{
Q_OBJECT
-public:
- tst_QGridLayout();
- virtual ~tst_QGridLayout();
-
-
-public slots:
+private slots:
void initTestCase();
- void cleanupTestCase();
- void init();
void cleanup();
-
-private slots:
void getItemPosition();
void itemAtPosition();
void badDistributionBug();
@@ -97,76 +88,72 @@ private slots:
void taskQTBUG_40609_addingLayoutToItself();
void replaceWidget();
void dontCrashWhenExtendsToEnd();
-
-private:
- QWidget *testWidget;
- QGridLayout *testLayout;
- QWidget *w1;
- QWidget *w2;
- QWidget *w3;
- QSpacerItem *sp;
-
- QGridLayout *m_grid;
- QWidget *m_toplevel;
};
-
-tst_QGridLayout::tst_QGridLayout()
+void tst_QGridLayout::initTestCase()
{
- m_grid = 0;
- m_toplevel = 0;
+#ifdef Q_OS_WINCE //disable magic for WindowsCE
+ qApp->setAutoMaximizeThreshold(-1);
+#endif
}
-tst_QGridLayout::~tst_QGridLayout()
+static inline int visibleTopLevelWidgetCount()
{
- delete m_toplevel;
+ int result= 0;
+ foreach (const QWidget *topLevel, QApplication::topLevelWidgets()) {
+ if (topLevel->isVisible())
+ ++result;
+ }
+ return result;
}
-void tst_QGridLayout::initTestCase()
+void tst_QGridLayout::cleanup()
{
-#ifdef Q_OS_WINCE //disable magic for WindowsCE
- qApp->setAutoMaximizeThreshold(-1);
-#endif
- // Create the test class
- testWidget = new QWidget(0);
+ // Verify that no visible top levels are leaked. Cannot check for
+ // topLevelWidgets().isEmpty() here since the data driven test layoutSpacing()
+ // will appear to "leak" top levels due to it creating widgets in the test data.
+ QCOMPARE(visibleTopLevelWidgetCount(), 0);
+}
- testLayout = new QGridLayout(testWidget);
+class ItemTestWidget : public QWidget {
+public:
+ ItemTestWidget();
+
+ QGridLayout *testLayout;
+ QWidget *w1;
+ QWidget *w2;
+ QWidget *w3;
+ QSpacerItem *sp;
+};
+
+ItemTestWidget::ItemTestWidget()
+ : testLayout(new QGridLayout(this))
+ , w1(new QWidget(this))
+ , w2(new QWidget(this))
+ , w3(new QWidget(this))
+ , sp(new QSpacerItem(4, 4))
+{
+ setObjectName("testWidget");
+ setWindowTitle(QTest::currentTestFunction());
- w1 = new QWidget(testWidget);
w1->setPalette(QPalette(Qt::red));
testLayout->addWidget(w1, 0, 0);
- w2 = new QWidget(testWidget);
testLayout->addWidget(w2, 1, 1, 2, 2);
w2->setPalette(QPalette(Qt::green));
- w3 = new QWidget(testWidget);
testLayout->addWidget(w3, 0, 1, 1, 2);
w3->setPalette(QPalette(Qt::blue));
- sp = new QSpacerItem(4, 4);
testLayout->addItem(sp, 1, 3, 2, 1);
-
- testWidget->resize( 200, 200 );
- testWidget->show();
-}
-
-void tst_QGridLayout::cleanupTestCase()
-{
- delete testWidget;
- testWidget = 0;
-}
-
-void tst_QGridLayout::init()
-{
-}
-
-void tst_QGridLayout::cleanup()
-{
}
void tst_QGridLayout::getItemPosition()
{
+ ItemTestWidget testWidget;
+ testWidget.resize(200, 200);
+ testWidget.show();
+
QLayoutItem *item;
int counter = 0;
@@ -175,28 +162,28 @@ void tst_QGridLayout::getItemPosition()
bool seenW3 = false;
bool seenSpacer = false;
- while ((item = testLayout->itemAt(counter))) {
+ while ((item = testWidget.testLayout->itemAt(counter))) {
QWidget *w = item->widget();
int r,c,rs,cs;
- testLayout->getItemPosition(counter, &r, &c, &rs, &cs);
+ testWidget.testLayout->getItemPosition(counter, &r, &c, &rs, &cs);
// qDebug() << "item" << counter << "has" <<r << c << rs << cs;
- if (w == w1) {
+ if (w == testWidget.w1) {
QVERIFY(!seenW1);
seenW1 = true;
QCOMPARE(r, 0);
QCOMPARE(c, 0);
QCOMPARE(rs, 1);
QCOMPARE(cs, 1);
- } else if (w == w2) {
+ } else if (w == testWidget.w2) {
QVERIFY(!seenW2);
seenW2 = true;
QCOMPARE(r, 1);
QCOMPARE(c, 1);
QCOMPARE(rs, 2);
QCOMPARE(cs, 2);
- } else if (w == w3) {
+ } else if (w == testWidget.w3) {
QVERIFY(!seenW3);
seenW3 = true;
QCOMPARE(r, 0);
@@ -223,16 +210,20 @@ void tst_QGridLayout::getItemPosition()
void tst_QGridLayout::itemAtPosition()
{
+ ItemTestWidget testWidget;
+ testWidget.resize(200, 200);
+ testWidget.show();
+
void *table[4][5] = {
- { w1, w3, w3, 0, 0 },
- { 0, w2, w2, sp, 0 },
- { 0, w2, w2, sp, 0 },
+ { testWidget.w1, testWidget.w3,testWidget.w3, 0, 0 },
+ { 0, testWidget.w2, testWidget.w2, testWidget.sp, 0 },
+ { 0, testWidget.w2, testWidget.w2, testWidget.sp, 0 },
{ 0, 0, 0, 0, 0 }
};
for (int row = 0; row < 4; ++row) {
for (int col = 0; col < 5; ++col) {
- QLayoutItem *item = testLayout->itemAtPosition(row, col);
+ QLayoutItem *item = testWidget.testLayout->itemAtPosition(row, col);
QVERIFY(item == table[row][col]
|| (item && item->widget() == table[row][col]));
}
@@ -860,32 +851,31 @@ void tst_QGridLayout::minMaxSize()
}
}
QApplication::setStyle(style);
- if (!m_grid)
- m_grid = new QGridLayout();
- if (!m_toplevel) {
- m_toplevel = new QWidget();
- setFrameless(m_toplevel);
- }
+ QWidget toplevel;
+ toplevel.setWindowTitle(QLatin1String(QTest::currentTestFunction())
+ + QLatin1Char(' ') + QLatin1String(QTest::currentDataTag()));
+ setFrameless(&toplevel);
+ QGridLayout *grid = new QGridLayout;
if (fixedSize.isValid()) {
- m_toplevel->setFixedSize(fixedSize);
+ toplevel.setFixedSize(fixedSize);
} else {
- m_toplevel->setMinimumSize(QSize(0,0));
- m_toplevel->setMaximumSize(QSize(QWIDGETSIZE_MAX,QWIDGETSIZE_MAX));
+ toplevel.setMinimumSize(QSize(0,0));
+ toplevel.setMaximumSize(QSize(QWIDGETSIZE_MAX,QWIDGETSIZE_MAX));
}
// Do a two-pass one using the real testdata, the other pass enables heightForWidth
// on the widget, but the heightForWidth() function just return sizeHint().width()
for (int pass = 0; pass < 2; ++pass) {
- m_toplevel->hide();
+ toplevel.hide();
QApplication::processEvents();
QTest::qWait(20);
// Test if removeItem uninitializes data properly
- while (m_grid->count()) {
- QLayoutItem *item = m_grid->itemAt(0);
- m_grid->removeItem(item);
+ while (grid->count()) {
+ QLayoutItem *item = grid->itemAt(0);
+ grid->removeItem(item);
delete item->widget();
delete item;
}
- m_toplevel->setLayout(m_grid);
+ toplevel.setLayout(grid);
// a layout with a top-level parent widget
QList<QPointer<SizeHinterFrame> > sizehinters;
@@ -899,29 +889,29 @@ void tst_QGridLayout::minMaxSize()
QSizePolicy sp = sh->sizePolicy();
sp.setHorizontalPolicy((QSizePolicy::Policy)sizePolicy);
sh->setSizePolicy(sp);
- sh->setParent(m_toplevel);
+ sh->setParent(&toplevel);
if (si.minSize.isValid())
sh->setMinimumSize(si.minSize);
if (si.maxSize.isValid())
sh->setMaximumSize(si.maxSize);
sizehinters.append(sh);
- m_grid->addWidget(sh, i, j);
+ grid->addWidget(sh, i, j);
}
}
- m_toplevel->show();
- QVERIFY(QTest::qWaitForWindowExposed(m_toplevel));
- m_toplevel->adjustSize();
+ toplevel.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&toplevel));
+ toplevel.adjustSize();
QTest::qWait(240); // wait for the implicit adjustSize
// If the following fails we might have to wait longer.
// If that does not help there is likely a problem with the implicit adjustSize in show()
if (!fixedSize.isValid()) {
// Note that this can fail if the desktop has large fonts on windows.
- QTRY_COMPARE(m_toplevel->size(), m_toplevel->sizeHint());
+ QTRY_COMPARE(toplevel.size(), toplevel.sizeHint());
}
// We are relying on the order here...
for (int pi = 0; pi < sizehinters.count(); ++pi) {
- QPoint pt = sizehinters.at(pi)->mapTo(m_toplevel, QPoint(0, 0));
+ QPoint pt = sizehinters.at(pi)->mapTo(&toplevel, QPoint(0, 0));
QCOMPARE(pt, sizeinfos.at(pi).expectedPos);
}
}
diff --git a/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp b/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
index d661c074ac..4d15ac9a93 100644
--- a/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
+++ b/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
@@ -66,6 +66,7 @@ public:
virtual ~tst_QLayout();
private slots:
+ void cleanup() { QVERIFY(QApplication::topLevelWidgets().isEmpty()); }
void getSetCheck();
void geometry();
void smartMaxSize();
@@ -217,12 +218,12 @@ void tst_QLayout::setLayoutBugs()
}
widget.setLayout(hBoxLayout);
- QVERIFY(widget.layout() == hBoxLayout);
+ QCOMPARE(widget.layout(), hBoxLayout);
QWidget containerWidget(0);
containerWidget.setLayout(widget.layout());
- QVERIFY(widget.layout() == 0);
- QVERIFY(containerWidget.layout() == hBoxLayout);
+ QVERIFY(!widget.layout());
+ QCOMPARE(containerWidget.layout(), hBoxLayout);
}
class MyLayout : public QLayout
diff --git a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
index 7b9eaa418f..15aef8d503 100644
--- a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
+++ b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
@@ -72,7 +72,8 @@ public:
TriggerSlot4,
TriggerSlot5,
TriggerSlot6,
- TriggerSlot7
+ TriggerSlot7,
+ SendKeyEvent
};
enum Result {
@@ -84,6 +85,7 @@ public:
Slot5Triggered,
Slot6Triggered,
Slot7Triggered,
+ SentKeyEvent,
Ambiguous
} currentResult;
@@ -104,10 +106,12 @@ public slots:
void ambigSlot7() { currentResult = Ambiguous; ambigResult = Slot7Triggered; }
void statusMessage( const QString& message ) { sbText = message; }
void shortcutDestroyed(QObject* obj);
+ void sendKeyEvent() { sendKeyEvents(edit, Qt::CTRL + Qt::Key_B, 0); currentResult = SentKeyEvent; }
public slots:
void initTestCase();
void cleanupTestCase();
+ void cleanup() { QCOMPARE(QApplication::topLevelWidgets().size(), 1); }
private slots:
void number_data();
@@ -980,6 +984,19 @@ void tst_QShortcut::keypressConsumption()
QVERIFY(edit->toPlainText().endsWith("<Ctrl+I>a"));
clearAllShortcuts();
+ edit->clear();
+ QCOMPARE(edit->toPlainText().size(), 0);
+
+ setupShortcut(edit, "first", SendKeyEvent, "Ctrl+A");
+
+ // Verify reentrancy when a non-shortcut is triggered as part
+ // of shortcut processing.
+ currentResult = NoResult;
+ ambigResult = NoResult;
+ sendKeyEvents(edit, Qt::CTRL + Qt::Key_A, 0);
+ QCOMPARE(currentResult, SentKeyEvent);
+ QCOMPARE(ambigResult, NoResult);
+ QCOMPARE(edit->toPlainText(), QString(QString("<Ctrl+B>")));
}
// ------------------------------------------------------------------
@@ -1181,9 +1198,12 @@ QShortcut *tst_QShortcut::setupShortcut(QWidget *parent, const char *name, int t
normal = SLOT(slotTrig7());
ambig = SLOT(ambigSlot7());
break;
+ case SendKeyEvent:
+ normal = SLOT(sendKeyEvent());
}
connect(cut, SIGNAL(activated()), this, normal);
- connect(cut, SIGNAL(activatedAmbiguously()), this, ambig);
+ if (ambig)
+ connect(cut, SIGNAL(activatedAmbiguously()), this, ambig);
connect(cut, SIGNAL(destroyed(QObject*)), this, SLOT(shortcutDestroyed(QObject*)));
shortcuts.append(cut);
return cut;
diff --git a/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp b/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp
index 6c88f8731b..0f8c9d1c9e 100644
--- a/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp
+++ b/tests/auto/widgets/kernel/qsizepolicy/tst_qsizepolicy.cpp
@@ -44,6 +44,7 @@ class tst_QSizePolicy : public QObject
Q_OBJECT
private Q_SLOTS:
+ void cleanup() { QVERIFY(QApplication::topLevelWidgets().isEmpty()); }
void qtest();
void defaultValues();
void getSetCheck_data() { data(); }
@@ -51,6 +52,8 @@ private Q_SLOTS:
void dataStream();
void horizontalStretch();
void verticalStretch();
+ void qhash_data() { data(); }
+ void qhash();
private:
void data() const;
};
@@ -149,8 +152,6 @@ void tst_QSizePolicy::getSetCheck()
QCOMPARE(sp.expandingDirections(), ed);
}
-#undef FETCH_TEST_DATA
-
static void makeRow(QSizePolicy sp, QSizePolicy::Policy hp, QSizePolicy::Policy vp,
int hst, int vst, QSizePolicy::ControlType ct, bool hfw, bool wfh,
Qt::Orientations orients)
@@ -314,5 +315,21 @@ void tst_QSizePolicy::verticalStretch()
QCOMPARE(sp.verticalStretch(), 255);
}
+void tst_QSizePolicy::qhash()
+{
+ FETCH_TEST_DATA;
+ Q_UNUSED(ed);
+
+ QSizePolicy sp2(hp, vp, ct);
+ sp2.setVerticalStretch(vst);
+ sp2.setHorizontalStretch(hst);
+ if (hfw) sp2.setHeightForWidth(true);
+ if (wfh) sp2.setWidthForHeight(true);
+ QCOMPARE(sp, sp2);
+ QCOMPARE(qHash(sp), qHash(sp2));
+}
+
+#undef FETCH_TEST_DATA
+
QTEST_MAIN(tst_QSizePolicy)
#include "tst_qsizepolicy.moc"
diff --git a/tests/auto/widgets/kernel/qtooltip/BLACKLIST b/tests/auto/widgets/kernel/qtooltip/BLACKLIST
new file mode 100644
index 0000000000..f8d062cc46
--- /dev/null
+++ b/tests/auto/widgets/kernel/qtooltip/BLACKLIST
@@ -0,0 +1,4 @@
+[whatsThis]
+ubuntu-14.04
+[task183679]
+opensuse-13.1
diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST
index 591aa9e40f..78ccbe302a 100644
--- a/tests/auto/widgets/kernel/qwidget/BLACKLIST
+++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST
@@ -12,7 +12,7 @@ osx
ubuntu-14.04
osx
[focusProxyAndInputMethods]
-ubuntu-14.04
+linux
[touchEventSynthesizedMouseEvent]
ubuntu-14.04
[grabMouse]
@@ -28,73 +28,17 @@ osx
[stackUnder]
osx
[raise]
-osx-10.9
+osx
[widgetAt]
osx
[sheetOpacity]
osx
[resizeEvent]
osx
-[setWindowGeometry:100,123 200x200, flags 0]
-osx-10.10
-[windowMoveResize:100,123 200x200, flags 0]
-osx-10.10
-[setWindowGeometry:100,122 200x200, flags 0]
-osx-10.9
-[windowMoveResize:100,122 200x200, flags 0]
-osx-10.9
-[setWindowGeometry:100,100 824x564, flags 0]
-osx-10.10
-[windowMoveResize:100,100 824x564, flags 0]
-osx-10.10
-[setWindowGeometry:100,100 824x516, flags 0]
-osx-10.10
-[windowMoveResize:100,100 824x516, flags 0]
-osx-10.10
-[setWindowGeometry:100,73 200x0, flags 0]
-osx-10.10
-[windowMoveResize:100,73 200x0, flags 0]
-osx-10.10
-[setWindowGeometry:100,100 824x519, flags 0]
-osx-10.10
-[windowMoveResize:100,100 824x519, flags 0]
-osx-10.10
-[setWindowGeometry:100,100 824x518, flags 0]
-osx-10.10
-[windowMoveResize:100,100 824x518, flags 0]
-osx-10.10
-[setWindowGeometry:100,72 200x0, flags 0]
-osx-10.9
-[windowMoveResize:100,72 200x0, flags 0]
-osx-10.9
-[setWindowGeometry:100,122 952x574, flags 0]
-osx-10.9
-[windowMoveResize:100,122 952x574, flags 0]
-osx-10.9
-[setWindowGeometry:100,122 952x578, flags 0]
-osx-10.9
-[windowMoveResize:100,122 952x578, flags 0]
-osx-10.9
-[setWindowGeometry:100,122 952x576, flags 0]
-osx-10.9
-[windowMoveResize:100,122 952x576, flags 0]
-osx-10.9
-[setWindowGeometry:100,100 824x521, flags 0]
-osx-10.10
-[windowMoveResize:100,100 824x521, flags 0]
-osx-10.10
-[setWindowGeometry:100,122 952x577, flags 0]
-osx-10.9
-[windowMoveResize:100,122 952x577, flags 0]
-osx-10.9
-[setWindowGeometry:100,122 952x580, flags 0]
-osx-10.9
-[windowMoveResize:100,122 952x580, flags 0]
-osx-10.9
-[windowMoveResize:130,72 0x0, flags 0]
-osx-10.9
-[windowMoveResize:130,122 0x200, flags 0]
-osx-10.9
+[setWindowGeometry]
+osx
+[windowMoveResize]
+osx
[childEvents]
osx
[renderInvisible]
@@ -114,9 +58,9 @@ osx
[showMinimizedKeepsFocus]
osx-10.10
[moveWindowInShowEvent:1]
-osx-10.9
+osx
[moveWindowInShowEvent:2]
-osx-10.9
+osx
[taskQTBUG_4055_sendSyntheticEnterLeave]
osx
[syntheticEnterLeave]
@@ -128,10 +72,14 @@ osx-10.10
[hideOpaqueChildWhileHidden]
osx
[resizeStaticContentsChildWidget_QTBUG35282]
-osx-10.9
+osx
[lower]
osx
[setClearAndResizeMask]
osx
[setToolTip]
osx-10.9
+[moveInResizeEvent]
+ubuntu-14.04
+[moveChild:right]
+osx
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index a0d94d2dc9..ddbb4e6d75 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -51,6 +51,7 @@
#include <qdesktopwidget.h>
#include <private/qwidget_p.h>
#include <private/qapplication_p.h>
+#include <private/qhighdpiscaling_p.h>
#include <qcalendarwidget.h>
#include <qmainwindow.h>
#include <qdockwidget.h>
@@ -193,6 +194,19 @@ static QByteArray msgComparisonFailed(T v1, const char *op, T v2)
return s.toLocal8Bit();
}
+// Compare a window position that may go through scaling in the platform plugin with fuzz.
+static inline bool qFuzzyCompareWindowPosition(const QPoint &p1, const QPoint p2, int fuzz)
+{
+ return (p1 - p2).manhattanLength() <= fuzz;
+}
+
+static QString msgPointMismatch(const QPoint &p1, const QPoint p2)
+{
+ QString result;
+ QDebug(&result) << p1 << "!=" << p2 << ", manhattanLength=" << (p1 - p2).manhattanLength();
+ return result;
+}
+
class tst_QWidget : public QObject
{
Q_OBJECT
@@ -613,7 +627,7 @@ void tst_QWidget::getSetCheck()
}
tst_QWidget::tst_QWidget()
- : m_platform(qApp->platformName().toLower())
+ : m_platform(QGuiApplication::platformName().toLower())
, m_windowsAnimationsEnabled(windowsAnimationsEnabled())
{
if (m_windowsAnimationsEnabled) // Disable animations which can interfere with screen grabbing in moveChild(), showAndMoveChild()
@@ -1846,10 +1860,6 @@ void tst_QWidget::activation()
QCOMPARE(QApplication::activeWindow(), &widget1);
widget2.showNormal();
QTest::qWait(waitTime);
-#ifndef Q_OS_WINCE
- if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA)
- QEXPECT_FAIL("", "MS introduced new behavior after XP", Continue);
-#endif
QTest::qWait(waitTime);
QCOMPARE(QApplication::activeWindow(), &widget2);
widget2.hide();
@@ -1905,8 +1915,10 @@ void tst_QWidget::windowState()
widget1.setWindowState(widget1.windowState() ^ Qt::WindowMaximized);
QTest::qWait(100);
+ const int fuzz = int(QHighDpiScaling::factor(widget1.windowHandle()));
QVERIFY(!(widget1.windowState() & Qt::WindowMaximized));
- QTRY_COMPARE(widget1.pos(), pos);
+ QTRY_VERIFY2(qFuzzyCompareWindowPosition(widget1.pos(), pos, fuzz),
+ qPrintable(msgPointMismatch(widget1.pos(), pos)));
QCOMPARE(widget1.windowHandle()->windowState(), Qt::WindowNoState);
widget1.setWindowState(Qt::WindowMinimized);
@@ -1927,7 +1939,8 @@ void tst_QWidget::windowState()
widget1.setWindowState(widget1.windowState() ^ Qt::WindowMaximized);
QTest::qWait(100);
QVERIFY(!(widget1.windowState() & (Qt::WindowMinimized|Qt::WindowMaximized)));
- QTRY_COMPARE(widget1.pos(), pos);
+ QTRY_VERIFY2(qFuzzyCompareWindowPosition(widget1.pos(), pos, fuzz),
+ qPrintable(msgPointMismatch(widget1.pos(), pos)));
QCOMPARE(widget1.windowHandle()->windowState(), Qt::WindowNoState);
widget1.setWindowState(Qt::WindowFullScreen);
@@ -1948,7 +1961,8 @@ void tst_QWidget::windowState()
widget1.setWindowState(Qt::WindowNoState);
QTest::qWait(100);
VERIFY_STATE(Qt::WindowNoState);
- QTRY_COMPARE(widget1.pos(), pos);
+ QTRY_VERIFY2(qFuzzyCompareWindowPosition(widget1.pos(), pos, fuzz),
+ qPrintable(msgPointMismatch(widget1.pos(), pos)));
QCOMPARE(widget1.windowHandle()->windowState(), Qt::WindowNoState);
widget1.setWindowState(Qt::WindowFullScreen);
@@ -1981,7 +1995,8 @@ void tst_QWidget::windowState()
QVERIFY(!(widget1.windowState() & stateMask));
QCOMPARE(widget1.windowHandle()->windowState(), Qt::WindowNoState);
- QTRY_COMPARE(widget1.pos(), pos);
+ QTRY_VERIFY2(qFuzzyCompareWindowPosition(widget1.pos(), pos, fuzz),
+ qPrintable(msgPointMismatch(widget1.pos(), pos)));
QTRY_COMPARE(widget1.size(), size);
}
@@ -3079,12 +3094,12 @@ void tst_QWidget::saveRestoreGeometry()
const QByteArray four("abca");
const QByteArray garbage("abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc");
- QVERIFY(widget.restoreGeometry(empty) == false);
- QVERIFY(widget.restoreGeometry(one) == false);
- QVERIFY(widget.restoreGeometry(two) == false);
- QVERIFY(widget.restoreGeometry(three) == false);
- QVERIFY(widget.restoreGeometry(four) == false);
- QVERIFY(widget.restoreGeometry(garbage) == false);
+ QVERIFY(!widget.restoreGeometry(empty));
+ QVERIFY(!widget.restoreGeometry(one));
+ QVERIFY(!widget.restoreGeometry(two));
+ QVERIFY(!widget.restoreGeometry(three));
+ QVERIFY(!widget.restoreGeometry(four));
+ QVERIFY(!widget.restoreGeometry(garbage));
QVERIFY(widget.restoreGeometry(savedGeometry));
widget.showNormal();
@@ -3354,7 +3369,7 @@ void tst_QWidget::widgetAt()
#if defined(Q_OS_WINCE)
QEXPECT_FAIL("", "Windows CE does only support rectangular regions", Continue); //See also task 147191
#endif
- QTRY_VERIFY(QApplication::widgetAt(testPos) == w1.data());
+ QTRY_COMPARE(QApplication::widgetAt(testPos), w1.data());
QTRY_VERIFY(QApplication::widgetAt(testPos + QPoint(1, 1)) == w2.data());
}
@@ -3401,24 +3416,24 @@ void tst_QWidget::testDeletionInEventHandlers()
QPointer<Widget> w = new Widget;
w->deleteThis = true;
w->close();
- QVERIFY(w == 0);
+ QVERIFY(w.isNull());
delete w;
// focusOut (crashes)
//w = new Widget;
//w->show();
//w->setFocus();
- //QVERIFY(qApp->focusWidget() == w);
+ //QCOMPARE(qApp->focusWidget(), w);
//w->deleteThis = true;
//w->clearFocus();
- //QVERIFY(w == 0);
+ //QVERIFY(w.isNull());
// key press
w = new Widget;
w->show();
w->deleteThis = true;
QTest::keyPress(w, Qt::Key_A);
- QVERIFY(w == 0);
+ QVERIFY(w.isNull());
delete w;
// key release
@@ -3426,7 +3441,7 @@ void tst_QWidget::testDeletionInEventHandlers()
w->show();
w->deleteThis = true;
QTest::keyRelease(w, Qt::Key_A);
- QVERIFY(w == 0);
+ QVERIFY(w.isNull());
delete w;
// mouse press
@@ -3434,15 +3449,16 @@ void tst_QWidget::testDeletionInEventHandlers()
w->show();
w->deleteThis = true;
QTest::mousePress(w, Qt::LeftButton);
- QVERIFY(w == 0);
+ QVERIFY(w.isNull());
delete w;
// mouse release
w = new Widget;
w->show();
w->deleteThis = true;
- QTest::mouseRelease(w, Qt::LeftButton);
- QVERIFY(w == 0);
+ QMouseEvent me(QEvent::MouseButtonRelease, QPoint(1, 1), Qt::LeftButton, Qt::LeftButton, 0);
+ qApp->notify(w, &me);
+ QVERIFY(w.isNull());
delete w;
// mouse double click
@@ -3450,7 +3466,7 @@ void tst_QWidget::testDeletionInEventHandlers()
w->show();
w->deleteThis = true;
QTest::mouseDClick(w, Qt::LeftButton);
- QVERIFY(w == 0);
+ QVERIFY(w.isNull());
delete w;
// hide event (crashes)
@@ -3458,13 +3474,13 @@ void tst_QWidget::testDeletionInEventHandlers()
//w->show();
//w->deleteThis = true;
//w->hide();
- //QVERIFY(w == 0);
+ //QVERIFY(w.isNull());
// action event
w = new Widget;
w->deleteThis = true;
w->addAction(new QAction(w));
- QVERIFY(w == 0);
+ QVERIFY(w.isNull());
delete w;
// change event
@@ -3472,16 +3488,16 @@ void tst_QWidget::testDeletionInEventHandlers()
w->show();
w->deleteThis = true;
w->setMouseTracking(true);
- QVERIFY(w == 0);
+ QVERIFY(w.isNull());
delete w;
w = new Widget;
w->setMouseTracking(true);
w->show();
w->deleteThis = true;
- QMouseEvent me(QEvent::MouseMove, QPoint(0, 0), Qt::NoButton, Qt::NoButton, Qt::NoModifier);
+ me = QMouseEvent(QEvent::MouseMove, QPoint(0, 0), Qt::NoButton, Qt::NoButton, Qt::NoModifier);
QApplication::sendEvent(w, &me);
- QVERIFY(w == 0);
+ QVERIFY(w.isNull());
delete w;
}
@@ -3675,6 +3691,8 @@ void tst_QWidget::optimizedResizeMove()
void tst_QWidget::optimizedResize_topLevel()
{
+ if (QHighDpiScaling::isActive())
+ QSKIP("Skip due to rounding errors in the regions.");
StaticWidget topLevel;
topLevel.gotPaintEvent = false;
topLevel.show();
@@ -3909,7 +3927,7 @@ void tst_QWidget::winIdChangeEvent()
QCOMPARE(winIdBefore, winIdAfter);
QCOMPARE(child.winIdChangeEventCount(), 3);
// winId is set to zero during reparenting
- QVERIFY(0 == child.m_winIdList[1]);
+ QCOMPARE(WId(0), child.m_winIdList[1]);
}
{
@@ -3949,7 +3967,7 @@ void tst_QWidget::winIdChangeEvent()
QCOMPARE(winIdBefore, winIdAfter);
QCOMPARE(child.winIdChangeEventCount(), 3);
// winId is set to zero during reparenting
- QVERIFY(0 == child.m_winIdList[1]);
+ QCOMPARE(WId(0), child.m_winIdList[1]);
}
}
@@ -4495,7 +4513,7 @@ void tst_QWidget::qobject_castInDestroyedSlot()
QObject::connect(widget, SIGNAL(destroyed(QObject*)), &checker, SLOT(destroyedSlot(QObject*)));
delete widget;
- QVERIFY(checker.wasQWidget == true);
+ QVERIFY(checker.wasQWidget);
}
// Since X11 WindowManager operations are all async, and we have no way to know if the window
@@ -4544,8 +4562,18 @@ void tst_QWidget::setWindowGeometry_data()
QList<int> windowFlags;
windowFlags << 0 << Qt::FramelessWindowHint;
+ const bool skipEmptyRects = (m_platform == QStringLiteral("windows"));
foreach (QList<QRect> l, rects) {
QRect rect = l.first();
+ if (skipEmptyRects) {
+ QList<QRect>::iterator it = l.begin();
+ while (it != l.end()) {
+ if (it->isEmpty())
+ it = l.erase(it);
+ else
+ ++it;
+ }
+ }
foreach (int windowFlag, windowFlags) {
QTest::newRow(QString("%1,%2 %3x%4, flags %5")
.arg(rect.x())
@@ -4594,8 +4622,13 @@ void tst_QWidget::setWindowGeometry()
widget.setGeometry(rect);
widget.showNormal();
- if (rect.isValid())
+ if (rect.isValid()) {
QVERIFY(QTest::qWaitForWindowExposed(&widget));
+ } else {
+ // in case of an invalid rect, wait for the geometry to become
+ // adjusted to the actual (valid) value.
+ QApplication::processEvents();
+ }
QTRY_COMPARE(widget.geometry(), rect);
// setGeometry() while shown
@@ -6007,10 +6040,13 @@ void tst_QWidget::childEvents()
expected =
EventRecorder::EventList()
<< qMakePair(&widget, QEvent::Polish)
+ << qMakePair(&widget, QEvent::PlatformSurface)
<< qMakePair(&widget, QEvent::WinIdChange)
+ << qMakePair(&widget, QEvent::WindowIconChange)
<< qMakePair(&widget, QEvent::Move)
<< qMakePair(&widget, QEvent::Resize)
<< qMakePair(&widget, QEvent::Show)
+ << qMakePair(&widget, QEvent::CursorChange)
<< qMakePair(&widget, QEvent::ShowToParent);
QVERIFY2(spy.eventList() == expected,
@@ -6022,13 +6058,9 @@ void tst_QWidget::childEvents()
EventRecorder::EventList()
<< qMakePair(&widget, QEvent::PolishRequest)
<< qMakePair(&widget, QEvent::Type(QEvent::User + 1))
-#if defined(Q_OS_OSX) || defined(Q_OS_QNX)
<< qMakePair(&widget, QEvent::UpdateLater)
-#endif
<< qMakePair(&widget, QEvent::UpdateRequest);
- if (m_platform == QStringLiteral("windows") || m_platform == QStringLiteral("xcb"))
- QEXPECT_FAIL("", EventRecorder::msgExpectFailQtBug26424(expected, spy.eventList()).constData(), Continue);
QVERIFY2(spy.eventList() == expected,
EventRecorder::msgEventListMismatch(expected, spy.eventList()).constData());
}
@@ -6097,10 +6129,13 @@ void tst_QWidget::childEvents()
<< qMakePair(&widget, QEvent::Polish)
<< qMakePair(&widget, QEvent::ChildPolished)
<< qMakePair(&widget, QEvent::ChildPolished)
+ << qMakePair(&widget, QEvent::PlatformSurface)
<< qMakePair(&widget, QEvent::WinIdChange)
+ << qMakePair(&widget, QEvent::WindowIconChange)
<< qMakePair(&widget, QEvent::Move)
<< qMakePair(&widget, QEvent::Resize)
<< qMakePair(&widget, QEvent::Show)
+ << qMakePair(&widget, QEvent::CursorChange)
<< qMakePair(&widget, QEvent::ShowToParent);
QVERIFY2(spy.eventList() == expected,
@@ -6113,13 +6148,9 @@ void tst_QWidget::childEvents()
<< qMakePair(&widget, QEvent::PolishRequest)
<< qMakePair(&widget, QEvent::Type(QEvent::User + 1))
<< qMakePair(&widget, QEvent::Type(QEvent::User + 2))
-#if defined(Q_OS_OSX) || defined(Q_OS_QNX)
<< qMakePair(&widget, QEvent::UpdateLater)
-#endif
<< qMakePair(&widget, QEvent::UpdateRequest);
- if (m_platform == QStringLiteral("windows") || m_platform == QStringLiteral("xcb"))
- QEXPECT_FAIL("", EventRecorder::msgExpectFailQtBug26424(expected, spy.eventList()).constData(), Continue);
QVERIFY2(spy.eventList() == expected,
EventRecorder::msgEventListMismatch(expected, spy.eventList()).constData());
}
@@ -6190,10 +6221,13 @@ void tst_QWidget::childEvents()
EventRecorder::EventList()
<< qMakePair(&widget, QEvent::Polish)
<< qMakePair(&widget, QEvent::ChildPolished)
+ << qMakePair(&widget, QEvent::PlatformSurface)
<< qMakePair(&widget, QEvent::WinIdChange)
+ << qMakePair(&widget, QEvent::WindowIconChange)
<< qMakePair(&widget, QEvent::Move)
<< qMakePair(&widget, QEvent::Resize)
<< qMakePair(&widget, QEvent::Show)
+ << qMakePair(&widget, QEvent::CursorChange)
<< qMakePair(&widget, QEvent::ShowToParent);
QVERIFY2(spy.eventList() == expected,
@@ -6206,13 +6240,9 @@ void tst_QWidget::childEvents()
<< qMakePair(&widget, QEvent::PolishRequest)
<< qMakePair(&widget, QEvent::Type(QEvent::User + 1))
<< qMakePair(&widget, QEvent::Type(QEvent::User + 2))
-#if defined(Q_OS_OSX) || defined(Q_OS_QNX)
<< qMakePair(&widget, QEvent::UpdateLater)
-#endif
<< qMakePair(&widget, QEvent::UpdateRequest);
- if (m_platform == QStringLiteral("windows") || m_platform == QStringLiteral("xcb"))
- QEXPECT_FAIL("", EventRecorder::msgExpectFailQtBug26424(expected, spy.eventList()).constData(), Continue);
QVERIFY2(spy.eventList() == expected,
EventRecorder::msgEventListMismatch(expected, spy.eventList()).constData());
}
@@ -8957,7 +8987,7 @@ void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave()
int numEnterEvents, numMouseMoveEvents;
};
- QCursor::setPos(QPoint(0,0));
+ QCursor::setPos(QPoint(0,0));
SELParent parent;
parent.move(200, 200);
@@ -8965,8 +8995,7 @@ void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave()
SELChild child(&parent);
child.resize(200, 200);
parent.show();
- QVERIFY(QTest::qWaitForWindowExposed(&parent));
- QTest::qWait(150);
+ QVERIFY(QTest::qWaitForWindowActive(&parent));
QCursor::setPos(child.mapToGlobal(QPoint(100, 100)));
// Make sure the cursor has entered the child.
@@ -9714,8 +9743,9 @@ void tst_QWidget::grabMouse()
QVERIFY(QTest::qWaitForWindowActive(&w));
QStringList expectedLog;
- grabber->grabMouse();
QPoint mousePos = QPoint(w.width() / 2, 10);
+ QTest::mouseMove(w.windowHandle(), mousePos);
+ grabber->grabMouse();
const int step = w.height() / 5;
for ( ; mousePos.y() < w.height() ; mousePos.ry() += step) {
QTest::mouseClick(w.windowHandle(), Qt::LeftButton, 0, mousePos);
@@ -10385,6 +10415,9 @@ public:
void tst_QWidget::keyboardModifiers()
{
KeyboardWidget w;
+ w.resize(300, 300);
+ w.show();
+ QVERIFY(QTest::qWaitForWindowActive(&w));
QTest::mouseClick(&w, Qt::LeftButton, Qt::ControlModifier);
QCOMPARE(w.m_eventCounter, 1);
QCOMPARE(int(w.m_modifiers), int(Qt::ControlModifier));
@@ -10462,7 +10495,7 @@ void tst_QWidget::qmlSetParentHelper()
QWidget child;
QVERIFY(QAbstractDeclarativeData::setWidgetParent);
QAbstractDeclarativeData::setWidgetParent(&child, &parent);
- QVERIFY(child.parentWidget() == &parent);
+ QCOMPARE(child.parentWidget(), &parent);
QAbstractDeclarativeData::setWidgetParent(&child, 0);
QVERIFY(!child.parentWidget());
#else
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 148c2352a5..5188dfbcfa 100644
--- a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
+++ b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
@@ -97,6 +97,8 @@ private slots:
void tst_resize_count();
void tst_move_count();
+
+ void tst_eventfilter_on_toplevel();
};
void tst_QWidget_window::initTestCase()
@@ -336,30 +338,30 @@ void tst_QWidget_window::tst_windowFilePath()
void tst_QWidget_window::tst_showWithoutActivating()
{
-#ifndef Q_DEAD_CODE_FROM_QT4_X11
- QSKIP("This test is X11-only.");
-#else
- QWidget w;
- w.show();
- QVERIFY(QTest::qWaitForWindowExposed(&w));
- QApplication::processEvents();
+ QString platformName = QGuiApplication::platformName().toLower();
+ if (platformName == "cocoa")
+ QSKIP("Cocoa: This fails. Figure out why.");
+ else if (platformName != QStringLiteral("xcb")
+ && platformName != QStringLiteral("windows")
+ && platformName != QStringLiteral("ios"))
+ QSKIP("Qt::WA_ShowWithoutActivating is currently supported only on xcb, windows, and ios platforms.");
+
+ QWidget w1;
+ w1.setAttribute(Qt::WA_ShowWithoutActivating);
+ w1.show();
+ QVERIFY(!QTest::qWaitForWindowActive(&w1));
- QApplication::clipboard();
- QLineEdit *lineEdit = new QLineEdit;
- lineEdit->setAttribute(Qt::WA_ShowWithoutActivating, true);
- lineEdit->show();
- lineEdit->setAttribute(Qt::WA_ShowWithoutActivating, false);
- lineEdit->raise();
- lineEdit->activateWindow();
-
- Window window;
- int revertto;
- QTRY_COMPARE(lineEdit->winId(),
- (XGetInputFocus(QX11Info::display(), &window, &revertto), window) );
- // Note the use of the , before window because we want the XGetInputFocus to be re-executed
- // in each iteration of the inside loop of the QTRY_COMPARE macro
-
-#endif // Q_DEAD_CODE_FROM_QT4_X11
+ QWidget w2;
+ w2.show();
+ QVERIFY(QTest::qWaitForWindowActive(&w2));
+
+ QWidget w3;
+ w3.setAttribute(Qt::WA_ShowWithoutActivating);
+ w3.show();
+ QVERIFY(!QTest::qWaitForWindowActive(&w3));
+
+ w3.activateWindow();
+ QVERIFY(QTest::qWaitForWindowActive(&w3));
}
void tst_QWidget_window::tst_paintEventOnSecondShow()
@@ -762,5 +764,48 @@ void tst_QWidget_window::tst_move_count()
QTRY_VERIFY(move.moveCount >= 1);
}
+class EventFilter : public QObject
+{
+public:
+ int eventCount;
+
+ EventFilter()
+ : QObject(),
+ eventCount(0)
+ {
+ }
+
+ static QEvent::Type filterEventType()
+ {
+ static int type = QEvent::registerEventType();
+ return static_cast<QEvent::Type>(type);
+ }
+
+protected:
+ bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE
+ {
+ if (e->type() == filterEventType())
+ ++eventCount;
+
+ return QObject::eventFilter(o, e);
+ }
+};
+
+void tst_QWidget_window::tst_eventfilter_on_toplevel()
+{
+ QWidget w;
+ EventFilter filter;
+ w.installEventFilter(&filter);
+ w.show();
+ QVERIFY(QTest::qWaitForWindowActive(&w));
+ QVERIFY(w.isWindow());
+ QCOMPARE(filter.eventCount, 0);
+
+ // send an event not handled in a special way by QWidgetWindow::event,
+ // and check that it's received by the event filter
+ QCoreApplication::postEvent(w.windowHandle(), new QEvent(EventFilter::filterEventType()));
+ QTRY_COMPARE(filter.eventCount, 1);
+}
+
QTEST_MAIN(tst_QWidget_window)
#include "tst_qwidget_window.moc"
diff --git a/tests/auto/widgets/kernel/qwidgetaction/tst_qwidgetaction.cpp b/tests/auto/widgets/kernel/qwidgetaction/tst_qwidgetaction.cpp
index df54d22a2f..207ce00dbf 100644
--- a/tests/auto/widgets/kernel/qwidgetaction/tst_qwidgetaction.cpp
+++ b/tests/auto/widgets/kernel/qwidgetaction/tst_qwidgetaction.cpp
@@ -55,6 +55,8 @@ class tst_QWidgetAction : public QObject
{
Q_OBJECT
private slots:
+ void initTestCase();
+ void cleanup();
void defaultWidget();
void visibilityUpdate();
void customWidget();
@@ -65,6 +67,19 @@ private slots:
void releaseWidgetCrash();
};
+void tst_QWidgetAction::initTestCase()
+{
+ // Disable menu/combo animations to prevent the alpha widgets from getting in the
+ // way in popup(), failing the top level leak check in cleanup().
+ QApplication::setEffectEnabled(Qt::UI_AnimateMenu, false);
+ QApplication::setEffectEnabled(Qt::UI_AnimateCombo, false);
+}
+
+void tst_QWidgetAction::cleanup()
+{
+ QVERIFY(QApplication::topLevelWidgets().isEmpty());
+}
+
void tst_QWidgetAction::defaultWidget()
{
{
@@ -123,14 +138,14 @@ void tst_QWidgetAction::defaultWidget()
action->setDefaultWidget(combo);
tb1.addAction(action);
- QVERIFY(combo->parent() == &tb1);
+ QCOMPARE(combo->parent(), &tb1);
qApp->processEvents();
qApp->processEvents();
QVERIFY(combo->isVisible());
// not supported, not supposed to work, hence the parent() check
tb2.addAction(action);
- QVERIFY(combo->parent() == &tb1);
+ QCOMPARE(combo->parent(), &tb1);
tb2.removeAction(action);
tb1.removeAction(action);
@@ -141,11 +156,11 @@ void tst_QWidgetAction::defaultWidget()
tb2.addAction(action);
qApp->processEvents(); //the call to hide is delayd by the toolbar layout
qApp->processEvents();
- QVERIFY(combo->parent() == &tb2);
+ QCOMPARE(combo->parent(), &tb2);
QVERIFY(combo->isVisible());
tb1.addAction(action);
- QVERIFY(combo->parent() == &tb2);
+ QCOMPARE(combo->parent(), &tb2);
delete action;
QVERIFY(!combo);
@@ -156,17 +171,17 @@ void tst_QWidgetAction::defaultWidget()
QPointer<QComboBox> combo1 = new QComboBox;
a->setDefaultWidget(combo1);
- QVERIFY(a->defaultWidget() == combo1);
+ QCOMPARE(a->defaultWidget(), combo1.data());
a->setDefaultWidget(combo1);
QVERIFY(combo1);
- QVERIFY(a->defaultWidget() == combo1);
+ QCOMPARE(a->defaultWidget(), combo1.data());
QPointer<QComboBox> combo2 = new QComboBox;
QVERIFY(combo1 != combo2);
a->setDefaultWidget(combo2);
QVERIFY(!combo1);
- QVERIFY(a->defaultWidget() == combo2);
+ QCOMPARE(a->defaultWidget(), combo2.data());
delete a;
QVERIFY(!combo2);
@@ -238,7 +253,7 @@ void tst_QWidgetAction::customWidget()
combos = action->createdWidgets();
QCOMPARE(combos.count(), 2);
- QVERIFY(combos.at(0) == combo1);
+ QCOMPARE(combos.at(0), combo1.data());
QPointer<QComboBox> combo2 = qobject_cast<QComboBox *>(combos.at(1));
QVERIFY(combo2);
@@ -262,7 +277,7 @@ void tst_QWidgetAction::keepOwnership()
{
QToolBar *tb = new QToolBar;
tb->addAction(action);
- QVERIFY(combo->parent() == tb);
+ QCOMPARE(combo->parent(), tb);
delete tb;
}
diff --git a/tests/auto/widgets/kernel/qwidgetsvariant/tst_qwidgetsvariant.cpp b/tests/auto/widgets/kernel/qwidgetsvariant/tst_qwidgetsvariant.cpp
index 8b566713f9..690ef30f71 100644
--- a/tests/auto/widgets/kernel/qwidgetsvariant/tst_qwidgetsvariant.cpp
+++ b/tests/auto/widgets/kernel/qwidgetsvariant/tst_qwidgetsvariant.cpp
@@ -84,13 +84,13 @@ void tst_QWidgetsVariant::constructor_invalid()
QTest::ignoreMessage(QtWarningMsg, QRegularExpression("^Trying to construct an instance of an invalid type, type id:"));
QVariant variant(static_cast<QVariant::Type>(typeId));
QVERIFY(!variant.isValid());
- QVERIFY(variant.userType() == QMetaType::UnknownType);
+ QCOMPARE(variant.userType(), int(QMetaType::UnknownType));
}
{
QTest::ignoreMessage(QtWarningMsg, QRegularExpression("^Trying to construct an instance of an invalid type, type id:"));
QVariant variant(typeId, /* copy */ 0);
QVERIFY(!variant.isValid());
- QVERIFY(variant.userType() == QMetaType::UnknownType);
+ QCOMPARE(variant.userType(), int(QMetaType::UnknownType));
}
}
@@ -208,7 +208,7 @@ void tst_QWidgetsVariant::qvariant_cast_QObject_derived()
CustomQWidget customWidget;
QWidget *widget = &customWidget;
QVariant data = QVariant::fromValue(widget);
- QVERIFY(data.userType() == qMetaTypeId<QWidget*>());
+ QCOMPARE(data.userType(), qMetaTypeId<QWidget*>());
QCOMPARE(data.value<QObject*>(), widget);
QCOMPARE(data.value<QWidget*>(), widget);
diff --git a/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp b/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp
index 33427788f6..dfc53c9164 100644
--- a/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp
+++ b/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp
@@ -212,7 +212,7 @@ void tst_QWindowContainer::testActivation()
// Under KDE (ubuntu 12.10), we experience that doing two activateWindow in a row
// does not work. The second gets ignored by the window manager, even though the
// timestamp in the xcb connection is unique for both.
- if (QGuiApplication::platformName() == "xcb")
+ if (!QGuiApplication::platformName().compare(QLatin1String("xcb"), Qt::CaseInsensitive))
QTest::qWait(100);
window->requestActivate();
@@ -327,7 +327,7 @@ void tst_QWindowContainer::testDockWidget()
QTest::qWait(1000);
dock->setFloating(false);
- QTRY_VERIFY(window->parent() == mainWindow.window()->windowHandle());
+ QTRY_COMPARE(window->parent(), mainWindow.window()->windowHandle());
}
QTEST_MAIN(tst_QWindowContainer)
diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
index 7aa529d5ee..21369d4520 100644
--- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
+++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
@@ -214,12 +214,12 @@ void tst_QStyle::testProxyStyle()
QProxyStyle *proxyStyle = new QProxyStyle();
QVERIFY(proxyStyle->baseStyle());
QStyle *style = QStyleFactory::create("Windows");
- QVERIFY(style->proxy() == style);
+ QCOMPARE(style->proxy(), style);
proxyStyle->setBaseStyle(style);
- QVERIFY(style->proxy() == proxyStyle);
- QVERIFY(style->parent() == proxyStyle);
- QVERIFY(proxyStyle->baseStyle() == style);
+ QCOMPARE(style->proxy(), proxyStyle);
+ QCOMPARE(style->parent(), proxyStyle);
+ QCOMPARE(proxyStyle->baseStyle(), style);
QVERIFY(testAllFunctions(proxyStyle));
proxyStyle->setBaseStyle(0);
@@ -236,7 +236,7 @@ void tst_QStyle::testProxyStyle()
QLineEdit edit;
edit.setStyle(&customStyle);
QVERIFY(!customStyle.parent());
- QVERIFY(edit.style()->pixelMetric(QStyle::PM_ButtonIconSize) == 13);
+ QCOMPARE(edit.style()->pixelMetric(QStyle::PM_ButtonIconSize), 13);
}
void tst_QStyle::drawItemPixmap()
diff --git a/tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp b/tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp
index 3c1d4c589b..2e26ba609b 100644
--- a/tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp
+++ b/tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp
@@ -43,7 +43,6 @@ class tst_QStyleOption: public QObject
private slots:
void qstyleoptioncast_data();
void qstyleoptioncast();
- void copyconstructors();
};
// Just a simple container for QStyleOption-pointer
@@ -133,21 +132,6 @@ void tst_QStyleOption::qstyleoptioncast()
delete testOption;
}
-void tst_QStyleOption::copyconstructors()
-{
- QStyleOptionFrame frame;
- QStyleOptionFrameV2 frame2(frame);
- QCOMPARE(frame2.version, int(QStyleOptionFrameV2::Version));
- frame2 = frame;
- QCOMPARE(frame2.version, int(QStyleOptionFrameV2::Version));
-
- QStyleOptionProgressBar bar;
- QStyleOptionProgressBarV2 bar2(bar);
- QCOMPARE(bar2.version, int(QStyleOptionProgressBarV2::Version));
- bar2 = bar;
- QCOMPARE(bar2.version, int(QStyleOptionProgressBarV2::Version));
-}
-
QTEST_MAIN(tst_QStyleOption)
#include "tst_qstyleoption.moc"
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST b/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST
new file mode 100644
index 0000000000..cf78fb47c2
--- /dev/null
+++ b/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST
@@ -0,0 +1,2 @@
+[hoverColors]
+ubuntu-14.04
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
index 25f7715e3b..a360803c50 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -178,45 +178,49 @@ void tst_QStyleSheetStyle::numinstances()
void tst_QStyleSheetStyle::widgetsBeforeAppStyleSheet()
{
QPushButton w1; // widget with no stylesheet
+ const QColor red(Qt::red);
+ const QColor white(Qt::white);
qApp->setStyleSheet("* { color: red; }");
- QVERIFY(COLOR(w1) == QColor("red"));
+ QCOMPARE(COLOR(w1), red);
w1.setStyleSheet("color: white");
- QVERIFY(COLOR(w1) == QColor("white"));
+ QCOMPARE(COLOR(w1), white);
qApp->setStyleSheet("");
- QVERIFY(COLOR(w1) == QColor("white"));
+ QCOMPARE(COLOR(w1), white);
w1.setStyleSheet("");
- QVERIFY(COLOR(w1) == APPCOLOR(w1));
+ QCOMPARE(COLOR(w1), APPCOLOR(w1));
}
class FriendlySpinBox : public QSpinBox { friend class tst_QStyleSheetStyle; };
void tst_QStyleSheetStyle::widgetsAfterAppStyleSheet()
{
+ const QColor red(Qt::red);
+ const QColor white(Qt::white);
qApp->setStyleSheet("* { color: red; font-size: 32pt; }");
QPushButton w1;
FriendlySpinBox spin;
- QVERIFY(COLOR(w1) == QColor("red"));
- QVERIFY(COLOR(spin) == QColor("red"));
- QVERIFY(COLOR(*spin.lineEdit()) == QColor("red"));
+ QCOMPARE(COLOR(w1), red);
+ QCOMPARE(COLOR(spin), red);
+ QCOMPARE(COLOR(*spin.lineEdit()), red);
QCOMPARE(FONTSIZE(w1), 32);
QCOMPARE(FONTSIZE(spin), 32);
QCOMPARE(FONTSIZE(*spin.lineEdit()), 32);
w1.setStyleSheet("color: white");
- QVERIFY(COLOR(w1) == QColor("white"));
- QVERIFY(COLOR(spin) == QColor("red"));
- QVERIFY(COLOR(*spin.lineEdit()) == QColor("red"));
+ QCOMPARE(COLOR(w1), white);
+ QCOMPARE(COLOR(spin), red);
+ QCOMPARE(COLOR(*spin.lineEdit()), red);
w1.setStyleSheet("");
- QVERIFY(COLOR(w1) == QColor("red"));
- QVERIFY(COLOR(spin) == QColor("red"));
- QVERIFY(COLOR(*spin.lineEdit()) == QColor("red"));
+ QCOMPARE(COLOR(w1), red);
+ QCOMPARE(COLOR(spin), red);
+ QCOMPARE(COLOR(*spin.lineEdit()), red);
w1.setStyleSheet("color: white");
- QVERIFY(COLOR(w1) == QColor("white"));
+ QCOMPARE(COLOR(w1), white);
qApp->setStyleSheet("");
- QVERIFY(COLOR(w1) == QColor("white"));
- QVERIFY(COLOR(spin) == APPCOLOR(spin));
- QVERIFY(COLOR(*spin.lineEdit()) == APPCOLOR(*spin.lineEdit()));
+ QCOMPARE(COLOR(w1), white);
+ QCOMPARE(COLOR(spin), APPCOLOR(spin));
+ QCOMPARE(COLOR(*spin.lineEdit()), APPCOLOR(*spin.lineEdit()));
w1.setStyleSheet("");
- QVERIFY(COLOR(w1) == APPCOLOR(w1));
+ QCOMPARE(COLOR(w1), APPCOLOR(w1));
// QCOMPARE(FONTSIZE(w1), APPFONTSIZE(w1)); //### task 244261
QCOMPARE(FONTSIZE(spin), APPFONTSIZE(spin));
//QCOMPARE(FONTSIZE(*spin.lineEdit()), APPFONTSIZE(*spin.lineEdit())); //### task 244261
@@ -224,121 +228,135 @@ void tst_QStyleSheetStyle::widgetsAfterAppStyleSheet()
void tst_QStyleSheetStyle::applicationStyleSheet()
{
+ const QColor red(Qt::red);
+ const QColor white(Qt::white);
QPushButton w1;
qApp->setStyleSheet("* { color: red; }");
- QVERIFY(COLOR(w1) == QColor("red"));
+ QCOMPARE(COLOR(w1), red);
qApp->setStyleSheet("* { color: white; }");
- QVERIFY(COLOR(w1) == QColor("white"));
+ QCOMPARE(COLOR(w1), white);
qApp->setStyleSheet("");
- QVERIFY(COLOR(w1) == APPCOLOR(w1));
+ QCOMPARE(COLOR(w1), APPCOLOR(w1));
qApp->setStyleSheet("* { color: red }");
- QVERIFY(COLOR(w1) == QColor("red"));
+ QCOMPARE(COLOR(w1), red);
}
void tst_QStyleSheetStyle::windowStyleSheet()
{
+ const QColor red(Qt::red);
+ const QColor white(Qt::white);
QPushButton w1;
qApp->setStyleSheet("");
w1.setStyleSheet("* { color: red; }");
- QVERIFY(COLOR(w1) == QColor("red"));
+ QCOMPARE(COLOR(w1), red);
w1.setStyleSheet("* { color: white; }");
- QVERIFY(COLOR(w1) == QColor("white"));
+ QCOMPARE(COLOR(w1), white);
w1.setStyleSheet("");
- QVERIFY(COLOR(w1) == APPCOLOR(w1));
+ QCOMPARE(COLOR(w1), APPCOLOR(w1));
w1.setStyleSheet("* { color: red }");
- QVERIFY(COLOR(w1) == QColor("red"));
+ QCOMPARE(COLOR(w1), red);
qApp->setStyleSheet("* { color: green }");
- QVERIFY(COLOR(w1) == QColor("red"));
+ QCOMPARE(COLOR(w1), red);
w1.setStyleSheet("");
- QVERIFY(COLOR(w1) == QColor("green"));
+ QCOMPARE(COLOR(w1), QColor("green"));
qApp->setStyleSheet("");
- QVERIFY(COLOR(w1) == APPCOLOR(w1));
+ QCOMPARE(COLOR(w1), APPCOLOR(w1));
}
void tst_QStyleSheetStyle::widgetStyleSheet()
{
+ const QColor blue(Qt::blue);
+ const QColor red(Qt::red);
+ const QColor white(Qt::white);
QPushButton w1;
QPushButton *pb = new QPushButton(&w1);
QPushButton &w2 = *pb;
qApp->setStyleSheet("");
w1.setStyleSheet("* { color: red }");
- QVERIFY(COLOR(w1) == QColor("red"));
- QVERIFY(COLOR(w2) == QColor("red"));
+ QCOMPARE(COLOR(w1), red);
+ QCOMPARE(COLOR(w2), red);
w2.setStyleSheet("* { color: white }");
- QVERIFY(COLOR(w2) == QColor("white"));
+ QCOMPARE(COLOR(w2), white);
w1.setStyleSheet("* { color: blue }");
- QVERIFY(COLOR(w1) == QColor("blue"));
- QVERIFY(COLOR(w2) == QColor("white"));
+ QCOMPARE(COLOR(w1), blue);
+ QCOMPARE(COLOR(w2), white);
w1.setStyleSheet("");
- QVERIFY(COLOR(w1) == APPCOLOR(w1));
- QVERIFY(COLOR(w2) == QColor("white"));
+ QCOMPARE(COLOR(w1), APPCOLOR(w1));
+ QCOMPARE(COLOR(w2), white);
w2.setStyleSheet("");
- QVERIFY(COLOR(w1) == APPCOLOR(w1));
- QVERIFY(COLOR(w2) == APPCOLOR(w2));
+ QCOMPARE(COLOR(w1), APPCOLOR(w1));
+ QCOMPARE(COLOR(w2), APPCOLOR(w2));
}
void tst_QStyleSheetStyle::reparentWithNoChildStyleSheet()
{
+ const QColor blue(Qt::blue);
+ const QColor red(Qt::red);
+ const QColor white(Qt::white);
QPushButton p1, p2;
QPushButton *pb = new QPushButton(&p1);
QPushButton &c1 = *pb; // child with no stylesheet
qApp->setStyleSheet("");
p1.setStyleSheet("* { color: red }");
- QVERIFY(COLOR(c1) == QColor("red"));
+ QCOMPARE(COLOR(c1), red);
c1.setParent(&p2);
- QVERIFY(COLOR(c1) == APPCOLOR(c1));
+ QCOMPARE(COLOR(c1), APPCOLOR(c1));
p2.setStyleSheet("* { color: white }");
- QVERIFY(COLOR(c1) == QColor("white"));
+ QCOMPARE(COLOR(c1), white);
c1.setParent(&p1);
- QVERIFY(COLOR(c1) == QColor("red"));
+ QCOMPARE(COLOR(c1), red);
qApp->setStyleSheet("* { color: blue }");
c1.setParent(0);
- QVERIFY(COLOR(c1) == QColor("blue"));
+ QCOMPARE(COLOR(c1), blue);
delete pb;
}
void tst_QStyleSheetStyle::reparentWithChildStyleSheet()
{
+ const QColor gray("gray");
+ const QColor white(Qt::white);
qApp->setStyleSheet("");
QPushButton p1, p2;
QPushButton *pb = new QPushButton(&p1);
QPushButton &c1 = *pb;
c1.setStyleSheet("background: gray");
- QVERIFY(BACKGROUND(c1) == QColor("gray"));
+ QCOMPARE(BACKGROUND(c1), gray);
c1.setParent(&p2);
- QVERIFY(BACKGROUND(c1) == QColor("gray"));
+ QCOMPARE(BACKGROUND(c1), gray);
qApp->setStyleSheet("* { color: white }");
c1.setParent(&p1);
- QVERIFY(BACKGROUND(c1) == QColor("gray"));
- QVERIFY(COLOR(c1) == QColor("white"));
+ QCOMPARE(BACKGROUND(c1), gray);
+ QCOMPARE(COLOR(c1), white);
}
void tst_QStyleSheetStyle::repolish()
{
+ const QColor red(Qt::red);
+ const QColor white(Qt::white);
qApp->setStyleSheet("");
QPushButton p1;
p1.setStyleSheet("color: red; background: white");
- QVERIFY(BACKGROUND(p1) == QColor("white"));
+ QCOMPARE(BACKGROUND(p1), white);
p1.setStyleSheet("background: white");
- QVERIFY(COLOR(p1) == APPCOLOR(p1));
+ QCOMPARE(COLOR(p1), APPCOLOR(p1));
p1.setStyleSheet("color: red");
- QVERIFY(COLOR(p1) == QColor("red"));
- QVERIFY(BACKGROUND(p1) == APPBACKGROUND(p1));
+ QCOMPARE(COLOR(p1), red);
+ QCOMPARE(BACKGROUND(p1), APPBACKGROUND(p1));
p1.setStyleSheet("");
- QVERIFY(COLOR(p1) == APPCOLOR(p1));
- QVERIFY(BACKGROUND(p1) == APPBACKGROUND(p1));
+ QCOMPARE(COLOR(p1), APPCOLOR(p1));
+ QCOMPARE(BACKGROUND(p1), APPBACKGROUND(p1));
}
void tst_QStyleSheetStyle::widgetStyle()
@@ -492,12 +510,12 @@ void tst_QStyleSheetStyle::appStyle()
QPointer<QStyle> style2 = QStyleFactory::create("Windows");
qApp->setStyle(style1);
// Basic sanity
- QVERIFY(qApp->style() == style1);
+ QCOMPARE(QApplication::style(), style1.data());
qApp->setStyle(style2);
QVERIFY(style1.isNull()); // qApp must have taken ownership and deleted it
// Setting null should not crash
qApp->setStyle(0);
- QVERIFY(qApp->style() == style2);
+ QCOMPARE(QApplication::style(), style2.data());
// Set the stylesheet
qApp->setStyleSheet("whatever");
@@ -505,7 +523,7 @@ void tst_QStyleSheetStyle::appStyle()
QVERIFY(!sss.isNull());
QCOMPARE(sss->metaObject()->className(), "QStyleSheetStyle"); // must be our proxy now
QVERIFY(!style2.isNull()); // this should exist as it is the base of the proxy
- QVERIFY(sss->baseStyle() == style2);
+ QCOMPARE(sss->baseStyle(), style2.data());
style1 = QStyleFactory::create("Windows");
qApp->setStyle(style1);
QVERIFY(style2.isNull()); // should disappear automatically
@@ -514,16 +532,16 @@ void tst_QStyleSheetStyle::appStyle()
// Update the stylesheet and check nothing changes
sss = (QStyleSheetStyle *)qApp->style();
qApp->setStyleSheet("whatever2");
- QVERIFY(qApp->style() == sss);
- QVERIFY(sss->baseStyle() == style1);
+ QCOMPARE(QApplication::style(), sss.data());
+ QCOMPARE(sss->baseStyle(), style1.data());
// Revert the stylesheet
qApp->setStyleSheet("");
QVERIFY(sss.isNull()); // should have disappeared
- QVERIFY(qApp->style() == style1);
+ QCOMPARE(QApplication::style(), style1.data());
qApp->setStyleSheet("");
- QVERIFY(qApp->style() == style1);
+ QCOMPARE(QApplication::style(), style1.data());
}
void tst_QStyleSheetStyle::dynamicProperty()
@@ -589,21 +607,24 @@ namespace ns {
void tst_QStyleSheetStyle::namespaces()
{
+ const QColor blue(Qt::blue);
+ const QColor red(Qt::red);
+ const QColor white(Qt::white);
ns::PushButton1 pb1;
qApp->setStyleSheet("ns--PushButton1 { background: white }");
- QVERIFY(BACKGROUND(pb1) == QColor("white"));
+ QCOMPARE(BACKGROUND(pb1), white);
qApp->setStyleSheet(".ns--PushButton1 { background: red }");
- QVERIFY(BACKGROUND(pb1) == QColor("red"));
+ QCOMPARE(BACKGROUND(pb1), red);
ns::PushButton2 pb2;
qApp->setStyleSheet("ns--PushButton1 { background: blue}");
- QVERIFY(BACKGROUND(pb2) == QColor("blue"));
+ QCOMPARE(BACKGROUND(pb2), blue);
qApp->setStyleSheet("ns--PushButton2 { background: magenta }");
- QVERIFY(BACKGROUND(pb2) == QColor("magenta"));
+ QCOMPARE(BACKGROUND(pb2), QColor(Qt::magenta));
qApp->setStyleSheet(".PushButtonTwo { background: white; }");
- QVERIFY(BACKGROUND(pb2) == QColor("white"));
+ QCOMPARE(BACKGROUND(pb2), white);
qApp->setStyleSheet(".PushButtonDuo { background: red; }");
- QVERIFY(BACKGROUND(pb2) == QColor("red"));
+ QCOMPARE(BACKGROUND(pb2), red);
}
void tst_QStyleSheetStyle::palettePropagation()
@@ -639,8 +660,8 @@ void tst_QStyleSheetStyle::fontPropagation()
int viewFontSize = FONTSIZE(*popup);
cb.setStyleSheet("QComboBox { font-size: 20pt; }");
- QVERIFY(FONTSIZE(cb) == 20);
- QVERIFY(FONTSIZE(*popup) == viewFontSize);
+ QCOMPARE(FONTSIZE(cb), 20);
+ QCOMPARE(FONTSIZE(*popup), viewFontSize);
QGroupBox gb;
QPushButton *push = new QPushButton(&gb);
QPushButton &pb = *push;
@@ -648,25 +669,25 @@ void tst_QStyleSheetStyle::fontPropagation()
int gbFontSize = FONTSIZE(gb);
gb.setStyleSheet("QGroupBox { font-size: 20pt }");
- QVERIFY(FONTSIZE(gb) == 20);
+ QCOMPARE(FONTSIZE(gb), 20);
QVERIFY(FONTSIZE(pb) == buttonFontSize); // font does not propagate
gb.setStyleSheet("QGroupBox * { font-size: 20pt; }");
- QVERIFY(FONTSIZE(gb) == gbFontSize);
- QVERIFY(FONTSIZE(pb) == 20);
+ QCOMPARE(FONTSIZE(gb), gbFontSize);
+ QCOMPARE(FONTSIZE(pb), 20);
QWidget window;
window.setStyleSheet("* { font-size: 10pt }");
pb.setParent(&window);
QCOMPARE(FONTSIZE(pb), 10);
window.setStyleSheet("");
- QVERIFY(FONTSIZE(pb) == buttonFontSize);
+ QCOMPARE(FONTSIZE(pb), buttonFontSize);
QTabWidget tw;
tw.setStyleSheet("QTabWidget { font-size: 20pt; }");
- QVERIFY(FONTSIZE(tw) == 20);
+ QCOMPARE(FONTSIZE(tw), 20);
QWidget *child = tw.findChild<QWidget *>("qt_tabwidget_tabbar");
QVERIFY2(child, "QTabWidget did not contain a widget named \"qt_tabwidget_tabbar\"");
- QVERIFY(FONTSIZE(*child) == 20);
+ QCOMPARE(FONTSIZE(*child), 20);
}
void tst_QStyleSheetStyle::onWidgetDestroyed()
@@ -1009,6 +1030,8 @@ void tst_QStyleSheetStyle::tabAlignement()
void tst_QStyleSheetStyle::attributesList()
{
+ const QColor blue(Qt::blue);
+ const QColor red(Qt::red);
QWidget w;
QPushButton *p1=new QPushButton(&w);
QPushButton *p2=new QPushButton(&w);
@@ -1019,10 +1042,10 @@ void tst_QStyleSheetStyle::attributesList()
p3->setProperty("prop", QStringList() << "foo" << "bar");
w.setStyleSheet(" QPushButton{ background-color:blue; } QPushButton[prop~=red] { background-color:red; }");
- QCOMPARE(BACKGROUND(*p1) , QColor("red"));
- QCOMPARE(BACKGROUND(*p2) , QColor("red"));
- QCOMPARE(BACKGROUND(*p3) , QColor("blue"));
- QCOMPARE(BACKGROUND(*p4) , QColor("blue"));
+ QCOMPARE(BACKGROUND(*p1) , red);
+ QCOMPARE(BACKGROUND(*p2) , red);
+ QCOMPARE(BACKGROUND(*p3) , blue);
+ QCOMPARE(BACKGROUND(*p4) , blue);
}
void tst_QStyleSheetStyle::minmaxSizes()
@@ -1065,6 +1088,7 @@ void tst_QStyleSheetStyle::minmaxSizes()
void tst_QStyleSheetStyle::task206238_twice()
{
+ const QColor red(Qt::red);
QMainWindow w;
QTabWidget* tw = new QTabWidget;
tw->addTab(new QLabel("foo"), "test");
@@ -1073,12 +1097,12 @@ void tst_QStyleSheetStyle::task206238_twice()
centerOnScreen(&w);
w.show();
QTest::qWait(20);
- QCOMPARE(BACKGROUND(w) , QColor("red"));
- QCOMPARE(BACKGROUND(*tw), QColor("red"));
+ QCOMPARE(BACKGROUND(w) , red);
+ QCOMPARE(BACKGROUND(*tw), red);
w.setStyleSheet("background: red;");
QTest::qWait(20);
- QCOMPARE(BACKGROUND(w) , QColor("red"));
- QCOMPARE(BACKGROUND(*tw), QColor("red"));
+ QCOMPARE(BACKGROUND(w) , red);
+ QCOMPARE(BACKGROUND(*tw), red);
}
void tst_QStyleSheetStyle::transparent()
@@ -1277,9 +1301,9 @@ void tst_QStyleSheetStyle::proxyStyle()
QTest::qWait(100);
// Test for QTBUG-7198 - style sheet overrides custom element size
- QStyleOptionViewItemV4 opt;
+ QStyleOptionViewItem opt;
opt.initFrom(w);
- opt.features |= QStyleOptionViewItemV2::HasCheckIndicator;
+ opt.features |= QStyleOptionViewItem::HasCheckIndicator;
QVERIFY(pb5->style()->subElementRect(QStyle::SE_ItemViewItemCheckIndicator,
&opt, pb5).width() == 3);
delete w;
diff --git a/tests/auto/widgets/util/qcompleter/BLACKLIST b/tests/auto/widgets/util/qcompleter/BLACKLIST
index ffbcc94a1f..fdc424b6ac 100644
--- a/tests/auto/widgets/util/qcompleter/BLACKLIST
+++ b/tests/auto/widgets/util/qcompleter/BLACKLIST
@@ -1,2 +1,2 @@
[QTBUG_14292_filesystem]
-ubuntu-14.04
+linux
diff --git a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
index dbfeda8104..e8ac9aa5d2 100644
--- a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
+++ b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
@@ -1043,9 +1043,9 @@ void tst_QCompleter::setters()
QAbstractItemModel *oldModel = completer->model();
completer->setModel(dirModel);
QVERIFY(completer->popup()->model() != oldModel);
- QVERIFY(completer->popup()->model() == completer->completionModel());
+ QCOMPARE(completer->popup()->model(), completer->completionModel());
completer->setPopup(new QListView);
- QVERIFY(completer->popup()->model() == completer->completionModel());
+ QCOMPARE(completer->popup()->model(), completer->completionModel());
completer->setModel(new QStringListModel(completer));
QVERIFY(dirModel == 0); // must have been deleted
@@ -1062,7 +1062,7 @@ void tst_QCompleter::modelDeletion()
QStringListModel *listModel = new QStringListModel(list);
completer->setCompletionPrefix("i");
completer->setModel(listModel);
- QVERIFY(completer->completionCount() == 3);
+ QCOMPARE(completer->completionCount(), 3);
QScopedPointer<QListView> view(new QListView);
view->setModel(completer->completionModel());
delete listModel;
@@ -1070,8 +1070,8 @@ void tst_QCompleter::modelDeletion()
view->show();
qApp->processEvents();
view.reset();
- QVERIFY(completer->completionCount() == 0);
- QVERIFY(completer->currentRow() == -1);
+ QCOMPARE(completer->completionCount(), 0);
+ QCOMPARE(completer->currentRow(), -1);
}
void tst_QCompleter::multipleWidgets()
@@ -1098,7 +1098,7 @@ void tst_QCompleter::multipleWidgets()
window.activateWindow();
QApplication::setActiveWindow(&window);
QTest::qWait(50);
- QTRY_VERIFY(qApp->focusWidget() == comboBox);
+ QTRY_COMPARE(QApplication::focusWidget(), comboBox);
comboBox->lineEdit()->setText("it");
QCOMPARE(comboBox->currentText(), QString("it")); // should not complete with setText
QTest::keyPress(comboBox, 'e');
@@ -1111,7 +1111,7 @@ void tst_QCompleter::multipleWidgets()
lineEdit->show();
lineEdit->setFocus();
QTest::qWait(50);
- QTRY_VERIFY(qApp->focusWidget() == lineEdit);
+ QTRY_COMPARE(QApplication::focusWidget(), lineEdit);
lineEdit->setText("it");
QCOMPARE(lineEdit->text(), QString("it")); // should not completer with setText
QCOMPARE(comboBox->currentText(), QString("")); // combo box text must not change!
@@ -1148,13 +1148,13 @@ void tst_QCompleter::focusIn()
lineEdit2->show();
comboBox->setFocus();
- QTRY_VERIFY(completer.widget() == comboBox);
+ QTRY_COMPARE(completer.widget(), comboBox);
lineEdit->setFocus();
- QTRY_VERIFY(completer.widget() == lineEdit);
+ QTRY_COMPARE(completer.widget(), lineEdit);
comboBox->setFocus();
- QTRY_VERIFY(completer.widget() == comboBox);
+ QTRY_COMPARE(completer.widget(), comboBox);
lineEdit2->setFocus();
- QTRY_VERIFY(completer.widget() == comboBox);
+ QTRY_COMPARE(completer.widget(), comboBox);
}
void tst_QCompleter::dynamicSortOrder()
diff --git a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
index d2e88a1656..58a655321c 100644
--- a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
+++ b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
@@ -297,7 +297,7 @@ void tst_QScroller::staticScrollers()
QScrollerProperties sp2 = QScroller::scroller(o2)->scrollerProperties();
// default properties should be the same
- QVERIFY(sp1 == sp2);
+ QCOMPARE(sp1, sp2);
QCOMPARE(QScroller::scroller(o1)->scrollerProperties(), sp1);
diff --git a/tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp b/tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp
index 7ea63911ae..05511a17a1 100644
--- a/tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp
+++ b/tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp
@@ -136,7 +136,7 @@ void tst_QSystemTrayIcon::lastWindowClosed()
QTimer::singleShot(2500, &window, SLOT(close()));
QTimer::singleShot(20000, qApp, SLOT(quit())); // in case the test fails
qApp->exec();
- QVERIFY(spy.count() == 1);
+ QCOMPARE(spy.count(), 1);
}
QTEST_MAIN(tst_QSystemTrayIcon)
diff --git a/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp b/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp
index 781adeedad..9f03e9b3a0 100644
--- a/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp
+++ b/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp
@@ -36,7 +36,22 @@
#include <QAction>
// Temporarily disabling IRIX due to build issuues with GCC
-#if !defined(__sgi) || defined(__sgi) && !defined(__GNUC__)
+#if defined(__sgi) && defined(__GNUC__)
+
+class tst_QUndoGroup : public QObject
+{
+ Q_OBJECT
+public:
+ tst_QUndoGroup() {}
+
+private slots:
+ void setActive() { QSKIP( "Not tested on irix-g++"); }
+ void addRemoveStack() { QSKIP( "Not tested on irix-g++"); }
+ void deleteStack() { QSKIP( "Not tested on irix-g++"); }
+ void checkSignals() { QSKIP( "Not tested on irix-g++"); }
+ void addStackAndDie() { QSKIP( "Not tested on irix-g++"); }
+};
+#else
/******************************************************************************
** Commands
@@ -645,22 +660,7 @@ void tst_QUndoGroup::commandTextFormat()
qApp->removeTranslator(&translator);
#endif
}
-
-#else
-class tst_QUndoGroup : public QObject
-{
- Q_OBJECT
-public:
- tst_QUndoGroup() {}
-
-private slots:
- void setActive() { QSKIP( "Not tested on irix-g++"); }
- void addRemoveStack() { QSKIP( "Not tested on irix-g++"); }
- void deleteStack() { QSKIP( "Not tested on irix-g++"); }
- void checkSignals() { QSKIP( "Not tested on irix-g++"); }
- void addStackAndDie() { QSKIP( "Not tested on irix-g++"); }
-};
-#endif
+#endif // !(SGI && GCC)
QTEST_MAIN(tst_QUndoGroup)
diff --git a/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp b/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp
index a633ba0cf0..43d6912c6e 100644
--- a/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp
+++ b/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp
@@ -283,9 +283,9 @@ void tst_QAbstractButton::setAutoRepeat()
QTest::qWait(REPEAT_DELAY);
QVERIFY(testWidget->isDown());
QTest::keyRelease(testWidget, Qt::Key_Space);
- QVERIFY(release_count == press_count);
- QVERIFY(toggle_count == 0);
- QVERIFY(press_count == click_count);
+ QCOMPARE(release_count, press_count);
+ QCOMPARE(toggle_count, uint(0));
+ QCOMPARE(press_count, click_count);
QVERIFY(click_count > 1);
break;
case 4:
diff --git a/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp b/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp
index df69063540..5dec6224ca 100644
--- a/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp
+++ b/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp
@@ -324,13 +324,13 @@ void tst_QButtonGroup::testSignals()
int expectedId = -2;
- QVERIFY(clickedIdSpy.takeFirst().at(0).toInt() == expectedId);
+ QCOMPARE(clickedIdSpy.takeFirst().at(0).toInt(), expectedId);
QCOMPARE(pressedSpy.count(), 1);
QCOMPARE(pressedIdSpy.count(), 1);
- QVERIFY(pressedIdSpy.takeFirst().at(0).toInt() == expectedId);
+ QCOMPARE(pressedIdSpy.takeFirst().at(0).toInt(), expectedId);
QCOMPARE(releasedSpy.count(), 1);
QCOMPARE(releasedIdSpy.count(), 1);
- QVERIFY(releasedIdSpy.takeFirst().at(0).toInt() == expectedId);
+ QCOMPARE(releasedIdSpy.takeFirst().at(0).toInt(), expectedId);
clickedSpy.clear();
clickedIdSpy.clear();
@@ -344,13 +344,13 @@ void tst_QButtonGroup::testSignals()
QCOMPARE(clickedSpy.count(), 1);
QCOMPARE(clickedIdSpy.count(), 1);
- QVERIFY(clickedIdSpy.takeFirst().at(0).toInt() == 23);
+ QCOMPARE(clickedIdSpy.takeFirst().at(0).toInt(), 23);
QCOMPARE(pressedSpy.count(), 1);
QCOMPARE(pressedIdSpy.count(), 1);
- QVERIFY(pressedIdSpy.takeFirst().at(0).toInt() == 23);
+ QCOMPARE(pressedIdSpy.takeFirst().at(0).toInt(), 23);
QCOMPARE(releasedSpy.count(), 1);
QCOMPARE(releasedIdSpy.count(), 1);
- QVERIFY(releasedIdSpy.takeFirst().at(0).toInt() == 23);
+ QCOMPARE(releasedIdSpy.takeFirst().at(0).toInt(), 23);
QSignalSpy toggledSpy(&buttons, SIGNAL(buttonToggled(QAbstractButton*, bool)));
@@ -427,25 +427,25 @@ void tst_QButtonGroup::checkedButton()
buttons.addButton(&pb1);
buttons.addButton(&pb2, 23);
- QVERIFY(buttons.checkedButton() == 0);
+ QVERIFY(!buttons.checkedButton());
pb1.setChecked(true);
- QVERIFY(buttons.checkedButton() == &pb1);
+ QCOMPARE(buttons.checkedButton(), &pb1);
pb2.setChecked(true);
- QVERIFY(buttons.checkedButton() == &pb2);
+ QCOMPARE(buttons.checkedButton(), &pb2);
pb2.setChecked(false);
- QVERIFY(buttons.checkedButton() == &pb1);
+ QCOMPARE(buttons.checkedButton(), &pb1);
pb1.setChecked(false);
- QVERIFY(buttons.checkedButton() == 0);
+ QVERIFY(!buttons.checkedButton());
buttons.setExclusive(true);
- QVERIFY(buttons.checkedButton() == 0);
+ QVERIFY(!buttons.checkedButton());
pb1.setChecked(true);
- QVERIFY(buttons.checkedButton() == &pb1);
+ QCOMPARE(buttons.checkedButton(), &pb1);
pb2.setChecked(true);
- QVERIFY(buttons.checkedButton() == &pb2);
+ QCOMPARE(buttons.checkedButton(), &pb2);
// checked button cannot be unchecked
pb2.setChecked(false);
- QVERIFY(buttons.checkedButton() == &pb2);
+ QCOMPARE(buttons.checkedButton(), &pb2);
}
class task209485_ButtonDeleter : public QObject
@@ -523,9 +523,9 @@ void tst_QButtonGroup::autoIncrementId()
radio1->setChecked(true);
- QVERIFY(buttons->id(radio1) == -2);
- QVERIFY(buttons->id(radio2) == -3);
- QVERIFY(buttons->id(radio3) == -4);
+ QCOMPARE(buttons->id(radio1), -2);
+ QCOMPARE(buttons->id(radio2), -3);
+ QCOMPARE(buttons->id(radio3), -4);
dlg.show();
}
diff --git a/tests/auto/widgets/widgets/qcheckbox/tst_qcheckbox.cpp b/tests/auto/widgets/widgets/qcheckbox/tst_qcheckbox.cpp
index e76e11fc67..5696382fab 100644
--- a/tests/auto/widgets/widgets/qcheckbox/tst_qcheckbox.cpp
+++ b/tests/auto/widgets/widgets/qcheckbox/tst_qcheckbox.cpp
@@ -83,9 +83,7 @@ private:
uint press_count;
uint release_count;
int cur_state;
- uint tmp;
QCheckBox *testWidget;
- uint tmp2;
};
tst_QCheckBox::tst_QCheckBox()
@@ -326,7 +324,7 @@ void tst_QCheckBox::isToggleButton()
void tst_QCheckBox::foregroundRole()
{
- QVERIFY(testWidget->foregroundRole() == QPalette::WindowText);
+ QCOMPARE(testWidget->foregroundRole(), QPalette::WindowText);
}
void tst_QCheckBox::minimumSizeHint()
diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
index 00636e50a8..ae516639a6 100644
--- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
@@ -164,6 +164,7 @@ private slots:
void keyboardSelection();
void setCustomModelAndView();
void updateDelegateOnEditableChange();
+ void respectChangedOwnershipOfItemView();
void task_QTBUG_39088_inputMethodHints();
void task_QTBUG_49831_scrollerNotActivated();
};
@@ -454,7 +455,7 @@ void tst_QComboBox::setPalette()
for (int i = 0; i < comboChildren.size(); ++i) {
QObject *o = comboChildren.at(i);
if (o->isWidgetType()) {
- QVERIFY(((QWidget*)o)->palette() == pal);
+ QCOMPARE(((QWidget*)o)->palette(), pal);
}
}
@@ -463,12 +464,12 @@ void tst_QComboBox::setPalette()
//Setting it on the lineedit should be separate form the combo
testWidget->lineEdit()->setPalette(pal);
QVERIFY(testWidget->palette() != pal);
- QVERIFY(testWidget->lineEdit()->palette() == pal);
+ QCOMPARE(testWidget->lineEdit()->palette(), pal);
pal.setColor(QPalette::Base, Qt::green);
//Setting it on the combo directly should override lineedit
testWidget->setPalette(pal);
- QVERIFY(testWidget->palette() == pal);
- QVERIFY(testWidget->lineEdit()->palette() == pal);
+ QCOMPARE(testWidget->palette(), pal);
+ QCOMPARE(testWidget->lineEdit()->palette(), pal);
}
void tst_QComboBox::sizeAdjustPolicy()
@@ -479,7 +480,7 @@ void tst_QComboBox::sizeAdjustPolicy()
QComboBox *testWidget = topLevel.comboBox();
// test that adding new items will not change the sizehint for AdjustToContentsOnFirstShow
QVERIFY(!testWidget->count());
- QVERIFY(testWidget->sizeAdjustPolicy() == QComboBox::AdjustToContentsOnFirstShow);
+ QCOMPARE(testWidget->sizeAdjustPolicy(), QComboBox::AdjustToContentsOnFirstShow);
QVERIFY(testWidget->isVisible());
QSize firstShow = testWidget->sizeHint();
testWidget->addItem("normal item");
@@ -752,7 +753,7 @@ void tst_QComboBox::insertPolicy()
// First check that there is the right number of entries, or
// we may unwittingly pass
- QVERIFY((int)result.count() == testWidget->count());
+ QCOMPARE((int)result.count(), testWidget->count());
// No need to compare if there are no strings to compare
if (result.count() > 0) {
@@ -797,7 +798,7 @@ void tst_QComboBox::virtualAutocompletion()
QApplication::sendEvent(testWidget, &kr1);
qApp->processEvents(); // Process events to trigger autocompletion
- QTRY_VERIFY(testWidget->currentIndex() == 1);
+ QTRY_COMPARE(testWidget->currentIndex(), 1);
QKeyEvent kp2(QEvent::KeyPress, Qt::Key_O, 0, "o");
QKeyEvent kr2(QEvent::KeyRelease, Qt::Key_O, 0, "o");
@@ -846,7 +847,7 @@ void tst_QComboBox::autoCompletionCaseSensitivity()
testWidget->clearEditText();
QSignalSpy spyReturn(testWidget, SIGNAL(activated(int)));
testWidget->setAutoCompletionCaseSensitivity(Qt::CaseInsensitive);
- QVERIFY(testWidget->autoCompletionCaseSensitivity() == Qt::CaseInsensitive);
+ QCOMPARE(testWidget->autoCompletionCaseSensitivity(), Qt::CaseInsensitive);
QTest::keyClick(testWidget->lineEdit(), Qt::Key_A);
qApp->processEvents();
@@ -880,7 +881,7 @@ void tst_QComboBox::autoCompletionCaseSensitivity()
// case sensitive
testWidget->clearEditText();
testWidget->setAutoCompletionCaseSensitivity(Qt::CaseSensitive);
- QVERIFY(testWidget->autoCompletionCaseSensitivity() == Qt::CaseSensitive);
+ QCOMPARE(testWidget->autoCompletionCaseSensitivity(), Qt::CaseSensitive);
QTest::keyClick(testWidget->lineEdit(), Qt::Key_A);
qApp->processEvents();
QCOMPARE(testWidget->currentText(), QString("aww"));
@@ -1378,7 +1379,7 @@ void tst_QComboBox::textpixmapdata()
QCOMPARE(icon.cacheKey(), icons.at(i).cacheKey());
QPixmap original = icons.at(i).pixmap(1024);
QPixmap pixmap = icon.pixmap(1024);
- QVERIFY(pixmap.toImage() == original.toImage());
+ QCOMPARE(pixmap.toImage(), original.toImage());
}
for (int i = 0; i<text.count(); ++i) {
@@ -1612,7 +1613,7 @@ void tst_QComboBox::setModel()
QCOMPARE(box.currentIndex(), 0);
QVERIFY(box.model() != oldModel);
QVERIFY(box.rootModelIndex() != rootModelIndex);
- QVERIFY(box.rootModelIndex() == QModelIndex());
+ QCOMPARE(box.rootModelIndex(), QModelIndex());
// check that setting the very same model doesn't move the current item
box.setCurrentIndex(1);
@@ -3185,6 +3186,27 @@ void tst_QComboBox::task_QTBUG_39088_inputMethodHints()
QCOMPARE(box.lineEdit()->inputMethodHints(), Qt::ImhNoPredictiveText);
}
+void tst_QComboBox::respectChangedOwnershipOfItemView()
+{
+ QComboBox box1;
+ QComboBox box2;
+ QTableView *v1 = new QTableView;
+ box1.setView(v1);
+
+ QSignalSpy spy1(v1, SIGNAL(destroyed()));
+ box2.setView(v1); // Ownership should now be transferred to box2
+
+
+ QTableView *v2 = new QTableView(&box1);
+ box1.setView(v2); // Here we do not expect v1 to be deleted
+ QApplication::processEvents();
+ QCOMPARE(spy1.count(), 0);
+
+ QSignalSpy spy2(v2, SIGNAL(destroyed()));
+ box1.setView(v1);
+ QCOMPARE(spy2.count(), 1);
+}
+
void tst_QComboBox::task_QTBUG_49831_scrollerNotActivated()
{
QStringList modelData;
diff --git a/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp b/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp
index d8cb7c01ad..a57553097a 100644
--- a/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp
+++ b/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp
@@ -98,11 +98,11 @@ void tst_QCommandLinkButton::getSetCheck()
QString text("mytext");
QVERIFY(obj1.description().isEmpty());
obj1.setDescription(text);
- QVERIFY(obj1.description() == text);
+ QCOMPARE(obj1.description(), text);
QVERIFY(obj1.text().isEmpty());
obj1.setText(text);
- QVERIFY(obj1.text() == text);
+ QCOMPARE(obj1.text(), text);
QMenu *var1 = new QMenu;
obj1.setMenu(var1);
@@ -236,8 +236,8 @@ void tst_QCommandLinkButton::setAutoRepeat()
QVERIFY( testWidget->isDown() );
QVERIFY( toggle_count == 0 );
QTest::keyRelease( testWidget, Qt::Key_Space );
- QVERIFY(press_count == release_count);
- QVERIFY(release_count == click_count);
+ QCOMPARE(press_count, release_count);
+ QCOMPARE(release_count, click_count);
QVERIFY(press_count > 1);
// #### shouldn't I check here to see if multiple signals have been fired???
diff --git a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
index c9ae60dd76..d41398046f 100644
--- a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
+++ b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
@@ -285,6 +285,7 @@ typedef QList<Qt::Key> KeyList;
void tst_QDateTimeEdit::getSetCheck()
{
QDateTimeEdit obj1;
+ QCOMPARE(obj1.inputMethodQuery(Qt::ImHints), QVariant(int(Qt::ImhPreferNumbers)));
obj1.setDisplayFormat("dd/MM/yyyy hh:mm:ss.zzz d/M/yy h:m:s.z AP");
// Section QDateTimeEdit::currentSection()
// void QDateTimeEdit::setCurrentSection(Section)
@@ -306,6 +307,11 @@ void tst_QDateTimeEdit::getSetCheck()
QCOMPARE(QDateTimeEdit::MonthSection, obj1.currentSection());
obj1.setCurrentSection(QDateTimeEdit::YearSection);
QCOMPARE(QDateTimeEdit::YearSection, obj1.currentSection());
+
+ QDateEdit dateEdit;
+ QCOMPARE(dateEdit.inputMethodQuery(Qt::ImHints), QVariant(int(Qt::ImhPreferNumbers)));
+ QTimeEdit timeEdit;
+ QCOMPARE(timeEdit.inputMethodQuery(Qt::ImHints), QVariant(int(Qt::ImhPreferNumbers)));
}
tst_QDateTimeEdit::tst_QDateTimeEdit()
@@ -2416,7 +2422,7 @@ void tst_QDateTimeEdit::displayedSections()
QFETCH(uint, section);
testWidget->setDisplayFormat(format);
- QVERIFY((QDateTimeEdit::Section)section == testWidget->displayedSections());
+ QCOMPARE(QDateTimeEdit::Sections(section), testWidget->displayedSections());
}
void tst_QDateTimeEdit::currentSection_data()
@@ -2460,7 +2466,7 @@ void tst_QDateTimeEdit::currentSection()
if ((QDateTimeEdit::Section)section == QDateTimeEdit::NoSection)
testWidget->setCurrentSection(QDateTimeEdit::YearSection); // Ensure it's not reset (see above)
testWidget->setCurrentSection((QDateTimeEdit::Section)section);
- QVERIFY((QDateTimeEdit::Section)currentSection == testWidget->currentSection());
+ QCOMPARE((QDateTimeEdit::Section)currentSection, testWidget->currentSection());
}
void tst_QDateTimeEdit::readOnly()
@@ -2825,7 +2831,7 @@ void tst_QDateTimeEdit::calendarPopup()
rect = style->subControlRect(QStyle::CC_ComboBox, &opt, QStyle::SC_ComboBoxArrow, &timeEdit);
QTest::mouseClick(&timeEdit, Qt::LeftButton, 0, QPoint(rect.left()+rect.width()/2, rect.top()+rect.height()/2));
QWidget *wid2 = timeEdit.findChild<QWidget *>("qt_datetimedit_calendar");
- QVERIFY(wid2 == 0);
+ QVERIFY(!wid2);
timeEdit.hide();
@@ -2839,7 +2845,7 @@ void tst_QDateTimeEdit::calendarPopup()
rect = style->subControlRect(QStyle::CC_ComboBox, &opt, QStyle::SC_ComboBoxArrow, &dateEdit);
QTest::mouseClick(&dateEdit, Qt::LeftButton, 0, QPoint(rect.left()+rect.width()/2, rect.top()+rect.height()/2));
QWidget *wid3 = dateEdit.findChild<QWidget *>("qt_datetimedit_calendar");
- QVERIFY(wid3 == 0);
+ QVERIFY(!wid3);
dateEdit.hide();
}
diff --git a/tests/auto/widgets/widgets/qdialogbuttonbox/tst_qdialogbuttonbox.cpp b/tests/auto/widgets/widgets/qdialogbuttonbox/tst_qdialogbuttonbox.cpp
index 38b473e5ae..32412afcd5 100644
--- a/tests/auto/widgets/widgets/qdialogbuttonbox/tst_qdialogbuttonbox.cpp
+++ b/tests/auto/widgets/widgets/qdialogbuttonbox/tst_qdialogbuttonbox.cpp
@@ -132,12 +132,12 @@ void tst_QDialogButtonBox::layoutReuse()
QDialogButtonBox *box = new QDialogButtonBox(QDialogButtonBox::Ok);
QPointer<QLayout> layout = box->layout();
box->setCenterButtons(!box->centerButtons());
- QVERIFY(layout == box->layout());
+ QCOMPARE(layout.data(), box->layout());
QEvent event(QEvent::StyleChange);
QApplication::sendEvent(box, &event);
- QVERIFY(layout == box->layout());
+ QCOMPARE(layout.data(), box->layout());
box->setOrientation(box->orientation() == Qt::Horizontal ? Qt::Vertical : Qt::Horizontal);
- QVERIFY(layout == 0);
+ QVERIFY(layout.isNull());
QVERIFY(layout != box->layout());
delete box;
}
diff --git a/tests/auto/widgets/widgets/qdockwidget/BLACKLIST b/tests/auto/widgets/widgets/qdockwidget/BLACKLIST
new file mode 100644
index 0000000000..60adfb9f4b
--- /dev/null
+++ b/tests/auto/widgets/widgets/qdockwidget/BLACKLIST
@@ -0,0 +1,2 @@
+[restoreDockWidget]
+ubuntu-14.04
diff --git a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
index 2bbc2e05b7..713dc6b9b8 100644
--- a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
+++ b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
@@ -40,6 +40,7 @@
#include <qdockwidget.h>
#include <qmainwindow.h>
#include <qlineedit.h>
+#include <qtabbar.h>
#include <QDesktopWidget>
#include <QtGui/QPainter>
#include "private/qdockwidget_p.h"
@@ -68,6 +69,7 @@ private slots:
void allowedAreas();
void toggleViewAction();
void visibilityChanged();
+ void updateTabBarOnVisibilityChanged();
void dockLocationChanged();
void setTitleBarWidget();
void titleBarDoubleClick();
@@ -120,7 +122,7 @@ void tst_QDockWidget::widget()
{
{
QDockWidget dw;
- QVERIFY(dw.widget() == 0);
+ QVERIFY(!dw.widget());
}
{
@@ -130,32 +132,32 @@ void tst_QDockWidget::widget()
dw.setWidget(w1);
QVERIFY(dw.widget() != 0);
- QVERIFY(dw.widget() == w1);
+ QCOMPARE(dw.widget(), w1);
QCOMPARE(w1->parentWidget(), (QWidget*)&dw);
dw.setWidget(0);
- QVERIFY(dw.widget() == 0);
+ QVERIFY(!dw.widget());
dw.setWidget(w2);
QVERIFY(dw.widget() != 0);
- QVERIFY(dw.widget() == w2);
+ QCOMPARE(dw.widget(), w2);
QCOMPARE(w2->parentWidget(), (QWidget*)&dw);
dw.setWidget(0);
- QVERIFY(dw.widget() == 0);
+ QVERIFY(!dw.widget());
dw.setWidget(w1);
QVERIFY(dw.widget() != 0);
- QVERIFY(dw.widget() == w1);
+ QCOMPARE(dw.widget(), w1);
QCOMPARE(w1->parentWidget(), (QWidget*)&dw);
dw.setWidget(w2);
QVERIFY(dw.widget() != 0);
- QVERIFY(dw.widget() == w2);
+ QCOMPARE(dw.widget(), w2);
QCOMPARE(w2->parentWidget(), (QWidget*)&dw);
dw.setWidget(0);
- QVERIFY(dw.widget() == 0);
+ QVERIFY(!dw.widget());
}
{
@@ -165,37 +167,37 @@ void tst_QDockWidget::widget()
dw.setWidget(w1);
QVERIFY(dw.widget() != 0);
- QVERIFY(dw.widget() == w1);
+ QCOMPARE(dw.widget(), w1);
QCOMPARE(w1->parentWidget(), (QWidget*)&dw);
w1->setParent(0);
- QVERIFY(dw.widget() == 0);
+ QVERIFY(!dw.widget());
dw.setWidget(w2);
QVERIFY(dw.widget() != 0);
- QVERIFY(dw.widget() == w2);
+ QCOMPARE(dw.widget(), w2);
QCOMPARE(w2->parentWidget(), (QWidget*)&dw);
w2->setParent(0);
- QVERIFY(dw.widget() == 0);
+ QVERIFY(!dw.widget());
dw.setWidget(w1);
QVERIFY(dw.widget() != 0);
- QVERIFY(dw.widget() == w1);
+ QCOMPARE(dw.widget(), w1);
QCOMPARE(w1->parentWidget(), (QWidget*)&dw);
dw.setWidget(w2);
QVERIFY(dw.widget() != 0);
- QVERIFY(dw.widget() == w2);
+ QCOMPARE(dw.widget(), w2);
QCOMPARE(w2->parentWidget(), (QWidget*)&dw);
w1->setParent(0);
QVERIFY(dw.widget() != 0);
- QVERIFY(dw.widget() == w2);
+ QCOMPARE(dw.widget(), w2);
QCOMPARE(w2->parentWidget(), (QWidget*)&dw);
w2->setParent(0);
- QVERIFY(dw.widget() == 0);
+ QVERIFY(!dw.widget());
delete w1;
delete w2;
}
@@ -586,6 +588,44 @@ void tst_QDockWidget::visibilityChanged()
QCOMPARE(spy.at(0).at(0).toBool(), true);
}
+void tst_QDockWidget::updateTabBarOnVisibilityChanged()
+{
+ // QTBUG49045: Populate tabified dock area with 4 widgets, set the tab
+ // index to 2 (dw2), hide dw0, dw1 and check that the tab index is 0 (dw3).
+ QMainWindow mw;
+ mw.setMinimumSize(400, 400);
+ mw.setWindowTitle(QTest::currentTestFunction());
+ QDockWidget *dw0 = new QDockWidget("d1", &mw);
+ dw0->setAllowedAreas(Qt::LeftDockWidgetArea);
+ mw.addDockWidget(Qt::LeftDockWidgetArea, dw0);
+ QDockWidget *dw1 = new QDockWidget("d2", &mw);
+ dw1->setAllowedAreas(Qt::LeftDockWidgetArea);
+ mw.addDockWidget(Qt::LeftDockWidgetArea, dw1);
+ QDockWidget *dw2 = new QDockWidget("d3", &mw);
+ dw2->setAllowedAreas(Qt::LeftDockWidgetArea);
+ mw.addDockWidget(Qt::LeftDockWidgetArea, dw2);
+ QDockWidget *dw3 = new QDockWidget("d4", &mw);
+ dw3->setAllowedAreas(Qt::LeftDockWidgetArea);
+ mw.addDockWidget(Qt::LeftDockWidgetArea, dw3);
+ mw.tabifyDockWidget(dw0, dw1);
+ mw.tabifyDockWidget(dw1, dw2);
+ mw.tabifyDockWidget(dw2, dw3);
+
+ QTabBar *tabBar = mw.findChild<QTabBar *>();
+ QVERIFY(tabBar);
+ tabBar->setCurrentIndex(2);
+
+ mw.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&mw));
+
+ QCOMPARE(tabBar->currentIndex(), 2);
+
+ dw0->hide();
+ dw1->hide();
+ QTRY_COMPARE(tabBar->count(), 2);
+ QCOMPARE(tabBar->currentIndex(), 0);
+}
+
Q_DECLARE_METATYPE(Qt::DockWidgetArea)
void tst_QDockWidget::dockLocationChanged()
@@ -721,6 +761,9 @@ 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 QSize size = availableGeometry.size() / 5;
@@ -745,11 +788,22 @@ void tst_QDockWidget::restoreDockWidget()
QVERIFY(dock->isFloating());
state = saveWindow.saveState();
geometry = saveWindow.saveGeometry();
+
+ // QTBUG-49832: Delete and recreate the dock; it should be restored to the same position.
+ delete dock;
+ dock = createTestDock(saveWindow);
+ QVERIFY(saveWindow.restoreDockWidget(dock));
+ dock->show();
+ QVERIFY(QTest::qWaitForWindowExposed(dock));
+ QTRY_VERIFY(dock->isFloating());
+ if (!isXcb) // Avoid Window manager positioning issues
+ QTRY_COMPARE(dock->pos(), dockPos);
}
QVERIFY(!geometry.isEmpty());
QVERIFY(!state.isEmpty());
+ // QTBUG-45780: Completely recreate the dock widget from the saved state.
{
QMainWindow restoreWindow;
restoreWindow.setObjectName(name);
@@ -764,7 +818,7 @@ void tst_QDockWidget::restoreDockWidget()
restoreWindow.show();
QVERIFY(QTest::qWaitForWindowExposed(&restoreWindow));
QTRY_VERIFY(dock->isFloating());
- if (!QGuiApplication::platformName().compare("xcb", Qt::CaseInsensitive))
+ if (isXcb)
QSKIP("Skip due to Window manager positioning issues", Abort);
QTRY_COMPARE(dock->pos(), dockPos);
}
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_0.png
index a75833c89c..00447760ec 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_0.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_0.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_1.png
index a75833c89c..00447760ec 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_1.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_1.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_2.png
index a75833c89c..00447760ec 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_2.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_0_2.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_0.png
index a75833c89c..00447760ec 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_0.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_0.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_1.png
index a75833c89c..00447760ec 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_1.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_1.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_2.png
index a75833c89c..00447760ec 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_2.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_1_2.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_0.png
index a75833c89c..00447760ec 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_0.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_0.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_1.png
index a75833c89c..00447760ec 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_1.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_1.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_2.png
index a75833c89c..00447760ec 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_2.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_raised_2_2.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_0.png
index d656ac56f0..4c809a2c80 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_0.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_0.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_1.png
index d656ac56f0..4c809a2c80 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_1.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_1.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_2.png
index d656ac56f0..4c809a2c80 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_2.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_0_2.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_0.png
index d656ac56f0..4c809a2c80 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_0.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_0.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_1.png
index d656ac56f0..4c809a2c80 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_1.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_1.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_2.png
index d656ac56f0..4c809a2c80 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_2.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_1_2.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_0.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_0.png
index d656ac56f0..4c809a2c80 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_0.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_0.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_1.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_1.png
index d656ac56f0..4c809a2c80 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_1.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_1.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_2.png b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_2.png
index d656ac56f0..4c809a2c80 100644
--- a/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_2.png
+++ b/tests/auto/widgets/widgets/qframe/images/winpanel_sunken_2_2.png
Binary files differ
diff --git a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp
index 1d995b5eea..d76dbf6b46 100644
--- a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp
+++ b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp
@@ -47,13 +47,12 @@
class Widget : public QWidget
{
+ Q_OBJECT
public:
- Widget() { }
-
QList<QEvent::Type> events;
protected:
- bool event(QEvent *ev) {
+ bool event(QEvent *ev) Q_DECL_OVERRIDE {
events.append(ev->type());
return QWidget::event(ev);
}
@@ -62,19 +61,14 @@ protected:
class tst_QLabel : public QObject
{
-Q_OBJECT
-
-public:
- tst_QLabel();
- virtual ~tst_QLabel();
-
+ Q_OBJECT
-public slots:
+private Q_SLOTS:
void initTestCase();
void cleanupTestCase();
void init();
void cleanup();
-private slots:
+
void getSetCheck();
void setText_data();
void setText();
@@ -111,7 +105,6 @@ private:
QLabel *testWidget;
QPointer<Widget> test_box;
QPointer<QLabel> test_label;
- QLineEdit *test_edit;
};
// Testing get/set functions
@@ -144,15 +137,6 @@ void tst_QLabel::getSetCheck()
delete var3;
}
-
-tst_QLabel::tst_QLabel(): test_box(0)
-{
-}
-
-tst_QLabel::~tst_QLabel()
-{
-}
-
void tst_QLabel::initTestCase()
{
// Create the test class
@@ -165,8 +149,7 @@ void tst_QLabel::cleanupTestCase()
{
delete testWidget;
testWidget = 0;
- if (test_box)
- delete test_box;
+ delete test_box;
}
void tst_QLabel::init()
@@ -196,7 +179,7 @@ void tst_QLabel::setBuddy()
test_box = new Widget;
test_label= new QLabel( test_box );
test_label->setText( "&Test with a buddy" );
- test_edit = new QLineEdit( test_box );
+ QWidget *test_edit = new QLineEdit( test_box );
QVBoxLayout *layout = new QVBoxLayout(test_box);
layout->addWidget(test_label);
layout->addWidget(test_edit);
@@ -322,7 +305,7 @@ void tst_QLabel::eventPropagation()
test_label->setText(text);
test_box->events.clear();
test_label->setTextInteractionFlags(Qt::TextInteractionFlags(textInteractionFlags));
- QVERIFY(int(test_label->focusPolicy()) == focusPolicy);
+ QCOMPARE(int(test_label->focusPolicy()), focusPolicy);
QTest::mousePress(test_label, Qt::LeftButton);
QVERIFY(test_box->events.contains(QEvent::MouseButtonPress) == propagation); // should have propagated!
}
diff --git a/tests/auto/widgets/widgets/qlineedit/qlineedit.pro b/tests/auto/widgets/widgets/qlineedit/qlineedit.pro
index 715dcb9550..636208d67a 100644
--- a/tests/auto/widgets/widgets/qlineedit/qlineedit.pro
+++ b/tests/auto/widgets/widgets/qlineedit/qlineedit.pro
@@ -3,3 +3,4 @@ TARGET = tst_qlineedit
QT += gui-private core-private widgets widgets-private testlib
SOURCES += tst_qlineedit.cpp
+osx: LIBS += -framework AppKit
diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
index 1d70e8a8ab..b46609c371 100644
--- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
@@ -229,6 +229,7 @@ private slots:
void isModified();
void edited();
+ void fixupDoesNotModify_QTBUG_49295();
void insert();
void setSelection_data();
@@ -1669,7 +1670,7 @@ void tst_QLineEdit::displayText()
testWidget->setEchoMode(mode);
testWidget->setText(insertString);
QCOMPARE(testWidget->displayText(), expectedString);
- QVERIFY(testWidget->echoMode() == mode);
+ QCOMPARE(testWidget->echoMode(), mode);
}
void tst_QLineEdit::passwordEchoOnEdit()
@@ -1839,9 +1840,9 @@ void tst_QLineEdit::maxLength()
// Make sure that the textChanged is not emitted unless the text is actually changed
if (insertString == expectedString) {
- QVERIFY(changed_count == 0);
+ QCOMPARE(changed_count, 0);
} else {
- QVERIFY(changed_count == 1);
+ QCOMPARE(changed_count, 1);
}
}
@@ -1962,7 +1963,7 @@ void tst_QLineEdit::psKeyClick(QTestEventList &keys, Qt::Key key, Qt::KeyboardMo
void tst_QLineEdit::cursorPosition()
{
QLineEdit *testWidget = ensureTestWidget();
- QVERIFY(testWidget->cursorPosition() == 0);
+ QCOMPARE(testWidget->cursorPosition(), 0);
// start with a basic text
QTest::keyClicks(testWidget, "The");
@@ -2208,7 +2209,7 @@ void tst_QLineEdit::selectedText()
testWidget->cursorForward(true, 9);
QVERIFY(testWidget->hasSelectedText());
QCOMPARE(testWidget->selectedText(), QString("Abc defg "));
- QVERIFY(selection_count == 1);
+ QCOMPARE(selection_count, 1);
// reset selection
testWidget->home(false);
@@ -2264,19 +2265,19 @@ void tst_QLineEdit::textChangedAndTextEdited()
QLineEdit *testWidget = ensureTestWidget();
QTest::keyClick(testWidget, Qt::Key_A);
QCOMPARE(changed_count, 1);
- QVERIFY(edited_count == changed_count);
+ QCOMPARE(edited_count, changed_count);
QTest::keyClick(testWidget, 'b');
QCOMPARE(changed_count, 2);
- QVERIFY(edited_count == changed_count);
+ QCOMPARE(edited_count, changed_count);
QTest::keyClick(testWidget, 'c');
QCOMPARE(changed_count, 3);
- QVERIFY(edited_count == changed_count);
+ QCOMPARE(edited_count, changed_count);
QTest::keyClick(testWidget, ' ');
QCOMPARE(changed_count, 4);
- QVERIFY(edited_count == changed_count);
+ QCOMPARE(edited_count, changed_count);
QTest::keyClick(testWidget, 'd');
QCOMPARE(changed_count, 5);
- QVERIFY(edited_count == changed_count);
+ QCOMPARE(edited_count, changed_count);
changed_count = 0;
edited_count = 0;
@@ -2322,27 +2323,27 @@ void tst_QLineEdit::returnPressed()
QLineEdit *testWidget = ensureTestWidget();
QTest::keyClick(testWidget, Qt::Key_Return);
- QVERIFY(return_count == 1);
+ QCOMPARE(return_count, 1);
return_count = 0;
QTest::keyClick(testWidget, 'A');
- QVERIFY(return_count == 0);
+ QCOMPARE(return_count, 0);
QTest::keyClick(testWidget, 'b');
- QVERIFY(return_count == 0);
+ QCOMPARE(return_count, 0);
QTest::keyClick(testWidget, 'c');
- QVERIFY(return_count == 0);
+ QCOMPARE(return_count, 0);
QTest::keyClick(testWidget, ' ');
- QVERIFY(return_count == 0);
+ QCOMPARE(return_count, 0);
QTest::keyClick(testWidget, 'd');
- QVERIFY(return_count == 0);
+ QCOMPARE(return_count, 0);
psKeyClick(testWidget, Qt::Key_Home);
- QVERIFY(return_count == 0);
+ QCOMPARE(return_count, 0);
psKeyClick(testWidget, Qt::Key_End);
- QVERIFY(return_count == 0);
+ QCOMPARE(return_count, 0);
QTest::keyClick(testWidget, Qt::Key_Escape);
- QVERIFY(return_count == 0);
+ QCOMPARE(return_count, 0);
QTest::keyClick(testWidget, Qt::Key_Return);
- QVERIFY(return_count == 1);
+ QCOMPARE(return_count, 1);
}
// int validator that fixes all !isNumber to '0'
@@ -2498,14 +2499,14 @@ void tst_QLineEdit::setValidator()
QCOMPARE(testWidget->validator(), static_cast<const QValidator*>(&iv1));
testWidget->setValidator(0);
- QVERIFY(testWidget->validator() == 0);
+ QVERIFY(!testWidget->validator());
QIntValidator iv2(0, 99, 0);
testWidget->setValidator(&iv2);
QCOMPARE(testWidget->validator(), static_cast<const QValidator *>(&iv2));
testWidget->setValidator(0);
- QVERIFY(testWidget->validator() == 0);
+ QVERIFY(!testWidget->validator());
}
void tst_QLineEdit::setValidator_QIntValidator_data()
@@ -2747,7 +2748,7 @@ void tst_QLineEdit::setAlignment()
QTEST(testWidget, "left");
#endif
#endif
- QVERIFY(testWidget->alignment() == Qt::AlignLeft);
+ QCOMPARE(testWidget->alignment(), Qt::AlignLeft);
testWidget->setText("hcenter");
testWidget->setAlignment(Qt::AlignHCenter);
@@ -2756,7 +2757,7 @@ void tst_QLineEdit::setAlignment()
QTEST(testWidget, "hcenter");
#endif
#endif
- QVERIFY(testWidget->alignment() == Qt::AlignHCenter);
+ QCOMPARE(testWidget->alignment(), Qt::AlignHCenter);
testWidget->setText("right");
testWidget->setAlignment(Qt::AlignRight);
@@ -2765,16 +2766,16 @@ void tst_QLineEdit::setAlignment()
QTEST(testWidget, "right");
#endif
#endif
- QVERIFY(testWidget->alignment() == Qt::AlignRight);
+ QCOMPARE(testWidget->alignment(), Qt::AlignRight);
testWidget->setAlignment(Qt::AlignTop);
- QVERIFY(testWidget->alignment() == Qt::AlignTop);
+ QCOMPARE(testWidget->alignment(), Qt::AlignTop);
testWidget->setAlignment(Qt::AlignBottom);
- QVERIFY(testWidget->alignment() == Qt::AlignBottom);
+ QCOMPARE(testWidget->alignment(), Qt::AlignBottom);
testWidget->setAlignment(Qt::AlignCenter);
- QVERIFY(testWidget->alignment() == Qt::AlignCenter);
+ QCOMPARE(testWidget->alignment(), Qt::AlignCenter);
}
void tst_QLineEdit::isModified()
@@ -2844,6 +2845,29 @@ void tst_QLineEdit::edited()
QVERIFY(testWidget->isModified());
}
+void tst_QLineEdit::fixupDoesNotModify_QTBUG_49295()
+{
+ QLineEdit *testWidget = ensureTestWidget();
+
+ ValidatorWithFixup val;
+ testWidget->setValidator(&val);
+ testWidget->setText("foo");
+ QVERIFY(!testWidget->isModified());
+ QVERIFY(!testWidget->hasAcceptableInput());
+
+ QTest::keyClicks(testWidget, QStringLiteral("bar"));
+ QVERIFY(testWidget->isModified());
+ QVERIFY(!testWidget->hasAcceptableInput());
+
+ // trigger a fixup, which should not reset the modified flag
+ QFocusEvent lostFocus(QEvent::FocusOut);
+ qApp->sendEvent(testWidget, &lostFocus);
+
+ QVERIFY(testWidget->hasAcceptableInput());
+ QEXPECT_FAIL("", "QTBUG-49295: a fixup of a line edit should keep it modified", Continue);
+ QVERIFY(testWidget->isModified());
+}
+
void tst_QLineEdit::insert()
{
QLineEdit *testWidget = ensureTestWidget();
@@ -3082,10 +3106,10 @@ void tst_QLineEdit::maxLengthAndInputMask()
QLineEdit *testWidget = ensureTestWidget();
QVERIFY(testWidget->inputMask().isNull());
testWidget->setMaxLength(10);
- QVERIFY(testWidget->maxLength() == 10);
+ QCOMPARE(testWidget->maxLength(), 10);
testWidget->setInputMask(QString::null);
QVERIFY(testWidget->inputMask().isNull());
- QVERIFY(testWidget->maxLength() == 10);
+ QCOMPARE(testWidget->maxLength(), 10);
}
@@ -4477,7 +4501,7 @@ void tst_QLineEdit::QTBUG1266_setInputMaskEmittingTextEdited()
QSignalSpy spy(&lineEdit, SIGNAL(textEdited(QString)));
lineEdit.setInputMask("AAAA");
lineEdit.setInputMask(QString());
- QVERIFY(spy.count() == 0);
+ QCOMPARE(spy.count(), 0);
}
QTEST_MAIN(tst_QLineEdit)
diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
index 270e5168f7..6282028746 100644
--- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
+++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
@@ -149,6 +149,8 @@ private slots:
void toggleUnifiedTitleAndToolBarOnMac();
#endif
void QTBUG21378_animationFinished();
+ void resizeDocks();
+ void resizeDocks_data();
};
@@ -211,15 +213,15 @@ tst_QMainWindow::tst_QMainWindow()
void tst_QMainWindow::constructor()
{
QMainWindow mw;
- QVERIFY(mw.parentWidget() == 0);
+ QVERIFY(!mw.parentWidget());
QVERIFY(mw.isWindow());
QMainWindow mw2(&mw);
- QVERIFY(mw2.parentWidget() == &mw);
+ QCOMPARE(mw2.parentWidget(), &mw);
QVERIFY(mw2.isWindow());
QMainWindow mw3(&mw, Qt::FramelessWindowHint);
- QVERIFY(mw3.parentWidget() == &mw);
+ QCOMPARE(mw3.parentWidget(), &mw);
QVERIFY(mw3.isWindow());
}
@@ -607,7 +609,7 @@ void tst_QMainWindow::menuBar()
QVERIFY(mw.menuBar() != 0);
//we now call deleteLater on the previous menubar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(mb1 == 0);
+ QVERIFY(mb1.isNull());
mw.setMenuBar(mb2);
QVERIFY(mw.menuBar() != 0);
@@ -618,7 +620,7 @@ void tst_QMainWindow::menuBar()
QVERIFY(mw.menuBar() != 0);
//we now call deleteLater on the previous menubar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(mb2 == 0);
+ QVERIFY(mb2.isNull());
mb1 = new QMenuBar;
mw.setMenuBar(mb1);
@@ -631,7 +633,7 @@ void tst_QMainWindow::menuBar()
QCOMPARE(mw.menuBar(), (QMenuBar *)mb2);
//we now call deleteLater on the previous menubar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(mb1 == 0);
+ QVERIFY(mb1.isNull());
mb1 = new QMenuBar;
mw.setMenuBar(mb1);
@@ -639,7 +641,7 @@ void tst_QMainWindow::menuBar()
QCOMPARE(mw.menuBar(), (QMenuBar *)mb1);
//we now call deleteLater on the previous menubar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(mb2 == 0);
+ QVERIFY(mb2.isNull());
QPointer<QWidget> topLeftCornerWidget = new QWidget;
mb1->setCornerWidget(topLeftCornerWidget, Qt::TopLeftCorner);
@@ -652,7 +654,7 @@ void tst_QMainWindow::menuBar()
QCOMPARE(mw.menuBar(), (QMenuBar *)mb2);
//we now call deleteLater on the previous menubar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(mb1 == 0);
+ QVERIFY(mb1.isNull());
QVERIFY(topLeftCornerWidget);
QCOMPARE(mb2->cornerWidget(Qt::TopLeftCorner), static_cast<QWidget *>(topLeftCornerWidget));
@@ -663,8 +665,8 @@ void tst_QMainWindow::menuBar()
QVERIFY(mw.menuBar() != 0);
//we now call deleteLater on the previous menubar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(mb2 == 0);
+ QVERIFY(mb2.isNull());
QVERIFY(!topLeftCornerWidget);
QVERIFY(!topRightCornerWidget);
}
@@ -692,7 +694,7 @@ void tst_QMainWindow::statusBar()
QVERIFY(mw.statusBar() != 0);
//we now call deleteLater on the previous statusbar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(sb1 == 0);
+ QVERIFY(sb1.isNull());
mw.setStatusBar(sb2);
QVERIFY(mw.statusBar() != 0);
@@ -703,7 +705,7 @@ void tst_QMainWindow::statusBar()
QVERIFY(mw.statusBar() != 0);
//we now call deleteLater on the previous statusbar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(sb2 == 0);
+ QVERIFY(sb2.isNull());
sb1 = new QStatusBar;
mw.setStatusBar(sb1);
@@ -718,7 +720,7 @@ void tst_QMainWindow::statusBar()
QCOMPARE(sb2->parentWidget(), (QWidget *)&mw);
//we now call deleteLater on the previous statusbar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(sb1 == 0);
+ QVERIFY(sb1.isNull());
sb1 = new QStatusBar;
mw.setStatusBar(sb1);
@@ -727,7 +729,7 @@ void tst_QMainWindow::statusBar()
QCOMPARE(sb1->parentWidget(), (QWidget *)&mw);
//we now call deleteLater on the previous statusbar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(sb2 == 0);
+ QVERIFY(sb2.isNull());
sb2 = new QStatusBar;
mw.setStatusBar(sb2);
@@ -736,7 +738,7 @@ void tst_QMainWindow::statusBar()
QCOMPARE(sb2->parentWidget(), (QWidget *)&mw);
//we now call deleteLater on the previous statusbar
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(sb1 == 0);
+ QVERIFY(sb1.isNull());
}
{
@@ -749,7 +751,7 @@ void tst_QMainWindow::statusBar()
QVERIFY(indexOfSb != -1);
delete sb;
indexOfSb = l->indexOf(sb);
- QVERIFY(indexOfSb == -1);
+ QCOMPARE(indexOfSb, -1);
}
}
@@ -791,7 +793,7 @@ void tst_QMainWindow::centralWidget()
{
{
QMainWindow mw;
- QVERIFY(mw.centralWidget() == 0);
+ QVERIFY(!mw.centralWidget());
}
{
@@ -799,7 +801,7 @@ void tst_QMainWindow::centralWidget()
QPointer<QWidget> w1 = new QWidget;
QPointer<QWidget> w2 = new QWidget;
- QVERIFY(mw.centralWidget() == 0);
+ QVERIFY(!mw.centralWidget());
mw.setCentralWidget(w1);
QVERIFY(mw.centralWidget() != 0);
@@ -812,12 +814,12 @@ void tst_QMainWindow::centralWidget()
QCOMPARE(w2->parentWidget(), (QWidget *)&mw);
mw.setCentralWidget(0);
- QVERIFY(mw.centralWidget() == 0);
+ QVERIFY(!mw.centralWidget());
//we now call deleteLater on the previous central widgets
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(w1 == 0);
- QVERIFY(w2 == 0);
+ QVERIFY(w1.isNull());
+ QVERIFY(w2.isNull());
}
{
@@ -831,7 +833,7 @@ void tst_QMainWindow::centralWidget()
QPointer<QWidget> w1 = new QWidget;
QPointer<QWidget> w2 = new QWidget;
- QVERIFY(mw.centralWidget() == 0);
+ QVERIFY(!mw.centralWidget());
mw.setCentralWidget(w1);
QVERIFY(mw.centralWidget() != 0);
@@ -844,12 +846,12 @@ void tst_QMainWindow::centralWidget()
QCOMPARE(w2->parentWidget(), (QWidget *)&mw);
mw.setCentralWidget(0);
- QVERIFY(mw.centralWidget() == 0);
+ QVERIFY(!mw.centralWidget());
//we now call deleteLater on the previous central widgets
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(w1 == 0);
- QVERIFY(w2 == 0);
+ QVERIFY(w1.isNull());
+ QVERIFY(w2.isNull());
}
}
@@ -860,25 +862,25 @@ void tst_QMainWindow::takeCentralWidget() {
QPointer<QWidget> w1 = new QWidget;
- QVERIFY(mw.centralWidget() == 0);
+ QVERIFY(!mw.centralWidget());
mw.setCentralWidget(w1);
QWidget *oldCentralWidget = mw.takeCentralWidget();
- QVERIFY(oldCentralWidget == w1.data());
+ QCOMPARE(oldCentralWidget, w1.data());
// ensure that takeCentralWidget doesn't end up calling deleteLater
// on the central widget
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(mw.centralWidget() == 0);
+ QVERIFY(!mw.centralWidget());
QVERIFY(!w1.isNull());
- QVERIFY(w1->parent() == 0);
+ QVERIFY(!w1->parent());
mw.setCentralWidget(w1);
// ensure that the deleteLater called by setCentralWidget
// gets executed
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
- QVERIFY(mw.centralWidget() == w1.data());
+ QCOMPARE(mw.centralWidget(), w1.data());
QPointer<QWidget> w2 = new QWidget;
@@ -887,10 +889,10 @@ void tst_QMainWindow::takeCentralWidget() {
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
QVERIFY(w1.isNull());
- QVERIFY(mw.centralWidget() == w2.data());
+ QCOMPARE(mw.centralWidget(), w2.data());
QWidget *hopefullyW2 = mw.takeCentralWidget();
- QVERIFY(mw.centralWidget() == 0);
+ QVERIFY(!mw.centralWidget());
// ensure that takeCentralWidget doesn't end up calling deleteLater
// on the central widget
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
@@ -1928,9 +1930,9 @@ void tst_QMainWindow::toggleUnifiedTitleAndToolBarOnMac()
mw.show();
QRect frameGeometry = mw.frameGeometry();
mw.setUnifiedTitleAndToolBarOnMac(false);
- QVERIFY(frameGeometry.topLeft() == mw.frameGeometry().topLeft());
+ QCOMPARE(frameGeometry.topLeft(), mw.frameGeometry().topLeft());
mw.setUnifiedTitleAndToolBarOnMac(true);
- QVERIFY(frameGeometry.topLeft() == mw.frameGeometry().topLeft());
+ QCOMPARE(frameGeometry.topLeft(), mw.frameGeometry().topLeft());
}
#endif
@@ -1950,5 +1952,96 @@ void tst_QMainWindow::QTBUG21378_animationFinished()
delete mwClickTimer;
QVERIFY(true);
}
+
+Q_DECLARE_METATYPE(Qt::Orientation)
+
+void tst_QMainWindow::resizeDocks_data()
+{
+ QTest::addColumn<Qt::Orientation>("orientation");
+ QTest::addColumn<QStringList>("docks");
+ QTest::addColumn<QList<int> >("sizes");
+
+ QTest::newRow("1") << Qt::Horizontal
+ << (QStringList() << "blue" << "orange" << "green" << "gray")
+ << (QList<int>() << 190 << 190 << 320 << 160);
+
+ QTest::newRow("2") << Qt::Vertical
+ << (QStringList() << "yellow" << "orange")
+ << (QList<int>() << 147 << 133 );
+
+
+ QTest::newRow("3") << Qt::Horizontal
+ << (QStringList() << "blue" << "yellow")
+ << (QList<int>() << 190 << 600);
+}
+
+void tst_QMainWindow::resizeDocks()
+{
+ AddList addList;
+ addList
+ << AddDockWidget("blue", Qt::LeftDockWidgetArea)
+ << AddDockWidget("red", Qt::TopDockWidgetArea)
+ << AddDockWidget("pink", "red")
+ << AddDockWidget("yellow", Qt::RightDockWidgetArea)
+ << AddDockWidget("orange", Qt::RightDockWidgetArea)
+ << AddDockWidget("green", "orange", Qt::Horizontal)
+ << AddDockWidget("gray", "orange", Qt::Horizontal);
+ /*
+ +--------------------------------+
+ | red/pink |
+ +------+-+-----------------------+
+ | | | yellow |
+ | blue + +--------+------+-------+
+ | | | orange | gray | green |
+ +------+-+--------+------+-------+
+
+ */
+
+ QMainWindow mw(0, Qt::BypassWindowManagerHint);
+ mw.setDockNestingEnabled(true);
+ mw.resize(1800, 600);
+
+ foreach (const AddDockWidget &i, addList)
+ i.apply(&mw);
+
+ foreach (QDockWidget *dw, mw.findChildren<QDockWidget *>())
+ dw->setStyleSheet( "* { background-color: " + dw->objectName() +" }");
+
+ mw.setCentralWidget(new QTextEdit);
+
+ mw.show();
+ QTest::qWaitForWindowExposed(&mw);
+
+ QFETCH(Qt::Orientation, orientation);
+ QFETCH(QStringList, docks);
+ QFETCH(QList<int>, sizes);
+
+ QList<QDockWidget *> list;
+ foreach (const QString &name, docks) {
+ QDockWidget *d = mw.findChild<QDockWidget *>(name);
+ QVERIFY(d);
+ list << d;
+ }
+
+ mw.resizeDocks(list, sizes, orientation);
+
+ qApp->processEvents();
+
+ int totalFromList = 0;
+ int actualTotal = 0;
+ for (int i = 0; i < docks.count(); ++i) {
+ totalFromList += sizes[i];
+ QSize s = list[i]->size();
+ actualTotal += (orientation == Qt::Horizontal) ? s.width() : s.height();
+// qDebug() << list[i] << list[i]->size() << sizes[i];
+ }
+
+ for (int i = 0; i < docks.count(); ++i) {
+ QSize s = list[i]->size();
+ int value = (orientation == Qt::Horizontal) ? s.width() : s.height();
+ QCOMPARE(value, qRound(sizes[i]*actualTotal/double(totalFromList)));
+ }
+}
+
QTEST_MAIN(tst_QMainWindow)
#include "tst_qmainwindow.moc"
diff --git a/tests/auto/widgets/widgets/qmdiarea/BLACKLIST b/tests/auto/widgets/widgets/qmdiarea/BLACKLIST
index b8640e9ac3..63da2e3ae3 100644
--- a/tests/auto/widgets/widgets/qmdiarea/BLACKLIST
+++ b/tests/auto/widgets/widgets/qmdiarea/BLACKLIST
@@ -1,2 +1,5 @@
[updateScrollBars]
osx
+[tileSubWindows]
+osx
+xcb
diff --git a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
index 53defce423..e23634c515 100644
--- a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
+++ b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
@@ -377,13 +377,13 @@ void tst_QMdiArea::subWindowActivated()
while (workspace->activeSubWindow() ) {
workspace->activeSubWindow()->close();
qApp->processEvents();
- QVERIFY(activeWindow == workspace->activeSubWindow());
+ QCOMPARE(activeWindow, workspace->activeSubWindow());
QCOMPARE(spy.count(), 1);
spy.clear();
}
- QVERIFY(activeWindow == 0);
- QVERIFY(workspace->activeSubWindow() == 0);
+ QVERIFY(!activeWindow);
+ QVERIFY(!workspace->activeSubWindow());
QCOMPARE(workspace->subWindowList().count(), 0);
{
@@ -432,13 +432,13 @@ void tst_QMdiArea::subWindowActivated()
QCOMPARE(spy.count(), 1);
spy.clear();
QVERIFY( activeWindow == window );
- QVERIFY(workspace->activeSubWindow() == window);
+ QCOMPARE(workspace->activeSubWindow(), window);
window->close();
qApp->processEvents();
QCOMPARE(spy.count(), 1);
spy.clear();
- QVERIFY(workspace->activeSubWindow() == 0);
- QVERIFY( activeWindow == 0 );
+ QVERIFY(!workspace->activeSubWindow());
+ QVERIFY(!activeWindow);
}
}
@@ -518,7 +518,7 @@ void tst_QMdiArea::subWindowActivated2()
#ifdef Q_OS_MAC
QSKIP("QTBUG-25298: This test is unstable on Mac.");
#endif
- if (qApp->platformName().toLower() == QStringLiteral("xcb"))
+ if (!QGuiApplication::platformName().compare(QLatin1String("xcb"), Qt::CaseInsensitive))
QSKIP("QTBUG-25298: Unstable on some X11 window managers");
QTRY_COMPARE(spy.count(), 1);
QVERIFY(!mdiArea.activeSubWindow());
@@ -564,8 +564,8 @@ void tst_QMdiArea::subWindowActivatedWithMinimize()
window1->close();
qApp->processEvents();
- QVERIFY(workspace->activeSubWindow() == 0);
- QVERIFY( activeWindow == 0 );
+ QVERIFY(!workspace->activeSubWindow());
+ QVERIFY(!activeWindow);
QVERIFY( workspace->subWindowList().count() == 0 );
}
@@ -1104,7 +1104,7 @@ void tst_QMdiArea::addAndRemoveWindows()
QVERIFY(window);
qApp->processEvents();
QCOMPARE(workspace.subWindowList().count(), 1);
- QVERIFY(window->windowFlags() == DefaultWindowFlags);
+ QCOMPARE(window->windowFlags(), DefaultWindowFlags);
QCOMPARE(window->size(), workspace.viewport()->size());
}
@@ -1115,7 +1115,7 @@ void tst_QMdiArea::addAndRemoveWindows()
QVERIFY(window);
qApp->processEvents();
QCOMPARE(workspace.subWindowList().count(), 2);
- QVERIFY(window->windowFlags() == DefaultWindowFlags);
+ QCOMPARE(window->windowFlags(), DefaultWindowFlags);
QCOMPARE(window->size(), window->minimumSize());
}
@@ -1127,7 +1127,7 @@ void tst_QMdiArea::addAndRemoveWindows()
QVERIFY(window);
qApp->processEvents();
QCOMPARE(workspace.subWindowList().count(), 3);
- QVERIFY(window->windowFlags() == DefaultWindowFlags);
+ QCOMPARE(window->windowFlags(), DefaultWindowFlags);
QCOMPARE(window->size(), QSize(1500, 1500));
}
@@ -1142,7 +1142,7 @@ void tst_QMdiArea::addAndRemoveWindows()
QMdiSubWindow *window = new QMdiSubWindow;
workspace.addSubWindow(window);
qApp->processEvents();
- QVERIFY(window->windowFlags() == DefaultWindowFlags);
+ QCOMPARE(window->windowFlags(), DefaultWindowFlags);
window->setWidget(new QWidget);
QCOMPARE(workspace.subWindowList().count(), 4);
QTest::ignoreMessage(QtWarningMsg, "QMdiArea::addSubWindow: window is already added");
@@ -1206,7 +1206,7 @@ void tst_QMdiArea::addAndRemoveWindowsWithReparenting()
{
QMdiArea workspace;
QMdiSubWindow window(&workspace);
- QVERIFY(window.windowFlags() == DefaultWindowFlags);
+ QCOMPARE(window.windowFlags(), DefaultWindowFlags);
// 0 because the window list contains widgets and not actual
// windows. Silly, but that's the behavior.
@@ -1219,7 +1219,7 @@ void tst_QMdiArea::addAndRemoveWindowsWithReparenting()
QCOMPARE(workspace.subWindowList().count(), 0);
window.setParent(&workspace);
QCOMPARE(workspace.subWindowList().count(), 1);
- QVERIFY(window.windowFlags() == DefaultWindowFlags);
+ QCOMPARE(window.windowFlags(), DefaultWindowFlags);
QTest::ignoreMessage(QtWarningMsg, "QMdiArea::addSubWindow: window is already added");
workspace.addSubWindow(&window);
diff --git a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
index a6caa3d020..db252347ac 100644
--- a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
+++ b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
@@ -191,6 +191,7 @@ private slots:
void fixedMinMaxSize();
#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
void replaceMenuBarWhileMaximized();
+ void closeOnDoubleClick_data();
void closeOnDoubleClick();
#endif
void setFont();
@@ -1793,9 +1794,23 @@ void tst_QMdiSubWindow::replaceMenuBarWhileMaximized()
QVERIFY(!subWindow->maximizedSystemMenuIconWidget());
}
+void tst_QMdiSubWindow::closeOnDoubleClick_data()
+{
+ QTest::addColumn<int>("actionIndex");
+ QTest::addColumn<bool>("expectClosed");
+
+ QTest::newRow("close") << 1 << true;
+ QTest::newRow("disabled-restore-action") << 0 << false; // QTBUG-48493
+}
+
void tst_QMdiSubWindow::closeOnDoubleClick()
{
+ QFETCH(int, actionIndex);
+ QFETCH(bool, expectClosed);
+
QMdiArea mdiArea;
+ mdiArea.setWindowTitle(QLatin1String(QTest::currentTestFunction())
+ + QLatin1Char(' ') + QLatin1String(QTest::currentDataTag()));
QPointer<QMdiSubWindow> subWindow = mdiArea.addSubWindow(new QWidget);
mdiArea.show();
QVERIFY(QTest::qWaitForWindowExposed(&mdiArea));
@@ -1807,12 +1822,13 @@ void tst_QMdiSubWindow::closeOnDoubleClick()
QVERIFY(systemMenu);
QVERIFY(systemMenu->isVisible());
- sendMouseDoubleClick(systemMenu, QPoint(10, 10));
+ const QRect actionGeometry = systemMenu->actionGeometry(systemMenu->actions().at(actionIndex));
+ sendMouseDoubleClick(systemMenu, actionGeometry.center());
if (qApp->activePopupWidget() == static_cast<QWidget *>(systemMenu))
systemMenu->hide();
qApp->processEvents();
- QVERIFY(!subWindow || !subWindow->isVisible());
QVERIFY(!systemMenu || !systemMenu->isVisible());
+ QCOMPARE(subWindow.isNull() || !subWindow->isVisible(), expectClosed);
}
#endif
diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
index 46d3177a56..b3f9c54f24 100644
--- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
+++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
@@ -78,6 +78,7 @@ public slots:
private slots:
void getSetCheck();
void addActionsAndClear();
+ void addActionsConnect();
void keyboardNavigation_data();
void keyboardNavigation();
@@ -93,6 +94,7 @@ private slots:
void task208001_stylesheet();
void activeSubMenuPosition();
+ void activeSubMenuPositionExec();
void task242454_sizeHint();
void task176201_clear();
void task250673_activeMultiColumnSubMenuPosition();
@@ -264,6 +266,34 @@ void tst_QMenu::addActionsAndClear()
QCOMPARE(menus[0]->actions().count(), 0);
}
+static void testFunction() { }
+
+void tst_QMenu::addActionsConnect()
+{
+ QMenu menu;
+ const QString text = QLatin1String("bla");
+ const QIcon icon;
+ menu.addAction(text, &menu, SLOT(deleteLater()));
+ menu.addAction(text, &menu, &QMenu::deleteLater);
+ menu.addAction(text, testFunction);
+ menu.addAction(text, &menu, testFunction);
+ menu.addAction(icon, text, &menu, SLOT(deleteLater()));
+ menu.addAction(icon, text, &menu, &QMenu::deleteLater);
+ menu.addAction(icon, text, testFunction);
+ menu.addAction(icon, text, &menu, testFunction);
+#ifndef QT_NO_SHORTCUT
+ const QKeySequence keySequence(Qt::CTRL + Qt::Key_C);
+ menu.addAction(text, &menu, SLOT(deleteLater()), keySequence);
+ menu.addAction(text, &menu, &QMenu::deleteLater, keySequence);
+ menu.addAction(text, testFunction, keySequence);
+ menu.addAction(text, &menu, testFunction, keySequence);
+ menu.addAction(icon, text, &menu, SLOT(deleteLater()), keySequence);
+ menu.addAction(icon, text, &menu, &QMenu::deleteLater, keySequence);
+ menu.addAction(icon, text, testFunction, keySequence);
+ menu.addAction(icon, text, &menu, testFunction, keySequence);
+#endif // !QT_NO_SHORTCUT
+}
+
// We have a separate mouseActivation test for Windows mobile
#ifndef Q_OS_WINCE
void tst_QMenu::mouseActivation()
@@ -334,8 +364,10 @@ void tst_QMenu::keyboardNavigation_data()
QTest::newRow("data9") << Qt::Key(Qt::Key_Down) << Qt::KeyboardModifiers(Qt::NoModifier) << 3 << 0 << false << false<< true;
QTest::newRow("data10") << Qt::Key(Qt::Key_Return) << Qt::KeyboardModifiers(Qt::NoModifier) << 3 << 0 << false << true << false;
- // Test shortcuts.
- QTest::newRow("shortcut0") << Qt::Key(Qt::Key_V) << Qt::KeyboardModifiers(Qt::AltModifier) << 5 << 0 << true << true << false;
+ if (QGuiApplication::platformName().compare(QLatin1String("xcb"), Qt::CaseInsensitive)) {
+ // Test shortcuts.
+ QTest::newRow("shortcut0") << Qt::Key(Qt::Key_V) << Qt::KeyboardModifiers(Qt::AltModifier) << 5 << 0 << true << true << false;
+ }
}
void tst_QMenu::keyboardNavigation()
@@ -513,7 +545,7 @@ void tst_QMenu::onStatusTipTimer()
menu->close(); //goes out of the menu
QCOMPARE(st, QString("sub action"));
- QVERIFY(menu->isVisible() == false);
+ QVERIFY(!menu->isVisible());
m_onStatusTipTimerExecuted = true;
}
@@ -663,6 +695,61 @@ void tst_QMenu::activeSubMenuPosition()
#endif
}
+// QTBUG-49588, QTBUG-48396: activeSubMenuPositionExec() is the same as
+// activeSubMenuPosition(), but uses QMenu::exec(), which produces a different
+// sequence of events. Verify that the sub menu is positioned to the right of the
+// main menu.
+class SubMenuPositionExecMenu : public QMenu
+{
+ Q_OBJECT
+public:
+ SubMenuPositionExecMenu() : QMenu("Menu-Title"), m_timerId(-1), m_timerTick(0)
+ {
+ addAction("Item 1");
+ m_subMenu = addMenu("Submenu");
+ m_subAction = m_subMenu->addAction("Sub-Item1");
+ setActiveAction(m_subMenu->menuAction());
+ }
+
+protected:
+ void showEvent(QShowEvent *e) Q_DECL_OVERRIDE
+ {
+ QVERIFY(m_subMenu->isVisible());
+ QVERIFY2(m_subMenu->x() > x(),
+ (QByteArray::number(m_subMenu->x()) + ' ' + QByteArray::number(x())).constData());
+ m_timerId = startTimer(50);
+ QMenu::showEvent(e);
+ }
+
+ void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE
+ {
+ if (e->timerId() == m_timerId) {
+ switch (m_timerTick++) {
+ case 0:
+ m_subMenu->close();
+ break;
+ case 1:
+ close();
+ break;
+ }
+ }
+ }
+
+private:
+ int m_timerId;
+ int m_timerTick;
+ QMenu *m_subMenu;
+ QAction *m_subAction;
+};
+
+void tst_QMenu::activeSubMenuPositionExec()
+{
+#ifndef Q_OS_WINCE
+ SubMenuPositionExecMenu menu;
+ menu.exec(QGuiApplication::primaryScreen()->availableGeometry().center());
+#endif // !Q_OS_WINCE
+}
+
void tst_QMenu::task242454_sizeHint()
{
QMenu menu;
diff --git a/tests/auto/widgets/widgets/qmenubar/BLACKLIST b/tests/auto/widgets/widgets/qmenubar/BLACKLIST
index 424ab2ceed..4f9508266c 100644
--- a/tests/auto/widgets/widgets/qmenubar/BLACKLIST
+++ b/tests/auto/widgets/widgets/qmenubar/BLACKLIST
@@ -2,5 +2,6 @@
ubuntu-14.04
[taskQTBUG4965_escapeEaten]
ubuntu-14.04
+redhatenterpriselinuxworkstation-6.6
[task256322_highlight]
osx
diff --git a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
index 31e9c737e2..f787d73a02 100644
--- a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
@@ -117,6 +117,7 @@ private slots:
// void check_mouse2();
void check_altPress();
+ void check_altClosePress();
#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
void check_shortcutPress();
void check_menuPosition();
@@ -146,7 +147,7 @@ private:
QAction* m_lastSimpleAcceleratorId;
int m_simpleActivatedCount;
- int m_complexTriggerCount['k'];
+ int m_complexTriggerCount[int('k')];
};
// Testing get/set functions
@@ -534,60 +535,60 @@ void tst_QMenuBar::check_accelKeys()
QCOMPARE(m_complexTriggerCount[2], 0);
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 0);
- QCOMPARE(m_complexTriggerCount['b'], 0);
- QCOMPARE(m_complexTriggerCount['c'], 0);
- QCOMPARE(m_complexTriggerCount['d'], 0);
+ QCOMPARE(m_complexTriggerCount[int('a')], 0);
+ QCOMPARE(m_complexTriggerCount[int('b')], 0);
+ QCOMPARE(m_complexTriggerCount[int('c')], 0);
+ QCOMPARE(m_complexTriggerCount[int('d')], 0);
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_A, Qt::ControlModifier);
QCOMPARE(m_complexTriggerCount[1], 0);
QCOMPARE(m_complexTriggerCount[2], 0);
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 1);
- QCOMPARE(m_complexTriggerCount['b'], 0);
- QCOMPARE(m_complexTriggerCount['c'], 0);
- QCOMPARE(m_complexTriggerCount['d'], 0);
+ QCOMPARE(m_complexTriggerCount[int('a')], 1);
+ QCOMPARE(m_complexTriggerCount[int('b')], 0);
+ QCOMPARE(m_complexTriggerCount[int('c')], 0);
+ QCOMPARE(m_complexTriggerCount[int('d')], 0);
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_C, Qt::ControlModifier);
QCOMPARE(m_complexTriggerCount[1], 0);
QCOMPARE(m_complexTriggerCount[2], 0);
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 1);
- QCOMPARE(m_complexTriggerCount['b'], 0);
- QCOMPARE(m_complexTriggerCount['c'], 1);
- QCOMPARE(m_complexTriggerCount['d'], 0);
+ QCOMPARE(m_complexTriggerCount[int('a')], 1);
+ QCOMPARE(m_complexTriggerCount[int('b')], 0);
+ QCOMPARE(m_complexTriggerCount[int('c')], 1);
+ QCOMPARE(m_complexTriggerCount[int('d')], 0);
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_B, Qt::ControlModifier);
QCOMPARE(m_complexTriggerCount[1], 0);
QCOMPARE(m_complexTriggerCount[2], 0);
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 1);
- QCOMPARE(m_complexTriggerCount['b'], 1);
- QCOMPARE(m_complexTriggerCount['c'], 1);
- QCOMPARE(m_complexTriggerCount['d'], 0);
+ QCOMPARE(m_complexTriggerCount[int('a')], 1);
+ QCOMPARE(m_complexTriggerCount[int('b')], 1);
+ QCOMPARE(m_complexTriggerCount[int('c')], 1);
+ QCOMPARE(m_complexTriggerCount[int('d')], 0);
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_D, Qt::ControlModifier);
QCOMPARE(m_complexTriggerCount[1], 0);
QCOMPARE(m_complexTriggerCount[2], 0);
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 1);
- QCOMPARE(m_complexTriggerCount['b'], 1);
- QCOMPARE(m_complexTriggerCount['c'], 1);
- QCOMPARE(m_complexTriggerCount['d'], 1);
+ QCOMPARE(m_complexTriggerCount[int('a')], 1);
+ QCOMPARE(m_complexTriggerCount[int('b')], 1);
+ QCOMPARE(m_complexTriggerCount[int('c')], 1);
+ QCOMPARE(m_complexTriggerCount[int('d')], 1);
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_J, Qt::AltModifier);
QCOMPARE(m_complexTriggerCount[1], 0);
QCOMPARE(m_complexTriggerCount[2], 0);
QCOMPARE(m_complexTriggerCount[3], 1);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 1);
- QCOMPARE(m_complexTriggerCount['b'], 1);
- QCOMPARE(m_complexTriggerCount['c'], 1);
- QCOMPARE(m_complexTriggerCount['d'], 1);
+ QCOMPARE(m_complexTriggerCount[int('a')], 1);
+ QCOMPARE(m_complexTriggerCount[int('b')], 1);
+ QCOMPARE(m_complexTriggerCount[int('c')], 1);
+ QCOMPARE(m_complexTriggerCount[int('d')], 1);
}
#endif
@@ -606,10 +607,10 @@ void tst_QMenuBar::check_cursorKeys1()
// the Popupmenu should be visible now
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 0);
- QCOMPARE(m_complexTriggerCount['b'], 0);
- QCOMPARE(m_complexTriggerCount['c'], 0);
- QCOMPARE(m_complexTriggerCount['d'], 0);
+ QCOMPARE(m_complexTriggerCount[int('a')], 0);
+ QCOMPARE(m_complexTriggerCount[int('b')], 0);
+ QCOMPARE(m_complexTriggerCount[int('c')], 0);
+ QCOMPARE(m_complexTriggerCount[int('d')], 0);
// Simulate a cursor key down click
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_Down );
@@ -618,10 +619,10 @@ void tst_QMenuBar::check_cursorKeys1()
// Let's see if the correct slot is called...
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 0); // this shouldn't have been called
- QCOMPARE(m_complexTriggerCount['b'], 1); // and this should have been called by a signal now
- QCOMPARE(m_complexTriggerCount['c'], 0);
- QCOMPARE(m_complexTriggerCount['d'], 0);
+ QCOMPARE(m_complexTriggerCount[int('a')], 0); // this shouldn't have been called
+ QCOMPARE(m_complexTriggerCount[int('b')], 1); // and this should have been called by a signal now
+ QCOMPARE(m_complexTriggerCount[int('c')], 0);
+ QCOMPARE(m_complexTriggerCount[int('d')], 0);
}
#endif
@@ -648,10 +649,10 @@ void tst_QMenuBar::check_cursorKeys2()
// Let's see if the correct slot is called...
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 0); // this shouldn't have been caled
- QCOMPARE(m_complexTriggerCount['b'], 0); // and this should have been called by a signal ow
- QCOMPARE(m_complexTriggerCount['c'], 0);
- QCOMPARE(m_complexTriggerCount['d'], 1);
+ QCOMPARE(m_complexTriggerCount[int('a')], 0); // this shouldn't have been caled
+ QCOMPARE(m_complexTriggerCount[int('b')], 0); // and this should have been called by a signal ow
+ QCOMPARE(m_complexTriggerCount[int('c')], 0);
+ QCOMPARE(m_complexTriggerCount[int('d')], 1);
}
#endif
@@ -679,10 +680,10 @@ void tst_QMenuBar::check_cursorKeys3()
// Let's see if the correct slot is called...
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 0); // this shouldn't have been called
- QCOMPARE(m_complexTriggerCount['b'], 1); // and this should have been called by a signal now
- QCOMPARE(m_complexTriggerCount['c'], 0);
- QCOMPARE(m_complexTriggerCount['d'], 0);
+ QCOMPARE(m_complexTriggerCount[int('a')], 0); // this shouldn't have been called
+ QCOMPARE(m_complexTriggerCount[int('b')], 1); // and this should have been called by a signal now
+ QCOMPARE(m_complexTriggerCount[int('c')], 0);
+ QCOMPARE(m_complexTriggerCount[int('d')], 0);
}
#endif
@@ -715,17 +716,17 @@ void tst_QMenuBar::check_homeKey()
// and press ENTER
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_Enter );
// Let's see if the correct slot is called...
-// QVERIFY2( m_complexActionTriggerCount['c'] == 1, "Popupmenu should respond to a Home key" );
- QCOMPARE(m_complexTriggerCount['c'], 1);
+// QVERIFY2( m_complexActionTriggerCount[int('c')] == 1, "Popupmenu should respond to a Home key" );
+ QCOMPARE(m_complexTriggerCount[int('c')], 1);
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 0);
- QCOMPARE(m_complexTriggerCount['b'], 0);
- QCOMPARE(m_complexTriggerCount['d'], 0);
- QCOMPARE(m_complexTriggerCount['e'], 0);
- QCOMPARE(m_complexTriggerCount['f'], 0);
- QCOMPARE(m_complexTriggerCount['g'], 0);
- QCOMPARE(m_complexTriggerCount['h'], 0);
+ QCOMPARE(m_complexTriggerCount[int('a')], 0);
+ QCOMPARE(m_complexTriggerCount[int('b')], 0);
+ QCOMPARE(m_complexTriggerCount[int('d')], 0);
+ QCOMPARE(m_complexTriggerCount[int('e')], 0);
+ QCOMPARE(m_complexTriggerCount[int('f')], 0);
+ QCOMPARE(m_complexTriggerCount[int('g')], 0);
+ QCOMPARE(m_complexTriggerCount[int('h')], 0);
}
/*!
@@ -754,17 +755,17 @@ void tst_QMenuBar::check_endKey()
// and press ENTER
QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_Enter );
// Let's see if the correct slot is called...
-// QVERIFY2( m_complexActionTriggerCount['h'] == 1, "Popupmenu should respond to an End key" );
- QCOMPARE(m_complexTriggerCount['h'], 1);//, "Popupmenu should respond to an End key");
+// QVERIFY2( m_complexActionTriggerCount[int('h')] == 1, "Popupmenu should respond to an End key" );
+ QCOMPARE(m_complexTriggerCount[int('h')], 1);//, "Popupmenu should respond to an End key");
QCOMPARE(m_complexTriggerCount[3], 0);
QCOMPARE(m_complexTriggerCount[4], 0);
- QCOMPARE(m_complexTriggerCount['a'], 0);
- QCOMPARE(m_complexTriggerCount['b'], 0);
- QCOMPARE(m_complexTriggerCount['c'], 0);
- QCOMPARE(m_complexTriggerCount['d'], 0);
- QCOMPARE(m_complexTriggerCount['e'], 0);
- QCOMPARE(m_complexTriggerCount['f'], 0);
- QCOMPARE(m_complexTriggerCount['g'], 0);
+ QCOMPARE(m_complexTriggerCount[int('a')], 0);
+ QCOMPARE(m_complexTriggerCount[int('b')], 0);
+ QCOMPARE(m_complexTriggerCount[int('c')], 0);
+ QCOMPARE(m_complexTriggerCount[int('d')], 0);
+ QCOMPARE(m_complexTriggerCount[int('e')], 0);
+ QCOMPARE(m_complexTriggerCount[int('f')], 0);
+ QCOMPARE(m_complexTriggerCount[int('g')], 0);
}
/*!
@@ -808,7 +809,7 @@ void tst_QMenuBar::check_escKey()
// and press ENTER
QTest::keyClick( menu.menus.at(1), Qt::Key_Enter );
// Let's see if the correct slot is called...
- QVERIFY2( m_complexTriggerCount['c'] == 1, "Expected item 2C to be selected" );
+ QVERIFY2(m_complexTriggerCount[int('c')] == 1, "Expected item 2C to be selected");
}
#endif
@@ -978,6 +979,35 @@ void tst_QMenuBar::check_altPress()
QTRY_VERIFY( ::qobject_cast<QMenuBar *>(qApp->focusWidget()) );
}
+// QTBUG-47377: Pressing 'Alt' after opening a menu by pressing 'Alt+Accelerator'
+// should close it and QMenuBar::activeAction() should be 0.
+void tst_QMenuBar::check_altClosePress()
+{
+ const QStyle *style = QApplication::style();
+ if (!style->styleHint(QStyle::SH_MenuBar_AltKeyNavigation) ) {
+ QSKIP(("This test is not supposed to work in the " + style->objectName().toLatin1()
+ + " style. Skipping.").constData());
+ }
+
+ QMainWindow w;
+ w.setWindowTitle(QTest::currentTestFunction());
+ QMenu *menuFile = w.menuBar()->addMenu(tr("&File"));
+ menuFile->addAction("Quit");
+ QMenu *menuEdit = w.menuBar()->addMenu(tr("&Edit"));
+ menuEdit->addAction("Copy");
+
+ w.show();
+ w.move(QGuiApplication::primaryScreen()->availableGeometry().center());
+ QApplication::setActiveWindow(&w);
+ QVERIFY(QTest::qWaitForWindowActive(&w));
+
+ QTest::keyClick(&w, Qt::Key_F, Qt::AltModifier);
+ QTRY_VERIFY(menuFile->isVisible());
+ QTest::keyClick(menuFile, Qt::Key_Alt, Qt::AltModifier);
+ QTRY_VERIFY(!menuFile->isVisible());
+ QTRY_VERIFY(!w.menuBar()->activeAction());
+}
+
// Qt/Mac,WinCE does not use the native popups/menubar
#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
void tst_QMenuBar::check_shortcutPress()
diff --git a/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST b/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST
new file mode 100644
index 0000000000..725b8e93b4
--- /dev/null
+++ b/tests/auto/widgets/widgets/qopenglwidget/BLACKLIST
@@ -0,0 +1,2 @@
+[clearAndGrab]
+opensuse-13.1
diff --git a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
index e9f9c67856..a4a0045265 100644
--- a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
+++ b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
@@ -57,6 +57,8 @@ private slots:
void asViewport();
void requestUpdate();
void fboRedirect();
+ void showHide();
+ void nativeWindow();
};
void tst_QOpenGLWidget::create()
@@ -70,7 +72,7 @@ void tst_QOpenGLWidget::create()
QVERIFY(w->isValid());
QVERIFY(w->context());
- QVERIFY(w->context()->format() == w->format());
+ QCOMPARE(w->context()->format(), w->format());
QVERIFY(w->defaultFramebufferObject() != 0);
}
@@ -81,7 +83,8 @@ public:
: QOpenGLWidget(parent),
m_initCalled(false), m_paintCalled(false), m_resizeCalled(false),
m_resizeOk(false),
- m_w(expectedWidth), m_h(expectedHeight) { }
+ m_w(expectedWidth), m_h(expectedHeight),
+ r(1.0f), g(0.0f), b(0.0f) { }
void initializeGL() Q_DECL_OVERRIDE {
m_initCalled = true;
@@ -89,13 +92,16 @@ public:
}
void paintGL() Q_DECL_OVERRIDE {
m_paintCalled = true;
- glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
+ glClearColor(r, g, b, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
}
void resizeGL(int w, int h) Q_DECL_OVERRIDE {
m_resizeCalled = true;
m_resizeOk = w == m_w && h == m_h;
}
+ void setClearColor(float r, float g, float b) {
+ this->r = r; this->g = g; this->b = b;
+ }
bool m_initCalled;
bool m_paintCalled;
@@ -103,6 +109,7 @@ public:
bool m_resizeOk;
int m_w;
int m_h;
+ float r, g, b;
};
void tst_QOpenGLWidget::clearAndGrab()
@@ -304,7 +311,7 @@ void tst_QOpenGLWidget::asViewport()
// the widget stack.
btn->update();
qApp->processEvents();
- QVERIFY(view->paintCount() == 0);
+ QCOMPARE(view->paintCount(), 0);
}
class PaintCountWidget : public QOpenGLWidget
@@ -355,6 +362,69 @@ void tst_QOpenGLWidget::fboRedirect()
QVERIFY(reportedDefaultFbo != widgetFbo);
}
+void tst_QOpenGLWidget::showHide()
+{
+ QScopedPointer<ClearWidget> w(new ClearWidget(0, 800, 600));
+ w->resize(800, 600);
+ w->show();
+ QTest::qWaitForWindowExposed(w.data());
+
+ w->hide();
+
+ QImage image = w->grabFramebuffer();
+ QVERIFY(!image.isNull());
+ QCOMPARE(image.width(), w->width());
+ QCOMPARE(image.height(), w->height());
+ QVERIFY(image.pixel(30, 40) == qRgb(255, 0, 0));
+
+ w->setClearColor(0, 0, 1);
+ w->show();
+ QTest::qWaitForWindowExposed(w.data());
+
+ image = w->grabFramebuffer();
+ QVERIFY(!image.isNull());
+ QCOMPARE(image.width(), w->width());
+ QCOMPARE(image.height(), w->height());
+ QVERIFY(image.pixel(30, 40) == qRgb(0, 0, 255));
+}
+
+void tst_QOpenGLWidget::nativeWindow()
+{
+ QScopedPointer<ClearWidget> w(new ClearWidget(0, 800, 600));
+ w->resize(800, 600);
+ w->show();
+ w->winId();
+ QTest::qWaitForWindowExposed(w.data());
+
+ QImage image = w->grabFramebuffer();
+ QVERIFY(!image.isNull());
+ QCOMPARE(image.width(), w->width());
+ QCOMPARE(image.height(), w->height());
+ QVERIFY(image.pixel(30, 40) == qRgb(255, 0, 0));
+ QVERIFY(w->internalWinId());
+
+ // Now as a native child.
+ QWidget nativeParent;
+ nativeParent.resize(800, 600);
+ nativeParent.setAttribute(Qt::WA_NativeWindow);
+ ClearWidget *child = new ClearWidget(0, 800, 600);
+ child->setClearColor(0, 1, 0);
+ child->setParent(&nativeParent);
+ child->resize(400, 400);
+ child->move(23, 34);
+ nativeParent.show();
+ QTest::qWaitForWindowExposed(&nativeParent);
+
+ QVERIFY(nativeParent.internalWinId());
+ QVERIFY(!child->internalWinId());
+
+ image = child->grabFramebuffer();
+ QVERIFY(!image.isNull());
+ QCOMPARE(image.width(), child->width());
+ QCOMPARE(image.height(), child->height());
+ QVERIFY(image.pixel(30, 40) == qRgb(0, 255, 0));
+}
+
QTEST_MAIN(tst_QOpenGLWidget)
#include "tst_qopenglwidget.moc"
diff --git a/tests/auto/widgets/widgets/qplaintextedit/qplaintextedit.pro b/tests/auto/widgets/widgets/qplaintextedit/qplaintextedit.pro
index e98bae2089..be4102ec75 100644
--- a/tests/auto/widgets/widgets/qplaintextedit/qplaintextedit.pro
+++ b/tests/auto/widgets/widgets/qplaintextedit/qplaintextedit.pro
@@ -9,3 +9,4 @@ INCLUDEPATH += ../
HEADERS +=
SOURCES += tst_qplaintextedit.cpp
+osx: LIBS += -framework AppKit
diff --git a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
index e7de6b0b75..2145260013 100644
--- a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
+++ b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
@@ -333,7 +333,7 @@ void tst_QPlainTextEdit::selectAllSetsNotSelection()
QSKIP("Test only relevant for systems with selection");
QApplication::clipboard()->setText(QString("foobar"), QClipboard::Selection);
- QVERIFY(QApplication::clipboard()->text(QClipboard::Selection) == QString("foobar"));
+ QCOMPARE(QApplication::clipboard()->text(QClipboard::Selection), QString("foobar"));
ed->insertPlainText("Hello World");
ed->selectAll();
@@ -905,13 +905,13 @@ void tst_QPlainTextEdit::mouseCursorShape()
{
// always show an IBeamCursor, see change 170146
QVERIFY(!ed->isReadOnly());
- QVERIFY(ed->viewport()->cursor().shape() == Qt::IBeamCursor);
+ QCOMPARE(ed->viewport()->cursor().shape(), Qt::IBeamCursor);
ed->setReadOnly(true);
- QVERIFY(ed->viewport()->cursor().shape() == Qt::IBeamCursor);
+ QCOMPARE(ed->viewport()->cursor().shape(), Qt::IBeamCursor);
ed->setPlainText("Foo");
- QVERIFY(ed->viewport()->cursor().shape() == Qt::IBeamCursor);
+ QCOMPARE(ed->viewport()->cursor().shape(), Qt::IBeamCursor);
}
#endif
@@ -1324,7 +1324,7 @@ void tst_QPlainTextEdit::preserveCharFormatAfterSetPlainText()
QTextBlock block = ed->document()->begin();
block = block.next();
QCOMPARE(block.text(), QString("This should still be blue"));
- QVERIFY(block.begin().fragment().charFormat().foreground().color() == QColor(Qt::blue));
+ QCOMPARE(block.begin().fragment().charFormat().foreground().color(), QColor(Qt::blue));
}
void tst_QPlainTextEdit::extraSelections()
@@ -1444,7 +1444,7 @@ void tst_QPlainTextEdit::wordWrapProperty()
doc->setDocumentLayout(new QPlainTextDocumentLayout(doc));
edit.setDocument(doc);
edit.setWordWrapMode(QTextOption::NoWrap);
- QVERIFY(doc->defaultTextOption().wrapMode() == QTextOption::NoWrap);
+ QCOMPARE(doc->defaultTextOption().wrapMode(), QTextOption::NoWrap);
}
{
QPlainTextEdit edit;
@@ -1452,18 +1452,18 @@ void tst_QPlainTextEdit::wordWrapProperty()
doc->setDocumentLayout(new QPlainTextDocumentLayout(doc));
edit.setWordWrapMode(QTextOption::NoWrap);
edit.setDocument(doc);
- QVERIFY(doc->defaultTextOption().wrapMode() == QTextOption::NoWrap);
+ QCOMPARE(doc->defaultTextOption().wrapMode(), QTextOption::NoWrap);
}
}
void tst_QPlainTextEdit::lineWrapProperty()
{
- QVERIFY(ed->wordWrapMode() == QTextOption::WrapAtWordBoundaryOrAnywhere);
- QVERIFY(ed->lineWrapMode() == QPlainTextEdit::WidgetWidth);
+ QCOMPARE(ed->wordWrapMode(), QTextOption::WrapAtWordBoundaryOrAnywhere);
+ QCOMPARE(ed->lineWrapMode(), QPlainTextEdit::WidgetWidth);
ed->setLineWrapMode(QPlainTextEdit::NoWrap);
- QVERIFY(ed->lineWrapMode() == QPlainTextEdit::NoWrap);
- QVERIFY(ed->wordWrapMode() == QTextOption::WrapAtWordBoundaryOrAnywhere);
- QVERIFY(ed->document()->defaultTextOption().wrapMode() == QTextOption::NoWrap);
+ QCOMPARE(ed->lineWrapMode(), QPlainTextEdit::NoWrap);
+ QCOMPARE(ed->wordWrapMode(), QTextOption::WrapAtWordBoundaryOrAnywhere);
+ QCOMPARE(ed->document()->defaultTextOption().wrapMode(), QTextOption::NoWrap);
}
void tst_QPlainTextEdit::selectionChanged()
@@ -1560,7 +1560,7 @@ void tst_QPlainTextEdit::findWithRegExp()
bool found = ed->find(rx);
- QVERIFY(found == true);
+ QVERIFY(found);
QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("text"));
}
@@ -1574,7 +1574,7 @@ void tst_QPlainTextEdit::findBackwardWithRegExp()
bool found = ed->find(rx, QTextDocument::FindBackward);
- QVERIFY(found == true);
+ QVERIFY(found);
QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("arbit"));
}
@@ -1586,7 +1586,7 @@ void tst_QPlainTextEdit::findWithRegExpReturnsFalseIfNoMoreResults()
bool found = ed->find(rx);
- QVERIFY(found == false);
+ QVERIFY(!found);
QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("text"));
}
#endif
diff --git a/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp b/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp
index 4a5f9d535b..5455ebb830 100644
--- a/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp
+++ b/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp
@@ -267,7 +267,7 @@ void tst_QProgressBar::sizeHint()
//test if the sizeHint is big enough
QFontMetrics fm = bar.fontMetrics();
- QStyleOptionProgressBarV2 opt;
+ QStyleOptionProgressBar opt;
bar.initStyleOption(&opt);
QSize size = QSize(9 * 7 + fm.width(QLatin1Char('0')) * 4, fm.height() + 8);
size= bar.style()->sizeFromContents(QStyle::CT_ProgressBar, &opt, size, &bar);
diff --git a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
index 4fd8b99acf..44a554ad82 100644
--- a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
+++ b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
@@ -227,8 +227,8 @@ void tst_QPushButton::autoRepeat()
QVERIFY( testWidget->isDown() );
QVERIFY( toggle_count == 0 );
QTest::keyRelease( testWidget, Qt::Key_Space );
- QVERIFY(press_count == release_count);
- QVERIFY(release_count == click_count);
+ QCOMPARE(press_count, release_count);
+ QCOMPARE(release_count, click_count);
QVERIFY(press_count > 1);
// #### shouldn't I check here to see if multiple signals have been fired???
diff --git a/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp b/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp
index 40e13c8e8d..ce6afc0a57 100644
--- a/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp
+++ b/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp
@@ -166,8 +166,8 @@ void tst_QScrollArea::checkHFW_Task_197736()
scrollArea.setWidgetResizable(false);
scrollArea.resize(QSize(100,100));
w->resize(QSize(200,200));
- QVERIFY(w->width() == 200);
- QVERIFY(w->height() == 200);
+ QCOMPARE(w->width(), 200);
+ QCOMPARE(w->height(), 200);
}
QTEST_MAIN(tst_QScrollArea)
diff --git a/tests/auto/widgets/widgets/qsizegrip/BLACKLIST b/tests/auto/widgets/widgets/qsizegrip/BLACKLIST
new file mode 100644
index 0000000000..2c874bcb57
--- /dev/null
+++ b/tests/auto/widgets/widgets/qsizegrip/BLACKLIST
@@ -0,0 +1,2 @@
+[hideAndShowOnWindowStateChange:Qt::Window]
+xcb
diff --git a/tests/auto/widgets/widgets/qspinbox/BLACKLIST b/tests/auto/widgets/widgets/qspinbox/BLACKLIST
new file mode 100644
index 0000000000..5bf6c3beed
--- /dev/null
+++ b/tests/auto/widgets/widgets/qspinbox/BLACKLIST
@@ -0,0 +1,3 @@
+[editingFinished]
+osx-10.8
+osx-10.9
diff --git a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
index 05dd834c76..34b05c5291 100644
--- a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
+++ b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
@@ -165,6 +165,7 @@ Q_DECLARE_METATYPE(QLocale::Country)
void tst_QSpinBox::getSetCheck()
{
QSpinBox obj1;
+ QCOMPARE(obj1.inputMethodQuery(Qt::ImHints), QVariant(int(Qt::ImhDigitsOnly)));
// int QSpinBox::singleStep()
// void QSpinBox::setSingleStep(int)
obj1.setSingleStep(0);
@@ -202,6 +203,7 @@ void tst_QSpinBox::getSetCheck()
QCOMPARE(INT_MAX, obj1.value());
QDoubleSpinBox obj2;
+ QCOMPARE(obj2.inputMethodQuery(Qt::ImHints), QVariant(int(Qt::ImhFormattedNumbersOnly)));
// double QDoubleSpinBox::singleStep()
// void QDoubleSpinBox::setSingleStep(double)
obj2.setSingleStep(0.0);
diff --git a/tests/auto/widgets/widgets/qtabbar/BLACKLIST b/tests/auto/widgets/widgets/qtabbar/BLACKLIST
new file mode 100644
index 0000000000..5a3f33e3e4
--- /dev/null
+++ b/tests/auto/widgets/widgets/qtabbar/BLACKLIST
@@ -0,0 +1,3 @@
+[sizeHints]
+ubuntu-14.04
+redhatenterpriselinuxworkstation-6.6
diff --git a/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp b/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
index fffbbc2ec7..a991f18110 100644
--- a/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
+++ b/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
@@ -165,7 +165,7 @@ void tst_QTabWidget::init()
tw = new QTabWidget(0);
QCOMPARE(tw->count(), 0);
QCOMPARE(tw->currentIndex(), -1);
- QVERIFY(tw->currentWidget() == NULL);
+ QVERIFY(!tw->currentWidget());
}
void tst_QTabWidget::cleanup()
@@ -208,7 +208,7 @@ void tst_QTabWidget::addRemoveTab()
QCOMPARE(tw->count(), 0);
tw->removeTab(-1);
QCOMPARE(tw->count(), 0);
- QVERIFY(tw->widget(-1) == 0);
+ QVERIFY(!tw->widget(-1));
QWidget *w = new QWidget();
int index = tw->addTab(w, LABEL);
@@ -216,7 +216,7 @@ void tst_QTabWidget::addRemoveTab()
QCOMPARE(tw->indexOf(w), index);
QCOMPARE(tw->count(), 1);
- QVERIFY(tw->widget(index) == w);
+ QCOMPARE(tw->widget(index), w);
QCOMPARE(tw->tabText(index), QString(LABEL));
removePage(index);
@@ -238,7 +238,7 @@ void tst_QTabWidget::tabPosition()
void tst_QTabWidget::tabEnabled()
{
// Test bad arguments
- QVERIFY(tw->isTabEnabled(-1) == false);
+ QVERIFY(!tw->isTabEnabled(-1));
tw->setTabEnabled(-1, false);
int index = addPage();
@@ -333,21 +333,21 @@ void tst_QTabWidget::currentWidget()
{
// Test bad arguments
tw->setCurrentWidget(NULL);
- QVERIFY(tw->currentWidget() == NULL);
+ QVERIFY(!tw->currentWidget());
int index = addPage();
QWidget *w = tw->widget(index);
- QVERIFY(tw->currentWidget() == w);
+ QCOMPARE(tw->currentWidget(), w);
QCOMPARE(tw->currentIndex(), index);
tw->setCurrentWidget(NULL);
- QVERIFY(tw->currentWidget() == w);
+ QCOMPARE(tw->currentWidget(), w);
QCOMPARE(tw->currentIndex(), index);
int index2 = addPage();
QWidget *w2 = tw->widget(index2);
Q_UNUSED(w2);
- QVERIFY(tw->currentWidget() == w);
+ QCOMPARE(tw->currentWidget(), w);
QCOMPARE(tw->currentIndex(), index);
removePage(index2);
@@ -372,7 +372,7 @@ void tst_QTabWidget::currentIndex()
QCOMPARE(tw->currentIndex(), firstIndex);
QCOMPARE(spy.count(), 1);
QList<QVariant> arguments = spy.takeFirst();
- QVERIFY(arguments.at(0).toInt() == firstIndex);
+ QCOMPARE(arguments.at(0).toInt(), firstIndex);
int index = addPage();
QCOMPARE(tw->currentIndex(), firstIndex);
@@ -380,19 +380,19 @@ void tst_QTabWidget::currentIndex()
QCOMPARE(tw->currentIndex(), index);
QCOMPARE(spy.count(), 1);
arguments = spy.takeFirst();
- QVERIFY(arguments.at(0).toInt() == index);
+ QCOMPARE(arguments.at(0).toInt(), index);
removePage(index);
QCOMPARE(tw->currentIndex(), firstIndex);
QCOMPARE(spy.count(), 1);
arguments = spy.takeFirst();
- QVERIFY(arguments.at(0).toInt() == firstIndex);
+ QCOMPARE(arguments.at(0).toInt(), firstIndex);
removePage(firstIndex);
QCOMPARE(tw->currentIndex(), -1);
QCOMPARE(spy.count(), 1);
arguments = spy.takeFirst();
- QVERIFY(arguments.at(0).toInt() == -1);
+ QCOMPARE(arguments.at(0).toInt(), -1);
}
void tst_QTabWidget::cornerWidget()
@@ -400,24 +400,24 @@ void tst_QTabWidget::cornerWidget()
// Test bad arguments
tw->setCornerWidget(NULL, Qt::TopRightCorner);
- QVERIFY(tw->cornerWidget(Qt::TopLeftCorner) == 0);
- QVERIFY(tw->cornerWidget(Qt::TopRightCorner) == 0);
- QVERIFY(tw->cornerWidget(Qt::BottomLeftCorner) == 0);
- QVERIFY(tw->cornerWidget(Qt::BottomRightCorner) == 0);
+ QVERIFY(!tw->cornerWidget(Qt::TopLeftCorner));
+ QVERIFY(!tw->cornerWidget(Qt::TopRightCorner));
+ QVERIFY(!tw->cornerWidget(Qt::BottomLeftCorner));
+ QVERIFY(!tw->cornerWidget(Qt::BottomRightCorner));
QWidget *w = new QWidget(0);
tw->setCornerWidget(w, Qt::TopLeftCorner);
QCOMPARE(w->parent(), (QObject *)tw);
- QVERIFY(tw->cornerWidget(Qt::TopLeftCorner) == w);
+ QCOMPARE(tw->cornerWidget(Qt::TopLeftCorner), w);
tw->setCornerWidget(w, Qt::TopRightCorner);
- QVERIFY(tw->cornerWidget(Qt::TopRightCorner) == w);
+ QCOMPARE(tw->cornerWidget(Qt::TopRightCorner), w);
tw->setCornerWidget(w, Qt::BottomLeftCorner);
- QVERIFY(tw->cornerWidget(Qt::BottomLeftCorner) == w);
+ QCOMPARE(tw->cornerWidget(Qt::BottomLeftCorner), w);
tw->setCornerWidget(w, Qt::BottomRightCorner);
- QVERIFY(tw->cornerWidget(Qt::BottomRightCorner) == w);
+ QCOMPARE(tw->cornerWidget(Qt::BottomRightCorner), w);
tw->setCornerWidget(0, Qt::TopRightCorner);
- QVERIFY(tw->cornerWidget(Qt::TopRightCorner) == 0);
+ QVERIFY(!tw->cornerWidget(Qt::TopRightCorner));
QCOMPARE(w->isHidden(), true);
}
diff --git a/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp b/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp
index aaa7348bdf..adc768f828 100644
--- a/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp
+++ b/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp
@@ -141,14 +141,14 @@ void tst_QTextBrowser::noReloadOnAnchorJump()
browser->setSource(url);
QCOMPARE(browser->htmlLoadAttempts, 1);
QVERIFY(!browser->toPlainText().isEmpty());
- QVERIFY(browser->source() == url);
+ QCOMPARE(browser->source(), url);
}
void tst_QTextBrowser::bgColorOnSourceChange()
{
browser->setSource(QUrl::fromLocalFile("pagewithbg.html"));
QVERIFY(browser->document()->rootFrame()->frameFormat().hasProperty(QTextFormat::BackgroundBrush));
- QVERIFY(browser->document()->rootFrame()->frameFormat().background().color() == Qt::blue);
+ QCOMPARE(browser->document()->rootFrame()->frameFormat().background().color(), QColor(Qt::blue));
browser->setSource(QUrl::fromLocalFile("pagewithoutbg.html"));
QVERIFY(!browser->document()->rootFrame()->frameFormat().hasProperty(QTextFormat::BackgroundBrush));
@@ -167,13 +167,13 @@ void tst_QTextBrowser::forwardButton()
QVERIFY(!forwardEmissions.isEmpty());
QVariant val = forwardEmissions.takeLast()[0];
- QVERIFY(val.type() == QVariant::Bool);
- QVERIFY(val.toBool() == false);
+ QCOMPARE(val.type(), QVariant::Bool);
+ QVERIFY(!val.toBool());
QVERIFY(!backwardEmissions.isEmpty());
val = backwardEmissions.takeLast()[0];
- QVERIFY(val.type() == QVariant::Bool);
- QVERIFY(val.toBool() == false);
+ QCOMPARE(val.type(), QVariant::Bool);
+ QVERIFY(!val.toBool());
QVERIFY(browser->historyTitle(-1).isEmpty());
QCOMPARE(browser->historyUrl(0), QUrl::fromLocalFile("pagewithbg.html"));
@@ -185,13 +185,13 @@ void tst_QTextBrowser::forwardButton()
QVERIFY(!forwardEmissions.isEmpty());
val = forwardEmissions.takeLast()[0];
- QVERIFY(val.type() == QVariant::Bool);
- QVERIFY(val.toBool() == false);
+ QCOMPARE(val.type(), QVariant::Bool);
+ QVERIFY(!val.toBool());
QVERIFY(!backwardEmissions.isEmpty());
val = backwardEmissions.takeLast()[0];
- QVERIFY(val.type() == QVariant::Bool);
- QVERIFY(val.toBool() == true);
+ QCOMPARE(val.type(), QVariant::Bool);
+ QVERIFY(val.toBool());
QCOMPARE(browser->historyTitle(-1), QString("Page With BG"));
QCOMPARE(browser->historyTitle(0), QString("Sample Anchor"));
@@ -201,13 +201,13 @@ void tst_QTextBrowser::forwardButton()
QVERIFY(!forwardEmissions.isEmpty());
val = forwardEmissions.takeLast()[0];
- QVERIFY(val.type() == QVariant::Bool);
- QVERIFY(val.toBool() == true);
+ QCOMPARE(val.type(), QVariant::Bool);
+ QVERIFY(val.toBool());
QVERIFY(!backwardEmissions.isEmpty());
val = backwardEmissions.takeLast()[0];
- QVERIFY(val.type() == QVariant::Bool);
- QVERIFY(val.toBool() == false);
+ QCOMPARE(val.type(), QVariant::Bool);
+ QVERIFY(!val.toBool());
QVERIFY(browser->historyTitle(-1).isEmpty());
QCOMPARE(browser->historyTitle(0), QString("Page With BG"));
@@ -217,13 +217,13 @@ void tst_QTextBrowser::forwardButton()
QVERIFY(!forwardEmissions.isEmpty());
val = forwardEmissions.takeLast()[0];
- QVERIFY(val.type() == QVariant::Bool);
- QVERIFY(val.toBool() == false);
+ QCOMPARE(val.type(), QVariant::Bool);
+ QVERIFY(!val.toBool());
QVERIFY(!backwardEmissions.isEmpty());
val = backwardEmissions.takeLast()[0];
- QVERIFY(val.type() == QVariant::Bool);
- QVERIFY(val.toBool() == true);
+ QCOMPARE(val.type(), QVariant::Bool);
+ QVERIFY(val.toBool());
}
void tst_QTextBrowser::viewportPositionInHistory()
@@ -244,29 +244,29 @@ void tst_QTextBrowser::relativeLinks()
QSignalSpy sourceChangedSpy(browser, SIGNAL(sourceChanged(QUrl)));
browser->setSource(QUrl("subdir/../qtextbrowser.html"));
QVERIFY(!browser->document()->isEmpty());
- QVERIFY(sourceChangedSpy.count() == 1);
+ QCOMPARE(sourceChangedSpy.count(), 1);
QCOMPARE(sourceChangedSpy.takeFirst()[0].toUrl(), QUrl("subdir/../qtextbrowser.html"));
browser->setSource(QUrl("subdir/index.html"));
QVERIFY(!browser->document()->isEmpty());
- QVERIFY(sourceChangedSpy.count() == 1);
+ QCOMPARE(sourceChangedSpy.count(), 1);
QCOMPARE(sourceChangedSpy.takeFirst()[0].toUrl(), QUrl("subdir/index.html"));
browser->setSource(QUrl("anchor.html"));
QVERIFY(!browser->document()->isEmpty());
- QVERIFY(sourceChangedSpy.count() == 1);
+ QCOMPARE(sourceChangedSpy.count(), 1);
QCOMPARE(sourceChangedSpy.takeFirst()[0].toUrl(), QUrl("anchor.html"));
browser->setSource(QUrl("subdir/index.html"));
QVERIFY(!browser->document()->isEmpty());
- QVERIFY(sourceChangedSpy.count() == 1);
+ QCOMPARE(sourceChangedSpy.count(), 1);
QCOMPARE(sourceChangedSpy.takeFirst()[0].toUrl(), QUrl("subdir/index.html"));
// using QUrl::fromLocalFile()
browser->setSource(QUrl::fromLocalFile("anchor.html"));
QVERIFY(!browser->document()->isEmpty());
- QVERIFY(sourceChangedSpy.count() == 1);
+ QCOMPARE(sourceChangedSpy.count(), 1);
QCOMPARE(sourceChangedSpy.takeFirst()[0].toUrl(), QUrl("file:anchor.html"));
browser->setSource(QUrl("subdir/../qtextbrowser.html"));
QVERIFY(!browser->document()->isEmpty());
- QVERIFY(sourceChangedSpy.count() == 1);
+ QCOMPARE(sourceChangedSpy.count(), 1);
QCOMPARE(sourceChangedSpy.takeFirst()[0].toUrl(), QUrl("subdir/../qtextbrowser.html"));
}
@@ -446,13 +446,13 @@ void tst_QTextBrowser::sourceInsideLoadResource()
void tst_QTextBrowser::textInteractionFlags_vs_readOnly()
{
QVERIFY(browser->isReadOnly());
- QVERIFY(browser->textInteractionFlags() == Qt::TextBrowserInteraction);
+ QCOMPARE(browser->textInteractionFlags(), Qt::TextBrowserInteraction);
browser->setReadOnly(true);
- QVERIFY(browser->textInteractionFlags() == Qt::TextBrowserInteraction);
+ QCOMPARE(browser->textInteractionFlags(), Qt::TextBrowserInteraction);
browser->setReadOnly(false);
- QVERIFY(browser->textInteractionFlags() == Qt::TextEditorInteraction);
+ QCOMPARE(browser->textInteractionFlags(), Qt::TextEditorInteraction);
browser->setReadOnly(true);
- QVERIFY(browser->textInteractionFlags() == Qt::TextBrowserInteraction);
+ QCOMPARE(browser->textInteractionFlags(), Qt::TextBrowserInteraction);
}
void tst_QTextBrowser::anchorsWithSelfBuiltHtml()
@@ -525,7 +525,7 @@ void tst_QTextBrowser::loadResourceOnRelativeLocalFiles()
QVERIFY(!browser->toPlainText().isEmpty());
QVariant v = browser->loadResource(QTextDocument::HtmlResource, QUrl("../anchor.html"));
QVERIFY(v.isValid());
- QVERIFY(v.type() == QVariant::ByteArray);
+ QCOMPARE(v.type(), QVariant::ByteArray);
QVERIFY(!v.toByteArray().isEmpty());
}
@@ -658,7 +658,7 @@ void tst_QTextBrowser::urlEncoding()
QCOMPARE(spy.count(), 1);
QUrl url = spy.at(0).at(0).toUrl();
- QVERIFY(url.toEncoded() == QByteArray("http://www.google.com/q=%22"));
+ QCOMPARE(url.toEncoded(), QByteArray("http://www.google.com/q=%22"));
delete browser;
}
diff --git a/tests/auto/widgets/widgets/qtextedit/qtextedit.pro b/tests/auto/widgets/widgets/qtextedit/qtextedit.pro
index 6e0fff17d5..8b39ab59b7 100644
--- a/tests/auto/widgets/widgets/qtextedit/qtextedit.pro
+++ b/tests/auto/widgets/widgets/qtextedit/qtextedit.pro
@@ -4,3 +4,5 @@ TARGET = tst_qtextedit
QT += widgets widgets-private gui-private core-private testlib
SOURCES += tst_qtextedit.cpp
+
+osx: LIBS += -framework AppKit
diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
index 35a6a8e4e0..0cc812cbca 100644
--- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
+++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
@@ -398,12 +398,13 @@ void tst_QTextEdit::cleanup()
void tst_QTextEdit::inlineAttributesOnInsert()
{
- QVERIFY(ed->textCursor().charFormat().foreground().color() != Qt::blue);
+ const QColor blue(Qt::blue);
+ QVERIFY(ed->textCursor().charFormat().foreground().color() != blue);
- ed->setTextColor(Qt::blue);
+ ed->setTextColor(blue);
QTest::keyClick(ed, Qt::Key_A);
- QVERIFY(ed->textCursor().charFormat().foreground().color() == Qt::blue);
+ QCOMPARE(ed->textCursor().charFormat().foreground().color(), blue);
}
void tst_QTextEdit::inlineAttributesOnSelection()
@@ -457,7 +458,7 @@ void tst_QTextEdit::autoBulletList1()
QTest::keyClicks(ed, "*This should become a list");
QVERIFY(ed->textCursor().currentList());
- QVERIFY(ed->textCursor().currentList()->format().style() == QTextListFormat::ListDisc);
+ QCOMPARE(ed->textCursor().currentList()->format().style(), QTextListFormat::ListDisc);
}
void tst_QTextEdit::autoBulletList2()
@@ -582,7 +583,7 @@ void tst_QTextEdit::selectAllSetsNotSelection()
}
QApplication::clipboard()->setText(QString("foobar"), QClipboard::Selection);
- QVERIFY(QApplication::clipboard()->text(QClipboard::Selection) == QString("foobar"));
+ QCOMPARE(QApplication::clipboard()->text(QClipboard::Selection), QString("foobar"));
ed->insertPlainText("Hello World");
ed->selectAll();
@@ -867,11 +868,12 @@ void tst_QTextEdit::appendShouldUseCurrentFormat()
fmt.setFontItalic(true);
ed->setCurrentCharFormat(fmt);
ed->append("Hello");
+ const QColor blue(Qt::blue);
QTextCursor cursor(ed->document());
QVERIFY(cursor.movePosition(QTextCursor::NextCharacter));
- QVERIFY(cursor.charFormat().foreground().color() != Qt::blue);
+ QVERIFY(cursor.charFormat().foreground().color() != blue);
QVERIFY(!cursor.charFormat().fontItalic());
QVERIFY(cursor.movePosition(QTextCursor::NextBlock));
@@ -883,7 +885,7 @@ void tst_QTextEdit::appendShouldUseCurrentFormat()
}
QVERIFY(cursor.movePosition(QTextCursor::NextCharacter));
- QVERIFY(cursor.charFormat().foreground().color() == Qt::blue);
+ QCOMPARE(cursor.charFormat().foreground().color(), blue);
QVERIFY(cursor.charFormat().fontItalic());
}
@@ -1211,7 +1213,7 @@ void tst_QTextEdit::lineWrapModes()
{
ed->setLineWrapMode(QTextEdit::NoWrap);
// NoWrap at the same time as having all lines that are all left aligned means we optimize to only layout once. The effect is that the width is always 0
- QVERIFY(ed->document()->pageSize().width() == qreal(0));
+ QCOMPARE(ed->document()->pageSize().width(), qreal(0));
QTextCursor cursor = QTextCursor(ed->document());
cursor.insertText(QString("A simple line"));
@@ -1237,13 +1239,13 @@ void tst_QTextEdit::mouseCursorShape()
{
// always show an IBeamCursor, see change 170146
QVERIFY(!ed->isReadOnly());
- QVERIFY(ed->viewport()->cursor().shape() == Qt::IBeamCursor);
+ QCOMPARE(ed->viewport()->cursor().shape(), Qt::IBeamCursor);
ed->setReadOnly(true);
- QVERIFY(ed->viewport()->cursor().shape() == Qt::IBeamCursor);
+ QCOMPARE(ed->viewport()->cursor().shape(), Qt::IBeamCursor);
ed->setPlainText("Foo");
- QVERIFY(ed->viewport()->cursor().shape() == Qt::IBeamCursor);
+ QCOMPARE(ed->viewport()->cursor().shape(), Qt::IBeamCursor);
}
#endif
@@ -1661,7 +1663,7 @@ void tst_QTextEdit::preserveCharFormatAfterSetPlainText()
QTextBlock block = ed->document()->begin();
block = block.next();
QCOMPARE(block.text(), QString("This should still be blue"));
- QVERIFY(block.begin().fragment().charFormat().foreground().color() == QColor(Qt::blue));
+ QCOMPARE(block.begin().fragment().charFormat().foreground().color(), QColor(Qt::blue));
}
void tst_QTextEdit::extraSelections()
@@ -1796,25 +1798,25 @@ void tst_QTextEdit::wordWrapProperty()
QTextDocument *doc = new QTextDocument(&edit);
edit.setDocument(doc);
edit.setWordWrapMode(QTextOption::NoWrap);
- QVERIFY(doc->defaultTextOption().wrapMode() == QTextOption::NoWrap);
+ QCOMPARE(doc->defaultTextOption().wrapMode(), QTextOption::NoWrap);
}
{
QTextEdit edit;
QTextDocument *doc = new QTextDocument(&edit);
edit.setWordWrapMode(QTextOption::NoWrap);
edit.setDocument(doc);
- QVERIFY(doc->defaultTextOption().wrapMode() == QTextOption::NoWrap);
+ QCOMPARE(doc->defaultTextOption().wrapMode(), QTextOption::NoWrap);
}
}
void tst_QTextEdit::lineWrapProperty()
{
- QVERIFY(ed->wordWrapMode() == QTextOption::WrapAtWordBoundaryOrAnywhere);
- QVERIFY(ed->lineWrapMode() == QTextEdit::WidgetWidth);
+ QCOMPARE(ed->wordWrapMode(), QTextOption::WrapAtWordBoundaryOrAnywhere);
+ QCOMPARE(ed->lineWrapMode(), QTextEdit::WidgetWidth);
ed->setLineWrapMode(QTextEdit::NoWrap);
- QVERIFY(ed->lineWrapMode() == QTextEdit::NoWrap);
- QVERIFY(ed->wordWrapMode() == QTextOption::WrapAtWordBoundaryOrAnywhere);
- QVERIFY(ed->document()->defaultTextOption().wrapMode() == QTextOption::NoWrap);
+ QCOMPARE(ed->lineWrapMode(), QTextEdit::NoWrap);
+ QCOMPARE(ed->wordWrapMode(), QTextOption::WrapAtWordBoundaryOrAnywhere);
+ QCOMPARE(ed->document()->defaultTextOption().wrapMode(), QTextOption::NoWrap);
}
void tst_QTextEdit::selectionChanged()
@@ -2122,7 +2124,7 @@ void tst_QTextEdit::setDocumentPreservesPalette()
QTextDocument *newDoc = new QTextDocument(ed);
ed->setDocument(newDoc);
- QVERIFY(control->document() == newDoc);
+ QCOMPARE(control->document(), newDoc);
QVERIFY(whitePal.color(QPalette::Active, QPalette::Text)
== control->palette().color(QPalette::Active, QPalette::Text));
}
@@ -2525,7 +2527,7 @@ void tst_QTextEdit::findWithRegExp()
bool found = ed->find(rx);
- QVERIFY(found == true);
+ QVERIFY(found);
QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("text"));
}
@@ -2539,7 +2541,7 @@ void tst_QTextEdit::findBackwardWithRegExp()
bool found = ed->find(rx, QTextDocument::FindBackward);
- QVERIFY(found == true);
+ QVERIFY(found);
QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("arbit"));
}
@@ -2551,7 +2553,7 @@ void tst_QTextEdit::findWithRegExpReturnsFalseIfNoMoreResults()
bool found = ed->find(rx);
- QVERIFY(found == false);
+ QVERIFY(!found);
QCOMPARE(ed->textCursor().selectedText(), QStringLiteral("text"));
}
#endif
diff --git a/tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp b/tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp
index 24de35ce89..e653a85d96 100644
--- a/tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp
+++ b/tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp
@@ -67,6 +67,7 @@ private slots:
void allowedAreas();
void orientation();
void addAction();
+ void addActionConnect();
void insertAction();
void addSeparator();
void insertSeparator();
@@ -361,6 +362,23 @@ void tst_QToolBar::addAction()
}
}
+static void testFunction() { }
+
+void tst_QToolBar::addActionConnect()
+{
+ QToolBar tb;
+ const QString text = QLatin1String("bla");
+ const QIcon icon;
+ tb.addAction(text, &tb, SLOT(deleteLater()));
+ tb.addAction(text, &tb, &QMenu::deleteLater);
+ tb.addAction(text, testFunction);
+ tb.addAction(text, &tb, testFunction);
+ tb.addAction(icon, text, &tb, SLOT(deleteLater()));
+ tb.addAction(icon, text, &tb, &QMenu::deleteLater);
+ tb.addAction(icon, text, testFunction);
+ tb.addAction(icon, text, &tb, testFunction);
+}
+
void tst_QToolBar::insertAction()
{
QToolBar tb;
@@ -495,13 +513,13 @@ void tst_QToolBar::insertWidget()
QToolBar tb;
QPointer<QWidget> widget = new QWidget;
QAction *action = tb.addWidget(widget);
- QVERIFY(action->parent() == &tb);
+ QCOMPARE(action->parent(), &tb);
QToolBar tb2;
tb.removeAction(action);
tb2.addAction(action);
QVERIFY(widget && widget->parent() == &tb2);
- QVERIFY(action->parent() == &tb2);
+ QCOMPARE(action->parent(), &tb2);
}
}
@@ -960,10 +978,10 @@ void tst_QToolBar::actionOwnership()
QToolBar *tb2 = new QToolBar;
QPointer<QAction> action = tb1->addAction("test");
- QVERIFY(action->parent() == tb1);
+ QCOMPARE(action->parent(), tb1);
tb2->addAction(action);
- QVERIFY(action->parent() == tb1);
+ QCOMPARE(action->parent(), tb1);
delete tb1;
QVERIFY(!action);
@@ -974,13 +992,13 @@ void tst_QToolBar::actionOwnership()
QToolBar *tb2 = new QToolBar;
QPointer<QAction> action = tb1->addAction("test");
- QVERIFY(action->parent() == tb1);
+ QCOMPARE(action->parent(), tb1);
tb1->removeAction(action);
- QVERIFY(action->parent() == tb1);
+ QCOMPARE(action->parent(), tb1);
tb2->addAction(action);
- QVERIFY(action->parent() == tb1);
+ QCOMPARE(action->parent(), tb1);
delete tb1;
QVERIFY(!action);
diff --git a/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp b/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp
index 03fbae2e57..0d1abe5032 100644
--- a/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp
+++ b/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp
@@ -170,10 +170,10 @@ void tst_QToolButton::collapseTextOnPriority()
QStyleOptionToolButton option;
button.initStyleOption(&option);
- QVERIFY(option.toolButtonStyle == Qt::ToolButtonTextBesideIcon);
+ QCOMPARE(option.toolButtonStyle, Qt::ToolButtonTextBesideIcon);
action.setPriority(QAction::LowPriority);
button.initStyleOption(&option);
- QVERIFY(option.toolButtonStyle == Qt::ToolButtonIconOnly);
+ QCOMPARE(option.toolButtonStyle, Qt::ToolButtonIconOnly);
}
diff --git a/tests/auto/xml/dom/qdom/tst_qdom.cpp b/tests/auto/xml/dom/qdom/tst_qdom.cpp
index 2ce32c7cf2..04cd0b300f 100644
--- a/tests/auto/xml/dom/qdom/tst_qdom.cpp
+++ b/tests/auto/xml/dom/qdom/tst_qdom.cpp
@@ -119,6 +119,7 @@ private slots:
void cloneDTD_QTBUG8398() const;
void DTDNotationDecl();
void DTDEntityDecl();
+ void QTBUG49113_dontCrashWithNegativeIndex() const;
void cleanupTestCase() const;
@@ -1043,15 +1044,15 @@ void tst_QDom::browseElements()
QVERIFY(!bar.isNull());
QVERIFY(bar.previousSiblingElement("bar").isNull());
QVERIFY(bar.previousSiblingElement().isNull());
- QVERIFY(bar.nextSiblingElement("bar").tagName() == "bar");
+ QCOMPARE(bar.nextSiblingElement("bar").tagName(), QLatin1String("bar"));
QVERIFY(bar.nextSiblingElement("bar").nextSiblingElement("bar").isNull());
QDomElement bop = foo.firstChildElement("bop");
QVERIFY(!bop.isNull());
- QVERIFY(bar.nextSiblingElement() == bop);
- QVERIFY(bop.nextSiblingElement("bop") == foo.lastChildElement("bop"));
- QVERIFY(bop.previousSiblingElement("bar") == foo.firstChildElement("bar"));
- QVERIFY(bop.previousSiblingElement("bar") == foo.firstChildElement());
+ QCOMPARE(bar.nextSiblingElement(), bop);
+ QCOMPARE(bop.nextSiblingElement("bop"), foo.lastChildElement("bop"));
+ QCOMPARE(bop.previousSiblingElement("bar"), foo.firstChildElement("bar"));
+ QCOMPARE(bop.previousSiblingElement("bar"), foo.firstChildElement());
}
void tst_QDom::domNodeMapAndList()
@@ -1979,5 +1980,13 @@ void tst_QDom::DTDEntityDecl()
QCOMPARE(doctype.namedItem(QString("logo")).toEntity().notationName(), QString("gif"));
}
+void tst_QDom::QTBUG49113_dontCrashWithNegativeIndex() const
+{
+ QDomDocument doc;
+ QDomElement elem = doc.appendChild(doc.createElement("root")).toElement();
+ QDomNode node = elem.attributes().item(-1);
+ QVERIFY(node.isNull());
+}
+
QTEST_MAIN(tst_QDom)
#include "tst_qdom.moc"
diff --git a/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp b/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp
index 04f19f6a2b..a5ac58878e 100644
--- a/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp
+++ b/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp
@@ -147,7 +147,7 @@ public slots:
void requestFinished(QNetworkReply *reply)
{
- QVERIFY(reply->error() == QNetworkReply::NoError);
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
reply->deleteLater();
}
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.ent
index 1cff3fd44f..1cff3fd44f 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/001.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.ent
index 45f6d8e74e..45f6d8e74e 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/002.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.ent
index 3436f20001..3436f20001 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/004.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.ent
index c6e97f821f..c6e97f821f 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/005.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.ent
index 4df2f0c2ac..4df2f0c2ac 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/006.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.ent
index ab1d696dd7..ab1d696dd7 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/007.ent
Binary files differ
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.ent
index c6ca61f9c8..c6ca61f9c8 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/008.ent
Binary files differ
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.ent
index 67c3297611..67c3297611 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/009.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.ent
index b19be3a497..b19be3a497 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/011.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.ent
index 8eb1fb9c41..8eb1fb9c41 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/012.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.ent
index 7f25c502dd..7f25c502dd 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/013.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.ent
index 470fd6fe44..470fd6fe44 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/ext-sa/014.ent
Binary files differ
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.ent
index 67c3297611..67c3297611 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/002.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003-1.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003-1.ent
index 931f3ad6d8..931f3ad6d8 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003-1.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/003-1.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-1.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-1.ent
index 40f7ff58a2..40f7ff58a2 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-1.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-1.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-2.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-2.ent
index 61def75cb7..61def75cb7 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-2.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/004-2.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-1.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-1.ent
index ade9599032..ade9599032 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-1.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-1.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-2.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-2.ent
index bef50b1f38..bef50b1f38 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-2.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/005-2.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.ent
index 8f305a82bd..8f305a82bd 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/006.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.ent
index fbf4ca4947..fbf4ca4947 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/007.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.ent
index fbf4ca4947..fbf4ca4947 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/008.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.ent
index fbf4ca4947..fbf4ca4947 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/009.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.ent
index 52a28f5deb..52a28f5deb 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/010.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.ent
index fbf4ca4947..fbf4ca4947 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/011.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.ent
index 7e372e65e9..7e372e65e9 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/012.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.ent
index a3691d9f08..a3691d9f08 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/013.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.ent
index 6eaf779329..6eaf779329 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/014.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.ent
index 00d2f30e1d..00d2f30e1d 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/015.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.ent
index bf77ef8336..bf77ef8336 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/016.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.ent
index ffd9adde61..ffd9adde61 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/017.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.ent
index 2d46f76fc3..2d46f76fc3 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/018.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.ent
index d18201a98b..d18201a98b 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/019.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.ent
index 815291c6d2..815291c6d2 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/020.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.ent
index 9f8f2afd2b..9f8f2afd2b 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/021.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.ent
index 26f2d8beb2..26f2d8beb2 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/022.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.ent
index e3268819f7..e3268819f7 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/023.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.ent
index aa6d0eccac..aa6d0eccac 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/024.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.ent
index 389d259eb1..389d259eb1 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/025.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.ent
index bdc93af639..bdc93af639 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/026.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.ent
index 712cce3700..712cce3700 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/027.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.ent
index ac249d7b2c..ac249d7b2c 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/028.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.ent
index df94df5560..df94df5560 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/029.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.ent
index e3864460df..e3864460df 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/030.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-1.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-1.ent
index f7f94ab152..f7f94ab152 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-1.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-1.ent
diff --git a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-2.ent b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-2.ent
index bef50b1f38..bef50b1f38 100755..100644
--- a/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-2.ent
+++ b/tests/auto/xml/sax/qxmlsimplereader/xmldocs/valid/not-sa/031-2.ent