summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/JoinResults.py66
-rw-r--r--tests/auto/_Categories/Qt3Support.txt51
-rw-r--r--tests/auto/_Categories/QtCore.txt118
-rw-r--r--tests/auto/_Categories/QtDBus.txt15
-rw-r--r--tests/auto/_Categories/QtGui.txt196
-rw-r--r--tests/auto/_Categories/QtHelp.txt5
-rw-r--r--tests/auto/_Categories/QtNetwork.txt33
-rw-r--r--tests/auto/_Categories/QtOpenGl.txt1
-rw-r--r--tests/auto/_Categories/QtScript.txt12
-rw-r--r--tests/auto/_Categories/QtSql.txt11
-rw-r--r--tests/auto/_Categories/QtSvg.txt3
-rw-r--r--tests/auto/_Categories/QtTest.txt1
-rw-r--r--tests/auto/_Categories/QtUiTools.txt1
-rw-r--r--tests/auto/_Categories/QtWebkit.txt5
-rw-r--r--tests/auto/_Categories/QtXml.txt5
-rw-r--r--tests/auto/_Categories/QtXmlPatterns.txt27
-rw-r--r--tests/auto/_Categories/all_categories.txt16
-rw-r--r--tests/auto/_Categories/phonon.txt2
-rw-r--r--tests/auto/_Categories/qmake.txt1
-rw-r--r--tests/auto/auto.pro22
-rw-r--r--tests/auto/autobuildruncategory.bat11
-rw-r--r--tests/auto/autobuildrunsingle.bat71
-rw-r--r--tests/auto/autobuildtests.bat19
-rw-r--r--tests/auto/autobuildtestsmain.bat38
-rw-r--r--tests/auto/compilecategory.bat4
-rw-r--r--tests/auto/compilesingle.bat28
-rw-r--r--tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp3
-rw-r--r--tests/auto/headers/tst_headers.cpp84
-rw-r--r--tests/auto/languagechange/tst_languagechange.cpp5
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/finddialog.cpp108
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.ts.result8
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/finddialog.cpp137
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.ts.result8
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before6
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.result6
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergeui/project.ui40
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result22
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result4
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parseui/project.ui40
-rw-r--r--tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result8
-rw-r--r--tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result12
-rw-r--r--tests/auto/linguist/lupdate/testdata/recursivescan/project.ui40
-rw-r--r--tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp139
-rw-r--r--tests/auto/network-settings.h20
-rw-r--r--tests/auto/qaudiodeviceid/tst_qaudiodeviceid.cpp60
-rw-r--r--tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp114
-rw-r--r--tests/auto/qaudioinput/tst_qaudioinput.cpp61
-rw-r--r--tests/auto/qaudiooutput/tst_qaudiooutput.cpp123
-rw-r--r--tests/auto/qcolumnview/qcolumnview.pro4
-rw-r--r--tests/auto/qdesktopservices/qdesktopservices.pro4
-rw-r--r--tests/auto/qdir/tst_qdir.cpp27
-rw-r--r--tests/auto/qdiriterator/tst_qdiriterator.cpp28
-rw-r--r--tests/auto/qdockwidget/tst_qdockwidget.cpp2
-rw-r--r--tests/auto/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp20
-rw-r--r--tests/auto/qfileinfo/qfileinfo.pro5
-rw-r--r--tests/auto/qfileinfo/tst_qfileinfo.cpp52
-rw-r--r--tests/auto/qfilesystemmodel/qfilesystemmodel.pro3
-rw-r--r--tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp31
-rw-r--r--tests/auto/qfontmetrics/tst_qfontmetrics.cpp7
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp68
-rw-r--r--tests/auto/qgraphicsscene/qgraphicsscene.pro2
-rw-r--r--tests/auto/qgraphicsview/tst_qgraphicsview.cpp39
-rw-r--r--tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.pro16
-rw-r--r--tests/auto/qhelpenginecore/tst_qhelpenginecore.cpp2
-rw-r--r--tests/auto/qhelpenginecore/tst_qhelpenginecore.pro17
-rw-r--r--tests/auto/qhostinfo/tst_qhostinfo.cpp2
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_1.tiffbin0 -> 7740 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_2.tiffbin0 -> 9570 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_3.tiffbin0 -> 11392 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_4.tiffbin0 -> 11392 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_5.tiffbin0 -> 11392 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_6.tiffbin0 -> 11392 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_7.tiffbin0 -> 11392 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_8.tiffbin0 -> 11392 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_1.tiffbin0 -> 2382 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_2.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_3.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_4.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_5.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_6.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_7.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/mono_orientation_8.tiffbin0 -> 1608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/original_indexed.tiffbin0 -> 5922 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/original_mono.tiffbin0 -> 786 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/original_rgb.tiffbin0 -> 12608 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_1.tiffbin0 -> 15560 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_2.tiffbin0 -> 17972 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_3.tiffbin0 -> 17324 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_4.tiffbin0 -> 17324 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_5.tiffbin0 -> 17648 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_6.tiffbin0 -> 17324 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_7.tiffbin0 -> 17324 bytes
-rw-r--r--tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_8.tiffbin0 -> 17324 bytes
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp45
-rw-r--r--tests/auto/qkeysequence/tst_qkeysequence.cpp25
-rw-r--r--tests/auto/qlabel/tst_qlabel.cpp2
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp8
-rw-r--r--tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp28
-rw-r--r--tests/auto/qsharedpointer/tst_qsharedpointer.cpp32
-rw-r--r--tests/auto/qtextcodec/test/test.pro17
-rw-r--r--tests/auto/qtextdocument/tst_qtextdocument.cpp39
101 files changed, 826 insertions, 1509 deletions
diff --git a/tests/auto/JoinResults.py b/tests/auto/JoinResults.py
deleted file mode 100644
index 8a98572..0000000
--- a/tests/auto/JoinResults.py
+++ /dev/null
@@ -1,66 +0,0 @@
-import string, sys, os, datetime, time, re
-import socket
-
-Enviroment=''
-RstPath=''
-QtVersion=''
-
-def JoinResults():
- timestamp = time.localtime()
-
- #result_qt_WITH_symbian_ON_2008-05-15_09-42-48_USING_4.4.0-rc1.xml
- rstFileName = time.strftime(RstPath+'\\result\\result_qt_WITH_symbian_ON_%Y-%m-%d_%H-%M-%S_USING_'+QtVersion+'.xml', timestamp)
- rst = open(rstFileName,'w')
-
- rst.write('<?xml version="1.0" encoding="ISO-8859-1"?>\n')
- rst.write('<Testrun>\n')
- rst.write('<Environment>\n')
- rst.write('<HostName>'+socket.gethostname()+'</HostName>\n')
- rst.write('<MakeSpec>symbian-'+Enviroment+'</MakeSpec>\n')
- rst.write('</Environment>\n')
- rst.write(time.strftime('<Timestamp date="%Y-%m-%d" time="%H:%M:%S"/>\n',timestamp))
-
-
- for root, dirs, files in os.walk(RstPath):
- for name in files:
- if not re.search('result_qt_WITH_', name ) and \
- re.match(name.split('.')[1], 'xml'):
- rst.write('<TestCase name="'+name.split('.')[0]+'">\n')
- path = root+'/'+name
- temp = open(path,'r')
- templines = temp.readlines()
- Validate( templines )
- rst.writelines(templines);
- temp.close()
- rst.write('</TestCase>\n')
-
- rst.write('</Testrun>\n')
- rst.close
-
-def Validate(lines):
- regexp1 = re.compile('\s*</TestFunction>\s*')
- regexp2 = re.compile('\s*<TestFunction name=\s*')
- regexp1Flag = False
- regexp2Flag = False
- for index, line in enumerate(lines):
- if len(line) > 0 and regexp1.search(line):
- if regexp1Flag:
- lines[index] = ''
- else:
- regexp1Flag = True
- elif len(line) > 0 and regexp2.search(line):
- if regexp2Flag:
- lines[index] = ''
- else:
- regexp2Flag = True
- else:
- regexp1Flag = False
- regexp2Flag = False
-
-
-if __name__ == '__main__':
- Enviroment = sys.argv[1]
- RstPath = sys.argv[2]
- QtVersion = sys.argv[3]
-
- JoinResults()
diff --git a/tests/auto/_Categories/Qt3Support.txt b/tests/auto/_Categories/Qt3Support.txt
deleted file mode 100644
index a55523c..0000000
--- a/tests/auto/_Categories/Qt3Support.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-q3accel
-q3action
-q3actiongroup
-q3buttongroup
-q3canvas
-q3checklistitem
-q3combobox
-q3cstring
-q3databrowser
-q3dateedit
-q3datetimeedit
-q3deepcopy
-q3dict
-q3dns
-q3dockwindow
-q3filedialog
-q3frame
-q3groupbox
-q3hbox
-q3header
-q3iconview
-q3listbox
-q3listview
-q3listviewitemiterator
-q3mainwindow
-q3popupmenu
-q3process
-q3progressbar
-q3progressdialog
-q3ptrlist
-q3richtext
-q3scrollview
-q3semaphore
-q3serversocket
-q3socket
-q3socketdevice
-q3sqlcursor
-q3sqlselectcursor
-q3stylesheet
-q3tabdialog
-q3table
-q3textbrowser
-q3textedit
-q3textstream
-q3timeedit
-q3toolbar
-q3uridrag
-q3urloperator
-q3valuelist
-q3valuevector
-q3widgetstack
diff --git a/tests/auto/_Categories/QtCore.txt b/tests/auto/_Categories/QtCore.txt
deleted file mode 100644
index 452b6ba..0000000
--- a/tests/auto/_Categories/QtCore.txt
+++ /dev/null
@@ -1,118 +0,0 @@
-# QtCore
-
-collections
-exceptionsafety
-qabstractitemmodel
-#Requires STL
-qalgorithms
-qanimationgroup
-qatomicint
-qatomicpointer
-qbitarray
-qbuffer
-qbytearray
-qbytearraymatcher
-qcache
-qchar
-qcontiguouscache
-qcoreapplication
-qcryptographichash
-qdatastream
-qdate
-qdatetime
-qdebug
-qdir
-qdiriterator
-qeasingcurve
-qevent
-qeventloop
-qexplicitlyshareddatapointer
-qfile cetest-subdir: test
-qfileinfo
-qfilesystemwatcher
-qflags
-qfuture
-qfuturewatcher
-qgetputenv
-qglobal
-qhash
-qiodevice
-qlibrary cetest-subdir: tst
-qline
-qlist
-qlocale cetest-subdir: test
-qmap
-qmetaobject
-qmetatype
-qmutex
-qmutexlocker
-qnumeric
-qobject cetest-pro: tst_qobject.pro
-qobjectperformance
-qobjectrace
-qparallelanimationgroup
-qplugin cetest-pro: tst_qplugin.pro
-qpluginloader cetest-subdir: tst
-qpoint
-qpointer
-qprocess cetest-subdir: test
-qpropertyanimation
-qqueue
-qrand
-qreadlocker
-qreadwritelock
-qrect
-qregexp
-qresourceengine
-qringbuffer
-qscopedpointer
-qsemaphore
-qsequentialanimationgroup
-qset
-qsettings
-qsharedmemory cetest-subdir: test
-qsharedpointer
-qsignalmapper
-qsignalspy
-qsize
-qsizef
-qsocketnotifier
-qstate
-qstatemachine
-#Requires STL
-qstl
-qstring
-qstringlist
-qstringmatcher
-qsysinfo
-qsystemsemaphore cetest-subdir: test
-#qtconcurrentfilter Not supported yet for s60 -> skip(std)
-# Uses std, though unclear if it is actually needed. To be re-investigated when QT_NO_CONCURRENT is removed.
-#qtconcurrentiteratekernel
-#qtconcurrentmap not supported yet for s60 -> skip(std)
-qtconcurrentrun
-qtconcurrentthreadengine
-qtemporaryfile
-qtextboundaryfinder
-qtextcodec
-qtextstream cetest-subdir: test
-qthread
-qthreadonce
-qthreadpool
-qthreadstorage
-qtime
-qtimeline
-qtimer
-# Requires MD5 Qt solutions to work
-#qtmd5
-qtranslator
-qurl
-quuid
-qvariant
-qvarlengtharray
-qvector
-qwaitcondition
-qwineventnotifier
-qwritelocker
-q_func_info
-utf8
diff --git a/tests/auto/_Categories/QtDBus.txt b/tests/auto/_Categories/QtDBus.txt
deleted file mode 100644
index 26490f1..0000000
--- a/tests/auto/_Categories/QtDBus.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-qdbusabstractadaptor
-qdbusconnection
-qdbuscontext
-qdbusinterface
-qdbuslocalcalls
-qdbusmarshall
-qdbusmetaobject
-qdbusmetatype
-qdbuspendingcall
-qdbuspendingreply
-qdbusperformance
-qdbusreply
-qdbusserver
-qdbusthreading
-qdbusxmlparser
diff --git a/tests/auto/_Categories/QtGui.txt b/tests/auto/_Categories/QtGui.txt
deleted file mode 100644
index 495a173..0000000
--- a/tests/auto/_Categories/QtGui.txt
+++ /dev/null
@@ -1,196 +0,0 @@
-exceptionsafety_objects
-#gestures This test is incomplete and also missing from auto.pro -> disabled for now
-#languagechange Uses unexported method QThreadData::current() and also missing from auto.pro -> disabled for now
-math3d
-modeltest
-qabstractbutton
-qabstractitemview
-#qabstractprintdialog NO PRINTING SUPPORT
-qabstractproxymodel
-qabstractscrollarea
-qabstractslider
-qabstractspinbox
-qabstracttextdocumentlayout
-#qaccessibility Requires sql support -> disabled for now
-#qaccessibility_mac
-qaction
-qactiongroup
-qapplication cetest-subdir: test
-qboxlayout
-qbrush
-qbuttongroup
-qcalendarwidget
-qcheckbox
-qclipboard cetest-subdir: test
-qcolor
-qcolordialog
-qcolumnview
-qcombobox
-qcommandlinkbutton
-qcompleter
-qcomplextext
-#qcopchannel QCOP NOT SUPPORTED
-qcssparser
-qdatawidgetmapper
-qdatetimeedit
-qdesktopservices
-qdesktopwidget
-qdial
-qdialog
-qdialogbuttonbox
-#qdirectpainter cetest-subdir: test TEST IS FOR EMBEDDED LINUX ONLY
-qdirmodel
-qdockwidget
-qdoublespinbox
-qdoublevalidator
-qdrag
-qerrormessage
-qfiledialog
-qfileiconprovider
-qfilesystemmodel
-qfocusevent
-qfocusframe
-qfont
-qfontcombobox
-qfontdatabase
-qfontdialog
-qfontmetrics
-qformlayout
-qgraphicsgridlayout
-qgraphicsitem
-qgraphicsitemanimation
-qgraphicslayout
-qgraphicslayoutitem
-qgraphicslinearlayout
-qgraphicsobject
-qgraphicspixmapitem
-qgraphicspolygonitem
-qgraphicsproxywidget
-qgraphicsscene
-qgraphicsview
-qgraphicswidget
-qgridlayout
-qgroupbox
-qguivariant
-qheaderview
-qicoimageformat
-qicon
-qimage
-qimageiohandler
-qimagereader
-qimagewriter
-qinputcontext
-qinputdialog
-qintvalidator
-qitemdelegate
-qitemeditorfactory
-qitemmodel
-qitemselectionmodel
-qitemview
-qkeysequence
-qlabel
-qlayout
-qlcdnumber
-qlineedit
-qlistview
-qlistwidget
-#qmacstyle
-qmainwindow
-#qmdiarea Not relevant for S60, skip for now
-#qmdisubwindow not relevant for S60, skip for now
-qmenu
-qmenubar
-#qmessagebox that's a hanger
-qmouseevent
-qmouseevent_modal
-qmovie
-qmultiscreen
-qpaintengine
-qpainter
-qpainterpath
-qpainterpathstroker
-qpalette
-qpathclipper
-qpen
-qpicture
-qpixmap
-qpixmapcache
-qpixmapfilter
-qplaintextedit
-#qprinter NO PRINTING SUPPORT ON SYMBIAN YET
-#qprinterinfo
-qprogressbar
-qprogressdialog
-qpushbutton
-qradiobutton
-qregexpvalidator
-qregion
-qscrollarea
-qscrollbar
-qshortcut
-qsidebar
-qsizegrip
-qslider
-qsortfilterproxymodel
-qsound
-qspinbox
-qsplitter
-qstackedlayout
-qstackedwidget
-qstandarditem
-qstandarditemmodel
-qstatusbar
-qstringlistmodel
-qstyle
-qstyleoption
-qstylesheetstyle
-qsyntaxhighlighter
-#qsystemtrayicon not relevant for s60, skip for now
-qtabbar
-qtableview
-qtablewidget
-qtabwidget
-qtessellator
-qtextblock
-qtextbrowser
-qtextcursor
-qtextdocument
-qtextdocumentfragment
-qtextdocumentlayout
-qtextedit
-qtextformat
-qtextlayout
-qtextlist
-qtextobject
-qtextodfwriter
-#This test can only be compiled on HW currently, because it does not use reduced exports
-#Because we are planning to use class level exports also in HW later on, there is no
-#sense to enable this at all
-#qtextpiecetable
-qtextscriptengine
-qtexttable
-qtoolbar
-qtoolbox
-qtoolbutton
-qtooltip
-qtouchevent
-qtransform
-qtransformedscreen
-qtreeview
-qtreewidget
-qtreewidgetitemiterator
-qtwidgets
-qundogroup
-qundostack
-qwidget
-qwidgetaction
-qwidget_window
-qwindowsurface
-qwizard
-qwmatrix
-qworkspace
-qwsembedwidget
-qwsinputmethod
-qwswindowsystem
-qx11info
-qzip
diff --git a/tests/auto/_Categories/QtHelp.txt b/tests/auto/_Categories/QtHelp.txt
deleted file mode 100644
index 89e01fc..0000000
--- a/tests/auto/_Categories/QtHelp.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-qhelpcontentmodel
-qhelpenginecore
-qhelpgenerator
-qhelpindexmodel
-qhelpprojectdata
diff --git a/tests/auto/_Categories/QtNetwork.txt b/tests/auto/_Categories/QtNetwork.txt
deleted file mode 100644
index 30645d7..0000000
--- a/tests/auto/_Categories/QtNetwork.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-networkselftest
-#qsocketnotifier
-qabstractnetworkcache
-qabstractsocket
-qftp
-qhostaddress
-qhostinfo
-qhttp
-qhttpnetworkconnection
-qhttpnetworkreply
-qhttpsocketengine
-qlocalsocket cetest-subdir: test
-qnativesocketengine
-#requires gui, but is more network test
-qnetworkaccessmanager_and_qprogressdialog
-qnetworkaddressentry
-qnetworkcachemetadata
-qnetworkcookie
-qnetworkcookiejar
-qnetworkdiskcache
-qnetworkinterface
-qnetworkproxy
-qnetworkreply cetest-subdir: test
-qnetworkrequest
-qsocks5socketengine
-qsslcertificate
-qsslcipher
-qsslerror
-qsslkey
-qsslsocket
-qtcpserver cetest-subdir: test
-qtcpsocket cetest-subdir: test
-qudpsocket cetest-subdir: test
diff --git a/tests/auto/_Categories/QtOpenGl.txt b/tests/auto/_Categories/QtOpenGl.txt
deleted file mode 100644
index a4e12ba..0000000
--- a/tests/auto/_Categories/QtOpenGl.txt
+++ /dev/null
@@ -1 +0,0 @@
-qgl \ No newline at end of file
diff --git a/tests/auto/_Categories/QtScript.txt b/tests/auto/_Categories/QtScript.txt
deleted file mode 100644
index 3b7e79a..0000000
--- a/tests/auto/_Categories/QtScript.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-qscriptable
-qscriptclass
-qscriptcontext
-qscriptcontextinfo
-qscriptengine
-qscriptengineagent
-#qscriptenginedebugger does not compile, requires QtScriptTools.lib
-qscriptjstestsuite
-qscriptstring
-qscriptv8testsuite
-qscriptvalue
-qscriptvalueiterator
diff --git a/tests/auto/_Categories/QtSql.txt b/tests/auto/_Categories/QtSql.txt
deleted file mode 100644
index 4fc1614..0000000
--- a/tests/auto/_Categories/QtSql.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-qsql
-qsqldatabase
-qsqldriver
-qsqlerror
-qsqlfield
-qsqlquery
-qsqlquerymodel
-qsqlrecord
-qsqlrelationaltablemodel
-qsqltablemodel
-qsqlthread
diff --git a/tests/auto/_Categories/QtSvg.txt b/tests/auto/_Categories/QtSvg.txt
deleted file mode 100644
index 8bd3cb2..0000000
--- a/tests/auto/_Categories/QtSvg.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-qsvgdevice
-qsvggenerator
-qsvgrenderer
diff --git a/tests/auto/_Categories/QtTest.txt b/tests/auto/_Categories/QtTest.txt
deleted file mode 100644
index 082a028..0000000
--- a/tests/auto/_Categories/QtTest.txt
+++ /dev/null
@@ -1 +0,0 @@
-selftests
diff --git a/tests/auto/_Categories/QtUiTools.txt b/tests/auto/_Categories/QtUiTools.txt
deleted file mode 100644
index 0df0e3c..0000000
--- a/tests/auto/_Categories/QtUiTools.txt
+++ /dev/null
@@ -1 +0,0 @@
-uiloader \ No newline at end of file
diff --git a/tests/auto/_Categories/QtWebkit.txt b/tests/auto/_Categories/QtWebkit.txt
deleted file mode 100644
index 90ea514..0000000
--- a/tests/auto/_Categories/QtWebkit.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-qwebelement
-qwebframe
-qwebhistory
-qwebhistoryinterface
-qwebpage \ No newline at end of file
diff --git a/tests/auto/_Categories/QtXml.txt b/tests/auto/_Categories/QtXml.txt
deleted file mode 100644
index ec56646..0000000
--- a/tests/auto/_Categories/QtXml.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-qdom
-qxml
-qxmlinputsource
-qxmlsimplereader
-qxmlstream
diff --git a/tests/auto/_Categories/QtXmlPatterns.txt b/tests/auto/_Categories/QtXmlPatterns.txt
deleted file mode 100644
index 17de3ef..0000000
--- a/tests/auto/_Categories/QtXmlPatterns.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-checkxmlfiles
-patternistexamplefiletree
-patternistexamples
-patternistheaders
-qabstractmessagehandler
-qabstracturiresolver
-qabstractxmlforwarditerator
-qabstractxmlnodemodel
-qabstractxmlreceiver
-qapplicationargumentparser
-qautoptr
-qsimplexmlnodemodel
-qsourcelocation
-qtokenautomaton
-qxmlformatter
-qxmlitem
-qxmlname
-qxmlnamepool
-qxmlnodemodelindex
-qxmlquery
-qxmlresultitems
-qxmlserializer
-xmlpatterns
-xmlpatternsdiagnosticsts
-xmlpatternsview
-xmlpatternsxqts
-xmlpatternsxslts
diff --git a/tests/auto/_Categories/all_categories.txt b/tests/auto/_Categories/all_categories.txt
deleted file mode 100644
index cc31f4b..0000000
--- a/tests/auto/_Categories/all_categories.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-#unsorted
-
-atwrapper
-bic
-compile
-compilerwarnings
-headers
-macgui
-macplist
-symbols
-uiloader
-moc
-rcc
-uic
-uic3
-qmake \ No newline at end of file
diff --git a/tests/auto/_Categories/phonon.txt b/tests/auto/_Categories/phonon.txt
deleted file mode 100644
index 67911b3..0000000
--- a/tests/auto/_Categories/phonon.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-mediaobject
-mediaobject_wince_ds9
diff --git a/tests/auto/_Categories/qmake.txt b/tests/auto/_Categories/qmake.txt
deleted file mode 100644
index 8fa141f..0000000
--- a/tests/auto/_Categories/qmake.txt
+++ /dev/null
@@ -1 +0,0 @@
-qmake \ No newline at end of file
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 8adf1b3..cc9f1b9 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -12,8 +12,6 @@ SUBDIRS += \
compilerwarnings \
exceptionsafety \
linguist \
- macgui \
- macplist \
mediaobject \
# mediaobject_wince_ds9 \ This is Windows CE only (we test the second phonon backend ds9 here)
moc \
@@ -75,7 +73,6 @@ SUBDIRS += \
qabstractspinbox \
qabstracttextdocumentlayout \
qaccessibility \
- qaccessibility_mac \
qaction \
qactiongroup \
qalgorithms \
@@ -98,7 +95,6 @@ SUBDIRS += \
qcombobox \
qcompleter \
qcomplextext \
- qcopchannel \
qcoreapplication \
qcryptographichash \
qcssparser \
@@ -114,7 +110,6 @@ SUBDIRS += \
qdialog \
qdialogbuttonbox \
qdir \
- qdirectpainter \
qdirmodel \
qdockwidget \
qdom \
@@ -209,7 +204,6 @@ SUBDIRS += \
qmouseevent \
qmouseevent_modal \
qmovie \
- qmultiscreen \
qmutex \
qmutexlocker \
qnativesocketengine \
@@ -317,6 +311,7 @@ SUBDIRS += \
qstatusbar \
qstl \
qstring \
+ qstringbuilder \
qstringmatcher \
qstringlist \
qstringlistmodel \
@@ -349,7 +344,6 @@ SUBDIRS += \
qtextlayout \
qtextlist \
qtextobject \
- qtextpiecetable \
qtextscriptengine \
qtextstream \
qtexttable \
@@ -404,6 +398,19 @@ SUBDIRS += \
utf8
contains(QT_CONFIG, OdfWriter):SUBDIRS += qzip qtextodfwriter
+mac: {
+ SUBDIRS += macgui \
+ macplist \
+ qaccessibility_mac
+}
+embedded: {
+ SUBDIRS += qcopchannel \
+ qdirectpainter \
+ qmultiscreen
+}
+!win32: {
+ SUBDIRS += qtextpiecetable
+}
# Enable the tests specific to QtXmlPatterns. If you add a test, remember to
# update runQtXmlPatternsTests.sh too. Remember that this file, auto.pro, is
@@ -445,6 +452,7 @@ SUBDIRS += checkxmlfiles \
xmlpatternsdiagnosticsts.depends = xmlpatternsxqts
xmlpatternsview.depends = xmlpatternsxqts
xmlpatternsxslts.depends = xmlpatternsxqts
+xmlpatternsschemats.depends = xmlpatternsxqts
}
unix:!embedded:contains(QT_CONFIG, dbus):SUBDIRS += \
diff --git a/tests/auto/autobuildruncategory.bat b/tests/auto/autobuildruncategory.bat
deleted file mode 100644
index 3f434ee..0000000
--- a/tests/auto/autobuildruncategory.bat
+++ /dev/null
@@ -1,11 +0,0 @@
-@echo off
-REM Compile all test cases from given category file
-
-REM Create root directory for autotest results
-IF NOT EXIST %3 MKDIR %3
-
-REM Set Module variable
-FOR /F %%i IN ("%1") DO SET MODULE=%%~ni
-
-REM run single test
-FOR /F "eol=# tokens=1*" %%i in (%1) do CALL autobuildrunsingle.bat %2 %%i %3 %4 %%j %%k
diff --git a/tests/auto/autobuildrunsingle.bat b/tests/auto/autobuildrunsingle.bat
deleted file mode 100644
index adb9871..0000000
--- a/tests/auto/autobuildrunsingle.bat
+++ /dev/null
@@ -1,71 +0,0 @@
-@echo off
-REM runtest
-
-SET QTVERSION=%4
-
-IF %1 == winscw goto winscw:
-IF %1 == armv5 goto armv5:
-IF %1 == gcce goto gcce:
-goto end:
-
-:winscw
-IF EXIST \epoc32\release\winscw\udeb\tst_%2.exe (
- call \epoc32\release\winscw\udeb\tst_%2.exe -lightxml
- if ERRORLEVEL 1 (
- echo ^<TestFunction name="PANIC"^> >> \Epoc32\winscw\c\system\data\out.txt
- echo ^<Incident type="fail" file="" line="0"^> >> \Epoc32\winscw\c\system\data\out.txt
- echo ^<DataTag^>^<![CDATA[ message ]]^>^</DataTag^> >> \Epoc32\winscw\c\system\data\out.txt
- echo ^<Description^>^<![CDATA['MESSAGE: TEST CASE PANICS]]^>^</Description^> >> \Epoc32\winscw\c\system\data\out.txt
- echo ^</Incident^> >> \Epoc32\winscw\c\system\data\out.txt
- echo ^</TestFunction^> >> \Epoc32\winscw\c\system\data\out.txt )
- copy /Y \Epoc32\winscw\c\system\data\out.txt %3\%2.xml
- goto end:
-) ELSE (
-goto notExist:
-)
-
-:ARMV5
-IF EXIST \epoc32\release\armv5\urel\tst_%2.exe (
- pushd .
- cd %2
- IF _%5 == _cetest-subdir: (
- echo Running cetest from subdir: %6
- cd %6
- )
- IF _%5 == _cetest-pro: (
- call cetest -release -f %6 -project-delete -lightxml -o %3\%2.xml
- ) ELSE (
- call cetest -release -project-delete -lightxml -o %3\%2.xml
- )
- if EXIST %3\%2.xml if ERRORLEVEL 1 (
- echo ^<TestFunction name="PANIC"^> >> %3\%2.xml
- echo ^<Incident type="fail" file="" line="0"^> >> %3\%2.xml
- echo ^<DataTag^>^<![CDATA[ message ]]^>^</DataTag^> >> %3\%2.xml
- echo ^<Description^>^<![CDATA['MESSAGE: TEST CASE PANICS]]^>^</Description^> >> %3\%2.xml
- echo ^</Incident^> >> %3\%2.xml
- echo ^</TestFunction^> >> %3\%2.xml
- )
- popd
- goto end:
-) ELSE (
-goto notExist:
-)
-
-:gcce
-goto end:
-
-:notExist
-echo AAA: %3\%2.xml
-echo ^<Environment^> >> %3\%2.xml
-echo ^<QtVersion^>%QTVERSION%^</QtVersion^> >> %3\%2.xml
-echo ^<QTestVersion^>%QTVERSION%^</QTestVersion^> >> %3\%2.xml
-echo ^</Environment^> >> %3\%2.xml
-echo ^<TestFunction name="initTestCase"^> >> %3\%2.xml
-echo ^<Incident type="fail" file="" line="0"^> >> %3\%2.xml
-echo ^<DataTag^>^<![CDATA[ message ]]^>^</DataTag^> >> %3\%2.xml
-echo ^<Description^>^<![CDATA['MESSAGE: COMPILE FAIL]]^>^</Description^> >> %3\%2.xml
-echo ^</Incident^> >> %3\%2.xml
-echo ^</TestFunction^> >> %3\%2.xml
-goto end:
-
-:end
diff --git a/tests/auto/autobuildtests.bat b/tests/auto/autobuildtests.bat
deleted file mode 100644
index 55ffad7..0000000
--- a/tests/auto/autobuildtests.bat
+++ /dev/null
@@ -1,19 +0,0 @@
-@echo off
-REM NOTE: If this script is modified, it is likely that next automatic test will fail horribly,
-REM unless manual pull from repository is done before running it.
-
-
-REM Sync git
-cd ..\..\
-call git clean -dfx
-//call git reset --hard
-call git pull
-
-
-REM Auto tests builder
-REM 1. argument is enviroment: wincw, armv5 or gcce
-REM 2. argument is result's path: like \autotestResults
-REM 3. argument is path to pscp.exe: like c:\
-
-call tests\auto\autobuildtestsmain.bat %1 %2 %3
-
diff --git a/tests/auto/autobuildtestsmain.bat b/tests/auto/autobuildtestsmain.bat
deleted file mode 100644
index 33ccd15..0000000
--- a/tests/auto/autobuildtestsmain.bat
+++ /dev/null
@@ -1,38 +0,0 @@
-@echo off
-SET QTVERSION=4.4.2
-
-IF NOT EXIST %2\result\sent MKDIR %2\result\sent
-
-REM Delete old results
-del /Q %2\*.*
-
-REM Build enviroment
-set path=%cd%\bin;%path%
-make confclean
-configure -cetest -platform win32-mwc -xplatform symbian-abld -openssl-linked -qconfig symbian
-call bldmake bldfiles
-call abld clean
-call abld reallyclean
-IF %1 == winscw call abld build winscw udeb
-IF %1 == armv5 call abld build armv5 urel
-IF %1 == gcce call abld build gcce urel
-
-REM Build auto tests
-cd \qts60\tests\auto
-for %%i in (QtCore QtGui QtNetwork QtXml QtSvg QtScript) do call compilecategory.bat _Categories\%%i.txt %1
-
-
-REM run auto tests
-cd \qts60\tests\auto
-for %%i in (QtCore QtGui QtNetwork QtXml QtSvg QtScript) do call autobuildruncategory.bat _Categories\%%i.txt %1 %2 %QTVERSION%
-
-REM Collect test results
-cd \qts60\tests\auto
-echo call python joinresults.py %1 %2 %QTVERSION%
-call python joinresults.py %1 %2 %QTVERSION%
-
-REM send the result file
-call %3pscp.exe -i "%USERPROFILE%\.ssh\puttyssh.ppk" %2\Result\*.xml qtestmaster@kramer-nokia.troll.no:/home/qtestmaster/results
-
-REM Copy the result file to different directory that it not sent again
-move %2\Result\*.xml %2\Result\sent
diff --git a/tests/auto/compilecategory.bat b/tests/auto/compilecategory.bat
deleted file mode 100644
index 59e31b5..0000000
--- a/tests/auto/compilecategory.bat
+++ /dev/null
@@ -1,4 +0,0 @@
-@echo off
-REM Compile all test cases from given gategory file
-
-FOR /F "eol=# tokens=1*" %%i in (%1) do CALL compilesingle.bat %%i %2
diff --git a/tests/auto/compilesingle.bat b/tests/auto/compilesingle.bat
deleted file mode 100644
index a9bb5f4..0000000
--- a/tests/auto/compilesingle.bat
+++ /dev/null
@@ -1,28 +0,0 @@
-@echo off
-REM Compile test case from folder as a parameter
-
-pushd .
-cd %1
-REM call abld reallyclean
-call qmake -r
-call bldmake bldfiles
-
-REM reallyclean is not always deleting executables for some reason, so do that explicitly before building
-
-IF %2 == winscw (
-call abld reallyclean winscw
-call del /q /f \epoc32\release\winscw\udeb\tst_%1.exe
-call abld build winscw udeb
-)
-IF %2 == armv5 (
-call abld reallyclean armv5
-call del /q /f \epoc32\release\armv5\urel\tst_%1.exe
-call abld build armv5 urel
-)
-IF %2 == gcce (
-call abld reallyclean gcce
-call del /q /f \epoc32\release\gcce\urel\tst_%1.exe
-call abld build gcce urel
-)
-
-popd \ No newline at end of file
diff --git a/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp b/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp
index e74d158..15c9cfb 100644
--- a/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp
+++ b/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp
@@ -49,7 +49,8 @@ QT_USE_NAMESPACE
// this test only works with
// * GLIBC
// * MSVC - only debug builds (we need the crtdbg.h helpers)
-#if (defined(QT_NO_EXCEPTIONS) || (!defined(__GLIBC__) && !defined(Q_CC_MSVC) && !defined(Q_OS_SYMBIAN))) && !defined(Q_MOC_RUN)
+// * SYMBIAN - only when __UHEAP_BURSTFAILNEXT is available
+#if (defined(QT_NO_EXCEPTIONS) || (!defined(__GLIBC__) && !defined(Q_CC_MSVC) && (!defined(Q_OS_SYMBIAN) || !defined(__UHEAP_BURSTFAILNEXT)))) && !defined(Q_MOC_RUN)
QTEST_NOOP_MAIN
#else
diff --git a/tests/auto/headers/tst_headers.cpp b/tests/auto/headers/tst_headers.cpp
index 51e3a55..f5a11f4 100644
--- a/tests/auto/headers/tst_headers.cpp
+++ b/tests/auto/headers/tst_headers.cpp
@@ -50,7 +50,7 @@ public:
private slots:
void initTestCase();
- void licenseCheck_data() { allHeadersData(); }
+ void licenseCheck_data() { allSourceFilesData(); }
void licenseCheck();
void privateSlots_data() { allHeadersData(); }
@@ -60,11 +60,19 @@ private slots:
void macros();
private:
+ static QStringList getFiles(const QString &path,
+ const QStringList dirFilters,
+ const QRegExp &exclude);
+ static QStringList getHeaders(const QString &path);
+ static QStringList getSourceFiles(const QString &path);
+
+ void allSourceFilesData();
void allHeadersData();
QStringList headers;
const QRegExp copyrightPattern;
const QRegExp licensePattern;
const QRegExp moduleTest;
+ QString qtSrcDir;
};
tst_Headers::tst_Headers() :
@@ -74,29 +82,41 @@ tst_Headers::tst_Headers() :
{
}
-QStringList getHeaders(const QString &path)
+QStringList tst_Headers::getFiles(const QString &path,
+ const QStringList dirFilters,
+ const QRegExp &excludeReg)
{
- QStringList headers;
-
- QDir dir(path);
- QStringList dirs = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
+ const QDir dir(path);
+ const QStringList dirs(dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot));
+ QStringList result;
foreach (QString subdir, dirs)
- headers += getHeaders(path + "/" + subdir);
+ result += getFiles(path + "/" + subdir, dirFilters, excludeReg);
- QStringList entries = dir.entryList(QStringList("*.h"), QDir::Files);
- QRegExp reg("^(?!ui_)");
- entries = entries.filter(reg);
+ QStringList entries = dir.entryList(dirFilters, QDir::Files);
+ entries = entries.filter(excludeReg);
foreach (QString entry, entries)
- headers += path + "/" + entry;
+ result += path + "/" + entry;
- return headers;
+ return result;
+}
+
+QStringList tst_Headers::getHeaders(const QString &path)
+{
+ return getFiles(path, QStringList("*.h"), QRegExp("^(?!ui_)"));
+}
+
+QStringList tst_Headers::getSourceFiles(const QString &path)
+{
+ return getFiles(path, QStringList("*.cpp"), QRegExp("^(?!(moc_|qrc_))"));
}
void tst_Headers::initTestCase()
{
- QString qtSrcDir = QString::fromLocal8Bit(qgetenv("QTSRCDIR").isEmpty()
- ? qgetenv("QTDIR") : qgetenv("QTSRCDIR"));
+ qtSrcDir = QString::fromLocal8Bit(qgetenv("QTSRCDIR").isEmpty()
+ ? qgetenv("QTDIR")
+ : qgetenv("QTSRCDIR"));
+
headers = getHeaders(qtSrcDir + "/src");
#ifndef Q_OS_WINCE
@@ -108,6 +128,30 @@ void tst_Headers::initTestCase()
QVERIFY(licensePattern.isValid());
}
+void tst_Headers::allSourceFilesData()
+{
+ QTest::addColumn<QString>("sourceFile");
+
+ const QStringList sourceFiles(getSourceFiles(qtSrcDir));
+
+ foreach (QString sourceFile, sourceFiles) {
+ if (sourceFile.contains("/3rdparty/")
+ || sourceFile.contains("/config.tests/")
+ || sourceFile.contains("/snippets/")
+ || sourceFile.contains("linguist/lupdate/testdata")
+ || sourceFile.contains("/fulltextsearch/"))
+ continue;
+
+ // This test is crude, but if a file contains this string, we skip it.
+ QFile file(sourceFile);
+ QVERIFY(file.open(QIODevice::ReadOnly));
+ if (file.readAll().contains("This file was generated by"))
+ continue;
+
+ QTest::newRow(qPrintable(sourceFile)) << sourceFile;
+ }
+}
+
void tst_Headers::allHeadersData()
{
QTest::addColumn<QString>("header");
@@ -125,12 +169,14 @@ void tst_Headers::allHeadersData()
void tst_Headers::licenseCheck()
{
- QFETCH(QString, header);
+ QFETCH(QString, sourceFile);
- if (header.endsWith("/qgifhandler.h") || header.endsWith("/qconfig.h"))
+ if (sourceFile.endsWith("/qgifhandler.h")
+ || sourceFile.endsWith("/qconfig.h")
+ || sourceFile.endsWith("/qconfig.cpp"))
return;
- QFile f(header);
+ QFile f(sourceFile);
QVERIFY(f.open(QIODevice::ReadOnly));
QByteArray data = f.readAll();
QStringList content = QString::fromLocal8Bit(data.replace('\r',"")).split("\n");
@@ -138,8 +184,8 @@ void tst_Headers::licenseCheck()
if (content.first().contains("generated"))
content.takeFirst();
- QVERIFY(licensePattern.exactMatch(content.at(7)) ||
- licensePattern.exactMatch(content.at(4)));
+ QVERIFY(licensePattern.exactMatch(content.value(7)) ||
+ licensePattern.exactMatch(content.value(4)));
QString licenseType = licensePattern.cap(1);
int i = 0;
diff --git a/tests/auto/languagechange/tst_languagechange.cpp b/tests/auto/languagechange/tst_languagechange.cpp
index 7cca3bf..7c98809 100644
--- a/tests/auto/languagechange/tst_languagechange.cpp
+++ b/tests/auto/languagechange/tst_languagechange.cpp
@@ -122,10 +122,7 @@ public slots:
void install() {
QCoreApplication::installTranslator(this);
QTest::qWait(2500);
- //### is there any better way to close a Qt dialog?
- QThreadData *data = QThreadData::current();
- if (!data->eventLoops.isEmpty())
- data->eventLoops.top()->quit();
+ QApplication::closeAllWindows();
}
public:
mutable QSet<QByteArray> m_translations;
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/finddialog.cpp b/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/finddialog.cpp
index 7958055..7215ebe 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/finddialog.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/finddialog.cpp
@@ -1,44 +1,3 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the autotests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 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.0, 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.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
#include "finddialog.h"
#include "mainwindow.h"
#include "tabbedbrowser.h"
@@ -51,83 +10,18 @@
#include <QDateTime>
#include <QGridLayout>
-CaseSensitiveModel::CaseSensitiveModel(int rows, int columns, QObject *parent)
- : QStandardItemModel(rows, columns, parent)
-{}
-QModelIndexList CaseSensitiveModel::match(const QModelIndex &start, int role, const QVariant &value,
- int hits, Qt::MatchFlags flags) const
-{
- if (flags == Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap))
- flags |= Qt::MatchCaseSensitive;
-
- return QStandardItemModel::match(start, role, value, hits, flags);
-}
-
FindDialog::FindDialog(MainWindow *parent)
: QDialog(parent)
{
- contentsWidget = new QWidget(this);
- ui.setupUi(contentsWidget);
- ui.comboFind->setModel(new CaseSensitiveModel(0, 1, ui.comboFind));
-
- QVBoxLayout *l = new QVBoxLayout(this);
- l->setMargin(0);
- l->setSpacing(0);
- l->addWidget(contentsWidget);
-
- lastBrowser = 0;
- onceFound = false;
- findExpr.clear();
-
sb = new QStatusBar(this);
l->addWidget(sb);
sb->showMessage(tr("Enter the text you want to find."));
- connect(ui.findButton, SIGNAL(clicked()), this, SLOT(findButtonClicked()));
- connect(ui.closeButton, SIGNAL(clicked()), this, SLOT(reject()));
-}
-
-FindDialog::~FindDialog()
-{
-}
-
-void FindDialog::findButtonClicked()
-{
- doFind(ui.radioForward->isChecked());
}
void FindDialog::doFind(bool forward)
{
- QTextBrowser *browser = static_cast<QTextBrowser*>(mainWindow()->browsers()->currentBrowser());
- sb->clearMessage();
-
- if (ui.comboFind->currentText() != findExpr || lastBrowser != browser)
- onceFound = false;
- findExpr = ui.comboFind->currentText();
-
- QTextDocument::FindFlags flags = 0;
-
- if (ui.checkCase->isChecked())
- flags |= QTextDocument::FindCaseSensitively;
-
- if (ui.checkWords->isChecked())
- flags |= QTextDocument::FindWholeWords;
-
- QTextCursor c = browser->textCursor();
- if (!c.hasSelection()) {
- if (forward)
- c.movePosition(QTextCursor::Start);
- else
- c.movePosition(QTextCursor::End);
-
- browser->setTextCursor(c);
- }
-
- QTextDocument::FindFlags options;
- if (forward == false)
- flags |= QTextDocument::FindBackward;
-
QTextCursor found = browser->document()->find(findExpr, c, flags);
if (found.isNull()) {
if (onceFound) {
@@ -141,8 +35,6 @@ void FindDialog::doFind(bool forward)
} else {
browser->setTextCursor(found);
}
- onceFound |= !found.isNull();
- lastBrowser = browser;
}
bool FindDialog::hasFindExpression() const
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.ts.result
index 21d1ca0..de2c45a 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.ts.result
@@ -4,22 +4,22 @@
<context>
<name>FindDialog</name>
<message>
- <location filename="finddialog.cpp" line="57"/>
+ <location filename="finddialog.cpp" line="19"/>
<source>Enter the text you want to find.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="107"/>
+ <location filename="finddialog.cpp" line="29"/>
<source>Search reached end of the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="109"/>
+ <location filename="finddialog.cpp" line="31"/>
<source>Search reached start of the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="111"/>
+ <location filename="finddialog.cpp" line="33"/>
<source>Text not found</source>
<translation type="unfinished"></translation>
</message>
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/finddialog.cpp b/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/finddialog.cpp
index 045fab1..756c9a3 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/finddialog.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/finddialog.cpp
@@ -1,44 +1,3 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the autotests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 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.0, 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.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
#include "finddialog.h"
#include "mainwindow.h"
#include "tabbedbrowser.h"
@@ -51,86 +10,17 @@
#include <QDateTime>
#include <QGridLayout>
-CaseSensitiveModel::CaseSensitiveModel(int rows, int columns, QObject *parent)
- : QStandardItemModel(rows, columns, parent)
-{}
-QModelIndexList CaseSensitiveModel::match(const QModelIndex &start, int role, const QVariant &value,
- int hits, Qt::MatchFlags flags) const
-{
- if (flags == Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap))
- flags |= Qt::MatchCaseSensitive;
-
- return QStandardItemModel::match(start, role, value, hits, flags);
-}
-
FindDialog::FindDialog(MainWindow *parent)
: QDialog(parent)
{
- contentsWidget = new QWidget(this);
- ui.setupUi(contentsWidget);
- ui.comboFind->setModel(new CaseSensitiveModel(0, 1, ui.comboFind));
-
- QVBoxLayout *l = new QVBoxLayout(this);
- l->setMargin(0);
- l->setSpacing(0);
- l->addWidget(contentsWidget);
-
- lastBrowser = 0;
- onceFound = false;
- findExpr.clear();
-
- sb = new QStatusBar(this);
- l->addWidget(sb);
-
-
// Move it to another line and change the text,
// then lupdate should add this one as a new one, and mark the old one as obsolete.
sb->showMessage(tr("Enter the text you want to find."));
- connect(ui.findButton, SIGNAL(clicked()), this, SLOT(findButtonClicked()));
- connect(ui.closeButton, SIGNAL(clicked()), this, SLOT(reject()));
-}
-
-FindDialog::~FindDialog()
-{
-}
-
-void FindDialog::findButtonClicked()
-{
- doFind(ui.radioForward->isChecked());
}
void FindDialog::doFind(bool forward)
{
- QTextBrowser *browser = static_cast<QTextBrowser*>(mainWindow()->browsers()->currentBrowser());
- sb->clearMessage();
-
- if (ui.comboFind->currentText() != findExpr || lastBrowser != browser)
- onceFound = false;
- findExpr = ui.comboFind->currentText();
-
- QTextDocument::FindFlags flags = 0;
-
- if (ui.checkCase->isChecked())
- flags |= QTextDocument::FindCaseSensitively;
-
- if (ui.checkWords->isChecked())
- flags |= QTextDocument::FindWholeWords;
-
- QTextCursor c = browser->textCursor();
- if (!c.hasSelection()) {
- if (forward)
- c.movePosition(QTextCursor::Start);
- else
- c.movePosition(QTextCursor::End);
-
- browser->setTextCursor(c);
- }
-
- QTextDocument::FindFlags options;
- if (forward == false)
- flags |= QTextDocument::FindBackward;
-
QTextCursor found = browser->document()->find(findExpr, c, flags);
if (found.isNull()) {
if (onceFound) {
@@ -144,31 +34,4 @@ void FindDialog::doFind(bool forward)
} else {
browser->setTextCursor(found);
}
- onceFound |= !found.isNull();
- lastBrowser = browser;
-}
-
-bool FindDialog::hasFindExpression() const
-{
- return !findExpr.isEmpty();
-}
-
-void FindDialog::statusMessage(const QString &message)
-{
- if (isVisible())
- sb->showMessage(message);
- else
- static_cast<MainWindow*>(parent())->statusBar()->showMessage(message, 2000);
-}
-
-MainWindow *FindDialog::mainWindow() const
-{
- return static_cast<MainWindow*>(parentWidget());
-}
-
-void FindDialog::reset()
-{
- ui.comboFind->setFocus();
- ui.comboFind->lineEdit()->setSelection(
- 0, ui.comboFind->lineEdit()->text().length());
}
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.ts.result
index b7074fe..4012182 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.ts.result
@@ -8,22 +8,22 @@
<translation type="obsolete">Skriv inn teksten du soker etter</translation>
</message>
<message>
- <location filename="finddialog.cpp" line="60"/>
+ <location filename="finddialog.cpp" line="18"/>
<source>Enter the text you want to find.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="110"/>
+ <location filename="finddialog.cpp" line="28"/>
<source>Search reached end of the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="112"/>
+ <location filename="finddialog.cpp" line="30"/>
<source>Search reached start of the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="114"/>
+ <location filename="finddialog.cpp" line="32"/>
<source>Text not found</source>
<translation type="unfinished"></translation>
</message>
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before
index 076520a..1ad6ec8 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before
+++ b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before
@@ -3,18 +3,18 @@
<context>
<name>FindDialog</name>
<message>
- <location filename="project.ui" line="27"/>
+ <location filename="project.ui" line="15"/>
<source>Qt Assistant - Find text</source>
<!--should be changed to unfinished, since we are changing the sourcetext in the UI file-->
<translation>Qt Assistant - Finn tekst</translation>
</message>
<message>
- <location filename="project.ui" line="30"/>
+ <location filename="project.ui" line="18"/>
<source>300px</source>
<translation>300px</translation>
</message>
<message>
- <location filename="project.ui" line="33"/>
+ <location filename="project.ui" line="21"/>
<source>400px</source>
<translation type="unfinished"></translation>
</message>
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.result
index b21f583..4c5f74d 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.result
@@ -4,18 +4,18 @@
<context>
<name>FindDialog</name>
<message>
- <location filename="project.ui" line="27"/>
+ <location filename="project.ui" line="15"/>
<source>Qt Assistant - Find Text</source>
<oldsource>Qt Assistant - Find text</oldsource>
<translation type="unfinished">Qt Assistant - Finn tekst</translation>
</message>
<message>
- <location filename="project.ui" line="30"/>
+ <location filename="project.ui" line="18"/>
<source>300px</source>
<translation>300px</translation>
</message>
<message>
- <location filename="project.ui" line="33"/>
+ <location filename="project.ui" line="21"/>
<source>401 pixels</source>
<translation type="unfinished"></translation>
</message>
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ui b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ui
index 2a0bb70..d332eeb 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ui
+++ b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ui
@@ -1,45 +1,5 @@
<ui version="4.0" >
<author></author>
- <comment>*********************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the autotests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 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.0, 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.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
-** $QT_END_LICENSE$
-**
-*********************************************************************</comment>
<exportmacro></exportmacro>
<class>FindDialog</class>
<widget class="QWidget" name="FindDialog" >
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
index 97d3bce..8c48245 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
@@ -79,27 +79,27 @@ backslashed \ stuff.</source>
<context>
<name>FindDialog</name>
<message>
- <location filename="finddialog.cpp" line="57"/>
+ <location filename="finddialog.cpp" line="85"/>
<source>Enter the text you are looking for.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="107"/>
+ <location filename="finddialog.cpp" line="135"/>
<source>Search reached end of the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="109"/>
+ <location filename="finddialog.cpp" line="137"/>
<source>Search reached start of the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="111"/>
+ <location filename="finddialog.cpp" line="139"/>
<source>Text not found</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="147"/>
+ <location filename="finddialog.cpp" line="175"/>
<source>null comment</source>
<translation type="unfinished"></translation>
</message>
@@ -107,7 +107,7 @@ backslashed \ stuff.</source>
<context>
<name>KÃ¥ntekst</name>
<message utf8="true">
- <location filename="finddialog.cpp" line="152"/>
+ <location filename="finddialog.cpp" line="180"/>
<source>encoding, using QApplication</source>
<translation type="unfinished"></translation>
</message>
@@ -151,28 +151,28 @@ backslashed \ stuff.</source>
<context>
<name>QCoreApplication</name>
<message>
- <location filename="finddialog.cpp" line="144"/>
+ <location filename="finddialog.cpp" line="172"/>
<source>with comment</source>
<comment>comment</comment>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="145"/>
+ <location filename="finddialog.cpp" line="173"/>
<source>empty comment</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="146"/>
+ <location filename="finddialog.cpp" line="174"/>
<source>null comment</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="149"/>
+ <location filename="finddialog.cpp" line="177"/>
<source>encoding, using QCoreApplication</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="150"/>
+ <location filename="finddialog.cpp" line="178"/>
<source>encoding, using QApplication</source>
<translation type="unfinished"></translation>
</message>
diff --git a/tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result
index ddf58c3..7f665f4 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result
@@ -4,12 +4,12 @@
<context>
<name>FindDialog</name>
<message>
- <location filename="project.ui" line="27"/>
+ <location filename="project.ui" line="15"/>
<source>Qt Assistant - Finn text</source>
<translation type="unfinished"></translation>
</message>
<message utf8="true">
- <location filename="project.ui" line="30"/>
+ <location filename="project.ui" line="18"/>
<source>Finn tekst - Der Bjørn möchte auch mal.</source>
<translation type="unfinished"></translation>
</message>
diff --git a/tests/auto/linguist/lupdate/testdata/good/parseui/project.ui b/tests/auto/linguist/lupdate/testdata/good/parseui/project.ui
index 9beb8d5..65a00c7 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parseui/project.ui
+++ b/tests/auto/linguist/lupdate/testdata/good/parseui/project.ui
@@ -1,45 +1,5 @@
<ui version="4.0" >
<author></author>
- <comment>*********************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the autotests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 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.0, 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.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
-** $QT_END_LICENSE$
-**
-*********************************************************************</comment>
<exportmacro></exportmacro>
<class>FindDialog</class>
<widget class="QWidget" name="FindDialog" >
diff --git a/tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result b/tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result
index e132342..f6415bf 100644
--- a/tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result
@@ -4,22 +4,22 @@
<context>
<name>FindDialog</name>
<message>
- <location filename="sub/finddialog.cpp" line="57"/>
+ <location filename="sub/finddialog.cpp" line="16"/>
<source>Enter the text you want to find.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="sub/finddialog.cpp" line="107"/>
+ <location filename="sub/finddialog.cpp" line="25"/>
<source>Search reached end of the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="sub/finddialog.cpp" line="109"/>
+ <location filename="sub/finddialog.cpp" line="27"/>
<source>Search reached start of the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="sub/finddialog.cpp" line="111"/>
+ <location filename="sub/finddialog.cpp" line="29"/>
<source>Text not found</source>
<translation type="unfinished"></translation>
</message>
diff --git a/tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result b/tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result
index 6646014..581e4b6 100644
--- a/tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result
@@ -4,32 +4,32 @@
<context>
<name>FindDialog</name>
<message>
- <location filename="project.ui" line="27"/>
+ <location filename="project.ui" line="15"/>
<source>Qt Assistant - Finn text</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="project.ui" line="30"/>
+ <location filename="project.ui" line="18"/>
<source>Finn tekst</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="sub/finddialog.cpp" line="57"/>
+ <location filename="sub/finddialog.cpp" line="16"/>
<source>Enter the text you want to find.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="sub/finddialog.cpp" line="107"/>
+ <location filename="sub/finddialog.cpp" line="25"/>
<source>Search reached end of the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="sub/finddialog.cpp" line="109"/>
+ <location filename="sub/finddialog.cpp" line="27"/>
<source>Search reached start of the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="sub/finddialog.cpp" line="111"/>
+ <location filename="sub/finddialog.cpp" line="29"/>
<source>Text not found</source>
<translation type="unfinished"></translation>
</message>
diff --git a/tests/auto/linguist/lupdate/testdata/recursivescan/project.ui b/tests/auto/linguist/lupdate/testdata/recursivescan/project.ui
index 97553db..8dea10b 100644
--- a/tests/auto/linguist/lupdate/testdata/recursivescan/project.ui
+++ b/tests/auto/linguist/lupdate/testdata/recursivescan/project.ui
@@ -1,45 +1,5 @@
<ui version="4.0" >
<author></author>
- <comment>*********************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the autotests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 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.0, 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.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
-** $QT_END_LICENSE$
-**
-*********************************************************************</comment>
<exportmacro></exportmacro>
<class>FindDialog</class>
<widget class="QWidget" name="FindDialog" >
diff --git a/tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp b/tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp
index 3800ee7..3875473 100644
--- a/tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp
+++ b/tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp
@@ -1,44 +1,3 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the autotests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 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.0, 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.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
#include "finddialog.h"
#include "mainwindow.h"
#include "tabbedbrowser.h"
@@ -51,83 +10,14 @@
#include <QDateTime>
#include <QGridLayout>
-CaseSensitiveModel::CaseSensitiveModel(int rows, int columns, QObject *parent)
- : QStandardItemModel(rows, columns, parent)
-{}
-QModelIndexList CaseSensitiveModel::match(const QModelIndex &start, int role, const QVariant &value,
- int hits, Qt::MatchFlags flags) const
-{
- if (flags == Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap))
- flags |= Qt::MatchCaseSensitive;
-
- return QStandardItemModel::match(start, role, value, hits, flags);
-}
-
FindDialog::FindDialog(MainWindow *parent)
: QDialog(parent)
{
- contentsWidget = new QWidget(this);
- ui.setupUi(contentsWidget);
- ui.comboFind->setModel(new CaseSensitiveModel(0, 1, ui.comboFind));
-
- QVBoxLayout *l = new QVBoxLayout(this);
- l->setMargin(0);
- l->setSpacing(0);
- l->addWidget(contentsWidget);
-
- lastBrowser = 0;
- onceFound = false;
- findExpr.clear();
-
- sb = new QStatusBar(this);
- l->addWidget(sb);
-
sb->showMessage(tr("Enter the text you want to find."));
-
- connect(ui.findButton, SIGNAL(clicked()), this, SLOT(findButtonClicked()));
- connect(ui.closeButton, SIGNAL(clicked()), this, SLOT(reject()));
-}
-
-FindDialog::~FindDialog()
-{
-}
-
-void FindDialog::findButtonClicked()
-{
- doFind(ui.radioForward->isChecked());
}
void FindDialog::doFind(bool forward)
{
- QTextBrowser *browser = static_cast<QTextBrowser*>(mainWindow()->browsers()->currentBrowser());
- sb->clearMessage();
-
- if (ui.comboFind->currentText() != findExpr || lastBrowser != browser)
- onceFound = false;
- findExpr = ui.comboFind->currentText();
-
- QTextDocument::FindFlags flags = 0;
-
- if (ui.checkCase->isChecked())
- flags |= QTextDocument::FindCaseSensitively;
-
- if (ui.checkWords->isChecked())
- flags |= QTextDocument::FindWholeWords;
-
- QTextCursor c = browser->textCursor();
- if (!c.hasSelection()) {
- if (forward)
- c.movePosition(QTextCursor::Start);
- else
- c.movePosition(QTextCursor::End);
-
- browser->setTextCursor(c);
- }
-
- QTextDocument::FindFlags options;
- if (forward == false)
- flags |= QTextDocument::FindBackward;
-
QTextCursor found = browser->document()->find(findExpr, c, flags);
if (found.isNull()) {
if (onceFound) {
@@ -138,34 +28,5 @@ void FindDialog::doFind(bool forward)
} else {
statusMessage(tr( "Text not found" ));
}
- } else {
- browser->setTextCursor(found);
}
- onceFound |= !found.isNull();
- lastBrowser = browser;
-}
-
-bool FindDialog::hasFindExpression() const
-{
- return !findExpr.isEmpty();
-}
-
-void FindDialog::statusMessage(const QString &message)
-{
- if (isVisible())
- sb->showMessage(message);
- else
- static_cast<MainWindow*>(parent())->statusBar()->showMessage(message, 2000);
-}
-
-MainWindow *FindDialog::mainWindow() const
-{
- return static_cast<MainWindow*>(parentWidget());
-}
-
-void FindDialog::reset()
-{
- ui.comboFind->setFocus();
- ui.comboFind->lineEdit()->setSelection(
- 0, ui.comboFind->lineEdit()->text().length());
}
diff --git a/tests/auto/network-settings.h b/tests/auto/network-settings.h
index 1843ffd..702dabb 100644
--- a/tests/auto/network-settings.h
+++ b/tests/auto/network-settings.h
@@ -126,7 +126,7 @@ public:
return "qt-test-server.wildcard.dev." + serverDomainName();
//return "qttest.wildcard.dev." + serverDomainName();
}
-
+
#ifdef QT_NETWORK_LIB
static QHostAddress serverIP()
{
@@ -140,11 +140,11 @@ public:
}
return QHostAddress(serverIp.data());
}
-#endif
+#endif
return QHostInfo::fromName(serverName()).addresses().first();
}
-#endif
-
+#endif
+
static QByteArray expectedReplyIMAP()
{
#ifdef Q_OS_SYMBIAN
@@ -158,16 +158,12 @@ public:
}
return imapExpectedReply.data();
}
-#endif
- /*QByteArray expected( "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] " );
- expected = expected.append(QtNetworkSettings::serverLocalName().toAscii());
- expected = expected.append(" Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");*/
-
- QByteArray expected( "* OK [CAPABILITY IMAP4 IMAP4REV1] " );
- expected = expected.append(QtNetworkSettings::serverLocalName().toAscii());
+#else
+ QByteArray expected( "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] " );
+ expected = expected.append(QtNetworkSettings::serverName().toAscii());
expected = expected.append(" Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n");
-
return expected;
+#endif
}
static QByteArray expectedReplySSL()
diff --git a/tests/auto/qaudiodeviceid/tst_qaudiodeviceid.cpp b/tests/auto/qaudiodeviceid/tst_qaudiodeviceid.cpp
index 8f8d6a6..f87500c 100644
--- a/tests/auto/qaudiodeviceid/tst_qaudiodeviceid.cpp
+++ b/tests/auto/qaudiodeviceid/tst_qaudiodeviceid.cpp
@@ -56,41 +56,61 @@ public:
tst_QAudioDeviceId(QObject* parent=0) : QObject(parent) {}
private slots:
+ void initTestCase();
void checkNull();
void checkEquality();
+
+private:
+ bool available;
};
-void tst_QAudioDeviceId::checkNull()
+void tst_QAudioDeviceId::initTestCase()
{
- // Default constructed is null.
- QAudioDeviceId deviceId0;
- QVERIFY(deviceId0.isNull());
+ // Only perform tests if audio output device exists!
+ QList<QAudioDeviceId> devices = QAudioDeviceInfo::deviceList(QAudio::AudioOutput);
+ if(devices.size() > 0)
+ available = true;
+ else {
+ qWarning()<<"NOTE: no audio output device found, no test will be performed";
+ available = false;
+ }
+}
- // Null is transferred
- QAudioDeviceId deviceId1(deviceId0);
- QVERIFY(deviceId1.isNull());
+void tst_QAudioDeviceId::checkNull()
+{
+ if(available) {
+ // Default constructed is null.
+ QAudioDeviceId deviceId0;
+ QVERIFY(deviceId0.isNull());
+
+ // Null is transferred
+ QAudioDeviceId deviceId1(deviceId0);
+ QVERIFY(deviceId1.isNull());
+ }
}
void tst_QAudioDeviceId::checkEquality()
{
- QAudioDeviceId deviceId0;
- QAudioDeviceId deviceId1;
+ if(available) {
+ QAudioDeviceId deviceId0;
+ QAudioDeviceId deviceId1;
- // Null ids are equivalent
- QVERIFY(deviceId0 == deviceId1);
- QVERIFY(!(deviceId0 != deviceId1));
+ // Null ids are equivalent
+ QVERIFY(deviceId0 == deviceId1);
+ QVERIFY(!(deviceId0 != deviceId1));
- deviceId1 = QAudioDeviceInfo::defaultOutputDevice();
+ deviceId1 = QAudioDeviceInfo::defaultOutputDevice();
- // Different
- QVERIFY(deviceId0 != deviceId1);
- QVERIFY(!(deviceId0 == deviceId1));
+ // Different
+ QVERIFY(deviceId0 != deviceId1);
+ QVERIFY(!(deviceId0 == deviceId1));
- // Same
- deviceId0 = deviceId1;
+ // Same
+ deviceId0 = deviceId1;
- QVERIFY(deviceId0 == deviceId1);
- QVERIFY(!(deviceId0 != deviceId1));
+ QVERIFY(deviceId0 == deviceId1);
+ QVERIFY(!(deviceId0 != deviceId1));
+ }
}
QTEST_MAIN(tst_QAudioDeviceId)
diff --git a/tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp b/tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp
index 72121a7..47f3d00 100644
--- a/tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp
+++ b/tests/auto/qaudiodeviceinfo/tst_qaudiodeviceinfo.cpp
@@ -55,6 +55,7 @@ public:
tst_QAudioDeviceInfo(QObject* parent=0) : QObject(parent) {}
private slots:
+ void initTestCase();
void checkAvailableDefaultInput();
void checkAvailableDefaultOutput();
void outputList();
@@ -69,89 +70,134 @@ private slots:
void nearest();
private:
+ bool available;
QAudioDeviceInfo* device;
};
+void tst_QAudioDeviceInfo::initTestCase()
+{
+ // Only perform tests if audio output device exists!
+ QList<QAudioDeviceId> devices = QAudioDeviceInfo::deviceList(QAudio::AudioOutput);
+ if(devices.size() > 0)
+ available = true;
+ else {
+ qWarning()<<"NOTE: no audio output device found, no test will be performed";
+ available = false;
+ }
+}
+
void tst_QAudioDeviceInfo::checkAvailableDefaultInput()
{
- QVERIFY(!QAudioDeviceInfo::defaultInputDevice().isNull());
+ // Only perform tests if audio input device exists!
+ bool storeAvailable = available;
+ QList<QAudioDeviceId> devices = QAudioDeviceInfo::deviceList(QAudio::AudioInput);
+ if(devices.size() > 0)
+ available = true;
+ else {
+ qWarning()<<"NOTE: no audio input device found, no test will be performed";
+ available = false;
+ }
+ if(available)
+ QVERIFY(!QAudioDeviceInfo::defaultInputDevice().isNull());
+ available = storeAvailable;
}
void tst_QAudioDeviceInfo::checkAvailableDefaultOutput()
{
- QVERIFY(!QAudioDeviceInfo::defaultOutputDevice().isNull());
+ if(available)
+ QVERIFY(!QAudioDeviceInfo::defaultOutputDevice().isNull());
}
void tst_QAudioDeviceInfo::outputList()
{
- QList<QAudioDeviceId> devices = QAudioDeviceInfo::deviceList(QAudio::AudioOutput);
- QVERIFY(devices.size() > 0);
- device = new QAudioDeviceInfo(devices.at(0), this);
+ if(available) {
+ QList<QAudioDeviceId> devices = QAudioDeviceInfo::deviceList(QAudio::AudioOutput);
+ QVERIFY(devices.size() > 0);
+ device = new QAudioDeviceInfo(devices.at(0), this);
+ }
}
void tst_QAudioDeviceInfo::codecs()
{
- QStringList avail = device->supportedCodecs();
- QVERIFY(avail.size() > 0);
+ if(available) {
+ QStringList avail = device->supportedCodecs();
+ QVERIFY(avail.size() > 0);
+ }
}
void tst_QAudioDeviceInfo::channels()
{
- QList<int> avail = device->supportedChannels();
- QVERIFY(avail.size() > 0);
+ if(available) {
+ QList<int> avail = device->supportedChannels();
+ QVERIFY(avail.size() > 0);
+ }
}
void tst_QAudioDeviceInfo::sampleSizes()
{
- QList<int> avail = device->supportedSampleSizes();
- QVERIFY(avail.size() > 0);
+ if(available) {
+ QList<int> avail = device->supportedSampleSizes();
+ QVERIFY(avail.size() > 0);
+ }
}
void tst_QAudioDeviceInfo::byteOrders()
{
- QList<QAudioFormat::Endian> avail = device->supportedByteOrders();
- QVERIFY(avail.size() > 0);
+ if(available) {
+ QList<QAudioFormat::Endian> avail = device->supportedByteOrders();
+ QVERIFY(avail.size() > 0);
+ }
}
void tst_QAudioDeviceInfo::sampleTypes()
{
- QList<QAudioFormat::SampleType> avail = device->supportedSampleTypes();
- QVERIFY(avail.size() > 0);
+ if(available) {
+ QList<QAudioFormat::SampleType> avail = device->supportedSampleTypes();
+ QVERIFY(avail.size() > 0);
+ }
}
void tst_QAudioDeviceInfo::frequencies()
{
- QList<int> avail = device->supportedFrequencies();
- QVERIFY(avail.size() > 0);
+ if(available) {
+ QList<int> avail = device->supportedFrequencies();
+ QVERIFY(avail.size() > 0);
+ }
}
void tst_QAudioDeviceInfo::isformat()
{
- QAudioFormat format;
- format.setFrequency(44100);
- format.setChannels(2);
- format.setSampleType(QAudioFormat::SignedInt);
- format.setByteOrder(QAudioFormat::LittleEndian);
- format.setSampleSize(16);
- format.setCodec("audio/pcm");
-
- // Should always be true for these format
- QVERIFY(device->isFormatSupported(format));
+ if(available) {
+ QAudioFormat format;
+ format.setFrequency(44100);
+ format.setChannels(2);
+ format.setSampleType(QAudioFormat::SignedInt);
+ format.setByteOrder(QAudioFormat::LittleEndian);
+ format.setSampleSize(16);
+ format.setCodec("audio/pcm");
+
+ // Should always be true for these format
+ QVERIFY(device->isFormatSupported(format));
+ }
}
void tst_QAudioDeviceInfo::preferred()
{
- QAudioFormat format = device->preferredFormat();
- QVERIFY(format.frequency() == 44100);
- QVERIFY(format.channels() == 2);
+ if(available) {
+ QAudioFormat format = device->preferredFormat();
+ QVERIFY(format.frequency() == 44100);
+ QVERIFY(format.channels() == 2);
+ }
}
void tst_QAudioDeviceInfo::nearest()
{
- QAudioFormat format1, format2;
- format1.setFrequency(8000);
- format2 = device->nearestFormat(format1);
- QVERIFY(format2.frequency() == 44100);
+ if(available) {
+ QAudioFormat format1, format2;
+ format1.setFrequency(8000);
+ format2 = device->nearestFormat(format1);
+ QVERIFY(format2.frequency() == 44100);
+ }
}
QTEST_MAIN(tst_QAudioDeviceInfo)
diff --git a/tests/auto/qaudioinput/tst_qaudioinput.cpp b/tests/auto/qaudioinput/tst_qaudioinput.cpp
index 891d1c4..6f1d568 100644
--- a/tests/auto/qaudioinput/tst_qaudioinput.cpp
+++ b/tests/auto/qaudioinput/tst_qaudioinput.cpp
@@ -60,6 +60,7 @@ private slots:
void pullFile();
private:
+ bool available;
QAudioFormat format;
QAudioInput* audio;
};
@@ -73,46 +74,62 @@ void tst_QAudioInput::initTestCase()
format.setByteOrder(QAudioFormat::LittleEndian);
format.setSampleType(QAudioFormat::UnSignedInt);
- audio = new QAudioInput(format, this);
+ // Only perform tests if audio input device exists!
+ QList<QAudioDeviceId> devices = QAudioDeviceInfo::deviceList(QAudio::AudioInput);
+ if(devices.size() > 0)
+ available = true;
+ else {
+ qWarning()<<"NOTE: no audio input device found, no test will be performed";
+ available = false;
+ }
+
+ if(available)
+ audio = new QAudioInput(format, this);
}
void tst_QAudioInput::settings()
{
- QAudioFormat f = audio->format();
-
- QVERIFY(format.channels() == f.channels());
- QVERIFY(format.frequency() == f.frequency());
- QVERIFY(format.sampleSize() == f.sampleSize());
- QVERIFY(format.codec() == f.codec());
- QVERIFY(format.byteOrder() == f.byteOrder());
- QVERIFY(format.sampleType() == f.sampleType());
+ if(available) {
+ QAudioFormat f = audio->format();
+
+ QVERIFY(format.channels() == f.channels());
+ QVERIFY(format.frequency() == f.frequency());
+ QVERIFY(format.sampleSize() == f.sampleSize());
+ QVERIFY(format.codec() == f.codec());
+ QVERIFY(format.byteOrder() == f.byteOrder());
+ QVERIFY(format.sampleType() == f.sampleType());
+ }
}
void tst_QAudioInput::notifyInterval()
{
- QVERIFY(audio->notifyInterval() == 1000); // Default
+ if(available) {
+ QVERIFY(audio->notifyInterval() == 1000); // Default
- audio->setNotifyInterval(500);
- QVERIFY(audio->notifyInterval() == 500); // Custom
+ audio->setNotifyInterval(500);
+ QVERIFY(audio->notifyInterval() == 500); // Custom
- audio->setNotifyInterval(1000); // reset
+ audio->setNotifyInterval(1000); // reset
+ }
}
void tst_QAudioInput::pullFile()
{
- QFile filename(SRCDIR "test.raw");
- filename.open( QIODevice::WriteOnly | QIODevice::Truncate );
+ if(available) {
+ QFile filename(SRCDIR "test.raw");
+ filename.open( QIODevice::WriteOnly | QIODevice::Truncate );
- QSignalSpy readSignal(audio, SIGNAL(notify()));
- audio->start(&filename);
+ QSignalSpy readSignal(audio, SIGNAL(notify()));
+ audio->start(&filename);
- QTest::qWait(5000);
+ QTest::qWait(5000);
- QVERIFY(readSignal.count() > 0);
- QVERIFY(audio->totalTime() > 0);
+ QVERIFY(readSignal.count() > 0);
+ QVERIFY(audio->totalTime() > 0);
- audio->stop();
- filename.close();
+ audio->stop();
+ filename.close();
+ }
}
QTEST_MAIN(tst_QAudioInput)
diff --git a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp
index 2c3f662..0552aa4 100644
--- a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp
+++ b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp
@@ -63,6 +63,7 @@ private slots:
void pushFile();
private:
+ bool available;
QAudioFormat format;
QAudioOutput* audio;
};
@@ -76,79 +77,95 @@ void tst_QAudioOutput::initTestCase()
format.setByteOrder(QAudioFormat::LittleEndian);
format.setSampleType(QAudioFormat::UnSignedInt);
+ // Only perform tests if audio output device exists!
+ QList<QAudioDeviceId> devices = QAudioDeviceInfo::deviceList(QAudio::AudioOutput);
+ if(devices.size() > 0)
+ available = true;
+ else {
+ qWarning()<<"NOTE: no audio output device found, no test will be performed";
+ available = false;
+ }
audio = new QAudioOutput(format, this);
}
void tst_QAudioOutput::settings()
{
- QAudioFormat f = audio->format();
-
- QVERIFY(format.channels() == f.channels());
- QVERIFY(format.frequency() == f.frequency());
- QVERIFY(format.sampleSize() == f.sampleSize());
- QVERIFY(format.codec() == f.codec());
- QVERIFY(format.byteOrder() == f.byteOrder());
- QVERIFY(format.sampleType() == f.sampleType());
+ if(available) {
+ QAudioFormat f = audio->format();
+
+ QVERIFY(format.channels() == f.channels());
+ QVERIFY(format.frequency() == f.frequency());
+ QVERIFY(format.sampleSize() == f.sampleSize());
+ QVERIFY(format.codec() == f.codec());
+ QVERIFY(format.byteOrder() == f.byteOrder());
+ QVERIFY(format.sampleType() == f.sampleType());
+ }
}
void tst_QAudioOutput::notifyInterval()
{
- QVERIFY(audio->notifyInterval() == 1000); // Default
+ if(available) {
+ QVERIFY(audio->notifyInterval() == 1000); // Default
- audio->setNotifyInterval(500);
- QVERIFY(audio->notifyInterval() == 500); // Custom
+ audio->setNotifyInterval(500);
+ QVERIFY(audio->notifyInterval() == 500); // Custom
- audio->setNotifyInterval(1000); // reset
+ audio->setNotifyInterval(1000); // reset
+ }
}
void tst_QAudioOutput::pullFile()
{
- QFile filename(SRCDIR "4.wav");
- QVERIFY(filename.exists());
- filename.open(QIODevice::ReadOnly);
-
- QSignalSpy readSignal(audio, SIGNAL(notify()));
- audio->setNotifyInterval(100);
- audio->start(&filename);
-
- QTestEventLoop::instance().enterLoop(1);
- // 4.wav is a little less than 700ms, so notify should fire 6 times!
- QVERIFY(readSignal.count() >= 6);
- QVERIFY(audio->totalTime() == 692250);
-
- audio->stop();
- filename.close();
+ if(available) {
+ QFile filename(SRCDIR "4.wav");
+ QVERIFY(filename.exists());
+ filename.open(QIODevice::ReadOnly);
+
+ QSignalSpy readSignal(audio, SIGNAL(notify()));
+ audio->setNotifyInterval(100);
+ audio->start(&filename);
+
+ QTestEventLoop::instance().enterLoop(1);
+ // 4.wav is a little less than 700ms, so notify should fire 6 times!
+ QVERIFY(readSignal.count() >= 6);
+ QVERIFY(audio->totalTime() == 692250);
+
+ audio->stop();
+ filename.close();
+ }
}
void tst_QAudioOutput::pushFile()
{
- QFile filename(SRCDIR "4.wav");
- QVERIFY(filename.exists());
- filename.open(QIODevice::ReadOnly);
-
- const qint64 fileSize = filename.size();
-
- QIODevice* feed = audio->start(0);
-
- char* buffer = new char[fileSize];
- filename.read(buffer, fileSize);
-
- qint64 counter=0;
- qint64 written=0;
- while(written < fileSize) {
- written+=feed->write(buffer+written,fileSize-written);
- QTest::qWait(20);
- counter++;
+ if(available) {
+ QFile filename(SRCDIR "4.wav");
+ QVERIFY(filename.exists());
+ filename.open(QIODevice::ReadOnly);
+
+ const qint64 fileSize = filename.size();
+
+ QIODevice* feed = audio->start(0);
+
+ char* buffer = new char[fileSize];
+ filename.read(buffer, fileSize);
+
+ qint64 counter=0;
+ qint64 written=0;
+ while(written < fileSize) {
+ written+=feed->write(buffer+written,fileSize-written);
+ QTest::qWait(20);
+ counter++;
+ }
+ QTestEventLoop::instance().enterLoop(1);
+
+ QVERIFY(written == fileSize);
+ QVERIFY(audio->totalTime() == 692250);
+
+ audio->stop();
+ filename.close();
+ delete [] buffer;
+ delete audio;
}
- QTestEventLoop::instance().enterLoop(1);
-
- QVERIFY(written == fileSize);
- QVERIFY(audio->totalTime() == 692250);
-
- audio->stop();
- filename.close();
- delete [] buffer;
- delete audio;
}
QTEST_MAIN(tst_QAudioOutput)
diff --git a/tests/auto/qcolumnview/qcolumnview.pro b/tests/auto/qcolumnview/qcolumnview.pro
index 00e3880..754f06f 100644
--- a/tests/auto/qcolumnview/qcolumnview.pro
+++ b/tests/auto/qcolumnview/qcolumnview.pro
@@ -1,8 +1,4 @@
CONFIG += qttest_p4
-include(../src/qcolumnview.pri)
-
SOURCES += tst_qcolumnview.cpp
TARGET = tst_qcolumnview
-
-
diff --git a/tests/auto/qdesktopservices/qdesktopservices.pro b/tests/auto/qdesktopservices/qdesktopservices.pro
index 7c1bdb9..9ef557d 100644
--- a/tests/auto/qdesktopservices/qdesktopservices.pro
+++ b/tests/auto/qdesktopservices/qdesktopservices.pro
@@ -2,9 +2,6 @@ CONFIG += qttest_p4
SOURCES += tst_qdesktopservices.cpp
TARGET = tst_qdesktopservices
-
-include(../src/qdesktopservices.pri)
-
symbian: {
dummy.sources = text\testfile.txt
dummy.path = .
@@ -30,4 +27,3 @@ symbian: {
#DEPLOYMENT += dummy text
}
-
diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp
index ef31f53..13e8c95 100644
--- a/tests/auto/qdir/tst_qdir.cpp
+++ b/tests/auto/qdir/tst_qdir.cpp
@@ -60,6 +60,12 @@
#define Q_NO_SYMLINKS
#endif
+#if defined(Q_OS_SYMBIAN)
+// Open C in Symbian doesn't support symbolic links to directories
+#define Q_NO_SYMLINKS_TO_DIRS
+#endif
+
+
//TESTED_CLASS=
//TESTED_FILES=
@@ -183,11 +189,20 @@ void tst_QDir::getSetCheck()
tst_QDir::tst_QDir()
{
+#ifdef Q_OS_SYMBIAN
+ // Can't deploy empty test dir, so create it here
+ QDir dir(SRCDIR);
+ dir.mkdir("testData");
+#endif
}
tst_QDir::~tst_QDir()
{
-
+#ifdef Q_OS_SYMBIAN
+ // Remove created test dir
+ QDir dir(SRCDIR);
+ dir.rmdir("testData");
+#endif
}
void tst_QDir::construction()
@@ -707,21 +722,23 @@ void tst_QDir::entryListSimple()
void tst_QDir::entryListWithSymLinks()
{
#ifndef Q_NO_SYMLINKS
+# ifndef Q_NO_SYMLINKS_TO_DIRS
QFile::remove("myLinkToDir.lnk");
+# endif
QFile::remove("myLinkToFile.lnk");
QFile::remove("testfile.cpp");
QDir dir;
dir.mkdir("myDir");
QFile("testfile.cpp").open(QIODevice::WriteOnly);
-#if !defined(Q_OS_SYMBIAN)
+# ifndef Q_NO_SYMLINKS_TO_DIRS
QVERIFY(QFile::link("myDir", "myLinkToDir.lnk"));
-#endif
+# endif
QVERIFY(QFile::link("testfile.cpp", "myLinkToFile.lnk"));
{
QStringList entryList = QDir().entryList();
QVERIFY(entryList.contains("myDir"));
-#if !defined(Q_OS_SYMBIAN)
+# ifndef Q_NO_SYMLINKS_TO_DIRS
QVERIFY(entryList.contains("myLinkToDir.lnk"));
#endif
QVERIFY(entryList.contains("myLinkToFile.lnk"));
@@ -729,7 +746,7 @@ void tst_QDir::entryListWithSymLinks()
{
QStringList entryList = QDir().entryList(QDir::Dirs);
QVERIFY(entryList.contains("myDir"));
-#if !defined(Q_OS_SYMBIAN)
+# ifndef Q_NO_SYMLINKS_TO_DIRS
QVERIFY(entryList.contains("myLinkToDir.lnk"));
#endif
#if defined(Q_OS_SYMBIAN)
diff --git a/tests/auto/qdiriterator/tst_qdiriterator.cpp b/tests/auto/qdiriterator/tst_qdiriterator.cpp
index 1419633..b0f7000 100644
--- a/tests/auto/qdiriterator/tst_qdiriterator.cpp
+++ b/tests/auto/qdiriterator/tst_qdiriterator.cpp
@@ -52,6 +52,11 @@
#define Q_NO_SYMLINKS
#endif
+#if defined(Q_OS_SYMBIAN)
+// Open C in Symbian doesn't support symbolic links to directories
+#define Q_NO_SYMLINKS_TO_DIRS
+#endif
+
Q_DECLARE_METATYPE(QDirIterator::IteratorFlags)
Q_DECLARE_METATYPE(QDir::Filters)
@@ -92,16 +97,20 @@ tst_QDirIterator::tst_QDirIterator()
QFile::remove("entrylist/directory/entrylist4.lnk");
#ifndef Q_NO_SYMLINKS
-#ifdef Q_OS_WIN || defined(Q_OS_SYMBIAN)
+# if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
// ### Sadly, this is a platform difference right now.
QFile::link("entrylist/file", "entrylist/linktofile.lnk");
+# ifndef Q_NO_SYMLINKS_TO_DIRS
QFile::link("entrylist/directory", "entrylist/linktodirectory.lnk");
+# endif
QFile::link("entrylist/nothing", "entrylist/brokenlink.lnk");
-#else
+# else
QFile::link("file", "entrylist/linktofile.lnk");
+# ifndef Q_NO_SYMLINKS_TO_DIRS
QFile::link("directory", "entrylist/linktodirectory.lnk");
+# endif
QFile::link("nothing", "entrylist/brokenlink.lnk");
-#endif
+# endif
#endif
QFile("entrylist/writable").open(QIODevice::ReadWrite);
}
@@ -136,7 +145,7 @@ void tst_QDirIterator::iterateRelativeDirectory_data()
<< QString("entrylist") << QDirIterator::IteratorFlags(0)
<< QDir::Filters(QDir::NoFilter) << QStringList("*")
<< QString(
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
"entrylist/.,"
"entrylist/..,"
#endif
@@ -145,7 +154,7 @@ void tst_QDirIterator::iterateRelativeDirectory_data()
"entrylist/linktofile.lnk,"
#endif
"entrylist/directory,"
-#ifndef Q_NO_SYMLINKS
+#if !defined(Q_NO_SYMLINKS) && !defined(Q_NO_SYMLINKS_TO_DIRS)
"entrylist/linktodirectory.lnk,"
#endif
"entrylist/writable").split(',');
@@ -154,7 +163,7 @@ void tst_QDirIterator::iterateRelativeDirectory_data()
<< QString("entrylist") << QDirIterator::IteratorFlags(QDirIterator::Subdirectories | QDirIterator::FollowSymlinks)
<< QDir::Filters(QDir::NoFilter) << QStringList("*")
<< QString(
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN)
"entrylist/.,"
"entrylist/..,"
"entrylist/directory/.,"
@@ -166,7 +175,7 @@ void tst_QDirIterator::iterateRelativeDirectory_data()
#endif
"entrylist/directory,"
"entrylist/directory/dummy,"
-#ifndef Q_NO_SYMLINKS
+#if !defined(Q_NO_SYMLINKS) && !defined(Q_NO_SYMLINKS_TO_DIRS)
"entrylist/linktodirectory.lnk,"
#endif
"entrylist/writable").split(',');
@@ -200,11 +209,6 @@ void tst_QDirIterator::iterateRelativeDirectory()
QFETCH(QStringList, nameFilters);
QFETCH(QStringList, entries);
-#if defined(Q_OS_SYMBIAN)
- QEXPECT_FAIL("no flags", "Symlink to directories is currently unsupported by Open C", Continue);
- QEXPECT_FAIL("QDir::Subdirectories | QDir::FollowSymlinks", "Symlink to directories is currently unsupported by Open C", Continue);
-#endif // defined(Q_OS_SYMBIAN)
-
QDirIterator it(dirName, nameFilters, filters, flags);
QStringList list;
while (it.hasNext()) {
diff --git a/tests/auto/qdockwidget/tst_qdockwidget.cpp b/tests/auto/qdockwidget/tst_qdockwidget.cpp
index e0548a7..686f62f 100644
--- a/tests/auto/qdockwidget/tst_qdockwidget.cpp
+++ b/tests/auto/qdockwidget/tst_qdockwidget.cpp
@@ -598,7 +598,7 @@ void tst_QDockWidget::visibilityChanged()
QCOMPARE(spy.count(), 0);
mw.addDockWidget(Qt::RightDockWidgetArea, &dw2);
- qApp->processEvents();
+ QTest::qWait(200);
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.at(0).at(0).toBool(), true);
}
diff --git a/tests/auto/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp b/tests/auto/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp
index 4cdeb5c..97e57f1 100644
--- a/tests/auto/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp
+++ b/tests/auto/qexplicitlyshareddatapointer/tst_qexplicitlyshareddatapointer.cpp
@@ -61,6 +61,7 @@ private Q_SLOTS:
void clone() const;
void data() const;
void reset() const;
+ void swap() const;
};
class MyClass : public QSharedData
@@ -233,6 +234,25 @@ void tst_QExplicitlySharedDataPointer::reset() const
}
}
+void tst_QExplicitlySharedDataPointer::swap() const
+{
+ QExplicitlySharedDataPointer<MyClass> p1(0), p2(new MyClass());
+ QVERIFY(!p1.data());
+ QVERIFY(p2.data());
+
+ p1.swap(p2);
+ QVERIFY(p1.data());
+ QVERIFY(!p2.data());
+
+ p1.swap(p2);
+ QVERIFY(!p1.data());
+ QVERIFY(p2.data());
+
+ qSwap(p1, p2);
+ QVERIFY(p1.data());
+ QVERIFY(!p2.data());
+}
+
QTEST_MAIN(tst_QExplicitlySharedDataPointer)
#include "tst_qexplicitlyshareddatapointer.moc"
diff --git a/tests/auto/qfileinfo/qfileinfo.pro b/tests/auto/qfileinfo/qfileinfo.pro
index d46a83b..c3be825 100644
--- a/tests/auto/qfileinfo/qfileinfo.pro
+++ b/tests/auto/qfileinfo/qfileinfo.pro
@@ -13,4 +13,7 @@ wince*:|symbian*: {
DEPLOYMENT = deploy res
}
-symbian:TARGET.CAPABILITY=AllFiles
+symbian {
+ TARGET.CAPABILITY=AllFiles
+ LIBS *= -lefsrv
+ }
diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp
index c53c86c..9184def 100644
--- a/tests/auto/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp
@@ -59,7 +59,10 @@
#endif
#include <qplatformdefs.h>
#include <qdebug.h>
-
+#ifdef Q_OS_SYMBIAN
+#include <f32file.h>
+#include <private/qcore_symbian_p.h>
+#endif
#include "../network-settings.h"
#include <private/qfileinfo_p.h>
@@ -172,6 +175,10 @@ tst_QFileInfo::~tst_QFileInfo()
QFile::remove("link.lnk");
QFile::remove("file1");
QFile::remove("dummyfile");
+#ifdef Q_OS_SYMBIAN
+ QFile::remove("hidden.txt");
+ QFile::remove("nothidden.txt");
+#endif
}
// Testing get/set functions
@@ -1006,13 +1013,13 @@ void tst_QFileInfo::isHidden_data()
QTest::newRow("C:/RECYCLER/.") << QString::fromLatin1("C:/RECYCLER/.") << false;
QTest::newRow("C:/RECYCLER/..") << QString::fromLatin1("C:/RECYCLER/..") << false;
#endif
-#if defined(Q_OS_UNIX)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
QTest::newRow("~/.qt") << QDir::homePath() + QString("/.qt") << true;
QTest::newRow("~/.qt/.") << QDir::homePath() + QString("/.qt/.") << false;
QTest::newRow("~/.qt/..") << QDir::homePath() + QString("/.qt/..") << false;
#endif
-#if !defined(Q_OS_WIN)
+#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN)
QTest::newRow("/bin/") << QString::fromLatin1("/bin/") << false;
#endif
@@ -1021,6 +1028,45 @@ void tst_QFileInfo::isHidden_data()
QTest::newRow("mac_private_etc") << QString::fromLatin1("/private/etc") << false;
QTest::newRow("mac_Applications") << QString::fromLatin1("/Applications") << false;
#endif
+
+#ifdef Q_OS_SYMBIAN
+ // No guaranteed hidden file knows to exist in Symbian filesystem, so make one.
+ QString hiddenFileName("hidden.txt");
+ QString notHiddenFileName("nothidden.txt");
+ QTest::newRow("hidden file") << hiddenFileName << true;
+ QTest::newRow("non-hidden file") << notHiddenFileName << false;
+
+ {
+ QFile file(hiddenFileName);
+ if (file.open(QIODevice::WriteOnly)) {
+ QTextStream t(&file);
+ t << "foobar";
+ } else {
+ qWarning("Failed to create hidden file");
+ }
+ QFile file2(notHiddenFileName);
+ if (file2.open(QIODevice::WriteOnly)) {
+ QTextStream t(&file);
+ t << "foobar";
+ } else {
+ qWarning("Failed to create non-hidden file");
+ }
+ }
+
+ RFs rfs;
+ TInt err = rfs.Connect();
+ if (err == KErrNone) {
+ HBufC* symFile = qt_QString2HBufC(hiddenFileName);
+ err = rfs.SetAtt(*symFile, KEntryAttHidden, 0);
+ rfs.Close();
+ delete symFile;
+ if (err != KErrNone) {
+ qWarning("Failed to set hidden attribute for test file");
+ }
+ } else {
+ qWarning("Failed to open RFs session");
+ }
+#endif
}
void tst_QFileInfo::isHidden()
diff --git a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro
index d421e44..eac16ee 100644
--- a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro
+++ b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro
@@ -1,8 +1,5 @@
CONFIG += qttest_p4
-include(../../src/qfiledialog.pri)
-include(../../../../modeltest/modeltest.pri)
-
QT = core gui
SOURCES += tst_qfilesystemmodel.cpp
diff --git a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
index 907b13e..a3dab07 100644
--- a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
+++ b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp
@@ -73,9 +73,11 @@ private slots:
void removePath();
void addPaths();
void removePaths();
- void watchFileAndItsDirectory();
+
void watchFileAndItsDirectory_data() { basicTest_data(); }
+ void watchFileAndItsDirectory();
+ void cleanup();
private:
QStringList do_force_engines;
bool do_force_native;
@@ -459,12 +461,22 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory()
timer.start(3000);
eventLoop.exec();
QVERIFY(fileChangedSpy.count() > 0);
- QCOMPARE(dirChangedSpy.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
+ //(e.g., when a file is added, -->modified<-- or deleted) or removed from disk.
+ //Note that if there are several changes during a short period of time, some
+ //of the changes might not emit this signal. However, the last change in the
+ //sequence of changes will always generate this signal.
+ //Symbian behaves as documented (and can't be filtered), but the other platforms don't
+ //so test should not assert this
+ QVERIFY(dirChangedSpy.count() < 2);
if (backend == "dnotify")
QSKIP("dnotify is broken, skipping the rest of the test.", SkipSingle);
fileChangedSpy.clear();
+ dirChangedSpy.clear();
QFile secondFile(secondFileName);
secondFile.open(QIODevice::WriteOnly | QIODevice::Truncate);
secondFile.write("Foo");
@@ -473,6 +485,11 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory()
timer.start(3000);
eventLoop.exec();
QCOMPARE(fileChangedSpy.count(), 0);
+#if defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT)
+ // Since native watcher is always used in real devices, this poller issue is irrelevant
+ // Symbian file system does not change modification time on a directory when a file inside is changed
+ QEXPECT_FAIL("poller", "Poller doesn't detect directory changes in RVCT builds", Abort);
+#endif
QCOMPARE(dirChangedSpy.count(), 1);
dirChangedSpy.clear();
@@ -498,5 +515,15 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory()
QVERIFY(QDir().rmdir("testDir"));
}
+void tst_QFileSystemWatcher::cleanup()
+{
+ QDir testDir("testDir");
+ QString testFileName = testDir.filePath("testFile.txt");
+ QString secondFileName = testDir.filePath("testFile2.txt");
+ QFile::remove(testFileName);
+ QFile::remove(secondFileName);
+ QDir().rmdir("testDir");
+}
+
QTEST_MAIN(tst_QFileSystemWatcher)
#include "tst_qfilesystemwatcher.moc"
diff --git a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
index f827bfc..9ffbc05 100644
--- a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
+++ b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
@@ -71,7 +71,7 @@ private slots:
void elidedText();
void veryNarrowElidedText();
void averageCharWidth();
- void elidedMultiLenght();
+ void elidedMultiLength();
};
tst_QFontMetrics::tst_QFontMetrics()
@@ -203,7 +203,7 @@ void tst_QFontMetrics::averageCharWidth()
QVERIFY(fmf.averageCharWidth() != 0);
}
-void tst_QFontMetrics::elidedMultiLenght()
+void tst_QFontMetrics::elidedMultiLength()
{
QString text1 = "Long Text 1\x9cShorter\x9csmall";
QString text1_long = "Long Text 1";
@@ -218,8 +218,9 @@ void tst_QFontMetrics::elidedMultiLenght()
QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_short), text1_short);
QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_short - 1), text1_small);
+ // Not even wide enough for "small" - should use ellipsis
QChar ellipsisChar(0x2026);
- QString text1_el = QString::fromLatin1("sm") + ellipsisChar;
+ QString text1_el = QString::fromLatin1("s") + ellipsisChar;
int width_small = fm.width(text1_el);
QCOMPARE(fm.elidedText(text1,Qt::ElideRight, width_small + 1), text1_el);
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index d49109d..7ff54f2 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -281,6 +281,8 @@ private slots:
void autoDetectFocusProxy();
void subFocus();
void reverseCreateAutoFocusProxy();
+ void focusProxyDeletion();
+ void negativeZStacksBehindParent();
// task specific tests below me
void task141694_textItemEnsureVisible();
@@ -7540,5 +7542,71 @@ void tst_QGraphicsItem::explicitDeleteAutoFocusProxy()
QCOMPARE(text->focusProxy(), (QGraphicsItem *)0);
}
+void tst_QGraphicsItem::focusProxyDeletion()
+{
+ QGraphicsRectItem *rect = new QGraphicsRectItem;
+ QGraphicsRectItem *rect2 = new QGraphicsRectItem;
+ rect->setFocusProxy(rect2);
+ QCOMPARE(rect->focusProxy(), (QGraphicsItem *)rect2);
+
+ delete rect2;
+ QCOMPARE(rect->focusProxy(), (QGraphicsItem *)0);
+
+ rect2 = new QGraphicsRectItem;
+ rect->setFocusProxy(rect2);
+ delete rect; // don't crash
+
+ rect = new QGraphicsRectItem;
+ rect->setFocusProxy(rect2);
+ QGraphicsScene *scene = new QGraphicsScene;
+ scene->addItem(rect);
+ scene->addItem(rect2);
+ delete rect2;
+ QCOMPARE(rect->focusProxy(), (QGraphicsItem *)0);
+
+ rect2 = new QGraphicsRectItem;
+ QTest::ignoreMessage(QtWarningMsg, "QGraphicsItem::setFocusProxy: focus proxy must be in same scene");
+ rect->setFocusProxy(rect2);
+ QCOMPARE(rect->focusProxy(), (QGraphicsItem *)0);
+ scene->addItem(rect2);
+ rect->setFocusProxy(rect2);
+ QCOMPARE(rect->focusProxy(), (QGraphicsItem *)rect2);
+ delete rect; // don't crash
+
+ rect = new QGraphicsRectItem;
+ rect2 = new QGraphicsRectItem;
+ rect->setFocusProxy(rect2);
+ QCOMPARE(rect->focusProxy(), (QGraphicsItem *)rect2);
+ scene->addItem(rect);
+ scene->addItem(rect2);
+ rect->setFocusProxy(rect2);
+ delete scene; // don't crash
+}
+
+void tst_QGraphicsItem::negativeZStacksBehindParent()
+{
+ QGraphicsRectItem rect;
+ QCOMPARE(rect.zValue(), qreal(0.0));
+ QVERIFY(!(rect.flags() & QGraphicsItem::ItemNegativeZStacksBehindParent));
+ QVERIFY(!(rect.flags() & QGraphicsItem::ItemStacksBehindParent));
+ rect.setZValue(-1);
+ QCOMPARE(rect.zValue(), qreal(-1.0));
+ QVERIFY(!(rect.flags() & QGraphicsItem::ItemStacksBehindParent));
+ rect.setZValue(0);
+ rect.setFlag(QGraphicsItem::ItemNegativeZStacksBehindParent);
+ QVERIFY(rect.flags() & QGraphicsItem::ItemNegativeZStacksBehindParent);
+ QVERIFY(!(rect.flags() & QGraphicsItem::ItemStacksBehindParent));
+ rect.setZValue(-1);
+ QVERIFY(rect.flags() & QGraphicsItem::ItemStacksBehindParent);
+ rect.setZValue(0);
+ QVERIFY(!(rect.flags() & QGraphicsItem::ItemStacksBehindParent));
+ rect.setFlag(QGraphicsItem::ItemNegativeZStacksBehindParent, false);
+ rect.setZValue(-1);
+ rect.setFlag(QGraphicsItem::ItemNegativeZStacksBehindParent, true);
+ QVERIFY(rect.flags() & QGraphicsItem::ItemStacksBehindParent);
+ rect.setFlag(QGraphicsItem::ItemNegativeZStacksBehindParent, false);
+ QVERIFY(rect.flags() & QGraphicsItem::ItemStacksBehindParent);
+}
+
QTEST_MAIN(tst_QGraphicsItem)
#include "tst_qgraphicsitem.moc"
diff --git a/tests/auto/qgraphicsscene/qgraphicsscene.pro b/tests/auto/qgraphicsscene/qgraphicsscene.pro
index 6b8bc70..31bb769 100644
--- a/tests/auto/qgraphicsscene/qgraphicsscene.pro
+++ b/tests/auto/qgraphicsscene/qgraphicsscene.pro
@@ -6,7 +6,7 @@ win32:!wince*: LIBS += -lUser32
!wince*:!symbian:DEFINES += SRCDIR=\\\"$$PWD\\\"
DEFINES += QT_NO_CAST_TO_ASCII
-wince*!symbian*: {
+wince*|symbian*: {
rootFiles.sources = Ash_European.jpg graphicsScene_selection.data
rootFiles.path = .
renderFiles.sources = testData\render\*
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
index a043d49..364def4 100644
--- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
@@ -216,6 +216,7 @@ private slots:
void task239047_fitInViewSmallViewport();
void task245469_itemsAtPointWithClip();
void task253415_reconnectUpdateSceneOnSceneChanged();
+ void task255529_transformationAnchorMouseAndViewportMargins();
};
void tst_QGraphicsView::initTestCase()
@@ -2531,7 +2532,7 @@ void tst_QGraphicsView::scrollBarRanges()
QSKIP("No Motif style compiled.", SkipSingle);
#endif
} else {
-#if defined(Q_OS_WINCE)
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
view.setStyle(new QWindowsStyle);
#elif !defined(QT_NO_STYLE_PLASTIQUE)
view.setStyle(new QPlastiqueStyle);
@@ -3627,5 +3628,41 @@ void tst_QGraphicsView::task253415_reconnectUpdateSceneOnSceneChanged()
QVERIFY(wasConnected2);
}
+void tst_QGraphicsView::task255529_transformationAnchorMouseAndViewportMargins()
+{
+ QGraphicsScene scene(-100, -100, 200, 200);
+ scene.addRect(QRectF(-50, -50, 100, 100), QPen(Qt::black), QBrush(Qt::blue));
+
+ class VpGraphicsView: public QGraphicsView
+ {
+ public:
+ VpGraphicsView(QGraphicsScene *scene)
+ : QGraphicsView(scene)
+ {
+ setViewportMargins(8, 16, 12, 20);
+ setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
+ setMouseTracking(true);
+ }
+ };
+
+ VpGraphicsView view(&scene);
+ view.show();
+ QPoint mouseViewPos(20, 20);
+ sendMouseMove(view.viewport(), mouseViewPos);
+ QTest::qWait(125);
+
+ QPointF mouseScenePos = view.mapToScene(mouseViewPos);
+ view.setTransform(QTransform().scale(5, 5));
+ QTest::qWait(125);
+ view.setTransform(QTransform().rotate(5, Qt::ZAxis), true);
+ QTest::qWait(125);
+
+ QPointF newMouseScenePos = view.mapToScene(mouseViewPos);
+ qreal slack = 3;
+ QVERIFY(qAbs(newMouseScenePos.x() - mouseScenePos.x()) < slack);
+ QVERIFY(qAbs(newMouseScenePos.y() - mouseScenePos.y()) < slack);
+}
+
+
QTEST_MAIN(tst_QGraphicsView)
#include "tst_qgraphicsview.moc"
diff --git a/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.pro b/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.pro
index 7cd8d51..889aac9 100644
--- a/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.pro
+++ b/tests/auto/qhelpcontentmodel/tst_qhelpcontentmodel.pro
@@ -3,6 +3,20 @@ SOURCES += tst_qhelpcontentmodel.cpp
CONFIG += help
-DEFINES += SRCDIR=\\\"$$PWD\\\"
DEFINES += QT_USE_USING_NAMESPACE
!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS
+
+wince*: {
+ DEFINES += SRCDIR=\\\"./\\\"
+ QT += network
+ addFiles.sources = $$PWD/data/*.*
+ addFiles.path = data
+ clucene.sources = $$QT_BUILD_TREE/lib/QtCLucene*.dll
+
+ DEPLOYMENT += addFiles
+ DEPLOYMENT += clucene
+
+ DEPLOYMENT_PLUGIN += qsqlite
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+} \ No newline at end of file
diff --git a/tests/auto/qhelpenginecore/tst_qhelpenginecore.cpp b/tests/auto/qhelpenginecore/tst_qhelpenginecore.cpp
index 499c367..d765c25 100644
--- a/tests/auto/qhelpenginecore/tst_qhelpenginecore.cpp
+++ b/tests/auto/qhelpenginecore/tst_qhelpenginecore.cpp
@@ -98,6 +98,8 @@ void tst_QHelpEngineCore::init()
// defined in profile
m_path = QLatin1String(SRCDIR);
+ m_path = QFileInfo(m_path).absoluteFilePath();
+
m_colFile = m_path + QLatin1String("/data/col.qhc");
if (QFile::exists(m_colFile))
QDir::current().remove(m_colFile);
diff --git a/tests/auto/qhelpenginecore/tst_qhelpenginecore.pro b/tests/auto/qhelpenginecore/tst_qhelpenginecore.pro
index 11fca8e..27ebd0f 100644
--- a/tests/auto/qhelpenginecore/tst_qhelpenginecore.pro
+++ b/tests/auto/qhelpenginecore/tst_qhelpenginecore.pro
@@ -3,6 +3,21 @@ SOURCES += tst_qhelpenginecore.cpp
CONFIG += help
QT += sql
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+
DEFINES += QT_USE_USING_NAMESPACE
!contains(QT_BUILD_PARTS, tools): DEFINES += QT_NO_BUILD_TOOLS
+
+wince*: {
+ DEFINES += SRCDIR=\\\"./\\\"
+ QT += network
+ addFiles.sources = $$PWD/data/*.*
+ addFiles.path = data
+ clucene.sources = $$QT_BUILD_TREE/lib/QtCLucene*.dll
+
+ DEPLOYMENT += addFiles
+ DEPLOYMENT += clucene
+
+ DEPLOYMENT_PLUGIN += qsqlite
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD\\\"
+}
diff --git a/tests/auto/qhostinfo/tst_qhostinfo.cpp b/tests/auto/qhostinfo/tst_qhostinfo.cpp
index 7d43f5a..e129f87 100644
--- a/tests/auto/qhostinfo/tst_qhostinfo.cpp
+++ b/tests/auto/qhostinfo/tst_qhostinfo.cpp
@@ -313,7 +313,7 @@ void tst_QHostInfo::reverseLookup_data()
// ### Use internal DNS instead. Discussed with Andreas.
//QTest::newRow("classical.hexago.com") << QString("2001:5c0:0:2::24") << QStringList(QString("classical.hexago.com")) << 0;
- QTest::newRow("www.cisco.com") << QString("198.133.219.25") << QStringList(QString("origin-www.cisco.com")) << 0;
+ QTest::newRow("origin.cisco.com") << QString("12.159.148.94") << QStringList(QString("origin.cisco.com")) << 0;
QTest::newRow("bogusexample.doenstexist.org") << QString("1::2::3::4") << QStringList() << 1;
}
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_1.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_1.tiff
new file mode 100644
index 0000000..3fcb8a9
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_1.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_2.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_2.tiff
new file mode 100644
index 0000000..6f3e9d5
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_2.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_3.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_3.tiff
new file mode 100644
index 0000000..aab9cf2
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_3.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_4.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_4.tiff
new file mode 100644
index 0000000..aad96ff
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_4.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_5.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_5.tiff
new file mode 100644
index 0000000..05d23dc
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_5.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_6.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_6.tiff
new file mode 100644
index 0000000..9ffe7fc
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_6.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_7.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_7.tiff
new file mode 100644
index 0000000..eeeb019
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_7.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_8.tiff b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_8.tiff
new file mode 100644
index 0000000..87cf2fd
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/indexed_orientation_8.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_1.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_1.tiff
new file mode 100644
index 0000000..3b589b2
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_1.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_2.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_2.tiff
new file mode 100644
index 0000000..9a66223
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_2.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_3.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_3.tiff
new file mode 100644
index 0000000..eed2423
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_3.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_4.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_4.tiff
new file mode 100644
index 0000000..055480e
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_4.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_5.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_5.tiff
new file mode 100644
index 0000000..b4d0974
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_5.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_6.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_6.tiff
new file mode 100644
index 0000000..3b1e02a
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_6.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_7.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_7.tiff
new file mode 100644
index 0000000..b752c74
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_7.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_8.tiff b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_8.tiff
new file mode 100644
index 0000000..e228d05
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/mono_orientation_8.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/original_indexed.tiff b/tests/auto/qimagereader/images/tiff_oriented/original_indexed.tiff
new file mode 100644
index 0000000..7507e52
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/original_indexed.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/original_mono.tiff b/tests/auto/qimagereader/images/tiff_oriented/original_mono.tiff
new file mode 100644
index 0000000..8ff9db8
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/original_mono.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/original_rgb.tiff b/tests/auto/qimagereader/images/tiff_oriented/original_rgb.tiff
new file mode 100644
index 0000000..321ea3e
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/original_rgb.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_1.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_1.tiff
new file mode 100644
index 0000000..2756a82
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_1.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_2.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_2.tiff
new file mode 100644
index 0000000..ae9af09
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_2.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_3.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_3.tiff
new file mode 100644
index 0000000..a2f4325
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_3.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_4.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_4.tiff
new file mode 100644
index 0000000..f35bfc4
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_4.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_5.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_5.tiff
new file mode 100644
index 0000000..70e5478
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_5.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_6.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_6.tiff
new file mode 100644
index 0000000..b2635fe
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_6.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_7.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_7.tiff
new file mode 100644
index 0000000..1fb0cd9
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_7.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_8.tiff b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_8.tiff
new file mode 100644
index 0000000..666b1b4
--- /dev/null
+++ b/tests/auto/qimagereader/images/tiff_oriented/rgb_orientation_8.tiff
Binary files differ
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index 30a934c..1d19baa 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -153,6 +153,9 @@ private slots:
void tiffCompression_data();
void tiffCompression();
void tiffEndianness();
+
+ void tiffOrientation_data();
+ void tiffOrientation();
#endif
void autoDetectImageFormat();
@@ -1314,6 +1317,48 @@ void tst_QImageReader::tiffEndianness()
QCOMPARE(littleEndian, bigEndian);
}
+void tst_QImageReader::tiffOrientation_data()
+{
+ QTest::addColumn<QString>("expected");
+ QTest::addColumn<QString>("oriented");
+ QTest::newRow("Indexed TIFF, orientation1") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_1.tiff";
+ QTest::newRow("Indexed TIFF, orientation2") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_2.tiff";
+ QTest::newRow("Indexed TIFF, orientation3") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_3.tiff";
+ QTest::newRow("Indexed TIFF, orientation4") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_4.tiff";
+ QTest::newRow("Indexed TIFF, orientation5") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_5.tiff";
+ QTest::newRow("Indexed TIFF, orientation6") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_6.tiff";
+ QTest::newRow("Indexed TIFF, orientation7") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_7.tiff";
+ QTest::newRow("Indexed TIFF, orientation8") << "tiff_oriented/original_indexed.tiff" << "tiff_oriented/indexed_orientation_8.tiff";
+
+ QTest::newRow("Mono TIFF, orientation1") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_1.tiff";
+ QTest::newRow("Mono TIFF, orientation2") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_2.tiff";
+ QTest::newRow("Mono TIFF, orientation3") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_3.tiff";
+ QTest::newRow("Mono TIFF, orientation4") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_4.tiff";
+ QTest::newRow("Mono TIFF, orientation5") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_5.tiff";
+ QTest::newRow("Mono TIFF, orientation6") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_6.tiff";
+ QTest::newRow("Mono TIFF, orientation7") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_7.tiff";
+ QTest::newRow("Mono TIFF, orientation8") << "tiff_oriented/original_mono.tiff" << "tiff_oriented/mono_orientation_8.tiff";
+
+ QTest::newRow("RGB TIFF, orientation1") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_1.tiff";
+ QTest::newRow("RGB TIFF, orientation2") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_2.tiff";
+ QTest::newRow("RGB TIFF, orientation3") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_3.tiff";
+ QTest::newRow("RGB TIFF, orientation4") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_4.tiff";
+ QTest::newRow("RGB TIFF, orientation5") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_5.tiff";
+ QTest::newRow("RGB TIFF, orientation6") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_6.tiff";
+ QTest::newRow("RGB TIFF, orientation7") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_7.tiff";
+ QTest::newRow("RGB TIFF, orientation8") << "tiff_oriented/original_rgb.tiff" << "tiff_oriented/rgb_orientation_8.tiff";
+}
+
+void tst_QImageReader::tiffOrientation()
+{
+ QFETCH(QString, expected);
+ QFETCH(QString, oriented);
+
+ QImage expectedImage(prefix + expected);
+ QImage orientedImage(prefix + oriented);
+ QCOMPARE(expectedImage, orientedImage);
+}
+
#endif
void tst_QImageReader::dotsPerMeter_data()
diff --git a/tests/auto/qkeysequence/tst_qkeysequence.cpp b/tests/auto/qkeysequence/tst_qkeysequence.cpp
index ec36075..6deee02 100644
--- a/tests/auto/qkeysequence/tst_qkeysequence.cpp
+++ b/tests/auto/qkeysequence/tst_qkeysequence.cpp
@@ -311,15 +311,7 @@ void tst_QKeySequence::standardKeys_data()
QTest::newRow("zoomOut") << (int)QKeySequence::ZoomOut<< QString("CTRL+-");
QTest::newRow("whatsthis") << (int)QKeySequence::WhatsThis<< QString("SHIFT+F1");
-#ifndef Q_WS_MAC
- QTest::newRow("help") << (int)QKeySequence::HelpContents<< QString("F1");
- QTest::newRow("nextChild") << (int)QKeySequence::NextChild<< QString("CTRL+Tab");
- QTest::newRow("previousChild") << (int)QKeySequence::PreviousChild<< QString("CTRL+SHIFT+BACKTAB");
- QTest::newRow("forward") << (int)QKeySequence::Forward << QString("ALT+RIGHT");
- QTest::newRow("backward") << (int)QKeySequence::Back << QString("ALT+LEFT");
- QTest::newRow("MoveToEndOfBlock") << (int)QKeySequence::MoveToEndOfBlock<< QString(""); //mac only
- QTest::newRow("SelectEndOfDocument") << (int)QKeySequence::SelectEndOfDocument<< QString("CTRL+SHIFT+END"); //mac only
-#else
+#if defined(Q_WS_MAC)
QTest::newRow("help") << (int)QKeySequence::HelpContents<< QString("Ctrl+?");
QTest::newRow("nextChild") << (int)QKeySequence::NextChild << QString("CTRL+}");
QTest::newRow("previousChild") << (int)QKeySequence::PreviousChild << QString("CTRL+{");
@@ -327,6 +319,17 @@ void tst_QKeySequence::standardKeys_data()
QTest::newRow("forward") << (int)QKeySequence::Forward << QString("CTRL+]");
QTest::newRow("backward") << (int)QKeySequence::Back << QString("CTRL+[");
QTest::newRow("SelectEndOfDocument") << (int)QKeySequence::SelectEndOfDocument<< QString("CTRL+SHIFT+DOWN"); //mac only
+#elif defined(Q_WS_S60)
+ QTest::newRow("help") << (int)QKeySequence::HelpContents<< QString("F2");
+ QTest::newRow("SelectEndOfDocument") << (int)QKeySequence::SelectEndOfDocument<< QString("CTRL+SHIFT+END"); //mac only
+#else
+ QTest::newRow("help") << (int)QKeySequence::HelpContents<< QString("F1");
+ QTest::newRow("nextChild") << (int)QKeySequence::NextChild<< QString("CTRL+Tab");
+ QTest::newRow("previousChild") << (int)QKeySequence::PreviousChild<< QString("CTRL+SHIFT+BACKTAB");
+ QTest::newRow("forward") << (int)QKeySequence::Forward << QString("ALT+RIGHT");
+ QTest::newRow("backward") << (int)QKeySequence::Back << QString("ALT+LEFT");
+ QTest::newRow("MoveToEndOfBlock") << (int)QKeySequence::MoveToEndOfBlock<< QString(""); //mac only
+ QTest::newRow("SelectEndOfDocument") << (int)QKeySequence::SelectEndOfDocument<< QString("CTRL+SHIFT+END"); //mac only
#endif
}
@@ -343,7 +346,7 @@ void tst_QKeySequence::keyBindings()
{
QList<QKeySequence> bindings = QKeySequence::keyBindings(QKeySequence::Copy);
QList<QKeySequence> expected;
-#ifdef Q_WS_MAC
+#if defined(Q_WS_MAC) || defined (Q_WS_S60)
expected << QKeySequence("CTRL+C");
#elif defined Q_WS_X11
expected << QKeySequence("CTRL+C") << QKeySequence("F16") << QKeySequence("CTRL+INSERT");
@@ -505,7 +508,7 @@ void tst_QKeySequence::translated()
#ifdef Q_WS_MAC
QSKIP("No need to translate modifiers on Mac OS X", SkipAll);
#elif defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
- QSKIP("No need to translate modifiers on WinCE", SkipAll);
+ QSKIP("No need to translate modifiers on WinCE or Symbian", SkipAll);
#endif
qApp->installTranslator(ourTranslator);
diff --git a/tests/auto/qlabel/tst_qlabel.cpp b/tests/auto/qlabel/tst_qlabel.cpp
index 13a75c1..3ff5bb4 100644
--- a/tests/auto/qlabel/tst_qlabel.cpp
+++ b/tests/auto/qlabel/tst_qlabel.cpp
@@ -54,7 +54,7 @@
//TESTED_CLASS=
//TESTED_FILES=
#if defined(Q_OS_SYMBIAN)
-# define SRCDIR "."
+# define SRCDIR ""
#endif
class Widget : public QWidget
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index 7321fe9..35d4cf3 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -1011,6 +1011,14 @@ void tst_QPixmap::fromSymbianCFbsBitmap()
bitmapContext->Clear();
__UHEAP_MARK;
+ { // Test the null case
+ CFbsBitmap *bitmap = 0;
+ QPixmap pixmap = QPixmap::fromSymbianCFbsBitmap(bitmap);
+ QVERIFY(pixmap.isNull());
+ }
+ __UHEAP_MARKEND;
+
+ __UHEAP_MARK;
{ // Test the normal case
QPixmap pixmap = QPixmap::fromSymbianCFbsBitmap(nativeBitmap);
// QCOMPARE(pixmap.depth(), expectedDepth); // Depth is not preserved now
diff --git a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
index 5af6f39..3ff177a 100644
--- a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
+++ b/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp
@@ -113,6 +113,7 @@ private slots:
void oneKeyValue();
void updateOnSetKeyValues();
void restart();
+ void valueChanged();
};
tst_QPropertyAnimation::tst_QPropertyAnimation()
@@ -1052,6 +1053,33 @@ void tst_QPropertyAnimation::restart()
anim.start();
}
+void tst_QPropertyAnimation::valueChanged()
+{
+ qRegisterMetaType<QVariant>("QVariant");
+
+ //we check that we receive the valueChanged signal
+ MyErrorObject o;
+ o.setOle(0);
+ QCOMPARE(o.property("ole").toInt(), 0);
+ QPropertyAnimation anim(&o, "ole");
+ anim.setEndValue(5);
+ anim.setDuration(1000);
+ QSignalSpy spy(&anim, SIGNAL(valueChanged(QVariant)));
+ anim.start();
+
+ QTest::qWait(anim.duration() + 50);
+
+ QCOMPARE(anim.state(), QAbstractAnimation::Stopped);
+ QCOMPARE(anim.currentTime(), anim.duration());
+
+ //let's check that the values go forward
+ QCOMPARE(spy.count(), 6); //we should have got everything from 0 to 5
+ for (int i = 0; i < spy.count(); ++i) {
+ QCOMPARE(qvariant_cast<QVariant>(spy.at(i).first()).toInt(), i);
+ }
+}
+
+
QTEST_MAIN(tst_QPropertyAnimation)
#include "tst_qpropertyanimation.moc"
diff --git a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
index 69511e6..c33121c 100644
--- a/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
+++ b/tests/auto/qsharedpointer/tst_qsharedpointer.cpp
@@ -66,6 +66,7 @@ class tst_QSharedPointer: public QObject
private slots:
void basics_data();
void basics();
+ void swap();
void forwardDeclaration1();
void forwardDeclaration2();
void memoryManagement();
@@ -267,6 +268,37 @@ void tst_QSharedPointer::basics()
// aData is deleted here
}
+void tst_QSharedPointer::swap()
+{
+ QSharedPointer<int> p1, p2(new int(42)), control = p2;
+ QVERIFY(p1 != control);
+ QVERIFY(p1.isNull());
+ QVERIFY(p2 == control);
+ QVERIFY(!p2.isNull());
+ QVERIFY(*p2 == 42);
+
+ p1.swap(p2);
+ QVERIFY(p1 == control);
+ QVERIFY(!p1.isNull());
+ QVERIFY(p2 != control);
+ QVERIFY(p2.isNull());
+ QVERIFY(*p1 == 42);
+
+ p1.swap(p2);
+ QVERIFY(p1 != control);
+ QVERIFY(p1.isNull());
+ QVERIFY(p2 == control);
+ QVERIFY(!p2.isNull());
+ QVERIFY(*p2 == 42);
+
+ qSwap(p1, p2);
+ QVERIFY(p1 == control);
+ QVERIFY(!p1.isNull());
+ QVERIFY(p2 != control);
+ QVERIFY(p2.isNull());
+ QVERIFY(*p1 == 42);
+}
+
class ForwardDeclared;
ForwardDeclared *forwardPointer();
void externalForwardDeclaration();
diff --git a/tests/auto/qtextcodec/test/test.pro b/tests/auto/qtextcodec/test/test.pro
index 36cac7c..afd7f5e 100644
--- a/tests/auto/qtextcodec/test/test.pro
+++ b/tests/auto/qtextcodec/test/test.pro
@@ -1,6 +1,21 @@
load(qttest_p4)
-TARGET = ../tst_qtextcodec
+
SOURCES += ../tst_qtextcodec.cpp
+
+!wince*: {
+TARGET = ../tst_qtextcodec
+
+win32: {
+ CONFIG(debug, debug|release) {
+ TARGET = ../../debug/tst_qtextcodec
+} else {
+ TARGET = ../../release/tst_qtextcodec
+ }
+}
+} else {
+ TARGET = tst_qtextcodec
+}
+
wince*|symbian {
addFiles.sources = ../*.txt
addFiles.path = .
diff --git a/tests/auto/qtextdocument/tst_qtextdocument.cpp b/tests/auto/qtextdocument/tst_qtextdocument.cpp
index 72f3ea8..4643df0 100644
--- a/tests/auto/qtextdocument/tst_qtextdocument.cpp
+++ b/tests/auto/qtextdocument/tst_qtextdocument.cpp
@@ -55,8 +55,13 @@
#include <qtextlist.h>
#include <qtextcodec.h>
#include <qurl.h>
+#include <qpainter.h>
+#include <qfontmetrics.h>
+#include <qimage.h>
+#include <qtextlayout.h>
#include "common.h"
+
QT_FORWARD_DECLARE_CLASS(QTextDocument)
//TESTED_CLASS=
@@ -93,6 +98,8 @@ private slots:
void noundo_isModified3();
void mightBeRichText();
+ void task240325();
+
void toHtml_data();
void toHtml();
void toHtml2();
@@ -532,6 +539,38 @@ void tst_QTextDocument::noundo_basicIsModifiedChecks()
QCOMPARE(spy.count(), 0);
}
+void tst_QTextDocument::task240325()
+{
+ doc->setHtml("<html><img width=\"100\" height=\"100\" align=\"right\"/>Foobar Foobar Foobar Foobar</html>");
+
+ QImage img(1000, 7000, QImage::Format_ARGB32_Premultiplied);
+ QPainter p(&img);
+ QFontMetrics fm(p.font());
+
+ // Set page size to contain image and one "Foobar"
+ doc->setPageSize(QSize(100 + fm.width("Foobar")*2, 1000));
+
+ // Force layout
+ doc->drawContents(&p);
+
+ QCOMPARE(doc->blockCount(), 1);
+ for (QTextBlock block = doc->begin() ; block!=doc->end() ; block = block.next()) {
+ QTextLayout *layout = block.layout();
+ QCOMPARE(layout->lineCount(), 4);
+ for (int lineIdx=0;lineIdx<layout->lineCount();++lineIdx) {
+ QTextLine line = layout->lineAt(lineIdx);
+
+ QString text = block.text().mid(line.textStart(), line.textLength()).trimmed();
+
+ // Remove start token
+ if (lineIdx == 0)
+ text = text.mid(1);
+
+ QCOMPARE(text, QString::fromLatin1("Foobar"));
+ }
+ }
+}
+
void tst_QTextDocument::noundo_moreIsModified()
{
doc->setUndoRedoEnabled(false);