summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/auto.pro2
-rw-r--r--tests/auto/compilerwarnings/data/test_cpp.txt2
-rw-r--r--tests/auto/corelib/animation/qabstractanimation/tst_qabstractanimation.cpp81
-rw-r--r--tests/auto/corelib/animation/qanimationgroup/tst_qanimationgroup.cpp7
-rw-r--r--tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp24
-rw-r--r--tests/auto/corelib/animation/qpauseanimation/tst_qpauseanimation.cpp2
-rw-r--r--tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp23
-rw-r--r--tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp25
-rw-r--r--tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp2
-rw-r--r--tests/auto/corelib/codecs/qtextcodec/echo/main.cpp5
-rw-r--r--tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp21
-rw-r--r--tests/auto/corelib/codecs/utf8/tst_utf8.cpp2
-rw-r--r--tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp2
-rw-r--r--tests/auto/corelib/concurrent/qfuturesynchronizer/tst_qfuturesynchronizer.cpp2
-rw-r--r--tests/auto/corelib/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp46
-rw-r--r--tests/auto/corelib/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp6
-rw-r--r--tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp2
-rw-r--r--tests/auto/corelib/concurrent/qtconcurrentmap/functions.h2
-rw-r--r--tests/auto/corelib/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp6
-rw-r--r--tests/auto/corelib/concurrent/qtconcurrentresultstore/tst_qtconcurrentresultstore.cpp2
-rw-r--r--tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp2
-rw-r--r--tests/auto/corelib/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp29
-rw-r--r--tests/auto/corelib/concurrent/qthreadpool/tst_qthreadpool.cpp9
-rw-r--r--tests/auto/corelib/corelib.pro1
-rw-r--r--tests/auto/corelib/global/q_func_info/tst_q_func_info.cpp2
-rw-r--r--tests/auto/corelib/global/qflags/tst_qflags.cpp2
-rw-r--r--tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp2
-rw-r--r--tests/auto/corelib/global/qglobal/tst_qglobal.cpp2
-rw-r--r--tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp2
-rw-r--r--tests/auto/corelib/global/qrand/tst_qrand.cpp2
-rw-r--r--tests/auto/corelib/io/io.pro2
-rw-r--r--tests/auto/corelib/io/largefile/largefile.pro (renamed from tests/auto/corelib/io/qfile/largefile/largefile.pro)0
-rw-r--r--tests/auto/corelib/io/largefile/tst_largefile.cpp (renamed from tests/auto/corelib/io/qfile/largefile/tst_largefile.cpp)2
-rw-r--r--tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp2
-rw-r--r--tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp2
-rw-r--r--tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp97
-rw-r--r--tests/auto/corelib/io/qdebug/tst_qdebug.cpp42
-rw-r--r--tests/auto/corelib/io/qdir/testdir/dir/qrc_qdir.cpp2
-rw-r--r--tests/auto/corelib/io/qdir/testdir/dir/tst_qdir.cpp2
-rw-r--r--tests/auto/corelib/io/qdir/tst_qdir.cpp28
-rw-r--r--tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp2
-rw-r--r--tests/auto/corelib/io/qfile/qfile.pro2
-rw-r--r--tests/auto/corelib/io/qfile/stdinprocess/main.cpp5
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp39
-rw-r--r--tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp55
-rw-r--r--tests/auto/corelib/io/qfilesystementry/tst_qfilesystementry.cpp2
-rw-r--r--tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp150
-rw-r--r--tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp4
-rw-r--r--tests/auto/corelib/io/qnodebug/qnodebug.pro4
-rw-r--r--tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp (renamed from tests/auto/v8/tst_v8.cpp)72
-rw-r--r--tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro4
-rw-r--r--tests/auto/corelib/io/qprocess/fileWriterProcess/main.cpp5
-rw-r--r--tests/auto/corelib/io/qprocess/qprocess.pri17
-rw-r--r--tests/auto/corelib/io/qprocess/qprocess.pro29
-rw-r--r--tests/auto/corelib/io/qprocess/test/test.pro10
-rw-r--r--tests/auto/corelib/io/qprocess/testDetached/main.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/testDetached/testDetached.pro4
-rw-r--r--tests/auto/corelib/io/qprocess/testExitCodes/main.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro4
-rw-r--r--tests/auto/corelib/io/qprocess/testGuiProcess/main.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro5
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessCrash/main.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro4
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/main.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro6
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessEOF/main.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro4
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessEcho/main.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro6
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessEcho2/main.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro6
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessEcho3/main.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro6
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessEchoGui/main_win.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessEchoGui/testProcessEchoGui.pro6
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessEnvironment/main.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro4
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessLoopback/main.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro6
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessNormal/main.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro4
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessOutput/main.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro6
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessSpacesArgs/main.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessSpacesArgs/nospace.pro4
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessSpacesArgs/onespace.pro4
-rw-r--r--tests/auto/corelib/io/qprocess/testProcessSpacesArgs/twospaces.pro4
-rw-r--r--tests/auto/corelib/io/qprocess/testSetWorkingDirectory/main.cpp6
-rw-r--r--tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro5
-rw-r--r--tests/auto/corelib/io/qprocess/testSoftExit/main_unix.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/testSoftExit/main_win.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro4
-rw-r--r--tests/auto/corelib/io/qprocess/testSpaceInName/main.cpp2
-rw-r--r--tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro4
-rw-r--r--tests/auto/corelib/io/qprocess/tst_qprocess.cpp164
-rw-r--r--tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp2
-rw-r--r--tests/auto/corelib/io/qresourceengine/.gitignore1
-rw-r--r--tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp4
-rw-r--r--tests/auto/corelib/io/qsettings/tst_qsettings.cpp20
-rw-r--r--tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp2
-rw-r--r--tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp2
-rw-r--r--tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp2
-rw-r--r--tests/auto/corelib/io/qtextstream/readAllStdinProcess/main.cpp6
-rw-r--r--tests/auto/corelib/io/qtextstream/readLineStdinProcess/main.cpp7
-rw-r--r--tests/auto/corelib/io/qtextstream/stdinProcess/main.cpp5
-rw-r--r--tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp2
-rw-r--r--tests/auto/corelib/io/qurl/idna-test.c2
-rw-r--r--tests/auto/corelib/io/qurl/tst_qurl.cpp2
-rw-r--r--tests/auto/corelib/itemmodels/itemmodels.pro11
-rw-r--r--tests/auto/corelib/itemmodels/qabstractitemmodel/.gitignore (renamed from tests/auto/corelib/kernel/qabstractitemmodel/.gitignore)0
-rw-r--r--tests/auto/corelib/itemmodels/qabstractitemmodel/qabstractitemmodel.pro (renamed from tests/auto/corelib/kernel/qabstractitemmodel/qabstractitemmodel.pro)0
-rw-r--r--tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp (renamed from tests/auto/corelib/kernel/qabstractitemmodel/tst_qabstractitemmodel.cpp)411
-rw-r--r--tests/auto/corelib/itemmodels/qabstractproxymodel/.gitignore (renamed from tests/auto/widgets/itemviews/qabstractproxymodel/.gitignore)0
-rw-r--r--tests/auto/corelib/itemmodels/qabstractproxymodel/qabstractproxymodel.pro (renamed from tests/auto/widgets/itemviews/qabstractproxymodel/qabstractproxymodel.pro)0
-rw-r--r--tests/auto/corelib/itemmodels/qabstractproxymodel/tst_qabstractproxymodel.cpp (renamed from tests/auto/widgets/itemviews/qabstractproxymodel/tst_qabstractproxymodel.cpp)79
-rw-r--r--tests/auto/corelib/itemmodels/qidentityproxymodel/qidentityproxymodel.pro (renamed from tests/auto/widgets/itemviews/qidentityproxymodel/qidentityproxymodel.pro)0
-rw-r--r--tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp (renamed from tests/auto/widgets/itemviews/qidentityproxymodel/tst_qidentityproxymodel.cpp)40
-rw-r--r--tests/auto/corelib/itemmodels/qitemmodel/.gitignore (renamed from tests/auto/corelib/kernel/qitemmodel/.gitignore)0
-rw-r--r--tests/auto/corelib/itemmodels/qitemmodel/README (renamed from tests/auto/corelib/kernel/qitemmodel/README)0
-rw-r--r--tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp (renamed from tests/auto/corelib/kernel/qitemmodel/modelstotest.cpp)8
-rw-r--r--tests/auto/corelib/itemmodels/qitemmodel/qitemmodel.pro (renamed from tests/auto/corelib/kernel/qitemmodel/qitemmodel.pro)0
-rw-r--r--tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp (renamed from tests/auto/corelib/kernel/qitemmodel/tst_qitemmodel.cpp)21
-rw-r--r--tests/auto/corelib/itemmodels/qitemselectionmodel/.gitignore (renamed from tests/auto/widgets/itemviews/qitemselectionmodel/.gitignore)0
-rw-r--r--tests/auto/corelib/itemmodels/qitemselectionmodel/qitemselectionmodel.pro (renamed from tests/auto/widgets/itemviews/qitemselectionmodel/qitemselectionmodel.pro)2
-rw-r--r--tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp (renamed from tests/auto/widgets/itemviews/qitemselectionmodel/tst_qitemselectionmodel.cpp)742
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel/.gitignore (renamed from tests/auto/widgets/itemviews/qsortfilterproxymodel/.gitignore)0
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel/qsortfilterproxymodel.pro (renamed from tests/auto/widgets/itemviews/qsortfilterproxymodel/qsortfilterproxymodel.pro)0
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp (renamed from tests/auto/widgets/itemviews/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp)361
-rw-r--r--tests/auto/corelib/itemmodels/qstringlistmodel/.gitignore (renamed from tests/auto/widgets/itemviews/qstringlistmodel/.gitignore)0
-rw-r--r--tests/auto/corelib/itemmodels/qstringlistmodel/qmodellistener.h (renamed from tests/auto/widgets/itemviews/qstringlistmodel/qmodellistener.h)7
-rw-r--r--tests/auto/corelib/itemmodels/qstringlistmodel/qstringlistmodel.pro (renamed from tests/auto/widgets/itemviews/qstringlistmodel/qstringlistmodel.pro)6
-rw-r--r--tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp (renamed from tests/auto/widgets/itemviews/qstringlistmodel/tst_qstringlistmodel.cpp)76
-rw-r--r--tests/auto/corelib/kernel/kernel.pro4
-rw-r--r--tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp4
-rw-r--r--tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp12
-rw-r--r--tests/auto/corelib/kernel/qmath/tst_qmath.cpp2
-rw-r--r--tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp3
-rw-r--r--tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp12
-rw-r--r--tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp2
-rw-r--r--tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp48
-rw-r--r--tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp2
-rw-r--r--tests/auto/corelib/kernel/qobject/.gitignore4
-rw-r--r--tests/auto/corelib/kernel/qobject/moc_oldnormalizeobject.cpp2
-rw-r--r--tests/auto/corelib/kernel/qobject/oldnormalizeobject.h2
-rw-r--r--tests/auto/corelib/kernel/qobject/qobject.pro2
-rw-r--r--tests/auto/corelib/kernel/qobject/signalbug/signalbug.cpp (renamed from tests/auto/corelib/kernel/qobject/signalbug.cpp)2
-rw-r--r--tests/auto/corelib/kernel/qobject/signalbug/signalbug.h (renamed from tests/auto/corelib/kernel/qobject/signalbug.h)2
-rw-r--r--tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro (renamed from tests/auto/corelib/kernel/qobject/signalbug.pro)6
-rw-r--r--tests/auto/corelib/kernel/qobject/tst_qobject.cpp202
-rw-r--r--tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp6
-rw-r--r--tests/auto/corelib/kernel/qsignalmapper/tst_qsignalmapper.cpp2
-rw-r--r--tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp5
-rw-r--r--tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp2
-rw-r--r--tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp2
-rw-r--r--tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp120
-rw-r--r--tests/auto/corelib/kernel/qwineventnotifier/tst_qwineventnotifier.cpp2
-rw-r--r--tests/auto/corelib/plugin/qlibrary/.gitignore2
-rw-r--r--tests/auto/corelib/plugin/qlibrary/lib/mylib.c2
-rw-r--r--tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro4
-rw-r--r--tests/auto/corelib/plugin/qlibrary/lib2/mylib.c2
-rw-r--r--tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp12
-rw-r--r--tests/auto/corelib/plugin/qplugin/debugplugin/main.cpp2
-rw-r--r--tests/auto/corelib/plugin/qplugin/releaseplugin/main.cpp2
-rw-r--r--tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp2
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/almostplugin/almostplugin.cpp2
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/almostplugin/almostplugin.h2
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/lib/mylib.c2
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/theplugin/plugininterface.h2
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.cpp2
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.h2
-rw-r--r--tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp4
-rw-r--r--tests/auto/corelib/plugin/quuid/testProcessUniqueness/main.cpp2
-rw-r--r--tests/auto/corelib/plugin/quuid/tst_quuid.cpp61
-rw-r--r--tests/auto/corelib/statemachine/qstate/tst_qstate.cpp2
-rw-r--r--tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp81
-rw-r--r--tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp2
-rw-r--r--tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp2
-rw-r--r--tests/auto/corelib/thread/qmutex/tst_qmutex.cpp2
-rw-r--r--tests/auto/corelib/thread/qmutexlocker/tst_qmutexlocker.cpp2
-rw-r--r--tests/auto/corelib/thread/qreadlocker/tst_qreadlocker.cpp2
-rw-r--r--tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp2
-rw-r--r--tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp2
-rw-r--r--tests/auto/corelib/thread/qthread/tst_qthread.cpp17
-rw-r--r--tests/auto/corelib/thread/qthreadonce/qthreadonce.cpp2
-rw-r--r--tests/auto/corelib/thread/qthreadonce/qthreadonce.h2
-rw-r--r--tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp2
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/crashOnExit.cpp5
-rw-r--r--tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp8
-rw-r--r--tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp18
-rw-r--r--tests/auto/corelib/thread/qwritelocker/tst_qwritelocker.cpp2
-rw-r--r--tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp4
-rw-r--r--tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp2
-rw-r--r--tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp2
-rw-r--r--tests/auto/corelib/tools/qbytearraymatcher/tst_qbytearraymatcher.cpp2
-rw-r--r--tests/auto/corelib/tools/qcache/tst_qcache.cpp2
-rw-r--r--tests/auto/corelib/tools/qchar/tst_qchar.cpp2
-rw-r--r--tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp2
-rw-r--r--tests/auto/corelib/tools/qcryptographichash/data/2c1517dad3678f03917f15849b052fd5.md5bin0 -> 8375 bytes
-rw-r--r--tests/auto/corelib/tools/qcryptographichash/data/d41d8cd98f00b204e9800998ecf8427e.md50
-rw-r--r--tests/auto/corelib/tools/qcryptographichash/qcryptographichash.pro12
-rw-r--r--tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp36
-rw-r--r--tests/auto/corelib/tools/qdate/tst_qdate.cpp2
-rw-r--r--tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp2
-rw-r--r--tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp2
-rw-r--r--tests/auto/corelib/tools/qelapsedtimer/tst_qelapsedtimer.cpp2
-rw-r--r--tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp2
-rw-r--r--tests/auto/corelib/tools/qfreelist/tst_qfreelist.cpp2
-rw-r--r--tests/auto/corelib/tools/qhash/tst_qhash.cpp2
-rw-r--r--tests/auto/corelib/tools/qline/tst_qline.cpp2
-rw-r--r--tests/auto/corelib/tools/qlist/tst_qlist.cpp2
-rw-r--r--tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.cpp2
-rw-r--r--tests/auto/corelib/tools/qlocale/tst_qlocale.cpp2
-rw-r--r--tests/auto/corelib/tools/qmap/tst_qmap.cpp2
-rw-r--r--tests/auto/corelib/tools/qmargins/tst_qmargins.cpp2
-rw-r--r--tests/auto/corelib/tools/qpoint/tst_qpoint.cpp2
-rw-r--r--tests/auto/corelib/tools/qqueue/tst_qqueue.cpp2
-rw-r--r--tests/auto/corelib/tools/qrect/tst_qrect.cpp2
-rw-r--r--tests/auto/corelib/tools/qregexp/tst_qregexp.cpp6
-rw-r--r--tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp2
-rw-r--r--tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp2
-rw-r--r--tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp2
-rw-r--r--tests/auto/corelib/tools/qset/tst_qset.cpp6
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/externaltests.cpp2
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/externaltests.h2
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/forwarddeclaration.cpp2
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/forwarddeclared.cpp2
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/forwarddeclared.h2
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp88
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/wrapper.cpp2
-rw-r--r--tests/auto/corelib/tools/qsharedpointer/wrapper.h2
-rw-r--r--tests/auto/corelib/tools/qsize/tst_qsize.cpp2
-rw-r--r--tests/auto/corelib/tools/qsizef/tst_qsizef.cpp2
-rw-r--r--tests/auto/corelib/tools/qstl/tst_qstl.cpp2
-rw-r--r--tests/auto/corelib/tools/qstring/double_data.h2
-rw-r--r--tests/auto/corelib/tools/qstring/tst_qstring.cpp102
-rw-r--r--tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp2
-rw-r--r--tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp2
-rw-r--r--tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp2
-rw-r--r--tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp2
-rw-r--r--tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp2
-rw-r--r--tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp2
-rw-r--r--tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp16
-rw-r--r--tests/auto/corelib/tools/qstringref/tst_qstringref.cpp2
-rw-r--r--tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp2
-rw-r--r--tests/auto/corelib/tools/qtime/tst_qtime.cpp2
-rw-r--r--tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp14
-rw-r--r--tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp110
-rw-r--r--tests/auto/corelib/tools/qvector/tst_qvector.cpp2
-rw-r--r--tests/auto/corelib/xml/qxmlstream/qc14n.h2
-rwxr-xr-xtests/auto/corelib/xml/qxmlstream/setupSuite.sh2
-rw-r--r--tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp2
-rw-r--r--tests/auto/dbus/qdbusabstractadaptor/myobject.h2
-rw-r--r--tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp2
-rw-r--r--tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp2
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/interface.cpp2
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/interface.h2
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/pinger.cpp4
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/pinger.h4
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp2
-rw-r--r--tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp2
-rw-r--r--tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp2
-rw-r--r--tests/auto/dbus/qdbusconnection_no_bus/tst_qdbusconnection_no_bus.cpp2
-rw-r--r--tests/auto/dbus/qdbuscontext/tst_qdbuscontext.cpp2
-rw-r--r--tests/auto/dbus/qdbusinterface/myobject.h2
-rw-r--r--tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp2
-rw-r--r--tests/auto/dbus/qdbusinterface/tst_qdbusinterface.cpp2
-rw-r--r--tests/auto/dbus/qdbuslocalcalls/tst_qdbuslocalcalls.cpp2
-rw-r--r--tests/auto/dbus/qdbusmarshall/common.h2
-rw-r--r--tests/auto/dbus/qdbusmarshall/qpong/qpong.cpp2
-rw-r--r--tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp222
-rw-r--r--tests/auto/dbus/qdbusmetaobject/tst_qdbusmetaobject.cpp2
-rw-r--r--tests/auto/dbus/qdbusmetatype/tst_qdbusmetatype.cpp2
-rw-r--r--tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp2
-rw-r--r--tests/auto/dbus/qdbuspendingreply/tst_qdbuspendingreply.cpp2
-rw-r--r--tests/auto/dbus/qdbusreply/tst_qdbusreply.cpp2
-rw-r--r--tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp2
-rw-r--r--tests/auto/dbus/qdbusthreading/tst_qdbusthreading.cpp2
-rw-r--r--tests/auto/dbus/qdbustype/tst_qdbustype.cpp2
-rw-r--r--tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp2
-rw-r--r--tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp2
-rw-r--r--tests/auto/gui/image/qicon/tst_qicon.cpp2
-rw-r--r--tests/auto/gui/image/qimage/tst_qimage.cpp2
-rw-r--r--tests/auto/gui/image/qimageiohandler/tst_qimageiohandler.cpp2
-rw-r--r--[-rwxr-xr-x]tests/auto/gui/image/qimagereader/images/txts.pngbin5413 -> 5413 bytes
-rw-r--r--tests/auto/gui/image/qimagereader/qimagereader.pro12
-rw-r--r--tests/auto/gui/image/qimagereader/tst_qimagereader.cpp64
-rw-r--r--tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp2
-rw-r--r--tests/auto/gui/image/qmovie/qmovie.pro8
-rw-r--r--tests/auto/gui/image/qmovie/tst_qmovie.cpp4
-rw-r--r--tests/auto/gui/image/qpicture/tst_qpicture.cpp2
-rw-r--r--tests/auto/gui/image/qpixmap/tst_qpixmap.cpp12
-rw-r--r--tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp2
-rw-r--r--tests/auto/gui/image/qpixmapfilter/tst_qpixmapfilter.cpp2
-rw-r--r--tests/auto/gui/image/qvolatileimage/tst_qvolatileimage.cpp2
-rw-r--r--tests/auto/gui/kernel/qclipboard/copier/copier.pro1
-rw-r--r--tests/auto/gui/kernel/qclipboard/copier/main.cpp22
-rw-r--r--tests/auto/gui/kernel/qclipboard/paster/main.cpp21
-rw-r--r--tests/auto/gui/kernel/qclipboard/paster/paster.pro1
-rw-r--r--tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp155
-rw-r--r--tests/auto/gui/kernel/qdrag/tst_qdrag.cpp2
-rw-r--r--tests/auto/gui/kernel/qevent/tst_qevent.cpp2
-rw-r--r--tests/auto/gui/kernel/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.cpp2
-rw-r--r--tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp18
-rw-r--r--tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp28
-rw-r--r--tests/auto/gui/kernel/qguivariant/tst_qguivariant.cpp2
-rw-r--r--tests/auto/gui/kernel/qinputpanel/tst_qinputpanel.cpp28
-rw-r--r--tests/auto/gui/kernel/qkeysequence/qt_de.qmbin186240 -> 186240 bytes
-rw-r--r--tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp55
-rw-r--r--tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp10
-rw-r--r--tests/auto/gui/kernel/qmouseevent_modal/tst_qmouseevent_modal.cpp2
-rw-r--r--tests/auto/gui/kernel/qpalette/tst_qpalette.cpp2
-rw-r--r--tests/auto/gui/kernel/qscreen/tst_qscreen.cpp14
-rw-r--r--tests/auto/gui/kernel/qshortcut/tst_qshortcut.cpp16
-rw-r--r--tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp235
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp236
-rw-r--r--tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp2
-rw-r--r--tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp2
-rw-r--r--tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp2
-rw-r--r--tests/auto/gui/painting/qbrush/tst_qbrush.cpp2
-rw-r--r--tests/auto/gui/painting/qcolor/tst_qcolor.cpp2
-rw-r--r--tests/auto/gui/painting/qpaintengine/tst_qpaintengine.cpp2
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp28
-rw-r--r--tests/auto/gui/painting/qpainter/utils/createImages/main.cpp6
-rw-r--r--tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp2
-rw-r--r--tests/auto/gui/painting/qpainterpathstroker/tst_qpainterpathstroker.cpp2
-rw-r--r--tests/auto/gui/painting/qpathclipper/pathcompare.h2
-rw-r--r--tests/auto/gui/painting/qpathclipper/paths.cpp2
-rw-r--r--tests/auto/gui/painting/qpathclipper/paths.h2
-rw-r--r--tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp2
-rw-r--r--tests/auto/gui/painting/qpen/tst_qpen.cpp14
-rw-r--r--tests/auto/gui/painting/qpolygon/tst_qpolygon.cpp4
-rw-r--r--tests/auto/gui/painting/qprinter/tst_qprinter.cpp36
-rw-r--r--tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp2
-rw-r--r--tests/auto/gui/painting/qregion/tst_qregion.cpp2
-rw-r--r--tests/auto/gui/painting/qtransform/tst_qtransform.cpp2
-rw-r--r--tests/auto/gui/painting/qwmatrix/tst_qwmatrix.cpp2
-rw-r--r--tests/auto/gui/qopengl/tst_qopengl.cpp24
-rw-r--r--tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp2
-rw-r--r--tests/auto/gui/text/qcssparser/tst_qcssparser.cpp2
-rw-r--r--tests/auto/gui/text/qfont/tst_qfont.cpp2
-rw-r--r--tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp2
-rw-r--r--tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp2
-rw-r--r--tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp2
-rw-r--r--tests/auto/gui/text/qrawfont/qrawfont.pro6
-rw-r--r--tests/auto/gui/text/qrawfont/tst_qrawfont.cpp75
-rw-r--r--tests/auto/gui/text/qstatictext/tst_qstatictext.cpp2
-rw-r--r--tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp2
-rw-r--r--tests/auto/gui/text/qtextblock/tst_qtextblock.cpp2
-rw-r--r--tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp136
-rw-r--r--tests/auto/gui/text/qtextdocument/common.h2
-rw-r--r--tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp2
-rw-r--r--tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp2
-rw-r--r--tests/auto/gui/text/qtextdocumentlayout/tst_qtextdocumentlayout.cpp2
-rw-r--r--tests/auto/gui/text/qtextformat/tst_qtextformat.cpp39
-rw-r--r--tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp2
-rw-r--r--tests/auto/gui/text/qtextlist/tst_qtextlist.cpp2
-rw-r--r--tests/auto/gui/text/qtextobject/tst_qtextobject.cpp2
-rw-r--r--tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp2
-rw-r--r--tests/auto/gui/text/qtextpiecetable/tst_qtextpiecetable.cpp2
-rw-r--r--tests/auto/gui/text/qtextscriptengine/generate/main.cpp2
-rw-r--r--tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp2
-rw-r--r--tests/auto/gui/text/qtexttable/tst_qtexttable.cpp2
-rw-r--r--tests/auto/gui/text/qzip/tst_qzip.cpp2
-rw-r--r--tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp2
-rw-r--r--tests/auto/network-settings.h2
-rw-r--r--tests/auto/network/access/access.pro4
-rw-r--r--tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp14
-rw-r--r--tests/auto/network/access/qftp/tst_qftp.cpp40
-rw-r--r--tests/auto/network/access/qhttp/.gitattributes1
-rw-r--r--tests/auto/network/access/qhttp/.gitignore1
-rw-r--r--tests/auto/network/access/qhttp/dummyserver.h114
-rw-r--r--tests/auto/network/access/qhttp/qhttp.pro23
-rw-r--r--tests/auto/network/access/qhttp/rfc3252.txt899
-rw-r--r--tests/auto/network/access/qhttp/trolltech8
-rw-r--r--tests/auto/network/access/qhttp/tst_qhttp.cpp1565
-rwxr-xr-xtests/auto/network/access/qhttp/webserver/cgi-bin/retrieve_testfile.cgi6
-rwxr-xr-xtests/auto/network/access/qhttp/webserver/cgi-bin/rfc.cgi5
-rwxr-xr-xtests/auto/network/access/qhttp/webserver/cgi-bin/store_testfile.cgi6
-rw-r--r--tests/auto/network/access/qhttp/webserver/index.html899
-rw-r--r--tests/auto/network/access/qhttp/webserver/rfc3252899
-rw-r--r--tests/auto/network/access/qhttp/webserver/rfc3252.txt899
-rw-r--r--tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp2
-rw-r--r--tests/auto/network/access/qhttpnetworkreply/tst_qhttpnetworkreply.cpp2
-rw-r--r--tests/auto/network/access/qnetworkaccessmanager/tst_qnetworkaccessmanager.cpp10
-rw-r--r--tests/auto/network/access/qnetworkcachemetadata/tst_qnetworkcachemetadata.cpp2
-rw-r--r--tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp2
-rw-r--r--tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp3
-rw-r--r--tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp2
-rw-r--r--tests/auto/network/access/qnetworkreply/echo/main.cpp2
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp339
-rw-r--r--tests/auto/network/access/qnetworkrequest/tst_qnetworkrequest.cpp2
-rw-r--r--tests/auto/network/bearer/qbearertestcommon.h35
-rw-r--r--tests/auto/network/bearer/qnetworkconfiguration/qnetworkconfiguration.pro6
-rw-r--r--tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp129
-rw-r--r--tests/auto/network/bearer/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro6
-rw-r--r--tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp144
-rw-r--r--tests/auto/network/bearer/qnetworksession/lackey/main.cpp6
-rw-r--r--tests/auto/network/bearer/qnetworksession/test/test.pro6
-rw-r--r--tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp176
-rw-r--r--tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp2
-rw-r--r--tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp120
-rw-r--r--tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp4
-rw-r--r--tests/auto/network/kernel/qnetworkaddressentry/tst_qnetworkaddressentry.cpp2
-rw-r--r--tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp6
-rw-r--r--tests/auto/network/kernel/qnetworkproxy/tst_qnetworkproxy.cpp2
-rw-r--r--tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp2
-rw-r--r--tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp2
-rw-r--r--tests/auto/network/socket/qabstractsocket/tst_qabstractsocket.cpp2
-rw-r--r--tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp3
-rw-r--r--tests/auto/network/socket/qlocalsocket/example/client/main.cpp2
-rw-r--r--tests/auto/network/socket/qlocalsocket/example/server/main.cpp2
-rw-r--r--tests/auto/network/socket/qlocalsocket/lackey/main.cpp2
-rw-r--r--tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp7
-rw-r--r--tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro3
-rw-r--r--tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp3
-rw-r--r--tests/auto/network/socket/qtcpserver/crashingServer/main.cpp2
-rw-r--r--tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp6
-rw-r--r--tests/auto/network/socket/qtcpsocket/qtcpsocket.pro1
-rw-r--r--tests/auto/network/socket/qtcpsocket/stressTest/Test.cpp4
-rw-r--r--tests/auto/network/socket/qtcpsocket/stressTest/Test.h4
-rw-r--r--tests/auto/network/socket/qtcpsocket/stressTest/main.cpp2
-rw-r--r--tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp21
-rw-r--r--tests/auto/network/socket/qudpsocket/clientserver/main.cpp2
-rw-r--r--tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp6
-rw-r--r--tests/auto/network/socket/qudpsocket/udpServer/main.cpp2
-rw-r--r--tests/auto/network/socket/socket.pro9
-rwxr-xr-xtests/auto/network/ssl/qsslcertificate/certificates/gencertificates.sh2
-rw-r--r--tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp4
-rw-r--r--tests/auto/network/ssl/qsslcipher/tst_qsslcipher.cpp2
-rw-r--r--tests/auto/network/ssl/qsslerror/tst_qsslerror.cpp2
-rwxr-xr-xtests/auto/network/ssl/qsslkey/keys/genkeys.sh2
-rw-r--r--tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp2
-rw-r--r--tests/auto/network/ssl/qsslsocket/qsslsocket.pro3
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp20
-rw-r--r--tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp2
-rw-r--r--tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp2
-rw-r--r--tests/auto/network/ssl/ssl.pro5
-rw-r--r--tests/auto/opengl/qgl/tst_qgl.cpp2
-rw-r--r--tests/auto/opengl/qglbuffer/tst_qglbuffer.cpp2
-rw-r--r--tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp2
-rw-r--r--tests/auto/opengl/qglthreads/tst_qglthreads.cpp2
-rw-r--r--tests/auto/opengl/qglthreads/tst_qglthreads.h2
-rw-r--r--tests/auto/other/atwrapper/atWrapper.cpp2
-rw-r--r--tests/auto/other/atwrapper/atWrapper.h2
-rw-r--r--tests/auto/other/atwrapper/atWrapperAutotest.cpp2
-rw-r--r--tests/auto/other/baselineexample/tst_baselineexample.cpp2
-rw-r--r--tests/auto/other/collections/tst_collections.cpp2
-rw-r--r--tests/auto/other/compiler/baseclass.cpp2
-rw-r--r--tests/auto/other/compiler/baseclass.h2
-rw-r--r--tests/auto/other/compiler/derivedclass.cpp2
-rw-r--r--tests/auto/other/compiler/derivedclass.h2
-rw-r--r--tests/auto/other/compiler/tst_compiler.cpp2
-rw-r--r--tests/auto/other/exceptionsafety/tst_exceptionsafety.cpp2
-rw-r--r--tests/auto/other/exceptionsafety_objects/oomsimulator.h8
-rw-r--r--tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp2
-rw-r--r--tests/auto/other/gestures/tst_gestures.cpp2
-rw-r--r--tests/auto/other/headersclean/tst_headersclean.cpp2
-rw-r--r--tests/auto/other/lancelot/lancelot.pro3
-rw-r--r--tests/auto/other/lancelot/paintcommands.cpp2
-rw-r--r--tests/auto/other/lancelot/paintcommands.h2
-rw-r--r--tests/auto/other/lancelot/tst_lancelot.cpp13
-rw-r--r--tests/auto/other/languagechange/tst_languagechange.cpp84
-rw-r--r--tests/auto/other/macgui/guitest.cpp2
-rw-r--r--tests/auto/other/macgui/guitest.h2
-rw-r--r--tests/auto/other/macgui/tst_macgui.cpp2
-rw-r--r--tests/auto/other/macnativeevents/expectedeventlist.cpp2
-rw-r--r--tests/auto/other/macnativeevents/expectedeventlist.h2
-rw-r--r--tests/auto/other/macnativeevents/nativeeventlist.cpp2
-rw-r--r--tests/auto/other/macnativeevents/nativeeventlist.h2
-rw-r--r--tests/auto/other/macnativeevents/qnativeevents.cpp2
-rw-r--r--tests/auto/other/macnativeevents/qnativeevents.h2
-rw-r--r--tests/auto/other/macnativeevents/qnativeevents_mac.cpp2
-rw-r--r--tests/auto/other/macnativeevents/tst_macnativeevents.cpp2
-rw-r--r--tests/auto/other/macplist/app/main.cpp2
-rw-r--r--tests/auto/other/macplist/tst_macplist.cpp2
-rw-r--r--tests/auto/other/modeltest/modeltest.cpp2
-rw-r--r--tests/auto/other/modeltest/modeltest.h2
-rw-r--r--tests/auto/other/modeltest/tst_modeltest.cpp2
-rw-r--r--tests/auto/other/networkselftest/tst_networkselftest.cpp2
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp672
-rw-r--r--tests/auto/other/qcomplextext/bidireorderstring.h2
-rw-r--r--tests/auto/other/qcomplextext/tst_qcomplextext.cpp2
-rw-r--r--tests/auto/other/qdirectpainter/runDirectPainter/main.cpp2
-rw-r--r--tests/auto/other/qdirectpainter/tst_qdirectpainter.cpp2
-rw-r--r--tests/auto/other/qfocusevent/tst_qfocusevent.cpp22
-rw-r--r--tests/auto/other/qmultiscreen/tst_qmultiscreen.cpp2
-rw-r--r--tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp2
-rw-r--r--tests/auto/other/qobjectperformance/tst_qobjectperformance.cpp2
-rw-r--r--tests/auto/other/qobjectrace/tst_qobjectrace.cpp2
-rw-r--r--tests/auto/other/qsharedpointer_and_qwidget/tst_qsharedpointer_and_qwidget.cpp6
-rwxr-xr-xtests/auto/other/qtokenautomaton/generateTokenizers.sh2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/basic/basic.cpp2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/basic/basic.h2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/basicNamespace/basicNamespace.cpp2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/basicNamespace/basicNamespace.h2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.cpp2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.h2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.xml2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/noNamespace/noNamespace.cpp2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/noNamespace/noNamespace.h2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/noToString/noToString.cpp2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/noToString/noToString.h2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/withNamespace/withNamespace.cpp2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/withNamespace/withNamespace.h2
-rw-r--r--tests/auto/other/qtokenautomaton/tst_qtokenautomaton.cpp2
-rw-r--r--tests/auto/other/windowsmobile/test/ddhelper.cpp2
-rw-r--r--tests/auto/other/windowsmobile/test/ddhelper.h2
-rw-r--r--tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp2
-rw-r--r--tests/auto/other/windowsmobile/testQMenuBar/main.cpp2
-rw-r--r--tests/auto/platformquirks.h2
-rw-r--r--tests/auto/sql/kernel/qsql/tst_qsql.cpp2
-rw-r--r--tests/auto/sql/kernel/qsqldatabase/tst_databases.h2
-rw-r--r--tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp2
-rw-r--r--tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp2
-rw-r--r--tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp2
-rw-r--r--tests/auto/sql/kernel/qsqlfield/tst_qsqlfield.cpp2
-rw-r--r--tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp11
-rw-r--r--tests/auto/sql/kernel/qsqlrecord/tst_qsqlrecord.cpp2
-rw-r--r--tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp2
-rw-r--r--tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp2
-rw-r--r--tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp2
-rw-r--r--tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp2
-rwxr-xr-xtests/auto/test.pl2
-rw-r--r--tests/auto/testlib/qsignalspy/tst_qsignalspy.cpp2
-rw-r--r--tests/auto/testlib/selftests/.gitignore1
-rw-r--r--tests/auto/testlib/selftests/alive/qtestalive.cpp2
-rw-r--r--tests/auto/testlib/selftests/alive/tst_alive.cpp79
-rw-r--r--tests/auto/testlib/selftests/assert/tst_assert.cpp4
-rw-r--r--tests/auto/testlib/selftests/badxml/badxml.pro1
-rw-r--r--tests/auto/testlib/selftests/badxml/tst_badxml.cpp4
-rw-r--r--tests/auto/testlib/selftests/benchlibcallgrind/benchlibcallgrind.pro1
-rw-r--r--tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp4
-rw-r--r--tests/auto/testlib/selftests/benchlibeventcounter/benchlibeventcounter.pro1
-rw-r--r--tests/auto/testlib/selftests/benchlibeventcounter/tst_benchlibeventcounter.cpp7
-rw-r--r--tests/auto/testlib/selftests/benchliboptions/benchliboptions.pro1
-rw-r--r--tests/auto/testlib/selftests/benchliboptions/tst_benchliboptions.cpp7
-rw-r--r--tests/auto/testlib/selftests/benchlibtickcounter/tst_benchlibtickcounter.cpp4
-rw-r--r--tests/auto/testlib/selftests/benchlibwalltime/tst_benchlibwalltime.cpp4
-rw-r--r--tests/auto/testlib/selftests/cmptest/cmptest.pro3
-rw-r--r--tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp239
-rw-r--r--tests/auto/testlib/selftests/commandlinedata/commandlinedata.pro1
-rw-r--r--tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp4
-rw-r--r--tests/auto/testlib/selftests/crashes/crashes.pro1
-rw-r--r--tests/auto/testlib/selftests/crashes/tst_crashes.cpp4
-rw-r--r--tests/auto/testlib/selftests/datatable/datatable.pro1
-rw-r--r--tests/auto/testlib/selftests/datatable/tst_datatable.cpp4
-rw-r--r--tests/auto/testlib/selftests/datetime/datetime.pro1
-rw-r--r--tests/auto/testlib/selftests/datetime/tst_datetime.cpp7
-rw-r--r--tests/auto/testlib/selftests/differentexec/differentexec.pro1
-rw-r--r--tests/auto/testlib/selftests/differentexec/tst_differentexec.cpp2
-rw-r--r--tests/auto/testlib/selftests/exceptionthrow/exceptionthrow.pro1
-rw-r--r--tests/auto/testlib/selftests/exceptionthrow/tst_exceptionthrow.cpp2
-rw-r--r--tests/auto/testlib/selftests/expected_alive.txt22
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.lightxml94
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.txt62
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.xml94
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.xunitxml46
-rw-r--r--tests/auto/testlib/selftests/expected_expectfail.lightxml43
-rw-r--r--tests/auto/testlib/selftests/expected_expectfail.txt25
-rw-r--r--tests/auto/testlib/selftests/expected_expectfail.xml43
-rw-r--r--tests/auto/testlib/selftests/expected_expectfail.xunitxml21
-rw-r--r--tests/auto/testlib/selftests/expectfail/expectfail.pro1
-rw-r--r--tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp103
-rw-r--r--tests/auto/testlib/selftests/failinit/failinit.pro1
-rw-r--r--tests/auto/testlib/selftests/failinit/tst_failinit.cpp2
-rw-r--r--tests/auto/testlib/selftests/failinitdata/failinitdata.pro1
-rw-r--r--tests/auto/testlib/selftests/failinitdata/tst_failinitdata.cpp2
-rw-r--r--tests/auto/testlib/selftests/fetchbogus/fetchbogus.pro1
-rw-r--r--tests/auto/testlib/selftests/fetchbogus/tst_fetchbogus.cpp4
-rw-r--r--tests/auto/testlib/selftests/findtestdata/findtestdata.cpp16
-rw-r--r--tests/auto/testlib/selftests/float/tst_float.cpp4
-rw-r--r--tests/auto/testlib/selftests/globaldata/globaldata.pro1
-rw-r--r--tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp4
-rw-r--r--tests/auto/testlib/selftests/longstring/longstring.pro2
-rw-r--r--tests/auto/testlib/selftests/longstring/tst_longstring.cpp4
-rw-r--r--tests/auto/testlib/selftests/maxwarnings/maxwarnings.cpp4
-rw-r--r--tests/auto/testlib/selftests/maxwarnings/maxwarnings.pro1
-rw-r--r--tests/auto/testlib/selftests/multiexec/multiexec.pro1
-rw-r--r--tests/auto/testlib/selftests/multiexec/tst_multiexec.cpp2
-rw-r--r--tests/auto/testlib/selftests/printdatatags/tst_printdatatags.cpp2
-rw-r--r--tests/auto/testlib/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp2
-rw-r--r--tests/auto/testlib/selftests/qexecstringlist/qexecstringlist.pro7
-rw-r--r--tests/auto/testlib/selftests/qexecstringlist/tst_qexecstringlist.cpp96
-rw-r--r--tests/auto/testlib/selftests/selftests.pri7
-rw-r--r--tests/auto/testlib/selftests/selftests.pro10
-rw-r--r--tests/auto/testlib/selftests/selftests.qrc1
-rw-r--r--tests/auto/testlib/selftests/singleskip/singleskip.pro1
-rw-r--r--tests/auto/testlib/selftests/singleskip/tst_singleskip.cpp4
-rw-r--r--tests/auto/testlib/selftests/skip/skip.pro1
-rw-r--r--tests/auto/testlib/selftests/skip/tst_skip.cpp4
-rw-r--r--tests/auto/testlib/selftests/skipinit/skipinit.pro1
-rw-r--r--tests/auto/testlib/selftests/skipinit/tst_skipinit.cpp2
-rw-r--r--tests/auto/testlib/selftests/skipinitdata/skipinitdata.pro1
-rw-r--r--tests/auto/testlib/selftests/skipinitdata/tst_skipinitdata.cpp2
-rw-r--r--tests/auto/testlib/selftests/sleep/sleep.pro1
-rw-r--r--tests/auto/testlib/selftests/sleep/tst_sleep.cpp4
-rw-r--r--tests/auto/testlib/selftests/strcmp/strcmp.pro1
-rw-r--r--tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp4
-rw-r--r--tests/auto/testlib/selftests/subtest/subtest.pro1
-rw-r--r--tests/auto/testlib/selftests/subtest/tst_subtest.cpp6
-rw-r--r--tests/auto/testlib/selftests/test/test.pro5
-rw-r--r--tests/auto/testlib/selftests/tst_selftests.cpp82
-rw-r--r--tests/auto/testlib/selftests/warnings/tst_warnings.cpp4
-rw-r--r--tests/auto/testlib/selftests/warnings/warnings.pro1
-rw-r--r--tests/auto/testlib/selftests/xunit/tst_xunit.cpp2
-rw-r--r--tests/auto/testlib/selftests/xunit/xunit.pro4
-rw-r--r--tests/auto/tools/moc/Test.framework/Headers/testinterface.h2
-rw-r--r--tests/auto/tools/moc/assign-namespace.h2
-rw-r--r--tests/auto/tools/moc/backslash-newlines.h2
-rw-r--r--tests/auto/tools/moc/c-comments.h2
-rw-r--r--tests/auto/tools/moc/cstyle-enums.h2
-rw-r--r--tests/auto/tools/moc/dir-in-include-path.h2
-rw-r--r--tests/auto/tools/moc/error-on-wrong-notify.h2
-rw-r--r--tests/auto/tools/moc/escapes-in-string-literals.h2
-rw-r--r--tests/auto/tools/moc/extraqualification.h2
-rw-r--r--tests/auto/tools/moc/forgotten-qinterface.h2
-rw-r--r--tests/auto/tools/moc/gadgetwithnoenums.h2
-rw-r--r--tests/auto/tools/moc/interface-from-framework.h2
-rw-r--r--tests/auto/tools/moc/macro-on-cmdline.h2
-rw-r--r--tests/auto/tools/moc/namespaced-flags.h2
-rw-r--r--tests/auto/tools/moc/no-keywords.h2
-rw-r--r--tests/auto/tools/moc/oldstyle-casts.h2
-rw-r--r--tests/auto/tools/moc/os9-newlines.h2
-rw-r--r--tests/auto/tools/moc/parse-boost.h2
-rw-r--r--tests/auto/tools/moc/pure-virtual-signals.h2
-rw-r--r--tests/auto/tools/moc/qinvokable.h2
-rw-r--r--tests/auto/tools/moc/qprivateslots.h2
-rw-r--r--tests/auto/tools/moc/single_function_keyword.h2
-rw-r--r--tests/auto/tools/moc/slots-with-void-template.h2
-rw-r--r--tests/auto/tools/moc/task189996.h2
-rw-r--r--tests/auto/tools/moc/task192552.h2
-rw-r--r--tests/auto/tools/moc/task234909.h2
-rw-r--r--tests/auto/tools/moc/task240368.h2
-rw-r--r--tests/auto/tools/moc/task87883.h2
-rw-r--r--tests/auto/tools/moc/template-gtgt.h2
-rw-r--r--tests/auto/tools/moc/testproject/Plugin/Plugin.h2
-rw-r--r--tests/auto/tools/moc/trigraphs.h2
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp30
-rw-r--r--tests/auto/tools/moc/using-namespaces.h2
-rw-r--r--tests/auto/tools/moc/warn-on-multiple-qobject-subclasses.h2
-rw-r--r--tests/auto/tools/moc/warn-on-property-without-read.h2
-rw-r--r--tests/auto/tools/moc/win-newlines.h2
-rw-r--r--tests/auto/tools/qmake/qmake.pro2
-rw-r--r--tests/auto/tools/qmake/testcompiler.cpp2
-rw-r--r--tests/auto/tools/qmake/testcompiler.h2
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/main.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/object1.h2
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/object2.h2
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/object3.h2
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/object4.h2
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/object5.h2
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/object6.h2
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/object7.h2
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/object8.h2
-rw-r--r--tests/auto/tools/qmake/testdata/findDeps/object9.h2
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/main.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object1.h2
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object2.h2
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object3.h2
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object4.h2
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object5.h2
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object6.h2
-rw-r--r--tests/auto/tools/qmake/testdata/findMocs/object7.h2
-rw-r--r--tests/auto/tools/qmake/testdata/functions/1.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/functions/2.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/functions/one/1.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/functions/one/2.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/functions/three/wildcard21.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/functions/three/wildcard22.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/functions/two/1.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/functions/two/2.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/functions/wildcard21.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/functions/wildcard22.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/include_dir/main.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/include_dir/test_file.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/include_dir/test_file.h2
-rw-r--r--tests/auto/tools/qmake/testdata/include_function/main.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/install_depends/main.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/install_depends/test_file.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/install_depends/test_file.h2
-rw-r--r--tests/auto/tools/qmake/testdata/one_space/main.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/quotedfilenames/main.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/shadow_files/main.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/shadow_files/test_file.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/shadow_files/test_file.h2
-rw-r--r--tests/auto/tools/qmake/testdata/simple_app/main.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/simple_app/test_file.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/simple_app/test_file.h2
-rw-r--r--tests/auto/tools/qmake/testdata/simple_dll/simple.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/simple_dll/simple.h2
-rw-r--r--tests/auto/tools/qmake/testdata/simple_lib/simple.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/simple_lib/simple.h2
-rw-r--r--tests/auto/tools/qmake/testdata/subdir_via_pro_file_extra_target/simple/main.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/subdirs/simple_app/main.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/subdirs/simple_app/test_file.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/subdirs/simple_app/test_file.h2
-rw-r--r--tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple.cpp2
-rw-r--r--tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple.h2
-rw-r--r--tests/auto/tools/qmake/tst_qmake.cpp29
-rw-r--r--tests/auto/tools/rcc/tst_rcc.cpp2
-rw-r--r--tests/auto/tools/uic/baseline/batchtranslation.ui2
-rw-r--r--tests/auto/tools/uic/baseline/batchtranslation.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/config.ui2
-rw-r--r--tests/auto/tools/uic/baseline/config.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/finddialog.ui2
-rw-r--r--tests/auto/tools/uic/baseline/finddialog.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/formwindowsettings.ui2
-rw-r--r--tests/auto/tools/uic/baseline/formwindowsettings.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/helpdialog.ui2
-rw-r--r--tests/auto/tools/uic/baseline/helpdialog.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/listwidgeteditor.ui2
-rw-r--r--tests/auto/tools/uic/baseline/listwidgeteditor.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/newactiondialog.ui2
-rw-r--r--tests/auto/tools/uic/baseline/newactiondialog.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/newform.ui2
-rw-r--r--tests/auto/tools/uic/baseline/newform.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/orderdialog.ui2
-rw-r--r--tests/auto/tools/uic/baseline/orderdialog.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/paletteeditor.ui2
-rw-r--r--tests/auto/tools/uic/baseline/paletteeditor.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/phrasebookbox.ui2
-rw-r--r--tests/auto/tools/uic/baseline/phrasebookbox.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/plugindialog.ui2
-rw-r--r--tests/auto/tools/uic/baseline/plugindialog.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/previewwidget.ui2
-rw-r--r--tests/auto/tools/uic/baseline/previewwidget.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/qfiledialog.ui2
-rw-r--r--tests/auto/tools/uic/baseline/qfiledialog.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/qtgradientdialog.ui2
-rw-r--r--tests/auto/tools/uic/baseline/qtgradientdialog.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/qtgradienteditor.ui2
-rw-r--r--tests/auto/tools/uic/baseline/qtgradienteditor.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/qtgradientviewdialog.ui2
-rw-r--r--tests/auto/tools/uic/baseline/qtgradientviewdialog.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/saveformastemplate.ui2
-rw-r--r--tests/auto/tools/uic/baseline/saveformastemplate.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/statistics.ui2
-rw-r--r--tests/auto/tools/uic/baseline/statistics.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/stringlisteditor.ui2
-rw-r--r--tests/auto/tools/uic/baseline/stringlisteditor.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/tabbedbrowser.ui2
-rw-r--r--tests/auto/tools/uic/baseline/tabbedbrowser.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/tablewidgeteditor.ui2
-rw-r--r--tests/auto/tools/uic/baseline/tablewidgeteditor.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/translatedialog.ui2
-rw-r--r--tests/auto/tools/uic/baseline/translatedialog.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/treewidgeteditor.ui2
-rw-r--r--tests/auto/tools/uic/baseline/treewidgeteditor.ui.h2
-rw-r--r--tests/auto/tools/uic/baseline/trpreviewtool.ui2
-rw-r--r--tests/auto/tools/uic/baseline/trpreviewtool.ui.h2
-rw-r--r--tests/auto/tools/uic/tst_uic.cpp2
-rw-r--r--tests/auto/v8/Makefile.nonqt16
-rw-r--r--tests/auto/v8/README.txt13
-rw-r--r--tests/auto/v8/v8.pro10
-rw-r--r--tests/auto/v8/v8test.cpp379
-rw-r--r--tests/auto/v8/v8test.h58
-rw-r--r--tests/auto/widgets/dialogs/qabstractprintdialog/tst_qabstractprintdialog.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp20
-rw-r--r--tests/auto/widgets/dialogs/qerrormessage/tst_qerrormessage.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp4
-rw-r--r--tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp8
-rw-r--r--tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm2
-rw-r--r--tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp2
-rw-r--r--tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp10
-rw-r--r--tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp10
-rw-r--r--tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp6
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicseffectsource/tst_qgraphicseffectsource.cpp4
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp84
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicslayoutitem/tst_qgraphicslayoutitem.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsobject/tst_qgraphicsobject.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicspixmapitem/tst_qgraphicspixmapitem.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicspolygonitem/tst_qgraphicspolygonitem.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp45
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicstransform/tst_qgraphicstransform.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp55
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp44
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro3
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp2
-rw-r--r--tests/auto/widgets/itemviews/itemviews.pro5
-rw-r--r--tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qdatawidgetmapper/tst_qdatawidgetmapper.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qfileiconprovider/tst_qfileiconprovider.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro2
-rw-r--r--tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qitemeditorfactory/tst_qitemeditorfactory.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qitemview/viewstotest.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qstandarditem/tst_qstandarditem.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qstandarditemmodel/tst_qstandarditemmodel.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/qtreeview.pro4
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp54
-rw-r--r--tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp2
-rw-r--r--tests/auto/widgets/kernel/kernel.pro1
-rw-r--r--tests/auto/widgets/kernel/qaction/tst_qaction.cpp2
-rw-r--r--tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp2
-rw-r--r--tests/auto/widgets/kernel/qapplication/desktopsettingsaware/desktopsettingsaware.pro6
-rw-r--r--tests/auto/widgets/kernel/qapplication/desktopsettingsaware/main.cpp2
-rw-r--r--tests/auto/widgets/kernel/qapplication/modal/base.cpp2
-rw-r--r--tests/auto/widgets/kernel/qapplication/modal/base.h2
-rw-r--r--tests/auto/widgets/kernel/qapplication/modal/main.cpp2
-rw-r--r--tests/auto/widgets/kernel/qapplication/modal/modal.pro6
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp224
-rw-r--r--tests/auto/widgets/kernel/qapplication/wincmdline/main.cpp2
-rw-r--r--tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro6
-rw-r--r--tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp2
-rw-r--r--tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp2
-rw-r--r--tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp2
-rw-r--r--tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp2
-rw-r--r--tests/auto/widgets/kernel/qinputcontext/qinputcontext.pro6
-rw-r--r--tests/auto/widgets/kernel/qinputcontext/tst_qinputcontext.cpp401
-rw-r--r--tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp2
-rw-r--r--tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp2
-rw-r--r--tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp2
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp96
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.h2
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.mm2
-rw-r--r--tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp2
-rw-r--r--tests/auto/widgets/kernel/qwidgetaction/tst_qwidgetaction.cpp2
-rw-r--r--tests/auto/widgets/shared/platforminputcontext.h101
-rw-r--r--tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp2
-rw-r--r--tests/auto/widgets/styles/qstyle/tst_qstyle.cpp6
-rw-r--r--tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp2
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp2
-rw-r--r--tests/auto/widgets/styles/styles.pro3
-rw-r--r--tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp2
-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.cpp2
-rw-r--r--tests/auto/widgets/util/qundostack/tst_qundostack.cpp2
-rw-r--r--tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp44
-rw-r--r--tests/auto/widgets/widgets/qabstractscrollarea/tst_qabstractscrollarea.cpp2
-rw-r--r--tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp2
-rw-r--r--tests/auto/widgets/widgets/qabstractspinbox/tst_qabstractspinbox.cpp2
-rw-r--r--tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp2
-rw-r--r--tests/auto/widgets/widgets/qcalendarwidget/qcalendarwidget.pro3
-rw-r--r--tests/auto/widgets/widgets/qcalendarwidget/tst_qcalendarwidget.cpp2
-rw-r--r--tests/auto/widgets/widgets/qcheckbox/tst_qcheckbox.cpp36
-rw-r--r--tests/auto/widgets/widgets/qcombobox/qcombobox.pro3
-rw-r--r--tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp2
-rw-r--r--tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp44
-rw-r--r--tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp12
-rw-r--r--tests/auto/widgets/widgets/qdial/tst_qdial.cpp2
-rw-r--r--tests/auto/widgets/widgets/qdialogbuttonbox/tst_qdialogbuttonbox.cpp2
-rw-r--r--tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp2
-rw-r--r--tests/auto/widgets/widgets/qdoublespinbox/qdoublespinbox.pro3
-rw-r--r--tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp2
-rw-r--r--tests/auto/widgets/widgets/qdoublevalidator/tst_qdoublevalidator.cpp2
-rw-r--r--tests/auto/widgets/widgets/qfocusframe/tst_qfocusframe.cpp2
-rw-r--r--tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp2
-rw-r--r--tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp2
-rw-r--r--tests/auto/widgets/widgets/qintvalidator/tst_qintvalidator.cpp2
-rw-r--r--tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp4
-rw-r--r--tests/auto/widgets/widgets/qlcdnumber/tst_qlcdnumber.cpp2
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp2
-rw-r--r--tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp2
-rw-r--r--tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp2
-rw-r--r--tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp2
-rw-r--r--tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp2
-rw-r--r--tests/auto/widgets/widgets/qmenubar/qmenubar.pro3
-rw-r--r--tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp6
-rw-r--r--tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp2
-rw-r--r--tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp2
-rw-r--r--tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp44
-rw-r--r--tests/auto/widgets/widgets/qradiobutton/tst_qradiobutton.cpp2
-rw-r--r--tests/auto/widgets/widgets/qregexpvalidator/tst_qregexpvalidator.cpp2
-rw-r--r--tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp2
-rw-r--r--tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp2
-rw-r--r--tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp2
-rw-r--r--tests/auto/widgets/widgets/qslider/tst_qslider.cpp2
-rw-r--r--tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp2
-rw-r--r--tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp2
-rw-r--r--tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp2
-rw-r--r--tests/auto/widgets/widgets/qstatusbar/tst_qstatusbar.cpp2
-rw-r--r--tests/auto/widgets/widgets/qtabbar/tst_qtabbar.cpp2
-rw-r--r--tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp2
-rw-r--r--tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp2
-rw-r--r--tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp2
-rw-r--r--tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp2
-rw-r--r--tests/auto/widgets/widgets/qtoolbox/tst_qtoolbox.cpp12
-rw-r--r--tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp2
-rw-r--r--tests/auto/widgets/widgets/qworkspace/tst_qworkspace.cpp4
-rw-r--r--tests/auto/xml/dom/qdom/tst_qdom.cpp119
-rw-r--r--tests/auto/xml/sax/qxml/tst_qxml.cpp2
-rw-r--r--tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp65
-rwxr-xr-xtests/auto/xml/sax/qxmlsimplereader/generate_ref_files.sh2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/parser/main.cpp2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp54
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/parser/parser.h2
-rw-r--r--tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp2
-rw-r--r--tests/baselineserver/shared/baselineprotocol.cpp2
-rw-r--r--tests/baselineserver/shared/baselineprotocol.h2
-rw-r--r--tests/baselineserver/shared/lookup3.cpp2
-rw-r--r--tests/baselineserver/shared/qbaselinetest.cpp2
-rw-r--r--tests/baselineserver/shared/qbaselinetest.h2
-rw-r--r--tests/baselineserver/src/baselineserver.cpp4
-rw-r--r--tests/baselineserver/src/baselineserver.h4
-rw-r--r--tests/baselineserver/src/main.cpp2
-rw-r--r--tests/baselineserver/src/report.cpp2
-rw-r--r--tests/baselineserver/src/report.h2
-rw-r--r--tests/benchmarks/corelib/codecs/qtextcodec/main.cpp2
-rw-r--r--tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp2
-rw-r--r--tests/benchmarks/corelib/io/qdir/tree/bench_qdir_tree.cpp2
-rw-r--r--tests/benchmarks/corelib/io/qdiriterator/main.cpp2
-rw-r--r--[-rwxr-xr-x]tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro0
-rw-r--r--tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp2
-rw-r--r--tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.h2
-rw-r--r--tests/benchmarks/corelib/io/qfile/main.cpp2
-rw-r--r--tests/benchmarks/corelib/io/qfileinfo/main.cpp2
-rw-r--r--tests/benchmarks/corelib/io/qiodevice/main.cpp2
-rw-r--r--[-rwxr-xr-x]tests/benchmarks/corelib/io/qiodevice/qiodevice.pro0
-rw-r--r--tests/benchmarks/corelib/io/qtemporaryfile/main.cpp2
-rw-r--r--tests/benchmarks/corelib/io/qurl/main.cpp2
-rw-r--r--tests/benchmarks/corelib/kernel/events/main.cpp2
-rw-r--r--tests/benchmarks/corelib/kernel/kernel.pro3
-rw-r--r--tests/benchmarks/corelib/kernel/qcoreapplication/main.cpp82
-rw-r--r--tests/benchmarks/corelib/kernel/qcoreapplication/qcoreapplication.pro9
-rw-r--r--tests/benchmarks/corelib/kernel/qmetaobject/main.cpp2
-rw-r--r--tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp2
-rw-r--r--tests/benchmarks/corelib/kernel/qobject/main.cpp2
-rw-r--r--tests/benchmarks/corelib/kernel/qobject/object.cpp2
-rw-r--r--tests/benchmarks/corelib/kernel/qobject/object.h2
-rw-r--r--tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp2
-rw-r--r--tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp2
-rw-r--r--tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp22
-rw-r--r--tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp2
-rw-r--r--tests/benchmarks/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp2
-rw-r--r--tests/benchmarks/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp2
-rw-r--r--tests/benchmarks/corelib/tools/containers-associative/main.cpp2
-rw-r--r--tests/benchmarks/corelib/tools/containers-sequential/main.cpp2
-rw-r--r--tests/benchmarks/corelib/tools/qbytearray/main.cpp2
-rw-r--r--[-rwxr-xr-x]tests/benchmarks/corelib/tools/qbytearray/qbytearray.pro0
-rw-r--r--tests/benchmarks/corelib/tools/qchar/main.cpp2
-rw-r--r--tests/benchmarks/corelib/tools/qcontiguouscache/main.cpp2
-rw-r--r--tests/benchmarks/corelib/tools/qhash/outofline.cpp2
-rw-r--r--tests/benchmarks/corelib/tools/qhash/qhash_string.cpp2
-rw-r--r--tests/benchmarks/corelib/tools/qhash/qhash_string.h2
-rw-r--r--tests/benchmarks/corelib/tools/qlist/main.cpp2
-rw-r--r--tests/benchmarks/corelib/tools/qrect/main.cpp2
-rw-r--r--tests/benchmarks/corelib/tools/qregexp/main.cpp2
-rw-r--r--tests/benchmarks/corelib/tools/qstring/data.h2
-rw-r--r--tests/benchmarks/corelib/tools/qstring/generatelist.pl2
-rw-r--r--tests/benchmarks/corelib/tools/qstring/generatelist_char.pl2
-rw-r--r--tests/benchmarks/corelib/tools/qstring/main.cpp94
-rw-r--r--tests/benchmarks/corelib/tools/qstringbuilder/main.cpp2
-rw-r--r--tests/benchmarks/corelib/tools/qstringlist/main.cpp2
-rw-r--r--tests/benchmarks/corelib/tools/qvector/main.cpp2
-rw-r--r--tests/benchmarks/corelib/tools/qvector/outofline.cpp2
-rw-r--r--tests/benchmarks/corelib/tools/qvector/qrawvector.h6
-rw-r--r--tests/benchmarks/dbus/qdbusperformance/server/server.cpp2
-rw-r--r--tests/benchmarks/dbus/qdbusperformance/serverobject.h2
-rw-r--r--tests/benchmarks/dbus/qdbusperformance/tst_qdbusperformance.cpp2
-rw-r--r--tests/benchmarks/dbus/qdbustype/main.cpp2
-rw-r--r--tests/benchmarks/gui/animation/qanimation/dummyanimation.cpp7
-rw-r--r--tests/benchmarks/gui/animation/qanimation/dummyanimation.h4
-rw-r--r--tests/benchmarks/gui/animation/qanimation/dummyobject.cpp2
-rw-r--r--tests/benchmarks/gui/animation/qanimation/dummyobject.h2
-rw-r--r--tests/benchmarks/gui/animation/qanimation/main.cpp2
-rw-r--r--tests/benchmarks/gui/animation/qanimation/rectanimation.cpp2
-rw-r--r--tests/benchmarks/gui/animation/qanimation/rectanimation.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/main.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/button.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/button.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/resourcemoninterface.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller_p.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/webview.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/webview.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/webview_p.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/main.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/view.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chip.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chip.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp2
-rw-r--r--tests/benchmarks/gui/image/blendbench/main.cpp2
-rw-r--r--tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp2
-rw-r--r--tests/benchmarks/gui/image/qimagereader/tst_qimagereader.cpp2
-rw-r--r--tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp2
-rw-r--r--tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp2
-rw-r--r--tests/benchmarks/gui/itemviews/qtableview/tst_qtableview.cpp2
-rw-r--r--tests/benchmarks/gui/kernel/qapplication/main.cpp2
-rw-r--r--tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp2
-rw-r--r--tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp2
-rw-r--r--tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp2
-rw-r--r--tests/benchmarks/gui/math3d/qmatrix4x4/tst_qmatrix4x4.cpp2
-rw-r--r--tests/benchmarks/gui/math3d/qquaternion/tst_qquaternion.cpp2
-rw-r--r--tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp2
-rw-r--r--tests/benchmarks/gui/painting/qregion/main.cpp2
-rw-r--r--tests/benchmarks/gui/painting/qtbench/benchmarktests.h2
-rw-r--r--tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp2
-rw-r--r--tests/benchmarks/gui/painting/qtracebench/tst_qtracebench.cpp2
-rw-r--r--tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp2
-rw-r--r--tests/benchmarks/gui/styles/qstylesheetstyle/main.cpp2
-rw-r--r--tests/benchmarks/gui/text/qfontmetrics/main.cpp2
-rw-r--r--tests/benchmarks/gui/text/qtext/main.cpp2
-rw-r--r--tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp2
-rw-r--r--tests/benchmarks/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp2
-rw-r--r--tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp12
-rw-r--r--tests/benchmarks/network/kernel/qhostinfo/main.cpp2
-rw-r--r--[-rwxr-xr-x]tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro0
-rw-r--r--tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp2
-rw-r--r--tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp2
-rw-r--r--tests/benchmarks/opengl/main.cpp2
-rw-r--r--tests/benchmarks/plugins/imageformats/jpeg/jpeg.cpp2
-rw-r--r--tests/benchmarks/sql/kernel/qsqlquery/main.cpp2
-rw-r--r--tests/manual/bearerex/bearerex.cpp2
-rw-r--r--tests/manual/bearerex/bearerex.h2
-rw-r--r--tests/manual/bearerex/datatransferer.cpp2
-rw-r--r--tests/manual/bearerex/datatransferer.h2
-rw-r--r--tests/manual/bearerex/main.cpp2
-rw-r--r--tests/manual/bearerex/xqlistwidget.cpp2
-rw-r--r--tests/manual/bearerex/xqlistwidget.h2
-rw-r--r--tests/manual/cmake/CMakeLists.txt6
-rw-r--r--tests/manual/cmake/pass1/CMakeLists.txt16
-rw-r--r--tests/manual/cmake/pass3/CMakeLists.txt5
-rw-r--r--tests/manual/cocoa/qt_on_cocoa/main.mm213
-rw-r--r--tests/manual/cocoa/qt_on_cocoa/qt_on_cocoa.pro12
-rw-r--r--tests/manual/cocoa/qt_on_cocoa/window.cpp203
-rw-r--r--tests/manual/cocoa/qt_on_cocoa/window.h (renamed from tests/auto/v8/v8main.cpp)52
-rw-r--r--tests/manual/gestures/graphicsview/gestures.cpp2
-rw-r--r--tests/manual/gestures/graphicsview/gestures.h2
-rw-r--r--tests/manual/gestures/graphicsview/imageitem.cpp2
-rw-r--r--tests/manual/gestures/graphicsview/imageitem.h2
-rw-r--r--tests/manual/gestures/graphicsview/main.cpp2
-rw-r--r--tests/manual/gestures/graphicsview/mousepangesturerecognizer.cpp2
-rw-r--r--tests/manual/gestures/graphicsview/mousepangesturerecognizer.h2
-rw-r--r--tests/manual/gestures/scrollarea/main.cpp2
-rw-r--r--tests/manual/gestures/scrollarea/mousepangesturerecognizer.cpp2
-rw-r--r--tests/manual/gestures/scrollarea/mousepangesturerecognizer.h2
-rw-r--r--tests/manual/inputmethodhints/inputmethodhints.cpp2
-rw-r--r--tests/manual/inputmethodhints/inputmethodhints.h2
-rw-r--r--tests/manual/inputmethodhints/main.cpp2
-rw-r--r--tests/manual/keypadnavigation/main.cpp2
-rw-r--r--tests/manual/lance/interactivewidget.cpp2
-rw-r--r--tests/manual/lance/interactivewidget.h2
-rw-r--r--tests/manual/lance/main.cpp2
-rw-r--r--tests/manual/lance/widgets.h2
-rwxr-xr-xtests/manual/mkspecs/test.sh2
-rw-r--r--tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp2
-rw-r--r--tests/manual/network_stresstest/minihttpserver.cpp2
-rw-r--r--tests/manual/network_stresstest/minihttpserver.h2
-rw-r--r--tests/manual/network_stresstest/tst_network_stresstest.cpp2
-rw-r--r--tests/manual/qcursor/allcursors/main.cpp2
-rw-r--r--tests/manual/qcursor/allcursors/mainwindow.cpp2
-rw-r--r--tests/manual/qcursor/allcursors/mainwindow.h2
-rw-r--r--tests/manual/qcursor/grab_override/main.cpp2
-rw-r--r--tests/manual/qcursor/grab_override/mainwindow.cpp2
-rw-r--r--tests/manual/qcursor/grab_override/mainwindow.h2
-rw-r--r--tests/manual/qdesktopwidget/main.cpp2
-rw-r--r--tests/manual/qgraphicsitemgroup/customitem.cpp2
-rw-r--r--tests/manual/qgraphicsitemgroup/customitem.h2
-rw-r--r--tests/manual/qgraphicsitemgroup/main.cpp2
-rw-r--r--tests/manual/qgraphicsitemgroup/widget.cpp2
-rw-r--r--tests/manual/qgraphicsitemgroup/widget.h2
-rw-r--r--tests/manual/qgraphicslayout/flicker/main.cpp2
-rw-r--r--tests/manual/qgraphicslayout/flicker/window.cpp2
-rw-r--r--tests/manual/qgraphicslayout/flicker/window.h2
-rw-r--r--tests/manual/qhttpnetworkconnection/main.cpp2
-rw-r--r--tests/manual/qimagereader/main.cpp2
-rw-r--r--tests/manual/qlocale/calendar.cpp2
-rw-r--r--tests/manual/qlocale/calendar.h2
-rw-r--r--tests/manual/qlocale/currency.cpp2
-rw-r--r--tests/manual/qlocale/currency.h2
-rw-r--r--tests/manual/qlocale/dateformats.cpp2
-rw-r--r--tests/manual/qlocale/dateformats.h2
-rw-r--r--tests/manual/qlocale/info.cpp2
-rw-r--r--tests/manual/qlocale/info.h2
-rw-r--r--tests/manual/qlocale/languages.cpp2
-rw-r--r--tests/manual/qlocale/languages.h2
-rw-r--r--tests/manual/qlocale/main.cpp2
-rw-r--r--tests/manual/qlocale/miscellaneous.cpp2
-rw-r--r--tests/manual/qlocale/miscellaneous.h2
-rw-r--r--tests/manual/qlocale/numberformats.cpp2
-rw-r--r--tests/manual/qlocale/numberformats.h2
-rw-r--r--tests/manual/qlocale/window.cpp2
-rw-r--r--tests/manual/qlocale/window.h2
-rw-r--r--tests/manual/qnetworkaccessmanager/qget/qget.cpp300
-rw-r--r--tests/manual/qnetworkaccessmanager/qget/qget.h101
-rw-r--r--tests/manual/qnetworkaccessmanager/qget/qget.pro10
-rw-r--r--tests/manual/qnetworkreply/main.cpp2
-rw-r--r--tests/manual/qssloptions/main.cpp2
-rw-r--r--tests/manual/qtabletevent/device_information/main.cpp2
-rw-r--r--tests/manual/qtabletevent/device_information/tabletwidget.cpp2
-rw-r--r--tests/manual/qtabletevent/device_information/tabletwidget.h2
-rw-r--r--tests/manual/qtabletevent/event_compression/main.cpp2
-rw-r--r--tests/manual/qtabletevent/event_compression/mousestatwidget.cpp2
-rw-r--r--tests/manual/qtabletevent/event_compression/mousestatwidget.h2
-rw-r--r--tests/manual/qtabletevent/regular_widgets/main.cpp2
-rw-r--r--tests/manual/qtbug-8933/main.cpp2
-rw-r--r--tests/manual/qtbug-8933/widget.cpp2
-rw-r--r--tests/manual/qtbug-8933/widget.h2
-rw-r--r--tests/manual/qtouchevent/main.cpp2
-rw-r--r--tests/manual/qtouchevent/touchwidget.cpp2
-rw-r--r--tests/manual/qtouchevent/touchwidget.h2
-rw-r--r--tests/manual/qwidget_zorder/main.cpp2
-rw-r--r--tests/manual/repaint/mainwindow/main.cpp2
-rw-r--r--tests/manual/repaint/scrollarea/main.cpp2
-rw-r--r--tests/manual/repaint/shared/shared.h2
-rw-r--r--tests/manual/repaint/splitter/main.cpp2
-rw-r--r--tests/manual/repaint/tableview/main.cpp2
-rw-r--r--tests/manual/repaint/task141091/main.cpp2
-rw-r--r--tests/manual/repaint/toplevel/main.cpp2
-rw-r--r--tests/manual/repaint/widget/main.cpp2
-rw-r--r--tests/manual/socketengine/main.cpp2
-rw-r--r--tests/manual/textrendering/glyphshaping/main.cpp2
-rw-r--r--tests/manual/textrendering/textperformance/main.cpp2
-rw-r--r--tests/manual/windowflags/controllerwindow.cpp2
-rw-r--r--tests/manual/windowflags/controllerwindow.h2
-rw-r--r--tests/manual/windowflags/main.cpp2
-rw-r--r--tests/manual/windowflags/previewwindow.cpp2
-rw-r--r--tests/manual/windowflags/previewwindow.h2
-rw-r--r--tests/shared/filesystem.h2
1203 files changed, 8052 insertions, 11035 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 1fc1ba381c..05b6f84fa9 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -9,7 +9,6 @@ SUBDIRS += \
sql \
testlib \
tools \
- v8 \
xml \
other \
widgets \
@@ -17,7 +16,6 @@ SUBDIRS += \
cross_compile: SUBDIRS -= tools
!contains(QT_CONFIG, opengl): SUBDIRS -= opengl
!unix|embedded|!contains(QT_CONFIG, dbus): SUBDIRS -= dbus
-!contains(QT_CONFIG, v8): SUBDIRS -= v8
# disable 'make check' on Mac OS X for the following subdirs for the time being
mac {
diff --git a/tests/auto/compilerwarnings/data/test_cpp.txt b/tests/auto/compilerwarnings/data/test_cpp.txt
index 4c3ab7131c..d51bc30aab 100644
--- a/tests/auto/compilerwarnings/data/test_cpp.txt
+++ b/tests/auto/compilerwarnings/data/test_cpp.txt
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/animation/qabstractanimation/tst_qabstractanimation.cpp b/tests/auto/corelib/animation/qabstractanimation/tst_qabstractanimation.cpp
index 8fd5237606..deea511a5f 100644
--- a/tests/auto/corelib/animation/qabstractanimation/tst_qabstractanimation.cpp
+++ b/tests/auto/corelib/animation/qabstractanimation/tst_qabstractanimation.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -58,6 +58,9 @@ private slots:
void loopCount();
void state();
void totalDuration();
+ void avoidJumpAtStart();
+ void avoidJumpAtStartWithStop();
+ void avoidJumpAtStartWithRunning();
};
class TestableQAbstractAnimation : public QAbstractAnimation
@@ -65,10 +68,15 @@ class TestableQAbstractAnimation : public QAbstractAnimation
Q_OBJECT
public:
+ TestableQAbstractAnimation() : m_duration(10) {}
virtual ~TestableQAbstractAnimation() {};
- int duration() const { return 10; }
+ int duration() const { return m_duration; }
virtual void updateCurrentTime(int) {}
+
+ void setDuration(int duration) { m_duration = duration; }
+private:
+ int m_duration;
};
class DummyQAnimationGroup : public QAnimationGroup
@@ -150,6 +158,75 @@ void tst_QAbstractAnimation::totalDuration()
QCOMPARE(anim.totalDuration(), 50);
}
+void tst_QAbstractAnimation::avoidJumpAtStart()
+{
+ TestableQAbstractAnimation anim;
+ anim.setDuration(1000);
+
+ /*
+ the timer shouldn't actually start until we hit the event loop,
+ so the sleep should have no effect
+ */
+ anim.start();
+ QTest::qSleep(300);
+ QCoreApplication::processEvents();
+ QVERIFY(anim.currentTime() < 50);
+}
+
+void tst_QAbstractAnimation::avoidJumpAtStartWithStop()
+{
+ TestableQAbstractAnimation anim;
+ anim.setDuration(1000);
+
+ TestableQAbstractAnimation anim2;
+ anim2.setDuration(1000);
+
+ TestableQAbstractAnimation anim3;
+ anim3.setDuration(1000);
+
+ anim.start();
+ QTest::qWait(300);
+ anim.stop();
+
+ /*
+ same test as avoidJumpAtStart, but after there is a
+ running animation that is stopped
+ */
+ anim2.start();
+ QTest::qSleep(300);
+ anim3.start();
+ QCoreApplication::processEvents();
+ QVERIFY(anim2.currentTime() < 50);
+ QVERIFY(anim3.currentTime() < 50);
+}
+
+void tst_QAbstractAnimation::avoidJumpAtStartWithRunning()
+{
+ TestableQAbstractAnimation anim;
+ anim.setDuration(2000);
+
+ TestableQAbstractAnimation anim2;
+ anim2.setDuration(1000);
+
+ TestableQAbstractAnimation anim3;
+ anim3.setDuration(1000);
+
+ anim.start();
+ QTest::qWait(300); //make sure timer has started
+
+ /*
+ same test as avoidJumpAtStart, but with an
+ existing running animation
+ */
+ anim2.start();
+ QTest::qSleep(300); //force large delta for next tick
+ anim3.start();
+ QCoreApplication::processEvents();
+ QVERIFY(anim2.currentTime() < 50);
+ QVERIFY(anim3.currentTime() < 50);
+}
+
+
QTEST_MAIN(tst_QAbstractAnimation)
#include "tst_qabstractanimation.moc"
diff --git a/tests/auto/corelib/animation/qanimationgroup/tst_qanimationgroup.cpp b/tests/auto/corelib/animation/qanimationgroup/tst_qanimationgroup.cpp
index 4c111a88d4..1502e5c8d2 100644
--- a/tests/auto/corelib/animation/qanimationgroup/tst_qanimationgroup.cpp
+++ b/tests/auto/corelib/animation/qanimationgroup/tst_qanimationgroup.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -51,7 +51,7 @@ class tst_QAnimationGroup : public QObject
{
Q_OBJECT
public Q_SLOTS:
- void init();
+ void initTestCase();
private slots:
void construction();
@@ -63,7 +63,7 @@ private slots:
void loopWithoutStartValue();
};
-void tst_QAnimationGroup::init()
+void tst_QAnimationGroup::initTestCase()
{
qRegisterMetaType<QAbstractAnimation::State>("QAbstractAnimation::State");
}
@@ -138,6 +138,7 @@ void tst_QAnimationGroup::emptyGroup()
{
QSequentialAnimationGroup group;
QSignalSpy groupStateChangedSpy(&group, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QVERIFY(groupStateChangedSpy.isValid());
QCOMPARE(group.state(), QAnimationGroup::Stopped);
group.start();
diff --git a/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp b/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
index e091666c2a..755de9d0b8 100644
--- a/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
+++ b/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -261,6 +261,11 @@ void tst_QParallelAnimationGroup::stateChanged()
QSignalSpy spy3(anim3, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
QSignalSpy spy4(anim4, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QVERIFY(spy1.isValid());
+ QVERIFY(spy2.isValid());
+ QVERIFY(spy3.isValid());
+ QVERIFY(spy4.isValid());
+
//first; let's start forward
group.start();
//all the animations should be started
@@ -432,6 +437,9 @@ void tst_QParallelAnimationGroup::updateChildrenWithRunningGroup()
QSignalSpy groupStateChangedSpy(&group, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
QSignalSpy childStateChangedSpy(&anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QVERIFY(groupStateChangedSpy.isValid());
+ QVERIFY(childStateChangedSpy.isValid());
+
QCOMPARE(groupStateChangedSpy.count(), 0);
QCOMPARE(childStateChangedSpy.count(), 0);
QCOMPARE(group.state(), QAnimationGroup::Stopped);
@@ -596,6 +604,9 @@ void tst_QParallelAnimationGroup::startGroupWithRunningChild()
QSignalSpy stateChangedSpy1(&anim1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
QSignalSpy stateChangedSpy2(&anim2, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QVERIFY(stateChangedSpy1.isValid());
+ QVERIFY(stateChangedSpy2.isValid());
+
QCOMPARE(stateChangedSpy1.count(), 0);
QCOMPARE(stateChangedSpy2.count(), 0);
QCOMPARE(group.state(), QAnimationGroup::Stopped);
@@ -661,12 +672,21 @@ void tst_QParallelAnimationGroup::zeroDurationAnimation()
QSignalSpy stateChangedSpy1(&anim1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
QSignalSpy finishedSpy1(&anim1, SIGNAL(finished()));
+ QVERIFY(stateChangedSpy1.isValid());
+ QVERIFY(finishedSpy1.isValid());
+
QSignalSpy stateChangedSpy2(&anim2, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
QSignalSpy finishedSpy2(&anim2, SIGNAL(finished()));
+ QVERIFY(stateChangedSpy2.isValid());
+ QVERIFY(finishedSpy2.isValid());
+
QSignalSpy stateChangedSpy3(&anim3, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
QSignalSpy finishedSpy3(&anim3, SIGNAL(finished()));
+ QVERIFY(stateChangedSpy3.isValid());
+ QVERIFY(finishedSpy3.isValid());
+
group.addAnimation(&anim1);
group.addAnimation(&anim2);
group.addAnimation(&anim3);
@@ -741,6 +761,7 @@ void tst_QParallelAnimationGroup::stopUncontrolledAnimations()
loopsForever.setLoopCount(-1);
QSignalSpy stateChangedSpy(&anim1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QVERIFY(stateChangedSpy.isValid());
group.addAnimation(&anim1);
group.addAnimation(&notTimeDriven);
@@ -948,6 +969,7 @@ void tst_QParallelAnimationGroup::pauseResume()
QParallelAnimationGroup group;
TestAnimation2 *anim = new TestAnimation2(250, &group); // 0, duration = 250;
QSignalSpy spy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QVERIFY(spy.isValid());
QCOMPARE(group.duration(), 250);
group.start();
QTest::qWait(100);
diff --git a/tests/auto/corelib/animation/qpauseanimation/tst_qpauseanimation.cpp b/tests/auto/corelib/animation/qpauseanimation/tst_qpauseanimation.cpp
index ffd4ce47e1..68ada06669 100644
--- a/tests/auto/corelib/animation/qpauseanimation/tst_qpauseanimation.cpp
+++ b/tests/auto/corelib/animation/qpauseanimation/tst_qpauseanimation.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp
index 51b7359980..c8688c89f6 100644
--- a/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp
+++ b/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -230,6 +230,10 @@ void tst_QPropertyAnimation::statesAndSignals()
QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
QSignalSpy currentLoopSpy(anim, SIGNAL(currentLoopChanged(int)));
+ QVERIFY(finishedSpy.isValid());
+ QVERIFY(runningSpy.isValid());
+ QVERIFY(currentLoopSpy.isValid());
+
anim->setCurrentTime(1);
anim->setCurrentTime(100);
QCOMPARE(finishedSpy.count(), 0);
@@ -305,6 +309,8 @@ void tst_QPropertyAnimation::deletion1()
//test that the animation is deleted correctly depending of the deletion flag passed in start()
QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
QSignalSpy finishedSpy(anim, SIGNAL(finished()));
+ QVERIFY(runningSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
anim->setStartValue(10);
anim->setEndValue(20);
anim->setDuration(200);
@@ -348,6 +354,9 @@ void tst_QPropertyAnimation::deletion2()
QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
QSignalSpy finishedSpy(anim, SIGNAL(finished()));
+ QVERIFY(runningSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
+
anim->setStartValue(10);
anim->setEndValue(20);
anim->setDuration(200);
@@ -378,6 +387,10 @@ void tst_QPropertyAnimation::deletion3()
QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
QSignalSpy finishedSpy(anim, SIGNAL(finished()));
+
+ QVERIFY(runningSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
+
anim->start();
QTest::qWait(50);
@@ -474,6 +487,7 @@ void tst_QPropertyAnimation::startWhenAnotherIsRunning()
QPointer<QVariantAnimation> anim = new QPropertyAnimation(&o, "ole");
anim->setEndValue(100);
QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QVERIFY(runningSpy.isValid());
anim->start(QVariantAnimation::DeleteWhenStopped);
QTest::qWait(anim->duration() + 100);
QTRY_COMPARE(runningSpy.count(), 2); //started and then stopped
@@ -484,6 +498,7 @@ void tst_QPropertyAnimation::startWhenAnotherIsRunning()
QPointer<QVariantAnimation> anim = new QPropertyAnimation(&o, "ole");
anim->setEndValue(100);
QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QVERIFY(runningSpy.isValid());
anim->start(QVariantAnimation::DeleteWhenStopped);
QTest::qWait(anim->duration()/2);
QPointer<QVariantAnimation> anim2 = new QPropertyAnimation(&o, "ole");
@@ -834,6 +849,7 @@ void tst_QPropertyAnimation::zeroDurationStart()
{
DummyPropertyAnimation anim;
QSignalSpy spy(&anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QVERIFY(spy.isValid());
anim.setDuration(0);
QCOMPARE(anim.state(), QAbstractAnimation::Stopped);
anim.start();
@@ -911,6 +927,7 @@ void tst_QPropertyAnimation::operationsInStates()
QPropertyAnimation anim(&o, "ole");
anim.setEndValue(100);
QSignalSpy spy(&anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QVERIFY(spy.isValid());
anim.stop();
switch (originState) {
@@ -1071,6 +1088,7 @@ void tst_QPropertyAnimation::valueChanged()
anim.setEndValue(5);
anim.setDuration(1000);
QSignalSpy spy(&anim, SIGNAL(valueChanged(QVariant)));
+ QVERIFY(spy.isValid());
anim.start();
QTest::qWait(anim.duration() + 100);
@@ -1203,6 +1221,9 @@ void tst_QPropertyAnimation::zeroLoopCount()
QSignalSpy runningSpy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
QSignalSpy finishedSpy(anim, SIGNAL(finished()));
+ QVERIFY(runningSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
+
QCOMPARE(anim->state(), QAnimationGroup::Stopped);
QCOMPARE(anim->currentValue().toInt(), 0);
QCOMPARE(runningSpy.count(), 0);
diff --git a/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp b/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp
index c7a996444f..3751816dbc 100644
--- a/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp
+++ b/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -642,6 +642,9 @@ void tst_QSequentialAnimationGroup::pauseAndResume()
QSignalSpy a1StateChangedSpy(a1_s_o1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
QSignalSpy seqStateChangedSpy(sequence, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QVERIFY(a1StateChangedSpy.isValid());
+ QVERIFY(seqStateChangedSpy.isValid());
+
QSequentialAnimationGroup group;
group.addAnimation(sequence);
@@ -746,6 +749,9 @@ void tst_QSequentialAnimationGroup::restart()
QSignalSpy seqCurrentAnimChangedSpy(sequence, SIGNAL(currentAnimationChanged(QAbstractAnimation*)));
QSignalSpy seqStateChangedSpy(sequence, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QVERIFY(seqCurrentAnimChangedSpy.isValid());
+ QVERIFY(seqStateChangedSpy.isValid());
+
QVariantAnimation *anims[3];
QSignalSpy *animsStateChanged[3];
@@ -753,6 +759,7 @@ void tst_QSequentialAnimationGroup::restart()
anims[i] = new DummyPropertyAnimation;
anims[i]->setDuration(100);
animsStateChanged[i] = new QSignalSpy(anims[i], SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QVERIFY(animsStateChanged[i]->isValid());
}
anims[1]->setLoopCount(2);
@@ -816,6 +823,11 @@ void tst_QSequentialAnimationGroup::looping()
QSignalSpy a3Spy(a3_s_o1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
QSignalSpy seqSpy(sequence, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QVERIFY(a1Spy.isValid());
+ QVERIFY(a2Spy.isValid());
+ QVERIFY(a3Spy.isValid());
+ QVERIFY(seqSpy.isValid());
+
a2_s_o1->setLoopCount(2);
sequence->addAnimation(a1_s_o1);
sequence->addAnimation(a2_s_o1);
@@ -824,6 +836,7 @@ void tst_QSequentialAnimationGroup::looping()
QSequentialAnimationGroup group;
QSignalSpy groupSpy(&group, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QVERIFY(groupSpy.isValid());
group.addAnimation(sequence);
group.setLoopCount(2);
@@ -1093,6 +1106,9 @@ void tst_QSequentialAnimationGroup::updateChildrenWithRunningGroup()
QSignalSpy groupStateChangedSpy(&group, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
QSignalSpy childStateChangedSpy(&anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QVERIFY(groupStateChangedSpy.isValid());
+ QVERIFY(childStateChangedSpy.isValid());
+
QCOMPARE(groupStateChangedSpy.count(), 0);
QCOMPARE(childStateChangedSpy.count(), 0);
QCOMPARE(group.state(), QAnimationGroup::Stopped);
@@ -1257,6 +1273,9 @@ void tst_QSequentialAnimationGroup::startGroupWithRunningChild()
QSignalSpy stateChangedSpy1(anim1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
QSignalSpy stateChangedSpy2(anim2, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QVERIFY(stateChangedSpy1.isValid());
+ QVERIFY(stateChangedSpy2.isValid());
+
QCOMPARE(stateChangedSpy1.count(), 0);
QCOMPARE(stateChangedSpy2.count(), 0);
QCOMPARE(group.state(), QAnimationGroup::Stopped);
@@ -1329,6 +1348,7 @@ void tst_QSequentialAnimationGroup::zeroDurationAnimation()
anim3->setDuration(0);
QSignalSpy stateChangedSpy(anim1, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QVERIFY(stateChangedSpy.isValid());
group.addAnimation(anim1);
group.addAnimation(anim2);
@@ -1400,6 +1420,7 @@ void tst_QSequentialAnimationGroup::finishWithUncontrolledAnimation()
QSequentialAnimationGroup group;
UncontrolledAnimation notTimeDriven(&o1, &group);
QSignalSpy spy(&group, SIGNAL(finished()));
+ QVERIFY(spy.isValid());
group.start();
QCOMPARE(group.state(), QAnimationGroup::Running);
@@ -1419,6 +1440,7 @@ void tst_QSequentialAnimationGroup::finishWithUncontrolledAnimation()
spy.clear();
DummyPropertyAnimation anim(&group);
QSignalSpy animStateChangedSpy(&anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QVERIFY(animStateChangedSpy.isValid());
group.setCurrentTime(300);
QCOMPARE(group.state(), QAnimationGroup::Stopped);
@@ -1620,6 +1642,7 @@ void tst_QSequentialAnimationGroup::pauseResume()
anim->setDuration(250);
anim->setEndValue(250);
QSignalSpy spy(anim, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)));
+ QVERIFY(spy.isValid());
QCOMPARE(group.duration(), 250);
group.start();
QTest::qWait(100);
diff --git a/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp b/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp
index bb6d32ee41..b7e1015a13 100644
--- a/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp
+++ b/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/codecs/qtextcodec/echo/main.cpp b/tests/auto/corelib/codecs/qtextcodec/echo/main.cpp
index 774cab1a9b..934f9f904b 100644
--- a/tests/auto/corelib/codecs/qtextcodec/echo/main.cpp
+++ b/tests/auto/corelib/codecs/qtextcodec/echo/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -42,7 +42,8 @@
#include <stdlib.h>
#include <stdio.h>
-#include <QtCore>
+#include <QtCore/QCoreApplication>
+#include <QtCore/QTextCodec>
int main(int argc, char **argv)
{
diff --git a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
index deb983c262..b6dcd3ed63 100644
--- a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
+++ b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -356,17 +356,18 @@ void tst_QTextCodec::codecForLocale()
break;
}
}
- if (!codec2) {
- QSKIP("Could not find a codec that is not already the codecForLocale()");
- }
- // set it, codecForLocale() should return it now
- QTextCodec::setCodecForLocale(codec2);
- QCOMPARE(QTextCodec::codecForLocale(), codec2);
+ // Only run the rest of the test if we could find a codec that is not
+ // already the codecForLocale().
+ if (codec2) {
+ // set it, codecForLocale() should return it now
+ QTextCodec::setCodecForLocale(codec2);
+ QCOMPARE(QTextCodec::codecForLocale(), codec2);
- // reset back to the default
- QTextCodec::setCodecForLocale(0);
- QCOMPARE(QTextCodec::codecForLocale(), codec);
+ // reset back to the default
+ QTextCodec::setCodecForLocale(0);
+ QCOMPARE(QTextCodec::codecForLocale(), codec);
+ }
#endif
}
diff --git a/tests/auto/corelib/codecs/utf8/tst_utf8.cpp b/tests/auto/corelib/codecs/utf8/tst_utf8.cpp
index f6726c3281..f6ff8b2208 100644
--- a/tests/auto/corelib/codecs/utf8/tst_utf8.cpp
+++ b/tests/auto/corelib/codecs/utf8/tst_utf8.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp b/tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp
index 1dc35ceeb1..53694100ba 100644
--- a/tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp
+++ b/tests/auto/corelib/concurrent/qfuture/tst_qfuture.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/concurrent/qfuturesynchronizer/tst_qfuturesynchronizer.cpp b/tests/auto/corelib/concurrent/qfuturesynchronizer/tst_qfuturesynchronizer.cpp
index 5aced3f8c1..a2145ca04f 100644
--- a/tests/auto/corelib/concurrent/qfuturesynchronizer/tst_qfuturesynchronizer.cpp
+++ b/tests/auto/corelib/concurrent/qfuturesynchronizer/tst_qfuturesynchronizer.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp b/tests/auto/corelib/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp
index c7e35e2b75..4fad31b5c9 100644
--- a/tests/auto/corelib/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp
+++ b/tests/auto/corelib/concurrent/qfuturewatcher/tst_qfuturewatcher.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -67,7 +67,7 @@ private slots:
void watchFinishedFuture();
void watchCanceledFuture();
void disconnectRunningFuture();
- void toMuchProgress();
+ void tooMuchProgress();
void progressText();
void sharedFutureInterface();
void changeFuture();
@@ -77,7 +77,7 @@ private slots:
void throttling();
void incrementalMapResults();
void incrementalFilterResults();
- void qfutureSynchornizer();
+ void qfutureSynchronizer();
void warnRace();
};
@@ -90,17 +90,20 @@ void tst_QFutureWatcher::startFinish()
{
QFutureWatcher<void> futureWatcher;
- QSignalSpy started(&futureWatcher, SIGNAL(started()));
- QSignalSpy finished(&futureWatcher, SIGNAL(finished()));
+ QSignalSpy startedSpy(&futureWatcher, SIGNAL(started()));
+ QSignalSpy finishedSpy(&futureWatcher, SIGNAL(finished()));
+
+ QVERIFY(startedSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
futureWatcher.setFuture(QtConcurrent::run(sleeper));
QTest::qWait(10); // spin the event loop to deliver queued signals.
- QCOMPARE(started.count(), 1);
- QCOMPARE(finished.count(), 0);
+ QCOMPARE(startedSpy.count(), 1);
+ QCOMPARE(finishedSpy.count(), 0);
futureWatcher.future().waitForFinished();
QTest::qWait(10);
- QCOMPARE(started.count(), 1);
- QCOMPARE(finished.count(), 1);
+ QCOMPARE(startedSpy.count(), 1);
+ QCOMPARE(finishedSpy.count(), 1);
}
void mapSleeper(int &)
@@ -323,6 +326,7 @@ void tst_QFutureWatcher::futureSignals()
f.setFuture(a.future());
QSignalSpy progressSpy(&f, SIGNAL(progressValueChanged(int)));
+ QVERIFY(progressSpy.isValid());
const int progress = 1;
a.setProgressValue(progress);
QTest::qWait(10);
@@ -333,6 +337,9 @@ void tst_QFutureWatcher::futureSignals()
QSignalSpy finishedSpy(&f, SIGNAL(finished()));
QSignalSpy resultReadySpy(&f, SIGNAL(resultReadyAt(int)));
+ QVERIFY(finishedSpy.isValid());
+ QVERIFY(resultReadySpy.isValid());
+
const int result = 10;
a.reportResult(&result);
QTest::qWait(10);
@@ -375,6 +382,11 @@ void tst_QFutureWatcher::watchFinishedFuture()
QSignalSpy resultReadySpy(&watcher, SIGNAL(resultReadyAt(int)));
QSignalSpy canceledSpy(&watcher, SIGNAL(canceled()));
+ QVERIFY(startedSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
+ QVERIFY(resultReadySpy.isValid());
+ QVERIFY(canceledSpy.isValid());
+
watcher.setFuture(f);
QTest::qWait(10);
@@ -404,6 +416,11 @@ void tst_QFutureWatcher::watchCanceledFuture()
QSignalSpy resultReadySpy(&watcher, SIGNAL(resultReadyAt(int)));
QSignalSpy canceledSpy(&watcher, SIGNAL(canceled()));
+ QVERIFY(startedSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
+ QVERIFY(resultReadySpy.isValid());
+ QVERIFY(canceledSpy.isValid());
+
watcher.setFuture(f);
QTest::qWait(10);
@@ -428,6 +445,9 @@ void tst_QFutureWatcher::disconnectRunningFuture()
QSignalSpy finishedSpy(watcher, SIGNAL(finished()));
QSignalSpy resultReadySpy(watcher, SIGNAL(resultReadyAt(int)));
+ QVERIFY(finishedSpy.isValid());
+ QVERIFY(resultReadySpy.isValid());
+
const int result = 10;
a.reportResult(&result);
QTest::qWait(10);
@@ -456,7 +476,7 @@ public:
}
};
-void tst_QFutureWatcher::toMuchProgress()
+void tst_QFutureWatcher::tooMuchProgress()
{
progressValues.clear();
ProgressObject o;
@@ -618,6 +638,7 @@ void tst_QFutureWatcher::changeFuture()
SignalSlotObject object;
connect(&watcher, SIGNAL(resultReadyAt(int)), &object, SLOT(resultReadyAt(int)));
QSignalSpy resultReadySpy(&watcher, SIGNAL(resultReadyAt(int)));
+ QVERIFY(resultReadySpy.isValid());
watcher.setFuture(a); // Watch 'a' which will genere a resultReady event.
watcher.setFuture(b); // But oh no! we're switching to another future
@@ -649,6 +670,7 @@ void tst_QFutureWatcher::cancelEvents()
SignalSlotObject object;
connect(&watcher, SIGNAL(resultReadyAt(int)), &object, SLOT(resultReadyAt(int)));
QSignalSpy resultReadySpy(&watcher, SIGNAL(resultReadyAt(int)));
+ QVERIFY(resultReadySpy.isValid());
watcher.setFuture(a);
watcher.cancel();
@@ -676,6 +698,7 @@ void tst_QFutureWatcher::pauseEvents()
SignalSlotObject object;
connect(&watcher, SIGNAL(resultReadyAt(int)), &object, SLOT(resultReadyAt(int)));
QSignalSpy resultReadySpy(&watcher, SIGNAL(resultReadyAt(int)));
+ QVERIFY(resultReadySpy.isValid());
watcher.setFuture(a);
watcher.pause();
@@ -701,6 +724,7 @@ void tst_QFutureWatcher::pauseEvents()
SignalSlotObject object;
connect(&watcher, SIGNAL(resultReadyAt(int)), &object, SLOT(resultReadyAt(int)));
QSignalSpy resultReadySpy(&watcher, SIGNAL(resultReadyAt(int)));
+ QVERIFY(resultReadySpy.isValid());
watcher.setFuture(a);
a.pause();
@@ -867,7 +891,7 @@ void tst_QFutureWatcher::incrementalFilterResults()
future.waitForFinished();
}
-void tst_QFutureWatcher::qfutureSynchornizer()
+void tst_QFutureWatcher::qfutureSynchronizer()
{
int taskCount = 1000;
QTime t;
diff --git a/tests/auto/corelib/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp b/tests/auto/corelib/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp
index 91d61e29d4..272d8514ef 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp
+++ b/tests/auto/corelib/concurrent/qtconcurrentfilter/tst_qtconcurrentfilter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -59,7 +59,7 @@ private slots:
void filteredReduced();
void resultAt();
void incrementalResults();
- void noDetatch();
+ void noDetach();
#ifndef QT_NO_STL
void stlContainers();
#endif
@@ -1461,7 +1461,7 @@ void tst_QtConcurrentFilter::incrementalResults()
QCOMPARE(future.results().count(), count / 2);
}
-void tst_QtConcurrentFilter::noDetatch()
+void tst_QtConcurrentFilter::noDetach()
{
{
QList<int> l = QList<int>() << 1;
diff --git a/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp b/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
index 96ba71b156..16f61513eb 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
+++ b/tests/auto/corelib/concurrent/qtconcurrentiteratekernel/tst_qtconcurrentiteratekernel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/concurrent/qtconcurrentmap/functions.h b/tests/auto/corelib/concurrent/qtconcurrentmap/functions.h
index a3dcd3c300..ebca462676 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentmap/functions.h
+++ b/tests/auto/corelib/concurrent/qtconcurrentmap/functions.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp b/tests/auto/corelib/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp
index a1dd1c7ab9..df74c028d3 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp
+++ b/tests/auto/corelib/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -74,7 +74,7 @@ private slots:
void exceptions();
#endif
void incrementalResults();
- void noDetatch();
+ void noDetach();
#ifndef QT_NO_STL
void stlContainers();
#endif
@@ -2279,7 +2279,7 @@ void tst_QtConcurrentMap::incrementalResults()
Test that mapped does not cause deep copies when holding
references to Qt containers.
*/
-void tst_QtConcurrentMap::noDetatch()
+void tst_QtConcurrentMap::noDetach()
{
{
QList<int> l = QList<int>() << 1;
diff --git a/tests/auto/corelib/concurrent/qtconcurrentresultstore/tst_qtconcurrentresultstore.cpp b/tests/auto/corelib/concurrent/qtconcurrentresultstore/tst_qtconcurrentresultstore.cpp
index f5b3f2965e..980fc6c282 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentresultstore/tst_qtconcurrentresultstore.cpp
+++ b/tests/auto/corelib/concurrent/qtconcurrentresultstore/tst_qtconcurrentresultstore.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp b/tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp
index 23f099bffa..96f705d00b 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp
+++ b/tests/auto/corelib/concurrent/qtconcurrentrun/tst_qtconcurrentrun.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp b/tests/auto/corelib/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp
index e020190ae3..858faa6eab 100644
--- a/tests/auto/corelib/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp
+++ b/tests/auto/corelib/concurrent/qtconcurrentthreadengine/tst_qtconcurrentthreadengine.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -48,14 +48,13 @@ using namespace QtConcurrent;
class tst_QtConcurrentThreadEngine: public QObject
{
Q_OBJECT
-public:
- void threadCount();
private slots:
void runDirectly();
void result();
void runThroughStarter();
void cancel();
void throttle();
+ void threadCount();
void multipleResults();
void stresstest();
void cancelQueuedSlowUser();
@@ -279,6 +278,8 @@ public:
void tst_QtConcurrentThreadEngine::threadCount()
{
+ QSKIP("QTBUG-23333: This test is unstable");
+
const int repeats = 10;
for (int i = 0; i < repeats; ++i) {
ThreadCountUser t;
@@ -445,8 +446,7 @@ void tst_QtConcurrentThreadEngine::exceptions()
} catch (const Exception &) {
caught = true;
}
- if (!caught)
- QFAIL("did not get exception");
+ QVERIFY2(caught, "did not get exception");
}
// Blocking mode:
@@ -459,9 +459,7 @@ void tst_QtConcurrentThreadEngine::exceptions()
} catch (const Exception &) {
caught = true;
}
-
- if (!caught)
- QFAIL("did not get exception");
+ QVERIFY2(caught, "did not get exception");
}
// test throwing the exception from the main thread (different code path)
@@ -473,9 +471,7 @@ void tst_QtConcurrentThreadEngine::exceptions()
} catch (const Exception &) {
caught = true;
}
-
- if (!caught)
- QFAIL("did not get exception");
+ QVERIFY2(caught, "did not get exception");
}
// Asynchronous mode:
@@ -488,8 +484,7 @@ void tst_QtConcurrentThreadEngine::exceptions()
} catch (const QtConcurrent::UnhandledException &) {
caught = true;
}
- if (!caught)
- QFAIL("did not get exception");
+ QVERIFY2(caught, "did not get exception");
}
// Blocking mode:
@@ -502,9 +497,7 @@ void tst_QtConcurrentThreadEngine::exceptions()
} catch (const QtConcurrent::UnhandledException &) {
caught = true;
}
-
- if (!caught)
- QFAIL("did not get exception");
+ QVERIFY2(caught, "did not get exception");
}
// test throwing the exception from the main thread (different code path)
@@ -516,9 +509,7 @@ void tst_QtConcurrentThreadEngine::exceptions()
} catch (const QtConcurrent::UnhandledException &) {
caught = true;
}
-
- if (!caught)
- QFAIL("did not get exception");
+ QVERIFY2(caught, "did not get exception");
}
}
diff --git a/tests/auto/corelib/concurrent/qthreadpool/tst_qthreadpool.cpp b/tests/auto/corelib/concurrent/qthreadpool/tst_qthreadpool.cpp
index ff26d5d2c3..e08ed2b3fc 100644
--- a/tests/auto/corelib/concurrent/qthreadpool/tst_qthreadpool.cpp
+++ b/tests/auto/corelib/concurrent/qthreadpool/tst_qthreadpool.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -205,9 +205,7 @@ void tst_QThreadPool::runTask()
QThreadPool manager;
ran = false;
manager.start(new TestTask());
- // Hang if task is not runned.
- while (ran == false)
- QTest::qSleep(100); // no busy loop - this doesn't work with FIFO schedulers
+ QTRY_VERIFY(ran);
}
/*
@@ -217,8 +215,7 @@ void tst_QThreadPool::singleton()
{
ran = false;
QThreadPool::globalInstance()->start(new TestTask());
- while (ran == false)
- QTest::qSleep(100); // no busy loop - this doesn't work with FIFO schedulers
+ QTRY_VERIFY(ran);
}
int *value = 0;
diff --git a/tests/auto/corelib/corelib.pro b/tests/auto/corelib/corelib.pro
index 50228990c9..84eb3f284c 100644
--- a/tests/auto/corelib/corelib.pro
+++ b/tests/auto/corelib/corelib.pro
@@ -5,6 +5,7 @@ SUBDIRS=\
concurrent \
global \
io \
+ itemmodels \
kernel \
plugin \
statemachine \
diff --git a/tests/auto/corelib/global/q_func_info/tst_q_func_info.cpp b/tests/auto/corelib/global/q_func_info/tst_q_func_info.cpp
index e4949348f4..35a74f154d 100644
--- a/tests/auto/corelib/global/q_func_info/tst_q_func_info.cpp
+++ b/tests/auto/corelib/global/q_func_info/tst_q_func_info.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/global/qflags/tst_qflags.cpp b/tests/auto/corelib/global/qflags/tst_qflags.cpp
index 85e64a6d63..d80f401071 100644
--- a/tests/auto/corelib/global/qflags/tst_qflags.cpp
+++ b/tests/auto/corelib/global/qflags/tst_qflags.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp b/tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp
index f440e4eaa5..41fb311837 100644
--- a/tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp
+++ b/tests/auto/corelib/global/qgetputenv/tst_qgetputenv.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
index 3efdbf0433..23b9c6bbab 100644
--- a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
+++ b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp b/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp
index 697ddfc9d2..f73884fe02 100644
--- a/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp
+++ b/tests/auto/corelib/global/qnumeric/tst_qnumeric.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/global/qrand/tst_qrand.cpp b/tests/auto/corelib/global/qrand/tst_qrand.cpp
index 7ac778211c..71f14e28e2 100644
--- a/tests/auto/corelib/global/qrand/tst_qrand.cpp
+++ b/tests/auto/corelib/global/qrand/tst_qrand.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/io.pro b/tests/auto/corelib/io/io.pro
index e044eda1ca..ae0b4968b8 100644
--- a/tests/auto/corelib/io/io.pro
+++ b/tests/auto/corelib/io/io.pro
@@ -7,10 +7,12 @@ SUBDIRS=\
qdir \
qdiriterator \
qfile \
+ largefile \
qfileinfo \
qfilesystementry \
qfilesystemwatcher \
qiodevice \
+ qnodebug \
qprocess \
qprocessenvironment \
qresourceengine \
diff --git a/tests/auto/corelib/io/qfile/largefile/largefile.pro b/tests/auto/corelib/io/largefile/largefile.pro
index 4e629122ec..4e629122ec 100644
--- a/tests/auto/corelib/io/qfile/largefile/largefile.pro
+++ b/tests/auto/corelib/io/largefile/largefile.pro
diff --git a/tests/auto/corelib/io/qfile/largefile/tst_largefile.cpp b/tests/auto/corelib/io/largefile/tst_largefile.cpp
index ce7b829738..ba2eced60a 100644
--- a/tests/auto/corelib/io/qfile/largefile/tst_largefile.cpp
+++ b/tests/auto/corelib/io/largefile/tst_largefile.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp b/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp
index 9f8fcda01c..1bffd63d1b 100644
--- a/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp
+++ b/tests/auto/corelib/io/qabstractfileengine/tst_qabstractfileengine.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp b/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp
index e2d422ad54..e2890d7891 100644
--- a/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp
+++ b/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
index 3d3f5b4a97..d17bab3bc1 100644
--- a/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
+++ b/tests/auto/corelib/io/qdatastream/tst_qdatastream.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,12 @@
****************************************************************************/
#include <QtTest/QtTest>
-#include <QtGui/QtGui>
+#include <QtGui/QBitmap>
+#include <QtGui/QPixmap>
+#include <QtGui/QPicture>
+#include <QtGui/QTextLength>
+#include <QtGui/QPainter>
+#include <QtGui/QPen>
Q_DECLARE_METATYPE(QBitArray)
Q_DECLARE_METATYPE(qint64)
@@ -873,7 +878,7 @@ static void QBitArrayData(QBitArray *b, int index)
for (int i = 0; i < filler.length(); ++i) {
if (filler.at(i) == '1')
- b->setBit(i, TRUE);
+ b->setBit(i, true);
}
}
@@ -1100,11 +1105,17 @@ void tst_QDataStream::readQCursor(QDataStream *s)
QVERIFY(d5.shape() == test.shape()); //## lacks operator==
QVERIFY(d5.hotSpot() == test.hotSpot());
QVERIFY((d5.bitmap() != 0 && test.bitmap() != 0) || (d5.bitmap() == 0 && test.bitmap() == 0));
- if (d5.bitmap() != 0)
- QVERIFY(pixmapsAreEqual(d5.bitmap(), test.bitmap()));
+ if (d5.bitmap() != 0) {
+ QPixmap actual = *(d5.bitmap());
+ QPixmap expected = *(test.bitmap());
+ QCOMPARE(actual, expected);
+ }
QVERIFY((d5.mask() != 0 && test.mask() != 0) || (d5.mask() == 0 && test.mask() == 0));
- if (d5.mask() != 0)
- QVERIFY(pixmapsAreEqual(d5.mask(), test.mask()));
+ if (d5.mask() != 0) {
+ QPixmap actual = *(d5.mask());
+ QPixmap expected = *(test.mask());
+ QCOMPARE(actual, expected);
+ }
#endif
}
@@ -1307,83 +1318,83 @@ void tst_QDataStream::readQDateTime(QDataStream *s)
static QFont qFontData(int index)
{
switch (index) {
- case 0: return QFont("Courier", 20, QFont::Bold, TRUE);
- case 1: return QFont("Courier", 18, QFont::Bold, FALSE);
- case 2: return QFont("Courier", 16, QFont::Light, TRUE);
- case 3: return QFont("Courier", 14, QFont::Normal, FALSE);
- case 4: return QFont("Courier", 12, QFont::DemiBold, TRUE);
- case 5: return QFont("Courier", 10, QFont::Black, FALSE);
+ case 0: return QFont("Courier", 20, QFont::Bold, true);
+ case 1: return QFont("Courier", 18, QFont::Bold, false);
+ case 2: return QFont("Courier", 16, QFont::Light, true);
+ case 3: return QFont("Courier", 14, QFont::Normal, false);
+ case 4: return QFont("Courier", 12, QFont::DemiBold, true);
+ case 5: return QFont("Courier", 10, QFont::Black, false);
case 6:
{
- QFont f("Helvetica", 10, QFont::Normal, FALSE);
+ QFont f("Helvetica", 10, QFont::Normal, false);
f.setPixelSize(2);
- f.setUnderline(FALSE);
- f.setStrikeOut(FALSE);
- f.setFixedPitch(FALSE);
+ f.setUnderline(false);
+ f.setStrikeOut(false);
+ f.setFixedPitch(false);
return f;
}
case 7:
{
- QFont f("Helvetica", 10, QFont::Bold, FALSE);
+ QFont f("Helvetica", 10, QFont::Bold, false);
f.setPixelSize(4);
- f.setUnderline(TRUE);
- f.setStrikeOut(FALSE);
- f.setFixedPitch(FALSE);
+ f.setUnderline(true);
+ f.setStrikeOut(false);
+ f.setFixedPitch(false);
return f;
}
case 8:
{
- QFont f("Helvetica", 10, QFont::Light, FALSE);
+ QFont f("Helvetica", 10, QFont::Light, false);
f.setPixelSize(6);
- f.setUnderline(FALSE);
- f.setStrikeOut(TRUE);
- f.setFixedPitch(FALSE);
+ f.setUnderline(false);
+ f.setStrikeOut(true);
+ f.setFixedPitch(false);
return f;
}
case 9:
{
- QFont f("Helvetica", 10, QFont::DemiBold, FALSE);
+ QFont f("Helvetica", 10, QFont::DemiBold, false);
f.setPixelSize(8);
- f.setUnderline(FALSE);
- f.setStrikeOut(FALSE);
- f.setFixedPitch(TRUE);
+ f.setUnderline(false);
+ f.setStrikeOut(false);
+ f.setFixedPitch(true);
return f;
}
case 10:
{
- QFont f("Helvetica", 10, QFont::Black, FALSE);
+ QFont f("Helvetica", 10, QFont::Black, false);
f.setPixelSize(10);
- f.setUnderline(TRUE);
- f.setStrikeOut(TRUE);
- f.setFixedPitch(FALSE);
+ f.setUnderline(true);
+ f.setStrikeOut(true);
+ f.setFixedPitch(false);
return f;
}
case 11:
{
- QFont f("Helvetica", 10, QFont::Normal, TRUE);
+ QFont f("Helvetica", 10, QFont::Normal, true);
f.setPixelSize(12);
- f.setUnderline(FALSE);
- f.setStrikeOut(TRUE);
- f.setFixedPitch(TRUE);
+ f.setUnderline(false);
+ f.setStrikeOut(true);
+ f.setFixedPitch(true);
return f;
}
case 12:
{
- QFont f("Helvetica", 10, QFont::Bold, TRUE);
+ QFont f("Helvetica", 10, QFont::Bold, true);
f.setPixelSize(14);
- f.setUnderline(TRUE);
- f.setStrikeOut(TRUE);
- f.setFixedPitch(TRUE);
+ f.setUnderline(true);
+ f.setStrikeOut(true);
+ f.setFixedPitch(true);
return f;
}
case 13:
{
- QFont f("Helvetica", 10, QFont::Bold, TRUE);
+ QFont f("Helvetica", 10, QFont::Bold, true);
f.setStretch(200);
return f;
}
}
- return QFont("Courier", 18, QFont::Bold, TRUE);
+ return QFont("Courier", 18, QFont::Bold, true);
}
#define MAX_QFONT_DATA 14
diff --git a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
index f33a7eef5a..535807bfc3 100644
--- a/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
+++ b/tests/auto/corelib/io/qdebug/tst_qdebug.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtCore/QtCore>
+#include <QtCore/QCoreApplication>
#include <QtCore/QtDebug>
#include <QtTest/QtTest>
@@ -81,16 +81,34 @@ static void myMessageHandler(QtMsgType type, const char *msg)
s_msgType = type;
}
+// Helper class to ensure that the testlib message handler gets
+// restored at the end of each test function, even if the test
+// fails or throws an exception.
+class MessageHandlerSetter
+{
+public:
+ MessageHandlerSetter(QtMsgHandler newMsgHandler)
+ : oldMsgHandler(qInstallMsgHandler(newMsgHandler))
+ { }
+
+ ~MessageHandlerSetter()
+ {
+ qInstallMsgHandler(oldMsgHandler);
+ }
+
+private:
+ QtMsgHandler oldMsgHandler;
+};
+
/*! \internal
The qWarning() stream should be usable even if QT_NO_DEBUG is defined.
*/
void tst_QDebug::warningWithoutDebug() const
{
- qInstallMsgHandler(myMessageHandler);
+ MessageHandlerSetter mhs(myMessageHandler);
{ qWarning() << "A qWarning() message"; }
QCOMPARE(s_msgType, QtWarningMsg);
QCOMPARE(QString::fromLatin1(s_msg.data()), QString::fromLatin1("A qWarning() message "));
- qInstallMsgHandler(0);
}
/*! \internal
@@ -98,25 +116,23 @@ void tst_QDebug::warningWithoutDebug() const
*/
void tst_QDebug::criticalWithoutDebug() const
{
- qInstallMsgHandler(myMessageHandler);
+ MessageHandlerSetter mhs(myMessageHandler);
{ qCritical() << "A qCritical() message"; }
QCOMPARE(s_msgType, QtCriticalMsg);
QCOMPARE(QString::fromLatin1(s_msg), QString::fromLatin1("A qCritical() message "));
- qInstallMsgHandler(0);
}
void tst_QDebug::debugWithQBool() const
{
- qInstallMsgHandler(myMessageHandler);
+ MessageHandlerSetter mhs(myMessageHandler);
{ qDebug() << QBool(false) << QBool(true); }
QCOMPARE(s_msgType, QtDebugMsg);
QCOMPARE(QString::fromLatin1(s_msg), QString::fromLatin1("false true "));
- qInstallMsgHandler(0);
}
void tst_QDebug::veryLongWarningMessage() const
{
- qInstallMsgHandler(myMessageHandler);
+ MessageHandlerSetter mhs(myMessageHandler);
QString test;
{
QString part("0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\n");
@@ -126,7 +142,6 @@ void tst_QDebug::veryLongWarningMessage() const
}
QCOMPARE(s_msgType, QtWarningMsg);
QCOMPARE(QString::fromLatin1(s_msg), QString::fromLatin1("Test output:\n")+test+QString::fromLatin1("\nend"));
- qInstallMsgHandler(0);
}
void tst_QDebug::qDebugQStringRef() const
@@ -136,27 +151,26 @@ void tst_QDebug::qDebugQStringRef() const
const QString in(QLatin1String("input"));
const QStringRef inRef(&in);
- qInstallMsgHandler(myMessageHandler);
+ MessageHandlerSetter mhs(myMessageHandler);
{ qDebug() << inRef; }
QCOMPARE(s_msgType, QtDebugMsg);
QCOMPARE(QString::fromLatin1(s_msg), QString::fromLatin1("\"input\" "));
- qInstallMsgHandler(0);
}
/* Use a null QStringRef. */
{
const QStringRef inRef;
- qInstallMsgHandler(myMessageHandler);
+ MessageHandlerSetter mhs(myMessageHandler);
{ qDebug() << inRef; }
QCOMPARE(s_msgType, QtDebugMsg);
QCOMPARE(QString::fromLatin1(s_msg), QString::fromLatin1("\"\" "));
- qInstallMsgHandler(0);
}
}
void tst_QDebug::defaultMessagehandler() const
{
+ MessageHandlerSetter mhs(0);
QtMsgHandler defaultMessageHandler1 = qInstallMsgHandler(0);
QtMsgHandler defaultMessageHandler2 = qInstallMsgHandler(myMessageHandler);
bool same = (*defaultMessageHandler1 == *defaultMessageHandler2);
diff --git a/tests/auto/corelib/io/qdir/testdir/dir/qrc_qdir.cpp b/tests/auto/corelib/io/qdir/testdir/dir/qrc_qdir.cpp
index 74114760c9..01cbc13d40 100644
--- a/tests/auto/corelib/io/qdir/testdir/dir/qrc_qdir.cpp
+++ b/tests/auto/corelib/io/qdir/testdir/dir/qrc_qdir.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qdir/testdir/dir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/testdir/dir/tst_qdir.cpp
index 74114760c9..01cbc13d40 100644
--- a/tests/auto/corelib/io/qdir/testdir/dir/tst_qdir.cpp
+++ b/tests/auto/corelib/io/qdir/testdir/dir/tst_qdir.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp
index 5b48f9da00..1f4e05d0cd 100644
--- a/tests/auto/corelib/io/qdir/tst_qdir.cpp
+++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -100,6 +100,7 @@ private slots:
void removeRecursively_data();
void removeRecursively();
void removeRecursivelyFailure();
+ void removeRecursivelySymlink();
void exists_data();
void exists();
@@ -412,6 +413,31 @@ void tst_QDir::removeRecursivelyFailure()
QVERIFY(!dir.exists());
}
+void tst_QDir::removeRecursivelySymlink()
+{
+#ifndef Q_NO_SYMLINKS
+ const QString tmpdir = QDir::currentPath() + "/tmpdir/";
+ QDir().mkpath(tmpdir);
+ QDir currentDir;
+ currentDir.mkdir("myDir");
+ QFile("testfile").open(QIODevice::WriteOnly);
+ const QString link = tmpdir + "linkToDir.lnk";
+ const QString linkToFile = tmpdir + "linkToFile.lnk";
+#ifndef Q_NO_SYMLINKS_TO_DIRS
+ QVERIFY(QFile::link("../myDir", link));
+ QVERIFY(QFile::link("../testfile", linkToFile));
+#endif
+
+ QDir dir(tmpdir);
+ QVERIFY(dir.removeRecursively());
+ QVERIFY(QDir("myDir").exists()); // it didn't follow the symlink, good.
+ QVERIFY(QFile::exists("testfile"));
+
+ currentDir.rmdir("myDir");
+ QFile::remove("testfile");
+#endif
+}
+
void tst_QDir::exists_data()
{
QTest::addColumn<QString>("path");
diff --git a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp
index 8a7f1747b4..3b3b2b5a04 100644
--- a/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp
+++ b/tests/auto/corelib/io/qdiriterator/tst_qdiriterator.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qfile/qfile.pro b/tests/auto/corelib/io/qfile/qfile.pro
index 8bb142c5b4..e2c714c67f 100644
--- a/tests/auto/corelib/io/qfile/qfile.pro
+++ b/tests/auto/corelib/io/qfile/qfile.pro
@@ -5,6 +5,4 @@ wince* {
SUBDIRS = test stdinprocess
}
-SUBDIRS += largefile
-
CONFIG += parallel_test
diff --git a/tests/auto/corelib/io/qfile/stdinprocess/main.cpp b/tests/auto/corelib/io/qfile/stdinprocess/main.cpp
index 57a8d904f5..14cb28af6b 100644
--- a/tests/auto/corelib/io/qfile/stdinprocess/main.cpp
+++ b/tests/auto/corelib/io/qfile/stdinprocess/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,8 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
+#include <QtCore/QFile>
int main(int argc, char *argv[])
{
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index 300f30e133..0549fe32f0 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -404,7 +404,7 @@ void tst_QFile::cleanupTestCase()
void tst_QFile::exists()
{
QFile f( QFINDTESTDATA("testfile.txt") );
- QCOMPARE( f.exists(), (bool)TRUE );
+ QVERIFY(f.exists());
QFile file("nobodyhassuchafile");
file.remove();
@@ -443,41 +443,41 @@ void tst_QFile::open_data()
#endif
QTest::newRow( "exist_readOnly" )
<< QString(QFINDTESTDATA("testfile.txt")) << int(QIODevice::ReadOnly)
- << (bool)TRUE << QFile::NoError;
+ << true << QFile::NoError;
QTest::newRow( "exist_writeOnly" )
<< QString("readonlyfile")
<< int(QIODevice::WriteOnly)
- << (bool)FALSE
+ << false
<< QFile::OpenError;
QTest::newRow( "exist_append" )
<< QString("readonlyfile") << int(QIODevice::Append)
- << (bool)FALSE << QFile::OpenError;
+ << false << QFile::OpenError;
QTest::newRow( "nonexist_readOnly" )
<< QString("nonExist.txt") << int(QIODevice::ReadOnly)
- << (bool)FALSE << QFile::OpenError;
+ << false << QFile::OpenError;
QTest::newRow("emptyfile")
<< QString("")
<< int(QIODevice::ReadOnly)
- << (bool)FALSE
+ << false
<< QFile::OpenError;
- QTest::newRow("nullfile") << QString() << int(QIODevice::ReadOnly) << (bool)FALSE
+ QTest::newRow("nullfile") << QString() << int(QIODevice::ReadOnly) << false
<< QFile::OpenError;
- QTest::newRow("two-dots") << QString(QFINDTESTDATA("two.dots.file")) << int(QIODevice::ReadOnly) << (bool)TRUE
+ QTest::newRow("two-dots") << QString(QFINDTESTDATA("two.dots.file")) << int(QIODevice::ReadOnly) << true
<< QFile::NoError;
QTest::newRow("readonlyfile") << QString("readonlyfile") << int(QIODevice::WriteOnly)
- << (bool)FALSE << QFile::OpenError;
+ << false << QFile::OpenError;
QTest::newRow("noreadfile") << QString("noreadfile") << int(QIODevice::ReadOnly)
- << (bool)FALSE << QFile::OpenError;
+ << false << QFile::OpenError;
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
QTest::newRow("//./PhysicalDrive0") << QString("//./PhysicalDrive0") << int(QIODevice::ReadOnly)
- << (bool)TRUE << QFile::NoError;
+ << true << QFile::NoError;
QTest::newRow("uncFile") << "//" + QtNetworkSettings::winServerName() + "/testshare/test.pri" << int(QIODevice::ReadOnly)
<< true << QFile::NoError;
#endif
@@ -694,7 +694,7 @@ void tst_QFile::atEnd()
bool end = f.atEnd();
f.close();
- QCOMPARE( end, (bool)TRUE );
+ QVERIFY(end);
}
void tst_QFile::readLine()
@@ -832,7 +832,7 @@ void tst_QFile::readAllStdin()
QByteArray lotsOfData(1024, '@'); // 10 megs
QProcess process;
- process.start("stdinprocess/stdinprocess all");
+ process.start(QFINDTESTDATA("stdinprocess/stdinprocess")+" all");
QVERIFY( process.waitForStarted() );
for (int i = 0; i < 5; ++i) {
QTest::qWait(1000);
@@ -867,7 +867,7 @@ void tst_QFile::readLineStdin()
for (int i = 0; i < 2; ++i) {
QProcess process;
- process.start(QString("stdinprocess/stdinprocess line %1").arg(i), QIODevice::Text | QIODevice::ReadWrite);
+ process.start((QFINDTESTDATA("stdinprocess/stdinprocess")+QString(" line %1").arg(i)), QIODevice::Text | QIODevice::ReadWrite);
for (int i = 0; i < 5; ++i) {
QTest::qWait(1000);
process.write(lotsOfData);
@@ -901,7 +901,7 @@ void tst_QFile::readLineStdin_lineByLine()
#else
for (int i = 0; i < 2; ++i) {
QProcess process;
- process.start(QString("stdinprocess/stdinprocess line %1").arg(i), QIODevice::Text | QIODevice::ReadWrite);
+ process.start(QFINDTESTDATA("stdinprocess/stdinprocess")+ QString(" line %1").arg(i), QIODevice::Text | QIODevice::ReadWrite);
QVERIFY(process.waitForStarted());
for (int j = 0; j < 3; ++j) {
@@ -1483,14 +1483,15 @@ void tst_QFile::tailFile()
QVERIFY(tailFile.open(QFile::ReadOnly));
tailFile.seek(file.size());
- QSignalSpy readSignal(&tailFile, SIGNAL(readyRead()));
+ QSignalSpy readSignalSpy(&tailFile, SIGNAL(readyRead()));
+ QVERIFY(readSignalSpy.isValid());
file.write("", 1);
QTestEventLoop::instance().enterLoop(5);
QVERIFY(!QTestEventLoop::instance().timeout());
- QCOMPARE(readSignal.count(), 1);
+ QCOMPARE(readSignalSpy.count(), 1);
}
void tst_QFile::flush()
@@ -1939,7 +1940,7 @@ public:
virtual ~MyEngine() {}
void setFileName(const QString &) {}
- bool open(int ) { return false; }
+ bool open(QIODevice::OpenMode) { return false; }
bool close() { return false; }
bool flush() { return false; }
qint64 size() const { return 123 + number; }
diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
index c3979fce15..5764cee66d 100644
--- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -49,6 +49,7 @@
#include <qdir.h>
#include <qfileinfo.h>
#ifdef Q_OS_UNIX
+#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
@@ -1492,41 +1493,53 @@ void tst_QFileInfo::testDecomposedUnicodeNames_data()
QTest::newRow("no decomposed") << currPath + QString::fromUtf8("/4 øøøcopy.pdf") << QString::fromUtf8("4 øøøcopy.pdf") << true;
}
-static void createFileNative(const QString &filePath)
+// This is a helper class that ensures that files created during the test
+// will be removed afterwards, even if the test fails or throws an exception.
+class NativeFileCreator
{
+public:
+ NativeFileCreator(const QString &filePath)
+ : m_filePath(filePath), m_error(0)
+ {
#ifdef Q_OS_UNIX
- int fd = open(filePath.normalized(QString::NormalizationForm_D).toUtf8().constData(), O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR);
- if (fd < 0) {
- QFAIL("couldn't create file");
- } else {
- close(fd);
- }
-#else
- Q_UNUSED(filePath);
+ int fd = open(m_filePath.normalized(QString::NormalizationForm_D).toUtf8().constData(), O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR);
+ if (fd >= 0)
+ close(fd);
+ else
+ m_error = errno;
#endif
-}
-
-static void removeFileNative(const QString &filePath)
-{
+ }
+ ~NativeFileCreator()
+ {
#ifdef Q_OS_UNIX
- unlink(filePath.normalized(QString::NormalizationForm_D).toUtf8().constData());
-#else
- Q_UNUSED(filePath);
+ if (m_error == 0)
+ unlink(m_filePath.normalized(QString::NormalizationForm_D).toUtf8().constData());
#endif
-}
+ }
+ int error() const
+ {
+ return m_error;
+ }
+
+private:
+ QString m_filePath;
+ int m_error;
+};
void tst_QFileInfo::testDecomposedUnicodeNames()
{
#ifndef Q_OS_MAC
QSKIP("This is a OS X only test (unless you know more about filesystems, then maybe you should try it ;)");
-#endif
+#else
QFETCH(QString, filePath);
- createFileNative(filePath);
+ NativeFileCreator nativeFileCreator(filePath);
+ int error = nativeFileCreator.error();
+ QVERIFY2(error == 0, qPrintable(QString("Couldn't create native file %1: %2").arg(filePath).arg(strerror(error))));
QFileInfo file(filePath);
QTEST(file.fileName(), "fileName");
QTEST(file.exists(), "exists");
- removeFileNative(filePath);
+#endif
}
void tst_QFileInfo::equalOperator() const
diff --git a/tests/auto/corelib/io/qfilesystementry/tst_qfilesystementry.cpp b/tests/auto/corelib/io/qfilesystementry/tst_qfilesystementry.cpp
index e8a7e945c3..cc75801638 100644
--- a/tests/auto/corelib/io/qfilesystementry/tst_qfilesystementry.cpp
+++ b/tests/auto/corelib/io/qfilesystementry/tst_qfilesystementry.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
index b9840bdb75..05b2539182 100644
--- a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
+++ b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -56,9 +56,6 @@ class tst_QFileSystemWatcher : public QObject
{
Q_OBJECT
-public:
- tst_QFileSystemWatcher();
-
private slots:
void basicTest_data();
void basicTest();
@@ -81,44 +78,18 @@ private slots:
void cleanup();
void destroyAfterQCoreApplication();
-private:
- QStringList do_force_engines;
- bool do_force_native;
};
-tst_QFileSystemWatcher::tst_QFileSystemWatcher()
- : do_force_native(false)
-{
-#ifdef Q_OS_LINUX
- // the inotify implementation in the kernel is known to be buggy in certain versions of the linux kernel
- do_force_engines << "native";
- do_force_engines << "dnotify";
-
-#ifdef QT_NO_INOTIFY
- if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13))
- do_force_engines << "inotify";
-#else
- if (inotify_init() != -1)
- do_force_engines << "inotify";
-#endif
-#elif defined(Q_OS_WIN) || defined(Q_OS_DARWIN) || defined(Q_OS_FREEBSD)
- // we have native engines for win32, macosx and freebsd
- do_force_engines << "native";
-#endif
-}
-
void tst_QFileSystemWatcher::basicTest_data()
{
QTest::addColumn<QString>("backend");
- foreach(QString engine, do_force_engines)
- QTest::newRow(engine.toLatin1().constData()) << engine;
- QTest::newRow("poller") << "poller";
+ QTest::newRow("native backend") << "native";
+ QTest::newRow("poller backend") << "poller";
}
void tst_QFileSystemWatcher::basicTest()
{
QFETCH(QString, backend);
- qDebug() << "Testing" << backend << "engine";
// create test file
QFile testFile("testfile.txt");
@@ -134,10 +105,10 @@ void tst_QFileSystemWatcher::basicTest()
// create watcher, forcing it to use a specific backend
QFileSystemWatcher watcher;
watcher.setObjectName(QLatin1String("_qt_autotest_force_engine_") + backend);
- watcher.removePath(testFile.fileName());
- watcher.addPath(testFile.fileName());
+ QVERIFY(watcher.addPath(testFile.fileName()));
QSignalSpy changedSpy(&watcher, SIGNAL(fileChanged(const QString &)));
+ QVERIFY(changedSpy.isValid());
QEventLoop eventLoop;
QTimer timer;
connect(&timer, SIGNAL(timeout()), &eventLoop, SLOT(quit()));
@@ -159,10 +130,7 @@ void tst_QFileSystemWatcher::basicTest()
testFile.close();
// waiting max 5 seconds for notification for file modification to trigger
- timer.start(5000);
- eventLoop.exec();
-
- QCOMPARE(changedSpy.count(), 1);
+ QTRY_COMPARE(changedSpy.count(), 1);
QCOMPARE(changedSpy.at(0).count(), 1);
QString fileName = changedSpy.at(0).at(0).toString();
@@ -171,7 +139,7 @@ void tst_QFileSystemWatcher::basicTest()
changedSpy.clear();
// remove the watch and modify the file, should not get a signal from the watcher
- watcher.removePath(testFile.fileName());
+ QVERIFY(watcher.removePath(testFile.fileName()));
testFile.open(QIODevice::WriteOnly | QIODevice::Truncate);
testFile.write(QByteArray("hello universe!"));
testFile.close();
@@ -183,31 +151,25 @@ void tst_QFileSystemWatcher::basicTest()
QCOMPARE(changedSpy.count(), 0);
// readd the file watch with a relative path
- watcher.addPath(testFile.fileName().prepend("./"));
+ QVERIFY(watcher.addPath(testFile.fileName().prepend("./")));
testFile.open(QIODevice::WriteOnly | QIODevice::Truncate);
testFile.write(QByteArray("hello multiverse!"));
testFile.close();
- timer.start(5000);
- eventLoop.exec();
-
- QVERIFY(changedSpy.count() > 0);
+ QTRY_VERIFY(changedSpy.count() > 0);
- watcher.removePath(testFile.fileName().prepend("./"));
+ QVERIFY(watcher.removePath(testFile.fileName().prepend("./")));
changedSpy.clear();
// readd the file watch
- watcher.addPath(testFile.fileName());
+ QVERIFY(watcher.addPath(testFile.fileName()));
// change the permissions, should get a signal from the watcher
testFile.setPermissions(QFile::ReadOwner);
// waiting max 5 seconds for notification for file permission modification to trigger
- timer.start(5000);
- eventLoop.exec();
-
- QCOMPARE(changedSpy.count(), 1);
+ QTRY_COMPARE(changedSpy.count(), 1);
QCOMPARE(changedSpy.at(0).count(), 1);
fileName = changedSpy.at(0).at(0).toString();
@@ -216,7 +178,7 @@ void tst_QFileSystemWatcher::basicTest()
changedSpy.clear();
// remove the watch and modify file permissions, should not get a signal from the watcher
- watcher.removePath(testFile.fileName());
+ QVERIFY(watcher.removePath(testFile.fileName()));
testFile.setPermissions(QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOther);
// waiting max 5 seconds for notification for file modification to trigger
@@ -226,16 +188,15 @@ void tst_QFileSystemWatcher::basicTest()
QCOMPARE(changedSpy.count(), 0);
// readd the file watch
- watcher.addPath(testFile.fileName());
+ QVERIFY(watcher.addPath(testFile.fileName()));
// remove the file, should get a signal from the watcher
QVERIFY(testFile.remove());
// waiting max 5 seconds for notification for file removal to trigger
- timer.start(5000);
- eventLoop.exec();
-
- QVERIFY(changedSpy.count() == 1 || changedSpy.count() == 2); // removing a file on some filesystems seems to deliver 2 notifications
+ // > 0 && < 3 because some platforms may emit two changes
+ // XXX: which platforms? (QTBUG-23370)
+ QTRY_VERIFY(changedSpy.count() > 0 && changedSpy.count() < 3);
QCOMPARE(changedSpy.at(0).count(), 1);
fileName = changedSpy.at(0).at(0).toString();
@@ -260,7 +221,6 @@ void tst_QFileSystemWatcher::basicTest()
void tst_QFileSystemWatcher::watchDirectory()
{
QFETCH(QString, backend);
- qDebug() << "Testing" << backend << "engine";
QDir().mkdir("testDir");
QDir testDir("testDir");
@@ -270,9 +230,10 @@ void tst_QFileSystemWatcher::watchDirectory()
QFileSystemWatcher watcher;
watcher.setObjectName(QLatin1String("_qt_autotest_force_engine_") + backend);
- watcher.addPath(testDir.dirName());
+ QVERIFY(watcher.addPath(testDir.dirName()));
QSignalSpy changedSpy(&watcher, SIGNAL(directoryChanged(const QString &)));
+ QVERIFY(changedSpy.isValid());
QEventLoop eventLoop;
QTimer timer;
connect(&timer, SIGNAL(timeout()), &eventLoop, SLOT(quit()));
@@ -285,7 +246,7 @@ void tst_QFileSystemWatcher::watchDirectory()
QString fileName;
// remove the watch, should not get notification of a new file
- watcher.removePath(testDir.dirName());
+ QVERIFY(watcher.removePath(testDir.dirName()));
QVERIFY(testFile.open(QIODevice::WriteOnly | QIODevice::Truncate));
testFile.close();
@@ -295,7 +256,7 @@ void tst_QFileSystemWatcher::watchDirectory()
QCOMPARE(changedSpy.count(), 0);
- watcher.addPath(testDir.dirName());
+ QVERIFY(watcher.addPath(testDir.dirName()));
// remove the file again, should get a signal from the watcher
QVERIFY(testFile.remove());
@@ -307,13 +268,10 @@ void tst_QFileSystemWatcher::watchDirectory()
QVERIFY(QDir().rmdir("testDir"));
// waiting max 5 seconds for notification for directory removal to trigger
- timer.start(5000);
- eventLoop.exec();
-
#ifdef Q_OS_WINCE
QEXPECT_FAIL("poller", "Directory does not get updated on file removal(See #137910)", Abort);
#endif
- QCOMPARE(changedSpy.count(), 2);
+ QTRY_COMPARE(changedSpy.count(), 2);
QCOMPARE(changedSpy.at(0).count(), 1);
QCOMPARE(changedSpy.at(1).count(), 1);
@@ -341,30 +299,32 @@ void tst_QFileSystemWatcher::addPath()
{
QFileSystemWatcher watcher;
QString home = QDir::homePath();
- watcher.addPath(home);
+ QVERIFY(watcher.addPath(home));
QCOMPARE(watcher.directories().count(), 1);
QCOMPARE(watcher.directories().first(), home);
- watcher.addPath(home);
+
+ // second watch on an already-watched path should fail
+ QVERIFY(!watcher.addPath(home));
QCOMPARE(watcher.directories().count(), 1);
// With empty string
QTest::ignoreMessage(QtWarningMsg, "QFileSystemWatcher::addPath: path is empty");
- watcher.addPath(QString());
+ QVERIFY(watcher.addPath(QString()));
}
void tst_QFileSystemWatcher::removePath()
{
QFileSystemWatcher watcher;
QString home = QDir::homePath();
- watcher.addPath(home);
- watcher.removePath(home);
+ QVERIFY(watcher.addPath(home));
+ QVERIFY(watcher.removePath(home));
QCOMPARE(watcher.directories().count(), 0);
- watcher.removePath(home);
+ QVERIFY(!watcher.removePath(home));
QCOMPARE(watcher.directories().count(), 0);
// With empty string
QTest::ignoreMessage(QtWarningMsg, "QFileSystemWatcher::removePath: path is empty");
- watcher.removePath(QString());
+ QVERIFY(watcher.removePath(QString()));
}
void tst_QFileSystemWatcher::addPaths()
@@ -372,13 +332,13 @@ void tst_QFileSystemWatcher::addPaths()
QFileSystemWatcher watcher;
QStringList paths;
paths << QDir::homePath() << QDir::currentPath();
- watcher.addPaths(paths);
+ QCOMPARE(watcher.addPaths(paths), QStringList());
QCOMPARE(watcher.directories().count(), 2);
// With empty list
paths.clear();
QTest::ignoreMessage(QtWarningMsg, "QFileSystemWatcher::addPaths: list is empty");
- watcher.addPaths(paths);
+ QCOMPARE(watcher.addPaths(paths), QStringList());
}
void tst_QFileSystemWatcher::removePaths()
@@ -386,9 +346,9 @@ void tst_QFileSystemWatcher::removePaths()
QFileSystemWatcher watcher;
QStringList paths;
paths << QDir::homePath() << QDir::currentPath();
- watcher.addPaths(paths);
+ QCOMPARE(watcher.addPaths(paths), QStringList());
QCOMPARE(watcher.directories().count(), 2);
- watcher.removePaths(paths);
+ QCOMPARE(watcher.removePaths(paths), QStringList());
QCOMPARE(watcher.directories().count(), 0);
//With empty list
@@ -418,11 +378,13 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory()
QFileSystemWatcher watcher;
watcher.setObjectName(QLatin1String("_qt_autotest_force_engine_") + backend);
- watcher.addPath(testDir.dirName());
- watcher.addPath(testFileName);
+ QVERIFY(watcher.addPath(testDir.dirName()));
+ QVERIFY(watcher.addPath(testFileName));
QSignalSpy fileChangedSpy(&watcher, SIGNAL(fileChanged(const QString &)));
QSignalSpy dirChangedSpy(&watcher, SIGNAL(directoryChanged(const QString &)));
+ QVERIFY(fileChangedSpy.isValid());
+ QVERIFY(dirChangedSpy.isValid());
QEventLoop eventLoop;
QTimer timer;
connect(&timer, SIGNAL(timeout()), &eventLoop, SLOT(quit()));
@@ -436,9 +398,8 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory()
testFile.write(QByteArray("hello again"));
testFile.close();
- timer.start(3000);
- eventLoop.exec();
- QVERIFY(fileChangedSpy.count() > 0);
+ QTRY_VERIFY(fileChangedSpy.count() > 0);
+
//according to Qt 4 documentation:
//void QFileSystemWatcher::directoryChanged ( const QString & path ) [signal]
//This signal is emitted when the directory at a specified path, is modified
@@ -448,9 +409,6 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory()
//sequence of changes will always generate this signal.
QVERIFY(dirChangedSpy.count() < 2);
- if (backend == "dnotify")
- QSKIP("dnotify is broken, skipping the rest of the test.");
-
fileChangedSpy.clear();
dirChangedSpy.clear();
QFile secondFile(secondFileName);
@@ -470,15 +428,14 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory()
QFile::remove(testFileName);
- timer.start(3000);
- eventLoop.exec();
- QVERIFY(fileChangedSpy.count() > 0);
+ QTRY_VERIFY(fileChangedSpy.count() > 0);
QCOMPARE(dirChangedSpy.count(), 1);
fileChangedSpy.clear();
dirChangedSpy.clear();
- watcher.removePath(testFileName);
+ // removing a deleted file should fail
+ QVERIFY(!watcher.removePath(testFileName));
QFile::remove(secondFileName);
timer.start(3000);
@@ -503,8 +460,17 @@ void tst_QFileSystemWatcher::nonExistingFile()
{
// Don't crash...
QFileSystemWatcher watcher;
- watcher.addPath("file_that_does_not_exist.txt");
- QVERIFY(true);
+ QVERIFY(!watcher.addPath("file_that_does_not_exist.txt"));
+
+ // Test that the paths returned in error aren't messed with
+ QCOMPARE(watcher.addPaths(QStringList() << "../..//./does-not-exist"),
+ QStringList() << "../..//./does-not-exist");
+
+ // empty path is not actually a failure
+ QCOMPARE(watcher.addPaths(QStringList() << QString()), QStringList());
+
+ // empty path is not actually a failure
+ QCOMPARE(watcher.removePaths(QStringList() << QString()), QStringList());
}
void tst_QFileSystemWatcher::removeFileAndUnWatch()
@@ -517,17 +483,17 @@ void tst_QFileSystemWatcher::removeFileAndUnWatch()
testFile.open(QIODevice::WriteOnly);
testFile.close();
}
- watcher.addPath(filename);
+ QVERIFY(watcher.addPath(filename));
QFile::remove(filename);
- watcher.removePath(filename);
+ QVERIFY(watcher.removePath(filename));
{
QFile testFile(filename);
testFile.open(QIODevice::WriteOnly);
testFile.close();
}
- watcher.addPath(filename);
+ QVERIFY(watcher.addPath(filename));
}
class SomeSingleton : public QObject
diff --git a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
index a67289f2a1..b1c02a6c02 100644
--- a/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
+++ b/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include <QtCore/QtCore>
+#include <QtCore/QCoreApplication>
#include <QtNetwork/QtNetwork>
#include <QtTest/QtTest>
diff --git a/tests/auto/corelib/io/qnodebug/qnodebug.pro b/tests/auto/corelib/io/qnodebug/qnodebug.pro
new file mode 100644
index 0000000000..2f951ab892
--- /dev/null
+++ b/tests/auto/corelib/io/qnodebug/qnodebug.pro
@@ -0,0 +1,4 @@
+CONFIG += testcase parallel_test
+TARGET = tst_qnodebug
+QT = core testlib
+SOURCES = tst_qnodebug.cpp
diff --git a/tests/auto/v8/tst_v8.cpp b/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp
index 77a3413718..bca4d55037 100644
--- a/tests/auto/v8/tst_v8.cpp
+++ b/tests/auto/corelib/io/qnodebug/tst_qnodebug.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -38,61 +38,43 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include <qtest.h>
-#include <private/v8.h>
-#include "v8test.h"
-using namespace v8;
+// This test is for "release" mode, with -DQT_NO_DEBUG -DQT_NO_DEBUG_OUTPUT
+#ifndef QT_NO_DEBUG
+#define QT_NO_DEBUG
+#endif
+#ifndef QT_NO_DEBUG_OUTPUT
+#define QT_NO_DEBUG_OUTPUT
+#endif
-class tst_v8 : public QObject
+#include <QtCore/QtCore>
+#include <QtCore/QtDebug>
+#include <QtTest/QtTest>
+
+class tst_QNoDebug: public QObject
{
Q_OBJECT
-public:
- tst_v8() {}
-
private slots:
- void initTestCase() {}
- void cleanupTestCase() {}
-
- void eval();
- void evalwithinwith();
- void userobjectcompare();
- void externalteardown();
- void globalcall();
+ void noDebugOutput() const;
+ void streaming() const;
};
-void tst_v8::eval()
-{
- QVERIFY(v8test_eval());
-}
-
-void tst_v8::evalwithinwith()
+void tst_QNoDebug::noDebugOutput() const
{
- QVERIFY(v8test_evalwithinwith());
-}
+ // should do nothing
+ qDebug() << "foo";
-void tst_v8::userobjectcompare()
-{
- QVERIFY(v8test_userobjectcompare());
+ // qWarning still works, though
+ QTest::ignoreMessage(QtWarningMsg, "bar ");
+ qWarning() << "bar";
}
-void tst_v8::externalteardown()
+void tst_QNoDebug::streaming() const
{
- QVERIFY(v8test_externalteardown());
-}
-
-void tst_v8::globalcall()
-{
- QVERIFY(v8test_globalcall());
-}
-
-int main(int argc, char *argv[])
-{
- V8::SetFlagsFromCommandLine(&argc, argv, true);
-
- QCoreApplication app(argc, argv);
- tst_v8 tc;
- return QTest::qExec(&tc, argc, argv);
+ QDateTime dt(QDate(1,2,3),QTime(4,5,6));
+ QTest::ignoreMessage(QtWarningMsg, qPrintable(QString::fromLatin1("QDateTime(\"%1\") ").arg(dt.toString())));
+ qWarning() << dt;
}
-#include "tst_v8.moc"
+QTEST_MAIN(tst_QNoDebug);
+#include "tst_qnodebug.moc"
diff --git a/tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro b/tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro
index 360981f83c..947dc916f2 100644
--- a/tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro
+++ b/tests/auto/corelib/io/qprocess/fileWriterProcess/fileWriterProcess.pro
@@ -3,7 +3,3 @@ CONFIG += console
CONFIG -= app_bundle
QT = core
DESTDIR = ./
-
-# This app is testdata for tst_qprocess
-target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/fileWriterProcess/main.cpp b/tests/auto/corelib/io/qprocess/fileWriterProcess/main.cpp
index 40e92c69be..5851ffe3da 100644
--- a/tests/auto/corelib/io/qprocess/fileWriterProcess/main.cpp
+++ b/tests/auto/corelib/io/qprocess/fileWriterProcess/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -38,7 +38,8 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include <QtCore>
+#include <QCoreApplication>
+#include <QFile>
int main(int argc, char **argv)
{
diff --git a/tests/auto/corelib/io/qprocess/qprocess.pri b/tests/auto/corelib/io/qprocess/qprocess.pri
new file mode 100644
index 0000000000..8047bc4b39
--- /dev/null
+++ b/tests/auto/corelib/io/qprocess/qprocess.pri
@@ -0,0 +1,17 @@
+SUBPROGRAMS = \
+ testProcessCrash \
+ testProcessEcho \
+ testProcessEcho2 \
+ testProcessEcho3 \
+ testProcessEnvironment \
+ testProcessLoopback \
+ testProcessNormal \
+ testProcessOutput \
+ testProcessDeadWhileReading \
+ testProcessEOF \
+ testExitCodes \
+ testGuiProcess \
+ testDetached \
+ fileWriterProcess \
+ testSetWorkingDirectory \
+ testSoftExit
diff --git a/tests/auto/corelib/io/qprocess/qprocess.pro b/tests/auto/corelib/io/qprocess/qprocess.pro
index 67c5f5437c..4155e3f73d 100644
--- a/tests/auto/corelib/io/qprocess/qprocess.pro
+++ b/tests/auto/corelib/io/qprocess/qprocess.pro
@@ -1,27 +1,14 @@
TEMPLATE = subdirs
-SUBDIRS = \
- testProcessCrash \
- testProcessEcho \
- testProcessEcho2 \
- testProcessEcho3 \
- testProcessEnvironment \
- testProcessLoopback \
- testProcessNormal \
- testProcessOutput \
- testProcessDeadWhileReading \
- testProcessEOF \
- testProcessSpacesArgs/nospace.pro \
- testExitCodes \
- testSpaceInName \
- testGuiProcess \
- testDetached \
- fileWriterProcess \
- testSetWorkingDirectory \
- testProcessSpacesArgs/onespace.pro \
- testProcessSpacesArgs/twospaces.pro \
- testSoftExit
+include(qprocess.pri)
+SUBDIRS = $$SUBPROGRAMS
+# Add special cases
+SUBDIRS += testProcessSpacesArgs/nospace.pro \
+ testProcessSpacesArgs/onespace.pro \
+ testProcessSpacesArgs/twospaces.pro \
+ testSpaceInName
win32:!wince*:SUBDIRS+=testProcessEchoGui
+test.depends += $$SUBDIRS
SUBDIRS += test
diff --git a/tests/auto/corelib/io/qprocess/test/test.pro b/tests/auto/corelib/io/qprocess/test/test.pro
index a8dba5eb8b..fb21800976 100644
--- a/tests/auto/corelib/io/qprocess/test/test.pro
+++ b/tests/auto/corelib/io/qprocess/test/test.pro
@@ -5,4 +5,12 @@ SOURCES = ../tst_qprocess.cpp
TARGET = ../tst_qprocess
-TESTDATA += ../testBatFiles/*
+win32:TESTDATA += ../testBatFiles/*
+
+include(../qprocess.pri)
+load(testcase) # for target.path and installTestHelperApp()
+for(file, SUBPROGRAMS): installTestHelperApp("../$${file}/$${file}",$${file},$${file})
+installTestHelperApp("../testProcessSpacesArgs/nospace",testProcessSpacesArgs,nospace)
+installTestHelperApp("../testProcessSpacesArgs/one space",testProcessSpacesArgs,"one space")
+installTestHelperApp("../testProcessSpacesArgs/two space s",testProcessSpacesArgs,"two space s")
+installTestHelperApp("../test Space In Name/testSpaceInName","test Space In Name",testSpaceInName)
diff --git a/tests/auto/corelib/io/qprocess/testDetached/main.cpp b/tests/auto/corelib/io/qprocess/testDetached/main.cpp
index 5b4ee790b9..bcf237f488 100644
--- a/tests/auto/corelib/io/qprocess/testDetached/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testDetached/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qprocess/testDetached/testDetached.pro b/tests/auto/corelib/io/qprocess/testDetached/testDetached.pro
index e307379014..8d1fcba624 100644
--- a/tests/auto/corelib/io/qprocess/testDetached/testDetached.pro
+++ b/tests/auto/corelib/io/qprocess/testDetached/testDetached.pro
@@ -4,7 +4,3 @@ CONFIG += console
CONFIG -= app_bundle
INSTALLS =
DESTDIR = ./
-
-# This app is testdata for tst_qprocess
-target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/testExitCodes/main.cpp b/tests/auto/corelib/io/qprocess/testExitCodes/main.cpp
index 4d6a49e8f5..1475b3354d 100644
--- a/tests/auto/corelib/io/qprocess/testExitCodes/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testExitCodes/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro b/tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro
index afa8e4ccab..b08371804f 100644
--- a/tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro
+++ b/tests/auto/corelib/io/qprocess/testExitCodes/testExitCodes.pro
@@ -3,7 +3,3 @@ CONFIG -= qt app_bundle
CONFIG += console
DESTDIR = ./
-
-# This app is testdata for tst_qprocess
-target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/testGuiProcess/main.cpp b/tests/auto/corelib/io/qprocess/testGuiProcess/main.cpp
index 90d4d4a962..c9e5d2e6a5 100644
--- a/tests/auto/corelib/io/qprocess/testGuiProcess/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testGuiProcess/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro b/tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro
index 992188b443..8778da7ffe 100644
--- a/tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro
+++ b/tests/auto/corelib/io/qprocess/testGuiProcess/testGuiProcess.pro
@@ -1,8 +1,5 @@
SOURCES += main.cpp
QT += widgets
CONFIG += console
+CONFIG -= app_bundle
DESTDIR = ./
-
-# This app is testdata for tst_qprocess
-target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/testProcessCrash/main.cpp b/tests/auto/corelib/io/qprocess/testProcessCrash/main.cpp
index e2ec87b3aa..b7c0511d77 100644
--- a/tests/auto/corelib/io/qprocess/testProcessCrash/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testProcessCrash/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro b/tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro
index 98c5b966f2..7ccc976efc 100644
--- a/tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro
+++ b/tests/auto/corelib/io/qprocess/testProcessCrash/testProcessCrash.pro
@@ -3,7 +3,3 @@ CONFIG += console
CONFIG -= qt app_bundle
DESTDIR = ./
-
-# This app is testdata for tst_qprocess
-target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/main.cpp b/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/main.cpp
index 9e285b5012..97d9208e19 100644
--- a/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro b/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro
index a5f4697605..fbb3411d47 100644
--- a/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro
+++ b/tests/auto/corelib/io/qprocess/testProcessDeadWhileReading/testProcessDeadWhileReading.pro
@@ -1,9 +1,5 @@
SOURCES = main.cpp
-CONFIG -= qt
+CONFIG -= qt app_bundle
CONFIG += console
DESTDIR = ./
-
-# This app is testdata for tst_qprocess
-target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/testProcessEOF/main.cpp b/tests/auto/corelib/io/qprocess/testProcessEOF/main.cpp
index 28de5c2f3a..bf3d190630 100644
--- a/tests/auto/corelib/io/qprocess/testProcessEOF/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testProcessEOF/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro b/tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro
index 4efdad997d..676318ac1e 100644
--- a/tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro
+++ b/tests/auto/corelib/io/qprocess/testProcessEOF/testProcessEOF.pro
@@ -4,7 +4,3 @@ CONFIG += console
win32:!win32-g++*:!equals(TEMPLATE_PREFIX, "vc"):QMAKE_CXXFLAGS += /GS-
DESTDIR = ./
-
-# This app is testdata for tst_qprocess
-target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho/main.cpp b/tests/auto/corelib/io/qprocess/testProcessEcho/main.cpp
index a7eedff56d..0c915918e4 100644
--- a/tests/auto/corelib/io/qprocess/testProcessEcho/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testProcessEcho/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro b/tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro
index f8dc695c17..e236e05c7d 100644
--- a/tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro
+++ b/tests/auto/corelib/io/qprocess/testProcessEcho/testProcessEcho.pro
@@ -1,8 +1,4 @@
SOURCES = main.cpp
-CONFIG -= qt
+CONFIG -= qt app_bundle
CONFIG += console
DESTDIR = ./
-
-# This app is testdata for tst_qprocess
-target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho2/main.cpp b/tests/auto/corelib/io/qprocess/testProcessEcho2/main.cpp
index 1c18319bca..8f3bd70a3a 100644
--- a/tests/auto/corelib/io/qprocess/testProcessEcho2/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testProcessEcho2/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro b/tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro
index f8dc695c17..e236e05c7d 100644
--- a/tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro
+++ b/tests/auto/corelib/io/qprocess/testProcessEcho2/testProcessEcho2.pro
@@ -1,8 +1,4 @@
SOURCES = main.cpp
-CONFIG -= qt
+CONFIG -= qt app_bundle
CONFIG += console
DESTDIR = ./
-
-# This app is testdata for tst_qprocess
-target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho3/main.cpp b/tests/auto/corelib/io/qprocess/testProcessEcho3/main.cpp
index 62901a7789..c5eb4df307 100644
--- a/tests/auto/corelib/io/qprocess/testProcessEcho3/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testProcessEcho3/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro b/tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro
index f8dc695c17..e236e05c7d 100644
--- a/tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro
+++ b/tests/auto/corelib/io/qprocess/testProcessEcho3/testProcessEcho3.pro
@@ -1,8 +1,4 @@
SOURCES = main.cpp
-CONFIG -= qt
+CONFIG -= qt app_bundle
CONFIG += console
DESTDIR = ./
-
-# This app is testdata for tst_qprocess
-target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/testProcessEchoGui/main_win.cpp b/tests/auto/corelib/io/qprocess/testProcessEchoGui/main_win.cpp
index b8c2bd6abd..877b3c6175 100644
--- a/tests/auto/corelib/io/qprocess/testProcessEchoGui/main_win.cpp
+++ b/tests/auto/corelib/io/qprocess/testProcessEchoGui/main_win.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qprocess/testProcessEchoGui/testProcessEchoGui.pro b/tests/auto/corelib/io/qprocess/testProcessEchoGui/testProcessEchoGui.pro
index 65b408fc85..bedc76aa5b 100644
--- a/tests/auto/corelib/io/qprocess/testProcessEchoGui/testProcessEchoGui.pro
+++ b/tests/auto/corelib/io/qprocess/testProcessEchoGui/testProcessEchoGui.pro
@@ -3,9 +3,5 @@ win32 {
!win32-borland:LIBS += -lUser32
}
-CONFIG -= qt
+CONFIG -= qt app_bundle
DESTDIR = ./
-
-# This app is testdata for tst_qprocess
-target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/testProcessEnvironment/main.cpp b/tests/auto/corelib/io/qprocess/testProcessEnvironment/main.cpp
index 17ed5c61dc..146b61af0e 100644
--- a/tests/auto/corelib/io/qprocess/testProcessEnvironment/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testProcessEnvironment/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro b/tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro
index 43378b6e17..a07ae00605 100644
--- a/tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro
+++ b/tests/auto/corelib/io/qprocess/testProcessEnvironment/testProcessEnvironment.pro
@@ -6,7 +6,3 @@ DESTDIR = ./
mac {
CONFIG -= app_bundle
}
-
-# This app is testdata for tst_qprocess
-target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/testProcessLoopback/main.cpp b/tests/auto/corelib/io/qprocess/testProcessLoopback/main.cpp
index 6803518400..78973f9f12 100644
--- a/tests/auto/corelib/io/qprocess/testProcessLoopback/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testProcessLoopback/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro b/tests/auto/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro
index f8dc695c17..e236e05c7d 100644
--- a/tests/auto/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro
+++ b/tests/auto/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro
@@ -1,8 +1,4 @@
SOURCES = main.cpp
-CONFIG -= qt
+CONFIG -= qt app_bundle
CONFIG += console
DESTDIR = ./
-
-# This app is testdata for tst_qprocess
-target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/testProcessNormal/main.cpp b/tests/auto/corelib/io/qprocess/testProcessNormal/main.cpp
index 008a0a2430..4fc8ea197c 100644
--- a/tests/auto/corelib/io/qprocess/testProcessNormal/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testProcessNormal/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro b/tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro
index 98c5b966f2..7ccc976efc 100644
--- a/tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro
+++ b/tests/auto/corelib/io/qprocess/testProcessNormal/testProcessNormal.pro
@@ -3,7 +3,3 @@ CONFIG += console
CONFIG -= qt app_bundle
DESTDIR = ./
-
-# This app is testdata for tst_qprocess
-target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/testProcessOutput/main.cpp b/tests/auto/corelib/io/qprocess/testProcessOutput/main.cpp
index d01739e3c0..5284607e9f 100644
--- a/tests/auto/corelib/io/qprocess/testProcessOutput/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testProcessOutput/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro b/tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro
index f8dc695c17..e236e05c7d 100644
--- a/tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro
+++ b/tests/auto/corelib/io/qprocess/testProcessOutput/testProcessOutput.pro
@@ -1,8 +1,4 @@
SOURCES = main.cpp
-CONFIG -= qt
+CONFIG -= qt app_bundle
CONFIG += console
DESTDIR = ./
-
-# This app is testdata for tst_qprocess
-target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/main.cpp b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/main.cpp
index 00944ba160..57fb68e841 100644
--- a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/nospace.pro b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/nospace.pro
index 93d0afb79f..e236e05c7d 100644
--- a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/nospace.pro
+++ b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/nospace.pro
@@ -2,7 +2,3 @@ SOURCES = main.cpp
CONFIG -= qt app_bundle
CONFIG += console
DESTDIR = ./
-
-# This app is testdata for tst_qproces
-target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/testProcessSpacesArgs
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/onespace.pro b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/onespace.pro
index 0146a6a985..527685e156 100644
--- a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/onespace.pro
+++ b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/onespace.pro
@@ -4,7 +4,3 @@ CONFIG += console
DESTDIR = ./
TARGET = "one space"
-
-# This app is testdata for tst_qprocess
-target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/testProcessSpacesArgs
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/twospaces.pro b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/twospaces.pro
index f881c2a824..1a7fc32fd1 100644
--- a/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/twospaces.pro
+++ b/tests/auto/corelib/io/qprocess/testProcessSpacesArgs/twospaces.pro
@@ -4,7 +4,3 @@ CONFIG += console
DESTDIR = ./
TARGET = "two space s"
-
-# This app is testdata for tst_qprocess
-target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/testProcessSpacesArgs
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/main.cpp b/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/main.cpp
index 0035c6253a..6ce8892354 100644
--- a/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,9 @@
****************************************************************************/
-#include <QtCore>
+#include <QCoreApplication>
+#include <QByteArray>
+#include <QDir>
int main(int argc, char **argv)
{
diff --git a/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro b/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro
index d6cc96b1e8..2ed59a7510 100644
--- a/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro
+++ b/tests/auto/corelib/io/qprocess/testSetWorkingDirectory/testSetWorkingDirectory.pro
@@ -1,7 +1,4 @@
SOURCES = main.cpp
CONFIG += console
+CONFIG -= app_bundle
DESTDIR = ./
-
-# This app is testdata for tst_qprocess
-target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/testSoftExit/main_unix.cpp b/tests/auto/corelib/io/qprocess/testSoftExit/main_unix.cpp
index b17ab4d9a6..fa368489d6 100644
--- a/tests/auto/corelib/io/qprocess/testSoftExit/main_unix.cpp
+++ b/tests/auto/corelib/io/qprocess/testSoftExit/main_unix.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qprocess/testSoftExit/main_win.cpp b/tests/auto/corelib/io/qprocess/testSoftExit/main_win.cpp
index 7bdf796926..87ba12c008 100644
--- a/tests/auto/corelib/io/qprocess/testSoftExit/main_win.cpp
+++ b/tests/auto/corelib/io/qprocess/testSoftExit/main_win.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro b/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro
index 5d4ec4fc21..d5f30bc35d 100644
--- a/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro
+++ b/tests/auto/corelib/io/qprocess/testSoftExit/testSoftExit.pro
@@ -9,7 +9,3 @@ unix {
CONFIG -= qt app_bundle
CONFIG += console
DESTDIR = ./
-
-# This app is testdata for tst_qprocess
-target.path = $$[QT_INSTALL_TESTS]/tst_qprocess/$$TARGET
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/testSpaceInName/main.cpp b/tests/auto/corelib/io/qprocess/testSpaceInName/main.cpp
index 3fadc68095..d42b8ed083 100644
--- a/tests/auto/corelib/io/qprocess/testSpaceInName/main.cpp
+++ b/tests/auto/corelib/io/qprocess/testSpaceInName/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro b/tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro
index eac0b59d9a..5a0314f601 100644
--- a/tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro
+++ b/tests/auto/corelib/io/qprocess/testSpaceInName/testSpaceInName.pro
@@ -6,7 +6,3 @@ DESTDIR = "../test Space In Name"
mac {
CONFIG -= app_bundle
}
-
-# This app is testdata for tst_qprocess
-target.path = "$$[QT_INSTALL_TESTS]/tst_qprocess/test Space In Name"
-INSTALLS += target
diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
index 9d0121307c..e16e00de91 100644
--- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
+++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -239,6 +239,7 @@ void tst_QProcess::simpleStart()
process = new QProcess;
QSignalSpy spy(process, SIGNAL(stateChanged(QProcess::ProcessState)));
+ QVERIFY(spy.isValid());
connect(process, SIGNAL(readyRead()), this, SLOT(readFromProcess()));
/* valgrind dislike SUID binaries(those that have the `s'-flag set), which
@@ -303,6 +304,7 @@ void tst_QProcess::crashTest()
#endif
process = new QProcess;
QSignalSpy stateSpy(process, SIGNAL(stateChanged(QProcess::ProcessState)));
+ QVERIFY(stateSpy.isValid());
process->start("testProcessCrash/testProcessCrash");
QVERIFY(process->waitForStarted(5000));
@@ -312,6 +314,9 @@ void tst_QProcess::crashTest()
QSignalSpy spy(process, SIGNAL(error(QProcess::ProcessError)));
QSignalSpy spy2(process, SIGNAL(finished(int, QProcess::ExitStatus)));
+ QVERIFY(spy.isValid());
+ QVERIFY(spy2.isValid());
+
QVERIFY(process->waitForFinished(30000));
QCOMPARE(spy.count(), 1);
@@ -347,6 +352,9 @@ void tst_QProcess::crashTest2()
QSignalSpy spy(process, SIGNAL(error(QProcess::ProcessError)));
QSignalSpy spy2(process, SIGNAL(finished(int, QProcess::ExitStatus)));
+ QVERIFY(spy.isValid());
+ QVERIFY(spy2.isValid());
+
QObject::connect(process, SIGNAL(finished(int)), this, SLOT(exitLoopSlot()));
QTestEventLoop::instance().enterLoop(30);
@@ -392,11 +400,7 @@ void tst_QProcess::echoTest()
process = new QProcess;
connect(process, SIGNAL(readyRead()), this, SLOT(exitLoopSlot()));
-#ifdef Q_OS_MAC
- process->start("testProcessEcho/testProcessEcho.app");
-#else
process->start("testProcessEcho/testProcessEcho");
-#endif
QVERIFY(process->waitForStarted(5000));
process->write(input);
@@ -448,11 +452,7 @@ void tst_QProcess::echoTest2()
process = new QProcess;
connect(process, SIGNAL(readyRead()), this, SLOT(exitLoopSlot()));
-#ifdef Q_OS_MAC
- process->start("testProcessEcho2/testProcessEcho2.app");
-#else
process->start("testProcessEcho2/testProcessEcho2");
-#endif
QVERIFY(process->waitForStarted(5000));
QVERIFY(!process->waitForReadyRead(250));
QCOMPARE(process->error(), QProcess::Timedout);
@@ -461,6 +461,9 @@ void tst_QProcess::echoTest2()
QSignalSpy spy1(process, SIGNAL(readyReadStandardOutput()));
QSignalSpy spy2(process, SIGNAL(readyReadStandardError()));
+ QVERIFY(spy1.isValid());
+ QVERIFY(spy2.isValid());
+
QTime stopWatch;
stopWatch.start();
forever {
@@ -497,11 +500,7 @@ void tst_QProcess::echoTest_performance()
#endif
QProcess process;
-#ifdef Q_OS_MAC
- process.start("testProcessLoopback/testProcessLoopback.app");
-#else
process.start("testProcessLoopback/testProcessLoopback");
-#endif
QByteArray array;
array.resize(1024 * 1024);
@@ -516,6 +515,7 @@ void tst_QProcess::echoTest_performance()
qint64 totalBytes = 0;
QByteArray dump;
QSignalSpy readyReadSpy(&process, SIGNAL(readyRead()));
+ QVERIFY(readyReadSpy.isValid());
while (stopWatch.elapsed() < 2000) {
process.write(array);
while (process.bytesToWrite() > 0) {
@@ -651,11 +651,7 @@ void tst_QProcess::loopBackTest()
#endif
process = new QProcess;
-#ifdef Q_OS_MAC
- process->start("testProcessEcho/testProcessEcho.app");
-#else
process->start("testProcessEcho/testProcessEcho");
-#endif
QVERIFY(process->waitForStarted(5000));
for (int i = 0; i < 100; ++i) {
@@ -681,11 +677,7 @@ void tst_QProcess::readTimeoutAndThenCrash()
#endif
process = new QProcess;
-#ifdef Q_OS_MAC
- process->start("testProcessEcho/testProcessEcho.app");
-#else
process->start("testProcessEcho/testProcessEcho");
-#endif
if (process->state() != QProcess::Starting)
QCOMPARE(process->state(), QProcess::Running);
@@ -697,6 +689,7 @@ void tst_QProcess::readTimeoutAndThenCrash()
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
QSignalSpy spy(process, SIGNAL(error(QProcess::ProcessError)));
+ QVERIFY(spy.isValid());
process->kill();
@@ -714,11 +707,7 @@ void tst_QProcess::waitForFinished()
{
QProcess process;
-#ifdef Q_OS_MAC
- process.start("testProcessOutput/testProcessOutput.app");
-#else
process.start("testProcessOutput/testProcessOutput");
-#endif
#if !defined(Q_OS_WINCE)
QVERIFY(process.waitForFinished(5000));
@@ -746,11 +735,7 @@ void tst_QProcess::deadWhileReading()
QProcess process;
-#ifdef Q_OS_MAC
- process.start("testProcessDeadWhileReading/testProcessDeadWhileReading.app");
-#else
process.start("testProcessDeadWhileReading/testProcessDeadWhileReading");
-#endif
QString output;
@@ -776,11 +761,7 @@ void tst_QProcess::restartProcessDeadlock()
process = &proc;
connect(process, SIGNAL(finished(int)), this, SLOT(restartProcess()));
-#ifdef Q_OS_MAC
- process->start("testProcessEcho/testProcessEcho.app");
-#else
process->start("testProcessEcho/testProcessEcho");
-#endif
QCOMPARE(process->write("", 1), qlonglong(1));
QVERIFY(process->waitForFinished(5000));
@@ -793,11 +774,7 @@ void tst_QProcess::restartProcessDeadlock()
void tst_QProcess::restartProcess()
{
-#ifdef Q_OS_MAC
- process->start("testProcessEcho/testProcessEcho.app");
-#else
process->start("testProcessEcho/testProcessEcho");
-#endif
}
//-----------------------------------------------------------------------------
@@ -841,11 +818,7 @@ void tst_QProcess::closeReadChannel()
QProcess::ProcessChannel channel2 = QProcess::StandardError;
QProcess proc;
-#ifdef Q_OS_MAC
- proc.start("testProcessEcho2/testProcessEcho2.app");
-#else
proc.start("testProcessEcho2/testProcessEcho2");
-#endif
QVERIFY(proc.waitForStarted(5000));
proc.closeReadChannel(i&1 ? channel2 : channel1);
proc.setReadChannel(i&1 ? channel2 : channel1);
@@ -876,11 +849,7 @@ void tst_QProcess::openModes()
QProcess proc;
QVERIFY(!proc.isOpen());
QVERIFY(proc.openMode() == QProcess::NotOpen);
-#ifdef Q_OS_MAC
- proc.start("testProcessEcho3/testProcessEcho3.app");
-#else
proc.start("testProcessEcho3/testProcessEcho3");
-#endif
QVERIFY(proc.waitForStarted(5000));
QVERIFY(proc.isOpen());
QVERIFY(proc.openMode() == QProcess::ReadWrite);
@@ -926,12 +895,9 @@ void tst_QProcess::emitReadyReadOnlyWhenNewDataArrives()
QProcess proc;
connect(&proc, SIGNAL(readyRead()), this, SLOT(exitLoopSlot()));
QSignalSpy spy(&proc, SIGNAL(readyRead()));
+ QVERIFY(spy.isValid());
-#ifdef Q_OS_MAC
- proc.start("testProcessEcho/testProcessEcho.app");
-#else
proc.start("testProcessEcho/testProcessEcho");
-#endif
QCOMPARE(spy.count(), 0);
@@ -960,9 +926,7 @@ void tst_QProcess::hardExit()
{
QProcess proc;
-#if defined(Q_OS_MAC)
- proc.start("testProcessEcho/testProcessEcho.app");
-#elif defined(Q_OS_WINCE)
+#if defined(Q_OS_WINCE)
proc.start("testSoftExit/testSoftExit");
#else
proc.start("testProcessEcho/testProcessEcho");
@@ -1070,16 +1034,8 @@ void tst_QProcess::softExitInSlots_data()
{
QTest::addColumn<QString>("appName");
-#ifdef Q_OS_MAC
- QTest::newRow("gui app") << "testGuiProcess/testGuiProcess.app";
-#else
QTest::newRow("gui app") << "testGuiProcess/testGuiProcess";
-#endif
-#ifdef Q_OS_MAC
- QTest::newRow("console app") << "testProcessEcho2/testProcessEcho2.app";
-#else
QTest::newRow("console app") << "testProcessEcho2/testProcessEcho2";
-#endif
}
//-----------------------------------------------------------------------------
@@ -1112,11 +1068,7 @@ void tst_QProcess::mergedChannels()
process.setReadChannelMode(QProcess::MergedChannels);
QCOMPARE(process.readChannelMode(), QProcess::MergedChannels);
-#ifdef Q_OS_MAC
- process.start("testProcessEcho2/testProcessEcho2.app");
-#else
process.start("testProcessEcho2/testProcessEcho2");
-#endif
QVERIFY(process.waitForStarted(5000));
@@ -1142,11 +1094,7 @@ void tst_QProcess::forwardedChannels()
process.setReadChannelMode(QProcess::ForwardedChannels);
QCOMPARE(process.readChannelMode(), QProcess::ForwardedChannels);
-#ifdef Q_OS_MAC
- process.start("testProcessEcho2/testProcessEcho2.app");
-#else
process.start("testProcessEcho2/testProcessEcho2");
-#endif
QVERIFY(process.waitForStarted(5000));
QCOMPARE(process.write("forwarded\n"), qlonglong(10));
@@ -1167,11 +1115,7 @@ void tst_QProcess::atEnd()
QProcess process;
-#ifdef Q_OS_MAC
- process.start("testProcessEcho/testProcessEcho.app");
-#else
process.start("testProcessEcho/testProcessEcho");
-#endif
process.write("abcdefgh\n");
while (process.bytesAvailable() < 8)
@@ -1205,11 +1149,7 @@ protected:
connect(&process, SIGNAL(finished(int)), this, SLOT(catchExitCode(int)),
Qt::DirectConnection);
-#ifdef Q_OS_MAC
- process.start("testProcessEcho/testProcessEcho.app");
-#else
process.start("testProcessEcho/testProcessEcho");
-#endif
#if !defined(Q_OS_WINCE)
QCOMPARE(process.write("abc\0", 4), qint64(4));
@@ -1270,11 +1210,7 @@ void tst_QProcess::waitForFinishedWithTimeout()
process = new QProcess(this);
-#ifdef Q_OS_MAC
- process->start("testProcessEcho/testProcessEcho.app");
-#else
process->start("testProcessEcho/testProcessEcho");
-#endif
QVERIFY(process->waitForStarted(5000));
QVERIFY(!process->waitForFinished(1));
@@ -1299,14 +1235,11 @@ void tst_QProcess::waitForReadyReadInAReadyReadSlot()
connect(process, SIGNAL(finished(int)), this, SLOT(exitLoopSlot()));
bytesAvailable = 0;
-#ifdef Q_OS_MAC
- process->start("testProcessEcho/testProcessEcho.app");
-#else
process->start("testProcessEcho/testProcessEcho");
-#endif
QVERIFY(process->waitForStarted(5000));
QSignalSpy spy(process, SIGNAL(readyRead()));
+ QVERIFY(spy.isValid());
process->write("foo");
QTestEventLoop::instance().enterLoop(30);
QVERIFY(!QTestEventLoop::instance().timeout());
@@ -1344,15 +1277,12 @@ void tst_QProcess::waitForBytesWrittenInABytesWrittenSlot()
connect(process, SIGNAL(bytesWritten(qint64)), this, SLOT(waitForBytesWrittenInABytesWrittenSlotSlot()));
bytesAvailable = 0;
-#ifdef Q_OS_MAC
- process->start("testProcessEcho/testProcessEcho.app");
-#else
process->start("testProcessEcho/testProcessEcho");
-#endif
QVERIFY(process->waitForStarted(5000));
qRegisterMetaType<qint64>("qint64");
QSignalSpy spy(process, SIGNAL(bytesWritten(qint64)));
+ QVERIFY(spy.isValid());
process->write("f");
QTestEventLoop::instance().enterLoop(30);
QVERIFY(!QTestEventLoop::instance().timeout());
@@ -1572,6 +1502,11 @@ void tst_QProcess::failToStart()
QSignalSpy finishedSpy(&process, SIGNAL(finished(int)));
QSignalSpy finishedSpy2(&process, SIGNAL(finished(int, QProcess::ExitStatus)));
+ QVERIFY(stateSpy.isValid());
+ QVERIFY(errorSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
+ QVERIFY(finishedSpy2.isValid());
+
// Mac OS X and HP-UX have a really low default process limit (~100), so spawning
// to many processes here will cause test failures later on.
#if defined Q_OS_HPUX
@@ -1633,6 +1568,10 @@ void tst_QProcess::failToStartWithWait()
QSignalSpy finishedSpy(&process, SIGNAL(finished(int)));
QSignalSpy finishedSpy2(&process, SIGNAL(finished(int, QProcess::ExitStatus)));
+ QVERIFY(errorSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
+ QVERIFY(finishedSpy2.isValid());
+
for (int i = 0; i < 50; ++i) {
process.start("/blurp", QStringList() << "-v" << "-debug");
process.waitForStarted();
@@ -1656,6 +1595,10 @@ void tst_QProcess::failToStartWithEventLoop()
QSignalSpy finishedSpy(&process, SIGNAL(finished(int)));
QSignalSpy finishedSpy2(&process, SIGNAL(finished(int, QProcess::ExitStatus)));
+ QVERIFY(errorSpy.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);
@@ -1683,11 +1626,7 @@ void tst_QProcess::removeFileWhileProcessIsRunning()
QVERIFY(file.open(QFile::WriteOnly));
QProcess process;
-#ifdef Q_OS_MAC
- process.start("testProcessEcho/testProcessEcho.app");
-#else
process.start("testProcessEcho/testProcessEcho");
-#endif
QVERIFY(process.waitForStarted(5000));
@@ -1856,7 +1795,8 @@ void tst_QProcess::lockupsInStartDetached()
// doesn't exist. Before Qt 4.2, this used to lock up on Unix due
// to calling ::exit instead of ::_exit if execve failed.
- QHostInfo::lookupHost(QString("something.invalid"), 0, 0);
+ QObject *dummy = new QObject(this);
+ QHostInfo::lookupHost(QString("something.invalid"), dummy, SLOT(deleteLater()));
QProcess::execute("yjhbrty");
QProcess::startDetached("yjhbrty");
}
@@ -1870,11 +1810,7 @@ void tst_QProcess::atEnd2()
QProcess process;
-#ifdef Q_OS_MAC
- process.start("testProcessEcho/testProcessEcho.app");
-#else
process.start("testProcessEcho/testProcessEcho");
-#endif
process.write("Foo\nBar\nBaz\nBodukon\nHadukan\nTorwukan\nend\n");
process.putChar('\0');
QVERIFY(process.waitForFinished());
@@ -1896,6 +1832,11 @@ void tst_QProcess::waitForReadyReadForNonexistantProcess()
QSignalSpy errorSpy(&process, SIGNAL(error(QProcess::ProcessError)));
QSignalSpy finishedSpy1(&process, SIGNAL(finished(int)));
QSignalSpy finishedSpy2(&process, SIGNAL(finished(int, QProcess::ExitStatus)));
+
+ QVERIFY(errorSpy.isValid());
+ QVERIFY(finishedSpy1.isValid());
+ QVERIFY(finishedSpy2.isValid());
+
QVERIFY(!process.waitForReadyRead()); // used to crash
process.start("doesntexist");
QVERIFY(!process.waitForReadyRead());
@@ -1921,11 +1862,7 @@ void tst_QProcess::setStandardInputFile()
file.close();
process.setStandardInputFile("data");
-#ifdef Q_OS_MAC
- process.start("testProcessEcho/testProcessEcho.app");
-#else
process.start("testProcessEcho/testProcessEcho");
-#endif
QPROCESS_VERIFY(process, waitForFinished());
QByteArray all = process.readAll();
@@ -1992,11 +1929,7 @@ void tst_QProcess::setStandardOutputFile()
else
process.setStandardErrorFile("data", mode);
-#ifdef Q_OS_MAC
- process.start("testProcessEcho2/testProcessEcho2.app");
-#else
process.start("testProcessEcho2/testProcessEcho2");
-#endif
process.write(testdata, sizeof testdata);
QPROCESS_VERIFY(process,waitForFinished());
@@ -2040,13 +1973,8 @@ void tst_QProcess::setStandardOutputProcess()
source.setReadChannelMode(merged ? QProcess::MergedChannels : QProcess::SeparateChannels);
source.setStandardOutputProcess(&sink);
-#ifdef Q_OS_MAC
- source.start("testProcessEcho2/testProcessEcho2.app");
- sink.start("testProcessEcho2/testProcessEcho2.app");
-#else
source.start("testProcessEcho2/testProcessEcho2");
sink.start("testProcessEcho2/testProcessEcho2");
-#endif
QByteArray data("Hello, World");
source.write(data);
@@ -2144,11 +2072,7 @@ void tst_QProcess::switchReadChannels()
QProcess process;
-#ifdef Q_OS_MAC
- process.start("testProcessEcho2/testProcessEcho2.app");
-#else
process.start("testProcessEcho2/testProcessEcho2");
-#endif
process.write(data);
process.closeWriteChannel();
QVERIFY(process.waitForFinished(5000));
@@ -2177,11 +2101,7 @@ void tst_QProcess::setWorkingDirectory()
#endif
process = new QProcess;
process->setWorkingDirectory("test");
-#ifdef Q_OS_MAC
- process->start("testSetWorkingDirectory/testSetWorkingDirectory.app");
-#else
process->start("testSetWorkingDirectory/testSetWorkingDirectory");
-#endif
#ifndef Q_OS_WIN
QSKIP("setWorkingDirectory will chdir before starting the process on unices");
#endif
@@ -2202,11 +2122,7 @@ void tst_QProcess::startFinishStartFinish()
for (int i = 0; i < 3; ++i) {
QCOMPARE(process.state(), QProcess::NotRunning);
-#ifdef Q_OS_MAC
- process.start("testProcessOutput/testProcessOutput.app");
-#else
process.start("testProcessOutput/testProcessOutput");
-#endif
#if !defined(Q_OS_WINCE)
QVERIFY(process.waitForReadyRead(10000));
QCOMPARE(QString::fromLatin1(process.readLine().trimmed()),
@@ -2233,6 +2149,7 @@ void tst_QProcess::invalidProgramString()
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
QSignalSpy spy(&process, SIGNAL(error(QProcess::ProcessError)));
+ QVERIFY(spy.isValid());
process.start(programString);
QCOMPARE(process.error(), QProcess::FailedToStart);
@@ -2249,6 +2166,9 @@ void tst_QProcess::onlyOneStartedSignal()
QSignalSpy spyStarted(&process, SIGNAL(started()));
QSignalSpy spyFinished(&process, SIGNAL(finished(int, QProcess::ExitStatus)));
+ QVERIFY(spyStarted.isValid());
+ QVERIFY(spyFinished.isValid());
+
process.start("testProcessNormal/testProcessNormal");
QVERIFY(process.waitForStarted(5000));
QVERIFY(process.waitForFinished(5000));
diff --git a/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp b/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp
index addce54136..50579f0712 100644
--- a/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp
+++ b/tests/auto/corelib/io/qprocessenvironment/tst_qprocessenvironment.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qresourceengine/.gitignore b/tests/auto/corelib/io/qresourceengine/.gitignore
index eb48d60239..c93206ff3b 100644
--- a/tests/auto/corelib/io/qresourceengine/.gitignore
+++ b/tests/auto/corelib/io/qresourceengine/.gitignore
@@ -1 +1,2 @@
tst_qresourceengine
+runtime_resource.rcc
diff --git a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
index 2a40a64580..539f49fa97 100644
--- a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
+++ b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -41,7 +41,7 @@
#include <QtTest/QtTest>
-#include <QtCore>
+#include <QtCore/QCoreApplication>
class tst_QResourceEngine: public QObject
{
diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
index 2c96339737..87f5b37e14 100644
--- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
+++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -73,10 +73,8 @@ class tst_QSettings : public QObject
{
Q_OBJECT
-public:
- tst_QSettings();
-
public slots:
+ void initTestCase();
void init();
void cleanup();
private slots:
@@ -270,7 +268,7 @@ static void populateWithFormats()
QTest::newRow("custom2") << QSettings::CustomFormat2;
}
-tst_QSettings::tst_QSettings()
+void tst_QSettings::initTestCase()
{
QSettings::Format custom1 = QSettings::registerFormat("custom1", readCustom1File, writeCustom1File);
QSettings::Format custom2 = QSettings::registerFormat("custom2", readCustom2File, writeCustom2File
@@ -1696,6 +1694,7 @@ void tst_QSettings::testUpdateRequestEvent()
const int NumIterations = 5;
const int NumThreads = 4;
+int numThreadSafetyFailures;
class SettingsThread : public QThread
{
@@ -1713,7 +1712,10 @@ void SettingsThread::run()
QSettings settings("software.org", "KillerAPP");
settings.setValue(QString::number((param * NumIterations) + i), param);
settings.sync();
- QCOMPARE((int)settings.status(), (int)QSettings::NoError);
+ if (settings.status() != QSettings::NoError) {
+ QWARN(qPrintable(QString("Unexpected QSettings status %1").arg((int)settings.status())));
+ ++numThreadSafetyFailures;
+ }
}
}
@@ -1722,6 +1724,8 @@ void tst_QSettings::testThreadSafety()
SettingsThread threads[NumThreads];
int i, j;
+ numThreadSafetyFailures = 0;
+
for (i = 0; i < NumThreads; ++i)
threads[i].start(i + 1);
for (i = 0; i < NumThreads; ++i)
@@ -1734,6 +1738,8 @@ void tst_QSettings::testThreadSafety()
QCOMPARE(settings.value(QString::number((param * NumIterations) + j)).toInt(), param);
}
}
+
+ QCOMPARE(numThreadSafetyFailures, 0);
}
void tst_QSettings::testNormalizedKey_data()
@@ -3160,7 +3166,7 @@ void tst_QSettings::consistentRegistryStorage()
// Not tested at the moment.
void tst_QSettings::oldSubkeyList()
{
- QVERIFY( TRUE );
+ QVERIFY( true );
}
*/
diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
index 66fb8bbbf9..1820d66496 100644
--- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
+++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp
index 60c7174f3a..86aa071410 100644
--- a/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp
+++ b/tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp
index a1e9d98461..4c2e3f211b 100644
--- a/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp
+++ b/tests/auto/corelib/io/qtemporaryfile/tst_qtemporaryfile.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qtextstream/readAllStdinProcess/main.cpp b/tests/auto/corelib/io/qtextstream/readAllStdinProcess/main.cpp
index ca541d053a..a33b6759b4 100644
--- a/tests/auto/corelib/io/qtextstream/readAllStdinProcess/main.cpp
+++ b/tests/auto/corelib/io/qtextstream/readAllStdinProcess/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,9 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
+#include <QtCore/QTextStream>
+#include <QtCore/QDebug>
int main(int argc, char **argv)
{
diff --git a/tests/auto/corelib/io/qtextstream/readLineStdinProcess/main.cpp b/tests/auto/corelib/io/qtextstream/readLineStdinProcess/main.cpp
index d8d2eed000..e561fc886f 100644
--- a/tests/auto/corelib/io/qtextstream/readLineStdinProcess/main.cpp
+++ b/tests/auto/corelib/io/qtextstream/readLineStdinProcess/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,10 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
+#include <QtCore/QTextStream>
+#include <QtCore/QString>
+
int main(int argc, char **argv)
{
diff --git a/tests/auto/corelib/io/qtextstream/stdinProcess/main.cpp b/tests/auto/corelib/io/qtextstream/stdinProcess/main.cpp
index 6d51f84fa1..7fcfd6d53b 100644
--- a/tests/auto/corelib/io/qtextstream/stdinProcess/main.cpp
+++ b/tests/auto/corelib/io/qtextstream/stdinProcess/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,8 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
+#include <QtCore/QTextStream>
int main(int argc, char **argv)
{
diff --git a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
index a1b3724417..6b6ac013bd 100644
--- a/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
+++ b/tests/auto/corelib/io/qtextstream/tst_qtextstream.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qurl/idna-test.c b/tests/auto/corelib/io/qurl/idna-test.c
index 7effd03168..40538dfb65 100644
--- a/tests/auto/corelib/io/qurl/idna-test.c
+++ b/tests/auto/corelib/io/qurl/idna-test.c
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp
index d86f96fba3..f0b6429089 100644
--- a/tests/auto/corelib/io/qurl/tst_qurl.cpp
+++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/itemmodels/itemmodels.pro b/tests/auto/corelib/itemmodels/itemmodels.pro
new file mode 100644
index 0000000000..851035e949
--- /dev/null
+++ b/tests/auto/corelib/itemmodels/itemmodels.pro
@@ -0,0 +1,11 @@
+TEMPLATE=subdirs
+
+SUBDIRS = qabstractitemmodel \
+ qabstractproxymodel \
+ qidentityproxymodel \
+ qitemmodel \
+ qitemselectionmodel \
+ qsortfilterproxymodel \
+ qstringlistmodel
+
+mac: qabstractitemmodel.CONFIG = no_check_target # QTBUG-22748
diff --git a/tests/auto/corelib/kernel/qabstractitemmodel/.gitignore b/tests/auto/corelib/itemmodels/qabstractitemmodel/.gitignore
index f6f93f4b89..f6f93f4b89 100644
--- a/tests/auto/corelib/kernel/qabstractitemmodel/.gitignore
+++ b/tests/auto/corelib/itemmodels/qabstractitemmodel/.gitignore
diff --git a/tests/auto/corelib/kernel/qabstractitemmodel/qabstractitemmodel.pro b/tests/auto/corelib/itemmodels/qabstractitemmodel/qabstractitemmodel.pro
index acf74737a8..acf74737a8 100644
--- a/tests/auto/corelib/kernel/qabstractitemmodel/qabstractitemmodel.pro
+++ b/tests/auto/corelib/itemmodels/qabstractitemmodel/qabstractitemmodel.pro
diff --git a/tests/auto/corelib/kernel/qabstractitemmodel/tst_qabstractitemmodel.cpp b/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp
index 2340c86207..af1e492a8b 100644
--- a/tests/auto/corelib/kernel/qabstractitemmodel/tst_qabstractitemmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qabstractitemmodel/tst_qabstractitemmodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,10 +40,10 @@
****************************************************************************/
#include <QtTest/QtTest>
-#include <QtCore/QtCore>
+#include <QtCore/QCoreApplication>
-#include <QtWidgets/QSortFilterProxyModel>
-#include <QtWidgets/QStringListModel>
+#include <QtCore/QSortFilterProxyModel>
+#include <QtCore/QStringListModel>
#include "dynamictreemodel.h"
@@ -59,6 +59,7 @@ class tst_QAbstractItemModel : public QObject
public slots:
void initTestCase();
void init();
+ void cleanup();
private slots:
void index();
@@ -111,6 +112,9 @@ private slots:
void testChildrenLayoutsChanged();
+ void testRoleNames();
+ void testDragActions();
+
private:
DynamicTreeModel *m_model;
};
@@ -275,6 +279,11 @@ void tst_QAbstractItemModel::init()
insertCommand->doCommand();
}
+void tst_QAbstractItemModel::cleanup()
+{
+ delete m_model;
+}
+
/*
tests
*/
@@ -682,7 +691,6 @@ void tst_QAbstractItemModel::dropMimeData()
}
}
-
void tst_QAbstractItemModel::changePersistentIndex()
{
QtTestModel model(3, 3);
@@ -720,6 +728,9 @@ void tst_QAbstractItemModel::removeRows()
QSignalSpy rowsAboutToBeRemovedSpy(&model, SIGNAL(rowsAboutToBeRemoved( const QModelIndex &, int , int )));
QSignalSpy rowsRemovedSpy(&model, SIGNAL(rowsRemoved( const QModelIndex &, int, int )));
+ QVERIFY(rowsAboutToBeRemovedSpy.isValid());
+ QVERIFY(rowsRemovedSpy.isValid());
+
QCOMPARE(model.removeRows(6, 4), true);
QCOMPARE(rowsAboutToBeRemovedSpy.count(), 1);
QCOMPARE(rowsRemovedSpy.count(), 1);
@@ -732,6 +743,9 @@ void tst_QAbstractItemModel::removeColumns()
QSignalSpy columnsAboutToBeRemovedSpy(&model, SIGNAL(columnsAboutToBeRemoved( const QModelIndex &, int , int )));
QSignalSpy columnsRemovedSpy(&model, SIGNAL(columnsRemoved( const QModelIndex &, int, int )));
+ QVERIFY(columnsAboutToBeRemovedSpy.isValid());
+ QVERIFY(columnsRemovedSpy.isValid());
+
QCOMPARE(model.removeColumns(6, 4), true);
QCOMPARE(columnsAboutToBeRemovedSpy.count(), 1);
QCOMPARE(columnsRemovedSpy.count(), 1);
@@ -744,6 +758,9 @@ void tst_QAbstractItemModel::insertRows()
QSignalSpy rowsAboutToBeInsertedSpy(&model, SIGNAL(rowsAboutToBeInserted( const QModelIndex &, int , int )));
QSignalSpy rowsInsertedSpy(&model, SIGNAL(rowsInserted( const QModelIndex &, int, int )));
+ QVERIFY(rowsAboutToBeInsertedSpy.isValid());
+ QVERIFY(rowsInsertedSpy.isValid());
+
QCOMPARE(model.insertRows(6, 4), true);
QCOMPARE(rowsAboutToBeInsertedSpy.count(), 1);
QCOMPARE(rowsInsertedSpy.count(), 1);
@@ -756,6 +773,9 @@ void tst_QAbstractItemModel::insertColumns()
QSignalSpy columnsAboutToBeInsertedSpy(&model, SIGNAL(columnsAboutToBeInserted( const QModelIndex &, int , int )));
QSignalSpy columnsInsertedSpy(&model, SIGNAL(columnsInserted( const QModelIndex &, int, int )));
+ QVERIFY(columnsAboutToBeInsertedSpy.isValid());
+ QVERIFY(columnsInsertedSpy.isValid());
+
QCOMPARE(model.insertColumns(6, 4), true);
QCOMPARE(columnsAboutToBeInsertedSpy.count(), 1);
QCOMPARE(columnsInsertedSpy.count(), 1);
@@ -766,6 +786,7 @@ void tst_QAbstractItemModel::reset()
QtTestModel model(10, 10);
QSignalSpy resetSpy(&model, SIGNAL(modelReset()));
+ QVERIFY(resetSpy.isValid());
model.reset();
QCOMPARE(resetSpy.count(), 1);
}
@@ -830,7 +851,6 @@ void tst_QAbstractItemModel::complexChangesWithPersistent()
QVERIFY(!e[i].isValid());
for (int i=6; i <10 ; i++)
QVERIFY(e[i] == model.index(2, i-2 , QModelIndex()));
-
}
void tst_QAbstractItemModel::testMoveSameParentDown_data()
@@ -858,20 +878,18 @@ void tst_QAbstractItemModel::testMoveSameParentDown_data()
void tst_QAbstractItemModel::testMoveSameParentDown()
{
- QFETCH( int, startRow);
- QFETCH( int, endRow);
- QFETCH( int, destRow);
- QFETCH( bool, topLevel);
+ QFETCH(int, startRow);
+ QFETCH(int, endRow);
+ QFETCH(int, destRow);
+ QFETCH(bool, topLevel);
QModelIndex moveParent = topLevel ? QModelIndex() : m_model->index(5, 0);
QList<QPersistentModelIndex> persistentList;
QModelIndexList indexList;
- for (int column = 0; column < m_model->columnCount(); ++column)
- {
- for (int row= 0; row < m_model->rowCount(); ++row)
- {
+ for (int column = 0; column < m_model->columnCount(); ++column) {
+ for (int row = 0; row < m_model->rowCount(); ++row) {
QModelIndex idx = m_model->index(row, column);
QVERIFY(idx.isValid());
indexList << idx;
@@ -880,10 +898,8 @@ void tst_QAbstractItemModel::testMoveSameParentDown()
}
QModelIndex parent = m_model->index(5, 0);
- for (int column = 0; column < m_model->columnCount(); ++column)
- {
- for (int row= 0; row < m_model->rowCount(parent); ++row)
- {
+ for (int column = 0; column < m_model->columnCount(); ++column) {
+ for (int row = 0; row < m_model->rowCount(parent); ++row) {
QModelIndex idx = m_model->index(row, column, parent);
QVERIFY(idx.isValid());
indexList << idx;
@@ -894,6 +910,9 @@ void tst_QAbstractItemModel::testMoveSameParentDown()
QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
+ QVERIFY(beforeSpy.isValid());
+ QVERIFY(afterSpy.isValid());
+
ModelMoveCommand *moveCommand = new ModelMoveCommand(m_model, this);
moveCommand->setNumCols(4);
if (!topLevel)
@@ -922,37 +941,29 @@ void tst_QAbstractItemModel::testMoveSameParentDown()
QCOMPARE(afterSignal.at(3).value<QModelIndex>(), moveParent);
QCOMPARE(afterSignal.at(4).toInt(), destRow);
- for (int i = 0; i < indexList.size(); i++)
- {
+ for (int i = 0; i < indexList.size(); i++) {
QModelIndex idx = indexList.at(i);
QModelIndex persistentIndex = persistentList.at(i);
- if (idx.parent() == moveParent)
- {
+ if (idx.parent() == moveParent) {
int row = idx.row();
- if ( row >= startRow)
- {
- if (row <= endRow)
- {
- QCOMPARE(row + destRow - endRow - 1, persistentIndex.row() );
+ if ( row >= startRow) {
+ if (row <= endRow) {
+ QCOMPARE(row + destRow - endRow - 1, persistentIndex.row());
QCOMPARE(idx.column(), persistentIndex.column());
QCOMPARE(idx.parent(), persistentIndex.parent());
QCOMPARE(idx.model(), persistentIndex.model());
- } else if ( row < destRow)
- {
- QCOMPARE(row - (endRow - startRow + 1), persistentIndex.row() );
+ } else if (row < destRow) {
+ QCOMPARE(row - (endRow - startRow + 1), persistentIndex.row());
QCOMPARE(idx.column(), persistentIndex.column());
QCOMPARE(idx.parent(), persistentIndex.parent());
QCOMPARE(idx.model(), persistentIndex.model());
- } else
- {
- QCOMPARE(idx, persistentIndex);
+ } else {
+ QCOMPARE(idx, persistentIndex);
}
- } else
- {
+ } else {
QCOMPARE(idx, persistentIndex);
}
- } else
- {
+ } else {
QCOMPARE(idx, persistentIndex);
}
}
@@ -982,21 +993,18 @@ void tst_QAbstractItemModel::testMoveSameParentUp_data()
void tst_QAbstractItemModel::testMoveSameParentUp()
{
-
- QFETCH( int, startRow);
- QFETCH( int, endRow);
- QFETCH( int, destRow);
- QFETCH( bool, topLevel);
+ QFETCH(int, startRow);
+ QFETCH(int, endRow);
+ QFETCH(int, destRow);
+ QFETCH(bool, topLevel);
QModelIndex moveParent = topLevel ? QModelIndex() : m_model->index(5, 0);
QList<QPersistentModelIndex> persistentList;
QModelIndexList indexList;
- for (int column = 0; column < m_model->columnCount(); ++column)
- {
- for (int row= 0; row < m_model->rowCount(); ++row)
- {
+ for (int column = 0; column < m_model->columnCount(); ++column) {
+ for (int row = 0; row < m_model->rowCount(); ++row) {
QModelIndex idx = m_model->index(row, column);
QVERIFY(idx.isValid());
indexList << idx;
@@ -1005,10 +1013,8 @@ void tst_QAbstractItemModel::testMoveSameParentUp()
}
QModelIndex parent = m_model->index(2, 0);
- for (int column = 0; column < m_model->columnCount(); ++column)
- {
- for (int row= 0; row < m_model->rowCount(parent); ++row)
- {
+ for (int column = 0; column < m_model->columnCount(); ++column) {
+ for (int row = 0; row < m_model->rowCount(parent); ++row) {
QModelIndex idx = m_model->index(row, column, parent);
QVERIFY(idx.isValid());
indexList << idx;
@@ -1019,6 +1025,8 @@ void tst_QAbstractItemModel::testMoveSameParentUp()
QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
+ QVERIFY(beforeSpy.isValid());
+ QVERIFY(afterSpy.isValid());
ModelMoveCommand *moveCommand = new ModelMoveCommand(m_model, this);
moveCommand->setNumCols(4);
@@ -1048,38 +1056,29 @@ void tst_QAbstractItemModel::testMoveSameParentUp()
QCOMPARE(afterSignal.at(3).value<QModelIndex>(), moveParent);
QCOMPARE(afterSignal.at(4).toInt(), destRow);
-
- for (int i = 0; i < indexList.size(); i++)
- {
+ for (int i = 0; i < indexList.size(); i++) {
QModelIndex idx = indexList.at(i);
QModelIndex persistentIndex = persistentList.at(i);
- if (idx.parent() == moveParent)
- {
+ if (idx.parent() == moveParent) {
int row = idx.row();
- if ( row >= destRow)
- {
- if (row < startRow)
- {
- QCOMPARE(row + endRow - startRow + 1, persistentIndex.row() );
+ if ( row >= destRow) {
+ if (row < startRow) {
+ QCOMPARE(row + endRow - startRow + 1, persistentIndex.row());
QCOMPARE(idx.column(), persistentIndex.column());
QCOMPARE(idx.parent(), persistentIndex.parent());
QCOMPARE(idx.model(), persistentIndex.model());
- } else if ( row <= endRow)
- {
- QCOMPARE(row + destRow - startRow, persistentIndex.row() );
+ } else if (row <= endRow) {
+ QCOMPARE(row + destRow - startRow, persistentIndex.row());
QCOMPARE(idx.column(), persistentIndex.column());
QCOMPARE(idx.parent(), persistentIndex.parent());
QCOMPARE(idx.model(), persistentIndex.model());
- } else
- {
+ } else {
QCOMPARE(idx, persistentIndex);
}
- } else
- {
+ } else {
QCOMPARE(idx, persistentIndex);
}
- } else
- {
+ } else {
QCOMPARE(idx, persistentIndex);
}
}
@@ -1143,19 +1142,16 @@ void tst_QAbstractItemModel::testMoveToGrandParent_data()
void tst_QAbstractItemModel::testMoveToGrandParent()
{
-
- QFETCH( int, startRow);
- QFETCH( int, endRow);
- QFETCH( int, destRow);
+ QFETCH(int, startRow);
+ QFETCH(int, endRow);
+ QFETCH(int, destRow);
QList<QPersistentModelIndex> persistentList;
QModelIndexList indexList;
QModelIndexList parentsList;
- for (int column = 0; column < m_model->columnCount(); ++column)
- {
- for (int row= 0; row < m_model->rowCount(); ++row)
- {
+ for (int column = 0; column < m_model->columnCount(); ++column) {
+ for (int row = 0; row < m_model->rowCount(); ++row) {
QModelIndex idx = m_model->index(row, column);
QVERIFY(idx.isValid());
indexList << idx;
@@ -1165,10 +1161,8 @@ void tst_QAbstractItemModel::testMoveToGrandParent()
}
QModelIndex sourceIndex = m_model->index(5, 0);
- for (int column = 0; column < m_model->columnCount(); ++column)
- {
- for (int row= 0; row < m_model->rowCount(sourceIndex); ++row)
- {
+ for (int column = 0; column < m_model->columnCount(); ++column) {
+ for (int row = 0; row < m_model->rowCount(sourceIndex); ++row) {
QModelIndex idx = m_model->index(row, column, sourceIndex);
QVERIFY(idx.isValid());
indexList << idx;
@@ -1180,6 +1174,9 @@ void tst_QAbstractItemModel::testMoveToGrandParent()
QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
+ QVERIFY(beforeSpy.isValid());
+ QVERIFY(afterSpy.isValid());
+
QPersistentModelIndex persistentSource = sourceIndex;
ModelMoveCommand *moveCommand = new ModelMoveCommand(m_model, this);
@@ -1207,46 +1204,37 @@ void tst_QAbstractItemModel::testMoveToGrandParent()
QCOMPARE(afterSignal.at(3).value<QModelIndex>(), QModelIndex());
QCOMPARE(afterSignal.at(4).toInt(), destRow);
- for (int i = 0; i < indexList.size(); i++)
- {
+ for (int i = 0; i < indexList.size(); i++) {
QModelIndex idx = indexList.at(i);
QModelIndex idxParent = parentsList.at(i);
QModelIndex persistentIndex = persistentList.at(i);
int row = idx.row();
- if (idxParent == QModelIndex())
- {
- if ( row >= destRow)
- {
- QCOMPARE(row + endRow - startRow + 1, persistentIndex.row() );
- QCOMPARE(idx.column(), persistentIndex.column());
- QCOMPARE(idxParent, persistentIndex.parent());
- QCOMPARE(idx.model(), persistentIndex.model());
- } else
- {
+ if (idxParent == QModelIndex()) {
+ if (row >= destRow) {
+ QCOMPARE(row + endRow - startRow + 1, persistentIndex.row());
+ QCOMPARE(idx.column(), persistentIndex.column());
+ QCOMPARE(idxParent, persistentIndex.parent());
+ QCOMPARE(idx.model(), persistentIndex.model());
+ } else {
QCOMPARE(idx, persistentIndex);
}
- } else
- {
- if (row < startRow)
- {
+ } else {
+ if (row < startRow) {
QCOMPARE(idx, persistentIndex);
- } else if (row <= endRow)
- {
- QCOMPARE(row + destRow - startRow, persistentIndex.row() );
+ } else if (row <= endRow) {
+ QCOMPARE(row + destRow - startRow, persistentIndex.row());
QCOMPARE(idx.column(), persistentIndex.column());
QCOMPARE(QModelIndex(), persistentIndex.parent());
QCOMPARE(idx.model(), persistentIndex.model());
} else {
- QCOMPARE(row - (endRow - startRow + 1), persistentIndex.row() );
+ QCOMPARE(row - (endRow - startRow + 1), persistentIndex.row());
QCOMPARE(idx.column(), persistentIndex.column());
- if (idxParent.row() >= destRow)
- {
+ if (idxParent.row() >= destRow) {
QModelIndex adjustedParent;
- adjustedParent = idxParent.sibling( idxParent.row() + endRow - startRow + 1, idxParent.column());
+ adjustedParent = idxParent.sibling(idxParent.row() + endRow - startRow + 1, idxParent.column());
QCOMPARE(adjustedParent, persistentIndex.parent());
- } else
- {
+ } else {
QCOMPARE(idxParent, persistentIndex.parent());
}
QCOMPARE(idx.model(), persistentIndex.model());
@@ -1295,10 +1283,9 @@ void tst_QAbstractItemModel::testMoveToSibling_data()
void tst_QAbstractItemModel::testMoveToSibling()
{
-
- QFETCH( int, startRow);
- QFETCH( int, endRow);
- QFETCH( int, destRow);
+ QFETCH(int, startRow);
+ QFETCH(int, endRow);
+ QFETCH(int, destRow);
QList<QPersistentModelIndex> persistentList;
QModelIndexList indexList;
@@ -1306,8 +1293,7 @@ void tst_QAbstractItemModel::testMoveToSibling()
const int column = 0;
- for (int i= 0; i < m_model->rowCount(); ++i)
- {
+ for (int i = 0; i < m_model->rowCount(); ++i) {
QModelIndex idx = m_model->index(i, column);
QVERIFY(idx.isValid());
indexList << idx;
@@ -1317,8 +1303,7 @@ void tst_QAbstractItemModel::testMoveToSibling()
QModelIndex destIndex = m_model->index(5, 0);
QModelIndex sourceIndex;
- for (int i= 0; i < m_model->rowCount(destIndex); ++i)
- {
+ for (int i = 0; i < m_model->rowCount(destIndex); ++i) {
QModelIndex idx = m_model->index(i, column, destIndex);
QVERIFY(idx.isValid());
indexList << idx;
@@ -1329,6 +1314,9 @@ void tst_QAbstractItemModel::testMoveToSibling()
QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
+ QVERIFY(beforeSpy.isValid());
+ QVERIFY(afterSpy.isValid());
+
QPersistentModelIndex persistentDest = destIndex;
ModelMoveCommand *moveCommand = new ModelMoveCommand(m_model, this);
@@ -1356,51 +1344,41 @@ void tst_QAbstractItemModel::testMoveToSibling()
QCOMPARE(afterSignal.at(3).value<QModelIndex>(), static_cast<QModelIndex>(persistentDest));
QCOMPARE(afterSignal.at(4).toInt(), destRow);
- for (int i = 0; i < indexList.size(); i++)
- {
+ for (int i = 0; i < indexList.size(); i++) {
QModelIndex idx = indexList.at(i);
QModelIndex idxParent = parentsList.at(i);
QModelIndex persistentIndex = persistentList.at(i);
QModelIndex adjustedDestination = destIndex.sibling(destIndex.row() - (endRow - startRow + 1), destIndex.column());
int row = idx.row();
- if (idxParent == destIndex)
- {
- if ( row >= destRow)
- {
- QCOMPARE(row + endRow - startRow + 1, persistentIndex.row() );
- QCOMPARE(idx.column(), persistentIndex.column());
- if (idxParent.row() > startRow)
- {
- QCOMPARE(adjustedDestination, persistentIndex.parent());
- } else {
- QCOMPARE(destIndex, persistentIndex.parent());
- }
- QCOMPARE(idx.model(), persistentIndex.model());
- } else
- {
+ if (idxParent == destIndex) {
+ if (row >= destRow) {
+ QCOMPARE(row + endRow - startRow + 1, persistentIndex.row());
+ QCOMPARE(idx.column(), persistentIndex.column());
+ if (idxParent.row() > startRow) {
+ QCOMPARE(adjustedDestination, persistentIndex.parent());
+ } else {
+ QCOMPARE(destIndex, persistentIndex.parent());
+ }
+ QCOMPARE(idx.model(), persistentIndex.model());
+ } else {
QCOMPARE(idx, persistentIndex);
}
- } else
- {
- if (row < startRow)
- {
+ } else {
+ if (row < startRow) {
QCOMPARE(idx, persistentIndex);
- } else if (row <= endRow)
- {
- QCOMPARE(row + destRow - startRow, persistentIndex.row() );
+ } else if (row <= endRow) {
+ QCOMPARE(row + destRow - startRow, persistentIndex.row());
QCOMPARE(idx.column(), persistentIndex.column());
- if (destIndex.row() > startRow)
- {
+ if (destIndex.row() > startRow) {
QCOMPARE(adjustedDestination, persistentIndex.parent());
} else {
QCOMPARE(destIndex, persistentIndex.parent());
}
QCOMPARE(idx.model(), persistentIndex.model());
-
} else {
- QCOMPARE(row - (endRow - startRow + 1), persistentIndex.row() );
+ QCOMPARE(row - (endRow - startRow + 1), persistentIndex.row());
QCOMPARE(idx.column(), persistentIndex.column());
QCOMPARE(idxParent, persistentIndex.parent());
QCOMPARE(idx.model(), persistentIndex.model());
@@ -1411,7 +1389,6 @@ void tst_QAbstractItemModel::testMoveToSibling()
void tst_QAbstractItemModel::testMoveToUncle_data()
{
-
QTest::addColumn<int>("startRow");
QTest::addColumn<int>("endRow");
QTest::addColumn<int>("destRow");
@@ -1456,9 +1433,9 @@ void tst_QAbstractItemModel::testMoveToUncle()
insertCommand->setEndRow(9);
insertCommand->doCommand();
- QFETCH( int, startRow);
- QFETCH( int, endRow);
- QFETCH( int, destRow);
+ QFETCH(int, startRow);
+ QFETCH(int, endRow);
+ QFETCH(int, destRow);
QList<QPersistentModelIndex> persistentList;
QModelIndexList indexList;
@@ -1467,8 +1444,7 @@ void tst_QAbstractItemModel::testMoveToUncle()
const int column = 0;
QModelIndex sourceIndex = m_model->index(9, 0);
- for (int i= 0; i < m_model->rowCount(sourceIndex); ++i)
- {
+ for (int i = 0; i < m_model->rowCount(sourceIndex); ++i) {
QModelIndex idx = m_model->index(i, column, sourceIndex);
QVERIFY(idx.isValid());
indexList << idx;
@@ -1477,8 +1453,7 @@ void tst_QAbstractItemModel::testMoveToUncle()
}
QModelIndex destIndex = m_model->index(5, 0);
- for (int i= 0; i < m_model->rowCount(destIndex); ++i)
- {
+ for (int i = 0; i < m_model->rowCount(destIndex); ++i) {
QModelIndex idx = m_model->index(i, column, destIndex);
QVERIFY(idx.isValid());
indexList << idx;
@@ -1489,6 +1464,9 @@ void tst_QAbstractItemModel::testMoveToUncle()
QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
+ QVERIFY(beforeSpy.isValid());
+ QVERIFY(afterSpy.isValid());
+
ModelMoveCommand *moveCommand = new ModelMoveCommand(m_model, this);
moveCommand->setAncestorRowNumbers(QList<int>() << 9);
moveCommand->setNumCols(4);
@@ -1515,39 +1493,31 @@ void tst_QAbstractItemModel::testMoveToUncle()
QCOMPARE(afterSignal.at(3).value<QModelIndex>(), destIndex);
QCOMPARE(afterSignal.at(4).toInt(), destRow);
- for (int i = 0; i < indexList.size(); i++)
- {
+ for (int i = 0; i < indexList.size(); i++) {
QModelIndex idx = indexList.at(i);
QModelIndex idxParent = parentsList.at(i);
QModelIndex persistentIndex = persistentList.at(i);
int row = idx.row();
- if (idxParent == destIndex)
- {
- if ( row >= destRow)
- {
- QCOMPARE(row + endRow - startRow + 1, persistentIndex.row() );
- QCOMPARE(idx.column(), persistentIndex.column());
- QCOMPARE(destIndex, persistentIndex.parent());
- QCOMPARE(idx.model(), persistentIndex.model());
- } else
- {
+ if (idxParent == destIndex) {
+ if (row >= destRow) {
+ QCOMPARE(row + endRow - startRow + 1, persistentIndex.row());
+ QCOMPARE(idx.column(), persistentIndex.column());
+ QCOMPARE(destIndex, persistentIndex.parent());
+ QCOMPARE(idx.model(), persistentIndex.model());
+ } else {
QCOMPARE(idx, persistentIndex);
}
- } else
- {
- if (row < startRow)
- {
+ } else {
+ if (row < startRow) {
QCOMPARE(idx, persistentIndex);
- } else if (row <= endRow)
- {
- QCOMPARE(row + destRow - startRow, persistentIndex.row() );
+ } else if (row <= endRow) {
+ QCOMPARE(row + destRow - startRow, persistentIndex.row());
QCOMPARE(idx.column(), persistentIndex.column());
QCOMPARE(destIndex, persistentIndex.parent());
QCOMPARE(idx.model(), persistentIndex.model());
-
} else {
- QCOMPARE(row - (endRow - startRow + 1), persistentIndex.row() );
+ QCOMPARE(row - (endRow - startRow + 1), persistentIndex.row());
QCOMPARE(idx.column(), persistentIndex.column());
QCOMPARE(idxParent, persistentIndex.parent());
QCOMPARE(idx.model(), persistentIndex.model());
@@ -1564,8 +1534,7 @@ void tst_QAbstractItemModel::testMoveToDescendants()
// Need to have some extra rows available in a tree.
QList<int> rows;
ModelInsertCommand *insertCommand;
- for (int i = 0; i < depth; i++)
- {
+ for (int i = 0; i < depth; i++) {
insertCommand = new ModelInsertCommand(m_model, this);
insertCommand->setAncestorRowNumbers(rows);
insertCommand->setNumCols(4);
@@ -1582,8 +1551,7 @@ void tst_QAbstractItemModel::testMoveToDescendants()
const int column = 0;
QModelIndex sourceIndex = m_model->index(9, 0);
- for (int i= 0; i < m_model->rowCount(sourceIndex); ++i)
- {
+ for (int i = 0; i < m_model->rowCount(sourceIndex); ++i) {
QModelIndex idx = m_model->index(i, column, sourceIndex);
QVERIFY(idx.isValid());
indexList << idx;
@@ -1592,8 +1560,7 @@ void tst_QAbstractItemModel::testMoveToDescendants()
}
QModelIndex destIndex = m_model->index(5, 0);
- for (int i= 0; i < m_model->rowCount(destIndex); ++i)
- {
+ for (int i = 0; i < m_model->rowCount(destIndex); ++i) {
QModelIndex idx = m_model->index(i, column, destIndex);
QVERIFY(idx.isValid());
indexList << idx;
@@ -1604,13 +1571,14 @@ void tst_QAbstractItemModel::testMoveToDescendants()
QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
+ QVERIFY(beforeSpy.isValid());
+ QVERIFY(afterSpy.isValid());
+
ModelMoveCommand *moveCommand;
QList<int> ancestors;
- while (ancestors.size() < depth)
- {
+ while (ancestors.size() < depth) {
ancestors << 9;
- for (int row = 0; row <= 9; row++)
- {
+ for (int row = 0; row <= 9; row++) {
moveCommand = new ModelMoveCommand(m_model, this);
moveCommand->setNumCols(4);
moveCommand->setStartRow(9);
@@ -1656,20 +1624,20 @@ void tst_QAbstractItemModel::testMoveWithinOwnRange_data()
QTest::newRow("move20") << 8 << 9 << 10;
QTest::newRow("move21") << 9 << 9 << 9;
QTest::newRow("move22") << 0 << 9 << 10;
-
}
void tst_QAbstractItemModel::testMoveWithinOwnRange()
{
-
- QFETCH( int, startRow);
- QFETCH( int, endRow);
- QFETCH( int, destRow);
-
+ QFETCH(int, startRow);
+ QFETCH(int, endRow);
+ QFETCH(int, destRow);
QSignalSpy beforeSpy(m_model, SIGNAL(rowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
QSignalSpy afterSpy(m_model, SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)));
+ QVERIFY(beforeSpy.isValid());
+ QVERIFY(afterSpy.isValid());
+
ModelMoveCommand *moveCommand = new ModelMoveCommand(m_model, this);
moveCommand->setNumCols(4);
moveCommand->setStartRow(startRow);
@@ -1679,13 +1647,11 @@ void tst_QAbstractItemModel::testMoveWithinOwnRange()
QVERIFY(beforeSpy.size() == 0);
QVERIFY(afterSpy.size() == 0);
-
-
}
class ListenerObject : public QObject
{
- Q_OBJECT
+ Q_OBJECT
public:
ListenerObject(QAbstractProxyModel *parent);
@@ -1717,14 +1683,11 @@ void ListenerObject::fillIndexStores(const QModelIndex &parent)
const int column = 0;
int row = 0;
QModelIndex idx = m_model->index(row, column, parent);
- while (idx.isValid())
- {
+ while (idx.isValid()) {
m_persistentIndexes << QPersistentModelIndex(idx);
m_nonPersistentIndexes << idx;
if (m_model->hasChildren(idx))
- {
fillIndexStores(idx);
- }
++row;
idx = m_model->index(row, column, parent);
}
@@ -1733,8 +1696,7 @@ void ListenerObject::fillIndexStores(const QModelIndex &parent)
void ListenerObject::slotAboutToBeReset()
{
// Nothing has been changed yet. All indexes should be the same.
- for (int i = 0; i < m_persistentIndexes.size(); ++i)
- {
+ for (int i = 0; i < m_persistentIndexes.size(); ++i) {
QModelIndex idx = m_persistentIndexes.at(i);
QVERIFY(idx == m_nonPersistentIndexes.at(i));
QVERIFY(m_model->mapToSource(idx).isValid());
@@ -1743,18 +1705,18 @@ void ListenerObject::slotAboutToBeReset()
void ListenerObject::slotReset()
{
- foreach(const QModelIndex &idx, m_persistentIndexes)
- {
+ foreach (const QModelIndex &idx, m_persistentIndexes) {
QVERIFY(!idx.isValid());
}
}
-
void tst_QAbstractItemModel::testReset()
{
QSignalSpy beforeResetSpy(m_model, SIGNAL(modelAboutToBeReset()));
QSignalSpy afterResetSpy(m_model, SIGNAL(modelReset()));
+ QVERIFY(beforeResetSpy.isValid());
+ QVERIFY(afterResetSpy.isValid());
QSortFilterProxyModel *nullProxy = new QSortFilterProxyModel(this);
nullProxy->setSourceModel(m_model);
@@ -1779,7 +1741,6 @@ void tst_QAbstractItemModel::testReset()
QVERIFY(m_model->rowCount() == 9);
QModelIndex destIndex = m_model->index(4, 0);
QVERIFY(m_model->rowCount(destIndex) == 11);
-
}
class CustomRoleModel : public QStringListModel
@@ -1796,7 +1757,6 @@ public:
CustomRoleModel(QObject *parent = 0)
: QStringListModel(QStringList() << "a" << "b" << "c", parent)
{
-
}
void emitSignals()
@@ -1821,6 +1781,9 @@ void tst_QAbstractItemModel::testDataChanged()
QSignalSpy withRoles(&model, SIGNAL(dataChanged(QModelIndex,QModelIndex,QSet<int>)));
QSignalSpy withoutRoles(&model, SIGNAL(dataChanged(QModelIndex,QModelIndex)));
+ QVERIFY(withRoles.isValid());
+ QVERIFY(withoutRoles.isValid());
+
model.emitSignals();
QCOMPARE(withRoles.size(), withoutRoles.size());
@@ -1920,6 +1883,9 @@ void tst_QAbstractItemModel::testChildrenLayoutsChanged()
QSignalSpy beforeSpy(&model, SIGNAL(layoutAboutToBeChanged(QList<QPersistentModelIndex>)));
QSignalSpy afterSpy(&model, SIGNAL(layoutChanged(QList<QPersistentModelIndex>)));
+ QVERIFY(beforeSpy.isValid());
+ QVERIFY(afterSpy.isValid());
+
ModelChangeChildrenLayoutsCommand *changeCommand = new ModelChangeChildrenLayoutsCommand(&model, this);
changeCommand->setAncestorRowNumbers(QList<int>() << 2);
changeCommand->setSecondAncestorRowNumbers(QList<int>() << 5);
@@ -1950,7 +1916,6 @@ void tst_QAbstractItemModel::testChildrenLayoutsChanged()
QVERIFY(p1LastPersistent.row() == 0);
QVERIFY(p2FirstPersistent.row() == 9);
QVERIFY(p2LastPersistent.row() == 8);
-
}
insertCommand = new ModelInsertCommand(&model, this);
@@ -1984,6 +1949,9 @@ void tst_QAbstractItemModel::testChildrenLayoutsChanged()
QSignalSpy beforeSpy(&model, SIGNAL(layoutAboutToBeChanged(QList<QPersistentModelIndex>)));
QSignalSpy afterSpy(&model, SIGNAL(layoutChanged(QList<QPersistentModelIndex>)));
+ QVERIFY(beforeSpy.isValid());
+ QVERIFY(afterSpy.isValid());
+
// Because the arguments in the signal are persistent, we need to check them for the aboutToBe
// case at emission time - before they get updated.
SignalArgumentChecker checker(p1, p2);
@@ -2011,5 +1979,44 @@ void tst_QAbstractItemModel::testChildrenLayoutsChanged()
}
}
+class OverrideRoleNamesAndDragActions : public QStringListModel
+{
+ Q_OBJECT
+public:
+ OverrideRoleNamesAndDragActions(QObject *parent = 0)
+ : QStringListModel(parent)
+ {
+
+ }
+
+ QHash<int, QByteArray> roleNames() const
+ {
+ QHash<int, QByteArray> roles = QStringListModel::roleNames();
+ roles.insert(Qt::UserRole + 2, "custom");
+ return roles;
+ }
+
+ Qt::DropActions supportedDragActions() const
+ {
+ return QStringListModel::supportedDragActions() | Qt::MoveAction;
+ }
+};
+
+void tst_QAbstractItemModel::testRoleNames()
+{
+ QAbstractItemModel *model = new OverrideRoleNamesAndDragActions(this);
+ QHash<int, QByteArray> roles = model->roleNames();
+ QVERIFY(roles.contains(Qt::UserRole + 2));
+ QVERIFY(roles.value(Qt::UserRole + 2) == "custom");
+}
+
+void tst_QAbstractItemModel::testDragActions()
+{
+ QAbstractItemModel *model = new OverrideRoleNamesAndDragActions(this);
+ const Qt::DropActions actions = model->supportedDragActions();
+ QVERIFY(actions & Qt::CopyAction); // Present by default
+ QVERIFY(actions & Qt::MoveAction);
+}
+
QTEST_MAIN(tst_QAbstractItemModel)
#include "tst_qabstractitemmodel.moc"
diff --git a/tests/auto/widgets/itemviews/qabstractproxymodel/.gitignore b/tests/auto/corelib/itemmodels/qabstractproxymodel/.gitignore
index bffc04d632..bffc04d632 100644
--- a/tests/auto/widgets/itemviews/qabstractproxymodel/.gitignore
+++ b/tests/auto/corelib/itemmodels/qabstractproxymodel/.gitignore
diff --git a/tests/auto/widgets/itemviews/qabstractproxymodel/qabstractproxymodel.pro b/tests/auto/corelib/itemmodels/qabstractproxymodel/qabstractproxymodel.pro
index 5ded15ad5c..5ded15ad5c 100644
--- a/tests/auto/widgets/itemviews/qabstractproxymodel/qabstractproxymodel.pro
+++ b/tests/auto/corelib/itemmodels/qabstractproxymodel/qabstractproxymodel.pro
diff --git a/tests/auto/widgets/itemviews/qabstractproxymodel/tst_qabstractproxymodel.cpp b/tests/auto/corelib/itemmodels/qabstractproxymodel/tst_qabstractproxymodel.cpp
index b6557c45ec..088ad0afdc 100644
--- a/tests/auto/widgets/itemviews/qabstractproxymodel/tst_qabstractproxymodel.cpp
+++ b/tests/auto/corelib/itemmodels/qabstractproxymodel/tst_qabstractproxymodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -39,7 +39,6 @@
**
****************************************************************************/
-
#include <QtTest/QtTest>
#include <qabstractproxymodel.h>
#include <QItemSelection>
@@ -49,14 +48,7 @@ class tst_QAbstractProxyModel : public QObject
{
Q_OBJECT
-public slots:
- void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
-
private slots:
- void qabstractproxymodel_data();
void qabstractproxymodel();
void data_data();
void data();
@@ -74,9 +66,7 @@ private slots:
void mapSelectionToSource();
void mapToSource_data();
void mapToSource();
- void revert_data();
void revert();
- void setSourceModel_data();
void setSourceModel();
void submit_data();
void submit();
@@ -116,32 +106,6 @@ public:
}
};
-// This will be called before the first test function is executed.
-// It is only called once.
-void tst_QAbstractProxyModel::initTestCase()
-{
-}
-
-// This will be called after the last test function is executed.
-// It is only called once.
-void tst_QAbstractProxyModel::cleanupTestCase()
-{
-}
-
-// This will be called before each test function is executed.
-void tst_QAbstractProxyModel::init()
-{
-}
-
-// This will be called after every test function.
-void tst_QAbstractProxyModel::cleanup()
-{
-}
-
-void tst_QAbstractProxyModel::qabstractproxymodel_data()
-{
-}
-
void tst_QAbstractProxyModel::qabstractproxymodel()
{
SubQAbstractProxyModel model;
@@ -309,32 +273,16 @@ void tst_QAbstractProxyModel::mapToSource()
QCOMPARE(model.mapToSource(proxyIndex), mapToSource);
}
-void tst_QAbstractProxyModel::revert_data()
-{
- //QTest::addColumn<int>("foo");
- //QTest::newRow("null") << 0;
-}
-
// public void revert()
void tst_QAbstractProxyModel::revert()
{
- //QFETCH(int, foo);
-
SubQAbstractProxyModel model;
model.revert();
}
-void tst_QAbstractProxyModel::setSourceModel_data()
-{
- //QTest::addColumn<int>("sourceModelCount");
- //QTest::newRow("null") << 0;
-}
-
// public void setSourceModel(QAbstractItemModel* sourceModel)
void tst_QAbstractProxyModel::setSourceModel()
{
- //QFETCH(int, sourceModelCount);
-
SubQAbstractProxyModel model;
QStandardItemModel *sourceModel = new QStandardItemModel(&model);
model.setSourceModel(sourceModel);
@@ -381,18 +329,18 @@ public:
class AnotherStandardItemModelWithCustomRoleNames : public QStandardItemModel
{
- public:
- enum CustomRole {
- AnotherCustomRole1 = Qt::UserRole + 10, // Different to StandardItemModelWithCustomRoleNames::CustomRole1
- AnotherCustomRole2
- };
-
- AnotherStandardItemModelWithCustomRoleNames() {
- QHash<int, QByteArray> _roleNames = roleNames();
- _roleNames.insert(AnotherCustomRole1, "another_custom1");
- _roleNames.insert(AnotherCustomRole2, "another_custom2");
- setRoleNames(_roleNames);
- }
+public:
+ enum CustomRole {
+ AnotherCustomRole1 = Qt::UserRole + 10, // Different to StandardItemModelWithCustomRoleNames::CustomRole1
+ AnotherCustomRole2
+ };
+
+ AnotherStandardItemModelWithCustomRoleNames() {
+ QHash<int, QByteArray> _roleNames = roleNames();
+ _roleNames.insert(AnotherCustomRole1, "another_custom1");
+ _roleNames.insert(AnotherCustomRole2, "another_custom2");
+ setRoleNames(_roleNames);
+ }
};
/**
@@ -441,7 +389,6 @@ void tst_QAbstractProxyModel::testRoleNames()
QVERIFY( proxy2RoleNames.contains(StandardItemModelWithCustomRoleNames::CustomRole2));
QVERIFY( proxy2RoleNames.value(StandardItemModelWithCustomRoleNames::CustomRole1) == "custom1" );
QVERIFY( proxy2RoleNames.value(StandardItemModelWithCustomRoleNames::CustomRole2) == "custom2" );
-
}
QTEST_MAIN(tst_QAbstractProxyModel)
diff --git a/tests/auto/widgets/itemviews/qidentityproxymodel/qidentityproxymodel.pro b/tests/auto/corelib/itemmodels/qidentityproxymodel/qidentityproxymodel.pro
index 4fb8c98fe7..4fb8c98fe7 100644
--- a/tests/auto/widgets/itemviews/qidentityproxymodel/qidentityproxymodel.pro
+++ b/tests/auto/corelib/itemmodels/qidentityproxymodel/qidentityproxymodel.pro
diff --git a/tests/auto/widgets/itemviews/qidentityproxymodel/tst_qidentityproxymodel.cpp b/tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp
index 86ff00f9d4..fc11fbf763 100644
--- a/tests/auto/widgets/itemviews/qidentityproxymodel/tst_qidentityproxymodel.cpp
+++ b/tests/auto/corelib/itemmodels/qidentityproxymodel/tst_qidentityproxymodel.cpp
@@ -39,11 +39,9 @@
**
****************************************************************************/
-
#include <QtTest/QtTest>
-#include <QtCore>
-#include <QtGui>
-#include <QtWidgets>
+#include <QtCore/QCoreApplication>
+#include <QtWidgets/QStandardItemModel>
#include "dynamictreemodel.h"
#include "qidentityproxymodel.h"
@@ -55,14 +53,11 @@ class tst_QIdentityProxyModel : public QObject
Q_OBJECT
public:
-
tst_QIdentityProxyModel();
- virtual ~tst_QIdentityProxyModel();
public slots:
void initTestCase();
void cleanupTestCase();
- void init();
void cleanup();
private slots:
@@ -82,12 +77,6 @@ private:
tst_QIdentityProxyModel::tst_QIdentityProxyModel()
: m_model(0), m_proxy(0)
{
-
-}
-
-tst_QIdentityProxyModel::~tst_QIdentityProxyModel()
-{
-
}
void tst_QIdentityProxyModel::initTestCase()
@@ -104,10 +93,6 @@ void tst_QIdentityProxyModel::cleanupTestCase()
delete m_model;
}
-void tst_QIdentityProxyModel::init()
-{
-}
-
void tst_QIdentityProxyModel::cleanup()
{
m_model->clear();
@@ -169,6 +154,11 @@ void tst_QIdentityProxyModel::insertRows()
QSignalSpy proxyBeforeSpy(m_proxy, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)));
QSignalSpy proxyAfterSpy(m_proxy, SIGNAL(rowsInserted(QModelIndex,int,int)));
+ QVERIFY(modelBeforeSpy.isValid());
+ QVERIFY(modelAfterSpy.isValid());
+ QVERIFY(proxyBeforeSpy.isValid());
+ QVERIFY(proxyAfterSpy.isValid());
+
QStandardItem *item = new QStandardItem(QString("new item"));
parentItem->appendRow(item);
@@ -184,7 +174,6 @@ void tst_QIdentityProxyModel::insertRows()
QVERIFY(modelAfterSpy.first().at(2) == proxyAfterSpy.first().at(2));
verifyIdentity(m_model);
-
}
void tst_QIdentityProxyModel::removeRows()
@@ -205,6 +194,11 @@ void tst_QIdentityProxyModel::removeRows()
QSignalSpy proxyBeforeSpy(m_proxy, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)));
QSignalSpy proxyAfterSpy(m_proxy, SIGNAL(rowsRemoved(QModelIndex,int,int)));
+ QVERIFY(modelBeforeSpy.isValid());
+ QVERIFY(modelAfterSpy.isValid());
+ QVERIFY(proxyBeforeSpy.isValid());
+ QVERIFY(proxyAfterSpy.isValid());
+
const QModelIndex topLevel = m_model->index(0, 0, QModelIndex());
const QModelIndex secondLevel = m_model->index(0, 0, topLevel);
const QModelIndex thirdLevel = m_model->index(0, 0, secondLevel);
@@ -254,6 +248,11 @@ void tst_QIdentityProxyModel::moveRows()
QSignalSpy proxyBeforeSpy(m_proxy, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
QSignalSpy proxyAfterSpy(m_proxy, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)));
+ QVERIFY(modelBeforeSpy.isValid());
+ QVERIFY(modelAfterSpy.isValid());
+ QVERIFY(proxyBeforeSpy.isValid());
+ QVERIFY(proxyAfterSpy.isValid());
+
{
ModelMoveCommand moveCommand(&model, 0);
moveCommand.setAncestorRowNumbers(QList<int>() << 5);
@@ -310,6 +309,11 @@ void tst_QIdentityProxyModel::reset()
QSignalSpy proxyBeforeSpy(m_proxy, SIGNAL(modelAboutToBeReset()));
QSignalSpy proxyAfterSpy(m_proxy, SIGNAL(modelReset()));
+ QVERIFY(modelBeforeSpy.isValid());
+ QVERIFY(modelAfterSpy.isValid());
+ QVERIFY(proxyBeforeSpy.isValid());
+ QVERIFY(proxyAfterSpy.isValid());
+
{
ModelResetCommandFixed resetCommand(&model, 0);
resetCommand.setAncestorRowNumbers(QList<int>() << 5);
diff --git a/tests/auto/corelib/kernel/qitemmodel/.gitignore b/tests/auto/corelib/itemmodels/qitemmodel/.gitignore
index 017be17fa8..017be17fa8 100644
--- a/tests/auto/corelib/kernel/qitemmodel/.gitignore
+++ b/tests/auto/corelib/itemmodels/qitemmodel/.gitignore
diff --git a/tests/auto/corelib/kernel/qitemmodel/README b/tests/auto/corelib/itemmodels/qitemmodel/README
index bddec0cef2..bddec0cef2 100644
--- a/tests/auto/corelib/kernel/qitemmodel/README
+++ b/tests/auto/corelib/itemmodels/qitemmodel/README
diff --git a/tests/auto/corelib/kernel/qitemmodel/modelstotest.cpp b/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp
index 496789d408..20985b69a6 100644
--- a/tests/auto/corelib/kernel/qitemmodel/modelstotest.cpp
+++ b/tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -41,10 +41,10 @@
#include <QtTest/QtTest>
-#include <QtCore/QtCore>
+#include <QtCore/QCoreApplication>
#include <QtSql/QtSql>
#include <QtWidgets/QtWidgets>
-#include <QSortFilterProxyModel>
+#include <QtCore/QSortFilterProxyModel>
/*
To add a model to be tested add the header file to the includes
@@ -163,7 +163,7 @@ QAbstractItemModel *ModelsToTest::createModel(const QString &modelType)
QStandardItemModel *standardItemModel = new QStandardItemModel;
model->setSourceModel(standardItemModel);
populateTestArea(model);
- model->setFilterRegExp(QRegExp("(^$|0.*)"));
+ model->setFilterRegExp(QRegExp("(^$|I.*)"));
return model;
}
diff --git a/tests/auto/corelib/kernel/qitemmodel/qitemmodel.pro b/tests/auto/corelib/itemmodels/qitemmodel/qitemmodel.pro
index ff21d6afa5..ff21d6afa5 100644
--- a/tests/auto/corelib/kernel/qitemmodel/qitemmodel.pro
+++ b/tests/auto/corelib/itemmodels/qitemmodel/qitemmodel.pro
diff --git a/tests/auto/corelib/kernel/qitemmodel/tst_qitemmodel.cpp b/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp
index a4b1044cab..6d673ae00f 100644
--- a/tests/auto/corelib/kernel/qitemmodel/tst_qitemmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qitemmodel/tst_qitemmodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
#include <QtTest/QtTest>
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <qdebug.h>
#include "modelstotest.cpp"
#include <QMetaType>
@@ -601,6 +601,7 @@ void tst_QItemModel::setData()
QVERIFY(currentModel);
qRegisterMetaType<QModelIndex>("QModelIndex");
QSignalSpy spy(currentModel, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)));
+ QVERIFY(spy.isValid());
QCOMPARE(currentModel->setData(QModelIndex(), QVariant()), false);
QCOMPARE(spy.count(), 0);
@@ -662,6 +663,7 @@ void tst_QItemModel::setHeaderData()
qRegisterMetaType<Qt::Orientation>("Qt::Orientation");
QSignalSpy spy(currentModel, SIGNAL(headerDataChanged( Qt::Orientation, int , int )));
+ QVERIFY(spy.isValid());
QString text = "Index private pointers should always be the same";
int signalCount = 0;
@@ -702,6 +704,7 @@ void tst_QItemModel::sort()
QModelIndex index = currentModel->index(0, 0, topIndex);
QVERIFY(index.isValid());
QSignalSpy spy(currentModel, SIGNAL(layoutChanged()));
+ QVERIFY(spy.isValid());
for (int i=-1; i < 10; ++i){
currentModel->sort(i);
if (index != currentModel->index(0, 0, topIndex)){
@@ -846,6 +849,13 @@ void tst_QItemModel::remove()
QSignalSpy modelResetSpy(currentModel, SIGNAL(modelReset()));
QSignalSpy modelLayoutChangedSpy(currentModel, SIGNAL(layoutChanged()));
+ QVERIFY(columnsAboutToBeRemovedSpy.isValid());
+ QVERIFY(rowsAboutToBeRemovedSpy.isValid());
+ QVERIFY(columnsRemovedSpy.isValid());
+ QVERIFY(rowsRemovedSpy.isValid());
+ QVERIFY(modelResetSpy.isValid());
+ QVERIFY(modelLayoutChangedSpy.isValid());
+
QFETCH(int, numberOfRowsAboutToBeRemovedSignals);
QFETCH(int, numberOfColumnsAboutToBeRemovedSignals);
QFETCH(int, numberOfRowsRemovedSignals);
@@ -1182,6 +1192,13 @@ void tst_QItemModel::insert()
QSignalSpy modelResetSpy(currentModel, SIGNAL(modelReset()));
QSignalSpy modelLayoutChangedSpy(currentModel, SIGNAL(layoutChanged()));
+ QVERIFY(columnsAboutToBeInsertedSpy.isValid());
+ QVERIFY(rowsAboutToBeInsertedSpy.isValid());
+ QVERIFY(columnsInsertedSpy.isValid());
+ QVERIFY(rowsInsertedSpy.isValid());
+ QVERIFY(modelResetSpy.isValid());
+ QVERIFY(modelLayoutChangedSpy.isValid());
+
QFETCH(int, numberOfRowsAboutToBeInsertedSignals);
QFETCH(int, numberOfColumnsAboutToBeInsertedSignals);
QFETCH(int, numberOfRowsInsertedSignals);
diff --git a/tests/auto/widgets/itemviews/qitemselectionmodel/.gitignore b/tests/auto/corelib/itemmodels/qitemselectionmodel/.gitignore
index aa543a200a..aa543a200a 100644
--- a/tests/auto/widgets/itemviews/qitemselectionmodel/.gitignore
+++ b/tests/auto/corelib/itemmodels/qitemselectionmodel/.gitignore
diff --git a/tests/auto/widgets/itemviews/qitemselectionmodel/qitemselectionmodel.pro b/tests/auto/corelib/itemmodels/qitemselectionmodel/qitemselectionmodel.pro
index a4c7ba3786..aff9b3102d 100644
--- a/tests/auto/widgets/itemviews/qitemselectionmodel/qitemselectionmodel.pro
+++ b/tests/auto/corelib/itemmodels/qitemselectionmodel/qitemselectionmodel.pro
@@ -2,5 +2,3 @@ CONFIG += testcase
TARGET = tst_qitemselectionmodel
QT += widgets testlib
SOURCES += tst_qitemselectionmodel.cpp
-
-
diff --git a/tests/auto/widgets/itemviews/qitemselectionmodel/tst_qitemselectionmodel.cpp b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp
index 2097cb31ee..552b3d6eab 100644
--- a/tests/auto/widgets/itemviews/qitemselectionmodel/tst_qitemselectionmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qitemselectionmodel/tst_qitemselectionmodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -39,7 +39,6 @@
**
****************************************************************************/
-
#include <QtTest/QtTest>
#include <QtGui/QtGui>
@@ -51,8 +50,6 @@ class tst_QItemSelectionModel : public QObject
public:
tst_QItemSelectionModel();
- virtual ~tst_QItemSelectionModel();
-
public slots:
void initTestCase();
@@ -80,18 +77,18 @@ private slots:
void selectedColumns();
void setCurrentIndex();
void splitOnInsert();
- void task196285_rowIntersectsSelection();
+ void rowIntersectsSelection1();
+ void rowIntersectsSelection2();
void unselectable();
- void task220420_selectedIndexes();
- void task240734_layoutChanged();
+ void selectedIndexes();
+ void layoutChanged();
void merge_data();
void merge();
- void task119433_isRowSelected();
- void task252069_rowIntersectsSelection();
- void task232634_childrenDeselectionSignal();
- void task260134_layoutChangedWithAllSelected();
- void QTBUG5671_layoutChangedWithAllSelected();
- void QTBUG2804_layoutChangedTreeSelection();
+ void isRowSelected();
+ void childrenDeselectionSignal();
+ void layoutChangedWithAllSelected1();
+ void layoutChangedWithAllSelected2();
+ void layoutChangedTreeSelection();
void deselectRemovedMiddleRange();
void rangeOperatorLessThan_data();
void rangeOperatorLessThan();
@@ -116,7 +113,6 @@ typedef QList<int> IntList;
typedef QPair<int, int> IntPair;
typedef QList<IntPair> PairList;
-
Q_DECLARE_METATYPE(PairList)
Q_DECLARE_METATYPE(QModelIndex)
Q_DECLARE_METATYPE(QModelIndexList)
@@ -186,11 +182,8 @@ QDataStream &operator>>(QDataStream &s, QModelIndexList &output)
return s;
}
-tst_QItemSelectionModel::tst_QItemSelectionModel() : model(0), selection(0)
-{
-}
-
-tst_QItemSelectionModel::~tst_QItemSelectionModel()
+tst_QItemSelectionModel::tst_QItemSelectionModel()
+ : model(0), selection(0)
{
}
@@ -321,7 +314,7 @@ void tst_QItemSelectionModel::clearAndSelect()
// populate selectionmodel
selection->select(model->index(1, 1, QModelIndex()), QItemSelectionModel::Select);
QCOMPARE(selection->selectedIndexes().count(), 1);
- QVERIFY(selection->hasSelection());
+ QVERIFY(selection->hasSelection());
// ClearAndSelect with empty selection
QItemSelection emptySelection;
@@ -329,40 +322,38 @@ void tst_QItemSelectionModel::clearAndSelect()
// verify the selectionmodel is empty
QVERIFY(selection->selectedIndexes().isEmpty());
- QVERIFY(selection->hasSelection()==false);
+ QVERIFY(selection->hasSelection()==false);
}
void tst_QItemSelectionModel::toggleSelection()
{
- //test the toggle selection and checks whether selectedIndex
- //and hasSelection returns the correct value
+ //test the toggle selection and checks whether selectedIndex
+ //and hasSelection returns the correct value
- selection->clearSelection();
+ selection->clearSelection();
QCOMPARE(selection->selectedIndexes().count(), 0);
- QVERIFY(selection->hasSelection()==false);
+ QVERIFY(selection->hasSelection()==false);
- QModelIndex index=model->index(1, 1, QModelIndex());
+ QModelIndex index=model->index(1, 1, QModelIndex());
// populate selectionmodel
selection->select(index, QItemSelectionModel::Toggle);
QCOMPARE(selection->selectedIndexes().count(), 1);
- QVERIFY(selection->hasSelection()==true);
+ QVERIFY(selection->hasSelection()==true);
selection->select(index, QItemSelectionModel::Toggle);
QCOMPARE(selection->selectedIndexes().count(), 0);
- QVERIFY(selection->hasSelection()==false);
+ QVERIFY(selection->hasSelection()==false);
// populate selectionmodel with rows
selection->select(index, QItemSelectionModel::Toggle | QItemSelectionModel::Rows);
QCOMPARE(selection->selectedIndexes().count(), model->columnCount());
- QVERIFY(selection->hasSelection()==true);
+ QVERIFY(selection->hasSelection()==true);
selection->select(index, QItemSelectionModel::Toggle | QItemSelectionModel::Rows);
QCOMPARE(selection->selectedIndexes().count(), 0);
- QVERIFY(selection->hasSelection()==false);
-
+ QVERIFY(selection->hasSelection()==false);
}
-
void tst_QItemSelectionModel::select_data()
{
QTest::addColumn<QModelIndexList>("indexList");
@@ -628,7 +619,6 @@ void tst_QItemSelectionModel::select_data()
<< command
<< expected;
}
- /* ### FAILS
{
QModelIndexList index;
QModelIndexList expected;
@@ -642,7 +632,6 @@ void tst_QItemSelectionModel::select_data()
<< command
<< expected;
}
- */
{
QModelIndexList index;
QModelIndexList expected;
@@ -1187,54 +1176,54 @@ void tst_QItemSelectionModel::select_data()
}
{
QModelIndexList indexes;
- IntList commands;
- QModelIndexList expected;
-
- indexes << model->index(0, 0, QModelIndex()) << model->index(0, 0, QModelIndex()) // press 0
- << model->index(0, 0, QModelIndex()) << model->index(0, 0, QModelIndex()) // release 0
- << model->index(1, 0, QModelIndex()) << model->index(1, 0, QModelIndex()) // press 1
- << model->index(1, 0, QModelIndex()) << model->index(1, 0, QModelIndex()) // release 1
- << model->index(2, 0, QModelIndex()) << model->index(2, 0, QModelIndex()) // press 2
- << model->index(2, 0, QModelIndex()) << model->index(2, 0, QModelIndex()) // release 2
- << model->index(3, 0, QModelIndex()) << model->index(3, 0, QModelIndex()) // press 3
- << model->index(3, 0, QModelIndex()) << model->index(3, 0, QModelIndex()) // release 3
- << model->index(2, 0, QModelIndex()) << model->index(2, 0, QModelIndex()) // press 2 again
- << model->index(2, 0, QModelIndex()) << model->index(2, 0, QModelIndex());// move 2
-
- commands << (QItemSelectionModel::NoUpdate) // press 0
- << (QItemSelectionModel::Toggle|QItemSelectionModel::Rows) // release 0
- << (QItemSelectionModel::NoUpdate) // press 1
- << (QItemSelectionModel::Toggle|QItemSelectionModel::Rows) // release 1
- << (QItemSelectionModel::NoUpdate) // press 2
- << (QItemSelectionModel::Toggle|QItemSelectionModel::Rows) // release 2
- << (QItemSelectionModel::NoUpdate) // press 3
- << (QItemSelectionModel::Toggle|QItemSelectionModel::Rows) // release 3
- << (QItemSelectionModel::NoUpdate) // press 2 again
- << (QItemSelectionModel::Toggle/*Current*/|QItemSelectionModel::Rows);// move 2
-
- expected << model->index(0, 0, QModelIndex())
- << model->index(0, 1, QModelIndex())
- << model->index(0, 2, QModelIndex())
- << model->index(0, 3, QModelIndex())
- << model->index(0, 4, QModelIndex())
-
- << model->index(1, 0, QModelIndex())
- << model->index(1, 1, QModelIndex())
- << model->index(1, 2, QModelIndex())
- << model->index(1, 3, QModelIndex())
- << model->index(1, 4, QModelIndex())
- /*
- << model->index(2, 0, QModelIndex())
- << model->index(2, 1, QModelIndex())
- << model->index(2, 2, QModelIndex())
- << model->index(2, 3, QModelIndex())
- << model->index(2, 4, QModelIndex())
- */
- << model->index(3, 0, QModelIndex())
- << model->index(3, 1, QModelIndex())
- << model->index(3, 2, QModelIndex())
- << model->index(3, 3, QModelIndex())
- << model->index(3, 4, QModelIndex());
+ IntList commands;
+ QModelIndexList expected;
+
+ indexes << model->index(0, 0, QModelIndex()) << model->index(0, 0, QModelIndex()) // press 0
+ << model->index(0, 0, QModelIndex()) << model->index(0, 0, QModelIndex()) // release 0
+ << model->index(1, 0, QModelIndex()) << model->index(1, 0, QModelIndex()) // press 1
+ << model->index(1, 0, QModelIndex()) << model->index(1, 0, QModelIndex()) // release 1
+ << model->index(2, 0, QModelIndex()) << model->index(2, 0, QModelIndex()) // press 2
+ << model->index(2, 0, QModelIndex()) << model->index(2, 0, QModelIndex()) // release 2
+ << model->index(3, 0, QModelIndex()) << model->index(3, 0, QModelIndex()) // press 3
+ << model->index(3, 0, QModelIndex()) << model->index(3, 0, QModelIndex()) // release 3
+ << model->index(2, 0, QModelIndex()) << model->index(2, 0, QModelIndex()) // press 2 again
+ << model->index(2, 0, QModelIndex()) << model->index(2, 0, QModelIndex());// move 2
+
+ commands << (QItemSelectionModel::NoUpdate) // press 0
+ << (QItemSelectionModel::Toggle|QItemSelectionModel::Rows) // release 0
+ << (QItemSelectionModel::NoUpdate) // press 1
+ << (QItemSelectionModel::Toggle|QItemSelectionModel::Rows) // release 1
+ << (QItemSelectionModel::NoUpdate) // press 2
+ << (QItemSelectionModel::Toggle|QItemSelectionModel::Rows) // release 2
+ << (QItemSelectionModel::NoUpdate) // press 3
+ << (QItemSelectionModel::Toggle|QItemSelectionModel::Rows) // release 3
+ << (QItemSelectionModel::NoUpdate) // press 2 again
+ << (QItemSelectionModel::Toggle/*Current*/|QItemSelectionModel::Rows);// move 2
+
+ expected << model->index(0, 0, QModelIndex())
+ << model->index(0, 1, QModelIndex())
+ << model->index(0, 2, QModelIndex())
+ << model->index(0, 3, QModelIndex())
+ << model->index(0, 4, QModelIndex())
+
+ << model->index(1, 0, QModelIndex())
+ << model->index(1, 1, QModelIndex())
+ << model->index(1, 2, QModelIndex())
+ << model->index(1, 3, QModelIndex())
+ << model->index(1, 4, QModelIndex())
+ /*
+ << model->index(2, 0, QModelIndex())
+ << model->index(2, 1, QModelIndex())
+ << model->index(2, 2, QModelIndex())
+ << model->index(2, 3, QModelIndex())
+ << model->index(2, 4, QModelIndex())
+ */
+ << model->index(3, 0, QModelIndex())
+ << model->index(3, 1, QModelIndex())
+ << model->index(3, 2, QModelIndex())
+ << model->index(3, 3, QModelIndex())
+ << model->index(3, 4, QModelIndex());
QTest::newRow("simulated treeview multiselection behavior")
<< indexes
@@ -1269,12 +1258,6 @@ void tst_QItemSelectionModel::select()
QVERIFY(selection->hasSelection()!=selectedList.isEmpty());
- // debug output
-// for (int i=0; i<selectedList.count(); ++i)
-// qDebug(QString("selected (%1, %2)")
-// .arg(selectedList.at(i).row())
-// .arg(selectedList.at(i).column()));
-
// test that the number of indices are as expected
QVERIFY2(selectedList.count() == expectedList.count(),
QString("expected indices: %1 actual indices: %2")
@@ -1343,140 +1326,140 @@ void tst_QItemSelectionModel::persistentselections_data()
<< insertRows << insertColumns << deleteRows << deleteColumns
<< expected;
- index.clear(); expected.clear(); command.clear();
- insertRows.clear(); insertColumns.clear(); deleteRows.clear(); deleteColumns.clear();
- index << IntPair(0, 0);
- command << QItemSelectionModel::ClearAndSelect;
- deleteRows << 0 << 1;
- QTest::newRow("ClearAndSelect (0, 0). Delete first row.")
- << index << command
- << insertRows << insertColumns << deleteRows << deleteColumns
- << expected;
-
- index.clear(); expected.clear(); command.clear();
- insertRows.clear(); insertColumns.clear(); deleteRows.clear(); deleteColumns.clear();
- index << IntPair(1, 0);
- command << QItemSelectionModel::ClearAndSelect;
- deleteRows << 0 << 1;
- expected << IntPair(0, 0);
- QTest::newRow("ClearAndSelect (1, 0). Delete first row.")
- << index << command
- << insertRows << insertColumns << deleteRows << deleteColumns
- << expected;
-
- index.clear(); expected.clear(); command.clear();
- insertRows.clear(); insertColumns.clear(); deleteRows.clear(); deleteColumns.clear();
- index << IntPair(0, 0);
- command << QItemSelectionModel::ClearAndSelect;
- insertRows << 5 << 1;
- expected << IntPair(0, 0);
- QTest::newRow("ClearAndSelect (0, 0). Append row.")
- << index << command
- << insertRows << insertColumns << deleteRows << deleteColumns
- << expected;
-
- index.clear(); expected.clear(); command.clear();
- insertRows.clear(); insertColumns.clear(); deleteRows.clear(); deleteColumns.clear();
- index << IntPair(0, 0);
- command << QItemSelectionModel::ClearAndSelect;
- insertRows << 0 << 1;
- expected << IntPair(1, 0);
- QTest::newRow("ClearAndSelect (0, 0). Insert before first row.")
- << index << command
- << insertRows << insertColumns << deleteRows << deleteColumns
- << expected;
-
- index.clear(); expected.clear(); command.clear();
- insertRows.clear(); insertColumns.clear(); deleteRows.clear(); deleteColumns.clear();
- index << IntPair(0, 0)
- << IntPair(4, 0);
- command << QItemSelectionModel::ClearAndSelect;
- insertRows << 5 << 1;
- expected << IntPair(0, 0)
- << IntPair(1, 0)
- << IntPair(2, 0)
- << IntPair(3, 0)
- << IntPair(4, 0);
- QTest::newRow("ClearAndSelect (0, 0) to (4, 0). Append row.")
- << index << command
- << insertRows << insertColumns << deleteRows << deleteColumns
- << expected;
-
- index.clear(); expected.clear(); command.clear();
- insertRows.clear(); insertColumns.clear(); deleteRows.clear(); deleteColumns.clear();
- index << IntPair(0, 0)
- << IntPair(4, 0);
- command << QItemSelectionModel::ClearAndSelect;
- insertRows << 0 << 1;
- expected << IntPair(1, 0)
- << IntPair(2, 0)
- << IntPair(3, 0)
- << IntPair(4, 0)
- << IntPair(5, 0);
- QTest::newRow("ClearAndSelect (0, 0) to (4, 0). Insert before first row.")
- << index << command
- << insertRows << insertColumns << deleteRows << deleteColumns
- << expected;
-
- index.clear(); expected.clear(); command.clear();
- insertRows.clear(); insertColumns.clear(); deleteRows.clear(); deleteColumns.clear();
- index << IntPair(0, 0)
- << IntPair(4, 0);
- command << QItemSelectionModel::ClearAndSelect;
- deleteRows << 0 << 1;
- expected << IntPair(0, 0)
- << IntPair(1, 0)
- << IntPair(2, 0)
- << IntPair(3, 0);
- QTest::newRow("ClearAndSelect (0, 0) to (4, 0). Delete first row.")
- << index << command
- << insertRows << insertColumns << deleteRows << deleteColumns
- << expected;
-
- index.clear(); expected.clear(); command.clear();
- insertRows.clear(); insertColumns.clear(); deleteRows.clear(); deleteColumns.clear();
- index << IntPair(0, 0)
- << IntPair(4, 0);
- command << QItemSelectionModel::ClearAndSelect;
- deleteRows << 4 << 1;
- expected << IntPair(0, 0)
- << IntPair(1, 0)
- << IntPair(2, 0)
- << IntPair(3, 0);
- QTest::newRow("ClearAndSelect (0, 0) to (4, 0). Delete last row.")
- << index << command
- << insertRows << insertColumns << deleteRows << deleteColumns
- << expected;
-
- index.clear(); expected.clear(); command.clear();
- insertRows.clear(); insertColumns.clear(); deleteRows.clear(); deleteColumns.clear();
- index << IntPair(0, 0)
- << IntPair(4, 0);
- command << QItemSelectionModel::ClearAndSelect;
- deleteRows << 1 << 3;
- expected << IntPair(0, 0)
- << IntPair(1, 0);
- QTest::newRow("ClearAndSelect (0, 0) to (4, 0). Deleting all but first and last row.")
- << index << command
- << insertRows << insertColumns << deleteRows << deleteColumns
- << expected;
-
- index.clear(); expected.clear(); command.clear();
- insertRows.clear(); insertColumns.clear(); deleteRows.clear(); deleteColumns.clear();
- index << IntPair(0, 0)
- << IntPair(4, 0);
- command << QItemSelectionModel::ClearAndSelect;
- insertRows << 1 << 1;
- expected << IntPair(0, 0)
- // the inserted row should not be selected
- << IntPair(2, 0)
- << IntPair(3, 0)
- << IntPair(4, 0)
- << IntPair(5, 0);
- QTest::newRow("ClearAndSelect (0, 0) to (4, 0). Insert after first row.")
- << index << command
- << insertRows << insertColumns << deleteRows << deleteColumns
- << expected;
+ index.clear(); expected.clear(); command.clear();
+ insertRows.clear(); insertColumns.clear(); deleteRows.clear(); deleteColumns.clear();
+ index << IntPair(0, 0);
+ command << QItemSelectionModel::ClearAndSelect;
+ deleteRows << 0 << 1;
+ QTest::newRow("ClearAndSelect (0, 0). Delete first row.")
+ << index << command
+ << insertRows << insertColumns << deleteRows << deleteColumns
+ << expected;
+
+ index.clear(); expected.clear(); command.clear();
+ insertRows.clear(); insertColumns.clear(); deleteRows.clear(); deleteColumns.clear();
+ index << IntPair(1, 0);
+ command << QItemSelectionModel::ClearAndSelect;
+ deleteRows << 0 << 1;
+ expected << IntPair(0, 0);
+ QTest::newRow("ClearAndSelect (1, 0). Delete first row.")
+ << index << command
+ << insertRows << insertColumns << deleteRows << deleteColumns
+ << expected;
+
+ index.clear(); expected.clear(); command.clear();
+ insertRows.clear(); insertColumns.clear(); deleteRows.clear(); deleteColumns.clear();
+ index << IntPair(0, 0);
+ command << QItemSelectionModel::ClearAndSelect;
+ insertRows << 5 << 1;
+ expected << IntPair(0, 0);
+ QTest::newRow("ClearAndSelect (0, 0). Append row.")
+ << index << command
+ << insertRows << insertColumns << deleteRows << deleteColumns
+ << expected;
+
+ index.clear(); expected.clear(); command.clear();
+ insertRows.clear(); insertColumns.clear(); deleteRows.clear(); deleteColumns.clear();
+ index << IntPair(0, 0);
+ command << QItemSelectionModel::ClearAndSelect;
+ insertRows << 0 << 1;
+ expected << IntPair(1, 0);
+ QTest::newRow("ClearAndSelect (0, 0). Insert before first row.")
+ << index << command
+ << insertRows << insertColumns << deleteRows << deleteColumns
+ << expected;
+
+ index.clear(); expected.clear(); command.clear();
+ insertRows.clear(); insertColumns.clear(); deleteRows.clear(); deleteColumns.clear();
+ index << IntPair(0, 0)
+ << IntPair(4, 0);
+ command << QItemSelectionModel::ClearAndSelect;
+ insertRows << 5 << 1;
+ expected << IntPair(0, 0)
+ << IntPair(1, 0)
+ << IntPair(2, 0)
+ << IntPair(3, 0)
+ << IntPair(4, 0);
+ QTest::newRow("ClearAndSelect (0, 0) to (4, 0). Append row.")
+ << index << command
+ << insertRows << insertColumns << deleteRows << deleteColumns
+ << expected;
+
+ index.clear(); expected.clear(); command.clear();
+ insertRows.clear(); insertColumns.clear(); deleteRows.clear(); deleteColumns.clear();
+ index << IntPair(0, 0)
+ << IntPair(4, 0);
+ command << QItemSelectionModel::ClearAndSelect;
+ insertRows << 0 << 1;
+ expected << IntPair(1, 0)
+ << IntPair(2, 0)
+ << IntPair(3, 0)
+ << IntPair(4, 0)
+ << IntPair(5, 0);
+ QTest::newRow("ClearAndSelect (0, 0) to (4, 0). Insert before first row.")
+ << index << command
+ << insertRows << insertColumns << deleteRows << deleteColumns
+ << expected;
+
+ index.clear(); expected.clear(); command.clear();
+ insertRows.clear(); insertColumns.clear(); deleteRows.clear(); deleteColumns.clear();
+ index << IntPair(0, 0)
+ << IntPair(4, 0);
+ command << QItemSelectionModel::ClearAndSelect;
+ deleteRows << 0 << 1;
+ expected << IntPair(0, 0)
+ << IntPair(1, 0)
+ << IntPair(2, 0)
+ << IntPair(3, 0);
+ QTest::newRow("ClearAndSelect (0, 0) to (4, 0). Delete first row.")
+ << index << command
+ << insertRows << insertColumns << deleteRows << deleteColumns
+ << expected;
+
+ index.clear(); expected.clear(); command.clear();
+ insertRows.clear(); insertColumns.clear(); deleteRows.clear(); deleteColumns.clear();
+ index << IntPair(0, 0)
+ << IntPair(4, 0);
+ command << QItemSelectionModel::ClearAndSelect;
+ deleteRows << 4 << 1;
+ expected << IntPair(0, 0)
+ << IntPair(1, 0)
+ << IntPair(2, 0)
+ << IntPair(3, 0);
+ QTest::newRow("ClearAndSelect (0, 0) to (4, 0). Delete last row.")
+ << index << command
+ << insertRows << insertColumns << deleteRows << deleteColumns
+ << expected;
+
+ index.clear(); expected.clear(); command.clear();
+ insertRows.clear(); insertColumns.clear(); deleteRows.clear(); deleteColumns.clear();
+ index << IntPair(0, 0)
+ << IntPair(4, 0);
+ command << QItemSelectionModel::ClearAndSelect;
+ deleteRows << 1 << 3;
+ expected << IntPair(0, 0)
+ << IntPair(1, 0);
+ QTest::newRow("ClearAndSelect (0, 0) to (4, 0). Deleting all but first and last row.")
+ << index << command
+ << insertRows << insertColumns << deleteRows << deleteColumns
+ << expected;
+
+ index.clear(); expected.clear(); command.clear();
+ insertRows.clear(); insertColumns.clear(); deleteRows.clear(); deleteColumns.clear();
+ index << IntPair(0, 0)
+ << IntPair(4, 0);
+ command << QItemSelectionModel::ClearAndSelect;
+ insertRows << 1 << 1;
+ expected << IntPair(0, 0)
+ // the inserted row should not be selected
+ << IntPair(2, 0)
+ << IntPair(3, 0)
+ << IntPair(4, 0)
+ << IntPair(5, 0);
+ QTest::newRow("ClearAndSelect (0, 0) to (4, 0). Insert after first row.")
+ << index << command
+ << insertRows << insertColumns << deleteRows << deleteColumns
+ << expected;
}
void tst_QItemSelectionModel::persistentselections()
@@ -1550,6 +1533,7 @@ void tst_QItemSelectionModel::resetModel()
view.setModel(&model);
QSignalSpy spy(view.selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)));
+ QVERIFY(spy.isValid());
view.selectionModel()->select(QItemSelection(model.index(0, 0), model.index(5, 5)), QItemSelectionModel::Select);
@@ -1612,6 +1596,7 @@ void tst_QItemSelectionModel::removeRows()
MyStandardItemModel model(rowCount, columnCount);
QItemSelectionModel selections(&model);
QSignalSpy spy(&selections, SIGNAL(selectionChanged(QItemSelection,QItemSelection)));
+ QVERIFY(spy.isValid());
QModelIndex tl = model.index(selectTop, selectLeft);
QModelIndex br = model.index(selectBottom, selectRight);
@@ -1674,6 +1659,7 @@ void tst_QItemSelectionModel::removeColumns()
MyStandardItemModel model(rowCount, columnCount);
QItemSelectionModel selections(&model);
QSignalSpy spy(&selections, SIGNAL(selectionChanged(QItemSelection,QItemSelection)));
+ QVERIFY(spy.isValid());
QModelIndex tl = model.index(selectTop, selectLeft);
QModelIndex br = model.index(selectBottom, selectRight);
@@ -1786,7 +1772,7 @@ void tst_QItemSelectionModel::modelLayoutChanged()
// verify that selection is as expected
QItemSelection selection = selectionModel.selection();
QCOMPARE(selection.count(), expectedSelectedRanges.count());
- QVERIFY(selectionModel.hasSelection() == !expectedSelectedRanges.isEmpty());
+ QVERIFY(selectionModel.hasSelection() == !expectedSelectedRanges.isEmpty());
for (int i = 0; i < expectedSelectedRanges.count(); ++i) {
IntPairPair expectedRange = expectedSelectedRanges.at(i);
@@ -1943,6 +1929,10 @@ void tst_QItemSelectionModel::setCurrentIndex()
QSignalSpy columnSpy(selectionModel,
SIGNAL(currentColumnChanged(QModelIndex,QModelIndex)));
+ QVERIFY(currentSpy.isValid());
+ QVERIFY(rowSpy.isValid());
+ QVERIFY(columnSpy.isValid());
+
// Select the same row and column indexes, but with a different parent
selectionModel->setCurrentIndex(
treemodel->index(0, 0, treemodel->index(1, 0)),
@@ -1974,7 +1964,7 @@ void tst_QItemSelectionModel::splitOnInsert()
QVERIFY(!selectionModel.isSelected(model.index(1, 0)));
}
-void tst_QItemSelectionModel::task196285_rowIntersectsSelection()
+void tst_QItemSelectionModel::rowIntersectsSelection1()
{
QTableWidget table;
table.setColumnCount(1);
@@ -2001,6 +1991,52 @@ void tst_QItemSelectionModel::task196285_rowIntersectsSelection()
QVERIFY(!selectionModel->columnIntersectsSelection(0, QModelIndex()));
}
+void tst_QItemSelectionModel::rowIntersectsSelection2()
+{
+ QStandardItemModel m;
+ for (int i=0; i<8; ++i) {
+ for (int j=0; j<8; ++j) {
+ QStandardItem *item = new QStandardItem(QString("Item number %1").arg(i));
+ if ((i % 2 == 0 && j == 0) ||
+ (j % 2 == 0 && i == 0) ||
+ j == 5 || i == 5 ) {
+ item->setEnabled(false);
+ //item->setSelectable(false);
+ }
+ m.setItem(i, j, item);
+ }
+ }
+
+ QItemSelectionModel selected(&m);
+ //nothing is selected
+ QVERIFY(!selected.rowIntersectsSelection(0, QModelIndex()));
+ QVERIFY(!selected.rowIntersectsSelection(2, QModelIndex()));
+ QVERIFY(!selected.rowIntersectsSelection(3, QModelIndex()));
+ QVERIFY(!selected.rowIntersectsSelection(5, QModelIndex()));
+ QVERIFY(!selected.columnIntersectsSelection(0, QModelIndex()));
+ QVERIFY(!selected.columnIntersectsSelection(2, QModelIndex()));
+ QVERIFY(!selected.columnIntersectsSelection(3, QModelIndex()));
+ QVERIFY(!selected.columnIntersectsSelection(5, QModelIndex()));
+ selected.select(m.index(2, 0), QItemSelectionModel::Select | QItemSelectionModel::Rows);
+ QVERIFY(!selected.rowIntersectsSelection(0, QModelIndex()));
+ QVERIFY( selected.rowIntersectsSelection(2, QModelIndex()));
+ QVERIFY(!selected.rowIntersectsSelection(3, QModelIndex()));
+ QVERIFY(!selected.rowIntersectsSelection(5, QModelIndex()));
+ QVERIFY(!selected.columnIntersectsSelection(0, QModelIndex()));
+ QVERIFY( selected.columnIntersectsSelection(2, QModelIndex()));
+ QVERIFY( selected.columnIntersectsSelection(3, QModelIndex()));
+ QVERIFY(!selected.columnIntersectsSelection(5, QModelIndex()));
+ selected.select(m.index(0, 5), QItemSelectionModel::Select | QItemSelectionModel::Columns);
+ QVERIFY(!selected.rowIntersectsSelection(0, QModelIndex()));
+ QVERIFY( selected.rowIntersectsSelection(2, QModelIndex()));
+ QVERIFY(!selected.rowIntersectsSelection(3, QModelIndex()));
+ QVERIFY(!selected.rowIntersectsSelection(5, QModelIndex()));
+ QVERIFY(!selected.columnIntersectsSelection(0, QModelIndex()));
+ QVERIFY( selected.columnIntersectsSelection(2, QModelIndex()));
+ QVERIFY( selected.columnIntersectsSelection(3, QModelIndex()));
+ QVERIFY(!selected.columnIntersectsSelection(5, QModelIndex()));
+}
+
void tst_QItemSelectionModel::unselectable()
{
QTreeWidget w;
@@ -2015,7 +2051,7 @@ void tst_QItemSelectionModel::unselectable()
QCOMPARE(w.selectionModel()->selectedRows().count(), 0);
}
-void tst_QItemSelectionModel::task220420_selectedIndexes()
+void tst_QItemSelectionModel::selectedIndexes()
{
QStandardItemModel model(2, 2);
QItemSelectionModel selectionModel(&model);
@@ -2034,31 +2070,32 @@ void tst_QItemSelectionModel::task220420_selectedIndexes()
class QtTestTableModel: public QAbstractTableModel
{
Q_OBJECT
+public:
+ QtTestTableModel(int rows = 0, int columns = 0, QObject *parent = 0)
+ : QAbstractTableModel(parent)
+ , row_count(rows)
+ , column_count(columns)
+ {
+ }
- public:
- QtTestTableModel(int rows = 0, int columns = 0, QObject *parent = 0)
- : QAbstractTableModel(parent),
- row_count(rows),
- column_count(columns) {}
-
- int rowCount(const QModelIndex& = QModelIndex()) const { return row_count; }
- int columnCount(const QModelIndex& = QModelIndex()) const { return column_count; }
- bool isEditable(const QModelIndex &) const { return true; }
+ int rowCount(const QModelIndex& = QModelIndex()) const { return row_count; }
+ int columnCount(const QModelIndex& = QModelIndex()) const { return column_count; }
+ bool isEditable(const QModelIndex &) const { return true; }
- QVariant data(const QModelIndex &idx, int role) const
- {
- if (role == Qt::DisplayRole || role == Qt::EditRole)
- return QString("[%1,%2]").arg(idx.row()).arg(idx.column());
- return QVariant();
- }
+ QVariant data(const QModelIndex &idx, int role) const
+ {
+ if (role == Qt::DisplayRole || role == Qt::EditRole)
+ return QString("[%1,%2]").arg(idx.row()).arg(idx.column());
+ return QVariant();
+ }
- int row_count;
- int column_count;
- friend class tst_QItemSelectionModel;
+ int row_count;
+ int column_count;
+ friend class tst_QItemSelectionModel;
};
-void tst_QItemSelectionModel::task240734_layoutChanged()
+void tst_QItemSelectionModel::layoutChanged()
{
QtTestTableModel model(1,1);
QItemSelectionModel selectionModel(&model);
@@ -2126,7 +2163,6 @@ void tst_QItemSelectionModel::merge_data()
<< r1;
}
-
void tst_QItemSelectionModel::merge()
{
QFETCH(QItemSelection, init);
@@ -2142,7 +2178,7 @@ void tst_QItemSelectionModel::merge()
QVERIFY(init.contains(idx));
}
-void tst_QItemSelectionModel::task119433_isRowSelected()
+void tst_QItemSelectionModel::isRowSelected()
{
QStandardItemModel model(2,2);
model.setData(model.index(0,0), 0, Qt::UserRole - 1);
@@ -2152,53 +2188,7 @@ void tst_QItemSelectionModel::task119433_isRowSelected()
QVERIFY(sel.isRowSelected(0, QModelIndex()));
}
-void tst_QItemSelectionModel::task252069_rowIntersectsSelection()
-{
- QStandardItemModel m;
- for (int i=0; i<8; ++i) {
- for (int j=0; j<8; ++j) {
- QStandardItem *item = new QStandardItem(QString("Item number %1").arg(i));
- if ((i % 2 == 0 && j == 0) ||
- (j % 2 == 0 && i == 0) ||
- j == 5 || i == 5 ) {
- item->setEnabled(false);
- //item->setSelectable(false);
- }
- m.setItem(i, j, item);
- }
- }
-
- QItemSelectionModel selected(&m);
- //nothing is selected
- QVERIFY(!selected.rowIntersectsSelection(0, QModelIndex()));
- QVERIFY(!selected.rowIntersectsSelection(2, QModelIndex()));
- QVERIFY(!selected.rowIntersectsSelection(3, QModelIndex()));
- QVERIFY(!selected.rowIntersectsSelection(5, QModelIndex()));
- QVERIFY(!selected.columnIntersectsSelection(0, QModelIndex()));
- QVERIFY(!selected.columnIntersectsSelection(2, QModelIndex()));
- QVERIFY(!selected.columnIntersectsSelection(3, QModelIndex()));
- QVERIFY(!selected.columnIntersectsSelection(5, QModelIndex()));
- selected.select(m.index(2, 0), QItemSelectionModel::Select | QItemSelectionModel::Rows);
- QVERIFY(!selected.rowIntersectsSelection(0, QModelIndex()));
- QVERIFY( selected.rowIntersectsSelection(2, QModelIndex()));
- QVERIFY(!selected.rowIntersectsSelection(3, QModelIndex()));
- QVERIFY(!selected.rowIntersectsSelection(5, QModelIndex()));
- QVERIFY(!selected.columnIntersectsSelection(0, QModelIndex()));
- QVERIFY( selected.columnIntersectsSelection(2, QModelIndex()));
- QVERIFY( selected.columnIntersectsSelection(3, QModelIndex()));
- QVERIFY(!selected.columnIntersectsSelection(5, QModelIndex()));
- selected.select(m.index(0, 5), QItemSelectionModel::Select | QItemSelectionModel::Columns);
- QVERIFY(!selected.rowIntersectsSelection(0, QModelIndex()));
- QVERIFY( selected.rowIntersectsSelection(2, QModelIndex()));
- QVERIFY(!selected.rowIntersectsSelection(3, QModelIndex()));
- QVERIFY(!selected.rowIntersectsSelection(5, QModelIndex()));
- QVERIFY(!selected.columnIntersectsSelection(0, QModelIndex()));
- QVERIFY( selected.columnIntersectsSelection(2, QModelIndex()));
- QVERIFY( selected.columnIntersectsSelection(3, QModelIndex()));
- QVERIFY(!selected.columnIntersectsSelection(5, QModelIndex()));
-}
-
-void tst_QItemSelectionModel::task232634_childrenDeselectionSignal()
+void tst_QItemSelectionModel::childrenDeselectionSignal()
{
QStandardItemModel model;
@@ -2217,6 +2207,7 @@ void tst_QItemSelectionModel::task232634_childrenDeselectionSignal()
selectionModel.select(sel, QItemSelectionModel::SelectCurrent);
QSignalSpy deselectSpy(&selectionModel, SIGNAL(selectionChanged(const QItemSelection& , const QItemSelection&)));
+ QVERIFY(deselectSpy.isValid());
model.removeRows(0, 1, root);
QVERIFY(deselectSpy.count() == 1);
@@ -2251,7 +2242,7 @@ void tst_QItemSelectionModel::task232634_childrenDeselectionSignal()
QVERIFY(selectionModel.selection().contains(sel2));
}
-void tst_QItemSelectionModel::task260134_layoutChangedWithAllSelected()
+void tst_QItemSelectionModel::layoutChangedWithAllSelected1()
{
QStringListModel model( QStringList() << "foo" << "bar" << "foo2");
QSortFilterProxyModel proxy;
@@ -2282,8 +2273,9 @@ void tst_QItemSelectionModel::task260134_layoutChangedWithAllSelected()
QVERIFY(selection.isSelected(index));
}
-
-void tst_QItemSelectionModel::QTBUG5671_layoutChangedWithAllSelected()
+// Same as layoutChangedWithAllSelected1, but with a slightly bigger model.
+// This test is a regression test for QTBUG-5671.
+void tst_QItemSelectionModel::layoutChangedWithAllSelected2()
{
struct MyFilterModel : public QSortFilterProxyModel
{ // Override sort filter proxy to remove even numbered rows.
@@ -2294,8 +2286,6 @@ void tst_QItemSelectionModel::QTBUG5671_layoutChangedWithAllSelected()
}
};
- //same as task260134_layoutChangedWithAllSelected but with a sightly bigger model
-
enum { cNumRows=30, cNumCols=20 };
QStandardItemModel model(cNumRows, cNumCols);
@@ -2315,7 +2305,6 @@ void tst_QItemSelectionModel::QTBUG5671_layoutChangedWithAllSelected()
}
}
-
QCOMPARE(model.rowCount(), int(cNumRows));
QCOMPARE(proxy.rowCount(), int(cNumRows/2));
@@ -2335,7 +2324,8 @@ void tst_QItemSelectionModel::QTBUG5671_layoutChangedWithAllSelected()
QVERIFY(selection.isSelected(index));
}
-void tst_QItemSelectionModel::QTBUG2804_layoutChangedTreeSelection()
+// This test is a regression test for QTBUG-2804.
+void tst_QItemSelectionModel::layoutChangedTreeSelection()
{
QStandardItemModel model;
QStandardItem top1("Child1"), top2("Child2"), top3("Child3");
@@ -2379,7 +2369,6 @@ public slots:
}
QVERIFY(m_itemSelectionModel->selection().size() == 2);
}
-
};
void tst_QItemSelectionModel::deselectRemovedMiddleRange()
@@ -2401,6 +2390,7 @@ void tst_QItemSelectionModel::deselectRemovedMiddleRange()
RemovalObserver ro(&selModel);
QSignalSpy spy(&selModel, SIGNAL(selectionChanged(QItemSelection, QItemSelection)));
+ QVERIFY(spy.isValid());
bool ok = model.removeRows(4, 2);
QVERIFY(ok);
@@ -2431,9 +2421,9 @@ static QStandardItemModel* getModel(QObject *parent)
}
enum Result {
- LessThan,
- NotLessThan,
- NotEqual
+ LessThan,
+ NotLessThan,
+ NotEqual
};
Q_DECLARE_METATYPE(Result);
@@ -2499,70 +2489,70 @@ void tst_QItemSelectionModel::rangeOperatorLessThan_data()
void tst_QItemSelectionModel::rangeOperatorLessThan()
{
- QStandardItemModel *model1 = getModel(this);
- QStandardItemModel *model2 = getModel(this);
+ QStandardItemModel *model1 = getModel(this);
+ QStandardItemModel *model2 = getModel(this);
- QFETCH(int, parent1);
- QFETCH(int, top1);
- QFETCH(int, left1);
- QFETCH(int, bottom1);
- QFETCH(int, right1);
- QFETCH(int, parent2);
- QFETCH(int, top2);
- QFETCH(int, left2);
- QFETCH(int, bottom2);
- QFETCH(int, right2);
- QFETCH(Result, result);
+ QFETCH(int, parent1);
+ QFETCH(int, top1);
+ QFETCH(int, left1);
+ QFETCH(int, bottom1);
+ QFETCH(int, right1);
+ QFETCH(int, parent2);
+ QFETCH(int, top2);
+ QFETCH(int, left2);
+ QFETCH(int, bottom2);
+ QFETCH(int, right2);
+ QFETCH(Result, result);
- QModelIndex p1 = model1->index(parent1, 0);
+ QModelIndex p1 = model1->index(parent1, 0);
- QModelIndex tl1 = model1->index(top1, left1, p1);
- QModelIndex br1 = model1->index(bottom1, right1, p1);
+ QModelIndex tl1 = model1->index(top1, left1, p1);
+ QModelIndex br1 = model1->index(bottom1, right1, p1);
- QItemSelectionRange r1(tl1, br1);
+ QItemSelectionRange r1(tl1, br1);
- QModelIndex p2 = model1->index(parent2, 0);
+ QModelIndex p2 = model1->index(parent2, 0);
- QModelIndex tl2 = model1->index(top2, left2, p2);
- QModelIndex br2 = model1->index(bottom2, right2, p2);
+ QModelIndex tl2 = model1->index(top2, left2, p2);
+ QModelIndex br2 = model1->index(bottom2, right2, p2);
- QItemSelectionRange r2(tl2, br2);
+ QItemSelectionRange r2(tl2, br2);
- if (result == LessThan)
- QVERIFY(r1 < r2);
- else if (result == NotLessThan)
- QVERIFY(!(r1 < r2));
- else if (result == NotEqual)
- if (!(r1 < r2))
- QVERIFY(r2 < r1);
+ if (result == LessThan)
+ QVERIFY(r1 < r2);
+ else if (result == NotLessThan)
+ QVERIFY(!(r1 < r2));
+ else if (result == NotEqual)
+ if (!(r1 < r2))
+ QVERIFY(r2 < r1);
- // Ranges in different models are always non-equal
+ // Ranges in different models are always non-equal
- QModelIndex p3 = model2->index(parent1, 0);
+ QModelIndex p3 = model2->index(parent1, 0);
- QModelIndex tl3 = model2->index(top1, left1, p3);
- QModelIndex br3 = model2->index(bottom1, right1, p3);
+ QModelIndex tl3 = model2->index(top1, left1, p3);
+ QModelIndex br3 = model2->index(bottom1, right1, p3);
- QItemSelectionRange r3(tl3, br3);
+ QItemSelectionRange r3(tl3, br3);
- if (!(r1 < r3))
- QVERIFY(r3 < r1);
+ if (!(r1 < r3))
+ QVERIFY(r3 < r1);
- if (!(r2 < r3))
- QVERIFY(r3 < r2);
+ if (!(r2 < r3))
+ QVERIFY(r3 < r2);
- QModelIndex p4 = model2->index(parent2, 0);
+ QModelIndex p4 = model2->index(parent2, 0);
- QModelIndex tl4 = model2->index(top2, left2, p4);
- QModelIndex br4 = model2->index(bottom2, right2, p4);
+ QModelIndex tl4 = model2->index(top2, left2, p4);
+ QModelIndex br4 = model2->index(bottom2, right2, p4);
- QItemSelectionRange r4(tl4, br4);
+ QItemSelectionRange r4(tl4, br4);
- if (!(r1 < r4))
- QVERIFY(r4 < r1);
+ if (!(r1 < r4))
+ QVERIFY(r4 < r1);
- if (!(r2 < r4))
- QVERIFY(r4 < r2);
+ if (!(r2 < r4))
+ QVERIFY(r4 < r2);
}
void tst_QItemSelectionModel::testDifferentModels()
@@ -2575,7 +2565,6 @@ void tst_QItemSelectionModel::testDifferentModels()
model1.appendColumn(QList<QStandardItem*>() << &top11 << &top12 << &top13);
model2.appendColumn(QList<QStandardItem*>() << &top21 << &top22 << &top23);
-
QModelIndex topIndex1 = model1.index(0, 0);
QModelIndex bottomIndex1 = model1.index(2, 0);
QModelIndex topIndex2 = model2.index(0, 0);
@@ -2593,10 +2582,10 @@ void tst_QItemSelectionModel::testDifferentModels()
class SelectionObserver : public QObject
{
- Q_OBJECT
+ Q_OBJECT
public:
SelectionObserver(QAbstractItemModel *model, QObject *parent = 0)
- : QObject(parent), m_model(model), m_selectionModel(0)
+ : QObject(parent), m_model(model), m_selectionModel(0)
{
connect(model, SIGNAL(modelReset()), SLOT(modelReset()));
}
@@ -2607,7 +2596,7 @@ public:
connect(m_selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(selectionChanged(QItemSelection,QItemSelection)));
}
- private slots:
+private slots:
void modelReset()
{
const QModelIndex idx = m_model->index(2, 0);
@@ -2657,37 +2646,35 @@ void tst_QItemSelectionModel::testValidRangesInSelectionsAfterReset()
class DuplicateItemSelectionModel : public QItemSelectionModel
{
- Q_OBJECT
+ Q_OBJECT
public:
- DuplicateItemSelectionModel(QItemSelectionModel *target, QAbstractItemModel *model, QObject *parent = 0)
- : QItemSelectionModel(model, parent), m_target(target)
- {
-
- }
+ DuplicateItemSelectionModel(QItemSelectionModel *target, QAbstractItemModel *model, QObject *parent = 0)
+ : QItemSelectionModel(model, parent), m_target(target)
+ {
+ }
- void select(const QItemSelection &selection, QItemSelectionModel::SelectionFlags command)
- {
- QItemSelectionModel::select(selection, command);
- m_target->select(selection, command);
- }
+ void select(const QItemSelection &selection, QItemSelectionModel::SelectionFlags command)
+ {
+ QItemSelectionModel::select(selection, command);
+ m_target->select(selection, command);
+ }
- using QItemSelectionModel::select;
+ using QItemSelectionModel::select;
- void setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
- {
- QItemSelectionModel::setCurrentIndex(index, command);
- m_target->setCurrentIndex(index, command);
- }
+ void setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
+ {
+ QItemSelectionModel::setCurrentIndex(index, command);
+ m_target->setCurrentIndex(index, command);
+ }
- void clearCurrentIndex()
- {
- QItemSelectionModel::clearCurrentIndex();
- m_target->clearCurrentIndex();
- }
+ void clearCurrentIndex()
+ {
+ QItemSelectionModel::clearCurrentIndex();
+ m_target->clearCurrentIndex();
+ }
private:
- QItemSelectionModel *m_target;
-
+ QItemSelectionModel *m_target;
};
void tst_QItemSelectionModel::testChainedSelectionClear()
@@ -2735,6 +2722,7 @@ void tst_QItemSelectionModel::testClearCurrentIndex()
QItemSelectionModel selectionModel(&model, 0);
QSignalSpy currentIndexSpy(&selectionModel, SIGNAL(currentChanged(QModelIndex,QModelIndex)));
+ QVERIFY(currentIndexSpy.isValid());
QModelIndex firstIndex = model.index(0, 0);
QVERIFY(firstIndex.isValid());
diff --git a/tests/auto/widgets/itemviews/qsortfilterproxymodel/.gitignore b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/.gitignore
index d3672fe4ae..d3672fe4ae 100644
--- a/tests/auto/widgets/itemviews/qsortfilterproxymodel/.gitignore
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/.gitignore
diff --git a/tests/auto/widgets/itemviews/qsortfilterproxymodel/qsortfilterproxymodel.pro b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/qsortfilterproxymodel.pro
index d6e949f73d..d6e949f73d 100644
--- a/tests/auto/widgets/itemviews/qsortfilterproxymodel/qsortfilterproxymodel.pro
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/qsortfilterproxymodel.pro
diff --git a/tests/auto/widgets/itemviews/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
index cc8299e28f..559a806ef3 100644
--- a/tests/auto/widgets/itemviews/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -39,14 +39,14 @@
**
****************************************************************************/
-
#include <QtTest/QtTest>
#include "dynamictreemodel.h"
#include "modeltest.h"
-#include <QtCore>
-#include <QtGui>
-#include <QtWidgets>
+#include <QtCore/QCoreApplication>
+#include <QtWidgets/QStandardItem>
+#include <QtWidgets/QTreeView>
+#include <QtWidgets/QTableView>
#include <qdebug.h>
@@ -62,16 +62,12 @@ Q_DECLARE_METATYPE(QModelIndex)
class tst_QSortFilterProxyModel : public QObject
{
Q_OBJECT
-
public:
-
tst_QSortFilterProxyModel();
- virtual ~tst_QSortFilterProxyModel();
public slots:
void initTestCase();
void cleanupTestCase();
- void init();
void cleanup();
private slots:
@@ -84,8 +80,6 @@ private slots:
void insertRows_data();
void insertRows();
void prependRow();
-// void insertColumns_data();
-// void insertColumns();
void removeRows_data();
void removeRows();
void removeColumns_data();
@@ -128,20 +122,20 @@ private slots:
void sortStable();
- void task236755_hiddenColumns();
- void task247867_insertRowsSort();
- void task248868_staticSorting();
- void task248868_dynamicSorting();
- void task250023_fetchMore();
- void task251296_hiddenChildren();
- void task252507_mapFromToSource();
- void task255652_removeRowsRecursive();
- void taskQTBUG_6205_doubleProxySelectionSetSourceModel();
- void taskQTBUG_7537_appearsAndSort();
- void taskQTBUG_7716_unnecessaryDynamicSorting();
- void taskQTBUG_10287_unnecessaryMapCreation();
- void taskQTBUG_17812_resetInvalidate_data();
- void taskQTBUG_17812_resetInvalidate();
+ void hiddenColumns();
+ void insertRowsSort();
+ void staticSorting();
+ void dynamicSorting();
+ void fetchMore();
+ void hiddenChildren();
+ void mapFromToSource();
+ void removeRowsRecursive();
+ void doubleProxySelectionSetSourceModel();
+ void appearsAndSort();
+ void unnecessaryDynamicSorting();
+ void unnecessaryMapCreation();
+ void resetInvalidate_data();
+ void resetInvalidate();
void testMultipleProxiesWithSelection();
void mapSelectionFromSource();
@@ -177,12 +171,6 @@ void tst_QSortFilterProxyModel::getSetCheck()
tst_QSortFilterProxyModel::tst_QSortFilterProxyModel()
: m_model(0), m_proxy(0)
{
-
-}
-
-tst_QSortFilterProxyModel::~tst_QSortFilterProxyModel()
-{
-
}
void tst_QSortFilterProxyModel::initTestCase()
@@ -202,10 +190,6 @@ void tst_QSortFilterProxyModel::cleanupTestCase()
delete m_model;
}
-void tst_QSortFilterProxyModel::init()
-{
-}
-
void tst_QSortFilterProxyModel::cleanup()
{
m_proxy->setFilterRegExp(QRegExp());
@@ -350,7 +334,6 @@ void tst_QSortFilterProxyModel::sort_data()
<< (QStringList()
<< "BETA" << "Gamma" << "alpha" << "delta");
-
QStringList list;
for (int i = 10000; i < 20000; ++i)
list.append(QString("Number: %1").arg(i));
@@ -405,7 +388,6 @@ void tst_QSortFilterProxyModel::sort()
QModelIndex index = m_proxy->index(row, 0, QModelIndex());
QCOMPARE(m_proxy->data(index, Qt::DisplayRole).toString(), initial.at(row));
}
-
}
void tst_QSortFilterProxyModel::sortHierarchy_data()
@@ -593,7 +575,7 @@ void tst_QSortFilterProxyModel::insertRows()
for (int i = 0; i < insert.count(); ++i) {
QModelIndex index = m_proxy->index(position + i, 0, QModelIndex());
m_proxy->setData(index, insert.at(i), Qt::DisplayRole);
- }
+ }
// make sure the model correct after insert
for (int row = 0; row < m_model->rowCount(QModelIndex()); ++row) {
@@ -612,7 +594,7 @@ void tst_QSortFilterProxyModel::prependRow()
{
//this tests that data is correctly handled by the sort filter when prepending a row
QStandardItemModel model;
- QSortFilterProxyModel proxy;
+ QSortFilterProxyModel proxy;
proxy.setSourceModel(&model);
QStandardItem item("root");
@@ -634,19 +616,6 @@ void tst_QSortFilterProxyModel::prependRow()
QCOMPARE(proxy.rowCount(QModelIndex()), 1); //only the "root" item is there
}
-
-/*
-void tst_QSortFilterProxyModel::insertColumns_data()
-{
-
-}
-
-void tst_QSortFilterProxyModel::insertColumns()
-{
-
-}
-*/
-
void tst_QSortFilterProxyModel::removeRows_data()
{
QTest::addColumn<QStringList>("initial");
@@ -1197,7 +1166,6 @@ void tst_QSortFilterProxyModel::removeColumns()
}
}
-
void tst_QSortFilterProxyModel::filterColumns_data()
{
QTest::addColumn<QString>("pattern");
@@ -1424,8 +1392,6 @@ void tst_QSortFilterProxyModel::checkHierarchy(const QStringList &l, const QAbst
}
}
-
-
class TestModel: public QAbstractTableModel
{
public:
@@ -1504,6 +1470,7 @@ void tst_QSortFilterProxyModel::filterCurrent()
view.show();
view.setModel(&proxy);
QSignalSpy spy(view.selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)));
+ QVERIFY(spy.isValid());
view.setCurrentIndex(proxy.index(0, 0));
QCOMPARE(spy.count(), 1);
@@ -1628,6 +1595,11 @@ void tst_QSortFilterProxyModel::removeSourceRows()
QSignalSpy aboutToRemoveSpy(&proxy, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)));
QSignalSpy aboutToInsertSpy(&proxy, SIGNAL(rowsAboutToBeInserted(QModelIndex, int, int)));
+ QVERIFY(removeSpy.isValid());
+ QVERIFY(insertSpy.isValid());
+ QVERIFY(aboutToRemoveSpy.isValid());
+ QVERIFY(aboutToInsertSpy.isValid());
+
model.removeRows(start, count, QModelIndex());
QCOMPARE(aboutToRemoveSpy.count(), expectedRemovedProxyIntervals.count());
@@ -1802,6 +1774,9 @@ void tst_QSortFilterProxyModel::changeFilter()
QSignalSpy initialRemoveSpy(&proxy, SIGNAL(rowsRemoved(QModelIndex, int, int)));
QSignalSpy initialInsertSpy(&proxy, SIGNAL(rowsInserted(QModelIndex, int, int)));
+ QVERIFY(initialRemoveSpy.isValid());
+ QVERIFY(initialInsertSpy.isValid());
+
proxy.setFilterRegExp(initialFilter);
QCOMPARE(initialRemoveSpy.count(), initialRemoveIntervals.count());
@@ -1823,6 +1798,9 @@ void tst_QSortFilterProxyModel::changeFilter()
QSignalSpy finalRemoveSpy(&proxy, SIGNAL(rowsRemoved(QModelIndex, int, int)));
QSignalSpy finalInsertSpy(&proxy, SIGNAL(rowsInserted(QModelIndex, int, int)));
+ QVERIFY(finalRemoveSpy.isValid());
+ QVERIFY(finalInsertSpy.isValid());
+
proxy.setFilterRegExp(finalFilter);
QCOMPARE(finalRemoveSpy.count(), finalRemoveIntervals.count());
@@ -1971,6 +1949,9 @@ void tst_QSortFilterProxyModel::changeSourceData()
QSignalSpy removeSpy(&proxy, SIGNAL(rowsRemoved(QModelIndex, int, int)));
QSignalSpy insertSpy(&proxy, SIGNAL(rowsInserted(QModelIndex, int, int)));
+ QVERIFY(removeSpy.isValid());
+ QVERIFY(insertSpy.isValid());
+
{
QModelIndex index = model.index(row, 0, QModelIndex());
model.setData(index, newValue, Qt::DisplayRole);
@@ -2065,6 +2046,7 @@ void tst_QSortFilterProxyModel::selectionFilteredOut()
view.show();
view.setModel(&proxy);
QSignalSpy spy(view.selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)));
+ QVERIFY(spy.isValid());
view.setCurrentIndex(proxy.index(0, 0));
QCOMPARE(spy.count(), 1);
@@ -2181,6 +2163,9 @@ void tst_QSortFilterProxyModel::insertIntoChildrenlessItem()
QSignalSpy colsInsertedSpy(&proxy, SIGNAL(columnsInserted(const QModelIndex&, int, int)));
QSignalSpy rowsInsertedSpy(&proxy, SIGNAL(rowsInserted(const QModelIndex&, int, int)));
+ QVERIFY(colsInsertedSpy.isValid());
+ QVERIFY(rowsInsertedSpy.isValid());
+
(void)proxy.rowCount(QModelIndex()); // force mapping of "a", "b", "c"
QCOMPARE(colsInsertedSpy.count(), 0);
QCOMPARE(rowsInsertedSpy.count(), 0);
@@ -2256,6 +2241,7 @@ void tst_QSortFilterProxyModel::insertRowIntoFilteredParent()
proxy.setSourceModel(&model);
QSignalSpy spy(&proxy, SIGNAL(rowsInserted(const QModelIndex&, int, int)));
+ QVERIFY(spy.isValid());
QStandardItem *itemA = new QStandardItem();
model.appendRow(itemA); // A will be filtered
@@ -2286,6 +2272,9 @@ void tst_QSortFilterProxyModel::filterOutParentAndFilterInChild()
QSignalSpy removedSpy(&proxy, SIGNAL(rowsRemoved(const QModelIndex&, int, int)));
QSignalSpy insertedSpy(&proxy, SIGNAL(rowsInserted(const QModelIndex&, int, int)));
+ QVERIFY(removedSpy.isValid());
+ QVERIFY(insertedSpy.isValid());
+
proxy.setFilterRegExp("C"); // A and B will be filtered out, C filtered in
// we should now have been notified that the subtree represented by itemA has been removed
@@ -2323,7 +2312,6 @@ void tst_QSortFilterProxyModel::sourceInsertRows()
void tst_QSortFilterProxyModel::sourceModelDeletion()
{
-
QSortFilterProxyModel proxyModel;
{
QStandardItemModel model;
@@ -2331,7 +2319,6 @@ void tst_QSortFilterProxyModel::sourceModelDeletion()
QCOMPARE(proxyModel.sourceModel(), static_cast<QAbstractItemModel*>(&model));
}
QCOMPARE(proxyModel.sourceModel(), static_cast<QAbstractItemModel*>(0));
-
}
void tst_QSortFilterProxyModel::sortColumnTracking1()
@@ -2393,11 +2380,11 @@ void tst_QSortFilterProxyModel::sortColumnTracking2()
void tst_QSortFilterProxyModel::sortStable()
{
QStandardItemModel* model = new QStandardItemModel(5, 2);
- for (int r=0; r<5; r++) {
- for (int c=0; c<2; c++) {
+ for (int r = 0; r < 5; r++) {
+ for (int c = 0; c < 2; c++) {
QStandardItem* item = new QStandardItem(
QString("Row:%0, Column:%1").arg(r).arg(c) );
- for( int i=0; i<3; i++ ) {
+ for (int i = 0; i < 3; i++) {
QStandardItem* child = new QStandardItem(
QString("Item %0").arg(i) );
item->appendRow( child );
@@ -2406,8 +2393,7 @@ void tst_QSortFilterProxyModel::sortStable()
}
}
model->setHorizontalHeaderItem( 0, new QStandardItem( "Name" ));
- model->setHorizontalHeaderItem( 1, new QStandardItem( "Value" ) );
-
+ model->setHorizontalHeaderItem( 1, new QStandardItem( "Value" ));
QSortFilterProxyModel *filterModel = new QSortFilterProxyModel(model);
filterModel->setSourceModel(model);
@@ -2424,7 +2410,7 @@ void tst_QSortFilterProxyModel::sortStable()
QCOMPARE(lastItemData, filterModel->index(2,0, firstRoot).data());
}
-void tst_QSortFilterProxyModel::task236755_hiddenColumns()
+void tst_QSortFilterProxyModel::hiddenColumns()
{
class MyStandardItemModel : public QStandardItemModel
{
@@ -2448,12 +2434,12 @@ void tst_QSortFilterProxyModel::task236755_hiddenColumns()
model.blockSignals(false);
model.reset();
- //in the initial task this would be false because resetting
- //model would also reset the hidden columns
+ // In the initial bug report that spawned this test, this would be false
+ // because resetting model would also reset the hidden columns.
QVERIFY(view.isColumnHidden(0));
}
-void tst_QSortFilterProxyModel::task247867_insertRowsSort()
+void tst_QSortFilterProxyModel::insertRowsSort()
{
QStandardItemModel model(2,2);
QSortFilterProxyModel proxyModel;
@@ -2469,7 +2455,7 @@ void tst_QSortFilterProxyModel::task247867_insertRowsSort()
QCOMPARE(proxyModel.sortColumn(), 0);
}
-void tst_QSortFilterProxyModel::task248868_staticSorting()
+void tst_QSortFilterProxyModel::staticSorting()
{
QStandardItemModel model(0, 1);
QSortFilterProxyModel proxy;
@@ -2525,15 +2511,15 @@ void tst_QSortFilterProxyModel::task248868_staticSorting()
QModelIndex index = proxy.index(row, 0, QModelIndex());
QCOMPARE(proxy.data(index, Qt::DisplayRole).toString(), expected.at(row));
}
-
}
-void tst_QSortFilterProxyModel::task248868_dynamicSorting()
+void tst_QSortFilterProxyModel::dynamicSorting()
{
QStringListModel model1;
const QStringList initial = QString("bateau avion dragon hirondelle flamme camion elephant").split(" ");
model1.setStringList(initial);
QSortFilterProxyModel proxy1;
+ proxy1.setDynamicSortFilter(false);
proxy1.sort(0);
proxy1.setSourceModel(&model1);
@@ -2579,7 +2565,6 @@ void tst_QSortFilterProxyModel::task248868_dynamicSorting()
//set up the sorting before seting the model up
QSortFilterProxyModel proxy2;
- proxy2.setDynamicSortFilter(true);
proxy2.sort(0);
proxy2.setSourceModel(&model2);
for (int row = 0; row < proxy2.rowCount(QModelIndex()); ++row) {
@@ -2590,74 +2575,85 @@ void tst_QSortFilterProxyModel::task248868_dynamicSorting()
class QtTestModel: public QAbstractItemModel
{
- public:
- QtTestModel(int _rows, int _cols, QObject *parent = 0): QAbstractItemModel(parent),
- rows(_rows), cols(_cols), wrongIndex(false) { }
+public:
+ QtTestModel(int _rows, int _cols, QObject *parent = 0)
+ : QAbstractItemModel(parent)
+ , rows(_rows)
+ , cols(_cols)
+ , wrongIndex(false)
+ {
+ }
- bool canFetchMore(const QModelIndex &idx) const {
- return !fetched.contains(idx);
- }
+ bool canFetchMore(const QModelIndex &idx) const
+ {
+ return !fetched.contains(idx);
+ }
- void fetchMore(const QModelIndex &idx) {
- if (fetched.contains(idx))
- return;
- beginInsertRows(idx, 0, rows-1);
- fetched.insert(idx);
- endInsertRows();
- }
+ void fetchMore(const QModelIndex &idx)
+ {
+ if (fetched.contains(idx))
+ return;
+ beginInsertRows(idx, 0, rows-1);
+ fetched.insert(idx);
+ endInsertRows();
+ }
- bool hasChildren(const QModelIndex & = QModelIndex()) const {
- return true;
- }
+ bool hasChildren(const QModelIndex & = QModelIndex()) const
+ {
+ return true;
+ }
- int rowCount(const QModelIndex& parent = QModelIndex()) const {
- return fetched.contains(parent) ? rows : 0;
- }
- int columnCount(const QModelIndex& parent = QModelIndex()) const {
- Q_UNUSED(parent);
- return cols;
- }
+ int rowCount(const QModelIndex& parent = QModelIndex()) const
+ {
+ return fetched.contains(parent) ? rows : 0;
+ }
- QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const
- {
- if (row < 0 || column < 0 || column >= cols || row >= rows) {
- return QModelIndex();
- }
- QModelIndex i = createIndex(row, column, int(parent.internalId() + 1));
- parentHash[i] = parent;
- return i;
- }
+ int columnCount(const QModelIndex& parent = QModelIndex()) const
+ {
+ Q_UNUSED(parent);
+ return cols;
+ }
- QModelIndex parent(const QModelIndex &index) const
- {
- if (!parentHash.contains(index))
- return QModelIndex();
- return parentHash[index];
+ QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const
+ {
+ if (row < 0 || column < 0 || column >= cols || row >= rows) {
+ return QModelIndex();
}
+ QModelIndex i = createIndex(row, column, int(parent.internalId() + 1));
+ parentHash[i] = parent;
+ return i;
+ }
- QVariant data(const QModelIndex &idx, int role) const
- {
- if (!idx.isValid())
- return QVariant();
-
- if (role == Qt::DisplayRole) {
- if (idx.row() < 0 || idx.column() < 0 || idx.column() >= cols || idx.row() >= rows) {
- wrongIndex = true;
- qWarning("Invalid modelIndex [%d,%d,%p]", idx.row(), idx.column(),
- idx.internalPointer());
- }
- return QString("[%1,%2]").arg(idx.row()).arg(idx.column());
- }
+ QModelIndex parent(const QModelIndex &index) const
+ {
+ if (!parentHash.contains(index))
+ return QModelIndex();
+ return parentHash[index];
+ }
+
+ QVariant data(const QModelIndex &idx, int role) const
+ {
+ if (!idx.isValid())
return QVariant();
+
+ if (role == Qt::DisplayRole) {
+ if (idx.row() < 0 || idx.column() < 0 || idx.column() >= cols || idx.row() >= rows) {
+ wrongIndex = true;
+ qWarning("Invalid modelIndex [%d,%d,%p]", idx.row(), idx.column(),
+ idx.internalPointer());
+ }
+ return QString("[%1,%2]").arg(idx.row()).arg(idx.column());
}
+ return QVariant();
+ }
- QSet<QModelIndex> fetched;
- int rows, cols;
- mutable bool wrongIndex;
- mutable QMap<QModelIndex,QModelIndex> parentHash;
+ QSet<QModelIndex> fetched;
+ int rows, cols;
+ mutable bool wrongIndex;
+ mutable QMap<QModelIndex,QModelIndex> parentHash;
};
-void tst_QSortFilterProxyModel::task250023_fetchMore()
+void tst_QSortFilterProxyModel::fetchMore()
{
QtTestModel model(10,10);
QSortFilterProxyModel proxy;
@@ -2679,7 +2675,7 @@ void tst_QSortFilterProxyModel::task250023_fetchMore()
QCOMPARE(proxy.columnCount(idx), 10);
}
-void tst_QSortFilterProxyModel::task251296_hiddenChildren()
+void tst_QSortFilterProxyModel::hiddenChildren()
{
QStandardItemModel model;
QSortFilterProxyModel proxy;
@@ -2730,7 +2726,7 @@ void tst_QSortFilterProxyModel::task251296_hiddenChildren()
QCOMPARE(proxy.rowCount(indexA) , 0);
}
-void tst_QSortFilterProxyModel::task252507_mapFromToSource()
+void tst_QSortFilterProxyModel::mapFromToSource()
{
QtTestModel source(10,10);
source.fetchMore(QModelIndex());
@@ -2756,8 +2752,7 @@ static QStandardItem *addEntry(QStandardItem* pParent, const QString &descriptio
return pItem;
}
-
-void tst_QSortFilterProxyModel::task255652_removeRowsRecursive()
+void tst_QSortFilterProxyModel::removeRowsRecursive()
{
QStandardItemModel pModel;
QStandardItem *pItem1 = new QStandardItem("root");
@@ -2807,7 +2802,7 @@ void tst_QSortFilterProxyModel::task255652_removeRowsRecursive()
delete pItem11;
}
-void tst_QSortFilterProxyModel::taskQTBUG_6205_doubleProxySelectionSetSourceModel()
+void tst_QSortFilterProxyModel::doubleProxySelectionSetSourceModel()
{
QStandardItemModel *model1 = new QStandardItemModel;
QStandardItem *parentItem = model1->invisibleRootItem();
@@ -2843,29 +2838,28 @@ void tst_QSortFilterProxyModel::taskQTBUG_6205_doubleProxySelectionSetSourceMode
QVERIFY(ism.selection().isEmpty());
}
-void tst_QSortFilterProxyModel::taskQTBUG_7537_appearsAndSort()
+void tst_QSortFilterProxyModel::appearsAndSort()
{
class PModel : public QSortFilterProxyModel
{
- public:
- PModel() : mVisible(false) {};
- protected:
- bool filterAcceptsRow(int, const QModelIndex &) const
- {
- return mVisible;
- }
+ public:
+ PModel() : mVisible(false) {};
+ protected:
+ bool filterAcceptsRow(int, const QModelIndex &) const
+ {
+ return mVisible;
+ }
- public:
- void updateXX()
- {
- mVisible = true;
- invalidate();
- }
- private:
- bool mVisible;
+ public:
+ void updateXX()
+ {
+ mVisible = true;
+ invalidate();
+ }
+ private:
+ bool mVisible;
} proxyModel;
-
QStringListModel sourceModel;
QStringList list;
list << "b" << "a" << "c";
@@ -2882,6 +2876,9 @@ void tst_QSortFilterProxyModel::taskQTBUG_7537_appearsAndSort()
QSignalSpy spyAbout1(&proxyModel, SIGNAL(layoutAboutToBeChanged()));
QSignalSpy spyChanged1(&proxyModel, SIGNAL(layoutChanged()));
+ QVERIFY(spyAbout1.isValid());
+ QVERIFY(spyChanged1.isValid());
+
//introducing secondProxyModel to test the layoutChange when many items appears at once
QSortFilterProxyModel secondProxyModel;
secondProxyModel.setSourceModel(&proxyModel);
@@ -2891,6 +2888,9 @@ void tst_QSortFilterProxyModel::taskQTBUG_7537_appearsAndSort()
QSignalSpy spyAbout2(&secondProxyModel, SIGNAL(layoutAboutToBeChanged()));
QSignalSpy spyChanged2(&secondProxyModel, SIGNAL(layoutChanged()));
+ QVERIFY(spyAbout2.isValid());
+ QVERIFY(spyChanged2.isValid());
+
proxyModel.updateXX();
QApplication::processEvents();
//now rows should be visible, and sorted
@@ -2911,7 +2911,7 @@ void tst_QSortFilterProxyModel::taskQTBUG_7537_appearsAndSort()
QCOMPARE(spyChanged2.count(), 1);
}
-void tst_QSortFilterProxyModel::taskQTBUG_7716_unnecessaryDynamicSorting()
+void tst_QSortFilterProxyModel::unnecessaryDynamicSorting()
{
QStringListModel model;
const QStringList initial = QString("bravo charlie delta echo").split(" ");
@@ -2993,7 +2993,6 @@ private slots:
private:
QItemSelectionModel *selectionModel;
-
};
void tst_QSortFilterProxyModel::testMultipleProxiesWithSelection()
@@ -3020,13 +3019,13 @@ void tst_QSortFilterProxyModel::testMultipleProxiesWithSelection()
// trick the proxy into emitting begin/end reset signals.
proxy.setSourceModel(0);
-
}
-static bool isValid(const QItemSelection &selection) {
- foreach(const QItemSelectionRange &range, selection)
- if (!range.isValid())
- return false;
+static bool isValid(const QItemSelection &selection)
+{
+ foreach (const QItemSelectionRange &range, selection)
+ if (!range.isValid())
+ return false;
return true;
}
@@ -3113,7 +3112,7 @@ protected:
}
};
-void tst_QSortFilterProxyModel::taskQTBUG_10287_unnecessaryMapCreation()
+void tst_QSortFilterProxyModel::unnecessaryMapCreation()
{
Model10287 m;
Proxy10287 p(&m);
@@ -3123,19 +3122,18 @@ void tst_QSortFilterProxyModel::taskQTBUG_10287_unnecessaryMapCreation()
class FilteredColumnProxyModel : public QSortFilterProxyModel
{
- Q_OBJECT
+ Q_OBJECT
public:
- FilteredColumnProxyModel(QObject *parent = 0)
- : QSortFilterProxyModel(parent)
- {
-
- }
+ FilteredColumnProxyModel(QObject *parent = 0)
+ : QSortFilterProxyModel(parent)
+ {
+ }
protected:
- bool filterAcceptsColumn(int column, const QModelIndex & /* source_parent */) const
- {
- return column % 2 != 0;
- }
+ bool filterAcceptsColumn(int column, const QModelIndex & /* source_parent */) const
+ {
+ return column % 2 != 0;
+ }
};
void tst_QSortFilterProxyModel::filteredColumns()
@@ -3155,7 +3153,7 @@ void tst_QSortFilterProxyModel::filteredColumns()
insertCommand->doCommand();
}
-void tst_QSortFilterProxyModel::taskQTBUG_17812_resetInvalidate_data()
+void tst_QSortFilterProxyModel::resetInvalidate_data()
{
QTest::addColumn<int>("test");
QTest::addColumn<bool>("works");
@@ -3166,17 +3164,19 @@ void tst_QSortFilterProxyModel::taskQTBUG_17812_resetInvalidate_data()
QTest::newRow("invalidate_filter") << 3 << true;
}
-void tst_QSortFilterProxyModel::taskQTBUG_17812_resetInvalidate()
+void tst_QSortFilterProxyModel::resetInvalidate()
{
QFETCH(int, test);
QFETCH(bool, works);
struct Proxy : QSortFilterProxyModel {
QString pattern;
- virtual bool filterAcceptsRow(int source_row, const QModelIndex&) const {
+ virtual bool filterAcceptsRow(int source_row, const QModelIndex&) const
+ {
return sourceModel()->data(sourceModel()->index(source_row, 0)).toString().contains(pattern);
}
- void notifyChange(int test) {
+ void notifyChange(int test)
+ {
switch (test) {
case 0: break;
case 1: reset(); break;
@@ -3248,16 +3248,27 @@ void tst_QSortFilterProxyModel::testParentLayoutChanged()
QSignalSpy dataChangedSpy(&model, SIGNAL(dataChanged(QModelIndex,QModelIndex)));
+ QVERIFY(dataChangedSpy.isValid());
+
// Verify that the no-arg signal is still emitted.
QSignalSpy layoutAboutToBeChangedSpy(&proxy, SIGNAL(layoutAboutToBeChanged()));
QSignalSpy layoutChangedSpy(&proxy, SIGNAL(layoutChanged()));
+ QVERIFY(layoutAboutToBeChangedSpy.isValid());
+ QVERIFY(layoutChangedSpy.isValid());
+
QSignalSpy parentsAboutToBeChangedSpy(&proxy, SIGNAL(layoutAboutToBeChanged(QList<QPersistentModelIndex>)));
QSignalSpy parentsChangedSpy(&proxy, SIGNAL(layoutChanged(QList<QPersistentModelIndex>)));
+ QVERIFY(parentsAboutToBeChangedSpy.isValid());
+ QVERIFY(parentsChangedSpy.isValid());
+
QSignalSpy proxy2ParentsAboutToBeChangedSpy(&proxy2, SIGNAL(layoutAboutToBeChanged(QList<QPersistentModelIndex>)));
QSignalSpy proxy2ParentsChangedSpy(&proxy2, SIGNAL(layoutChanged(QList<QPersistentModelIndex>)));
+ QVERIFY(proxy2ParentsAboutToBeChangedSpy.isValid());
+ QVERIFY(proxy2ParentsChangedSpy.isValid());
+
QStandardItem *item = model.invisibleRootItem()->child(1)->child(1);
// Ensure mapped:
@@ -3299,7 +3310,6 @@ void tst_QSortFilterProxyModel::testParentLayoutChanged()
QVERIFY(beforeParents.contains(proxy2.mapToSource(idx)));
foreach (const QPersistentModelIndex &idx, proxy2AfterList)
QVERIFY(afterParents.contains(proxy2.mapToSource(idx)));
-
}
class SignalArgumentChecker : public QObject
@@ -3426,6 +3436,17 @@ void tst_QSortFilterProxyModel::moveSourceRows()
QSignalSpy filterBothBeforeParentLayoutSpy(&filterBothProxy, SIGNAL(layoutAboutToBeChanged(QList<QPersistentModelIndex>)));
QSignalSpy filterBothAfterParentLayoutSpy(&filterBothProxy, SIGNAL(layoutChanged(QList<QPersistentModelIndex>)));
+ QVERIFY(modelBeforeSpy.isValid());
+ QVERIFY(modelAfterSpy.isValid());
+ QVERIFY(proxyBeforeMoveSpy.isValid());
+ QVERIFY(proxyAfterMoveSpy.isValid());
+ QVERIFY(proxyBeforeParentLayoutSpy.isValid());
+ QVERIFY(proxyAfterParentLayoutSpy.isValid());
+ QVERIFY(filterBeforeParentLayoutSpy.isValid());
+ QVERIFY(filterAfterParentLayoutSpy.isValid());
+ QVERIFY(filterBothBeforeParentLayoutSpy.isValid());
+ QVERIFY(filterBothAfterParentLayoutSpy.isValid());
+
{
ModelMoveCommand moveCommand(&model, 0);
moveCommand.setAncestorRowNumbers(QList<int>() << 2);
diff --git a/tests/auto/widgets/itemviews/qstringlistmodel/.gitignore b/tests/auto/corelib/itemmodels/qstringlistmodel/.gitignore
index 9c14561e3c..9c14561e3c 100644
--- a/tests/auto/widgets/itemviews/qstringlistmodel/.gitignore
+++ b/tests/auto/corelib/itemmodels/qstringlistmodel/.gitignore
diff --git a/tests/auto/widgets/itemviews/qstringlistmodel/qmodellistener.h b/tests/auto/corelib/itemmodels/qstringlistmodel/qmodellistener.h
index f3ed3c1793..1de3018228 100644
--- a/tests/auto/widgets/itemviews/qstringlistmodel/qmodellistener.h
+++ b/tests/auto/corelib/itemmodels/qstringlistmodel/qmodellistener.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -38,11 +38,11 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+
#include <QObject>
#include <QModelIndex>
#include <qdebug.h>
-
QT_FORWARD_DECLARE_CLASS(QStringListModel)
class QModelListener : public QObject
@@ -56,7 +56,7 @@ public:
virtual ~QModelListener() { }
void setTestData(QStringList *pAboutToStringlist, QStringList *pExpectedStringlist, QStringListModel *pModel)
- {
+ {
m_pAboutToStringlist = pAboutToStringlist;
m_pExpectedStringlist = pExpectedStringlist;
m_pModel = pModel;
@@ -70,6 +70,5 @@ private:
public slots:
void rowsAboutToBeRemovedOrInserted(const QModelIndex & parent, int start, int end );
void rowsRemovedOrInserted(const QModelIndex & parent, int start, int end );
-
};
diff --git a/tests/auto/widgets/itemviews/qstringlistmodel/qstringlistmodel.pro b/tests/auto/corelib/itemmodels/qstringlistmodel/qstringlistmodel.pro
index ecdd30cae2..821a48038b 100644
--- a/tests/auto/widgets/itemviews/qstringlistmodel/qstringlistmodel.pro
+++ b/tests/auto/corelib/itemmodels/qstringlistmodel/qstringlistmodel.pro
@@ -2,8 +2,4 @@ CONFIG += testcase
TARGET = tst_qstringlistmodel
QT += widgets testlib
HEADERS += qmodellistener.h
-
-SOURCES += tst_qstringlistmodel.cpp
-
-
-
+SOURCES += tst_qstringlistmodel.cpp
diff --git a/tests/auto/widgets/itemviews/qstringlistmodel/tst_qstringlistmodel.cpp b/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
index c8afe5dd75..6c7c87c940 100644
--- a/tests/auto/widgets/itemviews/qstringlistmodel/tst_qstringlistmodel.cpp
+++ b/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -39,7 +39,6 @@
**
****************************************************************************/
-
#include <QtTest/QtTest>
#include <qabstractitemmodel.h>
#include <qapplication.h>
@@ -52,20 +51,17 @@
void QModelListener::rowsAboutToBeRemovedOrInserted(const QModelIndex & parent, int start, int end )
{
- int i;
- for (i = 0; start + i <= end; i++)
- {
+ for (int i = 0; start + i <= end; i++) {
QModelIndex mIndex = m_pModel->index(start + i, 0, parent);
QVariant var = m_pModel->data(mIndex, Qt::DisplayRole);
QString str = var.toString();
-
+
QCOMPARE(str, m_pAboutToStringlist->at(i));
}
}
void QModelListener::rowsRemovedOrInserted(const QModelIndex & parent, int , int)
{
- int i;
// Can the rows that *are* removed be iterated now ?
// What about rowsAboutToBeInserted - what will the indices be?
@@ -74,35 +70,20 @@ void QModelListener::rowsRemovedOrInserted(const QModelIndex & parent, int , int
// RemoveColumn. Does that also fire the rowsRemoved-family signals?
- for (i = 0; i < m_pExpectedStringlist->size(); i++)
- {
+ for (int i = 0; i < m_pExpectedStringlist->size(); i++) {
QModelIndex mIndex = m_pModel->index(i, 0, parent);
QVariant var = m_pModel->data(mIndex, Qt::DisplayRole);
QString str = var.toString();
-
- //qDebug() << "index: " << i << " start: " << start << "end: " << end;
+
QCOMPARE(str, m_pExpectedStringlist->at(i));
}
}
-
class tst_QStringListModel : public QObject
{
Q_OBJECT
-public:
-
- tst_QStringListModel();
- virtual ~tst_QStringListModel();
-
-
-public slots:
- void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
private slots:
-
void rowsAboutToBeRemoved_rowsRemoved();
void rowsAboutToBeRemoved_rowsRemoved_data();
@@ -110,37 +91,6 @@ private slots:
void rowsAboutToBeInserted_rowsInserted_data();
};
-
-tst_QStringListModel::tst_QStringListModel()
-
-{
-}
-
-tst_QStringListModel::~tst_QStringListModel()
-{
-}
-
-void tst_QStringListModel::initTestCase()
-{
-}
-
-void tst_QStringListModel::cleanupTestCase()
-{
-}
-
-void tst_QStringListModel::init()
-{
-}
-
-void tst_QStringListModel::cleanup()
-{
-}
-
-/*
- tests
-*/
-
-
void tst_QStringListModel::rowsAboutToBeRemoved_rowsRemoved_data()
{
QTest::addColumn<QStringList>("input");
@@ -195,21 +145,20 @@ void tst_QStringListModel::rowsAboutToBeRemoved_rowsRemoved()
QStringListModel *model = new QStringListModel(input);
QModelListener *pListener = new QModelListener(&aboutto, &res, model);
- pListener->connect(model, SIGNAL( rowsAboutToBeRemoved(const QModelIndex & , int , int )),
+ pListener->connect(model, SIGNAL( rowsAboutToBeRemoved(const QModelIndex & , int , int )),
pListener, SLOT( rowsAboutToBeRemovedOrInserted(const QModelIndex & , int , int )) );
- pListener->connect(model, SIGNAL( rowsRemoved(const QModelIndex & , int , int )),
+ pListener->connect(model, SIGNAL( rowsRemoved(const QModelIndex & , int , int )),
pListener, SLOT( rowsRemovedOrInserted(const QModelIndex & , int , int )) );
model->removeRows(row,count);
- // At this point, control goes to our connected slots inn this order:
+ // At this point, control goes to our connected slots inn this order:
// 1. rowsAboutToBeRemovedOrInserted
// 2. rowsRemovedOrInserted
// Control returns here
delete pListener;
delete model;
-
}
void tst_QStringListModel::rowsAboutToBeInserted_rowsInserted_data()
@@ -260,24 +209,21 @@ void tst_QStringListModel::rowsAboutToBeInserted_rowsInserted()
QStringListModel *model = new QStringListModel(input);
QModelListener *pListener = new QModelListener(&aboutto, &res, model);
- connect(model, SIGNAL( rowsAboutToBeInserted(const QModelIndex & , int , int )),
+ connect(model, SIGNAL( rowsAboutToBeInserted(const QModelIndex & , int , int )),
pListener, SLOT( rowsAboutToBeRemovedOrInserted(const QModelIndex & , int , int )) );
- connect(model, SIGNAL( rowsInserted(const QModelIndex & , int , int )),
+ connect(model, SIGNAL( rowsInserted(const QModelIndex & , int , int )),
pListener, SLOT( rowsRemovedOrInserted(const QModelIndex & , int , int )) );
model->insertRows(row,count);
- // At this point, control goes to our connected slots inn this order:
+ // At this point, control goes to our connected slots inn this order:
// 1. rowsAboutToBeRemovedOrInserted
// 2. rowsRemovedOrInserted
// Control returns here
delete pListener;
delete model;
-
}
-
QTEST_MAIN(tst_QStringListModel)
#include "tst_qstringlistmodel.moc"
-
diff --git a/tests/auto/corelib/kernel/kernel.pro b/tests/auto/corelib/kernel/kernel.pro
index 90a5c24506..3c697f4149 100644
--- a/tests/auto/corelib/kernel/kernel.pro
+++ b/tests/auto/corelib/kernel/kernel.pro
@@ -1,12 +1,11 @@
TEMPLATE=subdirs
SUBDIRS=\
- qabstractitemmodel \
qcoreapplication \
qeventloop \
- qitemmodel \
qmath \
qmetaobject \
qmetaobjectbuilder \
+ qmetaproperty \
qmetatype \
qmimedata \
qobject \
@@ -24,4 +23,3 @@ SUBDIRS=\
# This test is only applicable on Windows
!win32*:SUBDIRS -= qwineventnotifier
-mac: qabstractitemmodel.CONFIG = no_check_target # QTBUG-22748
diff --git a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
index 6a2d04d46d..5c2ebc8948 100644
--- a/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
+++ b/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -601,7 +601,7 @@ public:
}
void registerSocketNotifier(QSocketNotifier *) {}
void unregisterSocketNotifier(QSocketNotifier *) {}
- void registerTimer(int , int , QObject *) {}
+ void registerTimer(int , int , Qt::TimerType, QObject *) {}
bool unregisterTimer(int ) { return false; }
bool unregisterTimers(QObject *) { return false; }
QList<TimerInfo> registeredTimers(QObject *) const { return QList<TimerInfo>(); }
diff --git a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp
index aab405fa97..49e3fec33e 100644
--- a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp
+++ b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -203,6 +203,9 @@ void tst_QEventLoop::processEvents()
QSignalSpy spy1(QAbstractEventDispatcher::instance(), SIGNAL(aboutToBlock()));
QSignalSpy spy2(QAbstractEventDispatcher::instance(), SIGNAL(awake()));
+ QVERIFY(spy1.isValid());
+ QVERIFY(spy2.isValid());
+
QEventLoop eventLoop;
QCoreApplication::postEvent(&eventLoop, new QEvent(QEvent::User));
@@ -285,6 +288,7 @@ void tst_QEventLoop::exec()
// make sure the eventloop runs
QSignalSpy spy(QAbstractEventDispatcher::instance(&thread), SIGNAL(awake()));
+ QVERIFY(spy.isValid());
thread.cond.wakeOne();
thread.cond.wait(&thread.mutex);
QVERIFY(spy.count() > 0);
@@ -322,7 +326,9 @@ void tst_QEventLoop::throwInExec()
// qobject.cpp will try to rethrow the exception after handling
// which causes gwes.exe to crash
QSKIP("This platform doesn't support propagating exceptions through the event loop");
-#elif defined(Q_OS_LINUX)
+#else
+ // exceptions compiled in, runtime tests follow.
+#if defined(Q_OS_LINUX)
// C++ exceptions can't be passed through glib callbacks. Skip the test if
// we're using the glib event loop.
QByteArray dispatcher = QAbstractEventDispatcher::instance()->metaObject()->className();
@@ -357,6 +363,7 @@ void tst_QEventLoop::throwInExec()
}
QCOMPARE(caughtExceptions, 2);
}
+#endif
}
void tst_QEventLoop::reexec()
@@ -393,6 +400,7 @@ void tst_QEventLoop::wakeUp()
(void) eventLoop.exec();
QSignalSpy spy(QAbstractEventDispatcher::instance(&thread), SIGNAL(awake()));
+ QVERIFY(spy.isValid());
thread.eventLoop->wakeUp();
// give the thread time to wake up
diff --git a/tests/auto/corelib/kernel/qmath/tst_qmath.cpp b/tests/auto/corelib/kernel/qmath/tst_qmath.cpp
index f908bd6e3e..fab95564d2 100644
--- a/tests/auto/corelib/kernel/qmath/tst_qmath.cpp
+++ b/tests/auto/corelib/kernel/qmath/tst_qmath.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp
index 32d0ccfaac..0fe82f6277 100644
--- a/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp
+++ b/tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -796,6 +796,7 @@ void tst_QMetaObject::invokeTypedefTypes()
qRegisterMetaType<CustomString>("CustomString");
QtTestCustomObject obj;
QSignalSpy spy(&obj, SIGNAL(sig_custom(CustomString)));
+ QVERIFY(spy.isValid());
QCOMPARE(spy.count(), 0);
CustomString arg("hello");
diff --git a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
index 7ad020c356..fb7122aec4 100644
--- a/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
+++ b/tests/auto/corelib/kernel/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -957,17 +957,17 @@ void tst_QMetaObjectBuilder::copyMetaObject()
QMetaObjectBuilder builder(&QObject::staticMetaObject);
QMetaObject *meta = builder.toMetaObject();
QVERIFY(sameMetaObject(meta, &QObject::staticMetaObject));
- qFree(meta);
+ free(meta);
QMetaObjectBuilder builder2(&staticMetaObject);
meta = builder2.toMetaObject();
QVERIFY(sameMetaObject(meta, &staticMetaObject));
- qFree(meta);
+ free(meta);
QMetaObjectBuilder builder3(&SomethingOfEverything::staticMetaObject);
meta = builder3.toMetaObject();
QVERIFY(sameMetaObject(meta, &SomethingOfEverything::staticMetaObject));
- qFree(meta);
+ free(meta);
}
// Serialize and deserialize a meta object and check that
@@ -992,8 +992,8 @@ void tst_QMetaObjectBuilder::serialize()
QMetaObject *meta2 = builder2.toMetaObject();
QVERIFY(sameMetaObject(meta, meta2));
- qFree(meta);
- qFree(meta2);
+ free(meta);
+ free(meta2);
}
// Partial QMetaObjectBuilder
diff --git a/tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp b/tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp
index 7a457b05fa..e225371a7f 100644
--- a/tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp
+++ b/tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
index e0433ea4b0..d5aa369a92 100644
--- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
+++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -78,6 +78,8 @@ private slots:
void createCopy();
void sizeOf_data();
void sizeOf();
+ void flags_data();
+ void flags();
void construct_data();
void construct();
void constructCopy_data();
@@ -129,6 +131,10 @@ protected:
#ifdef Q_OS_LINUX
pthread_yield();
#endif
+ if (QMetaType::typeFlags(tp) != (QMetaType::NeedsConstruction | QMetaType::NeedsDestruction)) {
+ ++failureCount;
+ qWarning() << "Wrong typeInfo returned for" << tp;
+ }
if (!QMetaType::isRegistered(tp)) {
++failureCount;
qWarning() << name << "is not a registered metatype";
@@ -440,6 +446,12 @@ template<> struct TestValueFactory<QMetaType::QPointF> {
template<> struct TestValueFactory<QMetaType::QEasingCurve> {
static QEasingCurve *create() { return new QEasingCurve(QEasingCurve::InOutElastic); }
};
+template<> struct TestValueFactory<QMetaType::QUuid> {
+ static QUuid *create() { return new QUuid(); }
+};
+template<> struct TestValueFactory<QMetaType::QModelIndex> {
+ static QModelIndex *create() { return new QModelIndex(); }
+};
template<> struct TestValueFactory<QMetaType::QRegExp> {
static QRegExp *create()
{
@@ -578,6 +590,40 @@ void tst_QMetaType::sizeOf()
QCOMPARE(QMetaType::sizeOf(type), size);
}
+struct CustomMovable {};
+QT_BEGIN_NAMESPACE
+Q_DECLARE_TYPEINFO(CustomMovable, Q_MOVABLE_TYPE);
+QT_END_NAMESPACE
+Q_DECLARE_METATYPE(CustomMovable);
+
+void tst_QMetaType::flags_data()
+{
+ QTest::addColumn<int>("type");
+ QTest::addColumn<bool>("isMovable");
+ QTest::addColumn<bool>("isComplex");
+
+#define ADD_METATYPE_TEST_ROW(MetaTypeName, MetaTypeId, RealType) \
+ QTest::newRow(#RealType) << MetaTypeId << bool(!QTypeInfo<RealType>::isStatic) << bool(QTypeInfo<RealType>::isComplex);
+QT_FOR_EACH_STATIC_CORE_CLASS(ADD_METATYPE_TEST_ROW)
+QT_FOR_EACH_STATIC_PRIMITIVE_POINTER(ADD_METATYPE_TEST_ROW)
+QT_FOR_EACH_STATIC_CORE_POINTER(ADD_METATYPE_TEST_ROW)
+#undef ADD_METATYPE_TEST_ROW
+ QTest::newRow("TestSpace::Foo") << ::qMetaTypeId<TestSpace::Foo>() << false << true;
+ QTest::newRow("Whity<double>") << ::qMetaTypeId<Whity<double> >() << false << true;
+ QTest::newRow("CustomMovable") << ::qMetaTypeId<CustomMovable>() << true << true;
+}
+
+void tst_QMetaType::flags()
+{
+ QFETCH(int, type);
+ QFETCH(bool, isMovable);
+ QFETCH(bool, isComplex);
+
+ QCOMPARE(bool(QMetaType::typeFlags(type) & QMetaType::NeedsConstruction), isComplex);
+ QCOMPARE(bool(QMetaType::typeFlags(type) & QMetaType::NeedsDestruction), isComplex);
+ QCOMPARE(bool(QMetaType::typeFlags(type) & QMetaType::MovableType), isMovable);
+}
+
void tst_QMetaType::construct_data()
{
create_data();
diff --git a/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp b/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp
index 6e8e9940ab..f55701b3ec 100644
--- a/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp
+++ b/tests/auto/corelib/kernel/qmimedata/tst_qmimedata.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/kernel/qobject/.gitignore b/tests/auto/corelib/kernel/qobject/.gitignore
index ea4d6d7f06..7970e32c8f 100644
--- a/tests/auto/corelib/kernel/qobject/.gitignore
+++ b/tests/auto/corelib/kernel/qobject/.gitignore
@@ -1,3 +1,3 @@
tst_qobject
-signalbug
-signalbug.exe
+signalbug/signalbug
+signalbug/signalbug.exe
diff --git a/tests/auto/corelib/kernel/qobject/moc_oldnormalizeobject.cpp b/tests/auto/corelib/kernel/qobject/moc_oldnormalizeobject.cpp
index b275ff30fa..b4069eba6c 100644
--- a/tests/auto/corelib/kernel/qobject/moc_oldnormalizeobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/moc_oldnormalizeobject.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/kernel/qobject/oldnormalizeobject.h b/tests/auto/corelib/kernel/qobject/oldnormalizeobject.h
index 4dfb7d97d2..efd1df2f5a 100644
--- a/tests/auto/corelib/kernel/qobject/oldnormalizeobject.h
+++ b/tests/auto/corelib/kernel/qobject/oldnormalizeobject.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/kernel/qobject/qobject.pro b/tests/auto/corelib/kernel/qobject/qobject.pro
index 113e14a61d..ee48f56b1d 100644
--- a/tests/auto/corelib/kernel/qobject/qobject.pro
+++ b/tests/auto/corelib/kernel/qobject/qobject.pro
@@ -1,3 +1,3 @@
TEMPLATE = subdirs
-SUBDIRS = tst_qobject.pro signalbug.pro
+SUBDIRS = signalbug tst_qobject.pro
CONFIG += parallel_test
diff --git a/tests/auto/corelib/kernel/qobject/signalbug.cpp b/tests/auto/corelib/kernel/qobject/signalbug/signalbug.cpp
index 0465373e40..86e8869a33 100644
--- a/tests/auto/corelib/kernel/qobject/signalbug.cpp
+++ b/tests/auto/corelib/kernel/qobject/signalbug/signalbug.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/kernel/qobject/signalbug.h b/tests/auto/corelib/kernel/qobject/signalbug/signalbug.h
index 4292d70063..bba612c998 100644
--- a/tests/auto/corelib/kernel/qobject/signalbug.h
+++ b/tests/auto/corelib/kernel/qobject/signalbug/signalbug.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/kernel/qobject/signalbug.pro b/tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro
index ed3adf0242..19d36a63a1 100644
--- a/tests/auto/corelib/kernel/qobject/signalbug.pro
+++ b/tests/auto/corelib/kernel/qobject/signalbug/signalbug.pro
@@ -1,9 +1,9 @@
TEMPLATE = app
-TARGET =
DEPENDPATH += .
INCLUDEPATH += .
CONFIG -= app_bundle debug_and_release
-DESTDIR=.
+CONFIG += console
+DESTDIR = ./
QT -= gui
wince*: {
LIBS += coredll.lib
@@ -13,5 +13,5 @@ HEADERS += signalbug.h
SOURCES += signalbug.cpp
# This app is testdata for tst_qobject
-target.path = $$[QT_INSTALL_TESTS]/tst_qobject
+target.path = $$[QT_INSTALL_TESTS]/tst_qobject/$$TARGET
INSTALLS += target
diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
index 8f938a79fe..f3bba08544 100644
--- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -65,6 +65,7 @@ class tst_QObject : public QObject
{
Q_OBJECT
private slots:
+ void initTestCase();
void disconnect();
void connectByName();
void connectSignalsToSignalsWithDefaultArguments();
@@ -96,7 +97,7 @@ private slots:
void recursiveSignalEmission();
#endif
void blockingQueuedConnection();
- void compatibilityChildInsertedEvents();
+ void childEvents();
void installEventFilter();
void deleteSelfInSlot();
void disconnectSelfInSlotAndDeleteAfterEmit();
@@ -236,6 +237,12 @@ public slots:
int ReceiverObject::sequence = 0;
+void tst_QObject::initTestCase()
+{
+ const QString testDataDir = QFileInfo(QFINDTESTDATA("signalbug")).absolutePath();
+ QVERIFY2(QDir::setCurrent(testDataDir), qPrintable("Could not chdir to " + testDataDir));
+}
+
void tst_QObject::disconnect()
{
SenderObject *s = new SenderObject;
@@ -253,10 +260,10 @@ void tst_QObject::disconnect()
s->emitSignal3();
s->emitSignal4();
- QCOMPARE( r1->called(1), TRUE );
- QCOMPARE( r1->called(2), TRUE );
- QCOMPARE( r1->called(3), TRUE );
- QCOMPARE( r1->called(4), TRUE );
+ QVERIFY(r1->called(1));
+ QVERIFY(r1->called(2));
+ QVERIFY(r1->called(3));
+ QVERIFY(r1->called(4));
r1->reset();
// usual disconnect with all parameters given
@@ -264,12 +271,12 @@ void tst_QObject::disconnect()
s->emitSignal1();
- QCOMPARE( r1->called(1), FALSE );
+ QVERIFY(!r1->called(1));
r1->reset();
- QCOMPARE( ret, TRUE );
+ QVERIFY(ret);
ret = QObject::disconnect( s, SIGNAL( signal1() ), r1, SLOT( slot1() ) );
- QCOMPARE( ret, FALSE );
+ QVERIFY(!ret);
// disconnect all signals from s from all slots from r1
QObject::disconnect( s, 0, r1, 0 );
@@ -278,9 +285,9 @@ void tst_QObject::disconnect()
s->emitSignal3();
s->emitSignal4();
- QCOMPARE( r1->called(2), FALSE );
- QCOMPARE( r1->called(3), FALSE );
- QCOMPARE( r1->called(4), FALSE );
+ QVERIFY(!r1->called(2));
+ QVERIFY(!r1->called(3));
+ QVERIFY(!r1->called(4));
r1->reset();
connect( s, SIGNAL( signal1() ), r1, SLOT( slot1() ) );
@@ -294,10 +301,10 @@ void tst_QObject::disconnect()
s->emitSignal1();
s->emitSignal2();
- QCOMPARE( r1->called(1), FALSE );
- QCOMPARE( r1->called(2), FALSE );
- QCOMPARE( r1->called(3), FALSE );
- QCOMPARE( r1->called(4), TRUE );
+ QVERIFY(!r1->called(1));
+ QVERIFY(!r1->called(2));
+ QVERIFY(!r1->called(3));
+ QVERIFY(r1->called(4));
r1->reset();
// make sure all is disconnected again
QObject::disconnect( s, 0, r1, 0 );
@@ -315,12 +322,12 @@ void tst_QObject::disconnect()
s->emitSignal2();
s->emitSignal3();
- QCOMPARE( r1->called(1), FALSE );
- QCOMPARE( r2->called(1), FALSE );
- QCOMPARE( r1->called(2), TRUE );
- QCOMPARE( r2->called(2), TRUE );
- QCOMPARE( r1->called(2), TRUE );
- QCOMPARE( r2->called(2), TRUE );
+ QVERIFY(!r1->called(1));
+ QVERIFY(!r2->called(1));
+ QVERIFY(r1->called(2));
+ QVERIFY(r2->called(2));
+ QVERIFY(r1->called(2));
+ QVERIFY(r2->called(2));
r1->reset();
r2->reset();
@@ -328,10 +335,10 @@ void tst_QObject::disconnect()
// disconnect all signals of s from all receivers
QObject::disconnect( s, 0, 0, 0 );
- QCOMPARE( r1->called(2), FALSE );
- QCOMPARE( r2->called(2), FALSE );
- QCOMPARE( r1->called(2), FALSE );
- QCOMPARE( r2->called(2), FALSE );
+ QVERIFY(!r1->called(2));
+ QVERIFY(!r2->called(2));
+ QVERIFY(!r1->called(2));
+ QVERIFY(!r2->called(2));
delete r2;
delete r1;
@@ -972,14 +979,14 @@ void tst_QObject::emitInDefinedOrder()
SequenceObject::sequence = sequence = 0;
sender2->emitSignal1();
- QCOMPARE(seq1.called(1), TRUE);
- QCOMPARE(seq2.called(1), TRUE);
- QCOMPARE(seq3->called(1), FALSE);
- QCOMPARE(seq4.called(1), TRUE);
- QCOMPARE(seq1.called(2), TRUE);
- QCOMPARE(seq2.called(2), TRUE);
- QCOMPARE(seq3->called(2), FALSE);
- QCOMPARE(seq4.called(2), TRUE);
+ QVERIFY(seq1.called(1));
+ QVERIFY(seq2.called(1));
+ QVERIFY(!seq3->called(1));
+ QVERIFY(seq4.called(1));
+ QVERIFY(seq1.called(2));
+ QVERIFY(seq2.called(2));
+ QVERIFY(!seq3->called(2));
+ QVERIFY(seq4.called(2));
QCOMPARE(seq1.sequence_slot1, ++sequence);
QCOMPARE(seq2.sequence_slot1, ++sequence);
QCOMPARE(seq4.sequence_slot1, ++sequence);
@@ -1008,14 +1015,14 @@ void tst_QObject::emitInDefinedOrder()
SequenceObject::sequence = sequence = 0;
sender2->emitSignal1();
- QCOMPARE(seq1.called(2), TRUE);
- QCOMPARE(seq2.called(2), TRUE);
- QCOMPARE(seq3->called(2), FALSE);
- QCOMPARE(seq4.called(2), TRUE);
- QCOMPARE(seq1.called(1), TRUE);
- QCOMPARE(seq2.called(1), TRUE);
- QCOMPARE(seq3->called(1), FALSE);
- QCOMPARE(seq4.called(1), TRUE);
+ QVERIFY(seq1.called(2));
+ QVERIFY(seq2.called(2));
+ QVERIFY(!seq3->called(2));
+ QVERIFY(seq4.called(2));
+ QVERIFY(seq1.called(1));
+ QVERIFY(seq2.called(1));
+ QVERIFY(!seq3->called(1));
+ QVERIFY(seq4.called(1));
QCOMPARE(seq1.sequence_slot2, ++sequence);
QCOMPARE(seq2.sequence_slot2, ++sequence);
QCOMPARE(seq4.sequence_slot2, ++sequence);
@@ -1044,14 +1051,14 @@ void tst_QObject::emitInDefinedOrder()
SequenceObject::sequence = sequence = 0;
sender2->emitSignal1();
- QCOMPARE(seq1.called(1), TRUE);
- QCOMPARE(seq2.called(1), TRUE);
- QCOMPARE(seq3->called(1), FALSE);
- QCOMPARE(seq4.called(1), TRUE);
- QCOMPARE(seq1.called(2), TRUE);
- QCOMPARE(seq2.called(2), TRUE);
- QCOMPARE(seq3->called(2), FALSE);
- QCOMPARE(seq4.called(2), TRUE);
+ QVERIFY(seq1.called(1));
+ QVERIFY(seq2.called(1));
+ QVERIFY(!seq3->called(1));
+ QVERIFY(seq4.called(1));
+ QVERIFY(seq1.called(2));
+ QVERIFY(seq2.called(2));
+ QVERIFY(!seq3->called(2));
+ QVERIFY(seq4.called(2));
QCOMPARE(seq1.sequence_slot1, ++sequence);
QCOMPARE(seq2.sequence_slot1, ++sequence);
QCOMPARE(seq4.sequence_slot1, ++sequence);
@@ -1085,12 +1092,12 @@ void tst_QObject::emitInDefinedOrder()
sender2->emitSignal1();
QCOMPARE(static_cast<QObject *>(psender), static_cast<QObject *>(0));
QCOMPARE(static_cast<QObject *>(pseq3), static_cast<QObject *>(0));
- QCOMPARE(seq1.called(1), TRUE);
- QCOMPARE(seq2.called(1), TRUE);
- QCOMPARE(seq4.called(1), TRUE);
- QCOMPARE(seq1.called(2), TRUE);
- QCOMPARE(seq2.called(2), TRUE);
- QCOMPARE(seq4.called(2), FALSE);
+ QVERIFY(seq1.called(1));
+ QVERIFY(seq2.called(1));
+ QVERIFY(seq4.called(1));
+ QVERIFY(seq1.called(2));
+ QVERIFY(seq2.called(2));
+ QVERIFY(!seq4.called(2));
QCOMPARE(seq1.sequence_slot1, ++sequence);
QCOMPARE(seq2.sequence_slot1, ++sequence);
QCOMPARE(seq4.sequence_slot1, ++sequence);
@@ -2794,7 +2801,9 @@ void tst_QObject::recursiveSignalEmission()
{
QProcess proc;
// signalbug helper app should always be next to this test binary
- proc.start(QCoreApplication::applicationDirPath() + "/signalbug");
+ const QString path = QStringLiteral("signalbug/signalbug");
+ proc.start(path);
+ QVERIFY2(proc.waitForStarted(), qPrintable(QString::fromLatin1("Cannot start '%1': %2").arg(path, proc.errorString())));
QVERIFY(proc.waitForFinished());
QVERIFY(proc.exitStatus() == QProcess::NormalExit);
QCOMPARE(proc.exitCode(), 0);
@@ -2859,7 +2868,7 @@ private:
EventList events;
};
-void tst_QObject::compatibilityChildInsertedEvents()
+void tst_QObject::childEvents()
{
EventSpy::EventList expected;
@@ -2880,7 +2889,7 @@ void tst_QObject::compatibilityChildInsertedEvents()
}
{
- // 2 children, so we expect 2 ChildAdded and 2 ChildInserted events
+ // 2 children, so we expect 2 ChildAdded events
QObject object;
EventSpy spy;
object.installEventFilter(&spy);
@@ -2911,7 +2920,7 @@ void tst_QObject::compatibilityChildInsertedEvents()
{
// 2 children, but one is reparented away, so we expect:
- // 2 ChildAdded, 1 ChildRemoved, and 1 ChildInserted
+ // 2 ChildAdded, 1 ChildRemoved
QObject object;
EventSpy spy;
object.installEventFilter(&spy);
@@ -3484,7 +3493,6 @@ void tst_QObject::isSignalConnected()
QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig15()")));
QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig29()")));
QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig60()")));
- QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig61()")));
#endif
QObject::connect(&o, SIGNAL(sig00()), &o, SIGNAL(sig69()));
@@ -3539,7 +3547,6 @@ void tst_QObject::isSignalConnected()
QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig21()")));
QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig25()")));
QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig55()")));
- QVERIFY(!priv->isSignalConnected(priv->signalIndex("sig61()")));
#endif
emit o.sig00();
@@ -3990,7 +3997,7 @@ void tst_QObject::disconnectNotSignalMetaMethod()
QMetaMethod slot = s.metaObject()->method(
s.metaObject()->indexOfMethod("aPublicSlot()"));
- QTest::ignoreMessage(QtWarningMsg,"Object::disconnect: Attempt to unbind non-signal SenderObject::aPublicSlot()");
+ QTest::ignoreMessage(QtWarningMsg,"QObject::disconnect: Attempt to unbind non-signal SenderObject::aPublicSlot()");
QVERIFY(!QObject::disconnect(&s, slot, &r, QMetaMethod()));
}
@@ -4092,12 +4099,25 @@ public slots:
}
};
+static void processEvents()
+{
+ qApp->processEvents();
+}
+
void tst_QObject::baseDestroyed()
{
- BaseDestroyed d;
- connect(&d, SIGNAL(destroyed()), &d, SLOT(slotUseList()));
- //When d goes out of scope, slotUseList should not be called as the BaseDestroyed has
- // already been destroyed while ~QObject emit destroyed
+ {
+ BaseDestroyed d;
+ connect(&d, SIGNAL(destroyed()), &d, SLOT(slotUseList()));
+ //When d goes out of scope, slotUseList should not be called as the BaseDestroyed has
+ // already been destroyed while ~QObject emit destroyed
+ }
+ {
+ BaseDestroyed d;
+ connect(&d, &QObject::destroyed, processEvents);
+ QMetaObject::invokeMethod(&d, "slotUseList", Qt::QueuedConnection);
+ //the destructor will call processEvents, that should not call the slotUseList
+ }
}
void tst_QObject::pointerConnect()
@@ -4189,10 +4209,10 @@ void tst_QObject::pointerDisconnect()
s->emitSignal3();
s->emitSignal4();
- QCOMPARE( r1->called(1), TRUE );
- QCOMPARE( r1->called(2), TRUE );
- QCOMPARE( r1->called(3), TRUE );
- QCOMPARE( r1->called(4), TRUE );
+ QVERIFY(r1->called(1));
+ QVERIFY(r1->called(2));
+ QVERIFY(r1->called(3));
+ QVERIFY(r1->called(4));
r1->reset();
// usual disconnect with all parameters given
@@ -4200,12 +4220,12 @@ void tst_QObject::pointerDisconnect()
s->emitSignal1();
- QCOMPARE( r1->called(1), FALSE );
+ QVERIFY(!r1->called(1));
r1->reset();
- QCOMPARE( ret, TRUE );
+ QVERIFY(ret);
ret = QObject::disconnect( s, &SenderObject::signal1, r1, &ReceiverObject::slot1 );
- QCOMPARE( ret, FALSE );
+ QVERIFY(!ret);
// disconnect all signals from s from all slots from r1
QObject::disconnect( s, 0, r1, 0 );
@@ -4214,9 +4234,9 @@ void tst_QObject::pointerDisconnect()
s->emitSignal3();
s->emitSignal4();
- QCOMPARE( r1->called(2), FALSE );
- QCOMPARE( r1->called(3), FALSE );
- QCOMPARE( r1->called(4), FALSE );
+ QVERIFY(!r1->called(2));
+ QVERIFY(!r1->called(3));
+ QVERIFY(!r1->called(4));
r1->reset();
connect( s, &SenderObject::signal1, r1, &ReceiverObject::slot1 );
@@ -4230,10 +4250,10 @@ void tst_QObject::pointerDisconnect()
s->emitSignal1();
s->emitSignal2();
- QCOMPARE( r1->called(1), FALSE );
- QCOMPARE( r1->called(2), FALSE );
- QCOMPARE( r1->called(3), FALSE );
- QCOMPARE( r1->called(4), TRUE );
+ QVERIFY(!r1->called(1));
+ QVERIFY(!r1->called(2));
+ QVERIFY(!r1->called(3));
+ QVERIFY(r1->called(4));
r1->reset();
// make sure all is disconnected again
QObject::disconnect( s, 0, r1, 0 );
@@ -4251,12 +4271,12 @@ void tst_QObject::pointerDisconnect()
s->emitSignal2();
s->emitSignal3();
- QCOMPARE( r1->called(1), FALSE );
- QCOMPARE( r2->called(1), FALSE );
- QCOMPARE( r1->called(2), TRUE );
- QCOMPARE( r2->called(2), TRUE );
- QCOMPARE( r1->called(2), TRUE );
- QCOMPARE( r2->called(2), TRUE );
+ QVERIFY(!r1->called(1));
+ QVERIFY(!r2->called(1));
+ QVERIFY(r1->called(2));
+ QVERIFY(r2->called(2));
+ QVERIFY(r1->called(2));
+ QVERIFY(r2->called(2));
r1->reset();
r2->reset();
@@ -4264,10 +4284,10 @@ void tst_QObject::pointerDisconnect()
// disconnect all signals of s from all receivers
QObject::disconnect( s, 0, 0, 0 );
- QCOMPARE( r1->called(2), FALSE );
- QCOMPARE( r2->called(2), FALSE );
- QCOMPARE( r1->called(2), FALSE );
- QCOMPARE( r2->called(2), FALSE );
+ QVERIFY(!r1->called(2));
+ QVERIFY(!r2->called(2));
+ QVERIFY(!r1->called(2));
+ QVERIFY(!r2->called(2));
delete r2;
delete r1;
diff --git a/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp b/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp
index fed98ec86a..df4c5f99cb 100644
--- a/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp
+++ b/tests/auto/corelib/kernel/qpointer/tst_qpointer.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -241,8 +241,8 @@ public:
ChildWidget::~ChildWidget()
{
- QCOMPARE(static_cast<QWidget *>(guardedPointer), static_cast<QWidget *>(0));
- QCOMPARE(qobject_cast<QWidget *>(guardedPointer), static_cast<QWidget *>(0));
+ QCOMPARE(static_cast<QWidget *>(guardedPointer), parentWidget());
+ QCOMPARE(qobject_cast<QWidget *>(guardedPointer), parentWidget());
}
class DerivedChild;
diff --git a/tests/auto/corelib/kernel/qsignalmapper/tst_qsignalmapper.cpp b/tests/auto/corelib/kernel/qsignalmapper/tst_qsignalmapper.cpp
index 58a545ca75..4b9c37a5e0 100644
--- a/tests/auto/corelib/kernel/qsignalmapper/tst_qsignalmapper.cpp
+++ b/tests/auto/corelib/kernel/qsignalmapper/tst_qsignalmapper.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp b/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp
index 90c537b9fc..180e7d532b 100644
--- a/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp
+++ b/tests/auto/corelib/kernel/qsocketnotifier/tst_qsocketnotifier.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -263,12 +263,15 @@ void tst_QSocketNotifier::posixSockets()
QSocketNotifier rn(posixSocket, QSocketNotifier::Read);
connect(&rn, SIGNAL(activated(int)), &QTestEventLoop::instance(), SLOT(exitLoop()));
QSignalSpy readSpy(&rn, SIGNAL(activated(int)));
+ QVERIFY(readSpy.isValid());
QSocketNotifier wn(posixSocket, QSocketNotifier::Write);
connect(&wn, SIGNAL(activated(int)), &QTestEventLoop::instance(), SLOT(exitLoop()));
QSignalSpy writeSpy(&wn, SIGNAL(activated(int)));
+ QVERIFY(writeSpy.isValid());
QSocketNotifier en(posixSocket, QSocketNotifier::Exception);
connect(&en, SIGNAL(activated(int)), &QTestEventLoop::instance(), SLOT(exitLoop()));
QSignalSpy errorSpy(&en, SIGNAL(activated(int)));
+ QVERIFY(errorSpy.isValid());
passive->write("hello",6);
passive->waitForBytesWritten(5000);
diff --git a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
index bfaeff7f26..098d8a8825 100644
--- a/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
+++ b/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp
index 941d3a9be4..a7ccc45642 100644
--- a/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp
+++ b/tests/auto/corelib/kernel/qtranslator/tst_qtranslator.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
index e540474b3e..c2d4f0a240 100644
--- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
+++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -63,6 +63,7 @@
#include <qvector3d.h>
#include <qvector4d.h>
#include <qquaternion.h>
+#include <qdebug.h>
#include <limits.h>
@@ -253,11 +254,14 @@ private slots:
void numericalConvert();
void moreCustomTypes();
+ void movabilityTest();
void variantInVariant();
void colorInteger();
void forwardDeclare();
+ void debugStream_data();
+ void debugStream();
};
Q_DECLARE_METATYPE(QDate)
@@ -1375,8 +1379,29 @@ void tst_QVariant::quaternion()
QMetaType::destroy(QVariant::Quaternion, pquaternion);
}
+struct CustomStreamableClass
+{
+ int i;
+ bool operator==(const CustomStreamableClass& other) const
+ {
+ return i == other.i;
+ }
+};
+Q_DECLARE_METATYPE(CustomStreamableClass);
+
+QDataStream &operator<<(QDataStream &out, const CustomStreamableClass &myObj)
+{
+ return out << myObj.i;
+}
+
+QDataStream &operator>>(QDataStream &in, CustomStreamableClass &myObj)
+{
+ return in >> myObj.i;
+}
+
void tst_QVariant::writeToReadFromDataStream_data()
{
+ qRegisterMetaTypeStreamOperators<CustomStreamableClass>();
QTest::addColumn<QVariant>("writeVariant");
QTest::addColumn<bool>("isNull");
@@ -1483,6 +1508,8 @@ void tst_QVariant::writeToReadFromDataStream_data()
QTest::newRow("QMetaType::Float invalid") << QVariant(QMetaType::Float, (void *) 0) << false;
float f = 1.234f;
QTest::newRow("QMetaType::Float") << QVariant(QMetaType::Float, &f) << false;
+ CustomStreamableClass custom = {123};
+ QTest::newRow("Custom type") << QVariant::fromValue(custom) << false;
}
void tst_QVariant::writeToReadFromDataStream()
@@ -1501,8 +1528,10 @@ void tst_QVariant::writeToReadFromDataStream()
// Best way to confirm the readVariant contains the same data?
// Since only a few won't match since the serial numbers are different
// I won't bother adding another bool in the data test.
- QVariant::Type writeType = writeVariant.type();
- if ( writeType != QVariant::Invalid && writeType != QVariant::Bitmap && writeType != QVariant::Pixmap
+ const int writeType = writeVariant.userType();
+ if (writeType == qMetaTypeId<CustomStreamableClass>())
+ QCOMPARE(qvariant_cast<CustomStreamableClass>(readVariant), qvariant_cast<CustomStreamableClass>(writeVariant));
+ else if ( writeType != QVariant::Invalid && writeType != QVariant::Bitmap && writeType != QVariant::Pixmap
&& writeType != QVariant::Image) {
switch (writeType) {
default:
@@ -1562,6 +1591,7 @@ void tst_QVariant::writeToReadFromOldDataStream()
void tst_QVariant::checkDataStream()
{
+ QTest::ignoreMessage(QtWarningMsg, "Trying to construct an instance of an invalid type, type id: 46");
const QByteArray settingsHex("0000002effffffffff");
const QByteArray settings = QByteArray::fromHex(settingsHex);
QDataStream in(settings);
@@ -2006,7 +2036,7 @@ void tst_QVariant::userType()
QVariant userVar3;
qVariantSetValue(userVar3, data2);
- QVERIFY(userVar2 == userVar3);
+
userVar3 = userVar2;
QVERIFY(userVar2 == userVar3);
}
@@ -2049,7 +2079,7 @@ void tst_QVariant::userType()
QCOMPARE(instanceCount, 3);
{
QVariant second = myCarrier;
- QCOMPARE(instanceCount, 4);
+ QCOMPARE(instanceCount, 3);
second.detach();
QCOMPARE(instanceCount, 4);
}
@@ -3220,6 +3250,27 @@ void tst_QVariant::moreCustomTypes()
QCOMPARE(MyMovable::count, 0);
}
+void tst_QVariant::movabilityTest()
+{
+ // This test checks if QVariant is movable even if an internal data is not movable.
+ QVERIFY(!MyNotMovable::count);
+ {
+ QVariant variant = QVariant::fromValue(MyNotMovable());
+ QVERIFY(MyNotMovable::count);
+
+ // prepare destination memory space to which variant will be moved
+ QVariant buffer[1];
+ QCOMPARE(buffer[0].type(), QVariant::Invalid);
+ buffer[0].~QVariant();
+
+ memcpy(buffer, &variant, sizeof(QVariant));
+ QCOMPARE(buffer[0].type(), QVariant::UserType);
+ MyNotMovable tmp(buffer[0].value<MyNotMovable>());
+
+ new (&variant) QVariant();
+ }
+ QVERIFY(!MyNotMovable::count);
+}
void tst_QVariant::variantInVariant()
{
@@ -3283,5 +3334,64 @@ void tst_QVariant::forwardDeclare()
}
+class MessageHandler {
+public:
+ MessageHandler(const int typeId)
+ : oldMsgHandler(qInstallMsgHandler(handler))
+ {
+ currentId = typeId;
+ }
+
+ ~MessageHandler()
+ {
+ qInstallMsgHandler(oldMsgHandler);
+ }
+
+ bool testPassed() const
+ {
+ return ok;
+ }
+private:
+ static void handler(QtMsgType, const char *txt)
+ {
+ QString msg = QString::fromLatin1(txt);
+ // Format itself is not important, but basic data as a type name should be included in the output
+ ok = msg.startsWith("QVariant(") + QMetaType::typeName(currentId);
+ QVERIFY2(ok, (QString::fromLatin1("Message is not valid: '") + msg + '\'').toLatin1().constData());
+ }
+
+ QtMsgHandler oldMsgHandler;
+ static int currentId;
+ static bool ok;
+};
+bool MessageHandler::ok;
+int MessageHandler::currentId;
+
+void tst_QVariant::debugStream_data()
+{
+ QTest::addColumn<QVariant>("variant");
+ QTest::addColumn<int>("typeId");
+ for (int id = QMetaType::Void; id < QMetaType::User; ++id) {
+ const char *tagName = QMetaType::typeName(id);
+ if (!tagName)
+ continue;
+ QTest::newRow(tagName) << QVariant(static_cast<QVariant::Type>(id)) << id;
+ }
+ QTest::newRow("QBitArray(111)") << QVariant(QBitArray(3, true)) << qMetaTypeId<QBitArray>();
+ QTest::newRow("CustomStreamableClass") << QVariant(qMetaTypeId<CustomStreamableClass>(), 0) << qMetaTypeId<CustomStreamableClass>();
+ QTest::newRow("MyClass") << QVariant(qMetaTypeId<MyClass>(), 0) << qMetaTypeId<MyClass>();
+}
+
+void tst_QVariant::debugStream()
+{
+ QFETCH(QVariant, variant);
+ QFETCH(int, typeId);
+
+ MessageHandler msgHandler(typeId);
+ qDebug() << variant;
+ QVERIFY(msgHandler.testPassed());
+}
+
+
QTEST_MAIN(tst_QVariant)
#include "tst_qvariant.moc"
diff --git a/tests/auto/corelib/kernel/qwineventnotifier/tst_qwineventnotifier.cpp b/tests/auto/corelib/kernel/qwineventnotifier/tst_qwineventnotifier.cpp
index 38df9d77c8..cd87bed601 100644
--- a/tests/auto/corelib/kernel/qwineventnotifier/tst_qwineventnotifier.cpp
+++ b/tests/auto/corelib/kernel/qwineventnotifier/tst_qwineventnotifier.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/plugin/qlibrary/.gitignore b/tests/auto/corelib/plugin/qlibrary/.gitignore
index 38963f2235..3841c7a33c 100644
--- a/tests/auto/corelib/plugin/qlibrary/.gitignore
+++ b/tests/auto/corelib/plugin/qlibrary/.gitignore
@@ -7,4 +7,4 @@ mylib2.dll
mylib2.exp
mylib2.lib
mylib_noextension
-system.trolltech.test.mylib.dll
+system.qt.test.mylib.dll
diff --git a/tests/auto/corelib/plugin/qlibrary/lib/mylib.c b/tests/auto/corelib/plugin/qlibrary/lib/mylib.c
index b9d3c1b219..04a59f210c 100644
--- a/tests/auto/corelib/plugin/qlibrary/lib/mylib.c
+++ b/tests/auto/corelib/plugin/qlibrary/lib/mylib.c
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro b/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro
index 7d319d644e..a15393b214 100644
--- a/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro
+++ b/tests/auto/corelib/plugin/qlibrary/lib2/lib2.pro
@@ -21,10 +21,10 @@ win32 {
} else {
src = $(DESTDIR_TARGET)
}
- files = mylib.dl2 system.trolltech.test.mylib.dll
+ files = mylib.dl2 system.qt.test.mylib.dll
} else {
src = $(DESTDIR)$(TARGET)
- files = libmylib.so2 system.trolltech.test.mylib.so
+ files = libmylib.so2 system.qt.test.mylib.so
}
# This project is testdata for tst_qlibrary
diff --git a/tests/auto/corelib/plugin/qlibrary/lib2/mylib.c b/tests/auto/corelib/plugin/qlibrary/lib2/mylib.c
index 950102abcc..525f3e3aab 100644
--- a/tests/auto/corelib/plugin/qlibrary/lib2/mylib.c
+++ b/tests/auto/corelib/plugin/qlibrary/lib2/mylib.c
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp
index 5156070a32..75f854667e 100644
--- a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp
+++ b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -203,11 +203,11 @@ void tst_QLibrary::load_data()
# if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
QTest::newRow( "ok01 (with suffix)" ) << currDir + "/mylib.dll" << true;
QTest::newRow( "ok02 (with non-standard suffix)" ) << currDir + "/mylib.dl2" << true;
- QTest::newRow( "ok03 (with many dots)" ) << currDir + "/system.trolltech.test.mylib.dll" << true;
+ QTest::newRow( "ok03 (with many dots)" ) << currDir + "/system.qt.test.mylib.dll" << true;
# elif defined Q_OS_UNIX
QTest::newRow( "ok01 (with suffix)" ) << currDir + "/libmylib" SUFFIX << true;
QTest::newRow( "ok02 (with non-standard suffix)" ) << currDir + "/libmylib.so2" << true;
- QTest::newRow( "ok03 (with many dots)" ) << currDir + "/system.trolltech.test.mylib.so" << true;
+ QTest::newRow( "ok03 (with many dots)" ) << currDir + "/system.qt.test.mylib.so" << true;
# endif // Q_OS_UNIX
}
@@ -334,7 +334,7 @@ void tst_QLibrary::isLibrary_data()
QTest::newRow("bad (libmylib.1.0.0.foo)") << QString("libmylib.1.0.0.foo") << false;
#elif defined(Q_OS_WIN)
- QTest::newRow("good (with many dots)" ) << "/system.trolltech.test.mylib.dll" << true;
+ QTest::newRow("good (with many dots)" ) << "/system.qt.test.mylib.dll" << true;
#endif
}
@@ -437,11 +437,11 @@ void tst_QLibrary::loadHints_data()
# if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
QTest::newRow( "ok01 (with suffix)" ) << currDir + "/mylib.dll" << int(lh) << true;
QTest::newRow( "ok02 (with non-standard suffix)" ) << currDir + "/mylib.dl2" << int(lh) << true;
- QTest::newRow( "ok03 (with many dots)" ) << currDir + "/system.trolltech.test.mylib.dll" << int(lh) << true;
+ QTest::newRow( "ok03 (with many dots)" ) << currDir + "/system.qt.test.mylib.dll" << int(lh) << true;
# elif defined Q_OS_UNIX
QTest::newRow( "ok01 (with suffix)" ) << currDir + "/libmylib" SUFFIX << int(lh) << true;
QTest::newRow( "ok02 (with non-standard suffix)" ) << currDir + "/libmylib.so2" << int(lh) << true;
- QTest::newRow( "ok03 (with many dots)" ) << currDir + "/system.trolltech.test.mylib.so" << int(lh) << true;
+ QTest::newRow( "ok03 (with many dots)" ) << currDir + "/system.qt.test.mylib.so" << int(lh) << true;
# endif // Q_OS_UNIX
}
diff --git a/tests/auto/corelib/plugin/qplugin/debugplugin/main.cpp b/tests/auto/corelib/plugin/qplugin/debugplugin/main.cpp
index b1538963d8..3dc5ec377c 100644
--- a/tests/auto/corelib/plugin/qplugin/debugplugin/main.cpp
+++ b/tests/auto/corelib/plugin/qplugin/debugplugin/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/plugin/qplugin/releaseplugin/main.cpp b/tests/auto/corelib/plugin/qplugin/releaseplugin/main.cpp
index 3be9a7415d..99f3c8f452 100644
--- a/tests/auto/corelib/plugin/qplugin/releaseplugin/main.cpp
+++ b/tests/auto/corelib/plugin/qplugin/releaseplugin/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp b/tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp
index c7ea963225..63c1100c5c 100644
--- a/tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp
+++ b/tests/auto/corelib/plugin/qplugin/tst_qplugin.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/plugin/qpluginloader/almostplugin/almostplugin.cpp b/tests/auto/corelib/plugin/qpluginloader/almostplugin/almostplugin.cpp
index 70596c0113..353b5e0158 100644
--- a/tests/auto/corelib/plugin/qpluginloader/almostplugin/almostplugin.cpp
+++ b/tests/auto/corelib/plugin/qpluginloader/almostplugin/almostplugin.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/plugin/qpluginloader/almostplugin/almostplugin.h b/tests/auto/corelib/plugin/qpluginloader/almostplugin/almostplugin.h
index 0021180b36..e4a9b376b2 100644
--- a/tests/auto/corelib/plugin/qpluginloader/almostplugin/almostplugin.h
+++ b/tests/auto/corelib/plugin/qpluginloader/almostplugin/almostplugin.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/plugin/qpluginloader/lib/mylib.c b/tests/auto/corelib/plugin/qpluginloader/lib/mylib.c
index dc43c35815..c87ec5b66d 100644
--- a/tests/auto/corelib/plugin/qpluginloader/lib/mylib.c
+++ b/tests/auto/corelib/plugin/qpluginloader/lib/mylib.c
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/plugin/qpluginloader/theplugin/plugininterface.h b/tests/auto/corelib/plugin/qpluginloader/theplugin/plugininterface.h
index 48d8443ba1..92b7a1b4dc 100644
--- a/tests/auto/corelib/plugin/qpluginloader/theplugin/plugininterface.h
+++ b/tests/auto/corelib/plugin/qpluginloader/theplugin/plugininterface.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.cpp b/tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.cpp
index fdf599c875..660dbd2b90 100644
--- a/tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.cpp
+++ b/tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.h b/tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.h
index 5b738696e0..e1ded8f07b 100644
--- a/tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.h
+++ b/tests/auto/corelib/plugin/qpluginloader/theplugin/theplugin.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
index c143977a48..bf046524d7 100644
--- a/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
+++ b/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -229,6 +229,8 @@ void tst_QPluginLoader::deleteinstanceOnUnload()
QSignalSpy spy1(loader1.instance(), SIGNAL(destroyed()));
QSignalSpy spy2(loader2.instance(), SIGNAL(destroyed()));
+ QVERIFY(spy1.isValid());
+ QVERIFY(spy2.isValid());
if (pass == 0) {
QCOMPARE(loader2.unload(), false); // refcount not reached 0, not really unloaded
QCOMPARE(spy1.count(), 0);
diff --git a/tests/auto/corelib/plugin/quuid/testProcessUniqueness/main.cpp b/tests/auto/corelib/plugin/quuid/testProcessUniqueness/main.cpp
index 085f56539d..072d722cff 100644
--- a/tests/auto/corelib/plugin/quuid/testProcessUniqueness/main.cpp
+++ b/tests/auto/corelib/plugin/quuid/testProcessUniqueness/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/plugin/quuid/tst_quuid.cpp b/tests/auto/corelib/plugin/quuid/tst_quuid.cpp
index 90a391039f..789659cd04 100644
--- a/tests/auto/corelib/plugin/quuid/tst_quuid.cpp
+++ b/tests/auto/corelib/plugin/quuid/tst_quuid.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -59,6 +59,7 @@ private slots:
void fromByteArray();
void toRfc4122();
void fromRfc4122();
+ void createUuidV3OrV5();
void check_QDataStream();
void isNull();
void equal();
@@ -76,23 +77,39 @@ private slots:
void hash();
+ void qvariant();
+ void qvariant_conversion();
+
public:
// Variables
+ QUuid uuidNS;
QUuid uuidA;
QUuid uuidB;
+ QUuid uuidC;
+ QUuid uuidD;
};
void tst_QUuid::initTestCase()
{
+ //It's NameSpace_DNS in RFC4122
+ //"{6ba7b810-9dad-11d1-80b4-00c04fd430c8}";
+ uuidNS = QUuid(0x6ba7b810, 0x9dad, 0x11d1, 0x80, 0xb4, 0x00, 0xc0, 0x4f, 0xd4, 0x30, 0xc8);
+
//"{fc69b59e-cc34-4436-a43c-ee95d128b8c5}";
- uuidA = QUuid(0xfc69b59e, 0xcc34 ,0x4436 ,0xa4 ,0x3c ,0xee ,0x95 ,0xd1 ,0x28 ,0xb8 ,0xc5);
+ uuidA = QUuid(0xfc69b59e, 0xcc34, 0x4436, 0xa4, 0x3c, 0xee, 0x95, 0xd1, 0x28, 0xb8, 0xc5);
//"{1ab6e93a-b1cb-4a87-ba47-ec7e99039a7b}";
- uuidB = QUuid(0x1ab6e93a ,0xb1cb ,0x4a87 ,0xba ,0x47 ,0xec ,0x7e ,0x99 ,0x03 ,0x9a ,0x7b);
+ uuidB = QUuid(0x1ab6e93a, 0xb1cb, 0x4a87, 0xba, 0x47, 0xec, 0x7e, 0x99, 0x03, 0x9a, 0x7b);
// chdir to the directory containing our testdata, then refer to it with relative paths
QString testdata_dir = QFileInfo(QFINDTESTDATA("testProcessUniqueness")).absolutePath();
QVERIFY2(QDir::setCurrent(testdata_dir), qPrintable("Could not chdir to " + testdata_dir));
+
+ //"{3d813cbb-47fb-32ba-91df-831e1593ac29}"; http://www.rfc-editor.org/errata_search.php?rfc=4122&eid=1352
+ uuidC = QUuid(0x3d813cbb, 0x47fb, 0x32ba, 0x91, 0xdf, 0x83, 0x1e, 0x15, 0x93, 0xac, 0x29);
+
+ //"{21f7f8de-8051-5b89-8680-0195ef798b6a}";
+ uuidD = QUuid(0x21f7f8de, 0x8051, 0x5b89, 0x86, 0x80, 0x01, 0x95, 0xef, 0x79, 0x8b, 0x6a);
}
void tst_QUuid::fromChar()
@@ -161,6 +178,16 @@ void tst_QUuid::fromRfc4122()
QCOMPARE(uuidB, QUuid::fromRfc4122(QByteArray::fromHex("1ab6e93ab1cb4a87ba47ec7e99039a7b")));
}
+void tst_QUuid::createUuidV3OrV5()
+{
+ //"www.widgets.com" is also from RFC4122
+ QCOMPARE(uuidC, QUuid::createUuidV3(uuidNS, QByteArray("www.widgets.com")));
+ QCOMPARE(uuidC, QUuid::createUuidV3(uuidNS, QString("www.widgets.com")));
+
+ QCOMPARE(uuidD, QUuid::createUuidV5(uuidNS, QByteArray("www.widgets.com")));
+ QCOMPARE(uuidD, QUuid::createUuidV5(uuidNS, QString("www.widgets.com")));
+}
+
void tst_QUuid::check_QDataStream()
{
QUuid tmp;
@@ -327,7 +354,35 @@ void tst_QUuid::hash()
QCOMPARE(qHash(QUuid(uuidA.toString())), h);
}
+void tst_QUuid::qvariant()
+{
+ QUuid uuid = QUuid::createUuid();
+ QVariant v = QVariant::fromValue(uuid);
+ QVERIFY(!v.isNull());
+ QCOMPARE(v.type(), QVariant::Uuid);
+
+ QUuid uuid2 = v.value<QUuid>();
+ QVERIFY(!uuid2.isNull());
+ QCOMPARE(uuid, uuid2);
+}
+void tst_QUuid::qvariant_conversion()
+{
+ QUuid uuid = QUuid::createUuid();
+ QVariant v = QVariant::fromValue(uuid);
+
+ QVERIFY(v.canConvert<QString>());
+ QCOMPARE(v.toString(), uuid.toString());
+ QCOMPARE(v.value<QString>(), uuid.toString());
+ QVERIFY(!v.canConvert<int>());
+ QVERIFY(!v.canConvert<QStringList>());
+
+ // try reverse conversion QString -> QUuid
+ QVariant sv = QVariant::fromValue(uuid.toString());
+ QCOMPARE(sv.type(), QVariant::String);
+ QVERIFY(sv.canConvert<QUuid>());
+ QCOMPARE(sv.value<QUuid>(), uuid);
+}
QTEST_MAIN(tst_QUuid)
#include "tst_quuid.moc"
diff --git a/tests/auto/corelib/statemachine/qstate/tst_qstate.cpp b/tests/auto/corelib/statemachine/qstate/tst_qstate.cpp
index af587632b3..7ca7fc5120 100644
--- a/tests/auto/corelib/statemachine/qstate/tst_qstate.cpp
+++ b/tests/auto/corelib/statemachine/qstate/tst_qstate.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp b/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
index bdb261eefc..2183016c32 100644
--- a/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
+++ b/tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -873,6 +873,7 @@ void tst_QStateMachine::historyStateAfterRestart()
for (int x = 0; x < 2; ++x) {
QSignalSpy startedSpy(&machine, SIGNAL(started()));
+ QVERIFY(startedSpy.isValid());
machine.start();
QTRY_COMPARE(startedSpy.count(), 1);
QCOMPARE(machine.configuration().count(), 1);
@@ -908,6 +909,7 @@ void tst_QStateMachine::historyStateAfterRestart()
QVERIFY(machine.configuration().contains(s22));
QSignalSpy stoppedSpy(&machine, SIGNAL(stopped()));
+ QVERIFY(stoppedSpy.isValid());
machine.stop();
QTRY_COMPARE(stoppedSpy.count(), 1);
}
@@ -1189,6 +1191,11 @@ void tst_QStateMachine::stateEntryAndExit()
QSignalSpy startedSpy(&machine, SIGNAL(started()));
QSignalSpy stoppedSpy(&machine, SIGNAL(stopped()));
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+
+ QVERIFY(startedSpy.isValid());
+ QVERIFY(stoppedSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
+
machine.setInitialState(s1);
QCOMPARE(machine.initialState(), (QAbstractState*)s1);
{
@@ -1206,6 +1213,13 @@ void tst_QStateMachine::stateEntryAndExit()
QSignalSpy tTriggeredSpy(t, SIGNAL(triggered()));
QSignalSpy s2EnteredSpy(s2, SIGNAL(entered()));
QSignalSpy s2ExitedSpy(s2, SIGNAL(exited()));
+
+ QVERIFY(s1EnteredSpy.isValid());
+ QVERIFY(s1ExitedSpy.isValid());
+ QVERIFY(tTriggeredSpy.isValid());
+ QVERIFY(s2EnteredSpy.isValid());
+ QVERIFY(s2ExitedSpy.isValid());
+
machine.start();
QTRY_COMPARE(startedSpy.count(), 1);
@@ -1256,6 +1270,8 @@ void tst_QStateMachine::stateEntryAndExit()
QSignalSpy startedSpy(&machine, SIGNAL(started()));
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(startedSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
machine.setInitialState(s1);
globalTick = 0;
machine.start();
@@ -1329,6 +1345,7 @@ void tst_QStateMachine::assignProperty()
{
QSignalSpy propertiesAssignedSpy(s1, SIGNAL(propertiesAssigned()));
+ QVERIFY(propertiesAssignedSpy.isValid());
machine.start();
QTRY_COMPARE(propertiesAssignedSpy.count(), 1);
}
@@ -1384,6 +1401,7 @@ void tst_QStateMachine::assignPropertyWithAnimation()
machine.setInitialState(s1);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.start();
QTRY_COMPARE(finishedSpy.count(), 1);
QCOMPARE(obj.property("foo").toInt(), 456);
@@ -1412,6 +1430,7 @@ void tst_QStateMachine::assignPropertyWithAnimation()
machine.setInitialState(s1);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.start();
QTRY_COMPARE(finishedSpy.count(), 1);
QCOMPARE(obj.property("foo").toInt(), 456);
@@ -1440,6 +1459,7 @@ void tst_QStateMachine::assignPropertyWithAnimation()
machine.setInitialState(s1);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.start();
QTRY_COMPARE(finishedSpy.count(), 1);
QCOMPARE(obj.property("foo").toInt(), 456);
@@ -1489,6 +1509,7 @@ void tst_QStateMachine::assignPropertyWithAnimation()
machine.setInitialState(s1);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.start();
QTRY_COMPARE(finishedSpy.count(), 1);
QCOMPARE(obj.property("foo").toInt(), 321);
@@ -1523,6 +1544,7 @@ void tst_QStateMachine::assignPropertyWithAnimation()
machine.start();
QTRY_COMPARE(machine.configuration().contains(s1), true);
QSignalSpy propertiesAssignedSpy(s2, SIGNAL(propertiesAssigned()));
+ QVERIFY(propertiesAssignedSpy.isValid());
emitter.emitSignalWithNoArg();
QTRY_COMPARE(machine.configuration().contains(s2), true);
QVERIFY(propertiesAssignedSpy.isEmpty());
@@ -1610,6 +1632,7 @@ void tst_QStateMachine::postEvent()
machine.addState(s2);
machine.setInitialState(s1);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.start();
QTRY_COMPARE(finishedSpy.count(), 1);
QCOMPARE(machine.configuration().size(), 1);
@@ -1639,6 +1662,7 @@ void tst_QStateMachine::cancelDelayedEvent()
machine.setInitialState(s1);
QSignalSpy startedSpy(&machine, SIGNAL(started()));
+ QVERIFY(startedSpy.isValid());
machine.start();
QTRY_COMPARE(startedSpy.count(), 1);
QCOMPARE(machine.configuration().size(), 1);
@@ -1658,6 +1682,7 @@ void tst_QStateMachine::cancelDelayedEvent()
QVERIFY(!machine.cancelDelayedEvent(id2));
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
QTRY_COMPARE(finishedSpy.count(), 1);
QCOMPARE(machine.configuration().size(), 1);
QVERIFY(machine.configuration().contains(s2));
@@ -1672,6 +1697,7 @@ void tst_QStateMachine::postDelayedEventAndStop()
machine.setInitialState(s1);
QSignalSpy startedSpy(&machine, SIGNAL(started()));
+ QVERIFY(startedSpy.isValid());
machine.start();
QTRY_COMPARE(startedSpy.count(), 1);
QCOMPARE(machine.configuration().size(), 1);
@@ -1680,6 +1706,7 @@ void tst_QStateMachine::postDelayedEventAndStop()
int id1 = machine.postDelayedEvent(new StringEvent("a"), 0);
QVERIFY(id1 != -1);
QSignalSpy stoppedSpy(&machine, SIGNAL(stopped()));
+ QVERIFY(stoppedSpy.isValid());
machine.stop();
QTRY_COMPARE(stoppedSpy.count(), 1);
QCOMPARE(machine.configuration().size(), 1);
@@ -1707,9 +1734,11 @@ void tst_QStateMachine::stopAndPostEvent()
QState *s1 = new QState(&machine);
machine.setInitialState(s1);
QSignalSpy startedSpy(&machine, SIGNAL(started()));
+ QVERIFY(startedSpy.isValid());
machine.start();
QTRY_COMPARE(startedSpy.count(), 1);
QSignalSpy stoppedSpy(&machine, SIGNAL(stopped()));
+ QVERIFY(stoppedSpy.isValid());
machine.stop();
QCOMPARE(stoppedSpy.count(), 0);
machine.postEvent(new QEvent(QEvent::User));
@@ -1729,6 +1758,7 @@ void tst_QStateMachine::stateFinished()
s1->addTransition(s1, SIGNAL(finished()), s2);
machine.setInitialState(s1);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.start();
QTRY_COMPARE(finishedSpy.count(), 1);
QCOMPARE(machine.configuration().size(), 1);
@@ -1766,6 +1796,7 @@ void tst_QStateMachine::parallelStates()
machine.setInitialState(s1);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.start();
QTRY_COMPARE(finishedSpy.count(), 1);
QCOMPARE(machine.configuration().size(), 1);
@@ -1788,6 +1819,7 @@ void tst_QStateMachine::parallelRootState()
s2->setInitialState(s2_f);
QSignalSpy startedSpy(&machine, SIGNAL(started()));
+ QVERIFY(startedSpy.isValid());
QTest::ignoreMessage(QtWarningMsg, "QStateMachine::start: No initial state set for machine. Refusing to start.");
machine.start();
QCoreApplication::processEvents();
@@ -1833,6 +1865,7 @@ void tst_QStateMachine::allSourceToTargetConfigurations()
s0->addTransition(new StringTransition("e", s211));
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.setInitialState(s0);
machine.start();
QCoreApplication::processEvents();
@@ -1919,6 +1952,7 @@ void tst_QStateMachine::signalTransitions()
QCOMPARE(trans->signal(), QByteArray(SIGNAL(signalWithNoArg())));
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.setInitialState(s0);
machine.start();
QCoreApplication::processEvents();
@@ -1969,6 +2003,7 @@ void tst_QStateMachine::signalTransitions()
QCOMPARE(trans->signal(), QByteArray("signalWithNoArg()"));
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.setInitialState(s0);
machine.start();
QCoreApplication::processEvents();
@@ -1993,6 +2028,7 @@ void tst_QStateMachine::signalTransitions()
s0->addTransition(trans);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.setInitialState(s0);
machine.start();
QCoreApplication::processEvents();
@@ -2014,6 +2050,7 @@ void tst_QStateMachine::signalTransitions()
s0->addTransition(trans);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.setInitialState(s0);
machine.start();
QCoreApplication::processEvents();
@@ -2045,6 +2082,7 @@ void tst_QStateMachine::signalTransitions()
s0->addTransition(trans);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.setInitialState(s0);
machine.start();
QCoreApplication::processEvents();
@@ -2063,6 +2101,7 @@ void tst_QStateMachine::signalTransitions()
QSignalTransition *t1 = s1->addTransition(&emitter, SIGNAL(signalWithNoArg()), s0);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.setInitialState(s0);
machine.start();
QCoreApplication::processEvents();
@@ -2112,6 +2151,8 @@ void tst_QStateMachine::signalTransitions()
QSignalSpy startedSpy(&machine, SIGNAL(started()));
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(startedSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
machine.setInitialState(s0);
machine.start();
@@ -2151,6 +2192,8 @@ void tst_QStateMachine::signalTransitions()
QSignalSpy startedSpy(&machine, SIGNAL(started()));
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(startedSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
machine.setInitialState(s0);
machine.start();
QTRY_COMPARE(startedSpy.count(), 1);
@@ -2212,6 +2255,7 @@ void tst_QStateMachine::eventTransitions()
s0->addTransition(trans);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.setInitialState(s0);
machine.start();
QCoreApplication::processEvents();
@@ -2264,6 +2308,7 @@ void tst_QStateMachine::eventTransitions()
s0->addTransition(trans);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.setInitialState(s0);
machine.start();
QCoreApplication::processEvents();
@@ -2289,6 +2334,7 @@ void tst_QStateMachine::eventTransitions()
s0->addTransition(trans);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.setInitialState(s0);
machine.start();
QCoreApplication::processEvents();
@@ -2311,6 +2357,7 @@ void tst_QStateMachine::eventTransitions()
s0->addTransition(trans);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.setInitialState(s0);
machine.start();
QCoreApplication::processEvents();
@@ -2336,6 +2383,7 @@ void tst_QStateMachine::eventTransitions()
s0->addTransition(trans);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.setInitialState(s0);
machine.start();
QCoreApplication::processEvents();
@@ -2358,6 +2406,7 @@ void tst_QStateMachine::eventTransitions()
s1->addTransition(t1);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.setInitialState(s0);
machine.start();
QCoreApplication::processEvents();
@@ -2408,6 +2457,8 @@ void tst_QStateMachine::eventTransitions()
QSignalSpy startedSpy(&machine, SIGNAL(started()));
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(startedSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
machine.setInitialState(s0);
machine.start();
@@ -2435,6 +2486,7 @@ void tst_QStateMachine::eventTransitions()
s0->addTransition(trans);
QSignalSpy startedSpy(&machine, SIGNAL(started()));
+ QVERIFY(startedSpy.isValid());
machine.setInitialState(s0);
machine.start();
QTest::ignoreMessage(QtWarningMsg, "QObject event transitions are not supported for custom types");
@@ -2452,6 +2504,7 @@ void tst_QStateMachine::eventTransitions()
QCOMPARE(trans->eventTypeReceived(), QEvent::None);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.setInitialState(s0);
machine.start();
QCoreApplication::processEvents();
@@ -2481,6 +2534,8 @@ void tst_QStateMachine::graphicsSceneEventTransitions()
QSignalSpy startedSpy(&machine, SIGNAL(started()));
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(startedSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
machine.start();
QTRY_COMPARE(startedSpy.count(), 1);
QVERIFY(finishedSpy.count() == 0);
@@ -2527,6 +2582,7 @@ void tst_QStateMachine::historyStates()
s0->setInitialState(s00);
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.start();
QCoreApplication::processEvents();
QCOMPARE(machine.configuration().size(), 2);
@@ -2565,6 +2621,11 @@ void tst_QStateMachine::startAndStop()
QSignalSpy startedSpy(&machine, SIGNAL(started()));
QSignalSpy stoppedSpy(&machine, SIGNAL(stopped()));
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+
+ QVERIFY(startedSpy.isValid());
+ QVERIFY(stoppedSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
+
QVERIFY(!machine.isRunning());
QTest::ignoreMessage(QtWarningMsg, "QStateMachine::start: No initial state set for machine. Refusing to start.");
machine.start();
@@ -2616,6 +2677,11 @@ void tst_QStateMachine::targetStateWithNoParent()
QSignalSpy startedSpy(&machine, SIGNAL(started()));
QSignalSpy stoppedSpy(&machine, SIGNAL(stopped()));
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+
+ QVERIFY(startedSpy.isValid());
+ QVERIFY(stoppedSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
+
machine.start();
QTest::ignoreMessage(QtWarningMsg, "Unrecoverable error detected in running state machine: No common ancestor for targets and source of transition from state 's1'");
QTRY_COMPARE(startedSpy.count(), 1);
@@ -3045,12 +3111,14 @@ void tst_QStateMachine::propertiesAssignedSignalTransitionsReuseAnimationGroup()
QParallelAnimationGroup animationGroup;
animationGroup.addAnimation(new QPropertyAnimation(object, "foo"));
QSignalSpy animationFinishedSpy(&animationGroup, SIGNAL(finished()));
+ QVERIFY(animationFinishedSpy.isValid());
s1->addTransition(s1, SIGNAL(propertiesAssigned()), s2)->addAnimation(&animationGroup);
s2->addTransition(s2, SIGNAL(propertiesAssigned()), s3)->addAnimation(&animationGroup);
s3->addTransition(s3, SIGNAL(propertiesAssigned()), s4);
machine.setInitialState(s1);
QSignalSpy machineFinishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(machineFinishedSpy.isValid());
machine.start();
QTRY_COMPARE(machineFinishedSpy.count(), 1);
QCOMPARE(machine.configuration().size(), 1);
@@ -3551,6 +3619,8 @@ void tst_QStateMachine::nestedStateMachines()
QSignalSpy startedSpy(&machine, SIGNAL(started()));
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(startedSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
machine.start();
QTRY_COMPARE(startedSpy.count(), 1);
QTRY_COMPARE(machine.configuration().count(), 1+2*3);
@@ -3573,6 +3643,7 @@ void tst_QStateMachine::goToState()
QState *s2 = new QState(&machine);
machine.setInitialState(s1);
QSignalSpy startedSpy(&machine, SIGNAL(started()));
+ QVERIFY(startedSpy.isValid());
machine.start();
QTRY_COMPARE(startedSpy.count(), 1);
@@ -3615,6 +3686,7 @@ void tst_QStateMachine::goToStateFromSourceWithTransition()
QState *s2 = new QState(&machine);
machine.setInitialState(s1);
QSignalSpy startedSpy(&machine, SIGNAL(started()));
+ QVERIFY(startedSpy.isValid());
machine.start();
QTRY_COMPARE(startedSpy.count(), 1);
@@ -3704,6 +3776,7 @@ void tst_QStateMachine::postEventFromOtherThread()
poster.start();
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(finishedSpy.isValid());
machine.start();
QTRY_COMPARE(finishedSpy.count(), 1);
}
@@ -3759,6 +3832,9 @@ void tst_QStateMachine::stopInTransitionToFinalState()
QSignalSpy stoppedSpy(&machine, SIGNAL(stopped()));
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
QSignalSpy s2EnteredSpy(s2, SIGNAL(entered()));
+ QVERIFY(stoppedSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
+ QVERIFY(s2EnteredSpy.isValid());
machine.start();
// Stopping should take precedence over finished.
@@ -3799,11 +3875,14 @@ void tst_QStateMachine::stopInEventTest()
machine.setInitialState(s1);
QSignalSpy startedSpy(&machine, SIGNAL(started()));
+ QVERIFY(startedSpy.isValid());
machine.start();
QTRY_COMPARE(startedSpy.count(), 1);
QSignalSpy stoppedSpy(&machine, SIGNAL(stopped()));
QSignalSpy finishedSpy(&machine, SIGNAL(finished()));
+ QVERIFY(stoppedSpy.isValid());
+ QVERIFY(finishedSpy.isValid());
machine.postEvent(new QEvent(QEvent::User), QStateMachine::EventPriority(eventPriority));
QTRY_COMPARE(stoppedSpy.count(), 1);
diff --git a/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp b/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp
index 1d79206b3a..f7969eb55e 100644
--- a/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp
+++ b/tests/auto/corelib/thread/qatomicint/tst_qatomicint.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp b/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp
index 9c73eb3d61..ac83601414 100644
--- a/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp
+++ b/tests/auto/corelib/thread/qatomicpointer/tst_qatomicpointer.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp b/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp
index 67d6998bb1..6669a5c4b4 100644
--- a/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp
+++ b/tests/auto/corelib/thread/qmutex/tst_qmutex.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/thread/qmutexlocker/tst_qmutexlocker.cpp b/tests/auto/corelib/thread/qmutexlocker/tst_qmutexlocker.cpp
index a6646215a0..e92dddca95 100644
--- a/tests/auto/corelib/thread/qmutexlocker/tst_qmutexlocker.cpp
+++ b/tests/auto/corelib/thread/qmutexlocker/tst_qmutexlocker.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/thread/qreadlocker/tst_qreadlocker.cpp b/tests/auto/corelib/thread/qreadlocker/tst_qreadlocker.cpp
index 7da7282ae4..4ba28f60ef 100644
--- a/tests/auto/corelib/thread/qreadlocker/tst_qreadlocker.cpp
+++ b/tests/auto/corelib/thread/qreadlocker/tst_qreadlocker.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp b/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
index 4acbf411c1..418ae02add 100644
--- a/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
+++ b/tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp b/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp
index d3537a459a..2901e8f6c9 100644
--- a/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp
+++ b/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/thread/qthread/tst_qthread.cpp b/tests/auto/corelib/thread/qthread/tst_qthread.cpp
index a8e04db2a0..1afd913fe9 100644
--- a/tests/auto/corelib/thread/qthread/tst_qthread.cpp
+++ b/tests/auto/corelib/thread/qthread/tst_qthread.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -1074,17 +1074,14 @@ void tst_QThread::wait2()
thread.start();
timer.start();
QVERIFY(!thread.wait(Waiting_Thread::WaitTime));
- qint64 elapsed = timer.elapsed();
-
- QVERIFY(elapsed >= Waiting_Thread::WaitTime);
- //QVERIFY(elapsed < Waiting_Thread::WaitTime * 1.4);
+ qint64 elapsed = timer.elapsed(); // On Windows, we sometimes get (WaitTime - 1).
+ QVERIFY2(elapsed >= Waiting_Thread::WaitTime - 1, qPrintable(QString::fromLatin1("elapsed: %1").arg(elapsed)));
timer.start();
thread.cond1.wakeOne();
QVERIFY(thread.wait(/*Waiting_Thread::WaitTime * 1.4*/));
elapsed = timer.elapsed();
- QVERIFY(elapsed >= Waiting_Thread::WaitTime);
- //QVERIFY(elapsed < Waiting_Thread::WaitTime * 1.4);
+ QVERIFY2(elapsed - Waiting_Thread::WaitTime >= -1, qPrintable(QString::fromLatin1("elapsed: %1").arg(elapsed)));
}
@@ -1116,9 +1113,7 @@ void tst_QThread::wait3_slowDestructor()
timer.start();
QVERIFY(!thread.wait(Waiting_Thread::WaitTime));
qint64 elapsed = timer.elapsed();
-
- QVERIFY(elapsed >= Waiting_Thread::WaitTime);
- //QVERIFY(elapsed < Waiting_Thread::WaitTime * 1.4);
+ QVERIFY2(elapsed >= Waiting_Thread::WaitTime - 1, qPrintable(QString::fromLatin1("elapsed: %1").arg(elapsed)));
slow.cond.wakeOne();
//now the thread should finish quickly
@@ -1233,7 +1228,7 @@ public:
}
void registerSocketNotifier(QSocketNotifier *) {}
void unregisterSocketNotifier(QSocketNotifier *) {}
- void registerTimer(int , int , QObject *) {}
+ void registerTimer(int, int, Qt::TimerType, QObject *) {}
bool unregisterTimer(int ) { return false; }
bool unregisterTimers(QObject *) { return false; }
QList<TimerInfo> registeredTimers(QObject *) const { return QList<TimerInfo>(); }
diff --git a/tests/auto/corelib/thread/qthreadonce/qthreadonce.cpp b/tests/auto/corelib/thread/qthreadonce/qthreadonce.cpp
index abd3d6bbef..c37823436a 100644
--- a/tests/auto/corelib/thread/qthreadonce/qthreadonce.cpp
+++ b/tests/auto/corelib/thread/qthreadonce/qthreadonce.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/thread/qthreadonce/qthreadonce.h b/tests/auto/corelib/thread/qthreadonce/qthreadonce.h
index c33625cbde..3c5a42e814 100644
--- a/tests/auto/corelib/thread/qthreadonce/qthreadonce.h
+++ b/tests/auto/corelib/thread/qthreadonce/qthreadonce.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp b/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp
index 21c716448b..81f57215cc 100644
--- a/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp
+++ b/tests/auto/corelib/thread/qthreadonce/tst_qthreadonce.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/thread/qthreadstorage/crashOnExit.cpp b/tests/auto/corelib/thread/qthreadstorage/crashOnExit.cpp
index 92efcf3b3d..4c5fcf916a 100644
--- a/tests/auto/corelib/thread/qthreadstorage/crashOnExit.cpp
+++ b/tests/auto/corelib/thread/qthreadstorage/crashOnExit.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -39,7 +39,8 @@
**
****************************************************************************/
-#include <QtCore/QtCore>
+#include <QtCore/QCoreApplication>
+#include <QtCore/QThreadStorage>
class Class
{
diff --git a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
index c343d1d8d4..c74b85154f 100644
--- a/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
+++ b/tests/auto/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -290,7 +290,11 @@ void tst_QThreadStorage::crashOnExit()
QProcess process;
// crashOnExit is always expected to be in the same directory
// as this test binary
+#ifdef Q_OS_MAC
+ process.start(QCoreApplication::applicationDirPath() + "/../../../crashOnExit");
+#else
process.start(QCoreApplication::applicationDirPath() + "/crashOnExit");
+#endif
QVERIFY(process.waitForFinished());
QVERIFY(process.exitStatus() != QProcess::CrashExit);
}
@@ -465,7 +469,7 @@ void tst_QThreadStorage::valueBased()
t2.someNumber = -128;
t3.someNumber = 78;
t1.someString = "hello";
- t2.someString = "trolltech";
+ t2.someString = "australia";
t3.someString = "nokia";
t1.start();
diff --git a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
index 4ffde9fcb8..6bb562e146 100644
--- a/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
+++ b/tests/auto/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -443,7 +443,7 @@ void tst_QWaitCondition::wakeOne()
for (x = 0; x < ThreadCount; ++x) {
thread[x].mutex = &mutex;
thread[x].cond = &cond;
- thread_exited[x] = FALSE;
+ thread_exited[x] = false;
thread[x].start();
// wait for thread to start
QVERIFY(thread[x].started.wait(&mutex, 1000));
@@ -468,7 +468,7 @@ void tst_QWaitCondition::wakeOne()
if (thread_exited[y])
continue;
if (thread[y].wait(exited > 0 ? 10 : 1000)) {
- thread_exited[y] = TRUE;
+ thread_exited[y] = true;
++exited;
}
}
@@ -487,7 +487,7 @@ void tst_QWaitCondition::wakeOne()
for (x = 0; x < ThreadCount; ++x) {
rwthread[x].readWriteLock = &readWriteLock;
rwthread[x].cond = &cond;
- thread_exited[x] = FALSE;
+ thread_exited[x] = false;
rwthread[x].start();
// wait for thread to start
QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000));
@@ -512,7 +512,7 @@ void tst_QWaitCondition::wakeOne()
if (thread_exited[y])
continue;
if (rwthread[y].wait(exited > 0 ? 10 : 1000)) {
- thread_exited[y] = TRUE;
+ thread_exited[y] = true;
++exited;
}
}
@@ -537,7 +537,7 @@ void tst_QWaitCondition::wakeOne()
for (x = 0; x < ThreadCount; ++x) {
thread[x].mutex = &mutex;
thread[x].cond = &cond;
- thread_exited[x] = FALSE;
+ thread_exited[x] = false;
thread[x].start();
// wait for thread to start
QVERIFY(thread[x].started.wait(&mutex, 1000));
@@ -564,7 +564,7 @@ void tst_QWaitCondition::wakeOne()
if (thread_exited[y])
continue;
if (thread[y].wait(exited > 0 ? 10 : 1000)) {
- thread_exited[y] = TRUE;
+ thread_exited[y] = true;
++exited;
}
}
@@ -583,7 +583,7 @@ void tst_QWaitCondition::wakeOne()
for (x = 0; x < ThreadCount; ++x) {
rwthread[x].readWriteLock = &readWriteLock;
rwthread[x].cond = &cond;
- thread_exited[x] = FALSE;
+ thread_exited[x] = false;
rwthread[x].start();
// wait for thread to start
QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000));
@@ -610,7 +610,7 @@ void tst_QWaitCondition::wakeOne()
if (thread_exited[y])
continue;
if (rwthread[y].wait(exited > 0 ? 10 : 1000)) {
- thread_exited[y] = TRUE;
+ thread_exited[y] = true;
++exited;
}
}
diff --git a/tests/auto/corelib/thread/qwritelocker/tst_qwritelocker.cpp b/tests/auto/corelib/thread/qwritelocker/tst_qwritelocker.cpp
index 6fb34bec86..f975351e32 100644
--- a/tests/auto/corelib/thread/qwritelocker/tst_qwritelocker.cpp
+++ b/tests/auto/corelib/thread/qwritelocker/tst_qwritelocker.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
index 4702c6e7de..5735c4043b 100644
--- a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
+++ b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -174,7 +174,7 @@ bool isSorted(ContainerType &container, LessThan lessThan)
template <typename ContainerType>
bool isSorted(ContainerType &container)
{
- return isSorted(container, qLess<Q_TYPENAME ContainerType::value_type>());
+ return isSorted(container, qLess<typename ContainerType::value_type>());
}
diff --git a/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp b/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp
index 2babc178a5..9ee006827f 100644
--- a/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp
+++ b/tests/auto/corelib/tools/qbitarray/tst_qbitarray.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
index 6d85b5a1f0..8767571f6c 100644
--- a/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
+++ b/tests/auto/corelib/tools/qbytearray/tst_qbytearray.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qbytearraymatcher/tst_qbytearraymatcher.cpp b/tests/auto/corelib/tools/qbytearraymatcher/tst_qbytearraymatcher.cpp
index cb153b4f8b..8bc827ef7f 100644
--- a/tests/auto/corelib/tools/qbytearraymatcher/tst_qbytearraymatcher.cpp
+++ b/tests/auto/corelib/tools/qbytearraymatcher/tst_qbytearraymatcher.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qcache/tst_qcache.cpp b/tests/auto/corelib/tools/qcache/tst_qcache.cpp
index dfc59eed9a..88b56612af 100644
--- a/tests/auto/corelib/tools/qcache/tst_qcache.cpp
+++ b/tests/auto/corelib/tools/qcache/tst_qcache.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qchar/tst_qchar.cpp b/tests/auto/corelib/tools/qchar/tst_qchar.cpp
index b7acbe63c5..c5fdeeb54a 100644
--- a/tests/auto/corelib/tools/qchar/tst_qchar.cpp
+++ b/tests/auto/corelib/tools/qchar/tst_qchar.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp b/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp
index c96b26bdfb..ad464dc40a 100644
--- a/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp
+++ b/tests/auto/corelib/tools/qcontiguouscache/tst_qcontiguouscache.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qcryptographichash/data/2c1517dad3678f03917f15849b052fd5.md5 b/tests/auto/corelib/tools/qcryptographichash/data/2c1517dad3678f03917f15849b052fd5.md5
new file mode 100644
index 0000000000..dd5c63cce1
--- /dev/null
+++ b/tests/auto/corelib/tools/qcryptographichash/data/2c1517dad3678f03917f15849b052fd5.md5
Binary files differ
diff --git a/tests/auto/corelib/tools/qcryptographichash/data/d41d8cd98f00b204e9800998ecf8427e.md5 b/tests/auto/corelib/tools/qcryptographichash/data/d41d8cd98f00b204e9800998ecf8427e.md5
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/corelib/tools/qcryptographichash/data/d41d8cd98f00b204e9800998ecf8427e.md5
diff --git a/tests/auto/corelib/tools/qcryptographichash/qcryptographichash.pro b/tests/auto/corelib/tools/qcryptographichash/qcryptographichash.pro
index 39987bac35..fddd67fbd6 100644
--- a/tests/auto/corelib/tools/qcryptographichash/qcryptographichash.pro
+++ b/tests/auto/corelib/tools/qcryptographichash/qcryptographichash.pro
@@ -2,3 +2,15 @@ CONFIG += testcase parallel_test
TARGET = tst_qcryptographichash
QT = core testlib
SOURCES = tst_qcryptographichash.cpp
+
+
+wince* {
+ addFiles.files = data/*
+ addFiles.path = data/
+ DEPLOYMENT += addFiles
+
+ DEFINES += SRCDIR=\\\".\\\"
+}
+else {
+ DEFINES += SRCDIR=\\\"$$PWD/\\\"
+} \ No newline at end of file
diff --git a/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp b/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp
index b8592e1850..14b41e178d 100644
--- a/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp
+++ b/tests/auto/corelib/tools/qcryptographichash/tst_qcryptographichash.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,6 +40,7 @@
****************************************************************************/
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
class tst_QCryptographicHash : public QObject
@@ -51,8 +52,9 @@ private slots:
void intermediary_result_data();
void intermediary_result();
void sha1();
+ void files_data();
+ void files();
};
-#include <QtCore>
void tst_QCryptographicHash::repeated_result_data()
{
@@ -150,5 +152,35 @@ void tst_QCryptographicHash::sha1()
}
+Q_DECLARE_METATYPE(QCryptographicHash::Algorithm);
+
+void tst_QCryptographicHash::files_data() {
+ QTest::addColumn<QString>("filename");
+ QTest::addColumn<QCryptographicHash::Algorithm>("algorithm");
+ QTest::addColumn<QByteArray>("md5sum");
+ QTest::newRow("Line") << QString::fromAscii("data/2c1517dad3678f03917f15849b052fd5.md5") << QCryptographicHash::Md5 << QByteArray("2c1517dad3678f03917f15849b052fd5");
+ QTest::newRow("Line") << QString::fromAscii("data/d41d8cd98f00b204e9800998ecf8427e.md5") << QCryptographicHash::Md5 << QByteArray("d41d8cd98f00b204e9800998ecf8427e");
+}
+
+
+void tst_QCryptographicHash::files()
+{
+ QFETCH(QString, filename);
+ QFETCH(QCryptographicHash::Algorithm, algorithm);
+ QFETCH(QByteArray, md5sum);
+ {
+ QFile f(QString::fromLocal8Bit(SRCDIR) + filename);
+ QCryptographicHash hash(algorithm);
+ QVERIFY(! hash.addData(&f)); // file is not open for reading;
+ if (f.open(QIODevice::ReadOnly)) {
+ QVERIFY(hash.addData(&f));
+ QCOMPARE(hash.result().toHex(),md5sum);
+ } else {
+ QFAIL("Failed to open file for testing. should not happen");
+ }
+ }
+}
+
+
QTEST_MAIN(tst_QCryptographicHash)
#include "tst_qcryptographichash.moc"
diff --git a/tests/auto/corelib/tools/qdate/tst_qdate.cpp b/tests/auto/corelib/tools/qdate/tst_qdate.cpp
index 936f82861f..7bb6de8c9f 100644
--- a/tests/auto/corelib/tools/qdate/tst_qdate.cpp
+++ b/tests/auto/corelib/tools/qdate/tst_qdate.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
index 8e385dfbdb..4ef508e92b 100644
--- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
+++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp
index 3044b4180d..a4a96c6df7 100644
--- a/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp
+++ b/tests/auto/corelib/tools/qeasingcurve/tst_qeasingcurve.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qelapsedtimer/tst_qelapsedtimer.cpp b/tests/auto/corelib/tools/qelapsedtimer/tst_qelapsedtimer.cpp
index 40b2d30c02..0e2f61ab98 100644
--- a/tests/auto/corelib/tools/qelapsedtimer/tst_qelapsedtimer.cpp
+++ b/tests/auto/corelib/tools/qelapsedtimer/tst_qelapsedtimer.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp b/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp
index a6c2f50e6d..a031bf811d 100644
--- a/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp
+++ b/tests/auto/corelib/tools/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qfreelist/tst_qfreelist.cpp b/tests/auto/corelib/tools/qfreelist/tst_qfreelist.cpp
index 0c1bb655b4..a713fd4ca7 100644
--- a/tests/auto/corelib/tools/qfreelist/tst_qfreelist.cpp
+++ b/tests/auto/corelib/tools/qfreelist/tst_qfreelist.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qhash/tst_qhash.cpp b/tests/auto/corelib/tools/qhash/tst_qhash.cpp
index 6d82831214..6c941179d6 100644
--- a/tests/auto/corelib/tools/qhash/tst_qhash.cpp
+++ b/tests/auto/corelib/tools/qhash/tst_qhash.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qline/tst_qline.cpp b/tests/auto/corelib/tools/qline/tst_qline.cpp
index 94fd279842..0c4df63884 100644
--- a/tests/auto/corelib/tools/qline/tst_qline.cpp
+++ b/tests/auto/corelib/tools/qline/tst_qline.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qlist/tst_qlist.cpp b/tests/auto/corelib/tools/qlist/tst_qlist.cpp
index 24fa94ac6f..c1b71de2b7 100644
--- a/tests/auto/corelib/tools/qlist/tst_qlist.cpp
+++ b/tests/auto/corelib/tools/qlist/tst_qlist.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.cpp b/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.cpp
index 030fc4a728..2b6280fd2b 100644
--- a/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.cpp
+++ b/tests/auto/corelib/tools/qlocale/syslocaleapp/syslocaleapp.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
index 8d4c15b5f9..a670cac03c 100644
--- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
+++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qmap/tst_qmap.cpp b/tests/auto/corelib/tools/qmap/tst_qmap.cpp
index f24311adef..c48bcfb4b3 100644
--- a/tests/auto/corelib/tools/qmap/tst_qmap.cpp
+++ b/tests/auto/corelib/tools/qmap/tst_qmap.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qmargins/tst_qmargins.cpp b/tests/auto/corelib/tools/qmargins/tst_qmargins.cpp
index e8cb23b9b6..bdaf98cbf2 100644
--- a/tests/auto/corelib/tools/qmargins/tst_qmargins.cpp
+++ b/tests/auto/corelib/tools/qmargins/tst_qmargins.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp b/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp
index 1e32c3afea..acdfd20488 100644
--- a/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp
+++ b/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qqueue/tst_qqueue.cpp b/tests/auto/corelib/tools/qqueue/tst_qqueue.cpp
index 483cf93918..5282d2964b 100644
--- a/tests/auto/corelib/tools/qqueue/tst_qqueue.cpp
+++ b/tests/auto/corelib/tools/qqueue/tst_qqueue.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qrect/tst_qrect.cpp b/tests/auto/corelib/tools/qrect/tst_qrect.cpp
index c1375c38f6..c2a9d05af6 100644
--- a/tests/auto/corelib/tools/qrect/tst_qrect.cpp
+++ b/tests/auto/corelib/tools/qrect/tst_qrect.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp
index d66e6b35da..836c02dfca 100644
--- a/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp
+++ b/tests/auto/corelib/tools/qregexp/tst_qregexp.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -348,7 +348,7 @@ void tst_QRegExp::indexIn_addMoreRows(const QByteArray &stri)
// miscellaneous
QTest::newRow( stri + "misc00" ) << QString(email)
- << QString("troll1@trolltech.com") << 0 << 20
+ << QString("email123@example.com") << 0 << 20
<< QStringList();
QTest::newRow( stri + "misc01" ) << QString("[0-9]*\\.[0-9]+") << QString("pi = 3.14") << 5 << 4
<< QStringList();
@@ -791,7 +791,7 @@ void tst_QRegExp::wildcard_data()
QTest::newRow( "data0" ) << QString("*.html") << QString("test.html") << 0;
QTest::newRow( "data1" ) << QString("*.html") << QString("test.htm") << -1;
QTest::newRow( "data2" ) << QString("bar*") << QString("foobarbaz") << 3;
- QTest::newRow( "data3" ) << QString("*") << QString("Trolltech") << 0;
+ QTest::newRow( "data3" ) << QString("*") << QString("Qt Rocks!") << 0;
QTest::newRow( "data4" ) << QString(".html") << QString("test.html") << 4;
QTest::newRow( "data5" ) << QString(".h") << QString("test.cpp") << -1;
QTest::newRow( "data6" ) << QString(".???l") << QString("test.html") << 4;
diff --git a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp
index ea90b2236d..67de98b867 100644
--- a/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp
+++ b/tests/auto/corelib/tools/qringbuffer/tst_qringbuffer.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp b/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp
index 186a6c2d5d..22f6cb7d32 100644
--- a/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp
+++ b/tests/auto/corelib/tools/qscopedpointer/tst_qscopedpointer.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp b/tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp
index 457733b7a8..c0e036e232 100644
--- a/tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp
+++ b/tests/auto/corelib/tools/qscopedvaluerollback/tst_qscopedvaluerollback.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qset/tst_qset.cpp b/tests/auto/corelib/tools/qset/tst_qset.cpp
index f03d769e13..4c0ecce5ec 100644
--- a/tests/auto/corelib/tools/qset/tst_qset.cpp
+++ b/tests/auto/corelib/tools/qset/tst_qset.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -57,10 +57,6 @@ class tst_QSet : public QObject
{
Q_OBJECT
-public:
- tst_QSet() {}
- virtual ~tst_QSet() {}
-
private slots:
void operator_eq();
void swap();
diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp
index e94b6d3fb9..c7ffe8cb7b 100644
--- a/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qsharedpointer/externaltests.h b/tests/auto/corelib/tools/qsharedpointer/externaltests.h
index e07ba31928..6903433b70 100644
--- a/tests/auto/corelib/tools/qsharedpointer/externaltests.h
+++ b/tests/auto/corelib/tools/qsharedpointer/externaltests.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qsharedpointer/forwarddeclaration.cpp b/tests/auto/corelib/tools/qsharedpointer/forwarddeclaration.cpp
index f6ee9ad02a..b5d59de037 100644
--- a/tests/auto/corelib/tools/qsharedpointer/forwarddeclaration.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/forwarddeclaration.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.cpp b/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.cpp
index 5ff8893b81..17812216c0 100644
--- a/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.h b/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.h
index 6afc293dde..cebbe94ef1 100644
--- a/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.h
+++ b/tests/auto/corelib/tools/qsharedpointer/forwarddeclared.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
index 7eb1bd2dee..35b63deb4c 100644
--- a/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -102,10 +102,10 @@ private slots:
void invalidConstructs();
public slots:
- void cleanup() { check(); }
+ void cleanup() { safetyCheck(); }
public:
- inline void check()
+ inline void safetyCheck()
{
#ifdef QT_BUILD_INTERNAL
QtSharedPointer::internalSafetyCheckCleanCheck();
@@ -607,7 +607,7 @@ void tst_QSharedPointer::qobjectWeakManagement()
delete obj;
QVERIFY(weak.isNull());
}
- check();
+ safetyCheck();
{
// same, bit with operator=
@@ -621,7 +621,7 @@ void tst_QSharedPointer::qobjectWeakManagement()
delete obj;
QVERIFY(weak.isNull());
}
- check();
+ safetyCheck();
{
// delete triggered by parent
@@ -634,7 +634,7 @@ void tst_QSharedPointer::qobjectWeakManagement()
delete parent;
QVERIFY(weak.isNull());
}
- check();
+ safetyCheck();
{
// same as above, but set the parent after QWeakPointer is created
@@ -649,7 +649,7 @@ void tst_QSharedPointer::qobjectWeakManagement()
delete parent;
QVERIFY(weak.isNull());
}
- check();
+ safetyCheck();
{
// with two QWeakPointers
@@ -666,7 +666,7 @@ void tst_QSharedPointer::qobjectWeakManagement()
delete obj;
QVERIFY(weak.isNull());
}
- check();
+ safetyCheck();
{
// same, but delete the pointer while two QWeakPointers exist
@@ -683,7 +683,7 @@ void tst_QSharedPointer::qobjectWeakManagement()
}
QVERIFY(weak.isNull());
}
- check();
+ safetyCheck();
}
void tst_QSharedPointer::noSharedPointerFromWeakQObject()
@@ -737,7 +737,7 @@ void tst_QSharedPointer::objectCast()
ptr = qobject_cast<QSharedPointer<OtherObject> >(baseptr);
QVERIFY(ptr == data);
}
- check();
+ safetyCheck();
{
const OtherObject *data = new OtherObject;
@@ -763,11 +763,10 @@ void tst_QSharedPointer::objectCast()
ptr = qobject_cast<QSharedPointer<const OtherObject> >(baseptr);
QVERIFY(ptr == data);
}
- check();
+ safetyCheck();
{
OtherObject *data = new OtherObject;
- QPointer<OtherObject> qptr = data;
QSharedPointer<OtherObject> ptr = QSharedPointer<OtherObject>(data);
QWeakPointer<QObject> weakptr = ptr;
@@ -788,7 +787,6 @@ void tst_QSharedPointer::objectCast()
// drop the reference:
ptr.clear();
QVERIFY(ptr.isNull());
- QVERIFY(qptr.isNull());
QVERIFY(weakptr.toStrongRef().isNull());
// verify that the object casts fail without crash
@@ -803,7 +801,7 @@ void tst_QSharedPointer::objectCast()
otherptr = qobject_cast<QSharedPointer<OtherObject> >(weakptr);
QVERIFY(otherptr.isNull());
}
- check();
+ safetyCheck();
}
void tst_QSharedPointer::differentPointers()
@@ -850,7 +848,7 @@ void tst_QSharedPointer::differentPointers()
QVERIFY(baseptr == aData);
QVERIFY(aData == baseptr);
}
- check();
+ safetyCheck();
{
DiffPtrDerivedData *aData = new DiffPtrDerivedData;
@@ -865,7 +863,7 @@ void tst_QSharedPointer::differentPointers()
QVERIFY(ptr == aBase);
QVERIFY(baseptr == aData);
}
- check();
+ safetyCheck();
{
DiffPtrDerivedData *aData = new DiffPtrDerivedData;
@@ -882,7 +880,7 @@ void tst_QSharedPointer::differentPointers()
QVERIFY(baseptr == aData);
QVERIFY(baseptr == aBase);
}
- check();
+ safetyCheck();
}
void tst_QSharedPointer::virtualBaseDifferentPointers()
@@ -902,7 +900,7 @@ void tst_QSharedPointer::virtualBaseDifferentPointers()
QVERIFY(baseptr == aData);
QVERIFY(baseptr == aBase);
}
- check();
+ safetyCheck();
{
VirtualDerived *aData = new VirtualDerived;
@@ -919,7 +917,7 @@ void tst_QSharedPointer::virtualBaseDifferentPointers()
QVERIFY(baseptr == aData);
QVERIFY(baseptr == aBase);
}
- check();
+ safetyCheck();
}
#ifndef QTEST_NO_RTTI
@@ -1086,7 +1084,7 @@ void tst_QSharedPointer::constCorrectness()
ptr = cvptr.constCast<Data>();
#endif
}
- check();
+ safetyCheck();
{
Data *aData = new Data;
@@ -1103,7 +1101,7 @@ void tst_QSharedPointer::constCorrectness()
QCOMPARE(cptr.data(), aData);
QCOMPARE(cptr.operator->(), aData);
}
- check();
+ safetyCheck();
}
static int customDeleterFnCallCount;
@@ -1137,13 +1135,13 @@ void tst_QSharedPointer::customDeleter()
QSharedPointer<Data> ptr2(new Data, &Data::alsoDelete);
QSharedPointer<Data> ptr3(new Data, &Data::virtualDelete);
}
- check();
+ safetyCheck();
{
QSharedPointer<DerivedData> ptr(new DerivedData, &Data::doDelete);
QSharedPointer<DerivedData> ptr2(new DerivedData, &Data::alsoDelete);
QSharedPointer<DerivedData> ptr3(new DerivedData, &Data::virtualDelete);
}
- check();
+ safetyCheck();
customDeleterFnCallCount = 0;
{
@@ -1152,7 +1150,7 @@ void tst_QSharedPointer::customDeleter()
QCOMPARE(customDeleterFnCallCount, 0);
}
QCOMPARE(customDeleterFnCallCount, 1);
- check();
+ safetyCheck();
customDeleterFnCallCount = 0;
{
@@ -1162,7 +1160,7 @@ void tst_QSharedPointer::customDeleter()
QCOMPARE(customDeleterFnCallCount, 1);
}
QCOMPARE(customDeleterFnCallCount, 1);
- check();
+ safetyCheck();
customDeleterFnCallCount = 0;
{
@@ -1172,7 +1170,7 @@ void tst_QSharedPointer::customDeleter()
QCOMPARE(customDeleterFnCallCount, 1);
}
QCOMPARE(customDeleterFnCallCount, 1);
- check();
+ safetyCheck();
customDeleterFnCallCount = 0;
{
@@ -1181,7 +1179,7 @@ void tst_QSharedPointer::customDeleter()
QCOMPARE(customDeleterFnCallCount, 0);
}
QCOMPARE(customDeleterFnCallCount, 1);
- check();
+ safetyCheck();
customDeleterFnCallCount = 0;
{
@@ -1190,7 +1188,7 @@ void tst_QSharedPointer::customDeleter()
QCOMPARE(customDeleterFnCallCount, 0);
}
QCOMPARE(customDeleterFnCallCount, 1);
- check();
+ safetyCheck();
customDeleterFnCallCount = 0;
{
@@ -1203,7 +1201,7 @@ void tst_QSharedPointer::customDeleter()
QCOMPARE(customDeleterFnCallCount, 0);
}
QCOMPARE(customDeleterFnCallCount, 1);
- check();
+ safetyCheck();
customDeleterFnCallCount = 0;
{
@@ -1216,7 +1214,7 @@ void tst_QSharedPointer::customDeleter()
QCOMPARE(customDeleterFnCallCount, 0);
}
QCOMPARE(customDeleterFnCallCount, 1);
- check();
+ safetyCheck();
refcount = 0;
CustomDeleter<Data> dataDeleter;
@@ -1228,7 +1226,7 @@ void tst_QSharedPointer::customDeleter()
}
QCOMPARE(dataDeleter.callCount, 1);
QCOMPARE(refcount, 1);
- check();
+ safetyCheck();
dataDeleter.callCount = 0;
{
@@ -1239,7 +1237,7 @@ void tst_QSharedPointer::customDeleter()
}
QCOMPARE(dataDeleter.callCount, 1);
QCOMPARE(refcount, 1);
- check();
+ safetyCheck();
dataDeleter.callCount = 0;
{
@@ -1253,7 +1251,7 @@ void tst_QSharedPointer::customDeleter()
}
QCOMPARE(dataDeleter.callCount, 1);
QCOMPARE(refcount, 1);
- check();
+ safetyCheck();
dataDeleter.callCount = 0;
{
@@ -1263,7 +1261,7 @@ void tst_QSharedPointer::customDeleter()
}
QCOMPARE(dataDeleter.callCount, 1);
QCOMPARE(refcount, 1);
- check();
+ safetyCheck();
CustomDeleter<DerivedData> derivedDataDeleter;
derivedDataDeleter.callCount = 0;
@@ -1277,7 +1275,7 @@ void tst_QSharedPointer::customDeleter()
QCOMPARE(dataDeleter.callCount, 0);
QCOMPARE(derivedDataDeleter.callCount, 1);
QCOMPARE(refcount, 2);
- check();
+ safetyCheck();
derivedDataDeleter.callCount = 0;
dataDeleter.callCount = 0;
@@ -1295,7 +1293,7 @@ void tst_QSharedPointer::customDeleter()
QCOMPARE(dataDeleter.callCount, 1);
QCOMPARE(derivedDataDeleter.callCount, 0);
QCOMPARE(refcount, 2);
- check();
+ safetyCheck();
derivedDataDeleter.callCount = 0;
dataDeleter.callCount = 0;
@@ -1313,7 +1311,7 @@ void tst_QSharedPointer::customDeleter()
QCOMPARE(dataDeleter.callCount, 0);
QCOMPARE(derivedDataDeleter.callCount, 1);
QCOMPARE(refcount, 2);
- check();
+ safetyCheck();
}
void customQObjectDeleterFn(QObject *obj)
@@ -1337,7 +1335,7 @@ void tst_QSharedPointer::creating()
ptr.clear();
QCOMPARE(Data::destructorCounter, 1);
}
- check();
+ safetyCheck();
Data::generationCounter = Data::destructorCounter = 0;
{
@@ -1353,7 +1351,7 @@ void tst_QSharedPointer::creating()
QVERIFY(d->weakref.load() == 1);
QVERIFY(d->strongref.load() == 0);
}
- check();
+ safetyCheck();
Data::generationCounter = Data::destructorCounter = 0;
DerivedData::derivedDestructorCounter = 0;
@@ -1366,7 +1364,7 @@ void tst_QSharedPointer::creating()
QCOMPARE(Data::destructorCounter, 1);
QCOMPARE(DerivedData::derivedDestructorCounter, 1);
}
- check();
+ safetyCheck();
{
QSharedPointer<Data> ptr = QSharedPointer<DiffPtrDerivedData>::create();
@@ -1375,7 +1373,7 @@ void tst_QSharedPointer::creating()
QCOMPARE(ptr.staticCast<DiffPtrDerivedData>()->buffer[3]+0, 16-3);
QCOMPARE(ptr.staticCast<DiffPtrDerivedData>()->buffer[0]+0, 16);
}
- check();
+ safetyCheck();
{
QSharedPointer<VirtualDerived> ptr = QSharedPointer<VirtualDerived>::create();
@@ -1385,7 +1383,7 @@ void tst_QSharedPointer::creating()
QSharedPointer<Data> baseptr = ptr;
QCOMPARE(baseptr->classLevel(), 4);
}
- check();
+ safetyCheck();
}
void tst_QSharedPointer::creatingQObject()
@@ -1399,13 +1397,13 @@ void tst_QSharedPointer::creatingQObject()
QVERIFY(qptr.isNull());
}
- check();
+ safetyCheck();
{
QSharedPointer<QObject> ptr = QSharedPointer<OtherObject>::create();
QCOMPARE(ptr->metaObject(), &OtherObject::staticMetaObject);
}
- check();
+ safetyCheck();
}
void tst_QSharedPointer::mixTrackingPointerCode()
@@ -1417,7 +1415,7 @@ void tst_QSharedPointer::mixTrackingPointerCode()
Wrapper w(ptr);
ptr.clear();
}
- check();
+ safetyCheck();
{
// pointer created without tracking
diff --git a/tests/auto/corelib/tools/qsharedpointer/wrapper.cpp b/tests/auto/corelib/tools/qsharedpointer/wrapper.cpp
index 018fc1c97b..889493ddb4 100644
--- a/tests/auto/corelib/tools/qsharedpointer/wrapper.cpp
+++ b/tests/auto/corelib/tools/qsharedpointer/wrapper.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qsharedpointer/wrapper.h b/tests/auto/corelib/tools/qsharedpointer/wrapper.h
index b25510f76d..66202a5a31 100644
--- a/tests/auto/corelib/tools/qsharedpointer/wrapper.h
+++ b/tests/auto/corelib/tools/qsharedpointer/wrapper.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qsize/tst_qsize.cpp b/tests/auto/corelib/tools/qsize/tst_qsize.cpp
index 5b6e4f85b1..bc40e2aa64 100644
--- a/tests/auto/corelib/tools/qsize/tst_qsize.cpp
+++ b/tests/auto/corelib/tools/qsize/tst_qsize.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qsizef/tst_qsizef.cpp b/tests/auto/corelib/tools/qsizef/tst_qsizef.cpp
index d2879612be..c74f4c3754 100644
--- a/tests/auto/corelib/tools/qsizef/tst_qsizef.cpp
+++ b/tests/auto/corelib/tools/qsizef/tst_qsizef.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qstl/tst_qstl.cpp b/tests/auto/corelib/tools/qstl/tst_qstl.cpp
index 43c318737f..f9e3549a4d 100644
--- a/tests/auto/corelib/tools/qstl/tst_qstl.cpp
+++ b/tests/auto/corelib/tools/qstl/tst_qstl.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qstring/double_data.h b/tests/auto/corelib/tools/qstring/double_data.h
index e7e654c442..8ffb981675 100644
--- a/tests/auto/corelib/tools/qstring/double_data.h
+++ b/tests/auto/corelib/tools/qstring/double_data.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
index 80cbabeaf6..ed525e3429 100644
--- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -121,8 +121,9 @@ private slots:
void simplified_data();
void simplified();
void trimmed();
- void toLower();
void toUpper();
+ void toLower();
+ void toCaseFolded();
void rightJustified();
void leftJustified();
void mid();
@@ -811,9 +812,6 @@ void tst_QString::constructorQByteArray()
void tst_QString::STL()
{
-#ifdef Q_CC_HPACC
- QSKIP("This test crashes on HP-UX with aCC");
-#endif
#ifndef QT_NO_STL
#ifndef QT_NO_CAST_TO_ASCII
QString qt( "QString" );
@@ -851,16 +849,13 @@ void tst_QString::STL()
QVERIFY( !stdstr3.length() );
#endif
-// Skip the rest of the test if glibc is not compiled with wide character support
-#if !(defined Q_CC_GNU && !defined _GLIBCPP_USE_WCHAR_T) && !defined QT_NO_STL_WCHAR
const wchar_t arr[] = {'h', 'e', 'l', 'l', 'o', 0};
- QStdWString stlStr = arr;
+ std::wstring stlStr = arr;
QString s = QString::fromStdWString(stlStr);
QCOMPARE(s, QString::fromLatin1("hello"));
QCOMPARE(stlStr, s.toStdWString());
-#endif
#else
QSKIP( "Not tested without STL support");
#endif
@@ -1571,14 +1566,28 @@ void tst_QString::toUpper()
QCOMPARE( QString(1, QChar(0xdf)).toUpper(), QString("SS"));
- QString lower;
+ QString lower, upper;
lower += QChar(QChar::highSurrogate(0x10428));
lower += QChar(QChar::lowSurrogate(0x10428));
- QString upper;
upper += QChar(QChar::highSurrogate(0x10400));
upper += QChar(QChar::lowSurrogate(0x10400));
QCOMPARE( lower.toUpper(), upper);
+ lower += lower;
+ upper += upper;
+ QCOMPARE( lower.toUpper(), upper);
+ // test for broken surrogate pair handling (low low hi low hi low)
+ lower.prepend(QChar(QChar::lowSurrogate(0x10428)));
+ lower.prepend(QChar(QChar::lowSurrogate(0x10428)));
+ upper.prepend(QChar(QChar::lowSurrogate(0x10428)));
+ upper.prepend(QChar(QChar::lowSurrogate(0x10428)));
+ QCOMPARE(lower.toUpper(), upper);
+ // test for broken surrogate pair handling (low low hi low hi low hi hi)
+ lower += QChar(QChar::highSurrogate(0x10428));
+ lower += QChar(QChar::highSurrogate(0x10428));
+ upper += QChar(QChar::highSurrogate(0x10428));
+ upper += QChar(QChar::highSurrogate(0x10428));
+ QCOMPARE(lower.toUpper(), upper);
#ifdef QT_USE_ICU
// test doesn't work with ICU support, since QChar is unaware of any locale
@@ -1616,13 +1625,28 @@ void tst_QString::toLower()
QCOMPARE( QString(1, QChar(0x130)).toLower(), QString(QString(1, QChar(0x69)) + QChar(0x307)));
- QString lower;
+ QString lower, upper;
lower += QChar(QChar::highSurrogate(0x10428));
lower += QChar(QChar::lowSurrogate(0x10428));
- QString upper;
upper += QChar(QChar::highSurrogate(0x10400));
upper += QChar(QChar::lowSurrogate(0x10400));
QCOMPARE( upper.toLower(), lower);
+ lower += lower;
+ upper += upper;
+ QCOMPARE( upper.toLower(), lower);
+
+ // test for broken surrogate pair handling (low low hi low hi low)
+ lower.prepend(QChar(QChar::lowSurrogate(0x10400)));
+ lower.prepend(QChar(QChar::lowSurrogate(0x10400)));
+ upper.prepend(QChar(QChar::lowSurrogate(0x10400)));
+ upper.prepend(QChar(QChar::lowSurrogate(0x10400)));
+ QCOMPARE( upper.toLower(), lower);
+ // test for broken surrogate pair handling (low low hi low hi low hi hi)
+ lower += QChar(QChar::highSurrogate(0x10400));
+ lower += QChar(QChar::highSurrogate(0x10400));
+ upper += QChar(QChar::highSurrogate(0x10400));
+ upper += QChar(QChar::highSurrogate(0x10400));
+ QCOMPARE( upper.toLower(), lower);
#ifdef QT_USE_ICU
// test doesn't work with ICU support, since QChar is unaware of any locale
@@ -1639,6 +1663,58 @@ void tst_QString::toLower()
#endif
}
+void tst_QString::toCaseFolded()
+{
+ QCOMPARE( QString().toCaseFolded(), QString() );
+ QCOMPARE( QString("").toCaseFolded(), QString("") );
+ QCOMPARE( QString("text").toCaseFolded(), QString("text") );
+ QCOMPARE( QString("Text").toCaseFolded(), QString("text") );
+ QCOMPARE( QString("tExt").toCaseFolded(), QString("text") );
+ QCOMPARE( QString("teXt").toCaseFolded(), QString("text") );
+ QCOMPARE( QString("texT").toCaseFolded(), QString("text") );
+ QCOMPARE( QString("TExt").toCaseFolded(), QString("text") );
+ QCOMPARE( QString("teXT").toCaseFolded(), QString("text") );
+ QCOMPARE( QString("tEXt").toCaseFolded(), QString("text") );
+ QCOMPARE( QString("tExT").toCaseFolded(), QString("text") );
+ QCOMPARE( QString("TEXT").toCaseFolded(), QString("text") );
+ QCOMPARE( QString("@ABYZ[").toCaseFolded(), QString("@abyz["));
+ QCOMPARE( QString("@abyz[").toCaseFolded(), QString("@abyz["));
+ QCOMPARE( QString("`ABYZ{").toCaseFolded(), QString("`abyz{"));
+ QCOMPARE( QString("`abyz{").toCaseFolded(), QString("`abyz{"));
+
+ QString lower, upper;
+ upper += QChar(QChar::highSurrogate(0x10400));
+ upper += QChar(QChar::lowSurrogate(0x10400));
+ lower += QChar(QChar::highSurrogate(0x10428));
+ lower += QChar(QChar::lowSurrogate(0x10428));
+ QCOMPARE( upper.toCaseFolded(), lower);
+ lower += lower;
+ upper += upper;
+ QCOMPARE( upper.toCaseFolded(), lower);
+
+ // test for broken surrogate pair handling (low low hi low hi low)
+ lower.prepend(QChar(QChar::lowSurrogate(0x10400)));
+ lower.prepend(QChar(QChar::lowSurrogate(0x10400)));
+ upper.prepend(QChar(QChar::lowSurrogate(0x10400)));
+ upper.prepend(QChar(QChar::lowSurrogate(0x10400)));
+ QCOMPARE(upper.toCaseFolded(), lower);
+ // test for broken surrogate pair handling (low low hi low hi low hi hi)
+ lower += QChar(QChar::highSurrogate(0x10400));
+ lower += QChar(QChar::highSurrogate(0x10400));
+ upper += QChar(QChar::highSurrogate(0x10400));
+ upper += QChar(QChar::highSurrogate(0x10400));
+ QCOMPARE(upper.toCaseFolded(), lower);
+
+ //### we currently don't support full case foldings
+ for (int i = 0; i < 65536; ++i) {
+ QString str(1, QChar(i));
+ QString lower = str.toCaseFolded();
+ QVERIFY(lower.length() >= 1);
+ if (lower.length() == 1)
+ QVERIFY(str.toCaseFolded() == QString(1, QChar(i).toCaseFolded()));
+ }
+}
+
void tst_QString::trimmed()
{
QString a;
diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp
index 4d453b0585..283e707c1b 100644
--- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp
+++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp
index 9a71955d62..fd92aafadd 100644
--- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp
+++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/tst_qstringbuilder1.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp
index 4979672647..6bdb607431 100644
--- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp
+++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/tst_qstringbuilder2.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp
index 2c6466ffe2..915c0d23ad 100644
--- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp
+++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/tst_qstringbuilder3.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp
index 7f709d1590..c9837a0489 100644
--- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp
+++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/tst_qstringbuilder4.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp
index b74e88753e..54ca9dd3a7 100644
--- a/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp
+++ b/tests/auto/corelib/tools/qstringlist/tst_qstringlist.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp b/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp
index e8f36c4840..10906902ff 100644
--- a/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp
+++ b/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -56,15 +56,9 @@ private slots:
void assignOperator();
};
-// Subclass that exposes the protected functions.
-class SubQStringMatcher : public QStringMatcher
-{
-public:
-};
-
void tst_QStringMatcher::qstringmatcher()
{
- SubQStringMatcher matcher;
+ QStringMatcher matcher;
QCOMPARE(matcher.caseSensitivity(), Qt::CaseSensitive);
QCOMPARE(matcher.indexIn("foo", 1), 1);
QCOMPARE(matcher.pattern(), QString());
@@ -73,7 +67,7 @@ void tst_QStringMatcher::qstringmatcher()
// public Qt::CaseSensitivity caseSensitivity() const
void tst_QStringMatcher::caseSensitivity()
{
- SubQStringMatcher matcher;
+ QStringMatcher matcher;
matcher.setCaseSensitivity(Qt::CaseSensitive);
QCOMPARE(matcher.caseSensitivity(), Qt::CaseSensitive);
@@ -106,7 +100,7 @@ void tst_QStringMatcher::indexIn()
QFETCH(int, from);
QFETCH(int, indexIn);
- SubQStringMatcher matcher;
+ QStringMatcher matcher;
matcher.setPattern(needle);
QCOMPARE(matcher.indexIn(haystack, from), indexIn);
@@ -133,7 +127,7 @@ void tst_QStringMatcher::setCaseSensitivity()
QFETCH(int, indexIn);
QFETCH(int, cs);
- SubQStringMatcher matcher;
+ QStringMatcher matcher;
matcher.setPattern(needle);
matcher.setCaseSensitivity(static_cast<Qt::CaseSensitivity> (cs));
diff --git a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp b/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp
index 0b3d1bbea1..c0dc253167 100644
--- a/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp
+++ b/tests/auto/corelib/tools/qstringref/tst_qstringref.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp b/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp
index a7abf6f589..100ddfcb12 100644
--- a/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp
+++ b/tests/auto/corelib/tools/qtextboundaryfinder/tst_qtextboundaryfinder.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qtime/tst_qtime.cpp b/tests/auto/corelib/tools/qtime/tst_qtime.cpp
index 33513df9ac..bc03e74b41 100644
--- a/tests/auto/corelib/tools/qtime/tst_qtime.cpp
+++ b/tests/auto/corelib/tools/qtime/tst_qtime.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp
index 0bc1352681..db08bc5724 100644
--- a/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp
+++ b/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -102,6 +102,7 @@ void tst_QTimeLine::range()
// Verify that you can change the range in the timeLine
timeLine.setFrameRange(10, 20);
QSignalSpy spy(&timeLine, SIGNAL(frameChanged(int)));
+ QVERIFY(spy.isValid());
timeLine.start();
#ifdef Q_OS_WINCE
QTest::qWait(1000);
@@ -131,6 +132,7 @@ void tst_QTimeLine::currentTime()
timeLine.setUpdateInterval((timeLine.duration()/2) / 33);
qRegisterMetaType<qreal>("qreal");
QSignalSpy spy(&timeLine, SIGNAL(valueChanged(qreal)));
+ QVERIFY(spy.isValid());
timeLine.setFrameRange(10, 20);
QCOMPARE(timeLine.currentTime(), 0);
timeLine.start();
@@ -200,6 +202,7 @@ void tst_QTimeLine::frameRate()
// Default speed
timeLine.setUpdateInterval(1000 / 33);
QSignalSpy spy(&timeLine, SIGNAL(frameChanged(int)));
+ QVERIFY(spy.isValid());
timeLine.start();
QTest::qWait(timeLine.duration()*2);
QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
@@ -223,6 +226,7 @@ void tst_QTimeLine::value()
// Default speed
qRegisterMetaType<qreal>("qreal");
QSignalSpy spy(&timeLine, SIGNAL(valueChanged(qreal)));
+ QVERIFY(spy.isValid());
timeLine.start();
QTest::qWait(timeLine.duration()/3);
QVERIFY(timeLine.currentValue() > 0);
@@ -253,6 +257,7 @@ void tst_QTimeLine::currentFrame()
// Default speed
QSignalSpy spy(&timeLine, SIGNAL(frameChanged(int)));
+ QVERIFY(spy.isValid());
timeLine.start();
QTest::qWait(timeLine.duration()/3);
QVERIFY(timeLine.currentFrame() > 10);
@@ -284,6 +289,7 @@ void tst_QTimeLine::loopCount()
// Default speed infiniti looping
QSignalSpy spy(&timeLine, SIGNAL(frameChanged(int)));
+ QVERIFY(spy.isValid());
timeLine.start();
QTest::qWait(timeLine.duration());
QCOMPARE(timeLine.state(), QTimeLine::Running);
@@ -302,6 +308,8 @@ void tst_QTimeLine::loopCount()
QSignalSpy finishedSpy(&timeLine, SIGNAL(finished()));
QSignalSpy frameChangedSpy(&timeLine, SIGNAL(frameChanged(int)));
+ QVERIFY(finishedSpy.isValid());
+ QVERIFY(frameChangedSpy.isValid());
QEventLoop loop;
connect(&timeLine, SIGNAL(finished()), &loop, SLOT(quit()));
@@ -451,6 +459,7 @@ void tst_QTimeLine::frameChanged()
timeLine.setFrameRange(0,9);
timeLine.setUpdateInterval(1000);
QSignalSpy spy(&timeLine, SIGNAL(frameChanged(int)));
+ QVERIFY(spy.isValid());
timeLine.start();
QTest::qWait(timeLine.duration()*2);
QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
@@ -473,6 +482,7 @@ void tst_QTimeLine::stopped()
timeLine.setFrameRange(0, 9);
qRegisterMetaType<QTimeLine::State>("QTimeLine::State");
QSignalSpy spy(&timeLine, SIGNAL(stateChanged(QTimeLine::State)));
+ QVERIFY(spy.isValid());
timeLine.start();
QTest::qWait(timeLine.duration()*2);
QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
@@ -490,6 +500,7 @@ void tst_QTimeLine::finished()
QTimeLine timeLine;
timeLine.setFrameRange(0,9);
QSignalSpy spy(&timeLine, SIGNAL(finished()));
+ QVERIFY(spy.isValid());
timeLine.start();
QTest::qWait(timeLine.duration()*2);
QCOMPARE(timeLine.state(), QTimeLine::NotRunning);
@@ -522,6 +533,7 @@ void tst_QTimeLine::multipleTimeLines()
QTimeLine timeLine(200);
timeLine.setFrameRange(0,99);
QSignalSpy spy(&timeLine, SIGNAL(finished()));
+ QVERIFY(spy.isValid());
QTimeLine timeLineKiller;
timeLineKiller.setFrameRange(0,99);
diff --git a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp
index 0bdc49a15a..cc2bbe2f1f 100644
--- a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp
+++ b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -55,6 +55,9 @@ private slots:
void appendCausingRealloc();
void resize();
void realloc();
+ void count();
+ void first();
+ void last();
};
int fooCtor = 0;
@@ -593,5 +596,110 @@ void tst_QVarLengthArray::realloc()
QVERIFY(reallocTestProceed);
}
+void tst_QVarLengthArray::count()
+{
+ // tests size(), count() and length(), since they're the same thing
+ {
+ const QVarLengthArray<int> list;
+ QCOMPARE(list.length(), 0);
+ QCOMPARE(list.count(), 0);
+ QCOMPARE(list.size(), 0);
+ }
+
+ {
+ QVarLengthArray<int> list;
+ list.append(0);
+ QCOMPARE(list.length(), 1);
+ QCOMPARE(list.count(), 1);
+ QCOMPARE(list.size(), 1);
+ }
+
+ {
+ QVarLengthArray<int> list;
+ list.append(0);
+ list.append(1);
+ QCOMPARE(list.length(), 2);
+ QCOMPARE(list.count(), 2);
+ QCOMPARE(list.size(), 2);
+ }
+
+ {
+ QVarLengthArray<int> list;
+ list.append(0);
+ list.append(0);
+ list.append(0);
+ QCOMPARE(list.length(), 3);
+ QCOMPARE(list.count(), 3);
+ QCOMPARE(list.size(), 3);
+ }
+
+ // test removals too
+ {
+ QVarLengthArray<int> list;
+ list.append(0);
+ list.append(0);
+ list.append(0);
+ QCOMPARE(list.length(), 3);
+ QCOMPARE(list.count(), 3);
+ QCOMPARE(list.size(), 3);
+ list.removeLast();
+ QCOMPARE(list.length(), 2);
+ QCOMPARE(list.count(), 2);
+ QCOMPARE(list.size(), 2);
+ list.removeLast();
+ QCOMPARE(list.length(), 1);
+ QCOMPARE(list.count(), 1);
+ QCOMPARE(list.size(), 1);
+ list.removeLast();
+ QCOMPARE(list.length(), 0);
+ QCOMPARE(list.count(), 0);
+ QCOMPARE(list.size(), 0);
+ }
+}
+
+void tst_QVarLengthArray::first()
+{
+ // append some items, make sure it stays sane
+ QVarLengthArray<int> list;
+ list.append(27);
+ QCOMPARE(list.first(), 27);
+ list.append(4);
+ QCOMPARE(list.first(), 27);
+ list.append(1987);
+ QCOMPARE(list.first(), 27);
+ QCOMPARE(list.length(), 3);
+
+ // remove some, make sure it stays sane
+ list.removeLast();
+ QCOMPARE(list.first(), 27);
+ QCOMPARE(list.length(), 2);
+
+ list.removeLast();
+ QCOMPARE(list.first(), 27);
+ QCOMPARE(list.length(), 1);
+}
+
+void tst_QVarLengthArray::last()
+{
+ // append some items, make sure it stays sane
+ QVarLengthArray<int> list;
+ list.append(27);
+ QCOMPARE(list.last(), 27);
+ list.append(4);
+ QCOMPARE(list.last(), 4);
+ list.append(1987);
+ QCOMPARE(list.last(), 1987);
+ QCOMPARE(list.length(), 3);
+
+ // remove some, make sure it stays sane
+ list.removeLast();
+ QCOMPARE(list.last(), 4);
+ QCOMPARE(list.length(), 2);
+
+ list.removeLast();
+ QCOMPARE(list.last(), 27);
+ QCOMPARE(list.length(), 1);
+}
+
QTEST_APPLESS_MAIN(tst_QVarLengthArray)
#include "tst_qvarlengtharray.moc"
diff --git a/tests/auto/corelib/tools/qvector/tst_qvector.cpp b/tests/auto/corelib/tools/qvector/tst_qvector.cpp
index 704d75b709..bed2e25d31 100644
--- a/tests/auto/corelib/tools/qvector/tst_qvector.cpp
+++ b/tests/auto/corelib/tools/qvector/tst_qvector.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/xml/qxmlstream/qc14n.h b/tests/auto/corelib/xml/qxmlstream/qc14n.h
index f7c17b5a7a..ed7bd3b323 100644
--- a/tests/auto/corelib/xml/qxmlstream/qc14n.h
+++ b/tests/auto/corelib/xml/qxmlstream/qc14n.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/corelib/xml/qxmlstream/setupSuite.sh b/tests/auto/corelib/xml/qxmlstream/setupSuite.sh
index 5d4947e5ae..ca85fa2884 100755
--- a/tests/auto/corelib/xml/qxmlstream/setupSuite.sh
+++ b/tests/auto/corelib/xml/qxmlstream/setupSuite.sh
@@ -1,7 +1,7 @@
#!/bin/sh
#############################################################################
##
-## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+## Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation (qt-info@nokia.com)
##
diff --git a/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp b/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp
index 12ebbb72a6..8d3ddfa096 100644
--- a/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp
+++ b/tests/auto/corelib/xml/qxmlstream/tst_qxmlstream.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbusabstractadaptor/myobject.h b/tests/auto/dbus/qdbusabstractadaptor/myobject.h
index 2aaaa7ecc5..a5dc47376d 100644
--- a/tests/auto/dbus/qdbusabstractadaptor/myobject.h
+++ b/tests/auto/dbus/qdbusabstractadaptor/myobject.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp
index a06232c4bd..ed027ae70c 100644
--- a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp
+++ b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/qmyserver.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp b/tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp
index ff684ff522..cc55a942c5 100644
--- a/tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp
+++ b/tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbusabstractinterface/interface.cpp b/tests/auto/dbus/qdbusabstractinterface/interface.cpp
index 849db93084..14a9db543c 100644
--- a/tests/auto/dbus/qdbusabstractinterface/interface.cpp
+++ b/tests/auto/dbus/qdbusabstractinterface/interface.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbusabstractinterface/interface.h b/tests/auto/dbus/qdbusabstractinterface/interface.h
index 0fb15fe6c5..1c1b1bdcb1 100644
--- a/tests/auto/dbus/qdbusabstractinterface/interface.h
+++ b/tests/auto/dbus/qdbusabstractinterface/interface.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbusabstractinterface/pinger.cpp b/tests/auto/dbus/qdbusabstractinterface/pinger.cpp
index 24113fbb1b..1bd767c8fc 100644
--- a/tests/auto/dbus/qdbusabstractinterface/pinger.cpp
+++ b/tests/auto/dbus/qdbusabstractinterface/pinger.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -43,7 +43,7 @@
* This file was generated by qdbusxml2cpp version 0.7
* Command line was: qdbusxml2cpp -i interface.h -p pinger com.trolltech.QtDBus.Pinger.xml
*
- * qdbusxml2cpp is Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+ * qdbusxml2cpp is Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
*
* This is an auto-generated file.
* This file may have been hand-edited. Look for HAND-EDIT comments
diff --git a/tests/auto/dbus/qdbusabstractinterface/pinger.h b/tests/auto/dbus/qdbusabstractinterface/pinger.h
index 739a14229f..e1acd41021 100644
--- a/tests/auto/dbus/qdbusabstractinterface/pinger.h
+++ b/tests/auto/dbus/qdbusabstractinterface/pinger.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -43,7 +43,7 @@
* This file was generated by qdbusxml2cpp version 0.7
* Command line was: qdbusxml2cpp -i interface.h -p pinger com.trolltech.QtDBus.Pinger.xml
*
- * qdbusxml2cpp is Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+ * qdbusxml2cpp is Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
*
* This is an auto-generated file.
* Do not edit! All changes made to it will be lost.
diff --git a/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp b/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp
index 393d6470c8..489bd4afdb 100644
--- a/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp
+++ b/tests/auto/dbus/qdbusabstractinterface/qpinger/qpinger.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp
index 994df058fa..84d2051f29 100644
--- a/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp
+++ b/tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
index f8f632d667..f6b9edcff1 100644
--- a/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
+++ b/tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
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 acd27386f5..a678ddd269 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
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbuscontext/tst_qdbuscontext.cpp b/tests/auto/dbus/qdbuscontext/tst_qdbuscontext.cpp
index 8041708151..de29f08ef8 100644
--- a/tests/auto/dbus/qdbuscontext/tst_qdbuscontext.cpp
+++ b/tests/auto/dbus/qdbuscontext/tst_qdbuscontext.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbusinterface/myobject.h b/tests/auto/dbus/qdbusinterface/myobject.h
index 3959823a77..68f5137a4b 100644
--- a/tests/auto/dbus/qdbusinterface/myobject.h
+++ b/tests/auto/dbus/qdbusinterface/myobject.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp b/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp
index dd15012222..cfd183c91e 100644
--- a/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp
+++ b/tests/auto/dbus/qdbusinterface/qmyserver/qmyserver.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbusinterface/tst_qdbusinterface.cpp b/tests/auto/dbus/qdbusinterface/tst_qdbusinterface.cpp
index 9156818158..dc8363db42 100644
--- a/tests/auto/dbus/qdbusinterface/tst_qdbusinterface.cpp
+++ b/tests/auto/dbus/qdbusinterface/tst_qdbusinterface.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbuslocalcalls/tst_qdbuslocalcalls.cpp b/tests/auto/dbus/qdbuslocalcalls/tst_qdbuslocalcalls.cpp
index 56431b8716..3d33e92f1f 100644
--- a/tests/auto/dbus/qdbuslocalcalls/tst_qdbuslocalcalls.cpp
+++ b/tests/auto/dbus/qdbuslocalcalls/tst_qdbuslocalcalls.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbusmarshall/common.h b/tests/auto/dbus/qdbusmarshall/common.h
index 9a102f0f75..f41cacc953 100644
--- a/tests/auto/dbus/qdbusmarshall/common.h
+++ b/tests/auto/dbus/qdbusmarshall/common.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbusmarshall/qpong/qpong.cpp b/tests/auto/dbus/qdbusmarshall/qpong/qpong.cpp
index fce6f59344..1d64e45be5 100644
--- a/tests/auto/dbus/qdbusmarshall/qpong/qpong.cpp
+++ b/tests/auto/dbus/qdbusmarshall/qpong/qpong.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp b/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
index 2843e15758..b302be85ad 100644
--- a/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
+++ b/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -96,6 +96,15 @@ private slots:
void demarshallPrimitives_data();
void demarshallPrimitives();
+ void demarshallStrings_data();
+ void demarshallStrings();
+
+ void demarshallInvalidStringList_data();
+ void demarshallInvalidStringList();
+
+ void demarshallInvalidByteArray_data();
+ void demarshallInvalidByteArray();
+
private:
int fileDescriptorForTest();
@@ -1260,5 +1269,216 @@ void tst_QDBusMarshall::demarshallPrimitives()
}
}
+void tst_QDBusMarshall::demarshallStrings_data()
+{
+ QTest::addColumn<QVariant>("value");
+ QTest::addColumn<char>("targetSig");
+ QTest::addColumn<QVariant>("expectedValue");
+
+ // All primitive types demarshall to null string types
+ typedef QPair<QVariant, char> ValSigPair;
+ const QList<ValSigPair> nullStringTypes
+ = QList<ValSigPair>()
+ << ValSigPair(qVariantFromValue(QString()), 's')
+ << ValSigPair(qVariantFromValue(QDBusObjectPath()), 'o')
+ << ValSigPair(qVariantFromValue(QDBusSignature()), 'g');
+ foreach (ValSigPair valSigPair, nullStringTypes) {
+ QTest::newRow("bool(false)") << QVariant(false) << valSigPair.second << valSigPair.first;
+ QTest::newRow("bool(true)") << QVariant(true) << valSigPair.second << valSigPair.first;
+ QTest::newRow("byte") << qVariantFromValue(uchar(1)) << valSigPair.second << valSigPair.first;
+ QTest::newRow("int16") << qVariantFromValue(short(2)) << valSigPair.second << valSigPair.first;
+ QTest::newRow("uint16") << qVariantFromValue(ushort(3)) << valSigPair.second << valSigPair.first;
+ QTest::newRow("int") << QVariant(1) << valSigPair.second << valSigPair.first;
+ QTest::newRow("uint") << QVariant(2U) << valSigPair.second << valSigPair.first;
+ QTest::newRow("int64") << QVariant(Q_INT64_C(3)) << valSigPair.second << valSigPair.first;
+ QTest::newRow("uint64") << QVariant(Q_UINT64_C(4)) << valSigPair.second << valSigPair.first;
+ QTest::newRow("double") << QVariant(42.5) << valSigPair.second << valSigPair.first;
+ }
+
+ // String types should demarshall to each other. This is a regression test
+ // to check released functionality is maintained even after checks have
+ // been added to string demarshalling
+ QTest::newRow("empty string->invalid objectpath") << QVariant("")
+ << 'o' << qVariantFromValue(QDBusObjectPath());
+ QTest::newRow("null string->invalid objectpath") << QVariant(QString())
+ << 'o' << qVariantFromValue(QDBusObjectPath());
+ QTest::newRow("string->invalid objectpath") << QVariant("invalid objectpath")
+ << 'o' << qVariantFromValue(QDBusObjectPath());
+ QTest::newRow("string->valid objectpath") << QVariant("/org/kde")
+ << 'o' << qVariantFromValue(QDBusObjectPath("/org/kde"));
+
+ QTest::newRow("empty string->invalid signature") << QVariant("")
+ << 'g' << qVariantFromValue(QDBusSignature());
+ QTest::newRow("null string->invalid signature") << QVariant(QString())
+ << 'g' << qVariantFromValue(QDBusSignature());
+ QTest::newRow("string->invalid signature") << QVariant("_invalid signature")
+ << 'g' << qVariantFromValue(QDBusSignature());
+ QTest::newRow("string->valid signature") << QVariant("s")
+ << 'g' << qVariantFromValue(QDBusSignature("s"));
+
+ QTest::newRow("objectpath->string") << qVariantFromValue(QDBusObjectPath("/org/kde"))
+ << 's' << qVariantFromValue(QString("/org/kde"));
+ QTest::newRow("objectpath->invalid signature") << qVariantFromValue(QDBusObjectPath("/org/kde"))
+ << 'g' << qVariantFromValue(QDBusSignature());
+
+ QTest::newRow("signature->string") << qVariantFromValue(QDBusSignature("s"))
+ << 's' << qVariantFromValue(QString("s"));
+ QTest::newRow("signature->invalid objectpath") << qVariantFromValue(QDBusSignature("s"))
+ << 'o' << qVariantFromValue(QDBusObjectPath());
+}
+
+QVariant demarshallAsString(const QDBusArgument& dbusArg, char targetSig)
+{
+ switch (targetSig) {
+ case 's': {
+ QString s;
+ dbusArg >> s;
+ return s;
+ }
+ case 'o': {
+ QDBusObjectPath op;
+ dbusArg >> op;
+ return qVariantFromValue(op);
+ }
+ case 'g' : {
+ QDBusSignature sig;
+ dbusArg >> sig;
+ return qVariantFromValue(sig);
+ }
+ default: {
+ return QVariant();
+ }
+ }
+}
+
+void tst_QDBusMarshall::demarshallStrings()
+{
+ QFETCH(QVariant, value);
+ QFETCH(char, targetSig);
+ QFETCH(QVariant, expectedValue);
+
+ QDBusConnection con = QDBusConnection::sessionBus();
+
+ QVERIFY(con.isConnected());
+
+ QDBusMessage msg = QDBusMessage::createMethodCall(serviceName, objectPath,
+ interfaceName, "ping");
+ QDBusArgument sendArg;
+ sendArg.beginStructure();
+ sendArg.appendVariant(value);
+ sendArg.endStructure();
+ msg.setArguments(QVariantList() << qVariantFromValue(sendArg));
+ QDBusMessage reply = con.call(msg);
+
+ const QDBusArgument receiveArg = qvariant_cast<QDBusArgument>(reply.arguments().at(0));
+ receiveArg.beginStructure();
+
+ QVariant receiveValue = demarshallAsString(receiveArg, targetSig);
+ QVERIFY2(receiveValue.isValid(), "Invalid targetSig in demarshallStrings_data()");
+ QVERIFY(compare(receiveValue, expectedValue));
+
+ receiveArg.endStructure();
+ QVERIFY(receiveArg.atEnd());
+}
+
+void tst_QDBusMarshall::demarshallInvalidStringList_data()
+{
+ addBasicTypesColumns();
+
+ // None of the basic types should demarshall to a string list
+ basicNumericTypes_data();
+ basicStringTypes_data();
+
+ // Arrays of non-string type should not demarshall to a string list
+ QList<bool> bools;
+ QTest::newRow("emptyboollist") << qVariantFromValue(bools);
+ bools << false << true << false;
+ QTest::newRow("boollist") << qVariantFromValue(bools);
+
+ // Structures should not demarshall to a QByteArray
+ QTest::newRow("struct of strings")
+ << qVariantFromValue(QVariantList() << QString("foo") << QString("bar"));
+ QTest::newRow("struct of mixed types")
+ << qVariantFromValue(QVariantList() << QString("foo") << int(42) << double(3.14));
+}
+
+void tst_QDBusMarshall::demarshallInvalidStringList()
+{
+ QFETCH(QVariant, value);
+
+ QDBusConnection con = QDBusConnection::sessionBus();
+
+ QVERIFY(con.isConnected());
+
+ QDBusMessage msg = QDBusMessage::createMethodCall(serviceName, objectPath,
+ interfaceName, "ping");
+ QDBusArgument sendArg;
+ sendArg.beginStructure();
+ sendArg.appendVariant(value);
+ sendArg.endStructure();
+ msg.setArguments(QVariantList() << qVariantFromValue(sendArg));
+ QDBusMessage reply = con.call(msg);
+
+ const QDBusArgument receiveArg = qvariant_cast<QDBusArgument>(reply.arguments().at(0));
+ receiveArg.beginStructure();
+
+ QStringList receiveValue;
+ receiveArg >> receiveValue;
+ QCOMPARE(receiveValue, QStringList());
+
+ receiveArg.endStructure();
+ QVERIFY(receiveArg.atEnd());
+}
+
+void tst_QDBusMarshall::demarshallInvalidByteArray_data()
+{
+ addBasicTypesColumns();
+
+ // None of the basic types should demarshall to a QByteArray
+ basicNumericTypes_data();
+ basicStringTypes_data();
+
+ // Arrays of other types than byte should not demarshall to a QByteArray
+ QList<bool> bools;
+ QTest::newRow("empty array of bool") << qVariantFromValue(bools);
+ bools << true << false << true;
+ QTest::newRow("non-empty array of bool") << qVariantFromValue(bools);
+
+ // Structures should not demarshall to a QByteArray
+ QTest::newRow("struct of bytes")
+ << qVariantFromValue(QVariantList() << uchar(1) << uchar(2));
+
+ QTest::newRow("struct of mixed types")
+ << qVariantFromValue(QVariantList() << int(42) << QString("foo") << double(3.14));
+}
+
+void tst_QDBusMarshall::demarshallInvalidByteArray()
+{
+ QFETCH(QVariant, value);
+
+ QDBusConnection con = QDBusConnection::sessionBus();
+
+ QVERIFY(con.isConnected());
+
+ QDBusMessage msg = QDBusMessage::createMethodCall(serviceName, objectPath,
+ interfaceName, "ping");
+ QDBusArgument sendArg;
+ sendArg.beginStructure();
+ sendArg.appendVariant(value);
+ sendArg.endStructure();
+ msg.setArguments(QVariantList() << qVariantFromValue(sendArg));
+ QDBusMessage reply = con.call(msg);
+
+ const QDBusArgument receiveArg = qvariant_cast<QDBusArgument>(reply.arguments().at(0));
+ receiveArg.beginStructure();
+
+ QByteArray receiveValue;
+ receiveArg >> receiveValue;
+ QCOMPARE(receiveValue, QByteArray());
+
+ receiveArg.endStructure();
+ QVERIFY(receiveArg.atEnd());
+}
+
QTEST_MAIN(tst_QDBusMarshall)
#include "tst_qdbusmarshall.moc"
diff --git a/tests/auto/dbus/qdbusmetaobject/tst_qdbusmetaobject.cpp b/tests/auto/dbus/qdbusmetaobject/tst_qdbusmetaobject.cpp
index 7711e819a0..8de6ad1ce5 100644
--- a/tests/auto/dbus/qdbusmetaobject/tst_qdbusmetaobject.cpp
+++ b/tests/auto/dbus/qdbusmetaobject/tst_qdbusmetaobject.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbusmetatype/tst_qdbusmetatype.cpp b/tests/auto/dbus/qdbusmetatype/tst_qdbusmetatype.cpp
index 7e1f651a1b..9055fdeaac 100644
--- a/tests/auto/dbus/qdbusmetatype/tst_qdbusmetatype.cpp
+++ b/tests/auto/dbus/qdbusmetatype/tst_qdbusmetatype.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp b/tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp
index face4742b1..447532b427 100644
--- a/tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp
+++ b/tests/auto/dbus/qdbuspendingcall/tst_qdbuspendingcall.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbuspendingreply/tst_qdbuspendingreply.cpp b/tests/auto/dbus/qdbuspendingreply/tst_qdbuspendingreply.cpp
index 9eb69392c4..347c164eda 100644
--- a/tests/auto/dbus/qdbuspendingreply/tst_qdbuspendingreply.cpp
+++ b/tests/auto/dbus/qdbuspendingreply/tst_qdbuspendingreply.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbusreply/tst_qdbusreply.cpp b/tests/auto/dbus/qdbusreply/tst_qdbusreply.cpp
index 8d18657c56..ffa7275c6a 100644
--- a/tests/auto/dbus/qdbusreply/tst_qdbusreply.cpp
+++ b/tests/auto/dbus/qdbusreply/tst_qdbusreply.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp b/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp
index 99aeefa8ee..a07d21c4c6 100644
--- a/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp
+++ b/tests/auto/dbus/qdbusservicewatcher/tst_qdbusservicewatcher.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbusthreading/tst_qdbusthreading.cpp b/tests/auto/dbus/qdbusthreading/tst_qdbusthreading.cpp
index 32ede6c97f..4f88f223d3 100644
--- a/tests/auto/dbus/qdbusthreading/tst_qdbusthreading.cpp
+++ b/tests/auto/dbus/qdbusthreading/tst_qdbusthreading.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbustype/tst_qdbustype.cpp b/tests/auto/dbus/qdbustype/tst_qdbustype.cpp
index 5c46b4684a..453ff629b8 100644
--- a/tests/auto/dbus/qdbustype/tst_qdbustype.cpp
+++ b/tests/auto/dbus/qdbustype/tst_qdbustype.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp b/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp
index e0f03307f3..42a3fd19cc 100644
--- a/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp
+++ b/tests/auto/dbus/qdbusxmlparser/tst_qdbusxmlparser.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp b/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp
index a6fc7a8212..40cd9b848a 100644
--- a/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp
+++ b/tests/auto/gui/image/qicoimageformat/tst_qicoimageformat.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/image/qicon/tst_qicon.cpp b/tests/auto/gui/image/qicon/tst_qicon.cpp
index 39a68943df..55b0c81529 100644
--- a/tests/auto/gui/image/qicon/tst_qicon.cpp
+++ b/tests/auto/gui/image/qicon/tst_qicon.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp
index be34cf51cf..479acea3fd 100644
--- a/tests/auto/gui/image/qimage/tst_qimage.cpp
+++ b/tests/auto/gui/image/qimage/tst_qimage.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/image/qimageiohandler/tst_qimageiohandler.cpp b/tests/auto/gui/image/qimageiohandler/tst_qimageiohandler.cpp
index 1b2e4fab0e..acf4e4f4ea 100644
--- a/tests/auto/gui/image/qimageiohandler/tst_qimageiohandler.cpp
+++ b/tests/auto/gui/image/qimageiohandler/tst_qimageiohandler.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/image/qimagereader/images/txts.png b/tests/auto/gui/image/qimagereader/images/txts.png
index 99be1eb4f9..99be1eb4f9 100755..100644
--- a/tests/auto/gui/image/qimagereader/images/txts.png
+++ b/tests/auto/gui/image/qimagereader/images/txts.png
Binary files differ
diff --git a/tests/auto/gui/image/qimagereader/qimagereader.pro b/tests/auto/gui/image/qimagereader/qimagereader.pro
index fc2b97267c..14d23f05ba 100644
--- a/tests/auto/gui/image/qimagereader/qimagereader.pro
+++ b/tests/auto/gui/image/qimagereader/qimagereader.pro
@@ -4,20 +4,10 @@ SOURCES += tst_qimagereader.cpp
MOC_DIR=tmp
QT += widgets widgets-private core-private gui-private network testlib
RESOURCES += qimagereader.qrc
-DEFINES += SRCDIR=\\\"$$PWD\\\"
win32-msvc:QMAKE_CXXFLAGS -= -Zm200
win32-msvc:QMAKE_CXXFLAGS += -Zm800
win32-msvc.net:QMAKE_CXXFLAGS -= -Zm300
win32-msvc.net:QMAKE_CXXFLAGS += -Zm1100
-wince*: {
- images.files = images
- images.path = .
-
- imagePlugins.files = $$QT_BUILD_TREE/plugins/imageformats/*.dll
- imagePlugins.path = imageformats
-
- DEPLOYMENT += images imagePlugins
- DEFINES += SRCDIR=\\\".\\\"
-}
+TESTDATA += images/* baseline/*
diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
index d0bbc57632..7504ab3466 100644
--- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -54,6 +54,7 @@
#include <QTcpSocket>
#include <QTcpServer>
#include <QTimer>
+#include <QTemporaryDir>
typedef QMap<QString, QString> QStringMap;
typedef QList<int> QIntList;
@@ -176,9 +177,11 @@ private slots:
void preserveTexts_data();
void preserveTexts();
-};
-static const QLatin1String prefix(SRCDIR "/images/");
+private:
+ QString prefix;
+ QTemporaryDir m_temporaryDir;
+};
// helper to skip an autotest when the given image format is not supported
#define SKIP_IF_UNSUPPORTED(format) do { \
@@ -203,8 +206,10 @@ void tst_QImageReader::getSetCheck()
delete var1;
}
-tst_QImageReader::tst_QImageReader()
+tst_QImageReader::tst_QImageReader() :
+ m_temporaryDir(QStringLiteral("tst_qimagereaderXXXXXX"))
{
+ m_temporaryDir.setAutoRemove(true);
}
tst_QImageReader::~tst_QImageReader()
@@ -214,6 +219,8 @@ tst_QImageReader::~tst_QImageReader()
void tst_QImageReader::init()
{
+ prefix = QFINDTESTDATA("images/");
+ QVERIFY(m_temporaryDir.isValid());
}
void tst_QImageReader::cleanup()
@@ -1041,6 +1048,20 @@ void tst_QImageReader::readFromDevice_data()
QTest::newRow("svg") << QString("rect.svg") << QByteArray("svg");
QTest::newRow("svgz") << QString("rect.svgz") << QByteArray("svgz");
+#if defined QTEST_HAVE_TGA
+ QTest::newRow("tga") << QString("test-flag.tga") << QByteArray("tga");
+#endif
+}
+
+static QByteArray msgReadFromDeviceFail(const QString &sourceFileName,
+ const QByteArray &detectedFormat)
+{
+ QByteArray result = "Failure for '";
+ result += sourceFileName.toLocal8Bit();
+ result += "', detected as: '";
+ result += detectedFormat;
+ result += '\'';
+ return result;
}
void tst_QImageReader::readFromDevice()
@@ -1050,9 +1071,9 @@ void tst_QImageReader::readFromDevice()
SKIP_IF_UNSUPPORTED(format);
- QImage expectedImage(prefix + fileName, format);
-
- QFile file(prefix + fileName);
+ const QString imageFileName = prefix + fileName;
+ QImage expectedImage(imageFileName, format);
+ QFile file(imageFileName);
QVERIFY(file.open(QFile::ReadOnly));
QByteArray imageData = file.readAll();
QVERIFY(!imageData.isEmpty());
@@ -1065,6 +1086,7 @@ void tst_QImageReader::readFromDevice()
QVERIFY(reader.canRead());
QImage imageReaderImage = reader.read();
+ QVERIFY2(!imageReaderImage.isNull(), msgReadFromDeviceFail(imageFileName, reader.format()).constData());
QCOMPARE(imageReaderImage, expectedImage);
buffer.seek(0);
@@ -1846,6 +1868,19 @@ void tst_QImageReader::testIgnoresFormatAndExtension_data()
QTest::newRow("rect.svgz") << "rect" << "svgz" << "svgz";
}
+static QByteArray msgIgnoreFormatAndExtensionFail(const QString &sourceFileName,
+ const QString &targetFileName,
+ const QString &detectedFormat)
+{
+ QByteArray result = "Failure for '";
+ result += sourceFileName.toLocal8Bit();
+ result += "' as '";
+ result += targetFileName;
+ result += "', detected as: '";
+ result += detectedFormat.toLocal8Bit();
+ result += '\'';
+ return result;
+}
void tst_QImageReader::testIgnoresFormatAndExtension()
{
@@ -1856,21 +1891,26 @@ void tst_QImageReader::testIgnoresFormatAndExtension()
SKIP_IF_UNSUPPORTED(expected.toLatin1());
QList<QByteArray> formats = QImageReader::supportedImageFormats();
- QString fileNameBase = prefix + name + ".";
+ QString fileNameBase = prefix + name + QLatin1Char('.');
+ QString tempPath = m_temporaryDir.path();
+ if (!tempPath.endsWith(QLatin1Char('/')))
+ tempPath += QLatin1Char('/');
foreach (const QByteArray &f, formats) {
if (f == extension)
continue;
- QFile tmp(QDir::tempPath() + "/" + name + "_" + expected + "." + f);
- QVERIFY(QFile::copy(fileNameBase + extension, QFileInfo(tmp).absoluteFilePath()));
+ QFile tmp(tempPath + name + QLatin1Char('_') + expected + QLatin1Char('.') + f);
+ const QString sourceFileName = fileNameBase + extension;
+ const QString tempFileName = QFileInfo(tmp).absoluteFilePath();
+ QVERIFY(QFile::copy(sourceFileName, tempFileName));
QString format;
QImage image;
{
// image reader needs to be scoped for the remove() to work..
QImageReader r;
- r.setFileName(QFileInfo(tmp).absoluteFilePath());
+ r.setFileName(tempFileName);
r.setDecideFormatFromContent(true);
format = r.format();
r.read(&image);
@@ -1878,7 +1918,7 @@ void tst_QImageReader::testIgnoresFormatAndExtension()
tmp.remove();
- QVERIFY(!image.isNull());
+ QVERIFY2(!image.isNull(), msgIgnoreFormatAndExtensionFail(sourceFileName, tempFileName, format).constData());
QCOMPARE(format, expected);
}
}
diff --git a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
index 8a1f79e91a..9acf210eeb 100644
--- a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
+++ b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/image/qmovie/qmovie.pro b/tests/auto/gui/image/qmovie/qmovie.pro
index d565418d6d..5da0b80670 100644
--- a/tests/auto/gui/image/qmovie/qmovie.pro
+++ b/tests/auto/gui/image/qmovie/qmovie.pro
@@ -8,11 +8,5 @@ MOC_DIR=tmp
!contains(QT_CONFIG, no-jpeg):DEFINES += QTEST_HAVE_JPEG
!contains(QT_CONFIG, no-mng):DEFINES += QTEST_HAVE_MNG
-wince*: {
- addFiles.files = animations\\*
- addFiles.path = animations
- DEPLOYMENT += addFiles
-}
-
RESOURCES += resources.qrc
-
+TESTDATA += animations/*
diff --git a/tests/auto/gui/image/qmovie/tst_qmovie.cpp b/tests/auto/gui/image/qmovie/tst_qmovie.cpp
index b2d0360e33..d0c5e91f57 100644
--- a/tests/auto/gui/image/qmovie/tst_qmovie.cpp
+++ b/tests/auto/gui/image/qmovie/tst_qmovie.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -152,7 +152,7 @@ void tst_QMovie::playMovie()
QFETCH(QString, fileName);
QFETCH(int, frameCount);
- QMovie movie(fileName);
+ QMovie movie(QFINDTESTDATA(fileName));
QCOMPARE(movie.state(), QMovie::NotRunning);
movie.setSpeed(1000);
diff --git a/tests/auto/gui/image/qpicture/tst_qpicture.cpp b/tests/auto/gui/image/qpicture/tst_qpicture.cpp
index ea7e7c3e49..d4dc254dcb 100644
--- a/tests/auto/gui/image/qpicture/tst_qpicture.cpp
+++ b/tests/auto/gui/image/qpicture/tst_qpicture.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
index c15d1e6976..7ae680dbdb 100644
--- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -329,7 +329,7 @@ void tst_QPixmap::convertFromImage()
pix = QPixmap::fromImage(img2);
QPixmap res = QPixmap::fromImage(img2);
- QVERIFY( pixmapsAreEqual(&pix, &res) );
+ QCOMPARE(pix, res);
}
void tst_QPixmap::scroll_data()
@@ -1149,7 +1149,7 @@ void tst_QPixmap::copy()
trans.fill(Qt::transparent);
QPixmap transCopy = trans.copy();
- QVERIFY(pixmapsAreEqual(&trans, &transCopy));
+ QCOMPARE(trans, transCopy);
}
void tst_QPixmap::depthOfNullObjects()
@@ -1317,7 +1317,7 @@ void tst_QPixmap::loadFromDataImage()
QPixmap directLoadingPixmap;
directLoadingPixmap.loadFromData(rawData);
- QVERIFY(pixmapsAreEqual(&pixmapWithCopy, &directLoadingPixmap));
+ QCOMPARE(pixmapWithCopy, directLoadingPixmap);
}
void tst_QPixmap::fromImageReader_data()
@@ -1348,7 +1348,7 @@ void tst_QPixmap::fromImageReader()
QPixmap directLoadingPixmap = QPixmap::fromImageReader(&imageReader);
- QVERIFY(pixmapsAreEqual(&pixmapWithCopy, &directLoadingPixmap));
+ QCOMPARE(pixmapWithCopy, directLoadingPixmap);
}
void tst_QPixmap::fromImageReaderAnimatedGif_data()
@@ -1376,7 +1376,7 @@ void tst_QPixmap::fromImageReaderAnimatedGif()
QPixmap refPixmap = QPixmap::fromImage(refImage);
QPixmap directLoadingPixmap = QPixmap::fromImageReader(&pixmapReader);
- QVERIFY(pixmapsAreEqual(&refPixmap, &directLoadingPixmap));
+ QCOMPARE(refPixmap, directLoadingPixmap);
}
}
diff --git a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
index cd3c357d79..c79e42f908 100644
--- a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
+++ b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/image/qpixmapfilter/tst_qpixmapfilter.cpp b/tests/auto/gui/image/qpixmapfilter/tst_qpixmapfilter.cpp
index c89e09ea97..91ba2332d1 100644
--- a/tests/auto/gui/image/qpixmapfilter/tst_qpixmapfilter.cpp
+++ b/tests/auto/gui/image/qpixmapfilter/tst_qpixmapfilter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/image/qvolatileimage/tst_qvolatileimage.cpp b/tests/auto/gui/image/qvolatileimage/tst_qvolatileimage.cpp
index 053160fc7e..158ccc5770 100644
--- a/tests/auto/gui/image/qvolatileimage/tst_qvolatileimage.cpp
+++ b/tests/auto/gui/image/qvolatileimage/tst_qvolatileimage.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/kernel/qclipboard/copier/copier.pro b/tests/auto/gui/kernel/qclipboard/copier/copier.pro
index d345d33eb5..1c188ca7de 100644
--- a/tests/auto/gui/kernel/qclipboard/copier/copier.pro
+++ b/tests/auto/gui/kernel/qclipboard/copier/copier.pro
@@ -3,7 +3,6 @@ TARGET =
DEPENDPATH += .
INCLUDEPATH += .
CONFIG -= app_bundle
-QT += widgets
win32: DESTDIR = ../copier
# Input
SOURCES += main.cpp
diff --git a/tests/auto/gui/kernel/qclipboard/copier/main.cpp b/tests/auto/gui/kernel/qclipboard/copier/main.cpp
index e4417352ff..7e3efa03ba 100644
--- a/tests/auto/gui/kernel/qclipboard/copier/main.cpp
+++ b/tests/auto/gui/kernel/qclipboard/copier/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -38,17 +38,19 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include <QApplication>
-#include <QClipboard>
-#include <QStringList>
+#include <QtGui/QGuiApplication>
+#include <QtGui/QClipboard>
+#include <QtCore/QStringList>
+
int main(int argc, char **argv)
{
- QApplication app(argc, argv);
- QClipboard *board = QApplication::clipboard();
-#ifdef Q_OS_WINCE
- board->setText(QLatin1String("testString.!"));
-#else
- board->setText(app.arguments().at(1));
+ QGuiApplication app(argc, argv);
+ QString paste = QStringLiteral("testString.!");
+#ifndef Q_OS_WINCE
+ const QStringList arguments = app.arguments();
+ if (arguments.size() > 1)
+ paste = arguments.at(1);
#endif
+ QGuiApplication::clipboard()->setText(paste);
return 0;
}
diff --git a/tests/auto/gui/kernel/qclipboard/paster/main.cpp b/tests/auto/gui/kernel/qclipboard/paster/main.cpp
index 4df4d7fb45..3ca4886f0b 100644
--- a/tests/auto/gui/kernel/qclipboard/paster/main.cpp
+++ b/tests/auto/gui/kernel/qclipboard/paster/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -38,17 +38,18 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include <QApplication>
-#include <QClipboard>
-#include <QStringList>
+#include <QtGui/QGuiApplication>
+#include <QtGui/QClipboard>
+#include <QtCore/QStringList>
int main(int argc, char **argv)
{
- QApplication app(argc, argv);
- QClipboard *board = QApplication::clipboard();
-#ifdef Q_OS_WINCE
- return (board->text() == QLatin1String("testString.!")) ? 0 : 1;
-#else
- return (board->text() == app.arguments().at(1)) ? 0 : 1;
+ QGuiApplication app(argc, argv);
+ QString expected = QStringLiteral("testString.!");
+#ifndef Q_OS_WINCE
+ const QStringList arguments = app.arguments();
+ if (arguments.size() > 1)
+ expected = arguments.at(1);
#endif
+ return QGuiApplication::clipboard()->text() == expected ? 0 : 1;
}
diff --git a/tests/auto/gui/kernel/qclipboard/paster/paster.pro b/tests/auto/gui/kernel/qclipboard/paster/paster.pro
index d214c9e90a..2f50eefb1e 100644
--- a/tests/auto/gui/kernel/qclipboard/paster/paster.pro
+++ b/tests/auto/gui/kernel/qclipboard/paster/paster.pro
@@ -4,7 +4,6 @@ DEPENDPATH += .
INCLUDEPATH += .
win32: DESTDIR = ../paster
CONFIG -= app_bundle
-QT += widgets
# Input
SOURCES += main.cpp
diff --git a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
index 29fabefc72..fcba0958e7 100644
--- a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
+++ b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -42,7 +42,9 @@
#include <QtTest/QtTest>
#include <QtCore/QDebug>
-#include <QtWidgets/QApplication>
+#include <QtCore/QFileInfo>
+#include <QtCore/QDir>
+#include <QtGui/QGuiApplication>
#include <QtGui/QClipboard>
#ifdef Q_WS_MAC
#include <Carbon/Carbon.h>
@@ -52,8 +54,9 @@ class tst_QClipboard : public QObject
{
Q_OBJECT
private slots:
+ void init();
void copy_exit_paste();
- void capabiliyFunctions();
+ void capabilityFunctions();
void modes();
void testSignals();
void setMimeData();
@@ -63,6 +66,11 @@ private:
bool nativeClipboardWorking();
};
+void tst_QClipboard::init()
+{
+ const QString testdataDir = QFileInfo(QFINDTESTDATA("copier")).absolutePath();
+ QVERIFY2(QDir::setCurrent(testdataDir), qPrintable("Could not chdir to " + testdataDir));
+}
bool tst_QClipboard::nativeClipboardWorking()
{
@@ -82,9 +90,9 @@ Q_DECLARE_METATYPE(QClipboard::Mode)
Tests that the capability functions are implemented on all
platforms.
*/
-void tst_QClipboard::capabiliyFunctions()
+void tst_QClipboard::capabilityFunctions()
{
- QClipboard * const clipboard = QApplication::clipboard();
+ QClipboard * const clipboard = QGuiApplication::clipboard();
clipboard->supportsSelection();
clipboard->supportsFindBuffer();
@@ -99,7 +107,7 @@ void tst_QClipboard::capabiliyFunctions()
*/
void tst_QClipboard::modes()
{
- QClipboard * const clipboard = QApplication::clipboard();
+ QClipboard * const clipboard = QGuiApplication::clipboard();
if (!nativeClipboardWorking())
QSKIP("Native clipboard not working in this setup");
@@ -124,7 +132,7 @@ void tst_QClipboard::modes()
}
/*
- Test that the appropriate signals are emitted when the cliboard
+ Test that the appropriate signals are emitted when the clipboard
contents is changed by calling the qt functions.
*/
void tst_QClipboard::testSignals()
@@ -134,7 +142,7 @@ void tst_QClipboard::testSignals()
if (!nativeClipboardWorking())
QSKIP("Native clipboard not working in this setup");
- QClipboard * const clipboard = QApplication::clipboard();
+ QClipboard * const clipboard = QGuiApplication::clipboard();
QSignalSpy changedSpy(clipboard, SIGNAL(changed(QClipboard::Mode)));
QSignalSpy dataChangedSpy(clipboard, SIGNAL(dataChanged()));
@@ -182,6 +190,44 @@ void tst_QClipboard::testSignals()
QCOMPARE(dataChangedSpy.count(), 1);
}
+static bool runHelper(const QString &program, const QStringList &arguments, QByteArray *errorMessage)
+{
+ QProcess process;
+ process.setReadChannelMode(QProcess::ForwardedChannels);
+ process.start(program, arguments);
+ if (!process.waitForStarted()) {
+ *errorMessage = "Unable to start '" + program.toLocal8Bit() + " ': "
+ + process.errorString().toLocal8Bit();
+ return false;
+ }
+
+ // Windows: Due to implementation changes, the event loop needs
+ // to be spun since we ourselves also need to answer the
+ // WM_DRAWCLIPBOARD message as we are in the chain of clipboard
+ // viewers.
+ bool running = true;
+ for (int i = 0; i < 60 && running; ++i) {
+ QGuiApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
+ if (process.waitForFinished(500))
+ running = false;
+ }
+ if (running) {
+ process.kill();
+ *errorMessage = "Timeout running '" + program.toLocal8Bit() + '\'';
+ return false;
+ }
+ if (process.exitStatus() != QProcess::NormalExit) {
+ *errorMessage = "Process '" + program.toLocal8Bit() + "' crashed.";
+ return false;
+ }
+ if (process.exitCode()) {
+ *errorMessage = "Process '" + program.toLocal8Bit() + "' returns "
+ + QByteArray::number(process.exitCode());
+ return false;
+ }
+ return true;
+}
+
// Test that pasted text remains on the clipboard after a Qt application exits.
void tst_QClipboard::copy_exit_paste()
{
@@ -192,13 +238,16 @@ void tst_QClipboard::copy_exit_paste()
#endif
if (!nativeClipboardWorking())
QSKIP("Native clipboard not working in this setup");
- const QStringList stringArgument = QStringList() << "Test string.";
- QCOMPARE(QProcess::execute("copier/copier", stringArgument), 0);
+ const QStringList stringArgument(QStringLiteral("Test string."));
+ QByteArray errorMessage;
+ QVERIFY2(runHelper(QStringLiteral("copier/copier"), stringArgument, &errorMessage),
+ errorMessage.constData());
#ifdef Q_OS_MAC
// The Pasteboard needs a moment to breathe (at least on older Macs).
QTest::qWait(100);
#endif
- QCOMPARE(QProcess::execute("paster/paster", stringArgument), 0);
+ QVERIFY2(runHelper(QStringLiteral("paster/paster"), stringArgument, &errorMessage),
+ errorMessage.constData());
#endif
}
@@ -214,33 +263,33 @@ void tst_QClipboard::setMimeData()
mimeData->setText(QLatin1String("Qt/CE foo"));
#endif
- QApplication::clipboard()->setMimeData(mimeData);
- QCOMPARE(QApplication::clipboard()->mimeData(), (const QMimeData *)mimeData);
- QCOMPARE(QApplication::clipboard()->mimeData()->objectName(), TestName);
+ QGuiApplication::clipboard()->setMimeData(mimeData);
+ QCOMPARE(QGuiApplication::clipboard()->mimeData(), (const QMimeData *)mimeData);
+ QCOMPARE(QGuiApplication::clipboard()->mimeData()->objectName(), TestName);
// set it to the same data again, it shouldn't delete mimeData (and crash as a result)
- QApplication::clipboard()->setMimeData(mimeData);
- QCOMPARE(QApplication::clipboard()->mimeData(), (const QMimeData *)mimeData);
- QCOMPARE(QApplication::clipboard()->mimeData()->objectName(), TestName);
- QApplication::clipboard()->clear();
- const QMimeData *appMimeData = QApplication::clipboard()->mimeData();
+ QGuiApplication::clipboard()->setMimeData(mimeData);
+ QCOMPARE(QGuiApplication::clipboard()->mimeData(), (const QMimeData *)mimeData);
+ QCOMPARE(QGuiApplication::clipboard()->mimeData()->objectName(), TestName);
+ QGuiApplication::clipboard()->clear();
+ const QMimeData *appMimeData = QGuiApplication::clipboard()->mimeData();
QVERIFY(appMimeData != mimeData || appMimeData->objectName() != TestName);
// check for crash when using the same mimedata object on several clipboards
QMimeData *data = new QMimeData;
data->setText("foo");
- QApplication::clipboard()->setMimeData(data, QClipboard::Clipboard);
- QApplication::clipboard()->setMimeData(data, QClipboard::Selection);
- QApplication::clipboard()->setMimeData(data, QClipboard::FindBuffer);
+ QGuiApplication::clipboard()->setMimeData(data, QClipboard::Clipboard);
+ QGuiApplication::clipboard()->setMimeData(data, QClipboard::Selection);
+ QGuiApplication::clipboard()->setMimeData(data, QClipboard::FindBuffer);
- QSignalSpy spySelection(QApplication::clipboard(), SIGNAL(selectionChanged()));
- QSignalSpy spyData(QApplication::clipboard(), SIGNAL(dataChanged()));
- QSignalSpy spyFindBuffer(QApplication::clipboard(), SIGNAL(findBufferChanged()));
+ QSignalSpy spySelection(QGuiApplication::clipboard(), SIGNAL(selectionChanged()));
+ QSignalSpy spyData(QGuiApplication::clipboard(), SIGNAL(dataChanged()));
+ QSignalSpy spyFindBuffer(QGuiApplication::clipboard(), SIGNAL(findBufferChanged()));
- QApplication::clipboard()->clear(QClipboard::Clipboard);
- QApplication::clipboard()->clear(QClipboard::Selection); // used to crash on X11
- QApplication::clipboard()->clear(QClipboard::FindBuffer);
+ QGuiApplication::clipboard()->clear(QClipboard::Clipboard);
+ QGuiApplication::clipboard()->clear(QClipboard::Selection); // used to crash on X11
+ QGuiApplication::clipboard()->clear(QClipboard::FindBuffer);
#if defined(Q_WS_X11)
QCOMPARE(spySelection.count(), 1);
@@ -260,9 +309,9 @@ void tst_QClipboard::setMimeData()
data = new QMimeData;
data->setText("foo");
- QApplication::clipboard()->setMimeData(data, QClipboard::Clipboard);
- QApplication::clipboard()->setMimeData(data, QClipboard::Selection);
- QApplication::clipboard()->setMimeData(data, QClipboard::FindBuffer);
+ QGuiApplication::clipboard()->setMimeData(data, QClipboard::Clipboard);
+ QGuiApplication::clipboard()->setMimeData(data, QClipboard::Selection);
+ QGuiApplication::clipboard()->setMimeData(data, QClipboard::FindBuffer);
QMimeData *newData = new QMimeData;
newData->setText("bar");
@@ -271,9 +320,9 @@ void tst_QClipboard::setMimeData()
spyData.clear();
spyFindBuffer.clear();
- QApplication::clipboard()->setMimeData(newData, QClipboard::Clipboard);
- QApplication::clipboard()->setMimeData(newData, QClipboard::Selection); // used to crash on X11
- QApplication::clipboard()->setMimeData(newData, QClipboard::FindBuffer);
+ QGuiApplication::clipboard()->setMimeData(newData, QClipboard::Clipboard);
+ QGuiApplication::clipboard()->setMimeData(newData, QClipboard::Selection); // used to crash on X11
+ QGuiApplication::clipboard()->setMimeData(newData, QClipboard::FindBuffer);
#if defined(Q_WS_X11)
QCOMPARE(spySelection.count(), 1);
@@ -292,7 +341,7 @@ void tst_QClipboard::setMimeData()
void tst_QClipboard::clearBeforeSetText()
{
- QApplication::processEvents();
+ QGuiApplication::processEvents();
if (!nativeClipboardWorking())
QSKIP("Native clipboard not working in this setup");
@@ -300,30 +349,30 @@ void tst_QClipboard::clearBeforeSetText()
const QString text = "tst_QClipboard::clearBeforeSetText()";
// setText() should work after processEvents()
- QApplication::clipboard()->setText(text);
- QCOMPARE(QApplication::clipboard()->text(), text);
- QApplication::processEvents();
- QCOMPARE(QApplication::clipboard()->text(), text);
+ QGuiApplication::clipboard()->setText(text);
+ QCOMPARE(QGuiApplication::clipboard()->text(), text);
+ QGuiApplication::processEvents();
+ QCOMPARE(QGuiApplication::clipboard()->text(), text);
// same with clear()
- QApplication::clipboard()->clear();
- QVERIFY(QApplication::clipboard()->text().isEmpty());
- QApplication::processEvents();
- QVERIFY(QApplication::clipboard()->text().isEmpty());
+ QGuiApplication::clipboard()->clear();
+ QVERIFY(QGuiApplication::clipboard()->text().isEmpty());
+ QGuiApplication::processEvents();
+ QVERIFY(QGuiApplication::clipboard()->text().isEmpty());
// setText() again
- QApplication::clipboard()->setText(text);
- QCOMPARE(QApplication::clipboard()->text(), text);
- QApplication::processEvents();
- QCOMPARE(QApplication::clipboard()->text(), text);
+ QGuiApplication::clipboard()->setText(text);
+ QCOMPARE(QGuiApplication::clipboard()->text(), text);
+ QGuiApplication::processEvents();
+ QCOMPARE(QGuiApplication::clipboard()->text(), text);
// clear() immediately followed by setText() should still return the text
- QApplication::clipboard()->clear();
- QVERIFY(QApplication::clipboard()->text().isEmpty());
- QApplication::clipboard()->setText(text);
- QCOMPARE(QApplication::clipboard()->text(), text);
- QApplication::processEvents();
- QCOMPARE(QApplication::clipboard()->text(), text);
+ QGuiApplication::clipboard()->clear();
+ QVERIFY(QGuiApplication::clipboard()->text().isEmpty());
+ QGuiApplication::clipboard()->setText(text);
+ QCOMPARE(QGuiApplication::clipboard()->text(), text);
+ QGuiApplication::processEvents();
+ QCOMPARE(QGuiApplication::clipboard()->text(), text);
}
QTEST_MAIN(tst_QClipboard)
diff --git a/tests/auto/gui/kernel/qdrag/tst_qdrag.cpp b/tests/auto/gui/kernel/qdrag/tst_qdrag.cpp
index 8723c6614b..47ff1b05f1 100644
--- a/tests/auto/gui/kernel/qdrag/tst_qdrag.cpp
+++ b/tests/auto/gui/kernel/qdrag/tst_qdrag.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/kernel/qevent/tst_qevent.cpp b/tests/auto/gui/kernel/qevent/tst_qevent.cpp
index 7e39c11e2c..f0771330f7 100644
--- a/tests/auto/gui/kernel/qevent/tst_qevent.cpp
+++ b/tests/auto/gui/kernel/qevent/tst_qevent.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/kernel/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.cpp b/tests/auto/gui/kernel/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.cpp
index 5d1a6a390f..0c0bff551b 100644
--- a/tests/auto/gui/kernel/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.cpp
+++ b/tests/auto/gui/kernel/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp b/tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp
index 00008a80f0..207356fe84 100644
--- a/tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp
+++ b/tests/auto/gui/kernel/qfileopenevent/test/tst_qfileopenevent.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -163,11 +163,11 @@ void tst_qfileopenevent::handleLifetime()
qFile.close();
// check the content
- QFile check("testHandleLifetime");
- check.open(QFile::ReadOnly);
- QString content(check.readAll());
+ QFile checkContent("testHandleLifetime");
+ checkContent.open(QFile::ReadOnly);
+ QString content(checkContent.readAll());
QCOMPARE(content, QLatin1String("test content+closed original handles"));
- check.close();
+ checkContent.close();
QFile::remove(QLatin1String("testHandleLifetime"));
}
@@ -214,11 +214,11 @@ void tst_qfileopenevent::sendAndReceive()
QCoreApplication::instance()->sendPostedEvents();
// check the content
- QFile check("testSendAndReceive");
- QCOMPARE(check.open(QFile::ReadOnly), true);
- QString content(check.readAll());
+ QFile checkContent("testSendAndReceive");
+ QCOMPARE(checkContent.open(QFile::ReadOnly), true);
+ QString content(checkContent.readAll());
QCOMPARE(content, QLatin1String("sending+received"));
- check.close();
+ checkContent.close();
QFile::remove(QLatin1String("testSendAndReceive"));
}
diff --git a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
index 98314a9336..d0f12ea945 100644
--- a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
+++ b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -56,6 +56,8 @@ private slots:
void createCopy();
void sizeOf_data();
void sizeOf();
+ void flags_data();
+ void flags();
void construct_data();
void construct();
void constructCopy_data();
@@ -320,6 +322,30 @@ struct TypeAlignment
#endif
};
+void tst_QGuiMetaType::flags_data()
+{
+ QTest::addColumn<int>("type");
+ QTest::addColumn<bool>("isMovable");
+ QTest::addColumn<bool>("isComplex");
+
+#define ADD_METATYPE_TEST_ROW(MetaTypeName, MetaTypeId, RealType) \
+ QTest::newRow(#RealType) << MetaTypeId << bool(!QTypeInfo<RealType>::isStatic) << bool(QTypeInfo<RealType>::isComplex);
+QT_FOR_EACH_STATIC_GUI_CLASS(ADD_METATYPE_TEST_ROW)
+#undef ADD_METATYPE_TEST_ROW
+}
+
+void tst_QGuiMetaType::flags()
+{
+ QFETCH(int, type);
+ QFETCH(bool, isMovable);
+ QFETCH(bool, isComplex);
+
+ QCOMPARE(bool(QMetaType::typeFlags(type) & QMetaType::NeedsConstruction), isComplex);
+ QCOMPARE(bool(QMetaType::typeFlags(type) & QMetaType::NeedsDestruction), isComplex);
+ QCOMPARE(bool(QMetaType::typeFlags(type) & QMetaType::MovableType), isMovable);
+}
+
+
void tst_QGuiMetaType::construct_data()
{
create_data();
diff --git a/tests/auto/gui/kernel/qguivariant/tst_qguivariant.cpp b/tests/auto/gui/kernel/qguivariant/tst_qguivariant.cpp
index 988580b874..56a1fb0d8f 100644
--- a/tests/auto/gui/kernel/qguivariant/tst_qguivariant.cpp
+++ b/tests/auto/gui/kernel/qguivariant/tst_qguivariant.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/kernel/qinputpanel/tst_qinputpanel.cpp b/tests/auto/gui/kernel/qinputpanel/tst_qinputpanel.cpp
index 26bde8aa19..b46899a84d 100644
--- a/tests/auto/gui/kernel/qinputpanel/tst_qinputpanel.cpp
+++ b/tests/auto/gui/kernel/qinputpanel/tst_qinputpanel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -54,6 +54,8 @@ public:
m_updateCallCount(0),
m_resetCallCount(0),
m_commitCallCount(0),
+ m_localeCallCount(0),
+ m_inputDirectionCallCount(0),
m_lastQueries(Qt::ImhNone),
m_action(QInputPanel::Click),
m_cursorPosition(0),
@@ -91,12 +93,24 @@ public:
{
return m_visible;
}
+ virtual QLocale locale() const
+ {
+ m_localeCallCount++;
+ return QLocale::c();
+ }
+ virtual Qt::LayoutDirection inputDirection() const
+ {
+ m_inputDirectionCallCount++;
+ return Qt::LeftToRight;
+ }
bool m_animating;
bool m_visible;
int m_updateCallCount;
int m_resetCallCount;
int m_commitCallCount;
+ mutable int m_localeCallCount;
+ mutable int m_inputDirectionCallCount;
Qt::InputMethodQueries m_lastQueries;
QInputPanel::Action m_action;
int m_cursorPosition;
@@ -144,6 +158,7 @@ private slots:
void commit();
void update();
void query();
+ void inputDirection();
private:
InputItem m_inputItem;
PlatformInputContext m_platformInputContext;
@@ -312,5 +327,16 @@ void tst_qinputpanel::query()
QCOMPARE(cursorRectangle, QRect(1,2,3,4));
}
+void tst_qinputpanel::inputDirection()
+{
+ QCOMPARE(m_platformInputContext.m_inputDirectionCallCount, 0);
+ qApp->inputPanel()->inputDirection();
+ QCOMPARE(m_platformInputContext.m_inputDirectionCallCount, 1);
+
+ QCOMPARE(m_platformInputContext.m_localeCallCount, 0);
+ qApp->inputPanel()->locale();
+ QCOMPARE(m_platformInputContext.m_localeCallCount, 1);
+}
+
QTEST_MAIN(tst_qinputpanel)
#include "tst_qinputpanel.moc"
diff --git a/tests/auto/gui/kernel/qkeysequence/qt_de.qm b/tests/auto/gui/kernel/qkeysequence/qt_de.qm
index 595e4d7e8f..c22b8f6c38 100644
--- a/tests/auto/gui/kernel/qkeysequence/qt_de.qm
+++ b/tests/auto/gui/kernel/qkeysequence/qt_de.qm
Binary files differ
diff --git a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
index 6fbd77c54f..fcc30a7afe 100644
--- a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
+++ b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -122,8 +122,12 @@ private slots:
void mnemonic();
void toString_data();
void toString();
+ void toStringFromKeycode_data();
+ void toStringFromKeycode();
void streamOperators_data();
void streamOperators();
+ void parseString_data();
+ void parseString();
void fromString_data();
void fromString();
void ensureSorted();
@@ -474,6 +478,24 @@ void tst_QKeySequence::toString()
}
+void tst_QKeySequence::toStringFromKeycode_data()
+{
+ QTest::addColumn<QKeySequence>("keycode");
+ QTest::addColumn<QString>("expectedString");
+
+ QTest::newRow("A") << QKeySequence(Qt::Key_A) << "A";
+ QTest::newRow("-1") << QKeySequence(-1) << "";
+ QTest::newRow("Unknown") << QKeySequence(Qt::Key_unknown) << "";
+}
+
+void tst_QKeySequence::toStringFromKeycode()
+{
+ QFETCH(QKeySequence, keycode);
+ QFETCH(QString, expectedString);
+
+ QCOMPARE(QKeySequence(keycode).toString(), expectedString);
+}
+
void tst_QKeySequence::streamOperators_data()
{
operatorQString_data();
@@ -501,6 +523,34 @@ void tst_QKeySequence::streamOperators()
QVERIFY( orgK != copyOrgK );
}
+
+void tst_QKeySequence::parseString_data()
+{
+ QTest::addColumn<QString>("strSequence");
+ QTest::addColumn<QKeySequence>("keycode");
+
+ QTest::newRow("A") << "A" << QKeySequence(Qt::Key_A);
+ QTest::newRow("a") << "a" << QKeySequence(Qt::Key_A);
+ QTest::newRow("Ctrl+Left") << "Ctrl+Left" << QKeySequence(Qt::CTRL + Qt::Key_Left);
+ QTest::newRow("Ctrl++") << "Ctrl++" << QKeySequence(Qt::CTRL + Qt::Key_Plus);
+ QTest::newRow("Meta+A") << "Meta+a" << QKeySequence(Qt::META + Qt::Key_A);
+ QTest::newRow("Win+A") << "Win+a" << QKeySequence(Qt::Key_unknown);
+ QTest::newRow("4+3=2") << "4+3=2" << QKeySequence(Qt::Key_unknown);
+ QTest::newRow("Super+Meta+A") << "Super+Meta+A" << QKeySequence(Qt::Key_unknown);
+ QTest::newRow("Meta+Trolls") << "Meta+Trolls" << QKeySequence(Qt::Key_unknown);
+ QTest::newRow("Alabama") << "Alabama" << QKeySequence(Qt::Key_unknown);
+ QTest::newRow("Simon+G") << "Simon+G" << QKeySequence(Qt::Key_unknown);
+}
+
+void tst_QKeySequence::parseString()
+{
+ QFETCH( QString, strSequence );
+ QFETCH( QKeySequence, keycode );
+
+ QCOMPARE( QKeySequence(strSequence).toString(), keycode.toString() );
+ QVERIFY( QKeySequence(strSequence) == keycode );
+}
+
void tst_QKeySequence::fromString_data()
{
toString_data();
@@ -512,6 +562,9 @@ void tst_QKeySequence::fromString()
QFETCH(QString, neutralString);
QFETCH(QString, platformString);
+ if (strSequence == "Ctrly") // Key_Unknown gives empty string
+ return;
+
QKeySequence ks1(strSequence);
QKeySequence ks2 = QKeySequence::fromString(ks1.toString());
QKeySequence ks3 = QKeySequence::fromString(neutralString, QKeySequence::PortableText);
diff --git a/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp b/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp
index 370338d24a..aca3ffc9cb 100644
--- a/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp
+++ b/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -72,7 +72,7 @@ protected:
mousePressButton = e->button();
mousePressButtons = e->buttons();
mousePressModifiers = e->modifiers();
- mousePressEventRecieved = TRUE;
+ mousePressEventRecieved = true;
e->accept();
}
void mouseReleaseEvent(QMouseEvent *e)
@@ -81,7 +81,7 @@ protected:
mouseReleaseButton = e->button();
mouseReleaseButtons = e->buttons();
mouseReleaseModifiers = e->modifiers();
- mouseReleaseEventRecieved = TRUE;
+ mouseReleaseEventRecieved = true;
e->accept();
}
};
@@ -134,8 +134,8 @@ void tst_QMouseEvent::cleanupTestCase()
void tst_QMouseEvent::init()
{
- testMouseWidget->mousePressEventRecieved = FALSE;
- testMouseWidget->mouseReleaseEventRecieved = FALSE;
+ testMouseWidget->mousePressEventRecieved = false;
+ testMouseWidget->mouseReleaseEventRecieved = false;
testMouseWidget->mousePressButton = 0;
testMouseWidget->mousePressButtons = 0;
testMouseWidget->mousePressModifiers = 0;
diff --git a/tests/auto/gui/kernel/qmouseevent_modal/tst_qmouseevent_modal.cpp b/tests/auto/gui/kernel/qmouseevent_modal/tst_qmouseevent_modal.cpp
index 4dc8b58366..ce006eaa99 100644
--- a/tests/auto/gui/kernel/qmouseevent_modal/tst_qmouseevent_modal.cpp
+++ b/tests/auto/gui/kernel/qmouseevent_modal/tst_qmouseevent_modal.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp b/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp
index 053e6d0a7e..5474c4097d 100644
--- a/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp
+++ b/tests/auto/gui/kernel/qpalette/tst_qpalette.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp b/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp
index 1d00032b56..ab798a7351 100644
--- a/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp
+++ b/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -52,6 +52,7 @@ private slots:
void angleBetween();
void transformBetween_data();
void transformBetween();
+ void orientationChange();
};
void tst_QScreen::angleBetween_data()
@@ -163,5 +164,16 @@ void tst_QScreen::transformBetween()
QCOMPARE(QScreen::transformBetween(a, b, rect), expected);
}
+void tst_QScreen::orientationChange()
+{
+ QScreen *screen = QGuiApplication::primaryScreen();
+
+ QWindowSystemInterface::handleScreenOrientationChange(screen, Qt::LandscapeOrientation);
+ QTRY_COMPARE(screen->currentOrientation(), Qt::LandscapeOrientation);
+
+ QWindowSystemInterface::handleScreenOrientationChange(screen, Qt::PortraitOrientation);
+ QTRY_COMPARE(screen->currentOrientation(), Qt::PortraitOrientation);
+}
+
#include <tst_qscreen.moc>
QTEST_MAIN(tst_QScreen);
diff --git a/tests/auto/gui/kernel/qshortcut/tst_qshortcut.cpp b/tests/auto/gui/kernel/qshortcut/tst_qshortcut.cpp
index d3a087eefc..228b73414e 100644
--- a/tests/auto/gui/kernel/qshortcut/tst_qshortcut.cpp
+++ b/tests/auto/gui/kernel/qshortcut/tst_qshortcut.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -152,12 +152,12 @@ protected:
};
QT_BEGIN_NAMESPACE
-template<> struct QMetaTypeId<tst_QShortcut::Widget>
-{ enum { Defined = 1 }; static inline int qt_metatype_id() { return QMetaType::Int; } };
-template<> struct QMetaTypeId<tst_QShortcut::Result>
-{ enum { Defined = 1 }; static inline int qt_metatype_id() { return QMetaType::Int; } };
-template<> struct QMetaTypeId<tst_QShortcut::Action>
-{ enum { Defined = 1 }; static inline int qt_metatype_id() { return QMetaType::Int; } };
+template<> struct QMetaTypeId<tst_QShortcut::Widget> : public QMetaTypeId<int>
+{ static inline int qt_metatype_id() { return QMetaType::Int; } };
+template<> struct QMetaTypeId<tst_QShortcut::Result> : public QMetaTypeId<int>
+{ static inline int qt_metatype_id() { return QMetaType::Int; } };
+template<> struct QMetaTypeId<tst_QShortcut::Action> : public QMetaTypeId<int>
+{ static inline int qt_metatype_id() { return QMetaType::Int; } };
QT_END_NAMESPACE
class TestEdit : public QTextEdit
@@ -1254,10 +1254,8 @@ void tst_QShortcut::testElement()
if (action == ClearAll) {
clearAllShortcuts();
- QCOMPARE(TRUE, TRUE);
} else if (action == SetupAccel) {
setupShortcut(testWidget, txt, k1, k2, k3, k4);
- QCOMPARE(TRUE, TRUE);
} else {
sendKeyEvents(k1, c1, k2, c2, k3, c3, k4, c4);
QCOMPARE(int(currentResult), result);
diff --git a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
index 07afe4a89c..95e644987f 100644
--- a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
+++ b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -209,6 +209,8 @@ private slots:
void deleteInRawEventTranslation();
void crashInQGraphicsSceneAfterNotHandlingTouchBegin();
void touchBeginWithGraphicsWidget();
+ void testQGuiAppDelivery();
+ void testMultiDevice();
private:
QTouchDevice *touchScreenDevice;
@@ -597,10 +599,12 @@ void tst_QTouchEvent::basicRawEventTranslation()
rawPosList << QPointF(12, 34) << QPointF(56, 78);
rawTouchPoint.setRawScreenPositions(rawPosList);
const ulong timestamp = 1234;
- qt_translateRawTouchEvent(&touchWidget,
- touchScreenDevice,
- QList<QTouchEvent::TouchPoint>() << rawTouchPoint,
- timestamp);
+ QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
+ timestamp,
+ touchScreenDevice,
+ QTest::QTouchEventSequence::touchPointList(
+ QList<QTouchEvent::TouchPoint>() << rawTouchPoint));
+ QCoreApplication::processEvents();
QVERIFY(touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
QVERIFY(!touchWidget.seenTouchEnd);
@@ -632,10 +636,11 @@ void tst_QTouchEvent::basicRawEventTranslation()
rawTouchPoint.setState(Qt::TouchPointMoved);
rawTouchPoint.setScreenPos(screenPos + delta);
rawTouchPoint.setNormalizedPos(normalized(rawTouchPoint.pos(), screenGeometry));
- qt_translateRawTouchEvent(&touchWidget,
- touchScreenDevice,
- QList<QTouchEvent::TouchPoint>() << rawTouchPoint,
- 0);
+ QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
+ 0,
+ touchScreenDevice,
+ QTest::QTouchEventSequence::touchPointList(QList<QTouchEvent::TouchPoint>() << rawTouchPoint));
+ QCoreApplication::processEvents();
QVERIFY(touchWidget.seenTouchBegin);
QVERIFY(touchWidget.seenTouchUpdate);
QVERIFY(!touchWidget.seenTouchEnd);
@@ -664,10 +669,11 @@ void tst_QTouchEvent::basicRawEventTranslation()
rawTouchPoint.setState(Qt::TouchPointReleased);
rawTouchPoint.setScreenPos(screenPos + delta + delta);
rawTouchPoint.setNormalizedPos(normalized(rawTouchPoint.pos(), screenGeometry));
- qt_translateRawTouchEvent(&touchWidget,
- touchScreenDevice,
- QList<QTouchEvent::TouchPoint>() << rawTouchPoint,
- 0);
+ QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
+ 0,
+ touchScreenDevice,
+ QTest::QTouchEventSequence::touchPointList(QList<QTouchEvent::TouchPoint>() << rawTouchPoint));
+ QCoreApplication::processEvents();
QVERIFY(touchWidget.seenTouchBegin);
QVERIFY(touchWidget.seenTouchUpdate);
QVERIFY(touchWidget.seenTouchEnd);
@@ -731,7 +737,11 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchScreen()
rawTouchPoints[1].setState(Qt::TouchPointPressed);
rawTouchPoints[1].setScreenPos(rightScreenPos);
rawTouchPoints[1].setNormalizedPos(normalized(rawTouchPoints[1].pos(), screenGeometry));
- qt_translateRawTouchEvent(&touchWidget, touchScreenDevice, rawTouchPoints, 0);
+ QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
+ 0,
+ touchScreenDevice,
+ QTest::QTouchEventSequence::touchPointList(rawTouchPoints));
+ QCoreApplication::processEvents();
QVERIFY(!touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
QVERIFY(!touchWidget.seenTouchEnd);
@@ -792,7 +802,11 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchScreen()
rawTouchPoints[1].setState(Qt::TouchPointMoved);
rawTouchPoints[1].setScreenPos(centerScreenPos);
rawTouchPoints[1].setNormalizedPos(normalized(rawTouchPoints[1].pos(), screenGeometry));
- qt_translateRawTouchEvent(&touchWidget, touchScreenDevice, rawTouchPoints, 0);
+ QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
+ 0,
+ touchScreenDevice,
+ QTest::QTouchEventSequence::touchPointList(rawTouchPoints));
+ QCoreApplication::processEvents();
QVERIFY(!touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
QVERIFY(!touchWidget.seenTouchEnd);
@@ -853,7 +867,11 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchScreen()
rawTouchPoints[1].setState(Qt::TouchPointReleased);
rawTouchPoints[1].setScreenPos(centerScreenPos);
rawTouchPoints[1].setNormalizedPos(normalized(rawTouchPoints[1].pos(), screenGeometry));
- qt_translateRawTouchEvent(&touchWidget, touchScreenDevice, rawTouchPoints, 0);
+ QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
+ 0,
+ touchScreenDevice,
+ QTest::QTouchEventSequence::touchPointList(rawTouchPoints));
+ QCoreApplication::processEvents();
QVERIFY(!touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
QVERIFY(!touchWidget.seenTouchEnd);
@@ -946,7 +964,11 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchPad()
rawTouchPoints[1].setState(Qt::TouchPointPressed);
rawTouchPoints[1].setScreenPos(rightScreenPos);
rawTouchPoints[1].setNormalizedPos(normalized(rawTouchPoints[1].pos(), screenGeometry));
- qt_translateRawTouchEvent(&touchWidget, touchPadDevice, rawTouchPoints, 0);
+ QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
+ 0,
+ touchPadDevice,
+ QTest::QTouchEventSequence::touchPointList(rawTouchPoints));
+ QCoreApplication::processEvents();
QVERIFY(!touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
QVERIFY(!touchWidget.seenTouchEnd);
@@ -1007,7 +1029,11 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchPad()
rawTouchPoints[1].setState(Qt::TouchPointMoved);
rawTouchPoints[1].setScreenPos(centerScreenPos);
rawTouchPoints[1].setNormalizedPos(normalized(rawTouchPoints[1].pos(), screenGeometry));
- qt_translateRawTouchEvent(&touchWidget, touchPadDevice, rawTouchPoints, 0);
+ QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
+ 0,
+ touchPadDevice,
+ QTest::QTouchEventSequence::touchPointList(rawTouchPoints));
+ QCoreApplication::processEvents();
QVERIFY(!touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
QVERIFY(!touchWidget.seenTouchEnd);
@@ -1068,7 +1094,11 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchPad()
rawTouchPoints[1].setState(Qt::TouchPointReleased);
rawTouchPoints[1].setScreenPos(centerScreenPos);
rawTouchPoints[1].setNormalizedPos(normalized(rawTouchPoints[1].pos(), screenGeometry));
- qt_translateRawTouchEvent(&touchWidget, touchPadDevice, rawTouchPoints, 0);
+ QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
+ 0,
+ touchPadDevice,
+ QTest::QTouchEventSequence::touchPointList(rawTouchPoints));
+ QCoreApplication::processEvents();
QVERIFY(!touchWidget.seenTouchBegin);
QVERIFY(!touchWidget.seenTouchUpdate);
QVERIFY(!touchWidget.seenTouchEnd);
@@ -1326,20 +1356,32 @@ void tst_QTouchEvent::deleteInRawEventTranslation()
rawTouchPoints[2].setNormalizedPos(normalized(rawTouchPoints[2].pos(), screenGeometry));
// generate begin events on all widgets, the left widget should die
- qt_translateRawTouchEvent(&touchWidget, touchScreenDevice, rawTouchPoints, 0);
+ QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
+ 0,
+ touchScreenDevice,
+ QTest::QTouchEventSequence::touchPointList(rawTouchPoints));
+ QCoreApplication::processEvents();
QVERIFY(pl.isNull() && !pc.isNull() && !pr.isNull());
// generate update events on all widget, the center widget should die
rawTouchPoints[0].setState(Qt::TouchPointMoved);
rawTouchPoints[1].setState(Qt::TouchPointMoved);
rawTouchPoints[2].setState(Qt::TouchPointMoved);
- qt_translateRawTouchEvent(&touchWidget, touchScreenDevice, rawTouchPoints, 0);
+ QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
+ 0,
+ touchScreenDevice,
+ QTest::QTouchEventSequence::touchPointList(rawTouchPoints));
+ 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);
- qt_translateRawTouchEvent(&touchWidget, touchScreenDevice, rawTouchPoints, 0);
+ QWindowSystemInterface::handleTouchEvent(touchWidget.windowHandle(),
+ 0,
+ touchScreenDevice,
+ QTest::QTouchEventSequence::touchPointList(rawTouchPoints));
+ QCoreApplication::processEvents();
}
void tst_QTouchEvent::crashInQGraphicsSceneAfterNotHandlingTouchBegin()
@@ -1390,12 +1432,12 @@ void tst_QTouchEvent::touchBeginWithGraphicsWidget()
QTest::qWaitForWindowShown(&view);
view.fitInView(scene.sceneRect());
- QTest::touchEvent(static_cast<QWindow *>(0), touchScreenDevice)
+ QTest::touchEvent(&view, touchScreenDevice)
.press(0, view.mapFromScene(root->mapToScene(3,3)), view.viewport());
- QTest::touchEvent(static_cast<QWindow *>(0), touchScreenDevice)
+ QTest::touchEvent(&view, touchScreenDevice)
.stationary(0)
.press(1, view.mapFromScene(root->mapToScene(6,6)), view.viewport());
- QTest::touchEvent(static_cast<QWindow *>(0), touchScreenDevice)
+ QTest::touchEvent(&view, touchScreenDevice)
.release(0, view.mapFromScene(root->mapToScene(3,3)), view.viewport())
.release(1, view.mapFromScene(root->mapToScene(6,6)), view.viewport());
@@ -1407,12 +1449,12 @@ void tst_QTouchEvent::touchBeginWithGraphicsWidget()
root->reset();
glassWidget->setWindowFlags(Qt::Window); // make the glassWidget a panel
- QTest::touchEvent(static_cast<QWindow *>(0), touchScreenDevice)
+ QTest::touchEvent(&view, touchScreenDevice)
.press(0, view.mapFromScene(root->mapToScene(3,3)), view.viewport());
- QTest::touchEvent(static_cast<QWindow *>(0), touchScreenDevice)
+ QTest::touchEvent(&view, touchScreenDevice)
.stationary(0)
.press(1, view.mapFromScene(root->mapToScene(6,6)), view.viewport());
- QTest::touchEvent(static_cast<QWindow *>(0), touchScreenDevice)
+ QTest::touchEvent(&view, touchScreenDevice)
.release(0, view.mapFromScene(root->mapToScene(3,3)), view.viewport())
.release(1, view.mapFromScene(root->mapToScene(6,6)), view.viewport());
@@ -1425,6 +1467,143 @@ void tst_QTouchEvent::touchBeginWithGraphicsWidget()
delete glassWidget;
}
+class WindowTouchEventFilter : public QObject
+{
+ Q_OBJECT
+public:
+ bool eventFilter(QObject *obj, QEvent *event);
+ struct TouchInfo {
+ QList<QTouchEvent::TouchPoint> points;
+ QEvent::Type lastSeenType;
+ };
+ QMap<QTouchDevice *, TouchInfo> d;
+};
+
+bool WindowTouchEventFilter::eventFilter(QObject *, QEvent *event)
+{
+ if (event->type() == QEvent::TouchBegin
+ || event->type() == QEvent::TouchUpdate
+ || event->type() == QEvent::TouchEnd) {
+ QTouchEvent *te = static_cast<QTouchEvent *>(event);
+ TouchInfo &td = d[te->device()];
+ if (event->type() == QEvent::TouchBegin)
+ td.points.clear();
+ td.points.append(te->touchPoints());
+ td.lastSeenType = event->type();
+ }
+ return false;
+}
+
+void tst_QTouchEvent::testQGuiAppDelivery()
+{
+ QTouchDevice *device = new QTouchDevice;
+ device->setType(QTouchDevice::TouchScreen);
+ QWindowSystemInterface::registerTouchDevice(device);
+
+ QWindow *w = new QWindow;
+ w->setGeometry(100, 100, 100, 100);
+ w->show();
+ QTest::qWaitForWindowShown(w);
+
+ WindowTouchEventFilter filter;
+ w->installEventFilter(&filter);
+
+ QList<QWindowSystemInterface::TouchPoint> points;
+
+ // Pass empty list, should be ignored.
+ QWindowSystemInterface::handleTouchEvent(w, 0, points);
+ QCoreApplication::processEvents();
+ QCOMPARE(filter.d.isEmpty(), true);
+
+ QWindowSystemInterface::TouchPoint tp;
+ tp.id = 0;
+ tp.state = Qt::TouchPointPressed;
+ tp.area = QRectF(120, 120, 20, 20);
+ points.append(tp);
+
+ // Pass 0 as device, should be ignored.
+ QWindowSystemInterface::handleTouchEvent(w, 0, points);
+ QCoreApplication::processEvents();
+ QCOMPARE(filter.d.isEmpty(), true);
+
+ // Now the real thing.
+ QWindowSystemInterface::handleTouchEvent(w, device, points); // TouchBegin
+ QCoreApplication::processEvents();
+ QCOMPARE(filter.d.count(), 1);
+ QCOMPARE(filter.d.contains(device), true);
+ QCOMPARE(filter.d.value(device).points.count(), 1);
+ QCOMPARE(filter.d.value(device).lastSeenType, QEvent::TouchBegin);
+
+ points[0].state = Qt::TouchPointMoved;
+ QWindowSystemInterface::handleTouchEvent(w, device, points); // TouchUpdate
+ QCoreApplication::processEvents();
+ QCOMPARE(filter.d.count(), 1);
+ QCOMPARE(filter.d.contains(device), true);
+ QCOMPARE(filter.d.value(device).points.count(), 2);
+ QCOMPARE(filter.d.value(device).lastSeenType, QEvent::TouchUpdate);
+
+ points[0].state = Qt::TouchPointReleased;
+ QWindowSystemInterface::handleTouchEvent(w, device, points); // TouchEnd
+ QCoreApplication::processEvents();
+ QCOMPARE(filter.d.count(), 1);
+ QCOMPARE(filter.d.contains(device), true);
+ QCOMPARE(filter.d.value(device).points.count(), 3);
+ QCOMPARE(filter.d.value(device).lastSeenType, QEvent::TouchEnd);
+}
+
+void tst_QTouchEvent::testMultiDevice()
+{
+ QTouchDevice *deviceOne = new QTouchDevice;
+ deviceOne->setType(QTouchDevice::TouchScreen);
+ QWindowSystemInterface::registerTouchDevice(deviceOne);
+ QTouchDevice *deviceTwo = new QTouchDevice;
+ deviceTwo->setType(QTouchDevice::TouchScreen);
+ QWindowSystemInterface::registerTouchDevice(deviceTwo);
+
+ QWindow *w = new QWindow;
+ w->setGeometry(100, 100, 100, 100);
+ w->show();
+ QTest::qWaitForWindowShown(w);
+
+ WindowTouchEventFilter filter;
+ w->installEventFilter(&filter);
+
+ QList<QWindowSystemInterface::TouchPoint> pointsOne, pointsTwo;
+
+ // deviceOne reports a single point, deviceTwo reports the beginning of a multi-point sequence.
+ // Even though there is a point with id 0 for both devices, they should be delivered cleanly, independently.
+ QWindowSystemInterface::TouchPoint tp;
+ tp.id = 0;
+ tp.state = Qt::TouchPointPressed;
+ tp.area = QRectF(120, 120, 20, 20);
+ pointsOne.append(tp);
+
+ pointsTwo.append(tp);
+ tp.id = 1;
+ tp.area = QRectF(140, 140, 20, 20);
+ pointsTwo.append(tp);
+
+ QWindowSystemInterface::handleTouchEvent(w, deviceOne, pointsOne);
+ QWindowSystemInterface::handleTouchEvent(w, deviceTwo, pointsTwo);
+ QCoreApplication::processEvents();
+
+ QCOMPARE(filter.d.contains(deviceOne), true);
+ QCOMPARE(filter.d.contains(deviceTwo), true);
+
+ QCOMPARE(filter.d.value(deviceOne).lastSeenType, QEvent::TouchBegin);
+ QCOMPARE(filter.d.value(deviceTwo).lastSeenType, QEvent::TouchBegin);
+ 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).state(), pointsOne[0].state);
+
+ QCOMPARE(filter.d.value(deviceTwo).points.at(0).screenRect(), pointsTwo[0].area);
+ 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).state(), pointsTwo[1].state);
+}
+
QTEST_MAIN(tst_QTouchEvent)
#include "tst_qtouchevent.moc"
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index 4171f0f797..77fffef13a 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -43,6 +43,8 @@
#include <QtTest/QtTest>
+#include <QEvent>
+
class tst_QWindow: public QObject
{
Q_OBJECT
@@ -51,6 +53,19 @@ private slots:
void mapGlobal();
void positioning();
void isActive();
+ void testInputEvents();
+ void touchToMouseTranslation();
+ void mouseToTouchTranslation();
+ void mouseToTouchLoop();
+ void initTestCase()
+ {
+ touchDevice = new QTouchDevice;
+ touchDevice->setType(QTouchDevice::TouchScreen);
+ QWindowSystemInterface::registerTouchDevice(touchDevice);
+ }
+
+private:
+ QTouchDevice *touchDevice;
};
@@ -221,5 +236,224 @@ void tst_QWindow::isActive()
QVERIFY(child.isActive());
}
+class InputTestWindow : public QWindow
+{
+public:
+ void keyPressEvent(QKeyEvent *event) {
+ keyPressCode = event->key();
+ }
+ void keyReleaseEvent(QKeyEvent *event) {
+ keyReleaseCode = event->key();
+ }
+ void mousePressEvent(QMouseEvent *event) {
+ if (ignoreMouse)
+ event->ignore();
+ else
+ mousePressButton = event->button();
+ }
+ void mouseReleaseEvent(QMouseEvent *event) {
+ if (ignoreMouse)
+ event->ignore();
+ else
+ mouseReleaseButton = event->button();
+ }
+ void touchEvent(QTouchEvent *event) {
+ if (ignoreTouch) {
+ event->ignore();
+ return;
+ }
+ QList<QTouchEvent::TouchPoint> points = event->touchPoints();
+ for (int i = 0; i < points.count(); ++i) {
+ switch (points.at(i).state()) {
+ case Qt::TouchPointPressed:
+ ++touchPressedCount;
+ break;
+ case Qt::TouchPointReleased:
+ ++touchReleasedCount;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ InputTestWindow() {
+ keyPressCode = keyReleaseCode = 0;
+ mousePressButton = mouseReleaseButton = 0;
+ touchPressedCount = touchReleasedCount = 0;
+ ignoreMouse = ignoreTouch = 0;
+ }
+
+ int keyPressCode, keyReleaseCode;
+ int mousePressButton, mouseReleaseButton;
+ int touchPressedCount, touchReleasedCount;
+
+ bool ignoreMouse, ignoreTouch;
+};
+
+void tst_QWindow::testInputEvents()
+{
+ InputTestWindow window;
+ window.setGeometry(80, 80, 40, 40);
+ window.show();
+ QTest::qWaitForWindowShown(&window);
+
+ QWindowSystemInterface::handleKeyEvent(&window, QEvent::KeyPress, Qt::Key_A, Qt::NoModifier);
+ QWindowSystemInterface::handleKeyEvent(&window, QEvent::KeyRelease, 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);
+ QCoreApplication::processEvents();
+ QCOMPARE(window.mousePressButton, int(Qt::LeftButton));
+ QCOMPARE(window.mouseReleaseButton, int(Qt::LeftButton));
+
+ QList<QWindowSystemInterface::TouchPoint> points;
+ QWindowSystemInterface::TouchPoint tp1, tp2;
+ tp1.id = 1;
+ tp1.state = Qt::TouchPointPressed;
+ tp1.area = QRect(10, 10, 4, 4);
+ tp2.id = 2;
+ tp2.state = Qt::TouchPointPressed;
+ tp2.area = QRect(20, 20, 4, 4);
+ points << tp1 << tp2;
+ QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points);
+ points[0].state = Qt::TouchPointReleased;
+ points[1].state = Qt::TouchPointReleased;
+ QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points);
+ QCoreApplication::processEvents();
+ QTRY_COMPARE(window.touchPressedCount, 2);
+ QTRY_COMPARE(window.touchReleasedCount, 2);
+}
+
+void tst_QWindow::touchToMouseTranslation()
+{
+ InputTestWindow window;
+ window.ignoreTouch = true;
+ window.setGeometry(80, 80, 40, 40);
+ window.show();
+ QTest::qWaitForWindowShown(&window);
+
+ QList<QWindowSystemInterface::TouchPoint> points;
+ QWindowSystemInterface::TouchPoint tp1, tp2;
+ tp1.id = 1;
+ tp1.state = Qt::TouchPointPressed;
+ tp2.id = 2;
+ tp2.state = Qt::TouchPointPressed;
+ points << tp1 << tp2;
+ QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points);
+ points[0].state = Qt::TouchPointReleased;
+ points[1].state = Qt::TouchPointReleased;
+ QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points);
+ QCoreApplication::processEvents();
+
+ QTRY_COMPARE(window.mousePressButton, int(Qt::LeftButton));
+ QTRY_COMPARE(window.mouseReleaseButton, int(Qt::LeftButton));
+
+ window.mousePressButton = 0;
+ window.mouseReleaseButton = 0;
+
+ window.ignoreTouch = false;
+
+ points[0].state = Qt::TouchPointPressed;
+ points[1].state = Qt::TouchPointPressed;
+ QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points);
+ points[0].state = Qt::TouchPointReleased;
+ points[1].state = Qt::TouchPointReleased;
+ QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points);
+ QCoreApplication::processEvents();
+
+ // no new mouse events should be generated since the input window handles the touch events
+ QTRY_COMPARE(window.mousePressButton, 0);
+ QTRY_COMPARE(window.mouseReleaseButton, 0);
+
+ qApp->setAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents, false);
+
+ window.ignoreTouch = true;
+ points[0].state = Qt::TouchPointPressed;
+ points[1].state = Qt::TouchPointPressed;
+ QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points);
+ points[0].state = Qt::TouchPointReleased;
+ points[1].state = Qt::TouchPointReleased;
+ QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points);
+ QCoreApplication::processEvents();
+
+ qApp->setAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents, true);
+
+ // mouse event synthesizing disabled
+ QTRY_COMPARE(window.mousePressButton, 0);
+ QTRY_COMPARE(window.mouseReleaseButton, 0);
+}
+
+void tst_QWindow::mouseToTouchTranslation()
+{
+ qApp->setAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents, true);
+
+ InputTestWindow window;
+ window.ignoreMouse = true;
+ window.setGeometry(80, 80, 40, 40);
+ window.show();
+ QTest::qWaitForWindowShown(&window);
+
+ QWindowSystemInterface::handleMouseEvent(&window, QPoint(10, 10), window.mapToGlobal(QPoint(10, 10)), Qt::LeftButton);
+ QWindowSystemInterface::handleMouseEvent(&window, QPoint(10, 10), window.mapToGlobal(QPoint(10, 10)), Qt::NoButton);
+ QCoreApplication::processEvents();
+
+ qApp->setAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents, false);
+
+ QTRY_COMPARE(window.touchPressedCount, 1);
+ QTRY_COMPARE(window.touchReleasedCount, 1);
+
+ qApp->setAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents, true);
+
+ window.ignoreMouse = false;
+
+ QWindowSystemInterface::handleMouseEvent(&window, QPoint(10, 10), window.mapToGlobal(QPoint(10, 10)), Qt::LeftButton);
+ QWindowSystemInterface::handleMouseEvent(&window, QPoint(10, 10), window.mapToGlobal(QPoint(10, 10)), Qt::NoButton);
+ QCoreApplication::processEvents();
+
+ qApp->setAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents, false);
+
+ // no new touch events should be generated since the input window handles the mouse events
+ QTRY_COMPARE(window.touchPressedCount, 1);
+ QTRY_COMPARE(window.touchReleasedCount, 1);
+
+ window.ignoreMouse = true;
+
+ QWindowSystemInterface::handleMouseEvent(&window, QPoint(10, 10), window.mapToGlobal(QPoint(10, 10)), Qt::LeftButton);
+ QWindowSystemInterface::handleMouseEvent(&window, QPoint(10, 10), window.mapToGlobal(QPoint(10, 10)), Qt::NoButton);
+ QCoreApplication::processEvents();
+
+ // touch event synthesis disabled
+ QTRY_COMPARE(window.touchPressedCount, 1);
+ QTRY_COMPARE(window.touchReleasedCount, 1);
+
+
+}
+
+void tst_QWindow::mouseToTouchLoop()
+{
+ // make sure there's no infinite loop when synthesizing both ways
+ qApp->setAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents, true);
+ qApp->setAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents, true);
+
+ InputTestWindow window;
+ window.ignoreMouse = true;
+ window.ignoreTouch = true;
+ window.setGeometry(80, 80, 40, 40);
+ window.show();
+ QTest::qWaitForWindowShown(&window);
+
+ QWindowSystemInterface::handleMouseEvent(&window, QPoint(10, 10), window.mapToGlobal(QPoint(10, 10)), Qt::LeftButton);
+ QWindowSystemInterface::handleMouseEvent(&window, QPoint(10, 10), window.mapToGlobal(QPoint(10, 10)), Qt::NoButton);
+ QCoreApplication::processEvents();
+
+ qApp->setAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents, false);
+ qApp->setAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents, false);
+}
+
#include <tst_qwindow.moc>
QTEST_MAIN(tst_QWindow);
diff --git a/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp b/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
index 98a559af85..2c006b224e 100644
--- a/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
+++ b/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
index 7bc50efeeb..77bd22a676 100644
--- a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
+++ b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp b/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp
index 37c1949dc2..1ebad41466 100644
--- a/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp
+++ b/tests/auto/gui/math3d/qvectornd/tst_qvectornd.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/painting/qbrush/tst_qbrush.cpp b/tests/auto/gui/painting/qbrush/tst_qbrush.cpp
index e559556e58..e84cbb5c19 100644
--- a/tests/auto/gui/painting/qbrush/tst_qbrush.cpp
+++ b/tests/auto/gui/painting/qbrush/tst_qbrush.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
index 49b1bfe661..00a393562a 100644
--- a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
+++ b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/painting/qpaintengine/tst_qpaintengine.cpp b/tests/auto/gui/painting/qpaintengine/tst_qpaintengine.cpp
index f2e6021818..07ec8458af 100644
--- a/tests/auto/gui/painting/qpaintengine/tst_qpaintengine.cpp
+++ b/tests/auto/gui/painting/qpaintengine/tst_qpaintengine.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index c868e9fa39..d6511d4475 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -256,6 +256,8 @@ private slots:
void drawTextOutsideGuiThread();
+ void drawTextWithComplexBrush();
+
private:
void fillData();
void setPenColor(QPainter& p);
@@ -347,7 +349,7 @@ Q_DECLARE_METATYPE(QRegion)
tst_QPainter::tst_QPainter()
{
// QtTestCase sets this to false, but this turns off alpha pixmaps on Unix.
- QApplication::setDesktopSettingsAware(TRUE);
+ QApplication::setDesktopSettingsAware(true);
}
tst_QPainter::~tst_QPainter()
@@ -4305,6 +4307,28 @@ void tst_QPainter::drawTextOutsideGuiThread()
QCOMPARE(referenceRendering, t.rendering);
}
+void tst_QPainter::drawTextWithComplexBrush()
+{
+ QImage texture(10, 10, QImage::Format_ARGB32_Premultiplied);
+ texture.fill(Qt::red);
+
+ QImage image(100, 100, QImage::Format_ARGB32_Premultiplied);
+ image.fill(Qt::white);
+ QPainter p(&image);
+ QFont f = p.font();
+ f.setPixelSize(70);
+ p.setFont(f);
+
+ QBrush brush(Qt::white);
+ brush.setTextureImage(texture);
+ p.setPen(QPen(brush, 2));
+
+ p.drawText(10, 10, "Hello World");
+
+ int paintedPixels = getPaintedPixels(image, Qt::white);
+ QVERIFY(paintedPixels > 0);
+}
+
QTEST_MAIN(tst_QPainter)
#include "tst_qpainter.moc"
diff --git a/tests/auto/gui/painting/qpainter/utils/createImages/main.cpp b/tests/auto/gui/painting/qpainter/utils/createImages/main.cpp
index 418c385717..4603d9d613 100644
--- a/tests/auto/gui/painting/qpainter/utils/createImages/main.cpp
+++ b/tests/auto/gui/painting/qpainter/utils/createImages/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -127,7 +127,7 @@ static QBitmap createSrcBitmap( int size, int border )
painter.drawRect( border, border, size, size2 );
painter.end();
if ( border > 0 ) {
- QBitmap mask( totalSize, totalSize, TRUE );
+ QBitmap mask( totalSize, totalSize, true );
QPainter painter;
painter.begin( &mask );
painter.setPen( QPen( Qt::color1, 1 ) );
@@ -171,7 +171,7 @@ int main( int argc, char **argv )
QBitmap src_tmp = createSrcBitmap( 32, 0 ).xForm( QWMatrix( 1, 0, 0, -1, 0, 0 ) );
src_tmp.resize( 32, 48 );
QBitmap src2 = src_tmp.xForm( QWMatrix( 1, 0, 0, -1, 0, 0 ) );
- QBitmap mask( 32, 48, TRUE );
+ QBitmap mask( 32, 48, true );
{
QPainter painter;
painter.begin( &mask );
diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
index c54ffb358e..5d48113aa8 100644
--- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
+++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/painting/qpainterpathstroker/tst_qpainterpathstroker.cpp b/tests/auto/gui/painting/qpainterpathstroker/tst_qpainterpathstroker.cpp
index b5d6c231bd..371a142cc3 100644
--- a/tests/auto/gui/painting/qpainterpathstroker/tst_qpainterpathstroker.cpp
+++ b/tests/auto/gui/painting/qpainterpathstroker/tst_qpainterpathstroker.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/painting/qpathclipper/pathcompare.h b/tests/auto/gui/painting/qpathclipper/pathcompare.h
index d80c189665..bb4c00222a 100644
--- a/tests/auto/gui/painting/qpathclipper/pathcompare.h
+++ b/tests/auto/gui/painting/qpathclipper/pathcompare.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/painting/qpathclipper/paths.cpp b/tests/auto/gui/painting/qpathclipper/paths.cpp
index 950c34614e..f4e63a200f 100644
--- a/tests/auto/gui/painting/qpathclipper/paths.cpp
+++ b/tests/auto/gui/painting/qpathclipper/paths.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/painting/qpathclipper/paths.h b/tests/auto/gui/painting/qpathclipper/paths.h
index 89ef785857..e270574304 100644
--- a/tests/auto/gui/painting/qpathclipper/paths.h
+++ b/tests/auto/gui/painting/qpathclipper/paths.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp b/tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp
index 1fa279dbc7..1e6bb20614 100644
--- a/tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp
+++ b/tests/auto/gui/painting/qpathclipper/tst_qpathclipper.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/painting/qpen/tst_qpen.cpp b/tests/auto/gui/painting/qpen/tst_qpen.cpp
index eeb5aae96d..3da7294e9a 100644
--- a/tests/auto/gui/painting/qpen/tst_qpen.cpp
+++ b/tests/auto/gui/painting/qpen/tst_qpen.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -117,22 +117,22 @@ void tst_QPen::operator_eq_eq_data()
QTest::newRow("differentColor") << QPen(Qt::red)
<< QPen(Qt::blue)
- << bool(FALSE);
+ << false;
QTest::newRow("differentWidth") << QPen(Qt::red, 2)
<< QPen(Qt::red, 3)
- << bool(FALSE);
+ << false;
QTest::newRow("differentPenStyle") << QPen(Qt::red, 2, Qt::DashLine)
<< QPen(Qt::red, 2, Qt::DotLine)
- << bool(FALSE);
+ << false;
QTest::newRow("differentCapStyle") << QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin)
<< QPen(Qt::red, 2, Qt::DashLine, Qt::SquareCap, Qt::BevelJoin)
- << bool(FALSE);
+ << false;
QTest::newRow("differentJoinStyle") << QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin)
<< QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::MiterJoin)
- << bool(FALSE);
+ << false;
QTest::newRow("same") << QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin)
<< QPen(Qt::red, 2, Qt::DashLine, Qt::RoundCap, Qt::BevelJoin)
- << bool(TRUE);
+ << true;
}
diff --git a/tests/auto/gui/painting/qpolygon/tst_qpolygon.cpp b/tests/auto/gui/painting/qpolygon/tst_qpolygon.cpp
index 8d0bed6128..46a8f80f23 100644
--- a/tests/auto/gui/painting/qpolygon/tst_qpolygon.cpp
+++ b/tests/auto/gui/painting/qpolygon/tst_qpolygon.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -76,7 +76,7 @@ void tst_QPolygon::makeEllipse()
int i;
// make sure that all points are R+-1 away from the center
- bool err = FALSE;
+ bool err = false;
for (i = 1; i < pa.size(); i++) {
QPoint p = pa.at( i );
double r = sqrt( pow( double(p.x() - R), 2.0 ) + pow( double(p.y() - R), 2.0 ) );
diff --git a/tests/auto/gui/painting/qprinter/tst_qprinter.cpp b/tests/auto/gui/painting/qprinter/tst_qprinter.cpp
index 88c2a3ee9b..dd33030d7e 100644
--- a/tests/auto/gui/painting/qprinter/tst_qprinter.cpp
+++ b/tests/auto/gui/painting/qprinter/tst_qprinter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -191,7 +191,6 @@ void tst_QPrinter::getSetCheck()
obj1.setPageSize(QPrinter::PageSize(QPrinter::A4));
QCOMPARE(QPrinter::PageSize(QPrinter::A4), obj1.pageSize());
obj1.setPageSize(QPrinter::PageSize(QPrinter::Letter));
- QEXPECT_FAIL("", "QTBUG-22562, QTBUG-22296", Abort);
QCOMPARE(QPrinter::PageSize(QPrinter::Letter), obj1.pageSize());
obj1.setPageSize(QPrinter::PageSize(QPrinter::Legal));
QCOMPARE(QPrinter::PageSize(QPrinter::Legal), obj1.pageSize());
@@ -316,25 +315,25 @@ void tst_QPrinter::testSetOptions()
QPrintDialog dlg(&prn);
// Verify default values
- MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), TRUE);
- MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), FALSE);
- MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), TRUE);
+ MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), true);
+ MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), false);
+ MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), true);
dlg.setEnabledOptions(QAbstractPrintDialog::PrintPageRange);
- MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), FALSE);
- MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), FALSE);
- MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), TRUE);
+ MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), false);
+ MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), false);
+ MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), true);
dlg.setEnabledOptions((QAbstractPrintDialog::PrintDialogOptions(QAbstractPrintDialog::PrintSelection
| QAbstractPrintDialog::PrintPageRange)));
- MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), FALSE);
- MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), TRUE);
- MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), TRUE);
+ MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), false);
+ MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), true);
+ MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), true);
dlg.setEnabledOptions(QAbstractPrintDialog::PrintSelection);
- MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), FALSE);
- MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), TRUE);
- MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), FALSE);
+ MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintToFile), false);
+ MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintSelection), true);
+ MYCOMPARE(dlg.isOptionEnabled(QAbstractPrintDialog::PrintPageRange), false);
}
void tst_QPrinter::testMargins_data()
@@ -517,7 +516,6 @@ void tst_QPrinter::setGetPaperSize()
p.setOutputFormat(QPrinter::PdfFormat);
QSizeF size(500, 10);
p.setPaperSize(size, QPrinter::Millimeter);
- QEXPECT_FAIL("", "QTBUG-22562, QTBUG-22296", Abort);
QCOMPARE(p.paperSize(QPrinter::Millimeter), size);
QSizeF ptSize = p.paperSize(QPrinter::Point);
//qDebug() << ptSize;
@@ -760,7 +758,6 @@ void tst_QPrinter::valuePreservation()
printer.setPageSize(QPrinter::B5);
printer.setOutputFormat(newFormat);
- QEXPECT_FAIL("", "QTBUG-22562, QTBUG-22296", Abort);
QCOMPARE(printer.pageSize(), QPrinter::B5);
printer.setOutputFormat(oldFormat);
QCOMPARE(printer.pageSize(), QPrinter::B5);
@@ -881,7 +878,6 @@ void tst_QPrinter::testCustomPageSizes()
p.setPaperSize(customSize, QPrinter::Inch);
QSizeF paperSize = p.paperSize(QPrinter::Inch);
- QEXPECT_FAIL("", "QTBUG-22562, QTBUG-22296", Abort);
QCOMPARE(paperSize, customSize);
QPrinter p2(QPrinter::HighResolution);
@@ -975,7 +971,8 @@ void tst_QPrinter::testPdfTitle()
QPainter painter;
QPrinter printer;
// This string is just the UTF-8 encoding of the string: \()f &oslash; hiragana o
- const char title[]={0x5c, 0x28, 0x29, 0x66, 0xc3, 0xb8, 0xe3, 0x81, 0x8a, 0x00};
+ const unsigned char titleBuf[]={0x5c, 0x28, 0x29, 0x66, 0xc3, 0xb8, 0xe3, 0x81, 0x8a, 0x00};
+ const char *title = reinterpret_cast<const char*>(titleBuf);
printer.setOutputFileName("file.pdf");
printer.setDocName(QString::fromUtf8(title));
painter.begin(&printer);
@@ -986,10 +983,11 @@ void tst_QPrinter::testPdfTitle()
// The we expect the title to appear in the PDF as:
// ASCII('\title (') UTF16(\\\(\)f &oslash; hiragana o) ASCII(')').
// which has the following binary representation
- const char expected[] = {
+ const unsigned char expectedBuf[] = {
0x2f, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x20, 0x28, 0xfe,
0xff, 0x00, 0x5c, 0x5c, 0x00, 0x5c, 0x28, 0x00, 0x5c,
0x29, 0x00, 0x66, 0x00, 0xf8, 0x30, 0x4a, 0x29};
+ const char *expected = reinterpret_cast<const char*>(expectedBuf);
QVERIFY(file.readAll().contains(QByteArray(expected, 26)));
}
diff --git a/tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp b/tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp
index 04d148cdc4..6ffdc63e6c 100644
--- a/tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp
+++ b/tests/auto/gui/painting/qprinterinfo/tst_qprinterinfo.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/painting/qregion/tst_qregion.cpp b/tests/auto/gui/painting/qregion/tst_qregion.cpp
index 299710f56a..c9ad8e00ab 100644
--- a/tests/auto/gui/painting/qregion/tst_qregion.cpp
+++ b/tests/auto/gui/painting/qregion/tst_qregion.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/painting/qtransform/tst_qtransform.cpp b/tests/auto/gui/painting/qtransform/tst_qtransform.cpp
index 6d0b88dcd7..b4e1b8ffb8 100644
--- a/tests/auto/gui/painting/qtransform/tst_qtransform.cpp
+++ b/tests/auto/gui/painting/qtransform/tst_qtransform.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/painting/qwmatrix/tst_qwmatrix.cpp b/tests/auto/gui/painting/qwmatrix/tst_qwmatrix.cpp
index 7a5c96ab6b..725c374708 100644
--- a/tests/auto/gui/painting/qwmatrix/tst_qwmatrix.cpp
+++ b/tests/auto/gui/painting/qwmatrix/tst_qwmatrix.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp
index aa3e70a047..357b7359e4 100644
--- a/tests/auto/gui/qopengl/tst_qopengl.cpp
+++ b/tests/auto/gui/qopengl/tst_qopengl.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -50,6 +50,8 @@
#include <QtTest/QtTest>
+#include <QSignalSpy>
+
class tst_QOpenGL : public QObject
{
Q_OBJECT
@@ -62,6 +64,7 @@ private slots:
void fboRendering();
void fboHandleNulledAfterContextDestroyed();
void openGLPaintDevice();
+ void aboutToBeDestroyed();
};
struct SharedResourceTracker
@@ -500,5 +503,24 @@ void tst_QOpenGL::openGLPaintDevice()
QCOMPARE(image, fbo.toImage().convertToFormat(QImage::Format_RGB32));
}
+void tst_QOpenGL::aboutToBeDestroyed()
+{
+ QWindow window;
+ window.setGeometry(0, 0, 128, 128);
+ window.create();
+
+ QOpenGLContext *context = new QOpenGLContext;
+ QSignalSpy spy(context, SIGNAL(aboutToBeDestroyed()));
+
+ context->create();
+ context->makeCurrent(&window);
+
+ QCOMPARE(spy.size(), 0);
+
+ delete context;
+
+ QCOMPARE(spy.size(), 1);
+}
+
QTEST_MAIN(tst_QOpenGL)
#include "tst_qopengl.moc"
diff --git a/tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp b/tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp
index b296a56b38..d6fff734c0 100644
--- a/tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp
+++ b/tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
index 29dcfcd542..4f1deec996 100644
--- a/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
+++ b/tests/auto/gui/text/qcssparser/tst_qcssparser.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp
index 406bdf950e..c3d41a27bf 100644
--- a/tests/auto/gui/text/qfont/tst_qfont.cpp
+++ b/tests/auto/gui/text/qfont/tst_qfont.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
index bf84b91024..e7bbfbceff 100644
--- a/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
+++ b/tests/auto/gui/text/qfontdatabase/tst_qfontdatabase.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp
index a4bc8458b3..bc858bf38a 100644
--- a/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp
+++ b/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
index 256ea20a1c..a4e5c63e6d 100644
--- a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
+++ b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qrawfont/qrawfont.pro b/tests/auto/gui/text/qrawfont/qrawfont.pro
index 3b5e2b1046..149ad6442e 100644
--- a/tests/auto/gui/text/qrawfont/qrawfont.pro
+++ b/tests/auto/gui/text/qrawfont/qrawfont.pro
@@ -8,8 +8,4 @@ SOURCES += \
INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/harfbuzz/src
-wince* {
- DEFINES += SRCDIR=\\\"\\\"
-} else {
- DEFINES += SRCDIR=\\\"$$PWD/\\\"
-}
+TESTDATA += testfont_bold_italic.ttf testfont.ttf
diff --git a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp
index f922ba3572..a0cda39c27 100644
--- a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp
+++ b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,6 +40,7 @@
****************************************************************************/
#include <QtTest/QtTest>
+#include <QtGui/QFontDatabase>
#include <qrawfont.h>
#include <private/qrawfont_p.h>
@@ -50,6 +51,7 @@ class tst_QRawFont: public QObject
#if !defined(QT_NO_RAWFONT)
private slots:
void init();
+ void initTestCase();
void invalidRawFont();
@@ -99,7 +101,9 @@ private slots:
#if defined(Q_WS_X11) || defined(Q_WS_MAC)
void multipleRawFontsFromData();
#endif
-
+private:
+ QString testFont;
+ QString testFontBoldItalic;
#endif // QT_NO_RAWFONT
};
@@ -113,6 +117,18 @@ void tst_QRawFont::init()
{
}
+void tst_QRawFont::initTestCase()
+{
+ testFont = QFINDTESTDATA("testfont.ttf");
+ testFontBoldItalic = QFINDTESTDATA("testfont_bold_italic.ttf");
+ if (testFont.isEmpty() || testFontBoldItalic.isEmpty())
+ QFAIL("qrawfont unittest font files not found!");
+
+ QFontDatabase database;
+ if (database.families().count() == 0)
+ QSKIP("No fonts available!!!");
+}
+
void tst_QRawFont::invalidRawFont()
{
QRawFont font;
@@ -140,7 +156,7 @@ void tst_QRawFont::explicitRawFontNotLoadedInDatabase()
{
QFETCH(QFont::HintingPreference, hintingPreference);
- QRawFont font(QLatin1String(SRCDIR "testfont.ttf"), 10, hintingPreference);
+ QRawFont font(testFont, 10, hintingPreference);
QVERIFY(font.isValid());
QVERIFY(!QFontDatabase().families().contains(font.familyName()));
@@ -160,7 +176,7 @@ void tst_QRawFont::explicitRawFontNotAvailableInSystem()
{
QFETCH(QFont::HintingPreference, hintingPreference);
- QRawFont rawfont(QLatin1String(SRCDIR "testfont.ttf"), 10, hintingPreference);
+ QRawFont rawfont(testFont, 10, hintingPreference);
{
QFont font(rawfont.familyName(), 10);
@@ -190,7 +206,7 @@ void tst_QRawFont::correctFontData_data()
int *hintingPreference = hintingPreferences;
while (*hintingPreference >= 0) {
- QString fileName = QLatin1String(SRCDIR "testfont.ttf");
+ QString fileName = testFont;
QString title = fileName
+ QLatin1String(": hintingPreference=")
+ QString::number(*hintingPreference);
@@ -204,7 +220,7 @@ void tst_QRawFont::correctFontData_data()
<< 1000.0
<< 10.0;
- fileName = QLatin1String(SRCDIR "testfont_bold_italic.ttf");
+ fileName = testFontBoldItalic;
title = fileName
+ QLatin1String(": hintingPreference=")
+ QString::number(*hintingPreference);
@@ -245,7 +261,7 @@ void tst_QRawFont::correctFontData()
void tst_QRawFont::glyphIndices()
{
- QRawFont font(QLatin1String(SRCDIR "testfont.ttf"), 10);
+ QRawFont font(testFont, 10);
QVERIFY(font.isValid());
QVector<quint32> glyphIndices = font.glyphIndexesForString(QLatin1String("Foobar"));
@@ -269,7 +285,7 @@ void tst_QRawFont::advances()
{
QFETCH(QFont::HintingPreference, hintingPreference);
- QRawFont font(QLatin1String(SRCDIR "testfont.ttf"), 10, hintingPreference);
+ QRawFont font(testFont, 10, hintingPreference);
QVERIFY(font.isValid());
QRawFontPrivate *font_d = QRawFontPrivate::get(font);
@@ -292,7 +308,7 @@ void tst_QRawFont::advances()
void tst_QRawFont::textLayout()
{
QFontDatabase fontDatabase;
- int id = fontDatabase.addApplicationFont(SRCDIR "testfont.ttf");
+ int id = fontDatabase.addApplicationFont(testFont);
QVERIFY(id >= 0);
QString familyName = QString::fromLatin1("QtBidiTestFont");
@@ -371,7 +387,7 @@ void tst_QRawFont::fontTable()
QFETCH(int, offset);
QFETCH(quint32, expectedValue);
- QRawFont font(QString::fromLatin1(SRCDIR "testfont.ttf"), 10, hintingPreference);
+ QRawFont font(testFont, 10, hintingPreference);
QVERIFY(font.isValid());
QByteArray table = font.fontTable(tagName);
@@ -396,7 +412,7 @@ void tst_QRawFont::supportedWritingSystems_data()
QTest::newRow(qPrintable(QString::fromLatin1("testfont.ttf, hintingPreference=%1")
.arg(hintingPreference)))
- << QString::fromLatin1(SRCDIR "testfont.ttf")
+ << testFont
<< (QList<QFontDatabase::WritingSystem>()
<< QFontDatabase::Latin
<< QFontDatabase::Hebrew
@@ -405,7 +421,7 @@ void tst_QRawFont::supportedWritingSystems_data()
QTest::newRow(qPrintable(QString::fromLatin1("testfont_bold_italic.ttf, hintingPreference=%1")
.arg(hintingPreference)))
- << QString::fromLatin1(SRCDIR "testfont_bold_italic.ttf")
+ << testFontBoldItalic
<< (QList<QFontDatabase::WritingSystem>()
<< QFontDatabase::Latin
<< QFontDatabase::Hebrew
@@ -439,8 +455,8 @@ void tst_QRawFont::supportsCharacter_data()
QTest::addColumn<bool>("shouldBeSupported");
const char *fileNames[2] = {
- SRCDIR "testfont.ttf",
- SRCDIR "testfont_bold_italic.ttf"
+ "testfont.ttf",
+ "testfont_bold_italic.ttf"
};
for (int hintingPreference=QFont::PreferDefaultHinting;
@@ -448,7 +464,7 @@ void tst_QRawFont::supportsCharacter_data()
++hintingPreference) {
for (int i=0; i<2; ++i) {
- QString fileName = QLatin1String(fileNames[i]);
+ QString fileName = QFINDTESTDATA(fileNames[i]);
// Latin text
for (char ch='!'; ch<='~'; ++ch) {
@@ -510,7 +526,7 @@ void tst_QRawFont::supportsUcs4Character_data()
++hintingPreference) {
for (quint32 ch=0x10330; ch<=0x1034A; ++ch) {
{
- QString fileName = QString::fromLatin1(SRCDIR "testfont.ttf");
+ QString fileName = testFont;
QString title = QString::fromLatin1("%1, character=0x%2, hintingPreference=%3")
.arg(fileName).arg(QString::number(ch, 16)).arg(hintingPreference);
@@ -522,7 +538,7 @@ void tst_QRawFont::supportsUcs4Character_data()
}
{
- QString fileName = QString::fromLatin1(SRCDIR "testfont_bold_italic.ttf");
+ QString fileName = testFontBoldItalic;
QString title = QString::fromLatin1("%1, character=0x%2, hintingPreference=%3")
.arg(fileName).arg(QString::number(ch, 16)).arg(hintingPreference);
@@ -560,7 +576,7 @@ void tst_QRawFont::fromFont_data()
QString titleBase = QString::fromLatin1("%2, hintingPreference=%1, writingSystem=%3")
.arg(i);
{
- QString fileName = QString::fromLatin1(SRCDIR "testfont.ttf");
+ QString fileName = testFont;
QFontDatabase::WritingSystem writingSystem = QFontDatabase::Any;
QString title = titleBase.arg(fileName).arg(writingSystem);
@@ -572,7 +588,7 @@ void tst_QRawFont::fromFont_data()
}
{
- QString fileName = QString::fromLatin1(SRCDIR "testfont.ttf");
+ QString fileName = testFont;
QFontDatabase::WritingSystem writingSystem = QFontDatabase::Hebrew;
QString title = titleBase.arg(fileName).arg(writingSystem);
@@ -584,7 +600,7 @@ void tst_QRawFont::fromFont_data()
}
{
- QString fileName = QString::fromLatin1(SRCDIR "testfont.ttf");
+ QString fileName = testFont;
QFontDatabase::WritingSystem writingSystem = QFontDatabase::Latin;
QString title = titleBase.arg(fileName).arg(writingSystem);
@@ -644,7 +660,7 @@ void tst_QRawFont::copyConstructor()
QRawFont outerRawFont;
{
- QRawFont rawFont(QString::fromLatin1(SRCDIR "testfont.ttf"), 11, hintingPreference);
+ QRawFont rawFont(testFont, 11, hintingPreference);
QVERIFY(rawFont.isValid());
rawFontFamilyName = rawFont.familyName();
@@ -712,7 +728,7 @@ void tst_QRawFont::detach()
QRawFont outerRawFont;
{
- QRawFont rawFont(QString::fromLatin1(SRCDIR "testfont.ttf"), 11, hintingPreference);
+ QRawFont rawFont(testFont, 11, hintingPreference);
QVERIFY(rawFont.isValid());
rawFontFamilyName = rawFont.familyName();
@@ -725,8 +741,7 @@ void tst_QRawFont::detach()
{
QRawFont otherRawFont(rawFont);
- otherRawFont.loadFromFile(QLatin1String(SRCDIR "testfont.ttf"),
- rawFontPixelSize, hintingPreference);
+ otherRawFont.loadFromFile(testFont, rawFontPixelSize, hintingPreference);
QVERIFY(otherRawFont.isValid());
QCOMPARE(otherRawFont.pixelSize(), rawFontPixelSize);
@@ -740,8 +755,7 @@ void tst_QRawFont::detach()
{
QRawFont otherRawFont = rawFont;
- otherRawFont.loadFromFile(QLatin1String(SRCDIR "testfont.ttf"),
- rawFontPixelSize, hintingPreference);
+ otherRawFont.loadFromFile(testFont, rawFontPixelSize, hintingPreference);
QVERIFY(otherRawFont.isValid());
QCOMPARE(otherRawFont.pixelSize(), rawFontPixelSize);
@@ -754,8 +768,7 @@ void tst_QRawFont::detach()
outerRawFont = rawFont;
- rawFont.loadFromFile(QLatin1String(SRCDIR "testfont.ttf"), rawFontPixelSize,
- hintingPreference);
+ rawFont.loadFromFile(testFont, rawFontPixelSize, hintingPreference);
}
QVERIFY(outerRawFont.isValid());
@@ -783,7 +796,7 @@ void tst_QRawFont::unsupportedWritingSystem()
QFETCH(QFont::HintingPreference, hintingPreference);
QFontDatabase fontDatabase;
- int id = fontDatabase.addApplicationFont(QLatin1String(SRCDIR "testfont.ttf"));
+ int id = fontDatabase.addApplicationFont(testFont);
QFont font("QtBidiTestFont");
font.setHintingPreference(hintingPreference);
@@ -857,13 +870,13 @@ void tst_QRawFont::rawFontSetPixelSize()
#if defined(Q_WS_X11) || defined(Q_WS_MAC)
void tst_QRawFont::multipleRawFontsFromData()
{
- QFile file(QString::fromLatin1(SRCDIR "testfont.ttf"));
+ QFile file(testFont);
QRawFont testFont;
if (file.open(QIODevice::ReadOnly)) {
testFont.loadFromData(file.readAll(), 11, QFont::PreferDefaultHinting);
file.close();
}
- file.setFileName(QLatin1String(SRCDIR "testfont_bold_italic.ttf"));
+ file.setFileName(testFontBoldItalic);
QRawFont testFontBoldItalic;
if (file.open(QIODevice::ReadOnly))
testFontBoldItalic.loadFromData(file.readAll(), 11, QFont::PreferDefaultHinting);
diff --git a/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp b/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp
index 05854440c6..b0a66eab07 100644
--- a/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp
+++ b/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp b/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp
index bbc60df9d4..0358b5d471 100644
--- a/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp
+++ b/tests/auto/gui/text/qsyntaxhighlighter/tst_qsyntaxhighlighter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qtextblock/tst_qtextblock.cpp b/tests/auto/gui/text/qtextblock/tst_qtextblock.cpp
index 190262f4ef..9489a2e90e 100644
--- a/tests/auto/gui/text/qtextblock/tst_qtextblock.cpp
+++ b/tests/auto/gui/text/qtextblock/tst_qtextblock.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp b/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp
index 9667df73bb..09b9a06a1d 100644
--- a/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp
+++ b/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -872,27 +872,147 @@ void tst_QTextCursor::tableMovement()
void tst_QTextCursor::selectionsInTable()
{
- QTextTable *table = cursor.insertTable(2, 2);
- table->cellAt(0, 0).firstCursorPosition().insertText("First");
- table->cellAt(0, 1).firstCursorPosition().insertText("Second");
- table->cellAt(1, 0).firstCursorPosition().insertText("Third");
- table->cellAt(1, 1).firstCursorPosition().insertText("Fourth");
+ QTextTable *table = cursor.insertTable(3, 3);
+ table->cellAt(0, 0).firstCursorPosition().insertText("A a"); // first = 1
+ table->cellAt(0, 1).firstCursorPosition().insertText("B b"); // first = 5
+ table->cellAt(0, 2).firstCursorPosition().insertText("C c"); // first = 9
+ table->cellAt(1, 0).firstCursorPosition().insertText("D d"); // first = 13
+ table->cellAt(1, 1).firstCursorPosition().insertText("E e"); // first = 17
+ table->cellAt(1, 2).firstCursorPosition().insertText("F f"); // first = 21
+ table->cellAt(2, 0).firstCursorPosition().insertText("G g"); // first = 25
+ table->cellAt(2, 1).firstCursorPosition().insertText("H h"); // first = 29
+ table->cellAt(2, 2).firstCursorPosition().insertText("I i"); // first = 33
cursor = table->cellAt(0, 0).lastCursorPosition();
+ QCOMPARE(cursor.position(), 4);
+ QVERIFY(cursor.movePosition(QTextCursor::PreviousWord, QTextCursor::KeepAnchor));
QVERIFY(cursor.movePosition(QTextCursor::PreviousWord, QTextCursor::KeepAnchor));
QVERIFY(cursor.movePosition(QTextCursor::PreviousWord, QTextCursor::KeepAnchor) == false);
+ QCOMPARE(cursor.position(), 1);
cursor = table->cellAt(1, 0).lastCursorPosition();
+ QCOMPARE(cursor.position(), 16);
+ QVERIFY(cursor.movePosition(QTextCursor::PreviousWord, QTextCursor::KeepAnchor));
QVERIFY(cursor.movePosition(QTextCursor::PreviousWord, QTextCursor::KeepAnchor));
QVERIFY(cursor.movePosition(QTextCursor::PreviousWord, QTextCursor::KeepAnchor) == false);
+ QCOMPARE(cursor.position(), 13);
- cursor = table->cellAt(0, 1).firstCursorPosition();
+ cursor = table->cellAt(0, 2).firstCursorPosition();
+ QVERIFY(cursor.movePosition(QTextCursor::NextWord, QTextCursor::KeepAnchor));
QVERIFY(cursor.movePosition(QTextCursor::NextWord, QTextCursor::KeepAnchor));
QVERIFY(cursor.movePosition(QTextCursor::NextWord, QTextCursor::KeepAnchor) == false);
- cursor = table->cellAt(1, 1).firstCursorPosition();
+ cursor = table->cellAt(1, 2).firstCursorPosition();
+ QVERIFY(cursor.movePosition(QTextCursor::NextWord, QTextCursor::KeepAnchor));
QVERIFY(cursor.movePosition(QTextCursor::NextWord, QTextCursor::KeepAnchor));
QVERIFY(cursor.movePosition(QTextCursor::NextWord, QTextCursor::KeepAnchor) == false);
+
+ // Next let's test selecting entire cells one at a time
+ cursor = table->cellAt(0, 0).firstCursorPosition();
+ QVERIFY(cursor.movePosition(QTextCursor::NextCell, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 5);
+ QVERIFY(cursor.movePosition(QTextCursor::NextCell, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 9);
+ QVERIFY(cursor.movePosition(QTextCursor::NextCell, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 13);
+ QVERIFY(cursor.movePosition(QTextCursor::NextCell, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 17);
+ QVERIFY(cursor.movePosition(QTextCursor::NextCell, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 21);
+ QVERIFY(cursor.movePosition(QTextCursor::NextCell, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 25);
+ QVERIFY(cursor.movePosition(QTextCursor::NextCell, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 29);
+ QVERIFY(cursor.movePosition(QTextCursor::NextCell, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 33);
+ QVERIFY(cursor.movePosition(QTextCursor::NextCell, QTextCursor::KeepAnchor) == false);
+
+ // And now lets walk all the way back
+ QVERIFY(cursor.movePosition(QTextCursor::PreviousCell, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 29);
+ QVERIFY(cursor.movePosition(QTextCursor::PreviousCell, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 25);
+ QVERIFY(cursor.movePosition(QTextCursor::PreviousCell, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 21);
+ QVERIFY(cursor.movePosition(QTextCursor::PreviousCell, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 17);
+ QVERIFY(cursor.movePosition(QTextCursor::PreviousCell, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 13);
+ QVERIFY(cursor.movePosition(QTextCursor::PreviousCell, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 9);
+ QVERIFY(cursor.movePosition(QTextCursor::PreviousCell, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 5);
+ QVERIFY(cursor.movePosition(QTextCursor::PreviousCell, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 1);
+ QVERIFY(cursor.movePosition(QTextCursor::PreviousCell, QTextCursor::KeepAnchor) == false);
+
+ QTextCursor::MoveOperation leftMovements[5] = {
+ QTextCursor::PreviousBlock
+ , QTextCursor::PreviousCharacter
+ , QTextCursor::PreviousWord
+ , QTextCursor::Left
+ , QTextCursor::WordLeft
+ };
+
+ QTextCursor::MoveOperation rightMovements[5] = {
+ QTextCursor::NextBlock
+ , QTextCursor::NextCharacter
+ , QTextCursor::NextWord
+ , QTextCursor::Right
+ , QTextCursor::WordRight
+ };
+
+ for (int i = 0; i < 5; ++i) {
+ QTextCursor::MoveOperation left = leftMovements[i];
+ QTextCursor::MoveOperation right = rightMovements[i];
+
+ // Lets walk circle around anchor placed at 1,1 using up, down, left and right
+ cursor = table->cellAt(1, 1).firstCursorPosition();
+ QCOMPARE(cursor.position(), 17);
+ QVERIFY(cursor.movePosition(QTextCursor::Right, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 18); // First right should not jump more than one char
+ QVERIFY(cursor.movePosition(QTextCursor::NextCell, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 21); // Lets jump to the next cell
+ QVERIFY(cursor.movePosition(QTextCursor::Down, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 33);
+ QVERIFY(cursor.movePosition(left, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 29);
+ QVERIFY(cursor.movePosition(left, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 25);
+ QVERIFY(cursor.movePosition(QTextCursor::Up, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 13);
+ QVERIFY(cursor.movePosition(QTextCursor::Up, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 1);
+ QVERIFY(cursor.movePosition(right, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 5);
+ QVERIFY(cursor.movePosition(right, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 9);
+ QVERIFY(cursor.movePosition(QTextCursor::Down, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 21);
+
+ // Lets walk to the side 2 cells and back, first right
+ cursor = table->cellAt(0, 0).firstCursorPosition();
+ QVERIFY(cursor.movePosition(QTextCursor::NextCell, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 5); // Lets jump to the next cell
+ QVERIFY(cursor.movePosition(right, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 9);
+ QVERIFY(cursor.movePosition(left, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 5);
+ QVERIFY(cursor.movePosition(left, QTextCursor::KeepAnchor));
+ QVERIFY(cursor.position() < 5);
+
+ // Then left
+ cursor = table->cellAt(0, 2).firstCursorPosition();
+ QCOMPARE(cursor.position(), 9);
+ QVERIFY(cursor.movePosition(left, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 5); // A single left should do
+ QVERIFY(cursor.movePosition(left, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 1);
+ QVERIFY(cursor.movePosition(right, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 5);
+ QVERIFY(cursor.movePosition(right, QTextCursor::KeepAnchor));
+ QCOMPARE(cursor.position(), 9);
+ }
}
void tst_QTextCursor::selectedText()
diff --git a/tests/auto/gui/text/qtextdocument/common.h b/tests/auto/gui/text/qtextdocument/common.h
index 1eaefdbfbe..081c71ea13 100644
--- a/tests/auto/gui/text/qtextdocument/common.h
+++ b/tests/auto/gui/text/qtextdocument/common.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
index a9295ffbdb..a84024ceab 100644
--- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
+++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
index 7b4c1f9804..63a67a0c10 100644
--- a/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
+++ b/tests/auto/gui/text/qtextdocumentfragment/tst_qtextdocumentfragment.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qtextdocumentlayout/tst_qtextdocumentlayout.cpp b/tests/auto/gui/text/qtextdocumentlayout/tst_qtextdocumentlayout.cpp
index ae31936e63..91da86d3d1 100644
--- a/tests/auto/gui/text/qtextdocumentlayout/tst_qtextdocumentlayout.cpp
+++ b/tests/auto/gui/text/qtextdocumentlayout/tst_qtextdocumentlayout.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp b/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp
index 1d69bc2c1d..166b5d7c82 100644
--- a/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp
+++ b/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -63,6 +63,8 @@ private slots:
void testUnderlinePropertyPrecedence();
void toFormat();
void resolveFont();
+ void testLetterSpacing();
+ void testFontStretch();
void getSetTabs();
void testTabsUsed();
void testFontStyleSetters();
@@ -277,6 +279,41 @@ void tst_QTextFormat::resolveFont()
QVERIFY(fmt.font().strikeOut());
}
+
+void tst_QTextFormat::testLetterSpacing()
+{
+ QTextCharFormat format;
+
+ QCOMPARE(format.hasProperty(QTextFormat::FontLetterSpacing), false);
+ QCOMPARE(format.hasProperty(QTextFormat::FontAbsoluteLetterSpacing), false);
+
+ format.setFontAbsoluteLetterSpacing(10.0);
+
+ QCOMPARE(format.hasProperty(QTextFormat::FontLetterSpacing), false);
+ QCOMPARE(format.property(QTextFormat::FontAbsoluteLetterSpacing).toDouble(), 10.0);
+
+ format.setFontLetterSpacing(110.0);
+
+ QCOMPARE(format.property(QTextFormat::FontLetterSpacing).toDouble(), 110.0);
+ QCOMPARE(format.hasProperty(QTextFormat::FontAbsoluteLetterSpacing), false);
+
+ format.setFontAbsoluteLetterSpacing(10.0);
+
+ QCOMPARE(format.hasProperty(QTextFormat::FontLetterSpacing), false);
+ QCOMPARE(format.property(QTextFormat::FontAbsoluteLetterSpacing).toDouble(), 10.0);
+}
+
+void tst_QTextFormat::testFontStretch()
+{
+ QTextCharFormat format;
+
+ QCOMPARE(format.hasProperty(QTextFormat::FontStretch), false);
+
+ format.setFontStretch(130.0);
+
+ QCOMPARE(format.property(QTextFormat::FontStretch).toInt(), 130);
+}
+
void tst_QTextFormat::getSetTabs()
{
class Comparator {
diff --git a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
index 253211bbe9..e816b04153 100644
--- a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
+++ b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qtextlist/tst_qtextlist.cpp b/tests/auto/gui/text/qtextlist/tst_qtextlist.cpp
index 8b4317f52b..810c416875 100644
--- a/tests/auto/gui/text/qtextlist/tst_qtextlist.cpp
+++ b/tests/auto/gui/text/qtextlist/tst_qtextlist.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qtextobject/tst_qtextobject.cpp b/tests/auto/gui/text/qtextobject/tst_qtextobject.cpp
index 15e50a5a54..b621763cea 100644
--- a/tests/auto/gui/text/qtextobject/tst_qtextobject.cpp
+++ b/tests/auto/gui/text/qtextobject/tst_qtextobject.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp b/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp
index 01abf636c9..49d86a2c4b 100644
--- a/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp
+++ b/tests/auto/gui/text/qtextodfwriter/tst_qtextodfwriter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qtextpiecetable/tst_qtextpiecetable.cpp b/tests/auto/gui/text/qtextpiecetable/tst_qtextpiecetable.cpp
index 2f4ca7282a..b74bc3daf8 100644
--- a/tests/auto/gui/text/qtextpiecetable/tst_qtextpiecetable.cpp
+++ b/tests/auto/gui/text/qtextpiecetable/tst_qtextpiecetable.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qtextscriptengine/generate/main.cpp b/tests/auto/gui/text/qtextscriptengine/generate/main.cpp
index 06caa34b4d..5bb13232ca 100644
--- a/tests/auto/gui/text/qtextscriptengine/generate/main.cpp
+++ b/tests/auto/gui/text/qtextscriptengine/generate/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp
index 487ef96405..638f13aea2 100644
--- a/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp
+++ b/tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp b/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
index fcafa51c90..b4ecdf1f39 100644
--- a/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
+++ b/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/text/qzip/tst_qzip.cpp b/tests/auto/gui/text/qzip/tst_qzip.cpp
index 7d7f412648..d68cb2e2dc 100644
--- a/tests/auto/gui/text/qzip/tst_qzip.cpp
+++ b/tests/auto/gui/text/qzip/tst_qzip.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp b/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
index d354e18fe4..cfaafb37f4 100644
--- a/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
+++ b/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h
index 5cf32d32b1..bd3539c797 100644
--- a/tests/auto/network-settings.h
+++ b/tests/auto/network-settings.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/access/access.pro b/tests/auto/network/access/access.pro
index 53b16f07b8..1e98d3cf85 100644
--- a/tests/auto/network/access/access.pro
+++ b/tests/auto/network/access/access.pro
@@ -8,13 +8,11 @@ SUBDIRS=\
qhttpnetworkconnection \
qnetworkreply \
qnetworkcachemetadata \
- qftp \
qhttpnetworkreply \
- qhttp \
qabstractnetworkcache \
!contains(QT_CONFIG, private_tests): SUBDIRS -= \
qhttpnetworkconnection \
qhttpnetworkreply \
-
+ qftp \
diff --git a/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp b/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
index 59a9c559c0..94de4704fb 100644
--- a/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
+++ b/tests/auto/network/access/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -85,7 +85,7 @@ private slots:
void deleteCache();
private:
- void check();
+ void runTest();
void checkSynchronous();
#ifndef QT_NO_BEARERMANAGEMENT
@@ -174,7 +174,7 @@ void tst_QAbstractNetworkCache::expires_data()
void tst_QAbstractNetworkCache::expires()
{
- check();
+ runTest();
}
void tst_QAbstractNetworkCache::expiresSynchronous_data()
@@ -206,7 +206,7 @@ void tst_QAbstractNetworkCache::lastModified_data()
void tst_QAbstractNetworkCache::lastModified()
{
- check();
+ runTest();
}
void tst_QAbstractNetworkCache::lastModifiedSynchronous_data()
@@ -238,7 +238,7 @@ void tst_QAbstractNetworkCache::etag_data()
void tst_QAbstractNetworkCache::etag()
{
- check();
+ runTest();
}
void tst_QAbstractNetworkCache::etagSynchronous_data()
@@ -279,7 +279,7 @@ void tst_QAbstractNetworkCache::cacheControl_data()
void tst_QAbstractNetworkCache::cacheControl()
{
- check();
+ runTest();
}
void tst_QAbstractNetworkCache::cacheControlSynchronous_data()
@@ -292,7 +292,7 @@ void tst_QAbstractNetworkCache::cacheControlSynchronous()
checkSynchronous();
}
-void tst_QAbstractNetworkCache::check()
+void tst_QAbstractNetworkCache::runTest()
{
QFETCH(QNetworkRequest::CacheLoadControl, cacheLoadControl);
QFETCH(QString, url);
diff --git a/tests/auto/network/access/qftp/tst_qftp.cpp b/tests/auto/network/access/qftp/tst_qftp.cpp
index 2e484d5bb5..35abd68415 100644
--- a/tests/auto/network/access/qftp/tst_qftp.cpp
+++ b/tests/auto/network/access/qftp/tst_qftp.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -45,7 +45,7 @@
#include <qcoreapplication.h>
#include <qfile.h>
#include <qbuffer.h>
-#include "qftp.h"
+#include "private/qftp_p.h"
#include <qmap.h>
#include <time.h>
#include <stdlib.h>
@@ -278,7 +278,7 @@ void tst_QFtp::init()
bytesAvailable_finished = 1234567890;
bytesAvailable_done = 1234567890;
- inFileDirExistsFunction = FALSE;
+ inFileDirExistsFunction = false;
#if !defined(Q_OS_WINCE)
srand(time(0));
@@ -435,12 +435,12 @@ void tst_QFtp::close_data()
QTest::addColumn<QString>("password");
QTest::addColumn<bool>("login");
- QTest::newRow( "login01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << (bool)TRUE;
- QTest::newRow( "login02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftp") << QString() << (bool)TRUE;
- QTest::newRow( "login03" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftp") << QString("foo") << (bool)TRUE;
- QTest::newRow( "login04" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password") << (bool)TRUE;
+ QTest::newRow( "login01" ) << QtNetworkSettings::serverName() << (uint)21 << QString() << QString() << true;
+ QTest::newRow( "login02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftp") << QString() << true;
+ QTest::newRow( "login03" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftp") << QString("foo") << true;
+ QTest::newRow( "login04" ) << QtNetworkSettings::serverName() << (uint)21 << QString("ftptest") << QString("password") << true;
- QTest::newRow( "no-login01" ) << QtNetworkSettings::serverName() << (uint)21 << QString("") << QString("") << (bool)FALSE;
+ QTest::newRow( "no-login01" ) << QtNetworkSettings::serverName() << (uint)21 << QString("") << QString("") << false;
}
void tst_QFtp::close()
@@ -1963,12 +1963,12 @@ bool tst_QFtp::fileExists( const QString &host, quint16 port, const QString &use
// ### make these tests work
if (ftp->currentId() != 0) {
qWarning("ftp->currentId() != 0");
- return FALSE;
+ return false;
}
if (ftp->state() != QFtp::Unconnected) {
qWarning("ftp->state() != QFtp::Unconnected");
- return FALSE;
+ return false;
}
addCommand( QFtp::ConnectToHost, ftp->connectToHost( host, port ) );
@@ -1978,39 +1978,39 @@ bool tst_QFtp::fileExists( const QString &host, quint16 port, const QString &use
addCommand( QFtp::List, ftp->list( file ) );
addCommand( QFtp::Close, ftp->close() );
- inFileDirExistsFunction = TRUE;
+ inFileDirExistsFunction = true;
QTestEventLoop::instance().enterLoop( 30 );
delete ftp;
ftp = 0;
if ( QTestEventLoop::instance().timeout() ) {
// ### make this test work
qWarning("tst_QFtp::fileExists: Network operation timed out");
- return FALSE;
+ return false;
}
- inFileDirExistsFunction = FALSE;
+ inFileDirExistsFunction = false;
ResMapIt it = resultMap.find( QFtp::ConnectToHost );
// ### make these tests work
if (it == resultMap.end()) {
qWarning("it != resultMap.end()");
- return FALSE;
+ return false;
}
if (it.value().success == -1) {
qWarning("it.value().success != -1");
- return FALSE;
+ return false;
}
if ( it.value().success == 1 ) {
for ( uint i=0; i < (uint) listInfo_i.count(); i++ ) {
if ( QFileInfo(listInfo_i[i].name()).fileName() == QFileInfo(file).fileName() )
- return TRUE;
+ return true;
}
}
//this is not a good warning considering sometime this function is used to test that a file does not exist
//qWarning("file doesn't exist");
- return FALSE;
+ return false;
}
bool tst_QFtp::dirExists( const QString &host, quint16 port, const QString &user, const QString &password, const QString &cdDir, const QString &dirToCreate )
@@ -2029,7 +2029,7 @@ bool tst_QFtp::dirExists( const QString &host, quint16 port, const QString &user
addCommand( QFtp::Cd, ftp->cd( cdDir + "/" + dirToCreate ) );
addCommand( QFtp::Close, ftp->close() );
- inFileDirExistsFunction = TRUE;
+ inFileDirExistsFunction = true;
QTestEventLoop::instance().enterLoop( 30 );
delete ftp;
ftp = 0;
@@ -2037,9 +2037,9 @@ bool tst_QFtp::dirExists( const QString &host, quint16 port, const QString &user
// ### make this test work
// QFAIL( "Network operation timed out" );
qWarning("tst_QFtp::dirExists: Network operation timed out");
- return FALSE;
+ return false;
}
- inFileDirExistsFunction = FALSE;
+ inFileDirExistsFunction = false;
ResMapIt it = resultMap.find( QFtp::Cd );
// ### make these tests work
diff --git a/tests/auto/network/access/qhttp/.gitattributes b/tests/auto/network/access/qhttp/.gitattributes
deleted file mode 100644
index e04709aa2e..0000000000
--- a/tests/auto/network/access/qhttp/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-rfc3252.txt -crlf
diff --git a/tests/auto/network/access/qhttp/.gitignore b/tests/auto/network/access/qhttp/.gitignore
deleted file mode 100644
index 00c1f492cd..0000000000
--- a/tests/auto/network/access/qhttp/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-tst_qhttp
diff --git a/tests/auto/network/access/qhttp/dummyserver.h b/tests/auto/network/access/qhttp/dummyserver.h
deleted file mode 100644
index 7c14ae2f14..0000000000
--- a/tests/auto/network/access/qhttp/dummyserver.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-// Use if you need
-
-class DummyHttpServer : public QTcpServer
-{
- Q_OBJECT
-public:
- DummyHttpServer() : phase(Header)
- { listen(); }
-
-protected:
- enum {
- Header,
- Data1,
- Data2,
- Close
- } phase;
- void incomingConnection(int socketDescriptor)
- {
- QSslSocket *socket = new QSslSocket(this);
- socket->setSocketDescriptor(socketDescriptor, QAbstractSocket::ConnectedState);
- socket->ignoreSslErrors();
- socket->startServerEncryption();
- connect(socket, SIGNAL(readyRead()), SLOT(handleReadyRead()));
- }
-
-public slots:
- void handleReadyRead()
- {
- QTcpSocket *socket = static_cast<QTcpSocket *>(sender());
- socket->readAll();
- if (phase != Header)
- return;
-
- phase = Data1;
- static const char header[] =
- "HTTP/1.0 200 OK\r\n"
- "Date: Fri, 07 Sep 2007 12:33:18 GMT\r\n"
- "Server: Apache\r\n"
- "Expires:\r\n"
- "Cache-Control:\r\n"
- "Pragma:\r\n"
- "Last-Modified: Thu, 06 Sep 2007 08:52:06 +0000\r\n"
- "Etag: a700f59a6ccb1ad39af68d998aa36fb1\r\n"
- "Vary: Accept-Encoding\r\n"
- "Content-Length: 6560\r\n"
- "Connection: close\r\n"
- "Content-Type: text/html; charset=utf-8\r\n"
- "\r\n";
-
-
- socket->write(header, sizeof header - 1);
- connect(socket, SIGNAL(bytesWritten(qint64)), SLOT(handleBytesWritten()), Qt::QueuedConnection);
- }
-
- void handleBytesWritten()
- {
- QTcpSocket *socket = static_cast<QTcpSocket *>(sender());
- if (socket->bytesToWrite() != 0)
- return;
-
- if (phase == Data1) {
- QByteArray data(4096, 'a');
- socket->write(data);
- phase = Data2;
- } else if (phase == Data2) {
- QByteArray data(2464, 'a');
- socket->write(data);
- phase = Close;
- } else {
- //socket->disconnectFromHost();
- //socket->deleteLater();
- }
- }
-};
diff --git a/tests/auto/network/access/qhttp/qhttp.pro b/tests/auto/network/access/qhttp/qhttp.pro
deleted file mode 100644
index d25b321851..0000000000
--- a/tests/auto/network/access/qhttp/qhttp.pro
+++ /dev/null
@@ -1,23 +0,0 @@
-CONFIG += testcase
-TARGET = tst_qhttp
-SOURCES += tst_qhttp.cpp
-
-
-QT = core network testlib
-
-wince*: {
- webFiles.files = webserver/*
- webFiles.path = webserver
- cgi.files = webserver/cgi-bin/*
- cgi.path = webserver/cgi-bin
- addFiles.files = rfc3252.txt trolltech
- addFiles.path = .
- DEPLOYMENT += addFiles webFiles cgi
- DEFINES += SRCDIR=\\\"\\\"
-} else:vxworks*: {
- DEFINES += SRCDIR=\\\"\\\"
-} else {
- DEFINES += SRCDIR=\\\"$$PWD/\\\"
-}
-
-CONFIG+=insignificant_test
diff --git a/tests/auto/network/access/qhttp/rfc3252.txt b/tests/auto/network/access/qhttp/rfc3252.txt
deleted file mode 100644
index b80c61bf0a..0000000000
--- a/tests/auto/network/access/qhttp/rfc3252.txt
+++ /dev/null
@@ -1,899 +0,0 @@
-
-
-
-
-
-
-Network Working Group H. Kennedy
-Request for Comments: 3252 Mimezine
-Category: Informational 1 April 2002
-
-
- Binary Lexical Octet Ad-hoc Transport
-
-Status of this Memo
-
- This memo provides information for the Internet community. It does
- not specify an Internet standard of any kind. Distribution of this
- memo is unlimited.
-
-Copyright Notice
-
- Copyright (C) The Internet Society (2002). All Rights Reserved.
-
-Abstract
-
- This document defines a reformulation of IP and two transport layer
- protocols (TCP and UDP) as XML applications.
-
-1. Introduction
-
-1.1. Overview
-
- This document describes the Binary Lexical Octet Ad-hoc Transport
- (BLOAT): a reformulation of a widely-deployed network-layer protocol
- (IP [RFC791]), and two associated transport layer protocols (TCP
- [RFC793] and UDP [RFC768]) as XML [XML] applications. It also
- describes methods for transporting BLOAT over Ethernet and IEEE 802
- networks as well as encapsulating BLOAT in IP for gatewaying BLOAT
- across the public Internet.
-
-1.2. Motivation
-
- The wild popularity of XML as a basis for application-level protocols
- such as the Blocks Extensible Exchange Protocol [RFC3080], the Simple
- Object Access Protocol [SOAP], and Jabber [JABBER] prompted
- investigation into the possibility of extending the use of XML in the
- protocol stack. Using XML at both the transport and network layer in
- addition to the application layer would provide for an amazing amount
- of power and flexibility while removing dependencies on proprietary
- and hard-to-understand binary protocols. This protocol unification
- would also allow applications to use a single XML parser for all
- aspects of their operation, eliminating developer time spent figuring
- out the intricacies of each new protocol, and moving the hard work of
-
-
-
-
-Kennedy Informational [Page 1]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- parsing to the XML toolset. The use of XML also mitigates concerns
- over "network vs. host" byte ordering which is at the root of many
- network application bugs.
-
-1.3. Relation to Existing Protocols
-
- The reformulations specified in this RFC follow as closely as
- possible the spirit of the RFCs on which they are based, and so MAY
- contain elements or attributes that would not be needed in a pure
- reworking (e.g. length attributes, which are implicit in XML.)
-
- The layering of network and transport protocols are maintained in
- this RFC despite the optimizations that could be made if the line
- were somewhat blurred (i.e. merging TCP and IP into a single, larger
- element in the DTD) in order to foster future use of this protocol as
- a basis for reformulating other protocols (such as ICMP.)
-
- Other than the encoding, the behavioral aspects of each of the
- existing protocols remain unchanged. Routing, address spaces, TCP
- congestion control, etc. behave as specified in the extant standards.
- Adapting to new standards and experimental algorithm heuristics for
- improving performance will become much easier once the move to BLOAT
- has been completed.
-
-1.4. Requirement Levels
-
- The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
- "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
- document are to be interpreted as described in BCP 14, RFC 2119
- [RFC2119].
-
-2. IPoXML
-
- This protocol MUST be implemented to be compliant with this RFC.
- IPoXML is the root protocol REQUIRED for effective use of TCPoXML
- (section 3.) and higher-level application protocols.
-
- The DTD for this document type can be found in section 7.1.
-
- The routing of IPoXML can be easily implemented on hosts with an XML
- parser, as the regular structure lends itself handily to parsing and
- validation of the document/datagram and then processing the
- destination address, TTL, and checksum before sending it on to its
- next-hop.
-
- The reformulation of IPv4 was chosen over IPv6 [RFC2460] due to the
- wider deployment of IPv4 and the fact that implementing IPv6 as XML
- would have exceeded the 1500 byte Ethernet MTU.
-
-
-
-Kennedy Informational [Page 2]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- All BLOAT implementations MUST use - and specify - the UTF-8 encoding
- of RFC 2279 [RFC2279]. All BLOAT document/datagrams MUST be well-
- formed and include the XMLDecl.
-
-2.1. IP Description
-
- A number of items have changed (for the better) from the original IP
- specification. Bit-masks, where present have been converted into
- human-readable values. IP addresses are listed in their dotted-
- decimal notation [RFC1123]. Length and checksum values are present
- as decimal integers.
-
- To calculate the length and checksum fields of the IP element, a
- canonicalized form of the element MUST be used. The canonical form
- SHALL have no whitespace (including newline characters) between
- elements and only one space character between attributes. There
- SHALL NOT be a space following the last attribute in an element.
-
- An iterative method SHOULD be used to calculate checksums, as the
- length field will vary based on the size of the checksum.
-
- The payload element bears special attention. Due to the character
- set restrictions of XML, the payload of IP datagrams (which MAY
- contain arbitrary data) MUST be encoded for transport. This RFC
- REQUIRES the contents of the payload to be encoded in the base-64
- encoding of RFC 2045 [RFC2045], but removes the requirement that the
- encoded output MUST be wrapped on 76-character lines.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Kennedy Informational [Page 3]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
-2.2. Example Datagram
-
- The following is an example IPoXML datagram with an empty payload:
-
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE ip PUBLIC "-//IETF//DTD BLOAT 1.0 IP//EN" "bloat.dtd">
- <ip>
- <header length="474">
- <version value="4"/>
- <tos precedence="Routine" delay="Normal" throughput="Normal"
- relibility="Normal" reserved="0"/>
- <total.length value="461"/>
- <id value="1"/>
- <flags reserved="0" df="dont" mf="last"/>
- <offset value="0"/>
- <ttl value="255"/>
- <protocol value="6"/>
- <checksum value="8707"/>
- <source address="10.0.0.22"/>
- <destination address="10.0.0.1"/>
- <options>
- <end copied="0" class="0" number="0"/>
- </options>
- <padding pad="0"/>
- </header>
- <payload>
- </payload>
- </ip>
-
-3. TCPoXML
-
- This protocol MUST be implemented to be compliant with this RFC. The
- DTD for this document type can be found in section 7.2.
-
-3.1. TCP Description
-
- A number of items have changed from the original TCP specification.
- Bit-masks, where present have been converted into human-readable
- values. Length and checksum and port values are present as decimal
- integers.
-
- To calculate the length and checksum fields of the TCP element, a
- canonicalized form of the element MUST be used as in section 2.1.
-
- An iterative method SHOULD be used to calculate checksums as in
- section 2.1.
-
- The payload element MUST be encoded as in section 2.1.
-
-
-
-Kennedy Informational [Page 4]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- The TCP offset element was expanded to a maximum of 255 from 16 to
- allow for the increased size of the header in XML.
-
- TCPoXML datagrams encapsulated by IPoXML MAY omit the <?xml?> header
- as well as the <!DOCTYPE> declaration.
-
-3.2. Example Datagram
-
- The following is an example TCPoXML datagram with an empty payload:
-
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE tcp PUBLIC "-//IETF//DTD BLOAT 1.0 TCP//EN" "bloat.dtd">
- <tcp>
- <tcp.header>
- <src port="31415"/>
- <dest port="42424"/>
- <sequence number="322622954"/>
- <acknowledgement number="689715995"/>
- <offset number=""/>
- <reserved value="0"/>
- <control syn="1" ack="1"/>
- <window size="1"/>
- <urgent pointer="0"/>
- <checksum value="2988"/>
- <tcp.options>
- <tcp.end kind="0"/>
- </tcp.options>
- <padding pad="0"/>
- </tcp.header>
- <payload>
- </payload>
- </tcp>
-
-4. UDPoXML
-
- This protocol MUST be implemented to be compliant with this RFC. The
- DTD for this document type can be found in section 7.3.
-
-4.1. UDP Description
-
- A number of items have changed from the original UDP specification.
- Bit-masks, where present have been converted into human-readable
- values. Length and checksum and port values are present as decimal
- integers.
-
-
-
-
-
-
-
-Kennedy Informational [Page 5]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- To calculate the length and checksum fields of the UDP element, a
- canonicalized form of the element MUST be used as in section 2.1. An
- iterative method SHOULD be used to calculate checksums as in section
- 2.1.
-
- The payload element MUST be encoded as in section 2.1.
-
- UDPoXML datagrams encapsulated by IPoXML MAY omit the <?xml?> header
- as well as the <!DOCTYPE> declaration.
-
-4.2. Example Datagram
-
- The following is an example UDPoXML datagram with an empty payload:
-
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE udp PUBLIC "-//IETF//DTD BLOAT 1.0 UDP//EN" "bloat.dtd">
- <udp>
- <udp.header>
- <src port="31415"/>
- <dest port="42424"/>
- <udp.length value="143"/>
- <checksum value="2988"/>
- </udp.header>
- <payload>
- </payload>
- </udp>
-
-5. Network Transport
-
- This document provides for the transmission of BLOAT datagrams over
- two common families of physical layer transport. Future RFCs will
- address additional transports as routing vendors catch up to the
- specification, and we begin to see BLOAT routed across the Internet
- backbone.
-
-5.1. Ethernet
-
- BLOAT is encapsulated in Ethernet datagrams as in [RFC894] with the
- exception that the type field of the Ethernet frame MUST contain the
- value 0xBEEF. The first 5 octets of the Ethernet frame payload will
- be 0x3c 3f 78 6d 6c ("<?xml".)
-
-5.2. IEEE 802
-
- BLOAT is encapsulated in IEEE 802 Networks as in [RFC1042] except
- that the protocol type code for IPoXML is 0xBEEF.
-
-
-
-
-
-Kennedy Informational [Page 6]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
-6. Gatewaying over IP
-
- In order to facilitate the gradual introduction of BLOAT into the
- public Internet, BLOAT MAY be encapsulated in IP as in [RFC2003] to
- gateway between networks that run BLOAT natively on their LANs.
-
-7. DTDs
-
- The Transport DTDs (7.2. and 7.3.) build on the definitions in the
- Network DTD (7.1.)
-
- The DTDs are referenced by their PubidLiteral and SystemLiteral (from
- [XML]) although it is understood that most IPoXML implementations
- will not need to pull down the DTD, as it will normally be embedded
- in the implementation, and presents something of a catch-22 if you
- need to load part of your network protocol over the network.
-
-7.1. IPoXML DTD
-
- <!--
- DTD for IP over XML.
- Refer to this DTD as:
-
- <!DOCTYPE ip PUBLIC "-//IETF//DTD BLOAT 1.0 IP//EN" "bloat.dtd">
- -->
- <!--
- DTD data types:
-
- Digits [0..9]+
-
- Precedence "NetworkControl | InternetworkControl |
- CRITIC | FlashOverride | Flash | Immediate |
- Priority | Routine"
-
- IP4Addr "dotted-decimal" notation of [RFC1123]
-
- Class [0..3]
-
- Sec "Unclassified | Confidential | EFTO | MMMM | PROG |
- Restricted | Secret | Top Secret | Reserved"
-
- Compartments [0..65535]
-
- Handling [0..65535]
-
- TCC [0..16777216]
-
- -->
-
-
-
-Kennedy Informational [Page 7]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- <!ENTITY % Digits "CDATA">
- <!ENTITY % Precedence "CDATA">
- <!ENTITY % IP4Addr "CDATA">
- <!ENTITY % Class "CDATA">
- <!ENTITY % Sec "CDATA">
- <!ENTITY % Compartments "CDATA">
- <!ENTITY % Handling "CDATA">
- <!ENTITY % TCC "CDATA">
-
- <!ELEMENT ip (header, payload)>
-
- <!ELEMENT header (version, tos, total.length, id, flags, offset, ttl,
- protocol, checksum, source, destination, options,
- padding)>
- <!-- length of header in 32-bit words -->
- <!ATTLIST header
- length %Digits; #REQUIRED>
-
- <!ELEMENT version EMPTY>
- <!-- ip version. SHOULD be "4" -->
- <!ATTLIST version
- value %Digits; #REQUIRED>
-
- <!ELEMENT tos EMPTY>
- <!ATTLIST tos
- precedence %Precedence; #REQUIRED
- delay (normal | low) #REQUIRED
- throughput (normal | high) #REQUIRED
- relibility (normal | high) #REQUIRED
- reserved CDATA #FIXED "0">
-
- <!ELEMENT total.length EMPTY>
- <!--
- total length of datagram (header and payload) in octets, MUST be
- less than 65,535 (and SHOULD be less than 1024 for IPoXML on local
- ethernets).
- -->
- <!ATTLIST total.length
- value %Digits; #REQUIRED>
-
- <!ELEMENT id EMPTY>
- <!-- 0 <= id <= 65,535 -->
- <!ATTLIST id
- value %Digits; #REQUIRED>
-
- <!ELEMENT flags EMPTY>
- <!-- df = don't fragment, mf = more fragments -->
- <!ATTLIST flags
-
-
-
-Kennedy Informational [Page 8]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- reserved CDATA #FIXED "0"
- df (may|dont) #REQUIRED
- mf (last|more) #REQUIRED>
-
- <!ELEMENT offset EMPTY>
- <!-- 0 <= offset <= 8192 measured in 8 octet (64-bit) chunks -->
- <!ATTLIST offset
- value %Digits; #REQUIRED>
-
- <!ELEMENT ttl EMPTY>
- <!-- 0 <= ttl <= 255 -->
- <!ATTLIST ttl
- value %Digits; #REQUIRED>
-
- <!ELEMENT protocol EMPTY>
- <!-- 0 <= protocol <= 255 (per IANA) -->
- <!ATTLIST protocol
- value %Digits; #REQUIRED>
-
- <!ELEMENT checksum EMPTY>
- <!-- 0 <= checksum <= 65535 (over header only) -->
- <!ATTLIST checksum
- value %Digits; #REQUIRED>
-
- <!ELEMENT source EMPTY>
- <!ATTLIST source
- address %IP4Addr; #REQUIRED>
-
- <!ELEMENT destination EMPTY>
- <!ATTLIST destination
- address %IP4Addr; #REQUIRED>
-
- <!ELEMENT options ( end | noop | security | loose | strict | record
- | stream | timestamp )*>
-
- <!ELEMENT end EMPTY>
- <!ATTLIST end
- copied (0|1) #REQUIRED
- class CDATA #FIXED "0"
- number CDATA #FIXED "0">
-
- <!ELEMENT noop EMPTY>
- <!ATTLIST noop
- copied (0|1) #REQUIRED
- class CDATA #FIXED "0"
- number CDATA #FIXED "1">
-
- <!ELEMENT security EMPTY>
-
-
-
-Kennedy Informational [Page 9]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- <!ATTLIST security
- copied CDATA #FIXED "1"
- class CDATA #FIXED "0"
- number CDATA #FIXED "2"
- length CDATA #FIXED "11"
- security %Sec; #REQUIRED
- compartments %Compartments; #REQUIRED
- handling %Handling; #REQUIRED
- tcc %TCC; #REQUIRED>
- <!ELEMENT loose (hop)+>
- <!ATTLIST loose
- copied CDATA #FIXED "1"
- class CDATA #FIXED "0"
- number CDATA #FIXED "3"
- length %Digits; #REQUIRED
- pointer %Digits; #REQUIRED>
-
- <!ELEMENT hop EMPTY>
- <!ATTLIST hop
- address %IP4Addr; #REQUIRED>
-
- <!ELEMENT strict (hop)+>
- <!ATTLIST strict
- copied CDATA #FIXED "1"
- class CDATA #FIXED "0"
- number CDATA #FIXED "9"
- length %Digits; #REQUIRED
- pointer %Digits; #REQUIRED>
-
- <!ELEMENT record (hop)+>
- <!ATTLIST record
- copied CDATA #FIXED "0"
- class CDATA #FIXED "0"
- number CDATA #FIXED "7"
- length %Digits; #REQUIRED
- pointer %Digits; #REQUIRED>
-
- <!ELEMENT stream EMPTY>
- <!-- 0 <= id <= 65,535 -->
- <!ATTLIST stream
- copied CDATA #FIXED "1"
- class CDATA #FIXED "0"
- number CDATA #FIXED "8"
- length CDATA #FIXED "4"
- id %Digits; #REQUIRED>
-
- <!ELEMENT timestamp (tstamp)+>
- <!-- 0 <= oflw <=15 -->
-
-
-
-Kennedy Informational [Page 10]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- <!ATTLIST timestamp
- copied CDATA #FIXED "0"
- class CDATA #FIXED "2"
- number CDATA #FIXED "4"
- length %Digits; #REQUIRED
- pointer %Digits; #REQUIRED
- oflw %Digits; #REQUIRED
- flag (0 | 1 | 3) #REQUIRED>
-
- <!ELEMENT tstamp EMPTY>
- <!ATTLIST tstamp
- time %Digits; #REQUIRED
- address %IP4Addr; #IMPLIED>
- <!--
- padding to bring header to 32-bit boundary.
- pad MUST be "0"*
- -->
- <!ELEMENT padding EMPTY>
- <!ATTLIST padding
- pad CDATA #REQUIRED>
-
- <!-- payload MUST be encoded as base-64 [RFC2045], as modified
- by section 2.1 of this RFC -->
- <!ELEMENT payload (CDATA)>
-
-7.2. TCPoXML DTD
-
- <!--
- DTD for TCP over XML.
- Refer to this DTD as:
-
- <!DOCTYPE tcp PUBLIC "-//IETF//DTD BLOAT 1.0 TCP//EN" "bloat.dtd">
- -->
-
- <!-- the pseudoheader is only included for checksum calculations -->
- <!ELEMENT tcp (tcp.pseudoheader?, tcp.header, payload)>
-
- <!ELEMENT tcp.header (src, dest, sequence, acknowledgement, offset,
- reserved, control, window, checksum, urgent,
- tcp.options, padding)>
-
- <!ELEMENT src EMPTY>
- <!-- 0 <= port <= 65,535 -->
- <!ATTLIST src
- port %Digits; #REQUIRED>
-
- <!ELEMENT dest EMPTY>
- <!-- 0 <= port <= 65,535 -->
-
-
-
-Kennedy Informational [Page 11]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- <!ATTLIST dest
- port %Digits; #REQUIRED>
-
- <!ELEMENT sequence EMPTY>
- <!-- 0 <= number <= 4294967295 -->
- <!ATTLIST sequence
- number %Digits; #REQUIRED>
-
- <!ELEMENT acknowledgement EMPTY>
- <!-- 0 <= number <= 4294967295 -->
- <!ATTLIST acknowledgement
- number %Digits; #REQUIRED>
-
- <!ELEMENT offset EMPTY>
- <!-- 0 <= number <= 255 -->
- <!ATTLIST offset
- number %Digits; #REQUIRED>
-
- <!ELEMENT reserved EMPTY>
- <!ATTLIST reserved
- value CDATA #FIXED "0">
-
- <!ELEMENT control EMPTY>
- <!ATTLIST control
- urg (0|1) #IMPLIED
- ack (0|1) #IMPLIED
- psh (0|1) #IMPLIED
- rst (0|1) #IMPLIED
- syn (0|1) #IMPLIED
- fin (0|1) #IMPLIED>
-
- <!ELEMENT window EMPTY>
- <!-- 0 <= size <= 65,535 -->
- <!ATTLIST window
- size %Digits; #REQUIRED>
-
- <!--
- checksum as in ip, but with
- the following pseudo-header added into the tcp element:
- -->
- <!ELEMENT tcp.pseudoheader (source, destination, protocol,
- tcp.length)>
-
- <!--
- tcp header + data length in octets. does not include the size of
-
- the pseudoheader.
- -->
-
-
-
-Kennedy Informational [Page 12]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- <!ELEMENT tcp.length EMPTY>
- <!ATTLIST tcp.length
- value %Digits; #REQUIRED>
-
- <!ELEMENT urgent EMPTY>
- <!-- 0 <= pointer <= 65,535 -->
- <!ATTLIST urgent
- pointer %Digits; #REQUIRED>
-
- <!ELEMENT tcp.options (tcp.end | tcp.noop | tcp.mss)+>
-
- <!ELEMENT tcp.end EMPTY>
- <!ATTLIST tcp.end
- kind CDATA #FIXED "0">
-
- <!ELEMENT tcp.noop EMPTY>
- <!ATTLIST tcp.noop
- kind CDATA #FIXED "1">
-
- <!ELEMENT tcp.mss EMPTY>
- <!ATTLIST tcp.mss
- kind CDATA #FIXED "2"
- length CDATA #FIXED "4"
- size %Digits; #REQUIRED>
-
-7.3. UDPoXML DTD
-
- <!--
- DTD for UDP over XML.
- Refer to this DTD as:
-
- <!DOCTYPE udp PUBLIC "-//IETF//DTD BLOAT 1.0 UDP//EN" "bloat.dtd">
- -->
-
- <!ELEMENT udp (udp.pseudoheader?, udp.header, payload)>
-
- <!ELEMENT udp.header (src, dest, udp.length, checksum)>
-
- <!ELEMENT udp.pseudoheader (source, destination, protocol,
- udp.length)>
-
- <!--
- udp header + data length in octets. does not include the size of
- the pseudoheader.
- -->
- <!ELEMENT udp.length EMPTY>
- <!ATTLIST udp.length
- value %Digits; #REQUIRED>
-
-
-
-Kennedy Informational [Page 13]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
-8. Security Considerations
-
- XML, as a subset of SGML, has the same security considerations as
- specified in SGML Media Types [RFC1874]. Security considerations
- that apply to IP, TCP and UDP also likely apply to BLOAT as it does
- not attempt to correct for issues not related to message format.
-
-9. References
-
- [JABBER] Miller, J., "Jabber", draft-miller-jabber-00.txt,
- February 2002. (Work in Progress)
-
- [RFC768] Postel, J., "User Datagram Protocol", STD 6, RFC 768,
- August 1980.
-
- [RFC791] Postel, J., "Internet Protocol", STD 5, RFC 791,
- September 1981.
-
- [RFC793] Postel, J., "Transmission Control Protocol", STD 7, RFC
- 793, September 1981.
-
- [RFC894] Hornig, C., "Standard for the Transmission of IP
- Datagrams over Ethernet Networks.", RFC 894, April 1984.
-
- [RFC1042] Postel, J. and J. Reynolds, "Standard for the
- Transmission of IP Datagrams Over IEEE 802 Networks", STD
- 43, RFC 1042, February 1988.
-
- [RFC1123] Braden, R., "Requirements for Internet Hosts -
- Application and Support", RFC 1123, October 1989.
-
- [RFC1874] Levinson, E., "SGML Media Types", RFC 1874, December
- 1995.
-
- [RFC2003] Perkins, C., "IP Encapsulation within IP", RFC 2003,
- October 1996.
-
- [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
- Extensions (MIME) Part One: Format of Internet Message
- Bodies", RFC 2045, November 1996.
-
- [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
- Requirement Levels", BCP 14, RFC 2119, March 1997.
-
- [RFC2279] Yergeau, F., "UTF-8, a transformation format of ISO
- 10646", RFC 2279, January 1998.
-
-
-
-
-
-Kennedy Informational [Page 14]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6
- (IPv6) Specification", RFC 2460, December 1998.
-
- [RFC3080] Rose, M., "The Blocks Extensible Exchange Protocol Core",
- RFC 3080, March 2001.
-
- [SOAP] Box, D., Ehnebuske, D., Kakivaya, G., Layman, A.,
- Mendelsohn, N., Nielsen, H. F., Thatte, S. Winer, D.,
- "Simple Object Access Protocol (SOAP) 1.1" World Wide Web
- Consortium Note, May 2000 http://www.w3.org/TR/SOAP/
-
- [XML] Bray, T., Paoli, J., Sperberg-McQueen, C. M., "Extensible
- Markup Language (XML)" World Wide Web Consortium
- Recommendation REC- xml-19980210.
- http://www.w3.org/TR/1998/REC-xml-19980210
-
-10. Author's Address
-
- Hugh Kennedy
- Mimezine
- 1060 West Addison
- Chicago, IL 60613
- USA
-
- EMail: kennedyh@engin.umich.edu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Kennedy Informational [Page 15]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
-11. Full Copyright Statement
-
- Copyright (C) The Internet Society (2002). All Rights Reserved.
-
- This document and translations of it may be copied and furnished to
- others, and derivative works that comment on or otherwise explain it
- or assist in its implementation may be prepared, copied, published
- and distributed, in whole or in part, without restriction of any
- kind, provided that the above copyright notice and this paragraph are
- included on all such copies and derivative works. However, this
- document itself may not be modified in any way, such as by removing
- the copyright notice or references to the Internet Society or other
- Internet organizations, except as needed for the purpose of
- developing Internet standards in which case the procedures for
- copyrights defined in the Internet Standards process must be
- followed, or as required to translate it into languages other than
- English.
-
- The limited permissions granted above are perpetual and will not be
- revoked by the Internet Society or its successors or assigns.
-
- This document and the information contained herein is provided on an
- "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
- TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
- BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
- HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-
-Acknowledgement
-
- Funding for the RFC Editor function is currently provided by the
- Internet Society.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Kennedy Informational [Page 16]
-
diff --git a/tests/auto/network/access/qhttp/trolltech b/tests/auto/network/access/qhttp/trolltech
deleted file mode 100644
index c155360e8d..0000000000
--- a/tests/auto/network/access/qhttp/trolltech
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
- <head>
- <title>Test</title>
- </head>
- <body>
- <h1>Test</h1>
- </body>
-</html>
diff --git a/tests/auto/network/access/qhttp/tst_qhttp.cpp b/tests/auto/network/access/qhttp/tst_qhttp.cpp
deleted file mode 100644
index f6514bade1..0000000000
--- a/tests/auto/network/access/qhttp/tst_qhttp.cpp
+++ /dev/null
@@ -1,1565 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#include <QtTest/QtTest>
-
-#include <qbuffer.h>
-#include <qcoreapplication.h>
-#include <qfile.h>
-#include <qhostinfo.h>
-#include <qhttp.h>
-#include <qlist.h>
-#include <qpointer.h>
-#include <qtcpsocket.h>
-#include <qtcpserver.h>
-#include <qauthenticator.h>
-#include <QNetworkProxy>
-#ifndef QT_NO_OPENSSL
-# include <qsslsocket.h>
-#endif
-
-#include "../../../network-settings.h"
-
-Q_DECLARE_METATYPE(QHttpResponseHeader)
-
-class tst_QHttp : public QObject
-{
- Q_OBJECT
-
-public:
- tst_QHttp();
- virtual ~tst_QHttp();
-
-
-public slots:
- void initTestCase_data();
- void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
-private slots:
- void constructing();
- void invalidRequests();
- void get_data();
- void get();
- void head_data();
- void head();
- void post_data();
- void post();
- void request_data();
- void request();
- void authorization_data();
- void authorization();
- void proxy_data();
- void proxy();
- void proxy2();
- void proxy3();
- void postAuthNtlm();
-#ifndef QT_NO_OPENSSL
- void proxyAndSsl();
- void cachingProxyAndSsl();
-#endif
- void reconnect();
- void setSocket();
- void unexpectedRemoteClose();
- void pctEncodedPath();
- void caseInsensitiveKeys();
- void emptyBodyInReply();
- void abortInReadyRead();
- void abortInResponseHeaderReceived();
- void nestedEventLoop();
- void connectionClose();
-
-protected slots:
- void stateChanged( int );
- void responseHeaderReceived( const QHttpResponseHeader & );
- void readyRead( const QHttpResponseHeader& );
- void dataSendProgress( int, int );
- void dataReadProgress( int , int );
-
- void requestStarted( int );
- void requestFinished( int, bool );
- void done( bool );
-
- void reconnect_state(int state);
- void proxy2_slot();
- void nestedEventLoop_slot(int id);
-
- void abortSender();
- void proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *auth);
-
-private:
- QHttp *newHttp(bool withAuth = false);
- void addRequest( QHttpRequestHeader, int );
- bool headerAreEqual( const QHttpHeader&, const QHttpHeader& );
-
- QHttp *http;
-
- struct RequestResult
- {
- QHttpRequestHeader req;
- QHttpResponseHeader resp;
- int success;
- };
- QMap< int, RequestResult > resultMap;
- typedef QMap<int,RequestResult>::Iterator ResMapIt;
- QList<int> ids; // helper to make sure that all expected signals are emitted
-
- int current_id;
- int cur_state;
- int done_success;
-
- QByteArray readyRead_ba;
-
- int bytesTotalSend;
- int bytesDoneSend;
- int bytesTotalRead;
- int bytesDoneRead;
-
- int getId;
- int headId;
- int postId;
-
- int reconnect_state_connect_count;
-
- bool connectionWithAuth;
- bool proxyAuthCalled;
-};
-
-class ClosingServer: public QTcpServer
-{
- Q_OBJECT
-public:
- ClosingServer()
- {
- connect(this, SIGNAL(newConnection()), SLOT(handleConnection()));
- listen();
- }
-
-public slots:
- void handleConnection()
- {
- delete nextPendingConnection();
- }
-};
-
-//#define DUMP_SIGNALS
-
-const int bytesTotal_init = -10;
-const int bytesDone_init = -10;
-
-tst_QHttp::tst_QHttp()
-{
-}
-
-tst_QHttp::~tst_QHttp()
-{
-}
-
-void tst_QHttp::initTestCase_data()
-{
- QTest::addColumn<bool>("setProxy");
- QTest::addColumn<int>("proxyType");
-
- QTest::newRow("WithoutProxy") << false << 0;
- QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy);
-}
-
-void tst_QHttp::initTestCase()
-{
- QVERIFY(QtNetworkSettings::verifyTestNetworkSettings());
-}
-
-void tst_QHttp::cleanupTestCase()
-{
-}
-
-void tst_QHttp::init()
-{
- QFETCH_GLOBAL(bool, setProxy);
- if (setProxy) {
- QFETCH_GLOBAL(int, proxyType);
- if (proxyType == QNetworkProxy::Socks5Proxy) {
- QNetworkProxy::setApplicationProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, QtNetworkSettings::serverName(), 1080));
- }
- }
-
- http = 0;
-
- resultMap.clear();
- ids.clear();
-
- current_id = 0;
- cur_state = QHttp::Unconnected;
- done_success = -1;
-
- readyRead_ba = QByteArray();
-
- getId = -1;
- headId = -1;
- postId = -1;
-}
-
-void tst_QHttp::cleanup()
-{
- delete http;
- http = 0;
-
- QCoreApplication::processEvents();
-
- QFETCH_GLOBAL(bool, setProxy);
- if (setProxy) {
- QNetworkProxy::setApplicationProxy(QNetworkProxy::DefaultProxy);
- }
-}
-
-void tst_QHttp::constructing()
-{
- //QHeader
- {
- QHttpRequestHeader header;
- header.addValue("key1", "val1");
- header.addValue("key2", "val2");
- header.addValue("key1", "val3");
- QCOMPARE(header.values().size(), 3);
- QCOMPARE(header.allValues("key1").size(), 2);
- QVERIFY(header.hasKey("key2"));
- QCOMPARE(header.keys().count(), 2);
-
- }
-
- {
- QHttpResponseHeader header(200);
- }
-}
-
-void tst_QHttp::invalidRequests()
-{
- QHttp http;
- http.setHost("localhost"); // we will not actually connect
-
- QTest::ignoreMessage(QtWarningMsg, "QHttp: empty path requested is invalid -- using '/'");
- http.get(QString());
-
- QTest::ignoreMessage(QtWarningMsg, "QHttp: empty path requested is invalid -- using '/'");
- http.head(QString());
-
- QTest::ignoreMessage(QtWarningMsg, "QHttp: empty path requested is invalid -- using '/'");
- http.post(QString(), QByteArray());
-
- QTest::ignoreMessage(QtWarningMsg, "QHttp: empty path requested is invalid -- using '/'");
- http.request(QHttpRequestHeader("PROPFIND", QString()));
-}
-
-void tst_QHttp::get_data()
-{
- QTest::addColumn<QString>("host");
- QTest::addColumn<uint>("port");
- QTest::addColumn<QString>("path");
- QTest::addColumn<int>("success");
- QTest::addColumn<int>("statusCode");
- QTest::addColumn<QByteArray>("res");
- QTest::addColumn<bool>("useIODevice");
-
- // ### move this into external testdata
- QFile file( SRCDIR "rfc3252.txt" );
- QVERIFY( file.open( QIODevice::ReadOnly ) );
- QByteArray rfc3252 = file.readAll();
- file.close();
-
- file.setFileName( SRCDIR "trolltech" );
- QVERIFY( file.open( QIODevice::ReadOnly ) );
- QByteArray trolltech = file.readAll();
- file.close();
-
- // test the two get() modes in one routine
- for ( int i=0; i<2; i++ ) {
- QTest::newRow(QString("path_01_%1").arg(i).toLatin1()) << QtNetworkSettings::serverName() << 80u
- << QString("/qtest/rfc3252.txt") << 1 << 200 << rfc3252 << (bool)(i==1);
- QTest::newRow( QString("path_02_%1").arg(i).toLatin1() ) << QString("www.ietf.org") << 80u
- << QString("/rfc/rfc3252.txt") << 1 << 200 << rfc3252 << (bool)(i==1);
-
- QTest::newRow( QString("uri_01_%1").arg(i).toLatin1() ) << QtNetworkSettings::serverName() << 80u
- << QString("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt") << 1 << 200 << rfc3252 << (bool)(i==1);
- QTest::newRow( QString("uri_02_%1").arg(i).toLatin1() ) << "www.ietf.org" << 80u
- << QString("http://www.ietf.org/rfc/rfc3252.txt") << 1 << 200 << rfc3252 << (bool)(i==1);
-
- QTest::newRow( QString("fail_01_%1").arg(i).toLatin1() ) << QString("this-host-will-not-exist.") << 80u
- << QString("/qtest/rfc3252.txt") << 0 << 0 << QByteArray() << (bool)(i==1);
-
- QTest::newRow( QString("failprot_01_%1").arg(i).toLatin1() ) << QtNetworkSettings::serverName() << 80u
- << QString("/t") << 1 << 404 << QByteArray() << (bool)(i==1);
- QTest::newRow( QString("failprot_02_%1").arg(i).toLatin1() ) << QtNetworkSettings::serverName() << 80u
- << QString("qtest/rfc3252.txt") << 1 << 400 << QByteArray() << (bool)(i==1);
-
- // qt.nokia.com/doc uses transfer-encoding=chunked
- /* qt.nokia.com/doc no longer seams to be using chuncked encodig.
- QTest::newRow( QString("chunked_01_%1").arg(i).toLatin1() ) << QString("test.troll.no") << 80u
- << QString("/") << 1 << 200 << trolltech << (bool)(i==1);
- */
- QTest::newRow( QString("chunked_02_%1").arg(i).toLatin1() ) << QtNetworkSettings::serverName() << 80u
- << QString("/qtest/cgi-bin/rfc.cgi") << 1 << 200 << rfc3252 << (bool)(i==1);
- }
-}
-
-void tst_QHttp::get()
-{
- // for the overload that takes a QIODevice
- QByteArray buf_ba;
- QBuffer buf( &buf_ba );
-
- QFETCH( QString, host );
- QFETCH( uint, port );
- QFETCH( QString, path );
- QFETCH( bool, useIODevice );
-
- http = newHttp();
- QCOMPARE( http->currentId(), 0 );
- QCOMPARE( (int)http->state(), (int)QHttp::Unconnected );
-
- addRequest( QHttpRequestHeader(), http->setHost( host, port ) );
- if ( useIODevice ) {
- buf.open( QIODevice::WriteOnly );
- getId = http->get( path, &buf );
- } else {
- getId = http->get( path );
- }
- addRequest( QHttpRequestHeader(), getId );
-
- QTestEventLoop::instance().enterLoop( 50 );
-
- if ( QTestEventLoop::instance().timeout() )
- QFAIL( "Network operation timed out" );
-
- ResMapIt res = resultMap.find( getId );
- QVERIFY( res != resultMap.end() );
- if ( res.value().success!=1 && host=="www.ietf.org" ) {
- // The nightly tests fail from time to time. In order to make them more
- // stable, add some debug output that might help locate the problem (I
- // can't reproduce the problem in the non-nightly builds).
- qDebug( "Error %d: %s", http->error(), http->errorString().toLatin1().constData() );
- }
- QTEST( res.value().success, "success" );
- if ( res.value().success ) {
- QTEST( res.value().resp.statusCode(), "statusCode" );
-
- QFETCH( QByteArray, res );
- if ( res.count() > 0 ) {
- if ( useIODevice ) {
- QCOMPARE(buf_ba, res);
- if ( bytesDoneRead != bytesDone_init )
- QVERIFY( (int)buf_ba.size() == bytesDoneRead );
- } else {
- QCOMPARE(readyRead_ba, res);
- if ( bytesDoneRead != bytesDone_init )
- QVERIFY( (int)readyRead_ba.size() == bytesDoneRead );
- }
- }
- QVERIFY( bytesTotalRead != bytesTotal_init );
- if ( bytesTotalRead > 0 )
- QVERIFY( bytesDoneRead == bytesTotalRead );
- } else {
- QVERIFY( !res.value().resp.isValid() );
- }
-}
-
-void tst_QHttp::head_data()
-{
- QTest::addColumn<QString>("host");
- QTest::addColumn<uint>("port");
- QTest::addColumn<QString>("path");
- QTest::addColumn<int>("success");
- QTest::addColumn<int>("statusCode");
- QTest::addColumn<uint>("contentLength");
-
- QTest::newRow( "path_01" ) << QtNetworkSettings::serverName() << 80u
- << QString("/qtest/rfc3252.txt") << 1 << 200 << 25962u;
-
- QTest::newRow( "path_02" ) << QString("www.ietf.org") << 80u
- << QString("/rfc/rfc3252.txt") << 1 << 200 << 25962u;
-
- QTest::newRow( "uri_01" ) << QtNetworkSettings::serverName() << 80u
- << QString("http://" + QtNetworkSettings::serverName() + "/qtest/rfc3252.txt") << 1 << 200 << 25962u;
-
- QTest::newRow( "uri_02" ) << QString("www.ietf.org") << 80u
- << QString("http://www.ietf.org/rfc/rfc3252.txt") << 1 << 200 << 25962u;
-
- QTest::newRow( "fail_01" ) << QString("this-host-will-not-exist.") << 80u
- << QString("/qtest/rfc3252.txt") << 0 << 0 << 0u;
-
- QTest::newRow( "failprot_01" ) << QtNetworkSettings::serverName() << 80u
- << QString("/t") << 1 << 404 << 0u;
-
- QTest::newRow( "failprot_02" ) << QtNetworkSettings::serverName() << 80u
- << QString("qtest/rfc3252.txt") << 1 << 400 << 0u;
-
- /* qt.nokia.com/doc no longer seams to be using chuncked encodig.
- QTest::newRow( "chunked_01" ) << QString("qt.nokia.com/doc") << 80u
- << QString("/index.html") << 1 << 200 << 0u;
- */
- QTest::newRow( "chunked_02" ) << QtNetworkSettings::serverName() << 80u
- << QString("/qtest/cgi-bin/rfc.cgi") << 1 << 200 << 0u;
-}
-
-void tst_QHttp::head()
-{
- QFETCH( QString, host );
- QFETCH( uint, port );
- QFETCH( QString, path );
-
- http = newHttp();
- QCOMPARE( http->currentId(), 0 );
- QCOMPARE( (int)http->state(), (int)QHttp::Unconnected );
-
- addRequest( QHttpRequestHeader(), http->setHost( host, port ) );
- headId = http->head( path );
- addRequest( QHttpRequestHeader(), headId );
-
- QTestEventLoop::instance().enterLoop( 30 );
- if ( QTestEventLoop::instance().timeout() )
- QFAIL( "Network operation timed out" );
-
- ResMapIt res = resultMap.find( headId );
- QVERIFY( res != resultMap.end() );
- if ( res.value().success!=1 && host=="www.ietf.org" ) {
- // The nightly tests fail from time to time. In order to make them more
- // stable, add some debug output that might help locate the problem (I
- // can't reproduce the problem in the non-nightly builds).
- qDebug( "Error %d: %s", http->error(), http->errorString().toLatin1().constData() );
- }
- QTEST( res.value().success, "success" );
- if ( res.value().success ) {
- QTEST( res.value().resp.statusCode(), "statusCode" );
- QTEST( res.value().resp.contentLength(), "contentLength" );
-
- QCOMPARE( (uint)readyRead_ba.size(), 0u );
- QVERIFY( bytesTotalRead == bytesTotal_init );
- QVERIFY( bytesDoneRead == bytesDone_init );
- } else {
- QVERIFY( !res.value().resp.isValid() );
- }
-}
-
-void tst_QHttp::post_data()
-{
- QTest::addColumn<QString>("source");
- QTest::addColumn<bool>("useIODevice");
- QTest::addColumn<bool>("useProxy");
- QTest::addColumn<QString>("host");
- QTest::addColumn<int>("port");
- QTest::addColumn<bool>("ssl");
- QTest::addColumn<QString>("path");
- QTest::addColumn<QByteArray>("result");
-
- QByteArray md5sum;
- md5sum = "d41d8cd98f00b204e9800998ecf8427e";
- QTest::newRow("empty-data")
- << QString() << false << false
- << QtNetworkSettings::serverName() << 80 << false << "/qtest/cgi-bin/md5sum.cgi" << md5sum;
- QTest::newRow("empty-device")
- << QString() << true << false
- << QtNetworkSettings::serverName() << 80 << false << "/qtest/cgi-bin/md5sum.cgi" << md5sum;
- QTest::newRow("proxy-empty-data")
- << QString() << false << true
- << QtNetworkSettings::serverName() << 80 << false << "/qtest/cgi-bin/md5sum.cgi" << md5sum;
-
- md5sum = "b3e32ac459b99d3f59318f3ac31e4bee";
- QTest::newRow("data") << "rfc3252.txt" << false << false
- << QtNetworkSettings::serverName() << 80 << false << "/qtest/cgi-bin/md5sum.cgi"
- << md5sum;
- QTest::newRow("device") << "rfc3252.txt" << true << false
- << QtNetworkSettings::serverName() << 80 << false << "/qtest/cgi-bin/md5sum.cgi"
- << md5sum;
- QTest::newRow("proxy-data") << "rfc3252.txt" << false << true
- << QtNetworkSettings::serverName() << 80 << false << "/qtest/cgi-bin/md5sum.cgi"
- << md5sum;
-
-#ifndef QT_NO_OPENSSL
- md5sum = "d41d8cd98f00b204e9800998ecf8427e";
- QTest::newRow("empty-data-ssl")
- << QString() << false << false
- << QtNetworkSettings::serverName() << 443 << true << "/qtest/cgi-bin/md5sum.cgi" << md5sum;
- QTest::newRow("empty-device-ssl")
- << QString() << true << false
- << QtNetworkSettings::serverName() << 443 << true << "/qtest/cgi-bin/md5sum.cgi" << md5sum;
- QTest::newRow("proxy-empty-data-ssl")
- << QString() << false << true
- << QtNetworkSettings::serverName() << 443 << true << "/qtest/cgi-bin/md5sum.cgi" << md5sum;
- md5sum = "b3e32ac459b99d3f59318f3ac31e4bee";
- QTest::newRow("data-ssl") << "rfc3252.txt" << false << false
- << QtNetworkSettings::serverName() << 443 << true << "/qtest/cgi-bin/md5sum.cgi"
- << md5sum;
- QTest::newRow("device-ssl") << "rfc3252.txt" << true << false
- << QtNetworkSettings::serverName() << 443 << true << "/qtest/cgi-bin/md5sum.cgi"
- << md5sum;
- QTest::newRow("proxy-data-ssl") << "rfc3252.txt" << false << true
- << QtNetworkSettings::serverName() << 443 << true << "/qtest/cgi-bin/md5sum.cgi"
- << md5sum;
-#endif
-
- // the following test won't work. See task 185996
-/*
- QTest::newRow("proxy-device") << "rfc3252.txt" << true << true
- << QtNetworkSettings::serverName() << 80 << "/qtest/cgi-bin/md5sum.cgi"
- << md5sum;
-*/
-}
-
-void tst_QHttp::post()
-{
- QFETCH(QString, source);
- QFETCH(bool, useIODevice);
- QFETCH(bool, useProxy);
- QFETCH(QString, host);
- QFETCH(int, port);
- QFETCH(bool, ssl);
- QFETCH(QString, path);
-
- http = newHttp(useProxy);
-#ifndef QT_NO_OPENSSL
- QObject::connect(http, SIGNAL(sslErrors(const QList<QSslError> &)),
- http, SLOT(ignoreSslErrors()));
-#endif
- QCOMPARE(http->currentId(), 0);
- QCOMPARE((int)http->state(), (int)QHttp::Unconnected);
- if (useProxy)
- addRequest(QHttpRequestHeader(), http->setProxy(QtNetworkSettings::serverName(), 3129));
- addRequest(QHttpRequestHeader(), http->setHost(host, (ssl ? QHttp::ConnectionModeHttps : QHttp::ConnectionModeHttp), port));
-
- // add the POST request
- QFile file(SRCDIR + source);
- QBuffer emptyBuffer;
- QIODevice *dev;
- if (!source.isEmpty()) {
- QVERIFY(file.open(QIODevice::ReadOnly));
- dev = &file;
- } else {
- emptyBuffer.open(QIODevice::ReadOnly);
- dev = &emptyBuffer;
- }
-
- if (useIODevice)
- postId = http->post(path, dev);
- else
- postId = http->post(path, dev->readAll());
- addRequest(QHttpRequestHeader(), postId);
-
- // run request
- connect(http, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
- SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
- QTestEventLoop::instance().enterLoop( 30 );
-
- if ( QTestEventLoop::instance().timeout() )
- QFAIL( "Network operation timed out" );
-
- ResMapIt res = resultMap.find(postId);
- QVERIFY(res != resultMap.end());
- QVERIFY(res.value().success);
- QCOMPARE(res.value().resp.statusCode(), 200);
- QTEST(readyRead_ba.trimmed(), "result");
-}
-
-void tst_QHttp::request_data()
-{
- QTest::addColumn<QString>("source");
- QTest::addColumn<bool>("useIODevice");
- QTest::addColumn<bool>("useProxy");
- QTest::addColumn<QString>("host");
- QTest::addColumn<int>("port");
- QTest::addColumn<QString>("method");
- QTest::addColumn<QString>("path");
- QTest::addColumn<QByteArray>("result");
-
- QFile source(SRCDIR "rfc3252.txt");
- if (!source.open(QIODevice::ReadOnly))
- return;
-
- QByteArray contents = source.readAll();
- QByteArray md5sum = QCryptographicHash::hash(contents, QCryptographicHash::Md5).toHex() + '\n';
- QByteArray emptyMd5sum = "d41d8cd98f00b204e9800998ecf8427e\n";
-
- QTest::newRow("head") << QString() << false << false << QtNetworkSettings::serverName() << 80
- << "HEAD" << "/qtest/rfc3252.txt"
- << QByteArray();
- QTest::newRow("get") << QString() << false << false << QtNetworkSettings::serverName() << 80
- << "GET" << "/qtest/rfc3252.txt"
- << contents;
- QTest::newRow("post-empty-data") << QString() << false << false
- << QtNetworkSettings::serverName() << 80 << "POST" << "/qtest/cgi-bin/md5sum.cgi"
- << emptyMd5sum;
- QTest::newRow("post-empty-device") << QString() << true << false
- << QtNetworkSettings::serverName() << 80 << "POST" << "/qtest/cgi-bin/md5sum.cgi"
- << emptyMd5sum;
- QTest::newRow("post-data") << "rfc3252.txt" << false << false
- << QtNetworkSettings::serverName() << 80 << "POST" << "/qtest/cgi-bin/md5sum.cgi"
- << md5sum;
- QTest::newRow("post-device") << "rfc3252.txt" << true << false
- << QtNetworkSettings::serverName() << 80 << "POST" << "/qtest/cgi-bin/md5sum.cgi"
- << md5sum;
-
- QTest::newRow("proxy-head") << QString() << false << true << QtNetworkSettings::serverName() << 80
- << "HEAD" << "/qtest/rfc3252.txt"
- << QByteArray();
- QTest::newRow("proxy-get") << QString() << false << true << QtNetworkSettings::serverName() << 80
- << "GET" << "/qtest/rfc3252.txt"
- << contents;
- QTest::newRow("proxy-post-empty-data") << QString() << false << true
- << QtNetworkSettings::serverName() << 80 << "POST" << "/qtest/cgi-bin/md5sum.cgi"
- << emptyMd5sum;
- QTest::newRow("proxy-post-data") << "rfc3252.txt" << false << true
- << QtNetworkSettings::serverName() << 80 << "POST" << "/qtest/cgi-bin/md5sum.cgi"
- << md5sum;
- // the following test won't work. See task 185996
-/*
- QTest::newRow("proxy-post-device") << "rfc3252.txt" << true << true
- << QtNetworkSettings::serverName() << 80 << "POST" << "/qtest/cgi-bin/md5sum.cgi"
- << md5sum;
-*/
-}
-
-void tst_QHttp::request()
-{
- QFETCH(QString, source);
- QFETCH(bool, useIODevice);
- QFETCH(bool, useProxy);
- QFETCH(QString, host);
- QFETCH(int, port);
- QFETCH(QString, method);
- QFETCH(QString, path);
-
- http = newHttp(useProxy);
- QCOMPARE(http->currentId(), 0);
- QCOMPARE((int)http->state(), (int)QHttp::Unconnected);
- if (useProxy)
- addRequest(QHttpRequestHeader(), http->setProxy(QtNetworkSettings::serverName(), 3129));
- addRequest(QHttpRequestHeader(), http->setHost(host, port));
-
- QFile file(SRCDIR + source);
- QBuffer emptyBuffer;
- QIODevice *dev;
- if (!source.isEmpty()) {
- QVERIFY(file.open(QIODevice::ReadOnly));
- dev = &file;
- } else {
- emptyBuffer.open(QIODevice::ReadOnly);
- dev = &emptyBuffer;
- }
-
- // prepare the request
- QHttpRequestHeader request;
- request.setRequest(method, path, 1,1);
- request.addValue("Host", host);
- int *theId;
-
- if (method == "POST")
- theId = &postId;
- else if (method == "GET")
- theId = &getId;
- else if (method == "HEAD")
- theId = &headId;
- else
- QFAIL("You're lazy! Please implement your test!");
-
- // now send the request
- if (useIODevice)
- *theId = http->request(request, dev);
- else
- *theId = http->request(request, dev->readAll());
- addRequest(QHttpRequestHeader(), *theId);
-
- // run request
- connect(http, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
- SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
- QTestEventLoop::instance().enterLoop( 30 );
-
- if ( QTestEventLoop::instance().timeout() )
- QFAIL( "Network operation timed out" );
-
- ResMapIt res = resultMap.find(*theId);
- QVERIFY(res != resultMap.end());
- QVERIFY(res.value().success);
- QCOMPARE(res.value().resp.statusCode(), 200);
- QTEST(readyRead_ba, "result");
-}
-
-void tst_QHttp::authorization_data()
-{
- QTest::addColumn<QString>("host");
- QTest::addColumn<QString>("path");
- QTest::addColumn<QString>("user");
- QTest::addColumn<QString>("pass");
- QTest::addColumn<int>("result");
-
- QTest::newRow("correct password") << QtNetworkSettings::serverName()
- << QString::fromLatin1("/qtest/rfcs-auth/index.html")
- << QString::fromLatin1("httptest")
- << QString::fromLatin1("httptest")
- << 200;
-
- QTest::newRow("no password") << QtNetworkSettings::serverName()
- << QString::fromLatin1("/qtest/rfcs-auth/index.html")
- << QString::fromLatin1("")
- << QString::fromLatin1("")
- << 401;
-
- QTest::newRow("wrong password") << QtNetworkSettings::serverName()
- << QString::fromLatin1("/qtest/rfcs-auth/index.html")
- << QString::fromLatin1("maliciu0s")
- << QString::fromLatin1("h4X0r")
- << 401;
-}
-
-void tst_QHttp::authorization()
-{
- QFETCH(QString, host);
- QFETCH(QString, path);
- QFETCH(QString, user);
- QFETCH(QString, pass);
- QFETCH(int, result);
-
- QEventLoop loop;
-
- QHttp http;
- connect(&http, SIGNAL(done(bool)), &loop, SLOT(quit()));
-
- if (!user.isEmpty())
- http.setUser(user, pass);
- http.setHost(host);
- int id = http.get(path);
- Q_UNUSED(id);
-
- QTimer::singleShot(5000, &loop, SLOT(quit()));
- loop.exec();
-
- QCOMPARE(http.lastResponse().statusCode(), result);
-}
-
-void tst_QHttp::proxy_data()
-{
- QTest::addColumn<QString>("proxyhost");
- QTest::addColumn<int>("port");
- QTest::addColumn<QString>("host");
- QTest::addColumn<QString>("path");
- QTest::addColumn<QString>("proxyuser");
- QTest::addColumn<QString>("proxypass");
-
- QTest::newRow("qt-test-server") << QtNetworkSettings::serverName() << 3128
- << QString::fromLatin1("qt.nokia.com") << QString::fromLatin1("/")
- << QString::fromLatin1("") << QString::fromLatin1("");
- QTest::newRow("qt-test-server pct") << QtNetworkSettings::serverName() << 3128
- << QString::fromLatin1("qt.nokia.com") << QString::fromLatin1("/%64eveloper")
- << QString::fromLatin1("") << QString::fromLatin1("");
- QTest::newRow("qt-test-server-basic") << QtNetworkSettings::serverName() << 3129
- << QString::fromLatin1("qt.nokia.com") << QString::fromLatin1("/")
- << QString::fromLatin1("qsockstest") << QString::fromLatin1("password");
-
-#if 0
- // NTLM requires sending the same request three times for it to work
- // the tst_QHttp class is too strict to handle the byte counts sent by dataSendProgress
- // So don't run this test:
- QTest::newRow("qt-test-server-ntlm") << QtNetworkSettings::serverName() << 3130
- << QString::fromLatin1("qt.nokia.com") << QString::fromLatin1("/")
- << QString::fromLatin1("qsockstest") << QString::fromLatin1("password");
-#endif
-}
-
-void tst_QHttp::proxy()
-{
- QFETCH(QString, proxyhost);
- QFETCH(int, port);
- QFETCH(QString, host);
- QFETCH(QString, path);
- QFETCH(QString, proxyuser);
- QFETCH(QString, proxypass);
-
- http = newHttp(!proxyuser.isEmpty());
-
- QCOMPARE(http->currentId(), 0);
- QCOMPARE((int)http->state(), (int)QHttp::Unconnected);
-
- addRequest(QHttpRequestHeader(), http->setProxy(proxyhost, port, proxyuser, proxypass));
- addRequest(QHttpRequestHeader(), http->setHost(host));
- getId = http->get(path);
- addRequest(QHttpRequestHeader(), getId);
-
- QTestEventLoop::instance().enterLoop(30);
- if (QTestEventLoop::instance().timeout())
- QFAIL("Network operation timed out");
-
- ResMapIt res = resultMap.find(getId);
- QVERIFY(res != resultMap.end());
- QVERIFY(res.value().success);
- QCOMPARE(res.value().resp.statusCode(), 200);
-}
-
-void tst_QHttp::proxy2()
-{
- QFETCH_GLOBAL(bool, setProxy);
- if (setProxy)
- return;
-
- readyRead_ba.clear();
-
- QHttp http;
- http.setProxy(QtNetworkSettings::serverName(), 3128);
- http.setHost(QtNetworkSettings::serverName());
- http.get("/index.html");
- http.get("/index.html");
-
- connect(&http, SIGNAL(requestFinished(int, bool)),
- this, SLOT(proxy2_slot()));
- QTestEventLoop::instance().enterLoop(30);
- QVERIFY(!QTestEventLoop::instance().timeout());
-
- QCOMPARE(readyRead_ba.count("Welcome to qt-test-server"), 2);
-
- readyRead_ba.clear();
-}
-
-void tst_QHttp::proxy2_slot()
-{
- QHttp *http = static_cast<QHttp *>(sender());
- readyRead_ba.append(http->readAll());
- if (!http->hasPendingRequests())
- QTestEventLoop::instance().exitLoop();
-}
-
-void tst_QHttp::proxy3()
-{
- QFETCH_GLOBAL(bool, setProxy);
- if (setProxy)
- return;
-
- readyRead_ba.clear();
-
- QTcpSocket socket;
- socket.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3128));
-
- QHttp http;
- http.setSocket(&socket);
- http.setHost(QtNetworkSettings::serverName());
- http.get("/index.html");
- http.get("/index.html");
-
- connect(&http, SIGNAL(requestFinished(int, bool)),
- this, SLOT(proxy2_slot()));
- QTestEventLoop::instance().enterLoop(30);
- QVERIFY(!QTestEventLoop::instance().timeout());
-
- QCOMPARE(readyRead_ba.count("Welcome to qt-test-server"), 2);
-
- readyRead_ba.clear();
-}
-
-// test QHttp::currentId() and QHttp::currentRequest()
-#define CURRENTREQUEST_TEST \
- { \
- ResMapIt res = resultMap.find( http->currentId() ); \
- QVERIFY( res != resultMap.end() ); \
- if ( http->currentId() == getId ) { \
- QCOMPARE( http->currentRequest().method(), QString("GET") ); \
- } else if ( http->currentId() == headId ) { \
- QCOMPARE( http->currentRequest().method(), QString("HEAD") ); \
- } else if ( http->currentId() == postId ) { \
- QCOMPARE( http->currentRequest().method(), QString("POST") ); \
- } else { \
- QVERIFY( headerAreEqual( http->currentRequest(), res.value().req ) ); \
- } \
- }
-
-void tst_QHttp::requestStarted( int id )
-{
-#if defined( DUMP_SIGNALS )
- qDebug( "%d:requestStarted( %d )", http->currentId(), id );
-#endif
- // make sure that the requestStarted and requestFinished are nested correctly
- QVERIFY( current_id == 0 );
- current_id = id;
-
- QVERIFY( !ids.isEmpty() );
- QVERIFY( ids.first() == id );
- if ( ids.count() > 1 ) {
- QVERIFY( http->hasPendingRequests() );
- } else {
- QVERIFY( !http->hasPendingRequests() );
- }
-
- QVERIFY( http->currentId() == id );
- QVERIFY( cur_state == http->state() );
-
-
-
-
- CURRENTREQUEST_TEST;
-
- QVERIFY( http->error() == QHttp::NoError );
-}
-
-void tst_QHttp::requestFinished( int id, bool error )
-{
-#if defined( DUMP_SIGNALS )
- qDebug( "%d:requestFinished( %d, %d ) -- errorString: '%s'",
- http->currentId(), id, (int)error, http->errorString().toAscii().data() );
-#endif
- // make sure that the requestStarted and requestFinished are nested correctly
- QVERIFY( current_id == id );
- current_id = 0;
-
- QVERIFY( !ids.isEmpty() );
- QVERIFY( ids.first() == id );
- if ( ids.count() > 1 ) {
- QVERIFY( http->hasPendingRequests() );
- } else {
- QVERIFY( !http->hasPendingRequests() );
- }
-
- if ( error ) {
- QVERIFY( http->error() != QHttp::NoError );
- ids.clear();
- } else {
- QVERIFY( http->error() == QHttp::NoError );
- ids.pop_front();
- }
-
- QVERIFY( http->currentId() == id );
- QVERIFY( cur_state == http->state() );
- CURRENTREQUEST_TEST;
-
- ResMapIt res = resultMap.find( http->currentId() );
- QVERIFY( res != resultMap.end() );
- QVERIFY( res.value().success == -1 );
- if ( error )
- res.value().success = 0;
- else
- res.value().success = 1;
-}
-
-void tst_QHttp::done( bool error )
-{
-#if defined( DUMP_SIGNALS )
- qDebug( "%d:done( %d )", http->currentId(), (int)error );
-#endif
- QVERIFY( http->currentId() == 0 );
- QVERIFY( current_id == 0 );
- QVERIFY( ids.isEmpty() );
- QVERIFY( cur_state == http->state() );
- QVERIFY( !http->hasPendingRequests() );
-
- QVERIFY( done_success == -1 );
- if ( error ) {
- QVERIFY( http->error() != QHttp::NoError );
- done_success = 0;
- } else {
- QVERIFY( http->error() == QHttp::NoError );
- done_success = 1;
- }
- QTestEventLoop::instance().exitLoop();
-}
-
-void tst_QHttp::stateChanged( int state )
-{
-#if defined( DUMP_SIGNALS )
- qDebug( "%d: stateChanged( %d )", http->currentId(), state );
-#endif
- QCOMPARE( http->currentId(), current_id );
- if ( ids.count() > 0 )
- CURRENTREQUEST_TEST;
-
- QVERIFY( state != cur_state );
- QVERIFY( state == http->state() );
- if ( state != QHttp::Unconnected && !connectionWithAuth ) {
- // make sure that the states are always emitted in the right order (for
- // this, we assume an ordering on the enum values, which they have at
- // the moment)
- // connections with authentication will possibly reconnect, so ignore them
- QVERIFY( cur_state < state );
- }
- cur_state = state;
-
- if (state == QHttp::Connecting) {
- bytesTotalSend = bytesTotal_init;
- bytesDoneSend = bytesDone_init;
- bytesTotalRead = bytesTotal_init;
- bytesDoneRead = bytesDone_init;
- }
-}
-
-void tst_QHttp::responseHeaderReceived( const QHttpResponseHeader &header )
-{
-#if defined( DUMP_SIGNALS )
- qDebug( "%d: responseHeaderReceived(\n---{\n%s}---)", http->currentId(), header.toString().toAscii().data() );
-#endif
- QCOMPARE( http->currentId(), current_id );
- if ( ids.count() > 1 ) {
- QVERIFY( http->hasPendingRequests() );
- } else {
- QVERIFY( !http->hasPendingRequests() );
- }
- CURRENTREQUEST_TEST;
-
- resultMap[ http->currentId() ].resp = header;
-}
-
-void tst_QHttp::readyRead( const QHttpResponseHeader & )
-{
-#if defined( DUMP_SIGNALS )
- qDebug( "%d: readyRead()", http->currentId() );
-#endif
- QCOMPARE( http->currentId(), current_id );
- if ( ids.count() > 1 ) {
- QVERIFY( http->hasPendingRequests() );
- } else {
- QVERIFY( !http->hasPendingRequests() );
- }
- QVERIFY( cur_state == http->state() );
- CURRENTREQUEST_TEST;
-
- if ( QTest::currentTestFunction() != QLatin1String("bytesAvailable") ) {
- int oldSize = readyRead_ba.size();
- quint64 bytesAvail = http->bytesAvailable();
- QByteArray ba = http->readAll();
- QVERIFY( (quint64) ba.size() == bytesAvail );
- readyRead_ba.resize( oldSize + ba.size() );
- memcpy( readyRead_ba.data()+oldSize, ba.data(), ba.size() );
-
- if ( bytesTotalRead > 0 ) {
- QVERIFY( (int)readyRead_ba.size() <= bytesTotalRead );
- }
- QVERIFY( (int)readyRead_ba.size() == bytesDoneRead );
- }
-}
-
-void tst_QHttp::dataSendProgress( int done, int total )
-{
-#if defined( DUMP_SIGNALS )
- qDebug( "%d: dataSendProgress( %d, %d )", http->currentId(), done, total );
-#endif
- QCOMPARE( http->currentId(), current_id );
- if ( ids.count() > 1 ) {
- QVERIFY( http->hasPendingRequests() );
- } else {
- QVERIFY( !http->hasPendingRequests() );
- }
- QVERIFY( cur_state == http->state() );
- CURRENTREQUEST_TEST;
-
- if ( bytesTotalSend == bytesTotal_init ) {
- bytesTotalSend = total;
- } else {
- QCOMPARE( bytesTotalSend, total );
- }
-
- QVERIFY( bytesTotalSend != bytesTotal_init );
- QVERIFY( bytesDoneSend <= done );
- bytesDoneSend = done;
- if ( bytesTotalSend > 0 ) {
- QVERIFY( bytesDoneSend <= bytesTotalSend );
- }
-
- if ( QTest::currentTestFunction() == QLatin1String("abort") ) {
- // ### it would be nice if we could specify in our testdata when to do
- // the abort
- if ( done >= total/100000 ) {
- if ( ids.count() != 1 ) {
- // do abort only once
- int tmpId = ids.first();
- ids.clear();
- ids << tmpId;
- http->abort();
- }
- }
- }
-}
-
-void tst_QHttp::dataReadProgress( int done, int total )
-{
-#if defined( DUMP_SIGNALS )
- qDebug( "%d: dataReadProgress( %d, %d )", http->currentId(), done, total );
-#endif
- QCOMPARE( http->currentId(), current_id );
- if ( ids.count() > 1 ) {
- QVERIFY( http->hasPendingRequests() );
- } else {
- QVERIFY( !http->hasPendingRequests() );
- }
- QVERIFY( cur_state == http->state() );
- CURRENTREQUEST_TEST;
-
- if ( bytesTotalRead == bytesTotal_init )
- bytesTotalRead = total;
- else {
- QVERIFY( bytesTotalRead == total );
- }
-
- QVERIFY( bytesTotalRead != bytesTotal_init );
- QVERIFY( bytesDoneRead <= done );
- bytesDoneRead = done;
- if ( bytesTotalRead > 0 ) {
- QVERIFY( bytesDoneRead <= bytesTotalRead );
- }
-
- if ( QTest::currentTestFunction() == QLatin1String("abort") ) {
- // ### it would be nice if we could specify in our testdata when to do
- // the abort
- if ( done >= total/100000 ) {
- if ( ids.count() != 1 ) {
- // do abort only once
- int tmpId = ids.first();
- ids.clear();
- ids << tmpId;
- http->abort();
- }
- }
- }
-}
-
-
-QHttp *tst_QHttp::newHttp(bool withAuth)
-{
- QHttp *nHttp = new QHttp( 0 );
- connect( nHttp, SIGNAL(requestStarted(int)),
- SLOT(requestStarted(int)) );
- connect( nHttp, SIGNAL(requestFinished(int,bool)),
- SLOT(requestFinished(int,bool)) );
- connect( nHttp, SIGNAL(done(bool)),
- SLOT(done(bool)) );
- connect( nHttp, SIGNAL(stateChanged(int)),
- SLOT(stateChanged(int)) );
- connect( nHttp, SIGNAL(responseHeaderReceived(const QHttpResponseHeader&)),
- SLOT(responseHeaderReceived(const QHttpResponseHeader&)) );
- connect( nHttp, SIGNAL(readyRead(const QHttpResponseHeader&)),
- SLOT(readyRead(const QHttpResponseHeader&)) );
- connect( nHttp, SIGNAL(dataSendProgress(int,int)),
- SLOT(dataSendProgress(int,int)) );
- connect( nHttp, SIGNAL(dataReadProgress(int,int)),
- SLOT(dataReadProgress(int,int)) );
-
- connectionWithAuth = withAuth;
- return nHttp;
-}
-
-void tst_QHttp::addRequest( QHttpRequestHeader header, int id )
-{
- ids << id;
- RequestResult res;
- res.req = header;
- res.success = -1;
- resultMap[ id ] = res;
-}
-
-bool tst_QHttp::headerAreEqual( const QHttpHeader &h1, const QHttpHeader &h2 )
-{
- if ( !h1.isValid() )
- return !h2.isValid();
- if ( !h2.isValid() )
- return !h1.isValid();
-
- return h1.toString() == h2.toString();
-}
-
-
-void tst_QHttp::reconnect()
-{
- reconnect_state_connect_count = 0;
-
- QHttp http;
-
- QObject::connect(&http, SIGNAL(stateChanged(int)), this, SLOT(reconnect_state(int)));
- http.setHost("trolltech.com", 80);
- http.get("/company/index.html");
- http.setHost("trolltech.com", 8080);
- http.get("/company/index.html");
-
- QTestEventLoop::instance().enterLoop(60);
- if (QTestEventLoop::instance().timeout())
- QFAIL("Network operation timed out");
-
- QCOMPARE(reconnect_state_connect_count, 1);
-
- QTestEventLoop::instance().enterLoop(60);
- if (QTestEventLoop::instance().timeout())
- QFAIL("Network operation timed out");
-
- QCOMPARE(reconnect_state_connect_count, 2);
-}
-
-void tst_QHttp::reconnect_state(int state)
-{
- if (state == QHttp::Connecting) {
- ++reconnect_state_connect_count;
- QTestEventLoop::instance().exitLoop();
- }
-}
-
-void tst_QHttp::setSocket()
-{
- QHttp *http = new QHttp;
- QPointer<QTcpSocket> replacementSocket = new QTcpSocket;
- http->setSocket(replacementSocket);
- QCoreApplication::processEvents();
- delete http;
- QVERIFY(replacementSocket);
- delete replacementSocket;
-}
-
-class Server : public QTcpServer
-{
- Q_OBJECT
-public:
- Server()
- {
- connect(this, SIGNAL(newConnection()),
- this, SLOT(serveConnection()));
- }
-
-private slots:
- void serveConnection()
- {
- QTcpSocket *socket = nextPendingConnection();
- socket->write("HTTP/1.1 404 Not found\r\n"
- "content-length: 4\r\n\r\nabcd");
- socket->disconnectFromHost();
- };
-};
-
-void tst_QHttp::unexpectedRemoteClose()
-{
- QFETCH_GLOBAL(int, proxyType);
- if (proxyType == QNetworkProxy::Socks5Proxy) {
- // This test doesn't make sense for SOCKS5
- return;
- }
-
- Server server;
- server.listen();
- QCoreApplication::instance()->processEvents();
-
- QEventLoop loop;
- QTimer::singleShot(3000, &loop, SLOT(quit()));
-
- QHttp http;
- QObject::connect(&http, SIGNAL(done(bool)), &loop, SLOT(quit()));
- QSignalSpy finishedSpy(&http, SIGNAL(requestFinished(int, bool)));
- QSignalSpy doneSpy(&http, SIGNAL(done(bool)));
-
- http.setHost("localhost", server.serverPort());
- http.get("/");
- http.get("/");
- http.get("/");
-
- loop.exec();
-
- QCOMPARE(finishedSpy.count(), 4);
- QVERIFY(!finishedSpy.at(1).at(1).toBool());
- QVERIFY(!finishedSpy.at(2).at(1).toBool());
- QVERIFY(!finishedSpy.at(3).at(1).toBool());
- QCOMPARE(doneSpy.count(), 1);
- QVERIFY(!doneSpy.at(0).at(0).toBool());
-}
-
-void tst_QHttp::pctEncodedPath()
-{
- QHttpRequestHeader header;
- header.setRequest("GET", "/index.asp/a=%20&b=%20&c=%20");
- QCOMPARE(header.toString(), QString("GET /index.asp/a=%20&b=%20&c=%20 HTTP/1.1\r\n\r\n"));
-}
-
-void tst_QHttp::caseInsensitiveKeys()
-{
- QHttpResponseHeader header("HTTP/1.1 200 OK\r\nContent-Length: 213\r\nX-Been-There: True\r\nLocation: http://www.TrollTech.com/\r\n\r\n");
- QVERIFY(header.hasKey("Content-Length"));
- QVERIFY(header.hasKey("X-Been-There"));
- QVERIFY(header.hasKey("Location"));
- QVERIFY(header.hasKey("content-length"));
- QVERIFY(header.hasKey("x-been-there"));
- QVERIFY(header.hasKey("location"));
- QCOMPARE(header.value("Content-Length"), QString("213"));
- QCOMPARE(header.value("X-Been-There"), QString("True"));
- QCOMPARE(header.value("Location"), QString("http://www.TrollTech.com/"));
- QCOMPARE(header.value("content-length"), QString("213"));
- QCOMPARE(header.value("x-been-there"), QString("True"));
- QCOMPARE(header.value("location"), QString("http://www.TrollTech.com/"));
- QCOMPARE(header.allValues("location"), QStringList("http://www.TrollTech.com/"));
-
- header.addValue("Content-Length", "213");
- header.addValue("Content-Length", "214");
- header.addValue("Content-Length", "215");
- qDebug() << header.toString();
-}
-
-void tst_QHttp::proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *auth)
-{
- proxyAuthCalled = true;
- auth->setUser("qsockstest");
- auth->setPassword("password");
-}
-
-void tst_QHttp::postAuthNtlm()
-{
- QSKIP("NTLM not working");
-
- QHostInfo info = QHostInfo::fromName(QHostInfo::localHostName());
- QByteArray postData("Hello World");
- QHttp http;
-
- http.setHost(QtNetworkSettings::serverName());
- http.setProxy(QtNetworkSettings::serverName(), 3130);
- http.post("/", postData);
-
- proxyAuthCalled = false;
- connect(&http, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
- SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
-
- QObject::connect(&http, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
- QTestEventLoop::instance().enterLoop(3);
- QObject::disconnect(&http, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
-
- QVERIFY(proxyAuthCalled);
- QVERIFY(!QTestEventLoop::instance().timeout());
-};
-
-#ifndef QT_NO_OPENSSL
-void tst_QHttp::proxyAndSsl()
-{
- QFETCH_GLOBAL(bool, setProxy);
- if (setProxy)
- return;
-
- QHttp http;
-
- http.setHost(QtNetworkSettings::serverName(), QHttp::ConnectionModeHttps);
- http.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, QtNetworkSettings::serverName(), 3129));
- http.get("/");
-
- proxyAuthCalled = false;
- connect(&http, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
- SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
- connect(&http, SIGNAL(sslErrors(QList<QSslError>)),
- &http, SLOT(ignoreSslErrors()));
-
- QObject::connect(&http, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
- QTestEventLoop::instance().enterLoop(3);
- QObject::disconnect(&http, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
-
- QVERIFY(!QTestEventLoop::instance().timeout());
- QVERIFY(proxyAuthCalled);
-
- QHttpResponseHeader header = http.lastResponse();
- QVERIFY(header.isValid());
- QVERIFY(header.statusCode() < 400); // Should be 200, but as long as it's not an error, we're happy
-}
-#endif
-
-#ifndef QT_NO_OPENSSL
-void tst_QHttp::cachingProxyAndSsl()
-{
- QFETCH_GLOBAL(bool, setProxy);
- if (setProxy)
- return;
-
- QHttp http;
-
- http.setHost(QtNetworkSettings::serverName(), QHttp::ConnectionModeHttps);
- http.setProxy(QNetworkProxy(QNetworkProxy::HttpCachingProxy, QtNetworkSettings::serverName(), 3129));
- http.get("/");
-
- proxyAuthCalled = false;
- connect(&http, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
- SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
-
- QObject::connect(&http, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
- QTestEventLoop::instance().enterLoop(3);
- QObject::disconnect(&http, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
-
- QVERIFY(!QTestEventLoop::instance().timeout());
- QVERIFY(!proxyAuthCalled); // NOT called! QHttp should get a socket error
- QVERIFY(http.state() != QHttp::Connected);
-
- QHttpResponseHeader header = http.lastResponse();
- QVERIFY(!header.isValid());
-}
-#endif
-
-void tst_QHttp::emptyBodyInReply()
-{
- // Note: if this test starts failing, please verify the date on the file
- // returned by Apache on http://netiks.troll.no/
- // It is right now hard-coded to the date below
- QHttp http;
- http.setHost(QtNetworkSettings::serverName());
-
- QHttpRequestHeader headers("GET", "/");
- headers.addValue("If-Modified-Since", "Sun, 16 Nov 2008 12:29:51 GMT");
- headers.addValue("Host", QtNetworkSettings::serverName());
- http.request(headers);
-
- QObject::connect(&http, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
- QTestEventLoop::instance().enterLoop(10);
- QObject::disconnect(&http, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
-
- QVERIFY(!QTestEventLoop::instance().timeout());
-
- // check the reply
- if (http.lastResponse().statusCode() != 304) {
- qWarning() << http.lastResponse().statusCode() << qPrintable(http.lastResponse().reasonPhrase());
- qWarning() << "Last-Modified:" << qPrintable(http.lastResponse().value("last-modified"));
- QFAIL("Server replied with the wrong status code; see warning output");
- }
-}
-
-void tst_QHttp::abortSender()
-{
- QHttp *http = qobject_cast<QHttp *>(sender());
- if (http)
- http->abort();
-}
-
-void tst_QHttp::abortInReadyRead()
-{
- QHttp http;
- http.setHost(QtNetworkSettings::serverName());
- http.get("/qtest/bigfile");
-
- qRegisterMetaType<QHttpResponseHeader>();
- QSignalSpy spy(&http, SIGNAL(readyRead(QHttpResponseHeader)));
-
- QObject::connect(&http, SIGNAL(readyRead(QHttpResponseHeader)), this, SLOT(abortSender()));
- QObject::connect(&http, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
- QTestEventLoop::instance().enterLoop(10);
- QObject::disconnect(&http, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
-
- QVERIFY2(!QTestEventLoop::instance().timeout(), "Network timeout");
- QVERIFY(http.state() != QHttp::Connected);
-
- QCOMPARE(spy.count(), 1);
-}
-
-void tst_QHttp::abortInResponseHeaderReceived()
-{
- QHttp http;
- http.setHost(QtNetworkSettings::serverName());
- http.get("/qtest/bigfile");
-
- qRegisterMetaType<QHttpResponseHeader>();
- QSignalSpy spy(&http, SIGNAL(readyRead(QHttpResponseHeader)));
-
- QObject::connect(&http, SIGNAL(responseHeaderReceived(QHttpResponseHeader)), this, SLOT(abortSender()));
- QObject::connect(&http, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
- QTestEventLoop::instance().enterLoop(10);
- QObject::disconnect(&http, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
-
- QVERIFY2(!QTestEventLoop::instance().timeout(), "Network timeout");
- QVERIFY(http.state() != QHttp::Connected);
-
- QCOMPARE(spy.count(), 0);
-}
-
-void tst_QHttp::connectionClose()
-{
- // This was added in response to bug 176822
- QFETCH_GLOBAL(bool, setProxy);
- if (setProxy)
- return;
-
- QHttp http;
- ClosingServer server;
- http.setHost("localhost", QHttp::ConnectionModeHttps, server.serverPort());
- http.get("/login/gateway/processLogin");
-
- // another possibility:
- //http.setHost("nexus.passport.com", QHttp::ConnectionModeHttps, 443);
- //http.get("/rdr/pprdr.asp");
-
- QObject::connect(&http, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
- QTestEventLoop::instance().enterLoop(900);
- QObject::disconnect(&http, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
-
- QVERIFY(!QTestEventLoop::instance().timeout());
-}
-
-void tst_QHttp::nestedEventLoop_slot(int id)
-{
- if (!ids.contains(id))
- return;
- QEventLoop subloop;
-
- // 16 seconds: fluke times out in 15 seconds, which triggers a QTcpSocket error
- QTimer::singleShot(16000, &subloop, SLOT(quit()));
- subloop.exec();
-
- QTestEventLoop::instance().exitLoop();
-}
-
-void tst_QHttp::nestedEventLoop()
-{
- QFETCH_GLOBAL(bool, setProxy);
- if (setProxy)
- return;
-
- http = new QHttp;
- http->setHost(QtNetworkSettings::serverName());
- int getId = http->get("/");
-
- ids.clear();
- ids << getId;
-
- QSignalSpy spy(http, SIGNAL(requestStarted(int)));
- QSignalSpy spy2(http, SIGNAL(done(bool)));
-
- connect(http, SIGNAL(requestFinished(int,bool)), SLOT(nestedEventLoop_slot(int)));
- QTestEventLoop::instance().enterLoop(20);
-
- QVERIFY2(!QTestEventLoop::instance().timeout(), "Network timeout");
-
- // Find out how many signals with the first argument equalling our id were found
- int spyCount = 0;
- for (int i = 0; i < spy.count(); ++i)
- if (spy.at(i).at(0).toInt() == getId)
- ++spyCount;
-
- // each signal spied should have been emitted only once
- QCOMPARE(spyCount, 1);
- QCOMPARE(spy2.count(), 1);
-}
-
-QTEST_MAIN(tst_QHttp)
-#include "tst_qhttp.moc"
diff --git a/tests/auto/network/access/qhttp/webserver/cgi-bin/retrieve_testfile.cgi b/tests/auto/network/access/qhttp/webserver/cgi-bin/retrieve_testfile.cgi
deleted file mode 100755
index 7896c505ca..0000000000
--- a/tests/auto/network/access/qhttp/webserver/cgi-bin/retrieve_testfile.cgi
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-echo "Content-type: text/plain";
-echo
-cat testfile
-echo "no file retrieved" > testfile
diff --git a/tests/auto/network/access/qhttp/webserver/cgi-bin/rfc.cgi b/tests/auto/network/access/qhttp/webserver/cgi-bin/rfc.cgi
deleted file mode 100755
index c68688ea31..0000000000
--- a/tests/auto/network/access/qhttp/webserver/cgi-bin/rfc.cgi
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-echo "Content-type: text/plain";
-echo
-cat ../rfc3252
diff --git a/tests/auto/network/access/qhttp/webserver/cgi-bin/store_testfile.cgi b/tests/auto/network/access/qhttp/webserver/cgi-bin/store_testfile.cgi
deleted file mode 100755
index e950f2af04..0000000000
--- a/tests/auto/network/access/qhttp/webserver/cgi-bin/store_testfile.cgi
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-echo "Content-type: text/plain";
-echo
-echo "file stored under 'testfile'"
-cat > testfile
diff --git a/tests/auto/network/access/qhttp/webserver/index.html b/tests/auto/network/access/qhttp/webserver/index.html
deleted file mode 100644
index b80c61bf0a..0000000000
--- a/tests/auto/network/access/qhttp/webserver/index.html
+++ /dev/null
@@ -1,899 +0,0 @@
-
-
-
-
-
-
-Network Working Group H. Kennedy
-Request for Comments: 3252 Mimezine
-Category: Informational 1 April 2002
-
-
- Binary Lexical Octet Ad-hoc Transport
-
-Status of this Memo
-
- This memo provides information for the Internet community. It does
- not specify an Internet standard of any kind. Distribution of this
- memo is unlimited.
-
-Copyright Notice
-
- Copyright (C) The Internet Society (2002). All Rights Reserved.
-
-Abstract
-
- This document defines a reformulation of IP and two transport layer
- protocols (TCP and UDP) as XML applications.
-
-1. Introduction
-
-1.1. Overview
-
- This document describes the Binary Lexical Octet Ad-hoc Transport
- (BLOAT): a reformulation of a widely-deployed network-layer protocol
- (IP [RFC791]), and two associated transport layer protocols (TCP
- [RFC793] and UDP [RFC768]) as XML [XML] applications. It also
- describes methods for transporting BLOAT over Ethernet and IEEE 802
- networks as well as encapsulating BLOAT in IP for gatewaying BLOAT
- across the public Internet.
-
-1.2. Motivation
-
- The wild popularity of XML as a basis for application-level protocols
- such as the Blocks Extensible Exchange Protocol [RFC3080], the Simple
- Object Access Protocol [SOAP], and Jabber [JABBER] prompted
- investigation into the possibility of extending the use of XML in the
- protocol stack. Using XML at both the transport and network layer in
- addition to the application layer would provide for an amazing amount
- of power and flexibility while removing dependencies on proprietary
- and hard-to-understand binary protocols. This protocol unification
- would also allow applications to use a single XML parser for all
- aspects of their operation, eliminating developer time spent figuring
- out the intricacies of each new protocol, and moving the hard work of
-
-
-
-
-Kennedy Informational [Page 1]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- parsing to the XML toolset. The use of XML also mitigates concerns
- over "network vs. host" byte ordering which is at the root of many
- network application bugs.
-
-1.3. Relation to Existing Protocols
-
- The reformulations specified in this RFC follow as closely as
- possible the spirit of the RFCs on which they are based, and so MAY
- contain elements or attributes that would not be needed in a pure
- reworking (e.g. length attributes, which are implicit in XML.)
-
- The layering of network and transport protocols are maintained in
- this RFC despite the optimizations that could be made if the line
- were somewhat blurred (i.e. merging TCP and IP into a single, larger
- element in the DTD) in order to foster future use of this protocol as
- a basis for reformulating other protocols (such as ICMP.)
-
- Other than the encoding, the behavioral aspects of each of the
- existing protocols remain unchanged. Routing, address spaces, TCP
- congestion control, etc. behave as specified in the extant standards.
- Adapting to new standards and experimental algorithm heuristics for
- improving performance will become much easier once the move to BLOAT
- has been completed.
-
-1.4. Requirement Levels
-
- The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
- "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
- document are to be interpreted as described in BCP 14, RFC 2119
- [RFC2119].
-
-2. IPoXML
-
- This protocol MUST be implemented to be compliant with this RFC.
- IPoXML is the root protocol REQUIRED for effective use of TCPoXML
- (section 3.) and higher-level application protocols.
-
- The DTD for this document type can be found in section 7.1.
-
- The routing of IPoXML can be easily implemented on hosts with an XML
- parser, as the regular structure lends itself handily to parsing and
- validation of the document/datagram and then processing the
- destination address, TTL, and checksum before sending it on to its
- next-hop.
-
- The reformulation of IPv4 was chosen over IPv6 [RFC2460] due to the
- wider deployment of IPv4 and the fact that implementing IPv6 as XML
- would have exceeded the 1500 byte Ethernet MTU.
-
-
-
-Kennedy Informational [Page 2]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- All BLOAT implementations MUST use - and specify - the UTF-8 encoding
- of RFC 2279 [RFC2279]. All BLOAT document/datagrams MUST be well-
- formed and include the XMLDecl.
-
-2.1. IP Description
-
- A number of items have changed (for the better) from the original IP
- specification. Bit-masks, where present have been converted into
- human-readable values. IP addresses are listed in their dotted-
- decimal notation [RFC1123]. Length and checksum values are present
- as decimal integers.
-
- To calculate the length and checksum fields of the IP element, a
- canonicalized form of the element MUST be used. The canonical form
- SHALL have no whitespace (including newline characters) between
- elements and only one space character between attributes. There
- SHALL NOT be a space following the last attribute in an element.
-
- An iterative method SHOULD be used to calculate checksums, as the
- length field will vary based on the size of the checksum.
-
- The payload element bears special attention. Due to the character
- set restrictions of XML, the payload of IP datagrams (which MAY
- contain arbitrary data) MUST be encoded for transport. This RFC
- REQUIRES the contents of the payload to be encoded in the base-64
- encoding of RFC 2045 [RFC2045], but removes the requirement that the
- encoded output MUST be wrapped on 76-character lines.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Kennedy Informational [Page 3]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
-2.2. Example Datagram
-
- The following is an example IPoXML datagram with an empty payload:
-
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE ip PUBLIC "-//IETF//DTD BLOAT 1.0 IP//EN" "bloat.dtd">
- <ip>
- <header length="474">
- <version value="4"/>
- <tos precedence="Routine" delay="Normal" throughput="Normal"
- relibility="Normal" reserved="0"/>
- <total.length value="461"/>
- <id value="1"/>
- <flags reserved="0" df="dont" mf="last"/>
- <offset value="0"/>
- <ttl value="255"/>
- <protocol value="6"/>
- <checksum value="8707"/>
- <source address="10.0.0.22"/>
- <destination address="10.0.0.1"/>
- <options>
- <end copied="0" class="0" number="0"/>
- </options>
- <padding pad="0"/>
- </header>
- <payload>
- </payload>
- </ip>
-
-3. TCPoXML
-
- This protocol MUST be implemented to be compliant with this RFC. The
- DTD for this document type can be found in section 7.2.
-
-3.1. TCP Description
-
- A number of items have changed from the original TCP specification.
- Bit-masks, where present have been converted into human-readable
- values. Length and checksum and port values are present as decimal
- integers.
-
- To calculate the length and checksum fields of the TCP element, a
- canonicalized form of the element MUST be used as in section 2.1.
-
- An iterative method SHOULD be used to calculate checksums as in
- section 2.1.
-
- The payload element MUST be encoded as in section 2.1.
-
-
-
-Kennedy Informational [Page 4]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- The TCP offset element was expanded to a maximum of 255 from 16 to
- allow for the increased size of the header in XML.
-
- TCPoXML datagrams encapsulated by IPoXML MAY omit the <?xml?> header
- as well as the <!DOCTYPE> declaration.
-
-3.2. Example Datagram
-
- The following is an example TCPoXML datagram with an empty payload:
-
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE tcp PUBLIC "-//IETF//DTD BLOAT 1.0 TCP//EN" "bloat.dtd">
- <tcp>
- <tcp.header>
- <src port="31415"/>
- <dest port="42424"/>
- <sequence number="322622954"/>
- <acknowledgement number="689715995"/>
- <offset number=""/>
- <reserved value="0"/>
- <control syn="1" ack="1"/>
- <window size="1"/>
- <urgent pointer="0"/>
- <checksum value="2988"/>
- <tcp.options>
- <tcp.end kind="0"/>
- </tcp.options>
- <padding pad="0"/>
- </tcp.header>
- <payload>
- </payload>
- </tcp>
-
-4. UDPoXML
-
- This protocol MUST be implemented to be compliant with this RFC. The
- DTD for this document type can be found in section 7.3.
-
-4.1. UDP Description
-
- A number of items have changed from the original UDP specification.
- Bit-masks, where present have been converted into human-readable
- values. Length and checksum and port values are present as decimal
- integers.
-
-
-
-
-
-
-
-Kennedy Informational [Page 5]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- To calculate the length and checksum fields of the UDP element, a
- canonicalized form of the element MUST be used as in section 2.1. An
- iterative method SHOULD be used to calculate checksums as in section
- 2.1.
-
- The payload element MUST be encoded as in section 2.1.
-
- UDPoXML datagrams encapsulated by IPoXML MAY omit the <?xml?> header
- as well as the <!DOCTYPE> declaration.
-
-4.2. Example Datagram
-
- The following is an example UDPoXML datagram with an empty payload:
-
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE udp PUBLIC "-//IETF//DTD BLOAT 1.0 UDP//EN" "bloat.dtd">
- <udp>
- <udp.header>
- <src port="31415"/>
- <dest port="42424"/>
- <udp.length value="143"/>
- <checksum value="2988"/>
- </udp.header>
- <payload>
- </payload>
- </udp>
-
-5. Network Transport
-
- This document provides for the transmission of BLOAT datagrams over
- two common families of physical layer transport. Future RFCs will
- address additional transports as routing vendors catch up to the
- specification, and we begin to see BLOAT routed across the Internet
- backbone.
-
-5.1. Ethernet
-
- BLOAT is encapsulated in Ethernet datagrams as in [RFC894] with the
- exception that the type field of the Ethernet frame MUST contain the
- value 0xBEEF. The first 5 octets of the Ethernet frame payload will
- be 0x3c 3f 78 6d 6c ("<?xml".)
-
-5.2. IEEE 802
-
- BLOAT is encapsulated in IEEE 802 Networks as in [RFC1042] except
- that the protocol type code for IPoXML is 0xBEEF.
-
-
-
-
-
-Kennedy Informational [Page 6]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
-6. Gatewaying over IP
-
- In order to facilitate the gradual introduction of BLOAT into the
- public Internet, BLOAT MAY be encapsulated in IP as in [RFC2003] to
- gateway between networks that run BLOAT natively on their LANs.
-
-7. DTDs
-
- The Transport DTDs (7.2. and 7.3.) build on the definitions in the
- Network DTD (7.1.)
-
- The DTDs are referenced by their PubidLiteral and SystemLiteral (from
- [XML]) although it is understood that most IPoXML implementations
- will not need to pull down the DTD, as it will normally be embedded
- in the implementation, and presents something of a catch-22 if you
- need to load part of your network protocol over the network.
-
-7.1. IPoXML DTD
-
- <!--
- DTD for IP over XML.
- Refer to this DTD as:
-
- <!DOCTYPE ip PUBLIC "-//IETF//DTD BLOAT 1.0 IP//EN" "bloat.dtd">
- -->
- <!--
- DTD data types:
-
- Digits [0..9]+
-
- Precedence "NetworkControl | InternetworkControl |
- CRITIC | FlashOverride | Flash | Immediate |
- Priority | Routine"
-
- IP4Addr "dotted-decimal" notation of [RFC1123]
-
- Class [0..3]
-
- Sec "Unclassified | Confidential | EFTO | MMMM | PROG |
- Restricted | Secret | Top Secret | Reserved"
-
- Compartments [0..65535]
-
- Handling [0..65535]
-
- TCC [0..16777216]
-
- -->
-
-
-
-Kennedy Informational [Page 7]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- <!ENTITY % Digits "CDATA">
- <!ENTITY % Precedence "CDATA">
- <!ENTITY % IP4Addr "CDATA">
- <!ENTITY % Class "CDATA">
- <!ENTITY % Sec "CDATA">
- <!ENTITY % Compartments "CDATA">
- <!ENTITY % Handling "CDATA">
- <!ENTITY % TCC "CDATA">
-
- <!ELEMENT ip (header, payload)>
-
- <!ELEMENT header (version, tos, total.length, id, flags, offset, ttl,
- protocol, checksum, source, destination, options,
- padding)>
- <!-- length of header in 32-bit words -->
- <!ATTLIST header
- length %Digits; #REQUIRED>
-
- <!ELEMENT version EMPTY>
- <!-- ip version. SHOULD be "4" -->
- <!ATTLIST version
- value %Digits; #REQUIRED>
-
- <!ELEMENT tos EMPTY>
- <!ATTLIST tos
- precedence %Precedence; #REQUIRED
- delay (normal | low) #REQUIRED
- throughput (normal | high) #REQUIRED
- relibility (normal | high) #REQUIRED
- reserved CDATA #FIXED "0">
-
- <!ELEMENT total.length EMPTY>
- <!--
- total length of datagram (header and payload) in octets, MUST be
- less than 65,535 (and SHOULD be less than 1024 for IPoXML on local
- ethernets).
- -->
- <!ATTLIST total.length
- value %Digits; #REQUIRED>
-
- <!ELEMENT id EMPTY>
- <!-- 0 <= id <= 65,535 -->
- <!ATTLIST id
- value %Digits; #REQUIRED>
-
- <!ELEMENT flags EMPTY>
- <!-- df = don't fragment, mf = more fragments -->
- <!ATTLIST flags
-
-
-
-Kennedy Informational [Page 8]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- reserved CDATA #FIXED "0"
- df (may|dont) #REQUIRED
- mf (last|more) #REQUIRED>
-
- <!ELEMENT offset EMPTY>
- <!-- 0 <= offset <= 8192 measured in 8 octet (64-bit) chunks -->
- <!ATTLIST offset
- value %Digits; #REQUIRED>
-
- <!ELEMENT ttl EMPTY>
- <!-- 0 <= ttl <= 255 -->
- <!ATTLIST ttl
- value %Digits; #REQUIRED>
-
- <!ELEMENT protocol EMPTY>
- <!-- 0 <= protocol <= 255 (per IANA) -->
- <!ATTLIST protocol
- value %Digits; #REQUIRED>
-
- <!ELEMENT checksum EMPTY>
- <!-- 0 <= checksum <= 65535 (over header only) -->
- <!ATTLIST checksum
- value %Digits; #REQUIRED>
-
- <!ELEMENT source EMPTY>
- <!ATTLIST source
- address %IP4Addr; #REQUIRED>
-
- <!ELEMENT destination EMPTY>
- <!ATTLIST destination
- address %IP4Addr; #REQUIRED>
-
- <!ELEMENT options ( end | noop | security | loose | strict | record
- | stream | timestamp )*>
-
- <!ELEMENT end EMPTY>
- <!ATTLIST end
- copied (0|1) #REQUIRED
- class CDATA #FIXED "0"
- number CDATA #FIXED "0">
-
- <!ELEMENT noop EMPTY>
- <!ATTLIST noop
- copied (0|1) #REQUIRED
- class CDATA #FIXED "0"
- number CDATA #FIXED "1">
-
- <!ELEMENT security EMPTY>
-
-
-
-Kennedy Informational [Page 9]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- <!ATTLIST security
- copied CDATA #FIXED "1"
- class CDATA #FIXED "0"
- number CDATA #FIXED "2"
- length CDATA #FIXED "11"
- security %Sec; #REQUIRED
- compartments %Compartments; #REQUIRED
- handling %Handling; #REQUIRED
- tcc %TCC; #REQUIRED>
- <!ELEMENT loose (hop)+>
- <!ATTLIST loose
- copied CDATA #FIXED "1"
- class CDATA #FIXED "0"
- number CDATA #FIXED "3"
- length %Digits; #REQUIRED
- pointer %Digits; #REQUIRED>
-
- <!ELEMENT hop EMPTY>
- <!ATTLIST hop
- address %IP4Addr; #REQUIRED>
-
- <!ELEMENT strict (hop)+>
- <!ATTLIST strict
- copied CDATA #FIXED "1"
- class CDATA #FIXED "0"
- number CDATA #FIXED "9"
- length %Digits; #REQUIRED
- pointer %Digits; #REQUIRED>
-
- <!ELEMENT record (hop)+>
- <!ATTLIST record
- copied CDATA #FIXED "0"
- class CDATA #FIXED "0"
- number CDATA #FIXED "7"
- length %Digits; #REQUIRED
- pointer %Digits; #REQUIRED>
-
- <!ELEMENT stream EMPTY>
- <!-- 0 <= id <= 65,535 -->
- <!ATTLIST stream
- copied CDATA #FIXED "1"
- class CDATA #FIXED "0"
- number CDATA #FIXED "8"
- length CDATA #FIXED "4"
- id %Digits; #REQUIRED>
-
- <!ELEMENT timestamp (tstamp)+>
- <!-- 0 <= oflw <=15 -->
-
-
-
-Kennedy Informational [Page 10]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- <!ATTLIST timestamp
- copied CDATA #FIXED "0"
- class CDATA #FIXED "2"
- number CDATA #FIXED "4"
- length %Digits; #REQUIRED
- pointer %Digits; #REQUIRED
- oflw %Digits; #REQUIRED
- flag (0 | 1 | 3) #REQUIRED>
-
- <!ELEMENT tstamp EMPTY>
- <!ATTLIST tstamp
- time %Digits; #REQUIRED
- address %IP4Addr; #IMPLIED>
- <!--
- padding to bring header to 32-bit boundary.
- pad MUST be "0"*
- -->
- <!ELEMENT padding EMPTY>
- <!ATTLIST padding
- pad CDATA #REQUIRED>
-
- <!-- payload MUST be encoded as base-64 [RFC2045], as modified
- by section 2.1 of this RFC -->
- <!ELEMENT payload (CDATA)>
-
-7.2. TCPoXML DTD
-
- <!--
- DTD for TCP over XML.
- Refer to this DTD as:
-
- <!DOCTYPE tcp PUBLIC "-//IETF//DTD BLOAT 1.0 TCP//EN" "bloat.dtd">
- -->
-
- <!-- the pseudoheader is only included for checksum calculations -->
- <!ELEMENT tcp (tcp.pseudoheader?, tcp.header, payload)>
-
- <!ELEMENT tcp.header (src, dest, sequence, acknowledgement, offset,
- reserved, control, window, checksum, urgent,
- tcp.options, padding)>
-
- <!ELEMENT src EMPTY>
- <!-- 0 <= port <= 65,535 -->
- <!ATTLIST src
- port %Digits; #REQUIRED>
-
- <!ELEMENT dest EMPTY>
- <!-- 0 <= port <= 65,535 -->
-
-
-
-Kennedy Informational [Page 11]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- <!ATTLIST dest
- port %Digits; #REQUIRED>
-
- <!ELEMENT sequence EMPTY>
- <!-- 0 <= number <= 4294967295 -->
- <!ATTLIST sequence
- number %Digits; #REQUIRED>
-
- <!ELEMENT acknowledgement EMPTY>
- <!-- 0 <= number <= 4294967295 -->
- <!ATTLIST acknowledgement
- number %Digits; #REQUIRED>
-
- <!ELEMENT offset EMPTY>
- <!-- 0 <= number <= 255 -->
- <!ATTLIST offset
- number %Digits; #REQUIRED>
-
- <!ELEMENT reserved EMPTY>
- <!ATTLIST reserved
- value CDATA #FIXED "0">
-
- <!ELEMENT control EMPTY>
- <!ATTLIST control
- urg (0|1) #IMPLIED
- ack (0|1) #IMPLIED
- psh (0|1) #IMPLIED
- rst (0|1) #IMPLIED
- syn (0|1) #IMPLIED
- fin (0|1) #IMPLIED>
-
- <!ELEMENT window EMPTY>
- <!-- 0 <= size <= 65,535 -->
- <!ATTLIST window
- size %Digits; #REQUIRED>
-
- <!--
- checksum as in ip, but with
- the following pseudo-header added into the tcp element:
- -->
- <!ELEMENT tcp.pseudoheader (source, destination, protocol,
- tcp.length)>
-
- <!--
- tcp header + data length in octets. does not include the size of
-
- the pseudoheader.
- -->
-
-
-
-Kennedy Informational [Page 12]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- <!ELEMENT tcp.length EMPTY>
- <!ATTLIST tcp.length
- value %Digits; #REQUIRED>
-
- <!ELEMENT urgent EMPTY>
- <!-- 0 <= pointer <= 65,535 -->
- <!ATTLIST urgent
- pointer %Digits; #REQUIRED>
-
- <!ELEMENT tcp.options (tcp.end | tcp.noop | tcp.mss)+>
-
- <!ELEMENT tcp.end EMPTY>
- <!ATTLIST tcp.end
- kind CDATA #FIXED "0">
-
- <!ELEMENT tcp.noop EMPTY>
- <!ATTLIST tcp.noop
- kind CDATA #FIXED "1">
-
- <!ELEMENT tcp.mss EMPTY>
- <!ATTLIST tcp.mss
- kind CDATA #FIXED "2"
- length CDATA #FIXED "4"
- size %Digits; #REQUIRED>
-
-7.3. UDPoXML DTD
-
- <!--
- DTD for UDP over XML.
- Refer to this DTD as:
-
- <!DOCTYPE udp PUBLIC "-//IETF//DTD BLOAT 1.0 UDP//EN" "bloat.dtd">
- -->
-
- <!ELEMENT udp (udp.pseudoheader?, udp.header, payload)>
-
- <!ELEMENT udp.header (src, dest, udp.length, checksum)>
-
- <!ELEMENT udp.pseudoheader (source, destination, protocol,
- udp.length)>
-
- <!--
- udp header + data length in octets. does not include the size of
- the pseudoheader.
- -->
- <!ELEMENT udp.length EMPTY>
- <!ATTLIST udp.length
- value %Digits; #REQUIRED>
-
-
-
-Kennedy Informational [Page 13]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
-8. Security Considerations
-
- XML, as a subset of SGML, has the same security considerations as
- specified in SGML Media Types [RFC1874]. Security considerations
- that apply to IP, TCP and UDP also likely apply to BLOAT as it does
- not attempt to correct for issues not related to message format.
-
-9. References
-
- [JABBER] Miller, J., "Jabber", draft-miller-jabber-00.txt,
- February 2002. (Work in Progress)
-
- [RFC768] Postel, J., "User Datagram Protocol", STD 6, RFC 768,
- August 1980.
-
- [RFC791] Postel, J., "Internet Protocol", STD 5, RFC 791,
- September 1981.
-
- [RFC793] Postel, J., "Transmission Control Protocol", STD 7, RFC
- 793, September 1981.
-
- [RFC894] Hornig, C., "Standard for the Transmission of IP
- Datagrams over Ethernet Networks.", RFC 894, April 1984.
-
- [RFC1042] Postel, J. and J. Reynolds, "Standard for the
- Transmission of IP Datagrams Over IEEE 802 Networks", STD
- 43, RFC 1042, February 1988.
-
- [RFC1123] Braden, R., "Requirements for Internet Hosts -
- Application and Support", RFC 1123, October 1989.
-
- [RFC1874] Levinson, E., "SGML Media Types", RFC 1874, December
- 1995.
-
- [RFC2003] Perkins, C., "IP Encapsulation within IP", RFC 2003,
- October 1996.
-
- [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
- Extensions (MIME) Part One: Format of Internet Message
- Bodies", RFC 2045, November 1996.
-
- [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
- Requirement Levels", BCP 14, RFC 2119, March 1997.
-
- [RFC2279] Yergeau, F., "UTF-8, a transformation format of ISO
- 10646", RFC 2279, January 1998.
-
-
-
-
-
-Kennedy Informational [Page 14]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6
- (IPv6) Specification", RFC 2460, December 1998.
-
- [RFC3080] Rose, M., "The Blocks Extensible Exchange Protocol Core",
- RFC 3080, March 2001.
-
- [SOAP] Box, D., Ehnebuske, D., Kakivaya, G., Layman, A.,
- Mendelsohn, N., Nielsen, H. F., Thatte, S. Winer, D.,
- "Simple Object Access Protocol (SOAP) 1.1" World Wide Web
- Consortium Note, May 2000 http://www.w3.org/TR/SOAP/
-
- [XML] Bray, T., Paoli, J., Sperberg-McQueen, C. M., "Extensible
- Markup Language (XML)" World Wide Web Consortium
- Recommendation REC- xml-19980210.
- http://www.w3.org/TR/1998/REC-xml-19980210
-
-10. Author's Address
-
- Hugh Kennedy
- Mimezine
- 1060 West Addison
- Chicago, IL 60613
- USA
-
- EMail: kennedyh@engin.umich.edu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Kennedy Informational [Page 15]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
-11. Full Copyright Statement
-
- Copyright (C) The Internet Society (2002). All Rights Reserved.
-
- This document and translations of it may be copied and furnished to
- others, and derivative works that comment on or otherwise explain it
- or assist in its implementation may be prepared, copied, published
- and distributed, in whole or in part, without restriction of any
- kind, provided that the above copyright notice and this paragraph are
- included on all such copies and derivative works. However, this
- document itself may not be modified in any way, such as by removing
- the copyright notice or references to the Internet Society or other
- Internet organizations, except as needed for the purpose of
- developing Internet standards in which case the procedures for
- copyrights defined in the Internet Standards process must be
- followed, or as required to translate it into languages other than
- English.
-
- The limited permissions granted above are perpetual and will not be
- revoked by the Internet Society or its successors or assigns.
-
- This document and the information contained herein is provided on an
- "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
- TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
- BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
- HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-
-Acknowledgement
-
- Funding for the RFC Editor function is currently provided by the
- Internet Society.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Kennedy Informational [Page 16]
-
diff --git a/tests/auto/network/access/qhttp/webserver/rfc3252 b/tests/auto/network/access/qhttp/webserver/rfc3252
deleted file mode 100644
index b80c61bf0a..0000000000
--- a/tests/auto/network/access/qhttp/webserver/rfc3252
+++ /dev/null
@@ -1,899 +0,0 @@
-
-
-
-
-
-
-Network Working Group H. Kennedy
-Request for Comments: 3252 Mimezine
-Category: Informational 1 April 2002
-
-
- Binary Lexical Octet Ad-hoc Transport
-
-Status of this Memo
-
- This memo provides information for the Internet community. It does
- not specify an Internet standard of any kind. Distribution of this
- memo is unlimited.
-
-Copyright Notice
-
- Copyright (C) The Internet Society (2002). All Rights Reserved.
-
-Abstract
-
- This document defines a reformulation of IP and two transport layer
- protocols (TCP and UDP) as XML applications.
-
-1. Introduction
-
-1.1. Overview
-
- This document describes the Binary Lexical Octet Ad-hoc Transport
- (BLOAT): a reformulation of a widely-deployed network-layer protocol
- (IP [RFC791]), and two associated transport layer protocols (TCP
- [RFC793] and UDP [RFC768]) as XML [XML] applications. It also
- describes methods for transporting BLOAT over Ethernet and IEEE 802
- networks as well as encapsulating BLOAT in IP for gatewaying BLOAT
- across the public Internet.
-
-1.2. Motivation
-
- The wild popularity of XML as a basis for application-level protocols
- such as the Blocks Extensible Exchange Protocol [RFC3080], the Simple
- Object Access Protocol [SOAP], and Jabber [JABBER] prompted
- investigation into the possibility of extending the use of XML in the
- protocol stack. Using XML at both the transport and network layer in
- addition to the application layer would provide for an amazing amount
- of power and flexibility while removing dependencies on proprietary
- and hard-to-understand binary protocols. This protocol unification
- would also allow applications to use a single XML parser for all
- aspects of their operation, eliminating developer time spent figuring
- out the intricacies of each new protocol, and moving the hard work of
-
-
-
-
-Kennedy Informational [Page 1]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- parsing to the XML toolset. The use of XML also mitigates concerns
- over "network vs. host" byte ordering which is at the root of many
- network application bugs.
-
-1.3. Relation to Existing Protocols
-
- The reformulations specified in this RFC follow as closely as
- possible the spirit of the RFCs on which they are based, and so MAY
- contain elements or attributes that would not be needed in a pure
- reworking (e.g. length attributes, which are implicit in XML.)
-
- The layering of network and transport protocols are maintained in
- this RFC despite the optimizations that could be made if the line
- were somewhat blurred (i.e. merging TCP and IP into a single, larger
- element in the DTD) in order to foster future use of this protocol as
- a basis for reformulating other protocols (such as ICMP.)
-
- Other than the encoding, the behavioral aspects of each of the
- existing protocols remain unchanged. Routing, address spaces, TCP
- congestion control, etc. behave as specified in the extant standards.
- Adapting to new standards and experimental algorithm heuristics for
- improving performance will become much easier once the move to BLOAT
- has been completed.
-
-1.4. Requirement Levels
-
- The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
- "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
- document are to be interpreted as described in BCP 14, RFC 2119
- [RFC2119].
-
-2. IPoXML
-
- This protocol MUST be implemented to be compliant with this RFC.
- IPoXML is the root protocol REQUIRED for effective use of TCPoXML
- (section 3.) and higher-level application protocols.
-
- The DTD for this document type can be found in section 7.1.
-
- The routing of IPoXML can be easily implemented on hosts with an XML
- parser, as the regular structure lends itself handily to parsing and
- validation of the document/datagram and then processing the
- destination address, TTL, and checksum before sending it on to its
- next-hop.
-
- The reformulation of IPv4 was chosen over IPv6 [RFC2460] due to the
- wider deployment of IPv4 and the fact that implementing IPv6 as XML
- would have exceeded the 1500 byte Ethernet MTU.
-
-
-
-Kennedy Informational [Page 2]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- All BLOAT implementations MUST use - and specify - the UTF-8 encoding
- of RFC 2279 [RFC2279]. All BLOAT document/datagrams MUST be well-
- formed and include the XMLDecl.
-
-2.1. IP Description
-
- A number of items have changed (for the better) from the original IP
- specification. Bit-masks, where present have been converted into
- human-readable values. IP addresses are listed in their dotted-
- decimal notation [RFC1123]. Length and checksum values are present
- as decimal integers.
-
- To calculate the length and checksum fields of the IP element, a
- canonicalized form of the element MUST be used. The canonical form
- SHALL have no whitespace (including newline characters) between
- elements and only one space character between attributes. There
- SHALL NOT be a space following the last attribute in an element.
-
- An iterative method SHOULD be used to calculate checksums, as the
- length field will vary based on the size of the checksum.
-
- The payload element bears special attention. Due to the character
- set restrictions of XML, the payload of IP datagrams (which MAY
- contain arbitrary data) MUST be encoded for transport. This RFC
- REQUIRES the contents of the payload to be encoded in the base-64
- encoding of RFC 2045 [RFC2045], but removes the requirement that the
- encoded output MUST be wrapped on 76-character lines.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Kennedy Informational [Page 3]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
-2.2. Example Datagram
-
- The following is an example IPoXML datagram with an empty payload:
-
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE ip PUBLIC "-//IETF//DTD BLOAT 1.0 IP//EN" "bloat.dtd">
- <ip>
- <header length="474">
- <version value="4"/>
- <tos precedence="Routine" delay="Normal" throughput="Normal"
- relibility="Normal" reserved="0"/>
- <total.length value="461"/>
- <id value="1"/>
- <flags reserved="0" df="dont" mf="last"/>
- <offset value="0"/>
- <ttl value="255"/>
- <protocol value="6"/>
- <checksum value="8707"/>
- <source address="10.0.0.22"/>
- <destination address="10.0.0.1"/>
- <options>
- <end copied="0" class="0" number="0"/>
- </options>
- <padding pad="0"/>
- </header>
- <payload>
- </payload>
- </ip>
-
-3. TCPoXML
-
- This protocol MUST be implemented to be compliant with this RFC. The
- DTD for this document type can be found in section 7.2.
-
-3.1. TCP Description
-
- A number of items have changed from the original TCP specification.
- Bit-masks, where present have been converted into human-readable
- values. Length and checksum and port values are present as decimal
- integers.
-
- To calculate the length and checksum fields of the TCP element, a
- canonicalized form of the element MUST be used as in section 2.1.
-
- An iterative method SHOULD be used to calculate checksums as in
- section 2.1.
-
- The payload element MUST be encoded as in section 2.1.
-
-
-
-Kennedy Informational [Page 4]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- The TCP offset element was expanded to a maximum of 255 from 16 to
- allow for the increased size of the header in XML.
-
- TCPoXML datagrams encapsulated by IPoXML MAY omit the <?xml?> header
- as well as the <!DOCTYPE> declaration.
-
-3.2. Example Datagram
-
- The following is an example TCPoXML datagram with an empty payload:
-
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE tcp PUBLIC "-//IETF//DTD BLOAT 1.0 TCP//EN" "bloat.dtd">
- <tcp>
- <tcp.header>
- <src port="31415"/>
- <dest port="42424"/>
- <sequence number="322622954"/>
- <acknowledgement number="689715995"/>
- <offset number=""/>
- <reserved value="0"/>
- <control syn="1" ack="1"/>
- <window size="1"/>
- <urgent pointer="0"/>
- <checksum value="2988"/>
- <tcp.options>
- <tcp.end kind="0"/>
- </tcp.options>
- <padding pad="0"/>
- </tcp.header>
- <payload>
- </payload>
- </tcp>
-
-4. UDPoXML
-
- This protocol MUST be implemented to be compliant with this RFC. The
- DTD for this document type can be found in section 7.3.
-
-4.1. UDP Description
-
- A number of items have changed from the original UDP specification.
- Bit-masks, where present have been converted into human-readable
- values. Length and checksum and port values are present as decimal
- integers.
-
-
-
-
-
-
-
-Kennedy Informational [Page 5]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- To calculate the length and checksum fields of the UDP element, a
- canonicalized form of the element MUST be used as in section 2.1. An
- iterative method SHOULD be used to calculate checksums as in section
- 2.1.
-
- The payload element MUST be encoded as in section 2.1.
-
- UDPoXML datagrams encapsulated by IPoXML MAY omit the <?xml?> header
- as well as the <!DOCTYPE> declaration.
-
-4.2. Example Datagram
-
- The following is an example UDPoXML datagram with an empty payload:
-
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE udp PUBLIC "-//IETF//DTD BLOAT 1.0 UDP//EN" "bloat.dtd">
- <udp>
- <udp.header>
- <src port="31415"/>
- <dest port="42424"/>
- <udp.length value="143"/>
- <checksum value="2988"/>
- </udp.header>
- <payload>
- </payload>
- </udp>
-
-5. Network Transport
-
- This document provides for the transmission of BLOAT datagrams over
- two common families of physical layer transport. Future RFCs will
- address additional transports as routing vendors catch up to the
- specification, and we begin to see BLOAT routed across the Internet
- backbone.
-
-5.1. Ethernet
-
- BLOAT is encapsulated in Ethernet datagrams as in [RFC894] with the
- exception that the type field of the Ethernet frame MUST contain the
- value 0xBEEF. The first 5 octets of the Ethernet frame payload will
- be 0x3c 3f 78 6d 6c ("<?xml".)
-
-5.2. IEEE 802
-
- BLOAT is encapsulated in IEEE 802 Networks as in [RFC1042] except
- that the protocol type code for IPoXML is 0xBEEF.
-
-
-
-
-
-Kennedy Informational [Page 6]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
-6. Gatewaying over IP
-
- In order to facilitate the gradual introduction of BLOAT into the
- public Internet, BLOAT MAY be encapsulated in IP as in [RFC2003] to
- gateway between networks that run BLOAT natively on their LANs.
-
-7. DTDs
-
- The Transport DTDs (7.2. and 7.3.) build on the definitions in the
- Network DTD (7.1.)
-
- The DTDs are referenced by their PubidLiteral and SystemLiteral (from
- [XML]) although it is understood that most IPoXML implementations
- will not need to pull down the DTD, as it will normally be embedded
- in the implementation, and presents something of a catch-22 if you
- need to load part of your network protocol over the network.
-
-7.1. IPoXML DTD
-
- <!--
- DTD for IP over XML.
- Refer to this DTD as:
-
- <!DOCTYPE ip PUBLIC "-//IETF//DTD BLOAT 1.0 IP//EN" "bloat.dtd">
- -->
- <!--
- DTD data types:
-
- Digits [0..9]+
-
- Precedence "NetworkControl | InternetworkControl |
- CRITIC | FlashOverride | Flash | Immediate |
- Priority | Routine"
-
- IP4Addr "dotted-decimal" notation of [RFC1123]
-
- Class [0..3]
-
- Sec "Unclassified | Confidential | EFTO | MMMM | PROG |
- Restricted | Secret | Top Secret | Reserved"
-
- Compartments [0..65535]
-
- Handling [0..65535]
-
- TCC [0..16777216]
-
- -->
-
-
-
-Kennedy Informational [Page 7]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- <!ENTITY % Digits "CDATA">
- <!ENTITY % Precedence "CDATA">
- <!ENTITY % IP4Addr "CDATA">
- <!ENTITY % Class "CDATA">
- <!ENTITY % Sec "CDATA">
- <!ENTITY % Compartments "CDATA">
- <!ENTITY % Handling "CDATA">
- <!ENTITY % TCC "CDATA">
-
- <!ELEMENT ip (header, payload)>
-
- <!ELEMENT header (version, tos, total.length, id, flags, offset, ttl,
- protocol, checksum, source, destination, options,
- padding)>
- <!-- length of header in 32-bit words -->
- <!ATTLIST header
- length %Digits; #REQUIRED>
-
- <!ELEMENT version EMPTY>
- <!-- ip version. SHOULD be "4" -->
- <!ATTLIST version
- value %Digits; #REQUIRED>
-
- <!ELEMENT tos EMPTY>
- <!ATTLIST tos
- precedence %Precedence; #REQUIRED
- delay (normal | low) #REQUIRED
- throughput (normal | high) #REQUIRED
- relibility (normal | high) #REQUIRED
- reserved CDATA #FIXED "0">
-
- <!ELEMENT total.length EMPTY>
- <!--
- total length of datagram (header and payload) in octets, MUST be
- less than 65,535 (and SHOULD be less than 1024 for IPoXML on local
- ethernets).
- -->
- <!ATTLIST total.length
- value %Digits; #REQUIRED>
-
- <!ELEMENT id EMPTY>
- <!-- 0 <= id <= 65,535 -->
- <!ATTLIST id
- value %Digits; #REQUIRED>
-
- <!ELEMENT flags EMPTY>
- <!-- df = don't fragment, mf = more fragments -->
- <!ATTLIST flags
-
-
-
-Kennedy Informational [Page 8]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- reserved CDATA #FIXED "0"
- df (may|dont) #REQUIRED
- mf (last|more) #REQUIRED>
-
- <!ELEMENT offset EMPTY>
- <!-- 0 <= offset <= 8192 measured in 8 octet (64-bit) chunks -->
- <!ATTLIST offset
- value %Digits; #REQUIRED>
-
- <!ELEMENT ttl EMPTY>
- <!-- 0 <= ttl <= 255 -->
- <!ATTLIST ttl
- value %Digits; #REQUIRED>
-
- <!ELEMENT protocol EMPTY>
- <!-- 0 <= protocol <= 255 (per IANA) -->
- <!ATTLIST protocol
- value %Digits; #REQUIRED>
-
- <!ELEMENT checksum EMPTY>
- <!-- 0 <= checksum <= 65535 (over header only) -->
- <!ATTLIST checksum
- value %Digits; #REQUIRED>
-
- <!ELEMENT source EMPTY>
- <!ATTLIST source
- address %IP4Addr; #REQUIRED>
-
- <!ELEMENT destination EMPTY>
- <!ATTLIST destination
- address %IP4Addr; #REQUIRED>
-
- <!ELEMENT options ( end | noop | security | loose | strict | record
- | stream | timestamp )*>
-
- <!ELEMENT end EMPTY>
- <!ATTLIST end
- copied (0|1) #REQUIRED
- class CDATA #FIXED "0"
- number CDATA #FIXED "0">
-
- <!ELEMENT noop EMPTY>
- <!ATTLIST noop
- copied (0|1) #REQUIRED
- class CDATA #FIXED "0"
- number CDATA #FIXED "1">
-
- <!ELEMENT security EMPTY>
-
-
-
-Kennedy Informational [Page 9]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- <!ATTLIST security
- copied CDATA #FIXED "1"
- class CDATA #FIXED "0"
- number CDATA #FIXED "2"
- length CDATA #FIXED "11"
- security %Sec; #REQUIRED
- compartments %Compartments; #REQUIRED
- handling %Handling; #REQUIRED
- tcc %TCC; #REQUIRED>
- <!ELEMENT loose (hop)+>
- <!ATTLIST loose
- copied CDATA #FIXED "1"
- class CDATA #FIXED "0"
- number CDATA #FIXED "3"
- length %Digits; #REQUIRED
- pointer %Digits; #REQUIRED>
-
- <!ELEMENT hop EMPTY>
- <!ATTLIST hop
- address %IP4Addr; #REQUIRED>
-
- <!ELEMENT strict (hop)+>
- <!ATTLIST strict
- copied CDATA #FIXED "1"
- class CDATA #FIXED "0"
- number CDATA #FIXED "9"
- length %Digits; #REQUIRED
- pointer %Digits; #REQUIRED>
-
- <!ELEMENT record (hop)+>
- <!ATTLIST record
- copied CDATA #FIXED "0"
- class CDATA #FIXED "0"
- number CDATA #FIXED "7"
- length %Digits; #REQUIRED
- pointer %Digits; #REQUIRED>
-
- <!ELEMENT stream EMPTY>
- <!-- 0 <= id <= 65,535 -->
- <!ATTLIST stream
- copied CDATA #FIXED "1"
- class CDATA #FIXED "0"
- number CDATA #FIXED "8"
- length CDATA #FIXED "4"
- id %Digits; #REQUIRED>
-
- <!ELEMENT timestamp (tstamp)+>
- <!-- 0 <= oflw <=15 -->
-
-
-
-Kennedy Informational [Page 10]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- <!ATTLIST timestamp
- copied CDATA #FIXED "0"
- class CDATA #FIXED "2"
- number CDATA #FIXED "4"
- length %Digits; #REQUIRED
- pointer %Digits; #REQUIRED
- oflw %Digits; #REQUIRED
- flag (0 | 1 | 3) #REQUIRED>
-
- <!ELEMENT tstamp EMPTY>
- <!ATTLIST tstamp
- time %Digits; #REQUIRED
- address %IP4Addr; #IMPLIED>
- <!--
- padding to bring header to 32-bit boundary.
- pad MUST be "0"*
- -->
- <!ELEMENT padding EMPTY>
- <!ATTLIST padding
- pad CDATA #REQUIRED>
-
- <!-- payload MUST be encoded as base-64 [RFC2045], as modified
- by section 2.1 of this RFC -->
- <!ELEMENT payload (CDATA)>
-
-7.2. TCPoXML DTD
-
- <!--
- DTD for TCP over XML.
- Refer to this DTD as:
-
- <!DOCTYPE tcp PUBLIC "-//IETF//DTD BLOAT 1.0 TCP//EN" "bloat.dtd">
- -->
-
- <!-- the pseudoheader is only included for checksum calculations -->
- <!ELEMENT tcp (tcp.pseudoheader?, tcp.header, payload)>
-
- <!ELEMENT tcp.header (src, dest, sequence, acknowledgement, offset,
- reserved, control, window, checksum, urgent,
- tcp.options, padding)>
-
- <!ELEMENT src EMPTY>
- <!-- 0 <= port <= 65,535 -->
- <!ATTLIST src
- port %Digits; #REQUIRED>
-
- <!ELEMENT dest EMPTY>
- <!-- 0 <= port <= 65,535 -->
-
-
-
-Kennedy Informational [Page 11]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- <!ATTLIST dest
- port %Digits; #REQUIRED>
-
- <!ELEMENT sequence EMPTY>
- <!-- 0 <= number <= 4294967295 -->
- <!ATTLIST sequence
- number %Digits; #REQUIRED>
-
- <!ELEMENT acknowledgement EMPTY>
- <!-- 0 <= number <= 4294967295 -->
- <!ATTLIST acknowledgement
- number %Digits; #REQUIRED>
-
- <!ELEMENT offset EMPTY>
- <!-- 0 <= number <= 255 -->
- <!ATTLIST offset
- number %Digits; #REQUIRED>
-
- <!ELEMENT reserved EMPTY>
- <!ATTLIST reserved
- value CDATA #FIXED "0">
-
- <!ELEMENT control EMPTY>
- <!ATTLIST control
- urg (0|1) #IMPLIED
- ack (0|1) #IMPLIED
- psh (0|1) #IMPLIED
- rst (0|1) #IMPLIED
- syn (0|1) #IMPLIED
- fin (0|1) #IMPLIED>
-
- <!ELEMENT window EMPTY>
- <!-- 0 <= size <= 65,535 -->
- <!ATTLIST window
- size %Digits; #REQUIRED>
-
- <!--
- checksum as in ip, but with
- the following pseudo-header added into the tcp element:
- -->
- <!ELEMENT tcp.pseudoheader (source, destination, protocol,
- tcp.length)>
-
- <!--
- tcp header + data length in octets. does not include the size of
-
- the pseudoheader.
- -->
-
-
-
-Kennedy Informational [Page 12]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- <!ELEMENT tcp.length EMPTY>
- <!ATTLIST tcp.length
- value %Digits; #REQUIRED>
-
- <!ELEMENT urgent EMPTY>
- <!-- 0 <= pointer <= 65,535 -->
- <!ATTLIST urgent
- pointer %Digits; #REQUIRED>
-
- <!ELEMENT tcp.options (tcp.end | tcp.noop | tcp.mss)+>
-
- <!ELEMENT tcp.end EMPTY>
- <!ATTLIST tcp.end
- kind CDATA #FIXED "0">
-
- <!ELEMENT tcp.noop EMPTY>
- <!ATTLIST tcp.noop
- kind CDATA #FIXED "1">
-
- <!ELEMENT tcp.mss EMPTY>
- <!ATTLIST tcp.mss
- kind CDATA #FIXED "2"
- length CDATA #FIXED "4"
- size %Digits; #REQUIRED>
-
-7.3. UDPoXML DTD
-
- <!--
- DTD for UDP over XML.
- Refer to this DTD as:
-
- <!DOCTYPE udp PUBLIC "-//IETF//DTD BLOAT 1.0 UDP//EN" "bloat.dtd">
- -->
-
- <!ELEMENT udp (udp.pseudoheader?, udp.header, payload)>
-
- <!ELEMENT udp.header (src, dest, udp.length, checksum)>
-
- <!ELEMENT udp.pseudoheader (source, destination, protocol,
- udp.length)>
-
- <!--
- udp header + data length in octets. does not include the size of
- the pseudoheader.
- -->
- <!ELEMENT udp.length EMPTY>
- <!ATTLIST udp.length
- value %Digits; #REQUIRED>
-
-
-
-Kennedy Informational [Page 13]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
-8. Security Considerations
-
- XML, as a subset of SGML, has the same security considerations as
- specified in SGML Media Types [RFC1874]. Security considerations
- that apply to IP, TCP and UDP also likely apply to BLOAT as it does
- not attempt to correct for issues not related to message format.
-
-9. References
-
- [JABBER] Miller, J., "Jabber", draft-miller-jabber-00.txt,
- February 2002. (Work in Progress)
-
- [RFC768] Postel, J., "User Datagram Protocol", STD 6, RFC 768,
- August 1980.
-
- [RFC791] Postel, J., "Internet Protocol", STD 5, RFC 791,
- September 1981.
-
- [RFC793] Postel, J., "Transmission Control Protocol", STD 7, RFC
- 793, September 1981.
-
- [RFC894] Hornig, C., "Standard for the Transmission of IP
- Datagrams over Ethernet Networks.", RFC 894, April 1984.
-
- [RFC1042] Postel, J. and J. Reynolds, "Standard for the
- Transmission of IP Datagrams Over IEEE 802 Networks", STD
- 43, RFC 1042, February 1988.
-
- [RFC1123] Braden, R., "Requirements for Internet Hosts -
- Application and Support", RFC 1123, October 1989.
-
- [RFC1874] Levinson, E., "SGML Media Types", RFC 1874, December
- 1995.
-
- [RFC2003] Perkins, C., "IP Encapsulation within IP", RFC 2003,
- October 1996.
-
- [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
- Extensions (MIME) Part One: Format of Internet Message
- Bodies", RFC 2045, November 1996.
-
- [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
- Requirement Levels", BCP 14, RFC 2119, March 1997.
-
- [RFC2279] Yergeau, F., "UTF-8, a transformation format of ISO
- 10646", RFC 2279, January 1998.
-
-
-
-
-
-Kennedy Informational [Page 14]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6
- (IPv6) Specification", RFC 2460, December 1998.
-
- [RFC3080] Rose, M., "The Blocks Extensible Exchange Protocol Core",
- RFC 3080, March 2001.
-
- [SOAP] Box, D., Ehnebuske, D., Kakivaya, G., Layman, A.,
- Mendelsohn, N., Nielsen, H. F., Thatte, S. Winer, D.,
- "Simple Object Access Protocol (SOAP) 1.1" World Wide Web
- Consortium Note, May 2000 http://www.w3.org/TR/SOAP/
-
- [XML] Bray, T., Paoli, J., Sperberg-McQueen, C. M., "Extensible
- Markup Language (XML)" World Wide Web Consortium
- Recommendation REC- xml-19980210.
- http://www.w3.org/TR/1998/REC-xml-19980210
-
-10. Author's Address
-
- Hugh Kennedy
- Mimezine
- 1060 West Addison
- Chicago, IL 60613
- USA
-
- EMail: kennedyh@engin.umich.edu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Kennedy Informational [Page 15]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
-11. Full Copyright Statement
-
- Copyright (C) The Internet Society (2002). All Rights Reserved.
-
- This document and translations of it may be copied and furnished to
- others, and derivative works that comment on or otherwise explain it
- or assist in its implementation may be prepared, copied, published
- and distributed, in whole or in part, without restriction of any
- kind, provided that the above copyright notice and this paragraph are
- included on all such copies and derivative works. However, this
- document itself may not be modified in any way, such as by removing
- the copyright notice or references to the Internet Society or other
- Internet organizations, except as needed for the purpose of
- developing Internet standards in which case the procedures for
- copyrights defined in the Internet Standards process must be
- followed, or as required to translate it into languages other than
- English.
-
- The limited permissions granted above are perpetual and will not be
- revoked by the Internet Society or its successors or assigns.
-
- This document and the information contained herein is provided on an
- "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
- TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
- BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
- HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-
-Acknowledgement
-
- Funding for the RFC Editor function is currently provided by the
- Internet Society.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Kennedy Informational [Page 16]
-
diff --git a/tests/auto/network/access/qhttp/webserver/rfc3252.txt b/tests/auto/network/access/qhttp/webserver/rfc3252.txt
deleted file mode 100644
index b80c61bf0a..0000000000
--- a/tests/auto/network/access/qhttp/webserver/rfc3252.txt
+++ /dev/null
@@ -1,899 +0,0 @@
-
-
-
-
-
-
-Network Working Group H. Kennedy
-Request for Comments: 3252 Mimezine
-Category: Informational 1 April 2002
-
-
- Binary Lexical Octet Ad-hoc Transport
-
-Status of this Memo
-
- This memo provides information for the Internet community. It does
- not specify an Internet standard of any kind. Distribution of this
- memo is unlimited.
-
-Copyright Notice
-
- Copyright (C) The Internet Society (2002). All Rights Reserved.
-
-Abstract
-
- This document defines a reformulation of IP and two transport layer
- protocols (TCP and UDP) as XML applications.
-
-1. Introduction
-
-1.1. Overview
-
- This document describes the Binary Lexical Octet Ad-hoc Transport
- (BLOAT): a reformulation of a widely-deployed network-layer protocol
- (IP [RFC791]), and two associated transport layer protocols (TCP
- [RFC793] and UDP [RFC768]) as XML [XML] applications. It also
- describes methods for transporting BLOAT over Ethernet and IEEE 802
- networks as well as encapsulating BLOAT in IP for gatewaying BLOAT
- across the public Internet.
-
-1.2. Motivation
-
- The wild popularity of XML as a basis for application-level protocols
- such as the Blocks Extensible Exchange Protocol [RFC3080], the Simple
- Object Access Protocol [SOAP], and Jabber [JABBER] prompted
- investigation into the possibility of extending the use of XML in the
- protocol stack. Using XML at both the transport and network layer in
- addition to the application layer would provide for an amazing amount
- of power and flexibility while removing dependencies on proprietary
- and hard-to-understand binary protocols. This protocol unification
- would also allow applications to use a single XML parser for all
- aspects of their operation, eliminating developer time spent figuring
- out the intricacies of each new protocol, and moving the hard work of
-
-
-
-
-Kennedy Informational [Page 1]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- parsing to the XML toolset. The use of XML also mitigates concerns
- over "network vs. host" byte ordering which is at the root of many
- network application bugs.
-
-1.3. Relation to Existing Protocols
-
- The reformulations specified in this RFC follow as closely as
- possible the spirit of the RFCs on which they are based, and so MAY
- contain elements or attributes that would not be needed in a pure
- reworking (e.g. length attributes, which are implicit in XML.)
-
- The layering of network and transport protocols are maintained in
- this RFC despite the optimizations that could be made if the line
- were somewhat blurred (i.e. merging TCP and IP into a single, larger
- element in the DTD) in order to foster future use of this protocol as
- a basis for reformulating other protocols (such as ICMP.)
-
- Other than the encoding, the behavioral aspects of each of the
- existing protocols remain unchanged. Routing, address spaces, TCP
- congestion control, etc. behave as specified in the extant standards.
- Adapting to new standards and experimental algorithm heuristics for
- improving performance will become much easier once the move to BLOAT
- has been completed.
-
-1.4. Requirement Levels
-
- The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
- "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
- document are to be interpreted as described in BCP 14, RFC 2119
- [RFC2119].
-
-2. IPoXML
-
- This protocol MUST be implemented to be compliant with this RFC.
- IPoXML is the root protocol REQUIRED for effective use of TCPoXML
- (section 3.) and higher-level application protocols.
-
- The DTD for this document type can be found in section 7.1.
-
- The routing of IPoXML can be easily implemented on hosts with an XML
- parser, as the regular structure lends itself handily to parsing and
- validation of the document/datagram and then processing the
- destination address, TTL, and checksum before sending it on to its
- next-hop.
-
- The reformulation of IPv4 was chosen over IPv6 [RFC2460] due to the
- wider deployment of IPv4 and the fact that implementing IPv6 as XML
- would have exceeded the 1500 byte Ethernet MTU.
-
-
-
-Kennedy Informational [Page 2]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- All BLOAT implementations MUST use - and specify - the UTF-8 encoding
- of RFC 2279 [RFC2279]. All BLOAT document/datagrams MUST be well-
- formed and include the XMLDecl.
-
-2.1. IP Description
-
- A number of items have changed (for the better) from the original IP
- specification. Bit-masks, where present have been converted into
- human-readable values. IP addresses are listed in their dotted-
- decimal notation [RFC1123]. Length and checksum values are present
- as decimal integers.
-
- To calculate the length and checksum fields of the IP element, a
- canonicalized form of the element MUST be used. The canonical form
- SHALL have no whitespace (including newline characters) between
- elements and only one space character between attributes. There
- SHALL NOT be a space following the last attribute in an element.
-
- An iterative method SHOULD be used to calculate checksums, as the
- length field will vary based on the size of the checksum.
-
- The payload element bears special attention. Due to the character
- set restrictions of XML, the payload of IP datagrams (which MAY
- contain arbitrary data) MUST be encoded for transport. This RFC
- REQUIRES the contents of the payload to be encoded in the base-64
- encoding of RFC 2045 [RFC2045], but removes the requirement that the
- encoded output MUST be wrapped on 76-character lines.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Kennedy Informational [Page 3]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
-2.2. Example Datagram
-
- The following is an example IPoXML datagram with an empty payload:
-
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE ip PUBLIC "-//IETF//DTD BLOAT 1.0 IP//EN" "bloat.dtd">
- <ip>
- <header length="474">
- <version value="4"/>
- <tos precedence="Routine" delay="Normal" throughput="Normal"
- relibility="Normal" reserved="0"/>
- <total.length value="461"/>
- <id value="1"/>
- <flags reserved="0" df="dont" mf="last"/>
- <offset value="0"/>
- <ttl value="255"/>
- <protocol value="6"/>
- <checksum value="8707"/>
- <source address="10.0.0.22"/>
- <destination address="10.0.0.1"/>
- <options>
- <end copied="0" class="0" number="0"/>
- </options>
- <padding pad="0"/>
- </header>
- <payload>
- </payload>
- </ip>
-
-3. TCPoXML
-
- This protocol MUST be implemented to be compliant with this RFC. The
- DTD for this document type can be found in section 7.2.
-
-3.1. TCP Description
-
- A number of items have changed from the original TCP specification.
- Bit-masks, where present have been converted into human-readable
- values. Length and checksum and port values are present as decimal
- integers.
-
- To calculate the length and checksum fields of the TCP element, a
- canonicalized form of the element MUST be used as in section 2.1.
-
- An iterative method SHOULD be used to calculate checksums as in
- section 2.1.
-
- The payload element MUST be encoded as in section 2.1.
-
-
-
-Kennedy Informational [Page 4]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- The TCP offset element was expanded to a maximum of 255 from 16 to
- allow for the increased size of the header in XML.
-
- TCPoXML datagrams encapsulated by IPoXML MAY omit the <?xml?> header
- as well as the <!DOCTYPE> declaration.
-
-3.2. Example Datagram
-
- The following is an example TCPoXML datagram with an empty payload:
-
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE tcp PUBLIC "-//IETF//DTD BLOAT 1.0 TCP//EN" "bloat.dtd">
- <tcp>
- <tcp.header>
- <src port="31415"/>
- <dest port="42424"/>
- <sequence number="322622954"/>
- <acknowledgement number="689715995"/>
- <offset number=""/>
- <reserved value="0"/>
- <control syn="1" ack="1"/>
- <window size="1"/>
- <urgent pointer="0"/>
- <checksum value="2988"/>
- <tcp.options>
- <tcp.end kind="0"/>
- </tcp.options>
- <padding pad="0"/>
- </tcp.header>
- <payload>
- </payload>
- </tcp>
-
-4. UDPoXML
-
- This protocol MUST be implemented to be compliant with this RFC. The
- DTD for this document type can be found in section 7.3.
-
-4.1. UDP Description
-
- A number of items have changed from the original UDP specification.
- Bit-masks, where present have been converted into human-readable
- values. Length and checksum and port values are present as decimal
- integers.
-
-
-
-
-
-
-
-Kennedy Informational [Page 5]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- To calculate the length and checksum fields of the UDP element, a
- canonicalized form of the element MUST be used as in section 2.1. An
- iterative method SHOULD be used to calculate checksums as in section
- 2.1.
-
- The payload element MUST be encoded as in section 2.1.
-
- UDPoXML datagrams encapsulated by IPoXML MAY omit the <?xml?> header
- as well as the <!DOCTYPE> declaration.
-
-4.2. Example Datagram
-
- The following is an example UDPoXML datagram with an empty payload:
-
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE udp PUBLIC "-//IETF//DTD BLOAT 1.0 UDP//EN" "bloat.dtd">
- <udp>
- <udp.header>
- <src port="31415"/>
- <dest port="42424"/>
- <udp.length value="143"/>
- <checksum value="2988"/>
- </udp.header>
- <payload>
- </payload>
- </udp>
-
-5. Network Transport
-
- This document provides for the transmission of BLOAT datagrams over
- two common families of physical layer transport. Future RFCs will
- address additional transports as routing vendors catch up to the
- specification, and we begin to see BLOAT routed across the Internet
- backbone.
-
-5.1. Ethernet
-
- BLOAT is encapsulated in Ethernet datagrams as in [RFC894] with the
- exception that the type field of the Ethernet frame MUST contain the
- value 0xBEEF. The first 5 octets of the Ethernet frame payload will
- be 0x3c 3f 78 6d 6c ("<?xml".)
-
-5.2. IEEE 802
-
- BLOAT is encapsulated in IEEE 802 Networks as in [RFC1042] except
- that the protocol type code for IPoXML is 0xBEEF.
-
-
-
-
-
-Kennedy Informational [Page 6]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
-6. Gatewaying over IP
-
- In order to facilitate the gradual introduction of BLOAT into the
- public Internet, BLOAT MAY be encapsulated in IP as in [RFC2003] to
- gateway between networks that run BLOAT natively on their LANs.
-
-7. DTDs
-
- The Transport DTDs (7.2. and 7.3.) build on the definitions in the
- Network DTD (7.1.)
-
- The DTDs are referenced by their PubidLiteral and SystemLiteral (from
- [XML]) although it is understood that most IPoXML implementations
- will not need to pull down the DTD, as it will normally be embedded
- in the implementation, and presents something of a catch-22 if you
- need to load part of your network protocol over the network.
-
-7.1. IPoXML DTD
-
- <!--
- DTD for IP over XML.
- Refer to this DTD as:
-
- <!DOCTYPE ip PUBLIC "-//IETF//DTD BLOAT 1.0 IP//EN" "bloat.dtd">
- -->
- <!--
- DTD data types:
-
- Digits [0..9]+
-
- Precedence "NetworkControl | InternetworkControl |
- CRITIC | FlashOverride | Flash | Immediate |
- Priority | Routine"
-
- IP4Addr "dotted-decimal" notation of [RFC1123]
-
- Class [0..3]
-
- Sec "Unclassified | Confidential | EFTO | MMMM | PROG |
- Restricted | Secret | Top Secret | Reserved"
-
- Compartments [0..65535]
-
- Handling [0..65535]
-
- TCC [0..16777216]
-
- -->
-
-
-
-Kennedy Informational [Page 7]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- <!ENTITY % Digits "CDATA">
- <!ENTITY % Precedence "CDATA">
- <!ENTITY % IP4Addr "CDATA">
- <!ENTITY % Class "CDATA">
- <!ENTITY % Sec "CDATA">
- <!ENTITY % Compartments "CDATA">
- <!ENTITY % Handling "CDATA">
- <!ENTITY % TCC "CDATA">
-
- <!ELEMENT ip (header, payload)>
-
- <!ELEMENT header (version, tos, total.length, id, flags, offset, ttl,
- protocol, checksum, source, destination, options,
- padding)>
- <!-- length of header in 32-bit words -->
- <!ATTLIST header
- length %Digits; #REQUIRED>
-
- <!ELEMENT version EMPTY>
- <!-- ip version. SHOULD be "4" -->
- <!ATTLIST version
- value %Digits; #REQUIRED>
-
- <!ELEMENT tos EMPTY>
- <!ATTLIST tos
- precedence %Precedence; #REQUIRED
- delay (normal | low) #REQUIRED
- throughput (normal | high) #REQUIRED
- relibility (normal | high) #REQUIRED
- reserved CDATA #FIXED "0">
-
- <!ELEMENT total.length EMPTY>
- <!--
- total length of datagram (header and payload) in octets, MUST be
- less than 65,535 (and SHOULD be less than 1024 for IPoXML on local
- ethernets).
- -->
- <!ATTLIST total.length
- value %Digits; #REQUIRED>
-
- <!ELEMENT id EMPTY>
- <!-- 0 <= id <= 65,535 -->
- <!ATTLIST id
- value %Digits; #REQUIRED>
-
- <!ELEMENT flags EMPTY>
- <!-- df = don't fragment, mf = more fragments -->
- <!ATTLIST flags
-
-
-
-Kennedy Informational [Page 8]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- reserved CDATA #FIXED "0"
- df (may|dont) #REQUIRED
- mf (last|more) #REQUIRED>
-
- <!ELEMENT offset EMPTY>
- <!-- 0 <= offset <= 8192 measured in 8 octet (64-bit) chunks -->
- <!ATTLIST offset
- value %Digits; #REQUIRED>
-
- <!ELEMENT ttl EMPTY>
- <!-- 0 <= ttl <= 255 -->
- <!ATTLIST ttl
- value %Digits; #REQUIRED>
-
- <!ELEMENT protocol EMPTY>
- <!-- 0 <= protocol <= 255 (per IANA) -->
- <!ATTLIST protocol
- value %Digits; #REQUIRED>
-
- <!ELEMENT checksum EMPTY>
- <!-- 0 <= checksum <= 65535 (over header only) -->
- <!ATTLIST checksum
- value %Digits; #REQUIRED>
-
- <!ELEMENT source EMPTY>
- <!ATTLIST source
- address %IP4Addr; #REQUIRED>
-
- <!ELEMENT destination EMPTY>
- <!ATTLIST destination
- address %IP4Addr; #REQUIRED>
-
- <!ELEMENT options ( end | noop | security | loose | strict | record
- | stream | timestamp )*>
-
- <!ELEMENT end EMPTY>
- <!ATTLIST end
- copied (0|1) #REQUIRED
- class CDATA #FIXED "0"
- number CDATA #FIXED "0">
-
- <!ELEMENT noop EMPTY>
- <!ATTLIST noop
- copied (0|1) #REQUIRED
- class CDATA #FIXED "0"
- number CDATA #FIXED "1">
-
- <!ELEMENT security EMPTY>
-
-
-
-Kennedy Informational [Page 9]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- <!ATTLIST security
- copied CDATA #FIXED "1"
- class CDATA #FIXED "0"
- number CDATA #FIXED "2"
- length CDATA #FIXED "11"
- security %Sec; #REQUIRED
- compartments %Compartments; #REQUIRED
- handling %Handling; #REQUIRED
- tcc %TCC; #REQUIRED>
- <!ELEMENT loose (hop)+>
- <!ATTLIST loose
- copied CDATA #FIXED "1"
- class CDATA #FIXED "0"
- number CDATA #FIXED "3"
- length %Digits; #REQUIRED
- pointer %Digits; #REQUIRED>
-
- <!ELEMENT hop EMPTY>
- <!ATTLIST hop
- address %IP4Addr; #REQUIRED>
-
- <!ELEMENT strict (hop)+>
- <!ATTLIST strict
- copied CDATA #FIXED "1"
- class CDATA #FIXED "0"
- number CDATA #FIXED "9"
- length %Digits; #REQUIRED
- pointer %Digits; #REQUIRED>
-
- <!ELEMENT record (hop)+>
- <!ATTLIST record
- copied CDATA #FIXED "0"
- class CDATA #FIXED "0"
- number CDATA #FIXED "7"
- length %Digits; #REQUIRED
- pointer %Digits; #REQUIRED>
-
- <!ELEMENT stream EMPTY>
- <!-- 0 <= id <= 65,535 -->
- <!ATTLIST stream
- copied CDATA #FIXED "1"
- class CDATA #FIXED "0"
- number CDATA #FIXED "8"
- length CDATA #FIXED "4"
- id %Digits; #REQUIRED>
-
- <!ELEMENT timestamp (tstamp)+>
- <!-- 0 <= oflw <=15 -->
-
-
-
-Kennedy Informational [Page 10]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- <!ATTLIST timestamp
- copied CDATA #FIXED "0"
- class CDATA #FIXED "2"
- number CDATA #FIXED "4"
- length %Digits; #REQUIRED
- pointer %Digits; #REQUIRED
- oflw %Digits; #REQUIRED
- flag (0 | 1 | 3) #REQUIRED>
-
- <!ELEMENT tstamp EMPTY>
- <!ATTLIST tstamp
- time %Digits; #REQUIRED
- address %IP4Addr; #IMPLIED>
- <!--
- padding to bring header to 32-bit boundary.
- pad MUST be "0"*
- -->
- <!ELEMENT padding EMPTY>
- <!ATTLIST padding
- pad CDATA #REQUIRED>
-
- <!-- payload MUST be encoded as base-64 [RFC2045], as modified
- by section 2.1 of this RFC -->
- <!ELEMENT payload (CDATA)>
-
-7.2. TCPoXML DTD
-
- <!--
- DTD for TCP over XML.
- Refer to this DTD as:
-
- <!DOCTYPE tcp PUBLIC "-//IETF//DTD BLOAT 1.0 TCP//EN" "bloat.dtd">
- -->
-
- <!-- the pseudoheader is only included for checksum calculations -->
- <!ELEMENT tcp (tcp.pseudoheader?, tcp.header, payload)>
-
- <!ELEMENT tcp.header (src, dest, sequence, acknowledgement, offset,
- reserved, control, window, checksum, urgent,
- tcp.options, padding)>
-
- <!ELEMENT src EMPTY>
- <!-- 0 <= port <= 65,535 -->
- <!ATTLIST src
- port %Digits; #REQUIRED>
-
- <!ELEMENT dest EMPTY>
- <!-- 0 <= port <= 65,535 -->
-
-
-
-Kennedy Informational [Page 11]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- <!ATTLIST dest
- port %Digits; #REQUIRED>
-
- <!ELEMENT sequence EMPTY>
- <!-- 0 <= number <= 4294967295 -->
- <!ATTLIST sequence
- number %Digits; #REQUIRED>
-
- <!ELEMENT acknowledgement EMPTY>
- <!-- 0 <= number <= 4294967295 -->
- <!ATTLIST acknowledgement
- number %Digits; #REQUIRED>
-
- <!ELEMENT offset EMPTY>
- <!-- 0 <= number <= 255 -->
- <!ATTLIST offset
- number %Digits; #REQUIRED>
-
- <!ELEMENT reserved EMPTY>
- <!ATTLIST reserved
- value CDATA #FIXED "0">
-
- <!ELEMENT control EMPTY>
- <!ATTLIST control
- urg (0|1) #IMPLIED
- ack (0|1) #IMPLIED
- psh (0|1) #IMPLIED
- rst (0|1) #IMPLIED
- syn (0|1) #IMPLIED
- fin (0|1) #IMPLIED>
-
- <!ELEMENT window EMPTY>
- <!-- 0 <= size <= 65,535 -->
- <!ATTLIST window
- size %Digits; #REQUIRED>
-
- <!--
- checksum as in ip, but with
- the following pseudo-header added into the tcp element:
- -->
- <!ELEMENT tcp.pseudoheader (source, destination, protocol,
- tcp.length)>
-
- <!--
- tcp header + data length in octets. does not include the size of
-
- the pseudoheader.
- -->
-
-
-
-Kennedy Informational [Page 12]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- <!ELEMENT tcp.length EMPTY>
- <!ATTLIST tcp.length
- value %Digits; #REQUIRED>
-
- <!ELEMENT urgent EMPTY>
- <!-- 0 <= pointer <= 65,535 -->
- <!ATTLIST urgent
- pointer %Digits; #REQUIRED>
-
- <!ELEMENT tcp.options (tcp.end | tcp.noop | tcp.mss)+>
-
- <!ELEMENT tcp.end EMPTY>
- <!ATTLIST tcp.end
- kind CDATA #FIXED "0">
-
- <!ELEMENT tcp.noop EMPTY>
- <!ATTLIST tcp.noop
- kind CDATA #FIXED "1">
-
- <!ELEMENT tcp.mss EMPTY>
- <!ATTLIST tcp.mss
- kind CDATA #FIXED "2"
- length CDATA #FIXED "4"
- size %Digits; #REQUIRED>
-
-7.3. UDPoXML DTD
-
- <!--
- DTD for UDP over XML.
- Refer to this DTD as:
-
- <!DOCTYPE udp PUBLIC "-//IETF//DTD BLOAT 1.0 UDP//EN" "bloat.dtd">
- -->
-
- <!ELEMENT udp (udp.pseudoheader?, udp.header, payload)>
-
- <!ELEMENT udp.header (src, dest, udp.length, checksum)>
-
- <!ELEMENT udp.pseudoheader (source, destination, protocol,
- udp.length)>
-
- <!--
- udp header + data length in octets. does not include the size of
- the pseudoheader.
- -->
- <!ELEMENT udp.length EMPTY>
- <!ATTLIST udp.length
- value %Digits; #REQUIRED>
-
-
-
-Kennedy Informational [Page 13]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
-8. Security Considerations
-
- XML, as a subset of SGML, has the same security considerations as
- specified in SGML Media Types [RFC1874]. Security considerations
- that apply to IP, TCP and UDP also likely apply to BLOAT as it does
- not attempt to correct for issues not related to message format.
-
-9. References
-
- [JABBER] Miller, J., "Jabber", draft-miller-jabber-00.txt,
- February 2002. (Work in Progress)
-
- [RFC768] Postel, J., "User Datagram Protocol", STD 6, RFC 768,
- August 1980.
-
- [RFC791] Postel, J., "Internet Protocol", STD 5, RFC 791,
- September 1981.
-
- [RFC793] Postel, J., "Transmission Control Protocol", STD 7, RFC
- 793, September 1981.
-
- [RFC894] Hornig, C., "Standard for the Transmission of IP
- Datagrams over Ethernet Networks.", RFC 894, April 1984.
-
- [RFC1042] Postel, J. and J. Reynolds, "Standard for the
- Transmission of IP Datagrams Over IEEE 802 Networks", STD
- 43, RFC 1042, February 1988.
-
- [RFC1123] Braden, R., "Requirements for Internet Hosts -
- Application and Support", RFC 1123, October 1989.
-
- [RFC1874] Levinson, E., "SGML Media Types", RFC 1874, December
- 1995.
-
- [RFC2003] Perkins, C., "IP Encapsulation within IP", RFC 2003,
- October 1996.
-
- [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
- Extensions (MIME) Part One: Format of Internet Message
- Bodies", RFC 2045, November 1996.
-
- [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
- Requirement Levels", BCP 14, RFC 2119, March 1997.
-
- [RFC2279] Yergeau, F., "UTF-8, a transformation format of ISO
- 10646", RFC 2279, January 1998.
-
-
-
-
-
-Kennedy Informational [Page 14]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
- [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6
- (IPv6) Specification", RFC 2460, December 1998.
-
- [RFC3080] Rose, M., "The Blocks Extensible Exchange Protocol Core",
- RFC 3080, March 2001.
-
- [SOAP] Box, D., Ehnebuske, D., Kakivaya, G., Layman, A.,
- Mendelsohn, N., Nielsen, H. F., Thatte, S. Winer, D.,
- "Simple Object Access Protocol (SOAP) 1.1" World Wide Web
- Consortium Note, May 2000 http://www.w3.org/TR/SOAP/
-
- [XML] Bray, T., Paoli, J., Sperberg-McQueen, C. M., "Extensible
- Markup Language (XML)" World Wide Web Consortium
- Recommendation REC- xml-19980210.
- http://www.w3.org/TR/1998/REC-xml-19980210
-
-10. Author's Address
-
- Hugh Kennedy
- Mimezine
- 1060 West Addison
- Chicago, IL 60613
- USA
-
- EMail: kennedyh@engin.umich.edu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Kennedy Informational [Page 15]
-
-RFC 3252 Binary Lexical Octet Ad-hoc Transport 1 April 2002
-
-
-11. Full Copyright Statement
-
- Copyright (C) The Internet Society (2002). All Rights Reserved.
-
- This document and translations of it may be copied and furnished to
- others, and derivative works that comment on or otherwise explain it
- or assist in its implementation may be prepared, copied, published
- and distributed, in whole or in part, without restriction of any
- kind, provided that the above copyright notice and this paragraph are
- included on all such copies and derivative works. However, this
- document itself may not be modified in any way, such as by removing
- the copyright notice or references to the Internet Society or other
- Internet organizations, except as needed for the purpose of
- developing Internet standards in which case the procedures for
- copyrights defined in the Internet Standards process must be
- followed, or as required to translate it into languages other than
- English.
-
- The limited permissions granted above are perpetual and will not be
- revoked by the Internet Society or its successors or assigns.
-
- This document and the information contained herein is provided on an
- "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
- TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
- BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
- HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-
-Acknowledgement
-
- Funding for the RFC Editor function is currently provided by the
- Internet Society.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Kennedy Informational [Page 16]
-
diff --git a/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp b/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
index b4c0e2c93a..aa8617740b 100644
--- a/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
+++ b/tests/auto/network/access/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/access/qhttpnetworkreply/tst_qhttpnetworkreply.cpp b/tests/auto/network/access/qhttpnetworkreply/tst_qhttpnetworkreply.cpp
index 513b20ec82..fa215a5422 100644
--- a/tests/auto/network/access/qhttpnetworkreply/tst_qhttpnetworkreply.cpp
+++ b/tests/auto/network/access/qhttpnetworkreply/tst_qhttpnetworkreply.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/access/qnetworkaccessmanager/tst_qnetworkaccessmanager.cpp b/tests/auto/network/access/qnetworkaccessmanager/tst_qnetworkaccessmanager.cpp
index 14804b5187..9fda95821e 100644
--- a/tests/auto/network/access/qnetworkaccessmanager/tst_qnetworkaccessmanager.cpp
+++ b/tests/auto/network/access/qnetworkaccessmanager/tst_qnetworkaccessmanager.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -42,11 +42,15 @@
#include <QtTest/QtTest>
#include <QtNetwork/QNetworkAccessManager>
+#ifndef QT_NO_BEARERMANAGEMENT
#include <QtNetwork/QNetworkConfigurationManager>
+#endif
#include <QtCore/QDebug>
-Q_DECLARE_METATYPE(QNetworkAccessManager::NetworkAccessibility);
+#ifndef QT_NO_BEARERMANAGEMENT
+Q_DECLARE_METATYPE(QNetworkAccessManager::NetworkAccessibility)
+#endif
class tst_QNetworkAccessManager : public QObject
{
@@ -65,6 +69,7 @@ tst_QNetworkAccessManager::tst_QNetworkAccessManager()
void tst_QNetworkAccessManager::networkAccessible()
{
+#ifndef QT_NO_BEARERMANAGEMENT
QNetworkAccessManager manager;
qRegisterMetaType<QNetworkAccessManager::NetworkAccessibility>("QNetworkAccessManager::NetworkAccessibility");
@@ -105,6 +110,7 @@ void tst_QNetworkAccessManager::networkAccessible()
QNetworkAccessManager::NotAccessible);
QCOMPARE(manager.networkAccessible(), QNetworkAccessManager::NotAccessible);
}
+#endif
}
QTEST_MAIN(tst_QNetworkAccessManager)
diff --git a/tests/auto/network/access/qnetworkcachemetadata/tst_qnetworkcachemetadata.cpp b/tests/auto/network/access/qnetworkcachemetadata/tst_qnetworkcachemetadata.cpp
index a5b63bd7d5..b272c0b282 100644
--- a/tests/auto/network/access/qnetworkcachemetadata/tst_qnetworkcachemetadata.cpp
+++ b/tests/auto/network/access/qnetworkcachemetadata/tst_qnetworkcachemetadata.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp b/tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp
index a83f6dda91..abf8e726d2 100644
--- a/tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp
+++ b/tests/auto/network/access/qnetworkcookie/tst_qnetworkcookie.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp b/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp
index 5051aa5fee..6ef08131a5 100644
--- a/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp
+++ b/tests/auto/network/access/qnetworkcookiejar/tst_qnetworkcookiejar.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -42,6 +42,7 @@
#include <QtTest/QtTest>
#include <QtNetwork/QNetworkCookieJar>
+#include <QtNetwork/QNetworkCookie>
#include "private/qtldurl_p.h"
class tst_QNetworkCookieJar: public QObject
diff --git a/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp b/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
index 750721beab..dbd5e64627 100644
--- a/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
+++ b/tests/auto/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/access/qnetworkreply/echo/main.cpp b/tests/auto/network/access/qnetworkreply/echo/main.cpp
index a4ddda171a..5162842081 100644
--- a/tests/auto/network/access/qnetworkreply/echo/main.cpp
+++ b/tests/auto/network/access/qnetworkreply/echo/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
index d3b92ea9b1..9d3c8a7f2f 100644
--- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -54,13 +54,16 @@
#include <QtNetwork/QLocalSocket>
#include <QtNetwork/QLocalServer>
#include <QtNetwork/QHostInfo>
-#include <QtNetwork/QFtp>
+#include <QtNetwork/QNetworkAccessManager>
+#include <QtNetwork/QNetworkRequest>
+#include <QtNetwork/QNetworkReply>
#include <QtNetwork/QAbstractNetworkCache>
#include <QtNetwork/qauthenticator.h>
#include <QtNetwork/qnetworkaccessmanager.h>
#include <QtNetwork/qnetworkrequest.h>
#include <QtNetwork/qnetworkreply.h>
#include <QtNetwork/qnetworkcookie.h>
+#include <QtNetwork/QNetworkCookieJar>
#include <QtNetwork/QHttpPart>
#include <QtNetwork/QHttpMultiPart>
#include <QtNetwork/QNetworkProxyQuery>
@@ -73,7 +76,9 @@
#include <QtNetwork/qnetworkconfiguration.h>
#include <QtNetwork/qnetworksession.h>
#endif
-
+#ifdef QT_BUILD_INTERNAL
+#include <QtNetwork/private/qnetworkaccessmanager_p.h>
+#endif
#include <time.h>
#include "../../../network-settings.h"
@@ -163,6 +168,7 @@ public Q_SLOTS:
void gotError();
void authenticationRequired(QNetworkReply*,QAuthenticator*);
void proxyAuthenticationRequired(const QNetworkProxy &,QAuthenticator*);
+ void pipeliningHelperSlot();
#ifndef QT_NO_OPENSSL
void sslErrors(QNetworkReply*,const QList<QSslError> &);
@@ -366,6 +372,7 @@ private Q_SLOTS:
void qtbug15311doubleContentLength();
void qtbug18232gzipContentLengthZero();
+ void qtbug22660gzipNoContentLengthEmptyContent();
void synchronousRequest_data();
void synchronousRequest();
@@ -378,7 +385,11 @@ private Q_SLOTS:
void dontInsertPartialContentIntoTheCache();
void httpUserAgent();
+ void authenticationCacheAfterCancel_data();
+ void authenticationCacheAfterCancel();
+ void authenticationWithDifferentRealm();
void synchronousAuthenticationCache();
+ void pipelining();
// NOTE: This test must be last!
void parentingRepliesToTheApp();
@@ -463,7 +474,7 @@ public:
if (useipv6) {
listen(QHostAddress::AnyIPv6);
} else {
- listen();
+ listen(QHostAddress::AnyIPv4);
}
if (thread) {
connect(thread, SIGNAL(started()), this, SLOT(threadStartedSlot()));
@@ -474,7 +485,7 @@ public:
}
protected:
- void incomingConnection(int socketDescriptor)
+ void incomingConnection(qintptr socketDescriptor)
{
//qDebug() << "incomingConnection" << socketDescriptor << "doSsl:" << doSsl << "ipv6:" << ipv6;
if (!doSsl) {
@@ -796,7 +807,7 @@ public:
return nextPendingConnection();
}
}
- virtual void incomingConnection(int socketDescriptor)
+ virtual void incomingConnection(qintptr socketDescriptor)
{
#ifndef QT_NO_OPENSSL
if (doSsl) {
@@ -1304,9 +1315,11 @@ void tst_QNetworkReply::cleanupTestCase()
#if !defined Q_OS_WIN
QFile::remove(wronlyFileName);
#endif
+#ifndef QT_NO_BEARERMANAGEMENT
if (networkSession && networkSession->isOpen()) {
networkSession->close();
}
+#endif
}
void tst_QNetworkReply::init()
@@ -1841,23 +1854,22 @@ void tst_QNetworkReply::putToFtp()
// download the file again from FTP to make sure it was uploaded
// correctly
- QFtp ftp;
- ftp.connectToHost(url.host());
- ftp.login();
- ftp.get(url.path());
+ QNetworkAccessManager qnam;
+ QNetworkRequest req(url);
+ QNetworkReply *r = qnam.get(req);
- QObject::connect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QObject::connect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
QTestEventLoop::instance().enterLoop(10);
- QObject::disconnect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QObject::disconnect(r, SIGNAL(finished(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
- QByteArray uploaded = ftp.readAll();
+ QByteArray uploaded = r->readAll();
QCOMPARE(uploaded.size(), data.size());
QCOMPARE(uploaded, data);
- ftp.close();
- QObject::connect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ r->close();
+ QObject::connect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
QTestEventLoop::instance().enterLoop(10);
- QObject::disconnect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QObject::disconnect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
}
void tst_QNetworkReply::putToHttp_data()
@@ -3893,23 +3905,22 @@ void tst_QNetworkReply::ioPutToFtpFromFile()
// download the file again from FTP to make sure it was uploaded
// correctly
- QFtp ftp;
- ftp.connectToHost(url.host());
- ftp.login();
- ftp.get(url.path());
+ QNetworkAccessManager qnam;
+ QNetworkRequest req(url);
+ QNetworkReply *r = qnam.get(req);
- QObject::connect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QObject::connect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
QTestEventLoop::instance().enterLoop(3);
- QObject::disconnect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QObject::disconnect(r, SIGNAL(finished(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
- QByteArray uploaded = ftp.readAll();
+ QByteArray uploaded = r->readAll();
QCOMPARE(qint64(uploaded.size()), sourceFile.size());
QCOMPARE(uploaded, sourceFile.readAll());
- ftp.close();
- QObject::connect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ r->close();
+ QObject::connect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
QTestEventLoop::instance().enterLoop(10);
- QObject::disconnect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QObject::disconnect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
}
void tst_QNetworkReply::ioPutToHttpFromFile_data()
@@ -4268,7 +4279,7 @@ class SslServer : public QTcpServer {
Q_OBJECT
public:
SslServer() : socket(0) {};
- void incomingConnection(int socketDescriptor) {
+ void incomingConnection(qintptr socketDescriptor) {
QSslSocket *serverSocket = new QSslSocket;
serverSocket->setParent(this);
@@ -6025,6 +6036,221 @@ void tst_QNetworkReply::qtbug4121unknownAuthentication()
QCOMPARE(reply->error(), QNetworkReply::AuthenticationRequiredError);
}
+void tst_QNetworkReply::authenticationCacheAfterCancel_data()
+{
+ QTest::addColumn<QNetworkProxy>("proxy");
+ QTest::addColumn<bool>("proxyAuth");
+ QTest::addColumn<QUrl>("url");
+ for (int i = 0; i < proxies.count(); ++i) {
+ QTest::newRow("http" + proxies.at(i).tag) << proxies.at(i).proxy << proxies.at(i).requiresAuthentication << QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt");
+#ifndef QT_NO_OPENSSL
+ QTest::newRow("https" + proxies.at(i).tag) << proxies.at(i).proxy << proxies.at(i).requiresAuthentication << QUrl("https://" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt");
+#endif
+ }
+}
+
+class AuthenticationCacheHelper : public QObject
+{
+ Q_OBJECT
+public:
+ AuthenticationCacheHelper()
+ {}
+public slots:
+ void proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *auth)
+ {
+ if (!proxyPassword.isNull()) {
+ auth->setUser(proxyUserName);
+ auth->setPassword(proxyPassword);
+ //clear credentials, if they are asked again, they were bad
+ proxyUserName.clear();
+ proxyPassword.clear();
+ }
+ }
+ void authenticationRequired(QNetworkReply*,QAuthenticator *auth)
+ {
+ if (!httpPassword.isNull()) {
+ auth->setUser(httpUserName);
+ auth->setPassword(httpPassword);
+ //clear credentials, if they are asked again, they were bad
+ httpUserName.clear();
+ httpPassword.clear();
+ }
+ }
+public:
+ QString httpUserName;
+ QString httpPassword;
+ QString proxyUserName;
+ QString proxyPassword;
+};
+
+/* Purpose of this test is to check credentials are cached correctly.
+ - If user cancels authentication dialog (i.e. nothing is set to the QAuthenticator by the callback) then this is not cached
+ - if user supplies a wrong password, then this is not cached
+ - if user supplies a correct user/password combination then this is cached
+
+ Test is checking both the proxyAuthenticationRequired and authenticationRequired signals.
+ */
+void tst_QNetworkReply::authenticationCacheAfterCancel()
+{
+ QFETCH(QNetworkProxy, proxy);
+ QFETCH(bool, proxyAuth);
+ QFETCH(QUrl, url);
+ QNetworkAccessManager manager;
+#ifndef QT_NO_OPENSSL
+ connect(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
+ SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
+#endif
+ manager.setProxy(proxy);
+ QSignalSpy authSpy(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)));
+ QSignalSpy proxyAuthSpy(&manager, SIGNAL(proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *)));
+
+ AuthenticationCacheHelper helper;
+ connect(&manager, SIGNAL(proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *)), &helper, SLOT(proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *)));
+ connect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), &helper, SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*)));
+
+ QNetworkRequest request(url);
+ QNetworkReplyPtr reply;
+ if (proxyAuth) {
+ //should fail due to no credentials
+ reply = manager.get(request);
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection);
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QCOMPARE(reply->error(), QNetworkReply::ProxyAuthenticationRequiredError);
+ QCOMPARE(authSpy.count(), 0);
+ QCOMPARE(proxyAuthSpy.count(), 1);
+ proxyAuthSpy.clear();
+
+ //should fail due to bad credentials
+ helper.proxyUserName = "qsockstest";
+ helper.proxyPassword = "badpassword";
+ reply = manager.get(request);
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection);
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QEXPECT_FAIL("http+socksauth", "QTBUG-23136 - danted accepts bad authentication but blocks the connection", Continue);
+ QEXPECT_FAIL("https+socksauth", "QTBUG-23136 - danted accepts bad authentication but blocks the connection", Continue);
+
+ QCOMPARE(reply->error(), QNetworkReply::ProxyAuthenticationRequiredError);
+ QCOMPARE(authSpy.count(), 0);
+ QVERIFY(proxyAuthSpy.count() > 0);
+ proxyAuthSpy.clear();
+
+ //QTBUG-23136 workaround
+ if (proxy.port() == 1081) {
+#ifdef QT_BUILD_INTERNAL
+ QNetworkAccessManagerPrivate::clearCache(&manager);
+#else
+ return; //XFAIL result above
+#endif
+ }
+
+ //next proxy auth should succeed, due to correct credentials
+ helper.proxyUserName = "qsockstest";
+ helper.proxyPassword = "password";
+ }
+
+ //should fail due to no credentials
+ reply = manager.get(request);
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection);
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QCOMPARE(reply->error(), QNetworkReply::AuthenticationRequiredError);
+ QVERIFY(authSpy.count() > 0);
+ authSpy.clear();
+ if (proxyAuth) {
+ QVERIFY(proxyAuthSpy.count() > 0);
+ proxyAuthSpy.clear();
+ }
+
+ //should fail due to bad credentials
+ helper.httpUserName = "baduser";
+ helper.httpPassword = "badpassword";
+ reply = manager.get(request);
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection);
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QCOMPARE(reply->error(), QNetworkReply::AuthenticationRequiredError);
+ QVERIFY(authSpy.count() > 0);
+ authSpy.clear();
+ if (proxyAuth) {
+ //should be supplied from cache
+ QCOMPARE(proxyAuthSpy.count(), 0);
+ proxyAuthSpy.clear();
+ }
+
+ //next auth should succeed, due to correct credentials
+ helper.httpUserName = "httptest";
+ helper.httpPassword = "httptest";
+
+ reply = manager.get(request);
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection);
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
+ QVERIFY(authSpy.count() > 0);
+ authSpy.clear();
+ if (proxyAuth) {
+ //should be supplied from cache
+ QCOMPARE(proxyAuthSpy.count(), 0);
+ proxyAuthSpy.clear();
+ }
+
+ //next auth should use cached credentials
+ reply = manager.get(request);
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection);
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
+ //should be supplied from cache
+ QCOMPARE(authSpy.count(), 0);
+ authSpy.clear();
+ if (proxyAuth) {
+ //should be supplied from cache
+ QCOMPARE(proxyAuthSpy.count(), 0);
+ proxyAuthSpy.clear();
+ }
+
+}
+
+void tst_QNetworkReply::authenticationWithDifferentRealm()
+{
+ AuthenticationCacheHelper helper;
+ QNetworkAccessManager manager;
+#ifndef QT_NO_OPENSSL
+ connect(&manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
+ SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
+#endif
+ connect(&manager, SIGNAL(proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *)), &helper, SLOT(proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *)));
+ connect(&manager, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), &helper, SLOT(authenticationRequired(QNetworkReply*,QAuthenticator*)));
+
+ helper.httpUserName = "httptest";
+ helper.httpPassword = "httptest";
+
+ QNetworkRequest request(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/rfcs-auth/rfc3252.txt"));
+ QNetworkReply* reply = manager.get(request);
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection);
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
+
+ helper.httpUserName = "httptest";
+ helper.httpPassword = "httptest";
+
+ request.setUrl(QUrl("http://" + QtNetworkSettings::serverName() + "/qtest/auth-digest/"));
+ reply = manager.get(request);
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection);
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
+}
+
class QtBug13431Helper : public QObject {
Q_OBJECT
public:
@@ -6141,6 +6367,28 @@ void tst_QNetworkReply::qtbug18232gzipContentLengthZero()
QCOMPARE(reply->readAll(), QByteArray());
}
+// Reproduced a crash in QHttpNetworkReplyPrivate::gunzipBodyPartiallyEnd
+// where zlib inflateEnd was called for uninitialized zlib stream
+void tst_QNetworkReply::qtbug22660gzipNoContentLengthEmptyContent()
+{
+ // Response with no Content-Length in header and empty content
+ QByteArray response("HTTP/1.0 200 OK\r\nContent-Encoding: gzip\r\n\r\n");
+ MiniHttpServer server(response);
+ server.doClose = true;
+
+ QNetworkRequest request(QUrl("http://localhost:" + QString::number(server.serverPort())));
+ QNetworkReplyPtr reply = manager.get(request);
+
+ connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QTestEventLoop::instance().enterLoop(10);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ QVERIFY(reply->isFinished());
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
+ QCOMPARE(reply->size(), qint64(0));
+ QVERIFY(!reply->header(QNetworkRequest::ContentLengthHeader).isValid());
+ QCOMPARE(reply->readAll(), QByteArray());
+}
+
void tst_QNetworkReply::synchronousRequest_data()
{
QTest::addColumn<QUrl>("url");
@@ -6443,6 +6691,43 @@ void tst_QNetworkReply::synchronousAuthenticationCache()
}
}
+void tst_QNetworkReply::pipelining()
+{
+ QString urlString("http://" + QtNetworkSettings::serverName() + "/qtest/cgi-bin/echo.cgi?");
+ QList<QNetworkReplyPtr> replies;
+ for (int a = 0; a < 20; a++) {
+ QNetworkRequest request(urlString + QString::number(a));
+ request.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, QVariant(true));
+ replies.append(manager.get(request));
+ connect(replies.at(a), SIGNAL(finished()), this, SLOT(pipeliningHelperSlot()));
+ }
+ QTestEventLoop::instance().enterLoop(20);
+ QVERIFY(!QTestEventLoop::instance().timeout());
+}
+
+void tst_QNetworkReply::pipeliningHelperSlot() {
+ static int a = 0;
+
+ // check that pipelining was used in at least one of the replies
+ static bool pipeliningWasUsed = false;
+ QNetworkReply *reply = qobject_cast<QNetworkReply *>(sender());
+ bool pipeliningWasUsedInReply = reply->attribute(QNetworkRequest::HttpPipeliningWasUsedAttribute).toBool();
+ if (pipeliningWasUsedInReply)
+ pipeliningWasUsed = true;
+
+ // check that the contents match (the response to echo.cgi?3 should return 3 etc.)
+ QString urlQueryString = reply->url().queryItems().at(0).first;
+ QString content = reply->readAll();
+ QVERIFY2(urlQueryString == content, "data corruption with pipelining detected");
+
+ a++;
+
+ if (a == 20) { // all replies have finished
+ QTestEventLoop::instance().exitLoop();
+ QVERIFY2(pipeliningWasUsed, "pipelining was not used in any of the replies when trying to test pipelining");
+ }
+}
+
// NOTE: This test must be last testcase in tst_qnetworkreply!
void tst_QNetworkReply::parentingRepliesToTheApp()
{
diff --git a/tests/auto/network/access/qnetworkrequest/tst_qnetworkrequest.cpp b/tests/auto/network/access/qnetworkrequest/tst_qnetworkrequest.cpp
index 90527163e2..e106230dc4 100644
--- a/tests/auto/network/access/qnetworkrequest/tst_qnetworkrequest.cpp
+++ b/tests/auto/network/access/qnetworkrequest/tst_qnetworkrequest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/bearer/qbearertestcommon.h b/tests/auto/network/bearer/qbearertestcommon.h
index c16c2016e8..6279dbb1ef 100644
--- a/tests/auto/network/bearer/qbearertestcommon.h
+++ b/tests/auto/network/bearer/qbearertestcommon.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -42,6 +42,10 @@
#ifndef QBEARERTESTCOMMON_H
#define QBEARERTESTCOMMON_H
+#include <QtTest/qtestcase.h>
+
+enum { TestTimeOut = 90000 };
+
// Wait for __expr to happen, while still allowing events to be processed.
#define QTRY_NOOP(__expr) \
do { \
@@ -55,33 +59,4 @@
} \
} while(0)
-// Will try to wait for the condition while allowing event processing
-#define QTRY_VERIFY(__expr) \
- do { \
- const int __step = 50; \
- const int __timeout = 90000; \
- if (!(__expr)) { \
- QTest::qWait(0); \
- } \
- for (int __i = 0; __i < __timeout && !(__expr); __i+=__step) { \
- QTest::qWait(__step); \
- } \
- QVERIFY(__expr); \
- } while(0)
-
-// Will try to wait for the condition while allowing event processing
-#define QTRY_COMPARE(__expr, __expected) \
- do { \
- const int __step = 50; \
- const int __timeout = 90000; \
- if ((__expr) != (__expected)) { \
- QTest::qWait(0); \
- } \
- for (int __i = 0; __i < __timeout && ((__expr) != (__expected)); __i+=__step) { \
- QTest::qWait(__step); \
- } \
- QCOMPARE(__expr, __expected); \
- } while(0)
-
#endif
-
diff --git a/tests/auto/network/bearer/qnetworkconfiguration/qnetworkconfiguration.pro b/tests/auto/network/bearer/qnetworkconfiguration/qnetworkconfiguration.pro
index b01f8d380e..cde82a4fb2 100644
--- a/tests/auto/network/bearer/qnetworkconfiguration/qnetworkconfiguration.pro
+++ b/tests/auto/network/bearer/qnetworkconfiguration/qnetworkconfiguration.pro
@@ -4,9 +4,3 @@ SOURCES += tst_qnetworkconfiguration.cpp
HEADERS += ../qbearertestcommon.h
QT = core network testlib
-
-maemo6|maemo5 {
- CONFIG += link_pkgconfig
-
- PKGCONFIG += conninet
-}
diff --git a/tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp b/tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
index a2c9acea6e..2a05f6132a 100644
--- a/tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
+++ b/tests/auto/network/bearer/qnetworkconfiguration/tst_qnetworkconfiguration.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -42,8 +42,10 @@
#include <QtTest/QtTest>
#include "../qbearertestcommon.h"
+#ifndef QT_NO_BEARERMANAGEMENT
#include <QtNetwork/qnetworkconfiguration.h>
#include <QtNetwork/qnetworkconfigmanager.h>
+#endif
/*
Although this unit test doesn't use QNetworkAccessManager
@@ -52,136 +54,22 @@
*/
#include <QNetworkAccessManager>
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
-#include <stdio.h>
-#include <iapconf.h>
-#endif
-
QT_USE_NAMESPACE
+
class tst_QNetworkConfiguration : public QObject
{
Q_OBJECT
-public slots:
- void initTestCase();
- void cleanupTestCase();
-
private slots:
+#ifndef QT_NO_BEARERMANAGEMENT
void invalidPoint();
void comparison();
void children();
void isRoamingAvailable();
-
-private:
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
- Maemo::IAPConf *iapconf;
- Maemo::IAPConf *iapconf2;
- Maemo::IAPConf *gprsiap;
-#define MAX_IAPS 50
- Maemo::IAPConf *iaps[MAX_IAPS];
- QProcess *icd_stub;
#endif
};
-void tst_QNetworkConfiguration::initTestCase()
-{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
- iapconf = new Maemo::IAPConf("007");
- iapconf->setValue("ipv4_type", "AUTO");
- iapconf->setValue("wlan_wepkey1", "connt");
- iapconf->setValue("wlan_wepdefkey", 1);
- iapconf->setValue("wlan_ssid", QByteArray("JamesBond"));
- iapconf->setValue("name", "James Bond");
- iapconf->setValue("type", "WLAN_INFRA");
-
- iapconf2 = new Maemo::IAPConf("osso.net");
- iapconf2->setValue("ipv4_type", "AUTO");
- iapconf2->setValue("wlan_wepkey1", "osso.net");
- iapconf2->setValue("wlan_wepdefkey", 1);
- iapconf2->setValue("wlan_ssid", QByteArray("osso.net"));
- iapconf2->setValue("name", "osso.net");
- iapconf2->setValue("type", "WLAN_INFRA");
- iapconf2->setValue("wlan_security", "WEP");
-
- gprsiap = new Maemo::IAPConf("This-is-GPRS-IAP");
- gprsiap->setValue("ask_password", false);
- gprsiap->setValue("gprs_accesspointname", "internet");
- gprsiap->setValue("gprs_password", "");
- gprsiap->setValue("gprs_username", "");
- gprsiap->setValue("ipv4_autodns", true);
- gprsiap->setValue("ipv4_type", "AUTO");
- gprsiap->setValue("sim_imsi", "244070123456789");
- gprsiap->setValue("name", "MI6");
- gprsiap->setValue("type", "GPRS");
-
- /* Create large number of IAPs in the gconf and see what happens */
- fflush(stdout);
- printf("Creating %d IAPS: ", MAX_IAPS);
- for (int i=0; i<MAX_IAPS; i++) {
- QString num = QString().sprintf("%d", i);
- QString iap = "iap-" + num;
- iaps[i] = new Maemo::IAPConf(iap);
- iaps[i]->setValue("name", QString("test-iap-")+num);
- iaps[i]->setValue("type", "WLAN_INFRA");
- iaps[i]->setValue("wlan_ssid", QString(QString("test-ssid-")+num).toAscii());
- iaps[i]->setValue("wlan_security", "WPA_PSK");
- iaps[i]->setValue("EAP_wpa_preshared_passphrase", QString("test-passphrase-")+num);
- printf(".");
- fflush(stdout);
- }
- printf("\n");
- fflush(stdout);
-
- icd_stub = new QProcess(this);
- icd_stub->start("/usr/bin/icd2_stub.py");
- QTest::qWait(1000);
-
- // Add a known network to scan list that icd2 stub returns
- QProcess dbus_send;
- // 007 network
- dbus_send.start("dbus-send --type=method_call --system "
- "--dest=com.nokia.icd2 /com/nokia/icd2 "
- "com.nokia.icd2.testing.add_available_network "
- "string:'' uint32:0 string:'' "
- "string:WLAN_INFRA uint32:5000011 array:byte:48,48,55");
- dbus_send.waitForFinished();
-
- // osso.net network
- dbus_send.start("dbus-send --type=method_call --system "
- "--dest=com.nokia.icd2 /com/nokia/icd2 "
- "com.nokia.icd2.testing.add_available_network "
- "string:'' uint32:0 string:'' "
- "string:WLAN_INFRA uint32:83886097 array:byte:111,115,115,111,46,110,101,116");
- dbus_send.waitForFinished();
-#endif
-}
-
-void tst_QNetworkConfiguration::cleanupTestCase()
-{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
- iapconf->clear();
- delete iapconf;
- iapconf2->clear();
- delete iapconf2;
- gprsiap->clear();
- delete gprsiap;
-
- printf("Deleting %d IAPS : ", MAX_IAPS);
- for (int i=0; i<MAX_IAPS; i++) {
- iaps[i]->clear();
- delete iaps[i];
- printf(".");
- fflush(stdout);
- }
- printf("\n");
- qDebug() << "Deleted" << MAX_IAPS << "IAPs";
-
- // Terminate icd2 stub
- icd_stub->terminate();
- icd_stub->waitForFinished();
-#endif
-}
-
+#ifndef QT_NO_BEARERMANAGEMENT
void tst_QNetworkConfiguration::invalidPoint()
{
QNetworkConfiguration pt;
@@ -239,7 +127,7 @@ void tst_QNetworkConfiguration::comparison()
QSignalSpy spy(&manager, SIGNAL(updateCompleted()));
manager.updateConfigurations(); //initiate scans
- QTRY_VERIFY(spy.count() == 1); //wait for scan to complete
+ QTRY_VERIFY_WITH_TIMEOUT(spy.count() == 1, TestTimeOut); //wait for scan to complete
QList<QNetworkConfiguration> configs = manager.allConfigurations(QNetworkConfiguration::Discovered);
QVERIFY(configs.count());
@@ -286,7 +174,7 @@ void tst_QNetworkConfiguration::isRoamingAvailable()
//force update to get maximum list
QSignalSpy spy(&manager, SIGNAL(updateCompleted()));
manager.updateConfigurations(); //initiate scans
- QTRY_VERIFY(spy.count() == 1); //wait for scan to complete
+ QTRY_VERIFY_WITH_TIMEOUT(spy.count() == 1, TestTimeOut); //wait for scan to complete
foreach(QNetworkConfiguration c, configs)
{
@@ -306,6 +194,7 @@ void tst_QNetworkConfiguration::isRoamingAvailable()
}
}
}
+#endif
QTEST_MAIN(tst_QNetworkConfiguration)
#include "tst_qnetworkconfiguration.moc"
diff --git a/tests/auto/network/bearer/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro b/tests/auto/network/bearer/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro
index e7ff28ee63..52cee1f64d 100644
--- a/tests/auto/network/bearer/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro
+++ b/tests/auto/network/bearer/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro
@@ -4,9 +4,3 @@ SOURCES += tst_qnetworkconfigurationmanager.cpp
HEADERS += ../qbearertestcommon.h
QT = core network testlib
-
-maemo6|maemo5 {
- CONFIG += link_pkgconfig
-
- PKGCONFIG += conninet
-}
diff --git a/tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp b/tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
index 6b299ac459..c801534a50 100644
--- a/tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
+++ b/tests/auto/network/bearer/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -42,12 +42,9 @@
#include <QtTest/QtTest>
#include "../qbearertestcommon.h"
+#ifndef QT_NO_BEARERMANAGEMENT
#include <QtNetwork/qnetworkconfiguration.h>
#include <QtNetwork/qnetworkconfigmanager.h>
-
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
-#include <stdio.h>
-#include <iapconf.h>
#endif
QT_USE_NAMESPACE
@@ -55,136 +52,16 @@ class tst_QNetworkConfigurationManager : public QObject
{
Q_OBJECT
-public slots:
- void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
-
private slots:
+#ifndef QT_NO_BEARERMANAGEMENT
void usedInThread(); // this test must be first, or it will falsely pass
void allConfigurations();
void defaultConfiguration();
void configurationFromIdentifier();
-
-private:
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
- Maemo::IAPConf *iapconf;
- Maemo::IAPConf *iapconf2;
- Maemo::IAPConf *gprsiap;
-#define MAX_IAPS 50
- Maemo::IAPConf *iaps[MAX_IAPS];
- QProcess *icd_stub;
#endif
};
-void tst_QNetworkConfigurationManager::initTestCase()
-{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
- iapconf = new Maemo::IAPConf("007");
- iapconf->setValue("ipv4_type", "AUTO");
- iapconf->setValue("wlan_wepkey1", "connt");
- iapconf->setValue("wlan_wepdefkey", 1);
- iapconf->setValue("wlan_ssid", QByteArray("JamesBond"));
- iapconf->setValue("name", "James Bond");
- iapconf->setValue("type", "WLAN_INFRA");
-
- gprsiap = new Maemo::IAPConf("This-is-GPRS-IAP");
- gprsiap->setValue("ask_password", false);
- gprsiap->setValue("gprs_accesspointname", "internet");
- gprsiap->setValue("gprs_password", "");
- gprsiap->setValue("gprs_username", "");
- gprsiap->setValue("ipv4_autodns", true);
- gprsiap->setValue("ipv4_type", "AUTO");
- gprsiap->setValue("sim_imsi", "244070123456789");
- gprsiap->setValue("name", "MI6");
- gprsiap->setValue("type", "GPRS");
-
- iapconf2 = new Maemo::IAPConf("osso.net");
- iapconf2->setValue("ipv4_type", "AUTO");
- iapconf2->setValue("wlan_wepkey1", "osso.net");
- iapconf2->setValue("wlan_wepdefkey", 1);
- iapconf2->setValue("wlan_ssid", QByteArray("osso.net"));
- iapconf2->setValue("name", "osso.net");
- iapconf2->setValue("type", "WLAN_INFRA");
- iapconf2->setValue("wlan_security", "WEP");
-
- /* Create large number of IAPs in the gconf and see what happens */
- fflush(stdout);
- printf("Creating %d IAPS: ", MAX_IAPS);
- for (int i=0; i<MAX_IAPS; i++) {
- QString num = QString().sprintf("%d", i);
- QString iap = "iap-" + num;
- iaps[i] = new Maemo::IAPConf(iap);
- iaps[i]->setValue("name", QString("test-iap-")+num);
- iaps[i]->setValue("type", "WLAN_INFRA");
- iaps[i]->setValue("wlan_ssid", QString(QString("test-ssid-")+num).toAscii());
- iaps[i]->setValue("wlan_security", "WPA_PSK");
- iaps[i]->setValue("EAP_wpa_preshared_passphrase", QString("test-passphrase-")+num);
- printf(".");
- fflush(stdout);
- }
- printf("\n");
- fflush(stdout);
-
- icd_stub = new QProcess(this);
- icd_stub->start("/usr/bin/icd2_stub.py");
- QTest::qWait(1000);
-
- // Add a known network to scan list that icd2 stub returns
- QProcess dbus_send;
- // 007 network
- dbus_send.start("dbus-send --type=method_call --system "
- "--dest=com.nokia.icd2 /com/nokia/icd2 "
- "com.nokia.icd2.testing.add_available_network "
- "string:'' uint32:0 string:'' "
- "string:WLAN_INFRA uint32:5000011 array:byte:48,48,55");
- dbus_send.waitForFinished();
-
- // osso.net network
- dbus_send.start("dbus-send --type=method_call --system "
- "--dest=com.nokia.icd2 /com/nokia/icd2 "
- "com.nokia.icd2.testing.add_available_network "
- "string:'' uint32:0 string:'' "
- "string:WLAN_INFRA uint32:83886097 array:byte:111,115,115,111,46,110,101,116");
- dbus_send.waitForFinished();
-#endif
-}
-
-
-void tst_QNetworkConfigurationManager::cleanupTestCase()
-{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
- iapconf->clear();
- delete iapconf;
- iapconf2->clear();
- delete iapconf2;
- gprsiap->clear();
- delete gprsiap;
-
- printf("Deleting %d IAPS : ", MAX_IAPS);
- for (int i=0; i<MAX_IAPS; i++) {
- iaps[i]->clear();
- delete iaps[i];
- printf(".");
- fflush(stdout);
- }
- printf("\n");
- qDebug() << "Deleted" << MAX_IAPS << "IAPs";
-
- icd_stub->terminate();
- icd_stub->waitForFinished();
-#endif
-}
-
-void tst_QNetworkConfigurationManager::init()
-{
-}
-
-void tst_QNetworkConfigurationManager::cleanup()
-{
-}
-
+#ifndef QT_NO_BEARERMANAGEMENT
void printConfigurationDetails(const QNetworkConfiguration& p)
{
qDebug() << p.name() <<": isvalid->" <<p.isValid() << " type->"<< p.type() <<
@@ -204,7 +81,7 @@ void tst_QNetworkConfigurationManager::allConfigurations()
QSignalSpy spy(&manager, SIGNAL(updateCompleted()));
manager.updateConfigurations(); //initiate scans
- QTRY_VERIFY(spy.count() == 1); //wait for scan to complete
+ QTRY_VERIFY_WITH_TIMEOUT(spy.count() == 1, TestTimeOut); //wait for scan to complete
QList<QNetworkConfiguration> configs = manager.allConfigurations();
@@ -281,7 +158,7 @@ void tst_QNetworkConfigurationManager::defaultConfiguration()
QNetworkConfigurationManager manager;
QSignalSpy spy(&manager, SIGNAL(updateCompleted()));
manager.updateConfigurations(); //initiate scans
- QTRY_VERIFY(spy.count() == 1); //wait for scan to complete
+ QTRY_VERIFY_WITH_TIMEOUT(spy.count() == 1, TestTimeOut); //wait for scan to complete
QList<QNetworkConfiguration> configs = manager.allConfigurations();
QNetworkConfiguration defaultConfig = manager.defaultConfiguration();
@@ -311,7 +188,7 @@ void tst_QNetworkConfigurationManager::configurationFromIdentifier()
//force an update to get maximum number of configs
QSignalSpy spy(&manager, SIGNAL(updateCompleted()));
manager.updateConfigurations(); //initiate scans
- QTRY_VERIFY(spy.count() == 1); //wait for scan to complete
+ QTRY_VERIFY_WITH_TIMEOUT(spy.count() == 1, TestTimeOut); //wait for scan to complete
QList<QNetworkConfiguration> configs = manager.allConfigurations();
@@ -339,7 +216,7 @@ protected:
preScanConfigs = manager.allConfigurations();
QSignalSpy spy(&manager, SIGNAL(updateCompleted()));
manager.updateConfigurations(); //initiate scans
- QTRY_VERIFY(spy.count() == 1); //wait for scan to complete
+ QTRY_VERIFY_WITH_TIMEOUT(spy.count() == 1, TestTimeOut); //wait for scan to complete
configs = manager.allConfigurations();
}
public:
@@ -356,7 +233,7 @@ void tst_QNetworkConfigurationManager::usedInThread()
QNCMTestThread thread;
connect(&thread, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
thread.start();
- QTestEventLoop::instance().enterLoop(100); //QTRY_VERIFY could take ~90 seconds to time out in the thread
+ QTestEventLoop::instance().enterLoop(100); //QTRY_VERIFY_WITH_TIMEOUT could take ~90 seconds to time out in the thread
QVERIFY(!QTestEventLoop::instance().timeout());
qDebug() << "prescan:" << thread.preScanConfigs.count();
qDebug() << "postscan:" << thread.configs.count();
@@ -365,7 +242,7 @@ void tst_QNetworkConfigurationManager::usedInThread()
QList<QNetworkConfiguration> preScanConfigs = manager.allConfigurations();
QSignalSpy spy(&manager, SIGNAL(updateCompleted()));
manager.updateConfigurations(); //initiate scans
- QTRY_VERIFY(spy.count() == 1); //wait for scan to complete
+ QTRY_VERIFY_WITH_TIMEOUT(spy.count() == 1, TestTimeOut); //wait for scan to complete
QList<QNetworkConfiguration> configs = manager.allConfigurations();
QCOMPARE(thread.configs, configs);
//Don't compare pre scan configs, because these may be cached and therefore give different results
@@ -373,6 +250,7 @@ void tst_QNetworkConfigurationManager::usedInThread()
//QCOMPARE(thread.preScanConfigs, preScanConfigs);
#endif
}
+#endif
QTEST_MAIN(tst_QNetworkConfigurationManager)
#include "tst_qnetworkconfigurationmanager.moc"
diff --git a/tests/auto/network/bearer/qnetworksession/lackey/main.cpp b/tests/auto/network/bearer/qnetworksession/lackey/main.cpp
index 2b0f50f23e..1182454fda 100644
--- a/tests/auto/network/bearer/qnetworksession/lackey/main.cpp
+++ b/tests/auto/network/bearer/qnetworksession/lackey/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -43,9 +43,11 @@
#include <QStringList>
#include <QLocalSocket>
+#ifndef QT_NO_BEARERMANAGEMENT
#include <QtNetwork/qnetworkconfiguration.h>
#include <QtNetwork/qnetworkconfigmanager.h>
#include <QtNetwork/qnetworksession.h>
+#endif
#include <QEventLoop>
#include <QTimer>
@@ -62,6 +64,7 @@ int main(int argc, char** argv)
{
QCoreApplication app(argc, argv);
+#ifndef QT_NO_BEARERMANAGEMENT
// Update configurations so that everything is up to date for this process too.
// Event loop is used to wait for awhile.
QNetworkConfigurationManager manager;
@@ -150,6 +153,7 @@ int main(int argc, char** argv)
oopSocket.disconnectFromServer();
oopSocket.waitForDisconnected(-1);
+#endif
return 0;
}
diff --git a/tests/auto/network/bearer/qnetworksession/test/test.pro b/tests/auto/network/bearer/qnetworksession/test/test.pro
index ad55a4223b..5567e35b02 100644
--- a/tests/auto/network/bearer/qnetworksession/test/test.pro
+++ b/tests/auto/network/bearer/qnetworksession/test/test.pro
@@ -14,9 +14,3 @@ CONFIG(debug_and_release) {
} else {
DESTDIR = ..
}
-
-maemo6|maemo5 {
- CONFIG += link_pkgconfig
-
- PKGCONFIG += conninet
-}
diff --git a/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp b/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp
index 685c0ba696..26bdec5c9b 100644
--- a/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp
+++ b/tests/auto/network/bearer/qnetworksession/test/tst_qnetworksession.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -45,12 +45,9 @@
#include <QTimer>
#include "../../qbearertestcommon.h"
+#ifndef QT_NO_BEARERMANAGEMENT
#include <QtNetwork/qnetworkconfigmanager.h>
#include <QtNetwork/qnetworksession.h>
-
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
-#include <stdio.h>
-#include <iapconf.h>
#endif
QT_USE_NAMESPACE
@@ -58,19 +55,21 @@ QT_USE_NAMESPACE
// Can be used to configure tests that require manual attention (such as roaming)
//#define QNETWORKSESSION_MANUAL_TESTS 1
+#ifndef QT_NO_BEARERMANAGEMENT
Q_DECLARE_METATYPE(QNetworkConfiguration)
-Q_DECLARE_METATYPE(QNetworkConfiguration::Type);
+Q_DECLARE_METATYPE(QNetworkConfiguration::Type)
+#endif
class tst_QNetworkSession : public QObject
{
Q_OBJECT
+#ifndef QT_NO_BEARERMANAGEMENT
public slots:
void initTestCase();
void cleanupTestCase();
private slots:
-
void robustnessBombing();
void sessionClosing_data();
@@ -97,17 +96,10 @@ private slots:
private:
QNetworkConfigurationManager manager;
int inProcessSessionManagementCount;
-
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
- Maemo::IAPConf *iapconf;
- Maemo::IAPConf *iapconf2;
- Maemo::IAPConf *gprsiap;
-#define MAX_IAPS 10
- Maemo::IAPConf *iaps[MAX_IAPS];
- QProcess *icd_stub;
#endif
};
+#ifndef QT_NO_BEARERMANAGEMENT
// Helper functions
bool openSession(QNetworkSession *session);
bool closeSession(QNetworkSession *session, bool lastSessionOnConfiguration = true);
@@ -120,81 +112,11 @@ void tst_QNetworkSession::initTestCase()
qRegisterMetaType<QNetworkConfiguration>("QNetworkConfiguration");
qRegisterMetaType<QNetworkConfiguration::Type>("QNetworkConfiguration::Type");
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
- iapconf = new Maemo::IAPConf("007");
- iapconf->setValue("ipv4_type", "AUTO");
- iapconf->setValue("wlan_wepkey1", "connt");
- iapconf->setValue("wlan_wepdefkey", 1);
- iapconf->setValue("wlan_ssid", QByteArray("JamesBond"));
- iapconf->setValue("name", "James Bond");
- iapconf->setValue("type", "WLAN_INFRA");
-
- gprsiap = new Maemo::IAPConf("This-is-GPRS-IAP");
- gprsiap->setValue("ask_password", false);
- gprsiap->setValue("gprs_accesspointname", "internet");
- gprsiap->setValue("gprs_password", "");
- gprsiap->setValue("gprs_username", "");
- gprsiap->setValue("ipv4_autodns", true);
- gprsiap->setValue("ipv4_type", "AUTO");
- gprsiap->setValue("sim_imsi", "244070123456789");
- gprsiap->setValue("name", "MI6");
- gprsiap->setValue("type", "GPRS");
-
- iapconf2 = new Maemo::IAPConf("osso.net");
- iapconf2->setValue("ipv4_type", "AUTO");
- iapconf2->setValue("wlan_wepkey1", "osso.net");
- iapconf2->setValue("wlan_wepdefkey", 1);
- iapconf2->setValue("wlan_ssid", QByteArray("osso.net"));
- iapconf2->setValue("name", "osso.net");
- iapconf2->setValue("type", "WLAN_INFRA");
- iapconf2->setValue("wlan_security", "WEP");
-
- /* Create large number of IAPs in the gconf and see what happens */
- fflush(stdout);
- printf("Creating %d IAPS: ", MAX_IAPS);
- for (int i=0; i<MAX_IAPS; i++) {
- QString num = QString().sprintf("%d", i);
- QString iap = "iap-" + num;
- iaps[i] = new Maemo::IAPConf(iap);
- iaps[i]->setValue("name", QString("test-iap-")+num);
- iaps[i]->setValue("type", "WLAN_INFRA");
- iaps[i]->setValue("wlan_ssid", QString(QString("test-ssid-")+num).toAscii());
- iaps[i]->setValue("wlan_security", "WPA_PSK");
- iaps[i]->setValue("EAP_wpa_preshared_passphrase", QString("test-passphrase-")+num);
- printf(".");
- fflush(stdout);
- }
- printf("\n");
- fflush(stdout);
-
- icd_stub = new QProcess(this);
- icd_stub->start("/usr/bin/icd2_stub.py");
- QTest::qWait(1000);
-
- // Add a known network to scan list that icd2 stub returns
- QProcess dbus_send;
- // 007 network
- dbus_send.start("dbus-send --type=method_call --system "
- "--dest=com.nokia.icd2 /com/nokia/icd2 "
- "com.nokia.icd2.testing.add_available_network "
- "string:'' uint32:0 string:'' "
- "string:WLAN_INFRA uint32:5000011 array:byte:48,48,55");
- dbus_send.waitForFinished();
-
- // osso.net network
- dbus_send.start("dbus-send --type=method_call --system "
- "--dest=com.nokia.icd2 /com/nokia/icd2 "
- "com.nokia.icd2.testing.add_available_network "
- "string:'' uint32:0 string:'' "
- "string:WLAN_INFRA uint32:83886097 array:byte:111,115,115,111,46,110,101,116");
- dbus_send.waitForFinished();
-#endif
-
inProcessSessionManagementCount = -1;
QSignalSpy spy(&manager, SIGNAL(updateCompleted()));
manager.updateConfigurations();
- QTRY_VERIFY(spy.count() == 1);
+ QTRY_VERIFY_WITH_TIMEOUT(spy.count() == 1, TestTimeOut);
}
void tst_QNetworkSession::cleanupTestCase()
@@ -205,28 +127,6 @@ void tst_QNetworkSession::cleanupTestCase()
qWarning("No usable configurations found to complete all possible tests in "
"inProcessSessionManagement()");
}
-
-#if defined(Q_OS_UNIX) && !defined(QT_NO_ICD)
- iapconf->clear();
- delete iapconf;
- iapconf2->clear();
- delete iapconf2;
- gprsiap->clear();
- delete gprsiap;
-
- printf("Deleting %d IAPS : ", MAX_IAPS);
- for (int i=0; i<MAX_IAPS; i++) {
- iaps[i]->clear();
- delete iaps[i];
- printf(".");
- fflush(stdout);
- }
- printf("\n");
- qDebug() << "Deleted" << MAX_IAPS << "IAPs";
-
- icd_stub->terminate();
- icd_stub->waitForFinished();
-#endif
}
// Robustness test for calling interfaces in nonsense order / with nonsense parameters
@@ -278,7 +178,7 @@ void tst_QNetworkSession::sessionClosing()
session.close();
// Sooner or later session must end in Disconnected state,
// no matter what the phase was.
- QTRY_VERIFY(session.state() == QNetworkSession::Disconnected);
+ QTRY_VERIFY_WITH_TIMEOUT(session.state() == QNetworkSession::Disconnected, TestTimeOut);
QTest::qWait(200); // Give platform a breathe, otherwise we'll be catching other errors
}
}
@@ -526,7 +426,7 @@ void tst_QNetworkSession::userChoiceSession()
QVERIFY(errorSpy.isEmpty());
if (expectStateChange)
- QTRY_VERIFY(!stateChangedSpy.isEmpty());
+ QTRY_VERIFY_WITH_TIMEOUT(!stateChangedSpy.isEmpty(), TestTimeOut);
QVERIFY(session.state() == QNetworkSession::Connected);
#ifndef QT_NO_NETWORKINTERFACE
@@ -630,7 +530,7 @@ void tst_QNetworkSession::sessionOpenCloseStop()
// Wait until the configuration is uptodate as well, it may be signaled 'connected'
// bit later than the session
- QTRY_VERIFY(configuration.state() == QNetworkConfiguration::Active);
+ QTRY_VERIFY_WITH_TIMEOUT(configuration.state() == QNetworkConfiguration::Active, TestTimeOut);
if (session.isOpen())
QVERIFY(!sessionOpenedSpy.isEmpty() || !errorSpy.isEmpty());
@@ -664,7 +564,7 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QVERIFY(errorSpy.isEmpty());
if (expectStateChange) {
- QTRY_VERIFY(stateChangedSpy.count() >= 2);
+ QTRY_VERIFY_WITH_TIMEOUT(stateChangedSpy.count() >= 2, TestTimeOut);
QNetworkSession::State state =
qvariant_cast<QNetworkSession::State>(stateChangedSpy.at(0).at(0));
@@ -704,7 +604,7 @@ void tst_QNetworkSession::sessionOpenCloseStop()
session2.open();
- QTRY_VERIFY(!sessionOpenedSpy2.isEmpty() || !errorSpy2.isEmpty());
+ QTRY_VERIFY_WITH_TIMEOUT(!sessionOpenedSpy2.isEmpty() || !errorSpy2.isEmpty(), TestTimeOut);
if (errorSpy2.isEmpty()) {
QVERIFY(session2.isOpen());
@@ -731,13 +631,13 @@ void tst_QNetworkSession::sessionOpenCloseStop()
// QNetworkSession::stop() must result either closed() signal
// or error() signal
- QTRY_VERIFY(!sessionClosedSpy2.isEmpty() || !errorSpy2.isEmpty());
+ QTRY_VERIFY_WITH_TIMEOUT(!sessionClosedSpy2.isEmpty() || !errorSpy2.isEmpty(), TestTimeOut);
QVERIFY(!session2.isOpen());
if (!errorSpy2.isEmpty()) {
// QNetworkSession::stop() resulted error() signal for session2
// => also session should emit error() signal
- QTRY_VERIFY(!errorSpy.isEmpty());
+ QTRY_VERIFY_WITH_TIMEOUT(!errorSpy.isEmpty(), TestTimeOut);
// check for SessionAbortedError
QNetworkSession::SessionError error =
@@ -762,7 +662,7 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QTRY_NOOP(session2.state() == QNetworkSession::Disconnected);
if (expectStateChange)
- QTRY_VERIFY(stateChangedSpy2.count() >= 1 || !errorSpy2.isEmpty());
+ QTRY_VERIFY_WITH_TIMEOUT(stateChangedSpy2.count() >= 1 || !errorSpy2.isEmpty(), TestTimeOut);
if (!errorSpy2.isEmpty()) {
QVERIFY(session2.state() == previousState);
@@ -814,11 +714,11 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QFAIL("Unexpected amount of state changes when roaming.");
}
- QTRY_VERIFY(session.state() == QNetworkSession::Roaming ||
+ QTRY_VERIFY_WITH_TIMEOUT(session.state() == QNetworkSession::Roaming ||
session.state() == QNetworkSession::Connected ||
- session.state() == QNetworkSession::Disconnected);
+ session.state() == QNetworkSession::Disconnected, TestTimeOut);
- QTRY_VERIFY(stateChangedSpy.count() > 0);
+ QTRY_VERIFY_WITH_TIMEOUT(stateChangedSpy.count() > 0, TestTimeOut);
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy.at(stateChangedSpy.count() - 1).at(0));
for (int i = 0; i < stateChangedSpy.count(); i++) {
@@ -829,19 +729,19 @@ void tst_QNetworkSession::sessionOpenCloseStop()
}
if (state == QNetworkSession::Roaming) {
- QTRY_VERIFY(session.state() == QNetworkSession::Connected);
- QTRY_VERIFY(session2.state() == QNetworkSession::Connected);
+ QTRY_VERIFY_WITH_TIMEOUT(session.state() == QNetworkSession::Connected, TestTimeOut);
+ QTRY_VERIFY_WITH_TIMEOUT(session2.state() == QNetworkSession::Connected, TestTimeOut);
roamedSuccessfully = true;
} else if (state == QNetworkSession::Closing) {
- QTRY_VERIFY(session2.state() == QNetworkSession::Disconnected);
- QTRY_VERIFY(session.state() == QNetworkSession::Connected ||
- session.state() == QNetworkSession::Disconnected);
+ QTRY_VERIFY_WITH_TIMEOUT(session2.state() == QNetworkSession::Disconnected, TestTimeOut);
+ QTRY_VERIFY_WITH_TIMEOUT(session.state() == QNetworkSession::Connected ||
+ session.state() == QNetworkSession::Disconnected, TestTimeOut );
roamedSuccessfully = false;
} else if (state == QNetworkSession::Disconnected) {
- QTRY_VERIFY(!errorSpy.isEmpty());
- QTRY_VERIFY(session2.state() == QNetworkSession::Disconnected);
+ QTRY_VERIFY_WITH_TIMEOUT(!errorSpy.isEmpty(), TestTimeOut);
+ QTRY_VERIFY_WITH_TIMEOUT(session2.state() == QNetworkSession::Disconnected, TestTimeOut);
} else if (state == QNetworkSession::Connected) {
- QTRY_VERIFY(errorSpy.isEmpty());
+ QTRY_VERIFY_WITH_TIMEOUT(errorSpy.isEmpty(),TestTimeOut);
if (stateChangedSpy.count() > 1) {
state = qvariant_cast<QNetworkSession::State>(stateChangedSpy.at(stateChangedSpy.count() - 2).at(0));
@@ -863,7 +763,7 @@ void tst_QNetworkSession::sessionOpenCloseStop()
if (session.isOpen())
QVERIFY(!sessionOpenedSpy3.isEmpty() || !errorSpy3.isEmpty());
session.stop();
- QTRY_VERIFY(session.state() == QNetworkSession::Disconnected);
+ QTRY_VERIFY_WITH_TIMEOUT(session.state() == QNetworkSession::Disconnected, TestTimeOut);
}
if (!roamedSuccessfully)
QVERIFY(!errorSpy.isEmpty());
@@ -892,8 +792,8 @@ void tst_QNetworkSession::sessionOpenCloseStop()
}
}
- QTRY_VERIFY(!sessionClosedSpy.isEmpty());
- QTRY_VERIFY(session.state() == QNetworkSession::Disconnected);
+ QTRY_VERIFY_WITH_TIMEOUT(!sessionClosedSpy.isEmpty(), TestTimeOut);
+ QTRY_VERIFY_WITH_TIMEOUT(session.state() == QNetworkSession::Disconnected, TestTimeOut);
}
QVERIFY(errorSpy2.isEmpty());
@@ -914,7 +814,7 @@ void tst_QNetworkSession::sessionOpenCloseStop()
int stateChangedCountBeforeClose = stateChangedSpy2.count();
session2.close();
- QTRY_VERIFY(!sessionClosedSpy2.isEmpty());
+ QTRY_VERIFY_WITH_TIMEOUT(!sessionClosedSpy2.isEmpty(), TestTimeOut);
QVERIFY(stateChangedSpy2.count() == stateChangedCountBeforeClose);
QVERIFY(sessionClosedSpy.isEmpty());
@@ -939,12 +839,12 @@ void tst_QNetworkSession::sessionOpenCloseStop()
session.close();
- QTRY_VERIFY(!sessionClosedSpy.isEmpty() || !errorSpy.isEmpty());
+ QTRY_VERIFY_WITH_TIMEOUT(!sessionClosedSpy.isEmpty() || !errorSpy.isEmpty(), TestTimeOut);
QVERIFY(!session.isOpen());
if (expectStateChange)
- QTRY_VERIFY(!stateChangedSpy.isEmpty() || !errorSpy.isEmpty());
+ QTRY_VERIFY_WITH_TIMEOUT(!stateChangedSpy.isEmpty() || !errorSpy.isEmpty(), TestTimeOut);
if (!errorSpy.isEmpty()) {
QNetworkSession::SessionError error =
@@ -973,7 +873,7 @@ void tst_QNetworkSession::sessionOpenCloseStop()
QVERIFY(errorSpy.isEmpty());
if (expectStateChange)
- QTRY_VERIFY(session.state() == QNetworkSession::Disconnected);
+ QTRY_VERIFY_WITH_TIMEOUT(session.state() == QNetworkSession::Disconnected, TestTimeOut);
++inProcessSessionManagementCount;
} else {
@@ -1035,7 +935,7 @@ void tst_QNetworkSession::outOfProcessSession()
QNetworkConfiguration changed;
do {
- QTRY_VERIFY(!spy.isEmpty());
+ QTRY_VERIFY_WITH_TIMEOUT(!spy.isEmpty(), TestTimeOut);
changed = qvariant_cast<QNetworkConfiguration>(spy.takeFirst().at(0));
} while (changed.identifier() != identifier);
@@ -1055,7 +955,7 @@ void tst_QNetworkSession::outOfProcessSession()
oopSocket->waitForBytesWritten();
do {
- QTRY_VERIFY(!spy.isEmpty());
+ QTRY_VERIFY_WITH_TIMEOUT(!spy.isEmpty(), TestTimeOut);
changed = qvariant_cast<QNetworkConfiguration>(spy.takeFirst().at(0));
} while (changed.identifier() != identifier);
@@ -1342,7 +1242,7 @@ void tst_QNetworkSession::sessionAutoClose()
// set session to auto close at next polling interval.
session.setSessionProperty(QLatin1String("AutoCloseSessionTimeout"), 0);
- QTRY_VERIFY(!closeSpy.isEmpty());
+ QTRY_VERIFY_WITH_TIMEOUT(!closeSpy.isEmpty(), TestTimeOut);
QCOMPARE(session.state(), QNetworkSession::Connected);
@@ -1356,7 +1256,7 @@ void tst_QNetworkSession::sessionAutoClose()
QCOMPARE(autoCloseSession.toInt(), -1);
}
+#endif
QTEST_MAIN(tst_QNetworkSession)
-
#include "tst_qnetworksession.moc"
diff --git a/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp b/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp
index ae78e10440..38aa684ec9 100644
--- a/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp
+++ b/tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp b/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp
index 8af3a37665..7869ab76fe 100644
--- a/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp
+++ b/tests/auto/network/kernel/qhostaddress/tst_qhostaddress.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -157,67 +157,67 @@ void tst_QHostAddress::setAddress_QString_data()
QTest::addColumn<int>("protocol"); // 4: IPv4, 6: IPv6, other: undefined
//next we fill it with data
- QTest::newRow("ip4_00") << QString("127.0.0.1") << (bool)TRUE << QString("127.0.0.1") << 4;
- QTest::newRow("ip4_01") << QString("255.3.2.1") << (bool)TRUE << QString("255.3.2.1") << 4;
- QTest::newRow("ip4_03") << QString(" 255.3.2.1") << (bool)TRUE << QString("255.3.2.1") << 4;
- QTest::newRow("ip4_04") << QString("255.3.2.1\r ") << (bool)TRUE << QString("255.3.2.1") << 4;
- QTest::newRow("ip4_05") << QString("0.0.0.0") << (bool)TRUE << QString("0.0.0.0") << 4;
+ QTest::newRow("ip4_00") << QString("127.0.0.1") << true << QString("127.0.0.1") << 4;
+ QTest::newRow("ip4_01") << QString("255.3.2.1") << true << QString("255.3.2.1") << 4;
+ QTest::newRow("ip4_03") << QString(" 255.3.2.1") << true << QString("255.3.2.1") << 4;
+ QTest::newRow("ip4_04") << QString("255.3.2.1\r ") << true << QString("255.3.2.1") << 4;
+ QTest::newRow("ip4_05") << QString("0.0.0.0") << true << QString("0.0.0.0") << 4;
// for the format of IPv6 addresses see also RFC 5952
- QTest::newRow("ip6_00") << QString("FEDC:BA98:7654:3210:FEDC:BA98:7654:3210") << (bool)TRUE << QString("FEDC:BA98:7654:3210:FEDC:BA98:7654:3210") << 6;
- QTest::newRow("ip6_01") << QString("1080:0000:0000:0000:0008:0800:200C:417A") << (bool)TRUE << QString("1080::8:800:200C:417A") << 6;
- QTest::newRow("ip6_02") << QString("1080:0:0:0:8:800:200C:417A") << (bool)TRUE << QString("1080::8:800:200C:417A") << 6;
- QTest::newRow("ip6_03") << QString("1080::8:800:200C:417A") << (bool)TRUE << QString("1080::8:800:200C:417A") << 6;
- QTest::newRow("ip6_04") << QString("FF01::43") << (bool)TRUE << QString("FF01::43") << 6;
- QTest::newRow("ip6_05") << QString("::1") << (bool)TRUE << QString("::1") << 6;
- QTest::newRow("ip6_06") << QString("1::") << (bool)TRUE << QString("1::") << 6;
- QTest::newRow("ip6_07") << QString("::") << (bool)TRUE << QString("::") << 6;
- QTest::newRow("ip6_08") << QString("0:0:0:0:0:0:13.1.68.3") << (bool)TRUE << QString("::D01:4403") << 6;
- QTest::newRow("ip6_09") << QString("::13.1.68.3") << (bool)TRUE << QString("::D01:4403") << 6;
- QTest::newRow("ip6_10") << QString("0:0:0:0:0:FFFF:129.144.52.38") << (bool)TRUE << QString("::FFFF:8190:3426") << 6;
- QTest::newRow("ip6_11") << QString("::FFFF:129.144.52.38") << (bool)TRUE << QString("::FFFF:8190:3426") << 6;
- QTest::newRow("ip6_12") << QString("1::FFFF:129.144.52.38") << (bool)TRUE << QString("1::FFFF:8190:3426") << 6;
- QTest::newRow("ip6_13") << QString("A:B::D:E") << (bool)TRUE << QString("A:B::D:E") << 6;
- QTest::newRow("ip6_14") << QString("1080:0:1:0:8:800:200C:417A") << (bool)TRUE << QString("1080:0:1:0:8:800:200C:417A") << 6;
- QTest::newRow("ip6_15") << QString("1080:0:1:0:8:800:200C:0") << (bool)TRUE << QString("1080:0:1:0:8:800:200C:0") << 6;
- QTest::newRow("ip6_16") << QString("1080:0:1:0:8:800:0:0") << (bool)TRUE << QString("1080:0:1:0:8:800::") << 6;
- QTest::newRow("ip6_17") << QString("1080:0:0:0:8:800:0:0") << (bool)TRUE << QString("1080::8:800:0:0") << 6;
- QTest::newRow("ip6_18") << QString("0:1:1:1:8:800:0:0") << (bool)TRUE << QString("0:1:1:1:8:800::") << 6;
- QTest::newRow("ip6_19") << QString("0:1:1:1:8:800:0:1") << (bool)TRUE << QString("0:1:1:1:8:800:0:1") << 6;
-
- QTest::newRow("error_00") << QString("foobarcom") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_01") << QString("foo.bar.com") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_02") << QString("") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_03") << QString() << (bool)FALSE << QString() << 0;
- QTest::newRow("error_04") << QString(" \t\r") << (bool)FALSE << QString() << 0;
-
- QTest::newRow("error_ip4_00") << QString("256.9.9.9") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip4_01") << QString("-1.9.9.9") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip4_02") << QString("123.0.0") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip4_03") << QString("123.0.0.0.0") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip4_04") << QString("255.2 3.2.1") << (bool)FALSE << QString() << 0;
-
- QTest::newRow("error_ip6_00") << QString(":") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip6_01") << QString(":::") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip6_02") << QString("::AAAA:") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip6_03") << QString(":AAAA::") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip6_04") << QString("FFFF:::129.144.52.38") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip6_05") << QString("FEDC:BA98:7654:3210:FEDC:BA98:7654:3210:1234") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip6_06") << QString("129.144.52.38::") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip6_07") << QString("::129.144.52.38:129.144.52.38") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip6_08") << QString(":::129.144.52.38") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip6_09") << QString("1FEDC:BA98:7654:3210:FEDC:BA98:7654:3210") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip6_10") << QString("::FFFFFFFF") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip6_11") << QString("::EFGH") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip6_12") << QString("ABCD:ABCD:ABCD") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip6_13") << QString("::ABCD:ABCD::") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip6_14") << QString("1::2::3") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip6_15") << QString("1:2:::") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip6_16") << QString(":::1:2") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip6_17") << QString("1:::2") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip6_18") << QString("FEDC::7654:3210:FEDC:BA98::3210") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip6_19") << QString("ABCD:ABCD:ABCD:1.2.3.4") << (bool)FALSE << QString() << 0;
- QTest::newRow("error_ip6_20") << QString("ABCD::ABCD::ABCD:1.2.3.4") << (bool)FALSE << QString() << 0;
+ QTest::newRow("ip6_00") << QString("FEDC:BA98:7654:3210:FEDC:BA98:7654:3210") << true << QString("FEDC:BA98:7654:3210:FEDC:BA98:7654:3210") << 6;
+ QTest::newRow("ip6_01") << QString("1080:0000:0000:0000:0008:0800:200C:417A") << true << QString("1080::8:800:200C:417A") << 6;
+ QTest::newRow("ip6_02") << QString("1080:0:0:0:8:800:200C:417A") << true << QString("1080::8:800:200C:417A") << 6;
+ QTest::newRow("ip6_03") << QString("1080::8:800:200C:417A") << true << QString("1080::8:800:200C:417A") << 6;
+ QTest::newRow("ip6_04") << QString("FF01::43") << true << QString("FF01::43") << 6;
+ QTest::newRow("ip6_05") << QString("::1") << true << QString("::1") << 6;
+ QTest::newRow("ip6_06") << QString("1::") << true << QString("1::") << 6;
+ QTest::newRow("ip6_07") << QString("::") << true << QString("::") << 6;
+ QTest::newRow("ip6_08") << QString("0:0:0:0:0:0:13.1.68.3") << true << QString("::D01:4403") << 6;
+ QTest::newRow("ip6_09") << QString("::13.1.68.3") << true << QString("::D01:4403") << 6;
+ QTest::newRow("ip6_10") << QString("0:0:0:0:0:FFFF:129.144.52.38") << true << QString("::FFFF:8190:3426") << 6;
+ QTest::newRow("ip6_11") << QString("::FFFF:129.144.52.38") << true << QString("::FFFF:8190:3426") << 6;
+ QTest::newRow("ip6_12") << QString("1::FFFF:129.144.52.38") << true << QString("1::FFFF:8190:3426") << 6;
+ QTest::newRow("ip6_13") << QString("A:B::D:E") << true << QString("A:B::D:E") << 6;
+ QTest::newRow("ip6_14") << QString("1080:0:1:0:8:800:200C:417A") << true << QString("1080:0:1:0:8:800:200C:417A") << 6;
+ QTest::newRow("ip6_15") << QString("1080:0:1:0:8:800:200C:0") << true << QString("1080:0:1:0:8:800:200C:0") << 6;
+ QTest::newRow("ip6_16") << QString("1080:0:1:0:8:800:0:0") << true << QString("1080:0:1:0:8:800::") << 6;
+ QTest::newRow("ip6_17") << QString("1080:0:0:0:8:800:0:0") << true << QString("1080::8:800:0:0") << 6;
+ QTest::newRow("ip6_18") << QString("0:1:1:1:8:800:0:0") << true << QString("0:1:1:1:8:800::") << 6;
+ QTest::newRow("ip6_19") << QString("0:1:1:1:8:800:0:1") << true << QString("0:1:1:1:8:800:0:1") << 6;
+
+ QTest::newRow("error_00") << QString("foobarcom") << false << QString() << 0;
+ QTest::newRow("error_01") << QString("foo.bar.com") << false << QString() << 0;
+ QTest::newRow("error_02") << QString("") << false << QString() << 0;
+ QTest::newRow("error_03") << QString() << false << QString() << 0;
+ QTest::newRow("error_04") << QString(" \t\r") << false << QString() << 0;
+
+ QTest::newRow("error_ip4_00") << QString("256.9.9.9") << false << QString() << 0;
+ QTest::newRow("error_ip4_01") << QString("-1.9.9.9") << false << QString() << 0;
+ QTest::newRow("error_ip4_02") << QString("123.0.0") << false << QString() << 0;
+ QTest::newRow("error_ip4_03") << QString("123.0.0.0.0") << false << QString() << 0;
+ QTest::newRow("error_ip4_04") << QString("255.2 3.2.1") << false << QString() << 0;
+
+ QTest::newRow("error_ip6_00") << QString(":") << false << QString() << 0;
+ QTest::newRow("error_ip6_01") << QString(":::") << false << QString() << 0;
+ QTest::newRow("error_ip6_02") << QString("::AAAA:") << false << QString() << 0;
+ QTest::newRow("error_ip6_03") << QString(":AAAA::") << false << QString() << 0;
+ QTest::newRow("error_ip6_04") << QString("FFFF:::129.144.52.38") << false << QString() << 0;
+ QTest::newRow("error_ip6_05") << QString("FEDC:BA98:7654:3210:FEDC:BA98:7654:3210:1234") << false << QString() << 0;
+ QTest::newRow("error_ip6_06") << QString("129.144.52.38::") << false << QString() << 0;
+ QTest::newRow("error_ip6_07") << QString("::129.144.52.38:129.144.52.38") << false << QString() << 0;
+ QTest::newRow("error_ip6_08") << QString(":::129.144.52.38") << false << QString() << 0;
+ QTest::newRow("error_ip6_09") << QString("1FEDC:BA98:7654:3210:FEDC:BA98:7654:3210") << false << QString() << 0;
+ QTest::newRow("error_ip6_10") << QString("::FFFFFFFF") << false << QString() << 0;
+ QTest::newRow("error_ip6_11") << QString("::EFGH") << false << QString() << 0;
+ QTest::newRow("error_ip6_12") << QString("ABCD:ABCD:ABCD") << false << QString() << 0;
+ QTest::newRow("error_ip6_13") << QString("::ABCD:ABCD::") << false << QString() << 0;
+ QTest::newRow("error_ip6_14") << QString("1::2::3") << false << QString() << 0;
+ QTest::newRow("error_ip6_15") << QString("1:2:::") << false << QString() << 0;
+ QTest::newRow("error_ip6_16") << QString(":::1:2") << false << QString() << 0;
+ QTest::newRow("error_ip6_17") << QString("1:::2") << false << QString() << 0;
+ QTest::newRow("error_ip6_18") << QString("FEDC::7654:3210:FEDC:BA98::3210") << false << QString() << 0;
+ QTest::newRow("error_ip6_19") << QString("ABCD:ABCD:ABCD:1.2.3.4") << false << QString() << 0;
+ QTest::newRow("error_ip6_20") << QString("ABCD::ABCD::ABCD:1.2.3.4") << false << QString() << 0;
}
diff --git a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
index 9226b3475a..6c89819094 100644
--- a/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
+++ b/tests/auto/network/kernel/qhostinfo/tst_qhostinfo.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -356,7 +356,7 @@ void tst_QHostInfo::reverseLookup_data()
QTest::addColumn<int>("err");
QTest::addColumn<bool>("ipv6");
- QTest::newRow("trolltech.com") << QString("62.70.27.69") << QStringList(QString("diverse.troll.no")) << 0 << false;
+ QTest::newRow("google-public-dns-a.google.com") << QString("8.8.8.8") << QStringList(QString("google-public-dns-a.google.com")) << 0 << false;
QTest::newRow("gitorious.org") << QString("87.238.52.168") << QStringList(QString("gitorious.org")) << 0 << false;
QTest::newRow("bogus-name") << QString("1::2::3::4") << QStringList() << 1 << true;
}
diff --git a/tests/auto/network/kernel/qnetworkaddressentry/tst_qnetworkaddressentry.cpp b/tests/auto/network/kernel/qnetworkaddressentry/tst_qnetworkaddressentry.cpp
index d210cdfdfb..cc46427653 100644
--- a/tests/auto/network/kernel/qnetworkaddressentry/tst_qnetworkaddressentry.cpp
+++ b/tests/auto/network/kernel/qnetworkaddressentry/tst_qnetworkaddressentry.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp b/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp
index f8a9def46a..9a82be67a7 100644
--- a/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp
+++ b/tests/auto/network/kernel/qnetworkinterface/tst_qnetworkinterface.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -45,8 +45,10 @@
#include <qcoreapplication.h>
#include <qnetworkinterface.h>
#include <qtcpsocket.h>
+#ifndef QT_NO_BEARERMANAGEMENT
#include <QNetworkConfigurationManager>
#include <QNetworkSession>
+#endif
#include "../../../network-settings.h"
class tst_QNetworkInterface : public QObject
@@ -68,7 +70,7 @@ private slots:
void copyInvalidInterface();
private:
-#ifndef QT_NO_BEARER_MANAGEMENT
+#ifndef QT_NO_BEARERMANAGEMENT
QNetworkConfigurationManager *netConfMan;
QNetworkConfiguration networkConfiguration;
QScopedPointer<QNetworkSession> networkSession;
diff --git a/tests/auto/network/kernel/qnetworkproxy/tst_qnetworkproxy.cpp b/tests/auto/network/kernel/qnetworkproxy/tst_qnetworkproxy.cpp
index a96e771c0d..70a6eaa9df 100644
--- a/tests/auto/network/kernel/qnetworkproxy/tst_qnetworkproxy.cpp
+++ b/tests/auto/network/kernel/qnetworkproxy/tst_qnetworkproxy.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp b/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
index de06a54447..088a5361ab 100644
--- a/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
+++ b/tests/auto/network/kernel/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
index 5cd57b587e..d315e1e76b 100644
--- a/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
+++ b/tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/socket/qabstractsocket/tst_qabstractsocket.cpp b/tests/auto/network/socket/qabstractsocket/tst_qabstractsocket.cpp
index 5b115f81bc..f39a9c66bf 100644
--- a/tests/auto/network/socket/qabstractsocket/tst_qabstractsocket.cpp
+++ b/tests/auto/network/socket/qabstractsocket/tst_qabstractsocket.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp b/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp
index 93344a3bf4..b411dd2651 100644
--- a/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp
+++ b/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -50,7 +50,6 @@
#include <qhostinfo.h>
#include <qhostaddress.h>
#include <qtcpsocket.h>
-#include <qhttp.h>
#include <qdebug.h>
#include <qtcpserver.h>
diff --git a/tests/auto/network/socket/qlocalsocket/example/client/main.cpp b/tests/auto/network/socket/qlocalsocket/example/client/main.cpp
index acf5cbc388..86b6b34cf3 100644
--- a/tests/auto/network/socket/qlocalsocket/example/client/main.cpp
+++ b/tests/auto/network/socket/qlocalsocket/example/client/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/socket/qlocalsocket/example/server/main.cpp b/tests/auto/network/socket/qlocalsocket/example/server/main.cpp
index 0d3de3a2e1..06c8b8501f 100644
--- a/tests/auto/network/socket/qlocalsocket/example/server/main.cpp
+++ b/tests/auto/network/socket/qlocalsocket/example/server/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/socket/qlocalsocket/lackey/main.cpp b/tests/auto/network/socket/qlocalsocket/lackey/main.cpp
index f7b2ff10b3..014a6eb2f8 100644
--- a/tests/auto/network/socket/qlocalsocket/lackey/main.cpp
+++ b/tests/auto/network/socket/qlocalsocket/lackey/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
index b4449df86c..87cfaeed6c 100644
--- a/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
+++ b/tests/auto/network/socket/qlocalsocket/tst_qlocalsocket.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -264,7 +264,7 @@ void tst_QLocalSocket::socket_basic()
QCOMPARE(socket.isValid(), false);
QVERIFY(socket.readBufferSize() == 0);
socket.setReadBufferSize(0);
- //QCOMPARE(socket.socketDescriptor(), -1);
+ //QCOMPARE(socket.socketDescriptor(), (qintptr)-1);
QCOMPARE(socket.state(), QLocalSocket::UnconnectedState);
QCOMPARE(socket.waitForConnected(0), false);
QCOMPARE(socket.waitForDisconnected(0), false);
@@ -632,7 +632,7 @@ void tst_QLocalSocket::hitMaximumConnections()
void tst_QLocalSocket::setSocketDescriptor()
{
LocalSocket socket;
- quintptr minusOne = -1;
+ qintptr minusOne = -1;
socket.setSocketDescriptor(minusOne, QLocalSocket::ConnectingState, QIODevice::Append);
QCOMPARE(socket.socketDescriptor(), minusOne);
QCOMPARE(socket.state(), QLocalSocket::ConnectingState);
@@ -717,6 +717,7 @@ void tst_QLocalSocket::threadedConnection()
server.mutex.lock();
server.start();
server.wc.wait(&server.mutex);
+ server.mutex.unlock();
QList<Client*> clients;
for (int i = 0; i < threads; ++i) {
diff --git a/tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro b/tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro
index f3c24e19fd..389c8ca4dc 100644
--- a/tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro
+++ b/tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro
@@ -10,4 +10,7 @@ MOC_DIR=tmp
QT = core-private network-private testlib
+# QTBUG-23380 - udpTest failing on Ubuntu 11.10 x64
+linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test
+
requires(contains(QT_CONFIG,private_tests))
diff --git a/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp
index 8c600c5400..df677875e6 100644
--- a/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp
+++ b/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -52,7 +52,6 @@
#include <qhostinfo.h>
#include <qhostaddress.h>
#include <qtcpsocket.h>
-#include <qhttp.h>
#include <qauthenticator.h>
#include <qdebug.h>
#include <qtcpserver.h>
diff --git a/tests/auto/network/socket/qtcpserver/crashingServer/main.cpp b/tests/auto/network/socket/qtcpserver/crashingServer/main.cpp
index e223bff8c5..f2e813497b 100644
--- a/tests/auto/network/socket/qtcpserver/crashingServer/main.cpp
+++ b/tests/auto/network/socket/qtcpserver/crashingServer/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp
index c1897779e1..0f4e60e258 100644
--- a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp
+++ b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -191,7 +191,7 @@ void tst_QTcpServer::constructing()
QCOMPARE(socket.serverAddress(), QHostAddress());
QCOMPARE(socket.maxPendingConnections(), 30);
QCOMPARE(socket.hasPendingConnections(), false);
- QCOMPARE(socket.socketDescriptor(), -1);
+ QCOMPARE(socket.socketDescriptor(), (qintptr)-1);
QCOMPARE(socket.serverError(), QAbstractSocket::UnknownSocketError);
// Check the state of the socket layer?
@@ -510,7 +510,7 @@ public:
bool ok;
protected:
- void incomingConnection(int socketDescriptor)
+ void incomingConnection(qintptr socketDescriptor)
{
// how a user woulddo it (qabstractsocketengine is not public)
unsigned long arg = 0;
diff --git a/tests/auto/network/socket/qtcpsocket/qtcpsocket.pro b/tests/auto/network/socket/qtcpsocket/qtcpsocket.pro
index aa7ac6bbb7..a7b9f6126e 100644
--- a/tests/auto/network/socket/qtcpsocket/qtcpsocket.pro
+++ b/tests/auto/network/socket/qtcpsocket/qtcpsocket.pro
@@ -4,5 +4,6 @@ TEMPLATE = subdirs
!wince*: SUBDIRS = test stressTest
wince*|vxworks* : SUBDIRS = test
+linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):DEFINES+=UBUNTU_ONEIRIC
requires(contains(QT_CONFIG,private_tests))
diff --git a/tests/auto/network/socket/qtcpsocket/stressTest/Test.cpp b/tests/auto/network/socket/qtcpsocket/stressTest/Test.cpp
index 995fc0528c..a112966b41 100644
--- a/tests/auto/network/socket/qtcpsocket/stressTest/Test.cpp
+++ b/tests/auto/network/socket/qtcpsocket/stressTest/Test.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -107,7 +107,7 @@ My4Server::My4Server(QObject *parent)
}
//------------------------------------------------------------------------------
-void My4Server::incomingConnection(int socketId)
+void My4Server::incomingConnection(qintptr socketId)
{
m_socket = new My4Socket(this);
m_socket->setSocketDescriptor(socketId);
diff --git a/tests/auto/network/socket/qtcpsocket/stressTest/Test.h b/tests/auto/network/socket/qtcpsocket/stressTest/Test.h
index 5440e7ffa9..3adcbe4e5c 100644
--- a/tests/auto/network/socket/qtcpsocket/stressTest/Test.h
+++ b/tests/auto/network/socket/qtcpsocket/stressTest/Test.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -69,7 +69,7 @@ public:
My4Server(QObject *parent = 0);
protected:
- void incomingConnection(int socket);
+ void incomingConnection(qintptr socket);
private slots:
void stopServer();
diff --git a/tests/auto/network/socket/qtcpsocket/stressTest/main.cpp b/tests/auto/network/socket/qtcpsocket/stressTest/main.cpp
index 76ce7bd820..57194a4948 100644
--- a/tests/auto/network/socket/qtcpsocket/stressTest/main.cpp
+++ b/tests/auto/network/socket/qtcpsocket/stressTest/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
index 218e372e4d..c9c7054960 100644
--- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
+++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -458,7 +458,7 @@ void tst_QTcpSocket::constructing()
QCOMPARE((int) socket->bytesAvailable(), 0);
QCOMPARE(socket->canReadLine(), false);
QCOMPARE(socket->readLine(), QByteArray());
- QCOMPARE(socket->socketDescriptor(), -1);
+ QCOMPARE(socket->socketDescriptor(), (qintptr)-1);
QCOMPARE((int) socket->localPort(), 0);
QVERIFY(socket->localAddress() == QHostAddress());
QCOMPARE((int) socket->peerPort(), 0);
@@ -538,9 +538,9 @@ void tst_QTcpSocket::bind()
void tst_QTcpSocket::setInvalidSocketDescriptor()
{
QTcpSocket *socket = newSocket();
- QCOMPARE(socket->socketDescriptor(), -1);
+ QCOMPARE(socket->socketDescriptor(), (qintptr)-1);
QVERIFY(!socket->setSocketDescriptor(-5, QTcpSocket::UnconnectedState));
- QCOMPARE(socket->socketDescriptor(), -1);
+ QCOMPARE(socket->socketDescriptor(), (qintptr)-1);
QCOMPARE(socket->error(), QTcpSocket::UnsupportedSocketOperationError);
@@ -577,17 +577,17 @@ void tst_QTcpSocket::setSocketDescriptor()
QVERIFY(sock != INVALID_SOCKET);
QTcpSocket *socket = newSocket();
QVERIFY(socket->setSocketDescriptor(sock, QTcpSocket::UnconnectedState));
- QCOMPARE(socket->socketDescriptor(), (int)sock);
+ QCOMPARE(socket->socketDescriptor(), (qintptr)sock);
qt_qhostinfo_clear_cache(); //avoid the HostLookupState being skipped due to address being in cache from previous test.
socket->connectToHost(QtNetworkSettings::serverName(), 143);
QCOMPARE(socket->state(), QTcpSocket::HostLookupState);
- QCOMPARE(socket->socketDescriptor(), (int)sock);
+ QCOMPARE(socket->socketDescriptor(), (qintptr)sock);
QVERIFY(socket->waitForConnected(10000));
// skip this, it has been broken for years, see task 260735
// if somebody complains, consider fixing it, but it might break existing applications.
QEXPECT_FAIL("", "bug has been around for years, will not fix without need", Continue);
- QCOMPARE(socket->socketDescriptor(), (int)sock);
+ QCOMPARE(socket->socketDescriptor(), (qintptr)sock);
delete socket;
#ifdef Q_OS_WIN
delete dummy;
@@ -600,7 +600,7 @@ void tst_QTcpSocket::socketDescriptor()
{
QTcpSocket *socket = newSocket();
- QCOMPARE(socket->socketDescriptor(), -1);
+ QCOMPARE(socket->socketDescriptor(), (qintptr)-1);
socket->connectToHost(QtNetworkSettings::serverName(), 143);
QVERIFY((socket->state() == QAbstractSocket::HostLookupState && socket->socketDescriptor() == -1) ||
(socket->state() == QAbstractSocket::ConnectingState && socket->socketDescriptor() != -1));
@@ -1025,7 +1025,7 @@ void tst_QTcpSocket::openCloseOpenClose()
QCOMPARE((int) socket->bytesAvailable(), 0);
QCOMPARE(socket->canReadLine(), false);
QCOMPARE(socket->readLine(), QByteArray());
- QCOMPARE(socket->socketDescriptor(), -1);
+ QCOMPARE(socket->socketDescriptor(), (qintptr)-1);
QCOMPARE((int) socket->localPort(), 0);
QVERIFY(socket->localAddress() == QHostAddress());
QCOMPARE((int) socket->peerPort(), 0);
@@ -2259,6 +2259,9 @@ void tst_QTcpSocket::suddenRemoteDisconnect()
QVERIFY(stopWatch.elapsed() < 20000);
// Check that both exited normally.
+#if defined(UBUNTU_ONEIRIC) && defined(__x86_64__)
+ QEXPECT_FAIL("", "Fails on this platform", Abort);
+#endif
QCOMPARE(clientProcess.readAll().constData(), "SUCCESS\n");
QCOMPARE(serverProcess.readAll().constData(), "SUCCESS\n");
}
diff --git a/tests/auto/network/socket/qudpsocket/clientserver/main.cpp b/tests/auto/network/socket/qudpsocket/clientserver/main.cpp
index 9145a5199f..a88c0f1335 100644
--- a/tests/auto/network/socket/qudpsocket/clientserver/main.cpp
+++ b/tests/auto/network/socket/qudpsocket/clientserver/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
index a0928b42eb..fb23483451 100644
--- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
+++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -63,7 +63,9 @@
Q_DECLARE_METATYPE(QHostAddress)
Q_DECLARE_METATYPE(QNetworkInterface)
+#ifndef QT_NO_BEARERMANAGEMENT
Q_DECLARE_METATYPE(QSharedPointer<QNetworkSession>)
+#endif
QT_FORWARD_DECLARE_CLASS(QUdpSocket)
@@ -195,7 +197,7 @@ void tst_QUdpSocket::constructing()
QCOMPARE((int) socket.bytesAvailable(), 0);
QCOMPARE(socket.canReadLine(), false);
QCOMPARE(socket.readLine(), QByteArray());
- QCOMPARE(socket.socketDescriptor(), -1);
+ QCOMPARE(socket.socketDescriptor(), (qintptr)-1);
QCOMPARE(socket.error(), QUdpSocket::UnknownSocketError);
QCOMPARE(socket.errorString(), QString("Unknown error"));
diff --git a/tests/auto/network/socket/qudpsocket/udpServer/main.cpp b/tests/auto/network/socket/qudpsocket/udpServer/main.cpp
index ff3ca111d0..90ddcf1748 100644
--- a/tests/auto/network/socket/qudpsocket/udpServer/main.cpp
+++ b/tests/auto/network/socket/qudpsocket/udpServer/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/socket/socket.pro b/tests/auto/network/socket/socket.pro
index 49fb52d1a5..426dca2277 100644
--- a/tests/auto/network/socket/socket.pro
+++ b/tests/auto/network/socket/socket.pro
@@ -10,8 +10,7 @@ SUBDIRS=\
platformsocketengine \
!contains(QT_CONFIG, private_tests): SUBDIRS -= \
- platformsocketengine \
- qhttpsocketengine \
- qsocks5socketengine \
-
-
+ platformsocketengine \
+ qtcpsocket \
+ qhttpsocketengine \
+ qsocks5socketengine \
diff --git a/tests/auto/network/ssl/qsslcertificate/certificates/gencertificates.sh b/tests/auto/network/ssl/qsslcertificate/certificates/gencertificates.sh
index 0bac191326..915bf796b1 100755
--- a/tests/auto/network/ssl/qsslcertificate/certificates/gencertificates.sh
+++ b/tests/auto/network/ssl/qsslcertificate/certificates/gencertificates.sh
@@ -1,7 +1,7 @@
#!/bin/sh
#############################################################################
##
-## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+## Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation (qt-info@nokia.com)
##
diff --git a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
index a521d0e389..a2fab2b479 100644
--- a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
+++ b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -200,10 +200,8 @@ void tst_QSslCertificate::emptyConstructor()
QCOMPARE(certificate.issuerInfo(QSslCertificate::Organization), QStringList());
QCOMPARE(certificate.subjectInfo(QSslCertificate::Organization), QStringList());
QCOMPARE(certificate.subjectAlternativeNames(),(QMultiMap<QSsl::AlternativeNameEntryType, QString>()));
-#ifndef QT_NO_TEXTSTREAM
QCOMPARE(certificate.effectiveDate(), QDateTime());
QCOMPARE(certificate.expiryDate(), QDateTime());
-#endif
}
Q_DECLARE_METATYPE(QSsl::EncodingFormat);
diff --git a/tests/auto/network/ssl/qsslcipher/tst_qsslcipher.cpp b/tests/auto/network/ssl/qsslcipher/tst_qsslcipher.cpp
index 5fe4d03bdd..89b735aed3 100644
--- a/tests/auto/network/ssl/qsslcipher/tst_qsslcipher.cpp
+++ b/tests/auto/network/ssl/qsslcipher/tst_qsslcipher.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/ssl/qsslerror/tst_qsslerror.cpp b/tests/auto/network/ssl/qsslerror/tst_qsslerror.cpp
index 3fae88ec00..481d73650b 100644
--- a/tests/auto/network/ssl/qsslerror/tst_qsslerror.cpp
+++ b/tests/auto/network/ssl/qsslerror/tst_qsslerror.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/ssl/qsslkey/keys/genkeys.sh b/tests/auto/network/ssl/qsslkey/keys/genkeys.sh
index 559ef5cf5d..087a3a64b9 100755
--- a/tests/auto/network/ssl/qsslkey/keys/genkeys.sh
+++ b/tests/auto/network/ssl/qsslkey/keys/genkeys.sh
@@ -1,7 +1,7 @@
#!/bin/sh
#############################################################################
##
-## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+## Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation (qt-info@nokia.com)
##
diff --git a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
index fe79c39363..cf1489c76c 100644
--- a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
+++ b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/ssl/qsslsocket/qsslsocket.pro b/tests/auto/network/ssl/qsslsocket/qsslsocket.pro
index cc24add331..2739a7eb25 100644
--- a/tests/auto/network/ssl/qsslsocket/qsslsocket.pro
+++ b/tests/auto/network/ssl/qsslsocket/qsslsocket.pro
@@ -32,4 +32,7 @@ wince* {
DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
+# QTBUG-23575
+linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):DEFINES+=UBUNTU_ONEIRIC
+
requires(contains(QT_CONFIG,private_tests))
diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
index a83611e2b5..96aea6a4e5 100644
--- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -396,7 +396,7 @@ void tst_QSslSocket::constructing()
QCOMPARE(socket.peerPort(), quint16(0));
QCOMPARE(socket.proxy().type(), QNetworkProxy::DefaultProxy);
QCOMPARE(socket.readBufferSize(), qint64(0));
- QCOMPARE(socket.socketDescriptor(), -1);
+ QCOMPARE(socket.socketDescriptor(), (qintptr)-1);
QCOMPARE(socket.socketType(), QAbstractSocket::TcpSocket);
QVERIFY(!socket.waitForConnected(10));
QTest::ignoreMessage(QtWarningMsg, "QSslSocket::waitForDisconnected() is not allowed in UnconnectedState");
@@ -912,7 +912,7 @@ public:
QString m_certFile;
protected:
- void incomingConnection(int socketDescriptor)
+ void incomingConnection(qintptr socketDescriptor)
{
socket = new QSslSocket(this);
socket->setProtocol(protocol);
@@ -947,7 +947,6 @@ protected slots:
void tst_QSslSocket::protocolServerSide_data()
{
-
QTest::addColumn<QSsl::SslProtocol>("serverProtocol");
QTest::addColumn<QSsl::SslProtocol>("clientProtocol");
QTest::addColumn<bool>("works");
@@ -1046,6 +1045,10 @@ void tst_QSslSocket::protocolServerSide()
QFETCH(bool, works);
QAbstractSocket::SocketState expectedState = (works) ? QAbstractSocket::ConnectedState : QAbstractSocket::UnconnectedState;
+#if defined(UBUNTU_ONEIRIC) && defined(__x86_64__)
+ QEXPECT_FAIL("ssl3-any", "QTBUG-23575 - Fails on this platform", Abort);
+ QEXPECT_FAIL("tls1.0-any", "QTBUG-23575 - Fails on this platform", Abort);
+#endif
QCOMPARE(int(client->state()), int(expectedState));
QCOMPARE(client->isEncrypted(), works);
}
@@ -1326,7 +1329,7 @@ void tst_QSslSocket::wildcard()
class SslServer2 : public QTcpServer
{
protected:
- void incomingConnection(int socketDescriptor)
+ void incomingConnection(qintptr socketDescriptor)
{
QSslSocket *socket = new QSslSocket(this);
socket->ignoreSslErrors();
@@ -1546,7 +1549,7 @@ public:
QSslSocket *socket;
protected:
- void incomingConnection(int socketDescriptor)
+ void incomingConnection(qintptr socketDescriptor)
{
socket = new QSslSocket(this);
connect(socket, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(ignoreErrorSlot()));
@@ -1715,7 +1718,7 @@ public:
QSslSocket *socket;
protected:
- void incomingConnection(int socketDescriptor)
+ void incomingConnection(qintptr socketDescriptor)
{
socket = new QSslSocket(this);
@@ -1761,6 +1764,9 @@ void tst_QSslSocket::verifyMode()
loop.exec();
QVERIFY(clientSocket.isEncrypted());
+#if defined(UBUNTU_ONEIRIC) && defined(__x86_64__)
+ QEXPECT_FAIL("", "QTBUG-23575 - Fails on this platform", Abort);
+#endif
QVERIFY(server.socket->sslErrors().isEmpty());
}
diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp
index 7e9c427192..d331658fc8 100644
--- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp
+++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp
index 59894244a4..4c76a44ac1 100644
--- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp
+++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/network/ssl/ssl.pro b/tests/auto/network/ssl/ssl.pro
index dd92ec0358..294caeba5a 100644
--- a/tests/auto/network/ssl/ssl.pro
+++ b/tests/auto/network/ssl/ssl.pro
@@ -7,3 +7,8 @@ SUBDIRS=\
qsslsocket \
qsslsocket_onDemandCertificates_member \
qsslsocket_onDemandCertificates_static \
+
+!contains(QT_CONFIG, private_tests): SUBDIRS -= \
+ qsslsocket \
+ qsslsocket_onDemandCertificates_member \
+ qsslsocket_onDemandCertificates_static \
diff --git a/tests/auto/opengl/qgl/tst_qgl.cpp b/tests/auto/opengl/qgl/tst_qgl.cpp
index 492c250b6b..0b8952f9ab 100644
--- a/tests/auto/opengl/qgl/tst_qgl.cpp
+++ b/tests/auto/opengl/qgl/tst_qgl.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/opengl/qglbuffer/tst_qglbuffer.cpp b/tests/auto/opengl/qglbuffer/tst_qglbuffer.cpp
index 399d624027..865a31bfce 100644
--- a/tests/auto/opengl/qglbuffer/tst_qglbuffer.cpp
+++ b/tests/auto/opengl/qglbuffer/tst_qglbuffer.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp b/tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp
index 7755d89c0b..3ad39f754a 100644
--- a/tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp
+++ b/tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
index 940220217d..97718d136a 100644
--- a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
+++ b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/opengl/qglthreads/tst_qglthreads.h b/tests/auto/opengl/qglthreads/tst_qglthreads.h
index 7972638085..54ada3bcce 100644
--- a/tests/auto/opengl/qglthreads/tst_qglthreads.h
+++ b/tests/auto/opengl/qglthreads/tst_qglthreads.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/atwrapper/atWrapper.cpp b/tests/auto/other/atwrapper/atWrapper.cpp
index 121f742201..5dc0cd599b 100644
--- a/tests/auto/other/atwrapper/atWrapper.cpp
+++ b/tests/auto/other/atwrapper/atWrapper.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/atwrapper/atWrapper.h b/tests/auto/other/atwrapper/atWrapper.h
index e325c087d8..48fe202267 100644
--- a/tests/auto/other/atwrapper/atWrapper.h
+++ b/tests/auto/other/atwrapper/atWrapper.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/atwrapper/atWrapperAutotest.cpp b/tests/auto/other/atwrapper/atWrapperAutotest.cpp
index 0c24286d6b..2ff3327349 100644
--- a/tests/auto/other/atwrapper/atWrapperAutotest.cpp
+++ b/tests/auto/other/atwrapper/atWrapperAutotest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/baselineexample/tst_baselineexample.cpp b/tests/auto/other/baselineexample/tst_baselineexample.cpp
index 73657bdf6d..7253082974 100644
--- a/tests/auto/other/baselineexample/tst_baselineexample.cpp
+++ b/tests/auto/other/baselineexample/tst_baselineexample.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/collections/tst_collections.cpp b/tests/auto/other/collections/tst_collections.cpp
index 3f96aa94d5..3c55897b46 100644
--- a/tests/auto/other/collections/tst_collections.cpp
+++ b/tests/auto/other/collections/tst_collections.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/compiler/baseclass.cpp b/tests/auto/other/compiler/baseclass.cpp
index 22ccba8f78..5eea58d1dc 100644
--- a/tests/auto/other/compiler/baseclass.cpp
+++ b/tests/auto/other/compiler/baseclass.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/compiler/baseclass.h b/tests/auto/other/compiler/baseclass.h
index e510112f2f..1cfa1079a4 100644
--- a/tests/auto/other/compiler/baseclass.h
+++ b/tests/auto/other/compiler/baseclass.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/compiler/derivedclass.cpp b/tests/auto/other/compiler/derivedclass.cpp
index 45ef6df3ee..e43e2f9b5b 100644
--- a/tests/auto/other/compiler/derivedclass.cpp
+++ b/tests/auto/other/compiler/derivedclass.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/compiler/derivedclass.h b/tests/auto/other/compiler/derivedclass.h
index c5fb61f46e..47227a95b5 100644
--- a/tests/auto/other/compiler/derivedclass.h
+++ b/tests/auto/other/compiler/derivedclass.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/compiler/tst_compiler.cpp b/tests/auto/other/compiler/tst_compiler.cpp
index b6fb391fb1..db57af63bb 100644
--- a/tests/auto/other/compiler/tst_compiler.cpp
+++ b/tests/auto/other/compiler/tst_compiler.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/exceptionsafety/tst_exceptionsafety.cpp b/tests/auto/other/exceptionsafety/tst_exceptionsafety.cpp
index ba384e0290..309f6b7d78 100644
--- a/tests/auto/other/exceptionsafety/tst_exceptionsafety.cpp
+++ b/tests/auto/other/exceptionsafety/tst_exceptionsafety.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/exceptionsafety_objects/oomsimulator.h b/tests/auto/other/exceptionsafety_objects/oomsimulator.h
index 15500f590b..0727723d47 100644
--- a/tests/auto/other/exceptionsafety_objects/oomsimulator.h
+++ b/tests/auto/other/exceptionsafety_objects/oomsimulator.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -173,17 +173,17 @@ static int qCrtAllocHook(int allocType, void * /*userData*/, size_t /*size*/,
const unsigned char * /*filename*/, int /*lineNumber*/)
{
if (blockType == _CRT_BLOCK)
- return TRUE; // ignore allocations from the C library
+ return true; // ignore allocations from the C library
switch (allocType) {
case _HOOK_ALLOC:
case _HOOK_REALLOC:
++mallocCount;
if (mallocFailActive && --mallocFailIndex < 0)
- return FALSE; // simulate OOM
+ return false; // simulate OOM
}
- return TRUE;
+ return true;
}
static struct QCrtDebugRegistrator
diff --git a/tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp b/tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp
index 304f834cac..7e569fe7f7 100644
--- a/tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp
+++ b/tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/gestures/tst_gestures.cpp b/tests/auto/other/gestures/tst_gestures.cpp
index 1a71f9170a..daa1893807 100644
--- a/tests/auto/other/gestures/tst_gestures.cpp
+++ b/tests/auto/other/gestures/tst_gestures.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/headersclean/tst_headersclean.cpp b/tests/auto/other/headersclean/tst_headersclean.cpp
index 4cc11caf71..807f97af69 100644
--- a/tests/auto/other/headersclean/tst_headersclean.cpp
+++ b/tests/auto/other/headersclean/tst_headersclean.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/lancelot/lancelot.pro b/tests/auto/other/lancelot/lancelot.pro
index bbb48c745e..ced8aceb99 100644
--- a/tests/auto/other/lancelot/lancelot.pro
+++ b/tests/auto/other/lancelot/lancelot.pro
@@ -10,7 +10,6 @@ RESOURCES += images.qrc
include($$PWD/../../../baselineserver/shared/qbaselinetest.pri)
-!wince*:DEFINES += SRCDIR=\\\"$$PWD\\\"
-linux-g++-maemo:DEFINES += USE_RUNTIME_DIR
+TESTDATA += scripts/*
CONFIG += insignificant_test # QTBUG-21402
diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp
index dc23575fc5..08c6918eb6 100644
--- a/tests/auto/other/lancelot/paintcommands.cpp
+++ b/tests/auto/other/lancelot/paintcommands.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/lancelot/paintcommands.h b/tests/auto/other/lancelot/paintcommands.h
index 925a867f2f..b22ab58b32 100644
--- a/tests/auto/other/lancelot/paintcommands.h
+++ b/tests/auto/other/lancelot/paintcommands.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/lancelot/tst_lancelot.cpp b/tests/auto/other/lancelot/tst_lancelot.cpp
index cbbd28dc82..50688ffa17 100644
--- a/tests/auto/other/lancelot/tst_lancelot.cpp
+++ b/tests/auto/other/lancelot/tst_lancelot.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -50,10 +50,6 @@
#include <QtOpenGL>
#endif
-#ifndef SRCDIR
-#define SRCDIR "."
-#endif
-
class tst_Lancelot : public QObject
{
Q_OBJECT
@@ -114,11 +110,8 @@ void tst_Lancelot::initTestCase()
if (!proto.connect(QLatin1String("tst_Lancelot"), &dryRunMode, clientInfo))
QSKIP(qPrintable(proto.errorMessage()));
-#if defined(USE_RUNTIME_DIR)
- scriptsDir = QCoreApplication::applicationDirPath() + "/scripts/";
-#else
- scriptsDir = SRCDIR "/scripts/";
-#endif
+ QString baseDir = QFINDTESTDATA("scripts/text.qps");
+ scriptsDir = baseDir.left(baseDir.lastIndexOf('/')) + '/';
QDir qpsDir(scriptsDir);
QStringList files = qpsDir.entryList(QStringList() << QLatin1String("*.qps"), QDir::Files | QDir::Readable);
if (files.isEmpty()) {
diff --git a/tests/auto/other/languagechange/tst_languagechange.cpp b/tests/auto/other/languagechange/tst_languagechange.cpp
index 3b77b13275..12b35795fe 100644
--- a/tests/auto/other/languagechange/tst_languagechange.cpp
+++ b/tests/auto/other/languagechange/tst_languagechange.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -46,6 +46,7 @@
#include <QtCore/QSet>
#include <QtCore/QFile>
#include <QtCore/QTranslator>
+#include <QtCore/QTemporaryDir>
#include <private/qthread_p.h>
#include <QtWidgets/QInputDialog>
#include <QtWidgets/QColorDialog>
@@ -116,16 +117,53 @@ public:
virtual bool isEmpty() const { return false; }
-public slots:
- void install() {
- QCoreApplication::installTranslator(this);
- QTest::qWait(2500);
- QApplication::closeAllWindows();
- }
public:
mutable QSet<QByteArray> m_translations;
};
+// Install the translator and close all application windows after a while to
+// quit the event loop.
+class LanguageTestStateMachine : public QObject
+{
+ Q_OBJECT
+public:
+ LanguageTestStateMachine(QTranslator *translator);
+ void start() { m_timer.start(); }
+
+private slots:
+ void timeout();
+
+private:
+ enum State { InstallTranslator, CloseDialog };
+
+ QTimer m_timer;
+ QTranslator *m_translator;
+ State m_state;
+};
+
+LanguageTestStateMachine::LanguageTestStateMachine(QTranslator *translator) :
+ m_translator(translator), m_state(InstallTranslator)
+{
+ m_timer.setInterval(500);
+ connect(&m_timer, SIGNAL(timeout()), this, SLOT(timeout()));
+}
+
+void LanguageTestStateMachine::timeout()
+{
+ switch (m_state) {
+ case InstallTranslator:
+ m_timer.stop();
+ QCoreApplication::installTranslator(m_translator);
+ m_timer.setInterval(2500);
+ m_timer.start();
+ m_state = CloseDialog;
+ break;
+ case CloseDialog: // Close repeatedly in case file dialog is slow.
+ QApplication::closeAllWindows();
+ break;
+ }
+}
+
enum DialogType {
InputDialog = 1,
ColorDialog,
@@ -208,17 +246,20 @@ void tst_languageChange::retranslatability()
"get proper widget layout.");
TransformTranslator translator;
- QTimer::singleShot(500, &translator, SLOT(install()));
+ LanguageTestStateMachine stateMachine(&translator);
+
switch (dialogType) {
case InputDialog:
- (void)QInputDialog::getInteger(0, QLatin1String("title"), QLatin1String("label"));
+ stateMachine.start();
+ QInputDialog::getInteger(0, QLatin1String("title"), QLatin1String("label"));
break;
case ColorDialog:
#ifdef Q_OS_MAC
QSKIP("The native color dialog is used on Mac OS");
#else
- (void)QColorDialog::getColor();
+ stateMachine.start();
+ QColorDialog::getColor();
#endif
break;
case FileDialog: {
@@ -227,29 +268,30 @@ void tst_languageChange::retranslatability()
#endif
QFileDialog dlg;
dlg.setOption(QFileDialog::DontUseNativeDialog);
- QString tmpParentDir = QDir::tempPath();
- if (!tmpParentDir.endsWith(QLatin1Char('/')))
- tmpParentDir += QLatin1Char('/');
- tmpParentDir += QStringLiteral("languagechangetestdir");
- const QString tmpDir = tmpParentDir + QStringLiteral("/finaldir");
- const QString fooName = tmpParentDir + QStringLiteral("/foo");
+ QString tempDirPattern = QDir::tempPath();
+ if (!tempDirPattern.endsWith(QLatin1Char('/')))
+ tempDirPattern += QLatin1Char('/');
+ tempDirPattern += QStringLiteral("languagechangetestdirXXXXXX");
+ QTemporaryDir temporaryDir(tempDirPattern);
+ temporaryDir.setAutoRemove(true);
+ QVERIFY(temporaryDir.isValid());
+ const QString finalDir = temporaryDir.path() + QStringLiteral("/finaldir");
+ const QString fooName = temporaryDir.path() + QStringLiteral("/foo");
QDir dir;
- QCOMPARE(dir.mkpath(tmpDir), true);
+ QVERIFY(dir.mkpath(finalDir));
QFile fooFile(fooName);
QVERIFY(fooFile.open(QIODevice::WriteOnly|QIODevice::Text));
fooFile.write("test");
fooFile.close();
- dlg.setDirectory(tmpParentDir);
+ dlg.setDirectory(temporaryDir.path());
#ifdef Q_OS_WINCE
dlg.setDirectory("\\Windows");
#endif
dlg.setFileMode(QFileDialog::ExistingFiles);
dlg.setViewMode(QFileDialog::Detail);
+ stateMachine.start();
dlg.exec();
QTest::qWait(3000);
- QCOMPARE(QFile::remove(fooName), true);
- QCOMPARE(dir.rmdir(tmpDir), true);
- QCOMPARE(dir.rmdir(tmpParentDir), true);
break; }
}
diff --git a/tests/auto/other/macgui/guitest.cpp b/tests/auto/other/macgui/guitest.cpp
index e5245528cb..6ab5a64a97 100644
--- a/tests/auto/other/macgui/guitest.cpp
+++ b/tests/auto/other/macgui/guitest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macgui/guitest.h b/tests/auto/other/macgui/guitest.h
index 170fc5c19c..39a63b0443 100644
--- a/tests/auto/other/macgui/guitest.h
+++ b/tests/auto/other/macgui/guitest.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macgui/tst_macgui.cpp b/tests/auto/other/macgui/tst_macgui.cpp
index 9ff2897aa8..8f66d54a2c 100644
--- a/tests/auto/other/macgui/tst_macgui.cpp
+++ b/tests/auto/other/macgui/tst_macgui.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macnativeevents/expectedeventlist.cpp b/tests/auto/other/macnativeevents/expectedeventlist.cpp
index d603f82f27..9067a38ec6 100644
--- a/tests/auto/other/macnativeevents/expectedeventlist.cpp
+++ b/tests/auto/other/macnativeevents/expectedeventlist.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macnativeevents/expectedeventlist.h b/tests/auto/other/macnativeevents/expectedeventlist.h
index e3fef2d56d..fb4c18d493 100644
--- a/tests/auto/other/macnativeevents/expectedeventlist.h
+++ b/tests/auto/other/macnativeevents/expectedeventlist.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macnativeevents/nativeeventlist.cpp b/tests/auto/other/macnativeevents/nativeeventlist.cpp
index 8c7f609d9f..781c3f5374 100644
--- a/tests/auto/other/macnativeevents/nativeeventlist.cpp
+++ b/tests/auto/other/macnativeevents/nativeeventlist.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macnativeevents/nativeeventlist.h b/tests/auto/other/macnativeevents/nativeeventlist.h
index 6bebca1613..f6493e56da 100644
--- a/tests/auto/other/macnativeevents/nativeeventlist.h
+++ b/tests/auto/other/macnativeevents/nativeeventlist.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macnativeevents/qnativeevents.cpp b/tests/auto/other/macnativeevents/qnativeevents.cpp
index b530d7bbe3..79667adcd0 100644
--- a/tests/auto/other/macnativeevents/qnativeevents.cpp
+++ b/tests/auto/other/macnativeevents/qnativeevents.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macnativeevents/qnativeevents.h b/tests/auto/other/macnativeevents/qnativeevents.h
index d303a55397..3a3e4f1590 100644
--- a/tests/auto/other/macnativeevents/qnativeevents.h
+++ b/tests/auto/other/macnativeevents/qnativeevents.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macnativeevents/qnativeevents_mac.cpp b/tests/auto/other/macnativeevents/qnativeevents_mac.cpp
index 8987a8d502..35028f9cf7 100644
--- a/tests/auto/other/macnativeevents/qnativeevents_mac.cpp
+++ b/tests/auto/other/macnativeevents/qnativeevents_mac.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macnativeevents/tst_macnativeevents.cpp b/tests/auto/other/macnativeevents/tst_macnativeevents.cpp
index ea30b0b5c2..c5131e19fc 100644
--- a/tests/auto/other/macnativeevents/tst_macnativeevents.cpp
+++ b/tests/auto/other/macnativeevents/tst_macnativeevents.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macplist/app/main.cpp b/tests/auto/other/macplist/app/main.cpp
index 90bf60ae38..c28c372f08 100644
--- a/tests/auto/other/macplist/app/main.cpp
+++ b/tests/auto/other/macplist/app/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macplist/tst_macplist.cpp b/tests/auto/other/macplist/tst_macplist.cpp
index 5b48c586b5..f2b47c1d99 100644
--- a/tests/auto/other/macplist/tst_macplist.cpp
+++ b/tests/auto/other/macplist/tst_macplist.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/modeltest/modeltest.cpp b/tests/auto/other/modeltest/modeltest.cpp
index 76803dfbe5..118b4a8e1f 100644
--- a/tests/auto/other/modeltest/modeltest.cpp
+++ b/tests/auto/other/modeltest/modeltest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/modeltest/modeltest.h b/tests/auto/other/modeltest/modeltest.h
index e4ef478c5e..f70aebabde 100644
--- a/tests/auto/other/modeltest/modeltest.h
+++ b/tests/auto/other/modeltest/modeltest.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/modeltest/tst_modeltest.cpp b/tests/auto/other/modeltest/tst_modeltest.cpp
index e5c227d167..fa9b98acb6 100644
--- a/tests/auto/other/modeltest/tst_modeltest.cpp
+++ b/tests/auto/other/modeltest/tst_modeltest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/networkselftest/tst_networkselftest.cpp b/tests/auto/other/networkselftest/tst_networkselftest.cpp
index c768a29bf8..3129fd965d 100644
--- a/tests/auto/other/networkselftest/tst_networkselftest.cpp
+++ b/tests/auto/other/networkselftest/tst_networkselftest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index 2a838c0e3d..90ab5b4c67 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -66,6 +66,8 @@ inline bool IsValidCEPlatform() {
}
#endif
+typedef QSharedPointer<QAccessibleInterface> QAIPtr;
+
static inline bool verifyChild(QWidget *child, QAccessibleInterface *interface,
int index, const QRect &domain)
{
@@ -89,7 +91,6 @@ static inline bool verifyChild(QWidget *child, QAccessibleInterface *interface,
// QAccessibleInterface::indexOfChild():
// Verify that indexOfChild() returns an index equal to the index passed in
int indexFromIndexOfChild = interface->indexOfChild(childInterface);
- delete childInterface;
if (indexFromIndexOfChild != index) {
qWarning("tst_QAccessibility::verifyChild (indexOfChild()):");
qWarning() << "Expected:" << index;
@@ -98,7 +99,7 @@ static inline bool verifyChild(QWidget *child, QAccessibleInterface *interface,
}
// Navigate to child, compare its object and role with the interface from queryAccessibleInterface(child).
- QAccessibleInterface *navigatedChildInterface = interface->child(index - 1);
+ QAccessibleInterface *navigatedChildInterface = interface->child(index);
if (navigatedChildInterface == 0)
return false;
@@ -109,13 +110,21 @@ static inline bool verifyChild(QWidget *child, QAccessibleInterface *interface,
// Calculate global child position and check that the interface
// returns the correct index for that position.
QPoint globalChildPos = child->mapToGlobal(QPoint(0, 0));
- int indexFromChildAt = interface->childAt(globalChildPos.x(), globalChildPos.y());
- if (indexFromChildAt != index) {
+ QAccessibleInterface *childAtInterface = interface->childAt(globalChildPos.x(), globalChildPos.y());
+ if (!childAtInterface) {
qWarning("tst_QAccessibility::verifyChild (childAt()):");
- qWarning() << "Expected:" << index;
- qWarning() << "Actual: " << indexFromChildAt;
+ qWarning() << "Expected:" << childInterface;
+ qWarning() << "Actual: no child";
return false;
}
+ if (childAtInterface->object() != childInterface->object()) {
+ qWarning("tst_QAccessibility::verifyChild (childAt()):");
+ qWarning() << "Expected:" << childInterface;
+ qWarning() << "Actual: " << childAtInterface;
+ return false;
+ }
+ delete childInterface;
+ delete childAtInterface;
// QAccessibleInterface::rect():
// Calculate global child geometry and check that the interface
@@ -221,7 +230,7 @@ private slots:
void customWidget();
void deletedWidget();
- void navigateGeometric();
+ void statesStructTest();
void navigateHierarchy();
void sliderTest();
void navigateCovered();
@@ -321,7 +330,7 @@ QAccessible::State state(QWidget * const widget)
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(widget);
if (!iface)
qWarning() << "Cannot get QAccessibleInterface for widget";
- QAccessible::State state = (iface ? iface->state() : static_cast<QAccessible::State>(0));
+ QAccessible::State state = (iface ? iface->state() : QAccessible::State());
delete iface;
return state;
}
@@ -454,100 +463,24 @@ void tst_QAccessibility::deletedWidget()
delete iface;
}
-void tst_QAccessibility::navigateGeometric()
+void tst_QAccessibility::statesStructTest()
{
- {
- static const int skip = 20; //speed the test up significantly
- static const double step = Q_PI / 180;
- QWidget *w = new QWidget(0);
- w->setObjectName(QString("Josef"));
- w->setFixedSize(400, 400);
-
- // center widget
- QtTestAccessibleWidget *center = new QtTestAccessibleWidget(w, "Sol");
- center->move(200, 200);
-
- // arrange 360 widgets around it in a circle
- QtTestAccessibleWidget *aw = 0;
- for (int i = 0; i < 360; i += skip) {
- aw = new QtTestAccessibleWidget(w, QString::number(i).toLatin1());
- aw->move( int(200.0 + 100.0 * sin(step * (double)i)), int(200.0 + 100.0 * cos(step * (double)i)) );
- }
-
- aw = new QtTestAccessibleWidget(w, "Earth");
- QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(center);
- QAccessibleInterface *target = 0;
- QVERIFY(iface != 0);
- QVERIFY(iface->isValid());
-
- w->show();
- QCoreApplication::processEvents();
- QTest::qWait(100);
-
- // let one widget rotate around center
- for (int i = 0; i < 360; i+=skip) {
- aw->move( int(200.0 + 75.0 * sin(step * (double)i)), int(200.0 + 75.0 * cos(step * (double)i)) );
-
- if (i < 45 || i > 315) {
- QCOMPARE(iface->navigate(QAccessible::Down, 0, &target), 0);
- } else if ( i < 135 ) {
- QCOMPARE(iface->navigate(QAccessible::Right, 0, &target), 0);
- } else if ( i < 225 ) {
- QCOMPARE(iface->navigate(QAccessible::Up, 0, &target), 0);
- } else {
- QCOMPARE(iface->navigate(QAccessible::Left, 0, &target), 0);
- }
-
- QVERIFY(target);
- QVERIFY(target->isValid());
- QVERIFY(target->object());
- QCOMPARE(target->object()->objectName(), aw->objectName());
- delete target; target = 0;
- }
-
- // test invisible widget
- target = QAccessible::queryAccessibleInterface(aw);
- QVERIFY(!(target->state() & QAccessible::Invisible));
- aw->hide();
- QVERIFY(target->state() & QAccessible::Invisible);
- delete target; target = 0;
-
- aw->move(center->x() + 10, center->y());
- QCOMPARE(iface->navigate(QAccessible::Right, 0, &target), 0);
- QVERIFY(target);
- QVERIFY(target->isValid());
- QVERIFY(target->object());
- QVERIFY(QString(target->object()->objectName()) != "Earth");
- delete target; target = 0;
-
- aw->move(center->x() - 10, center->y());
- QCOMPARE(iface->navigate(QAccessible::Left, 0, &target), 0);
- QVERIFY(target);
- QVERIFY(target->isValid());
- QVERIFY(target->object());
- QVERIFY(QString(target->object()->objectName()) != "Earth");
- delete target; target = 0;
-
- aw->move(center->x(), center->y() + 10);
- QCOMPARE(iface->navigate(QAccessible::Down, 0, &target), 0);
- QVERIFY(target);
- QVERIFY(target->isValid());
- QVERIFY(target->object());
- QVERIFY(QString(target->object()->objectName()) != "Earth");
- delete target; target = 0;
-
- aw->move(center->x(), center->y() - 10);
- QCOMPARE(iface->navigate(QAccessible::Up, 0, &target), 0);
- QVERIFY(target);
- QVERIFY(target->isValid());
- QVERIFY(target->object());
- QVERIFY(QString(target->object()->objectName()) != "Earth");
- delete target; target = 0;
-
- delete iface;
- delete w;
- }
- QTestAccessibility::clearEvents();
+ QAccessible::State s1;
+ QVERIFY(s1.disabled == 0);
+ QVERIFY(s1.focusable == 0);
+ QVERIFY(s1.modal == 0);
+
+ QAccessible::State s2;
+ QVERIFY(s2 == s1);
+ s2.busy = true;
+ QVERIFY(!(s2 == s1));
+ s1.busy = true;
+ QVERIFY(s2 == s1);
+ s1 = QAccessible::State();
+ QVERIFY(!(s2 == s1));
+ s1 = s2;
+ QVERIFY(s2 == s1);
+ QVERIFY(s1.busy == 1);
}
void tst_QAccessibility::sliderTest()
@@ -671,9 +604,9 @@ void tst_QAccessibility::navigateCovered()
w1->raise();
QVERIFY(iface1->relationTo(iface2) & QAccessible::Covers);
QVERIFY(iface2->relationTo(iface1) & QAccessible::Covered);
- QVERIFY(!(iface1->state() & QAccessible::Invisible));
+ QVERIFY(!iface1->state().invisible);
w1->hide();
- QVERIFY(iface1->state() & QAccessible::Invisible);
+ QVERIFY(iface1->state().invisible);
QVERIFY(!(iface1->relationTo(iface2) & QAccessible::Covers));
QVERIFY(!(iface2->relationTo(iface1) & QAccessible::Covered));
QCOMPARE(iface2->navigate(QAccessible::Covered, 1, &iface3), -1);
@@ -712,11 +645,6 @@ void tst_QAccessibility::navigateHierarchy()
QVERIFY(iface != 0);
QVERIFY(iface->isValid());
- QCOMPARE(iface->navigate(QAccessible::Sibling, -42, &target), -1);
- QVERIFY(target == 0);
- QCOMPARE(iface->navigate(QAccessible::Sibling, 42, &target), -1);
- QVERIFY(target == 0);
-
target = iface->child(14);
QVERIFY(target == 0);
target = iface->child(-1);
@@ -732,38 +660,27 @@ void tst_QAccessibility::navigateHierarchy()
delete interfaceW1;
delete iface; iface = 0;
- QCOMPARE(target->navigate(QAccessible::Sibling, 0, &iface), -1);
- QVERIFY(iface == 0);
- QCOMPARE(target->navigate(QAccessible::Sibling, 42, &iface), -1);
- QVERIFY(iface == 0);
- QCOMPARE(target->navigate(QAccessible::Sibling, -42, &iface), -1);
- QVERIFY(iface == 0);
- QCOMPARE(target->navigate(QAccessible::Sibling, 2, &iface), 0);
- QVERIFY(iface != 0);
- QVERIFY(iface->isValid());
- QCOMPARE(iface->object(), (QObject*)w2);
- delete target; target = 0;
- QCOMPARE(iface->navigate(QAccessible::Sibling, 3, &target), 0);
+ iface = QAccessible::queryAccessibleInterface(w);
+ target = iface->child(2);
QVERIFY(target != 0);
QVERIFY(target->isValid());
QCOMPARE(target->object(), (QObject*)w3);
delete iface; iface = 0;
+
+ iface = target->child(1);
+ QCOMPARE(iface, (QAccessibleInterface*)0);
iface = target->child(0);
QVERIFY(iface != 0);
QVERIFY(iface->isValid());
QCOMPARE(iface->object(), (QObject*)w31);
- delete target; target = 0;
- QCOMPARE(iface->navigate(QAccessible::Sibling, -1, &target), -1);
- QVERIFY(target == 0);
- QCOMPARE(iface->navigate(QAccessible::Sibling, 0, &target), -1);
- QVERIFY(target == 0);
- QCOMPARE(iface->navigate(QAccessible::Sibling, 1, &target), 0);
- QVERIFY(target != 0);
- QVERIFY(target->isValid());
+ iface = QAccessible::queryAccessibleInterface(w);
+ QAccessibleInterface *acc3 = iface->child(2);
+ target = acc3->child(0);
+ delete acc3;
+ delete iface;
QCOMPARE(target->object(), (QObject*)w31);
- delete iface; iface = 0;
iface = target->parent();
QVERIFY(iface != 0);
@@ -913,23 +830,23 @@ void tst_QAccessibility::hideShowTest()
QWidget * const window = new QWidget();
QWidget * const child = new QWidget(window);
- QVERIFY(state(window) & QAccessible::Invisible);
- QVERIFY(state(child) & QAccessible::Invisible);
+ QVERIFY(state(window).invisible);
+ QVERIFY(state(child).invisible);
QTestAccessibility::clearEvents();
// show() and veryfy that both window and child are not invisible and get ObjectShow events.
window->show();
- QVERIFY(state(window) ^ QAccessible::Invisible);
- QVERIFY(state(child) ^ QAccessible::Invisible);
+ QVERIFY(!state(window).invisible);
+ QVERIFY(!state(child).invisible);
QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(window, 0, QAccessible::ObjectShow)));
QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(child, 0, QAccessible::ObjectShow)));
QTestAccessibility::clearEvents();
// hide() and veryfy that both window and child are invisible and get ObjectHide events.
window->hide();
- QVERIFY(state(window) & QAccessible::Invisible);
- QVERIFY(state(child) & QAccessible::Invisible);
+ QVERIFY(state(window).invisible);
+ QVERIFY(state(child).invisible);
QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(window, 0, QAccessible::ObjectHide)));
QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(child, 0, QAccessible::ObjectHide)));
QTestAccessibility::clearEvents();
@@ -1053,7 +970,7 @@ void tst_QAccessibility::buttonTest()
// tristate checkbox
QCheckBox tristate("Tristate!", &window);
- tristate.setTristate(TRUE);
+ tristate.setTristate(true);
// radiobutton
QRadioButton radio("Radio me!", &window);
@@ -1091,12 +1008,12 @@ void tst_QAccessibility::buttonTest()
QCOMPARE(actionInterface->actionNames(), QStringList() << QAccessibleActionInterface::checkAction() << QAccessibleActionInterface::setFocusAction());
QCOMPARE(actionInterface->localizedActionDescription(QAccessibleActionInterface::checkAction()), QString("Checks the checkbox"));
QVERIFY(!toggleButton.isChecked());
- QVERIFY((interface->state() & QAccessible::Checked) == 0);
+ QVERIFY(!interface->state().checked);
actionInterface->doAction(QAccessibleActionInterface::checkAction());
QTest::qWait(500);
QVERIFY(toggleButton.isChecked());
QCOMPARE(actionInterface->actionNames().at(0), QAccessibleActionInterface::uncheckAction());
- QVERIFY(interface->state() & QAccessible::Checked);
+ QVERIFY(interface->state().checked);
delete interface;
{
@@ -1110,7 +1027,7 @@ void tst_QAccessibility::buttonTest()
menuButton.show();
QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(&menuButton);
QCOMPARE(interface->role(), QAccessible::ButtonMenu);
- QVERIFY(interface->state() & QAccessible::HasPopup);
+ QVERIFY(interface->state().hasPopup);
QCOMPARE(interface->actionInterface()->actionNames(), QStringList() << QAccessibleActionInterface::showMenuAction() << QAccessibleActionInterface::setFocusAction());
// showing the menu enters a new event loop...
// interface->actionInterface()->doAction(QAccessibleActionInterface::showMenuAction());
@@ -1124,11 +1041,11 @@ void tst_QAccessibility::buttonTest()
actionInterface = interface->actionInterface();
QCOMPARE(interface->role(), QAccessible::CheckBox);
QCOMPARE(actionInterface->actionNames(), QStringList() << QAccessibleActionInterface::checkAction() << QAccessibleActionInterface::setFocusAction());
- QVERIFY((interface->state() & QAccessible::Checked) == 0);
+ QVERIFY(!interface->state().checked);
actionInterface->doAction(QAccessibleActionInterface::checkAction());
QTest::qWait(500);
QCOMPARE(actionInterface->actionNames(), QStringList() << QAccessibleActionInterface::uncheckAction() << QAccessibleActionInterface::setFocusAction());
- QVERIFY(interface->state() & QAccessible::Checked);
+ QVERIFY(interface->state().checked);
QVERIFY(checkBox.isChecked());
delete interface;
@@ -1137,11 +1054,11 @@ void tst_QAccessibility::buttonTest()
actionInterface = interface->actionInterface();
QCOMPARE(interface->role(), QAccessible::RadioButton);
QCOMPARE(actionInterface->actionNames(), QStringList() << QAccessibleActionInterface::checkAction() << QAccessibleActionInterface::setFocusAction());
- QVERIFY((interface->state() & QAccessible::Checked) == 0);
+ QVERIFY(!interface->state().checked);
actionInterface->doAction(QAccessibleActionInterface::checkAction());
QTest::qWait(500);
QCOMPARE(actionInterface->actionNames(), QStringList() << QAccessibleActionInterface::checkAction() << QAccessibleActionInterface::setFocusAction());
- QVERIFY(interface->state() & QAccessible::Checked);
+ QVERIFY(interface->state().checked);
QVERIFY(checkBox.isChecked());
delete interface;
@@ -1202,15 +1119,15 @@ void tst_QAccessibility::scrollBarTest()
QScrollBar *scrollBar = new QScrollBar(Qt::Horizontal);
QAccessibleInterface * const scrollBarInterface = QAccessible::queryAccessibleInterface(scrollBar);
QVERIFY(scrollBarInterface);
- QVERIFY(scrollBarInterface->state() & QAccessible::Invisible);
+ QVERIFY(scrollBarInterface->state().invisible);
scrollBar->resize(200, 50);
scrollBar->show();
- QVERIFY(scrollBarInterface->state() ^ QAccessible::Invisible);
+ QVERIFY(!scrollBarInterface->state().invisible);
QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(scrollBar, 0, QAccessible::ObjectShow)));
QTestAccessibility::clearEvents();
scrollBar->hide();
- QVERIFY(scrollBarInterface->state() & QAccessible::Invisible);
+ QVERIFY(scrollBarInterface->state().invisible);
QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(scrollBar, 0, QAccessible::ObjectHide)));
QTestAccessibility::clearEvents();
@@ -1254,7 +1171,7 @@ void tst_QAccessibility::tabTest()
// and cleared correctly.
QAccessibleInterface *leftButton = interface->child(0);
QCOMPARE(leftButton->role(), QAccessible::PushButton);
- QVERIFY(leftButton->state() & QAccessible::Invisible);
+ QVERIFY(leftButton->state().invisible);
delete leftButton;
const int lots = 5;
@@ -1268,13 +1185,13 @@ void tst_QAccessibility::tabTest()
QVERIFY(child2);
QCOMPARE(child2->role(), QAccessible::PageTab);
- QVERIFY((child1->state() & QAccessible::Invisible) == false);
+ QVERIFY((child1->state().invisible) == false);
tabBar->hide();
QCoreApplication::processEvents();
QTest::qWait(100);
- QVERIFY(child1->state() & QAccessible::Invisible);
+ QVERIFY(child1->state().invisible);
tabBar->show();
tabBar->setCurrentIndex(0);
@@ -1533,7 +1450,6 @@ void tst_QAccessibility::menuTest()
QAccessibleInterface *iface2 = 0;
// traverse siblings with navigate(Sibling, ...)
- int entry;
iface = interface->child(0);
QVERIFY(iface);
QCOMPARE(iface->role(), QAccessible::MenuItem);
@@ -1546,44 +1462,13 @@ void tst_QAccessibility::menuTest()
QAccessible::MenuItem
};
for (int child = 0; child < 5; ++child) {
- entry = iface->navigate(QAccessible::Sibling, child + 1, &iface2);
- QCOMPARE(entry, 0);
+ iface2 = interface->child(child);
QVERIFY(iface2);
QCOMPARE(iface2->role(), fileRoles[child]);
delete iface2;
}
delete iface;
- // traverse menu items with navigate(Down, ...)
- iface = interface->child(0);
- QVERIFY(iface);
- QCOMPARE(iface->role(), QAccessible::MenuItem);
-
- for (int child = 0; child < 4; ++child) {
- entry = iface->navigate(QAccessible::Down, 1, &iface2);
- delete iface;
- iface = iface2;
- QCOMPARE(entry, 0);
- QVERIFY(iface);
- QCOMPARE(iface->role(), fileRoles[child + 1]);
- }
- delete iface;
-
- // traverse menu items with navigate(Up, ...)
- iface = interface->child(interface->childCount() - 1);
- QVERIFY(iface);
- QCOMPARE(iface->role(), QAccessible::MenuItem);
-
- for (int child = 3; child >= 0; --child) {
- entry = iface->navigate(QAccessible::Up, 1, &iface2);
- delete iface;
- iface = iface2;
- QCOMPARE(entry, 0);
- QVERIFY(iface);
- QCOMPARE(iface->role(), fileRoles[child]);
- }
- delete iface;
-
// "New" item
iface = interface->child(0);
QVERIFY(iface);
@@ -1593,7 +1478,6 @@ void tst_QAccessibility::menuTest()
iface2 = iface->child(0);
delete iface;
iface = iface2;
- QCOMPARE(entry, 0);
QVERIFY(iface);
QCOMPARE(iface->role(), QAccessible::PopupMenu);
@@ -1785,37 +1669,6 @@ void tst_QAccessibility::mdiAreaTest()
QVERIFY(interface);
QCOMPARE(interface->childCount(), subWindowCount);
- // Right, right, right, ...
- for (int i = 0; i < subWindowCount; ++i) {
- QAccessibleInterface *destination = 0;
- int index = interface->navigate(QAccessible::Right, i + 1, &destination);
- if (i == subWindowCount - 1) {
- QVERIFY(!destination);
- QCOMPARE(index, -1);
- } else {
- QVERIFY(destination);
- QCOMPARE(index, 0);
- QCOMPARE(destination->object(), (QObject*)subWindows.at(i + 1));
- delete destination;
- }
- }
-
- // Left, left, left, ...
- for (int i = subWindowCount; i > 0; --i) {
- QAccessibleInterface *destination = 0;
- int index = interface->navigate(QAccessible::Left, i, &destination);
- if (i == 1) {
- QVERIFY(!destination);
- QCOMPARE(index, -1);
- } else {
- QVERIFY(destination);
- QCOMPARE(index, 0);
- QCOMPARE(destination->object(), (QObject*)subWindows.at(i - 2));
- delete destination;
- }
- }
- // ### Add test for Up and Down.
-
}
QTestAccessibility::clearEvents();
}
@@ -1831,7 +1684,6 @@ void tst_QAccessibility::mdiSubWindowTest()
QTest::qWait(150);
#endif
- bool isSubWindowsPlacedNextToEachOther = false;
const int subWindowCount = 5;
for (int i = 0; i < subWindowCount; ++i) {
QMdiSubWindow *window = mdiArea.addSubWindow(new QPushButton("QAccessibilityTest"));
@@ -1846,8 +1698,6 @@ void tst_QAccessibility::mdiSubWindowTest()
QCoreApplication::processEvents();
QTest::qWait(100);
#endif
- if (mdiArea.width() >= minimumWidth)
- isSubWindowsPlacedNextToEachOther = true;
}
}
@@ -1872,47 +1722,34 @@ void tst_QAccessibility::mdiSubWindowTest()
mdiArea.setActiveSubWindow(testWindow);
// state
- QAccessible::State state = QAccessible::Normal | QAccessible::Focusable | QAccessible::Focused
- | QAccessible::Movable | QAccessible::Sizeable;
+ QAccessible::State state;
+ state.focusable = true;
+ state.focused = true;
+ state.movable = true;
+ state.sizeable = true;
+
QCOMPARE(interface->state(), state);
const QRect originalGeometry = testWindow->geometry();
testWindow->showMaximized();
- state &= (uint)~QAccessible::Sizeable;
- state &= (uint)~QAccessible::Movable;
+ state.sizeable = false;
+ state.movable = false;
QCOMPARE(interface->state(), state);
testWindow->showNormal();
testWindow->move(-10, 0);
- QVERIFY(interface->state() & QAccessible::Offscreen);
+ QVERIFY(interface->state().offscreen);
testWindow->setVisible(false);
- QVERIFY(interface->state() & QAccessible::Invisible);
+ QVERIFY(interface->state().invisible);
testWindow->setVisible(true);
testWindow->setEnabled(false);
- QVERIFY(interface->state() & QAccessible::Unavailable);
+ QVERIFY(interface->state().disabled);
testWindow->setEnabled(true);
qApp->setActiveWindow(&mdiArea);
mdiArea.setActiveSubWindow(testWindow);
testWindow->setFocus();
QVERIFY(testWindow->isAncestorOf(qApp->focusWidget()));
- QVERIFY(interface->state() & QAccessible::Focused);
+ QVERIFY(interface->state().focused);
testWindow->setGeometry(originalGeometry);
- if (isSubWindowsPlacedNextToEachOther) {
- // This part of the test can only be run if the sub windows are
- // placed next to each other.
- QAccessibleInterface *destination = interface->child(0);
- QVERIFY(destination);
- QCOMPARE(destination->object(), (QObject*)testWindow->widget());
- delete destination;
- QCOMPARE(interface->navigate(QAccessible::Left, 0, &destination), 0);
- QVERIFY(destination);
- QCOMPARE(destination->object(), (QObject*)subWindows.at(2));
- delete destination;
- QCOMPARE(interface->navigate(QAccessible::Right, 0, &destination), 0);
- QVERIFY(destination);
- QCOMPARE(destination->object(), (QObject*)subWindows.at(4));
- delete destination;
- }
-
// rect
const QPoint globalPos = testWindow->mapToGlobal(QPoint(0, 0));
QCOMPARE(interface->rect(), QRect(globalPos, testWindow->size()));
@@ -1931,11 +1768,14 @@ void tst_QAccessibility::mdiSubWindowTest()
QCOMPARE(childRect(interface), QRect(globalWidgetPos, widgetGeometry.size()));
// childAt
- QCOMPARE(interface->childAt(-10, 0), -1);
- QCOMPARE(interface->childAt(globalPos.x(), globalPos.y()), 0);
- QCOMPARE(interface->childAt(globalWidgetPos.x(), globalWidgetPos.y()), 1);
+ QCOMPARE(interface->childAt(-10, 0), static_cast<QAccessibleInterface*>(0));
+ QCOMPARE(interface->childAt(globalPos.x(), globalPos.y()), static_cast<QAccessibleInterface*>(0));
+ QAccessibleInterface *child = interface->childAt(globalWidgetPos.x(), globalWidgetPos.y());
+ QCOMPARE(child->role(), QAccessible::PushButton);
+ QCOMPARE(child->text(QAccessible::Name), QString("QAccessibilityTest"));
+ delete child;
testWindow->widget()->hide();
- QCOMPARE(interface->childAt(globalWidgetPos.x(), globalWidgetPos.y()), 0);
+ QCOMPARE(interface->childAt(globalWidgetPos.x(), globalWidgetPos.y()), static_cast<QAccessibleInterface*>(0));
}
QTestAccessibility::clearEvents();
@@ -1950,41 +1790,41 @@ void tst_QAccessibility::lineEditTest()
QApplication::processEvents();
QCOMPARE(iface->childCount(), 0);
- QVERIFY(iface->state() & QAccessible::Sizeable);
- QVERIFY(iface->state() & QAccessible::Movable);
- QCOMPARE(bool(iface->state() & QAccessible::Focusable), le->isActiveWindow());
- QVERIFY(iface->state() & QAccessible::Selectable);
- QVERIFY(iface->state() & QAccessible::HasPopup);
- QCOMPARE(bool(iface->state() & QAccessible::Focused), le->hasFocus());
+ QVERIFY(iface->state().sizeable);
+ QVERIFY(iface->state().movable);
+ QCOMPARE(bool(iface->state().focusable), le->isActiveWindow());
+ QVERIFY(iface->state().selectable);
+ QVERIFY(iface->state().hasPopup);
+ QCOMPARE(bool(iface->state().focused), le->hasFocus());
QString secret(QLatin1String("secret"));
le->setText(secret);
le->setEchoMode(QLineEdit::Normal);
- QVERIFY(!(iface->state() & QAccessible::Protected));
+ QVERIFY(!(iface->state().passwordEdit));
QCOMPARE(iface->text(QAccessible::Value), secret);
le->setEchoMode(QLineEdit::NoEcho);
- QVERIFY(iface->state() & QAccessible::Protected);
+ QVERIFY(iface->state().passwordEdit);
QVERIFY(iface->text(QAccessible::Value).isEmpty());
le->setEchoMode(QLineEdit::Password);
- QVERIFY(iface->state() & QAccessible::Protected);
+ QVERIFY(iface->state().passwordEdit);
QVERIFY(iface->text(QAccessible::Value).isEmpty());
le->setEchoMode(QLineEdit::PasswordEchoOnEdit);
- QVERIFY(iface->state() & QAccessible::Protected);
+ QVERIFY(iface->state().passwordEdit);
QVERIFY(iface->text(QAccessible::Value).isEmpty());
le->setEchoMode(QLineEdit::Normal);
- QVERIFY(!(iface->state() & QAccessible::Protected));
+ QVERIFY(!(iface->state().passwordEdit));
QCOMPARE(iface->text(QAccessible::Value), secret);
QWidget *toplevel = new QWidget;
le->setParent(toplevel);
toplevel->show();
QApplication::processEvents();
- QVERIFY(!(iface->state() & QAccessible::Sizeable));
- QVERIFY(!(iface->state() & QAccessible::Movable));
- QCOMPARE(bool(iface->state() & QAccessible::Focusable), le->isActiveWindow());
- QVERIFY(iface->state() & QAccessible::Selectable);
- QVERIFY(iface->state() & QAccessible::HasPopup);
- QCOMPARE(bool(iface->state() & QAccessible::Focused), le->hasFocus());
+ QVERIFY(!(iface->state().sizeable));
+ QVERIFY(!(iface->state().movable));
+ QCOMPARE(bool(iface->state().focusable), le->isActiveWindow());
+ QVERIFY(iface->state().selectable);
+ QVERIFY(iface->state().hasPopup);
+ QCOMPARE(bool(iface->state().focused), le->hasFocus());
QLineEdit *le2 = new QLineEdit(toplevel);
le2->show();
@@ -2086,39 +1926,18 @@ void tst_QAccessibility::workspaceTest()
QVERIFY(interface);
QCOMPARE(interface->childCount(), subWindowCount);
- // Right, right, right, ...
- for (int i = 0; i < subWindowCount; ++i) {
- QAccessibleInterface *destination = 0;
- int index = interface->navigate(QAccessible::Right, i + 1, &destination);
- if (i == subWindowCount - 1) {
- QVERIFY(!destination);
- QCOMPARE(index, -1);
- } else {
- QVERIFY(destination);
- QCOMPARE(index, 0);
- QCOMPARE(destination->object(), (QObject*)subWindows.at(i + 1));
- delete destination;
- }
}
+ QTestAccessibility::clearEvents();
+}
- // Left, left, left, ...
- for (int i = subWindowCount; i > 0; --i) {
- QAccessibleInterface *destination = 0;
- int index = interface->navigate(QAccessible::Left, i, &destination);
- if (i == 1) {
- QVERIFY(!destination);
- QCOMPARE(index, -1);
- } else {
- QVERIFY(destination);
- QCOMPARE(index, 0);
- QCOMPARE(destination->object(), (QObject*)subWindows.at(i - 2));
- delete destination;
- }
- }
- // ### Add test for Up and Down.
+bool accessibleInterfaceLeftOf(const QAccessibleInterface *a1, const QAccessibleInterface *a2)
+{
+ return a1->rect().x() < a2->rect().x();
+}
- }
- QTestAccessibility::clearEvents();
+bool accessibleInterfaceAbove(const QAccessibleInterface *a1, const QAccessibleInterface *a2)
+{
+ return a1->rect().y() < a2->rect().y();
}
void tst_QAccessibility::dialogButtonBoxTest()
@@ -2142,25 +1961,17 @@ void tst_QAccessibility::dialogButtonBoxTest()
QCOMPARE(iface->role(), QAccessible::Grouping);
QStringList actualOrder;
QAccessibleInterface *child;
- QAccessibleInterface *leftmost;
child = iface->child(0);
QCOMPARE(child->role(), QAccessible::PushButton);
- // first find the leftmost button
- while (child->navigate(QAccessible::Left, 1, &leftmost) != -1) {
- delete child;
- child = leftmost;
- }
- leftmost = child;
-
- // then traverse from left to right to find the correct order of the buttons
- int right = 0;
- while (right != -1) {
- actualOrder << leftmost->text(QAccessible::Name);
- right = leftmost->navigate(QAccessible::Right, 1, &child);
- delete leftmost;
- leftmost = child;
- }
+ QVector<QAccessibleInterface *> buttons;
+ for (int i = 0; i < iface->childCount(); ++i)
+ buttons << iface->child(i);
+
+ qSort(buttons.begin(), buttons.end(), accessibleInterfaceLeftOf);
+
+ for (int i = 0; i < buttons.count(); ++i)
+ actualOrder << buttons.at(i)->text(QAccessible::Name);
QStringList expectedOrder;
QDialogButtonBox::ButtonLayout btnlout =
@@ -2202,26 +2013,16 @@ void tst_QAccessibility::dialogButtonBoxTest()
#endif
QApplication::processEvents();
- QAccessibleInterface *child;
QStringList actualOrder;
- child = iface->child(0);
- // first find the topmost button
- QAccessibleInterface *other;
- while (child->navigate(QAccessible::Up, 1, &other) != -1) {
- delete child;
- child = other;
- }
- other = child;
-
- // then traverse from top to bottom to find the correct order of the buttons
- actualOrder.clear();
- int right = 0;
- while (right != -1) {
- actualOrder << other->text(QAccessible::Name);
- right = other->navigate(QAccessible::Down, 1, &child);
- delete other;
- other = child;
- }
+
+ QVector<QAccessibleInterface *> buttons;
+ for (int i = 0; i < iface->childCount(); ++i)
+ buttons << iface->child(i);
+
+ qSort(buttons.begin(), buttons.end(), accessibleInterfaceAbove);
+
+ for (int i = 0; i < buttons.count(); ++i)
+ actualOrder << buttons.at(i)->text(QAccessible::Name);
QStringList expectedOrder;
expectedOrder << QDialogButtonBox::tr("OK")
@@ -2288,7 +2089,7 @@ void tst_QAccessibility::abstractScrollAreaTest()
QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(&abstractScrollArea);
QVERIFY(interface);
QVERIFY(!interface->rect().isValid());
- QCOMPARE(interface->childAt(200, 200), -1);
+ QCOMPARE(interface->childAt(200, 200), static_cast<QAccessibleInterface*>(0));
abstractScrollArea.resize(400, 400);
abstractScrollArea.show();
@@ -2303,14 +2104,14 @@ void tst_QAccessibility::abstractScrollAreaTest()
QCOMPARE(interface->childCount(), 1);
QWidget *viewport = abstractScrollArea.viewport();
QVERIFY(viewport);
- QVERIFY(verifyChild(viewport, interface, 1, globalGeometry));
+ QVERIFY(verifyChild(viewport, interface, 0, globalGeometry));
// Horizontal scrollBar.
abstractScrollArea.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
QCOMPARE(interface->childCount(), 2);
QWidget *horizontalScrollBar = abstractScrollArea.horizontalScrollBar();
QWidget *horizontalScrollBarContainer = horizontalScrollBar->parentWidget();
- QVERIFY(verifyChild(horizontalScrollBarContainer, interface, 2, globalGeometry));
+ QVERIFY(verifyChild(horizontalScrollBarContainer, interface, 1, globalGeometry));
// Horizontal scrollBar widgets.
QLabel *secondLeftLabel = new QLabel(QLatin1String("L2"));
@@ -2334,7 +2135,7 @@ void tst_QAccessibility::abstractScrollAreaTest()
QCOMPARE(interface->childCount(), 3);
QWidget *verticalScrollBar = abstractScrollArea.verticalScrollBar();
QWidget *verticalScrollBarContainer = verticalScrollBar->parentWidget();
- QVERIFY(verifyChild(verticalScrollBarContainer, interface, 3, globalGeometry));
+ QVERIFY(verifyChild(verticalScrollBarContainer, interface, 2, globalGeometry));
// Vertical scrollBar widgets.
QLabel *secondTopLabel = new QLabel(QLatin1String("T2"));
@@ -2357,80 +2158,7 @@ void tst_QAccessibility::abstractScrollAreaTest()
abstractScrollArea.setCornerWidget(new QLabel(QLatin1String("C")));
QCOMPARE(interface->childCount(), 4);
QWidget *cornerWidget = abstractScrollArea.cornerWidget();
- QVERIFY(verifyChild(cornerWidget, interface, 4, globalGeometry));
-
- // Test navigate.
- QAccessibleInterface *target = 0;
-
- // viewport -> Up -> NOTHING
- const int viewportIndex = indexOfChild(interface, viewport);
- QVERIFY(viewportIndex != -1);
- QCOMPARE(interface->navigate(QAccessible::Up, viewportIndex, &target), -1);
- QVERIFY(!target);
-
- // viewport -> Left -> NOTHING
- QCOMPARE(interface->navigate(QAccessible::Left, viewportIndex, &target), -1);
- QVERIFY(!target);
-
- // viewport -> Down -> horizontalScrollBarContainer
- const int horizontalScrollBarContainerIndex = indexOfChild(interface, horizontalScrollBarContainer);
- QVERIFY(horizontalScrollBarContainerIndex != -1);
- QCOMPARE(interface->navigate(QAccessible::Down, viewportIndex, &target), 0);
- QVERIFY(target);
- QCOMPARE(target->object(), static_cast<QObject *>(horizontalScrollBarContainer));
- delete target;
- target = 0;
-
- // horizontalScrollBarContainer -> Left -> NOTHING
- QCOMPARE(interface->navigate(QAccessible::Left, horizontalScrollBarContainerIndex, &target), -1);
- QVERIFY(!target);
-
- // horizontalScrollBarContainer -> Down -> NOTHING
- QVERIFY(horizontalScrollBarContainerIndex != -1);
- QCOMPARE(interface->navigate(QAccessible::Down, horizontalScrollBarContainerIndex, &target), -1);
- QVERIFY(!target);
-
- // horizontalScrollBarContainer -> Right -> cornerWidget
- const int cornerWidgetIndex = indexOfChild(interface, cornerWidget);
- QVERIFY(cornerWidgetIndex != -1);
- QCOMPARE(interface->navigate(QAccessible::Right, horizontalScrollBarContainerIndex, &target), 0);
- QVERIFY(target);
- QCOMPARE(target->object(), static_cast<QObject *>(cornerWidget));
- delete target;
- target = 0;
-
- // cornerWidget -> Down -> NOTHING
- QCOMPARE(interface->navigate(QAccessible::Down, cornerWidgetIndex, &target), -1);
- QVERIFY(!target);
-
- // cornerWidget -> Right -> NOTHING
- QVERIFY(cornerWidgetIndex != -1);
- QCOMPARE(interface->navigate(QAccessible::Right, cornerWidgetIndex, &target), -1);
- QVERIFY(!target);
-
- // cornerWidget -> Up -> verticalScrollBarContainer
- const int verticalScrollBarContainerIndex = indexOfChild(interface, verticalScrollBarContainer);
- QVERIFY(verticalScrollBarContainerIndex != -1);
- QCOMPARE(interface->navigate(QAccessible::Up, cornerWidgetIndex, &target), 0);
- QVERIFY(target);
- QCOMPARE(target->object(), static_cast<QObject *>(verticalScrollBarContainer));
- delete target;
- target = 0;
-
- // verticalScrollBarContainer -> Right -> NOTHING
- QCOMPARE(interface->navigate(QAccessible::Right, verticalScrollBarContainerIndex, &target), -1);
- QVERIFY(!target);
-
- // verticalScrollBarContainer -> Up -> NOTHING
- QCOMPARE(interface->navigate(QAccessible::Up, verticalScrollBarContainerIndex, &target), -1);
- QVERIFY(!target);
-
- // verticalScrollBarContainer -> Left -> viewport
- QCOMPARE(interface->navigate(QAccessible::Left, verticalScrollBarContainerIndex, &target), 0);
- QVERIFY(target);
- QCOMPARE(target->object(), static_cast<QObject *>(viewport));
- delete target;
- target = 0;
+ QVERIFY(verifyChild(cornerWidget, interface, 3, globalGeometry));
QCOMPARE(verifyHierarchy(interface), 0);
@@ -2459,6 +2187,7 @@ void tst_QAccessibility::scrollAreaTest()
void tst_QAccessibility::listTest()
{
+ {
QListWidget *listView = new QListWidget;
listView->addItem("Oslo");
listView->addItem("Berlin");
@@ -2469,33 +2198,29 @@ void tst_QAccessibility::listTest()
QCoreApplication::processEvents();
QTest::qWait(100);
- QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(listView);
- QCOMPARE(verifyHierarchy(iface), 0);
+ QAIPtr iface = QAIPtr(QAccessible::queryAccessibleInterface(listView));
+ QCOMPARE(verifyHierarchy(iface.data()), 0);
QCOMPARE((int)iface->role(), (int)QAccessible::List);
QCOMPARE(iface->childCount(), 3);
- QAccessibleInterface *child1 = 0;
- child1 = iface->child(0);
+ {
+ QAIPtr child1 = QAIPtr(iface->child(0));
QVERIFY(child1);
- QCOMPARE(iface->indexOfChild(child1), 1);
+ QCOMPARE(iface->indexOfChild(child1.data()), 0);
QCOMPARE(child1->text(QAccessible::Name), QString("Oslo"));
QCOMPARE(child1->role(), QAccessible::ListItem);
- delete child1;
- QAccessibleInterface *child2 = 0;
- child2 = iface->child(1);
+ QAIPtr child2 = QAIPtr(iface->child(1));
QVERIFY(child2);
- QCOMPARE(iface->indexOfChild(child2), 2);
+ QCOMPARE(iface->indexOfChild(child2.data()), 1);
QCOMPARE(child2->text(QAccessible::Name), QString("Berlin"));
- delete child2;
- QAccessibleInterface *child3 = 0;
- child3 = iface->child(2);
+ QAIPtr child3 = QAIPtr(iface->child(2));
QVERIFY(child3);
- QCOMPARE(iface->indexOfChild(child3), 3);
+ QCOMPARE(iface->indexOfChild(child3.data()), 2);
QCOMPARE(child3->text(QAccessible::Name), QString("Brisbane"));
- delete child3;
+ }
QTestAccessibility::clearEvents();
// Check for events
@@ -2514,11 +2239,12 @@ void tst_QAccessibility::listTest()
QVERIFY(table2);
QCOMPARE(table2->columnCount(), 1);
QCOMPARE(table2->rowCount(), 4);
- QAccessibleInterface *cell1;
- QVERIFY(cell1 = table2->cellAt(0,0));
+ QAIPtr cell1 = QAIPtr(table2->cellAt(0,0));
+ QVERIFY(cell1);
QCOMPARE(cell1->text(QAccessible::Name), QString("Oslo"));
- QAccessibleInterface *cell4;
- QVERIFY(cell4 = table2->cellAt(3,0));
+
+ QAIPtr cell4 = QAIPtr(table2->cellAt(3,0));
+ QVERIFY(cell4);
QCOMPARE(cell4->text(QAccessible::Name), QString("Munich"));
QCOMPARE(cell4->role(), QAccessible::ListItem);
@@ -2526,12 +2252,30 @@ void tst_QAccessibility::listTest()
QVERIFY(cellInterface);
QCOMPARE(cellInterface->rowIndex(), 3);
QCOMPARE(cellInterface->columnIndex(), 0);
- QVERIFY(!(cell4->state() & QAccessible::Expandable));
+ QCOMPARE(cellInterface->rowExtent(), 1);
+ QCOMPARE(cellInterface->columnExtent(), 1);
+ QCOMPARE(cellInterface->rowHeaderCells(), QList<QAccessibleInterface*>());
+ QCOMPARE(cellInterface->columnHeaderCells(), QList<QAccessibleInterface*>());
+
+ QCOMPARE(QAIPtr(cellInterface->table())->object(), listView);
+
+ listView->clearSelection();
+ QVERIFY(!(cell4->state().expandable));
+ QVERIFY( (cell4->state().selectable));
+ QVERIFY(!(cell4->state().selected));
+ table2->selectRow(3);
+ QCOMPARE(listView->selectedItems().size(), 1);
+ QCOMPARE(listView->selectedItems().at(0)->text(), QLatin1String("Munich"));
+ QVERIFY(cell4->state().selected);
+ QVERIFY(cellInterface->isSelected());
+
+ QVERIFY(table2->cellAt(-1, 0) == 0);
+ QVERIFY(table2->cellAt(0, -1) == 0);
+ QVERIFY(table2->cellAt(0, 1) == 0);
+ QVERIFY(table2->cellAt(4, 0) == 0);
- delete cell4;
- delete cell1;
- delete iface;
delete listView;
+ }
QTestAccessibility::clearEvents();
}
@@ -2583,7 +2327,7 @@ void tst_QAccessibility::treeTest()
QAccessibleInterface *header1 = 0;
header1 = iface->child(0);
QVERIFY(header1);
- QCOMPARE(iface->indexOfChild(header1), 1);
+ QCOMPARE(iface->indexOfChild(header1), 0);
QCOMPARE(header1->text(QAccessible::Name), QString("Artist"));
QCOMPARE(header1->role(), QAccessible::ColumnHeader);
delete header1;
@@ -2591,16 +2335,16 @@ void tst_QAccessibility::treeTest()
QAccessibleInterface *child1 = 0;
child1 = iface->child(2);
QVERIFY(child1);
- QCOMPARE(iface->indexOfChild(child1), 3);
+ QCOMPARE(iface->indexOfChild(child1), 2);
QCOMPARE(child1->text(QAccessible::Name), QString("Spain"));
QCOMPARE(child1->role(), QAccessible::TreeItem);
- QVERIFY(!(child1->state() & QAccessible::Expanded));
+ QVERIFY(!(child1->state().expanded));
delete child1;
QAccessibleInterface *child2 = 0;
child2 = iface->child(4);
QVERIFY(child2);
- QCOMPARE(iface->indexOfChild(child2), 5);
+ QCOMPARE(iface->indexOfChild(child2), 4);
QCOMPARE(child2->text(QAccessible::Name), QString("Austria"));
delete child2;
@@ -2620,9 +2364,9 @@ void tst_QAccessibility::treeTest()
QCOMPARE(cell2->role(), QAccessible::TreeItem);
QCOMPARE(cell2->tableCellInterface()->rowIndex(), 1);
QCOMPARE(cell2->tableCellInterface()->columnIndex(), 0);
- QVERIFY(cell2->state() & QAccessible::Expandable);
- QCOMPARE(iface->indexOfChild(cell2), 5);
- QVERIFY(!(cell2->state() & QAccessible::Expanded));
+ QVERIFY(cell2->state().expandable);
+ QCOMPARE(iface->indexOfChild(cell2), 4);
+ QVERIFY(!(cell2->state().expanded));
QCOMPARE(table2->columnDescription(1), QString("Work"));
delete cell2;
delete cell1;
@@ -2637,15 +2381,15 @@ void tst_QAccessibility::treeTest()
QCOMPARE(table2->rowCount(), 5);
cell1 = table2->cellAt(1,0);
QCOMPARE(cell1->text(QAccessible::Name), QString("Picasso"));
- QCOMPARE(iface->indexOfChild(cell1), 5); // 1 based + 2 header + 2 for root item
+ QCOMPARE(iface->indexOfChild(cell1), 4); // 2 header + 2 for root item
cell2 = table2->cellAt(4,0);
QCOMPARE(cell2->text(QAccessible::Name), QString("Klimt"));
QCOMPARE(cell2->role(), QAccessible::TreeItem);
QCOMPARE(cell2->tableCellInterface()->rowIndex(), 4);
QCOMPARE(cell2->tableCellInterface()->columnIndex(), 0);
- QVERIFY(!(cell2->state() & QAccessible::Expandable));
- QCOMPARE(iface->indexOfChild(cell2), 11);
+ QVERIFY(!(cell2->state().expandable));
+ QCOMPARE(iface->indexOfChild(cell2), 10);
QCOMPARE(table2->columnDescription(0), QString("Artist"));
QCOMPARE(table2->columnDescription(1), QString("Work"));
@@ -2687,21 +2431,21 @@ void tst_QAccessibility::tableTest()
QAccessibleInterface *cornerButton = iface->child(0);
QVERIFY(cornerButton);
- QCOMPARE(iface->indexOfChild(cornerButton), 1);
+ QCOMPARE(iface->indexOfChild(cornerButton), 0);
QCOMPARE(cornerButton->role(), QAccessible::Pane);
delete cornerButton;
QAccessibleInterface *child1 = iface->child(2);
QVERIFY(child1);
- QCOMPARE(iface->indexOfChild(child1), 3);
+ QCOMPARE(iface->indexOfChild(child1), 2);
QCOMPARE(child1->text(QAccessible::Name), QString("h2"));
QCOMPARE(child1->role(), QAccessible::ColumnHeader);
- QVERIFY(!(child1->state() & QAccessible::Expanded));
+ QVERIFY(!(child1->state().expanded));
delete child1;
QAccessibleInterface *child2 = iface->child(10);
QVERIFY(child2);
- QCOMPARE(iface->indexOfChild(child2), 11);
+ QCOMPARE(iface->indexOfChild(child2), 10);
QCOMPARE(child2->text(QAccessible::Name), QString("1.1"));
QAccessibleTableCellInterface *cell2Iface = child2->tableCellInterface();
QCOMPARE(cell2Iface->rowIndex(), 1);
@@ -2709,7 +2453,7 @@ void tst_QAccessibility::tableTest()
delete child2;
QAccessibleInterface *child3 = iface->child(11);
- QCOMPARE(iface->indexOfChild(child3), 12);
+ QCOMPARE(iface->indexOfChild(child3), 11);
QCOMPARE(child3->text(QAccessible::Name), QString("1.2"));
delete child3;
@@ -2723,7 +2467,7 @@ void tst_QAccessibility::tableTest()
QAccessibleInterface *cell1;
QVERIFY(cell1 = table2->cellAt(0,0));
QCOMPARE(cell1->text(QAccessible::Name), QString("0.0"));
- QCOMPARE(iface->indexOfChild(cell1), 6);
+ QCOMPARE(iface->indexOfChild(cell1), 5);
QAccessibleInterface *cell2;
QVERIFY(cell2 = table2->cellAt(0,1));
@@ -2731,7 +2475,7 @@ void tst_QAccessibility::tableTest()
QCOMPARE(cell2->role(), QAccessible::Cell);
QCOMPARE(cell2->tableCellInterface()->rowIndex(), 0);
QCOMPARE(cell2->tableCellInterface()->columnIndex(), 1);
- QCOMPARE(iface->indexOfChild(cell2), 7);
+ QCOMPARE(iface->indexOfChild(cell2), 6);
delete cell2;
QAccessibleInterface *cell3;
@@ -2740,7 +2484,7 @@ void tst_QAccessibility::tableTest()
QCOMPARE(cell3->role(), QAccessible::Cell);
QCOMPARE(cell3->tableCellInterface()->rowIndex(), 1);
QCOMPARE(cell3->tableCellInterface()->columnIndex(), 2);
- QCOMPARE(iface->indexOfChild(cell3), 12);
+ QCOMPARE(iface->indexOfChild(cell3), 11);
delete cell3;
QCOMPARE(table2->columnDescription(0), QString("h1"));
@@ -2767,7 +2511,7 @@ void tst_QAccessibility::calendarWidgetTest()
QVERIFY(interface);
QCOMPARE(interface->role(), QAccessible::Table);
QVERIFY(!interface->rect().isValid());
- QCOMPARE(interface->childAt(200, 200), -1);
+ QCOMPARE(interface->childAt(200, 200), static_cast<QAccessibleInterface*>(0));
calendarWidget.resize(400, 300);
calendarWidget.show();
@@ -2791,7 +2535,7 @@ void tst_QAccessibility::calendarWidgetTest()
}
}
QVERIFY(navigationBar);
- QVERIFY(verifyChild(navigationBar, interface, 1, globalGeometry));
+ QVERIFY(verifyChild(navigationBar, interface, 0, globalGeometry));
QAbstractItemView *calendarView = 0;
foreach (QObject *child, calendarWidget.children()) {
@@ -2801,14 +2545,14 @@ void tst_QAccessibility::calendarWidgetTest()
}
}
QVERIFY(calendarView);
- QVERIFY(verifyChild(calendarView, interface, 2, globalGeometry));
+ QVERIFY(verifyChild(calendarView, interface, 1, globalGeometry));
// Hide navigation bar.
calendarWidget.setNavigationBarVisible(false);
QCOMPARE(interface->childCount(), 1);
QVERIFY(!navigationBar->isVisible());
- QVERIFY(verifyChild(calendarView, interface, 1, globalGeometry));
+ QVERIFY(verifyChild(calendarView, interface, 0, globalGeometry));
// Show navigation bar.
calendarWidget.setNavigationBarVisible(true);
@@ -2819,29 +2563,19 @@ void tst_QAccessibility::calendarWidgetTest()
QAccessibleInterface *navigationBarInterface = interface->child(0);
QVERIFY(navigationBarInterface);
QCOMPARE(navigationBarInterface->object(), (QObject*)navigationBar);
- delete navigationBarInterface;
- navigationBarInterface = 0;
// Navigate to the view via Child.
QAccessibleInterface *calendarViewInterface = interface->child(1);
QVERIFY(calendarViewInterface);
QCOMPARE(calendarViewInterface->object(), (QObject*)calendarView);
- delete calendarViewInterface;
- calendarViewInterface = 0;
QVERIFY(!interface->child(-1));
- // Navigate from navigation bar -> view (Down).
- QCOMPARE(interface->navigate(QAccessible::Down, 1, &calendarViewInterface), 0);
- QVERIFY(calendarViewInterface);
- QCOMPARE(calendarViewInterface->object(), (QObject*)calendarView);
+ // In order for geometric navigation to work they must share the same parent
+ QCOMPARE(navigationBarInterface->parent()->object(), calendarViewInterface->parent()->object());
+ QVERIFY(navigationBarInterface->rect().bottom() < calendarViewInterface->rect().top());
delete calendarViewInterface;
calendarViewInterface = 0;
-
- // Navigate from view -> navigation bar (Up).
- QCOMPARE(interface->navigate(QAccessible::Up, 2, &navigationBarInterface), 0);
- QVERIFY(navigationBarInterface);
- QCOMPARE(navigationBarInterface->object(), (QObject*)navigationBar);
delete navigationBarInterface;
navigationBarInterface = 0;
@@ -2903,12 +2637,14 @@ void tst_QAccessibility::dockWidgetTest()
QPoint globalPos = dock1->mapToGlobal(QPoint(0,0));
globalPos.rx()+=5; //### query style
globalPos.ry()+=5;
- int entry = accDock1->childAt(globalPos.x(), globalPos.y()); //###
- QCOMPARE(entry, 1);
- QAccessibleInterface *accTitleBar = accDock1->child(entry - 1);
+ QAccessibleInterface *childAt = accDock1->childAt(globalPos.x(), globalPos.y()); //###
+ QCOMPARE(childAt->role(), QAccessible::TitleBar);
+ int index = accDock1->indexOfChild(childAt);
+ delete childAt;
+ QAccessibleInterface *accTitleBar = accDock1->child(index);
QCOMPARE(accTitleBar->role(), QAccessible::TitleBar);
- QCOMPARE(accDock1->indexOfChild(accTitleBar), 1);
+ QCOMPARE(accDock1->indexOfChild(accTitleBar), 0);
QAccessibleInterface *acc;
acc = accTitleBar->parent();
QVERIFY(acc);
diff --git a/tests/auto/other/qcomplextext/bidireorderstring.h b/tests/auto/other/qcomplextext/bidireorderstring.h
index e0bbf6e80b..32f0c81e69 100644
--- a/tests/auto/other/qcomplextext/bidireorderstring.h
+++ b/tests/auto/other/qcomplextext/bidireorderstring.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qcomplextext/tst_qcomplextext.cpp b/tests/auto/other/qcomplextext/tst_qcomplextext.cpp
index ce45500e74..c741a76a7e 100644
--- a/tests/auto/other/qcomplextext/tst_qcomplextext.cpp
+++ b/tests/auto/other/qcomplextext/tst_qcomplextext.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qdirectpainter/runDirectPainter/main.cpp b/tests/auto/other/qdirectpainter/runDirectPainter/main.cpp
index af3dd90beb..475cb9c035 100644
--- a/tests/auto/other/qdirectpainter/runDirectPainter/main.cpp
+++ b/tests/auto/other/qdirectpainter/runDirectPainter/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qdirectpainter/tst_qdirectpainter.cpp b/tests/auto/other/qdirectpainter/tst_qdirectpainter.cpp
index f60f011a20..352dd96dd9 100644
--- a/tests/auto/other/qdirectpainter/tst_qdirectpainter.cpp
+++ b/tests/auto/other/qdirectpainter/tst_qdirectpainter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
index a0803b029c..9f82a72f65 100644
--- a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
+++ b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -73,14 +73,14 @@ protected:
QLineEdit::focusInEvent( e );
focusInEventReason = e->reason();
focusInEventGotFocus = e->gotFocus();
- focusInEventRecieved = TRUE;
+ focusInEventRecieved = true;
}
void focusOutEvent( QFocusEvent* e )
{
QLineEdit::focusOutEvent( e );
focusOutEventReason = e->reason();
focusOutEventLostFocus = !e->gotFocus();
- focusOutEventRecieved = TRUE;
+ focusOutEventRecieved = true;
}
};
@@ -173,17 +173,17 @@ void tst_QFocusEvent::initWidget()
// The first lineedit should have focus
QVERIFY( childFocusWidgetOne->hasFocus() );
- childFocusWidgetOne->focusInEventRecieved = FALSE;
- childFocusWidgetOne->focusInEventGotFocus = FALSE;
+ childFocusWidgetOne->focusInEventRecieved = false;
+ childFocusWidgetOne->focusInEventGotFocus = false;
childFocusWidgetOne->focusInEventReason = -1;
- childFocusWidgetOne->focusOutEventRecieved = FALSE;
- childFocusWidgetOne->focusOutEventLostFocus = FALSE;
+ childFocusWidgetOne->focusOutEventRecieved = false;
+ childFocusWidgetOne->focusOutEventLostFocus = false;
childFocusWidgetOne->focusOutEventReason = -1;
- childFocusWidgetTwo->focusInEventRecieved = FALSE;
- childFocusWidgetTwo->focusInEventGotFocus = FALSE;
+ childFocusWidgetTwo->focusInEventRecieved = false;
+ childFocusWidgetTwo->focusInEventGotFocus = false;
childFocusWidgetTwo->focusInEventReason = -1;
- childFocusWidgetTwo->focusOutEventRecieved = FALSE;
- childFocusWidgetTwo->focusOutEventLostFocus = FALSE;
+ childFocusWidgetTwo->focusOutEventRecieved = false;
+ childFocusWidgetTwo->focusOutEventLostFocus = false;
childFocusWidgetTwo->focusOutEventReason = -1;
}
diff --git a/tests/auto/other/qmultiscreen/tst_qmultiscreen.cpp b/tests/auto/other/qmultiscreen/tst_qmultiscreen.cpp
index 9f7411f3ab..e6f2432e64 100644
--- a/tests/auto/other/qmultiscreen/tst_qmultiscreen.cpp
+++ b/tests/auto/other/qmultiscreen/tst_qmultiscreen.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp b/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp
index 63506fed1d..6cf4147091 100644
--- a/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp
+++ b/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qobjectperformance/tst_qobjectperformance.cpp b/tests/auto/other/qobjectperformance/tst_qobjectperformance.cpp
index 4403a3f57b..2533cfb55b 100644
--- a/tests/auto/other/qobjectperformance/tst_qobjectperformance.cpp
+++ b/tests/auto/other/qobjectperformance/tst_qobjectperformance.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qobjectrace/tst_qobjectrace.cpp b/tests/auto/other/qobjectrace/tst_qobjectrace.cpp
index 8cb7845e78..41e3001415 100644
--- a/tests/auto/other/qobjectrace/tst_qobjectrace.cpp
+++ b/tests/auto/other/qobjectrace/tst_qobjectrace.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qsharedpointer_and_qwidget/tst_qsharedpointer_and_qwidget.cpp b/tests/auto/other/qsharedpointer_and_qwidget/tst_qsharedpointer_and_qwidget.cpp
index 90b71c517c..3cda8ed1ee 100644
--- a/tests/auto/other/qsharedpointer_and_qwidget/tst_qsharedpointer_and_qwidget.cpp
+++ b/tests/auto/other/qsharedpointer_and_qwidget/tst_qsharedpointer_and_qwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -62,10 +62,10 @@ private slots:
void strong_sharedptrDelete();
public slots:
- void cleanup() { check(); }
+ void cleanup() { safetyCheck(); }
public:
- inline void check()
+ inline void safetyCheck()
{
#ifdef QT_BUILD_INTERNAL
QtSharedPointer::internalSafetyCheckCleanCheck();
diff --git a/tests/auto/other/qtokenautomaton/generateTokenizers.sh b/tests/auto/other/qtokenautomaton/generateTokenizers.sh
index 0fb602aae4..0a67a1dca0 100755
--- a/tests/auto/other/qtokenautomaton/generateTokenizers.sh
+++ b/tests/auto/other/qtokenautomaton/generateTokenizers.sh
@@ -1,7 +1,7 @@
#!/bin/bash
#############################################################################
##
-## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+## Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation (qt-info@nokia.com)
##
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/basic/basic.cpp b/tests/auto/other/qtokenautomaton/tokenizers/basic/basic.cpp
index 7f96e41894..89e22719d1 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/basic/basic.cpp
+++ b/tests/auto/other/qtokenautomaton/tokenizers/basic/basic.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/basic/basic.h b/tests/auto/other/qtokenautomaton/tokenizers/basic/basic.h
index 2f0efa1ffc..8ff67a5b23 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/basic/basic.h
+++ b/tests/auto/other/qtokenautomaton/tokenizers/basic/basic.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/basicNamespace/basicNamespace.cpp b/tests/auto/other/qtokenautomaton/tokenizers/basicNamespace/basicNamespace.cpp
index 3874777d74..5eab3d972a 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/basicNamespace/basicNamespace.cpp
+++ b/tests/auto/other/qtokenautomaton/tokenizers/basicNamespace/basicNamespace.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/basicNamespace/basicNamespace.h b/tests/auto/other/qtokenautomaton/tokenizers/basicNamespace/basicNamespace.h
index 074bb304ba..147619604c 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/basicNamespace/basicNamespace.h
+++ b/tests/auto/other/qtokenautomaton/tokenizers/basicNamespace/basicNamespace.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.cpp b/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.cpp
index 5f374030bb..ba7cdfac91 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.cpp
+++ b/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.h b/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.h
index 735ca68e18..ec3631e272 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.h
+++ b/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.xml b/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.xml
index 604c147c43..c6f37a218b 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.xml
+++ b/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.xml
@@ -23,7 +23,7 @@
<boilerplate>
<prolog>/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/noNamespace/noNamespace.cpp b/tests/auto/other/qtokenautomaton/tokenizers/noNamespace/noNamespace.cpp
index 2d349ad637..38f7ca90a3 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/noNamespace/noNamespace.cpp
+++ b/tests/auto/other/qtokenautomaton/tokenizers/noNamespace/noNamespace.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/noNamespace/noNamespace.h b/tests/auto/other/qtokenautomaton/tokenizers/noNamespace/noNamespace.h
index f922dfcb50..086a9a0ce4 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/noNamespace/noNamespace.h
+++ b/tests/auto/other/qtokenautomaton/tokenizers/noNamespace/noNamespace.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/noToString/noToString.cpp b/tests/auto/other/qtokenautomaton/tokenizers/noToString/noToString.cpp
index d45c7302cd..a62eab1da7 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/noToString/noToString.cpp
+++ b/tests/auto/other/qtokenautomaton/tokenizers/noToString/noToString.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/noToString/noToString.h b/tests/auto/other/qtokenautomaton/tokenizers/noToString/noToString.h
index 12142bc4f0..f551b46f47 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/noToString/noToString.h
+++ b/tests/auto/other/qtokenautomaton/tokenizers/noToString/noToString.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/withNamespace/withNamespace.cpp b/tests/auto/other/qtokenautomaton/tokenizers/withNamespace/withNamespace.cpp
index 235bd60501..fdff637450 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/withNamespace/withNamespace.cpp
+++ b/tests/auto/other/qtokenautomaton/tokenizers/withNamespace/withNamespace.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/withNamespace/withNamespace.h b/tests/auto/other/qtokenautomaton/tokenizers/withNamespace/withNamespace.h
index 678b3a7903..627da4b93a 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/withNamespace/withNamespace.h
+++ b/tests/auto/other/qtokenautomaton/tokenizers/withNamespace/withNamespace.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tst_qtokenautomaton.cpp b/tests/auto/other/qtokenautomaton/tst_qtokenautomaton.cpp
index cbbf5a2a0d..789d2f6491 100644
--- a/tests/auto/other/qtokenautomaton/tst_qtokenautomaton.cpp
+++ b/tests/auto/other/qtokenautomaton/tst_qtokenautomaton.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/windowsmobile/test/ddhelper.cpp b/tests/auto/other/windowsmobile/test/ddhelper.cpp
index 55469f5901..7a8c9ea94e 100644
--- a/tests/auto/other/windowsmobile/test/ddhelper.cpp
+++ b/tests/auto/other/windowsmobile/test/ddhelper.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/windowsmobile/test/ddhelper.h b/tests/auto/other/windowsmobile/test/ddhelper.h
index 3d2f06aa36..de3f79afca 100644
--- a/tests/auto/other/windowsmobile/test/ddhelper.h
+++ b/tests/auto/other/windowsmobile/test/ddhelper.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp b/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp
index 4318de7991..b211f3e6e2 100644
--- a/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp
+++ b/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/windowsmobile/testQMenuBar/main.cpp b/tests/auto/other/windowsmobile/testQMenuBar/main.cpp
index c2099a648b..2c39605f54 100644
--- a/tests/auto/other/windowsmobile/testQMenuBar/main.cpp
+++ b/tests/auto/other/windowsmobile/testQMenuBar/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/platformquirks.h b/tests/auto/platformquirks.h
index b9c9885bc4..35ef232aa3 100644
--- a/tests/auto/platformquirks.h
+++ b/tests/auto/platformquirks.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/sql/kernel/qsql/tst_qsql.cpp b/tests/auto/sql/kernel/qsql/tst_qsql.cpp
index e663289f6c..21459a0080 100644
--- a/tests/auto/sql/kernel/qsql/tst_qsql.cpp
+++ b/tests/auto/sql/kernel/qsql/tst_qsql.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_databases.h b/tests/auto/sql/kernel/qsqldatabase/tst_databases.h
index 466dd59663..767744a8a9 100644
--- a/tests/auto/sql/kernel/qsqldatabase/tst_databases.h
+++ b/tests/auto/sql/kernel/qsqldatabase/tst_databases.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp
index a124e6c5f5..b018c7428b 100644
--- a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp
+++ b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp b/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp
index 11622e4b2a..410389e53a 100644
--- a/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp
+++ b/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp b/tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp
index 8eb6ae77b7..5a2b4b3f57 100644
--- a/tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp
+++ b/tests/auto/sql/kernel/qsqlerror/tst_qsqlerror.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/sql/kernel/qsqlfield/tst_qsqlfield.cpp b/tests/auto/sql/kernel/qsqlfield/tst_qsqlfield.cpp
index c121dfa3a9..75fb6e19ce 100644
--- a/tests/auto/sql/kernel/qsqlfield/tst_qsqlfield.cpp
+++ b/tests/auto/sql/kernel/qsqlfield/tst_qsqlfield.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
index c970020a01..76090fd947 100644
--- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -3135,6 +3135,7 @@ void tst_QSqlQuery::QTBUG_21884()
*/
void tst_QSqlQuery::QTBUG_16967()
{
+ QSqlQuery q2;
QFETCH(QString, dbName);
{
QSqlDatabase db = QSqlDatabase::database(dbName);
@@ -3146,6 +3147,7 @@ void tst_QSqlQuery::QTBUG_16967()
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
QSqlQuery q(db);
+ q2 = q;
q.prepare("CREATE TABLE t1 (id INTEGER PRIMARY KEY, str TEXT);");
db.close();
QCOMPARE(db.lastError().type(), QSqlError::NoError);
@@ -3154,8 +3156,9 @@ void tst_QSqlQuery::QTBUG_16967()
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
QSqlQuery q(db);
- q.prepare("CREATE TABLE t1 (id INTEGER PRIMARY KEY, str TEXT);");
- q.exec();
+ q2 = q;
+ q2.prepare("CREATE TABLE t1 (id INTEGER PRIMARY KEY, str TEXT);");
+ q2.exec();
db.close();
QCOMPARE(db.lastError().type(), QSqlError::NoError);
}
@@ -3163,6 +3166,7 @@ void tst_QSqlQuery::QTBUG_16967()
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
QSqlQuery q(db);
+ q2 = q;
q.exec("INSERT INTO t1 (id, str) VALUES(1, \"test1\");");
db.close();
QCOMPARE(db.lastError().type(), QSqlError::NoError);
@@ -3171,6 +3175,7 @@ void tst_QSqlQuery::QTBUG_16967()
QSqlDatabase db = QSqlDatabase::database(dbName);
CHECK_DATABASE(db);
QSqlQuery q(db);
+ q2 = q;
q.exec("SELECT * FROM t1;");
db.close();
QCOMPARE(db.lastError().type(), QSqlError::NoError);
diff --git a/tests/auto/sql/kernel/qsqlrecord/tst_qsqlrecord.cpp b/tests/auto/sql/kernel/qsqlrecord/tst_qsqlrecord.cpp
index 60b3069e1f..8dd130a543 100644
--- a/tests/auto/sql/kernel/qsqlrecord/tst_qsqlrecord.cpp
+++ b/tests/auto/sql/kernel/qsqlrecord/tst_qsqlrecord.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp b/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp
index f14b3d4e93..db92696084 100644
--- a/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp
+++ b/tests/auto/sql/kernel/qsqlthread/tst_qsqlthread.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp b/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp
index 71cb59f971..333b599c08 100644
--- a/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp
+++ b/tests/auto/sql/models/qsqlquerymodel/tst_qsqlquerymodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp b/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp
index c18de4acce..0414ee235f 100644
--- a/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp
+++ b/tests/auto/sql/models/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp
index 13f6f67a0f..067dd0f7b8 100644
--- a/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp
+++ b/tests/auto/sql/models/qsqltablemodel/tst_qsqltablemodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/test.pl b/tests/auto/test.pl
index 4c7a6954d0..8a9c54c7a2 100755
--- a/tests/auto/test.pl
+++ b/tests/auto/test.pl
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
#############################################################################
##
-## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+## Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation (qt-info@nokia.com)
##
diff --git a/tests/auto/testlib/qsignalspy/tst_qsignalspy.cpp b/tests/auto/testlib/qsignalspy/tst_qsignalspy.cpp
index f8e8553e7c..0499c2e38b 100644
--- a/tests/auto/testlib/qsignalspy/tst_qsignalspy.cpp
+++ b/tests/auto/testlib/qsignalspy/tst_qsignalspy.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/testlib/selftests/.gitignore b/tests/auto/testlib/selftests/.gitignore
index 98a3f49081..56ba17abd7 100644
--- a/tests/auto/testlib/selftests/.gitignore
+++ b/tests/auto/testlib/selftests/.gitignore
@@ -13,6 +13,7 @@ fetchbogus/tst_fetchbogus
globaldata/tst_globaldata
maxwarnings/tst_maxwarnings
multiexec/tst_multiexec
+qexecstringlist/tst_qexecstringlist
singleskip/tst_singleskip
skip/tst_skip
skipglobal/tst_skipglobal
diff --git a/tests/auto/testlib/selftests/alive/qtestalive.cpp b/tests/auto/testlib/selftests/alive/qtestalive.cpp
index dd3d411ce5..5220142456 100644
--- a/tests/auto/testlib/selftests/alive/qtestalive.cpp
+++ b/tests/auto/testlib/selftests/alive/qtestalive.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/testlib/selftests/alive/tst_alive.cpp b/tests/auto/testlib/selftests/alive/tst_alive.cpp
index f29aebb176..112ef493b7 100644
--- a/tests/auto/testlib/selftests/alive/tst_alive.cpp
+++ b/tests/auto/testlib/selftests/alive/tst_alive.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -52,8 +52,6 @@ class tst_Alive: public QObject
private slots:
void alive();
void addMouseDClick() const;
- void compareQStringLists() const;
- void compareQStringLists_data() const;
};
void tst_Alive::alive()
@@ -95,80 +93,5 @@ void tst_Alive::addMouseDClick() const
QVERIFY(listener.isTested);
}
-void tst_Alive::compareQStringLists() const
-{
- QFETCH(QStringList, opA);
- QFETCH(QStringList, opB);
-
- QCOMPARE(opA, opB);
-}
-
-void tst_Alive::compareQStringLists_data() const
-{
- QTest::addColumn<QStringList>("opA");
- QTest::addColumn<QStringList>("opB");
-
- {
- QStringList opA;
- opA.append(QLatin1String("string1"));
- opA.append(QLatin1String("string2"));
-
- QStringList opB(opA);
- opA.append(QLatin1String("string3"));
- opB.append(QLatin1String("DIFFERS"));
-
- QTest::newRow("") << opA << opB;
- }
-
- {
- QStringList opA;
- opA.append(QLatin1String("string1"));
- opA.append(QLatin1String("string2"));
-
- QStringList opB(opA);
- opA.append(QLatin1String("string3"));
- opA.append(QLatin1String("string4"));
-
- opB.append(QLatin1String("DIFFERS"));
- opB.append(QLatin1String("string4"));
-
- QTest::newRow("") << opA << opB;
- }
-
- {
- QStringList opA;
- opA.append(QLatin1String("string1"));
- opA.append(QLatin1String("string2"));
-
- QStringList opB;
- opB.append(QLatin1String("string1"));
-
- QTest::newRow("") << opA << opB;
- }
-
- {
- QStringList opA;
- opA.append(QLatin1String("openInNewWindow"));
- opA.append(QLatin1String("openInNewTab"));
- opA.append(QLatin1String("separator"));
- opA.append(QLatin1String("bookmark_add"));
- opA.append(QLatin1String("savelinkas"));
- opA.append(QLatin1String("copylinklocation"));
- opA.append(QLatin1String("separator"));
- opA.append(QLatin1String("openWith_submenu"));
- opA.append(QLatin1String("preview1"));
- opA.append(QLatin1String("actions_submenu"));
- opA.append(QLatin1String("separator"));
- opA.append(QLatin1String("viewDocumentSource"));
-
- QStringList opB;
- opB.append(QLatin1String("viewDocumentSource"));
-
- QTest::newRow("") << opA << opB;
-
- QTest::newRow("") << opB << opA;
- }
-}
-
QTEST_MAIN(tst_Alive)
#include "tst_alive.moc"
diff --git a/tests/auto/testlib/selftests/assert/tst_assert.cpp b/tests/auto/testlib/selftests/assert/tst_assert.cpp
index bd44162971..c2ec453317 100644
--- a/tests/auto/testlib/selftests/assert/tst_assert.cpp
+++ b/tests/auto/testlib/selftests/assert/tst_assert.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -44,7 +44,7 @@
# undef QT_NO_DEBUG
#endif
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
class tst_Assert: public QObject
diff --git a/tests/auto/testlib/selftests/badxml/badxml.pro b/tests/auto/testlib/selftests/badxml/badxml.pro
index 561c7e01db..5eaa1c3216 100644
--- a/tests/auto/testlib/selftests/badxml/badxml.pro
+++ b/tests/auto/testlib/selftests/badxml/badxml.pro
@@ -5,4 +5,3 @@ mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
TARGET = badxml
-
diff --git a/tests/auto/testlib/selftests/badxml/tst_badxml.cpp b/tests/auto/testlib/selftests/badxml/tst_badxml.cpp
index 2d0b007df9..0d10504020 100644
--- a/tests/auto/testlib/selftests/badxml/tst_badxml.cpp
+++ b/tests/auto/testlib/selftests/badxml/tst_badxml.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
/*
diff --git a/tests/auto/testlib/selftests/benchlibcallgrind/benchlibcallgrind.pro b/tests/auto/testlib/selftests/benchlibcallgrind/benchlibcallgrind.pro
index baa996c8d3..6cbefe518c 100644
--- a/tests/auto/testlib/selftests/benchlibcallgrind/benchlibcallgrind.pro
+++ b/tests/auto/testlib/selftests/benchlibcallgrind/benchlibcallgrind.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = benchlibcallgrind
diff --git a/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp b/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp
index 1199462c99..7a7a190e7d 100644
--- a/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp
+++ b/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
/* This test must be explicitly enabled since there are no compile tests for valgrind.h */
diff --git a/tests/auto/testlib/selftests/benchlibeventcounter/benchlibeventcounter.pro b/tests/auto/testlib/selftests/benchlibeventcounter/benchlibeventcounter.pro
index d1fe909fa1..5e2b963491 100644
--- a/tests/auto/testlib/selftests/benchlibeventcounter/benchlibeventcounter.pro
+++ b/tests/auto/testlib/selftests/benchlibeventcounter/benchlibeventcounter.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = benchlibeventcounter
diff --git a/tests/auto/testlib/selftests/benchlibeventcounter/tst_benchlibeventcounter.cpp b/tests/auto/testlib/selftests/benchlibeventcounter/tst_benchlibeventcounter.cpp
index ccb69ddb6a..8a9a7e3f3a 100644
--- a/tests/auto/testlib/selftests/benchlibeventcounter/tst_benchlibeventcounter.cpp
+++ b/tests/auto/testlib/selftests/benchlibeventcounter/tst_benchlibeventcounter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
/* Custom event dispatcher to ensure we don't receive any spontaneous events */
@@ -57,8 +57,7 @@ public:
void interrupt() {}
bool processEvents(QEventLoop::ProcessEventsFlags) { return false; }
void registerSocketNotifier(QSocketNotifier*) {}
- int registerTimer(int,QObject*) { return -1; }
- void registerTimer(int,int,QObject*) {}
+ void registerTimer(int,int,Qt::TimerType,QObject*) {}
QList<TimerInfo> registeredTimers(QObject*) const { return QList<TimerInfo>(); }
void unregisterSocketNotifier(QSocketNotifier*) {}
bool unregisterTimer(int) { return false; }
diff --git a/tests/auto/testlib/selftests/benchliboptions/benchliboptions.pro b/tests/auto/testlib/selftests/benchliboptions/benchliboptions.pro
index 73173b0a08..f4bcc92129 100644
--- a/tests/auto/testlib/selftests/benchliboptions/benchliboptions.pro
+++ b/tests/auto/testlib/selftests/benchliboptions/benchliboptions.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = benchliboptions
diff --git a/tests/auto/testlib/selftests/benchliboptions/tst_benchliboptions.cpp b/tests/auto/testlib/selftests/benchliboptions/tst_benchliboptions.cpp
index cbe5af5ce8..2431a1df78 100644
--- a/tests/auto/testlib/selftests/benchliboptions/tst_benchliboptions.cpp
+++ b/tests/auto/testlib/selftests/benchliboptions/tst_benchliboptions.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
/* Custom event dispatcher to ensure we don't receive any spontaneous events */
@@ -57,8 +57,7 @@ public:
void interrupt() {}
bool processEvents(QEventLoop::ProcessEventsFlags) { return false; }
void registerSocketNotifier(QSocketNotifier*) {}
- int registerTimer(int,QObject*) { return -1; }
- void registerTimer(int,int,QObject*) {}
+ void registerTimer(int,int,Qt::TimerType,QObject*) {}
QList<TimerInfo> registeredTimers(QObject*) const { return QList<TimerInfo>(); }
void unregisterSocketNotifier(QSocketNotifier*) {}
bool unregisterTimer(int) { return false; }
diff --git a/tests/auto/testlib/selftests/benchlibtickcounter/tst_benchlibtickcounter.cpp b/tests/auto/testlib/selftests/benchlibtickcounter/tst_benchlibtickcounter.cpp
index 9e274edea5..38a7029262 100644
--- a/tests/auto/testlib/selftests/benchlibtickcounter/tst_benchlibtickcounter.cpp
+++ b/tests/auto/testlib/selftests/benchlibtickcounter/tst_benchlibtickcounter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
#include <private/cycle_p.h>
diff --git a/tests/auto/testlib/selftests/benchlibwalltime/tst_benchlibwalltime.cpp b/tests/auto/testlib/selftests/benchlibwalltime/tst_benchlibwalltime.cpp
index 9042c27936..c079983e6c 100644
--- a/tests/auto/testlib/selftests/benchlibwalltime/tst_benchlibwalltime.cpp
+++ b/tests/auto/testlib/selftests/benchlibwalltime/tst_benchlibwalltime.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
class tst_BenchlibWalltime: public QObject
diff --git a/tests/auto/testlib/selftests/cmptest/cmptest.pro b/tests/auto/testlib/selftests/cmptest/cmptest.pro
index ac392b0234..a793c203dd 100644
--- a/tests/auto/testlib/selftests/cmptest/cmptest.pro
+++ b/tests/auto/testlib/selftests/cmptest/cmptest.pro
@@ -1,8 +1,7 @@
SOURCES += tst_cmptest.cpp
-QT = core testlib
+QT = core gui testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = cmptest
diff --git a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
index 70396a75b3..72d3ac9665 100644
--- a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+++ b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,8 +40,90 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
+#include <QtGui/QImage>
+#include <QtGui/QPixmap>
+
+/* XPM test data for QPixmap, QImage tests (use drag cursors as example) */
+
+static const char * const xpmPixmapData1[] = {
+"11 20 3 1",
+". c None",
+"a c #FFFFFF",
+"X c #000000", // X11 cursor is traditionally black
+"aa.........",
+"aXa........",
+"aXXa.......",
+"aXXXa......",
+"aXXXXa.....",
+"aXXXXXa....",
+"aXXXXXXa...",
+"aXXXXXXXa..",
+"aXXXXXXXXa.",
+"aXXXXXXXXXa",
+"aXXXXXXaaaa",
+"aXXXaXXa...",
+"aXXaaXXa...",
+"aXa..aXXa..",
+"aa...aXXa..",
+"a.....aXXa.",
+"......aXXa.",
+".......aXXa",
+".......aXXa",
+"........aa."};
+
+static const char * const xpmPixmapData2[] = {
+"11 20 4 1",
+". c None",
+"a c #FFFFFF",
+"b c #0000FF",
+"X c #000000",
+"aab........",
+"aXab.......",
+"aXXab......",
+"aXXXab.....",
+"aXXXXab....",
+"aXXXXXab...",
+"aXXXXXXab..",
+"aXXXXXXXa..",
+"aXXXXXXXXa.",
+"aXXXXXXXXXa",
+"aXXXXXXaaaa",
+"aXXXaXXa...",
+"aXXaaXXa...",
+"aXa..aXXa..",
+"aa...aXXa..",
+"a.....aXXa.",
+"......aXXa.",
+".......aXXa",
+".......aXXa",
+"........aa."};
+
+static const char * const xpmPixmapData3[] = {
+"20 20 2 1",
+" c #000000",
+". c #C32D2D",
+" ..........",
+" ........",
+" .......",
+" ......",
+" ....",
+" ..",
+" .",
+" ",
+" ",
+". ",
+"... ",
+"..... ",
+"...... ",
+"....... ",
+"......... ",
+"........... ",
+"........... ",
+"............ ",
+"............ ",
+"............. "};
class tst_Cmptest: public QObject
{
@@ -52,6 +134,12 @@ private slots:
void compare_pointerfuncs();
void compare_tostring();
void compare_tostring_data();
+ void compareQStringLists();
+ void compareQStringLists_data();
+ void compareQPixmaps();
+ void compareQPixmaps_data();
+ void compareQImages();
+ void compareQImages_data();
};
static bool boolfunc() { return true; }
@@ -126,6 +214,151 @@ void tst_Cmptest::compare_tostring()
QCOMPARE(actual, expected);
}
-QTEST_MAIN(tst_Cmptest)
+void tst_Cmptest::compareQStringLists_data()
+{
+ QTest::addColumn<QStringList>("opA");
+ QTest::addColumn<QStringList>("opB");
+
+ {
+ QStringList opA;
+ QStringList opB(opA);
+
+ QTest::newRow("empty lists") << opA << opB;
+ }
+
+ {
+ QStringList opA;
+ opA.append(QLatin1String("string1"));
+ opA.append(QLatin1String("string2"));
+ opA.append(QLatin1String("string3"));
+ opA.append(QLatin1String("string4"));
+
+ QStringList opB(opA);
+
+ QTest::newRow("equal lists") << opA << opB;
+ }
+
+ {
+ QStringList opA;
+ opA.append(QLatin1String("string1"));
+ opA.append(QLatin1String("string2"));
+
+ QStringList opB(opA);
+ opA.append(QLatin1String("string3"));
+ opB.append(QLatin1String("DIFFERS"));
+ QTest::newRow("last item different") << opA << opB;
+ }
+
+ {
+ QStringList opA;
+ opA.append(QLatin1String("string1"));
+ opA.append(QLatin1String("string2"));
+
+ QStringList opB(opA);
+ opA.append(QLatin1String("string3"));
+ opA.append(QLatin1String("string4"));
+
+ opB.append(QLatin1String("DIFFERS"));
+ opB.append(QLatin1String("string4"));
+
+ QTest::newRow("second-last item different") << opA << opB;
+ }
+
+ {
+ QStringList opA;
+ opA.append(QLatin1String("string1"));
+ opA.append(QLatin1String("string2"));
+
+ QStringList opB;
+ opB.append(QLatin1String("string1"));
+
+ QTest::newRow("prefix") << opA << opB;
+ }
+
+ {
+ QStringList opA;
+ opA.append(QLatin1String("openInNewWindow"));
+ opA.append(QLatin1String("openInNewTab"));
+ opA.append(QLatin1String("separator"));
+ opA.append(QLatin1String("bookmark_add"));
+ opA.append(QLatin1String("savelinkas"));
+ opA.append(QLatin1String("copylinklocation"));
+ opA.append(QLatin1String("separator"));
+ opA.append(QLatin1String("openWith_submenu"));
+ opA.append(QLatin1String("preview1"));
+ opA.append(QLatin1String("actions_submenu"));
+ opA.append(QLatin1String("separator"));
+ opA.append(QLatin1String("viewDocumentSource"));
+
+ QStringList opB;
+ opB.append(QLatin1String("viewDocumentSource"));
+
+ QTest::newRow("short list second") << opA << opB;
+
+ QTest::newRow("short list first") << opB << opA;
+ }
+}
+
+void tst_Cmptest::compareQStringLists()
+{
+ QFETCH(QStringList, opA);
+ QFETCH(QStringList, opB);
+
+ QCOMPARE(opA, opB);
+}
+
+void tst_Cmptest::compareQPixmaps_data()
+{
+ QTest::addColumn<QPixmap>("opA");
+ QTest::addColumn<QPixmap>("opB");
+
+ const QPixmap pixmap1(xpmPixmapData1);
+ const QPixmap pixmap2(xpmPixmapData2);
+ const QPixmap pixmap3(xpmPixmapData3);
+
+ QTest::newRow("both null") << QPixmap() << QPixmap();
+ QTest::newRow("one null") << QPixmap() << pixmap1;
+ QTest::newRow("other null") << pixmap1 << QPixmap();
+ QTest::newRow("equal") << pixmap1 << pixmap1;
+ QTest::newRow("different size") << pixmap1 << pixmap3;
+ QTest::newRow("different pixels") << pixmap1 << pixmap2;
+}
+
+void tst_Cmptest::compareQPixmaps()
+{
+ QFETCH(QPixmap, opA);
+ QFETCH(QPixmap, opB);
+
+ QCOMPARE(opA, opB);
+}
+
+void tst_Cmptest::compareQImages_data()
+{
+ QTest::addColumn<QImage>("opA");
+ QTest::addColumn<QImage>("opB");
+
+ const QImage image1(QPixmap(xpmPixmapData1).toImage());
+ const QImage image2(QPixmap(xpmPixmapData2).toImage());
+ const QImage image1Indexed = image1.convertToFormat(QImage::Format_Indexed8);
+ const QImage image3(QPixmap(xpmPixmapData3).toImage());
+
+ QTest::newRow("both null") << QImage() << QImage();
+ QTest::newRow("one null") << QImage() << image1;
+ QTest::newRow("other null") << image1 << QImage();
+ QTest::newRow("equal") << image1 << image1;
+ QTest::newRow("different size") << image1 << image3;
+ QTest::newRow("different format") << image1 << image1Indexed;
+ QTest::newRow("different pixels") << image1 << image2;
+}
+
+void tst_Cmptest::compareQImages()
+{
+ QFETCH(QImage, opA);
+ QFETCH(QImage, opB);
+
+ QCOMPARE(opA, opB);
+}
+
+QTEST_MAIN(tst_Cmptest)
#include "tst_cmptest.moc"
diff --git a/tests/auto/testlib/selftests/commandlinedata/commandlinedata.pro b/tests/auto/testlib/selftests/commandlinedata/commandlinedata.pro
index 9dd1212eba..056388333a 100644
--- a/tests/auto/testlib/selftests/commandlinedata/commandlinedata.pro
+++ b/tests/auto/testlib/selftests/commandlinedata/commandlinedata.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = commandlinedata
diff --git a/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp b/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp
index 5f2dd3fffc..d6d3db886b 100644
--- a/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp
+++ b/tests/auto/testlib/selftests/commandlinedata/tst_commandlinedata.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
/*!
diff --git a/tests/auto/testlib/selftests/crashes/crashes.pro b/tests/auto/testlib/selftests/crashes/crashes.pro
index e9f0f3e5b7..25e24243d1 100644
--- a/tests/auto/testlib/selftests/crashes/crashes.pro
+++ b/tests/auto/testlib/selftests/crashes/crashes.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = crashes
diff --git a/tests/auto/testlib/selftests/crashes/tst_crashes.cpp b/tests/auto/testlib/selftests/crashes/tst_crashes.cpp
index d707414f5b..35a55a367a 100644
--- a/tests/auto/testlib/selftests/crashes/tst_crashes.cpp
+++ b/tests/auto/testlib/selftests/crashes/tst_crashes.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
#ifdef Q_OS_WIN
diff --git a/tests/auto/testlib/selftests/datatable/datatable.pro b/tests/auto/testlib/selftests/datatable/datatable.pro
index 7c36d4a911..72fa851ae6 100644
--- a/tests/auto/testlib/selftests/datatable/datatable.pro
+++ b/tests/auto/testlib/selftests/datatable/datatable.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = datatable
diff --git a/tests/auto/testlib/selftests/datatable/tst_datatable.cpp b/tests/auto/testlib/selftests/datatable/tst_datatable.cpp
index a55e9cbae2..de2495ce65 100644
--- a/tests/auto/testlib/selftests/datatable/tst_datatable.cpp
+++ b/tests/auto/testlib/selftests/datatable/tst_datatable.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
/*!
diff --git a/tests/auto/testlib/selftests/datetime/datetime.pro b/tests/auto/testlib/selftests/datetime/datetime.pro
index f73a763d6b..d65c59354f 100644
--- a/tests/auto/testlib/selftests/datetime/datetime.pro
+++ b/tests/auto/testlib/selftests/datetime/datetime.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = datetime
diff --git a/tests/auto/testlib/selftests/datetime/tst_datetime.cpp b/tests/auto/testlib/selftests/datetime/tst_datetime.cpp
index 64126644db..ee6baacd5b 100644
--- a/tests/auto/testlib/selftests/datetime/tst_datetime.cpp
+++ b/tests/auto/testlib/selftests/datetime/tst_datetime.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,11 +40,10 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDateTime>
#include <QtTest/QtTest>
-#include <QDateTime>
-
/*!
\internal
*/
diff --git a/tests/auto/testlib/selftests/differentexec/differentexec.pro b/tests/auto/testlib/selftests/differentexec/differentexec.pro
index 60000d12ea..7f148ba996 100644
--- a/tests/auto/testlib/selftests/differentexec/differentexec.pro
+++ b/tests/auto/testlib/selftests/differentexec/differentexec.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = differentexec
diff --git a/tests/auto/testlib/selftests/differentexec/tst_differentexec.cpp b/tests/auto/testlib/selftests/differentexec/tst_differentexec.cpp
index 5061369776..3a9e0eddf4 100644
--- a/tests/auto/testlib/selftests/differentexec/tst_differentexec.cpp
+++ b/tests/auto/testlib/selftests/differentexec/tst_differentexec.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/testlib/selftests/exceptionthrow/exceptionthrow.pro b/tests/auto/testlib/selftests/exceptionthrow/exceptionthrow.pro
index 4a72181a07..6b8c821e6e 100644
--- a/tests/auto/testlib/selftests/exceptionthrow/exceptionthrow.pro
+++ b/tests/auto/testlib/selftests/exceptionthrow/exceptionthrow.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = exceptionthrow
diff --git a/tests/auto/testlib/selftests/exceptionthrow/tst_exceptionthrow.cpp b/tests/auto/testlib/selftests/exceptionthrow/tst_exceptionthrow.cpp
index 23cc89ca61..34dae53d0f 100644
--- a/tests/auto/testlib/selftests/exceptionthrow/tst_exceptionthrow.cpp
+++ b/tests/auto/testlib/selftests/exceptionthrow/tst_exceptionthrow.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/testlib/selftests/expected_alive.txt b/tests/auto/testlib/selftests/expected_alive.txt
index 74d93c5a21..352c878575 100644
--- a/tests/auto/testlib/selftests/expected_alive.txt
+++ b/tests/auto/testlib/selftests/expected_alive.txt
@@ -8,26 +8,6 @@ QWARN : tst_Alive::alive() TEST LAGS 3 PINGS behind!
QWARN : tst_Alive::alive() TEST LAGS 4 PINGS behind!
PASS : tst_Alive::alive()
PASS : tst_Alive::addMouseDClick()
-FAIL! : tst_Alive::compareQStringLists() Compared QStringLists differ at index 2.
- Actual (opA) : 'string3'
- Expected (opB) : 'DIFFERS'
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/alive/tst_alive.cpp(68)]
-FAIL! : tst_Alive::compareQStringLists() Compared QStringLists differ at index 2.
- Actual (opA) : 'string3'
- Expected (opB) : 'DIFFERS'
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/alive/tst_alive.cpp(68)]
-FAIL! : tst_Alive::compareQStringLists() Compared QStringLists have different sizes.
- Actual (opA) size : '2'
- Expected (opB) size: '1'
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/alive/tst_alive.cpp(68)]
-FAIL! : tst_Alive::compareQStringLists() Compared QStringLists have different sizes.
- Actual (opA) size : '12'
- Expected (opB) size: '1'
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/alive/tst_alive.cpp(68)]
-FAIL! : tst_Alive::compareQStringLists() Compared QStringLists have different sizes.
- Actual (opA) size : '1'
- Expected (opB) size: '12'
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/alive/tst_alive.cpp(68)]
PASS : tst_Alive::cleanupTestCase()
-Totals: 4 passed, 5 failed, 0 skipped
+Totals: 4 passed, 0 failed, 0 skipped
********* Finished testing of tst_Alive *********
diff --git a/tests/auto/testlib/selftests/expected_cmptest.lightxml b/tests/auto/testlib/selftests/expected_cmptest.lightxml
index 97b0621f9c..17f3e6ec3a 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.lightxml
+++ b/tests/auto/testlib/selftests/expected_cmptest.lightxml
@@ -12,31 +12,117 @@
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="compare_tostring">
-<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="122">
+<Incident type="fail" file="tst_cmptest.cpp" line="214">
<DataTag><![CDATA[int, string]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual): QVariant(int,123)
Expected (expected): QVariant(QString,hi)]]></Description>
</Incident>
-<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="122">
+<Incident type="fail" file="tst_cmptest.cpp" line="214">
<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="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="122">
+<Incident type="fail" file="tst_cmptest.cpp" line="214">
<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="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="122">
+<Incident type="fail" file="tst_cmptest.cpp" line="214">
<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>
</TestFunction>
+<TestFunction name="compareQStringLists">
+<Incident type="fail" file="tst_cmptest.cpp" line="308">
+ <DataTag><![CDATA[last item different]]></DataTag>
+ <Description><![CDATA[Compared QStringLists differ at index 2.
+ Actual (opA) : 'string3'
+ Expected (opB) : 'DIFFERS']]></Description>
+</Incident>
+<Incident type="fail" file="tst_cmptest.cpp" line="308">
+ <DataTag><![CDATA[second-last item different]]></DataTag>
+ <Description><![CDATA[Compared QStringLists differ at index 2.
+ Actual (opA) : 'string3'
+ Expected (opB) : 'DIFFERS']]></Description>
+</Incident>
+<Incident type="fail" file="tst_cmptest.cpp" line="308">
+ <DataTag><![CDATA[prefix]]></DataTag>
+ <Description><![CDATA[Compared QStringLists have different sizes.
+ Actual (opA) size : '2'
+ Expected (opB) size: '1']]></Description>
+</Incident>
+<Incident type="fail" file="tst_cmptest.cpp" line="308">
+ <DataTag><![CDATA[short list second]]></DataTag>
+ <Description><![CDATA[Compared QStringLists have different sizes.
+ Actual (opA) size : '12'
+ Expected (opB) size: '1']]></Description>
+</Incident>
+<Incident type="fail" file="tst_cmptest.cpp" line="308">
+ <DataTag><![CDATA[short list first]]></DataTag>
+ <Description><![CDATA[Compared QStringLists have different sizes.
+ Actual (opA) size : '1'
+ Expected (opB) size: '12']]></Description>
+</Incident>
+</TestFunction>
+<TestFunction name="compareQPixmaps">
+<Incident type="fail" file="tst_cmptest.cpp" line="333">
+ <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="333">
+ <DataTag><![CDATA[other null]]></DataTag>
+ <Description><![CDATA[Compared QPixmaps differ.
+ Actual (opA).isNull() : 0
+ Expected (opB).isNull(): 1]]></Description>
+</Incident>
+<Incident type="fail" file="tst_cmptest.cpp" line="333">
+ <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="333">
+ <DataTag><![CDATA[different pixels]]></DataTag>
+ <Description><![CDATA[Compared values are not the same]]></Description>
+</Incident>
+</TestFunction>
+<TestFunction name="compareQImages">
+<Incident type="fail" file="tst_cmptest.cpp" line="360">
+ <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="360">
+ <DataTag><![CDATA[other null]]></DataTag>
+ <Description><![CDATA[Compared QImages differ.
+ Actual (opA).isNull() : 0
+ Expected (opB).isNull(): 1]]></Description>
+</Incident>
+<Incident type="fail" file="tst_cmptest.cpp" line="360">
+ <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="360">
+ <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="360">
+ <DataTag><![CDATA[different pixels]]></DataTag>
+ <Description><![CDATA[Compared values are not the same]]></Description>
+</Incident>
+</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
</TestFunction>
diff --git a/tests/auto/testlib/selftests/expected_cmptest.txt b/tests/auto/testlib/selftests/expected_cmptest.txt
index 30cc201ef1..36a4995d91 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.txt
+++ b/tests/auto/testlib/selftests/expected_cmptest.txt
@@ -6,19 +6,71 @@ 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: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(122)]
+ Loc: [tst_cmptest.cpp(214)]
FAIL! : tst_Cmptest::compare_tostring(null hash, invalid) Compared values are not the same
Actual (actual): QVariant(QVariantHash)
Expected (expected): QVariant()
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(122)]
+ Loc: [tst_cmptest.cpp(214)]
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: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(122)]
+ Loc: [tst_cmptest.cpp(214)]
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: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(122)]
+ Loc: [tst_cmptest.cpp(214)]
+FAIL! : tst_Cmptest::compareQStringLists(last item different) Compared QStringLists differ at index 2.
+ Actual (opA) : 'string3'
+ Expected (opB) : 'DIFFERS'
+ Loc: [tst_cmptest.cpp(308)]
+FAIL! : tst_Cmptest::compareQStringLists(second-last item different) Compared QStringLists differ at index 2.
+ Actual (opA) : 'string3'
+ Expected (opB) : 'DIFFERS'
+ Loc: [tst_cmptest.cpp(308)]
+FAIL! : tst_Cmptest::compareQStringLists(prefix) Compared QStringLists have different sizes.
+ Actual (opA) size : '2'
+ Expected (opB) size: '1'
+ Loc: [tst_cmptest.cpp(308)]
+FAIL! : tst_Cmptest::compareQStringLists(short list second) Compared QStringLists have different sizes.
+ Actual (opA) size : '12'
+ Expected (opB) size: '1'
+ Loc: [tst_cmptest.cpp(308)]
+FAIL! : tst_Cmptest::compareQStringLists(short list first) Compared QStringLists have different sizes.
+ Actual (opA) size : '1'
+ Expected (opB) size: '12'
+ Loc: [tst_cmptest.cpp(308)]
+FAIL! : tst_Cmptest::compareQPixmaps(one null) Compared QPixmaps differ.
+ Actual (opA).isNull() : 1
+ Expected (opB).isNull(): 0
+ Loc: [tst_cmptest.cpp(333)]
+FAIL! : tst_Cmptest::compareQPixmaps(other null) Compared QPixmaps differ.
+ Actual (opA).isNull() : 0
+ Expected (opB).isNull(): 1
+ Loc: [tst_cmptest.cpp(333)]
+FAIL! : tst_Cmptest::compareQPixmaps(different size) Compared QPixmaps differ in size.
+ Actual (opA) : 11x20
+ Expected (opB): 20x20
+ Loc: [tst_cmptest.cpp(333)]
+FAIL! : tst_Cmptest::compareQPixmaps(different pixels) Compared values are not the same
+ Loc: [tst_cmptest.cpp(333)]
+FAIL! : tst_Cmptest::compareQImages(one null) Compared QImages differ.
+ Actual (opA).isNull() : 1
+ Expected (opB).isNull(): 0
+ Loc: [tst_cmptest.cpp(360)]
+FAIL! : tst_Cmptest::compareQImages(other null) Compared QImages differ.
+ Actual (opA).isNull() : 0
+ Expected (opB).isNull(): 1
+ Loc: [tst_cmptest.cpp(360)]
+FAIL! : tst_Cmptest::compareQImages(different size) Compared QImages differ in size.
+ Actual (opA) : 11x20
+ Expected (opB): 20x20
+ Loc: [tst_cmptest.cpp(360)]
+FAIL! : tst_Cmptest::compareQImages(different format) Compared QImages differ in format.
+ Actual (opA) : 6
+ Expected (opB): 3
+ Loc: [tst_cmptest.cpp(360)]
+FAIL! : tst_Cmptest::compareQImages(different pixels) Compared values are not the same
+ Loc: [tst_cmptest.cpp(360)]
PASS : tst_Cmptest::cleanupTestCase()
-Totals: 4 passed, 4 failed, 0 skipped
+Totals: 4 passed, 18 failed, 0 skipped
********* Finished testing of tst_Cmptest *********
diff --git a/tests/auto/testlib/selftests/expected_cmptest.xml b/tests/auto/testlib/selftests/expected_cmptest.xml
index ea05c725fd..aba1ce5edd 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.xml
+++ b/tests/auto/testlib/selftests/expected_cmptest.xml
@@ -14,31 +14,117 @@
<Incident type="pass" file="" line="0" />
</TestFunction>
<TestFunction name="compare_tostring">
-<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="122">
+<Incident type="fail" file="tst_cmptest.cpp" line="214">
<DataTag><![CDATA[int, string]]></DataTag>
<Description><![CDATA[Compared values are not the same
Actual (actual): QVariant(int,123)
Expected (expected): QVariant(QString,hi)]]></Description>
</Incident>
-<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="122">
+<Incident type="fail" file="tst_cmptest.cpp" line="214">
<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="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="122">
+<Incident type="fail" file="tst_cmptest.cpp" line="214">
<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="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="122">
+<Incident type="fail" file="tst_cmptest.cpp" line="214">
<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>
</TestFunction>
+<TestFunction name="compareQStringLists">
+<Incident type="fail" file="tst_cmptest.cpp" line="308">
+ <DataTag><![CDATA[last item different]]></DataTag>
+ <Description><![CDATA[Compared QStringLists differ at index 2.
+ Actual (opA) : 'string3'
+ Expected (opB) : 'DIFFERS']]></Description>
+</Incident>
+<Incident type="fail" file="tst_cmptest.cpp" line="308">
+ <DataTag><![CDATA[second-last item different]]></DataTag>
+ <Description><![CDATA[Compared QStringLists differ at index 2.
+ Actual (opA) : 'string3'
+ Expected (opB) : 'DIFFERS']]></Description>
+</Incident>
+<Incident type="fail" file="tst_cmptest.cpp" line="308">
+ <DataTag><![CDATA[prefix]]></DataTag>
+ <Description><![CDATA[Compared QStringLists have different sizes.
+ Actual (opA) size : '2'
+ Expected (opB) size: '1']]></Description>
+</Incident>
+<Incident type="fail" file="tst_cmptest.cpp" line="308">
+ <DataTag><![CDATA[short list second]]></DataTag>
+ <Description><![CDATA[Compared QStringLists have different sizes.
+ Actual (opA) size : '12'
+ Expected (opB) size: '1']]></Description>
+</Incident>
+<Incident type="fail" file="tst_cmptest.cpp" line="308">
+ <DataTag><![CDATA[short list first]]></DataTag>
+ <Description><![CDATA[Compared QStringLists have different sizes.
+ Actual (opA) size : '1'
+ Expected (opB) size: '12']]></Description>
+</Incident>
+</TestFunction>
+<TestFunction name="compareQPixmaps">
+<Incident type="fail" file="tst_cmptest.cpp" line="333">
+ <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="333">
+ <DataTag><![CDATA[other null]]></DataTag>
+ <Description><![CDATA[Compared QPixmaps differ.
+ Actual (opA).isNull() : 0
+ Expected (opB).isNull(): 1]]></Description>
+</Incident>
+<Incident type="fail" file="tst_cmptest.cpp" line="333">
+ <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="333">
+ <DataTag><![CDATA[different pixels]]></DataTag>
+ <Description><![CDATA[Compared values are not the same]]></Description>
+</Incident>
+</TestFunction>
+<TestFunction name="compareQImages">
+<Incident type="fail" file="tst_cmptest.cpp" line="360">
+ <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="360">
+ <DataTag><![CDATA[other null]]></DataTag>
+ <Description><![CDATA[Compared QImages differ.
+ Actual (opA).isNull() : 0
+ Expected (opB).isNull(): 1]]></Description>
+</Incident>
+<Incident type="fail" file="tst_cmptest.cpp" line="360">
+ <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="360">
+ <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="360">
+ <DataTag><![CDATA[different pixels]]></DataTag>
+ <Description><![CDATA[Compared values are not the same]]></Description>
+</Incident>
+</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
</TestFunction>
diff --git a/tests/auto/testlib/selftests/expected_cmptest.xunitxml b/tests/auto/testlib/selftests/expected_cmptest.xunitxml
index 01bfda8d01..00f5f7f480 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.xunitxml
+++ b/tests/auto/testlib/selftests/expected_cmptest.xunitxml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<testsuite errors="0" failures="4" tests="5" name="tst_Cmptest">
+<testsuite errors="0" failures="18" tests="8" name="tst_Cmptest">
<properties>
<property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/>
<property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/>
@@ -21,6 +21,50 @@
Actual (actual): QVariant(PhonyClass,&lt;value not representable as string&gt;)
Expected (expected): QVariant(PhonyClass,&lt;value not representable as string&gt;)" result="fail"/>
</testcase>
+ <testcase result="fail" name="compareQStringLists">
+ <failure tag="last item different" message="Compared QStringLists differ at index 2.
+ Actual (opA) : &apos;string3&apos;
+ Expected (opB) : &apos;DIFFERS&apos;" result="fail"/>
+ <failure tag="second&#x002D;last item different" message="Compared QStringLists differ at index 2.
+ Actual (opA) : &apos;string3&apos;
+ Expected (opB) : &apos;DIFFERS&apos;" result="fail"/>
+ <failure tag="prefix" message="Compared QStringLists have different sizes.
+ Actual (opA) size : &apos;2&apos;
+ Expected (opB) size: &apos;1&apos;" result="fail"/>
+ <failure tag="short list second" message="Compared QStringLists have different sizes.
+ Actual (opA) size : &apos;12&apos;
+ Expected (opB) size: &apos;1&apos;" result="fail"/>
+ <failure tag="short list first" message="Compared QStringLists have different sizes.
+ Actual (opA) size : &apos;1&apos;
+ Expected (opB) size: &apos;12&apos;" result="fail"/>
+ </testcase>
+ <testcase result="fail" name="compareQPixmaps">
+ <failure tag="one null" message="Compared QPixmaps differ.
+ Actual (opA).isNull() : 1
+ Expected (opB).isNull(): 0" result="fail"/>
+ <failure tag="other null" message="Compared QPixmaps differ.
+ Actual (opA).isNull() : 0
+ Expected (opB).isNull(): 1" result="fail"/>
+ <failure tag="different size" message="Compared QPixmaps differ in size.
+ Actual (opA) : 11x20
+ Expected (opB): 20x20" result="fail"/>
+ <failure tag="different pixels" message="Compared values are not the same" result="fail"/>
+ </testcase>
+ <testcase result="fail" name="compareQImages">
+ <failure tag="one null" message="Compared QImages differ.
+ Actual (opA).isNull() : 1
+ Expected (opB).isNull(): 0" result="fail"/>
+ <failure tag="other null" message="Compared QImages differ.
+ Actual (opA).isNull() : 0
+ Expected (opB).isNull(): 1" result="fail"/>
+ <failure tag="different size" message="Compared QImages differ in size.
+ Actual (opA) : 11x20
+ Expected (opB): 20x20" result="fail"/>
+ <failure tag="different format" message="Compared QImages differ in format.
+ Actual (opA) : 6
+ Expected (opB): 3" result="fail"/>
+ <failure tag="different pixels" message="Compared values are not the same" result="fail"/>
+ </testcase>
<testcase result="pass" name="cleanupTestCase"/>
<system-err/>
</testsuite>
diff --git a/tests/auto/testlib/selftests/expected_expectfail.lightxml b/tests/auto/testlib/selftests/expected_expectfail.lightxml
index f983a870d3..79e5827caa 100644
--- a/tests/auto/testlib/selftests/expected_expectfail.lightxml
+++ b/tests/auto/testlib/selftests/expected_expectfail.lightxml
@@ -9,7 +9,7 @@
<Message type="qdebug" file="" line="0">
<Description><![CDATA[begin]]></Description>
</Message>
-<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="60">
+<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="70">
<Description><![CDATA[This should xfail]]></Description>
</Incident>
<Message type="qdebug" file="" line="0">
@@ -21,20 +21,55 @@
<Message type="qdebug" file="" line="0">
<Description><![CDATA[begin]]></Description>
</Message>
-<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="68">
+<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="78">
<Description><![CDATA[This should xfail]]></Description>
</Incident>
<Incident type="pass" file="" line="0" />
</TestFunction>
+<TestFunction name="expectTwice">
+<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="87">
+ <Description><![CDATA[Already expecting a fail]]></Description>
+</Incident>
+</TestFunction>
<TestFunction name="xfailWithQString">
-<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="75">
+<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="97">
<Description><![CDATA[A string]]></Description>
</Incident>
-<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="80">
+<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="102">
<Description><![CDATA[Bug 5 (The message)]]></Description>
</Incident>
<Incident type="pass" file="" line="0" />
</TestFunction>
+<TestFunction name="xpass">
+<Incident type="xpass" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="108">
+ <Description><![CDATA['true' returned FALSE. ()]]></Description>
+</Incident>
+</TestFunction>
+<TestFunction name="dataDrivenTest">
+<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="141">
+ <DataTag><![CDATA[Abort]]></DataTag>
+ <Description><![CDATA[This test should xfail]]></Description>
+</Incident>
+<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="141">
+ <DataTag><![CDATA[Continue]]></DataTag>
+ <Description><![CDATA[This test should xfail]]></Description>
+</Incident>
+<Incident type="pass" file="" line="0" />
+</TestFunction>
+<TestFunction name="expectOnWrongRow">
+<Incident type="pass" file="" line="0" />
+</TestFunction>
+<TestFunction name="expectOnAnyRow">
+<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="176">
+ <DataTag><![CDATA[first row]]></DataTag>
+ <Description><![CDATA[This test should xfail]]></Description>
+</Incident>
+<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="176">
+ <DataTag><![CDATA[second row]]></DataTag>
+ <Description><![CDATA[This test should xfail]]></Description>
+</Incident>
+<Incident type="pass" file="" line="0" />
+</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
</TestFunction>
diff --git a/tests/auto/testlib/selftests/expected_expectfail.txt b/tests/auto/testlib/selftests/expected_expectfail.txt
index 77b01dfd86..b31245151d 100644
--- a/tests/auto/testlib/selftests/expected_expectfail.txt
+++ b/tests/auto/testlib/selftests/expected_expectfail.txt
@@ -3,18 +3,33 @@ Config: Using QTest library @INSERT_QT_VERSION_HERE@, Qt @INSERT_QT_VERSION_HERE
PASS : tst_ExpectFail::initTestCase()
QDEBUG : tst_ExpectFail::expectAndContinue() begin
XFAIL : tst_ExpectFail::expectAndContinue() This should xfail
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(27)]
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(70)]
QDEBUG : tst_ExpectFail::expectAndContinue() after
PASS : tst_ExpectFail::expectAndContinue()
QDEBUG : tst_ExpectFail::expectAndAbort() begin
XFAIL : tst_ExpectFail::expectAndAbort() This should xfail
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(35)]
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(78)]
PASS : tst_ExpectFail::expectAndAbort()
+FAIL! : tst_ExpectFail::expectTwice() Already expecting a fail
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(87)]
XFAIL : tst_ExpectFail::xfailWithQString() A string
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(42)]
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(97)]
XFAIL : tst_ExpectFail::xfailWithQString() Bug 5 (The message)
- Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(47)]
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(102)]
PASS : tst_ExpectFail::xfailWithQString()
+XPASS : tst_ExpectFail::xpass() 'true' returned FALSE. ()
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(108)]
+XFAIL : tst_ExpectFail::dataDrivenTest(Abort) This test should xfail
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(141)]
+XFAIL : tst_ExpectFail::dataDrivenTest(Continue) This test should xfail
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(141)]
+PASS : tst_ExpectFail::dataDrivenTest()
+PASS : tst_ExpectFail::expectOnWrongRow()
+XFAIL : tst_ExpectFail::expectOnAnyRow(first row) This test should xfail
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(176)]
+XFAIL : tst_ExpectFail::expectOnAnyRow(second row) This test should xfail
+ Loc: [/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp(176)]
+PASS : tst_ExpectFail::expectOnAnyRow()
PASS : tst_ExpectFail::cleanupTestCase()
-Totals: 5 passed, 0 failed, 0 skipped
+Totals: 8 passed, 2 failed, 0 skipped
********* Finished testing of tst_ExpectFail *********
diff --git a/tests/auto/testlib/selftests/expected_expectfail.xml b/tests/auto/testlib/selftests/expected_expectfail.xml
index 12a1d5cdbf..676a030b3f 100644
--- a/tests/auto/testlib/selftests/expected_expectfail.xml
+++ b/tests/auto/testlib/selftests/expected_expectfail.xml
@@ -11,7 +11,7 @@
<Message type="qdebug" file="" line="0">
<Description><![CDATA[begin]]></Description>
</Message>
-<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="60">
+<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="70">
<Description><![CDATA[This should xfail]]></Description>
</Incident>
<Message type="qdebug" file="" line="0">
@@ -23,20 +23,55 @@
<Message type="qdebug" file="" line="0">
<Description><![CDATA[begin]]></Description>
</Message>
-<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="68">
+<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="78">
<Description><![CDATA[This should xfail]]></Description>
</Incident>
<Incident type="pass" file="" line="0" />
</TestFunction>
+<TestFunction name="expectTwice">
+<Incident type="fail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="87">
+ <Description><![CDATA[Already expecting a fail]]></Description>
+</Incident>
+</TestFunction>
<TestFunction name="xfailWithQString">
-<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="75">
+<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="97">
<Description><![CDATA[A string]]></Description>
</Incident>
-<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="80">
+<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="102">
<Description><![CDATA[Bug 5 (The message)]]></Description>
</Incident>
<Incident type="pass" file="" line="0" />
</TestFunction>
+<TestFunction name="xpass">
+<Incident type="xpass" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="108">
+ <Description><![CDATA['true' returned FALSE. ()]]></Description>
+</Incident>
+</TestFunction>
+<TestFunction name="dataDrivenTest">
+<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="141">
+ <DataTag><![CDATA[Abort]]></DataTag>
+ <Description><![CDATA[This test should xfail]]></Description>
+</Incident>
+<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="141">
+ <DataTag><![CDATA[Continue]]></DataTag>
+ <Description><![CDATA[This test should xfail]]></Description>
+</Incident>
+<Incident type="pass" file="" line="0" />
+</TestFunction>
+<TestFunction name="expectOnWrongRow">
+<Incident type="pass" file="" line="0" />
+</TestFunction>
+<TestFunction name="expectOnAnyRow">
+<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="176">
+ <DataTag><![CDATA[first row]]></DataTag>
+ <Description><![CDATA[This test should xfail]]></Description>
+</Incident>
+<Incident type="xfail" file="/home/user/dev/qt5/qtbase/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp" line="176">
+ <DataTag><![CDATA[second row]]></DataTag>
+ <Description><![CDATA[This test should xfail]]></Description>
+</Incident>
+<Incident type="pass" file="" line="0" />
+</TestFunction>
<TestFunction name="cleanupTestCase">
<Incident type="pass" file="" line="0" />
</TestFunction>
diff --git a/tests/auto/testlib/selftests/expected_expectfail.xunitxml b/tests/auto/testlib/selftests/expected_expectfail.xunitxml
index 32a5cfca81..328bb6433b 100644
--- a/tests/auto/testlib/selftests/expected_expectfail.xunitxml
+++ b/tests/auto/testlib/selftests/expected_expectfail.xunitxml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<testsuite errors="7" failures="0" tests="5" name="tst_ExpectFail">
+<testsuite errors="11" failures="2" tests="10" name="tst_ExpectFail">
<properties>
<property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/>
<property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/>
@@ -14,10 +14,25 @@
<!-- message="begin" type="qdebug" -->
<!-- message="This should xfail" type="info" -->
</testcase>
+ <testcase result="fail" name="expectTwice">
+ <failure message="Already expecting a fail" result="fail"/>
+ </testcase>
<testcase result="xfail" name="xfailWithQString">
<!-- message="A string" type="info" -->
<!-- message="Bug 5 (The message)" type="info" -->
</testcase>
+ <testcase result="xpass" name="xpass">
+ <failure message="&apos;true&apos; returned FALSE. ()" result="xpass"/>
+ </testcase>
+ <testcase result="xfail" name="dataDrivenTest">
+ <!-- tag="Abort" message="This test should xfail" type="info" -->
+ <!-- tag="Continue" message="This test should xfail" type="info" -->
+ </testcase>
+ <testcase result="pass" name="expectOnWrongRow"/>
+ <testcase result="xfail" name="expectOnAnyRow">
+ <!-- tag="first row" message="This test should xfail" type="info" -->
+ <!-- tag="second row" message="This test should xfail" type="info" -->
+ </testcase>
<testcase result="pass" name="cleanupTestCase"/>
<system-err>
<![CDATA[begin]]>
@@ -27,5 +42,9 @@
<![CDATA[This should xfail]]>
<![CDATA[A string]]>
<![CDATA[Bug 5 (The message)]]>
+<![CDATA[This test should xfail]]>
+<![CDATA[This test should xfail]]>
+<![CDATA[This test should xfail]]>
+<![CDATA[This test should xfail]]>
</system-err>
</testsuite>
diff --git a/tests/auto/testlib/selftests/expectfail/expectfail.pro b/tests/auto/testlib/selftests/expectfail/expectfail.pro
index a2916b2830..c1849990f2 100644
--- a/tests/auto/testlib/selftests/expectfail/expectfail.pro
+++ b/tests/auto/testlib/selftests/expectfail/expectfail.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = expectfail
diff --git a/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp b/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
index 04aef02cc7..79325a3bfc 100644
--- a/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
+++ b/tests/auto/testlib/selftests/expectfail/tst_expectfail.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,9 +40,11 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
+Q_DECLARE_METATYPE(QTest::TestFailMode)
+
class tst_ExpectFail: public QObject
{
Q_OBJECT
@@ -50,7 +52,15 @@ class tst_ExpectFail: public QObject
private slots:
void expectAndContinue() const;
void expectAndAbort() const;
+ void expectTwice() const;
void xfailWithQString() const;
+ void xpass() const;
+ void dataDrivenTest_data() const;
+ void dataDrivenTest() const;
+ void expectOnWrongRow_data() const;
+ void expectOnWrongRow() const;
+ void expectOnAnyRow_data() const;
+ void expectOnAnyRow() const;
};
void tst_ExpectFail::expectAndContinue() const
@@ -66,7 +76,19 @@ void tst_ExpectFail::expectAndAbort() const
qDebug("begin");
QEXPECT_FAIL("", "This should xfail", Abort);
QVERIFY(false);
- qDebug("this should not be reached");
+
+ // If we get here the test did not correctly abort on the previous QVERIFY.
+ QVERIFY2(false, "This should not be reached");
+}
+
+void tst_ExpectFail::expectTwice() const
+{
+ QEXPECT_FAIL("", "Calling QEXPECT_FAIL once is fine", Abort);
+ QEXPECT_FAIL("", "Calling QEXPECT_FAIL when already expecting a failure is "
+ "an error and should abort this test function", Abort);
+
+ // If we get here the test did not correctly abort on the double call to QEXPECT_FAIL.
+ QVERIFY2(false, "This should not be reached");
}
void tst_ExpectFail::xfailWithQString() const
@@ -80,6 +102,79 @@ void tst_ExpectFail::xfailWithQString() const
QVERIFY(false);
}
-QTEST_MAIN(tst_ExpectFail)
+void tst_ExpectFail::xpass() const
+{
+ QEXPECT_FAIL("", "This test should xpass", Abort);
+ QVERIFY(true);
+
+ // If we get here the test did not correctly abort on the previous
+ // unexpected pass.
+ QVERIFY2(false, "This should not be reached");
+}
+
+void tst_ExpectFail::dataDrivenTest_data() const
+{
+ QTest::addColumn<bool>("shouldPass");
+ QTest::addColumn<QTest::TestFailMode>("failMode");
+
+ QTest::newRow("Pass 1") << true << QTest::Abort;
+ QTest::newRow("Pass 2") << true << QTest::Continue;
+ QTest::newRow("Abort") << false << QTest::Abort;
+ QTest::newRow("Continue") << false << QTest::Continue;
+}
+
+void tst_ExpectFail::dataDrivenTest() const
+{
+ QFETCH(bool, shouldPass);
+ QFETCH(QTest::TestFailMode, failMode);
+
+ // You can't pass a variable as the last parameter of QEXPECT_FAIL,
+ // because the macro adds "QTest::" in front of the last parameter.
+ // That is why the following code appears to be a little strange.
+ if (!shouldPass) {
+ if (failMode == QTest::Abort)
+ QEXPECT_FAIL(QTest::currentDataTag(), "This test should xfail", Abort);
+ else
+ QEXPECT_FAIL(QTest::currentDataTag(), "This test should xfail", Continue);
+ }
+
+ QVERIFY(shouldPass);
+ // If we get here, we either expected to pass or we expected to
+ // fail and the failure mode was Continue.
+ if (!shouldPass)
+ QCOMPARE(failMode, QTest::Continue);
+}
+
+void tst_ExpectFail::expectOnWrongRow_data() const
+{
+ QTest::addColumn<int>("dummy");
+
+ QTest::newRow("right row") << 0;
+}
+
+void tst_ExpectFail::expectOnWrongRow() const
+{
+ // QEXPECT_FAIL for a row that is not the current row should be ignored.
+ QEXPECT_FAIL("wrong row", "This xfail should be ignored", Abort);
+ QVERIFY(true);
+}
+
+void tst_ExpectFail::expectOnAnyRow_data() const
+{
+ QTest::addColumn<int>("dummy");
+
+ QTest::newRow("first row") << 0;
+ QTest::newRow("second row") << 1;
+}
+
+void tst_ExpectFail::expectOnAnyRow() const
+{
+ // In a data-driven test, passing an empty first parameter to QEXPECT_FAIL
+ // should mean that the failure is expected for all data rows.
+ QEXPECT_FAIL("", "This test should xfail", Abort);
+ QVERIFY(false);
+}
+
+QTEST_MAIN(tst_ExpectFail)
#include "tst_expectfail.moc"
diff --git a/tests/auto/testlib/selftests/failinit/failinit.pro b/tests/auto/testlib/selftests/failinit/failinit.pro
index 9a781840c6..6a30a5af68 100644
--- a/tests/auto/testlib/selftests/failinit/failinit.pro
+++ b/tests/auto/testlib/selftests/failinit/failinit.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = failinit
diff --git a/tests/auto/testlib/selftests/failinit/tst_failinit.cpp b/tests/auto/testlib/selftests/failinit/tst_failinit.cpp
index 0bf448f428..8f217f1d0a 100644
--- a/tests/auto/testlib/selftests/failinit/tst_failinit.cpp
+++ b/tests/auto/testlib/selftests/failinit/tst_failinit.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/testlib/selftests/failinitdata/failinitdata.pro b/tests/auto/testlib/selftests/failinitdata/failinitdata.pro
index 7b0b15a59b..b608c67dbb 100644
--- a/tests/auto/testlib/selftests/failinitdata/failinitdata.pro
+++ b/tests/auto/testlib/selftests/failinitdata/failinitdata.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = failinitdata
diff --git a/tests/auto/testlib/selftests/failinitdata/tst_failinitdata.cpp b/tests/auto/testlib/selftests/failinitdata/tst_failinitdata.cpp
index 00e4d12256..b14242f129 100644
--- a/tests/auto/testlib/selftests/failinitdata/tst_failinitdata.cpp
+++ b/tests/auto/testlib/selftests/failinitdata/tst_failinitdata.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/testlib/selftests/fetchbogus/fetchbogus.pro b/tests/auto/testlib/selftests/fetchbogus/fetchbogus.pro
index 1f8652d533..33b306ca75 100644
--- a/tests/auto/testlib/selftests/fetchbogus/fetchbogus.pro
+++ b/tests/auto/testlib/selftests/fetchbogus/fetchbogus.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = fetchbogus
diff --git a/tests/auto/testlib/selftests/fetchbogus/tst_fetchbogus.cpp b/tests/auto/testlib/selftests/fetchbogus/tst_fetchbogus.cpp
index 65d10c180c..f6f4f0de99 100644
--- a/tests/auto/testlib/selftests/fetchbogus/tst_fetchbogus.cpp
+++ b/tests/auto/testlib/selftests/fetchbogus/tst_fetchbogus.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
class tst_FetchBogus: public QObject
diff --git a/tests/auto/testlib/selftests/findtestdata/findtestdata.cpp b/tests/auto/testlib/selftests/findtestdata/findtestdata.cpp
index 473ba19798..09b8634334 100644
--- a/tests/auto/testlib/selftests/findtestdata/findtestdata.cpp
+++ b/tests/auto/testlib/selftests/findtestdata/findtestdata.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtCore/QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
#define TESTFILE "testfile"
@@ -62,7 +62,11 @@ void FindTestData::initTestCase()
{
// verify that our qt.conf is working as expected.
QString app_path = QCoreApplication::applicationDirPath();
- QString install_path = app_path + "/tests";
+ QString install_path = app_path
+#ifdef Q_OS_MAC
+ + "/Contents"
+#endif
+ + "/tests";
QVERIFY(QDir("/").mkpath(install_path));
QVERIFY(QDir("/").mkpath(install_path + "/findtestdata"));
QCOMPARE(QLibraryInfo::location(QLibraryInfo::TestsPath), install_path);
@@ -107,7 +111,11 @@ void FindTestData::paths()
QVERIFY(touch(testfile_path1));
// 2. at the test install path (faked via qt.conf)
- QString testfile_path2 = app_path + "/tests/findtestdata/" TESTFILE;
+ QString testfile_path2 = app_path
+#ifdef Q_OS_MAC
+ + "/Contents"
+#endif
+ + "/tests/findtestdata/" TESTFILE;
QVERIFY(touch(testfile_path2));
// 3. at the source path (which we will fake later on)
diff --git a/tests/auto/testlib/selftests/float/tst_float.cpp b/tests/auto/testlib/selftests/float/tst_float.cpp
index 65bd3188cb..47fb253cd0 100644
--- a/tests/auto/testlib/selftests/float/tst_float.cpp
+++ b/tests/auto/testlib/selftests/float/tst_float.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
#include <QDebug>
diff --git a/tests/auto/testlib/selftests/globaldata/globaldata.pro b/tests/auto/testlib/selftests/globaldata/globaldata.pro
index 3d49d3515b..c0b1554c0f 100644
--- a/tests/auto/testlib/selftests/globaldata/globaldata.pro
+++ b/tests/auto/testlib/selftests/globaldata/globaldata.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = globaldata
diff --git a/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp b/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp
index 898cccf435..5a7ffd328f 100644
--- a/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp
+++ b/tests/auto/testlib/selftests/globaldata/tst_globaldata.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
#include <QDebug>
diff --git a/tests/auto/testlib/selftests/longstring/longstring.pro b/tests/auto/testlib/selftests/longstring/longstring.pro
index 9b393e9cc7..d16ba85095 100644
--- a/tests/auto/testlib/selftests/longstring/longstring.pro
+++ b/tests/auto/testlib/selftests/longstring/longstring.pro
@@ -4,6 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = longstring
-
diff --git a/tests/auto/testlib/selftests/longstring/tst_longstring.cpp b/tests/auto/testlib/selftests/longstring/tst_longstring.cpp
index 99dac95ba1..d42e760483 100644
--- a/tests/auto/testlib/selftests/longstring/tst_longstring.cpp
+++ b/tests/auto/testlib/selftests/longstring/tst_longstring.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
char const lipsum[] =
diff --git a/tests/auto/testlib/selftests/maxwarnings/maxwarnings.cpp b/tests/auto/testlib/selftests/maxwarnings/maxwarnings.cpp
index 398d0d8e4a..fdfe00fc42 100644
--- a/tests/auto/testlib/selftests/maxwarnings/maxwarnings.cpp
+++ b/tests/auto/testlib/selftests/maxwarnings/maxwarnings.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtCore/QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
class MaxWarnings: public QObject
diff --git a/tests/auto/testlib/selftests/maxwarnings/maxwarnings.pro b/tests/auto/testlib/selftests/maxwarnings/maxwarnings.pro
index 9ebdde5015..79451af1ec 100644
--- a/tests/auto/testlib/selftests/maxwarnings/maxwarnings.pro
+++ b/tests/auto/testlib/selftests/maxwarnings/maxwarnings.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = maxwarnings
diff --git a/tests/auto/testlib/selftests/multiexec/multiexec.pro b/tests/auto/testlib/selftests/multiexec/multiexec.pro
index 79ae010bcb..2038acbd31 100644
--- a/tests/auto/testlib/selftests/multiexec/multiexec.pro
+++ b/tests/auto/testlib/selftests/multiexec/multiexec.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = multiexec
diff --git a/tests/auto/testlib/selftests/multiexec/tst_multiexec.cpp b/tests/auto/testlib/selftests/multiexec/tst_multiexec.cpp
index 0480714c77..d6a5e32f05 100644
--- a/tests/auto/testlib/selftests/multiexec/tst_multiexec.cpp
+++ b/tests/auto/testlib/selftests/multiexec/tst_multiexec.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/testlib/selftests/printdatatags/tst_printdatatags.cpp b/tests/auto/testlib/selftests/printdatatags/tst_printdatatags.cpp
index f0882316b8..4fdd33268a 100644
--- a/tests/auto/testlib/selftests/printdatatags/tst_printdatatags.cpp
+++ b/tests/auto/testlib/selftests/printdatatags/tst_printdatatags.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/testlib/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp b/tests/auto/testlib/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp
index 53454fc1ac..23dbfa1ee4 100644
--- a/tests/auto/testlib/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp
+++ b/tests/auto/testlib/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/testlib/selftests/qexecstringlist/qexecstringlist.pro b/tests/auto/testlib/selftests/qexecstringlist/qexecstringlist.pro
new file mode 100644
index 0000000000..bd967f32e6
--- /dev/null
+++ b/tests/auto/testlib/selftests/qexecstringlist/qexecstringlist.pro
@@ -0,0 +1,7 @@
+SOURCES += tst_qexecstringlist.cpp
+QT = core testlib
+
+mac:CONFIG -= app_bundle
+CONFIG -= debug_and_release_target
+
+TARGET = qexecstringlist
diff --git a/tests/auto/testlib/selftests/qexecstringlist/tst_qexecstringlist.cpp b/tests/auto/testlib/selftests/qexecstringlist/tst_qexecstringlist.cpp
new file mode 100644
index 0000000000..5df7e1e1d5
--- /dev/null
+++ b/tests/auto/testlib/selftests/qexecstringlist/tst_qexecstringlist.cpp
@@ -0,0 +1,96 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include <QtCore/QCoreApplication>
+#include <QtTest/QtTest>
+
+class tst_QExecStringList: public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void testA() const;
+ void testB() const;
+ void testB_data() const;
+ void testC() const;
+};
+
+void tst_QExecStringList::testA() const
+{
+}
+
+void tst_QExecStringList::testB() const
+{
+ QFETCH(bool, dummy);
+ Q_UNUSED(dummy);
+}
+
+void tst_QExecStringList::testB_data() const
+{
+ QTest::addColumn<bool>("dummy");
+
+ QTest::newRow("Data1") << false;
+ QTest::newRow("Data2") << false;
+ QTest::newRow("Data3") << false;
+}
+
+void tst_QExecStringList::testC() const
+{
+}
+
+int main(int argc,char *argv[])
+{
+ QCoreApplication app(argc, argv);
+
+ tst_QExecStringList test;
+
+ QTest::qExec(&test, app.arguments());
+ QTest::qExec(&test, QStringList("appName"));
+ QTest::qExec(&test, QStringList("appName") << "testA");
+ QTest::qExec(&test, QStringList("appName") << "testB");
+ QTest::qExec(&test, QStringList("appName") << "testB:Data2");
+ QTest::qExec(&test, QStringList("appName") << "testC");
+
+ return 0;
+}
+
+#include "tst_qexecstringlist.moc"
diff --git a/tests/auto/testlib/selftests/selftests.pri b/tests/auto/testlib/selftests/selftests.pri
new file mode 100644
index 0000000000..f506c8c08c
--- /dev/null
+++ b/tests/auto/testlib/selftests/selftests.pri
@@ -0,0 +1,7 @@
+SUBPROGRAMS = subtest warnings maxwarnings cmptest globaldata skip \
+ strcmp expectfail sleep fetchbogus crashes multiexec failinit failinitdata \
+ skipinit skipinitdata datetime singleskip assert differentexec \
+ exceptionthrow qexecstringlist datatable commandlinedata\
+ benchlibwalltime benchlibcallgrind benchlibeventcounter benchlibtickcounter \
+ benchliboptions xunit badxml longstring float printdatatags \
+ printdatatagswithglobaltags findtestdata
diff --git a/tests/auto/testlib/selftests/selftests.pro b/tests/auto/testlib/selftests/selftests.pro
index b4c4255dfc..1d39e6a899 100644
--- a/tests/auto/testlib/selftests/selftests.pro
+++ b/tests/auto/testlib/selftests/selftests.pro
@@ -1,12 +1,8 @@
TEMPLATE = subdirs
-SUBDIRS = subtest test warnings maxwarnings cmptest globaldata skip \
- strcmp expectfail sleep fetchbogus crashes multiexec failinit failinitdata \
- skipinit skipinitdata datetime singleskip assert differentexec \
- exceptionthrow datatable commandlinedata \
- benchlibwalltime benchlibcallgrind benchlibeventcounter benchlibtickcounter \
- benchliboptions xunit badxml longstring float printdatatags \
- printdatatagswithglobaltags findtestdata
+include(selftests.pri)
+
+SUBDIRS = $$SUBPROGRAMS test
INSTALLS =
diff --git a/tests/auto/testlib/selftests/selftests.qrc b/tests/auto/testlib/selftests/selftests.qrc
index 5090fa7378..fb303af2b5 100644
--- a/tests/auto/testlib/selftests/selftests.qrc
+++ b/tests/auto/testlib/selftests/selftests.qrc
@@ -95,6 +95,7 @@
<file>expected_multiexec.xunitxml</file>
<file>expected_printdatatags.txt</file>
<file>expected_printdatatagswithglobaltags.txt</file>
+ <file>expected_qexecstringlist.txt</file>
<file>expected_singleskip.lightxml</file>
<file>expected_singleskip.txt</file>
<file>expected_singleskip.xml</file>
diff --git a/tests/auto/testlib/selftests/singleskip/singleskip.pro b/tests/auto/testlib/selftests/singleskip/singleskip.pro
index f4bde92d62..9f63e62747 100644
--- a/tests/auto/testlib/selftests/singleskip/singleskip.pro
+++ b/tests/auto/testlib/selftests/singleskip/singleskip.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = singleskip
diff --git a/tests/auto/testlib/selftests/singleskip/tst_singleskip.cpp b/tests/auto/testlib/selftests/singleskip/tst_singleskip.cpp
index 7701eb81a0..d36b9b52f9 100644
--- a/tests/auto/testlib/selftests/singleskip/tst_singleskip.cpp
+++ b/tests/auto/testlib/selftests/singleskip/tst_singleskip.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
class tst_SingleSkip: public QObject
diff --git a/tests/auto/testlib/selftests/skip/skip.pro b/tests/auto/testlib/selftests/skip/skip.pro
index 82576212ad..8780d295cf 100644
--- a/tests/auto/testlib/selftests/skip/skip.pro
+++ b/tests/auto/testlib/selftests/skip/skip.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = skip
diff --git a/tests/auto/testlib/selftests/skip/tst_skip.cpp b/tests/auto/testlib/selftests/skip/tst_skip.cpp
index 905fe2dde4..76e9059f87 100644
--- a/tests/auto/testlib/selftests/skip/tst_skip.cpp
+++ b/tests/auto/testlib/selftests/skip/tst_skip.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
class tst_Skip: public QObject
diff --git a/tests/auto/testlib/selftests/skipinit/skipinit.pro b/tests/auto/testlib/selftests/skipinit/skipinit.pro
index 848252eabd..7defce9a52 100644
--- a/tests/auto/testlib/selftests/skipinit/skipinit.pro
+++ b/tests/auto/testlib/selftests/skipinit/skipinit.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = skipinit
diff --git a/tests/auto/testlib/selftests/skipinit/tst_skipinit.cpp b/tests/auto/testlib/selftests/skipinit/tst_skipinit.cpp
index 1a9fc1eeec..052dabb343 100644
--- a/tests/auto/testlib/selftests/skipinit/tst_skipinit.cpp
+++ b/tests/auto/testlib/selftests/skipinit/tst_skipinit.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/testlib/selftests/skipinitdata/skipinitdata.pro b/tests/auto/testlib/selftests/skipinitdata/skipinitdata.pro
index 762543a60b..cd806c2a43 100644
--- a/tests/auto/testlib/selftests/skipinitdata/skipinitdata.pro
+++ b/tests/auto/testlib/selftests/skipinitdata/skipinitdata.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = skipinitdata
diff --git a/tests/auto/testlib/selftests/skipinitdata/tst_skipinitdata.cpp b/tests/auto/testlib/selftests/skipinitdata/tst_skipinitdata.cpp
index b09e99b32f..96c9eb6aff 100644
--- a/tests/auto/testlib/selftests/skipinitdata/tst_skipinitdata.cpp
+++ b/tests/auto/testlib/selftests/skipinitdata/tst_skipinitdata.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/testlib/selftests/sleep/sleep.pro b/tests/auto/testlib/selftests/sleep/sleep.pro
index e0ae72f54a..affcba22ee 100644
--- a/tests/auto/testlib/selftests/sleep/sleep.pro
+++ b/tests/auto/testlib/selftests/sleep/sleep.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = sleep
diff --git a/tests/auto/testlib/selftests/sleep/tst_sleep.cpp b/tests/auto/testlib/selftests/sleep/tst_sleep.cpp
index e509954b5d..349ecb1d1c 100644
--- a/tests/auto/testlib/selftests/sleep/tst_sleep.cpp
+++ b/tests/auto/testlib/selftests/sleep/tst_sleep.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
class tst_Sleep: public QObject
diff --git a/tests/auto/testlib/selftests/strcmp/strcmp.pro b/tests/auto/testlib/selftests/strcmp/strcmp.pro
index ac1f1e840e..f5f6eecc88 100644
--- a/tests/auto/testlib/selftests/strcmp/strcmp.pro
+++ b/tests/auto/testlib/selftests/strcmp/strcmp.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = strcmp
diff --git a/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp b/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp
index 89689bb3bc..2cd69a5873 100644
--- a/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp
+++ b/tests/auto/testlib/selftests/strcmp/tst_strcmp.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
class tst_StrCmp: public QObject
diff --git a/tests/auto/testlib/selftests/subtest/subtest.pro b/tests/auto/testlib/selftests/subtest/subtest.pro
index 3066f20247..09dee1b1b9 100644
--- a/tests/auto/testlib/selftests/subtest/subtest.pro
+++ b/tests/auto/testlib/selftests/subtest/subtest.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = subtest
diff --git a/tests/auto/testlib/selftests/subtest/tst_subtest.cpp b/tests/auto/testlib/selftests/subtest/tst_subtest.cpp
index 7ccfc507d7..385d43ab8d 100644
--- a/tests/auto/testlib/selftests/subtest/tst_subtest.cpp
+++ b/tests/auto/testlib/selftests/subtest/tst_subtest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,9 +40,9 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDebug>
#include <QtTest/QtTest>
-#include <QDebug>
class tst_Subtest: public QObject
{
diff --git a/tests/auto/testlib/selftests/test/test.pro b/tests/auto/testlib/selftests/test/test.pro
index 29d2cc5f36..a395ecea47 100644
--- a/tests/auto/testlib/selftests/test/test.pro
+++ b/tests/auto/testlib/selftests/test/test.pro
@@ -13,3 +13,8 @@ win32 {
}
RESOURCES += ../selftests.qrc
+
+include(../selftests.pri)
+load(testcase) # for target.path and installTestHelperApp()
+for(file, SUBPROGRAMS): installTestHelperApp("../$${file}/$${file}",$${file},$${file})
+
diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp
index f7a485b857..04696a1387 100644
--- a/tests/auto/testlib/selftests/tst_selftests.cpp
+++ b/tests/auto/testlib/selftests/tst_selftests.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -39,15 +39,19 @@
**
****************************************************************************/
-#include <QtCore>
-#include <QtTest/QtTest>
+#include <QtCore/QCoreApplication>
#include <QtCore/QXmlStreamReader>
+#include <QtCore/QFileInfo>
+#include <QtCore/QDir>
+#include <QtTest/QtTest>
+
#include <private/cycle_p.h>
class tst_Selftests: public QObject
{
Q_OBJECT
private slots:
+ void initTestCase();
void runSubTest_data();
void runSubTest();
void cleanup();
@@ -285,6 +289,22 @@ static QList<LoggerSet> allLoggerSets()
;
}
+void tst_Selftests::initTestCase()
+{
+ //Detect the location of the sub programs
+ QString subProgram = QLatin1String("float/float");
+#if defined(Q_OS_WIN)
+ subProgram = QLatin1String("float/float.exe");
+#endif
+ QString testdataDir = QFINDTESTDATA(subProgram);
+ if (testdataDir.lastIndexOf(subProgram) > 0)
+ testdataDir = testdataDir.left(testdataDir.lastIndexOf(subProgram));
+ else
+ testdataDir = QCoreApplication::applicationDirPath();
+ // chdir to our testdata path and execute helper apps relative to that.
+ QVERIFY2(QDir::setCurrent(testdataDir), qPrintable("Could not chdir to " + testdataDir));
+}
+
void tst_Selftests::runSubTest_data()
{
QTest::addColumn<QString>("subdir");
@@ -311,7 +331,7 @@ void tst_Selftests::runSubTest_data()
<< "datatable"
<< "datetime"
<< "differentexec"
-#if !defined(QT_NO_EXCEPTIONS) && (!defined(Q_CC_INTEL) || !defined(Q_OS_WIN))
+#if !defined(QT_NO_EXCEPTIONS) && !defined(Q_CC_INTEL) && !defined(Q_OS_WIN)
// Disable this test on Windows and for intel compiler, as the run-times
// will popup dialogs with warnings that uncaught exceptions were thrown
<< "exceptionthrow"
@@ -319,7 +339,10 @@ void tst_Selftests::runSubTest_data()
<< "expectfail"
<< "failinit"
<< "failinitdata"
+#if !defined(Q_OS_WIN)
+ // Disable this test on Windows, as the run-time will popup dialogs with warnings
<< "fetchbogus"
+#endif
<< "float"
<< "globaldata"
<< "longstring"
@@ -327,6 +350,7 @@ void tst_Selftests::runSubTest_data()
<< "multiexec"
<< "printdatatags"
<< "printdatatagswithglobaltags"
+ << "qexecstringlist"
<< "singleskip"
<< "skip"
<< "skipinit"
@@ -391,6 +415,9 @@ void tst_Selftests::runSubTest_data()
if (subtest == "multiexec") {
continue;
}
+ if (subtest == "qexecstringlist") {
+ continue;
+ }
if (subtest == "benchliboptions") {
continue;
}
@@ -430,16 +457,41 @@ static inline QProcessEnvironment processEnvironment()
{
QProcessEnvironment result;
const QString path = QStringLiteral("PATH");
- result.insert(path, QProcessEnvironment::systemEnvironment().value(path));
+ const QProcessEnvironment systemEnvironment = QProcessEnvironment::systemEnvironment();
+ result.insert(path, systemEnvironment.value(path));
+ // Preserve DISPLAY for X11 as some tests use QtGui.
+#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
+ const QString display = QStringLiteral("DISPLAY");
+ const QString displayValue = systemEnvironment.value(display);
+ if (!displayValue.isEmpty())
+ result.insert(display, displayValue);
+#endif
+ const QString platform = QStringLiteral("QT_QPA_PLATFORM");
+ const QString platformValue = systemEnvironment.value(platform);
+ if (!platformValue.isEmpty())
+ result.insert(platform, platformValue);
return result;
}
void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& loggers, QStringList const& arguments)
{
+#if defined(__GNUC__) && defined(__i386) && defined(Q_OS_LINUX)
+ if (arguments.contains("-callgrind")) {
+ QProcess checkProcess;
+ QStringList args;
+ args << QLatin1String("--version");
+ checkProcess.start(QLatin1String("valgrind"), args);
+ if (!checkProcess.waitForFinished(-1))
+ QSKIP(QString("Valgrind broken or not available. Not running %1 test!").arg(subdir).toLocal8Bit());
+ }
+#endif
+
QProcess proc;
static const QProcessEnvironment environment = processEnvironment();
proc.setProcessEnvironment(environment);
- proc.start(subdir + QLatin1Char('/') + subdir, arguments);
+ const QString path = subdir + QLatin1Char('/') + subdir;
+ proc.start(path, arguments);
+ QVERIFY2(proc.waitForStarted(), qPrintable(QString::fromLatin1("Cannot start '%1': %2").arg(path, proc.errorString())));
QVERIFY2(proc.waitForFinished(), qPrintable(proc.errorString()));
QList<QByteArray> actualOutputs;
@@ -469,6 +521,7 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge
// newer than the valgrind version, such that valgrind can't understand the
// debug information on the binary.
if (subdir != QLatin1String("exceptionthrow")
+ && subdir != QLatin1String("cmptest") // QImage comparison requires QGuiApplication
&& subdir != QLatin1String("fetchbogus")
&& subdir != QLatin1String("xunit")
&& subdir != QLatin1String("benchlibcallgrind"))
@@ -507,7 +560,9 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge
}
}
} else {
- QCOMPARE(res.count(), exp.count());
+ QVERIFY2(res.count() == exp.count(),
+ qPrintable(QString::fromLatin1("Mismatch in line count: %1 != %2 (%3).")
+ .arg(res.count()).arg(exp.count()).arg(loggers.at(n))));
}
// For xml output formats, verify that the log is valid XML.
@@ -568,7 +623,9 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QStringList const& logge
QCOMPARE(actualResult, expectedResult);
} else {
- QCOMPARE(output, expected);
+ QVERIFY2(output == expected,
+ qPrintable(QString::fromLatin1("Mismatch at line %1 (%2): '%3' != '%4'")
+ .arg(i).arg(loggers.at(n), output, expected)));
}
benchmark = line.startsWith("RESULT : ");
@@ -741,9 +798,12 @@ void tst_Selftests::cleanup()
// Remove the test output files
for (int i = 0; i < loggers.count(); ++i) {
- QString logFile = logName(loggers[i]);
- if (!logFile.isEmpty())
- QVERIFY(QFile::remove(logFile));
+ QString logFileName = logName(loggers[i]);
+ if (!logFileName.isEmpty()) {
+ QFile logFile(logFileName);
+ if (logFile.exists())
+ QVERIFY2(logFile.remove(), qPrintable(QString::fromLatin1("Cannot remove file '%1': %2: ").arg(logFileName, logFile.errorString())));
+ }
}
}
diff --git a/tests/auto/testlib/selftests/warnings/tst_warnings.cpp b/tests/auto/testlib/selftests/warnings/tst_warnings.cpp
index e14f9c3d98..30fe15d354 100644
--- a/tests/auto/testlib/selftests/warnings/tst_warnings.cpp
+++ b/tests/auto/testlib/selftests/warnings/tst_warnings.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtCore>
+#include <QtCore/QCoreApplication>
#include <QtTest/QtTest>
class tst_Warnings: public QObject
diff --git a/tests/auto/testlib/selftests/warnings/warnings.pro b/tests/auto/testlib/selftests/warnings/warnings.pro
index 0c6ca01588..0c6cddcefb 100644
--- a/tests/auto/testlib/selftests/warnings/warnings.pro
+++ b/tests/auto/testlib/selftests/warnings/warnings.pro
@@ -4,5 +4,4 @@ QT = core testlib
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
-
TARGET = warnings
diff --git a/tests/auto/testlib/selftests/xunit/tst_xunit.cpp b/tests/auto/testlib/selftests/xunit/tst_xunit.cpp
index 05acc8cfe7..4193387bc1 100644
--- a/tests/auto/testlib/selftests/xunit/tst_xunit.cpp
+++ b/tests/auto/testlib/selftests/xunit/tst_xunit.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/testlib/selftests/xunit/xunit.pro b/tests/auto/testlib/selftests/xunit/xunit.pro
index d3ae402e6f..b8c606e828 100644
--- a/tests/auto/testlib/selftests/xunit/xunit.pro
+++ b/tests/auto/testlib/selftests/xunit/xunit.pro
@@ -1,8 +1,8 @@
QT = core testlib
-SOURCES += tst_xunit.cpp
+SOURCES += tst_xunit.cpp
+
mac:CONFIG -= app_bundle
CONFIG -= debug_and_release_target
TARGET = xunit
-
diff --git a/tests/auto/tools/moc/Test.framework/Headers/testinterface.h b/tests/auto/tools/moc/Test.framework/Headers/testinterface.h
index 9662a02bc3..d9f9a2b0f5 100644
--- a/tests/auto/tools/moc/Test.framework/Headers/testinterface.h
+++ b/tests/auto/tools/moc/Test.framework/Headers/testinterface.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/assign-namespace.h b/tests/auto/tools/moc/assign-namespace.h
index fc6631c18b..c73724918c 100644
--- a/tests/auto/tools/moc/assign-namespace.h
+++ b/tests/auto/tools/moc/assign-namespace.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/backslash-newlines.h b/tests/auto/tools/moc/backslash-newlines.h
index d65c15c6d5..e7edf4664b 100644
--- a/tests/auto/tools/moc/backslash-newlines.h
+++ b/tests/auto/tools/moc/backslash-newlines.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/c-comments.h b/tests/auto/tools/moc/c-comments.h
index 8c0709338d..fc58191e86 100644
--- a/tests/auto/tools/moc/c-comments.h
+++ b/tests/auto/tools/moc/c-comments.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/cstyle-enums.h b/tests/auto/tools/moc/cstyle-enums.h
index 59076a535f..21a883eb58 100644
--- a/tests/auto/tools/moc/cstyle-enums.h
+++ b/tests/auto/tools/moc/cstyle-enums.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/dir-in-include-path.h b/tests/auto/tools/moc/dir-in-include-path.h
index b69514ec74..cb530e20d9 100644
--- a/tests/auto/tools/moc/dir-in-include-path.h
+++ b/tests/auto/tools/moc/dir-in-include-path.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/error-on-wrong-notify.h b/tests/auto/tools/moc/error-on-wrong-notify.h
index 381932a265..2f8de785a0 100644
--- a/tests/auto/tools/moc/error-on-wrong-notify.h
+++ b/tests/auto/tools/moc/error-on-wrong-notify.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/escapes-in-string-literals.h b/tests/auto/tools/moc/escapes-in-string-literals.h
index 437ceae82b..71e9759f36 100644
--- a/tests/auto/tools/moc/escapes-in-string-literals.h
+++ b/tests/auto/tools/moc/escapes-in-string-literals.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/extraqualification.h b/tests/auto/tools/moc/extraqualification.h
index b2b028eb03..a54ed1770e 100644
--- a/tests/auto/tools/moc/extraqualification.h
+++ b/tests/auto/tools/moc/extraqualification.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/forgotten-qinterface.h b/tests/auto/tools/moc/forgotten-qinterface.h
index e52a63e4df..3be4422bdc 100644
--- a/tests/auto/tools/moc/forgotten-qinterface.h
+++ b/tests/auto/tools/moc/forgotten-qinterface.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/gadgetwithnoenums.h b/tests/auto/tools/moc/gadgetwithnoenums.h
index c5ec939b3a..1ef0eeece9 100644
--- a/tests/auto/tools/moc/gadgetwithnoenums.h
+++ b/tests/auto/tools/moc/gadgetwithnoenums.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/interface-from-framework.h b/tests/auto/tools/moc/interface-from-framework.h
index 242d9f2286..e78b6ec51a 100644
--- a/tests/auto/tools/moc/interface-from-framework.h
+++ b/tests/auto/tools/moc/interface-from-framework.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/macro-on-cmdline.h b/tests/auto/tools/moc/macro-on-cmdline.h
index a1c162d10b..78ca4778cc 100644
--- a/tests/auto/tools/moc/macro-on-cmdline.h
+++ b/tests/auto/tools/moc/macro-on-cmdline.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/namespaced-flags.h b/tests/auto/tools/moc/namespaced-flags.h
index b1c10792c1..86b9891028 100644
--- a/tests/auto/tools/moc/namespaced-flags.h
+++ b/tests/auto/tools/moc/namespaced-flags.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/no-keywords.h b/tests/auto/tools/moc/no-keywords.h
index 2da7100aeb..4f15aa2ad0 100644
--- a/tests/auto/tools/moc/no-keywords.h
+++ b/tests/auto/tools/moc/no-keywords.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/oldstyle-casts.h b/tests/auto/tools/moc/oldstyle-casts.h
index 2754bb4e18..f26aeb5629 100644
--- a/tests/auto/tools/moc/oldstyle-casts.h
+++ b/tests/auto/tools/moc/oldstyle-casts.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/os9-newlines.h b/tests/auto/tools/moc/os9-newlines.h
index 66bc51653e..a2bf57fbb4 100644
--- a/tests/auto/tools/moc/os9-newlines.h
+++ b/tests/auto/tools/moc/os9-newlines.h
@@ -1 +1 @@
-/**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU General ** Public License version 3.0 as published by the Free Software Foundation ** and appearing in the file LICENSE.GPL included in the packaging of this ** file. Please review the following information to ensure the GNU General ** Public License version 3.0 requirements will be met: ** http://www.gnu.org/copyleft/gpl.html. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include <QObject> class Os9Newlines : public QObject { Q_OBJECT public Q_SLOTS: inline void testSlot() {} }; \ No newline at end of file
+/**************************************************************************** ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU General ** Public License version 3.0 as published by the Free Software Foundation ** and appearing in the file LICENSE.GPL included in the packaging of this ** file. Please review the following information to ensure the GNU General ** Public License version 3.0 requirements will be met: ** http://www.gnu.org/copyleft/gpl.html. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include <QObject> class Os9Newlines : public QObject { Q_OBJECT public Q_SLOTS: inline void testSlot() {} }; \ No newline at end of file
diff --git a/tests/auto/tools/moc/parse-boost.h b/tests/auto/tools/moc/parse-boost.h
index 9453f7f2bf..f475cb8778 100644
--- a/tests/auto/tools/moc/parse-boost.h
+++ b/tests/auto/tools/moc/parse-boost.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/pure-virtual-signals.h b/tests/auto/tools/moc/pure-virtual-signals.h
index a70370c5bc..4009de1e86 100644
--- a/tests/auto/tools/moc/pure-virtual-signals.h
+++ b/tests/auto/tools/moc/pure-virtual-signals.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/qinvokable.h b/tests/auto/tools/moc/qinvokable.h
index 313a49d7a8..17f1610ebe 100644
--- a/tests/auto/tools/moc/qinvokable.h
+++ b/tests/auto/tools/moc/qinvokable.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/qprivateslots.h b/tests/auto/tools/moc/qprivateslots.h
index 4713b41522..25c2ce2ba6 100644
--- a/tests/auto/tools/moc/qprivateslots.h
+++ b/tests/auto/tools/moc/qprivateslots.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/single_function_keyword.h b/tests/auto/tools/moc/single_function_keyword.h
index 1ce2517e4c..62b91e2b38 100644
--- a/tests/auto/tools/moc/single_function_keyword.h
+++ b/tests/auto/tools/moc/single_function_keyword.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/slots-with-void-template.h b/tests/auto/tools/moc/slots-with-void-template.h
index 62eb42e13d..d182e752d9 100644
--- a/tests/auto/tools/moc/slots-with-void-template.h
+++ b/tests/auto/tools/moc/slots-with-void-template.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/task189996.h b/tests/auto/tools/moc/task189996.h
index 6f8701f008..1f07266d18 100644
--- a/tests/auto/tools/moc/task189996.h
+++ b/tests/auto/tools/moc/task189996.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/task192552.h b/tests/auto/tools/moc/task192552.h
index 016d12a12a..843c19f11d 100644
--- a/tests/auto/tools/moc/task192552.h
+++ b/tests/auto/tools/moc/task192552.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/task234909.h b/tests/auto/tools/moc/task234909.h
index a24e0b301a..ead7ce7791 100644
--- a/tests/auto/tools/moc/task234909.h
+++ b/tests/auto/tools/moc/task234909.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/task240368.h b/tests/auto/tools/moc/task240368.h
index 320cad3ff8..c019a5457d 100644
--- a/tests/auto/tools/moc/task240368.h
+++ b/tests/auto/tools/moc/task240368.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/task87883.h b/tests/auto/tools/moc/task87883.h
index aedbd386c9..3079809020 100644
--- a/tests/auto/tools/moc/task87883.h
+++ b/tests/auto/tools/moc/task87883.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/template-gtgt.h b/tests/auto/tools/moc/template-gtgt.h
index 42aae6e633..601c706c14 100644
--- a/tests/auto/tools/moc/template-gtgt.h
+++ b/tests/auto/tools/moc/template-gtgt.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/testproject/Plugin/Plugin.h b/tests/auto/tools/moc/testproject/Plugin/Plugin.h
index 6c8cffe7d9..90ed8e9be1 100644
--- a/tests/auto/tools/moc/testproject/Plugin/Plugin.h
+++ b/tests/auto/tools/moc/testproject/Plugin/Plugin.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/trigraphs.h b/tests/auto/tools/moc/trigraphs.h
index cb074e7dcd..9a76c933b1 100644
--- a/tests/auto/tools/moc/trigraphs.h
+++ b/tests/auto/tools/moc/trigraphs.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 6d3ee2611e..bce1ad8d00 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -1091,15 +1091,15 @@ void tst_Moc::invokable()
{
{
const QMetaObject &mobj = InvokableBeforeReturnType::staticMetaObject;
- QCOMPARE(mobj.methodCount(), 5);
- QVERIFY(mobj.method(4).signature() == QByteArray("foo()"));
+ QCOMPARE(mobj.methodCount(), 6);
+ QVERIFY(mobj.method(5).signature() == QByteArray("foo()"));
}
{
const QMetaObject &mobj = InvokableBeforeInline::staticMetaObject;
- QCOMPARE(mobj.methodCount(), 6);
- QVERIFY(mobj.method(4).signature() == QByteArray("foo()"));
- QVERIFY(mobj.method(5).signature() == QByteArray("bar()"));
+ QCOMPARE(mobj.methodCount(), 7);
+ QVERIFY(mobj.method(5).signature() == QByteArray("foo()"));
+ QVERIFY(mobj.method(6).signature() == QByteArray("bar()"));
}
}
@@ -1107,23 +1107,23 @@ void tst_Moc::singleFunctionKeywordSignalAndSlot()
{
{
const QMetaObject &mobj = SingleFunctionKeywordBeforeReturnType::staticMetaObject;
- QCOMPARE(mobj.methodCount(), 6);
- QVERIFY(mobj.method(4).signature() == QByteArray("mySignal()"));
- QVERIFY(mobj.method(5).signature() == QByteArray("mySlot()"));
+ QCOMPARE(mobj.methodCount(), 7);
+ QVERIFY(mobj.method(5).signature() == QByteArray("mySignal()"));
+ QVERIFY(mobj.method(6).signature() == QByteArray("mySlot()"));
}
{
const QMetaObject &mobj = SingleFunctionKeywordBeforeInline::staticMetaObject;
- QCOMPARE(mobj.methodCount(), 6);
- QVERIFY(mobj.method(4).signature() == QByteArray("mySignal()"));
- QVERIFY(mobj.method(5).signature() == QByteArray("mySlot()"));
+ QCOMPARE(mobj.methodCount(), 7);
+ QVERIFY(mobj.method(5).signature() == QByteArray("mySignal()"));
+ QVERIFY(mobj.method(6).signature() == QByteArray("mySlot()"));
}
{
const QMetaObject &mobj = SingleFunctionKeywordAfterInline::staticMetaObject;
- QCOMPARE(mobj.methodCount(), 6);
- QVERIFY(mobj.method(4).signature() == QByteArray("mySignal()"));
- QVERIFY(mobj.method(5).signature() == QByteArray("mySlot()"));
+ QCOMPARE(mobj.methodCount(), 7);
+ QVERIFY(mobj.method(5).signature() == QByteArray("mySignal()"));
+ QVERIFY(mobj.method(6).signature() == QByteArray("mySlot()"));
}
}
diff --git a/tests/auto/tools/moc/using-namespaces.h b/tests/auto/tools/moc/using-namespaces.h
index 6be9c283a3..52d15e7541 100644
--- a/tests/auto/tools/moc/using-namespaces.h
+++ b/tests/auto/tools/moc/using-namespaces.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/warn-on-multiple-qobject-subclasses.h b/tests/auto/tools/moc/warn-on-multiple-qobject-subclasses.h
index f6863bdde6..ae4ca10960 100644
--- a/tests/auto/tools/moc/warn-on-multiple-qobject-subclasses.h
+++ b/tests/auto/tools/moc/warn-on-multiple-qobject-subclasses.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/warn-on-property-without-read.h b/tests/auto/tools/moc/warn-on-property-without-read.h
index 77fbedab14..c631b9da52 100644
--- a/tests/auto/tools/moc/warn-on-property-without-read.h
+++ b/tests/auto/tools/moc/warn-on-property-without-read.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/moc/win-newlines.h b/tests/auto/tools/moc/win-newlines.h
index 568cd300f7..0dd7366bbc 100644
--- a/tests/auto/tools/moc/win-newlines.h
+++ b/tests/auto/tools/moc/win-newlines.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/qmake.pro b/tests/auto/tools/qmake/qmake.pro
index d535c9c0b8..1d9c5bec6e 100644
--- a/tests/auto/tools/qmake/qmake.pro
+++ b/tests/auto/tools/qmake/qmake.pro
@@ -5,3 +5,5 @@ SOURCES += tst_qmake.cpp testcompiler.cpp
QT = core testlib
cross_compile: DEFINES += QMAKE_CROSS_COMPILED
+
+TESTDATA += testdata/*
diff --git a/tests/auto/tools/qmake/testcompiler.cpp b/tests/auto/tools/qmake/testcompiler.cpp
index 1f21713b99..098c8c6d7c 100644
--- a/tests/auto/tools/qmake/testcompiler.cpp
+++ b/tests/auto/tools/qmake/testcompiler.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testcompiler.h b/tests/auto/tools/qmake/testcompiler.h
index fa827685f7..7e8d7ecbe6 100644
--- a/tests/auto/tools/qmake/testcompiler.h
+++ b/tests/auto/tools/qmake/testcompiler.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/findDeps/main.cpp b/tests/auto/tools/qmake/testdata/findDeps/main.cpp
index f203909aa4..ab39567517 100644
--- a/tests/auto/tools/qmake/testdata/findDeps/main.cpp
+++ b/tests/auto/tools/qmake/testdata/findDeps/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/findDeps/object1.h b/tests/auto/tools/qmake/testdata/findDeps/object1.h
index fe29c9d5d8..a2a9bc3978 100644
--- a/tests/auto/tools/qmake/testdata/findDeps/object1.h
+++ b/tests/auto/tools/qmake/testdata/findDeps/object1.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/findDeps/object2.h b/tests/auto/tools/qmake/testdata/findDeps/object2.h
index c03434a7a7..d055694a48 100644
--- a/tests/auto/tools/qmake/testdata/findDeps/object2.h
+++ b/tests/auto/tools/qmake/testdata/findDeps/object2.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/findDeps/object3.h b/tests/auto/tools/qmake/testdata/findDeps/object3.h
index 63fd98248a..d3e6ae685e 100644
--- a/tests/auto/tools/qmake/testdata/findDeps/object3.h
+++ b/tests/auto/tools/qmake/testdata/findDeps/object3.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/findDeps/object4.h b/tests/auto/tools/qmake/testdata/findDeps/object4.h
index d1191b72cb..8ef8458b50 100644
--- a/tests/auto/tools/qmake/testdata/findDeps/object4.h
+++ b/tests/auto/tools/qmake/testdata/findDeps/object4.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/findDeps/object5.h b/tests/auto/tools/qmake/testdata/findDeps/object5.h
index 3bce90fa0b..508ac33832 100644
--- a/tests/auto/tools/qmake/testdata/findDeps/object5.h
+++ b/tests/auto/tools/qmake/testdata/findDeps/object5.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/findDeps/object6.h b/tests/auto/tools/qmake/testdata/findDeps/object6.h
index 1c4bbd22b5..460f2ba6cd 100644
--- a/tests/auto/tools/qmake/testdata/findDeps/object6.h
+++ b/tests/auto/tools/qmake/testdata/findDeps/object6.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/findDeps/object7.h b/tests/auto/tools/qmake/testdata/findDeps/object7.h
index 8b0f328a30..19837add87 100644
--- a/tests/auto/tools/qmake/testdata/findDeps/object7.h
+++ b/tests/auto/tools/qmake/testdata/findDeps/object7.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/findDeps/object8.h b/tests/auto/tools/qmake/testdata/findDeps/object8.h
index d768e1d9b5..025e656a39 100644
--- a/tests/auto/tools/qmake/testdata/findDeps/object8.h
+++ b/tests/auto/tools/qmake/testdata/findDeps/object8.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/findDeps/object9.h b/tests/auto/tools/qmake/testdata/findDeps/object9.h
index 734437ad6f..8b8c84478b 100644
--- a/tests/auto/tools/qmake/testdata/findDeps/object9.h
+++ b/tests/auto/tools/qmake/testdata/findDeps/object9.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/findMocs/main.cpp b/tests/auto/tools/qmake/testdata/findMocs/main.cpp
index 2413dcc2a1..ed2faacfba 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/main.cpp
+++ b/tests/auto/tools/qmake/testdata/findMocs/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object1.h b/tests/auto/tools/qmake/testdata/findMocs/object1.h
index c62b314e14..1b3f3b6cba 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/object1.h
+++ b/tests/auto/tools/qmake/testdata/findMocs/object1.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object2.h b/tests/auto/tools/qmake/testdata/findMocs/object2.h
index 8a873c3875..a95a971d98 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/object2.h
+++ b/tests/auto/tools/qmake/testdata/findMocs/object2.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object3.h b/tests/auto/tools/qmake/testdata/findMocs/object3.h
index 6e61f1cb5f..c347385688 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/object3.h
+++ b/tests/auto/tools/qmake/testdata/findMocs/object3.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object4.h b/tests/auto/tools/qmake/testdata/findMocs/object4.h
index 2e51228476..67814ee6eb 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/object4.h
+++ b/tests/auto/tools/qmake/testdata/findMocs/object4.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object5.h b/tests/auto/tools/qmake/testdata/findMocs/object5.h
index d3addb2ddf..a17eaab6f4 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/object5.h
+++ b/tests/auto/tools/qmake/testdata/findMocs/object5.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object6.h b/tests/auto/tools/qmake/testdata/findMocs/object6.h
index 17b56ac2ed..41b1d9635f 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/object6.h
+++ b/tests/auto/tools/qmake/testdata/findMocs/object6.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/findMocs/object7.h b/tests/auto/tools/qmake/testdata/findMocs/object7.h
index 981a3d5689..a09faed78a 100644
--- a/tests/auto/tools/qmake/testdata/findMocs/object7.h
+++ b/tests/auto/tools/qmake/testdata/findMocs/object7.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/functions/1.cpp b/tests/auto/tools/qmake/testdata/functions/1.cpp
index df92035b61..b7ac2c493e 100644
--- a/tests/auto/tools/qmake/testdata/functions/1.cpp
+++ b/tests/auto/tools/qmake/testdata/functions/1.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/functions/2.cpp b/tests/auto/tools/qmake/testdata/functions/2.cpp
index df92035b61..b7ac2c493e 100644
--- a/tests/auto/tools/qmake/testdata/functions/2.cpp
+++ b/tests/auto/tools/qmake/testdata/functions/2.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/functions/one/1.cpp b/tests/auto/tools/qmake/testdata/functions/one/1.cpp
index df92035b61..b7ac2c493e 100644
--- a/tests/auto/tools/qmake/testdata/functions/one/1.cpp
+++ b/tests/auto/tools/qmake/testdata/functions/one/1.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/functions/one/2.cpp b/tests/auto/tools/qmake/testdata/functions/one/2.cpp
index df92035b61..b7ac2c493e 100644
--- a/tests/auto/tools/qmake/testdata/functions/one/2.cpp
+++ b/tests/auto/tools/qmake/testdata/functions/one/2.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/functions/three/wildcard21.cpp b/tests/auto/tools/qmake/testdata/functions/three/wildcard21.cpp
index df92035b61..b7ac2c493e 100644
--- a/tests/auto/tools/qmake/testdata/functions/three/wildcard21.cpp
+++ b/tests/auto/tools/qmake/testdata/functions/three/wildcard21.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/functions/three/wildcard22.cpp b/tests/auto/tools/qmake/testdata/functions/three/wildcard22.cpp
index df92035b61..b7ac2c493e 100644
--- a/tests/auto/tools/qmake/testdata/functions/three/wildcard22.cpp
+++ b/tests/auto/tools/qmake/testdata/functions/three/wildcard22.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/functions/two/1.cpp b/tests/auto/tools/qmake/testdata/functions/two/1.cpp
index df92035b61..b7ac2c493e 100644
--- a/tests/auto/tools/qmake/testdata/functions/two/1.cpp
+++ b/tests/auto/tools/qmake/testdata/functions/two/1.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/functions/two/2.cpp b/tests/auto/tools/qmake/testdata/functions/two/2.cpp
index df92035b61..b7ac2c493e 100644
--- a/tests/auto/tools/qmake/testdata/functions/two/2.cpp
+++ b/tests/auto/tools/qmake/testdata/functions/two/2.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/functions/wildcard21.cpp b/tests/auto/tools/qmake/testdata/functions/wildcard21.cpp
index df92035b61..b7ac2c493e 100644
--- a/tests/auto/tools/qmake/testdata/functions/wildcard21.cpp
+++ b/tests/auto/tools/qmake/testdata/functions/wildcard21.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/functions/wildcard22.cpp b/tests/auto/tools/qmake/testdata/functions/wildcard22.cpp
index df92035b61..b7ac2c493e 100644
--- a/tests/auto/tools/qmake/testdata/functions/wildcard22.cpp
+++ b/tests/auto/tools/qmake/testdata/functions/wildcard22.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/include_dir/main.cpp b/tests/auto/tools/qmake/testdata/include_dir/main.cpp
index 8471e367e9..f88dbac4fc 100644
--- a/tests/auto/tools/qmake/testdata/include_dir/main.cpp
+++ b/tests/auto/tools/qmake/testdata/include_dir/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/include_dir/test_file.cpp b/tests/auto/tools/qmake/testdata/include_dir/test_file.cpp
index 43807d0867..5c7dcc4825 100644
--- a/tests/auto/tools/qmake/testdata/include_dir/test_file.cpp
+++ b/tests/auto/tools/qmake/testdata/include_dir/test_file.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/include_dir/test_file.h b/tests/auto/tools/qmake/testdata/include_dir/test_file.h
index 994874284e..cf8236084d 100644
--- a/tests/auto/tools/qmake/testdata/include_dir/test_file.h
+++ b/tests/auto/tools/qmake/testdata/include_dir/test_file.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/include_function/main.cpp b/tests/auto/tools/qmake/testdata/include_function/main.cpp
index 67224bf860..980b3b2eef 100644
--- a/tests/auto/tools/qmake/testdata/include_function/main.cpp
+++ b/tests/auto/tools/qmake/testdata/include_function/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/install_depends/main.cpp b/tests/auto/tools/qmake/testdata/install_depends/main.cpp
index 05d257f8b6..253be88814 100644
--- a/tests/auto/tools/qmake/testdata/install_depends/main.cpp
+++ b/tests/auto/tools/qmake/testdata/install_depends/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/install_depends/test_file.cpp b/tests/auto/tools/qmake/testdata/install_depends/test_file.cpp
index 0dc2d5b263..14b431f00d 100644
--- a/tests/auto/tools/qmake/testdata/install_depends/test_file.cpp
+++ b/tests/auto/tools/qmake/testdata/install_depends/test_file.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/install_depends/test_file.h b/tests/auto/tools/qmake/testdata/install_depends/test_file.h
index d7f12ddbad..a00d395580 100644
--- a/tests/auto/tools/qmake/testdata/install_depends/test_file.h
+++ b/tests/auto/tools/qmake/testdata/install_depends/test_file.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/one_space/main.cpp b/tests/auto/tools/qmake/testdata/one_space/main.cpp
index a47ff9b99d..d75a55df27 100644
--- a/tests/auto/tools/qmake/testdata/one_space/main.cpp
+++ b/tests/auto/tools/qmake/testdata/one_space/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/quotedfilenames/main.cpp b/tests/auto/tools/qmake/testdata/quotedfilenames/main.cpp
index 91dfc156b9..5a64aad773 100644
--- a/tests/auto/tools/qmake/testdata/quotedfilenames/main.cpp
+++ b/tests/auto/tools/qmake/testdata/quotedfilenames/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/shadow_files/main.cpp b/tests/auto/tools/qmake/testdata/shadow_files/main.cpp
index 05d257f8b6..253be88814 100644
--- a/tests/auto/tools/qmake/testdata/shadow_files/main.cpp
+++ b/tests/auto/tools/qmake/testdata/shadow_files/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/shadow_files/test_file.cpp b/tests/auto/tools/qmake/testdata/shadow_files/test_file.cpp
index 0dc2d5b263..14b431f00d 100644
--- a/tests/auto/tools/qmake/testdata/shadow_files/test_file.cpp
+++ b/tests/auto/tools/qmake/testdata/shadow_files/test_file.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/shadow_files/test_file.h b/tests/auto/tools/qmake/testdata/shadow_files/test_file.h
index d7f12ddbad..a00d395580 100644
--- a/tests/auto/tools/qmake/testdata/shadow_files/test_file.h
+++ b/tests/auto/tools/qmake/testdata/shadow_files/test_file.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/simple_app/main.cpp b/tests/auto/tools/qmake/testdata/simple_app/main.cpp
index 697c7c050a..ef011a10b0 100644
--- a/tests/auto/tools/qmake/testdata/simple_app/main.cpp
+++ b/tests/auto/tools/qmake/testdata/simple_app/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/simple_app/test_file.cpp b/tests/auto/tools/qmake/testdata/simple_app/test_file.cpp
index 0dc2d5b263..14b431f00d 100644
--- a/tests/auto/tools/qmake/testdata/simple_app/test_file.cpp
+++ b/tests/auto/tools/qmake/testdata/simple_app/test_file.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/simple_app/test_file.h b/tests/auto/tools/qmake/testdata/simple_app/test_file.h
index d7f12ddbad..a00d395580 100644
--- a/tests/auto/tools/qmake/testdata/simple_app/test_file.h
+++ b/tests/auto/tools/qmake/testdata/simple_app/test_file.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/simple_dll/simple.cpp b/tests/auto/tools/qmake/testdata/simple_dll/simple.cpp
index 539725eb0b..a0a8911644 100644
--- a/tests/auto/tools/qmake/testdata/simple_dll/simple.cpp
+++ b/tests/auto/tools/qmake/testdata/simple_dll/simple.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/simple_dll/simple.h b/tests/auto/tools/qmake/testdata/simple_dll/simple.h
index 1a76482985..351b568923 100644
--- a/tests/auto/tools/qmake/testdata/simple_dll/simple.h
+++ b/tests/auto/tools/qmake/testdata/simple_dll/simple.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/simple_lib/simple.cpp b/tests/auto/tools/qmake/testdata/simple_lib/simple.cpp
index 539725eb0b..a0a8911644 100644
--- a/tests/auto/tools/qmake/testdata/simple_lib/simple.cpp
+++ b/tests/auto/tools/qmake/testdata/simple_lib/simple.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/simple_lib/simple.h b/tests/auto/tools/qmake/testdata/simple_lib/simple.h
index 912f028ced..ce9311e0a1 100644
--- a/tests/auto/tools/qmake/testdata/simple_lib/simple.h
+++ b/tests/auto/tools/qmake/testdata/simple_lib/simple.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/subdir_via_pro_file_extra_target/simple/main.cpp b/tests/auto/tools/qmake/testdata/subdir_via_pro_file_extra_target/simple/main.cpp
index 5597ef22cc..76e559325e 100644
--- a/tests/auto/tools/qmake/testdata/subdir_via_pro_file_extra_target/simple/main.cpp
+++ b/tests/auto/tools/qmake/testdata/subdir_via_pro_file_extra_target/simple/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/subdirs/simple_app/main.cpp b/tests/auto/tools/qmake/testdata/subdirs/simple_app/main.cpp
index 697c7c050a..ef011a10b0 100644
--- a/tests/auto/tools/qmake/testdata/subdirs/simple_app/main.cpp
+++ b/tests/auto/tools/qmake/testdata/subdirs/simple_app/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/subdirs/simple_app/test_file.cpp b/tests/auto/tools/qmake/testdata/subdirs/simple_app/test_file.cpp
index 0dc2d5b263..14b431f00d 100644
--- a/tests/auto/tools/qmake/testdata/subdirs/simple_app/test_file.cpp
+++ b/tests/auto/tools/qmake/testdata/subdirs/simple_app/test_file.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/subdirs/simple_app/test_file.h b/tests/auto/tools/qmake/testdata/subdirs/simple_app/test_file.h
index d7f12ddbad..a00d395580 100644
--- a/tests/auto/tools/qmake/testdata/subdirs/simple_app/test_file.h
+++ b/tests/auto/tools/qmake/testdata/subdirs/simple_app/test_file.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple.cpp b/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple.cpp
index 539725eb0b..a0a8911644 100644
--- a/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple.cpp
+++ b/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple.h b/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple.h
index 1a76482985..351b568923 100644
--- a/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple.h
+++ b/tests/auto/tools/qmake/testdata/subdirs/simple_dll/simple.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/qmake/tst_qmake.cpp b/tests/auto/tools/qmake/tst_qmake.cpp
index 8de822b47a..03f7720c22 100644
--- a/tests/auto/tools/qmake/tst_qmake.cpp
+++ b/tests/auto/tools/qmake/tst_qmake.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -98,6 +98,15 @@ private:
tst_qmake::tst_qmake()
{
+}
+
+tst_qmake::~tst_qmake()
+{
+
+}
+
+void tst_qmake::initTestCase()
+{
QString binpath = QLibraryInfo::location(QLibraryInfo::BinariesPath);
QString cmd = QString("%2/qmake \"QT_VERSION=%1\"").arg(QT_VERSION).arg(binpath);
#ifdef Q_CC_MSVC
@@ -109,17 +118,13 @@ tst_qmake::tst_qmake()
#else
test_compiler.setBaseCommands( "make", cmd );
#endif
- QDir dir;
- base_path = dir.currentPath();
-}
-
-tst_qmake::~tst_qmake()
-{
-
-}
-
-void tst_qmake::initTestCase()
-{
+ //Detect the location of the testdata
+ QString subProgram = QLatin1String("testdata/simple_app/main.cpp");
+ base_path = QFINDTESTDATA(subProgram);
+ if (base_path.lastIndexOf(subProgram) > 0)
+ base_path = base_path.left(base_path.lastIndexOf(subProgram));
+ else
+ base_path = QCoreApplication::applicationDirPath();
}
void tst_qmake::cleanupTestCase()
diff --git a/tests/auto/tools/rcc/tst_rcc.cpp b/tests/auto/tools/rcc/tst_rcc.cpp
index 90baf36b35..963ec75d75 100644
--- a/tests/auto/tools/rcc/tst_rcc.cpp
+++ b/tests/auto/tools/rcc/tst_rcc.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/batchtranslation.ui b/tests/auto/tools/uic/baseline/batchtranslation.ui
index 6cb2943606..e3103cb358 100644
--- a/tests/auto/tools/uic/baseline/batchtranslation.ui
+++ b/tests/auto/tools/uic/baseline/batchtranslation.ui
@@ -2,7 +2,7 @@
<author></author>
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/batchtranslation.ui.h b/tests/auto/tools/uic/baseline/batchtranslation.ui.h
index 29cefd5720..a2f65b58a9 100644
--- a/tests/auto/tools/uic/baseline/batchtranslation.ui.h
+++ b/tests/auto/tools/uic/baseline/batchtranslation.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/config.ui b/tests/auto/tools/uic/baseline/config.ui
index bebe17b41f..e509a5dcc9 100644
--- a/tests/auto/tools/uic/baseline/config.ui
+++ b/tests/auto/tools/uic/baseline/config.ui
@@ -1,7 +1,7 @@
<ui version="4.0" >
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/config.ui.h b/tests/auto/tools/uic/baseline/config.ui.h
index 1b32b61796..cfaf7b7846 100644
--- a/tests/auto/tools/uic/baseline/config.ui.h
+++ b/tests/auto/tools/uic/baseline/config.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/finddialog.ui b/tests/auto/tools/uic/baseline/finddialog.ui
index 913a868ad1..b2d3c4097d 100644
--- a/tests/auto/tools/uic/baseline/finddialog.ui
+++ b/tests/auto/tools/uic/baseline/finddialog.ui
@@ -1,7 +1,7 @@
<ui version="4.0" >
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/finddialog.ui.h b/tests/auto/tools/uic/baseline/finddialog.ui.h
index 919eea42de..3f544c999d 100644
--- a/tests/auto/tools/uic/baseline/finddialog.ui.h
+++ b/tests/auto/tools/uic/baseline/finddialog.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/formwindowsettings.ui b/tests/auto/tools/uic/baseline/formwindowsettings.ui
index fea18fe873..bca70a7fe1 100644
--- a/tests/auto/tools/uic/baseline/formwindowsettings.ui
+++ b/tests/auto/tools/uic/baseline/formwindowsettings.ui
@@ -1,7 +1,7 @@
<ui version="4.0" >
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/formwindowsettings.ui.h b/tests/auto/tools/uic/baseline/formwindowsettings.ui.h
index d84186bdbe..9e9edc08a6 100644
--- a/tests/auto/tools/uic/baseline/formwindowsettings.ui.h
+++ b/tests/auto/tools/uic/baseline/formwindowsettings.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/helpdialog.ui b/tests/auto/tools/uic/baseline/helpdialog.ui
index 133f3d2af4..7da10cd4f7 100644
--- a/tests/auto/tools/uic/baseline/helpdialog.ui
+++ b/tests/auto/tools/uic/baseline/helpdialog.ui
@@ -2,7 +2,7 @@
<author></author>
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/helpdialog.ui.h b/tests/auto/tools/uic/baseline/helpdialog.ui.h
index a1f10c221e..fa7bbe3810 100644
--- a/tests/auto/tools/uic/baseline/helpdialog.ui.h
+++ b/tests/auto/tools/uic/baseline/helpdialog.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/listwidgeteditor.ui b/tests/auto/tools/uic/baseline/listwidgeteditor.ui
index fa7d962bdb..0a38d8f65f 100644
--- a/tests/auto/tools/uic/baseline/listwidgeteditor.ui
+++ b/tests/auto/tools/uic/baseline/listwidgeteditor.ui
@@ -1,7 +1,7 @@
<ui version="4.0" >
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/listwidgeteditor.ui.h b/tests/auto/tools/uic/baseline/listwidgeteditor.ui.h
index 5da2aadbaa..a95f2cb860 100644
--- a/tests/auto/tools/uic/baseline/listwidgeteditor.ui.h
+++ b/tests/auto/tools/uic/baseline/listwidgeteditor.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/newactiondialog.ui b/tests/auto/tools/uic/baseline/newactiondialog.ui
index ae6212f868..ef326fe63e 100644
--- a/tests/auto/tools/uic/baseline/newactiondialog.ui
+++ b/tests/auto/tools/uic/baseline/newactiondialog.ui
@@ -1,7 +1,7 @@
<ui version="4.0" >
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/newactiondialog.ui.h b/tests/auto/tools/uic/baseline/newactiondialog.ui.h
index 05cd8b8279..d409ccb786 100644
--- a/tests/auto/tools/uic/baseline/newactiondialog.ui.h
+++ b/tests/auto/tools/uic/baseline/newactiondialog.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/newform.ui b/tests/auto/tools/uic/baseline/newform.ui
index 3f0a92dfb1..d83aef26a2 100644
--- a/tests/auto/tools/uic/baseline/newform.ui
+++ b/tests/auto/tools/uic/baseline/newform.ui
@@ -2,7 +2,7 @@
<author></author>
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/newform.ui.h b/tests/auto/tools/uic/baseline/newform.ui.h
index 3771bfac47..b744dd6869 100644
--- a/tests/auto/tools/uic/baseline/newform.ui.h
+++ b/tests/auto/tools/uic/baseline/newform.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/orderdialog.ui b/tests/auto/tools/uic/baseline/orderdialog.ui
index b44824778f..e95ac2906f 100644
--- a/tests/auto/tools/uic/baseline/orderdialog.ui
+++ b/tests/auto/tools/uic/baseline/orderdialog.ui
@@ -1,7 +1,7 @@
<ui version="4.0" >
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/orderdialog.ui.h b/tests/auto/tools/uic/baseline/orderdialog.ui.h
index 6745813f76..16fa98b6de 100644
--- a/tests/auto/tools/uic/baseline/orderdialog.ui.h
+++ b/tests/auto/tools/uic/baseline/orderdialog.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/paletteeditor.ui b/tests/auto/tools/uic/baseline/paletteeditor.ui
index 1cc6a18583..62b728267b 100644
--- a/tests/auto/tools/uic/baseline/paletteeditor.ui
+++ b/tests/auto/tools/uic/baseline/paletteeditor.ui
@@ -1,7 +1,7 @@
<ui version="4.0" >
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/paletteeditor.ui.h b/tests/auto/tools/uic/baseline/paletteeditor.ui.h
index 681d6705b3..808295ddf6 100644
--- a/tests/auto/tools/uic/baseline/paletteeditor.ui.h
+++ b/tests/auto/tools/uic/baseline/paletteeditor.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/phrasebookbox.ui b/tests/auto/tools/uic/baseline/phrasebookbox.ui
index 66558ea28a..95e92e4311 100644
--- a/tests/auto/tools/uic/baseline/phrasebookbox.ui
+++ b/tests/auto/tools/uic/baseline/phrasebookbox.ui
@@ -1,7 +1,7 @@
<ui version="4.0" >
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/phrasebookbox.ui.h b/tests/auto/tools/uic/baseline/phrasebookbox.ui.h
index dc3e4e1038..2b1c6222c1 100644
--- a/tests/auto/tools/uic/baseline/phrasebookbox.ui.h
+++ b/tests/auto/tools/uic/baseline/phrasebookbox.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/plugindialog.ui b/tests/auto/tools/uic/baseline/plugindialog.ui
index d4bec98834..924d506c2d 100644
--- a/tests/auto/tools/uic/baseline/plugindialog.ui
+++ b/tests/auto/tools/uic/baseline/plugindialog.ui
@@ -1,7 +1,7 @@
<ui version="4.0" >
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/plugindialog.ui.h b/tests/auto/tools/uic/baseline/plugindialog.ui.h
index 353470c484..bbde5ab416 100644
--- a/tests/auto/tools/uic/baseline/plugindialog.ui.h
+++ b/tests/auto/tools/uic/baseline/plugindialog.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/previewwidget.ui b/tests/auto/tools/uic/baseline/previewwidget.ui
index d38ab7cf30..00bcfbe66c 100644
--- a/tests/auto/tools/uic/baseline/previewwidget.ui
+++ b/tests/auto/tools/uic/baseline/previewwidget.ui
@@ -1,7 +1,7 @@
<ui version="4.0" >
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/previewwidget.ui.h b/tests/auto/tools/uic/baseline/previewwidget.ui.h
index a3e4e4d0e5..84eba31b17 100644
--- a/tests/auto/tools/uic/baseline/previewwidget.ui.h
+++ b/tests/auto/tools/uic/baseline/previewwidget.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/qfiledialog.ui b/tests/auto/tools/uic/baseline/qfiledialog.ui
index 85f5991722..7994f104ac 100644
--- a/tests/auto/tools/uic/baseline/qfiledialog.ui
+++ b/tests/auto/tools/uic/baseline/qfiledialog.ui
@@ -1,7 +1,7 @@
<ui version="4.0" >
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/qfiledialog.ui.h b/tests/auto/tools/uic/baseline/qfiledialog.ui.h
index 50a9de3cf6..75b03ed518 100644
--- a/tests/auto/tools/uic/baseline/qfiledialog.ui.h
+++ b/tests/auto/tools/uic/baseline/qfiledialog.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/qtgradientdialog.ui b/tests/auto/tools/uic/baseline/qtgradientdialog.ui
index 0c5578fd0b..045806eb31 100644
--- a/tests/auto/tools/uic/baseline/qtgradientdialog.ui
+++ b/tests/auto/tools/uic/baseline/qtgradientdialog.ui
@@ -1,7 +1,7 @@
<ui version="4.0" >
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/qtgradientdialog.ui.h b/tests/auto/tools/uic/baseline/qtgradientdialog.ui.h
index 30af7cebc4..f9721bad0a 100644
--- a/tests/auto/tools/uic/baseline/qtgradientdialog.ui.h
+++ b/tests/auto/tools/uic/baseline/qtgradientdialog.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/qtgradienteditor.ui b/tests/auto/tools/uic/baseline/qtgradienteditor.ui
index 472066b7fa..4754bc5899 100644
--- a/tests/auto/tools/uic/baseline/qtgradienteditor.ui
+++ b/tests/auto/tools/uic/baseline/qtgradienteditor.ui
@@ -1,7 +1,7 @@
<ui version="4.0" >
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/qtgradienteditor.ui.h b/tests/auto/tools/uic/baseline/qtgradienteditor.ui.h
index d53d4f9cc1..ca9de7f2a8 100644
--- a/tests/auto/tools/uic/baseline/qtgradienteditor.ui.h
+++ b/tests/auto/tools/uic/baseline/qtgradienteditor.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/qtgradientviewdialog.ui b/tests/auto/tools/uic/baseline/qtgradientviewdialog.ui
index c84907289b..4b02db52de 100644
--- a/tests/auto/tools/uic/baseline/qtgradientviewdialog.ui
+++ b/tests/auto/tools/uic/baseline/qtgradientviewdialog.ui
@@ -1,7 +1,7 @@
<ui version="4.0" >
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/qtgradientviewdialog.ui.h b/tests/auto/tools/uic/baseline/qtgradientviewdialog.ui.h
index e5491cbaf6..61c814964a 100644
--- a/tests/auto/tools/uic/baseline/qtgradientviewdialog.ui.h
+++ b/tests/auto/tools/uic/baseline/qtgradientviewdialog.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/saveformastemplate.ui b/tests/auto/tools/uic/baseline/saveformastemplate.ui
index 81d55d3b63..40ee76fbba 100644
--- a/tests/auto/tools/uic/baseline/saveformastemplate.ui
+++ b/tests/auto/tools/uic/baseline/saveformastemplate.ui
@@ -1,7 +1,7 @@
<ui version="4.0" >
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/saveformastemplate.ui.h b/tests/auto/tools/uic/baseline/saveformastemplate.ui.h
index 8c83f0f2e6..bf04e7b22c 100644
--- a/tests/auto/tools/uic/baseline/saveformastemplate.ui.h
+++ b/tests/auto/tools/uic/baseline/saveformastemplate.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/statistics.ui b/tests/auto/tools/uic/baseline/statistics.ui
index ba752e386a..359c6f7612 100644
--- a/tests/auto/tools/uic/baseline/statistics.ui
+++ b/tests/auto/tools/uic/baseline/statistics.ui
@@ -2,7 +2,7 @@
<class>Statistics</class>
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/statistics.ui.h b/tests/auto/tools/uic/baseline/statistics.ui.h
index a73ab6d3b3..76aadcce6d 100644
--- a/tests/auto/tools/uic/baseline/statistics.ui.h
+++ b/tests/auto/tools/uic/baseline/statistics.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/stringlisteditor.ui b/tests/auto/tools/uic/baseline/stringlisteditor.ui
index 96fff1c3ea..c6223a5f83 100644
--- a/tests/auto/tools/uic/baseline/stringlisteditor.ui
+++ b/tests/auto/tools/uic/baseline/stringlisteditor.ui
@@ -1,7 +1,7 @@
<ui version="4.0" >
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/stringlisteditor.ui.h b/tests/auto/tools/uic/baseline/stringlisteditor.ui.h
index 0278966d55..163e9a8613 100644
--- a/tests/auto/tools/uic/baseline/stringlisteditor.ui.h
+++ b/tests/auto/tools/uic/baseline/stringlisteditor.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/tabbedbrowser.ui b/tests/auto/tools/uic/baseline/tabbedbrowser.ui
index 6bb608f79f..5b28dd85a4 100644
--- a/tests/auto/tools/uic/baseline/tabbedbrowser.ui
+++ b/tests/auto/tools/uic/baseline/tabbedbrowser.ui
@@ -2,7 +2,7 @@
<author></author>
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/tabbedbrowser.ui.h b/tests/auto/tools/uic/baseline/tabbedbrowser.ui.h
index a4e28c8d22..00b6c9cdd6 100644
--- a/tests/auto/tools/uic/baseline/tabbedbrowser.ui.h
+++ b/tests/auto/tools/uic/baseline/tabbedbrowser.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/tablewidgeteditor.ui b/tests/auto/tools/uic/baseline/tablewidgeteditor.ui
index ebd15a2f80..558e7e89ee 100644
--- a/tests/auto/tools/uic/baseline/tablewidgeteditor.ui
+++ b/tests/auto/tools/uic/baseline/tablewidgeteditor.ui
@@ -1,7 +1,7 @@
<ui version="4.0" >
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/tablewidgeteditor.ui.h b/tests/auto/tools/uic/baseline/tablewidgeteditor.ui.h
index 136c70ebc4..3d69f59938 100644
--- a/tests/auto/tools/uic/baseline/tablewidgeteditor.ui.h
+++ b/tests/auto/tools/uic/baseline/tablewidgeteditor.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/translatedialog.ui b/tests/auto/tools/uic/baseline/translatedialog.ui
index b1cd99cbe7..57a0a7a039 100644
--- a/tests/auto/tools/uic/baseline/translatedialog.ui
+++ b/tests/auto/tools/uic/baseline/translatedialog.ui
@@ -1,7 +1,7 @@
<ui version="4.0" >
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/translatedialog.ui.h b/tests/auto/tools/uic/baseline/translatedialog.ui.h
index 099bd7e8c8..3f66587f65 100644
--- a/tests/auto/tools/uic/baseline/translatedialog.ui.h
+++ b/tests/auto/tools/uic/baseline/translatedialog.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/treewidgeteditor.ui b/tests/auto/tools/uic/baseline/treewidgeteditor.ui
index 1256a0a2fa..6fdcc54625 100644
--- a/tests/auto/tools/uic/baseline/treewidgeteditor.ui
+++ b/tests/auto/tools/uic/baseline/treewidgeteditor.ui
@@ -1,7 +1,7 @@
<ui version="4.0" >
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/treewidgeteditor.ui.h b/tests/auto/tools/uic/baseline/treewidgeteditor.ui.h
index e8883ee67d..2aa95b8f0a 100644
--- a/tests/auto/tools/uic/baseline/treewidgeteditor.ui.h
+++ b/tests/auto/tools/uic/baseline/treewidgeteditor.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/trpreviewtool.ui b/tests/auto/tools/uic/baseline/trpreviewtool.ui
index 03441139ed..520442b348 100644
--- a/tests/auto/tools/uic/baseline/trpreviewtool.ui
+++ b/tests/auto/tools/uic/baseline/trpreviewtool.ui
@@ -2,7 +2,7 @@
<author></author>
<comment>*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/baseline/trpreviewtool.ui.h b/tests/auto/tools/uic/baseline/trpreviewtool.ui.h
index c984bcc2c7..196a820c55 100644
--- a/tests/auto/tools/uic/baseline/trpreviewtool.ui.h
+++ b/tests/auto/tools/uic/baseline/trpreviewtool.ui.h
@@ -1,7 +1,7 @@
/*
*********************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/tools/uic/tst_uic.cpp b/tests/auto/tools/uic/tst_uic.cpp
index 3244e584f5..d298078487 100644
--- a/tests/auto/tools/uic/tst_uic.cpp
+++ b/tests/auto/tools/uic/tst_uic.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/v8/Makefile.nonqt b/tests/auto/v8/Makefile.nonqt
deleted file mode 100644
index ded1ba3a74..0000000000
--- a/tests/auto/v8/Makefile.nonqt
+++ /dev/null
@@ -1,16 +0,0 @@
-V8PATH = ../../../src/3rdparty/v8
-V8LIBPATH = $(V8PATH)
-V8INCPATH = $(V8PATH)/include
-SOURCES = v8main.cpp v8test.cpp
-
-release-m32:
- g++ -o v8test_release_m32 -m32 -O2 -I$(V8INCPATH) $(SOURCES) -lpthread -L$(V8LIBPATH) -lv8
-
-debug-m32:
- g++ -o v8test_debug_m32 -m32 -g -I$(V8INCPATH) $(SOURCES) -lpthread -L$(V8LIBPATH) -lv8_g
-
-release:
- g++ -o v8test_release -O2 -I$(V8INCPATH) $(SOURCES) -lpthread -L$(V8LIBPATH) -lv8
-
-debug:
- g++ -o v8test_debug -g -I$(V8INCPATH) $(SOURCES) -lpthread -L$(V8LIBPATH) -lv8_g
diff --git a/tests/auto/v8/README.txt b/tests/auto/v8/README.txt
deleted file mode 100644
index 097c459036..0000000000
--- a/tests/auto/v8/README.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-The v8 tests are actually implemented in v8test.[h|cpp]. There are also QtTest
-(tst_v8.cpp) and non-Qt (v8main.cpp) stubs provided to run these tests. This
-is done to allow the tests to be run both in the Qt CI system, and manually
-without a build of Qt. The latter is necessary to run them against more exotic
-build of V8, like the ARM simulator.
-
-To build the non-Qt version of the tests, first build a debug or release V8
-library under src/3rdparty/v8 using scons, and then use the Makefile.nonqt
-makefile selecting one of the following targets:
- release: Build the tests with -O2 and link against libv8
- debug: Build the tests with -g and link against libv8_g
- release-m32: Build the tests with -O2 -m32 and link against libv8
- debug-m32: Build the tests with -g -m32 and link against libv8_g
diff --git a/tests/auto/v8/v8.pro b/tests/auto/v8/v8.pro
deleted file mode 100644
index 493ea8e1cb..0000000000
--- a/tests/auto/v8/v8.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-CONFIG += testcase
-TARGET = tst_v8
-macx:CONFIG -= app_bundle
-
-SOURCES += tst_v8.cpp v8test.cpp
-HEADERS += v8test.h
-
-CONFIG += parallel_test
-
-QT = core v8-private testlib
diff --git a/tests/auto/v8/v8test.cpp b/tests/auto/v8/v8test.cpp
deleted file mode 100644
index 3792679272..0000000000
--- a/tests/auto/v8/v8test.cpp
+++ /dev/null
@@ -1,379 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "v8test.h"
-
-using namespace v8;
-
-#define BEGINTEST() bool _testPassed = true;
-#define ENDTEST() return _testPassed;
-
-#define VERIFY(expr) { \
- if (!(expr)) { \
- fprintf(stderr, "FAIL: %s:%d %s\n", __FILE__, __LINE__, # expr); \
- _testPassed = false; \
- goto cleanup; \
- } \
-}
-
-struct MyStringResource : public String::ExternalAsciiStringResource
-{
- static bool wasDestroyed;
- virtual ~MyStringResource() { wasDestroyed = true; }
- virtual const char* data() const { return "v8test"; }
- virtual size_t length() const { return 6; }
-};
-bool MyStringResource::wasDestroyed = false;
-
-struct MyResource : public Object::ExternalResource
-{
- static bool wasDestroyed;
- virtual ~MyResource() { wasDestroyed = true; }
-};
-bool MyResource::wasDestroyed = false;
-
-bool v8test_externalteardown()
-{
- BEGINTEST();
-
- Isolate *isolate = v8::Isolate::New();
- isolate->Enter();
-
- {
- HandleScope handle_scope;
- Persistent<Context> context = Context::New();
- Context::Scope context_scope(context);
-
- String::NewExternal(new MyStringResource);
-
- Local<FunctionTemplate> ft = FunctionTemplate::New();
- ft->InstanceTemplate()->SetHasExternalResource(true);
-
- Local<Object> obj = ft->GetFunction()->NewInstance();
- obj->SetExternalResource(new MyResource);
-
- context.Dispose();
- }
-
- // while (!v8::V8::IdleNotification()) ;
- isolate->Exit();
- isolate->Dispose();
-
- // ExternalString resources aren't guaranteed to be freed by v8 at this
- // point. Uncommenting the IdleNotification() line above helps.
-// VERIFY(MyStringResource::wasDestroyed);
-
- VERIFY(MyResource::wasDestroyed);
-
-cleanup:
-
- ENDTEST();
-}
-
-bool v8test_eval()
-{
- BEGINTEST();
-
- HandleScope handle_scope;
- Persistent<Context> context = Context::New();
- Context::Scope context_scope(context);
-
- Local<Object> qmlglobal = Object::New();
- qmlglobal->Set(String::New("a"), Integer::New(1922));
-
- Local<Script> script = Script::Compile(String::New("eval(\"a\")"), NULL, NULL,
- Handle<String>(), Script::QmlMode);
-
- TryCatch tc;
- Local<Value> result = script->Run(qmlglobal);
-
- VERIFY(!tc.HasCaught());
- VERIFY(result->Int32Value() == 1922);
-
-cleanup:
- context.Dispose();
-
- ENDTEST();
-}
-
-bool v8test_globalcall()
-{
- BEGINTEST();
-
- HandleScope handle_scope;
- Persistent<Context> context = Context::New();
- Context::Scope context_scope(context);
-
- Local<Object> qmlglobal = Object::New();
-
-#define SOURCE "function func1() { return 1; }\n" \
- "function func2() { var sum = 0; for (var ii = 0; ii < 10000000; ++ii) { sum += func1(); } return sum; }\n" \
- "func2();"
-
- Local<Script> script = Script::Compile(String::New(SOURCE), NULL, NULL,
- Handle<String>(), Script::QmlMode);
- Local<Value> result = script->Run(qmlglobal);
- VERIFY(!result.IsEmpty());
- VERIFY(result->IsInt32());
- VERIFY(result->Int32Value() == 10000000);
-
-#undef SOURCE
-
-cleanup:
- context.Dispose();
-
- ENDTEST();
-}
-
-bool v8test_evalwithinwith()
-{
- BEGINTEST();
-
- HandleScope handle_scope;
- Persistent<Context> context = Context::New();
- Context::Scope context_scope(context);
-
- Local<Object> qmlglobal = Object::New();
- qmlglobal->Set(String::New("a"), Integer::New(1922));
- // There was a bug that the "eval" lookup would incorrectly resolve
- // to the QML global object
- qmlglobal->Set(String::New("eval"), Integer::New(1922));
-
-#define SOURCE \
- "(function() { " \
- " var b = { c: 10 }; " \
- " with (b) { " \
- " return eval(\"a\"); " \
- " } " \
- "})"
- Local<Script> script = Script::Compile(String::New(SOURCE), NULL, NULL,
- Handle<String>(), Script::QmlMode);
-#undef SOURCE
-
- TryCatch tc;
- Local<Value> result = script->Run(qmlglobal);
-
- VERIFY(!tc.HasCaught());
- VERIFY(result->IsFunction());
-
- {
- Local<Value> fresult = Handle<Function>::Cast(result)->Call(context->Global(), 0, 0);
- VERIFY(!tc.HasCaught());
- VERIFY(fresult->Int32Value() == 1922);
- }
-
-cleanup:
- context.Dispose();
-
- ENDTEST();
-}
-
-static int userObjectComparisonCalled = 0;
-static bool userObjectComparisonReturn = false;
-static Local<Object> expectedLhs;
-static Local<Object> expectedRhs;
-static bool expectedObjectsCompared = false;
-
-#define SET_EXPECTED(lhs, rhs) { \
- expectedObjectsCompared = false; \
- expectedLhs = lhs; \
- expectedRhs = rhs; \
-}
-
-static bool UserObjectComparison(Local<Object> lhs, Local<Object> rhs)
-{
- userObjectComparisonCalled++;
-
- expectedObjectsCompared = (lhs == expectedLhs && rhs == expectedRhs);
-
- return userObjectComparisonReturn;
-}
-
-inline bool runscript(const char *source) {
- Local<Script> script = Script::Compile(String::New(source));
- Local<Value> result = script->Run();
- return result->BooleanValue();
-}
-
-bool v8test_userobjectcompare()
-{
- BEGINTEST();
-
- HandleScope handle_scope;
- Persistent<Context> context = Context::New();
- Context::Scope context_scope(context);
-
- V8::SetUserObjectComparisonCallbackFunction(UserObjectComparison);
-
- Local<ObjectTemplate> ot = ObjectTemplate::New();
- ot->MarkAsUseUserObjectComparison();
-
- Local<Object> uoc1 = ot->NewInstance();
- Local<Object> uoc2 = ot->NewInstance();
- context->Global()->Set(String::New("uoc1a"), uoc1);
- context->Global()->Set(String::New("uoc1b"), uoc1);
- context->Global()->Set(String::New("uoc2"), uoc2);
- Local<Object> obj1 = Object::New();
- context->Global()->Set(String::New("obj1a"), obj1);
- context->Global()->Set(String::New("obj1b"), obj1);
- context->Global()->Set(String::New("obj2"), Object::New());
- Local<String> string1 = String::New("Hello World");
- context->Global()->Set(String::New("string1a"), string1);
- context->Global()->Set(String::New("string1b"), string1);
- context->Global()->Set(String::New("string2"), v8::String::New("Goodbye World"));
-
- // XXX Opportunity for optimization - don't invoke user callback if objects are
- // equal.
-#if 0
- userObjectComparisonCalled = 0; userObjectComparisonReturn = false;
- VERIFY(true == runscript("uoc1a == uoc1b"));
- VERIFY(userObjectComparisonCalled == 0);
-#endif
-
- // Comparing two uoc objects invokes uoc
- userObjectComparisonCalled = 0;
- userObjectComparisonReturn = false;
- VERIFY(false == runscript("uoc1a == uoc2"));
- VERIFY(userObjectComparisonCalled == 1);
-
- VERIFY(false == runscript("uoc2 == uoc1a"));
- VERIFY(userObjectComparisonCalled == 2);
- userObjectComparisonReturn = true;
- VERIFY(true == runscript("uoc1a == uoc2"));
- VERIFY(userObjectComparisonCalled == 3);
- VERIFY(true == runscript("uoc2 == uoc1a"));
- VERIFY(userObjectComparisonCalled == 4);
-
- // != on two uoc object invokes uoc
- userObjectComparisonCalled = 0;
- userObjectComparisonReturn = false;
- VERIFY(true == runscript("uoc1a != uoc2"));
- VERIFY(userObjectComparisonCalled == 1);
- VERIFY(true == runscript("uoc2 != uoc1a"));
- VERIFY(userObjectComparisonCalled == 2);
- userObjectComparisonReturn = true;
- VERIFY(false == runscript("uoc1a != uoc2"));
- VERIFY(userObjectComparisonCalled == 3);
- VERIFY(false == runscript("uoc2 != uoc1a"));
- VERIFY(userObjectComparisonCalled == 4);
-
- // Comparison against a non-object doesn't invoke uoc
- userObjectComparisonCalled = 0;
- userObjectComparisonReturn = false;
- VERIFY(false == runscript("uoc1a == string1a"));
- VERIFY(userObjectComparisonCalled == 0);
- VERIFY(false == runscript("string1a == uoc1a"));
- VERIFY(userObjectComparisonCalled == 0);
- VERIFY(false == runscript("2 == uoc1a"));
- VERIFY(userObjectComparisonCalled == 0);
- VERIFY(true == runscript("uoc1a != string1a"));
- VERIFY(userObjectComparisonCalled == 0);
- VERIFY(true == runscript("string1a != uoc1a"));
- VERIFY(userObjectComparisonCalled == 0);
- VERIFY(true == runscript("2 != uoc1a"));
- VERIFY(userObjectComparisonCalled == 0);
-
- // Comparison against a non-uoc-object still invokes uoc
- userObjectComparisonCalled = 0;
- userObjectComparisonReturn = false;
- VERIFY(false == runscript("uoc1a == obj1a"));
- VERIFY(userObjectComparisonCalled == 1);
- VERIFY(false == runscript("obj1a == uoc1a"));
- VERIFY(userObjectComparisonCalled == 2);
- userObjectComparisonReturn = true;
- VERIFY(true == runscript("uoc1a == obj1a"));
- VERIFY(userObjectComparisonCalled == 3);
- VERIFY(true == runscript("obj1a == uoc1a"));
- VERIFY(userObjectComparisonCalled == 4);
-
- // != comparison against a non-uoc-object still invokes uoc
- userObjectComparisonCalled = 0;
- userObjectComparisonReturn = false;
- VERIFY(true == runscript("uoc1a != obj1a"));
- VERIFY(userObjectComparisonCalled == 1);
- VERIFY(true == runscript("obj1a != uoc1a"));
- VERIFY(userObjectComparisonCalled == 2);
- userObjectComparisonReturn = true;
- VERIFY(false == runscript("uoc1a != obj1a"));
- VERIFY(userObjectComparisonCalled == 3);
- VERIFY(false == runscript("obj1a != uoc1a"));
- VERIFY(userObjectComparisonCalled == 4);
-
- // Comparing two non-uoc objects does not invoke uoc
- userObjectComparisonCalled = 0;
- userObjectComparisonReturn = false;
- VERIFY(true == runscript("obj1a == obj1a"));
- VERIFY(true == runscript("obj1a == obj1b"));
- VERIFY(false == runscript("obj1a == obj2"));
- VERIFY(false == runscript("obj1a == string1a"));
- VERIFY(true == runscript("string1a == string1a"));
- VERIFY(true == runscript("string1a == string1b"));
- VERIFY(false == runscript("string1a == string2"));
- VERIFY(userObjectComparisonCalled == 0);
-
- // Correct lhs and rhs passed to uoc
- userObjectComparisonCalled = 0;
- userObjectComparisonReturn = false;
- SET_EXPECTED(uoc1, uoc2);
- VERIFY(false == runscript("uoc1a == uoc2"));
- VERIFY(true == expectedObjectsCompared);
- SET_EXPECTED(uoc2, uoc1);
- VERIFY(false == runscript("uoc2 == uoc1a"));
- VERIFY(true == expectedObjectsCompared);
- SET_EXPECTED(uoc1, uoc2);
- VERIFY(true == runscript("uoc1a != uoc2"));
- VERIFY(true == expectedObjectsCompared);
- SET_EXPECTED(uoc2, uoc1);
- VERIFY(true == runscript("uoc2 != uoc1a"));
- VERIFY(true == expectedObjectsCompared);
- SET_EXPECTED(uoc1, obj1);
- VERIFY(false == runscript("uoc1a == obj1a"));
- VERIFY(true == expectedObjectsCompared);
- SET_EXPECTED(obj1, uoc1);
- VERIFY(false == runscript("obj1a == uoc1a"));
- VERIFY(true == expectedObjectsCompared);
-
-cleanup:
- V8::SetUserObjectComparisonCallbackFunction(0);
- context.Dispose();
-
- ENDTEST();
-}
diff --git a/tests/auto/v8/v8test.h b/tests/auto/v8/v8test.h
deleted file mode 100644
index 7d389f85a8..0000000000
--- a/tests/auto/v8/v8test.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef V8TEST_H
-#define V8TEST_H
-
-#ifdef QT_CORE_LIB
-#include <private/v8.h>
-#else
-#include <v8.h>
-#endif
-
-bool v8test_eval();
-bool v8test_evalwithinwith();
-bool v8test_userobjectcompare();
-bool v8test_externalteardown();
-bool v8test_globalcall();
-
-#endif // V8TEST_H
-
diff --git a/tests/auto/widgets/dialogs/qabstractprintdialog/tst_qabstractprintdialog.cpp b/tests/auto/widgets/dialogs/qabstractprintdialog/tst_qabstractprintdialog.cpp
index 5e60b6a888..c3ede37e7f 100644
--- a/tests/auto/widgets/dialogs/qabstractprintdialog/tst_qabstractprintdialog.cpp
+++ b/tests/auto/widgets/dialogs/qabstractprintdialog/tst_qabstractprintdialog.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp b/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp
index 1b1b7137eb..f972bb3054 100644
--- a/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp
+++ b/tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
index 0ebe27f053..2a17cb4efc 100644
--- a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
+++ b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -170,10 +170,10 @@ void tst_QDialog::showExtension_data()
QTest::addColumn<QSize>("result");
//next we fill it with data
- QTest::newRow( "data0" ) << QSize(100,100) << QSize(50,50) << (bool)FALSE << QSize(100,150);
- QTest::newRow( "data1" ) << QSize(100,100) << QSize(120,50) << (bool)FALSE << QSize(120,150);
- QTest::newRow( "data2" ) << QSize(100,100) << QSize(50,50) << (bool)TRUE << QSize(150,100);
- QTest::newRow( "data3" ) << QSize(100,100) << QSize(50,120) << (bool)TRUE << QSize(150,120);
+ QTest::newRow( "data0" ) << QSize(100,100) << QSize(50,50) << false << QSize(100,150);
+ QTest::newRow( "data1" ) << QSize(100,100) << QSize(120,50) << false << QSize(120,150);
+ QTest::newRow( "data2" ) << QSize(100,100) << QSize(50,50) << true << QSize(150,100);
+ QTest::newRow( "data3" ) << QSize(100,100) << QSize(50,120) << true << QSize(150,120);
}
void tst_QDialog::showExtension()
@@ -193,7 +193,7 @@ void tst_QDialog::showExtension()
QPoint oldPosition = testWidget->pos();
// show
- ((DummyDialog*)testWidget)->showExtension( TRUE );
+ ((DummyDialog*)testWidget)->showExtension( true );
// while ( testWidget->size() == dlgSize )
// qApp->processEvents();
@@ -202,7 +202,7 @@ void tst_QDialog::showExtension()
QCOMPARE(testWidget->pos(), oldPosition);
// hide extension. back to old size ?
- ((DummyDialog*)testWidget)->showExtension( FALSE );
+ ((DummyDialog*)testWidget)->showExtension( false );
QCOMPARE( testWidget->size(), dlgSize );
testWidget->setExtension( 0 );
@@ -214,14 +214,14 @@ void tst_QDialog::defaultButtons()
QPushButton *push = new QPushButton("Button 1", testWidget);
QPushButton *pushTwo = new QPushButton("Button 2", testWidget);
QPushButton *pushThree = new QPushButton("Button 3", testWidget);
- pushThree->setAutoDefault(FALSE);
+ pushThree->setAutoDefault(false);
//we need to show the buttons. Otherwise they won't get the focus
push->show();
pushTwo->show();
pushThree->show();
- push->setDefault(TRUE);
+ push->setDefault(true);
QVERIFY(push->isDefault());
pushTwo->setFocus();
@@ -231,7 +231,7 @@ void tst_QDialog::defaultButtons()
lineEdit->setFocus();
QVERIFY(push->isDefault());
- pushTwo->setDefault(TRUE);
+ pushTwo->setDefault(true);
QVERIFY(pushTwo->isDefault());
pushTwo->setFocus();
diff --git a/tests/auto/widgets/dialogs/qerrormessage/tst_qerrormessage.cpp b/tests/auto/widgets/dialogs/qerrormessage/tst_qerrormessage.cpp
index d3ee640b1a..cdf53c361e 100644
--- a/tests/auto/widgets/dialogs/qerrormessage/tst_qerrormessage.cpp
+++ b/tests/auto/widgets/dialogs/qerrormessage/tst_qerrormessage.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
index 41f4798709..c2d21c2cf1 100644
--- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
index bac6b82d37..3ea66c5729 100644
--- a/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
+++ b/tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -931,7 +931,7 @@ void tst_QFileDialog2::task251341_sideBarRemoveEntries()
QCOMPARE(qvariant_cast<bool>(value), false);
MyQSideBar mySideBar;
- mySideBar.init(model, urls);
+ mySideBar.setModelAndUrls(model, urls);
mySideBar.show();
mySideBar.selectUrl(QUrl::fromLocalFile(testSubDir.absolutePath()));
QTest::qWait(1000);
diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
index 5e02dec28b..dbd1cfa016 100644
--- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
+++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp
index 855cc14095..d97d32698c 100644
--- a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp
+++ b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -119,10 +119,10 @@ void tst_QFontDialog::postKeyReturn() {
void tst_QFontDialog::defaultOkButton()
{
- bool ok = FALSE;
+ bool ok = false;
QTimer::singleShot(2000, this, SLOT(postKeyReturn()));
QFontDialog::getFont(&ok);
- QVERIFY(ok == TRUE);
+ QVERIFY(ok);
}
@@ -132,7 +132,7 @@ void tst_QFontDialog::setFont()
while the font dialog was open.
Task #27662
*/
- bool ok = FALSE;
+ bool ok = false;
#if defined Q_OS_HPUX
QString fontName = "Courier";
int fontSize = 25;
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 d12f696f7e..d10c789aec 100644
--- a/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm
+++ b/tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog_mac_helpers.mm
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp b/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp
index 91b55cdc20..0a62ac3099 100644
--- a/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp
+++ b/tests/auto/widgets/dialogs/qinputdialog/tst_qinputdialog.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
index 20cbdfbed4..b41a41124b 100644
--- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
+++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp b/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp
index bccf9ac153..281a028835 100644
--- a/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp
+++ b/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp b/tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp
index bb4c671d43..77a7baaf94 100644
--- a/tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp
+++ b/tests/auto/widgets/dialogs/qsidebar/tst_qsidebar.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -84,7 +84,7 @@ void tst_QSidebar::setUrls()
QList<QUrl> urls;
QFileSystemModel fsmodel;
QSidebar qsidebar;
- qsidebar.init(&fsmodel, urls);
+ qsidebar.setModelAndUrls(&fsmodel, urls);
QAbstractItemModel *model = qsidebar.model();
urls << QUrl::fromLocalFile(QDir::rootPath())
@@ -105,7 +105,7 @@ void tst_QSidebar::selectUrls()
<< QUrl::fromLocalFile(QDir::temp().absolutePath());
QFileSystemModel fsmodel;
QSidebar qsidebar;
- qsidebar.init(&fsmodel, urls);
+ qsidebar.setModelAndUrls(&fsmodel, urls);
QSignalSpy spy(&qsidebar, SIGNAL(goToUrl(const QUrl &)));
qsidebar.selectUrl(urls.at(0));
@@ -117,7 +117,7 @@ void tst_QSidebar::addUrls()
QList<QUrl> emptyUrls;
QFileSystemModel fsmodel;
QSidebar qsidebar;
- qsidebar.init(&fsmodel, emptyUrls);
+ qsidebar.setModelAndUrls(&fsmodel, emptyUrls);
QAbstractItemModel *model = qsidebar.model();
QDir testDir = QDir::home();
@@ -214,7 +214,7 @@ void tst_QSidebar::goToUrl()
<< QUrl::fromLocalFile(QDir::temp().absolutePath());
QFileSystemModel fsmodel;
QSidebar qsidebar;
- qsidebar.init(&fsmodel, urls);
+ qsidebar.setModelAndUrls(&fsmodel, urls);
qsidebar.show();
QSignalSpy spy(&qsidebar, SIGNAL(goToUrl(const QUrl &)));
diff --git a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
index 1b109223b6..c00d42bacd 100644
--- a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
+++ b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -855,7 +855,7 @@ public:
void cleanupPage() { ++cleanup; QWizardPage::cleanupPage(); }
bool validatePage() { ++validate; return QWizardPage::validatePage(); }
- bool check(int init, int cleanup)
+ bool sanityCheck(int init, int cleanup)
{
return init == this->init
&& cleanup == this->cleanup
@@ -868,9 +868,9 @@ public:
};
#define CHECK_PAGE_INIT(i0, c0, i1, c1, i2, c2) \
- QVERIFY(page0->check((i0), (c0))); \
- QVERIFY(page1->check((i1), (c1))); \
- QVERIFY(page2->check((i2), (c2)));
+ QVERIFY(page0->sanityCheck((i0), (c0))); \
+ QVERIFY(page1->sanityCheck((i1), (c1))); \
+ QVERIFY(page2->sanityCheck((i2), (c2)));
void tst_QWizard::setOption_IndependentPages()
{
diff --git a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
index a5214832c9..3ebc4dc5cb 100644
--- a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
+++ b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
index 6bf2f0b733..54b9355777 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -1377,8 +1377,8 @@ void tst_QGraphicsAnchorLayout::stability()
//static const int primes[] = {2, 3, 5, 13, 89, 233, 1597, 28657, 514229}; // fibo primes
//const int primeCount = sizeof(primes)/sizeof(int);
//int alloc = primes[pass % primeCount] + pass;
- //void *mem = qMalloc(alloc);
- //qFree(mem);
+ //void *mem = malloc(alloc);
+ //free(mem);
QGraphicsAnchorLayout *l = createAmbiguousS60Layout();
p->setLayout(l);
QSizeF layoutMinimumSize = l->effectiveSizeHint(Qt::MinimumSize);
diff --git a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
index 05f08e8719..0fd19c417f 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/graphicsview/qgraphicseffectsource/tst_qgraphicseffectsource.cpp b/tests/auto/widgets/graphicsview/qgraphicseffectsource/tst_qgraphicseffectsource.cpp
index a69440da50..6b90404255 100644
--- a/tests/auto/widgets/graphicsview/qgraphicseffectsource/tst_qgraphicseffectsource.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicseffectsource/tst_qgraphicseffectsource.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -122,7 +122,7 @@ public:
source()->draw(painter);
}
- void sourceChanged()
+ void sourceChanged(ChangeFlags)
{ m_sourceChanged = true; }
void sourceBoundingRectChanged()
diff --git a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
index 2247173c7f..42e0caa6a6 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
index 8474293a54..28ee69a36c 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -61,7 +61,6 @@
#include <QScrollBar>
#include <QVBoxLayout>
#include <QGraphicsEffect>
-#include <QInputContext>
#include <QPushButton>
#include <QLineEdit>
#include <QGraphicsLinearLayout>
@@ -440,7 +439,6 @@ private slots:
void modality_keyEvents();
void itemIsInFront();
void scenePosChange();
- void updateMicroFocus();
void textItem_shortcuts();
void scroll();
void focusHandling_data();
@@ -10436,86 +10434,6 @@ void tst_QGraphicsItem::scenePosChange()
QCOMPARE(child2->changes.count(QGraphicsItem::ItemScenePositionHasChanged), 0);
}
-class MyInputContext : public QInputContext
-{
-public:
- MyInputContext() : nbUpdates(0) {}
- ~MyInputContext() {}
-
- QString identifierName() { return QString(); }
- QString language() { return QString(); }
-
- void reset() {}
-
- bool isComposing() const { return false; }
-
- void update() { nbUpdates++; }
-
- bool nbUpdates;
-};
-
-class MyInputWidget : public QGraphicsWidget
-{
-public:
- MyInputWidget()
- {
- setFlag(QGraphicsItem::ItemIsFocusable, true);
- setFlag(QGraphicsItem::ItemAcceptsInputMethod, true);
- }
- void mousePressEvent(QGraphicsSceneMouseEvent *event)
- {
- event->accept();
- }
-
- void doUpdateMicroFocus()
- {
- if (QWidget *fw = QApplication::focusWidget()) {
- if (scene()) {
- for (int i = 0 ; i < scene()->views().count() ; ++i) {
- if (scene()->views().at(i) == fw) {
- if (QInputContext *inputContext = fw->inputContext()) {
- inputContext->update();
- }
- }
- }
- }
- }
- }
-};
-
-void tst_QGraphicsItem::updateMicroFocus()
-{
-#if defined Q_OS_WIN || defined Q_OS_MAC
- QSKIP("QTBUG-9578");
-#endif
- QGraphicsScene scene;
- QWidget parent;
- QGridLayout layout;
- parent.setLayout(&layout);
- QGraphicsView view(&scene);
- QGraphicsView view2(&scene);
- layout.addWidget(&view, 0, 0);
- layout.addWidget(&view2, 0, 1);
- MyInputContext *ic = new MyInputContext;
- qApp->setInputContext(ic);
- MyInputWidget input;
- input.setPos(0, 0);
- input.resize(150, 150);
- scene.addItem(&input);
- input.setFocus();
- parent.show();
- view.setFocus();
- qApp->setAutoSipEnabled(true);
- QApplication::setActiveWindow(&parent);
- QTest::qWaitForWindowShown(&parent);
- QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&parent));
- //We reset the number of updates that happened previously (initialisation)
- ic->nbUpdates = 0;
- input.doUpdateMicroFocus();
- QApplication::processEvents();
- QTRY_COMPARE(ic->nbUpdates, 1);
-}
-
void tst_QGraphicsItem::textItem_shortcuts()
{
QWidget w;
diff --git a/tests/auto/widgets/graphicsview/qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp b/tests/auto/widgets/graphicsview/qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp
index 6785ca5620..0344755480 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsitemanimation/tst_qgraphicsitemanimation.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp b/tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
index a4f375ec25..d640ce7bea 100644
--- a/tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/graphicsview/qgraphicslayoutitem/tst_qgraphicslayoutitem.cpp b/tests/auto/widgets/graphicsview/qgraphicslayoutitem/tst_qgraphicslayoutitem.cpp
index a8b6c0854e..bdcb3c8ad9 100644
--- a/tests/auto/widgets/graphicsview/qgraphicslayoutitem/tst_qgraphicslayoutitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicslayoutitem/tst_qgraphicslayoutitem.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
index 3c458b0ead..c708ae7e27 100644
--- a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/graphicsview/qgraphicsobject/tst_qgraphicsobject.cpp b/tests/auto/widgets/graphicsview/qgraphicsobject/tst_qgraphicsobject.cpp
index 85e36b74b2..40581f28e9 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsobject/tst_qgraphicsobject.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsobject/tst_qgraphicsobject.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/graphicsview/qgraphicspixmapitem/tst_qgraphicspixmapitem.cpp b/tests/auto/widgets/graphicsview/qgraphicspixmapitem/tst_qgraphicspixmapitem.cpp
index b2dccb0b09..a76b5dfd56 100644
--- a/tests/auto/widgets/graphicsview/qgraphicspixmapitem/tst_qgraphicspixmapitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicspixmapitem/tst_qgraphicspixmapitem.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/graphicsview/qgraphicspolygonitem/tst_qgraphicspolygonitem.cpp b/tests/auto/widgets/graphicsview/qgraphicspolygonitem/tst_qgraphicspolygonitem.cpp
index 061b3eda81..36e45fcddd 100644
--- a/tests/auto/widgets/graphicsview/qgraphicspolygonitem/tst_qgraphicspolygonitem.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicspolygonitem/tst_qgraphicspolygonitem.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 3f782d0808..4cd32a9186 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
index dc1e1cb804..f1afb9ff69 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -51,6 +51,8 @@
#include <private/qgraphicssceneindex_p.h>
#include <math.h>
#include "../../../gui/painting/qpathclipper/pathcompare.h"
+#include "../../shared/platforminputcontext.h"
+#include <private/qinputpanel_p.h>
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
#include <windows.h>
@@ -186,6 +188,7 @@ class tst_QGraphicsScene : public QObject
Q_OBJECT
public slots:
void initTestCase();
+ void cleanup();
private slots:
void construction();
@@ -289,6 +292,13 @@ void tst_QGraphicsScene::initTestCase()
#endif
}
+void tst_QGraphicsScene::cleanup()
+{
+ // ensure not even skipped tests with custom input context leave it dangling
+ QInputPanelPrivate *inputPanelPrivate = QInputPanelPrivate::get(qApp->inputPanel());
+ inputPanelPrivate->testContext = 0;
+}
+
void tst_QGraphicsScene::construction()
{
QGraphicsScene scene;
@@ -3070,7 +3080,7 @@ void tst_QGraphicsScene::tabFocus_sceneWithFocusableItems()
item->setFocus();
item->clearFocus();
- QGraphicsTextItem *item2 = scene.addText("Trolltech rocks!");
+ QGraphicsTextItem *item2 = scene.addText("Qt rocks!");
item2->setTabChangesFocus(true);
item2->setTextInteractionFlags(Qt::TextEditorInteraction);
item2->setPos(0, item->boundingRect().bottom());
@@ -3753,25 +3763,12 @@ public:
mutable int queryCalls;
};
-class TestInputContext : public QInputContext
-{
-public:
- TestInputContext() {}
-
- QString identifierName() { return QString(); }
- QString language() { return QString(); }
-
- void reset() {
- ++resetCalls;
- sendEvent(QInputMethodEvent()); }
-
- bool isComposing() const { return false; }
-
- int resetCalls;
-};
-
void tst_QGraphicsScene::inputMethod()
{
+ PlatformInputContext inputContext;
+ QInputPanelPrivate *inputPanelPrivate = QInputPanelPrivate::get(qApp->inputPanel());
+ inputPanelPrivate->testContext = &inputContext;
+
QFETCH(int, flags);
QFETCH(bool, callFocusItem);
@@ -3780,21 +3777,19 @@ void tst_QGraphicsScene::inputMethod()
QGraphicsScene scene;
QGraphicsView view(&scene);
- TestInputContext *inputContext = new TestInputContext;
- qApp->setInputContext(inputContext);
view.show();
QApplication::setActiveWindow(&view);
view.setFocus();
QTest::qWaitForWindowShown(&view);
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
- inputContext->resetCalls = 0;
+ inputContext.m_resetCallCount = 0;
scene.addItem(item);
QInputMethodEvent event;
scene.setFocusItem(item);
QCOMPARE(!!(item->flags() & QGraphicsItem::ItemIsFocusable), scene.focusItem() == item);
- QCOMPARE(inputContext->resetCalls, 0);
+ QCOMPARE(inputContext.m_resetCallCount, 0);
item->eventCalls = 0;
qApp->sendEvent(&scene, &event);
@@ -3807,9 +3802,7 @@ void tst_QGraphicsScene::inputMethod()
scene.setFocusItem(0);
// the input context is reset twice, once because an item has lost focus and again because
// the Qt::WA_InputMethodEnabled flag is cleared because no item has focus.
- QEXPECT_FAIL("3", "QTBUG-22456", Abort);
- QCOMPARE(inputContext->resetCalls, callFocusItem ? 2 : 0);
- QCOMPARE(item->eventCalls, callFocusItem ? 2 : 0); // verify correct delivery of "reset" event
+ QCOMPARE(inputContext.m_resetCallCount, callFocusItem ? 2 : 0);
QCOMPARE(item->queryCalls, callFocusItem ? 1 : 0); // verify that value is unaffected
item->eventCalls = 0;
diff --git a/tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp b/tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp
index 56d2508840..a318141d07 100644
--- a/tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/graphicsview/qgraphicstransform/tst_qgraphicstransform.cpp b/tests/auto/widgets/graphicsview/qgraphicstransform/tst_qgraphicstransform.cpp
index 7d5a9578ad..156adec6a7 100644
--- a/tests/auto/widgets/graphicsview/qgraphicstransform/tst_qgraphicstransform.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicstransform/tst_qgraphicstransform.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro b/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro
index 20cff5500a..e3a6edd682 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro
@@ -6,3 +6,5 @@ QT += core-private gui-private
SOURCES += tst_qgraphicsview.cpp tst_qgraphicsview_2.cpp
DEFINES += QT_NO_CAST_TO_ASCII
+
+linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index bf8ece42e2..9066ded329 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -68,10 +68,11 @@
#include <QtWidgets/QBoxLayout>
#include <QtWidgets/QStyle>
#include <QtWidgets/QPushButton>
-#include <QtWidgets/QInputContext>
#include <QtWidgets/QDesktopWidget>
#include <private/qgraphicsview_p.h>
#include "../../../platformquirks.h"
+#include "../../shared/platforminputcontext.h"
+#include <private/qinputpanel_p.h>
Q_DECLARE_METATYPE(QList<int>)
Q_DECLARE_METATYPE(QList<QRectF>)
@@ -141,6 +142,7 @@ class tst_QGraphicsView : public QObject
private slots:
void initTestCase();
+ void cleanup();
void construction();
void renderHints();
void alignment();
@@ -259,6 +261,13 @@ void tst_QGraphicsView::initTestCase()
#endif
}
+void tst_QGraphicsView::cleanup()
+{
+ // ensure not even skipped tests with custom input context leave it dangling
+ QInputPanelPrivate *inputPanelPrivate = QInputPanelPrivate::get(qApp->inputPanel());
+ inputPanelPrivate->testContext = 0;
+}
+
void tst_QGraphicsView::construction()
{
QGraphicsView view;
@@ -4100,26 +4109,16 @@ void tst_QGraphicsView::inputMethodSensitivity()
QCOMPARE(scene.focusItem(), static_cast<QGraphicsItem *>(item));
}
-class InputContextTester : public QInputContext
-{
- Q_OBJECT
-public:
- QString identifierName() { return QString(); }
- bool isComposing() const { return false; }
- QString language() { return QString(); }
- void reset() { ++resets; }
- int resets;
-};
-
void tst_QGraphicsView::inputContextReset()
{
+ PlatformInputContext inputContext;
+ QInputPanelPrivate *inputPanelPrivate = QInputPanelPrivate::get(qApp->inputPanel());
+ inputPanelPrivate->testContext = &inputContext;
+
QGraphicsScene scene;
QGraphicsView view(&scene);
QVERIFY(view.testAttribute(Qt::WA_InputMethodEnabled));
- InputContextTester *inputContext = new InputContextTester;
- qApp->setInputContext(inputContext);
-
view.show();
QTest::qWaitForWindowShown(&view);
QApplication::setActiveWindow(&view);
@@ -4128,40 +4127,40 @@ void tst_QGraphicsView::inputContextReset()
QGraphicsItem *item1 = new QGraphicsRectItem;
item1->setFlags(QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemAcceptsInputMethod);
- inputContext->resets = 0;
+ inputContext.m_resetCallCount = 0;
scene.addItem(item1);
- QCOMPARE(inputContext->resets, 0);
+ QCOMPARE(inputContext.m_resetCallCount, 0);
- inputContext->resets = 0;
+ inputContext.m_resetCallCount = 0;
scene.setFocusItem(item1);
QCOMPARE(scene.focusItem(), (QGraphicsItem *)item1);
QVERIFY(view.testAttribute(Qt::WA_InputMethodEnabled));
- QCOMPARE(inputContext->resets, 0);
+ QCOMPARE(inputContext.m_resetCallCount, 0);
- inputContext->resets = 0;
+ inputContext.m_resetCallCount = 0;
scene.setFocusItem(0);
// the input context is reset twice, once because an item has lost focus and again because
// the Qt::WA_InputMethodEnabled flag is cleared because no item has focus.
- QEXPECT_FAIL("", "QTBUG-22454", Abort);
- QCOMPARE(inputContext->resets, 2);
+ // QEXPECT_FAIL("", "QTBUG-22454", Abort);
+ QCOMPARE(inputContext.m_resetCallCount, 2);
// introduce another item that is focusable but does not accept input methods
QGraphicsItem *item2 = new QGraphicsRectItem;
item2->setFlags(QGraphicsItem::ItemIsFocusable);
scene.addItem(item2);
- inputContext->resets = 0;
+ inputContext.m_resetCallCount = 0;
scene.setFocusItem(item2);
- QCOMPARE(inputContext->resets, 0);
+ QCOMPARE(inputContext.m_resetCallCount, 0);
- inputContext->resets = 0;
+ inputContext.m_resetCallCount = 0;
scene.setFocusItem(item1);
- QCOMPARE(inputContext->resets, 0);
+ QCOMPARE(inputContext.m_resetCallCount, 0);
// test changing between between items that accept input methods.
item2->setFlags(QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemAcceptsInputMethod);
scene.setFocusItem(item2);
- QCOMPARE(inputContext->resets, 1);
+ QCOMPARE(inputContext.m_resetCallCount, 1);
}
void tst_QGraphicsView::indirectPainting()
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp
index 122ffbc875..7f056e6700 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview_2.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -39,23 +39,11 @@
**
****************************************************************************/
#include <QtTest/QtTest>
-#include <QSize>
-#include <QRectF>
-#include <QTransform>
-
-#ifdef Q_OS_WINCE
-#include <qguifunctions_wince.h>
-
-bool qt_wince_is_high_dpi() {
- HDC deviceContext = GetDC(0);
- int dpi = GetDeviceCaps(deviceContext, LOGPIXELSX);
- ReleaseDC(0, deviceContext);
- if ((dpi < 1000) && (dpi > 0))
- return dpi > 96;
- else
- return false;
-}
-#endif
+#include <QtCore/QSize>
+#include <QtCore/QRectF>
+#include <QtGui/QTransform>
+#include <QtGui/QGuiApplication>
+#include <QtGui/QScreen>
Q_DECLARE_METATYPE(QList<int>)
Q_DECLARE_METATYPE(QList<QRectF>)
@@ -286,7 +274,7 @@ static void _scrollBarRanges_data_1(int offset)
<< -200 << (50 + 16) << -200 << (100 + 16) << false << false;
}
-static void _scrollBarRanges_data_2(int offset)
+static void _scrollBarRangesMotif_data_1(int offset)
{
// Motif, flat frame
QTest::newRow("Motif, 1") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform()
@@ -507,7 +495,7 @@ static void _scrollBarRanges_data_2(int offset)
<< -200 << (50 + 16) << -200 << (100 + 16) << true << false;
}
-static void _scrollBarRanges_data_3(int offset)
+static void _scrollBarRanges_data_2(int offset)
{
// No motif, styled panel
QTest::newRow("Styled, 1") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform()
@@ -728,7 +716,7 @@ static void _scrollBarRanges_data_3(int offset)
<< -200 << (50 + 16) << -200 << (100 + 16) << false << true;
}
-static void _scrollBarRanges_data_4(int offset)
+static void _scrollBarRangesMotif_data_2(int offset)
{
// Motif, styled panel
QTest::newRow("Motif, Styled, 1") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform()
@@ -963,14 +951,14 @@ void _scrollBarRanges_data()
QTest::addColumn<bool>("useMotif");
QTest::addColumn<bool>("useStyledPanel");
- int offset = 16;
-#ifdef Q_OS_WINCE
- if (qt_wince_is_high_dpi())
- offset *= 2;
-#endif
+ const int offset = 16;
_scrollBarRanges_data_1(offset);
_scrollBarRanges_data_2(offset);
- _scrollBarRanges_data_3(offset);
- _scrollBarRanges_data_4(offset);
+ // Motif tests are suitable for 96 DPI, only.
+ const QScreen *screen = QGuiApplication::primaryScreen();
+ if (screen && qFuzzyCompare(screen->logicalDotsPerInchX(), 96.0)) {
+ _scrollBarRangesMotif_data_1(offset);
+ _scrollBarRangesMotif_data_2(offset);
+ }
}
diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro b/tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro
index afe584e57d..af9ff4d42c 100644
--- a/tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro
+++ b/tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro
@@ -6,5 +6,6 @@ QT += core-private gui-private
SOURCES += tst_qgraphicswidget.cpp
-
+# QTBUG-23616 - unstable test
+linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test
mac*:CONFIG+=insignificant_test
diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
index 164d5564e3..89cd63f482 100644
--- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/itemviews/itemviews.pro b/tests/auto/widgets/itemviews/itemviews.pro
index fc338fdb7b..e13a5a82ca 100644
--- a/tests/auto/widgets/itemviews/itemviews.pro
+++ b/tests/auto/widgets/itemviews/itemviews.pro
@@ -1,23 +1,18 @@
TEMPLATE=subdirs
SUBDIRS=\
qabstractitemview \
- qabstractproxymodel \
qcolumnview \
qdatawidgetmapper \
qdirmodel \
qfileiconprovider \
qheaderview \
- qidentityproxymodel \
qitemdelegate \
qitemeditorfactory \
- qitemselectionmodel \
qitemview \
qlistview \
qlistwidget \
- qsortfilterproxymodel \
qstandarditem \
qstandarditemmodel \
- qstringlistmodel \
qtableview \
qtablewidget \
qtreeview \
diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
index 4e1b61e32d..764838fc96 100644
--- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
+++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp b/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp
index 4b1a5a1a21..abf7929a94 100644
--- a/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp
+++ b/tests/auto/widgets/itemviews/qcolumnview/tst_qcolumnview.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/itemviews/qdatawidgetmapper/tst_qdatawidgetmapper.cpp b/tests/auto/widgets/itemviews/qdatawidgetmapper/tst_qdatawidgetmapper.cpp
index 7488195497..4ad8de1d3d 100644
--- a/tests/auto/widgets/itemviews/qdatawidgetmapper/tst_qdatawidgetmapper.cpp
+++ b/tests/auto/widgets/itemviews/qdatawidgetmapper/tst_qdatawidgetmapper.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp b/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp
index acbe652c89..ef183ed91c 100644
--- a/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp
+++ b/tests/auto/widgets/itemviews/qdirmodel/tst_qdirmodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/itemviews/qfileiconprovider/tst_qfileiconprovider.cpp b/tests/auto/widgets/itemviews/qfileiconprovider/tst_qfileiconprovider.cpp
index cf53019ff1..286a352304 100644
--- a/tests/auto/widgets/itemviews/qfileiconprovider/tst_qfileiconprovider.cpp
+++ b/tests/auto/widgets/itemviews/qfileiconprovider/tst_qfileiconprovider.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
index bf547cc7d9..f1a7b4588e 100644
--- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro b/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro
index 17a5d5ea57..d47b3bfa31 100644
--- a/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro
+++ b/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro
@@ -5,3 +5,5 @@ SOURCES += tst_qitemdelegate.cpp
win32:!wince*: LIBS += -lUser32
+# QTBUG-23637
+linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test
diff --git a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
index a2c85c2f48..30bf867249 100644
--- a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
+++ b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/itemviews/qitemeditorfactory/tst_qitemeditorfactory.cpp b/tests/auto/widgets/itemviews/qitemeditorfactory/tst_qitemeditorfactory.cpp
index 53c00dab0e..3945e65f80 100644
--- a/tests/auto/widgets/itemviews/qitemeditorfactory/tst_qitemeditorfactory.cpp
+++ b/tests/auto/widgets/itemviews/qitemeditorfactory/tst_qitemeditorfactory.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp b/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp
index 55a406cc74..7f8337a5d8 100644
--- a/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp
+++ b/tests/auto/widgets/itemviews/qitemview/tst_qitemview.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/itemviews/qitemview/viewstotest.cpp b/tests/auto/widgets/itemviews/qitemview/viewstotest.cpp
index b61ecd5c2a..15f1a4d02f 100644
--- a/tests/auto/widgets/itemviews/qitemview/viewstotest.cpp
+++ b/tests/auto/widgets/itemviews/qitemview/viewstotest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
index 86ec6c1a09..e56a8e1008 100644
--- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
+++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp b/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp
index ea3f6ae143..8849b3ae6d 100644
--- a/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp
+++ b/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/itemviews/qstandarditem/tst_qstandarditem.cpp b/tests/auto/widgets/itemviews/qstandarditem/tst_qstandarditem.cpp
index 00c8a868d9..a0e485a8c3 100644
--- a/tests/auto/widgets/itemviews/qstandarditem/tst_qstandarditem.cpp
+++ b/tests/auto/widgets/itemviews/qstandarditem/tst_qstandarditem.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/itemviews/qstandarditemmodel/tst_qstandarditemmodel.cpp b/tests/auto/widgets/itemviews/qstandarditemmodel/tst_qstandarditemmodel.cpp
index 6b0636ce77..78ac43f79a 100644
--- a/tests/auto/widgets/itemviews/qstandarditemmodel/tst_qstandarditemmodel.cpp
+++ b/tests/auto/widgets/itemviews/qstandarditemmodel/tst_qstandarditemmodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
index 383fcf8b3f..74917fbf9a 100644
--- a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
+++ b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp b/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp
index 1e5d63c261..5e2658a47f 100644
--- a/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp
+++ b/tests/auto/widgets/itemviews/qtablewidget/tst_qtablewidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro b/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro
index e3955469dc..95d1ba1c2f 100644
--- a/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro
+++ b/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro
@@ -1,4 +1,8 @@
CONFIG += testcase
TARGET = tst_qtreeview
QT += widgets testlib
+QT += widgets-private gui-private core-private
SOURCES += tst_qtreeview.cpp
+
+# QTBUG-23638
+linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test
diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
index fad4d3deea..5d0ef9d09b 100644
--- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -43,6 +43,7 @@
#include <QtTest/QtTest>
#include <QtGui/QtGui>
#include <QtWidgets/QtWidgets>
+#include <private/qabstractitemview_p.h>
Q_DECLARE_METATYPE(QModelIndex)
#ifndef QT_NO_DRAGANDDROP
@@ -106,6 +107,7 @@ struct PublicView : public QTreeView
inline QStyleOptionViewItem viewOptions() const { return QTreeView::viewOptions(); }
inline int sizeHintForColumn(int column) const { return QTreeView::sizeHintForColumn(column); }
+ QAbstractItemViewPrivate* aiv_priv() { return static_cast<QAbstractItemViewPrivate*>(d_ptr.data()); }
};
class tst_QTreeView : public QObject
@@ -2889,6 +2891,10 @@ void tst_QTreeView::styleOptionViewItem()
{
class MyDelegate : public QStyledItemDelegate
{
+ static QString posToString(QStyleOptionViewItemV4::ViewItemPosition pos) {
+ static const char* s_pos[] = { "Invalid", "Beginning", "Middle", "End", "OnlyOne" };
+ return s_pos[pos];
+ }
public:
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const
{
@@ -2905,16 +2911,16 @@ void tst_QTreeView::styleOptionViewItem()
QCOMPARE(!(opt.features & QStyleOptionViewItemV2::HasCheckIndicator), !opt.text.contains("Checkable"));
if (opt.text.contains("Beginning"))
- QCOMPARE(opt.viewItemPosition, QStyleOptionViewItemV4::Beginning);
+ QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItemV4::Beginning));
if (opt.text.contains("Middle"))
- QCOMPARE(opt.viewItemPosition, QStyleOptionViewItemV4::Middle);
+ QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItemV4::Middle));
if (opt.text.contains("End"))
- QCOMPARE(opt.viewItemPosition, QStyleOptionViewItemV4::End);
+ QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItemV4::End));
if (opt.text.contains("OnlyOne"))
- QCOMPARE(opt.viewItemPosition, QStyleOptionViewItemV4::OnlyOne);
+ QCOMPARE(posToString(opt.viewItemPosition), posToString(QStyleOptionViewItemV4::OnlyOne));
if (opt.text.contains("Checked"))
QCOMPARE(opt.checkState, Qt::Checked);
@@ -2933,47 +2939,51 @@ void tst_QTreeView::styleOptionViewItem()
bool allCollapsed;
};
- QTreeView view;
+ PublicView view;
QStandardItemModel model;
view.setModel(&model);
MyDelegate delegate;
view.setItemDelegate(&delegate);
model.appendRow(QList<QStandardItem*>()
- << new QStandardItem("Beginning") << new QStandardItem("Middle") << new QStandardItem("Middle") << new QStandardItem("End") );
+ << new QStandardItem("Beginning") << new QStandardItem("Hidden") << new QStandardItem("Middle") << new QStandardItem("Middle") << new QStandardItem("End") );
QStandardItem *par1 = new QStandardItem("Beginning HasChildren");
model.appendRow(QList<QStandardItem*>()
- << par1 << new QStandardItem("Middle HasChildren") << new QStandardItem("Middle HasChildren") << new QStandardItem("End HasChildren") );
+ << par1 << new QStandardItem("Hidden") << new QStandardItem("Middle HasChildren") << new QStandardItem("Middle HasChildren") << new QStandardItem("End HasChildren") );
model.appendRow(QList<QStandardItem*>()
- << new QStandardItem("OnlyOne") << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Assert") );
+ << new QStandardItem("OnlyOne") << new QStandardItem("Hidden") << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Assert") );
QStandardItem *checkable = new QStandardItem("Checkable");
checkable->setCheckable(true);
QStandardItem *checked = new QStandardItem("Checkable Checked");
- checkable->setCheckable(true);
+ checked->setCheckable(true);
checked->setCheckState(Qt::Checked);
model.appendRow(QList<QStandardItem*>()
- << new QStandardItem("Beginning") << checkable << checked << new QStandardItem("End") );
+ << new QStandardItem("Beginning") << new QStandardItem("Hidden") << checkable << checked << new QStandardItem("End") );
model.appendRow(QList<QStandardItem*>()
- << new QStandardItem("Beginning Last") << new QStandardItem("Middle Last") << new QStandardItem("Middle Last") << new QStandardItem("End Last") );
+ << new QStandardItem("Beginning Last") << new QStandardItem("Hidden") << new QStandardItem("Middle Last") << new QStandardItem("Middle Last") << new QStandardItem("End Last") );
par1->appendRow(QList<QStandardItem*>()
- << new QStandardItem("Beginning") << new QStandardItem("Middle") << new QStandardItem("Middle") << new QStandardItem("End") );
+ << new QStandardItem("Beginning") << new QStandardItem("Hidden") << new QStandardItem("Middle") << new QStandardItem("Middle") << new QStandardItem("End") );
QStandardItem *par2 = new QStandardItem("Beginning HasChildren");
par1->appendRow(QList<QStandardItem*>()
- << par2 << new QStandardItem("Middle HasChildren") << new QStandardItem("Middle HasChildren") << new QStandardItem("End HasChildren") );
+ << par2 << new QStandardItem("Hidden") << new QStandardItem("Middle HasChildren") << new QStandardItem("Middle HasChildren") << new QStandardItem("End HasChildren") );
par2->appendRow(QList<QStandardItem*>()
- << new QStandardItem("Beginning Last") << new QStandardItem("Middle Last") << new QStandardItem("Middle Last") << new QStandardItem("End Last") );
+ << new QStandardItem("Beginning Last") << new QStandardItem("Hidden") << new QStandardItem("Middle Last") << new QStandardItem("Middle Last") << new QStandardItem("End Last") );
QStandardItem *par3 = new QStandardItem("Beginning Last");
par1->appendRow(QList<QStandardItem*>()
- << par3 << new QStandardItem("Middle Last") << new QStandardItem("Middle Last") << new QStandardItem("End Last") );
+ << par3 << new QStandardItem("Hidden") << new QStandardItem("Middle Last") << new QStandardItem("Middle Last") << new QStandardItem("End Last") );
par3->appendRow(QList<QStandardItem*>()
- << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Asser") );
+ << new QStandardItem("Assert") << new QStandardItem("Hidden") << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Asser") );
view.setRowHidden(0, par3->index(), true);
par1->appendRow(QList<QStandardItem*>()
- << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Asser") );
+ << new QStandardItem("Assert") << new QStandardItem("Hidden") << new QStandardItem("Assert") << new QStandardItem("Assert") << new QStandardItem("Asser") );
view.setRowHidden(3, par1->index(), true);
+ view.setColumnHidden(1, true);
+ const int visibleColumns = 4;
+ const int modelColumns = 5;
+ view.header()->swapSections(2, 3);
view.setFirstColumnSpanned(2, QModelIndex(), true);
view.setAlternatingRowColors(true);
@@ -2992,6 +3002,14 @@ void tst_QTreeView::styleOptionViewItem()
QApplication::processEvents();
QTRY_VERIFY(delegate.count >= 4);
+ // test that the rendering of drag pixmap sets the correct options too (QTBUG-15834)
+#ifdef QT_BUILD_INTERNAL
+ delegate.count = 0;
+ QItemSelection sel(model.index(0,0), model.index(0,modelColumns-1));
+ QRect rect;
+ view.aiv_priv()->renderToPixmap(sel.indexes(), &rect);
+ QTRY_VERIFY(delegate.count == visibleColumns);
+#endif
//test dynamic models
{
diff --git a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
index 03619f0c97..14f1f8736d 100644
--- a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
+++ b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp b/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp
index 94f4446b5b..b747586548 100644
--- a/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp
+++ b/tests/auto/widgets/itemviews/qtreewidgetitemiterator/tst_qtreewidgetitemiterator.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/kernel/kernel.pro b/tests/auto/widgets/kernel/kernel.pro
index d1f2304378..a68a9c2748 100644
--- a/tests/auto/widgets/kernel/kernel.pro
+++ b/tests/auto/widgets/kernel/kernel.pro
@@ -7,7 +7,6 @@ SUBDIRS=\
qdesktopwidget \
qformlayout \
qgridlayout \
- qinputcontext \
qlayout \
qstackedlayout \
qtooltip \
diff --git a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
index 846cba7ad6..d00828e8b0 100644
--- a/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
+++ b/tests/auto/widgets/kernel/qaction/tst_qaction.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp b/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp
index 406298807a..3946423dec 100644
--- a/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp
+++ b/tests/auto/widgets/kernel/qactiongroup/tst_qactiongroup.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/kernel/qapplication/desktopsettingsaware/desktopsettingsaware.pro b/tests/auto/widgets/kernel/qapplication/desktopsettingsaware/desktopsettingsaware.pro
index 216a9710c7..3aa363d796 100644
--- a/tests/auto/widgets/kernel/qapplication/desktopsettingsaware/desktopsettingsaware.pro
+++ b/tests/auto/widgets/kernel/qapplication/desktopsettingsaware/desktopsettingsaware.pro
@@ -5,10 +5,14 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
-wince*:TARGET = ../desktopsettingsaware
+DESTDIR = ./
# Input
QT += widgets
SOURCES += main.cpp
CONFIG += qt warn_on create_prl link_prl
CONFIG -= app_bundle
+
+# This app is testdata for tst_qapplication
+target.path = $$[QT_INSTALL_TESTS]/tst_qapplication/$$TARGET
+INSTALLS += target
diff --git a/tests/auto/widgets/kernel/qapplication/desktopsettingsaware/main.cpp b/tests/auto/widgets/kernel/qapplication/desktopsettingsaware/main.cpp
index 9e2172829a..154e9262a3 100644
--- a/tests/auto/widgets/kernel/qapplication/desktopsettingsaware/main.cpp
+++ b/tests/auto/widgets/kernel/qapplication/desktopsettingsaware/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/kernel/qapplication/modal/base.cpp b/tests/auto/widgets/kernel/qapplication/modal/base.cpp
index 2f7b4ad529..c8e6c63c99 100644
--- a/tests/auto/widgets/kernel/qapplication/modal/base.cpp
+++ b/tests/auto/widgets/kernel/qapplication/modal/base.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/kernel/qapplication/modal/base.h b/tests/auto/widgets/kernel/qapplication/modal/base.h
index e1f36e11bd..af520b916f 100644
--- a/tests/auto/widgets/kernel/qapplication/modal/base.h
+++ b/tests/auto/widgets/kernel/qapplication/modal/base.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/kernel/qapplication/modal/main.cpp b/tests/auto/widgets/kernel/qapplication/modal/main.cpp
index 53c6008eb5..70cc8545d2 100644
--- a/tests/auto/widgets/kernel/qapplication/modal/main.cpp
+++ b/tests/auto/widgets/kernel/qapplication/modal/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/kernel/qapplication/modal/modal.pro b/tests/auto/widgets/kernel/qapplication/modal/modal.pro
index 9ed69769bb..b13165bcda 100644
--- a/tests/auto/widgets/kernel/qapplication/modal/modal.pro
+++ b/tests/auto/widgets/kernel/qapplication/modal/modal.pro
@@ -1,9 +1,13 @@
TEMPLATE = app
QT += widgets
-TARGET =
DEPENDPATH += .
INCLUDEPATH += .
SOURCES += main.cpp \
base.cpp
DESTDIR = ./
+CONFIG -= app_bundle
HEADERS += base.h
+
+# This app is testdata for tst_qapplication
+target.path = $$[QT_INSTALL_TESTS]/tst_qapplication/$$TARGET
+INSTALLS += target
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
index 81cdffe4e5..4cf15879cc 100644
--- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
+++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -45,12 +45,26 @@
#include <QtTest/QtTest>
-#include "qabstracteventdispatcher.h"
-#include <QtGui>
-#include <QtWidgets>
+#include <QtCore/QAbstractEventDispatcher>
+#include <QtCore/QFileInfo>
+#include <QtCore/QDir>
+#include <QtCore/QProcess>
+
+#include <QtGui/QFontDatabase>
+#include <QtGui/QClipboard>
+
+#include <QtWidgets/QApplication>
+#include <QtWidgets/QMessageBox>
+#include <QtWidgets/QInputContext>
+#include <QtWidgets/QStyleFactory>
+#include <QtWidgets/QHBoxLayout>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QLineEdit>
+#include <QtWidgets/QLabel>
+#include <QtWidgets/QMainWindow>
+#include <QtWidgets/private/qapplication_p.h>
+#include <QtWidgets/private/qstylesheetstyle_p.h>
-#include "private/qapplication_p.h"
-#include "private/qstylesheetstyle_p.h"
#ifdef Q_OS_WINCE
#include <windows.h>
#endif
@@ -64,11 +78,11 @@ public:
virtual ~tst_QApplication();
public slots:
+ void initTestCase();
void init();
void cleanup();
private slots:
void sendEventsOnProcessEvents(); // this must be the first test
- void getSetCheck();
void staticSetup();
void alert();
@@ -140,6 +154,13 @@ public:
}
};
+void tst_QApplication::initTestCase()
+{
+ // chdir to our testdata path and execute helper apps relative to that.
+ const QString testdataDir = QFileInfo(QFINDTESTDATA("desktopsettingsaware")).absolutePath();
+ QVERIFY2(QDir::setCurrent(testdataDir), qPrintable("Could not chdir to " + testdataDir));
+}
+
void tst_QApplication::sendEventsOnProcessEvents()
{
int argc = 0;
@@ -153,38 +174,6 @@ void tst_QApplication::sendEventsOnProcessEvents()
QVERIFY(spy.recordedEvents.contains(QEvent::User + 1));
}
-class MyInputContext : public QInputContext
-{
-public:
- MyInputContext() : QInputContext() {}
- QString identifierName() { return QString("NoName"); }
- QString language() { return QString("NoLanguage"); }
- void reset() {}
- bool isComposing() const { return false; }
-};
-
-// Testing get/set functions
-void tst_QApplication::getSetCheck()
-{
- int argc = 0;
- QApplication obj1(argc, 0, QApplication::GuiServer);
- MyInputContext *var1 = new MyInputContext;
-
- // QApplication takes ownership, so check for reparenting:
- obj1.setInputContext(var1);
- QCOMPARE(var1->parent(), static_cast<QObject *>(&obj1));
-
- // Test for self-assignment:
- obj1.setInputContext(obj1.inputContext());
- QVERIFY(obj1.inputContext());
- QCOMPARE(static_cast<QInputContext *>(var1), obj1.inputContext());
-
- // Resetting the input context to 0 is not allowed:
- QTest::ignoreMessage(QtWarningMsg, "QApplication::setInputContext: called with 0 input context");
- obj1.setInputContext(0);
-
- QCOMPARE(static_cast<QInputContext *>(var1), obj1.inputContext());
-}
class CloseEventTestWindow : public QWidget
{
@@ -1463,19 +1452,14 @@ void tst_QApplication::desktopSettingsAware()
{
#ifndef QT_NO_PROCESS
QProcess testProcess;
+ const QString path = QStringLiteral("desktopsettingsaware/desktopsettingsaware");
#ifdef Q_OS_WINCE
int argc = 0;
QApplication tmpApp(argc, 0, QApplication::GuiServer);
- testProcess.start("desktopsettingsaware/desktopsettingsaware");
-#else
-#if defined(Q_OS_WIN) && defined(QT_DEBUG)
- testProcess.start("desktopsettingsaware/debug/desktopsettingsaware");
-#elif defined(Q_OS_WIN)
- testProcess.start("desktopsettingsaware/release/desktopsettingsaware");
-#else
- testProcess.start("desktopsettingsaware/desktopsettingsaware");
-#endif
#endif
+ testProcess.start(path);
+ QVERIFY2(testProcess.waitForStarted(),
+ qPrintable(QString::fromLatin1("Cannot start '%1': %2").arg(path, testProcess.errorString())));
QVERIFY(testProcess.waitForFinished(10000));
QCOMPARE(int(testProcess.state()), int(QProcess::NotRunning));
QVERIFY(int(testProcess.error()) != int(QProcess::Crashed));
@@ -1866,11 +1850,10 @@ void tst_QApplication::windowsCommandLine()
QFETCH(QString, expected);
QProcess testProcess;
-#if defined(QT_DEBUG)
- testProcess.start("wincmdline/debug/wincmdline", QStringList(args));
-#else
- testProcess.start("wincmdline/release/wincmdline", QStringList(args));
-#endif
+ 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);
@@ -1941,23 +1924,52 @@ void tst_QApplication::touchEventPropagation()
// touch event behavior on a window
TouchEventPropagationTestWidget window;
window.setObjectName("1. window");
-
- qt_translateRawTouchEvent(&window, device, pressedTouchPoints, 0);
- qt_translateRawTouchEvent(&window, device, releasedTouchPoints, 0);
+ window.show(); // Must have an explicitly specified QWindow for handleTouchEvent,
+ // passing 0 would result in using topLevelAt() which is not ok in this case
+ // as the screen position in the point is bogus.
+ QTest::qWaitForWindowShown(&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)));
+
+ QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
+ 0,
+ device,
+ QTest::QTouchEventSequence::touchPointList(pressedTouchPoints));
+ QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
+ 0,
+ device,
+ QTest::QTouchEventSequence::touchPointList(releasedTouchPoints));
+ QCoreApplication::processEvents();
QVERIFY(!window.seenTouchEvent);
QVERIFY(!window.seenMouseEvent);
window.reset();
window.setAttribute(Qt::WA_AcceptTouchEvents);
- qt_translateRawTouchEvent(&window, device, pressedTouchPoints, 0);
- qt_translateRawTouchEvent(&window, device, releasedTouchPoints, 0);
+ QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
+ 0,
+ device,
+ QTest::QTouchEventSequence::touchPointList(pressedTouchPoints));
+ QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
+ 0,
+ device,
+ QTest::QTouchEventSequence::touchPointList(releasedTouchPoints));
+ QCoreApplication::processEvents();
QVERIFY(window.seenTouchEvent);
QVERIFY(!window.seenMouseEvent);
window.reset();
window.acceptTouchEvent = true;
- qt_translateRawTouchEvent(&window, device, pressedTouchPoints, 0);
- qt_translateRawTouchEvent(&window, device, releasedTouchPoints, 0);
+ QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
+ 0,
+ device,
+ QTest::QTouchEventSequence::touchPointList(pressedTouchPoints));
+ QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
+ 0,
+ device,
+ QTest::QTouchEventSequence::touchPointList(releasedTouchPoints));
+ QCoreApplication::processEvents();
QVERIFY(window.seenTouchEvent);
QVERIFY(!window.seenMouseEvent);
}
@@ -1968,9 +1980,20 @@ void tst_QApplication::touchEventPropagation()
window.setObjectName("2. window");
TouchEventPropagationTestWidget widget(&window);
widget.setObjectName("2. widget");
-
- qt_translateRawTouchEvent(&window, device, pressedTouchPoints, 0);
- qt_translateRawTouchEvent(&window, device, releasedTouchPoints, 0);
+ window.show();
+ QTest::qWaitForWindowShown(&window);
+ pressedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(0, 0)));
+ releasedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(0, 0)));
+
+ QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
+ 0,
+ device,
+ QTest::QTouchEventSequence::touchPointList(pressedTouchPoints));
+ QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
+ 0,
+ device,
+ QTest::QTouchEventSequence::touchPointList(releasedTouchPoints));
+ QCoreApplication::processEvents();
QVERIFY(!widget.seenTouchEvent);
QVERIFY(!widget.seenMouseEvent);
QVERIFY(!window.seenTouchEvent);
@@ -1979,8 +2002,15 @@ void tst_QApplication::touchEventPropagation()
window.reset();
widget.reset();
widget.setAttribute(Qt::WA_AcceptTouchEvents);
- qt_translateRawTouchEvent(&window, device, pressedTouchPoints, 0);
- qt_translateRawTouchEvent(&window, device, releasedTouchPoints, 0);
+ QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
+ 0,
+ device,
+ QTest::QTouchEventSequence::touchPointList(pressedTouchPoints));
+ QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
+ 0,
+ device,
+ QTest::QTouchEventSequence::touchPointList(releasedTouchPoints));
+ QCoreApplication::processEvents();
QVERIFY(widget.seenTouchEvent);
QVERIFY(!widget.seenMouseEvent);
QVERIFY(!window.seenTouchEvent);
@@ -1989,8 +2019,15 @@ void tst_QApplication::touchEventPropagation()
window.reset();
widget.reset();
widget.acceptMouseEvent = true;
- qt_translateRawTouchEvent(&window, device, pressedTouchPoints, 0);
- qt_translateRawTouchEvent(&window, device, releasedTouchPoints, 0);
+ QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
+ 0,
+ device,
+ QTest::QTouchEventSequence::touchPointList(pressedTouchPoints));
+ QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
+ 0,
+ device,
+ QTest::QTouchEventSequence::touchPointList(releasedTouchPoints));
+ QCoreApplication::processEvents();
QVERIFY(widget.seenTouchEvent);
QVERIFY(!widget.seenMouseEvent);
QVERIFY(!window.seenTouchEvent);
@@ -1999,8 +2036,15 @@ void tst_QApplication::touchEventPropagation()
window.reset();
widget.reset();
widget.acceptTouchEvent = true;
- qt_translateRawTouchEvent(&window, device, pressedTouchPoints, 0);
- qt_translateRawTouchEvent(&window, device, releasedTouchPoints, 0);
+ QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
+ 0,
+ device,
+ QTest::QTouchEventSequence::touchPointList(pressedTouchPoints));
+ QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
+ 0,
+ device,
+ QTest::QTouchEventSequence::touchPointList(releasedTouchPoints));
+ QCoreApplication::processEvents();
QVERIFY(widget.seenTouchEvent);
QVERIFY(!widget.seenMouseEvent);
QVERIFY(!window.seenTouchEvent);
@@ -2010,8 +2054,15 @@ void tst_QApplication::touchEventPropagation()
widget.reset();
widget.setAttribute(Qt::WA_AcceptTouchEvents, false);
window.setAttribute(Qt::WA_AcceptTouchEvents);
- qt_translateRawTouchEvent(&window, device, pressedTouchPoints, 0);
- qt_translateRawTouchEvent(&window, device, releasedTouchPoints, 0);
+ QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
+ 0,
+ device,
+ QTest::QTouchEventSequence::touchPointList(pressedTouchPoints));
+ QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
+ 0,
+ device,
+ QTest::QTouchEventSequence::touchPointList(releasedTouchPoints));
+ QCoreApplication::processEvents();
QVERIFY(!widget.seenTouchEvent);
QVERIFY(!widget.seenMouseEvent);
QVERIFY(window.seenTouchEvent);
@@ -2020,8 +2071,15 @@ void tst_QApplication::touchEventPropagation()
window.reset();
widget.reset();
window.acceptTouchEvent = true;
- qt_translateRawTouchEvent(&window, device, pressedTouchPoints, 0);
- qt_translateRawTouchEvent(&window, device, releasedTouchPoints, 0);
+ QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
+ 0,
+ device,
+ QTest::QTouchEventSequence::touchPointList(pressedTouchPoints));
+ QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
+ 0,
+ device,
+ QTest::QTouchEventSequence::touchPointList(releasedTouchPoints));
+ QCoreApplication::processEvents();
QVERIFY(!widget.seenTouchEvent);
QVERIFY(!widget.seenMouseEvent);
QVERIFY(window.seenTouchEvent);
@@ -2031,8 +2089,15 @@ void tst_QApplication::touchEventPropagation()
widget.reset();
widget.acceptMouseEvent = true; // doesn't matter, touch events are propagated first
window.acceptTouchEvent = true;
- qt_translateRawTouchEvent(&window, device, pressedTouchPoints, 0);
- qt_translateRawTouchEvent(&window, device, releasedTouchPoints, 0);
+ QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
+ 0,
+ device,
+ QTest::QTouchEventSequence::touchPointList(pressedTouchPoints));
+ QWindowSystemInterface::handleTouchEvent(window.windowHandle(),
+ 0,
+ device,
+ QTest::QTouchEventSequence::touchPointList(releasedTouchPoints));
+ QCoreApplication::processEvents();
QVERIFY(!widget.seenTouchEvent);
QVERIFY(!widget.seenMouseEvent);
QVERIFY(window.seenTouchEvent);
@@ -2044,11 +2109,10 @@ void tst_QApplication::qtbug_12673()
{
QProcess testProcess;
QStringList arguments;
-#ifdef Q_OS_MAC
- testProcess.start("modal/modal.app", arguments);
-#else
- testProcess.start("modal/modal", arguments);
-#endif
+ const QString path = QStringLiteral("modal/modal");
+ testProcess.start(path, arguments);
+ QVERIFY2(testProcess.waitForStarted(),
+ qPrintable(QString::fromLatin1("Cannot start '%1': %2").arg(path, testProcess.errorString())));
QVERIFY(testProcess.waitForFinished(20000));
QCOMPARE(testProcess.exitStatus(), QProcess::NormalExit);
}
diff --git a/tests/auto/widgets/kernel/qapplication/wincmdline/main.cpp b/tests/auto/widgets/kernel/qapplication/wincmdline/main.cpp
index d0f802231a..fc1f37047e 100644
--- a/tests/auto/widgets/kernel/qapplication/wincmdline/main.cpp
+++ b/tests/auto/widgets/kernel/qapplication/wincmdline/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro b/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro
index 3ba8f48167..9abeb1cc83 100644
--- a/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro
+++ b/tests/auto/widgets/kernel/qapplication/wincmdline/wincmdline.pro
@@ -1,8 +1,10 @@
TEMPLATE = app
-TARGET =
DEPENDPATH += .
INCLUDEPATH += .
QT += widgets
SOURCES += main.cpp
+DESTDIR = ./
-
+# This app is testdata for tst_qapplication
+target.path = $$[QT_INSTALL_TESTS]/tst_qapplication/$$TARGET
+INSTALLS += target
diff --git a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
index 088469d770..9da67183bc 100644
--- a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
+++ b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp b/tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp
index c66e0c1c61..5595e03252 100644
--- a/tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp
+++ b/tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
index a4d2cccc8e..4b4c843115 100644
--- a/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
+++ b/tests/auto/widgets/kernel/qformlayout/tst_qformlayout.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
index c7411af716..9df387b18b 100644
--- a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
+++ b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/kernel/qinputcontext/qinputcontext.pro b/tests/auto/widgets/kernel/qinputcontext/qinputcontext.pro
deleted file mode 100644
index fcfb15c5fb..0000000000
--- a/tests/auto/widgets/kernel/qinputcontext/qinputcontext.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-CONFIG += testcase
-TARGET = tst_qinputcontext
-QT += widgets testlib
-SOURCES += tst_qinputcontext.cpp
-
-mac*:CONFIG+=insignificant_test
diff --git a/tests/auto/widgets/kernel/qinputcontext/tst_qinputcontext.cpp b/tests/auto/widgets/kernel/qinputcontext/tst_qinputcontext.cpp
deleted file mode 100644
index cb7d7eb9d2..0000000000
--- a/tests/auto/widgets/kernel/qinputcontext/tst_qinputcontext.cpp
+++ /dev/null
@@ -1,401 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtTest/QtTest>
-#include <qinputcontext.h>
-#include <qlineedit.h>
-#include <qplaintextedit.h>
-#include <qlayout.h>
-#include <qradiobutton.h>
-#include <qwindowsstyle.h>
-#include <qdesktopwidget.h>
-#include <qpushbutton.h>
-#include <qgraphicsview.h>
-#include <qgraphicsscene.h>
-
-#ifdef QT_WEBKIT_LIB
-#include <qwebview.h>
-#include <qgraphicswebview.h>
-#endif
-
-class tst_QInputContext : public QObject
-{
-Q_OBJECT
-
-public:
- tst_QInputContext() : m_phoneIsQwerty(false) {}
- virtual ~tst_QInputContext() {}
-
-public slots:
- void cleanupTestCase() {}
- void init() {}
- void cleanup() {}
-private slots:
- void maximumTextLength();
- void filterMouseEvents();
- void requestSoftwareInputPanel();
- void closeSoftwareInputPanel();
- void selections();
- void focusProxy();
-
-private:
- bool m_phoneIsQwerty;
-};
-
-void tst_QInputContext::maximumTextLength()
-{
- QLineEdit le;
-
- le.setMaxLength(15);
- QVariant variant = le.inputMethodQuery(Qt::ImMaximumTextLength);
- QVERIFY(variant.isValid());
- QCOMPARE(variant.toInt(), 15);
-
- QPlainTextEdit pte;
- // For BC/historical reasons, QPlainTextEdit::inputMethodQuery is protected.
- variant = static_cast<QWidget *>(&pte)->inputMethodQuery(Qt::ImMaximumTextLength);
- QVERIFY(!variant.isValid());
-}
-
-class QFilterInputContext : public QInputContext
-{
-public:
- QFilterInputContext() {}
- ~QFilterInputContext() {}
-
- QString identifierName() { return QString(); }
- QString language() { return QString(); }
-
- void reset() {}
-
- bool isComposing() const { return false; }
-
- bool filterEvent( const QEvent *event )
- {
- lastTypes.append(event->type());
- return false;
- }
-
-public:
- QList<QEvent::Type> lastTypes;
-};
-
-void tst_QInputContext::filterMouseEvents()
-{
- QLineEdit le;
- le.show();
- QApplication::setActiveWindow(&le);
-
- QFilterInputContext *ic = new QFilterInputContext;
- qApp->setInputContext(ic);
- QTest::mouseClick(&le, Qt::LeftButton);
-
- QEXPECT_FAIL("", "QTBUG-22564", Abort);
- QVERIFY(ic->lastTypes.indexOf(QEvent::MouseButtonRelease) >= 0);
-}
-
-class RequestSoftwareInputPanelStyle : public QWindowsStyle
-{
-public:
- RequestSoftwareInputPanelStyle()
- : m_rsipBehavior(RSIP_OnMouseClickAndAlreadyFocused)
- {
-#ifdef Q_OS_WINCE
- qApp->setAutoSipEnabled(true);
-#endif
- }
- ~RequestSoftwareInputPanelStyle()
- {
- }
-
- int styleHint(StyleHint hint, const QStyleOption *opt = 0,
- const QWidget *widget = 0, QStyleHintReturn* returnData = 0) const
- {
- if (hint == SH_RequestSoftwareInputPanel) {
- return m_rsipBehavior;
- } else {
- return QWindowsStyle::styleHint(hint, opt, widget, returnData);
- }
- }
-
- RequestSoftwareInputPanel m_rsipBehavior;
-};
-
-void tst_QInputContext::requestSoftwareInputPanel()
-{
- QStyle *oldStyle = qApp->style();
- oldStyle->setParent(this); // Prevent it being deleted.
- RequestSoftwareInputPanelStyle *newStyle = new RequestSoftwareInputPanelStyle;
- qApp->setStyle(newStyle);
-
- QWidget w;
- QLayout *layout = new QVBoxLayout;
- QLineEdit *le1, *le2;
- le1 = new QLineEdit;
- le2 = new QLineEdit;
- layout->addWidget(le1);
- layout->addWidget(le2);
- w.setLayout(layout);
-
- QFilterInputContext *ic = new QFilterInputContext;
- qApp->setInputContext(ic);
-
- w.show();
- QApplication::setActiveWindow(&w);
-
- // Testing single click panel activation.
- newStyle->m_rsipBehavior = QStyle::RSIP_OnMouseClick;
- QTest::mouseClick(le2, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5));
- QEXPECT_FAIL("", "QTBUG-22564", Abort);
- QVERIFY(ic->lastTypes.indexOf(QEvent::RequestSoftwareInputPanel) >= 0);
- ic->lastTypes.clear();
-
- // Testing double click panel activation.
- newStyle->m_rsipBehavior = QStyle::RSIP_OnMouseClickAndAlreadyFocused;
- QTest::mouseClick(le1, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5));
- QVERIFY(ic->lastTypes.indexOf(QEvent::RequestSoftwareInputPanel) < 0);
- QTest::mouseClick(le1, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5));
- QVERIFY(ic->lastTypes.indexOf(QEvent::RequestSoftwareInputPanel) >= 0);
- ic->lastTypes.clear();
-
- // Testing right mouse button
- QTest::mouseClick(le1, Qt::RightButton, Qt::NoModifier, QPoint(5, 5));
- QVERIFY(ic->lastTypes.indexOf(QEvent::RequestSoftwareInputPanel) < 0);
-
- qApp->setStyle(oldStyle);
- oldStyle->setParent(qApp);
-}
-
-void tst_QInputContext::closeSoftwareInputPanel()
-{
- QWidget w;
- QLayout *layout = new QVBoxLayout;
- QLineEdit *le1, *le2;
- QRadioButton *rb;
- le1 = new QLineEdit;
- le2 = new QLineEdit;
- rb = new QRadioButton;
- layout->addWidget(le1);
- layout->addWidget(le2);
- layout->addWidget(rb);
- w.setLayout(layout);
-
- QFilterInputContext *ic = new QFilterInputContext;
- qApp->setInputContext(ic);
-
- w.show();
- QApplication::setActiveWindow(&w);
-
- // Testing that panel doesn't close between two input methods aware widgets.
- QTest::mouseClick(le1, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5));
- QTest::mouseClick(le2, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5));
- QVERIFY(ic->lastTypes.indexOf(QEvent::CloseSoftwareInputPanel) < 0);
-
- // Testing that panel closes when focusing non-aware widget.
- QTest::mouseClick(rb, Qt::LeftButton, Qt::NoModifier, QPoint(5, 5));
- QEXPECT_FAIL("", "QTBUG-22564", Abort);
- QVERIFY(ic->lastTypes.indexOf(QEvent::CloseSoftwareInputPanel) >= 0);
-}
-
-void tst_QInputContext::selections()
-{
- QLineEdit le;
- le.setText("Test text");
- le.setSelection(2, 2);
- QCOMPARE(le.inputMethodQuery(Qt::ImCursorPosition).toInt(), 4);
- QCOMPARE(le.inputMethodQuery(Qt::ImAnchorPosition).toInt(), 2);
-
- QList<QInputMethodEvent::Attribute> attributes;
- attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Selection, 5, 3, QVariant()));
- QInputMethodEvent event("", attributes);
- QApplication::sendEvent(&le, &event);
- QCOMPARE(le.cursorPosition(), 8);
- QCOMPARE(le.selectionStart(), 5);
- QCOMPARE(le.inputMethodQuery(Qt::ImCursorPosition).toInt(), 8);
- QCOMPARE(le.inputMethodQuery(Qt::ImAnchorPosition).toInt(), 5);
-}
-
-void tst_QInputContext::focusProxy()
-{
- QWidget toplevel(0, Qt::X11BypassWindowManagerHint); toplevel.setObjectName("toplevel");
- QWidget w(&toplevel); w.setObjectName("w");
- QWidget proxy(&w); proxy.setObjectName("proxy");
- QWidget proxy2(&w); proxy2.setObjectName("proxy2");
- w.setFocusProxy(&proxy);
- w.setAttribute(Qt::WA_InputMethodEnabled);
- toplevel.show();
- QApplication::setActiveWindow(&toplevel);
- QTest::qWaitForWindowShown(&toplevel);
- w.setFocus();
- w.setAttribute(Qt::WA_NativeWindow); // we shouldn't crash!
-
- proxy.setAttribute(Qt::WA_InputMethodEnabled);
- proxy2.setAttribute(Qt::WA_InputMethodEnabled);
-
- proxy2.setFocus();
- w.setFocus();
-
- QInputContext *gic = qApp->inputContext();
- QVERIFY(gic);
- QCOMPARE(gic->focusWidget(), &proxy);
-
- // then change the focus proxy and check that input context is valid
- QVERIFY(w.hasFocus());
- QVERIFY(proxy.hasFocus());
- QVERIFY(!proxy2.hasFocus());
- w.setFocusProxy(&proxy2);
- QVERIFY(!w.hasFocus());
- QVERIFY(proxy.hasFocus());
- QVERIFY(!proxy2.hasFocus());
- QCOMPARE(gic->focusWidget(), &proxy);
-}
-
-#ifdef QT_WEBKIT_LIB
-class AutoWebView : public QWebView
-{
- Q_OBJECT
-
-public:
- AutoWebView()
- : m_length(0)
- , m_mode(QLineEdit::Normal)
- {
- updatePage();
- }
- ~AutoWebView() {}
-
- void updatePage()
- {
- // The update might reset the input method parameters.
- bool imEnabled = testAttribute(Qt::WA_InputMethodEnabled);
- Qt::InputMethodHints hints = inputMethodHints();
-
- QString page = "<html><body onLoad=\"document.forms.testform.testinput.focus()\">"
- "<form name=\"testform\"><input name=\"testinput\" type=\"%1\" %2></form></body></html>";
- if (m_mode == QLineEdit::Password)
- page = page.arg("password");
- else
- page = page.arg("text");
-
- if (m_length == 0)
- page = page.arg("");
- else
- page = page.arg("maxlength=\"" + QString::number(m_length) + "\"");
-
- setHtml(page);
-
- setAttribute(Qt::WA_InputMethodEnabled, imEnabled);
- setInputMethodHints(hints);
- }
- void setMaxLength(int length)
- {
- m_length = length;
- updatePage();
- }
- void setEchoMode(QLineEdit::EchoMode mode)
- {
- m_mode = mode;
- updatePage();
- }
-
- int m_length;
- QLineEdit::EchoMode m_mode;
-};
-
-class AutoGraphicsWebView : public QGraphicsView
-{
- Q_OBJECT
-
-public:
- AutoGraphicsWebView()
- : m_length(0)
- , m_mode(QLineEdit::Normal)
- {
- m_scene.addItem(&m_view);
- setScene(&m_scene);
- m_view.setFocus();
- updatePage();
- }
- ~AutoGraphicsWebView() {}
-
- void updatePage()
- {
- // The update might reset the input method parameters.
- bool imEnabled = testAttribute(Qt::WA_InputMethodEnabled);
- Qt::InputMethodHints hints = inputMethodHints();
-
- QString page = "<html><body onLoad=\"document.forms.testform.testinput.focus()\">"
- "<form name=\"testform\"><input name=\"testinput\" type=\"%1\" %2></form></body></html>";
- if (m_mode == QLineEdit::Password)
- page = page.arg("password");
- else
- page = page.arg("text");
-
- if (m_length == 0)
- page = page.arg("");
- else
- page = page.arg("maxlength=\"" + QString::number(m_length) + "\"");
-
- m_view.setHtml(page);
-
- setAttribute(Qt::WA_InputMethodEnabled, imEnabled);
- setInputMethodHints(hints);
- }
- void setMaxLength(int length)
- {
- m_length = length;
- updatePage();
- }
- void setEchoMode(QLineEdit::EchoMode mode)
- {
- m_mode = mode;
- updatePage();
- }
-
- int m_length;
- QLineEdit::EchoMode m_mode;
- QGraphicsScene m_scene;
- QGraphicsWebView m_view;
-};
-#endif // QT_WEBKIT_LIB
-
-QTEST_MAIN(tst_QInputContext)
-#include "tst_qinputcontext.moc"
diff --git a/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp b/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
index 6cfb2f2f2a..c0a8d9680b 100644
--- a/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
+++ b/tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp b/tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp
index 2529ccf426..7939f12c0d 100644
--- a/tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp
+++ b/tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp
index d2126d4043..d8b0666880 100644
--- a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp
+++ b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index 28daf0ac02..16bb5d345b 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -301,7 +301,7 @@ private slots:
void clean_qt_x11_enforce_cursor();
#endif
- void compatibilityChildInsertedEvents();
+ void childEvents();
void render();
void renderInvisible();
void renderWithPainter();
@@ -442,16 +442,6 @@ bool tst_QWidget::ensureScreenSize(int width, int height)
return (available.width() >= width && available.height() >= height);
}
-class MyInputContext : public QInputContext
-{
-public:
- MyInputContext() : QInputContext() {}
- QString identifierName() { return QString("NoName"); }
- QString language() { return QString("NoLanguage"); }
- void reset() {}
- bool isComposing() const { return false; }
-};
-
// Testing get/set functions
void tst_QWidget::getSetCheck()
{
@@ -587,13 +577,6 @@ void tst_QWidget::getSetCheck()
obj1.setAcceptDrops(true);
QCOMPARE(true, obj1.acceptDrops());
- // QInputContext * QWidget::inputContext()
- MyInputContext *var13 = new MyInputContext;
- qApp->setInputContext(var13);
- QCOMPARE((QInputContext *)0, obj1.inputContext()); // The widget by default doesn't have the WA_InputMethodEnabled attribute
- obj1.setAttribute(Qt::WA_InputMethodEnabled);
- QCOMPARE(static_cast<QInputContext *>(var13), obj1.inputContext());
-
// bool QWidget::autoFillBackground()
// void QWidget::setAutoFillBackground(bool)
obj1.setAutoFillBackground(false);
@@ -726,7 +709,7 @@ void BezierViewer::paintEvent( QPaintEvent* )
/* Write number of vertices */
painter.setPen( Qt::red );
- painter.setFont( QFont("Helvetica", 14, QFont::DemiBold, TRUE ) );
+ painter.setFont( QFont("Helvetica", 14, QFont::DemiBold, true ) );
QString caption;
caption.setNum( bezier.size() );
caption += QString::fromLatin1( " vertices" );
@@ -759,24 +742,24 @@ void tst_QWidget::fontPropagation()
childWidget->show();
QCOMPARE( font, childWidget->font() );
- font.setBold( TRUE );
+ font.setBold( true );
testWidget->setFont( font );
QCOMPARE( font, testWidget->font() );
QCOMPARE( font, childWidget->font() );
QFont newFont = font;
- newFont.setItalic( TRUE );
+ newFont.setItalic( true );
childWidget->setFont( newFont );
QWidget* grandChildWidget = new QWidget( childWidget );
QCOMPARE( font, testWidget->font() );
QCOMPARE( newFont, grandChildWidget->font() );
- font.setUnderline( TRUE );
+ font.setUnderline( true );
testWidget->setFont( font );
// the child and grand child should now have merged bold and
// underline
- newFont.setUnderline( TRUE );
+ newFont.setUnderline( true );
QCOMPARE( newFont, childWidget->font() );
QCOMPARE( newFont, grandChildWidget->font() );
@@ -1074,32 +1057,32 @@ void tst_QWidget::enabledPropagation()
QVERIFY( testWidget->isEnabled() );
QVERIFY( childWidget->isEnabled() );
- testWidget->setEnabled( FALSE );
+ testWidget->setEnabled( false );
QVERIFY( !testWidget->isEnabled() );
QVERIFY( !childWidget->isEnabled() );
- testWidget->setDisabled( FALSE );
+ testWidget->setDisabled( false );
QVERIFY( testWidget->isEnabled() );
QVERIFY( childWidget->isEnabled() );
QWidget* grandChildWidget = new QWidget( childWidget );
QVERIFY( grandChildWidget->isEnabled() );
- testWidget->setDisabled( TRUE );
+ testWidget->setDisabled( true );
QVERIFY( !testWidget->isEnabled() );
QVERIFY( !childWidget->isEnabled() );
QVERIFY( !grandChildWidget->isEnabled() );
- grandChildWidget->setEnabled( FALSE );
- testWidget->setEnabled( TRUE );
+ grandChildWidget->setEnabled( false );
+ testWidget->setEnabled( true );
QVERIFY( testWidget->isEnabled() );
QVERIFY( childWidget->isEnabled() );
QVERIFY( !grandChildWidget->isEnabled() );
- grandChildWidget->setEnabled( TRUE );
- testWidget->setEnabled( FALSE );
- childWidget->setDisabled( TRUE );
- testWidget->setEnabled( TRUE );
+ grandChildWidget->setEnabled( true );
+ testWidget->setEnabled( false );
+ childWidget->setDisabled( true );
+ testWidget->setEnabled( true );
QVERIFY( testWidget->isEnabled() );
QVERIFY( !childWidget->isEnabled() );
QVERIFY( !grandChildWidget->isEnabled() );
@@ -1162,7 +1145,7 @@ void tst_QWidget::isEnabledTo()
QVERIFY( childWidget->isEnabledTo( testWidget ) );
QVERIFY( grandChildWidget->isEnabledTo( testWidget ) );
- childWidget->setEnabled( FALSE );
+ childWidget->setEnabled( false );
QVERIFY( !childWidget->isEnabledTo( testWidget ) );
QVERIFY( grandChildWidget->isEnabledTo( childWidget ) );
QVERIFY( !grandChildWidget->isEnabledTo( testWidget ) );
@@ -1245,7 +1228,7 @@ void tst_QWidget::visible_setWindowOpacity()
QVERIFY( !testWidget->isVisible() );
testWidget->setWindowOpacity(0.5);
#ifdef Q_OS_WIN
- QVERIFY(::IsWindowVisible(winHandleOf(testWidget)) == FALSE);
+ QVERIFY(!::IsWindowVisible(winHandleOf(testWidget)));
#endif
testWidget->setWindowOpacity(1.0);
}
@@ -1638,12 +1621,12 @@ public:
void tab()
{
- focusNextPrevChild(TRUE);
+ focusNextPrevChild(true);
}
void backTab()
{
- focusNextPrevChild(FALSE);
+ focusNextPrevChild(false);
}
};
@@ -5806,7 +5789,7 @@ private:
EventList events;
};
-void tst_QWidget::compatibilityChildInsertedEvents()
+void tst_QWidget::childEvents()
{
EventRecorder::EventList expected;
bool accessibilityEnabled = false;
@@ -9128,23 +9111,10 @@ void tst_QWidget::openModal_taskQTBUG_5804()
delete win;
}
-class InputContextTester : public QInputContext
-{
- Q_OBJECT
-public:
- QString identifierName() { return QString(); }
- bool isComposing() const { return false; }
- QString language() { return QString(); }
- void reset() { ++resets; }
- int resets;
-};
-
void tst_QWidget::focusProxyAndInputMethods()
{
- InputContextTester *inputContext = new InputContextTester;
QWidget *toplevel = new QWidget(0, Qt::X11BypassWindowManagerHint);
toplevel->setAttribute(Qt::WA_InputMethodEnabled, true);
- qApp->setInputContext(inputContext); // ownership is transferred
QWidget *child = new QWidget(toplevel);
child->setFocusProxy(toplevel);
@@ -9167,20 +9137,24 @@ void tst_QWidget::focusProxyAndInputMethods()
// and that the input method gets the focus proxy passed
// as the focus widget instead of the child widget.
// otherwise input method queries go to the wrong widget
+ QInputContext *inputContext = qApp->inputContext();
+ if (inputContext) {
+ QCOMPARE(inputContext->focusWidget(), toplevel);
- QCOMPARE(inputContext->focusWidget(), toplevel);
+ child->setAttribute(Qt::WA_InputMethodEnabled, false);
+ QVERIFY(!inputContext->focusWidget());
- child->setAttribute(Qt::WA_InputMethodEnabled, false);
- QVERIFY(!inputContext->focusWidget());
-
- child->setAttribute(Qt::WA_InputMethodEnabled, true);
- QCOMPARE(inputContext->focusWidget(), toplevel);
+ child->setAttribute(Qt::WA_InputMethodEnabled, true);
+ QCOMPARE(inputContext->focusWidget(), toplevel);
- child->setEnabled(false);
- QVERIFY(!inputContext->focusWidget());
+ child->setEnabled(false);
+ QVERIFY(!inputContext->focusWidget());
- child->setEnabled(true);
- QCOMPARE(inputContext->focusWidget(), toplevel);
+ child->setEnabled(true);
+ QCOMPARE(inputContext->focusWidget(), toplevel);
+ } else {
+ qDebug() << "No input context set, skipping QInputContext::focusWidget() test";
+ }
delete toplevel;
}
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.h b/tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.h
index d7bc3f33c7..5d07ebd381 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.h
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.mm b/tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.mm
index 10e137c06c..404a3e989f 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.mm
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.mm
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
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 f25a383177..b6f62379a6 100644
--- a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
+++ b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/kernel/qwidgetaction/tst_qwidgetaction.cpp b/tests/auto/widgets/kernel/qwidgetaction/tst_qwidgetaction.cpp
index 9b161ec5b8..7e2d3e3b9a 100644
--- a/tests/auto/widgets/kernel/qwidgetaction/tst_qwidgetaction.cpp
+++ b/tests/auto/widgets/kernel/qwidgetaction/tst_qwidgetaction.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/shared/platforminputcontext.h b/tests/auto/widgets/shared/platforminputcontext.h
new file mode 100644
index 0000000000..a8b9a8c547
--- /dev/null
+++ b/tests/auto/widgets/shared/platforminputcontext.h
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qplatforminputcontext_qpa.h>
+
+class PlatformInputContext : public QPlatformInputContext
+{
+public:
+ PlatformInputContext() :
+ m_animating(false),
+ m_visible(false),
+ m_updateCallCount(0),
+ m_resetCallCount(0),
+ m_commitCallCount(0),
+ m_lastQueries(Qt::ImhNone),
+ m_action(QInputPanel::Click),
+ m_cursorPosition(0),
+ m_lastEventType(QEvent::None)
+ {}
+
+ virtual QRectF keyboardRect() const { return m_keyboardRect; }
+ virtual bool isAnimating() const { return m_animating; }
+ virtual void reset() { m_resetCallCount++; }
+ virtual void commit() { m_commitCallCount++; }
+
+ virtual void update(Qt::InputMethodQueries queries)
+ {
+ m_updateCallCount++;
+ m_lastQueries = queries;
+ }
+ virtual void invokeAction(QInputPanel::Action action, int cursorPosition)
+ {
+ m_action = action;
+ m_cursorPosition = cursorPosition;
+ }
+ virtual bool filterEvent(const QEvent *event)
+ {
+ m_lastEventType = event->type(); return false;
+ }
+ virtual void showInputPanel()
+ {
+ m_visible = true;
+ }
+ virtual void hideInputPanel()
+ {
+ m_visible = false;
+ }
+ virtual bool isInputPanelVisible() const
+ {
+ return m_visible;
+ }
+
+ bool m_animating;
+ bool m_visible;
+ int m_updateCallCount;
+ int m_resetCallCount;
+ int m_commitCallCount;
+ Qt::InputMethodQueries m_lastQueries;
+ QInputPanel::Action m_action;
+ int m_cursorPosition;
+ int m_lastEventType;
+ QRectF m_keyboardRect;
+};
diff --git a/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp b/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp
index 30e380ea1c..551fc6612a 100644
--- a/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp
+++ b/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
index 5dede997ae..1483189cd0 100644
--- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
+++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -273,7 +273,7 @@ void tst_QStyle::drawItemPixmap()
QPixmap p(QString(SRCDIR) + "/task_25863.png", "PNG");
QPixmap actualPix = QPixmap::grabWidget(testWidget);
- QVERIFY(pixmapsAreEqual(&actualPix,&p));
+ QCOMPARE(actualPix, p);
testWidget->hide();
}
@@ -458,7 +458,7 @@ void comparePixmap(const QString &filename, const QPixmap &pixmap)
QImage oldFile = readImage(filename);
QPixmap oldPixmap = QPixmap::fromImage(oldFile);
if (!oldFile.isNull())
- QVERIFY(pixmapsAreEqual(&pixmap, &oldPixmap));
+ QCOMPARE(pixmap, oldPixmap);
else
writeImage(filename, pixmap.toImage());
}
diff --git a/tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp b/tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp
index c1d4bd8166..f1fac918bb 100644
--- a/tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp
+++ b/tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
index a1a27f538a..cf0e773905 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/styles/styles.pro b/tests/auto/widgets/styles/styles.pro
index 20a59dea45..7e931582db 100644
--- a/tests/auto/widgets/styles/styles.pro
+++ b/tests/auto/widgets/styles/styles.pro
@@ -1,7 +1,6 @@
TEMPLATE=subdirs
SUBDIRS=\
-# disabled in src/widgets/styles/styles.pri, so disable the test as well
-# qmacstyle \
+ qmacstyle \
qstyle \
qstyleoption \
qstylesheetstyle \
diff --git a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
index 9d75131149..024e4ffa14 100644
--- a/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
+++ b/tests/auto/widgets/util/qcompleter/tst_qcompleter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
index a7912aedc1..8bf82e588e 100644
--- a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
+++ b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp b/tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp
index 2d1cace929..846f282528 100644
--- a/tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp
+++ b/tests/auto/widgets/util/qsystemtrayicon/tst_qsystemtrayicon.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp b/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp
index 4d37daf681..a88b0168f2 100644
--- a/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp
+++ b/tests/auto/widgets/util/qundogroup/tst_qundogroup.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/util/qundostack/tst_qundostack.cpp b/tests/auto/widgets/util/qundostack/tst_qundostack.cpp
index 0d65c12326..eb8ebfe21a 100644
--- a/tests/auto/widgets/util/qundostack/tst_qundostack.cpp
+++ b/tests/auto/widgets/util/qundostack/tst_qundostack.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp b/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp
index 5d4c346adb..1eb1a5abd3 100644
--- a/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp
+++ b/tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -182,9 +182,9 @@ void tst_QAbstractButton::cleanupTestCase()
void tst_QAbstractButton::init()
{
testWidget->setText("Test");
- testWidget->setEnabled( TRUE );
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( FALSE );
+ testWidget->setEnabled( true );
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( false );
QKeySequence seq;
testWidget->setShortcut( seq );
@@ -257,16 +257,16 @@ void tst_QAbstractButton::setAutoRepeat()
break;
case 1:
// check if we can toggle the mode
- testWidget->setAutoRepeat( TRUE );
+ testWidget->setAutoRepeat( true );
QVERIFY( testWidget->autoRepeat() );
- testWidget->setAutoRepeat( FALSE );
+ testWidget->setAutoRepeat( false );
QVERIFY( !testWidget->autoRepeat() );
break;
case 2:
// check that the button is down if we press space and not in autorepeat
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( FALSE );
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( false );
QTest::keyPress( testWidget, Qt::Key_Space );
QTest::qWait( REPEAT_DELAY );
@@ -295,9 +295,9 @@ void tst_QAbstractButton::setAutoRepeat()
QVERIFY(click_count > 1);
break;
case 4:
- // check that pressing ENTER has no effect when autorepeat is FALSE
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( FALSE );
+ // check that pressing ENTER has no effect when autorepeat is false
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( false );
QTest::keyPress( testWidget, Qt::Key_Enter );
QTest::qWait( REPEAT_DELAY );
@@ -312,9 +312,9 @@ void tst_QAbstractButton::setAutoRepeat()
QVERIFY( click_count == 0 );
break;
case 5:
- // check that pressing ENTER has no effect when autorepeat is TRUE
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( TRUE );
+ // check that pressing ENTER has no effect when autorepeat is true
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( true );
QTest::keyPress( testWidget, Qt::Key_Enter );
QTest::qWait( REPEAT_DELAY );
@@ -427,11 +427,11 @@ void tst_QAbstractButton::setIcon()
void tst_QAbstractButton::setEnabled()
{
- testWidget->setEnabled( FALSE );
+ testWidget->setEnabled( false );
QVERIFY( !testWidget->isEnabled() );
// QTEST( testWidget, "disabled" );
- testWidget->setEnabled( TRUE );
+ testWidget->setEnabled( true );
QVERIFY( testWidget->isEnabled() );
// QTEST( testWidget, "enabled" );
}
@@ -443,14 +443,14 @@ void tst_QAbstractButton::isCheckable()
void tst_QAbstractButton::setDown()
{
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
QVERIFY( !testWidget->isDown() );
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
QTest::qWait(300);
QVERIFY( testWidget->isDown() );
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
// add some debugging stuff
QWidget *grab = QWidget::keyboardGrabber();
@@ -466,13 +466,13 @@ void tst_QAbstractButton::setDown()
void tst_QAbstractButton::isChecked()
{
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
QVERIFY( !testWidget->isChecked() );
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
QVERIFY( !testWidget->isChecked() );
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
testWidget->toggle();
QVERIFY( testWidget->isChecked() == testWidget->isCheckable() );
}
diff --git a/tests/auto/widgets/widgets/qabstractscrollarea/tst_qabstractscrollarea.cpp b/tests/auto/widgets/widgets/qabstractscrollarea/tst_qabstractscrollarea.cpp
index 542c3f58b3..c64c16bf85 100644
--- a/tests/auto/widgets/widgets/qabstractscrollarea/tst_qabstractscrollarea.cpp
+++ b/tests/auto/widgets/widgets/qabstractscrollarea/tst_qabstractscrollarea.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp b/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp
index e78844524e..32e0fbfc5e 100644
--- a/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp
+++ b/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qabstractspinbox/tst_qabstractspinbox.cpp b/tests/auto/widgets/widgets/qabstractspinbox/tst_qabstractspinbox.cpp
index 93415b35cd..964fd27320 100644
--- a/tests/auto/widgets/widgets/qabstractspinbox/tst_qabstractspinbox.cpp
+++ b/tests/auto/widgets/widgets/qabstractspinbox/tst_qabstractspinbox.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp b/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp
index 87163305b9..a554216300 100644
--- a/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp
+++ b/tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qcalendarwidget/qcalendarwidget.pro b/tests/auto/widgets/widgets/qcalendarwidget/qcalendarwidget.pro
index d30685e652..127d78596a 100644
--- a/tests/auto/widgets/widgets/qcalendarwidget/qcalendarwidget.pro
+++ b/tests/auto/widgets/widgets/qcalendarwidget/qcalendarwidget.pro
@@ -3,4 +3,5 @@ TARGET = tst_qcalendarwidget
QT += widgets testlib
SOURCES += tst_qcalendarwidget.cpp
-
+# QTBUG-23615 - unstable test
+linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test
diff --git a/tests/auto/widgets/widgets/qcalendarwidget/tst_qcalendarwidget.cpp b/tests/auto/widgets/widgets/qcalendarwidget/tst_qcalendarwidget.cpp
index 2098c95907..468497f7ae 100644
--- a/tests/auto/widgets/widgets/qcalendarwidget/tst_qcalendarwidget.cpp
+++ b/tests/auto/widgets/widgets/qcalendarwidget/tst_qcalendarwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qcheckbox/tst_qcheckbox.cpp b/tests/auto/widgets/widgets/qcheckbox/tst_qcheckbox.cpp
index 404f3f30b9..858586a20a 100644
--- a/tests/auto/widgets/widgets/qcheckbox/tst_qcheckbox.cpp
+++ b/tests/auto/widgets/widgets/qcheckbox/tst_qcheckbox.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -121,9 +121,9 @@ void tst_QCheckBox::cleanupTestCase()
void tst_QCheckBox::init()
{
- testWidget->setTristate( FALSE );
- testWidget->setChecked( FALSE );
- testWidget->setAutoRepeat( FALSE );
+ testWidget->setTristate( false );
+ testWidget->setChecked( false );
+ testWidget->setAutoRepeat( false );
}
void tst_QCheckBox::cleanup()
@@ -158,17 +158,17 @@ void tst_QCheckBox::onToggled( bool /*on*/ )
void tst_QCheckBox::setChecked()
{
- testWidget->setChecked( TRUE );
+ testWidget->setChecked( true );
QVERIFY( testWidget->isChecked() );
QVERIFY( testWidget->isChecked() );
QVERIFY( testWidget->checkState() == Qt::Checked );
- testWidget->setChecked( FALSE );
+ testWidget->setChecked( false );
QVERIFY( !testWidget->isChecked() );
QVERIFY( !testWidget->isChecked() );
QVERIFY( testWidget->checkState() == Qt::Unchecked );
- testWidget->setChecked( FALSE );
+ testWidget->setChecked( false );
QTest::keyClick( testWidget, ' ' );
QVERIFY( testWidget->isChecked() );
@@ -178,34 +178,34 @@ void tst_QCheckBox::setChecked()
void tst_QCheckBox::setTriState()
{
- testWidget->setTristate( TRUE );
+ testWidget->setTristate( true );
QVERIFY( testWidget->isTristate() );
QVERIFY( testWidget->checkState() == Qt::Unchecked );
testWidget->setCheckState(Qt::PartiallyChecked);
QVERIFY( testWidget->checkState() == Qt::PartiallyChecked );
- testWidget->setChecked( TRUE );
+ testWidget->setChecked( true );
QVERIFY( testWidget->isChecked() );
QVERIFY( testWidget->checkState() == Qt::Checked );
- testWidget->setChecked( FALSE );
+ testWidget->setChecked( false );
QVERIFY( !testWidget->isChecked() );
QVERIFY( testWidget->checkState() == Qt::Unchecked );
testWidget->setCheckState(Qt::PartiallyChecked);
QVERIFY( testWidget->checkState() == Qt::PartiallyChecked );
- testWidget->setTristate( FALSE );
+ testWidget->setTristate( false );
QVERIFY( !testWidget->isTristate() );
testWidget->setCheckState(Qt::PartiallyChecked);
QVERIFY( testWidget->checkState() == Qt::PartiallyChecked );
- testWidget->setChecked( TRUE );
+ testWidget->setChecked( true );
QVERIFY( testWidget->checkState() == Qt::Checked );
- testWidget->setChecked( FALSE );
+ testWidget->setChecked( false );
QVERIFY( testWidget->checkState() == Qt::Unchecked );
}
@@ -237,10 +237,10 @@ void tst_QCheckBox::setText()
void tst_QCheckBox::setDown()
{
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
QVERIFY( testWidget->isDown() );
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
QVERIFY( !testWidget->isDown() );
}
@@ -272,7 +272,7 @@ void tst_QCheckBox::pressed()
connect(testWidget, SIGNAL(released()), this, SLOT(onReleased()));
press_count = 0;
release_count = 0;
- testWidget->setDown(FALSE);
+ testWidget->setDown(false);
QVERIFY( !testWidget->isChecked() );
QTest::keyPress( testWidget, Qt::Key_Space );
@@ -315,12 +315,12 @@ void tst_QCheckBox::stateChanged()
QSignalSpy stateChangedSpy(testWidget, SIGNAL(stateChanged(int)));
connect(testWidget, SIGNAL(stateChanged(int)), this, SLOT(onStateChanged(int)));
cur_state = -1;
- testWidget->setChecked( TRUE );
+ testWidget->setChecked( true );
qApp->processEvents();
QCOMPARE( cur_state, (int)2 );
cur_state = -1;
- testWidget->setChecked( FALSE );
+ testWidget->setChecked( false );
qApp->processEvents();
QCOMPARE( cur_state, (int)0 );
diff --git a/tests/auto/widgets/widgets/qcombobox/qcombobox.pro b/tests/auto/widgets/widgets/qcombobox/qcombobox.pro
index 88b9d08557..03bb91f4c0 100644
--- a/tests/auto/widgets/widgets/qcombobox/qcombobox.pro
+++ b/tests/auto/widgets/widgets/qcombobox/qcombobox.pro
@@ -2,3 +2,6 @@ CONFIG += testcase
TARGET = tst_qcombobox
QT += widgets widgets-private gui-private core-private testlib
SOURCES += tst_qcombobox.cpp
+
+# QTBUG-23639 - unstable test (related QTBUG-1071)
+linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test
diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
index 807c99ff4e..95fee1f6c8 100644
--- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp b/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp
index 7d550bcf9c..1a594138df 100644
--- a/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp
+++ b/tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -154,11 +154,11 @@ void tst_QCommandLinkButton::cleanupTestCase()
void tst_QCommandLinkButton::init()
{
- testWidget->setAutoRepeat( FALSE );
- testWidget->setDown( FALSE );
+ testWidget->setAutoRepeat( false );
+ testWidget->setDown( false );
testWidget->setText("Test");
testWidget->setDescription("Description text.");
- testWidget->setEnabled( TRUE );
+ testWidget->setEnabled( true );
QKeySequence seq;
testWidget->setShortcut( seq );
@@ -215,17 +215,17 @@ void tst_QCommandLinkButton::setAutoRepeat()
QVERIFY( !tmp.autoRepeat() );
// check if we can toggle the mode
- testWidget->setAutoRepeat( TRUE );
+ testWidget->setAutoRepeat( true );
QVERIFY( testWidget->autoRepeat() );
- testWidget->setAutoRepeat( FALSE );
+ testWidget->setAutoRepeat( false );
QVERIFY( !testWidget->autoRepeat() );
resetCounters();
// check that the button is down if we press space and not in autorepeat
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( FALSE );
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( false );
QTest::keyPress( testWidget, Qt::Key_Space );
QTest::qWait( 300 );
@@ -242,8 +242,8 @@ void tst_QCommandLinkButton::setAutoRepeat()
// check that the button is down if we press space while in autorepeat
// we can't actually confirm how many times it is fired, more than 1 is enough.
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( TRUE );
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( true );
QTest::keyPress( testWidget, Qt::Key_Space );
QTest::qWait(900);
QVERIFY( testWidget->isDown() );
@@ -257,8 +257,8 @@ void tst_QCommandLinkButton::setAutoRepeat()
// check that pressing ENTER has no effect
resetCounters();
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( FALSE );
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( false );
QTest::keyPress( testWidget, Qt::Key_Enter );
QTest::qWait( 300 );
@@ -272,8 +272,8 @@ void tst_QCommandLinkButton::setAutoRepeat()
// check that pressing ENTER has no effect
resetCounters();
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( TRUE );
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( true );
QTest::keyClick( testWidget, Qt::Key_Enter );
QTest::qWait( 300 );
QVERIFY( !testWidget->isDown() );
@@ -318,26 +318,26 @@ void tst_QCommandLinkButton::isCheckable()
void tst_QCommandLinkButton::setDown()
{
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
QVERIFY( !testWidget->isDown() );
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
QVERIFY( testWidget->isDown() );
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
QTest::keyClick( testWidget, Qt::Key_Escape );
QVERIFY( !testWidget->isDown() );
}
void tst_QCommandLinkButton::isChecked()
{
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
QVERIFY( !testWidget->isChecked() );
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
QVERIFY( !testWidget->isChecked() );
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
testWidget->toggle();
QVERIFY( testWidget->isChecked() == testWidget->isCheckable() );
}
@@ -346,7 +346,7 @@ void tst_QCommandLinkButton::toggle()
{
// the pushbutton shouldn't toggle the button.
testWidget->toggle();
- QVERIFY( testWidget->isChecked() == FALSE );
+ QVERIFY(!testWidget->isChecked());
}
void tst_QCommandLinkButton::toggled()
@@ -432,7 +432,7 @@ void tst_QCommandLinkButton::clicked()
press_count = 0;
release_count = 0;
- testWidget->setDown(FALSE);
+ testWidget->setDown(false);
for (uint i=0; i<10; i++)
QTest::mouseClick( testWidget, Qt::LeftButton );
QCOMPARE( press_count, (uint)10 );
diff --git a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
index eb561b1dff..6514ed589c 100644
--- a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
+++ b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -1063,15 +1063,15 @@ void tst_QDateTimeEdit::enterKey()
QCOMPARE(testWidget->lineEdit()->selectedText(), QString("9"));
QCOMPARE(testWidget->date(), QDate(2004, 5, 9));
+ // Current behaviour is that pressing the Enter key in a QDateTimeEdit
+ // causes the dateChanged() signal to be emitted, even if the date
+ // wasn't actually changed. While this behaviour is questionable,
+ // we include this test so a change to the behaviour can't go unnoticed.
QSignalSpy enterSpy(testWidget, SIGNAL(dateChanged(const QDate &)));
QTest::keyClick(testWidget, Qt::Key_Enter);
QCOMPARE(enterSpy.count(), 1);
-
-#if 0
QVariantList list = enterSpy.takeFirst();
- QCOMPARE(list.at(0).toDate(), QDate(2004, 9, 15));
-#endif
-
+ QCOMPARE(list.at(0).toDate(), QDate(2004, 5, 9));
}
void tst_QDateTimeEdit::specialValueText()
diff --git a/tests/auto/widgets/widgets/qdial/tst_qdial.cpp b/tests/auto/widgets/widgets/qdial/tst_qdial.cpp
index 568b82d28b..1479ee768d 100644
--- a/tests/auto/widgets/widgets/qdial/tst_qdial.cpp
+++ b/tests/auto/widgets/widgets/qdial/tst_qdial.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qdialogbuttonbox/tst_qdialogbuttonbox.cpp b/tests/auto/widgets/widgets/qdialogbuttonbox/tst_qdialogbuttonbox.cpp
index b470edc38a..6a2517e0bb 100644
--- a/tests/auto/widgets/widgets/qdialogbuttonbox/tst_qdialogbuttonbox.cpp
+++ b/tests/auto/widgets/widgets/qdialogbuttonbox/tst_qdialogbuttonbox.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
index 41616dcfc1..ce86ea3dfc 100644
--- a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
+++ b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qdoublespinbox/qdoublespinbox.pro b/tests/auto/widgets/widgets/qdoublespinbox/qdoublespinbox.pro
index cc66eaae26..4dd0890fc0 100644
--- a/tests/auto/widgets/widgets/qdoublespinbox/qdoublespinbox.pro
+++ b/tests/auto/widgets/widgets/qdoublespinbox/qdoublespinbox.pro
@@ -2,3 +2,6 @@ CONFIG += testcase
TARGET = tst_qdoublespinbox
QT += widgets testlib
SOURCES += tst_qdoublespinbox.cpp
+
+# QTBUG-23641 - unstable test
+linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test
diff --git a/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp b/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp
index 8e3a9db824..51e91b40bd 100644
--- a/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp
+++ b/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qdoublevalidator/tst_qdoublevalidator.cpp b/tests/auto/widgets/widgets/qdoublevalidator/tst_qdoublevalidator.cpp
index 6014ce5165..77f3b15184 100644
--- a/tests/auto/widgets/widgets/qdoublevalidator/tst_qdoublevalidator.cpp
+++ b/tests/auto/widgets/widgets/qdoublevalidator/tst_qdoublevalidator.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qfocusframe/tst_qfocusframe.cpp b/tests/auto/widgets/widgets/qfocusframe/tst_qfocusframe.cpp
index b17529845a..920e5401c4 100644
--- a/tests/auto/widgets/widgets/qfocusframe/tst_qfocusframe.cpp
+++ b/tests/auto/widgets/widgets/qfocusframe/tst_qfocusframe.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp b/tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp
index 72b3dfe8ca..b80f50bc67 100644
--- a/tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp
+++ b/tests/auto/widgets/widgets/qfontcombobox/tst_qfontcombobox.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp b/tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp
index a8dadf77e0..bd919d2c4a 100644
--- a/tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp
+++ b/tests/auto/widgets/widgets/qgroupbox/tst_qgroupbox.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qintvalidator/tst_qintvalidator.cpp b/tests/auto/widgets/widgets/qintvalidator/tst_qintvalidator.cpp
index b7f4bd0061..bff3f59c50 100644
--- a/tests/auto/widgets/widgets/qintvalidator/tst_qintvalidator.cpp
+++ b/tests/auto/widgets/widgets/qintvalidator/tst_qintvalidator.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp
index 18da7fdf5f..f4775cae30 100644
--- a/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp
+++ b/tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -181,7 +181,7 @@ void tst_QLabel::init()
testWidget->setBuddy( 0 );
testWidget->setIndent( 0 );
testWidget->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
- testWidget->setScaledContents( FALSE );
+ testWidget->setScaledContents( false );
}
void tst_QLabel::cleanup()
diff --git a/tests/auto/widgets/widgets/qlcdnumber/tst_qlcdnumber.cpp b/tests/auto/widgets/widgets/qlcdnumber/tst_qlcdnumber.cpp
index 1341ab3d22..5ce4ac3dba 100644
--- a/tests/auto/widgets/widgets/qlcdnumber/tst_qlcdnumber.cpp
+++ b/tests/auto/widgets/widgets/qlcdnumber/tst_qlcdnumber.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
index 1e39e03e80..1fabc45cac 100644
--- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
index 1ff21e923a..c9c627dffa 100644
--- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
+++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
index da587c0393..6a6d29cb9a 100644
--- a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
+++ b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
index 9cc764b716..b66ffabfcd 100644
--- a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
+++ b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
index 0714910faf..924c134736 100644
--- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
+++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qmenubar/qmenubar.pro b/tests/auto/widgets/widgets/qmenubar/qmenubar.pro
index 3fb6ae61a8..6bacaa0d37 100644
--- a/tests/auto/widgets/widgets/qmenubar/qmenubar.pro
+++ b/tests/auto/widgets/widgets/qmenubar/qmenubar.pro
@@ -2,3 +2,6 @@ CONFIG += testcase
TARGET = tst_qmenubar
QT += widgets testlib
SOURCES += tst_qmenubar.cpp
+
+# QTBUG-4965, QTBUG-11823 - unstable tests
+linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test
diff --git a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
index ad7071f651..05ab9d014a 100644
--- a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -722,7 +722,7 @@ void tst_QMenuBar::check_homeKey()
{
// I'm temporarily shutting up this testcase.
// Seems like the behaviour i'm expecting isn't ok.
- QVERIFY( TRUE );
+ QVERIFY( true );
return;
QEXPECT_FAIL( "0", "Popupmenu should respond to a Home key", Abort );
@@ -760,7 +760,7 @@ void tst_QMenuBar::check_endKey()
{
// I'm temporarily silenting this testcase.
// Seems like the behaviour i'm expecting isn't ok.
- QVERIFY( TRUE );
+ QVERIFY( true );
return;
QEXPECT_FAIL( "0", "Popupmenu should respond to an End key", Abort );
diff --git a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
index 96364446be..bfd7050df1 100644
--- a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
+++ b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp b/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp
index 0844c2f5e2..97ccf60d27 100644
--- a/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp
+++ b/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
index 3a0a320831..2f290cb4f1 100644
--- a/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
+++ b/tests/auto/widgets/widgets/qpushbutton/tst_qpushbutton.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -152,10 +152,10 @@ void tst_QPushButton::cleanupTestCase()
void tst_QPushButton::init()
{
- testWidget->setAutoRepeat( FALSE );
- testWidget->setDown( FALSE );
+ testWidget->setAutoRepeat( false );
+ testWidget->setDown( false );
testWidget->setText("Test");
- testWidget->setEnabled( TRUE );
+ testWidget->setEnabled( true );
QKeySequence seq;
testWidget->setShortcut( seq );
@@ -206,17 +206,17 @@ void tst_QPushButton::autoRepeat()
QVERIFY( !tmp.autoRepeat() );
// check if we can toggle the mode
- testWidget->setAutoRepeat( TRUE );
+ testWidget->setAutoRepeat( true );
QVERIFY( testWidget->autoRepeat() );
- testWidget->setAutoRepeat( FALSE );
+ testWidget->setAutoRepeat( false );
QVERIFY( !testWidget->autoRepeat() );
resetCounters();
// check that the button is down if we press space and not in autorepeat
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( FALSE );
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( false );
QTest::keyPress( testWidget, Qt::Key_Space );
QTest::qWait( 300 );
@@ -233,8 +233,8 @@ void tst_QPushButton::autoRepeat()
// check that the button is down if we press space while in autorepeat
// we can't actually confirm how many times it is fired, more than 1 is enough.
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( TRUE );
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( true );
QTest::keyPress( testWidget, Qt::Key_Space );
QTest::qWait(900);
QVERIFY( testWidget->isDown() );
@@ -248,8 +248,8 @@ void tst_QPushButton::autoRepeat()
// check that pressing ENTER has no effect
resetCounters();
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( FALSE );
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( false );
QTest::keyPress( testWidget, Qt::Key_Enter );
QTest::qWait( 300 );
@@ -263,8 +263,8 @@ void tst_QPushButton::autoRepeat()
// check that pressing ENTER has no effect
resetCounters();
- testWidget->setDown( FALSE );
- testWidget->setAutoRepeat( TRUE );
+ testWidget->setDown( false );
+ testWidget->setAutoRepeat( true );
QTest::keyClick( testWidget, Qt::Key_Enter );
QTest::qWait( 300 );
QVERIFY( !testWidget->isDown() );
@@ -307,26 +307,26 @@ void tst_QPushButton::isCheckable()
void tst_QPushButton::setDown()
{
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
QVERIFY( !testWidget->isDown() );
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
QVERIFY( testWidget->isDown() );
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
QTest::keyClick( testWidget, Qt::Key_Escape );
QVERIFY( !testWidget->isDown() );
}
void tst_QPushButton::isChecked()
{
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
QVERIFY( !testWidget->isChecked() );
- testWidget->setDown( TRUE );
+ testWidget->setDown( true );
QVERIFY( !testWidget->isChecked() );
- testWidget->setDown( FALSE );
+ testWidget->setDown( false );
testWidget->toggle();
QVERIFY( testWidget->isChecked() == testWidget->isCheckable() );
}
@@ -335,7 +335,7 @@ void tst_QPushButton::toggle()
{
// the pushbutton shouldn't toggle the button.
testWidget->toggle();
- QVERIFY( testWidget->isChecked() == FALSE );
+ QVERIFY( testWidget->isChecked() == false );
}
void tst_QPushButton::toggled()
@@ -421,7 +421,7 @@ void tst_QPushButton::clicked()
press_count = 0;
release_count = 0;
- testWidget->setDown(FALSE);
+ testWidget->setDown(false);
for (uint i=0; i<10; i++)
QTest::mouseClick( testWidget, Qt::LeftButton );
QCOMPARE( press_count, (uint)10 );
diff --git a/tests/auto/widgets/widgets/qradiobutton/tst_qradiobutton.cpp b/tests/auto/widgets/widgets/qradiobutton/tst_qradiobutton.cpp
index 79d3c8ef9a..19a5b62277 100644
--- a/tests/auto/widgets/widgets/qradiobutton/tst_qradiobutton.cpp
+++ b/tests/auto/widgets/widgets/qradiobutton/tst_qradiobutton.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qregexpvalidator/tst_qregexpvalidator.cpp b/tests/auto/widgets/widgets/qregexpvalidator/tst_qregexpvalidator.cpp
index 2e245ab0c7..2bc04d74c0 100644
--- a/tests/auto/widgets/widgets/qregexpvalidator/tst_qregexpvalidator.cpp
+++ b/tests/auto/widgets/widgets/qregexpvalidator/tst_qregexpvalidator.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp b/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp
index ba4dc855ce..dbf8c9052e 100644
--- a/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp
+++ b/tests/auto/widgets/widgets/qscrollarea/tst_qscrollarea.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
index 3bd5da4649..65b46c1c0c 100644
--- a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
+++ b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp b/tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp
index 9b7d0a7f0b..5e37e21949 100644
--- a/tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp
+++ b/tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qslider/tst_qslider.cpp b/tests/auto/widgets/widgets/qslider/tst_qslider.cpp
index 43942e96d8..09cc51c113 100644
--- a/tests/auto/widgets/widgets/qslider/tst_qslider.cpp
+++ b/tests/auto/widgets/widgets/qslider/tst_qslider.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
index 620263bcb6..cc01642fc1 100644
--- a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
+++ b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
index 7aa760bc22..2af62ceea0 100644
--- a/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
+++ b/tests/auto/widgets/widgets/qsplitter/tst_qsplitter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp b/tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp
index e5651ceebf..94ac78e038 100644
--- a/tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp
+++ b/tests/auto/widgets/widgets/qstackedwidget/tst_qstackedwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qstatusbar/tst_qstatusbar.cpp b/tests/auto/widgets/widgets/qstatusbar/tst_qstatusbar.cpp
index 56d7e7bedf..86f97d18d3 100644
--- a/tests/auto/widgets/widgets/qstatusbar/tst_qstatusbar.cpp
+++ b/tests/auto/widgets/widgets/qstatusbar/tst_qstatusbar.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qtabbar/tst_qtabbar.cpp b/tests/auto/widgets/widgets/qtabbar/tst_qtabbar.cpp
index d43e17135a..2bea17f56f 100644
--- a/tests/auto/widgets/widgets/qtabbar/tst_qtabbar.cpp
+++ b/tests/auto/widgets/widgets/qtabbar/tst_qtabbar.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp b/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
index de5080cdc2..a4d2739186 100644
--- a/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
+++ b/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp b/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp
index ff3faeb1d3..6370c1ce51 100644
--- a/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp
+++ b/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
index 9c90255da1..a350f4d862 100644
--- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
+++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp b/tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp
index a796554d6b..e029f66cf2 100644
--- a/tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp
+++ b/tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qtoolbox/tst_qtoolbox.cpp b/tests/auto/widgets/widgets/qtoolbox/tst_qtoolbox.cpp
index ca3fb34632..10d476f662 100644
--- a/tests/auto/widgets/widgets/qtoolbox/tst_qtoolbox.cpp
+++ b/tests/auto/widgets/widgets/qtoolbox/tst_qtoolbox.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -273,23 +273,23 @@ void tst_QToolBox::change()
QCOMPARE( currentIndex, 1 );
QCOMPARE( testWidget->currentIndex(), 1 );
- testWidget->setItemEnabled( testWidget->currentIndex(), FALSE );
+ testWidget->setItemEnabled( testWidget->currentIndex(), false );
QCOMPARE( currentIndex, 2 );
QCOMPARE( testWidget->currentIndex(), 2 );
currentIndex = -1;
- testWidget->setItemEnabled( testWidget->indexOf(lastItem), FALSE );
+ testWidget->setItemEnabled( testWidget->indexOf(lastItem), false );
QCOMPARE( currentIndex, -1 );
QCOMPARE( testWidget->currentIndex(), 2 );
- testWidget->setItemEnabled( testWidget->currentIndex(), FALSE );
+ testWidget->setItemEnabled( testWidget->currentIndex(), false );
QCOMPARE( currentIndex, 0 );
currentIndex = -1;
- testWidget->setItemEnabled( testWidget->currentIndex(), FALSE );
+ testWidget->setItemEnabled( testWidget->currentIndex(), false );
QCOMPARE( currentIndex, -1 );
- testWidget->setItemEnabled( 1, TRUE );
+ testWidget->setItemEnabled( 1, true );
}
void tst_QToolBox::clear()
diff --git a/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp b/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp
index 333b98b3be..8eef254837 100644
--- a/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp
+++ b/tests/auto/widgets/widgets/qtoolbutton/tst_qtoolbutton.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/widgets/widgets/qworkspace/tst_qworkspace.cpp b/tests/auto/widgets/widgets/qworkspace/tst_qworkspace.cpp
index 28ffb4280f..8410a183cb 100644
--- a/tests/auto/widgets/widgets/qworkspace/tst_qworkspace.cpp
+++ b/tests/auto/widgets/widgets/qworkspace/tst_qworkspace.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -303,7 +303,7 @@ void tst_QWorkspace::windowActivatedWithMinimize()
void tst_QWorkspace::accelActivated()
{
- accelPressed = TRUE;
+ accelPressed = true;
}
void tst_QWorkspace::showWindows()
diff --git a/tests/auto/xml/dom/qdom/tst_qdom.cpp b/tests/auto/xml/dom/qdom/tst_qdom.cpp
index 734d7b473b..b5dc2e6081 100644
--- a/tests/auto/xml/dom/qdom/tst_qdom.cpp
+++ b/tests/auto/xml/dom/qdom/tst_qdom.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -125,6 +125,8 @@ private slots:
void taskQTBUG4595_dontAssertWhenDocumentSpecifiesUnknownEncoding() const;
void cloneDTD_QTBUG8398() const;
+ void DTDNotationDecl();
+ void DTDEntityDecl();
void cleanupTestCase() const;
@@ -166,7 +168,7 @@ void tst_QDom::setContent_data()
QTest::addColumn<QStringList>("featuresFalse");
QTest::addColumn<QString>("res");
-/* QTest::newRow( "01" ) << doc01
+ QTest::newRow( "01" ) << doc01
<< QStringList()
<< QString("http://trolltech.com/xml/features/report-whitespace-only-CharData").split(' ')
<< QString("<!DOCTYPE a1>\n"
@@ -238,7 +240,7 @@ void tst_QDom::setContent_data()
" </b3>\n"
"</a1>\n");
- */ QTest::newRow("05") << QString("<message>\n"
+ QTest::newRow("05") << QString("<message>\n"
" <body>&lt;b&gt;foo&lt;/b&gt;>]]&gt;</body>\n"
"</message>\n")
<< QStringList() << QStringList()
@@ -261,11 +263,11 @@ void tst_QDom::setContent()
QStringList::Iterator it;
for ( it = featuresTrue.begin(); it != featuresTrue.end(); ++it ) {
QVERIFY( reader.hasFeature( *it ) );
- reader.setFeature( *it, TRUE );
+ reader.setFeature( *it, true );
}
for ( it = featuresFalse.begin(); it != featuresFalse.end(); ++it ) {
QVERIFY( reader.hasFeature( *it ) );
- reader.setFeature( *it, FALSE );
+ reader.setFeature( *it, false );
}
QDomDocument domDoc;
@@ -386,7 +388,7 @@ void tst_QDom::hasAttributes_data()
}
/*
- This function tests that QDomNode::hasAttributes() returns TRUE if and only
+ This function tests that QDomNode::hasAttributes() returns true if and only
if the node has attributes (i.e. QDomNode::attributes() returns a list with
attributes in it).
*/
@@ -588,13 +590,13 @@ void tst_QDom::cloneNode_data()
QTest::addColumn<QList<QVariant> >("pathToNode");
QTest::addColumn<bool>("deep");
- QTest::newRow( "noDeep_01" ) << doc01 << nodeB1 << (bool)FALSE;
- QTest::newRow( "noDeep_02" ) << doc01 << nodeC1 << (bool)FALSE;
- QTest::newRow( "noDeep_03" ) << doc01 << nodeC2 << (bool)FALSE;
+ QTest::newRow( "noDeep_01" ) << doc01 << nodeB1 << false;
+ QTest::newRow( "noDeep_02" ) << doc01 << nodeC1 << false;
+ QTest::newRow( "noDeep_03" ) << doc01 << nodeC2 << false;
- QTest::newRow( "deep_01" ) << doc01 << nodeB1 << (bool)TRUE;
- QTest::newRow( "deep_02" ) << doc01 << nodeC1 << (bool)TRUE;
- QTest::newRow( "deep_03" ) << doc01 << nodeC2 << (bool)TRUE;
+ QTest::newRow( "deep_01" ) << doc01 << nodeB1 << true;
+ QTest::newRow( "deep_02" ) << doc01 << nodeC1 << true;
+ QTest::newRow( "deep_03" ) << doc01 << nodeC2 << true;
}
void tst_QDom::cloneNode()
@@ -732,14 +734,14 @@ void tst_QDom::ownerDocumentTask27424_data()
QTest::addColumn<bool>("insertLevel2AfterCstr");
QTest::addColumn<bool>("insertLevel3AfterCstr");
- QTest::newRow( "000" ) << (bool)FALSE << (bool)FALSE << (bool)FALSE;
- QTest::newRow( "001" ) << (bool)FALSE << (bool)FALSE << (bool)TRUE;
- QTest::newRow( "010" ) << (bool)FALSE << (bool)TRUE << (bool)FALSE;
- QTest::newRow( "011" ) << (bool)FALSE << (bool)TRUE << (bool)TRUE;
- QTest::newRow( "100" ) << (bool)TRUE << (bool)FALSE << (bool)FALSE;
- QTest::newRow( "101" ) << (bool)TRUE << (bool)FALSE << (bool)TRUE;
- QTest::newRow( "110" ) << (bool)TRUE << (bool)TRUE << (bool)FALSE;
- QTest::newRow( "111" ) << (bool)TRUE << (bool)TRUE << (bool)TRUE;
+ QTest::newRow( "000" ) << false << false << false;
+ QTest::newRow( "001" ) << false << false << true;
+ QTest::newRow( "010" ) << false << true << false;
+ QTest::newRow( "011" ) << false << true << true;
+ QTest::newRow( "100" ) << true << false << false;
+ QTest::newRow( "101" ) << true << false << true;
+ QTest::newRow( "110" ) << true << true << false;
+ QTest::newRow( "111" ) << true << true << true;
}
void tst_QDom::ownerDocumentTask27424()
@@ -858,14 +860,14 @@ void tst_QDom::documentCreationTask27424_data()
QTest::addColumn<bool>("insertLevel2AfterCstr");
QTest::addColumn<bool>("insertLevel3AfterCstr");
- QTest::newRow( "000" ) << (bool)FALSE << (bool)FALSE << (bool)FALSE;
- QTest::newRow( "001" ) << (bool)FALSE << (bool)FALSE << (bool)TRUE;
- QTest::newRow( "010" ) << (bool)FALSE << (bool)TRUE << (bool)FALSE;
- QTest::newRow( "011" ) << (bool)FALSE << (bool)TRUE << (bool)TRUE;
- QTest::newRow( "100" ) << (bool)TRUE << (bool)FALSE << (bool)FALSE;
- QTest::newRow( "101" ) << (bool)TRUE << (bool)FALSE << (bool)TRUE;
- QTest::newRow( "110" ) << (bool)TRUE << (bool)TRUE << (bool)FALSE;
- QTest::newRow( "111" ) << (bool)TRUE << (bool)TRUE << (bool)TRUE;
+ QTest::newRow( "000" ) << false << false << false;
+ QTest::newRow( "001" ) << false << false << true;
+ QTest::newRow( "010" ) << false << true << false;
+ QTest::newRow( "011" ) << false << true << true;
+ QTest::newRow( "100" ) << true << false << false;
+ QTest::newRow( "101" ) << true << false << true;
+ QTest::newRow( "110" ) << true << true << false;
+ QTest::newRow( "111" ) << true << true << true;
}
void tst_QDom::documentCreationTask27424()
@@ -961,9 +963,9 @@ bool tst_QDom::isDeepEqual(const QDomNode &n1, const QDomNode &n2)
}
/*
- Returns TRUE if \a doc1 and \a doc2 represent the same XML document, i.e.
+ Returns true if \a doc1 and \a doc2 represent the same XML document, i.e.
they have the same informational content. Otherwise, this function returns
- FALSE.
+ false.
*/
bool tst_QDom::compareDocuments( const QDomDocument &doc1, const QDomDocument &doc2 )
{
@@ -971,12 +973,12 @@ bool tst_QDom::compareDocuments( const QDomDocument &doc1, const QDomDocument &d
}
/*
- Returns TRUE if \a node1 and \a node2 represent the same XML node, i.e.
+ Returns true if \a node1 and \a node2 represent the same XML node, i.e.
they have the same informational content. Otherwise, this function returns
- FALSE.
+ false.
- If \a deep is TRUE, children of the nodes are also tested. If \a deep is
- FALSE, only \a node1 and \a node 2 are compared.
+ If \a deep is true, children of the nodes are also tested. If \a deep is
+ false, only \a node1 and \a node 2 are compared.
*/
bool tst_QDom::compareNodes( const QDomNode &node1, const QDomNode &node2, bool deep )
{
@@ -995,7 +997,7 @@ bool tst_QDom::compareNodes( const QDomNode &node1, const QDomNode &node2, bool
}
if ( node1.isNull() && node2.isNull() )
- return TRUE;
+ return true;
// ### I am not sure if this test is complete
bool equal = node1.nodeName() == node2.nodeName();
equal = equal && node1.nodeType() == node2.nodeType();
@@ -1923,5 +1925,52 @@ void tst_QDom::cloneDTD_QTBUG8398() const
domDocument2.save(stream, 0);
QCOMPARE(output, expected);
}
+
+void tst_QDom::DTDNotationDecl()
+{
+ QString dtd("<?xml version='1.0' encoding='UTF-8'?>\n"
+ "<!DOCTYPE first [\n"
+ "<!NOTATION gif SYSTEM 'image/gif'>\n"
+ "<!NOTATION jpeg SYSTEM 'image/jpeg'>\n"
+ "]>\n"
+ "<first/>\n");
+
+ QDomDocument domDocument;
+ QVERIFY(domDocument.setContent(dtd));
+
+ const QDomDocumentType doctype = domDocument.doctype();
+ QCOMPARE(doctype.notations().size(), 2);
+
+ QVERIFY(doctype.namedItem(QString("gif")).isNotation());
+ QCOMPARE(doctype.namedItem(QString("gif")).toNotation().systemId(), QString("image/gif"));
+
+ QVERIFY(doctype.namedItem(QString("jpeg")).isNotation());
+ QCOMPARE(doctype.namedItem(QString("jpeg")).toNotation().systemId(), QString("image/jpeg"));
+}
+
+void tst_QDom::DTDEntityDecl()
+{
+ QString dtd("<?xml version='1.0' encoding='UTF-8'?>\n"
+ "<!DOCTYPE first [\n"
+ "<!ENTITY secondFile SYSTEM 'second.xml'>\n"
+ "<!ENTITY logo SYSTEM \"http://www.w3c.org/logo.gif\" NDATA gif>"
+ "]>\n"
+ "<first/>\n");
+
+ QDomDocument domDocument;
+ QVERIFY(domDocument.setContent(dtd));
+
+ const QDomDocumentType doctype = domDocument.doctype();
+ QCOMPARE(doctype.entities().count(), 2);
+
+ QVERIFY(doctype.namedItem(QString("secondFile")).isEntity());
+ QCOMPARE(doctype.namedItem(QString("secondFile")).toEntity().systemId(), QString("second.xml"));
+ QCOMPARE(doctype.namedItem(QString("secondFile")).toEntity().notationName(), QString());
+
+ QVERIFY(doctype.namedItem(QString("logo")).isEntity());
+ QCOMPARE(doctype.namedItem(QString("logo")).toEntity().systemId(), QString("http://www.w3c.org/logo.gif"));
+ QCOMPARE(doctype.namedItem(QString("logo")).toEntity().notationName(), QString("gif"));
+}
+
QTEST_MAIN(tst_QDom)
#include "tst_qdom.moc"
diff --git a/tests/auto/xml/sax/qxml/tst_qxml.cpp b/tests/auto/xml/sax/qxml/tst_qxml.cpp
index 8a5e750563..afe219c635 100644
--- a/tests/auto/xml/sax/qxml/tst_qxml.cpp
+++ b/tests/auto/xml/sax/qxml/tst_qxml.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp b/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp
index ba6d2922f3..5bc3a09fc5 100644
--- a/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp
+++ b/tests/auto/xml/sax/qxmlinputsource/tst_qxmlinputsource.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -41,7 +41,9 @@
#include <QDomDocument>
-#include <QHttp>
+#include <QNetworkAccessManager>
+#include <QNetworkReply>
+#include <QNetworkRequest>
#include <QTcpServer>
#include <QTcpSocket>
#include <QTimer>
@@ -116,13 +118,16 @@ class ServerAndClient : public QObject
public:
ServerAndClient(QEventLoop &ev) : success(false)
, eventLoop(ev)
+ , isBody(false)
+ , bodyBytesRead(0)
+ , bodyLength(-1)
{
setObjectName("serverAndClient");
tcpServer = new QTcpServer(this);
connect(tcpServer, SIGNAL(newConnection()), this, SLOT(newConnection()));
tcpServer->listen(QHostAddress::LocalHost, 1088);
- httpClient = new QHttp(this);
- connect(httpClient, SIGNAL(requestFinished(int, bool)), SLOT(requestFinished(int, bool)));
+ httpClient = new QNetworkAccessManager(this);
+ connect(httpClient, SIGNAL(finished(QNetworkReply*)), SLOT(requestFinished(QNetworkReply*)));
}
bool success;
@@ -132,25 +137,26 @@ public slots:
void doIt()
{
QUrl url("http://127.0.0.1:1088");
- httpClient->setHost( url.host(), 1088);
- QHttpRequestHeader req_head("POST", url.path());
- req_head.setValue("host", url.host());
- req_head.setValue("user-agent", "xml-test");
- req_head.setValue("keep-alive", "false");
+ QNetworkRequest req(url);
+ req.setRawHeader("POST", url.path().toAscii());
+ req.setRawHeader("user-agent", "xml-test");
+ req.setRawHeader("keep-alive", "false");
+ req.setRawHeader("host", url.host().toAscii());
QByteArray xmlrpc("<methodCall>\r\n\
<methodName>SFD.GetVersion</methodName>\r\n\
<params/>\r\n\
</methodCall>");
- req_head.setContentLength(xmlrpc.size());
- req_head.setContentType("text/xml");
+ req.setHeader(QNetworkRequest::ContentLengthHeader, xmlrpc.size());
+ req.setHeader(QNetworkRequest::ContentTypeHeader, "text/xml");
- httpClient->request(req_head, xmlrpc);
+ httpClient->post(req, xmlrpc);
}
- void requestFinished(int, bool isError)
+ void requestFinished(QNetworkReply *reply)
{
- QVERIFY(!isError);
+ QVERIFY(reply->error() == QNetworkReply::NoError);
+ reply->deleteLater();
}
private slots:
@@ -165,32 +171,43 @@ private slots:
void readyRead()
{
QTcpSocket *const s = static_cast<QTcpSocket *>(sender());
- int bodyLength = -1;
- while(s->canReadLine())
+ while (s->bytesAvailable())
{
const QString line(s->readLine());
- if(line.startsWith("content-length:"))
+ if (line.startsWith("Content-Length:"))
bodyLength = line.mid(15).toInt();
- if(line == "\r\n")
+ if (isBody)
{
- if(bodyLength == -1)
+ body.append(line);
+ bodyBytesRead += line.length();
+ }
+ else if (line == "\r\n")
+ {
+ isBody = true;
+ if (bodyLength == -1)
{
qFatal("No length was specified in the header.");
}
-
- QDomDocument domDoc;
- success = domDoc.setContent(s->read(bodyLength));
- eventLoop.exit();
}
}
+
+ if (bodyBytesRead == bodyLength)
+ {
+ QDomDocument domDoc;
+ success = domDoc.setContent(body);
+ eventLoop.exit();
+ }
}
private:
+ QByteArray body;
+ int bodyBytesRead, bodyLength;
+ bool isBody;
QTcpServer *tcpServer;
- QHttp* httpClient;
+ QNetworkAccessManager* httpClient;
};
void tst_QXmlInputSource::waitForReadyIODevice() const
diff --git a/tests/auto/xml/sax/qxmlsimplereader/generate_ref_files.sh b/tests/auto/xml/sax/qxmlsimplereader/generate_ref_files.sh
index ae2a5ffb5c..b9895f8598 100755
--- a/tests/auto/xml/sax/qxmlsimplereader/generate_ref_files.sh
+++ b/tests/auto/xml/sax/qxmlsimplereader/generate_ref_files.sh
@@ -1,7 +1,7 @@
#!/bin/bash
#############################################################################
##
-## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+## Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation (qt-info@nokia.com)
##
diff --git a/tests/auto/xml/sax/qxmlsimplereader/parser/main.cpp b/tests/auto/xml/sax/qxmlsimplereader/parser/main.cpp
index 05d9ce6754..840f237875 100644
--- a/tests/auto/xml/sax/qxmlsimplereader/parser/main.cpp
+++ b/tests/auto/xml/sax/qxmlsimplereader/parser/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp b/tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp
index d1f1c3cfda..0089951d30 100644
--- a/tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp
+++ b/tests/auto/xml/sax/qxmlsimplereader/parser/parser.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -124,7 +124,7 @@ bool ContentHandler::startDocument()
m_result += nestPrefix();
m_result += "startDocument()\n";
++m_nest;
- return TRUE;
+ return true;
}
bool ContentHandler::endDocument()
@@ -132,7 +132,7 @@ bool ContentHandler::endDocument()
--m_nest;
m_result += nestPrefix();
m_result += "endDocument()\n";
- return TRUE;
+ return true;
}
bool ContentHandler::startElement(const QString &namespaceURI,
@@ -146,7 +146,7 @@ bool ContentHandler::startElement(const QString &namespaceURI,
+ "\", qName=\"" + escapeStr(qName)
+ "\", atts=[" + formatAttributes(atts) + "])\n";
++m_nest;
- return TRUE;
+ return true;
}
QString ContentHandler::escapeStr(const QString &s)
@@ -183,14 +183,14 @@ bool ContentHandler::endElement(const QString &namespaceURI,
m_result += "endElement(namespaceURI=\"" + escapeStr(namespaceURI)
+ "\", localName=\"" + escapeStr(localName)
+ "\", qName=\"" + escapeStr(qName) + "\")\n";
- return TRUE;
+ return true;
}
bool ContentHandler::characters(const QString &ch)
{
m_result += nestPrefix();
m_result += "characters(ch=\"" + escapeStr(ch) + "\")\n";
- return TRUE;
+ return true;
}
void ContentHandler::setDocumentLocator(QXmlLocator *locator)
@@ -208,7 +208,7 @@ bool ContentHandler::startPrefixMapping (const QString &prefix, const QString &
m_result += "startPrefixMapping(prefix=\"" + escapeStr(prefix)
+ "\", uri=\"" + escapeStr(uri) + "\")\n";
++m_nest;
- return TRUE;
+ return true;
}
bool ContentHandler::endPrefixMapping(const QString &prefix)
@@ -216,14 +216,14 @@ bool ContentHandler::endPrefixMapping(const QString &prefix)
--m_nest;
m_result += nestPrefix();
m_result += "endPrefixMapping(prefix=\"" + escapeStr(prefix) + "\")\n";
- return TRUE;
+ return true;
}
bool ContentHandler::ignorableWhitespace(const QString & ch)
{
m_result += nestPrefix();
m_result += "ignorableWhitespace(ch=\"" + escapeStr(ch) + "\")\n";
- return TRUE;
+ return true;
}
bool ContentHandler::processingInstruction(const QString &target, const QString &data)
@@ -231,14 +231,14 @@ bool ContentHandler::processingInstruction(const QString &target, const QString
m_result += nestPrefix();
m_result += "processingInstruction(target=\"" + escapeStr(target)
+ "\", data=\"" + escapeStr(data) + "\")\n";
- return TRUE;
+ return true;
}
bool ContentHandler::skippedEntity (const QString & name)
{
m_result += nestPrefix();
m_result += "skippedEntity(name=\"" + escapeStr(name) + "\")\n";
- return TRUE;
+ return true;
}
bool ContentHandler::warning(const QXmlParseException & exception)
@@ -256,7 +256,7 @@ bool ContentHandler::warning(const QXmlParseException & exception)
+ "\", systemId=\"" + escapeStr(exception.systemId())
+ "\", message=\"" + escapeStr(exception.message())
+ "\"})\n";
- return TRUE;
+ return true;
}
bool ContentHandler::error(const QXmlParseException & exception)
@@ -274,7 +274,7 @@ bool ContentHandler::error(const QXmlParseException & exception)
+ "\", systemId=\"" + escapeStr(exception.systemId())
+ "\", message=\"" + escapeStr(exception.message())
+ "\"})\n";
- return TRUE;
+ return true;
}
bool ContentHandler::fatalError(const QXmlParseException & exception)
@@ -292,7 +292,7 @@ bool ContentHandler::fatalError(const QXmlParseException & exception)
+ "\", systemId=\"" + escapeStr(exception.systemId())
+ "\", message=\"" + escapeStr(exception.message())
+ "\"})\n";
- return TRUE;
+ return true;
}
bool ContentHandler::notationDecl ( const QString & name,
@@ -303,7 +303,7 @@ bool ContentHandler::notationDecl ( const QString & name,
m_result += "notationDecl(name=\"" + escapeStr(name) + "\", publicId=\""
+ escapeStr(publicId) + "\", systemId=\""
+ escapeStr(systemId) + "\")\n";
- return TRUE;
+ return true;
}
bool ContentHandler::unparsedEntityDecl ( const QString & name,
@@ -317,7 +317,7 @@ bool ContentHandler::unparsedEntityDecl ( const QString & name,
+ "\", systemId=\"" + escapeStr(systemId)
+ "\", notationName=\"" + escapeStr(notationName)
+ "\")\n";
- return TRUE;
+ return true;
}
bool ContentHandler::resolveEntity(const QString & publicId,
@@ -328,7 +328,7 @@ bool ContentHandler::resolveEntity(const QString & publicId,
m_result += "resolveEntity(publicId=\"" + escapeStr(publicId)
+ "\", systemId=\"" + escapeStr(systemId)
+ "\", ret={})\n";
- return TRUE;
+ return true;
}
bool ContentHandler::startDTD ( const QString & name, const QString & publicId, const QString & systemId )
@@ -338,7 +338,7 @@ bool ContentHandler::startDTD ( const QString & name, const QString & publicId,
+ "\", publicId=\"" + escapeStr(publicId)
+ "\", systemId=\"" + escapeStr(systemId) + "\")\n";
++m_nest;
- return TRUE;
+ return true;
}
bool ContentHandler::endDTD ()
@@ -346,7 +346,7 @@ bool ContentHandler::endDTD ()
--m_nest;
m_result += nestPrefix();
m_result += "endDTD()\n";
- return TRUE;
+ return true;
}
bool ContentHandler::startEntity ( const QString & name )
@@ -354,7 +354,7 @@ bool ContentHandler::startEntity ( const QString & name )
m_result += nestPrefix();
m_result += "startEntity(name=\"" + escapeStr(name) + "\")\n";
++m_nest;
- return TRUE;
+ return true;
}
bool ContentHandler::endEntity ( const QString & name )
@@ -362,7 +362,7 @@ bool ContentHandler::endEntity ( const QString & name )
--m_nest;
m_result += nestPrefix();
m_result += "endEntity(name=\"" + escapeStr(name) + "\")\n";
- return TRUE;
+ return true;
}
bool ContentHandler::startCDATA ()
@@ -370,7 +370,7 @@ bool ContentHandler::startCDATA ()
m_result += nestPrefix();
m_result += "startCDATA()\n";
++m_nest;
- return TRUE;
+ return true;
}
bool ContentHandler::endCDATA ()
@@ -378,14 +378,14 @@ bool ContentHandler::endCDATA ()
--m_nest;
m_result += nestPrefix();
m_result += "endCDATA()\n";
- return TRUE;
+ return true;
}
bool ContentHandler::comment ( const QString & ch )
{
m_result += nestPrefix();
m_result += "comment(ch=\"" + escapeStr(ch) + "\")\n";
- return TRUE;
+ return true;
}
bool ContentHandler::attributeDecl ( const QString & eName,
@@ -399,7 +399,7 @@ bool ContentHandler::attributeDecl ( const QString & eName,
+ escapeStr(aName) + "\", type=\"" + escapeStr(type)
+ "\", valueDefault=\"" + escapeStr(valueDefault)
+ "\", value=\"" + escapeStr(value) + "\")\n";
- return TRUE;
+ return true;
}
bool ContentHandler::internalEntityDecl ( const QString & name,
@@ -408,7 +408,7 @@ bool ContentHandler::internalEntityDecl ( const QString & name,
m_result += nestPrefix();
m_result += "internatlEntityDecl(name=\"" + escapeStr(name)
+ "\", value=\"" + escapeStr(value) + "\")\n";
- return TRUE;
+ return true;
}
bool ContentHandler::externalEntityDecl ( const QString & name,
@@ -419,7 +419,7 @@ bool ContentHandler::externalEntityDecl ( const QString & name,
m_result += "externalEntityDecl(name=\"" + escapeStr(name)
+ "\", publicId=\"" + escapeStr(publicId)
+ "\", systemId=\"" + escapeStr(systemId) + "\")\n";
- return TRUE;
+ return true;
}
Parser::Parser()
diff --git a/tests/auto/xml/sax/qxmlsimplereader/parser/parser.h b/tests/auto/xml/sax/qxmlsimplereader/parser/parser.h
index e3d95ce811..e91ec53d5a 100644
--- a/tests/auto/xml/sax/qxmlsimplereader/parser/parser.h
+++ b/tests/auto/xml/sax/qxmlsimplereader/parser/parser.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp b/tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp
index 5447e6f0eb..1478ae7e23 100644
--- a/tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp
+++ b/tests/auto/xml/sax/qxmlsimplereader/tst_qxmlsimplereader.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/baselineserver/shared/baselineprotocol.cpp b/tests/baselineserver/shared/baselineprotocol.cpp
index e1ac2bddbd..e9adfae691 100644
--- a/tests/baselineserver/shared/baselineprotocol.cpp
+++ b/tests/baselineserver/shared/baselineprotocol.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/baselineserver/shared/baselineprotocol.h b/tests/baselineserver/shared/baselineprotocol.h
index ffdbb39d67..cd40a1241b 100644
--- a/tests/baselineserver/shared/baselineprotocol.h
+++ b/tests/baselineserver/shared/baselineprotocol.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/baselineserver/shared/lookup3.cpp b/tests/baselineserver/shared/lookup3.cpp
index 1ad2d371c4..4db5b3c622 100644
--- a/tests/baselineserver/shared/lookup3.cpp
+++ b/tests/baselineserver/shared/lookup3.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/baselineserver/shared/qbaselinetest.cpp b/tests/baselineserver/shared/qbaselinetest.cpp
index de3150e080..6e2491054c 100644
--- a/tests/baselineserver/shared/qbaselinetest.cpp
+++ b/tests/baselineserver/shared/qbaselinetest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/baselineserver/shared/qbaselinetest.h b/tests/baselineserver/shared/qbaselinetest.h
index 8594799447..84d40477b1 100644
--- a/tests/baselineserver/shared/qbaselinetest.h
+++ b/tests/baselineserver/shared/qbaselinetest.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/baselineserver/src/baselineserver.cpp b/tests/baselineserver/src/baselineserver.cpp
index 5ac78d4b32..7adc335fb2 100644
--- a/tests/baselineserver/src/baselineserver.cpp
+++ b/tests/baselineserver/src/baselineserver.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -101,7 +101,7 @@ QString BaselineServer::settingsFilePath()
return settingsFile;
}
-void BaselineServer::incomingConnection(int socketDescriptor)
+void BaselineServer::incomingConnection(qintptr socketDescriptor)
{
QString runId = QDateTime::currentDateTime().toString(QLS("MMMdd-hhmmss"));
if (runId == lastRunId) {
diff --git a/tests/baselineserver/src/baselineserver.h b/tests/baselineserver/src/baselineserver.h
index 333d9ed30b..a6065cc099 100644
--- a/tests/baselineserver/src/baselineserver.h
+++ b/tests/baselineserver/src/baselineserver.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -69,7 +69,7 @@ public:
static QString settingsFilePath();
protected:
- void incomingConnection(int socketDescriptor);
+ void incomingConnection(qintptr socketDescriptor);
private slots:
void heartbeat();
diff --git a/tests/baselineserver/src/main.cpp b/tests/baselineserver/src/main.cpp
index 8e5fa4e669..685e853575 100644
--- a/tests/baselineserver/src/main.cpp
+++ b/tests/baselineserver/src/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/baselineserver/src/report.cpp b/tests/baselineserver/src/report.cpp
index 16f061c7e7..a726149d6a 100644
--- a/tests/baselineserver/src/report.cpp
+++ b/tests/baselineserver/src/report.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/baselineserver/src/report.h b/tests/baselineserver/src/report.h
index 610497c84b..b4488f1489 100644
--- a/tests/baselineserver/src/report.h
+++ b/tests/baselineserver/src/report.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/codecs/qtextcodec/main.cpp b/tests/benchmarks/corelib/codecs/qtextcodec/main.cpp
index 995b606892..1499eccd50 100644
--- a/tests/benchmarks/corelib/codecs/qtextcodec/main.cpp
+++ b/tests/benchmarks/corelib/codecs/qtextcodec/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp b/tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp
index 8f07587371..8f11dc792e 100644
--- a/tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp
+++ b/tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/io/qdir/tree/bench_qdir_tree.cpp b/tests/benchmarks/corelib/io/qdir/tree/bench_qdir_tree.cpp
index 40a5d75f3f..9d7d60ebe0 100644
--- a/tests/benchmarks/corelib/io/qdir/tree/bench_qdir_tree.cpp
+++ b/tests/benchmarks/corelib/io/qdir/tree/bench_qdir_tree.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/io/qdiriterator/main.cpp b/tests/benchmarks/corelib/io/qdiriterator/main.cpp
index cecd0de1da..4e4b9cbf0b 100644
--- a/tests/benchmarks/corelib/io/qdiriterator/main.cpp
+++ b/tests/benchmarks/corelib/io/qdiriterator/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro b/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
index af3be799c6..af3be799c6 100755..100644
--- a/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
+++ b/tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
diff --git a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp
index 8c9f1cc423..584eb32021 100644
--- a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp
+++ b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.h b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.h
index 7e674e38e2..bef8115287 100644
--- a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.h
+++ b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/io/qfile/main.cpp b/tests/benchmarks/corelib/io/qfile/main.cpp
index 11cd5c76b2..d291e3f412 100644
--- a/tests/benchmarks/corelib/io/qfile/main.cpp
+++ b/tests/benchmarks/corelib/io/qfile/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/io/qfileinfo/main.cpp b/tests/benchmarks/corelib/io/qfileinfo/main.cpp
index 42220bf09a..479737a353 100644
--- a/tests/benchmarks/corelib/io/qfileinfo/main.cpp
+++ b/tests/benchmarks/corelib/io/qfileinfo/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/io/qiodevice/main.cpp b/tests/benchmarks/corelib/io/qiodevice/main.cpp
index f9e04a2204..e4244a71ef 100644
--- a/tests/benchmarks/corelib/io/qiodevice/main.cpp
+++ b/tests/benchmarks/corelib/io/qiodevice/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/io/qiodevice/qiodevice.pro b/tests/benchmarks/corelib/io/qiodevice/qiodevice.pro
index 0dff0ce86e..0dff0ce86e 100755..100644
--- a/tests/benchmarks/corelib/io/qiodevice/qiodevice.pro
+++ b/tests/benchmarks/corelib/io/qiodevice/qiodevice.pro
diff --git a/tests/benchmarks/corelib/io/qtemporaryfile/main.cpp b/tests/benchmarks/corelib/io/qtemporaryfile/main.cpp
index c9f3a84365..c0f16068d7 100644
--- a/tests/benchmarks/corelib/io/qtemporaryfile/main.cpp
+++ b/tests/benchmarks/corelib/io/qtemporaryfile/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/io/qurl/main.cpp b/tests/benchmarks/corelib/io/qurl/main.cpp
index 7e5035f250..c92c841cc8 100644
--- a/tests/benchmarks/corelib/io/qurl/main.cpp
+++ b/tests/benchmarks/corelib/io/qurl/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/kernel/events/main.cpp b/tests/benchmarks/corelib/kernel/events/main.cpp
index 1b51b087b3..09f37616be 100644
--- a/tests/benchmarks/corelib/kernel/events/main.cpp
+++ b/tests/benchmarks/corelib/kernel/events/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/kernel/kernel.pro b/tests/benchmarks/corelib/kernel/kernel.pro
index da3f0d609f..8b7d8c8f90 100644
--- a/tests/benchmarks/corelib/kernel/kernel.pro
+++ b/tests/benchmarks/corelib/kernel/kernel.pro
@@ -4,4 +4,5 @@ SUBDIRS = \
qmetaobject \
qmetatype \
qobject \
- qvariant
+ qvariant \
+ qcoreapplication
diff --git a/tests/benchmarks/corelib/kernel/qcoreapplication/main.cpp b/tests/benchmarks/corelib/kernel/qcoreapplication/main.cpp
new file mode 100644
index 0000000000..e1e4e2cc9a
--- /dev/null
+++ b/tests/benchmarks/corelib/kernel/qcoreapplication/main.cpp
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Robin Burchell <robin+qt@viroteck.net>
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QtCore>
+#include <qtest.h>
+#include <qcoreapplication.h>
+
+class QCoreApplicationBenchmark : public QObject
+{
+Q_OBJECT
+private slots:
+ void event_posting_benchmark_data();
+ void event_posting_benchmark();
+};
+
+void QCoreApplicationBenchmark::event_posting_benchmark_data()
+{
+ QTest::addColumn<int>("size");
+ QTest::newRow("50 events") << 50;
+ QTest::newRow("100 events") << 100;
+ QTest::newRow("200 events") << 200;
+ QTest::newRow("1000 events") << 1000;
+ QTest::newRow("10000 events") << 10000;
+ QTest::newRow("100000 events") << 100000;
+ QTest::newRow("1000000 events") << 1000000;
+}
+
+void QCoreApplicationBenchmark::event_posting_benchmark()
+{
+ QFETCH(int, size);
+
+ int type = QEvent::registerEventType();
+ QCoreApplication *app = QCoreApplication::instance();
+
+ // benchmark posting & sending events
+ QBENCHMARK {
+ for (int i = 0; i < size; ++i)
+ QCoreApplication::postEvent(app, new QEvent(QEvent::Type(type)));
+ QCoreApplication::sendPostedEvents();
+ }
+}
+
+QTEST_MAIN(QCoreApplicationBenchmark)
+
+#include "main.moc"
diff --git a/tests/benchmarks/corelib/kernel/qcoreapplication/qcoreapplication.pro b/tests/benchmarks/corelib/kernel/qcoreapplication/qcoreapplication.pro
new file mode 100644
index 0000000000..2c29fafca4
--- /dev/null
+++ b/tests/benchmarks/corelib/kernel/qcoreapplication/qcoreapplication.pro
@@ -0,0 +1,9 @@
+QT += testlib
+
+TEMPLATE = app
+TARGET = tst_bench_qcoreapplication
+DEPENDPATH += .
+INCLUDEPATH += .
+
+# Input
+SOURCES += main.cpp
diff --git a/tests/benchmarks/corelib/kernel/qmetaobject/main.cpp b/tests/benchmarks/corelib/kernel/qmetaobject/main.cpp
index 4214a41f5c..8b68f032ea 100644
--- a/tests/benchmarks/corelib/kernel/qmetaobject/main.cpp
+++ b/tests/benchmarks/corelib/kernel/qmetaobject/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp
index 36c88ea251..cee747316f 100644
--- a/tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp
+++ b/tests/benchmarks/corelib/kernel/qmetatype/tst_qmetatype.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/kernel/qobject/main.cpp b/tests/benchmarks/corelib/kernel/qobject/main.cpp
index 13ba073eb4..905b21fca0 100644
--- a/tests/benchmarks/corelib/kernel/qobject/main.cpp
+++ b/tests/benchmarks/corelib/kernel/qobject/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/kernel/qobject/object.cpp b/tests/benchmarks/corelib/kernel/qobject/object.cpp
index 1c4a558b29..0b036d0139 100644
--- a/tests/benchmarks/corelib/kernel/qobject/object.cpp
+++ b/tests/benchmarks/corelib/kernel/qobject/object.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/kernel/qobject/object.h b/tests/benchmarks/corelib/kernel/qobject/object.h
index 707455e67c..c3cd23d6be 100644
--- a/tests/benchmarks/corelib/kernel/qobject/object.h
+++ b/tests/benchmarks/corelib/kernel/qobject/object.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp
index 7dec7a8e74..151e78e5ce 100644
--- a/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp
+++ b/tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject/tst_qtimer_vs_qmetaobject.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp
index 85d14b99b6..00e2684066 100644
--- a/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp
+++ b/tests/benchmarks/corelib/kernel/qvariant/tst_qvariant.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp b/tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp
index a035cf3627..9e33655d18 100644
--- a/tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp
+++ b/tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -60,6 +60,8 @@ private slots:
void fromByteArray();
void toRfc4122();
void fromRfc4122();
+ void createUuidV3();
+ void createUuidV5();
void toDataStream();
void fromDataStream();
void isNull();
@@ -129,6 +131,24 @@ void tst_bench_QUuid::fromRfc4122()
}
}
+void tst_bench_QUuid::createUuidV3()
+{
+ QUuid ns = QUuid::createUuid();
+ QByteArray name = QByteArray("Test");
+ QBENCHMARK {
+ QUuid uuid = QUuid::createUuidV3(ns, name);
+ }
+}
+
+void tst_bench_QUuid::createUuidV5()
+{
+ QUuid ns = QUuid::createUuid();
+ QByteArray name = QByteArray("Test");
+ QBENCHMARK {
+ QUuid uuid = QUuid::createUuidV5(ns, name);
+ }
+}
+
void tst_bench_QUuid::toDataStream()
{
QUuid uuid1, uuid2;
diff --git a/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp b/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp
index 6f6085b7c7..9310a3dec8 100644
--- a/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp
+++ b/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp b/tests/benchmarks/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
index 7ded3a350d..6372b7a830 100644
--- a/tests/benchmarks/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
+++ b/tests/benchmarks/corelib/thread/qthreadstorage/tst_qthreadstorage.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp b/tests/benchmarks/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
index 6f77831acd..729b14067e 100644
--- a/tests/benchmarks/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
+++ b/tests/benchmarks/corelib/thread/qwaitcondition/tst_qwaitcondition.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/tools/containers-associative/main.cpp b/tests/benchmarks/corelib/tools/containers-associative/main.cpp
index 1b5536f0e5..3e9dfe3568 100644
--- a/tests/benchmarks/corelib/tools/containers-associative/main.cpp
+++ b/tests/benchmarks/corelib/tools/containers-associative/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/tools/containers-sequential/main.cpp b/tests/benchmarks/corelib/tools/containers-sequential/main.cpp
index ebcc0202ff..ae05a164a2 100644
--- a/tests/benchmarks/corelib/tools/containers-sequential/main.cpp
+++ b/tests/benchmarks/corelib/tools/containers-sequential/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/tools/qbytearray/main.cpp b/tests/benchmarks/corelib/tools/qbytearray/main.cpp
index 2c9b9d0638..61a7855884 100644
--- a/tests/benchmarks/corelib/tools/qbytearray/main.cpp
+++ b/tests/benchmarks/corelib/tools/qbytearray/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/tools/qbytearray/qbytearray.pro b/tests/benchmarks/corelib/tools/qbytearray/qbytearray.pro
index 10fdc7261e..10fdc7261e 100755..100644
--- a/tests/benchmarks/corelib/tools/qbytearray/qbytearray.pro
+++ b/tests/benchmarks/corelib/tools/qbytearray/qbytearray.pro
diff --git a/tests/benchmarks/corelib/tools/qchar/main.cpp b/tests/benchmarks/corelib/tools/qchar/main.cpp
index 5dcea7e03f..3abf7584bb 100644
--- a/tests/benchmarks/corelib/tools/qchar/main.cpp
+++ b/tests/benchmarks/corelib/tools/qchar/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/tools/qcontiguouscache/main.cpp b/tests/benchmarks/corelib/tools/qcontiguouscache/main.cpp
index 85b9e1d9aa..b6b064e012 100644
--- a/tests/benchmarks/corelib/tools/qcontiguouscache/main.cpp
+++ b/tests/benchmarks/corelib/tools/qcontiguouscache/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/tools/qhash/outofline.cpp b/tests/benchmarks/corelib/tools/qhash/outofline.cpp
index df7ff26dea..11a5f9e733 100644
--- a/tests/benchmarks/corelib/tools/qhash/outofline.cpp
+++ b/tests/benchmarks/corelib/tools/qhash/outofline.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/tools/qhash/qhash_string.cpp b/tests/benchmarks/corelib/tools/qhash/qhash_string.cpp
index c107633451..874a0c543a 100644
--- a/tests/benchmarks/corelib/tools/qhash/qhash_string.cpp
+++ b/tests/benchmarks/corelib/tools/qhash/qhash_string.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/tools/qhash/qhash_string.h b/tests/benchmarks/corelib/tools/qhash/qhash_string.h
index cde42ae32d..94f142914b 100644
--- a/tests/benchmarks/corelib/tools/qhash/qhash_string.h
+++ b/tests/benchmarks/corelib/tools/qhash/qhash_string.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/tools/qlist/main.cpp b/tests/benchmarks/corelib/tools/qlist/main.cpp
index 22aaf49861..d3380b188c 100644
--- a/tests/benchmarks/corelib/tools/qlist/main.cpp
+++ b/tests/benchmarks/corelib/tools/qlist/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/tools/qrect/main.cpp b/tests/benchmarks/corelib/tools/qrect/main.cpp
index 8f015ab353..59174e4f08 100644
--- a/tests/benchmarks/corelib/tools/qrect/main.cpp
+++ b/tests/benchmarks/corelib/tools/qrect/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/tools/qregexp/main.cpp b/tests/benchmarks/corelib/tools/qregexp/main.cpp
index c6cfb1cc1b..32e8e72577 100644
--- a/tests/benchmarks/corelib/tools/qregexp/main.cpp
+++ b/tests/benchmarks/corelib/tools/qregexp/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/tools/qstring/data.h b/tests/benchmarks/corelib/tools/qstring/data.h
index 3f3fcd8321..925ce3663a 100644
--- a/tests/benchmarks/corelib/tools/qstring/data.h
+++ b/tests/benchmarks/corelib/tools/qstring/data.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/tools/qstring/generatelist.pl b/tests/benchmarks/corelib/tools/qstring/generatelist.pl
index 1a29db4b47..1f10b638b2 100644
--- a/tests/benchmarks/corelib/tools/qstring/generatelist.pl
+++ b/tests/benchmarks/corelib/tools/qstring/generatelist.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+## Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation (qt-info@nokia.com)
##
diff --git a/tests/benchmarks/corelib/tools/qstring/generatelist_char.pl b/tests/benchmarks/corelib/tools/qstring/generatelist_char.pl
index 13b49314c3..ad6595ab5c 100644
--- a/tests/benchmarks/corelib/tools/qstring/generatelist_char.pl
+++ b/tests/benchmarks/corelib/tools/qstring/generatelist_char.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
# -*- mode: utf-8; tabs: nil -*-
-## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+## Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation (qt-info@nokia.com)
##
diff --git a/tests/benchmarks/corelib/tools/qstring/main.cpp b/tests/benchmarks/corelib/tools/qstring/main.cpp
index 640bd7a625..ab23fa5f9b 100644
--- a/tests/benchmarks/corelib/tools/qstring/main.cpp
+++ b/tests/benchmarks/corelib/tools/qstring/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -75,6 +75,13 @@ private slots:
void fromLatin1Alternatives() const;
void fromUtf8Alternatives_data() const;
void fromUtf8Alternatives() const;
+
+ void toUpper_data();
+ void toUpper();
+ void toLower_data();
+ void toLower();
+ void toCaseFolded_data();
+ void toCaseFolded();
};
void tst_QString::equals() const
@@ -2601,6 +2608,89 @@ void tst_QString::fromUtf8Alternatives() const
}
}
-QTEST_MAIN(tst_QString)
+void tst_QString::toUpper_data()
+{
+ QTest::addColumn<QString>("s");
+
+ QString lowerLatin1(300, QChar('a'));
+ QString upperLatin1(300, QChar('A'));
+
+ QString lowerDeseret;
+ {
+ QString pattern;
+ pattern += QChar(QChar::highSurrogate(0x10428));
+ pattern += QChar(QChar::lowSurrogate(0x10428));
+ for (int i = 0; i < 300 / pattern.size(); ++i)
+ lowerDeseret += pattern;
+ }
+ QString upperDeseret;
+ {
+ QString pattern;
+ pattern += QChar(QChar::highSurrogate(0x10400));
+ pattern += QChar(QChar::lowSurrogate(0x10400));
+ for (int i = 0; i < 300 / pattern.size(); ++i)
+ upperDeseret += pattern;
+ }
+
+ QString lowerLigature(600, QChar(0xFB03));
+
+ QTest::newRow("600<a>") << (lowerLatin1 + lowerLatin1);
+ QTest::newRow("600<A>") << (upperLatin1 + upperLatin1);
+
+ QTest::newRow("300<a>+300<A>") << (lowerLatin1 + upperLatin1);
+ QTest::newRow("300<A>+300<a>") << (upperLatin1 + lowerLatin1);
+
+ QTest::newRow("300<10428>") << (lowerDeseret + lowerDeseret);
+ QTest::newRow("300<10400>") << (upperDeseret + upperDeseret);
+
+ QTest::newRow("150<10428>+150<10400>") << (lowerDeseret + upperDeseret);
+ QTest::newRow("150<10400>+150<10428>") << (upperDeseret + lowerDeseret);
+
+ QTest::newRow("300a+150<10400>") << (lowerLatin1 + upperDeseret);
+ QTest::newRow("300a+150<10428>") << (lowerLatin1 + lowerDeseret);
+ QTest::newRow("300A+150<10400>") << (upperLatin1 + upperDeseret);
+ QTest::newRow("300A+150<10428>") << (upperLatin1 + lowerDeseret);
+
+ QTest::newRow("600<FB03> (ligature)") << lowerLigature;
+}
+
+void tst_QString::toUpper()
+{
+ QFETCH(QString, s);
+
+ QBENCHMARK {
+ s.toUpper();
+ }
+}
+
+void tst_QString::toLower_data()
+{
+ toUpper_data();
+}
+
+void tst_QString::toLower()
+{
+ QFETCH(QString, s);
+
+ QBENCHMARK {
+ s.toLower();
+ }
+}
+
+void tst_QString::toCaseFolded_data()
+{
+ toUpper_data();
+}
+
+void tst_QString::toCaseFolded()
+{
+ QFETCH(QString, s);
+
+ QBENCHMARK {
+ s.toCaseFolded();
+ }
+}
+
+QTEST_APPLESS_MAIN(tst_QString)
#include "main.moc"
diff --git a/tests/benchmarks/corelib/tools/qstringbuilder/main.cpp b/tests/benchmarks/corelib/tools/qstringbuilder/main.cpp
index 7f936181a2..b1ec5dace8 100644
--- a/tests/benchmarks/corelib/tools/qstringbuilder/main.cpp
+++ b/tests/benchmarks/corelib/tools/qstringbuilder/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/tools/qstringlist/main.cpp b/tests/benchmarks/corelib/tools/qstringlist/main.cpp
index a77cf87f73..696f0fc6da 100644
--- a/tests/benchmarks/corelib/tools/qstringlist/main.cpp
+++ b/tests/benchmarks/corelib/tools/qstringlist/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/tools/qvector/main.cpp b/tests/benchmarks/corelib/tools/qvector/main.cpp
index 416155d52b..38c1f4ac46 100644
--- a/tests/benchmarks/corelib/tools/qvector/main.cpp
+++ b/tests/benchmarks/corelib/tools/qvector/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/tools/qvector/outofline.cpp b/tests/benchmarks/corelib/tools/qvector/outofline.cpp
index 544d738bdf..a30a7e786a 100644
--- a/tests/benchmarks/corelib/tools/qvector/outofline.cpp
+++ b/tests/benchmarks/corelib/tools/qvector/outofline.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/corelib/tools/qvector/qrawvector.h b/tests/benchmarks/corelib/tools/qvector/qrawvector.h
index 2cdabb30c5..3bd75164d5 100644
--- a/tests/benchmarks/corelib/tools/qvector/qrawvector.h
+++ b/tests/benchmarks/corelib/tools/qvector/qrawvector.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -527,7 +527,7 @@ void QRawVector<T>::append(const T &t)
}
template <typename T>
-Q_TYPENAME QRawVector<T>::iterator QRawVector<T>::insert(iterator before, size_type n, const T &t)
+typename QRawVector<T>::iterator QRawVector<T>::insert(iterator before, size_type n, const T &t)
{
int offset = int(before - m_begin);
if (n != 0) {
@@ -561,7 +561,7 @@ Q_TYPENAME QRawVector<T>::iterator QRawVector<T>::insert(iterator before, size_t
}
template <typename T>
-Q_TYPENAME QRawVector<T>::iterator QRawVector<T>::erase(iterator abegin, iterator aend)
+typename QRawVector<T>::iterator QRawVector<T>::erase(iterator abegin, iterator aend)
{
int f = int(abegin - m_begin);
int l = int(aend - m_begin);
diff --git a/tests/benchmarks/dbus/qdbusperformance/server/server.cpp b/tests/benchmarks/dbus/qdbusperformance/server/server.cpp
index 3731be5fc4..d3c6f1f5ac 100644
--- a/tests/benchmarks/dbus/qdbusperformance/server/server.cpp
+++ b/tests/benchmarks/dbus/qdbusperformance/server/server.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/dbus/qdbusperformance/serverobject.h b/tests/benchmarks/dbus/qdbusperformance/serverobject.h
index 4e554e0fbf..dd4d9f4735 100644
--- a/tests/benchmarks/dbus/qdbusperformance/serverobject.h
+++ b/tests/benchmarks/dbus/qdbusperformance/serverobject.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/dbus/qdbusperformance/tst_qdbusperformance.cpp b/tests/benchmarks/dbus/qdbusperformance/tst_qdbusperformance.cpp
index 216d1819f7..116268835a 100644
--- a/tests/benchmarks/dbus/qdbusperformance/tst_qdbusperformance.cpp
+++ b/tests/benchmarks/dbus/qdbusperformance/tst_qdbusperformance.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/dbus/qdbustype/main.cpp b/tests/benchmarks/dbus/qdbustype/main.cpp
index 7c38fe594c..476bdc81c7 100644
--- a/tests/benchmarks/dbus/qdbustype/main.cpp
+++ b/tests/benchmarks/dbus/qdbustype/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/animation/qanimation/dummyanimation.cpp b/tests/benchmarks/gui/animation/qanimation/dummyanimation.cpp
index a190a0337a..f7d085f759 100644
--- a/tests/benchmarks/gui/animation/qanimation/dummyanimation.cpp
+++ b/tests/benchmarks/gui/animation/qanimation/dummyanimation.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -55,7 +55,8 @@ void DummyAnimation::updateCurrentValue(const QVariant &value)
m_dummy->setRect(value.toRect());
}
-void DummyAnimation::updateState(State state)
+void DummyAnimation::updateState(State newstate, State oldstate)
{
- Q_UNUSED(state);
+ Q_UNUSED(newstate);
+ Q_UNUSED(oldstate);
}
diff --git a/tests/benchmarks/gui/animation/qanimation/dummyanimation.h b/tests/benchmarks/gui/animation/qanimation/dummyanimation.h
index ecd4e0189e..caccebffc2 100644
--- a/tests/benchmarks/gui/animation/qanimation/dummyanimation.h
+++ b/tests/benchmarks/gui/animation/qanimation/dummyanimation.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -51,7 +51,7 @@ public:
DummyAnimation(DummyObject *d);
void updateCurrentValue(const QVariant &value);
- void updateState(State state);
+ void updateState(State newstate, State oldstate);
private:
DummyObject *m_dummy;
diff --git a/tests/benchmarks/gui/animation/qanimation/dummyobject.cpp b/tests/benchmarks/gui/animation/qanimation/dummyobject.cpp
index 305cf58df0..c0c163214b 100644
--- a/tests/benchmarks/gui/animation/qanimation/dummyobject.cpp
+++ b/tests/benchmarks/gui/animation/qanimation/dummyobject.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/animation/qanimation/dummyobject.h b/tests/benchmarks/gui/animation/qanimation/dummyobject.h
index 39c8769468..0da4aa60e1 100644
--- a/tests/benchmarks/gui/animation/qanimation/dummyobject.h
+++ b/tests/benchmarks/gui/animation/qanimation/dummyobject.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/animation/qanimation/main.cpp b/tests/benchmarks/gui/animation/qanimation/main.cpp
index 9c016ba765..2ca58bd66b 100644
--- a/tests/benchmarks/gui/animation/qanimation/main.cpp
+++ b/tests/benchmarks/gui/animation/qanimation/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/animation/qanimation/rectanimation.cpp b/tests/benchmarks/gui/animation/qanimation/rectanimation.cpp
index 3443850bea..aa64b19ca0 100644
--- a/tests/benchmarks/gui/animation/qanimation/rectanimation.cpp
+++ b/tests/benchmarks/gui/animation/qanimation/rectanimation.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/animation/qanimation/rectanimation.h b/tests/benchmarks/gui/animation/qanimation/rectanimation.h
index e0bb07f063..d8b20d5e6e 100644
--- a/tests/benchmarks/gui/animation/qanimation/rectanimation.h
+++ b/tests/benchmarks/gui/animation/qanimation/rectanimation.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/main.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/main.cpp
index e8019a946a..8565e1bff1 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/main.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.cpp
index bc6fa32050..864d2889c2 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.h
index 956c442fb4..f12bf84cbc 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp
index 71b9bf1f77..82e7954145 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.h
index 815f9c5098..97c2bd88e4 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.cpp
index a0dde8a299..b88ccb53f7 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.h
index 8aaeebc0f5..97269badf1 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractscrollarea.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.cpp
index b4bb4b3bb7..993a533b38 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.h
index ad17f65cee..c1628845f5 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.cpp
index 1d18942b01..ec3f4c0093 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.h
index e638034132..c9b154313a 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/backgrounditem.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/button.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/button.cpp
index 97b39fdb34..34737266b3 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/button.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/button.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/button.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/button.h
index 88dc33c956..cb4b1853c1 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/button.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/button.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.cpp
index b6592742bf..622cb22d5a 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.h
index efad458d20..cbfc63937b 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/commandline.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.cpp
index d6528f5e47..60bebefcf2 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.h
index 4e8ae93fe1..75e75235bc 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/dummydatagen.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.cpp
index 7731c3f446..cfa8ff63a8 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.h
index 5682db021f..d26641a4c3 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/gvbwidget.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.cpp
index 37198a3a91..53a745ba6a 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.h
index 7bb6034249..818b480849 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp
index 4ccdc4fa9d..6f3417e7c8 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.h
index e9c73e7875..87ce134267 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.cpp
index 628202be0c..96c1e8cb47 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.h
index cb3f936f8f..119633b557 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.cpp
index c0cd5018db..8f6a42dbca 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.h
index 8b71f27107..d203085cf7 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.cpp
index b68b347640..baeafaf6f3 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.h
index 6676cc992e..9bd6157710 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.cpp
index 3af5685916..b94097b21c 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.h
index f646f03922..cee8f67870 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcache.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.cpp
index e35f931c0a..c7a088a730 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.h
index afd7c256b3..6e9aab4417 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.cpp
index 7ff6c11eb9..aead236e84 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.h
index dc6b3a6fbe..cd0a7a5228 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listmodel.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.cpp
index 2371750efa..9d6bcc98d1 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.h
index 70708751ff..0e6593d6f3 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp
index 2520d0ddc3..d8f3445d36 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.h
index 71c565e16f..17a3505b8e 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.cpp
index 90b2ceabad..7757bcc616 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.h
index ea9eb7d736..ea95a079cd 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/menu.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.cpp
index ac01927442..9ee649438f 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.h
index 78d95198d2..a70eb19303 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/recycledlistitem.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/resourcemoninterface.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/resourcemoninterface.h
index 42b36f1595..04ab2fe229 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/resourcemoninterface.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/resourcemoninterface.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.cpp
index b74f0d8210..54236325d1 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.h
index 66aa4703fd..7d05f858f3 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scrollbar.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.cpp
index 9b70cab5c9..c45a880a8e 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.h
index 73dbb2c9fe..fb7162265d 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller_p.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller_p.h
index f7e807e374..bfb83757b0 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller_p.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/scroller_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.cpp
index 8cd1df1abb..ba153180e6 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.h
index b6184f26dc..0635231cb5 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/settings.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp
index 818822de27..be8c9d22ea 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.h
index e93d3ad5af..9a84407aed 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp
index 0fd1eded63..1dba139fd2 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.h
index df0de040b2..5c7367991a 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.cpp
index ca96816573..76fd265986 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.h
index f5373e0748..1b9e6e047c 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.cpp
index f8c945c091..4cdd7f0123 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.h
index 8ee86121e6..86e2f1b0e8 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/themeevent.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.cpp
index ff75adb7cc..09ff5d1394 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.h
index 8c85fa108e..c9ab96fbe8 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/topbar.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/webview.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/webview.cpp
index 1413585e15..cfff4903fd 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/webview.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/webview.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/webview.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/webview.h
index 48f0104b91..9fad826363 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/webview.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/webview.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/webview_p.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/webview_p.h
index ae22835545..1a3a1613c1 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/webview_p.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/webview_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
index 7475de1f0c..5f826a0141 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
index df2d39288f..f0cdbe29c5 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp b/tests/benchmarks/gui/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
index 055e4e395b..83ab96e5c3 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp b/tests/benchmarks/gui/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
index 629cd10c61..b52336dcd6 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
index fd0e89e17f..e713ecf03f 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.cpp
index de41358aae..f82b66f4fa 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.h b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.h
index b6338d9916..49fccb42e5 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.h
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/chip.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/main.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/main.cpp
index 2cb7990741..04aaa8b54b 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/main.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.cpp
index 4c6289ea95..f755976d55 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.h b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.h
index 56edfcd066..7042cb5bb3 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.h
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/mainwindow.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp
index 90a8a25ebe..7ea4ffbe00 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/view.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/view.h b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/view.h
index 206d9fbf0f..9e22a98c32 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/view.h
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/chipTest/view.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp
index fd5317bea6..d02b034834 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/moveItems/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp
index 4aec0baed5..0b2e87fcaf 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/benchapps/scrolltest/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chip.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chip.cpp
index 62ddcfc5ef..71e69fed9f 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chip.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chip.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chip.h b/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chip.h
index 3e4ef6fe24..3ef2ef546f 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chip.h
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chip.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.cpp
index c6167e50cb..f106cbe4e3 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.h b/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.h
index bcab432092..debb78ffbf 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.h
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/chiptester/chiptester.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index 04d48f19e0..dd1d7a3934 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/benchmarks/gui/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
index 756ded7d75..08e7c88a76 100644
--- a/tests/benchmarks/gui/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/benchmarks/gui/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/image/blendbench/main.cpp b/tests/benchmarks/gui/image/blendbench/main.cpp
index 062b91ef20..24cfba9012 100644
--- a/tests/benchmarks/gui/image/blendbench/main.cpp
+++ b/tests/benchmarks/gui/image/blendbench/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp b/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp
index 73272d279f..7be221a5ec 100644
--- a/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp
+++ b/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/image/qimagereader/tst_qimagereader.cpp b/tests/benchmarks/gui/image/qimagereader/tst_qimagereader.cpp
index 1f904a355f..363e7df5ac 100644
--- a/tests/benchmarks/gui/image/qimagereader/tst_qimagereader.cpp
+++ b/tests/benchmarks/gui/image/qimagereader/tst_qimagereader.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp b/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp
index 904177bff7..110bcbbca4 100644
--- a/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp
+++ b/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp b/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp
index f2189b1cbd..fa169cb0b1 100644
--- a/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp
+++ b/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/itemviews/qtableview/tst_qtableview.cpp b/tests/benchmarks/gui/itemviews/qtableview/tst_qtableview.cpp
index 8bd09e6040..1b8d1f2327 100644
--- a/tests/benchmarks/gui/itemviews/qtableview/tst_qtableview.cpp
+++ b/tests/benchmarks/gui/itemviews/qtableview/tst_qtableview.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/kernel/qapplication/main.cpp b/tests/benchmarks/gui/kernel/qapplication/main.cpp
index 63991683c4..6df3c5ac23 100644
--- a/tests/benchmarks/gui/kernel/qapplication/main.cpp
+++ b/tests/benchmarks/gui/kernel/qapplication/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp b/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp
index 1d0a2d9330..2d5164eda9 100644
--- a/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp
+++ b/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp b/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp
index 30da54847a..64e481ab7d 100644
--- a/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp
+++ b/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp b/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp
index f145304c14..8bd0cb8a03 100644
--- a/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/benchmarks/gui/kernel/qwidget/tst_qwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/math3d/qmatrix4x4/tst_qmatrix4x4.cpp b/tests/benchmarks/gui/math3d/qmatrix4x4/tst_qmatrix4x4.cpp
index de35c1d94b..6173870c10 100644
--- a/tests/benchmarks/gui/math3d/qmatrix4x4/tst_qmatrix4x4.cpp
+++ b/tests/benchmarks/gui/math3d/qmatrix4x4/tst_qmatrix4x4.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/math3d/qquaternion/tst_qquaternion.cpp b/tests/benchmarks/gui/math3d/qquaternion/tst_qquaternion.cpp
index 7bce2a1776..b691b99455 100644
--- a/tests/benchmarks/gui/math3d/qquaternion/tst_qquaternion.cpp
+++ b/tests/benchmarks/gui/math3d/qquaternion/tst_qquaternion.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp b/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp
index 37a8329151..c659fa5af1 100644
--- a/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/painting/qregion/main.cpp b/tests/benchmarks/gui/painting/qregion/main.cpp
index 92749da108..2a92387aa9 100644
--- a/tests/benchmarks/gui/painting/qregion/main.cpp
+++ b/tests/benchmarks/gui/painting/qregion/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/painting/qtbench/benchmarktests.h b/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
index 0f4ea7c023..53cac3d7b6 100644
--- a/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
+++ b/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp b/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp
index dc3f1f900e..c58e53f267 100644
--- a/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp
+++ b/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/painting/qtracebench/tst_qtracebench.cpp b/tests/benchmarks/gui/painting/qtracebench/tst_qtracebench.cpp
index 0bb586d85d..3d29482970 100644
--- a/tests/benchmarks/gui/painting/qtracebench/tst_qtracebench.cpp
+++ b/tests/benchmarks/gui/painting/qtracebench/tst_qtracebench.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp b/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp
index a11af5a3dd..1ad44cca7a 100644
--- a/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp
+++ b/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/styles/qstylesheetstyle/main.cpp b/tests/benchmarks/gui/styles/qstylesheetstyle/main.cpp
index f44a29d16d..3f10459615 100644
--- a/tests/benchmarks/gui/styles/qstylesheetstyle/main.cpp
+++ b/tests/benchmarks/gui/styles/qstylesheetstyle/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/text/qfontmetrics/main.cpp b/tests/benchmarks/gui/text/qfontmetrics/main.cpp
index 2bb32d737f..ab1d2944a0 100644
--- a/tests/benchmarks/gui/text/qfontmetrics/main.cpp
+++ b/tests/benchmarks/gui/text/qfontmetrics/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/gui/text/qtext/main.cpp b/tests/benchmarks/gui/text/qtext/main.cpp
index a7da42e347..753021419d 100644
--- a/tests/benchmarks/gui/text/qtext/main.cpp
+++ b/tests/benchmarks/gui/text/qtext/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp b/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp
index 54f0c71c1e..96b959ed70 100644
--- a/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp
+++ b/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp b/tests/benchmarks/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
index a81c71550d..a6b5082f39 100644
--- a/tests/benchmarks/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
+++ b/tests/benchmarks/network/access/qnetworkdiskcache/tst_qnetworkdiskcache.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
index 9fc6147b00..81f9c1a3e8 100644
--- a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -321,7 +321,7 @@ public:
return false;
}
- virtual bool reset() const{
+ virtual bool reset() {
return false;
}
@@ -690,15 +690,15 @@ public:
QSharedPointer<char> data = downloadBufferAttribute.value<QSharedPointer<char> >();
} else if (testType == DownloadBufferButUseRead) {
// We had a download buffer but we benchmark here the "legacy" read() way to access it
- char* replyData = (char*) qMalloc(uploadSize);
+ char* replyData = (char*) malloc(uploadSize);
QVERIFY(reply->read(replyData, uploadSize) == uploadSize);
- qFree(replyData);
+ free(replyData);
} else if (testType == NoDownloadBuffer) {
// We did not have a download buffer but we still need to benchmark having the data, e.g. reading it all.
// This should be the slowest benchmark result.
- char* replyData = (char*) qMalloc(uploadSize);
+ char* replyData = (char*) malloc(uploadSize);
QVERIFY(reply->read(replyData, uploadSize) == uploadSize);
- qFree(replyData);
+ free(replyData);
}
QMetaObject::invokeMethod(&QTestEventLoop::instance(), "exitLoop", Qt::QueuedConnection);
diff --git a/tests/benchmarks/network/kernel/qhostinfo/main.cpp b/tests/benchmarks/network/kernel/qhostinfo/main.cpp
index 634e237d5d..bcab4e3894 100644
--- a/tests/benchmarks/network/kernel/qhostinfo/main.cpp
+++ b/tests/benchmarks/network/kernel/qhostinfo/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro b/tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro
index e26406fe74..e26406fe74 100755..100644
--- a/tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro
+++ b/tests/benchmarks/network/kernel/qhostinfo/qhostinfo.pro
diff --git a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp
index c5d47f1a56..7157a6c690 100644
--- a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp
+++ b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp
index d3684837b7..3210a109c4 100644
--- a/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/benchmarks/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/opengl/main.cpp b/tests/benchmarks/opengl/main.cpp
index 37d15f86ac..9be7f17146 100644
--- a/tests/benchmarks/opengl/main.cpp
+++ b/tests/benchmarks/opengl/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/plugins/imageformats/jpeg/jpeg.cpp b/tests/benchmarks/plugins/imageformats/jpeg/jpeg.cpp
index d65ca18e7e..d8b8fbc865 100644
--- a/tests/benchmarks/plugins/imageformats/jpeg/jpeg.cpp
+++ b/tests/benchmarks/plugins/imageformats/jpeg/jpeg.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/benchmarks/sql/kernel/qsqlquery/main.cpp b/tests/benchmarks/sql/kernel/qsqlquery/main.cpp
index 87d4ebe3b8..b3ed0fa058 100644
--- a/tests/benchmarks/sql/kernel/qsqlquery/main.cpp
+++ b/tests/benchmarks/sql/kernel/qsqlquery/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/bearerex/bearerex.cpp b/tests/manual/bearerex/bearerex.cpp
index c044476a8c..fd75c30438 100644
--- a/tests/manual/bearerex/bearerex.cpp
+++ b/tests/manual/bearerex/bearerex.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/bearerex/bearerex.h b/tests/manual/bearerex/bearerex.h
index 22c24cb42c..045d310f4a 100644
--- a/tests/manual/bearerex/bearerex.h
+++ b/tests/manual/bearerex/bearerex.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/bearerex/datatransferer.cpp b/tests/manual/bearerex/datatransferer.cpp
index b170daf489..5184bccde9 100644
--- a/tests/manual/bearerex/datatransferer.cpp
+++ b/tests/manual/bearerex/datatransferer.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/bearerex/datatransferer.h b/tests/manual/bearerex/datatransferer.h
index 50fc416b19..ddbd89be2a 100644
--- a/tests/manual/bearerex/datatransferer.h
+++ b/tests/manual/bearerex/datatransferer.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/bearerex/main.cpp b/tests/manual/bearerex/main.cpp
index 9f3e9c68f4..e9bf03395f 100644
--- a/tests/manual/bearerex/main.cpp
+++ b/tests/manual/bearerex/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/bearerex/xqlistwidget.cpp b/tests/manual/bearerex/xqlistwidget.cpp
index 162545c4e9..b236c41bc6 100644
--- a/tests/manual/bearerex/xqlistwidget.cpp
+++ b/tests/manual/bearerex/xqlistwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/bearerex/xqlistwidget.h b/tests/manual/bearerex/xqlistwidget.h
index 0d6d59b877..1715bec3ec 100644
--- a/tests/manual/bearerex/xqlistwidget.h
+++ b/tests/manual/bearerex/xqlistwidget.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/cmake/CMakeLists.txt b/tests/manual/cmake/CMakeLists.txt
index 1f2bd3e80a..91ead649ec 100644
--- a/tests/manual/cmake/CMakeLists.txt
+++ b/tests/manual/cmake/CMakeLists.txt
@@ -25,8 +25,10 @@ macro(expect_fail _dir)
endif()
endmacro()
-# Requires a patched cmake for the automoc stuff. Will uncomment when it is released.
-# expect_pass(pass1)
+if(${CMAKE_VERSION} VERSION_GREATER 2.8.7)
+ # Requires CMAKE_AUTOMOC function in CMake 2.8.7
+ expect_pass(pass1)
+endif()
expect_pass(pass2)
expect_pass(pass3)
expect_fail(fail4)
diff --git a/tests/manual/cmake/pass1/CMakeLists.txt b/tests/manual/cmake/pass1/CMakeLists.txt
index c41a904d79..f11887e545 100644
--- a/tests/manual/cmake/pass1/CMakeLists.txt
+++ b/tests/manual/cmake/pass1/CMakeLists.txt
@@ -3,23 +3,23 @@ cmake_minimum_required(VERSION 2.8)
project(pass1)
-# Warning: requires cmake 2.8.7 due for release in December 2011
-# for automatic moc with Qt 5
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
macro(qt5_use_package _target _package)
- # TODO: Handle public/private keywords?
- find_package(Qt5${_package} ${ARG1})
+ if (NOT Qt5${_package}_FOUND)
+ find_package(Qt5${_package} ${ARG1})
+ endif()
if (Qt5${_package}_FOUND)
+ # TODO: Handle public/private keywords?
target_link_libraries(${_target} ${Qt5${_package}_LIBRARIES})
- include_directories(${Qt5${_package}_INCLUDE_DIRS})
+ # ### Requires CMake 2.8.8:
# set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${Qt5${_package}_INCLUDE_DIRS})
+ include_directories(${Qt5${_package}_INCLUDE_DIRS})
set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS ${Qt5${_package}_COMPILE_DEFINITIONS})
- foreach(_dep ${_Qt5_MODULE_DEPENDENCIES})
- qt5_use_package(${_target} ${_dep} REQUIRED)
- endforeach()
+ else()
+ message(FATAL_ERROR "NOT FOUND: Qt5${_package}")
endif()
endmacro()
diff --git a/tests/manual/cmake/pass3/CMakeLists.txt b/tests/manual/cmake/pass3/CMakeLists.txt
index 8c39b4f4a3..11402e2e18 100644
--- a/tests/manual/cmake/pass3/CMakeLists.txt
+++ b/tests/manual/cmake/pass3/CMakeLists.txt
@@ -3,11 +3,10 @@ cmake_minimum_required(VERSION 2.8)
project(pass3)
-find_package(Qt5Core REQUIRED)
-find_package(Qt5Gui REQUIRED)
+# The module finds its dependencies
find_package(Qt5Widgets REQUIRED)
-include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS})
+include_directories(${Qt5Widgets_INCLUDE_DIRS})
set(CMAKE_INCLUDE_CURRENT_DIR ON)
diff --git a/tests/manual/cocoa/qt_on_cocoa/main.mm b/tests/manual/cocoa/qt_on_cocoa/main.mm
new file mode 100644
index 0000000000..18b5c78993
--- /dev/null
+++ b/tests/manual/cocoa/qt_on_cocoa/main.mm
@@ -0,0 +1,213 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui>
+#include <QtDeclarative>
+
+#include <QtWidgets/QtWidgets>
+#include <private/qwidgetwindow_qpa_p.h>
+#include <QtGui/qplatformnativeinterface_qpa.h>
+
+#include <QtGui/QPixmap>
+
+#include "window.h"
+
+#include <Cocoa/Cocoa.h>
+
+
+@interface FilledView : NSView
+{
+
+}
+@end
+
+
+@implementation FilledView
+
+- (void)drawRect:(NSRect)dirtyRect {
+ // set any NSColor for filling, say white:
+ [[NSColor redColor] setFill];
+ NSRectFill(dirtyRect);
+}
+
+@end
+
+@interface QtMacToolbarDelegate : NSObject <NSToolbarDelegate>
+{
+@public
+ NSToolbar *toolbar;
+}
+
+- (id)init;
+- (NSToolbarItem *) toolbar: (NSToolbar *)toolbar itemForItemIdentifier: (NSString *) itemIdent willBeInsertedIntoToolbar:(BOOL) willBeInserted;
+- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)tb;
+- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar;
+- (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar;
+@end
+
+@implementation QtMacToolbarDelegate
+
+- (id)init
+{
+ self = [super init];
+ if (self) {
+ }
+ return self;
+}
+
+- (void)dealloc
+{
+ [super dealloc];
+}
+
+- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)tb
+{
+ Q_UNUSED(tb);
+ NSMutableArray *array = [[[NSMutableArray alloc] init] autorelease];
+// [array addObject : NSToolbarPrintItemIdentifier];
+// [array addObject : NSToolbarShowColorsItemIdentifier];
+ [array addObject : @"filledView"];
+ return array;
+}
+
+- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)tb
+{
+ Q_UNUSED(tb);
+ NSMutableArray *array = [[[NSMutableArray alloc] init] autorelease];
+// [array addObject : NSToolbarPrintItemIdentifier];
+// [array addObject : NSToolbarShowColorsItemIdentifier];
+ [array addObject : @"filledView"];
+ return array;
+}
+
+- (NSArray *)toolbarSelectableItemIdentifiers: (NSToolbar *)tb
+{
+ Q_UNUSED(tb);
+ NSMutableArray *array = [[[NSMutableArray alloc] init] autorelease];
+ return array;
+}
+
+- (IBAction)itemClicked:(id)sender
+{
+
+}
+
+- (NSToolbarItem *) toolbar: (NSToolbar *)tb itemForItemIdentifier: (NSString *) itemIdentifier willBeInsertedIntoToolbar:(BOOL) willBeInserted
+{
+ Q_UNUSED(tb);
+ Q_UNUSED(willBeInserted);
+ //const QString identifier = toQString(itemIdentifier);
+ //NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdentifier] autorelease];
+ //return toolbarItem;
+
+ //NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdentifier] autorelease];
+ NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdentifier] autorelease];
+ FilledView *theView = [[FilledView alloc] init];
+ [toolbarItem setView : theView];
+ [toolbarItem setMinSize : NSMakeSize(400, 40)];
+ [toolbarItem setMaxSize : NSMakeSize(4000, 40)];
+ return toolbarItem;
+}
+@end
+
+@interface WindowAndViewAndQtCreator : NSObject {}
+- (void)createWindowAndViewAndQt;
+@end
+
+@implementation WindowAndViewAndQtCreator
+- (void)createWindowAndViewAndQt {
+
+ // Create the window
+ NSRect frame = NSMakeRect(500, 500, 500, 500);
+ NSWindow* window = [[NSWindow alloc] initWithContentRect:frame
+ styleMask:NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask
+ backing:NSBackingStoreBuffered
+ defer:NO];
+
+ NSString *title = @"This the NSWindow window";
+ [window setTitle:title];
+
+ [window setBackgroundColor:[NSColor blueColor]];
+
+ // Create a tool bar, set Qt delegate
+ NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier : @"foobartoolbar"];
+ QtMacToolbarDelegate *delegate = [[QtMacToolbarDelegate alloc] init];
+ [toolbar setDelegate : delegate];
+ [window setToolbar : toolbar];
+
+ // Create the QWindow, don't show it.
+ Window *qtWindow = new Window();
+ qtWindow->create();
+
+ //QSGView *qtWindow = new QSGView();
+ //qtWindow->setSource(QUrl::fromLocalFile("/Users/msorvig/code/qt5/qtdeclarative/examples/declarative/samegame/samegame.qml"));
+ // qtWindow->setWindowFlags(Qt::WindowType(13)); // 13: NativeEmbeddedWindow
+
+ // Get the nsview from the QWindow, set it as the content view
+ // on the NSWindow created above.
+ QPlatformNativeInterface *platformNativeInterface = QGuiApplication::platformNativeInterface();
+ NSView *qtView = (NSView *)platformNativeInterface->nativeResourceForWindow("nsview", qtWindow);
+ [window setContentView:qtView];
+ [window makeKeyAndOrderFront:NSApp];
+}
+@end
+
+int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc, argv);
+
+ // fake NSApplicationMain() implementation follows:
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+ [NSApplication sharedApplication];
+
+ // schedule call to create the UI.
+ WindowAndViewAndQtCreator *windowAndViewAndQtCreator= [WindowAndViewAndQtCreator alloc];
+ [NSTimer scheduledTimerWithTimeInterval:0 target:windowAndViewAndQtCreator selector:@selector(createWindowAndViewAndQt) userInfo:nil repeats:NO];
+
+ [(NSApplication *)NSApp run];
+ [NSApp release];
+ [pool release];
+ exit(0);
+ return 0;
+}
+
+
+
diff --git a/tests/manual/cocoa/qt_on_cocoa/qt_on_cocoa.pro b/tests/manual/cocoa/qt_on_cocoa/qt_on_cocoa.pro
new file mode 100644
index 0000000000..d5399b543a
--- /dev/null
+++ b/tests/manual/cocoa/qt_on_cocoa/qt_on_cocoa.pro
@@ -0,0 +1,12 @@
+TEMPLATE = app
+
+OBJECTIVE_SOURCES += main.mm
+HEADERS += window.h
+SOURCES += window.cpp
+LIBS += -framework Cocoa
+
+QMAKE_INFO_PLIST = Info_mac.plist
+OTHER_FILES = Info_mac.plist
+QT += gui widgets widgets-private gui-private core-private
+
+QT += declarative
diff --git a/tests/manual/cocoa/qt_on_cocoa/window.cpp b/tests/manual/cocoa/qt_on_cocoa/window.cpp
new file mode 100644
index 0000000000..5d24ceb51f
--- /dev/null
+++ b/tests/manual/cocoa/qt_on_cocoa/window.cpp
@@ -0,0 +1,203 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "window.h"
+
+#include <private/qguiapplication_p.h>
+
+#include <QBackingStore>
+#include <QPainter>
+#include <QtGui>
+
+static int colorIndexId = 0;
+
+QColor colorTable[] =
+{
+ QColor("#f09f8f"),
+ QColor("#a2bff2"),
+ QColor("#c0ef8f")
+};
+
+Window::Window(QScreen *screen)
+ : QWindow(screen)
+ , m_backgroundColorIndex(colorIndexId++)
+{
+ initialize();
+}
+
+Window::Window(QWindow *parent)
+ : QWindow(parent)
+ , m_backgroundColorIndex(colorIndexId++)
+{
+ initialize();
+}
+
+void Window::initialize()
+{
+ if (parent())
+ setGeometry(QRect(160, 120, 320, 240));
+ else {
+ setGeometry(QRect(10, 10, 640, 480));
+
+ setSizeIncrement(QSize(10, 10));
+ setBaseSize(QSize(640, 480));
+ setMinimumSize(QSize(240, 160));
+ setMaximumSize(QSize(800, 600));
+ }
+
+ create();
+ m_backingStore = new QBackingStore(this);
+
+ m_image = QImage(geometry().size(), QImage::Format_RGB32);
+ m_image.fill(colorTable[m_backgroundColorIndex % (sizeof(colorTable) / sizeof(colorTable[0]))].rgba());
+
+ m_lastPos = QPoint(-1, -1);
+ m_renderTimer = 0;
+}
+
+void Window::mousePressEvent(QMouseEvent *event)
+{
+ m_lastPos = event->pos();
+}
+
+void Window::mouseMoveEvent(QMouseEvent *event)
+{
+ if (m_lastPos != QPoint(-1, -1)) {
+ QPainter p(&m_image);
+ p.setRenderHint(QPainter::Antialiasing);
+ p.drawLine(m_lastPos, event->pos());
+ m_lastPos = event->pos();
+ }
+
+ scheduleRender();
+}
+
+void Window::mouseReleaseEvent(QMouseEvent *event)
+{
+ if (m_lastPos != QPoint(-1, -1)) {
+ QPainter p(&m_image);
+ p.setRenderHint(QPainter::Antialiasing);
+ p.drawLine(m_lastPos, event->pos());
+ m_lastPos = QPoint(-1, -1);
+ }
+
+ scheduleRender();
+}
+
+void Window::exposeEvent(QExposeEvent *)
+{
+ scheduleRender();
+}
+
+void Window::resizeEvent(QResizeEvent *)
+{
+ QImage old = m_image;
+
+ //qDebug() << "Window::resizeEvent" << width << height;
+
+ int width = qMax(geometry().width(), old.width());
+ int height = qMax(geometry().height(), old.height());
+
+ if (width > old.width() || height > old.height()) {
+ m_image = QImage(width, height, QImage::Format_RGB32);
+ m_image.fill(colorTable[(m_backgroundColorIndex) % (sizeof(colorTable) / sizeof(colorTable[0]))].rgba());
+
+ QPainter p(&m_image);
+ p.drawImage(0, 0, old);
+ }
+
+ render();
+}
+
+void Window::keyPressEvent(QKeyEvent *event)
+{
+ switch (event->key()) {
+ case Qt::Key_Backspace:
+ m_text.chop(1);
+ break;
+ case Qt::Key_Enter:
+ case Qt::Key_Return:
+ m_text.append('\n');
+ break;
+ default:
+ m_text.append(event->text());
+ break;
+ }
+ scheduleRender();
+}
+
+void Window::scheduleRender()
+{
+ if (!m_renderTimer)
+ m_renderTimer = startTimer(1);
+}
+
+void Window::timerEvent(QTimerEvent *)
+{
+ render();
+ killTimer(m_renderTimer);
+ m_renderTimer = 0;
+}
+
+void Window::render()
+{
+ QRect rect(QPoint(), geometry().size());
+
+ m_backingStore->resize(rect.size());
+
+ m_backingStore->beginPaint(rect);
+
+ QPaintDevice *device = m_backingStore->paintDevice();
+
+ QPainter p(device);
+ p.drawImage(0, 0, m_image);
+
+ QFont font;
+ font.setPixelSize(32);
+
+ p.setFont(font);
+ p.drawText(rect, 0, m_text);
+
+ m_backingStore->endPaint();
+ m_backingStore->flush(rect);
+}
+
+
diff --git a/tests/auto/v8/v8main.cpp b/tests/manual/cocoa/qt_on_cocoa/window.h
index 091d2cae28..2fa2784427 100644
--- a/tests/auto/v8/v8main.cpp
+++ b/tests/manual/cocoa/qt_on_cocoa/window.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -39,28 +39,36 @@
**
****************************************************************************/
-#include "v8test.h"
-#include <stdio.h>
-#include <strings.h>
+#include <QWindow>
+#include <QImage>
-#define RUN_TEST(testname) { \
- if (argc == 1 || 0 == ::strcmp(argv[1], # testname)) { \
- if (!v8test_ ## testname()) \
- printf ("Test %s FAILED\n", # testname); \
- else \
- printf ("Test %s PASS\n", # testname); \
- } \
-}
-
-int main(int argc, char *argv[])
+class Window : public QWindow
{
- v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
+public:
+ Window(QWindow *parent = 0);
+ Window(QScreen *screen);
+
+protected:
+ void mousePressEvent(QMouseEvent *);
+ void mouseMoveEvent(QMouseEvent *);
+ void mouseReleaseEvent(QMouseEvent *);
+
+ void keyPressEvent(QKeyEvent *);
+
+ void exposeEvent(QExposeEvent *);
+ void resizeEvent(QResizeEvent *);
+
+ void timerEvent(QTimerEvent *);
- RUN_TEST(eval);
- RUN_TEST(evalwithinwith);
- RUN_TEST(userobjectcompare);
- RUN_TEST(externalteardown);
- RUN_TEST(globalcall);
+private:
+ void render();
+ void scheduleRender();
+ void initialize();
- return -1;
-}
+ QString m_text;
+ QImage m_image;
+ QPoint m_lastPos;
+ int m_backgroundColorIndex;
+ QBackingStore *m_backingStore;
+ int m_renderTimer;
+};
diff --git a/tests/manual/gestures/graphicsview/gestures.cpp b/tests/manual/gestures/graphicsview/gestures.cpp
index e576f14871..4dde0f5cb7 100644
--- a/tests/manual/gestures/graphicsview/gestures.cpp
+++ b/tests/manual/gestures/graphicsview/gestures.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/gestures/graphicsview/gestures.h b/tests/manual/gestures/graphicsview/gestures.h
index 8f96eccf99..8104da640d 100644
--- a/tests/manual/gestures/graphicsview/gestures.h
+++ b/tests/manual/gestures/graphicsview/gestures.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/gestures/graphicsview/imageitem.cpp b/tests/manual/gestures/graphicsview/imageitem.cpp
index 73d56129d0..03e9946cf4 100644
--- a/tests/manual/gestures/graphicsview/imageitem.cpp
+++ b/tests/manual/gestures/graphicsview/imageitem.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/gestures/graphicsview/imageitem.h b/tests/manual/gestures/graphicsview/imageitem.h
index cdc1d8823e..d789a3e914 100644
--- a/tests/manual/gestures/graphicsview/imageitem.h
+++ b/tests/manual/gestures/graphicsview/imageitem.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/gestures/graphicsview/main.cpp b/tests/manual/gestures/graphicsview/main.cpp
index 952b495b76..f46d7139d8 100644
--- a/tests/manual/gestures/graphicsview/main.cpp
+++ b/tests/manual/gestures/graphicsview/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/gestures/graphicsview/mousepangesturerecognizer.cpp b/tests/manual/gestures/graphicsview/mousepangesturerecognizer.cpp
index 44b6794d87..778ba78a10 100644
--- a/tests/manual/gestures/graphicsview/mousepangesturerecognizer.cpp
+++ b/tests/manual/gestures/graphicsview/mousepangesturerecognizer.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/gestures/graphicsview/mousepangesturerecognizer.h b/tests/manual/gestures/graphicsview/mousepangesturerecognizer.h
index e815a2d6a8..0e2684a285 100644
--- a/tests/manual/gestures/graphicsview/mousepangesturerecognizer.h
+++ b/tests/manual/gestures/graphicsview/mousepangesturerecognizer.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/gestures/scrollarea/main.cpp b/tests/manual/gestures/scrollarea/main.cpp
index 7b2924c079..ec5176600e 100644
--- a/tests/manual/gestures/scrollarea/main.cpp
+++ b/tests/manual/gestures/scrollarea/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/gestures/scrollarea/mousepangesturerecognizer.cpp b/tests/manual/gestures/scrollarea/mousepangesturerecognizer.cpp
index c9c5d41c08..8231fe0e74 100644
--- a/tests/manual/gestures/scrollarea/mousepangesturerecognizer.cpp
+++ b/tests/manual/gestures/scrollarea/mousepangesturerecognizer.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/gestures/scrollarea/mousepangesturerecognizer.h b/tests/manual/gestures/scrollarea/mousepangesturerecognizer.h
index e815a2d6a8..0e2684a285 100644
--- a/tests/manual/gestures/scrollarea/mousepangesturerecognizer.h
+++ b/tests/manual/gestures/scrollarea/mousepangesturerecognizer.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/inputmethodhints/inputmethodhints.cpp b/tests/manual/inputmethodhints/inputmethodhints.cpp
index f302c36c43..1754a3cd26 100644
--- a/tests/manual/inputmethodhints/inputmethodhints.cpp
+++ b/tests/manual/inputmethodhints/inputmethodhints.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/inputmethodhints/inputmethodhints.h b/tests/manual/inputmethodhints/inputmethodhints.h
index 839d5386af..6e2d934204 100644
--- a/tests/manual/inputmethodhints/inputmethodhints.h
+++ b/tests/manual/inputmethodhints/inputmethodhints.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/inputmethodhints/main.cpp b/tests/manual/inputmethodhints/main.cpp
index f0807dec6f..a276cde1f2 100644
--- a/tests/manual/inputmethodhints/main.cpp
+++ b/tests/manual/inputmethodhints/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/keypadnavigation/main.cpp b/tests/manual/keypadnavigation/main.cpp
index f8debafe56..2edc67a426 100644
--- a/tests/manual/keypadnavigation/main.cpp
+++ b/tests/manual/keypadnavigation/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/lance/interactivewidget.cpp b/tests/manual/lance/interactivewidget.cpp
index f7bc67ea0b..fb480b1d0b 100644
--- a/tests/manual/lance/interactivewidget.cpp
+++ b/tests/manual/lance/interactivewidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/lance/interactivewidget.h b/tests/manual/lance/interactivewidget.h
index f5e91c87dc..ac46a0ec36 100644
--- a/tests/manual/lance/interactivewidget.h
+++ b/tests/manual/lance/interactivewidget.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/lance/main.cpp b/tests/manual/lance/main.cpp
index f63ac7a367..7ff8b1cf36 100644
--- a/tests/manual/lance/main.cpp
+++ b/tests/manual/lance/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/lance/widgets.h b/tests/manual/lance/widgets.h
index 033067d846..28ed34f653 100644
--- a/tests/manual/lance/widgets.h
+++ b/tests/manual/lance/widgets.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/mkspecs/test.sh b/tests/manual/mkspecs/test.sh
index 84f5b93852..d384df2098 100755
--- a/tests/manual/mkspecs/test.sh
+++ b/tests/manual/mkspecs/test.sh
@@ -1,7 +1,7 @@
#!/bin/bash
#############################################################################
##
-## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+## Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation (qt-info@nokia.com)
##
diff --git a/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp b/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp
index 77589d350e..06e211738e 100644
--- a/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp
+++ b/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/network_stresstest/minihttpserver.cpp b/tests/manual/network_stresstest/minihttpserver.cpp
index 8318f93b5b..d024fe0f06 100644
--- a/tests/manual/network_stresstest/minihttpserver.cpp
+++ b/tests/manual/network_stresstest/minihttpserver.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/network_stresstest/minihttpserver.h b/tests/manual/network_stresstest/minihttpserver.h
index 0499c3b404..a622159ce6 100644
--- a/tests/manual/network_stresstest/minihttpserver.h
+++ b/tests/manual/network_stresstest/minihttpserver.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/network_stresstest/tst_network_stresstest.cpp b/tests/manual/network_stresstest/tst_network_stresstest.cpp
index 8337118bbf..debae981ab 100644
--- a/tests/manual/network_stresstest/tst_network_stresstest.cpp
+++ b/tests/manual/network_stresstest/tst_network_stresstest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qcursor/allcursors/main.cpp b/tests/manual/qcursor/allcursors/main.cpp
index c074f4c141..1b0d9a55bd 100644
--- a/tests/manual/qcursor/allcursors/main.cpp
+++ b/tests/manual/qcursor/allcursors/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qcursor/allcursors/mainwindow.cpp b/tests/manual/qcursor/allcursors/mainwindow.cpp
index 855229f3dc..8807f6f1d0 100644
--- a/tests/manual/qcursor/allcursors/mainwindow.cpp
+++ b/tests/manual/qcursor/allcursors/mainwindow.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qcursor/allcursors/mainwindow.h b/tests/manual/qcursor/allcursors/mainwindow.h
index df314ef3e6..d9dc3bcb78 100644
--- a/tests/manual/qcursor/allcursors/mainwindow.h
+++ b/tests/manual/qcursor/allcursors/mainwindow.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qcursor/grab_override/main.cpp b/tests/manual/qcursor/grab_override/main.cpp
index c074f4c141..1b0d9a55bd 100644
--- a/tests/manual/qcursor/grab_override/main.cpp
+++ b/tests/manual/qcursor/grab_override/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qcursor/grab_override/mainwindow.cpp b/tests/manual/qcursor/grab_override/mainwindow.cpp
index f1082d4d03..d6c671a642 100644
--- a/tests/manual/qcursor/grab_override/mainwindow.cpp
+++ b/tests/manual/qcursor/grab_override/mainwindow.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qcursor/grab_override/mainwindow.h b/tests/manual/qcursor/grab_override/mainwindow.h
index 5c565a3cc6..e5a2042bb0 100644
--- a/tests/manual/qcursor/grab_override/mainwindow.h
+++ b/tests/manual/qcursor/grab_override/mainwindow.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qdesktopwidget/main.cpp b/tests/manual/qdesktopwidget/main.cpp
index f42098f344..4982bd8321 100644
--- a/tests/manual/qdesktopwidget/main.cpp
+++ b/tests/manual/qdesktopwidget/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qgraphicsitemgroup/customitem.cpp b/tests/manual/qgraphicsitemgroup/customitem.cpp
index 25b99b3d1c..2fb14d638a 100644
--- a/tests/manual/qgraphicsitemgroup/customitem.cpp
+++ b/tests/manual/qgraphicsitemgroup/customitem.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qgraphicsitemgroup/customitem.h b/tests/manual/qgraphicsitemgroup/customitem.h
index e7ac8c2b45..c8416cf952 100644
--- a/tests/manual/qgraphicsitemgroup/customitem.h
+++ b/tests/manual/qgraphicsitemgroup/customitem.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qgraphicsitemgroup/main.cpp b/tests/manual/qgraphicsitemgroup/main.cpp
index 5c12a0cc51..c3310637b9 100644
--- a/tests/manual/qgraphicsitemgroup/main.cpp
+++ b/tests/manual/qgraphicsitemgroup/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qgraphicsitemgroup/widget.cpp b/tests/manual/qgraphicsitemgroup/widget.cpp
index 2788369517..1ff9e41c6a 100644
--- a/tests/manual/qgraphicsitemgroup/widget.cpp
+++ b/tests/manual/qgraphicsitemgroup/widget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qgraphicsitemgroup/widget.h b/tests/manual/qgraphicsitemgroup/widget.h
index 78468afa50..4e0489722f 100644
--- a/tests/manual/qgraphicsitemgroup/widget.h
+++ b/tests/manual/qgraphicsitemgroup/widget.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qgraphicslayout/flicker/main.cpp b/tests/manual/qgraphicslayout/flicker/main.cpp
index c0fac45142..db9e53e302 100644
--- a/tests/manual/qgraphicslayout/flicker/main.cpp
+++ b/tests/manual/qgraphicslayout/flicker/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qgraphicslayout/flicker/window.cpp b/tests/manual/qgraphicslayout/flicker/window.cpp
index 63dfa380d7..01a1182013 100644
--- a/tests/manual/qgraphicslayout/flicker/window.cpp
+++ b/tests/manual/qgraphicslayout/flicker/window.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qgraphicslayout/flicker/window.h b/tests/manual/qgraphicslayout/flicker/window.h
index 26a8f2ab5e..872a7469d8 100644
--- a/tests/manual/qgraphicslayout/flicker/window.h
+++ b/tests/manual/qgraphicslayout/flicker/window.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qhttpnetworkconnection/main.cpp b/tests/manual/qhttpnetworkconnection/main.cpp
index 502efcab9a..9998577997 100644
--- a/tests/manual/qhttpnetworkconnection/main.cpp
+++ b/tests/manual/qhttpnetworkconnection/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qimagereader/main.cpp b/tests/manual/qimagereader/main.cpp
index 90f3a3ec51..bc1772bbcc 100644
--- a/tests/manual/qimagereader/main.cpp
+++ b/tests/manual/qimagereader/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qlocale/calendar.cpp b/tests/manual/qlocale/calendar.cpp
index bd4756e998..8fadf68ea7 100644
--- a/tests/manual/qlocale/calendar.cpp
+++ b/tests/manual/qlocale/calendar.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qlocale/calendar.h b/tests/manual/qlocale/calendar.h
index b5bb3c9268..b03102f68d 100644
--- a/tests/manual/qlocale/calendar.h
+++ b/tests/manual/qlocale/calendar.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qlocale/currency.cpp b/tests/manual/qlocale/currency.cpp
index 4ef157cba8..f5d69de6c2 100644
--- a/tests/manual/qlocale/currency.cpp
+++ b/tests/manual/qlocale/currency.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qlocale/currency.h b/tests/manual/qlocale/currency.h
index 3a1255343c..fbee336da1 100644
--- a/tests/manual/qlocale/currency.h
+++ b/tests/manual/qlocale/currency.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qlocale/dateformats.cpp b/tests/manual/qlocale/dateformats.cpp
index 25b3e7a954..e23a2b8e52 100644
--- a/tests/manual/qlocale/dateformats.cpp
+++ b/tests/manual/qlocale/dateformats.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qlocale/dateformats.h b/tests/manual/qlocale/dateformats.h
index f05ad2a27f..67b2ed4a02 100644
--- a/tests/manual/qlocale/dateformats.h
+++ b/tests/manual/qlocale/dateformats.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qlocale/info.cpp b/tests/manual/qlocale/info.cpp
index a4f6adfce0..2df46a22e3 100644
--- a/tests/manual/qlocale/info.cpp
+++ b/tests/manual/qlocale/info.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qlocale/info.h b/tests/manual/qlocale/info.h
index b23ecf5a47..1fd2b753df 100644
--- a/tests/manual/qlocale/info.h
+++ b/tests/manual/qlocale/info.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qlocale/languages.cpp b/tests/manual/qlocale/languages.cpp
index 18d72d7dd9..189e6976b1 100644
--- a/tests/manual/qlocale/languages.cpp
+++ b/tests/manual/qlocale/languages.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qlocale/languages.h b/tests/manual/qlocale/languages.h
index 18e503f648..b365b7e4e3 100644
--- a/tests/manual/qlocale/languages.h
+++ b/tests/manual/qlocale/languages.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qlocale/main.cpp b/tests/manual/qlocale/main.cpp
index b14a44f7c6..e37113fdc2 100644
--- a/tests/manual/qlocale/main.cpp
+++ b/tests/manual/qlocale/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qlocale/miscellaneous.cpp b/tests/manual/qlocale/miscellaneous.cpp
index 89c80dc65a..fdf4d27f8e 100644
--- a/tests/manual/qlocale/miscellaneous.cpp
+++ b/tests/manual/qlocale/miscellaneous.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qlocale/miscellaneous.h b/tests/manual/qlocale/miscellaneous.h
index 3b635b802f..42e4e4f982 100644
--- a/tests/manual/qlocale/miscellaneous.h
+++ b/tests/manual/qlocale/miscellaneous.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qlocale/numberformats.cpp b/tests/manual/qlocale/numberformats.cpp
index 7b5fce4082..99664f7e73 100644
--- a/tests/manual/qlocale/numberformats.cpp
+++ b/tests/manual/qlocale/numberformats.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qlocale/numberformats.h b/tests/manual/qlocale/numberformats.h
index 4a3ab36506..79dcac0dc9 100644
--- a/tests/manual/qlocale/numberformats.h
+++ b/tests/manual/qlocale/numberformats.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qlocale/window.cpp b/tests/manual/qlocale/window.cpp
index 775023e5df..bb6aea3114 100644
--- a/tests/manual/qlocale/window.cpp
+++ b/tests/manual/qlocale/window.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qlocale/window.h b/tests/manual/qlocale/window.h
index aee728fd9c..402cdd6259 100644
--- a/tests/manual/qlocale/window.h
+++ b/tests/manual/qlocale/window.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qnetworkaccessmanager/qget/qget.cpp b/tests/manual/qnetworkaccessmanager/qget/qget.cpp
new file mode 100644
index 0000000000..4e1bc4a71a
--- /dev/null
+++ b/tests/manual/qnetworkaccessmanager/qget/qget.cpp
@@ -0,0 +1,300 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qget.h"
+
+#include <QSslError>
+#include <QNetworkProxy>
+#include <QAuthenticator>
+#include <QDebug>
+#include <QCoreApplication>
+#include <QList>
+#include <QStringList>
+#include <QNetworkConfiguration>
+#include <QNetworkConfigurationManager>
+#include <QNetworkSession>
+
+DownloadManager::DownloadManager()
+{
+ connect(&nam, SIGNAL(finished(QNetworkReply*)), this, SLOT(finished(QNetworkReply*)));
+ connect(&nam, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)), this, SLOT(authenticationRequired(QNetworkReply*, QAuthenticator*)));
+ connect(&nam, SIGNAL(proxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*)), this, SLOT(proxyAuthenticationRequired(const QNetworkProxy&, QAuthenticator*)));
+ connect(&nam, SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError>&)), this, SLOT(sslErrors(QNetworkReply*, const QList<QSslError>&)));
+}
+
+DownloadManager::~DownloadManager()
+{
+
+}
+
+void DownloadManager::get(const QUrl& url)
+{
+ //currently multiple downloads are processed in parallel.
+ //could add an option for serial using the downloads list as a queue
+ //which would require DownloadItem to hold a request rather than a reply
+ QNetworkReply* reply = nam.get(QNetworkRequest(url));
+ DownloadItem *dl = new DownloadItem(reply, nam);
+ downloads.append(dl);
+ connect(dl, SIGNAL(downloadFinished(DownloadItem*)), SLOT(downloadFinished(DownloadItem*)));
+}
+
+void DownloadManager::finished(QNetworkReply* reply)
+{
+}
+
+void DownloadManager::downloadFinished(DownloadItem *item)
+{
+ downloads.removeOne(item);
+ item->deleteLater();
+ checkForAllDone();
+}
+
+void DownloadManager::checkForAllDone()
+{
+ if (downloads.isEmpty()) {
+ qDebug() << "All Done.";
+ QCoreApplication::quit();
+ }
+}
+
+void DownloadManager::authenticationRequired(QNetworkReply* reply, QAuthenticator* auth)
+{
+ //provide the credentials exactly once, so that it fails if credentials are incorrect.
+ if (!httpUser.isEmpty() || !httpPassword.isEmpty()) {
+ auth->setUser(httpUser);
+ auth->setPassword(httpPassword);
+ httpUser.clear();
+ httpPassword.clear();
+ }
+}
+
+void DownloadManager::proxyAuthenticationRequired(const QNetworkProxy& proxy, QAuthenticator* auth)
+{
+ //provide the credentials exactly once, so that it fails if credentials are incorrect.
+ if (!proxyUser.isEmpty() || !proxyPassword.isEmpty()) {
+ auth->setUser(proxyUser);
+ auth->setPassword(proxyPassword);
+ proxyUser.clear();
+ proxyPassword.clear();
+ }
+}
+
+void DownloadManager::sslErrors(QNetworkReply* reply, const QList<QSslError>& errors)
+{
+ qDebug() << "sslErrors";
+ foreach (const QSslError& error, errors) {
+ qDebug() << error.errorString();
+ qDebug() << error.certificate().toPem();
+ }
+}
+
+DownloadItem::DownloadItem(QNetworkReply* r, QNetworkAccessManager& manager) : reply(r), nam(manager)
+{
+ reply->setParent(this);
+ connect(reply, SIGNAL(readyRead()), this, SLOT(readyRead()));
+ connect(reply, SIGNAL(finished()), this, SLOT(finished()));
+}
+
+DownloadItem::~DownloadItem()
+{
+}
+
+void DownloadItem::readyRead()
+{
+ if (!file.isOpen()) {
+ qDebug() << reply->header(QNetworkRequest::ContentTypeHeader) << reply->header(QNetworkRequest::ContentLengthHeader);
+ QString path = reply->url().path();
+ path = path.mid(path.lastIndexOf('/') + 1);
+ if (path.isEmpty())
+ path = QLatin1String("index.html");
+ file.setFileName(path);
+ for (int i=1;i<1000;i++) {
+ if (!file.exists() && file.open(QIODevice::WriteOnly | QIODevice::Truncate))
+ break;
+ file.setFileName(QString(QLatin1String("%1.%2")).arg(path).arg(i));
+ }
+ if (!file.isOpen()) {
+ qDebug() << "couldn't open output file";
+ reply->abort();
+ return;
+ }
+ qDebug() << reply->url() << " -> " << file.fileName();
+ }
+ file.write(reply->readAll());
+}
+
+void DownloadItem::finished()
+{
+ if (reply->attribute(QNetworkRequest::RedirectionTargetAttribute).isValid()) {
+ QUrl url = reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl();
+ url = reply->url().resolved(url);
+ qDebug() << reply->url() << "redirected to " << url;
+ if (redirects.contains(url)) {
+ qDebug() << "redirect loop detected";
+ } else if (redirects.count() > 10) {
+ qDebug() << "too many redirects";
+ } else {
+ //follow redirect
+ if (file.isOpen()) {
+ if (!file.seek(0) || !file.resize(0)) {
+ file.close();
+ file.remove();
+ }
+ }
+ reply->deleteLater();
+ reply = nam.get(QNetworkRequest(url));
+ reply->setParent(this);
+ connect(reply, SIGNAL(readyRead()), this, SLOT(readyRead()));
+ connect(reply, SIGNAL(finished()), this, SLOT(finished()));
+ redirects.append(url);
+ return;
+ }
+ }
+ if (file.isOpen()) {
+ file.write(reply->readAll());
+ file.close();
+ }
+ qDebug() << "finished " << reply->url() << " with http status: " << reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
+ if (reply->error() != QNetworkReply::NoError)
+ qDebug() << "and error: " << reply->error() << reply->errorString();
+ emit downloadFinished(this);
+}
+
+void printShortUsage()
+{
+ qDebug() << QCoreApplication::applicationName() << " [options] [list of urls]" << endl
+ << "Get one or more urls using QNetworkAccessManager" << endl
+ << "--help to display detailed usage" << endl;
+}
+
+void printUsage()
+{
+ qDebug() << QCoreApplication::applicationName() << " [options] [list of urls]" << endl
+ << "Get one or more urls using QNetworkAccessManager" << endl
+ << "Options:"
+ << "--help This message" << endl
+ << "--http-user=<username> Set username to use for http 401 challenges" << endl
+ << "--http-password=<password> Set password to use for http 401 challenges" << endl
+ << "--proxy-user=<username> Set username to use for proxy authentication" << endl
+ << "--proxy-password=<password> Set password to use for proxy authentication" << endl
+ << "--proxy=on Use system proxy (default)" << endl
+ << "--proxy=off Don't use system proxy" << endl
+ << "--proxy=<host:port>[,type] Use specified proxy" << endl
+ << " ,http HTTP proxy (default)" << endl
+ << " ,socks SOCKS5 proxy" << endl
+ << " ,ftp FTP proxy" << endl
+ << " ,httpcaching HTTP caching proxy (no CONNECT method)" << endl;
+}
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication app(argc, argv);
+ if (argc < 2) {
+ printShortUsage();
+ return EXIT_FAILURE;
+ }
+
+ //use system proxy (by default)
+ QNetworkProxyFactory::setUseSystemConfiguration(true);
+
+ DownloadManager dl;
+ //arguments match wget where possible
+ foreach (QString str, app.arguments().mid(1)) {
+ if (str == "--help")
+ printUsage();
+ else if (str.startsWith("--http-user="))
+ dl.setHttpUser(str.mid(12));
+ else if (str.startsWith("--http-passwd="))
+ dl.setHttpPassword(str.mid(14));
+ else if (str.startsWith("--proxy-user="))
+ dl.setProxyUser(str.mid(13));
+ else if (str.startsWith("--proxy-passwd="))
+ dl.setProxyPassword(str.mid(15));
+ else if (str == "--proxy=off")
+ QNetworkProxyFactory::setUseSystemConfiguration(false);
+ else if (str == "--proxy=on")
+ QNetworkProxyFactory::setUseSystemConfiguration(true);
+ else if (str.startsWith("--proxy=")) {
+ //parse "--proxy=host:port[,type]"
+ QNetworkProxy proxy;
+ str = str.mid(8);
+ int sep = str.indexOf(':');
+ proxy.setHostName(str.left(sep));
+ str = str.mid(sep + 1);
+ sep = str.indexOf(',');
+ QString port;
+ if (sep < 0) {
+ port = str;
+ proxy.setType(QNetworkProxy::HttpProxy);
+ } else {
+ port = str.left(sep);
+ str = str.mid(sep + 1);
+ if (str == "socks")
+ proxy.setType(QNetworkProxy::Socks5Proxy);
+ else if (str == "ftp")
+ proxy.setType(QNetworkProxy::FtpCachingProxy);
+ else if (str == "httpcaching")
+ proxy.setType(QNetworkProxy::HttpCachingProxy);
+ else if (str == "http")
+ proxy.setType(QNetworkProxy::HttpProxy);
+ else {
+ qDebug() << "unknown proxy type";
+ return EXIT_FAILURE;
+ }
+ }
+ bool ok;
+ quint16 p = port.toUShort(&ok);
+ if (!ok) {
+ qDebug() << "couldn't parse proxy";
+ return EXIT_FAILURE;
+ }
+ proxy.setPort(p);
+ qDebug() << "proxy:" << proxy.hostName() << proxy.port() << proxy.type();
+ dl.setProxy(proxy);
+ }
+ else if (str.startsWith("-"))
+ qDebug() << "unsupported option" << str;
+ else
+ dl.get(QUrl::fromUserInput(str));
+ }
+ QMetaObject::invokeMethod(&dl, "checkForAllDone", Qt::QueuedConnection);
+ return app.exec();
+}
diff --git a/tests/manual/qnetworkaccessmanager/qget/qget.h b/tests/manual/qnetworkaccessmanager/qget/qget.h
new file mode 100644
index 0000000000..f66e3cd923
--- /dev/null
+++ b/tests/manual/qnetworkaccessmanager/qget/qget.h
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef QGET_H
+#define QGET_H
+
+#include <QNetworkAccessManager>
+#include <QNetworkRequest>
+#include <QNetworkReply>
+#include <QFile>
+
+class DownloadItem : public QObject
+{
+ Q_OBJECT
+public:
+ DownloadItem(QNetworkReply* r, QNetworkAccessManager& nam);
+ ~DownloadItem();
+
+ QNetworkReply* networkReply() { return reply; }
+
+signals:
+ void downloadFinished(DownloadItem *self);
+private slots:
+ void readyRead();
+ void finished();
+private:
+ QNetworkAccessManager& nam;
+ QNetworkReply* reply;
+ QFile file;
+ QList<QUrl> redirects;
+};
+
+class DownloadManager : public QObject
+{
+ Q_OBJECT
+public:
+ DownloadManager();
+ ~DownloadManager();
+ void get(const QUrl& url);
+ void setProxy(const QNetworkProxy& proxy) { nam.setProxy(proxy); }
+ void setHttpUser(const QString& user) { httpUser = user; }
+ void setHttpPassword(const QString& password) { httpPassword = password; }
+ void setProxyUser(const QString& user) { proxyUser = user; }
+ void setProxyPassword(const QString& password) { proxyPassword = password; }
+
+public slots:
+ void checkForAllDone();
+
+private slots:
+ void finished(QNetworkReply* reply);
+ void authenticationRequired(QNetworkReply* reply, QAuthenticator* authenticator);
+ void proxyAuthenticationRequired(const QNetworkProxy& proxy, QAuthenticator* authenticator);
+ void sslErrors(QNetworkReply* reply, const QList<QSslError>& errors);
+ void downloadFinished(DownloadItem *item);
+private:
+ QNetworkAccessManager nam;
+ QList<DownloadItem*> downloads;
+ QString httpUser;
+ QString httpPassword;
+ QString proxyUser;
+ QString proxyPassword;
+};
+
+#endif // QGET_H
diff --git a/tests/manual/qnetworkaccessmanager/qget/qget.pro b/tests/manual/qnetworkaccessmanager/qget/qget.pro
new file mode 100644
index 0000000000..80af8a556f
--- /dev/null
+++ b/tests/manual/qnetworkaccessmanager/qget/qget.pro
@@ -0,0 +1,10 @@
+TEMPLATE = app
+QT = core network
+CONFIG += console
+
+# Input
+SOURCES += qget.cpp
+HEADERS += qget.h
+
+symbian: TARGET.CAPABILITY += ReadUserData NetworkServices
+
diff --git a/tests/manual/qnetworkreply/main.cpp b/tests/manual/qnetworkreply/main.cpp
index 8033251d06..bade33712e 100644
--- a/tests/manual/qnetworkreply/main.cpp
+++ b/tests/manual/qnetworkreply/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qssloptions/main.cpp b/tests/manual/qssloptions/main.cpp
index 21b5dab1d4..0b7b6b57bc 100644
--- a/tests/manual/qssloptions/main.cpp
+++ b/tests/manual/qssloptions/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qtabletevent/device_information/main.cpp b/tests/manual/qtabletevent/device_information/main.cpp
index 92e7ea4cd8..a8f42ab0a7 100644
--- a/tests/manual/qtabletevent/device_information/main.cpp
+++ b/tests/manual/qtabletevent/device_information/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qtabletevent/device_information/tabletwidget.cpp b/tests/manual/qtabletevent/device_information/tabletwidget.cpp
index 8b1eaab8e3..33b9fb9b0a 100644
--- a/tests/manual/qtabletevent/device_information/tabletwidget.cpp
+++ b/tests/manual/qtabletevent/device_information/tabletwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qtabletevent/device_information/tabletwidget.h b/tests/manual/qtabletevent/device_information/tabletwidget.h
index 0e93c41752..e1a9860f28 100644
--- a/tests/manual/qtabletevent/device_information/tabletwidget.h
+++ b/tests/manual/qtabletevent/device_information/tabletwidget.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qtabletevent/event_compression/main.cpp b/tests/manual/qtabletevent/event_compression/main.cpp
index 324dc17b52..d05f5cc55e 100644
--- a/tests/manual/qtabletevent/event_compression/main.cpp
+++ b/tests/manual/qtabletevent/event_compression/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qtabletevent/event_compression/mousestatwidget.cpp b/tests/manual/qtabletevent/event_compression/mousestatwidget.cpp
index d04563fac4..d43bc50820 100644
--- a/tests/manual/qtabletevent/event_compression/mousestatwidget.cpp
+++ b/tests/manual/qtabletevent/event_compression/mousestatwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qtabletevent/event_compression/mousestatwidget.h b/tests/manual/qtabletevent/event_compression/mousestatwidget.h
index 623f39f814..1a71ca44a4 100644
--- a/tests/manual/qtabletevent/event_compression/mousestatwidget.h
+++ b/tests/manual/qtabletevent/event_compression/mousestatwidget.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qtabletevent/regular_widgets/main.cpp b/tests/manual/qtabletevent/regular_widgets/main.cpp
index 5d589c2cd9..1ecef826ee 100644
--- a/tests/manual/qtabletevent/regular_widgets/main.cpp
+++ b/tests/manual/qtabletevent/regular_widgets/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qtbug-8933/main.cpp b/tests/manual/qtbug-8933/main.cpp
index 5c12a0cc51..c3310637b9 100644
--- a/tests/manual/qtbug-8933/main.cpp
+++ b/tests/manual/qtbug-8933/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qtbug-8933/widget.cpp b/tests/manual/qtbug-8933/widget.cpp
index be0a02d05a..6a87857f91 100644
--- a/tests/manual/qtbug-8933/widget.cpp
+++ b/tests/manual/qtbug-8933/widget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qtbug-8933/widget.h b/tests/manual/qtbug-8933/widget.h
index 5cee97e834..949cd2d11b 100644
--- a/tests/manual/qtbug-8933/widget.h
+++ b/tests/manual/qtbug-8933/widget.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qtouchevent/main.cpp b/tests/manual/qtouchevent/main.cpp
index 105f4a0302..6d5fbca6a6 100644
--- a/tests/manual/qtouchevent/main.cpp
+++ b/tests/manual/qtouchevent/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qtouchevent/touchwidget.cpp b/tests/manual/qtouchevent/touchwidget.cpp
index 2dedc8bfac..c26ab50f14 100644
--- a/tests/manual/qtouchevent/touchwidget.cpp
+++ b/tests/manual/qtouchevent/touchwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qtouchevent/touchwidget.h b/tests/manual/qtouchevent/touchwidget.h
index e3005eccba..61ad0f9a68 100644
--- a/tests/manual/qtouchevent/touchwidget.h
+++ b/tests/manual/qtouchevent/touchwidget.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/qwidget_zorder/main.cpp b/tests/manual/qwidget_zorder/main.cpp
index 5bbe3793a1..11e94bada3 100644
--- a/tests/manual/qwidget_zorder/main.cpp
+++ b/tests/manual/qwidget_zorder/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/repaint/mainwindow/main.cpp b/tests/manual/repaint/mainwindow/main.cpp
index 2cebecca45..5f1020aec6 100644
--- a/tests/manual/repaint/mainwindow/main.cpp
+++ b/tests/manual/repaint/mainwindow/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/repaint/scrollarea/main.cpp b/tests/manual/repaint/scrollarea/main.cpp
index e64304d2c0..e16866c4d6 100644
--- a/tests/manual/repaint/scrollarea/main.cpp
+++ b/tests/manual/repaint/scrollarea/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/repaint/shared/shared.h b/tests/manual/repaint/shared/shared.h
index f6a658688a..6cac04ee39 100644
--- a/tests/manual/repaint/shared/shared.h
+++ b/tests/manual/repaint/shared/shared.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/repaint/splitter/main.cpp b/tests/manual/repaint/splitter/main.cpp
index 8fe1cd2569..a5c329ed82 100644
--- a/tests/manual/repaint/splitter/main.cpp
+++ b/tests/manual/repaint/splitter/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/repaint/tableview/main.cpp b/tests/manual/repaint/tableview/main.cpp
index 6b88e4c9e4..25ccf5364e 100644
--- a/tests/manual/repaint/tableview/main.cpp
+++ b/tests/manual/repaint/tableview/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/repaint/task141091/main.cpp b/tests/manual/repaint/task141091/main.cpp
index 5f753f1af1..ac30142ef4 100644
--- a/tests/manual/repaint/task141091/main.cpp
+++ b/tests/manual/repaint/task141091/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/repaint/toplevel/main.cpp b/tests/manual/repaint/toplevel/main.cpp
index 3a5e813fe8..b5409a2fec 100644
--- a/tests/manual/repaint/toplevel/main.cpp
+++ b/tests/manual/repaint/toplevel/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/repaint/widget/main.cpp b/tests/manual/repaint/widget/main.cpp
index 300f0df1a4..1564bd2909 100644
--- a/tests/manual/repaint/widget/main.cpp
+++ b/tests/manual/repaint/widget/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/socketengine/main.cpp b/tests/manual/socketengine/main.cpp
index 115a187385..c81e323df5 100644
--- a/tests/manual/socketengine/main.cpp
+++ b/tests/manual/socketengine/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/textrendering/glyphshaping/main.cpp b/tests/manual/textrendering/glyphshaping/main.cpp
index a02373f1c8..e3d061dd85 100644
--- a/tests/manual/textrendering/glyphshaping/main.cpp
+++ b/tests/manual/textrendering/glyphshaping/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/textrendering/textperformance/main.cpp b/tests/manual/textrendering/textperformance/main.cpp
index 654aecde4a..e4907e5ee1 100644
--- a/tests/manual/textrendering/textperformance/main.cpp
+++ b/tests/manual/textrendering/textperformance/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/windowflags/controllerwindow.cpp b/tests/manual/windowflags/controllerwindow.cpp
index 2694bb861d..f22ec5ec87 100644
--- a/tests/manual/windowflags/controllerwindow.cpp
+++ b/tests/manual/windowflags/controllerwindow.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/windowflags/controllerwindow.h b/tests/manual/windowflags/controllerwindow.h
index 2ec91168ee..84c39c9d2b 100644
--- a/tests/manual/windowflags/controllerwindow.h
+++ b/tests/manual/windowflags/controllerwindow.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/windowflags/main.cpp b/tests/manual/windowflags/main.cpp
index 6bd72b99f6..18d212b88c 100644
--- a/tests/manual/windowflags/main.cpp
+++ b/tests/manual/windowflags/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/windowflags/previewwindow.cpp b/tests/manual/windowflags/previewwindow.cpp
index 24583220b8..a3e6b49546 100644
--- a/tests/manual/windowflags/previewwindow.cpp
+++ b/tests/manual/windowflags/previewwindow.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/manual/windowflags/previewwindow.h b/tests/manual/windowflags/previewwindow.h
index b58f589fc7..91e68ea6b5 100644
--- a/tests/manual/windowflags/previewwindow.h
+++ b/tests/manual/windowflags/previewwindow.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/shared/filesystem.h b/tests/shared/filesystem.h
index 14cd3a790b..8832574b54 100644
--- a/tests/shared/filesystem.h
+++ b/tests/shared/filesystem.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**