From 5e33f94ace72c01802befcdcf0d07fdcbf0aeaf4 Mon Sep 17 00:00:00 2001 From: mread Date: Tue, 4 Aug 2009 10:05:45 +0100 Subject: deleteing test objects for improved memory leak tracking. added test start parameter for easier tweaking --- .../tst_exceptionsafety_objects.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp b/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp index c867899..c2c0685 100644 --- a/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp +++ b/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp @@ -165,9 +165,9 @@ void tst_ExceptionSafetyObjects::objects_data() // create and destructs an object, and lets each and every allocation // during construction and destruction fail. -static void doOOMTest(AbstractObjectCreator *creator, QObject *parent) +static void doOOMTest(AbstractObjectCreator *creator, QObject *parent, int start=0) { - int currentOOMIndex = 0; + int currentOOMIndex = start; bool caught = false; bool done = false; @@ -278,7 +278,9 @@ void tst_ExceptionSafetyObjects::initTestCase() (void) std::set_new_handler(nh_func); #endif - doOOMTest(new ObjectCreator, 0); + ObjectCreator *selfTest = new ObjectCreator; + doOOMTest(selfTest, 0); + delete selfTest; QCOMPARE(alloc1Failed, 1); QCOMPARE(alloc2Failed, 1); QCOMPARE(alloc3Failed, 2); @@ -292,6 +294,8 @@ void tst_ExceptionSafetyObjects::objects() QFETCH(AbstractObjectCreator *, objectCreator); doOOMTest(objectCreator, 0); + + delete objectCreator; } template @@ -391,10 +395,12 @@ void tst_ExceptionSafetyObjects::widgets() { QFETCH(AbstractObjectCreator *, widgetCreator); - doOOMTest(widgetCreator, 0); + doOOMTest(widgetCreator, 0, 00000); QWidget parent; - doOOMTest(widgetCreator, &parent); + doOOMTest(widgetCreator, &parent, 00000); + + delete widgetCreator; // if the test reaches here without crashing, we passed :) QVERIFY(true); -- cgit v0.12 From 12b37100d5fff9a2309cd8e86cd90325b63cc485 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Tue, 4 Aug 2009 13:34:57 +0300 Subject: 'Trailing whitespace' and 'blank line' fixes for demos and examples --- demos/chip/chip.pro | 1 - demos/demobase.pri | 4 ++-- demos/interview/interview.pro | 1 - demos/mainwindow/mainwindow.pro | 1 - demos/spreadsheet/spreadsheet.pro | 1 - demos/textedit/textedit.pro | 1 - demos/undo/undo.pro | 1 - examples/examplebase.pri | 5 ++--- examples/network/ftp/ftpwindow.cpp | 18 +++++++++--------- examples/network/ftp/main.cpp | 6 +++--- examples/network/ftp/sym_iap_util.h | 2 +- examples/painting/svgviewer/svgviewer.pro | 2 +- examples/sql/drilldown/drilldown.pro | 4 ++-- examples/sql/drilldown/informationwindow.cpp | 4 ++-- examples/sql/drilldown/main.cpp | 8 ++++---- examples/sql/drilldown/view.cpp | 14 +++++++------- examples/widgets/softkeys/softkeys.cpp | 2 +- 17 files changed, 34 insertions(+), 41 deletions(-) diff --git a/demos/chip/chip.pro b/demos/chip/chip.pro index 2c44e56..a24a634 100644 --- a/demos/chip/chip.pro +++ b/demos/chip/chip.pro @@ -18,4 +18,3 @@ sources.path = $$[QT_INSTALL_DEMOS]/chip INSTALLS += target sources include($$QT_SOURCE_TREE/demos/demobase.pri) - diff --git a/demos/demobase.pri b/demos/demobase.pri index 724f64b..9ec8fe9 100644 --- a/demos/demobase.pri +++ b/demos/demobase.pri @@ -1,6 +1,6 @@ symbian { - RSS_RULES ="group_name=\"QtDemos\";" - + RSS_RULES ="group_name=\"QtDemos\";" + vendorinfo = \ "; Localised Vendor name" \ "%{\"Nokia, Qt Software\"}" \ diff --git a/demos/interview/interview.pro b/demos/interview/interview.pro index 19b2ca8..0faa21f 100644 --- a/demos/interview/interview.pro +++ b/demos/interview/interview.pro @@ -17,4 +17,3 @@ sources.path = $$[QT_INSTALL_DEMOS]/interview INSTALLS += target sources include($$QT_SOURCE_TREE/demos/demobase.pri) - diff --git a/demos/mainwindow/mainwindow.pro b/demos/mainwindow/mainwindow.pro index 6e7d784..87b42be 100644 --- a/demos/mainwindow/mainwindow.pro +++ b/demos/mainwindow/mainwindow.pro @@ -15,4 +15,3 @@ sources.path = $$[QT_INSTALL_DEMOS]/mainwindow INSTALLS += target sources include($$QT_SOURCE_TREE/demos/demobase.pri) - diff --git a/demos/spreadsheet/spreadsheet.pro b/demos/spreadsheet/spreadsheet.pro index 5cf251a..102b75d 100644 --- a/demos/spreadsheet/spreadsheet.pro +++ b/demos/spreadsheet/spreadsheet.pro @@ -32,4 +32,3 @@ sources.path = $$[QT_INSTALL_DEMOS]/spreadsheet INSTALLS += target sources include($$QT_SOURCE_TREE/demos/demobase.pri) - diff --git a/demos/textedit/textedit.pro b/demos/textedit/textedit.pro index 6f15e70..8b29a45 100644 --- a/demos/textedit/textedit.pro +++ b/demos/textedit/textedit.pro @@ -20,4 +20,3 @@ sources.path = $$[QT_INSTALL_DEMOS]/textedit INSTALLS += target sources include($$QT_SOURCE_TREE/demos/demobase.pri) - diff --git a/demos/undo/undo.pro b/demos/undo/undo.pro index bf7017b..a4257cd 100644 --- a/demos/undo/undo.pro +++ b/demos/undo/undo.pro @@ -16,4 +16,3 @@ sources.path = $$[QT_INSTALL_DEMOS]/undo INSTALLS += target sources include($$QT_SOURCE_TREE/demos/demobase.pri) - diff --git a/examples/examplebase.pri b/examples/examplebase.pri index 70e1c37..caaf819 100644 --- a/examples/examplebase.pri +++ b/examples/examplebase.pri @@ -1,6 +1,6 @@ symbian { - RSS_RULES ="group_name=\"QtExamples\";" - + RSS_RULES ="group_name=\"QtExamples\";" + vendorinfo = \ "; Localised Vendor name" \ "%{\"Nokia, Qt Software\"}" \ @@ -10,4 +10,3 @@ symbian { " " default_deployment.pkg_prerules += vendorinfo } - \ No newline at end of file diff --git a/examples/network/ftp/ftpwindow.cpp b/examples/network/ftp/ftpwindow.cpp index ffab8b4..b60da66 100644 --- a/examples/network/ftp/ftpwindow.cpp +++ b/examples/network/ftp/ftpwindow.cpp @@ -56,10 +56,10 @@ FtpWindow::FtpWindow(QWidget *parent) ftpServerLabel->setBuddy(ftpServerLineEdit); statusLabel = new QLabel(tr("Please enter the name of an FTP server.")); -#ifdef Q_OS_SYMBIAN - // Use word wrapping to fit the text on screen +#ifdef Q_OS_SYMBIAN + // Use word wrapping to fit the text on screen statusLabel->setWordWrap( true ); -#endif +#endif fileList = new QTreeWidget; fileList->setEnabled(false); @@ -69,7 +69,7 @@ FtpWindow::FtpWindow(QWidget *parent) connectButton = new QPushButton(tr("Connect")); connectButton->setDefault(true); - + cdToParentButton = new QPushButton; cdToParentButton->setIcon(QPixmap(":/images/cdtoparent.png")); cdToParentButton->setEnabled(false); @@ -105,15 +105,15 @@ FtpWindow::FtpWindow(QWidget *parent) // Make app better lookin on small screen QHBoxLayout *topLayout2 = new QHBoxLayout; topLayout2->addWidget(cdToParentButton); - topLayout2->addWidget(connectButton); + topLayout2->addWidget(connectButton); #endif - + QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addLayout(topLayout); -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN // Make app better lookin on small screen mainLayout->addLayout(topLayout2); -#endif +#endif mainLayout->addWidget(fileList); mainLayout->addWidget(statusLabel); mainLayout->addWidget(buttonBox); @@ -161,7 +161,7 @@ void FtpWindow::connectOrDisconnect() setCursor(Qt::WaitCursor); #endif -//![1] +//![1] ftp = new QFtp(this); connect(ftp, SIGNAL(commandFinished(int, bool)), this, SLOT(ftpCommandFinished(int, bool))); diff --git a/examples/network/ftp/main.cpp b/examples/network/ftp/main.cpp index f928bcb..978db0b 100644 --- a/examples/network/ftp/main.cpp +++ b/examples/network/ftp/main.cpp @@ -55,12 +55,12 @@ int main(int argc, char *argv[]) // in order that user can access the downloaded content QDir::setCurrent( "c:\\data" ); #endif - QApplication app(argc, argv); + QApplication app(argc, argv); FtpWindow ftpWin; -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN // Make application better looking and more usable on small screen ftpWin.showMaximized(); -#else +#else ftpWin.show(); #endif return ftpWin.exec(); diff --git a/examples/network/ftp/sym_iap_util.h b/examples/network/ftp/sym_iap_util.h index 74fe93a..c399b35 100644 --- a/examples/network/ftp/sym_iap_util.h +++ b/examples/network/ftp/sym_iap_util.h @@ -293,7 +293,7 @@ static QString qt_RouteInfoL() { return output; } -QString qt_TDesC2QStringL(const TDesC& aDescriptor) +QString qt_TDesC2QStringL(const TDesC& aDescriptor) { #ifdef QT_NO_UNICODE return QString::fromLocal8Bit(aDescriptor.Ptr(), aDescriptor.Length()); diff --git a/examples/painting/svgviewer/svgviewer.pro b/examples/painting/svgviewer/svgviewer.pro index 523dcf6..ea77946 100644 --- a/examples/painting/svgviewer/svgviewer.pro +++ b/examples/painting/svgviewer/svgviewer.pro @@ -28,5 +28,5 @@ symbian: { TARGET.UID3 = 0xA000A64E addFiles.sources = files\*.svg addFiles.path = . - DEPLOYMENT += addFiles + DEPLOYMENT += addFiles } diff --git a/examples/sql/drilldown/drilldown.pro b/examples/sql/drilldown/drilldown.pro index 7907bd2..1d0714b 100644 --- a/examples/sql/drilldown/drilldown.pro +++ b/examples/sql/drilldown/drilldown.pro @@ -1,7 +1,7 @@ HEADERS = ../connection.h \ imageitem.h \ informationwindow.h \ - view.h + view.h RESOURCES = drilldown.qrc SOURCES = imageitem.cpp \ informationwindow.cpp \ @@ -15,6 +15,6 @@ sources.files = $$SOURCES *.h $$RESOURCES $$FORMS drilldown.pro *.png *.jpg imag sources.path = $$[QT_INSTALL_EXAMPLES]/sql/drilldown INSTALLS += target sources -symbian:TARGET.UID3 = 0xA000C612 +symbian:TARGET.UID3 = 0xA000C612 include($$QT_SOURCE_TREE/examples/examplebase.pri) diff --git a/examples/sql/drilldown/informationwindow.cpp b/examples/sql/drilldown/informationwindow.cpp index b01b753..8b5fd0c 100644 --- a/examples/sql/drilldown/informationwindow.cpp +++ b/examples/sql/drilldown/informationwindow.cpp @@ -101,9 +101,9 @@ InformationWindow::InformationWindow(int id, QSqlRelationalTableModel *offices, setWindowFlags(Qt::Window); enableButtons(false); setWindowTitle(tr("Office: %1").arg(locationText->text())); -#ifndef Q_OS_SYMBIAN +#ifndef Q_OS_SYMBIAN resize(320, sizeHint().height()); -#endif +#endif } //! [4] diff --git a/examples/sql/drilldown/main.cpp b/examples/sql/drilldown/main.cpp index 432849d..57a11ed 100644 --- a/examples/sql/drilldown/main.cpp +++ b/examples/sql/drilldown/main.cpp @@ -54,10 +54,10 @@ int main(int argc, char *argv[]) return 1; View view("offices", "images"); -#ifndef Q_OS_SYMBIAN +#ifndef Q_OS_SYMBIAN view.show(); -#else - view.showFullScreen(); -#endif +#else + view.showFullScreen(); +#endif return app.exec(); } diff --git a/examples/sql/drilldown/view.cpp b/examples/sql/drilldown/view.cpp index e288ac6..349547a 100644 --- a/examples/sql/drilldown/view.cpp +++ b/examples/sql/drilldown/view.cpp @@ -62,15 +62,15 @@ View::View(const QString &offices, const QString &images, QWidget *parent) QGraphicsPixmapItem *logo = scene->addPixmap(QPixmap(":/logo.png")); logo->setPos(30, 515); - + #ifndef Q_OS_SYMBIAN setMinimumSize(470, 620); - setMaximumSize(470, 620); + setMaximumSize(470, 620); #else - setDragMode(QGraphicsView::ScrollHandDrag); -#endif + setDragMode(QGraphicsView::ScrollHandDrag); +#endif - setWindowTitle(tr("Offices World Wide")); + setWindowTitle(tr("Offices World Wide")); } //! [1] @@ -135,7 +135,7 @@ void View::showInformation(ImageItem *image) window->show(); #else window->showFullScreen(); -#endif +#endif } else { InformationWindow *window; window = new InformationWindow(id, officeTable, this); @@ -148,7 +148,7 @@ void View::showInformation(ImageItem *image) window->show(); #else window->showFullScreen(); -#endif +#endif informationWindows.append(window); } } diff --git a/examples/widgets/softkeys/softkeys.cpp b/examples/widgets/softkeys/softkeys.cpp index 110f2e6..d8ab09a 100644 --- a/examples/widgets/softkeys/softkeys.cpp +++ b/examples/widgets/softkeys/softkeys.cpp @@ -65,7 +65,7 @@ MainWindow::MainWindow(QWidget *parent) toggleButton = new QPushButton(tr("Custom softkeys"), this); toggleButton->setContextMenuPolicy(Qt::NoContextMenu); - toggleButton->setCheckable(true); + toggleButton->setCheckable(true); pushButton = new QPushButton(tr("Open File Dialog"), this); pushButton->setContextMenuPolicy(Qt::NoContextMenu); -- cgit v0.12 From 4b07c9d95087cc69956bfe309cd9b4eec26235ec Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Tue, 4 Aug 2009 13:45:34 +0300 Subject: Further code style cleanup fro demos and examples --- examples/draganddrop/dropsite/dropsite.pro | 1 - examples/draganddrop/fridgemagnets/dragwidget.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/draganddrop/dropsite/dropsite.pro b/examples/draganddrop/dropsite/dropsite.pro index 268e247..a42f717 100644 --- a/examples/draganddrop/dropsite/dropsite.pro +++ b/examples/draganddrop/dropsite/dropsite.pro @@ -11,4 +11,3 @@ sources.path = $$[QT_INSTALL_EXAMPLES]/draganddrop/dropsite INSTALLS += target sources include($$QT_SOURCE_TREE/examples/examplebase.pri) - diff --git a/examples/draganddrop/fridgemagnets/dragwidget.cpp b/examples/draganddrop/fridgemagnets/dragwidget.cpp index 81dbc00..92a6960 100644 --- a/examples/draganddrop/fridgemagnets/dragwidget.cpp +++ b/examples/draganddrop/fridgemagnets/dragwidget.cpp @@ -76,7 +76,7 @@ DragWidget::DragWidget(QWidget *parent) //! [2] #ifndef Q_WS_S60 - //Fridge magnets is used for demoing Qt on S60 and themed backgrounds look better than white + //Fridge magnets is used for demoing Qt on S60 and themed backgrounds look better than white QPalette newPalette = palette(); newPalette.setColor(QPalette::Window, Qt::white); setPalette(newPalette); -- cgit v0.12 From cd10d1a8dbb3b77c2d4e9c389e134b1f3cc3c2cf Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Tue, 4 Aug 2009 14:02:56 +0300 Subject: Trailing whitespace and tab/space fixes for auto tests --- tests/auto/_Categories/QtCore.txt | 4 +- tests/auto/_Categories/QtGui.txt | 4 +- .../auto/_networkselftest/tst_networkselftest.cpp | 16 +- tests/auto/languagechange/tst_languagechange.cpp | 6 +- .../qabstractitemview/tst_qabstractitemview.cpp | 50 +- .../tst_qabstractnetworkcache.cpp | 4 +- tests/auto/qautoptr/qautoptr.pro | 2 +- tests/auto/qbitarray/tst_qbitarray.cpp | 2 +- tests/auto/qclipboard/tst_qclipboard.cpp | 6 +- tests/auto/qcombobox/tst_qcombobox.cpp | 4 +- tests/auto/qcssparser/qcssparser.pro | 1 - tests/auto/qcssparser/tst_cssparser.cpp | 4 +- tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp | 6 +- tests/auto/qdesktopservices/qdesktopservices.pro | 16 +- .../auto/qdesktopservices/tst_qdesktopservices.cpp | 176 ++--- tests/auto/qdir/tst_qdir.cpp | 56 +- tests/auto/qfiledialog/qfiledialog.pro | 2 - tests/auto/qfileinfo/tst_qfileinfo.cpp | 2 +- tests/auto/qfilesystemmodel/qfilesystemmodel.pro | 4 +- tests/auto/qfontdatabase/tst_qfontdatabase.cpp | 4 +- tests/auto/qfontdialog/tst_qfontdialog.cpp | 2 +- tests/auto/qftp/tst_qftp.cpp | 10 +- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 8 +- tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp | 62 +- .../tst_qgraphicsproxywidget.cpp | 3 +- tests/auto/qhostinfo/tst_qhostinfo.cpp | 6 +- tests/auto/qhttp/tst_qhttp.cpp | 12 +- .../tst_qhttpnetworkconnection.cpp | 12 +- .../qhttpsocketengine/tst_qhttpsocketengine.cpp | 24 +- tests/auto/qimage/tst_qimage.cpp | 6 +- tests/auto/qimagereader/qimagereader.pro | 1 - tests/auto/qitemdelegate/tst_qitemdelegate.cpp | 2 +- tests/auto/qitemview/tst_qitemview.cpp | 4 +- tests/auto/qkeyevent/tst_qkeyevent.cpp | 6 +- tests/auto/qlibrary/tst/tst.pro | 2 +- tests/auto/qlocalsocket/lackey/lackey.pro | 4 +- tests/auto/qlocalsocket/test/test.pro | 2 +- tests/auto/qlocalsocket/tst_qlocalsocket.cpp | 18 +- tests/auto/qmenu/tst_qmenu.cpp | 14 +- .../tst_qnativesocketengine.cpp | 22 +- .../qnetworkinterface/tst_qnetworkinterface.cpp | 8 +- tests/auto/qnetworkreply/test/test.pro | 4 +- tests/auto/qnetworkreply/tst_qnetworkreply.cpp | 42 +- tests/auto/qobject/qobject.pro | 2 - tests/auto/qobject/tst_qobject.cpp | 2 +- tests/auto/qobject/tst_qobject.pro | 1 - tests/auto/qobjectrace/tst_qobjectrace.cpp | 14 +- tests/auto/qpluginloader/tst/tst.pro | 3 +- tests/auto/qpluginloader/tst_qpluginloader.cpp | 19 +- tests/auto/qprogressbar/tst_qprogressbar.cpp | 2 +- tests/auto/qresourceengine/qresourceengine.pro | 14 +- .../qscriptv8testsuite/tst_qscriptv8testsuite.cpp | 4 +- tests/auto/qsettings/tst_qsettings.cpp | 4 +- tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp | 14 +- .../tst_qsocks5socketengine.cpp | 28 +- tests/auto/qsql/qsql.pro | 4 +- tests/auto/qsqldatabase/qsqldatabase.pro | 4 +- tests/auto/qsqldriver/qsqldriver.pro | 2 +- tests/auto/qsqlerror/qsqlerror.pro | 2 +- tests/auto/qsqlfield/qsqlfield.pro | 2 +- tests/auto/qsqlquery/qsqlquery.pro | 4 +- tests/auto/qsqlquery/tst_qsqlquery.cpp | 2 +- tests/auto/qsqlquerymodel/qsqlquerymodel.pro | 2 +- tests/auto/qsqlrecord/qsqlrecord.pro | 2 +- .../qsqlrelationaltablemodel.pro | 4 +- tests/auto/qsqltablemodel/qsqltablemodel.pro | 4 +- tests/auto/qsqlthread/qsqlthread.pro | 4 +- tests/auto/qsslsocket/qsslsocket.pro | 4 +- tests/auto/qsslsocket/tst_qsslsocket.cpp | 40 +- tests/auto/qstatemachine/tst_qstatemachine.cpp | 182 +++--- tests/auto/qtcpserver/crashingServer/main.cpp | 2 +- tests/auto/qtcpserver/tst_qtcpserver.cpp | 8 +- tests/auto/qtcpsocket/tst_qtcpsocket.cpp | 36 +- tests/auto/qtemporaryfile/qtemporaryfile.pro | 2 +- tests/auto/qtextcodec/test/test.pro | 2 +- tests/auto/qtextedit/tst_qtextedit.cpp | 2 +- tests/auto/qtextodfwriter/qtextodfwriter.pro | 2 +- tests/auto/qtextstream/test/test.pro | 2 +- tests/auto/qtextstream/tst_qtextstream.cpp | 4 +- tests/auto/qtimer/tst_qtimer.cpp | 1 - tests/auto/qudpsocket/tst_qudpsocket.cpp | 152 ++--- tests/auto/qvariant/tst_qvariant.cpp | 6 +- tests/auto/qwaitcondition/tst_qwaitcondition.cpp | 716 ++++++++++----------- tests/auto/qwidget/tst_qwidget.cpp | 12 +- .../auto/qxmlsimplereader/tst_qxmlsimplereader.cpp | 4 +- .../orientationchange/orientationchange.pro | 4 +- .../orientationchange/tst_orientationchange.cpp | 36 +- .../symbian/qmainexceptions/qmainexceptions.pro | 4 +- .../qmainexceptions/tst_qmainexceptions.cpp | 8 +- 89 files changed, 1000 insertions(+), 1015 deletions(-) diff --git a/tests/auto/_Categories/QtCore.txt b/tests/auto/_Categories/QtCore.txt index c3fb879..452b6ba 100644 --- a/tests/auto/_Categories/QtCore.txt +++ b/tests/auto/_Categories/QtCore.txt @@ -5,7 +5,7 @@ exceptionsafety qabstractitemmodel #Requires STL qalgorithms -qanimationgroup +qanimationgroup qatomicint qatomicpointer qbitarray @@ -80,7 +80,7 @@ qsocketnotifier qstate qstatemachine #Requires STL -qstl +qstl qstring qstringlist qstringmatcher diff --git a/tests/auto/_Categories/QtGui.txt b/tests/auto/_Categories/QtGui.txt index 6ef7cfe..dcb3be5 100644 --- a/tests/auto/_Categories/QtGui.txt +++ b/tests/auto/_Categories/QtGui.txt @@ -43,7 +43,7 @@ qdirmodel qdockwidget qdoublespinbox qdoublevalidator -qdrag +qdrag qerrormessage qfiledialog qfileiconprovider @@ -166,7 +166,7 @@ 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 +#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 diff --git a/tests/auto/_networkselftest/tst_networkselftest.cpp b/tests/auto/_networkselftest/tst_networkselftest.cpp index cfb5c3c..2c57e83 100644 --- a/tests/auto/_networkselftest/tst_networkselftest.cpp +++ b/tests/auto/_networkselftest/tst_networkselftest.cpp @@ -52,8 +52,8 @@ class tst_NetworkSelfTest: public QObject Q_OBJECT public: tst_NetworkSelfTest(); - virtual ~tst_NetworkSelfTest(); - + virtual ~tst_NetworkSelfTest(); + private slots: void hostTest(); void dnsResolution_data(); @@ -68,7 +68,7 @@ private slots: void httpServer(); void httpsServer(); void httpProxy(); - void httpProxyBasicAuth(); + void httpProxyBasicAuth(); void httpProxyNtlmAuth(); void socks5Proxy(); void socks5ProxyAuth(); @@ -371,7 +371,7 @@ void tst_NetworkSelfTest::remotePortsOpen_data() QTest::newRow("https") << 443; QTest::newRow("http-proxy") << 3128; QTest::newRow("http-proxy-auth-basic") << 3129; - QTest::newRow("http-proxy-auth-ntlm") << 3130; + QTest::newRow("http-proxy-auth-ntlm") << 3130; QTest::newRow("socks5-proxy") << 1080; QTest::newRow("socks5-proxy-auth") << 1081; } @@ -381,8 +381,8 @@ void tst_NetworkSelfTest::remotePortsOpen() #ifdef Q_OS_SYMBIAN if (qstrcmp(QTest::currentDataTag(), "http-proxy-auth-ntlm") == 0) QSKIP("NTML authentication not yet supported in Symbian", SkipSingle); -#endif - +#endif + QFETCH(int, portNumber); QTcpSocket socket; socket.connectToHost(QtNetworkSettings::serverName(), portNumber); @@ -538,7 +538,7 @@ void tst_NetworkSelfTest::httpProxyNtlmAuth() { #ifdef Q_OS_SYMBIAN QSKIP("NTML authentication not yet supported in Symbian", SkipAll); -#else +#else netChat(3130, QList() // test auth required response << Chat::send("GET http://" + QtNetworkSettings::serverName().toLatin1() + "/ HTTP/1.0\r\n" @@ -551,7 +551,7 @@ void tst_NetworkSelfTest::httpProxyNtlmAuth() << Chat::discardUntil("\r\nProxy-Authenticate: NTLM\r\n") << Chat::DiscardUntilDisconnect ); -#endif +#endif } // SOCKSv5 is a binary protocol diff --git a/tests/auto/languagechange/tst_languagechange.cpp b/tests/auto/languagechange/tst_languagechange.cpp index f856f67..9ffadb1 100644 --- a/tests/auto/languagechange/tst_languagechange.cpp +++ b/tests/auto/languagechange/tst_languagechange.cpp @@ -213,11 +213,11 @@ void tst_languageChange::retranslatability() "get proper widget layout."); TransformTranslator translator; #if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86) - // Allow a little extra time or emulator startup delays cause failure + // Allow a little extra time or emulator startup delays cause failure QTimer::singleShot(5000, &translator, SLOT(install())); -#else +#else QTimer::singleShot(500, &translator, SLOT(install())); -#endif +#endif switch (dialogType) { case InputDialog: (void)QInputDialog::getInteger(0, QLatin1String("title"), QLatin1String("label")); diff --git a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp index a35270a..67aac6f 100644 --- a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp +++ b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp @@ -211,7 +211,7 @@ private slots: void noFallbackToRoot(); void setCurrentIndex_data(); void setCurrentIndex(); - + void task221955_selectedEditor(); void task250754_fontChange(); }; @@ -453,7 +453,7 @@ void tst_QAbstractItemView::basic_tests(TestView *view) view->setDragEnabled(true); QCOMPARE(view->dragEnabled(), true); #endif - + // setAlternatingRowColors view->setAlternatingRowColors(false); QCOMPARE(view->alternatingRowColors(), false); @@ -566,7 +566,7 @@ void tst_QAbstractItemView::basic_tests(TestView *view) view->tst_setState(TestView::CollapsingState); QVERIFY(view->tst_state()==TestView::CollapsingState); #endif - + view->tst_startAutoScroll(); view->tst_stopAutoScroll(); view->tst_doAutoScroll(); @@ -951,12 +951,12 @@ void tst_QAbstractItemView::dragAndDropOnChild() class TestModel : public QStandardItemModel { public: - TestModel(int rows, int columns) : QStandardItemModel(rows, columns) + TestModel(int rows, int columns) : QStandardItemModel(rows, columns) { setData_count = 0; } - virtual bool setData(const QModelIndex &/*index*/, const QVariant &/*value*/, int /*role = Qt::EditRole*/) + virtual bool setData(const QModelIndex &/*index*/, const QVariant &/*value*/, int /*role = Qt::EditRole*/) { ++setData_count; return true; @@ -973,20 +973,20 @@ void tst_QAbstractItemView::setItemDelegate_data() // default is rows, a -1 will switch to columns QTest::addColumn("rowsOrColumnsWithDelegate"); QTest::addColumn("cellToEdit"); - QTest::newRow("4 columndelegates") - << (IntList() << -1 << 0 << 1 << 2 << 3) + QTest::newRow("4 columndelegates") + << (IntList() << -1 << 0 << 1 << 2 << 3) << QPoint(0, 0); - QTest::newRow("2 identical rowdelegates on the same row") - << (IntList() << 0 << 0) + QTest::newRow("2 identical rowdelegates on the same row") + << (IntList() << 0 << 0) << QPoint(0, 0); - QTest::newRow("2 identical columndelegates on the same column") - << (IntList() << -1 << 2 << 2) + QTest::newRow("2 identical columndelegates on the same column") + << (IntList() << -1 << 2 << 2) << QPoint(2, 0); - QTest::newRow("2 duplicate delegates, 1 row and 1 column") - << (IntList() << 0 << -1 << 2) + QTest::newRow("2 duplicate delegates, 1 row and 1 column") + << (IntList() << 0 << -1 << 2) << QPoint(2, 0); - QTest::newRow("4 duplicate delegates, 2 row and 2 column") - << (IntList() << 0 << 0 << -1 << 2 << 2) + QTest::newRow("4 duplicate delegates, 2 row and 2 column") + << (IntList() << 0 << 0 << -1 << 2 << 2) << QPoint(2, 0); } @@ -1008,7 +1008,7 @@ void tst_QAbstractItemView::setItemDelegate() if (row) { v.setItemDelegateForRow(rc, delegate); } else { - v.setItemDelegateForColumn(rc, delegate); + v.setItemDelegateForColumn(rc, delegate); } } } @@ -1126,42 +1126,42 @@ void tst_QAbstractItemView::setCurrentIndex() void tst_QAbstractItemView::task221955_selectedEditor() { QPushButton *button; - + QTreeWidget tree; tree.setColumnCount(2); tree.addTopLevelItem(new QTreeWidgetItem(QStringList() << "Foo" <<"1")); tree.addTopLevelItem(new QTreeWidgetItem(QStringList() << "Bar" <<"2")); tree.addTopLevelItem(new QTreeWidgetItem(QStringList() << "Baz" <<"3")); - + QTreeWidgetItem *dummy = new QTreeWidgetItem(); tree.addTopLevelItem(dummy); tree.setItemWidget(dummy, 0, button = new QPushButton("More...")); button->setAutoFillBackground(true); // as recommended in doc - + tree.show(); tree.setFocus(); tree.setCurrentIndex(tree.model()->index(1,0)); QTest::qWait(100); QApplication::setActiveWindow(&tree); - + QVERIFY(! tree.selectionModel()->selectedIndexes().contains(tree.model()->index(3,0))); //We set the focus to the button, the index need to be selected - button->setFocus(); + button->setFocus(); QTest::qWait(100); QVERIFY(tree.selectionModel()->selectedIndexes().contains(tree.model()->index(3,0))); - + tree.setCurrentIndex(tree.model()->index(1,0)); QVERIFY(! tree.selectionModel()->selectedIndexes().contains(tree.model()->index(3,0))); - + //Same thing but with the flag NoSelection, nothing can be selected. tree.setFocus(); tree.setSelectionMode(QAbstractItemView::NoSelection); tree.clearSelection(); QVERIFY(tree.selectionModel()->selectedIndexes().isEmpty()); QTest::qWait(10); - button->setFocus(); + button->setFocus(); QTest::qWait(50); QVERIFY(tree.selectionModel()->selectedIndexes().isEmpty()); } @@ -1202,7 +1202,7 @@ void tst_QAbstractItemView::task250754_fontChange() QTest::qWait(30); //now with the huge items, the scrollbar must be visible QVERIFY(tree.verticalScrollBar()->isVisible()); - + qApp->setStyleSheet(app_css); } diff --git a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp index 2a4a1a7..b3f918b 100644 --- a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp +++ b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp @@ -84,7 +84,7 @@ public: #ifdef Q_OS_SYMBIAN QString location = QLatin1String("./cache/"); #else - QString location = QDesktopServices::storageLocation(QDesktopServices::DataLocation) + QString location = QDesktopServices::storageLocation(QDesktopServices::DataLocation) + QLatin1String("/cache/"); #endif setCacheDirectory(location); @@ -111,7 +111,7 @@ tst_QAbstractNetworkCache::tst_QAbstractNetworkCache() } tst_QAbstractNetworkCache::~tst_QAbstractNetworkCache() -{ +{ } static bool AlwaysTrue = true; diff --git a/tests/auto/qautoptr/qautoptr.pro b/tests/auto/qautoptr/qautoptr.pro index 9eab084..b0c574f 100644 --- a/tests/auto/qautoptr/qautoptr.pro +++ b/tests/auto/qautoptr/qautoptr.pro @@ -1,4 +1,4 @@ load(qttest_p4) SOURCES += tst_qautoptr.cpp -QT = core +QT = core include(../xmlpatterns.pri) diff --git a/tests/auto/qbitarray/tst_qbitarray.cpp b/tests/auto/qbitarray/tst_qbitarray.cpp index 3c9ef53..f8f288f 100644 --- a/tests/auto/qbitarray/tst_qbitarray.cpp +++ b/tests/auto/qbitarray/tst_qbitarray.cpp @@ -646,7 +646,7 @@ void tst_QBitArray::resize() // grow the array back and check the new bit a.resize(10); QCOMPARE( a, QStringToQBitArray(QString("1100000000")) ); - + // other test with and a.resize(9); QBitArray b = QStringToQBitArray(QString("1111111111")); diff --git a/tests/auto/qclipboard/tst_qclipboard.cpp b/tests/auto/qclipboard/tst_qclipboard.cpp index 2929aab..88c7a2c 100644 --- a/tests/auto/qclipboard/tst_qclipboard.cpp +++ b/tests/auto/qclipboard/tst_qclipboard.cpp @@ -197,7 +197,7 @@ void tst_QClipboard::copy_exit_paste() // ### It's still possible to test copy/paste - just keep the apps running #elif defined (Q_OS_SYMBIAN) && defined (Q_CC_NOKIAX86) QSKIP("emulator cannot launch multiple processes",SkipAll); -#endif +#endif if (!nativeClipboardWorking()) QSKIP("Native clipboard not working in this setup", SkipAll); const QStringList stringArgument = QStringList() << "Test string."; @@ -240,7 +240,7 @@ void tst_QClipboard::setMimeData() QApplication::clipboard()->setMimeData(data, QClipboard::Clipboard); QApplication::clipboard()->setMimeData(data, QClipboard::Selection); QApplication::clipboard()->setMimeData(data, QClipboard::FindBuffer); - + QSignalSpy spySelection(QApplication::clipboard(), SIGNAL(selectionChanged())); QSignalSpy spyData(QApplication::clipboard(), SIGNAL(dataChanged())); QSignalSpy spyFindBuffer(QApplication::clipboard(), SIGNAL(findBufferChanged())); @@ -277,7 +277,7 @@ void tst_QClipboard::setMimeData() spySelection.clear(); spyData.clear(); spyFindBuffer.clear(); - + QApplication::clipboard()->setMimeData(newData, QClipboard::Clipboard); QApplication::clipboard()->setMimeData(newData, QClipboard::Selection); // used to crash on X11 QApplication::clipboard()->setMimeData(newData, QClipboard::FindBuffer); diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp index 4976b30..8b5acc7 100644 --- a/tests/auto/qcombobox/tst_qcombobox.cpp +++ b/tests/auto/qcombobox/tst_qcombobox.cpp @@ -1246,7 +1246,7 @@ void tst_QComboBox::insertItem() QCOMPARE(testWidget->count(), initialItems.count() + 1); QCOMPARE(testWidget->itemText(expectedIndex), itemLabel); - + if (editable) QCOMPARE(testWidget->currentText(), QString("FOO")); } @@ -2196,7 +2196,7 @@ void tst_QComboBox::noScrollbar() QVERIFY(!comboBox.view()->horizontalScrollBar()->isVisible()); QVERIFY(!comboBox.view()->verticalScrollBar()->isVisible()); } - + { QTableWidget *table = new QTableWidget(2,2); QComboBox comboBox; diff --git a/tests/auto/qcssparser/qcssparser.pro b/tests/auto/qcssparser/qcssparser.pro index b655db1..abf7187 100644 --- a/tests/auto/qcssparser/qcssparser.pro +++ b/tests/auto/qcssparser/qcssparser.pro @@ -11,4 +11,3 @@ wince*|symbian: { addFiles.path = . DEPLOYMENT += addFiles } - diff --git a/tests/auto/qcssparser/tst_cssparser.cpp b/tests/auto/qcssparser/tst_cssparser.cpp index ce923e1..9870ec2 100644 --- a/tests/auto/qcssparser/tst_cssparser.cpp +++ b/tests/auto/qcssparser/tst_cssparser.cpp @@ -1139,8 +1139,8 @@ void tst_CssParser::specificity() QVERIFY(parser.parse(&sheet)); QCOMPARE(sheet.styleRules.count() + sheet.nameIndex.count() + sheet.idIndex.count() , 1); - QCss::StyleRule rule = (!sheet.styleRules.isEmpty()) ? sheet.styleRules.at(0) - : (!sheet.nameIndex.isEmpty()) ? *sheet.nameIndex.begin() + QCss::StyleRule rule = (!sheet.styleRules.isEmpty()) ? sheet.styleRules.at(0) + : (!sheet.nameIndex.isEmpty()) ? *sheet.nameIndex.begin() : *sheet.idIndex.begin(); QCOMPARE(rule.selectors.count(), 1); QTEST(rule.selectors.at(0).specificity(), "specificity"); diff --git a/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp index 55dd85c..e5cb4486 100644 --- a/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp +++ b/tests/auto/qdatetimeedit/tst_qdatetimeedit.cpp @@ -2216,12 +2216,12 @@ void tst_QDateTimeEdit::mousePress() // Ask the SC_SpinBoxUp button location from style QStyleOptionSpinBox so; - so.rect = testWidget->rect(); + so.rect = testWidget->rect(); QRect rectUp = testWidget->style()->subControlRect(QStyle::CC_SpinBox, &so, QStyle::SC_SpinBoxUp, testWidget); - + // Send mouseClick to center of SC_SpinBoxUp QTest::mouseClick(testWidget, Qt::LeftButton, 0, rectUp.center()); - QCOMPARE(testWidget->date().year(), 2005); + QCOMPARE(testWidget->date().year(), 2005); } diff --git a/tests/auto/qdesktopservices/qdesktopservices.pro b/tests/auto/qdesktopservices/qdesktopservices.pro index 3c96e85..7c1bdb9 100644 --- a/tests/auto/qdesktopservices/qdesktopservices.pro +++ b/tests/auto/qdesktopservices/qdesktopservices.pro @@ -10,22 +10,22 @@ symbian: { dummy.path = . text.sources = text\* - text.path = \data\others\ + text.path = \data\others\ image.sources = image\* image.path = \data\images\ - + audio.sources = audio\* audio.path = \data\sounds\ - + video.sources = video\* - video.path = \data\videos\ - + video.path = \data\videos\ + install.sources = install\* - install.path = \data\installs\ - + install.path = \data\installs\ + DEPLOYMENT += image audio video install - + # These are only needed for manual tests #DEPLOYMENT += dummy text } diff --git a/tests/auto/qdesktopservices/tst_qdesktopservices.cpp b/tests/auto/qdesktopservices/tst_qdesktopservices.cpp index c69b112..5e3ae4a 100644 --- a/tests/auto/qdesktopservices/tst_qdesktopservices.cpp +++ b/tests/auto/qdesktopservices/tst_qdesktopservices.cpp @@ -61,16 +61,16 @@ private slots: void cleanup(); void openUrl(); #ifdef Q_OS_SYMBIAN - // These test are manual ones, you need to check from device that + // These test are manual ones, you need to check from device that // correct system application is started with correct content - // When you want to run these test, uncomment //#define RUN_MANUAL_TESTS + // When you want to run these test, uncomment //#define RUN_MANUAL_TESTS void openHttpUrl_data(); void openHttpUrl(); void openMailtoUrl_data(); - void openMailtoUrl(); + void openMailtoUrl(); void openFileUrl_data(); void openFileUrl(); -#endif +#endif void handlers(); void storageLocation_data(); void storageLocation(); @@ -104,7 +104,7 @@ void tst_qdesktopservices::openUrl() // At the bare minimum check that they return false for invalid url's QCOMPARE(QDesktopServices::openUrl(QUrl()), false); #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) - // this test is only valid on windows on other systems it might mean open a new document in the application handling .file + // this test is only valid on windows on other systems it might mean open a new document in the application handling .file QCOMPARE(QDesktopServices::openUrl(QUrl("file://invalid.file")), false); #endif } @@ -112,32 +112,32 @@ void tst_qdesktopservices::openUrl() #ifdef Q_OS_SYMBIAN void tst_qdesktopservices::openHttpUrl_data() { - QTest::addColumn("url"); - QTest::addColumn("result"); - QTest::newRow("BasicWithHttp") << QUrl("http://www.google.fi") << true; - QTest::newRow("BasicWithoutHttp") << QUrl("www.nokia.fi") << true; + QTest::addColumn("url"); + QTest::addColumn("result"); + QTest::newRow("BasicWithHttp") << QUrl("http://www.google.fi") << true; + QTest::newRow("BasicWithoutHttp") << QUrl("www.nokia.fi") << true; QTest::newRow("BasicWithUserAndPw") << QUrl("http://s60prereleases:oslofjord@pepper.troll.no/s60prereleases/patches/") << true; QTest::newRow("URL with space") << QUrl("http://www.manataka.org/Contents Page.html") << true; - + } void tst_qdesktopservices::openHttpUrl() { -#ifndef RUN_MANUAL_TESTS - QSKIP("Test disabled -- only for manual purposes", SkipAll); -#endif - - QFETCH(QUrl, url); - QFETCH(bool, result); - QCOMPARE(QDesktopServices::openUrl(url), result); +#ifndef RUN_MANUAL_TESTS + QSKIP("Test disabled -- only for manual purposes", SkipAll); +#endif + + QFETCH(QUrl, url); + QFETCH(bool, result); + QCOMPARE(QDesktopServices::openUrl(url), result); QTest::qWait(30000); } void tst_qdesktopservices::openMailtoUrl_data() { QTest::addColumn("url"); - QTest::addColumn("result"); - + QTest::addColumn("result"); + // http://en.wikipedia.org/wiki/E-mail_address // RFC Valid e-mail addresses QTest::newRow("Wiki valid email 1") << QUrl("mailto:abc@example.com") << true; @@ -149,97 +149,97 @@ void tst_qdesktopservices::openMailtoUrl_data() QTest::newRow("Wiki valid email 7") << QUrl("mailto:abc+mailbox/department=shipping@example.com") << true; // S60 email client considers the next URL invalid, even ity should be valid QTest::newRow("Wiki valid email 8") << QUrl("mailto:!#$%&'*+-/=?^_`.{|}~@example.com") << true; // all of these characters are allowed - QTest::newRow("Wiki valid email 9") << QUrl("mailto:\"abc@def\"@example.com") << true; // anything goes inside quotation marks + QTest::newRow("Wiki valid email 9") << QUrl("mailto:\"abc@def\"@example.com") << true; // anything goes inside quotation marks QTest::newRow("Wiki valid email 10") << QUrl("mailto:\"Fred \\\"quota\\\" Bloggs\"@example.com") << true; // however, quotes need escaping - - // RFC invalid e-mail addresses - // These return true even though they are invalid, but check that user is notified about invalid URL in mail application - QTest::newRow("Wiki invalid email 1") << QUrl("mailto:Abc.example.com") << true; // character @ is missing - QTest::newRow("Wiki invalid email 2") << QUrl("mailto:Abc.@example.com") << true; // character dot(.) is last in local part - QTest::newRow("Wiki invalid email 3") << QUrl("mailto:Abc..123@example.com") << true; // character dot(.) is double - QTest::newRow("Wiki invalid email 4") << QUrl("mailto:A@b@c@example.com") << true; // only one @ is allowed outside quotations marks - QTest::newRow("Wiki invalid email 5") << QUrl("mailto:()[]\\;:,<>@example.com") << true; // none of the characters before the @ is allowed outside quotation marks - - QTest::newRow("Basic") << QUrl("mailto:test@nokia.com") << true; + + // RFC invalid e-mail addresses + // These return true even though they are invalid, but check that user is notified about invalid URL in mail application + QTest::newRow("Wiki invalid email 1") << QUrl("mailto:Abc.example.com") << true; // character @ is missing + QTest::newRow("Wiki invalid email 2") << QUrl("mailto:Abc.@example.com") << true; // character dot(.) is last in local part + QTest::newRow("Wiki invalid email 3") << QUrl("mailto:Abc..123@example.com") << true; // character dot(.) is double + QTest::newRow("Wiki invalid email 4") << QUrl("mailto:A@b@c@example.com") << true; // only one @ is allowed outside quotations marks + QTest::newRow("Wiki invalid email 5") << QUrl("mailto:()[]\\;:,<>@example.com") << true; // none of the characters before the @ is allowed outside quotation marks + + QTest::newRow("Basic") << QUrl("mailto:test@nokia.com") << true; QTest::newRow("BasicSeveralAddr") << QUrl("mailto:test@nokia.com,test2@nokia.com,test3@nokia.com") << true; - QTest::newRow("BasicAndSubject") << QUrl("mailto:test@nokia.com?subject=hello nokia") << true; - QTest::newRow("BasicAndTo") << QUrl("mailto:test@nokia.com?to=test2@nokia.com") << true; - + QTest::newRow("BasicAndSubject") << QUrl("mailto:test@nokia.com?subject=hello nokia") << true; + QTest::newRow("BasicAndTo") << QUrl("mailto:test@nokia.com?to=test2@nokia.com") << true; + QTest::newRow("BasicAndCc") << QUrl("mailto:test@nokia.com?cc=mycc@address.com") << true; - QTest::newRow("BasicAndBcc") << QUrl("mailto:test@nokia.com?bcc=mybcc@address.com") << true; - QTest::newRow("BasicAndBody") << QUrl("mailto:test@nokia.com?body=Test email message body") << true; - + QTest::newRow("BasicAndBcc") << QUrl("mailto:test@nokia.com?bcc=mybcc@address.com") << true; + QTest::newRow("BasicAndBody") << QUrl("mailto:test@nokia.com?body=Test email message body") << true; + // RFC examples, these are actually invalid because there is not host defined // Check that user is notified about invalid URL in mail application QTest::newRow("RFC2368 Example 1") << QUrl::fromEncoded("mailto:addr1%2C%20addr2") << true; QTest::newRow("RFC2368 Example 2") << QUrl::fromEncoded("mailto:?to=addr1%2C%20addr2") << true; QTest::newRow("RFC2368 Example 3") << QUrl("mailto:addr1?to=addr2") << true; - - QTest::newRow("RFC2368 Example 4") << QUrl("mailto:joe@example.com?cc=bob@example.com&body=hello") << true; + + QTest::newRow("RFC2368 Example 4") << QUrl("mailto:joe@example.com?cc=bob@example.com&body=hello") << true; QTest::newRow("RFC2368 Example 5") << QUrl("mailto:?to=joe@example.com&cc=bob@example.com&body=hello") << true; QTest::newRow("RFC2368 Example 6") << QUrl("mailto:foobar@example.com?In-Reply-To=%3c3469A91.D10AF4C@example.com") << true; // OpaqueData QTest::newRow("RFC2368 Example 7") << QUrl::fromEncoded("mailto:infobot@example.com?body=send%20current-issue%0D%0Asend%20index") << true; QTest::newRow("RFC2368 Example 8") << QUrl::fromEncoded("mailto:infobot@example.com?body=send%20current-issue") << true; QTest::newRow("RFC2368 Example 9") << QUrl("mailto:infobot@example.com?subject=current-issue") << true; QTest::newRow("RFC2368 Example 10") << QUrl("mailto:chris@example.com") << true; - + //QTest::newRow("RFC2368 Example 11 - illegal chars") << QUrl("mailto:joe@example.com?cc=bob@example.com?body=hello") << false; QTest::newRow("RFC2368 Example 12") << QUrl::fromEncoded("mailto:gorby%25kremvax@example.com") << true; // encoded reserved chars '%' - QTest::newRow("RFC2368 Example 13") << QUrl::fromEncoded("mailto:unlikely%3Faddress@example.com?blat=foop") << true; // encoded reserved chars `?' + QTest::newRow("RFC2368 Example 13") << QUrl::fromEncoded("mailto:unlikely%3Faddress@example.com?blat=foop") << true; // encoded reserved chars `?' } void tst_qdesktopservices::openMailtoUrl() { -#ifndef RUN_MANUAL_TESTS - QSKIP("Test disabled -- only for manual purposes", SkipAll); -#endif - - QFETCH(QUrl, url); - QFETCH(bool, result); - QCOMPARE(QDesktopServices::openUrl(url), result); +#ifndef RUN_MANUAL_TESTS + QSKIP("Test disabled -- only for manual purposes", SkipAll); +#endif + + QFETCH(QUrl, url); + QFETCH(bool, result); + QCOMPARE(QDesktopServices::openUrl(url), result); } void tst_qdesktopservices::openFileUrl_data() { QTest::addColumn("url"); - QTest::addColumn("result"); - + QTest::addColumn("result"); + // Text files - QTest::newRow("DOS text file") << QUrl("file:///c:/data/others/dosfile.txt") << true; - QTest::newRow("No EOF text file") << QUrl("file:///c:/data/others/noendofline.txt") << true; + QTest::newRow("DOS text file") << QUrl("file:///c:/data/others/dosfile.txt") << true; + QTest::newRow("No EOF text file") << QUrl("file:///c:/data/others/noendofline.txt") << true; QTest::newRow("text file") << QUrl("file:///c:/data/others/testfile.txt") << true; - QTest::newRow("text file with space") << QUrl("file:///c:/data/others/test file.txt") << true; - + QTest::newRow("text file with space") << QUrl("file:///c:/data/others/test file.txt") << true; + // Images - QTest::newRow("BMP image") << QUrl("file:///c:/data/images/image.bmp") << true; - QTest::newRow("GIF image") << QUrl("file:///c:/data/images/image.gif") << true; - QTest::newRow("JPG image") << QUrl("file:///c:/data/images/image.jpg") << true; - QTest::newRow("PNG image") << QUrl("file:///c:/data/images/image.png") << true; - - // Audio - QTest::newRow("MP4 audio") << QUrl("file:///c:/data/sounds/aac-only.mp4") << true; - QTest::newRow("3GP audio") << QUrl("file:///c:/data/sounds/audio_3gpp.3gp") << true; - - // Video - QTest::newRow("MP4 video") << QUrl("file:///c:/data/videos/vid-mpeg4-22k.mp4") << true; - - // Installs - QTest::newRow("SISX") << QUrl("file:///c:/data/installs/ErrRd.sisx") << true; - - // Errors - QTest::newRow("File does not exist") << QUrl("file:///c:/thisfileneverexists.txt") << false; + QTest::newRow("BMP image") << QUrl("file:///c:/data/images/image.bmp") << true; + QTest::newRow("GIF image") << QUrl("file:///c:/data/images/image.gif") << true; + QTest::newRow("JPG image") << QUrl("file:///c:/data/images/image.jpg") << true; + QTest::newRow("PNG image") << QUrl("file:///c:/data/images/image.png") << true; + + // Audio + QTest::newRow("MP4 audio") << QUrl("file:///c:/data/sounds/aac-only.mp4") << true; + QTest::newRow("3GP audio") << QUrl("file:///c:/data/sounds/audio_3gpp.3gp") << true; + + // Video + QTest::newRow("MP4 video") << QUrl("file:///c:/data/videos/vid-mpeg4-22k.mp4") << true; + + // Installs + QTest::newRow("SISX") << QUrl("file:///c:/data/installs/ErrRd.sisx") << true; + + // Errors + QTest::newRow("File does not exist") << QUrl("file:///c:/thisfileneverexists.txt") << false; } void tst_qdesktopservices::openFileUrl() { -#ifndef RUN_MANUAL_TESTS - QSKIP("Test disabled -- only for manual purposes", SkipAll); -#endif - - QFETCH(QUrl, url); - QFETCH(bool, result); +#ifndef RUN_MANUAL_TESTS + QSKIP("Test disabled -- only for manual purposes", SkipAll); +#endif + + QFETCH(QUrl, url); + QFETCH(bool, result); QCOMPARE(QDesktopServices::openUrl(url), result); - QTest::qWait(15000); + QTest::qWait(15000); } #endif @@ -297,11 +297,11 @@ void tst_qdesktopservices::storageLocation() QString storageLocation = QDesktopServices::storageLocation(location); QString displayName = QDesktopServices::displayName(location); //qDebug( "displayName: %s", displayName ); - + storageLocation = storageLocation.toLower(); displayName = displayName.toLower(); - - QString drive = QDir::currentPath().left(2).toLower(); + + QString drive = QDir::currentPath().left(2).toLower(); if( drive == "z:" ) drive = "c:"; @@ -319,9 +319,9 @@ void tst_qdesktopservices::storageLocation() case QDesktopServices::ApplicationsLocation: #ifdef Q_CC_NOKIAX86 QCOMPARE( storageLocation, QString("z:/sys/bin") ); -#else - QCOMPARE( storageLocation, drive + QString("/sys/bin") ); -#endif +#else + QCOMPARE( storageLocation, drive + QString("/sys/bin") ); +#endif break; case QDesktopServices::MusicLocation: QCOMPARE( storageLocation, drive + QString("/data/sounds") ); @@ -331,7 +331,7 @@ void tst_qdesktopservices::storageLocation() break; case QDesktopServices::PicturesLocation: QCOMPARE( storageLocation, drive + QString("/data/images") ); - break; + break; case QDesktopServices::TempLocation: QCOMPARE( storageLocation, QDir::tempPath().toLower()); break; @@ -339,18 +339,18 @@ void tst_qdesktopservices::storageLocation() QCOMPARE( storageLocation, QDir::homePath().toLower()); break; case QDesktopServices::DataLocation: - // Just check the folder not the drive + // Just check the folder not the drive QCOMPARE( storageLocation.mid(2), QDir::currentPath().mid(2).toLower()); - break; + break; default: QCOMPARE( storageLocation, QString() ); - break; + break; } #else QDesktopServices::storageLocation(location); QDesktopServices::displayName(location); -#endif +#endif } diff --git a/tests/auto/qdir/tst_qdir.cpp b/tests/auto/qdir/tst_qdir.cpp index 8f8200c..503c3e9 100644 --- a/tests/auto/qdir/tst_qdir.cpp +++ b/tests/auto/qdir/tst_qdir.cpp @@ -382,20 +382,20 @@ void tst_QDir::entryList_data() QTest::addColumn("sortspec"); QTest::addColumn("expected"); QTest::newRow("spaces1") << SRCDIR "testdir/spaces" << QStringList("*. bar") - << (int)(QDir::NoFilter) << (int)(QDir::NoSort) - << QStringList("foo. bar"); // notice how spaces5 works + << (int)(QDir::NoFilter) << (int)(QDir::NoSort) + << QStringList("foo. bar"); // notice how spaces5 works QTest::newRow("spaces2") << SRCDIR "testdir/spaces" << QStringList("*.bar") - << (int)(QDir::NoFilter) << (int)(QDir::NoSort) - << QStringList("foo.bar"); + << (int)(QDir::NoFilter) << (int)(QDir::NoSort) + << QStringList("foo.bar"); QTest::newRow("spaces3") << SRCDIR "testdir/spaces" << QStringList("foo.*") - << (int)(QDir::NoFilter) << (int)(QDir::NoSort) - << QString("foo. bar,foo.bar").split(','); + << (int)(QDir::NoFilter) << (int)(QDir::NoSort) + << QString("foo. bar,foo.bar").split(','); QTest::newRow("files1") << SRCDIR "testdir/dir" << QString("*r.cpp *.pro").split(" ") - << (int)(QDir::NoFilter) << (int)(QDir::NoSort) - << QString("qdir.pro,qrc_qdir.cpp,tst_qdir.cpp").split(','); + << (int)(QDir::NoFilter) << (int)(QDir::NoSort) + << QString("qdir.pro,qrc_qdir.cpp,tst_qdir.cpp").split(','); QTest::newRow("testdir1") << SRCDIR "testdir" << QStringList() - << (int)(QDir::AllDirs) << (int)(QDir::NoSort) - << QString(".,..,dir,spaces").split(','); + << (int)(QDir::AllDirs) << (int)(QDir::NoSort) + << QString(".,..,dir,spaces").split(','); // #### this test uses filenames that cannot be represented on all filesystems we test, in // particular HFS+ on the Mac. When checking out the files with perforce it silently ignores the // error that it cannot represent the file names stored in the repository and the test fails. That @@ -404,8 +404,8 @@ void tst_QDir::entryList_data() // ignored but git reports an error. The test only tried to prevent QDir from _hanging_ when listing // the directory. // QTest::newRow("unprintablenames") << SRCDIR "unprintablenames" << QStringList("*") -// << (int)(QDir::NoFilter) << (int)(QDir::NoSort) -// << QString(".,..").split(","); +// << (int)(QDir::NoFilter) << (int)(QDir::NoSort) +// << QString(".,..").split(","); QTest::newRow("resources1") << QString(":/tst_qdir/resources/entryList") << QStringList("*.data") << (int)(QDir::NoFilter) << (int)(QDir::NoSort) << QString("file1.data,file2.data,file3.data").split(','); @@ -540,10 +540,10 @@ void tst_QDir::entryList() QFile::remove(SRCDIR "entrylist/brokenlink.lnk"); QFile::remove(SRCDIR "entrylist/brokenlink"); - // WinCE/Symbian does not have . and .. in the directory listing + // WinCE/Symbian does not have . and .. in the directory listing #if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) - expected.removeAll("."); - expected.removeAll(".."); + expected.removeAll("."); + expected.removeAll(".."); #endif #if defined(Q_OS_WIN) @@ -553,7 +553,7 @@ void tst_QDir::entryList() QFile::link(SRCDIR "entryList/nothing", SRCDIR "entrylist/brokenlink.lnk"); #elif defined(Q_OS_SYMBIAN) // Symbian doesn't support links to directories - expected.removeAll("linktodirectory.lnk"); + expected.removeAll("linktodirectory.lnk"); // Expecting failures from a couple of OpenC bugs. Do checks only once. static int xFailChecked = false; @@ -737,7 +737,7 @@ void tst_QDir::canonicalPath_data() } #endif - QTest::newRow("relative") << "." << appPath; + QTest::newRow("relative") << "." << appPath; QTest::newRow("relativeSubDir") << "./testData/../testData" << appPath + "/testData"; #ifndef Q_WS_WIN @@ -784,10 +784,10 @@ void tst_QDir::current_data() else appPath.chop(1); // remove the ending slash #if defined Q_WS_WIN - if (appPath.endsWith("release", Qt::CaseInsensitive)) - appPath = appPath.left(appPath.length()-8); + if (appPath.endsWith("release", Qt::CaseInsensitive)) + appPath = appPath.left(appPath.length()-8); else if (appPath.endsWith("debug", Qt::CaseInsensitive)) - appPath = appPath.left(appPath.length()-6); + appPath = appPath.left(appPath.length()-6); #endif QTest::newRow("startup") << QString() << appPath; @@ -821,9 +821,9 @@ void tst_QDir::current() QDir newCurrent = QDir::current(); QDir::setCurrent(oldDir); #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) - QCOMPARE(newCurrent.absolutePath().toLower(), currentDir.toLower()); + QCOMPARE(newCurrent.absolutePath().toLower(), currentDir.toLower()); #else - QCOMPARE(newCurrent.absolutePath(), currentDir); + QCOMPARE(newCurrent.absolutePath(), currentDir); #endif } @@ -838,8 +838,8 @@ void tst_QDir::cd_data() QTest::addColumn("newDir"); QString appPath = QDir::currentPath(); - int index = appPath.lastIndexOf("/"); - QTest::newRow("cdUp") << QDir::currentPath() << ".." << true << appPath.left(index==0?1:index); + int index = appPath.lastIndexOf("/"); + QTest::newRow("cdUp") << QDir::currentPath() << ".." << true << appPath.left(index==0?1:index); QTest::newRow("noChange") << QDir::currentPath() << "." << true << appPath; #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) // on windows QDir::root() is usually c:/ but cd "/" will not force it to be root QTest::newRow("absolute") << QDir::currentPath() << "/" << true << "/"; @@ -881,11 +881,11 @@ void tst_QDir::setNameFilters_data() QTest::newRow("spaces1") << appPath + "testdir/spaces" << QStringList("*. bar") << QStringList("foo. bar"); QTest::newRow("spaces2") << appPath + "testdir/spaces" << QStringList("*.bar") - << QStringList("foo.bar"); + << QStringList("foo.bar"); QTest::newRow("spaces3") << appPath + "testdir/spaces" << QStringList("foo.*") - << QString("foo. bar,foo.bar").split(","); + << QString("foo. bar,foo.bar").split(","); QTest::newRow("files1") << appPath + "testdir/dir" << QString("*r.cpp *.pro").split(" ") - << QString("qdir.pro,qrc_qdir.cpp,tst_qdir.cpp").split(","); + << QString("qdir.pro,qrc_qdir.cpp,tst_qdir.cpp").split(","); QTest::newRow("resources1") << QString(":/tst_qdir/resources/entryList") << QStringList("*.data") << QString("file1.data,file2.data,file3.data").split(','); } @@ -1172,7 +1172,7 @@ void tst_QDir::operator_eq() void tst_QDir::dotAndDotDot() { #if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) - QSKIP("WinCE and Symbian do not have . nor ..", SkipAll); + QSKIP("WinCE and Symbian do not have . nor ..", SkipAll); #endif QDir dir(QString(SRCDIR "testdir/")); QStringList entryList = dir.entryList(QDir::Dirs); diff --git a/tests/auto/qfiledialog/qfiledialog.pro b/tests/auto/qfiledialog/qfiledialog.pro index 3c238ec..bea7716 100644 --- a/tests/auto/qfiledialog/qfiledialog.pro +++ b/tests/auto/qfiledialog/qfiledialog.pro @@ -15,6 +15,4 @@ wince*|symbian: { } symbian:TARGET.EPOCHEAPSIZE="0x100 0x1000000" - symbian:HEADERS += ../../../include/qtgui/private/qfileinfogatherer_p.h - diff --git a/tests/auto/qfileinfo/tst_qfileinfo.cpp b/tests/auto/qfileinfo/tst_qfileinfo.cpp index d94c7e4..fde4e0a 100644 --- a/tests/auto/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/qfileinfo/tst_qfileinfo.cpp @@ -1101,7 +1101,7 @@ void tst_QFileInfo::isExecutable() #ifdef Q_OS_SYMBIAN # if defined(Q_CC_NOKIAX86) QSKIP("Impossible to implement reading/touching of application binaries in Symbian emulator", SkipAll); -# endif +# endif QString appPath = "c:/sys/bin/tst_qfileinfo.exe"; #else QString appPath = QCoreApplication::applicationDirPath(); diff --git a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro index e9d7272..9750c43 100644 --- a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro +++ b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro @@ -3,12 +3,12 @@ CONFIG += qttest_p4 include(../../src/qfiledialog.pri) include(../../../../modeltest/modeltest.pri) -SOURCES += tst_qfilesystemmodel.cpp +SOURCES += tst_qfilesystemmodel.cpp TARGET = tst_qfilesystemmodel symbian: { HEADERS += ../../../include/qtgui/private/qfileinfogatherer_p.h - + # need to deploy something to create the private directory dummyDeploy.sources = tst_qfilesystemmodel.cpp dummyDeploy.path = . diff --git a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp index 7dd2fd0..eec9872 100644 --- a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp +++ b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp @@ -193,7 +193,7 @@ void tst_QFontDatabase::addAppFont() { #ifdef Q_OS_SYMBIAN QSKIP( "Symbian: Application fonts are not yet supported", SkipAll ); -#else +#else QFETCH(bool, useMemoryFont); QSignalSpy fontDbChangedSpy(QApplication::instance(), SIGNAL(fontDatabaseChanged())); @@ -243,7 +243,7 @@ void tst_QFontDatabase::addAppFont() QCOMPARE(fontDbChangedSpy.count(), 2); QVERIFY(db.families() == oldFamilies); -#endif +#endif } QTEST_MAIN(tst_QFontDatabase) diff --git a/tests/auto/qfontdialog/tst_qfontdialog.cpp b/tests/auto/qfontdialog/tst_qfontdialog.cpp index 1444ee0..57098a8 100644 --- a/tests/auto/qfontdialog/tst_qfontdialog.cpp +++ b/tests/auto/qfontdialog/tst_qfontdialog.cpp @@ -170,7 +170,7 @@ void tst_QFontDialog::task256466_wrongStyle() for (int i = 0; i < familyList->model()->rowCount(); ++i) { QModelIndex currentFamily = familyList->model()->index(i, 0); familyList->setCurrentIndex(currentFamily); - QCOMPARE(dialog.currentFont(), fdb.font(currentFamily.data().toString(), + QCOMPARE(dialog.currentFont(), fdb.font(currentFamily.data().toString(), styleList->currentIndex().data().toString(), sizeList->currentIndex().data().toInt())); } } diff --git a/tests/auto/qftp/tst_qftp.cpp b/tests/auto/qftp/tst_qftp.cpp index 7942d4b..f32803e 100644 --- a/tests/auto/qftp/tst_qftp.cpp +++ b/tests/auto/qftp/tst_qftp.cpp @@ -193,7 +193,7 @@ tst_QFtp::tst_QFtp() } tst_QFtp::~tst_QFtp() -{ +{ } void tst_QFtp::initTestCase_data() @@ -201,12 +201,12 @@ void tst_QFtp::initTestCase_data() QTest::addColumn("setProxy"); QTest::addColumn("proxyType"); - QTest::newRow("WithoutProxy") << false << 0; -#ifdef TEST_QNETWORK_PROXY + QTest::newRow("WithoutProxy") << false << 0; +#ifdef TEST_QNETWORK_PROXY QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy); //### doesn't work well yet. //QTest::newRow("WithHttpProxy") << true << int(QNetworkProxy::HttpProxy); -#endif +#endif } void tst_QFtp::initTestCase() @@ -1293,7 +1293,7 @@ void tst_QFtp::abort_data() QTest::newRow( "get_fluke02" ) << QtNetworkSettings::serverName() << (uint)21 << QString("qtest/rfc3252") << QByteArray(); // Qt/CE and Symbian test environment has to less memory for this test -#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) +#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) QByteArray bigData( 10*1024*1024, 0 ); bigData.fill( 'B' ); diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 7552f18..5df4e9e 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -6468,7 +6468,7 @@ public: QGraphicsRectItem::paint(painter, option, widget); painter->drawText(boundingRect(), Qt::AlignCenter, QString("%1x%2\n%3x%4").arg(p.x()).arg(p.y()).arg(sp.x()).arg(sp.y())); } - + protected: void hoverMoveEvent(QGraphicsSceneHoverEvent *event) { @@ -6650,7 +6650,7 @@ void tst_QGraphicsItem::setTransformProperties_data() QTest::newRow("rotationXYZ") << QPointF() << qreal(-25) << qreal(12) << qreal(556) << qreal(1.0) << qreal(1.0) << qreal(0.0) << qreal(0.0); - QTest::newRow("rotationXYZ dicentred") << QPointF(-53, 25.2) + QTest::newRow("rotationXYZ dicentred") << QPointF(-53, 25.2) << qreal(-2578.2) << qreal(4565.2) << qreal(56) << qreal(1.0) << qreal(1.0) << qreal(0.0) << qreal(0.0); @@ -6789,7 +6789,7 @@ void tst_QGraphicsItem::setTransformProperties() QCOMPARE_TRANSFORM(item1->sceneTransform(), item2->sceneTransform()); - QCOMPARE_TRANSFORM(item1->itemTransform(item2), QTransform()); + QCOMPARE_TRANSFORM(item1->itemTransform(item2), QTransform()); QCOMPARE_TRANSFORM(item2->itemTransform(item1), QTransform()); } @@ -6819,7 +6819,7 @@ void tst_QGraphicsItem::setTransformProperties() QCOMPARE_TRANSFORM(item1->sceneTransform(), item2->sceneTransform()); - QCOMPARE_TRANSFORM(item1->itemTransform(item2), QTransform()); + QCOMPARE_TRANSFORM(item1->itemTransform(item2), QTransform()); QCOMPARE_TRANSFORM(item2->itemTransform(item1), QTransform()); } } diff --git a/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp b/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp index 536c750..ea2646e 100644 --- a/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp +++ b/tests/auto/qgraphicslayout/tst_qgraphicslayout.cpp @@ -178,7 +178,7 @@ void tst_QGraphicsLayout::automaticReparenting() QCOMPARE(w1->parentItem(), static_cast(window)); QCOMPARE(w2->parentItem(), static_cast(window)); - // Sublayouts + // Sublayouts QGraphicsLinearLayout *l2 = new QGraphicsLinearLayout(); QGraphicsWidget *w3 = new QGraphicsWidget(); l2->addItem(w3); @@ -212,7 +212,7 @@ void tst_QGraphicsLayout::automaticReparenting() class TestLayout : public QGraphicsLinearLayout { public: - TestLayout(QGraphicsLayoutItem *parent = 0) + TestLayout(QGraphicsLayoutItem *parent = 0) : QGraphicsLinearLayout(parent) { m_count = 0; @@ -224,7 +224,7 @@ class TestLayout : public QGraphicsLinearLayout QGraphicsLinearLayout::setGeometry(rect); } - + int m_count; }; @@ -320,9 +320,9 @@ public: } void setGeometry(const QRectF &geom); - + QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF() ) const; - + inline QGraphicsRectItem *rectItem() { return static_cast(graphicsItem()); } @@ -354,20 +354,20 @@ QSizeF AnimatedLayoutItem::sizeHint(Qt::SizeHint which, const QSizeF &constraint class AnimatedLayout : public QObject, public QGraphicsLinearLayout { Q_OBJECT public: - AnimatedLayout(QGraphicsWidget *widget) : QGraphicsLinearLayout(widget), m_timeline(500, this) + AnimatedLayout(QGraphicsWidget *widget) : QGraphicsLinearLayout(widget), m_timeline(500, this) { connect(&m_timeline, SIGNAL(valueChanged(qreal)), this, SLOT(valueChanged(qreal))); } - + void setGeometry(const QRectF &geom) { fromGeoms.clear(); toGeoms.clear(); for (int i = 0; i < count(); ++i) { fromGeoms << itemAt(i)->geometry(); } - + QGraphicsLinearLayout::setGeometry(geom); - + for (int i = 0; i < count(); ++i) { toGeoms << itemAt(i)->geometry(); } @@ -380,13 +380,13 @@ private slots: QGraphicsLayoutItem *li = itemAt(i); QRectF from = fromGeoms.at(i); QRectF to = toGeoms.at(i); - - QRectF geom(from.topLeft() + (to.topLeft() - from.topLeft()) * value, + + QRectF geom(from.topLeft() + (to.topLeft() - from.topLeft()) * value, from.size() + (to.size() - from.size()) * value); static_cast(li->graphicsItem())->setRect(geom); } } -private: +private: QTimeLine m_timeline; QVector fromGeoms; QVector toGeoms; @@ -407,7 +407,7 @@ void tst_QGraphicsLayout::alternativeLayoutItems() QGraphicsRectItem *item1 = new QGraphicsRectItem; AnimatedLayoutItem *li1 = new AnimatedLayoutItem(item1); lout->addItem(li1); - + QGraphicsRectItem *item2 = new QGraphicsRectItem; AnimatedLayoutItem *li2 = new AnimatedLayoutItem(item2); lout->addItem(li2); @@ -417,7 +417,7 @@ void tst_QGraphicsLayout::alternativeLayoutItems() lout->addItem(li3); window->setLayout(lout); - + window->setGeometry(0, 0, 99, 99); view.setSceneRect(QRectF(-10, -10, 110, 110)); view.resize(150, 150); @@ -426,11 +426,11 @@ void tst_QGraphicsLayout::alternativeLayoutItems() QApplication::processEvents(); QTest::qWait(750); QApplication::processEvents(); - + QCOMPARE(static_cast(li1->graphicsItem())->rect(), QRectF( 0, 0, 33, 99)); QCOMPARE(static_cast(li2->graphicsItem())->rect(), QRectF(33, 0, 33, 99)); QCOMPARE(static_cast(li3->graphicsItem())->rect(), QRectF(66, 0, 33, 99)); - + lout->setOrientation(Qt::Vertical); QApplication::processEvents(); @@ -439,7 +439,7 @@ void tst_QGraphicsLayout::alternativeLayoutItems() QCOMPARE(static_cast(li1->graphicsItem())->rect(), QRectF(0, 0, 99, 33)); QCOMPARE(static_cast(li2->graphicsItem())->rect(), QRectF(0, 33, 99, 33)); QCOMPARE(static_cast(li3->graphicsItem())->rect(), QRectF(0, 66, 99, 33)); - + } class CustomLayoutItem : public QGraphicsLayoutItem { @@ -451,8 +451,8 @@ public: setOwnedByLayout(true); } - QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF() ) const; - + QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF() ) const; + ~CustomLayoutItem() { m_destructedSet->insert(this); } @@ -482,8 +482,8 @@ public: m_destructedSet = destructedSet; } - QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF() ) const; - + QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF() ) const; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget * = 0) { const QRect r = option->rect.adjusted(0, 0, -1, -1); @@ -565,7 +565,7 @@ void insertItem(int index, QGraphicsLayoutItem *item) QGraphicsWidget *widget = static_cast(item); updateParentWidget(widget); - + if (index == items.count()) { items.append(item); @@ -613,7 +613,7 @@ void tst_QGraphicsLayout::ownership() CustomLayoutItem *li3 = new CustomLayoutItem(&destructedSet); lay->addItem(li3); destructedSet.clear(); - + delete lay; QSet expected; expected << li1 << li2 << li3; @@ -642,10 +642,10 @@ void tst_QGraphicsLayout::ownership() { QGraphicsWidget *window = new QGraphicsWidget(0, Qt::Window); QGraphicsLinearLayout *lay = new QGraphicsLinearLayout; - + CustomGraphicsWidget *li1 = new CustomGraphicsWidget; lay->addItem(li1); - + QGraphicsLinearLayout *li2 = new QGraphicsLinearLayout; CustomGraphicsWidget *li2_1 = new CustomGraphicsWidget; li2->addItem(li2_1); @@ -654,25 +654,25 @@ void tst_QGraphicsLayout::ownership() CustomGraphicsWidget *li2_3 = new CustomGraphicsWidget; li2->addItem(li2_3); lay->addItem(li2); - + CustomGraphicsWidget *li3 = new CustomGraphicsWidget; lay->addItem(li3); - + window->setLayout(lay); scene.addItem(window); view.resize(500, 200); view.show(); - + for (int i = li2->count(); i > 0; --i) { QCOMPARE(li2->count(), i); delete li2->itemAt(0); } - + for (int i = lay->count(); i > 0; --i) { QCOMPARE(lay->count(), i); delete lay->itemAt(0); } - + delete window; } @@ -687,7 +687,7 @@ void tst_QGraphicsLayout::ownership() delete top; //don't crash after that. } - + } QTEST_MAIN(tst_QGraphicsLayout) diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 0b1d5cf..b07d87e 100644 --- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -3187,7 +3187,7 @@ void tst_QGraphicsProxyWidget::windowFlags() QVERIFY((widget->windowFlags() & widgetWFlags) == widgetWFlags); proxy.setWidget(widget); - + if (resultingProxyFlags == 0) QVERIFY(!proxy.windowFlags()); else @@ -3223,4 +3223,3 @@ QTEST_MAIN(tst_QGraphicsProxyWidget) #else // QT_NO_STYLE_CLEANLOOKS QTEST_NOOP_MAIN #endif - diff --git a/tests/auto/qhostinfo/tst_qhostinfo.cpp b/tests/auto/qhostinfo/tst_qhostinfo.cpp index 50d2325..f4ad307 100644 --- a/tests/auto/qhostinfo/tst_qhostinfo.cpp +++ b/tests/auto/qhostinfo/tst_qhostinfo.cpp @@ -165,7 +165,7 @@ tst_QHostInfo::tst_QHostInfo() } tst_QHostInfo::~tst_QHostInfo() -{ +{ } void tst_QHostInfo::initTestCase() @@ -223,7 +223,7 @@ void tst_QHostInfo::lookupIPv4_data() QTest::newRow("empty") << "" << "" << int(QHostInfo::HostNotFound); QTest::newRow("lupinella_00") << "l" << lupinellaIp << int(QHostInfo::NoError); - QTest::newRow("lupinella_01") << "lupinella" << lupinellaIp << int(QHostInfo::NoError); + QTest::newRow("lupinella_01") << "lupinella" << lupinellaIp << int(QHostInfo::NoError); QTest::newRow("lupinella_02") << "lupinella.troll.no" << lupinellaIp << int(QHostInfo::NoError); QTest::newRow("lupinella_03") << "lupinella.trolltech.com" << lupinellaIp << int(QHostInfo::NoError); QTest::newRow("multiple_ip4") << "multi.dev.troll.no" << "1.2.3.4 1.2.3.5 10.3.3.31" << int(QHostInfo::NoError); @@ -392,7 +392,7 @@ protected: void tst_QHostInfo::threadSafety() { const int nattempts = 5; -#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) +#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) const int runs = 10; #else const int runs = 100; diff --git a/tests/auto/qhttp/tst_qhttp.cpp b/tests/auto/qhttp/tst_qhttp.cpp index a6bec39..37ce256 100644 --- a/tests/auto/qhttp/tst_qhttp.cpp +++ b/tests/auto/qhttp/tst_qhttp.cpp @@ -198,9 +198,9 @@ void tst_QHttp::initTestCase_data() QTest::addColumn("proxyType"); QTest::newRow("WithoutProxy") << false << 0; -#ifdef TEST_QNETWORK_PROXY +#ifdef TEST_QNETWORK_PROXY QTest::newRow("WithSocks5Proxy") << true << int(QNetworkProxy::Socks5Proxy); -#endif +#endif } void tst_QHttp::initTestCase() @@ -426,7 +426,7 @@ void tst_QHttp::head_data() QTest::newRow( "failprot_01" ) << QtNetworkSettings::serverName() << 80u << QString("/t") << 1 << 404 << 0u; - + QTest::newRow( "failprot_02" ) << QtNetworkSettings::serverName() << 80u << QString("qtest/rfc3252.txt") << 1 << 400 << 0u; @@ -1242,11 +1242,11 @@ void tst_QHttp::unexpectedRemoteClose() QCoreApplication::instance()->processEvents(); QEventLoop loop; -#ifndef Q_OS_SYMBIAN +#ifndef Q_OS_SYMBIAN QTimer::singleShot(3000, &loop, SLOT(quit())); -#else +#else QTimer::singleShot(30000, &loop, SLOT(quit())); -#endif +#endif QHttp http; QObject::connect(&http, SIGNAL(done(bool)), &loop, SLOT(quit())); diff --git a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp index 236d1a1..9fe59c9 100644 --- a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp +++ b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp @@ -419,17 +419,17 @@ void tst_QHttpNetworkConnection::post() QCOMPARE(reply->statusCode(), statusCode); QCOMPARE(reply->reasonPhrase(), statusString); - + qint64 cLen = reply->contentLength(); if (cLen==-1) { - // HTTP 1.1 server may respond with chunked encoding and in that + // HTTP 1.1 server may respond with chunked encoding and in that // case contentLength is not present in reply -> verify that it is the case QByteArray transferEnc = reply->headerField("Transfer-Encoding"); QCOMPARE(transferEnc, QByteArray("chunked")); - } else { + } else { QCOMPARE(cLen, qint64(contentLength)); - } - + } + stopWatch.start(); QByteArray ba; do { @@ -442,7 +442,7 @@ void tst_QHttpNetworkConnection::post() QVERIFY(reply->isFinished()); QCOMPARE(ba.size(), downloadSize); - + delete reply; } diff --git a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp index ce96a2c..4287a16 100644 --- a/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp +++ b/tests/auto/qhttpsocketengine/tst_qhttpsocketengine.cpp @@ -324,9 +324,9 @@ void tst_QHttpSocketEngine::simpleConnectToIMAP() array.resize(available); QVERIFY(socketDevice.read(array.data(), array.size()) == available); - // Check that the greeting is what we expect it to be - QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); - + // Check that the greeting is what we expect it to be + QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); + // Write a logout message QByteArray array2 = "XXXX LOGOUT\r\n"; @@ -455,7 +455,7 @@ void tst_QHttpSocketEngine::tcpSocketBlockingTest() // Read greeting QVERIFY(socket.waitForReadyRead(5000)); QString s = socket.readLine(); - QCOMPARE(s.toLatin1().constData(), QtNetworkSettings::expectedReplyIMAP().constData()); + QCOMPARE(s.toLatin1().constData(), QtNetworkSettings::expectedReplyIMAP().constData()); // Write NOOP QCOMPARE((int) socket.write("1 NOOP\r\n", 8), 8); @@ -528,11 +528,11 @@ void tst_QHttpSocketEngine::tcpSocketNonBlockingTest() } // Read greeting - QVERIFY(!tcpSocketNonBlocking_data.isEmpty()); - QCOMPARE(tcpSocketNonBlocking_data.at(0).toLatin1().constData(), - QtNetworkSettings::expectedReplyIMAP().constData()); - - + QVERIFY(!tcpSocketNonBlocking_data.isEmpty()); + QCOMPARE(tcpSocketNonBlocking_data.at(0).toLatin1().constData(), + QtNetworkSettings::expectedReplyIMAP().constData()); + + tcpSocketNonBlocking_data.clear(); tcpSocketNonBlocking_totalWritten = 0; @@ -710,10 +710,10 @@ void tst_QHttpSocketEngine::passwordAuth() QByteArray array; array.resize(available); QVERIFY(socketDevice.read(array.data(), array.size()) == available); - + // Check that the greeting is what we expect it to be - QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); - + QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); + // Write a logout message QByteArray array2 = "XXXX LOGOUT\r\n"; diff --git a/tests/auto/qimage/tst_qimage.cpp b/tests/auto/qimage/tst_qimage.cpp index af02bbf..703be80 100644 --- a/tests/auto/qimage/tst_qimage.cpp +++ b/tests/auto/qimage/tst_qimage.cpp @@ -270,7 +270,7 @@ void tst_QImage::formatHandlersInput_data() const QString prefix = QLatin1String(SRCDIR) + "images/"; #else const QString prefix = QLatin1String(SRCDIR) + "/images/"; - #endif + #endif // add a new line here when a file is added QTest::newRow("ICO") << "ICO" << prefix + "image.ico"; @@ -1476,9 +1476,9 @@ void tst_QImage::smoothScale3() void tst_QImage::smoothScaleBig() { #if defined(Q_OS_WINCE) - int bigValue = 2000; + int bigValue = 2000; #elif defined(Q_OS_SYMBIAN) - int bigValue = 2000; + int bigValue = 2000; #else int bigValue = 200000; #endif diff --git a/tests/auto/qimagereader/qimagereader.pro b/tests/auto/qimagereader/qimagereader.pro index 44a0ddc..b4e1de1 100644 --- a/tests/auto/qimagereader/qimagereader.pro +++ b/tests/auto/qimagereader/qimagereader.pro @@ -35,4 +35,3 @@ symbian*: { DEPLOYMENT += images imagePlugins } - diff --git a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp index f1adc51..df0853b 100644 --- a/tests/auto/qitemdelegate/tst_qitemdelegate.cpp +++ b/tests/auto/qitemdelegate/tst_qitemdelegate.cpp @@ -1120,7 +1120,7 @@ void tst_QItemDelegate::enterKey() QTest::keyClick(editor, Qt::Key(key)); QApplication::processEvents(); - + if (widget == 2 || widget == 3) { QVERIFY(!editor.isNull()); QCOMPARE(editor && editor->hasFocus(), expectedFocus); diff --git a/tests/auto/qitemview/tst_qitemview.cpp b/tests/auto/qitemview/tst_qitemview.cpp index 6b664e7..afe679c 100644 --- a/tests/auto/qitemview/tst_qitemview.cpp +++ b/tests/auto/qitemview/tst_qitemview.cpp @@ -256,7 +256,7 @@ void tst_QItemView::populate() { treeModel = new CheckerModel; QModelIndex parent; -#if defined(QT_ARCH_ARM) || defined(Q_OS_SYMBIAN) +#if defined(QT_ARCH_ARM) || defined(Q_OS_SYMBIAN) const int baseInsert = 4; #else const int baseInsert = 26; @@ -360,7 +360,7 @@ void tst_QItemView::nonDestructiveBasicTest() QCOMPARE(view->showDropIndicator(), false); view->setDropIndicatorShown(true); QCOMPARE(view->showDropIndicator(), true); - + // setDragEnabled view->setDragEnabled(false); QCOMPARE(view->dragEnabled(), false); diff --git a/tests/auto/qkeyevent/tst_qkeyevent.cpp b/tests/auto/qkeyevent/tst_qkeyevent.cpp index 1e19a49..9adf97c 100644 --- a/tests/auto/qkeyevent/tst_qkeyevent.cpp +++ b/tests/auto/qkeyevent/tst_qkeyevent.cpp @@ -179,7 +179,7 @@ void tst_QKeyEvent::sendRecieveKeyEvents() QFETCH( QString, text ); testWidget->recievedKeyPress = false; -#ifdef Q_WS_WIN +#ifdef Q_WS_WIN // Will be eaten by Windows system if ( key == Qt::Key_Print ) return; @@ -208,7 +208,7 @@ void tst_QKeyEvent::sendRecieveKeyEvents() if ( key >= Qt::Key_BracketRight && key <= Qt::Key_ydiaeresis ) return; #endif // Q_WS_WIN - + #ifdef Q_OS_SYMBIAN // Not supported on symbian if ( key == Qt::Key_Print ) @@ -238,7 +238,7 @@ void tst_QKeyEvent::sendRecieveKeyEvents() if ( key >= Qt::Key_BracketRight && key <= Qt::Key_ydiaeresis ) return; #endif // Q_WS_WIN - + if ( key == Qt::Key_F1 ) return; // Ignore for the moment diff --git a/tests/auto/qlibrary/tst/tst.pro b/tests/auto/qlibrary/tst/tst.pro index 06c2cd8..e15d7ed 100644 --- a/tests/auto/qlibrary/tst/tst.pro +++ b/tests/auto/qlibrary/tst/tst.pro @@ -22,7 +22,7 @@ wince*: { system.trolltech.test.mylib.dll binDep.path = /sys/bin #mylib.dl2 nonstandard binary deployment will cause warning in emulator, -#but it can be safely ignored. +#but it can be safely ignored. custBinDep.sources = mylib.dl2 custBinDep.path = /sys/bin diff --git a/tests/auto/qlocalsocket/lackey/lackey.pro b/tests/auto/qlocalsocket/lackey/lackey.pro index f073e7a..7bb6bc3 100644 --- a/tests/auto/qlocalsocket/lackey/lackey.pro +++ b/tests/auto/qlocalsocket/lackey/lackey.pro @@ -12,7 +12,7 @@ mac:CONFIG -= app_bundle DEFINES += QLOCALSERVER_DEBUG DEFINES += QLOCALSOCKET_DEBUG -SOURCES += main.cpp +SOURCES += main.cpp TARGET = lackey -symbian:TARGET.CAPABILITY = ALL -TCB \ No newline at end of file +symbian:TARGET.CAPABILITY = ALL -TCB \ No newline at end of file diff --git a/tests/auto/qlocalsocket/test/test.pro b/tests/auto/qlocalsocket/test/test.pro index e399a29..da741b9 100644 --- a/tests/auto/qlocalsocket/test/test.pro +++ b/tests/auto/qlocalsocket/test/test.pro @@ -43,5 +43,5 @@ wince*|symbian { scriptFiles.path = lackey/scripts DEPLOYMENT = additionalFiles scriptFiles QT += script # for easy deployment of QtScript -} +} diff --git a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp index be8ec3f..e20105b 100644 --- a/tests/auto/qlocalsocket/tst_qlocalsocket.cpp +++ b/tests/auto/qlocalsocket/tst_qlocalsocket.cpp @@ -55,7 +55,7 @@ #ifdef Q_OS_SYMBIAN #define STRINGIFY(x) #x #define TOSTRING(x) STRINGIFY(x) - #define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/" + #define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/" #endif Q_DECLARE_METATYPE(QLocalSocket::LocalSocketError) Q_DECLARE_METATYPE(QLocalSocket::LocalSocketState) @@ -377,7 +377,7 @@ void tst_QLocalSocket::listenAndConnect() QSignalSpy spyReadyRead(socket, SIGNAL(readyRead())); socket->connectToServer(name); -#if defined(QT_LOCALSOCKET_TCP) || defined (Q_OS_SYMBIAN) +#if defined(QT_LOCALSOCKET_TCP) || defined (Q_OS_SYMBIAN) QTest::qWait(250); #endif @@ -579,10 +579,10 @@ void tst_QLocalSocket::fullPath() LocalSocket socket; socket.connectToServer(serverName); -#if defined (Q_OS_SYMBIAN) +#if defined (Q_OS_SYMBIAN) QTest::qWait(250); -#endif - +#endif + QCOMPARE(socket.serverName(), serverName); QCOMPARE(socket.fullServerName(), serverName); socket.disconnectFromServer(); @@ -730,16 +730,16 @@ void tst_QLocalSocket::threadedConnection() Server server; #if defined(Q_OS_SYMBIAN) server.setStackSize(0x14000); -#endif +#endif server.clients = threads; server.start(); QList clients; for (int i = 0; i < threads; ++i) { clients.append(new Client()); -#if defined(Q_OS_SYMBIAN) +#if defined(Q_OS_SYMBIAN) clients.last()->setStackSize(0x14000); -#endif +#endif clients.last()->start(); } @@ -951,7 +951,7 @@ void tst_QLocalSocket::unlink(QString name) int result = ::unlink(fullName.toUtf8().data()); if(result != 0) { - qWarning() << "Unlinking " << fullName << " failed with " << strerror(errno); + qWarning() << "Unlinking " << fullName << " failed with " << strerror(errno); } } #endif diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp index ce6afa1..9568e69 100644 --- a/tests/auto/qmenu/tst_qmenu.cpp +++ b/tests/auto/qmenu/tst_qmenu.cpp @@ -443,7 +443,7 @@ void tst_QMenu::overrideMenuAction() delete aFileMenu; - //after the deletion of the override menu action, + //after the deletion of the override menu action, //the menu should have its default menu action back QCOMPARE(m->menuAction(), menuaction); @@ -472,7 +472,7 @@ void tst_QMenu::statusTip() QVERIFY(btn != NULL); - //because showMenu calls QMenu::exec, we need to use a singleshot + //because showMenu calls QMenu::exec, we need to use a singleshot //to continue the test QTimer::singleShot(200,this, SLOT(onStatusTipTimer())); btn->showMenu(); @@ -486,10 +486,10 @@ void tst_QMenu::onStatusTipTimer() QVERIFY(menu != 0); QVERIFY(menu->isVisible()); QTest::keyClick(menu, Qt::Key_Down); - + //we store the statustip to press escape in any case //otherwise, if the test fails it blocks (never gets out of QMenu::exec - const QString st=statustip; + const QString st=statustip; menu->close(); //goes out of the menu @@ -554,10 +554,10 @@ void tst_QMenu::tearOff() menu->popup(QPoint(0,0)); QTest::qWait(50); QVERIFY(!menu->isTearOffMenuVisible()); - + QTest::mouseClick(menu, Qt::LeftButton, 0, QPoint(3, 3), 10); QTest::qWait(100); - + QVERIFY(menu->isTearOffMenuVisible()); QPointer torn = 0; foreach (QWidget *w, QApplication::allWidgets()) { @@ -640,7 +640,7 @@ void tst_QMenu::activeSubMenuPosition() main->setActiveAction(menuAction); sub->setActiveAction(subAction); -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN main->popup(QPoint(50,200)); #else main->popup(QPoint(200,200)); diff --git a/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp b/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp index dd584a0..be0bfe3 100644 --- a/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp +++ b/tests/auto/qnativesocketengine/tst_qnativesocketengine.cpp @@ -204,9 +204,9 @@ void tst_QNativeSocketEngine::simpleConnectToIMAP() //--------------------------------------------------------------------------- void tst_QNativeSocketEngine::udpLoopbackTest() { -#ifdef SYMBIAN_WINSOCK_CONNECTIVITY +#ifdef SYMBIAN_WINSOCK_CONNECTIVITY QSKIP("Not working on Emulator without WinPCAP", SkipAll); -#endif +#endif QNativeSocketEngine udpSocket; // Initialize device #1 @@ -257,7 +257,7 @@ void tst_QNativeSocketEngine::udpIPv6LoopbackTest() { #if defined(Q_OS_SYMBIAN) QSKIP("Symbian: IPv6 is not yet supported", SkipAll); -#endif +#endif QNativeSocketEngine udpSocket; // Initialize device #1 @@ -309,7 +309,7 @@ void tst_QNativeSocketEngine::broadcastTest() { #ifdef Q_OS_AIX QSKIP("Broadcast does not work on darko", SkipAll); -#endif +#endif QNativeSocketEngine broadcastSocket; // Initialize a regular Udp socket @@ -401,10 +401,10 @@ void tst_QNativeSocketEngine::serverTest() //--------------------------------------------------------------------------- void tst_QNativeSocketEngine::udpLoopbackPerformance() -{ -#ifdef SYMBIAN_WINSOCK_CONNECTIVITY +{ +#ifdef SYMBIAN_WINSOCK_CONNECTIVITY QSKIP("Not working on Emulator without WinPCAP", SkipAll); -#endif +#endif QNativeSocketEngine udpSocket; // Initialize device #1 @@ -576,13 +576,13 @@ void tst_QNativeSocketEngine::bind() QNativeSocketEngine binder3; QVERIFY(binder3.initialize(QAbstractSocket::TcpSocket, QAbstractSocket::IPv4Protocol)); QVERIFY(!binder3.bind(QHostAddress::Any, 31180)); - -#ifdef SYMBIAN_WINSOCK_CONNECTIVITY + +#ifdef SYMBIAN_WINSOCK_CONNECTIVITY qDebug("On Symbian Emulator (WinSock) we get EADDRNOTAVAIL instead of EADDRINUSE"); - QVERIFY(binder3.error() == QAbstractSocket::SocketAddressNotAvailableError); + QVERIFY(binder3.error() == QAbstractSocket::SocketAddressNotAvailableError); #else QVERIFY(binder3.error() == QAbstractSocket::AddressInUseError); -#endif +#endif } //--------------------------------------------------------------------------- diff --git a/tests/auto/qnetworkinterface/tst_qnetworkinterface.cpp b/tests/auto/qnetworkinterface/tst_qnetworkinterface.cpp index cf3d856..f3f343b 100644 --- a/tests/auto/qnetworkinterface/tst_qnetworkinterface.cpp +++ b/tests/auto/qnetworkinterface/tst_qnetworkinterface.cpp @@ -129,8 +129,8 @@ void tst_QNetworkInterface::loopbackIPv6() { #ifdef Q_OS_SYMBIAN QSKIP( "Symbian: IPv6 is not yet supported", SkipAll ); -#else - +#else + QList all = QNetworkInterface::allAddresses(); bool loopbackfound = false; @@ -142,9 +142,9 @@ void tst_QNetworkInterface::loopbackIPv6() break; } else if (addr.protocol() == QAbstractSocket::IPv6Protocol) anyIPv6 = true; - + QVERIFY(!anyIPv6 || loopbackfound); -#endif +#endif } void tst_QNetworkInterface::localAddress() diff --git a/tests/auto/qnetworkreply/test/test.pro b/tests/auto/qnetworkreply/test/test.pro index 593de8b..e0df503 100644 --- a/tests/auto/qnetworkreply/test/test.pro +++ b/tests/auto/qnetworkreply/test/test.pro @@ -25,12 +25,10 @@ symbian:{ addFiles.sources = ../empty ../rfc3252.txt ../resource ../bigfile addFiles.path = . DEPLOYMENT += addFiles - + # Symbian toolchain does not support correct include semantics INCPATH+=..\..\..\..\include\QtNetwork\private # bigfile test case requires more heap TARGET.EPOCHEAPSIZE="0x100 0x1000000" TARGET.CAPABILITY="ALL -TCB" } - - diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp index 305eca6..3817d9e 100644 --- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp @@ -876,7 +876,7 @@ tst_QNetworkReply::tst_QNetworkReply() } tst_QNetworkReply::~tst_QNetworkReply() -{ +{ } @@ -1721,11 +1721,11 @@ void tst_QNetworkReply::ioGetFromFtp() DataReader reader(reply); connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN QTestEventLoop::instance().enterLoop(20); #else - QTestEventLoop::instance().enterLoop(10); -#endif + QTestEventLoop::instance().enterLoop(10); +#endif QVERIFY(!QTestEventLoop::instance().timeout()); QCOMPARE(reply->url(), request.url()); @@ -1755,19 +1755,19 @@ void tst_QNetworkReply::ioGetFromFtpWithReuse() QSignalSpy spy(reply1, SIGNAL(finished())); connect(reply2, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN QTestEventLoop::instance().enterLoop(20); #else - QTestEventLoop::instance().enterLoop(10); -#endif + QTestEventLoop::instance().enterLoop(10); +#endif QVERIFY(!QTestEventLoop::instance().timeout()); if (spy.count() == 0) { connect(reply1, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN QTestEventLoop::instance().enterLoop(20); #else - QTestEventLoop::instance().enterLoop(10); -#endif + QTestEventLoop::instance().enterLoop(10); +#endif QVERIFY(!QTestEventLoop::instance().timeout()); } @@ -2456,11 +2456,11 @@ void tst_QNetworkReply::ioGetWithManyProxies() SLOT(sslErrors(QNetworkReply*,QList))); #endif -#ifndef Q_OS_SYMBIAN +#ifndef Q_OS_SYMBIAN QTestEventLoop::instance().enterLoop(10); -#else +#else QTestEventLoop::instance().enterLoop(60); -#endif +#endif QVERIFY(!QTestEventLoop::instance().timeout()); manager.disconnect(SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), @@ -3308,11 +3308,11 @@ void tst_QNetworkReply::downloadProgress() QVERIFY2(sender->waitForBytesWritten(2000), "Network timeout"); spy.clear(); -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN QTestEventLoop::instance().enterLoop(5); #else QTestEventLoop::instance().enterLoop(2); -#endif +#endif QVERIFY(!QTestEventLoop::instance().timeout()); QVERIFY(spy.count() > 0); @@ -3325,11 +3325,11 @@ void tst_QNetworkReply::downloadProgress() delete sender; spy.clear(); -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN QTestEventLoop::instance().enterLoop(5); #else QTestEventLoop::instance().enterLoop(2); -#endif +#endif QVERIFY(!QTestEventLoop::instance().timeout()); QVERIFY(spy.count() > 0); @@ -3344,7 +3344,7 @@ void tst_QNetworkReply::uploadProgress_data() } void tst_QNetworkReply::uploadProgress() -{ +{ QFETCH(QByteArray, data); QTcpServer server; QVERIFY(server.listen()); @@ -3616,11 +3616,11 @@ void tst_QNetworkReply::httpProxyCommands() // wait for the finished signal connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN QTestEventLoop::instance().enterLoop(5); #else - QTestEventLoop::instance().enterLoop(1); -#endif + QTestEventLoop::instance().enterLoop(1); +#endif QVERIFY(!QTestEventLoop::instance().timeout()); diff --git a/tests/auto/qobject/qobject.pro b/tests/auto/qobject/qobject.pro index 0cafdc3..b6b3f20 100644 --- a/tests/auto/qobject/qobject.pro +++ b/tests/auto/qobject/qobject.pro @@ -1,4 +1,2 @@ TEMPLATE = subdirs SUBDIRS = tst_qobject.pro signalbug.pro - - diff --git a/tests/auto/qobject/tst_qobject.cpp b/tests/auto/qobject/tst_qobject.cpp index 3276dee..f2d3651 100644 --- a/tests/auto/qobject/tst_qobject.cpp +++ b/tests/auto/qobject/tst_qobject.cpp @@ -1422,7 +1422,7 @@ void tst_QObject::moveToThread() #if defined(Q_OS_SYMBIAN) // Child timer will be registered after parent timer in the new // thread, and 10ms is less than symbian timer resolution, so - // child->timerEventThread compare after thread.wait() will + // child->timerEventThread compare after thread.wait() will // usually fail unless timers are farther apart. child->startTimer(100); object->startTimer(150); diff --git a/tests/auto/qobject/tst_qobject.pro b/tests/auto/qobject/tst_qobject.pro index b3bda37..aed181f 100644 --- a/tests/auto/qobject/tst_qobject.pro +++ b/tests/auto/qobject/tst_qobject.pro @@ -15,4 +15,3 @@ symbian: { addFiles.path = \sys\bin DEPLOYMENT += addFiles } - diff --git a/tests/auto/qobjectrace/tst_qobjectrace.cpp b/tests/auto/qobjectrace/tst_qobjectrace.cpp index b3052e0..b7a0bd6 100644 --- a/tests/auto/qobjectrace/tst_qobjectrace.cpp +++ b/tests/auto/qobjectrace/tst_qobjectrace.cpp @@ -44,8 +44,8 @@ #include -enum { OneMinute = 60 * 1000, - TwoMinutes = OneMinute * 2, +enum { OneMinute = 60 * 1000, + TwoMinutes = OneMinute * 2, TenMinutes = OneMinute * 10, TwentyFiveMinutes = OneMinute * 25 }; @@ -143,7 +143,7 @@ void tst_QObjectRace::moveToThreadRace() // ### FIXME: task 257411 - remove xfail once this is fixed QEXPECT_FAIL("", "Symbian event dispatcher can't handle this kind of race, see task: 257411", Abort); QVERIFY(false); -#endif +#endif RaceObject *object = new RaceObject; enum { ThreadCount = 10 }; @@ -222,7 +222,7 @@ public: // Symbian needs "a bit" more time # define EXTRA_THREAD_WAIT TenMinutes # define MAIN_THREAD_WAIT TwentyFiveMinutes -#else +#else # define EXTRA_THREAD_WAIT 3000 # define MAIN_THREAD_WAIT TwoMinutes #endif @@ -230,13 +230,13 @@ public: void tst_QObjectRace::destroyRace() { #if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86) - // ### FIXME: task 257411 - remove xfail once this is fixed. + // ### FIXME: task 257411 - remove xfail once this is fixed. // Oddly enough, this seems to work properly in HW, if given enough time and memory. QEXPECT_FAIL("", "Symbian event dispatcher can't handle this kind of race on emulator, see task: 257411", Abort); QVERIFY(false); -#endif +#endif - enum { ThreadCount = 10, ObjectCountPerThread = 733, + enum { ThreadCount = 10, ObjectCountPerThread = 733, ObjectCount = ThreadCount * ObjectCountPerThread }; const char *_slots[] = { SLOT(slot1()) , SLOT(slot2()) , SLOT(slot3()), diff --git a/tests/auto/qpluginloader/tst/tst.pro b/tests/auto/qpluginloader/tst/tst.pro index f848bb1..ecc4ecb 100644 --- a/tests/auto/qpluginloader/tst/tst.pro +++ b/tests/auto/qpluginloader/tst/tst.pro @@ -24,7 +24,6 @@ symbian: { libDep.path = /sys/bin pluginDep.sources = theplugin.dll pluginDep.path = bin - + DEPLOYMENT += libDep pluginDep } - diff --git a/tests/auto/qpluginloader/tst_qpluginloader.cpp b/tests/auto/qpluginloader/tst_qpluginloader.cpp index 5f07c78..d45acaf 100644 --- a/tests/auto/qpluginloader/tst_qpluginloader.cpp +++ b/tests/auto/qpluginloader/tst_qpluginloader.cpp @@ -303,13 +303,13 @@ void tst_QPluginLoader::checkingStubsFromDifferentDrives() // This test needs C-drive + some additional drive (driveForStubs) - const QString driveForStubs("E:/");// != "C:/" + const QString driveForStubs("E:/");// != "C:/" const QString stubDir("system/temp/stubtest/"); const QString stubName("dummyStub.qtplugin"); const QString fullStubFileName(stubDir + stubName); QDir dir(driveForStubs); bool test1(false); bool test2(false); - + // initial clean up QFile::remove(driveForStubs + fullStubFileName); dir.rmdir(driveForStubs + stubDir); @@ -317,22 +317,22 @@ void tst_QPluginLoader::checkingStubsFromDifferentDrives() // create a stub dir and do stub drive check if (!dir.mkpath(stubDir)) QSKIP("Required drive not available for this test", SkipSingle); - + {// test without stub, should not be found QPluginLoader loader("C:/" + fullStubFileName); test1 = !loader.fileName().length(); - } - + } + // create a stub to defined drive QFile tempFile(driveForStubs + fullStubFileName); tempFile.open(QIODevice::ReadWrite); QFileInfo fileInfo(tempFile); - - {// now should be found even tried to find from C: + + {// now should be found even tried to find from C: QPluginLoader loader("C:/" + fullStubFileName); test2 = (loader.fileName() == fileInfo.absoluteFilePath()); } - + // clean up tempFile.close(); if (!QFile::remove(driveForStubs + fullStubFileName)) @@ -343,10 +343,9 @@ void tst_QPluginLoader::checkingStubsFromDifferentDrives() // test after cleanup QVERIFY(test1); QVERIFY(test2); - + #endif//Q_OS_SYMBIAN } QTEST_APPLESS_MAIN(tst_QPluginLoader) #include "tst_qpluginloader.moc" - diff --git a/tests/auto/qprogressbar/tst_qprogressbar.cpp b/tests/auto/qprogressbar/tst_qprogressbar.cpp index 403b56b..7f0c17d 100644 --- a/tests/auto/qprogressbar/tst_qprogressbar.cpp +++ b/tests/auto/qprogressbar/tst_qprogressbar.cpp @@ -174,7 +174,7 @@ void tst_QProgressBar::format() bar.repainted = false; bar.setFormat("%v of %m (%p%)"); qApp->processEvents(); -#ifndef Q_WS_MAC +#ifndef Q_WS_MAC // The Mac scroll bar is animated, which means we get paint events all the time. QVERIFY(!bar.repainted); #endif diff --git a/tests/auto/qresourceengine/qresourceengine.pro b/tests/auto/qresourceengine/qresourceengine.pro index d98c2db..3fad4c0 100644 --- a/tests/auto/qresourceengine/qresourceengine.pro +++ b/tests/auto/qresourceengine/qresourceengine.pro @@ -7,12 +7,12 @@ load(resources) # Input SOURCES += tst_resourceengine.cpp -RESOURCES += testqrc/test.qrc +RESOURCES += testqrc/test.qrc symbian-sbsv2 { - runtime_resource.target = $$PWD/runtime_resource.rcc + runtime_resource.target = $$PWD/runtime_resource.rcc } else { - runtime_resource.target = runtime_resource.rcc + runtime_resource.target = runtime_resource.rcc } runtime_resource.depends = $$PWD/testqrc/test.qrc runtime_resource.commands = $$QMAKE_RCC -root /runtime_resource/ -binary $${runtime_resource.depends} -o $${runtime_resource.target} @@ -21,15 +21,15 @@ PRE_TARGETDEPS += $${runtime_resource.target} wince*|symbian*:{ deploy.sources += runtime_resource.rcc parentdir.txt - test.sources = testqrc/* + test.sources = testqrc/* test.path = testqrc alias.sources = testqrc/aliasdir/* alias.path = testqrc/aliasdir - other.sources = testqrc/otherdir/* + other.sources = testqrc/otherdir/* other.path = testqrc/otherdir - search1.sources = testqrc/searchpath1/* + search1.sources = testqrc/searchpath1/* search1.path = testqrc/searchpath1 - search2.sources = testqrc/searchpath2/* + search2.sources = testqrc/searchpath2/* search2.path = testqrc/searchpath2 sub.sources = testqrc/subdir/* sub.path = testqrc/subdir diff --git a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp index 7215852..130133c 100644 --- a/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp +++ b/tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp @@ -256,8 +256,8 @@ tst_Suite::tst_Suite() #ifdef Q_OS_SYMBIAN addTestExclusion("nested-repetition-count-overflow", "Demands too much memory on Symbian"); - addTestExclusion("unicode-test", "Demands too much memory on Symbian"); -#endif + addTestExclusion("unicode-test", "Demands too much memory on Symbian"); +#endif QVector *data = qt_meta_data_tst_Suite(); // content: diff --git a/tests/auto/qsettings/tst_qsettings.cpp b/tests/auto/qsettings/tst_qsettings.cpp index 2731c01..fdb2eb3 100644 --- a/tests/auto/qsettings/tst_qsettings.cpp +++ b/tests/auto/qsettings/tst_qsettings.cpp @@ -124,7 +124,7 @@ private slots: void setPath(); void setDefaultFormat(); void dontCreateNeedlessPaths(); -#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN) +#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN) void dontReorderIniKeysNeedlessly(); #endif @@ -3673,7 +3673,7 @@ void tst_QSettings::dontCreateNeedlessPaths() QVERIFY(!fileInfo.dir().exists()); } -#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN) +#if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN) void tst_QSettings::dontReorderIniKeysNeedlessly() { #ifdef QT_QSETTINGS_ALWAYS_CASE_SENSITIVE_AND_FORGET_ORIGINAL_KEY_ORDER diff --git a/tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp b/tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp index d4ae159..a6064bc 100644 --- a/tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp +++ b/tests/auto/qsocketnotifier/tst_qsocketnotifier.cpp @@ -134,24 +134,24 @@ void tst_QSocketNotifier::unexpectedDisconnection() QNativeSocketEngine readEnd1; readEnd1.initialize(QAbstractSocket::TcpSocket); - bool b = readEnd1.connectToHost(server.serverAddress(), server.serverPort()); + bool b = readEnd1.connectToHost(server.serverAddress(), server.serverPort()); QVERIFY(readEnd1.waitForWrite()); // while (!b && readEnd1.state() != QAbstractSocket::ConnectedState) // b = readEnd1.connectToHost(server.serverAddress(), server.serverPort()); QVERIFY(readEnd1.state() == QAbstractSocket::ConnectedState); - QVERIFY(server.waitForNewConnection()); + QVERIFY(server.waitForNewConnection()); QTcpSocket *writeEnd1 = server.nextPendingConnection(); QVERIFY(writeEnd1 != 0); - + QNativeSocketEngine readEnd2; readEnd2.initialize(QAbstractSocket::TcpSocket); - b = readEnd2.connectToHost(server.serverAddress(), server.serverPort()); + b = readEnd2.connectToHost(server.serverAddress(), server.serverPort()); QVERIFY(readEnd2.waitForWrite()); // while (!b) // b = readEnd2.connectToHost(server.serverAddress(), server.serverPort()); QVERIFY(readEnd2.state() == QAbstractSocket::ConnectedState); - QVERIFY(server.waitForNewConnection()); - QTcpSocket *writeEnd2 = server.nextPendingConnection(); + QVERIFY(server.waitForNewConnection()); + QTcpSocket *writeEnd2 = server.nextPendingConnection(); QVERIFY(writeEnd2 != 0); writeEnd1->write("1", 1); @@ -167,7 +167,7 @@ void tst_QSocketNotifier::unexpectedDisconnection() do { // we have to wait until sequence value changes - // as any event can make us jump out processing + // as any event can make us jump out processing QCoreApplication::processEvents(QEventLoop::WaitForMoreEvents); } while(tester.getSequence() <= 0); diff --git a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp index 2fc80da..d6628bd 100644 --- a/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp +++ b/tests/auto/qsocks5socketengine/tst_qsocks5socketengine.cpp @@ -336,7 +336,7 @@ void tst_QSocks5SocketEngine::simpleConnectToIMAP() QVERIFY(socketDevice.read(array.data(), array.size()) == available); // Check that the greeting is what we expect it to be - QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); + QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); // Write a logout message QByteArray array2 = "XXXX LOGOUT\r\n"; @@ -528,10 +528,10 @@ void tst_QSocks5SocketEngine::serverTest() //--------------------------------------------------------------------------- void tst_QSocks5SocketEngine::udpTest() { -#ifdef SYMBIAN_WINSOCK_CONNECTIVITY +#ifdef SYMBIAN_WINSOCK_CONNECTIVITY QSKIP("UDP works bads on non WinPCAP emulator setting", SkipAll); -#endif - +#endif + QSocks5SocketEngine udpSocket; // Initialize device #1 @@ -669,10 +669,10 @@ void tst_QSocks5SocketEngine::tcpSocketNonBlockingTest() } // Read greeting - QVERIFY(!tcpSocketNonBlocking_data.isEmpty()); - QCOMPARE(tcpSocketNonBlocking_data.at(0).toLatin1().constData(), - QtNetworkSettings::expectedReplyIMAP().constData()); - + QVERIFY(!tcpSocketNonBlocking_data.isEmpty()); + QCOMPARE(tcpSocketNonBlocking_data.at(0).toLatin1().constData(), + QtNetworkSettings::expectedReplyIMAP().constData()); + tcpSocketNonBlocking_data.clear(); tcpSocketNonBlocking_totalWritten = 0; @@ -857,9 +857,9 @@ void tst_QSocks5SocketEngine::passwordAuth() array.resize(available); QVERIFY(socketDevice.read(array.data(), array.size()) == available); - // Check that the greeting is what we expect it to be - QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); - + // Check that the greeting is what we expect it to be + QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); + // Write a logout message QByteArray array2 = "XXXX LOGOUT\r\n"; QVERIFY(socketDevice.write(array2.data(), @@ -925,9 +925,9 @@ void tst_QSocks5SocketEngine::passwordAuth2() array.resize(available); QVERIFY(socketDevice.read(array.data(), array.size()) == available); - // Check that the greeting is what we expect it to be - QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); - + // Check that the greeting is what we expect it to be + QCOMPARE(array.constData(), QtNetworkSettings::expectedReplyIMAP().constData()); + // Write a logout message QByteArray array2 = "XXXX LOGOUT\r\n"; QVERIFY(socketDevice.write(array2.data(), diff --git a/tests/auto/qsql/qsql.pro b/tests/auto/qsql/qsql.pro index 6660f42..167a38d 100644 --- a/tests/auto/qsql/qsql.pro +++ b/tests/auto/qsql/qsql.pro @@ -1,7 +1,7 @@ load(qttest_p4) SOURCES += tst_qsql.cpp -QT += sql +QT += sql contains(QT_CONFIG, qt3support): QT += qt3support @@ -12,7 +12,7 @@ wince*: { symbian { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.sources = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqldatabase/qsqldatabase.pro b/tests/auto/qsqldatabase/qsqldatabase.pro index d4d049a..1749d1e 100644 --- a/tests/auto/qsqldatabase/qsqldatabase.pro +++ b/tests/auto/qsqldatabase/qsqldatabase.pro @@ -19,10 +19,10 @@ wince*: { symbian { TARGET.EPOCHEAPSIZE=5000 5000000 TARGET.EPOCSTACKSIZE=50000 - + contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.sources = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqldriver/qsqldriver.pro b/tests/auto/qsqldriver/qsqldriver.pro index 0024841..59fc73a 100644 --- a/tests/auto/qsqldriver/qsqldriver.pro +++ b/tests/auto/qsqldriver/qsqldriver.pro @@ -6,7 +6,7 @@ QT += sql wince*: { plugFiles.sources = ../../../plugins/sqldrivers plugFiles.path = . - DEPLOYMENT += plugFiles + DEPLOYMENT += plugFiles } else { win32-g++ { LIBS += -lws2_32 diff --git a/tests/auto/qsqlerror/qsqlerror.pro b/tests/auto/qsqlerror/qsqlerror.pro index 855e720..2eb7934 100644 --- a/tests/auto/qsqlerror/qsqlerror.pro +++ b/tests/auto/qsqlerror/qsqlerror.pro @@ -10,7 +10,7 @@ SOURCES += tst_qsqlerror.cpp symbian { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.sources = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqlfield/qsqlfield.pro b/tests/auto/qsqlfield/qsqlfield.pro index 022d73f..6e5b461 100644 --- a/tests/auto/qsqlfield/qsqlfield.pro +++ b/tests/auto/qsqlfield/qsqlfield.pro @@ -6,7 +6,7 @@ QT += sql symbian { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.sources = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqlquery/qsqlquery.pro b/tests/auto/qsqlquery/qsqlquery.pro index 0313775..6222fa0 100644 --- a/tests/auto/qsqlquery/qsqlquery.pro +++ b/tests/auto/qsqlquery/qsqlquery.pro @@ -10,13 +10,13 @@ QT = core sql wince*: { plugFiles.sources = ../../../plugins/sqldrivers plugFiles.path = . - DEPLOYMENT += plugFiles + DEPLOYMENT += plugFiles } symbian { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.sources = sqlite3.dll DEPLOYMENT += sqlite } } diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp index ab7f0c9..3187854 100644 --- a/tests/auto/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp @@ -302,7 +302,7 @@ void tst_QSqlQuery::dropTestTables( QSqlDatabase db ) tablenames << qTableName( "qtest_lockedtable" ); tablenames << qTableName( "Planet" ); - + tablenames << qTableName( "task_250026" ); tablenames << qTableName( "task_234422" ); diff --git a/tests/auto/qsqlquerymodel/qsqlquerymodel.pro b/tests/auto/qsqlquerymodel/qsqlquerymodel.pro index 7aa78a1..0adb6cd 100644 --- a/tests/auto/qsqlquerymodel/qsqlquerymodel.pro +++ b/tests/auto/qsqlquerymodel/qsqlquerymodel.pro @@ -8,7 +8,7 @@ wince*: { }else:symbian { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.sources = sqlite3.dll DEPLOYMENT += sqlite } }else { diff --git a/tests/auto/qsqlrecord/qsqlrecord.pro b/tests/auto/qsqlrecord/qsqlrecord.pro index db92c09..67e8ab9 100644 --- a/tests/auto/qsqlrecord/qsqlrecord.pro +++ b/tests/auto/qsqlrecord/qsqlrecord.pro @@ -4,7 +4,7 @@ SOURCES += tst_qsqlrecord.cpp symbian { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.sources = sqlite3.dll DEPLOYMENT += sqlite } diff --git a/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro b/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro index 6d7795b..5236447 100644 --- a/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro +++ b/tests/auto/qsqlrelationaltablemodel/qsqlrelationaltablemodel.pro @@ -6,11 +6,11 @@ QT += sql wince*: { plugFiles.sources = ../../../plugins/sqldrivers plugFiles.path = . - DEPLOYMENT += plugFiles + DEPLOYMENT += plugFiles }else:symbian { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.sources = sqlite3.dll DEPLOYMENT += sqlite } }else { diff --git a/tests/auto/qsqltablemodel/qsqltablemodel.pro b/tests/auto/qsqltablemodel/qsqltablemodel.pro index f7043cc..a9a536b 100644 --- a/tests/auto/qsqltablemodel/qsqltablemodel.pro +++ b/tests/auto/qsqltablemodel/qsqltablemodel.pro @@ -6,11 +6,11 @@ QT += sql wince*: { plugFiles.sources = ../../../plugins/sqldrivers plugFiles.path = . - DEPLOYMENT += plugFiles + DEPLOYMENT += plugFiles }else:symbian { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.sources = sqlite3.dll DEPLOYMENT += sqlite } }else { diff --git a/tests/auto/qsqlthread/qsqlthread.pro b/tests/auto/qsqlthread/qsqlthread.pro index 05c84e2..414f857 100644 --- a/tests/auto/qsqlthread/qsqlthread.pro +++ b/tests/auto/qsqlthread/qsqlthread.pro @@ -7,11 +7,11 @@ QT = core sql wince*: { plugFiles.sources = ../../../plugins/sqldrivers plugFiles.path = . - DEPLOYMENT += plugFiles + DEPLOYMENT += plugFiles }else:symbian { contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { sqlite.path = /sys/bin - sqlite.sources = sqlite3.dll + sqlite.sources = sqlite3.dll DEPLOYMENT += sqlite } }else { diff --git a/tests/auto/qsslsocket/qsslsocket.pro b/tests/auto/qsslsocket/qsslsocket.pro index 8f61318..147175e 100644 --- a/tests/auto/qsslsocket/qsslsocket.pro +++ b/tests/auto/qsslsocket/qsslsocket.pro @@ -17,7 +17,7 @@ win32 { wince* { DEFINES += SRCDIR=\\\"./\\\" - + certFiles.sources = certs ssl.tar.gz certFiles.path = . DEPLOYMENT += certFiles @@ -25,7 +25,7 @@ wince* { DEFINES += QSSLSOCKET_CERTUNTRUSTED_WORKAROUND TARGET.EPOCHEAPSIZE="0x100 0x1000000" TARGET.CAPABILITY="ALL -TCB" - + certFiles.sources = certs ssl.tar.gz certFiles.path = . DEPLOYMENT += certFiles diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp index 295302f..95382bd 100644 --- a/tests/auto/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp @@ -195,9 +195,9 @@ protected slots: } void untrustedWorkaroundSlot(const QList &errors) { - if (errors.size() == 1 && - (errors.first().error() == QSslError::CertificateUntrusted || - errors.first().error() == QSslError::SelfSignedCertificate)) + if (errors.size() == 1 && + (errors.first().error() == QSslError::CertificateUntrusted || + errors.first().error() == QSslError::SelfSignedCertificate)) socket->ignoreSslErrors(); } @@ -223,7 +223,7 @@ tst_QSslSocket::tst_QSslSocket() } tst_QSslSocket::~tst_QSslSocket() -{ +{ } enum ProxyTests { @@ -498,7 +498,7 @@ void tst_QSslSocket::simpleConnectWithIgnore() if (!socket.canReadLine()) enterLoop(10); - QCOMPARE(socket.readAll(), QtNetworkSettings::expectedReplySSL()); + QCOMPARE(socket.readAll(), QtNetworkSettings::expectedReplySSL()); socket.disconnectFromHost(); } @@ -946,7 +946,7 @@ void tst_QSslSocket::waitForConnectedEncryptedReadyRead() QVERIFY(socket->waitForConnected(10000)); QVERIFY(socket->waitForEncrypted(10000)); - // dont forget to login + // dont forget to login QCOMPARE((int) socket->write("USER ftptest\r\n"), 14); QCOMPARE((int) socket->write("PASS ftP2Ptf\r\n"), 14); @@ -1050,7 +1050,7 @@ void tst_QSslSocket::systemCaCertificates() void tst_QSslSocket::wildcard() { - QSKIP("TODO: solve wildcard problem", SkipAll); + QSKIP("TODO: solve wildcard problem", SkipAll); if (!QSslSocket::supportsSsl()) return; @@ -1305,11 +1305,11 @@ protected: // delayed acceptance: QTest::qSleep(100); -#ifndef Q_OS_SYMBIAN +#ifndef Q_OS_SYMBIAN bool ret = server.waitForNewConnection(2000); #else - bool ret = server.waitForNewConnection(20000); -#endif + bool ret = server.waitForNewConnection(20000); +#endif // delayed start of encryption QTest::qSleep(100); @@ -1499,13 +1499,13 @@ void tst_QSslSocket::disconnectFromHostWhenConnecting() // without proxy, the state will be HostLookupState; // with proxy, the state will be ConnectingState. QVERIFY(socket->state() == QAbstractSocket::HostLookupState || - socket->state() == QAbstractSocket::ConnectingState); + socket->state() == QAbstractSocket::ConnectingState); socket->disconnectFromHost(); // the state of the socket must be the same before and after calling // disconnectFromHost() QCOMPARE(state, socket->state()); QVERIFY(socket->state() == QAbstractSocket::HostLookupState || - socket->state() == QAbstractSocket::ConnectingState); + socket->state() == QAbstractSocket::ConnectingState); QVERIFY(socket->waitForDisconnected(5000)); QCOMPARE(socket->state(), QAbstractSocket::UnconnectedState); // we did not call close, so the socket must be still open @@ -1522,16 +1522,16 @@ void tst_QSslSocket::disconnectFromHostWhenConnected() QSslSocketPtr socket = newSocket(); socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 993); socket->ignoreSslErrors(); -#ifndef Q_OS_SYMBIAN +#ifndef Q_OS_SYMBIAN QVERIFY(socket->waitForEncrypted(5000)); -#else - QVERIFY(socket->waitForEncrypted(10000)); -#endif +#else + QVERIFY(socket->waitForEncrypted(10000)); +#endif socket->write("XXXX LOGOUT\r\n"); QCOMPARE(socket->state(), QAbstractSocket::ConnectedState); socket->disconnectFromHost(); QCOMPARE(socket->state(), QAbstractSocket::ClosingState); -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN // I don't understand how socket->waitForDisconnected can work on other platforms // since socket->write will end to: // QMetaObject::invokeMethod(this, "_q_flushWriteBuffer", Qt::QueuedConnection); @@ -1540,9 +1540,9 @@ void tst_QSslSocket::disconnectFromHostWhenConnected() connect(socket, SIGNAL(disconnected()), this, SLOT(exitLoop())); enterLoop(5); QVERIFY(!timeout()); -#else - QVERIFY(socket->waitForDisconnected(5000)); -#endif +#else + QVERIFY(socket->waitForDisconnected(5000)); +#endif QCOMPARE(socket->bytesToWrite(), qint64(0)); } diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp index a859866..b6e16f0 100644 --- a/tests/auto/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp @@ -128,7 +128,7 @@ private slots: void targetStateDeleted(); void transitionToRootState(); void transitionEntersParent(); - + void defaultErrorState(); void customGlobalErrorState(); void customLocalErrorStateInBrokenState(); @@ -147,16 +147,16 @@ private slots: void customErrorStateNotInGraph(); void transitionToStateNotInGraph(); void restoreProperties(); - + void defaultGlobalRestorePolicy(); void globalRestorePolicySetToRestore(); void globalRestorePolicySetToDoNotRestore(); void noInitialStateForInitialState(); - + //void restorePolicyNotInherited(); //void mixedRestoreProperties(); - //void setRestorePolicyToDoNotRestore(); + //void setRestorePolicyToDoNotRestore(); //void setGlobalRestorePolicyToGlobalRestore(); //void restorePolicyOnChildState(); @@ -185,7 +185,7 @@ private slots: // void removeDefaultAnimationForSource(); // void removeDefaultAnimationForTarget(); // void overrideDefaultAnimationWithSource(); -// void overrideDefaultAnimationWithTarget(); +// void overrideDefaultAnimationWithTarget(); // void overrideDefaultSourceAnimationWithSpecific(); // void overrideDefaultTargetAnimationWithSpecific(); // void overrideDefaultTargetAnimationWithSource(); @@ -372,14 +372,14 @@ void tst_QStateMachine::defaultErrorState() class CustomErrorState: public QState { public: - CustomErrorState(QStateMachine *machine, QState *parent = 0) + CustomErrorState(QStateMachine *machine, QState *parent = 0) : QState(parent), error(QStateMachine::NoError), m_machine(machine) { } void onEntry(QEvent *) { - error = m_machine->error(); + error = m_machine->error(); errorString = m_machine->errorString(); } @@ -423,7 +423,7 @@ void tst_QStateMachine::customGlobalErrorState() QVERIFY(machine.configuration().contains(initialState)); QCoreApplication::processEvents(); - + QCOMPARE(machine.isRunning(), true); QCOMPARE(machine.configuration().count(), 1); QVERIFY(machine.configuration().contains(customErrorState)); @@ -434,7 +434,7 @@ void tst_QStateMachine::customGlobalErrorState() } void tst_QStateMachine::customLocalErrorStateInBrokenState() -{ +{ QStateMachine machine; CustomErrorState *customErrorState = new CustomErrorState(&machine); machine.addState(customErrorState); @@ -446,15 +446,15 @@ void tst_QStateMachine::customLocalErrorStateInBrokenState() QState *brokenState = new QState(); brokenState->setObjectName("brokenState"); - machine.addState(brokenState); - brokenState->setErrorState(customErrorState); + machine.addState(brokenState); + brokenState->setErrorState(customErrorState); QState *childState = new QState(brokenState); childState->setObjectName("childState"); initialState->addTransition(new EventTransition(QEvent::Type(QEvent::User + 1), brokenState)); - machine.start(); + machine.start(); QCoreApplication::processEvents(); machine.postEvent(new QEvent(QEvent::Type(QEvent::User + 1))); @@ -474,15 +474,15 @@ void tst_QStateMachine::customLocalErrorStateInOtherState() QState *initialState = new QState(); initialState->setObjectName("initialState"); - QTest::ignoreMessage(QtWarningMsg, "QState::setErrorState: error state cannot belong to a different state machine"); + QTest::ignoreMessage(QtWarningMsg, "QState::setErrorState: error state cannot belong to a different state machine"); initialState->setErrorState(customErrorState); machine.addState(initialState); machine.setInitialState(initialState); QState *brokenState = new QState(); brokenState->setObjectName("brokenState"); - - machine.addState(brokenState); + + machine.addState(brokenState); QState *childState = new QState(brokenState); childState->setObjectName("childState"); @@ -513,7 +513,7 @@ void tst_QStateMachine::customLocalErrorStateInParentOfBrokenState() QState *parentOfBrokenState = new QState(); machine.addState(parentOfBrokenState); parentOfBrokenState->setObjectName("parentOfBrokenState"); - parentOfBrokenState->setErrorState(customErrorState); + parentOfBrokenState->setErrorState(customErrorState); QState *brokenState = new QState(parentOfBrokenState); brokenState->setObjectName("brokenState"); @@ -553,7 +553,7 @@ void tst_QStateMachine::customLocalErrorStateOverridesParent() machine.addState(parentOfBrokenState); parentOfBrokenState->setObjectName("parentOfBrokenState"); parentOfBrokenState->setErrorState(customErrorStateForParent); - + QState *brokenState = new QState(parentOfBrokenState); brokenState->setObjectName("brokenState"); brokenState->setErrorState(customErrorStateForBrokenState); @@ -592,10 +592,10 @@ void tst_QStateMachine::errorStateHasChildren() QState *initialState = new QState(); initialState->setObjectName("initialState"); machine.addState(initialState); - machine.setInitialState(initialState); + machine.setInitialState(initialState); QState *brokenState = new QState(); - brokenState->setObjectName("brokenState"); + brokenState->setObjectName("brokenState"); machine.addState(brokenState); QState *childState = new QState(brokenState); @@ -612,7 +612,7 @@ void tst_QStateMachine::errorStateHasChildren() QCOMPARE(machine.isRunning(), true); QCOMPARE(machine.configuration().count(), 2); QVERIFY(machine.configuration().contains(customErrorState)); - QVERIFY(machine.configuration().contains(childOfErrorState)); + QVERIFY(machine.configuration().contains(childOfErrorState)); } @@ -631,10 +631,10 @@ void tst_QStateMachine::errorStateHasErrors() QState *initialState = new QState(); initialState->setObjectName("initialState"); machine.addState(initialState); - machine.setInitialState(initialState); + machine.setInitialState(initialState); QState *brokenState = new QState(); - brokenState->setObjectName("brokenState"); + brokenState->setObjectName("brokenState"); machine.addState(brokenState); QState *childState = new QState(brokenState); @@ -663,10 +663,10 @@ void tst_QStateMachine::errorStateIsRootState() QState *initialState = new QState(); initialState->setObjectName("initialState"); machine.addState(initialState); - machine.setInitialState(initialState); - + machine.setInitialState(initialState); + QState *brokenState = new QState(); - brokenState->setObjectName("brokenState"); + brokenState->setObjectName("brokenState"); machine.addState(brokenState); QState *childState = new QState(brokenState); @@ -703,7 +703,7 @@ void tst_QStateMachine::errorStateEntersParentFirst() QState *grandParent = new QState(greatGrandParent); grandParent->setObjectName("grandParent"); - grandParent->assignProperty(entryController, "grandParentEntered", true); + grandParent->assignProperty(entryController, "grandParentEntered", true); QState *parent = new QState(grandParent); parent->setObjectName("parent"); @@ -718,7 +718,7 @@ void tst_QStateMachine::errorStateEntersParentFirst() initialStateOfGreatGrandParent->setObjectName("initialStateOfGreatGrandParent"); greatGrandParent->setInitialState(initialStateOfGreatGrandParent); - QState *brokenState = new QState(greatGrandParent); + QState *brokenState = new QState(greatGrandParent); brokenState->setObjectName("brokenState"); QState *childState = new QState(brokenState); @@ -784,9 +784,9 @@ void tst_QStateMachine::customErrorStateIsNull() void tst_QStateMachine::clearError() { - QStateMachine machine; + QStateMachine machine; machine.setErrorState(new QState(machine.rootState())); // avoid warnings - + QState *brokenState = new QState(machine.rootState()); brokenState->setObjectName("brokenState"); machine.setInitialState(brokenState); @@ -819,10 +819,10 @@ void tst_QStateMachine::historyStateAsInitialState() QHistoryState *s2h = new QHistoryState(s2); s2->setInitialState(s2h); - + QState *s21 = new QState(s2); s2h->setDefaultState(s21); - + s1->addTransition(new EventTransition(QEvent::User, s2)); machine.start(); @@ -877,17 +877,17 @@ void tst_QStateMachine::brokenStateIsNeverEntered() entryController->setProperty("childStateEntered", false); entryController->setProperty("errorStateEntered", false); - QState *initialState = new QState(machine.rootState()); + QState *initialState = new QState(machine.rootState()); machine.setInitialState(initialState); QState *errorState = new QState(machine.rootState()); errorState->assignProperty(entryController, "errorStateEntered", true); - machine.setErrorState(errorState); + machine.setErrorState(errorState); QState *brokenState = new QState(machine.rootState()); brokenState->assignProperty(entryController, "brokenStateEntered", true); brokenState->setObjectName("brokenState"); - + QState *childState = new QState(brokenState); childState->assignProperty(entryController, "childStateEntered", true); @@ -906,7 +906,7 @@ void tst_QStateMachine::brokenStateIsNeverEntered() void tst_QStateMachine::transitionToStateNotInGraph() { - QStateMachine machine; + QStateMachine machine; QState *initialState = new QState(machine.rootState()); initialState->setObjectName("initialState"); @@ -1017,7 +1017,7 @@ void tst_QStateMachine::addAndRemoveState() { QStateMachine machine; QStatePrivate *root_d = QStatePrivate::get(machine.rootState()); - QCOMPARE(root_d->childStates().size(), 0); + QCOMPARE(root_d->childStates().size(), 0); QTest::ignoreMessage(QtWarningMsg, "QStateMachine::addState: cannot add null state"); machine.addState(0); @@ -1499,7 +1499,7 @@ public: : QAbstractTransition(QList() << target), m_value(value) {} protected: - virtual bool eventTest(QEvent *e) + virtual bool eventTest(QEvent *e) { if (e->type() != QEvent::Type(QEvent::User+2)) return false; @@ -2387,7 +2387,7 @@ void tst_QStateMachine::targetStateWithNoParent() machine.start(); QTest::ignoreMessage(QtWarningMsg, "Unrecoverable error detected in running state machine: No common ancestor for targets and source of transition from state 's1'"); QTRY_COMPARE(startedSpy.count(), 1); - QCOMPARE(machine.isRunning(), false); + QCOMPARE(machine.isRunning(), false); QCOMPARE(stoppedSpy.count(), 1); QCOMPARE(finishedSpy.count(), 0); QCOMPARE(machine.error(), QStateMachine::NoCommonAncestorForTransitionError); @@ -2407,7 +2407,7 @@ void tst_QStateMachine::targetStateDeleted() void tst_QStateMachine::defaultGlobalRestorePolicy() { - QStateMachine machine; + QStateMachine machine; QObject *propertyHolder = new QObject(&machine); propertyHolder->setProperty("a", 1); @@ -2427,7 +2427,7 @@ void tst_QStateMachine::defaultGlobalRestorePolicy() machine.setInitialState(s1); machine.start(); QCoreApplication::processEvents(); - + QCOMPARE(propertyHolder->property("a").toInt(), 3); QCOMPARE(propertyHolder->property("b").toInt(), 2); @@ -2441,7 +2441,7 @@ void tst_QStateMachine::defaultGlobalRestorePolicy() QCoreApplication::processEvents(); QCOMPARE(propertyHolder->property("a").toInt(), 3); - QCOMPARE(propertyHolder->property("b").toInt(), 4); + QCOMPARE(propertyHolder->property("b").toInt(), 4); } void tst_QStateMachine::noInitialStateForInitialState() @@ -2466,7 +2466,7 @@ void tst_QStateMachine::noInitialStateForInitialState() /* void tst_QStateMachine::restorePolicyNotInherited() { - QStateMachine machine; + QStateMachine machine; QObject *propertyHolder = new QObject(); propertyHolder->setProperty("a", 1); @@ -2494,7 +2494,7 @@ void tst_QStateMachine::restorePolicyNotInherited() machine.setInitialState(parentState); machine.start(); QCoreApplication::processEvents(); - + QCOMPARE(propertyHolder->property("a").toInt(), 3); QCOMPARE(propertyHolder->property("b").toInt(), 2); @@ -2508,7 +2508,7 @@ void tst_QStateMachine::restorePolicyNotInherited() QCoreApplication::processEvents(); QCOMPARE(propertyHolder->property("a").toInt(), 3); - QCOMPARE(propertyHolder->property("b").toInt(), 4); + QCOMPARE(propertyHolder->property("b").toInt(), 4); }*/ @@ -2535,7 +2535,7 @@ void tst_QStateMachine::globalRestorePolicySetToDoNotRestore() machine.setInitialState(s1); machine.start(); QCoreApplication::processEvents(); - + QCOMPARE(propertyHolder->property("a").toInt(), 3); QCOMPARE(propertyHolder->property("b").toInt(), 2); @@ -2549,7 +2549,7 @@ void tst_QStateMachine::globalRestorePolicySetToDoNotRestore() QCoreApplication::processEvents(); QCOMPARE(propertyHolder->property("a").toInt(), 3); - QCOMPARE(propertyHolder->property("b").toInt(), 4); + QCOMPARE(propertyHolder->property("b").toInt(), 4); } /* @@ -2655,7 +2655,7 @@ void tst_QStateMachine::restorePolicyOnChildState() machine.setInitialState(parentState); machine.start(); QCoreApplication::processEvents(); - + QCOMPARE(propertyHolder->property("a").toInt(), 3); QCOMPARE(propertyHolder->property("b").toInt(), 2); @@ -2669,13 +2669,13 @@ void tst_QStateMachine::restorePolicyOnChildState() QCoreApplication::processEvents(); QCOMPARE(propertyHolder->property("a").toInt(), 1); - QCOMPARE(propertyHolder->property("b").toInt(), 2); + QCOMPARE(propertyHolder->property("b").toInt(), 2); } */ void tst_QStateMachine::globalRestorePolicySetToRestore() { - QStateMachine machine; + QStateMachine machine; machine.setGlobalRestorePolicy(QStateMachine::RestoreProperties); QObject *propertyHolder = new QObject(&machine); @@ -2696,7 +2696,7 @@ void tst_QStateMachine::globalRestorePolicySetToRestore() machine.setInitialState(s1); machine.start(); QCoreApplication::processEvents(); - + QCOMPARE(propertyHolder->property("a").toInt(), 3); QCOMPARE(propertyHolder->property("b").toInt(), 2); @@ -2710,16 +2710,16 @@ void tst_QStateMachine::globalRestorePolicySetToRestore() QCoreApplication::processEvents(); QCOMPARE(propertyHolder->property("a").toInt(), 1); - QCOMPARE(propertyHolder->property("b").toInt(), 2); + QCOMPARE(propertyHolder->property("b").toInt(), 2); } /* void tst_QStateMachine::mixedRestoreProperties() { - QStateMachine machine; + QStateMachine machine; QObject *propertyHolder = new QObject(); - propertyHolder->setProperty("a", 1); + propertyHolder->setProperty("a", 1); QState *s1 = new QState(machine.rootState()); s1->setRestorePolicy(QState::RestoreProperties); @@ -2746,7 +2746,7 @@ void tst_QStateMachine::mixedRestoreProperties() machine.setInitialState(s1); machine.start(); QCoreApplication::processEvents(); - + // Enter s1, save current QCOMPARE(propertyHolder->property("a").toInt(), 3); @@ -2822,7 +2822,7 @@ void tst_QStateMachine::simpleAnimation() QCOREAPPLICATION_EXEC(5000); QVERIFY(machine.configuration().contains(s3)); - QCOMPARE(object->property("fooBar").toDouble(), 2.0); + QCOMPARE(object->property("fooBar").toDouble(), 2.0); } class SlotCalledCounter: public QObject @@ -2855,7 +2855,7 @@ void tst_QStateMachine::twoAnimations() animationBar->setDuration(900); SlotCalledCounter counter; - connect(animationFoo, SIGNAL(finished()), &counter, SLOT(slot())); + connect(animationFoo, SIGNAL(finished()), &counter, SLOT(slot())); connect(animationBar, SIGNAL(finished()), &counter, SLOT(slot())); EventTransition *et = new EventTransition(QEvent::User, s2); @@ -2877,7 +2877,7 @@ void tst_QStateMachine::twoAnimations() QVERIFY(machine.configuration().contains(s3)); QCOMPARE(object->property("foo").toDouble(), 2.0); QCOMPARE(object->property("bar").toDouble(), 10.0); - + QCOMPARE(counter.counter, 2); } @@ -2990,12 +2990,12 @@ void tst_QStateMachine::nestedTargetStateForAnimation() QState *s2Child2 = new QState(s2); s2Child2->assignProperty(object, "bar", 11.0); QAbstractTransition *at = s2Child->addTransition(new EventTransition(QEvent::User, s2Child2)); - + QPropertyAnimation *animation = new QPropertyAnimation(object, "bar", s2); animation->setDuration(2000); connect(animation, SIGNAL(finished()), &counter, SLOT(slot())); at->addAnimation(animation); - + at = s1->addTransition(new EventTransition(QEvent::User, s2)); animation = new QPropertyAnimation(object, "foo", s2); @@ -3005,7 +3005,7 @@ void tst_QStateMachine::nestedTargetStateForAnimation() animation = new QPropertyAnimation(object, "bar", s2); connect(animation, SIGNAL(finished()), &counter, SLOT(slot())); at->addAnimation(animation); - + QState *s3 = new QState(machine.rootState()); s2->addTransition(s2Child, SIGNAL(polished()), s3); @@ -3047,7 +3047,7 @@ void tst_QStateMachine::animatedGlobalRestoreProperty() QPropertyAnimation *pa = new QPropertyAnimation(object, "foo", s2); connect(pa, SIGNAL(finished()), &counter, SLOT(slot())); at->addAnimation(pa); - + at = s2->addTransition(pa, SIGNAL(finished()), s3); pa = new QPropertyAnimation(object, "foo", s3); connect(pa, SIGNAL(finished()), &counter, SLOT(slot())); @@ -3089,7 +3089,7 @@ void tst_QStateMachine::specificTargetValueOfAnimation() QState *s3 = new QState(machine.rootState()); QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); - s2->addTransition(anim, SIGNAL(finished()), s3); + s2->addTransition(anim, SIGNAL(finished()), s3); machine.setInitialState(s1); machine.start(); @@ -3117,7 +3117,7 @@ void tst_QStateMachine::addDefaultAnimation() QState *s3 = new QState(machine.rootState()); QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); - + s1->addTransition(new EventTransition(QEvent::User, s2)); QPropertyAnimation *pa = new QPropertyAnimation(object, "foo", &machine); @@ -3152,7 +3152,7 @@ void tst_QStateMachine::addDefaultAnimationWithUnusedAnimation() QState *s3 = new QState(machine.rootState()); QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); - + s1->addTransition(new EventTransition(QEvent::User, s2)); QPropertyAnimation *pa = new QPropertyAnimation(object, "foo", &machine); @@ -3197,7 +3197,7 @@ void tst_QStateMachine::removeDefaultAnimation() QCOMPARE(machine.defaultAnimations().size(), 0); machine.addDefaultAnimation(anim); - + QPropertyAnimation *anim2 = new QPropertyAnimation(&propertyHolder, "foo"); machine.addDefaultAnimation(anim2); @@ -3233,8 +3233,8 @@ void tst_QStateMachine::overrideDefaultAnimationWithSpecific() QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); QAbstractTransition *at = s1->addTransition(new EventTransition(QEvent::User, s2)); - - QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); + + QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); connect(defaultAnimation, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)), &counter, SLOT(slot())); QPropertyAnimation *moreSpecificAnimation = new QPropertyAnimation(object, "foo"); @@ -3269,7 +3269,7 @@ void tst_QStateMachine::addDefaultAnimationForSource() QState *s3 = new QState(machine.rootState()); QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); - + s1->addTransition(new EventTransition(QEvent::User, s2)); QPropertyAnimation *pa = new QPropertyAnimation(object, "foo", &machine); @@ -3301,7 +3301,7 @@ void tst_QStateMachine::addDefaultAnimationForTarget() QState *s3 = new QState(machine.rootState()); QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); - + s1->addTransition(new EventTransition(QEvent::User, s2)); QPropertyAnimation *pa = new QPropertyAnimation(object, "foo", &machine); @@ -3346,7 +3346,7 @@ void tst_QStateMachine::removeDefaultAnimationForSource() QCOMPARE(machine.defaultAnimationsForSourceState(machine.rootState()).size(), 0); machine.addDefaultAnimationForSourceState(machine.rootState(), anim); - + QPropertyAnimation *anim2 = new QPropertyAnimation(this, "foo"); machine.addDefaultAnimationForSourceState(machine.rootState(), anim2); @@ -3390,7 +3390,7 @@ void tst_QStateMachine::removeDefaultAnimationForTarget() QCOMPARE(machine.defaultAnimationsForTargetState(machine.rootState()).size(), 0); machine.addDefaultAnimationForTargetState(machine.rootState(), anim); - + QPropertyAnimation *anim2 = new QPropertyAnimation(this, "foo"); machine.addDefaultAnimationForTargetState(machine.rootState(), anim2); @@ -3425,9 +3425,9 @@ void tst_QStateMachine::overrideDefaultAnimationWithSource() QState *s3 = new QState(machine.rootState()); QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); - s1->addTransition(new EventTransition(QEvent::User, s2)); - - QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); + s1->addTransition(new EventTransition(QEvent::User, s2)); + + QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); connect(defaultAnimation, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)), &counter, SLOT(slot())); QPropertyAnimation *moreSpecificAnimation = new QPropertyAnimation(object, "foo"); @@ -3465,9 +3465,9 @@ void tst_QStateMachine::overrideDefaultAnimationWithTarget() QState *s3 = new QState(machine.rootState()); QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); - s1->addTransition(new EventTransition(QEvent::User, s2)); - - QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); + s1->addTransition(new EventTransition(QEvent::User, s2)); + + QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); connect(defaultAnimation, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)), &counter, SLOT(slot())); QPropertyAnimation *moreSpecificAnimation = new QPropertyAnimation(object, "foo"); @@ -3507,8 +3507,8 @@ void tst_QStateMachine::overrideDefaultSourceAnimationWithSpecific() QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); QAbstractTransition *at = s1->addTransition(new EventTransition(QEvent::User, s2)); - - QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); + + QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); connect(defaultAnimation, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)), &counter, SLOT(slot())); QPropertyAnimation *moreSpecificAnimation = new QPropertyAnimation(object, "foo"); @@ -3547,8 +3547,8 @@ void tst_QStateMachine::overrideDefaultTargetAnimationWithSpecific() QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); QAbstractTransition *at = s1->addTransition(new EventTransition(QEvent::User, s2)); - - QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); + + QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); connect(defaultAnimation, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)), &counter, SLOT(slot())); QPropertyAnimation *moreSpecificAnimation = new QPropertyAnimation(object, "foo"); @@ -3587,8 +3587,8 @@ void tst_QStateMachine::overrideDefaultTargetAnimationWithSource() QObject::connect(s3, SIGNAL(entered()), QCoreApplication::instance(), SLOT(quit())); s1->addTransition(new EventTransition(QEvent::User, s2)); - - QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); + + QPropertyAnimation *defaultAnimation = new QPropertyAnimation(object, "foo"); connect(defaultAnimation, SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)), &counter, SLOT(slot())); QPropertyAnimation *moreSpecificAnimation = new QPropertyAnimation(object, "foo"); @@ -3638,7 +3638,7 @@ void tst_QStateMachine::parallelStateAssignmentsDone() QCOMPARE(propertyHolder->property("foo").toInt(), 123); QCOMPARE(propertyHolder->property("bar").toInt(), 456); QCOMPARE(propertyHolder->property("zoot").toInt(), 789); - + machine.postEvent(new QEvent(QEvent::User)); QCoreApplication::processEvents(); @@ -3650,13 +3650,13 @@ void tst_QStateMachine::parallelStateAssignmentsDone() void tst_QStateMachine::transitionsFromParallelStateWithNoChildren() { QStateMachine machine; - + QState *parallelState = new QState(QState::ParallelStates, machine.rootState()); machine.setInitialState(parallelState); - QState *s1 = new QState(machine.rootState()); + QState *s1 = new QState(machine.rootState()); parallelState->addTransition(new EventTransition(QEvent::User, s1)); - + machine.start(); QCoreApplication::processEvents(); @@ -3687,7 +3687,7 @@ void tst_QStateMachine::parallelStateTransition() QState *s2InitialChild = new QState(s2); s2->setInitialState(s2InitialChild); - QState *s1OtherChild = new QState(s1); + QState *s1OtherChild = new QState(s1); s1->addTransition(new EventTransition(QEvent::User, s1OtherChild)); @@ -3707,12 +3707,12 @@ void tst_QStateMachine::parallelStateTransition() QVERIFY(machine.configuration().contains(parallelState)); QVERIFY(machine.configuration().contains(s1)); - + QVERIFY(machine.configuration().contains(s2)); QVERIFY(machine.configuration().contains(s1OtherChild)); QVERIFY(machine.configuration().contains(s2InitialChild)); QCOMPARE(machine.configuration().size(), 5); - + } void tst_QStateMachine::nestedRestoreProperties() @@ -3783,7 +3783,7 @@ void tst_QStateMachine::nestedRestoreProperties2() s2->assignProperty(propertyHolder, "foo", 3); QState *s21 = new QState(s2); - s21->assignProperty(propertyHolder, "bar", 4); + s21->assignProperty(propertyHolder, "bar", 4); s2->setInitialState(s21); QState *s22 = new QState(s2); diff --git a/tests/auto/qtcpserver/crashingServer/main.cpp b/tests/auto/qtcpserver/crashingServer/main.cpp index f135d26..c360fe4 100644 --- a/tests/auto/qtcpserver/crashingServer/main.cpp +++ b/tests/auto/qtcpserver/crashingServer/main.cpp @@ -61,7 +61,7 @@ int main(int argc, char *argv[]) file.close(); #else printf("Listening\n"); - fflush(stdout); + fflush(stdout); #endif server.waitForNewConnection(5000); diff --git a/tests/auto/qtcpserver/tst_qtcpserver.cpp b/tests/auto/qtcpserver/tst_qtcpserver.cpp index 51e5020..2e75353 100644 --- a/tests/auto/qtcpserver/tst_qtcpserver.cpp +++ b/tests/auto/qtcpserver/tst_qtcpserver.cpp @@ -134,7 +134,7 @@ tst_QTcpServer::tst_QTcpServer() } tst_QTcpServer::~tst_QTcpServer() -{ +{ } void tst_QTcpServer::initTestCase_data() @@ -524,7 +524,7 @@ private: //---------------------------------------------------------------------------------- void tst_QTcpServer::waitForConnectionTest() { - + QFETCH_GLOBAL(bool, setProxy); if (setProxy) { #ifdef TEST_QNETWORK_PROXY @@ -628,10 +628,10 @@ protected: void tst_QTcpServer::addressReusable() { -#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86) +#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86) QSKIP("Symbian: Emulator does not support process launching", SkipAll ); #endif - + #if defined(QT_NO_PROCESS) QSKIP("Qt was compiled with QT_NO_PROCESS", SkipAll); #else diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp index ed84273..718fcba 100644 --- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp @@ -902,12 +902,12 @@ void tst_QTcpSocket::disconnectWhileConnecting() socket->disconnectFromHost(); } - connect(socket, SIGNAL(disconnected()), SLOT(exitLoopSlot())); -#ifndef Q_OS_SYMBIAN + connect(socket, SIGNAL(disconnected()), SLOT(exitLoopSlot())); +#ifndef Q_OS_SYMBIAN enterLoop(10); -#else +#else enterLoop(30); -#endif +#endif QVERIFY2(!timeout(), "Network timeout"); QVERIFY(socket->state() == QAbstractSocket::UnconnectedState); if (!closeDirectly) { @@ -971,11 +971,11 @@ protected: QTcpSocket *socket = server->nextPendingConnection(); while (!quit) { -#ifndef Q_OS_SYMBIAN +#ifndef Q_OS_SYMBIAN if (socket->waitForDisconnected(500)) -#else +#else if (socket->waitForDisconnected(5000)) -#endif +#endif break; if (socket->error() != QAbstractSocket::SocketTimeoutError) return; @@ -1023,11 +1023,11 @@ void tst_QTcpSocket::disconnectWhileConnectingNoEventLoop() socket->disconnectFromHost(); } -#ifndef Q_OS_SYMBIAN +#ifndef Q_OS_SYMBIAN QVERIFY2(socket->waitForDisconnected(10000), "Network timeout"); -#else +#else QVERIFY2(socket->waitForDisconnected(30000), "Network timeout"); -#endif +#endif QVERIFY(socket->state() == QAbstractSocket::UnconnectedState); if (!closeDirectly) { QCOMPARE(int(socket->openMode()), int(QIODevice::ReadWrite)); @@ -1073,11 +1073,11 @@ void tst_QTcpSocket::disconnectWhileLookingUp() // let anything queued happen QEventLoop loop; -#ifndef Q_OS_SYMBIAN +#ifndef Q_OS_SYMBIAN QTimer::singleShot(50, &loop, SLOT(quit())); -#else +#else QTimer::singleShot(5000, &loop, SLOT(quit())); -#endif +#endif loop.exec(); // recheck @@ -1754,7 +1754,7 @@ void tst_QTcpSocket::waitForConnectedInHostLookupSlot2() QFAIL("Network timeout"); QVERIFY(foo.attemptedToConnect); - QCOMPARE(foo.count, 1); + QCOMPARE(foo.count, 1); } #endif @@ -1774,7 +1774,7 @@ void tst_QTcpSocket::readyReadSignalsAfterWaitForReadyRead() QCOMPARE(readyReadSpy.count(), 1); QString s = socket->readLine(); -#ifdef TEST_QNETWORK_PROXY +#ifdef TEST_QNETWORK_PROXY QNetworkProxy::ProxyType proxyType = QNetworkProxy::applicationProxy().type(); if(proxyType == QNetworkProxy::NoProxy) { QCOMPARE(s.toLatin1().constData(), "* OK [CAPABILITY IMAP4REV1] aspiriniks Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); @@ -1782,8 +1782,8 @@ void tst_QTcpSocket::readyReadSignalsAfterWaitForReadyRead() QCOMPARE(s.toLatin1().constData(), "* OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ID STARTTLS LOGINDISABLED] aspiriniks Cyrus IMAP4 v2.3.11-Mandriva-RPM-2.3.11-6mdv2008.1 server ready\r\n"); } #else - QCOMPARE(s.toLatin1().constData(), QtNetworkSettings::expectedReplyIMAP().constData()); -#endif + QCOMPARE(s.toLatin1().constData(), QtNetworkSettings::expectedReplyIMAP().constData()); +#endif QCOMPARE(socket->bytesAvailable(), qint64(0)); QCoreApplication::instance()->processEvents(); @@ -2002,7 +2002,7 @@ void tst_QTcpSocket::suddenRemoteDisconnect() #if defined(Q_OS_WINCE) QSKIP("stressTest subprocess needs Qt3Support", SkipAll); #elif defined( Q_OS_SYMBIAN ) - QSKIP("Symbian: QProcess IO is not yet supported, fix when supported", SkipAll); + QSKIP("Symbian: QProcess IO is not yet supported, fix when supported", SkipAll); #else QFETCH(QString, client); QFETCH(QString, server); diff --git a/tests/auto/qtemporaryfile/qtemporaryfile.pro b/tests/auto/qtemporaryfile/qtemporaryfile.pro index 0f2a6ea..c93a2e5 100644 --- a/tests/auto/qtemporaryfile/qtemporaryfile.pro +++ b/tests/auto/qtemporaryfile/qtemporaryfile.pro @@ -6,7 +6,7 @@ QT = core symbian { testData.sources = tst_qtemporaryfile.cpp testData.path = . - DEPLOYMENT += testData + DEPLOYMENT += testData }else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qtextcodec/test/test.pro b/tests/auto/qtextcodec/test/test.pro index 7748ce4..36cac7c 100644 --- a/tests/auto/qtextcodec/test/test.pro +++ b/tests/auto/qtextcodec/test/test.pro @@ -11,7 +11,7 @@ wince*|symbian { wince*: { DEFINES += SRCDIR=\\\"\\\" }else:symbian { - # Symbian can't define SRCDIR meaningfully here + # Symbian can't define SRCDIR meaningfully here } else { DEFINES += SRCDIR=\\\"$$PWD/../\\\" } diff --git a/tests/auto/qtextedit/tst_qtextedit.cpp b/tests/auto/qtextedit/tst_qtextedit.cpp index d68b21d..ad61015 100644 --- a/tests/auto/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/qtextedit/tst_qtextedit.cpp @@ -150,7 +150,7 @@ private slots: void preserveCharFormatInAppend(); #ifndef QT_NO_CLIPBOARD void copyAndSelectAllInReadonly(); -#endif +#endif void ctrlAltInput(); void noPropertiesOnDefaultTextEditCharFormat(); void setPlainTextShouldUseCurrentCharFormat(); diff --git a/tests/auto/qtextodfwriter/qtextodfwriter.pro b/tests/auto/qtextodfwriter/qtextodfwriter.pro index 2689894..f5e2c09 100644 --- a/tests/auto/qtextodfwriter/qtextodfwriter.pro +++ b/tests/auto/qtextodfwriter/qtextodfwriter.pro @@ -2,4 +2,4 @@ load(qttest_p4) SOURCES += tst_qtextodfwriter.cpp !symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" -symbian:INCLUDEPATH+=$$[QT_INSTALL_PREFIX]/include/QtGui/private +symbian:INCLUDEPATH+=$$[QT_INSTALL_PREFIX]/include/QtGui/private diff --git a/tests/auto/qtextstream/test/test.pro b/tests/auto/qtextstream/test/test.pro index b24708c..973c011 100644 --- a/tests/auto/qtextstream/test/test.pro +++ b/tests/auto/qtextstream/test/test.pro @@ -28,7 +28,7 @@ wince*|symbian: { wince*: { DEFINES += SRCDIR=\\\"\\\" }else:symbian { - # Symbian can't define SRCDIR meaningfully here + # Symbian can't define SRCDIR meaningfully here }else { DEFINES += SRCDIR=\\\"$$PWD/../\\\" } diff --git a/tests/auto/qtextstream/tst_qtextstream.cpp b/tests/auto/qtextstream/tst_qtextstream.cpp index 484d7c9..d8dd618 100644 --- a/tests/auto/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/qtextstream/tst_qtextstream.cpp @@ -476,7 +476,7 @@ tst_QTextStream::tst_QTextStream() } tst_QTextStream::~tst_QTextStream() -{ +{ } void tst_QTextStream::init() @@ -1251,7 +1251,7 @@ void tst_QTextStream::stillOpenWhenAtEnd() #endif QTcpSocket socket; socket.connectToHost(QtNetworkSettings::serverName(), 143); -#if defined(Q_OS_SYMBIAN) +#if defined(Q_OS_SYMBIAN) QVERIFY(socket.waitForReadyRead(30000)); #else QVERIFY(socket.waitForReadyRead(5000)); diff --git a/tests/auto/qtimer/tst_qtimer.cpp b/tests/auto/qtimer/tst_qtimer.cpp index f55e62c..2835c53 100644 --- a/tests/auto/qtimer/tst_qtimer.cpp +++ b/tests/auto/qtimer/tst_qtimer.cpp @@ -549,4 +549,3 @@ void tst_QTimer::timerFiresOnlyOncePerProcessEvents() QTEST_MAIN(tst_QTimer) #include "tst_qtimer.moc" - diff --git a/tests/auto/qudpsocket/tst_qudpsocket.cpp b/tests/auto/qudpsocket/tst_qudpsocket.cpp index db18eb5..e064967 100644 --- a/tests/auto/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/qudpsocket/tst_qudpsocket.cpp @@ -228,7 +228,7 @@ void tst_QUdpSocket::broadcasting() for (int j = 0; j < 100; ++j) { broadcastSocket.writeDatagram(message[i], strlen(message[i]), - QHostAddress::Broadcast, 5000); + QHostAddress::Broadcast, 5000); QTestEventLoop::instance().enterLoop(15); if (QTestEventLoop::instance().timeout()) { #if defined(Q_OS_FREEBSD) @@ -334,17 +334,17 @@ void tst_QUdpSocket::ipv6Loop() quint16 paulPort = 28123; if (!peter.bind(QHostAddress::LocalHostIPv6, peterPort)) { - QCOMPARE(peter.error(), QUdpSocket::UnsupportedSocketOperationError); + QCOMPARE(peter.error(), QUdpSocket::UnsupportedSocketOperationError); } else { - QVERIFY(paul.bind(QHostAddress::LocalHostIPv6, paulPort)); + QVERIFY(paul.bind(QHostAddress::LocalHostIPv6, paulPort)); - QCOMPARE(peter.writeDatagram(peterMessage.data(), peterMessage.length(), QHostAddress("::1"), + QCOMPARE(peter.writeDatagram(peterMessage.data(), peterMessage.length(), QHostAddress("::1"), paulPort), qint64(peterMessage.length())); - QCOMPARE(paul.writeDatagram(paulMessage.data(), paulMessage.length(), + QCOMPARE(paul.writeDatagram(paulMessage.data(), paulMessage.length(), QHostAddress("::1"), peterPort), qint64(paulMessage.length())); - char peterBuffer[16*1024]; - char paulBuffer[16*1024]; + char peterBuffer[16*1024]; + char paulBuffer[16*1024]; #if !defined(Q_OS_WINCE) QVERIFY(peter.waitForReadyRead(5000)); QVERIFY(paul.waitForReadyRead(5000)); @@ -352,16 +352,16 @@ void tst_QUdpSocket::ipv6Loop() QVERIFY(peter.waitForReadyRead(15000)); QVERIFY(paul.waitForReadyRead(15000)); #endif - if (success) { - QCOMPARE(peter.readDatagram(peterBuffer, sizeof(peterBuffer)), qint64(paulMessage.length())); - QCOMPARE(paul.readDatagram(paulBuffer, sizeof(peterBuffer)), qint64(peterMessage.length())); - } else { - QVERIFY(peter.readDatagram(peterBuffer, sizeof(peterBuffer)) != paulMessage.length()); - QVERIFY(paul.readDatagram(paulBuffer, sizeof(peterBuffer)) != peterMessage.length()); - } - - QCOMPARE(QByteArray(peterBuffer, paulMessage.length()), paulMessage); - QCOMPARE(QByteArray(paulBuffer, peterMessage.length()), peterMessage); + if (success) { + QCOMPARE(peter.readDatagram(peterBuffer, sizeof(peterBuffer)), qint64(paulMessage.length())); + QCOMPARE(paul.readDatagram(paulBuffer, sizeof(peterBuffer)), qint64(peterMessage.length())); + } else { + QVERIFY(peter.readDatagram(peterBuffer, sizeof(peterBuffer)) != paulMessage.length()); + QVERIFY(paul.readDatagram(paulBuffer, sizeof(peterBuffer)) != peterMessage.length()); + } + + QCOMPARE(QByteArray(peterBuffer, paulMessage.length()), paulMessage); + QCOMPARE(QByteArray(paulBuffer, peterMessage.length()), peterMessage); } } @@ -483,21 +483,21 @@ void tst_QUdpSocket::writeDatagram() void tst_QUdpSocket::performance() { #if defined(Q_OS_SYMBIAN) - // Large packets seems not to go through on Symbian - // Reason might be also fragmentation due to VPN connection etc - + // Large packets seems not to go through on Symbian + // Reason might be also fragmentation due to VPN connection etc + QFETCH_GLOBAL(bool, setProxy); - QFETCH_GLOBAL(int, proxyType); - + QFETCH_GLOBAL(int, proxyType); + int arrSize = 8192; - if (setProxy && proxyType == QNetworkProxy::Socks5Proxy) - arrSize = 1024; - - QByteArray arr(arrSize, '@'); + if (setProxy && proxyType == QNetworkProxy::Socks5Proxy) + arrSize = 1024; + + QByteArray arr(arrSize, '@'); #else - QByteArray arr(8192, '@'); + QByteArray arr(8192, '@'); #endif // Q_OS_SYMBIAN - + QUdpSocket server; QVERIFY2(server.bind(), server.errorString().toLatin1().constData()); @@ -507,13 +507,13 @@ void tst_QUdpSocket::performance() QUdpSocket client; client.connectToHost(serverAddress, server.localPort()); - + QTime stopWatch; stopWatch.start(); qint64 nbytes = 0; while (stopWatch.elapsed() < 5000) { - for (int i = 0; i < 100; ++i) { + for (int i = 0; i < 100; ++i) { if (client.write(arr.data(), arr.size()) > 0) { do { nbytes += server.readDatagram(arr.data(), arr.size()); @@ -525,14 +525,14 @@ void tst_QUdpSocket::performance() float secs = stopWatch.elapsed() / 1000.0; qDebug("\t%.2fMB/%.2fs: %.2fMB/s", float(nbytes / (1024.0*1024.0)), secs, float(nbytes / (1024.0*1024.0)) / secs); - -#if defined(Q_OS_SYMBIAN) + +#if defined(Q_OS_SYMBIAN) if(nbytes == 0) { - qDebug("No bytes passed through local UDP socket, since UDP socket write returns EWOULDBLOCK"); - qDebug("Should try with blocking sockets, but it is not currently possible due to Open C defect"); + qDebug("No bytes passed through local UDP socket, since UDP socket write returns EWOULDBLOCK"); + qDebug("Should try with blocking sockets, but it is not currently possible due to Open C defect"); } -#endif - +#endif + } void tst_QUdpSocket::bindMode() @@ -552,48 +552,48 @@ void tst_QUdpSocket::bindMode() QUdpSocket socket2; QVERIFY(!socket2.bind(socket.localPort())); #if defined(Q_OS_SYMBIAN) - + //RPRocess me; if(RProcess().HasCapability(ECapabilityNetworkControl)) { - qDebug("Test executed *with* NetworkControl capability"); - // In Symbian OS ReuseAddressHint together with NetworkControl capability - // gives application *always* right to bind to port. I.e. it does not matter - // if first socket was bound with any bind flag. Since autotests in Symbian - // are currently executed with ALL -TCB rights, this path is the one executed. - QVERIFY(socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)); - socket.close(); - socket2.close(); - - QVERIFY2(socket.bind(0, QUdpSocket::ShareAddress), socket.errorString().toLatin1().constData()); - QVERIFY(!socket2.bind(socket.localPort())); - QVERIFY2(socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint), socket2.errorString().toLatin1().constData()); - socket.close(); - socket2.close(); - - QVERIFY2(socket.bind(0, QUdpSocket::DontShareAddress), socket.errorString().toLatin1().constData()); - QVERIFY(!socket2.bind(socket.localPort())); - QVERIFY(socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)); - socket.close(); - socket2.close(); - } else { - qDebug("Test executed *without* NetworkControl capability"); - // If we don't have NetworkControl capability, attempt to bind already bound - // address will *always* fail. I.e. it does not matter if first socket was - // bound with any bind flag. - QVERIFY(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)); - socket.close(); - - QVERIFY2(socket.bind(0, QUdpSocket::ShareAddress), socket.errorString().toLatin1().constData()); - QVERIFY(!socket2.bind(socket.localPort())); - QVERIFY2(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint), socket2.errorString().toLatin1().constData()); - socket.close(); - - QVERIFY2(socket.bind(0, QUdpSocket::DontShareAddress), socket.errorString().toLatin1().constData()); - QVERIFY(!socket2.bind(socket.localPort())); - QVERIFY(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)); - socket.close(); - } -#elif defined(Q_OS_UNIX) + qDebug("Test executed *with* NetworkControl capability"); + // In Symbian OS ReuseAddressHint together with NetworkControl capability + // gives application *always* right to bind to port. I.e. it does not matter + // if first socket was bound with any bind flag. Since autotests in Symbian + // are currently executed with ALL -TCB rights, this path is the one executed. + QVERIFY(socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)); + socket.close(); + socket2.close(); + + QVERIFY2(socket.bind(0, QUdpSocket::ShareAddress), socket.errorString().toLatin1().constData()); + QVERIFY(!socket2.bind(socket.localPort())); + QVERIFY2(socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint), socket2.errorString().toLatin1().constData()); + socket.close(); + socket2.close(); + + QVERIFY2(socket.bind(0, QUdpSocket::DontShareAddress), socket.errorString().toLatin1().constData()); + QVERIFY(!socket2.bind(socket.localPort())); + QVERIFY(socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)); + socket.close(); + socket2.close(); + } else { + qDebug("Test executed *without* NetworkControl capability"); + // If we don't have NetworkControl capability, attempt to bind already bound + // address will *always* fail. I.e. it does not matter if first socket was + // bound with any bind flag. + QVERIFY(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)); + socket.close(); + + QVERIFY2(socket.bind(0, QUdpSocket::ShareAddress), socket.errorString().toLatin1().constData()); + QVERIFY(!socket2.bind(socket.localPort())); + QVERIFY2(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint), socket2.errorString().toLatin1().constData()); + socket.close(); + + QVERIFY2(socket.bind(0, QUdpSocket::DontShareAddress), socket.errorString().toLatin1().constData()); + QVERIFY(!socket2.bind(socket.localPort())); + QVERIFY(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)); + socket.close(); + } +#elif defined(Q_OS_UNIX) QVERIFY(!socket2.bind(socket.localPort(), QUdpSocket::ReuseAddressHint)); socket.close(); QVERIFY2(socket.bind(0, QUdpSocket::ShareAddress), socket.errorString().toLatin1().constData()); diff --git a/tests/auto/qvariant/tst_qvariant.cpp b/tests/auto/qvariant/tst_qvariant.cpp index 6655021..698dece 100644 --- a/tests/auto/qvariant/tst_qvariant.cpp +++ b/tests/auto/qvariant/tst_qvariant.cpp @@ -2981,9 +2981,9 @@ void tst_QVariant::toIntFromQString() const */ void tst_QVariant::toIntFromDouble() const { - double d = 2147483630; // max int 2147483647 + double d = 2147483630; // max int 2147483647 QVERIFY((int)d == 2147483630); - + QVariant var(d); QVERIFY( var.canConvert( QVariant::Int ) ); @@ -3004,7 +3004,7 @@ void tst_QVariant::task256984_setValue() QVERIFY( !v2.isDetached() ); qVariantSetValue(v2, 3); //set an integer value - + QVERIFY( v1.isDetached() ); QVERIFY( v2.isDetached() ); } diff --git a/tests/auto/qwaitcondition/tst_qwaitcondition.cpp b/tests/auto/qwaitcondition/tst_qwaitcondition.cpp index a6d272c..6ac02e7 100644 --- a/tests/auto/qwaitcondition/tst_qwaitcondition.cpp +++ b/tests/auto/qwaitcondition/tst_qwaitcondition.cpp @@ -98,10 +98,10 @@ public: void run() { - mutex.lock(); - cond.wakeOne(); - cond.wait(&mutex); - mutex.unlock(); + mutex.lock(); + cond.wakeOne(); + cond.wait(&mutex); + mutex.unlock(); } }; @@ -114,15 +114,15 @@ public: QWaitCondition *cond; inline wait_QMutex_Thread_2() - : mutex(0), cond(0) + : mutex(0), cond(0) { } void run() { - mutex->lock(); - started.wakeOne(); - cond->wait(mutex); - mutex->unlock(); + mutex->lock(); + started.wakeOne(); + cond->wait(mutex); + mutex->unlock(); } }; @@ -137,10 +137,10 @@ public: void run() { - readWriteLock.lockForWrite(); - cond.wakeOne(); - cond.wait(&readWriteLock); - readWriteLock.unlock(); + readWriteLock.lockForWrite(); + cond.wakeOne(); + cond.wait(&readWriteLock); + readWriteLock.unlock(); } }; @@ -153,15 +153,15 @@ public: QWaitCondition *cond; inline wait_QReadWriteLock_Thread_2() - : readWriteLock(0), cond(0) + : readWriteLock(0), cond(0) { } void run() { - readWriteLock->lockForRead(); - started.wakeOne(); - cond->wait(readWriteLock); - readWriteLock->unlock(); + readWriteLock->lockForRead(); + started.wakeOne(); + cond->wait(readWriteLock); + readWriteLock->unlock(); } }; @@ -169,79 +169,79 @@ void tst_QWaitCondition::wait_QMutex() { int x; for (int i = 0; i < iterations; ++i) { - { - QMutex mutex; - QWaitCondition cond; - - mutex.lock(); - - cond.wakeOne(); - QVERIFY(!cond.wait(&mutex, 1)); - - cond.wakeAll(); - QVERIFY(!cond.wait(&mutex, 1)); - - mutex.unlock(); - } - - { - // test multiple threads waiting on separate wait conditions - wait_QMutex_Thread_1 thread[ThreadCount]; - - for (x = 0; x < ThreadCount; ++x) { - thread[x].mutex.lock(); - thread[x].start(); - // wait for thread to start - QVERIFY(thread[x].cond.wait(&thread[x].mutex, 1000)); - thread[x].mutex.unlock(); - } - - for (x = 0; x < ThreadCount; ++x) { - QVERIFY(thread[x].isRunning()); - QVERIFY(!thread[x].isFinished()); - } - - for (x = 0; x < ThreadCount; ++x) { - thread[x].mutex.lock(); - thread[x].cond.wakeOne(); - thread[x].mutex.unlock(); - } - - for (x = 0; x < ThreadCount; ++x) { - QVERIFY(thread[x].wait(1000)); - } - } - - { - // test multiple threads waiting on a wait condition - QMutex mutex; - QWaitCondition cond1, cond2; - wait_QMutex_Thread_2 thread[ThreadCount]; - - mutex.lock(); - for (x = 0; x < ThreadCount; ++x) { - thread[x].mutex = &mutex; - thread[x].cond = (x < ThreadCount / 2) ? &cond1 : &cond2; - thread[x].start(); - // wait for thread to start - QVERIFY(thread[x].started.wait(&mutex, 1000)); - } - mutex.unlock(); - - for (x = 0; x < ThreadCount; ++x) { - QVERIFY(thread[x].isRunning()); - QVERIFY(!thread[x].isFinished()); - } - - mutex.lock(); - cond1.wakeAll(); - cond2.wakeAll(); - mutex.unlock(); - - for (x = 0; x < ThreadCount; ++x) { - QVERIFY(thread[x].wait(1000)); - } - } + { + QMutex mutex; + QWaitCondition cond; + + mutex.lock(); + + cond.wakeOne(); + QVERIFY(!cond.wait(&mutex, 1)); + + cond.wakeAll(); + QVERIFY(!cond.wait(&mutex, 1)); + + mutex.unlock(); + } + + { + // test multiple threads waiting on separate wait conditions + wait_QMutex_Thread_1 thread[ThreadCount]; + + for (x = 0; x < ThreadCount; ++x) { + thread[x].mutex.lock(); + thread[x].start(); + // wait for thread to start + QVERIFY(thread[x].cond.wait(&thread[x].mutex, 1000)); + thread[x].mutex.unlock(); + } + + for (x = 0; x < ThreadCount; ++x) { + QVERIFY(thread[x].isRunning()); + QVERIFY(!thread[x].isFinished()); + } + + for (x = 0; x < ThreadCount; ++x) { + thread[x].mutex.lock(); + thread[x].cond.wakeOne(); + thread[x].mutex.unlock(); + } + + for (x = 0; x < ThreadCount; ++x) { + QVERIFY(thread[x].wait(1000)); + } + } + + { + // test multiple threads waiting on a wait condition + QMutex mutex; + QWaitCondition cond1, cond2; + wait_QMutex_Thread_2 thread[ThreadCount]; + + mutex.lock(); + for (x = 0; x < ThreadCount; ++x) { + thread[x].mutex = &mutex; + thread[x].cond = (x < ThreadCount / 2) ? &cond1 : &cond2; + thread[x].start(); + // wait for thread to start + QVERIFY(thread[x].started.wait(&mutex, 1000)); + } + mutex.unlock(); + + for (x = 0; x < ThreadCount; ++x) { + QVERIFY(thread[x].isRunning()); + QVERIFY(!thread[x].isFinished()); + } + + mutex.lock(); + cond1.wakeAll(); + cond2.wakeAll(); + mutex.unlock(); + + for (x = 0; x < ThreadCount; ++x) { + QVERIFY(thread[x].wait(1000)); + } + } } } @@ -288,99 +288,99 @@ void tst_QWaitCondition::wait_QReadWriteLock() int x; for (int i = 0; i < iterations; ++i) { - { + { QReadWriteLock readWriteLock; QWaitCondition waitCondition; - readWriteLock.lockForRead(); + readWriteLock.lockForRead(); - waitCondition.wakeOne(); - QVERIFY(!waitCondition.wait(&readWriteLock, 1)); + waitCondition.wakeOne(); + QVERIFY(!waitCondition.wait(&readWriteLock, 1)); - waitCondition.wakeAll(); - QVERIFY(!waitCondition.wait(&readWriteLock, 1)); + waitCondition.wakeAll(); + QVERIFY(!waitCondition.wait(&readWriteLock, 1)); - readWriteLock.unlock(); - } + readWriteLock.unlock(); + } { QReadWriteLock readWriteLock; - QWaitCondition waitCondition; + QWaitCondition waitCondition; - readWriteLock.lockForWrite(); + readWriteLock.lockForWrite(); - waitCondition.wakeOne(); - QVERIFY(!waitCondition.wait(&readWriteLock, 1)); + waitCondition.wakeOne(); + QVERIFY(!waitCondition.wait(&readWriteLock, 1)); - waitCondition.wakeAll(); - QVERIFY(!waitCondition.wait(&readWriteLock, 1)); + waitCondition.wakeAll(); + QVERIFY(!waitCondition.wait(&readWriteLock, 1)); - readWriteLock.unlock(); - } + readWriteLock.unlock(); + } - { - // test multiple threads waiting on separate wait conditions - wait_QReadWriteLock_Thread_1 thread[ThreadCount]; + { + // test multiple threads waiting on separate wait conditions + wait_QReadWriteLock_Thread_1 thread[ThreadCount]; - for (x = 0; x < ThreadCount; ++x) { - thread[x].readWriteLock.lockForRead(); - thread[x].start(); - // wait for thread to start + for (x = 0; x < ThreadCount; ++x) { + thread[x].readWriteLock.lockForRead(); + thread[x].start(); + // wait for thread to start #if defined(Q_OS_SYMBIAN) && defined(Q_CC_WINSCW) // Symbian emulator startup simultaneously with this thread causes additional delay - QVERIFY(thread[x].cond.wait(&thread[x].readWriteLock, 10000)); + QVERIFY(thread[x].cond.wait(&thread[x].readWriteLock, 10000)); #else - QVERIFY(thread[x].cond.wait(&thread[x].readWriteLock, 1000)); + QVERIFY(thread[x].cond.wait(&thread[x].readWriteLock, 1000)); #endif - thread[x].readWriteLock.unlock(); - } - - for (x = 0; x < ThreadCount; ++x) { - QVERIFY(thread[x].isRunning()); - QVERIFY(!thread[x].isFinished()); - } - - for (x = 0; x < ThreadCount; ++x) { - thread[x].readWriteLock.lockForRead(); - thread[x].cond.wakeOne(); - thread[x].readWriteLock.unlock(); - } - - for (x = 0; x < ThreadCount; ++x) { - QVERIFY(thread[x].wait(1000)); - } - } - - { - // test multiple threads waiting on a wait condition - QReadWriteLock readWriteLock; - QWaitCondition cond1, cond2; - wait_QReadWriteLock_Thread_2 thread[ThreadCount]; - - readWriteLock.lockForWrite(); - for (x = 0; x < ThreadCount; ++x) { - thread[x].readWriteLock = &readWriteLock; - thread[x].cond = (x < ThreadCount / 2) ? &cond1 : &cond2; - thread[x].start(); - // wait for thread to start - QVERIFY(thread[x].started.wait(&readWriteLock, 1000)); - } - readWriteLock.unlock(); - - for (x = 0; x < ThreadCount; ++x) { - QVERIFY(thread[x].isRunning()); - QVERIFY(!thread[x].isFinished()); - } - - readWriteLock.lockForWrite(); - cond1.wakeAll(); - cond2.wakeAll(); - readWriteLock.unlock(); - - for (x = 0; x < ThreadCount; ++x) { - QVERIFY(thread[x].wait(1000)); - } - } + thread[x].readWriteLock.unlock(); + } + + for (x = 0; x < ThreadCount; ++x) { + QVERIFY(thread[x].isRunning()); + QVERIFY(!thread[x].isFinished()); + } + + for (x = 0; x < ThreadCount; ++x) { + thread[x].readWriteLock.lockForRead(); + thread[x].cond.wakeOne(); + thread[x].readWriteLock.unlock(); + } + + for (x = 0; x < ThreadCount; ++x) { + QVERIFY(thread[x].wait(1000)); + } + } + + { + // test multiple threads waiting on a wait condition + QReadWriteLock readWriteLock; + QWaitCondition cond1, cond2; + wait_QReadWriteLock_Thread_2 thread[ThreadCount]; + + readWriteLock.lockForWrite(); + for (x = 0; x < ThreadCount; ++x) { + thread[x].readWriteLock = &readWriteLock; + thread[x].cond = (x < ThreadCount / 2) ? &cond1 : &cond2; + thread[x].start(); + // wait for thread to start + QVERIFY(thread[x].started.wait(&readWriteLock, 1000)); + } + readWriteLock.unlock(); + + for (x = 0; x < ThreadCount; ++x) { + QVERIFY(thread[x].isRunning()); + QVERIFY(!thread[x].isFinished()); + } + + readWriteLock.lockForWrite(); + cond1.wakeAll(); + cond2.wakeAll(); + readWriteLock.unlock(); + + for (x = 0; x < ThreadCount; ++x) { + QVERIFY(thread[x].wait(1000)); + } + } } } @@ -397,7 +397,7 @@ public: QWaitCondition *cond; inline wake_Thread() - : mutex(0), cond(0) + : mutex(0), cond(0) { } static inline void sleep(ulong s) @@ -405,14 +405,14 @@ public: void run() { - mutex->lock(); - ++count; + mutex->lock(); + ++count; dummy.wakeOne(); // this wakeup should be lost - started.wakeOne(); + started.wakeOne(); dummy.wakeAll(); // this one too - cond->wait(mutex); + cond->wait(mutex); --count; - mutex->unlock(); + mutex->unlock(); } }; @@ -430,7 +430,7 @@ public: QWaitCondition *cond; inline wake_Thread_2() - : readWriteLock(0), cond(0) + : readWriteLock(0), cond(0) { } static inline void sleep(ulong s) @@ -438,14 +438,14 @@ public: void run() { - readWriteLock->lockForWrite(); - ++count; + readWriteLock->lockForWrite(); + ++count; dummy.wakeOne(); // this wakeup should be lost started.wakeOne(); dummy.wakeAll(); // this one too - cond->wait(readWriteLock); + cond->wait(readWriteLock); --count; - readWriteLock->unlock(); + readWriteLock->unlock(); } }; @@ -456,194 +456,194 @@ void tst_QWaitCondition::wakeOne() int x; // wake up threads, one at a time for (int i = 0; i < iterations; ++i) { - QMutex mutex; - QWaitCondition cond; + QMutex mutex; + QWaitCondition cond; // QMutex - wake_Thread thread[ThreadCount]; - bool thread_exited[ThreadCount]; - - mutex.lock(); - for (x = 0; x < ThreadCount; ++x) { - thread[x].mutex = &mutex; - thread[x].cond = &cond; - thread_exited[x] = FALSE; - thread[x].start(); - // wait for thread to start - QVERIFY(thread[x].started.wait(&mutex, 1000)); + wake_Thread thread[ThreadCount]; + bool thread_exited[ThreadCount]; + + mutex.lock(); + for (x = 0; x < ThreadCount; ++x) { + thread[x].mutex = &mutex; + thread[x].cond = &cond; + thread_exited[x] = FALSE; + thread[x].start(); + // wait for thread to start + QVERIFY(thread[x].started.wait(&mutex, 1000)); // make sure wakeups are not queued... if nothing is // waiting at the time of the wakeup, nothing happens QVERIFY(!thread[x].dummy.wait(&mutex, 1)); - } - mutex.unlock(); + } + mutex.unlock(); - QCOMPARE(wake_Thread::count, ThreadCount); + QCOMPARE(wake_Thread::count, ThreadCount); - // wake up threads one at a time - for (x = 0; x < ThreadCount; ++x) { - mutex.lock(); - cond.wakeOne(); - QVERIFY(!cond.wait(&mutex, COND_WAIT_TIME)); + // wake up threads one at a time + for (x = 0; x < ThreadCount; ++x) { + mutex.lock(); + cond.wakeOne(); + QVERIFY(!cond.wait(&mutex, COND_WAIT_TIME)); QVERIFY(!thread[x].dummy.wait(&mutex, 1)); - mutex.unlock(); + mutex.unlock(); - int exited = 0; - for (int y = 0; y < ThreadCount; ++y) { - if (thread_exited[y]) + int exited = 0; + for (int y = 0; y < ThreadCount; ++y) { + if (thread_exited[y]) continue; - if (thread[y].wait(exited > 0 ? 1 : 1000)) { - thread_exited[y] = TRUE; - ++exited; - } - } + if (thread[y].wait(exited > 0 ? 1 : 1000)) { + thread_exited[y] = TRUE; + ++exited; + } + } - QCOMPARE(exited, 1); - QCOMPARE(wake_Thread::count, ThreadCount - (x + 1)); - } + QCOMPARE(exited, 1); + QCOMPARE(wake_Thread::count, ThreadCount - (x + 1)); + } - QCOMPARE(wake_Thread::count, 0); + QCOMPARE(wake_Thread::count, 0); // QReadWriteLock QReadWriteLock readWriteLock; wake_Thread_2 rwthread[ThreadCount]; readWriteLock.lockForWrite(); - for (x = 0; x < ThreadCount; ++x) { - rwthread[x].readWriteLock = &readWriteLock; - rwthread[x].cond = &cond; - thread_exited[x] = FALSE; - rwthread[x].start(); - // wait for thread to start - QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000)); + for (x = 0; x < ThreadCount; ++x) { + rwthread[x].readWriteLock = &readWriteLock; + rwthread[x].cond = &cond; + thread_exited[x] = FALSE; + rwthread[x].start(); + // wait for thread to start + QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000)); // make sure wakeups are not queued... if nothing is // waiting at the time of the wakeup, nothing happens QVERIFY(!rwthread[x].dummy.wait(&readWriteLock, 1)); - } - readWriteLock.unlock(); + } + readWriteLock.unlock(); - QCOMPARE(wake_Thread_2::count, ThreadCount); + QCOMPARE(wake_Thread_2::count, ThreadCount); - // wake up threads one at a time - for (x = 0; x < ThreadCount; ++x) { - readWriteLock.lockForWrite(); - cond.wakeOne(); - QVERIFY(!cond.wait(&readWriteLock, COND_WAIT_TIME)); + // wake up threads one at a time + for (x = 0; x < ThreadCount; ++x) { + readWriteLock.lockForWrite(); + cond.wakeOne(); + QVERIFY(!cond.wait(&readWriteLock, COND_WAIT_TIME)); QVERIFY(!rwthread[x].dummy.wait(&readWriteLock, 1)); - readWriteLock.unlock(); + readWriteLock.unlock(); - int exited = 0; - for (int y = 0; y < ThreadCount; ++y) { - if (thread_exited[y]) + int exited = 0; + for (int y = 0; y < ThreadCount; ++y) { + if (thread_exited[y]) continue; - if (rwthread[y].wait(exited > 0 ? 1 : 1000)) { - thread_exited[y] = TRUE; - ++exited; - } - } + if (rwthread[y].wait(exited > 0 ? 1 : 1000)) { + thread_exited[y] = TRUE; + ++exited; + } + } - QCOMPARE(exited, 1); - QCOMPARE(wake_Thread_2::count, ThreadCount - (x + 1)); - } + QCOMPARE(exited, 1); + QCOMPARE(wake_Thread_2::count, ThreadCount - (x + 1)); + } - QCOMPARE(wake_Thread_2::count, 0); + QCOMPARE(wake_Thread_2::count, 0); } // wake up threads, two at a time for (int i = 0; i < iterations; ++i) { - QMutex mutex; - QWaitCondition cond; + QMutex mutex; + QWaitCondition cond; // QMutex - wake_Thread thread[ThreadCount]; - bool thread_exited[ThreadCount]; - - mutex.lock(); - for (x = 0; x < ThreadCount; ++x) { - thread[x].mutex = &mutex; - thread[x].cond = &cond; - thread_exited[x] = FALSE; - thread[x].start(); - // wait for thread to start - QVERIFY(thread[x].started.wait(&mutex, 1000)); + wake_Thread thread[ThreadCount]; + bool thread_exited[ThreadCount]; + + mutex.lock(); + for (x = 0; x < ThreadCount; ++x) { + thread[x].mutex = &mutex; + thread[x].cond = &cond; + thread_exited[x] = FALSE; + thread[x].start(); + // wait for thread to start + QVERIFY(thread[x].started.wait(&mutex, 1000)); // make sure wakeups are not queued... if nothing is // waiting at the time of the wakeup, nothing happens QVERIFY(!thread[x].dummy.wait(&mutex, 1)); - } - mutex.unlock(); + } + mutex.unlock(); - QCOMPARE(wake_Thread::count, ThreadCount); + QCOMPARE(wake_Thread::count, ThreadCount); - // wake up threads one at a time - for (x = 0; x < ThreadCount; x += 2) { - mutex.lock(); - cond.wakeOne(); - cond.wakeOne(); - QVERIFY(!cond.wait(&mutex, COND_WAIT_TIME)); + // wake up threads one at a time + for (x = 0; x < ThreadCount; x += 2) { + mutex.lock(); + cond.wakeOne(); + cond.wakeOne(); + QVERIFY(!cond.wait(&mutex, COND_WAIT_TIME)); QVERIFY(!thread[x].dummy.wait(&mutex, 1)); QVERIFY(!thread[x + 1].dummy.wait(&mutex, 1)); - mutex.unlock(); + mutex.unlock(); - int exited = 0; - for (int y = 0; y < ThreadCount; ++y) { - if (thread_exited[y]) + int exited = 0; + for (int y = 0; y < ThreadCount; ++y) { + if (thread_exited[y]) continue; - if (thread[y].wait(exited > 0 ? 1 : 1000)) { - thread_exited[y] = TRUE; - ++exited; - } - } + if (thread[y].wait(exited > 0 ? 1 : 1000)) { + thread_exited[y] = TRUE; + ++exited; + } + } - QCOMPARE(exited, 2); - QCOMPARE(wake_Thread::count, ThreadCount - (x + 2)); - } + QCOMPARE(exited, 2); + QCOMPARE(wake_Thread::count, ThreadCount - (x + 2)); + } - QCOMPARE(wake_Thread::count, 0); + QCOMPARE(wake_Thread::count, 0); // QReadWriteLock QReadWriteLock readWriteLock; wake_Thread_2 rwthread[ThreadCount]; - readWriteLock.lockForWrite(); - for (x = 0; x < ThreadCount; ++x) { - rwthread[x].readWriteLock = &readWriteLock; - rwthread[x].cond = &cond; - thread_exited[x] = FALSE; - rwthread[x].start(); - // wait for thread to start - QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000)); + readWriteLock.lockForWrite(); + for (x = 0; x < ThreadCount; ++x) { + rwthread[x].readWriteLock = &readWriteLock; + rwthread[x].cond = &cond; + thread_exited[x] = FALSE; + rwthread[x].start(); + // wait for thread to start + QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000)); // make sure wakeups are not queued... if nothing is // waiting at the time of the wakeup, nothing happens QVERIFY(!rwthread[x].dummy.wait(&readWriteLock, 1)); - } - readWriteLock.unlock(); + } + readWriteLock.unlock(); - QCOMPARE(wake_Thread_2::count, ThreadCount); + QCOMPARE(wake_Thread_2::count, ThreadCount); - // wake up threads one at a time - for (x = 0; x < ThreadCount; x += 2) { - readWriteLock.lockForWrite(); - cond.wakeOne(); - cond.wakeOne(); - QVERIFY(!cond.wait(&readWriteLock, COND_WAIT_TIME)); + // wake up threads one at a time + for (x = 0; x < ThreadCount; x += 2) { + readWriteLock.lockForWrite(); + cond.wakeOne(); + cond.wakeOne(); + QVERIFY(!cond.wait(&readWriteLock, COND_WAIT_TIME)); QVERIFY(!rwthread[x].dummy.wait(&readWriteLock, 1)); QVERIFY(!rwthread[x + 1].dummy.wait(&readWriteLock, 1)); - readWriteLock.unlock(); + readWriteLock.unlock(); - int exited = 0; - for (int y = 0; y < ThreadCount; ++y) { - if (thread_exited[y]) + int exited = 0; + for (int y = 0; y < ThreadCount; ++y) { + if (thread_exited[y]) continue; - if (rwthread[y].wait(exited > 0 ? 1 : 1000)) { - thread_exited[y] = TRUE; - ++exited; - } - } + if (rwthread[y].wait(exited > 0 ? 1 : 1000)) { + thread_exited[y] = TRUE; + ++exited; + } + } - QCOMPARE(exited, 2); - QCOMPARE(wake_Thread_2::count, ThreadCount - (x + 2)); - } + QCOMPARE(exited, 2); + QCOMPARE(wake_Thread_2::count, ThreadCount - (x + 2)); + } - QCOMPARE(wake_Thread_2::count, 0); + QCOMPARE(wake_Thread_2::count, 0); } } @@ -651,69 +651,69 @@ void tst_QWaitCondition::wakeAll() { int x; for (int i = 0; i < iterations; ++i) { - QMutex mutex; - QWaitCondition cond; + QMutex mutex; + QWaitCondition cond; // QMutex - wake_Thread thread[ThreadCount]; - - mutex.lock(); - for (x = 0; x < ThreadCount; ++x) { - thread[x].mutex = &mutex; - thread[x].cond = &cond; - thread[x].start(); - // wait for thread to start - QVERIFY(thread[x].started.wait(&mutex, 1000)); - } - mutex.unlock(); - - QCOMPARE(wake_Thread::count, ThreadCount); - - // wake up all threads at once - mutex.lock(); - cond.wakeAll(); - QVERIFY(!cond.wait(&mutex, COND_WAIT_TIME)); - mutex.unlock(); - - int exited = 0; - for (x = 0; x < ThreadCount; ++x) { - if (thread[x].wait(1000)) - ++exited; - } - - QCOMPARE(exited, ThreadCount); - QCOMPARE(wake_Thread::count, 0); + wake_Thread thread[ThreadCount]; + + mutex.lock(); + for (x = 0; x < ThreadCount; ++x) { + thread[x].mutex = &mutex; + thread[x].cond = &cond; + thread[x].start(); + // wait for thread to start + QVERIFY(thread[x].started.wait(&mutex, 1000)); + } + mutex.unlock(); + + QCOMPARE(wake_Thread::count, ThreadCount); + + // wake up all threads at once + mutex.lock(); + cond.wakeAll(); + QVERIFY(!cond.wait(&mutex, COND_WAIT_TIME)); + mutex.unlock(); + + int exited = 0; + for (x = 0; x < ThreadCount; ++x) { + if (thread[x].wait(1000)) + ++exited; + } + + QCOMPARE(exited, ThreadCount); + QCOMPARE(wake_Thread::count, 0); // QReadWriteLock QReadWriteLock readWriteLock; - wake_Thread_2 rwthread[ThreadCount]; - - readWriteLock.lockForWrite(); - for (x = 0; x < ThreadCount; ++x) { - rwthread[x].readWriteLock = &readWriteLock; - rwthread[x].cond = &cond; - rwthread[x].start(); - // wait for thread to start - QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000)); - } - readWriteLock.unlock(); - - QCOMPARE(wake_Thread_2::count, ThreadCount); - - // wake up all threads at once - readWriteLock.lockForWrite(); - cond.wakeAll(); - QVERIFY(!cond.wait(&readWriteLock, COND_WAIT_TIME)); - readWriteLock.unlock(); + wake_Thread_2 rwthread[ThreadCount]; + + readWriteLock.lockForWrite(); + for (x = 0; x < ThreadCount; ++x) { + rwthread[x].readWriteLock = &readWriteLock; + rwthread[x].cond = &cond; + rwthread[x].start(); + // wait for thread to start + QVERIFY(rwthread[x].started.wait(&readWriteLock, 1000)); + } + readWriteLock.unlock(); + + QCOMPARE(wake_Thread_2::count, ThreadCount); + + // wake up all threads at once + readWriteLock.lockForWrite(); + cond.wakeAll(); + QVERIFY(!cond.wait(&readWriteLock, COND_WAIT_TIME)); + readWriteLock.unlock(); exited = 0; - for (x = 0; x < ThreadCount; ++x) { - if (rwthread[x].wait(1000)) - ++exited; - } + for (x = 0; x < ThreadCount; ++x) { + if (rwthread[x].wait(1000)) + ++exited; + } - QCOMPARE(exited, ThreadCount); - QCOMPARE(wake_Thread_2::count, 0); + QCOMPARE(exited, ThreadCount); + QCOMPARE(wake_Thread_2::count, 0); } } diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index e148fdb..2b1c24c 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -3464,7 +3464,7 @@ QString textPropertyToString(Display *display, XTextProperty& text_prop) static CCoeControl* GetStatusPaneControl( TInt aPaneId ) { const TUid paneUid = { aPaneId }; - + CEikStatusPane* statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane(); if (statusPane && statusPane->PaneCapabilities(paneUid).IsPresent()){ CCoeControl* control = NULL; @@ -3474,17 +3474,17 @@ static CCoeControl* GetStatusPaneControl( TInt aPaneId ) } return NULL; } -// Returns the application's title pane, if not present returns NULL. +// Returns the application's title pane, if not present returns NULL. static CAknTitlePane* TitlePane() { return static_cast(GetStatusPaneControl(EEikStatusPaneUidTitle)); } - -// Returns the application's title pane, if not present returns NULL. + +// Returns the application's title pane, if not present returns NULL. static CAknContextPane* ContextPane() { return static_cast(GetStatusPaneControl(EEikStatusPaneUidContext)); -} +} #endif static QString visibleWindowTitle(QWidget *window, Qt::WindowState state = Qt::WindowNoState) @@ -3549,7 +3549,7 @@ static QString visibleWindowTitle(QWidget *window, Qt::WindowState state = Qt::W if (win) vTitle = win->caption(); } -#elif defined (Q_WS_S60) +#elif defined (Q_WS_S60) CAknTitlePane* titlePane = TitlePane(); if(titlePane) { diff --git a/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp b/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp index e0c183c..54ba29e 100644 --- a/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp +++ b/tests/auto/qxmlsimplereader/tst_qxmlsimplereader.cpp @@ -575,10 +575,10 @@ void tst_QXmlSimpleReader::inputFromSocket_data() void tst_QXmlSimpleReader::inputFromSocket() { QFETCH(QString, file_name); - + #if defined(Q_OS_SYMBIAN) QSKIP("Symbian: Skipped due to problems in Open C and QtNetwork", SkipAll); -#endif +#endif #if defined(Q_OS_WIN32) && (defined(Q_CC_INTEL) || defined(Q_CC_MINGW) || defined(Q_CC_MSVC_NET)) QSKIP("Regression caused by QHOstInfo change 294548, see task 202231.", SkipAll); diff --git a/tests/auto/symbian/orientationchange/orientationchange.pro b/tests/auto/symbian/orientationchange/orientationchange.pro index d240fa1..08b34f9 100644 --- a/tests/auto/symbian/orientationchange/orientationchange.pro +++ b/tests/auto/symbian/orientationchange/orientationchange.pro @@ -1,7 +1,7 @@ load(qttest_p4) -HEADERS += +HEADERS += SOURCES += tst_orientationchange.cpp -symbian { +symbian { INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE } diff --git a/tests/auto/symbian/orientationchange/tst_orientationchange.cpp b/tests/auto/symbian/orientationchange/tst_orientationchange.cpp index 9d57ae1..ff371fa 100644 --- a/tests/auto/symbian/orientationchange/tst_orientationchange.cpp +++ b/tests/auto/symbian/orientationchange/tst_orientationchange.cpp @@ -61,11 +61,11 @@ class TestWidget : public QWidget { public: TestWidget(QWidget *parent = 0); - + void reset(); public: void resizeEvent(QResizeEvent *event); - + public: QSize resizeEventSize; int resizeEventCount; @@ -86,58 +86,58 @@ void TestWidget::reset() void TestWidget::resizeEvent(QResizeEvent *event) { QWidget::resizeEvent(event); - + // Size delivered in first resize event is stored. - if (!resizeEventCount) + if (!resizeEventCount) resizeEventSize = event->size(); - resizeEventCount++; + resizeEventCount++; } void tst_orientationchange::resizeEventOnOrientationChange() { // This will test that when orientation 'changes', then // at most one resize event is generated. - + TestWidget *normalWidget = new TestWidget(); TestWidget *fullScreenWidget = new TestWidget(); TestWidget *maximizedWidget = new TestWidget(); - + fullScreenWidget->showFullScreen(); maximizedWidget->showMaximized(); normalWidget->show(); - + QCoreApplication::sendPostedEvents(); QCoreApplication::sendPostedEvents(); - + QCOMPARE(fullScreenWidget->resizeEventCount, 1); QCOMPARE(fullScreenWidget->size(), fullScreenWidget->resizeEventSize); QCOMPARE(maximizedWidget->resizeEventCount, 1); QCOMPARE(maximizedWidget->size(), maximizedWidget->resizeEventSize); QCOMPARE(normalWidget->resizeEventCount, 1); QCOMPARE(normalWidget->size(), normalWidget->resizeEventSize); - + fullScreenWidget->reset(); maximizedWidget->reset(); normalWidget->reset(); - + // Assumes that Qt application is AVKON application. CAknAppUi *appUi = static_cast(CEikonEnv::Static()->EikAppUi()); - + // Determine 'opposite' orientation to the current orientation. - + CAknAppUi::TAppUiOrientation orientation = CAknAppUi::EAppUiOrientationLandscape; if (fullScreenWidget->size().width() > fullScreenWidget->size().height()) { orientation = CAknAppUi::EAppUiOrientationPortrait; } - + TRAPD(err, appUi->SetOrientationL(orientation)); QCoreApplication::sendPostedEvents(); QCoreApplication::sendPostedEvents(); - // setOrientationL is not guaranteed to change orientation - // (if emulator configured to support just portrait or landscape, then + // setOrientationL is not guaranteed to change orientation + // (if emulator configured to support just portrait or landscape, then // setOrientationL call shouldn't do anything). // So let's ensure that we do not get resize event twice. @@ -150,9 +150,9 @@ void tst_orientationchange::resizeEventOnOrientationChange() QCOMPARE(maximizedWidget->size(), maximizedWidget->resizeEventSize); } QCOMPARE(normalWidget->resizeEventCount, 0); - + TRAP(err, appUi->SetOrientationL(CAknAppUi::EAppUiOrientationUnspecified)); - + delete normalWidget; delete fullScreenWidget; delete maximizedWidget; diff --git a/tests/auto/symbian/qmainexceptions/qmainexceptions.pro b/tests/auto/symbian/qmainexceptions/qmainexceptions.pro index 7533dd4..16111c1 100644 --- a/tests/auto/symbian/qmainexceptions/qmainexceptions.pro +++ b/tests/auto/symbian/qmainexceptions/qmainexceptions.pro @@ -1,5 +1,3 @@ load(qttest_p4) -HEADERS += +HEADERS += SOURCES += tst_qmainexceptions.cpp - - diff --git a/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp b/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp index 1601b7e..bfe092b 100644 --- a/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp +++ b/tests/auto/symbian/qmainexceptions/tst_qmainexceptions.cpp @@ -423,7 +423,7 @@ void HybridFuncLX(THybridAction aAction) void tst_qmainexceptions::testHybrid() { - TRAPD(error, + TRAPD(error, QT_TRYCATCH_LEAVING( HybridFuncLX(EHybridLeave); ) ); @@ -432,8 +432,8 @@ void tst_qmainexceptions::testHybrid() QCOMPARE(int(sizeof(expected1)/sizeof(int)), int(recDtor - dtorFired)); for (int i=0; i Date: Tue, 4 Aug 2009 15:34:47 +0300 Subject: Added sqlite dll deployment to qitemmodel test --- tests/auto/qitemmodel/qitemmodel.pro | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/auto/qitemmodel/qitemmodel.pro b/tests/auto/qitemmodel/qitemmodel.pro index 381a008..eb62b24 100644 --- a/tests/auto/qitemmodel/qitemmodel.pro +++ b/tests/auto/qitemmodel/qitemmodel.pro @@ -3,8 +3,6 @@ SOURCES += tst_qitemmodel.cpp QT += sql -symbian:TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb" - # NOTE: The deployment of the sqldrivers is disabled on purpose. # If we deploy the plugins, they are loaded twice when running # the tests on the autotest system. In that case we run out of @@ -15,3 +13,12 @@ symbian:TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb" # plugFiles.path = sqldrivers # DEPLOYMENT += plugFiles #} + +symbian { + TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb" + contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2)|contains(S60_VERSION, 5.0) { + sqlite.path = /sys/bin + sqlite.sources = sqlite3.dll + DEPLOYMENT += sqlite + } +} -- cgit v0.12 From 3bd102e7935fcb002867acfd72c34b38247144da Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 5 Aug 2009 11:05:57 +0300 Subject: Implemented QDesktopServices TODOs, and fixed coding style deviations. --- src/gui/util/qdesktopservices.cpp | 5 +- src/gui/util/qdesktopservices_s60.cpp | 83 ++++++++++++---------- .../auto/qdesktopservices/tst_qdesktopservices.cpp | 2 +- 3 files changed, 48 insertions(+), 42 deletions(-) diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp index 18a0a73..26e10ca 100644 --- a/src/gui/util/qdesktopservices.cpp +++ b/src/gui/util/qdesktopservices.cpp @@ -288,8 +288,9 @@ void QDesktopServices::unsetUrlHandler(const QString &scheme) \note The storage location returned can be a directory that does not exist; i.e., it may need to be created by the system or the user. - \note On Symbian OS, DataLocation and ApplicationsLocation always point to appropriate - folder on same drive with executable. FontsLocation always points to folder on ROM drive. + \note On Symbian OS, ApplicationsLocation always point /sys/bin folder on the same drive + with executable. FontsLocation always points to folder on ROM drive. Symbian OS does not + have desktop concept, DesktopLocation returns same path as DocumentsLocation. Rest of the standard locations point to folder on same drive with executable, except that if executable is in ROM the folder from C drive is returned. diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp index 565dd6e..4531a2f 100644 --- a/src/gui/util/qdesktopservices_s60.cpp +++ b/src/gui/util/qdesktopservices_s60.cpp @@ -68,6 +68,7 @@ QT_BEGIN_NAMESPACE +_LIT(KCacheSubDir, "Cache\\"); _LIT(KSysBin, "\\Sys\\Bin\\"); _LIT(KTempDir, "\\System\\Temp\\"); _LIT(KBrowserPrefix, "4 " ); @@ -125,7 +126,7 @@ static void handleMailtoSchemeLX(const QUrl &url) CleanupStack::PopAndDestroy(accounts); if(!count) { - // TODO: we should try to create account if count == 0 + // TODO: Task 259192: We should try to create account if count == 0 // CSendUi would provide account creation service for us, but it requires ridicilous // capabilities: LocalServices NetworkServices ReadDeviceData ReadUserData WriteDeviceData WriteUserData User::Leave(KErrNotSupported); @@ -143,18 +144,18 @@ static void handleMailtoSchemeLX(const QUrl &url) // To foreach(QString item, recipients) - sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo ); + sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo); foreach(QString item, tos) - sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo ); + sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo); // Cc foreach(QString item, ccs) - sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientCc ); + sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientCc); // Bcc foreach(QString item, bccs) - sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientBcc ); + sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientBcc); // send the message sendAsMessage.LaunchEditorAndCloseL(); @@ -172,32 +173,29 @@ static bool handleMailtoScheme(const QUrl &url) static void handleOtherSchemesL(const TDesC& aUrl) { // Other schemes are at the moment passed to WEB browser - HBufC* buf16 = HBufC::NewLC( aUrl.Length() + KBrowserPrefix.iTypeLength ); - buf16->Des().Copy( KBrowserPrefix ); // Prefix used to launch correct browser view - buf16->Des().Append( aUrl ); - - TApaTaskList taskList( CEikonEnv::Static()->WsSession() ); - TApaTask task = taskList.FindApp( KUidBrowser ); - if ( task.Exists() ) - { + HBufC* buf16 = HBufC::NewLC(aUrl.Length() + KBrowserPrefix.iTypeLength); + buf16->Des().Copy(KBrowserPrefix); // Prefix used to launch correct browser view + buf16->Des().Append(aUrl); + + TApaTaskList taskList(CEikonEnv::Static()->WsSession()); + TApaTask task = taskList.FindApp(KUidBrowser); + if (task.Exists()){ // Switch to existing browser instance - HBufC8* param8 = HBufC8::NewLC( buf16->Length() ); - param8->Des().Append( buf16->Des() ); - task.SendMessage( TUid::Uid( 0 ), *param8 ); // Uid is not used - CleanupStack::PopAndDestroy( param8 ); - } - else - { + HBufC8* param8 = HBufC8::NewLC(buf16->Length()); + param8->Des().Append(buf16->Des()); + task.SendMessage(TUid::Uid( 0 ), *param8); // Uid is not used + CleanupStack::PopAndDestroy(param8); + } else { // Start a new browser instance RApaLsSession appArcSession; - User::LeaveIfError( appArcSession.Connect() ); - CleanupClosePushL( appArcSession ); + User::LeaveIfError(appArcSession.Connect()); + CleanupClosePushL(appArcSession); TThreadId id; - appArcSession.StartDocument( *buf16, KUidBrowser , id ); + appArcSession.StartDocument(*buf16, KUidBrowser, id); CleanupStack::PopAndDestroy(); // appArcSession - } + } - CleanupStack::PopAndDestroy( buf16 ); + CleanupStack::PopAndDestroy(buf16); } static bool handleOtherSchemes(const QUrl &url) @@ -219,8 +217,8 @@ static TDriveUnit exeDrive() static TDriveUnit writableExeDrive() { TDriveUnit drive = exeDrive(); - if( drive.operator TInt() == EDriveZ ) - return TDriveUnit( EDriveC ); + if(drive.operator TInt() == EDriveZ) + return TDriveUnit(EDriveC); return drive; } @@ -228,7 +226,7 @@ static TPtrC writableDataRoot() { TDriveUnit drive = exeDrive(); #ifdef Q_WS_S60 - switch( drive.operator TInt() ){ + switch(drive.operator TInt()){ case EDriveC: return PathInfo::PhoneMemoryRootPath(); break; @@ -241,7 +239,6 @@ static TPtrC writableDataRoot() return PathInfo::PhoneMemoryRootPath(); break; default: - // TODO: Should we return drive root similar to MemoryCardRootPath return PathInfo::PhoneMemoryRootPath(); break; } @@ -258,13 +255,13 @@ static void openDocumentL(const TDesC& aUrl) // Apparc base method cannot be used to open app in embedded mode, // but seems to be most stable way at the moment RApaLsSession appArcSession; - User::LeaveIfError( appArcSession.Connect() ); - CleanupClosePushL( appArcSession ); + User::LeaveIfError(appArcSession.Connect()); + CleanupClosePushL(appArcSession); TThreadId id; // ESwitchFiles means do not start another instance // Leaves if file does not exist, leave is trapped in openDocument and false returned to user. - User::LeaveIfError( appArcSession.StartDocument( aUrl, id, - RApaLsSession::ESwitchFiles ) ); // ELaunchNewApp + User::LeaveIfError(appArcSession.StartDocument(aUrl, id, + RApaLsSession::ESwitchFiles)); // ELaunchNewApp CleanupStack::PopAndDestroy(); // appArcSession #else // This is an alternative way to launch app associated to MIME type @@ -306,8 +303,8 @@ static bool handleUrl(const QUrl &url) static void handleUrlL(const TDesC& aUrl) { - CSchemeHandler* schemeHandler = CSchemeHandler::NewL( aUrl ); - CleanupStack::PushL( schemeHandler ); + CSchemeHandler* schemeHandler = CSchemeHandler::NewL(aUrl); + CleanupStack::PushL(schemeHandler); schemeHandler->HandleUrlStandaloneL(); // Process the Url in standalone mode CleanupStack::PopAndDestroy(); } @@ -351,7 +348,9 @@ QString QDesktopServices::storageLocation(StandardLocation type) switch (type) { case DesktopLocation: - qWarning("QDesktopServices::storageLocation %d not implemented", type); + qWarning("No desktop concept in Symbian OS"); + // But lets still use some feasible default + path.Append(writableDataRoot()); break; case DocumentsLocation: path.Append(writableDataRoot()); @@ -391,11 +390,17 @@ QString QDesktopServices::storageLocation(StandardLocation type) //return QDir::homePath(); break; break; case DataLocation: - CEikonEnv::Static()->FsSession().PrivatePath( path ); - // TODO: Should we actually return phone mem if data is on ROM? - path.Insert( 0, exeDrive().Name() ); + CEikonEnv::Static()->FsSession().PrivatePath(path); + path.Insert(0, writableExeDrive().Name()); break; + case CacheLocation: + CEikonEnv::Static()->FsSession().PrivatePath(path); + path.Insert(0, writableExeDrive().Name()); + path.Append(KCacheSubDir); + break; default: + // Lets use feasible default + path.Append(writableDataRoot()); break; } diff --git a/tests/auto/qdesktopservices/tst_qdesktopservices.cpp b/tests/auto/qdesktopservices/tst_qdesktopservices.cpp index 5e3ae4a..dd85774 100644 --- a/tests/auto/qdesktopservices/tst_qdesktopservices.cpp +++ b/tests/auto/qdesktopservices/tst_qdesktopservices.cpp @@ -307,7 +307,7 @@ void tst_qdesktopservices::storageLocation() switch(location) { case QDesktopServices::DesktopLocation: - QCOMPARE( storageLocation, QString() ); + QCOMPARE( storageLocation, drive + QString("/data") ); break; case QDesktopServices::DocumentsLocation: QCOMPARE( storageLocation, drive + QString("/data") ); -- cgit v0.12 From 58839dd435e558a02ea7882e9133e5be0fa9c687 Mon Sep 17 00:00:00 2001 From: mread Date: Wed, 5 Aug 2009 09:35:09 +0100 Subject: protecting against leak in QSymbianControl when QWidget construction fails --- src/gui/kernel/qwidget_s60.cpp | 44 +++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index b206517..ad7cd2d 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -299,6 +299,7 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de CCoeControl *destroyw = 0; + createExtra(); if(window) { if (destroyOldWindow) destroyw = data.winid; @@ -311,7 +312,10 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de if (!q->testAttribute(Qt::WA_Moved) && !q->testAttribute(Qt::WA_DontShowOnScreen)) data.crect.moveTopLeft(QPoint(clientRect.iTl.iX, clientRect.iTl.iY)); QSymbianControl *control= q_check_ptr(new QSymbianControl(q)); + id = (WId)control; + setWinId(id); QT_TRAP_THROWING(control->ConstructL(true,desktop)); + if (!desktop) { TInt stackingFlags; if ((q->windowType() & Qt::Popup) == Qt::Popup) { @@ -336,11 +340,6 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de } } - - id = (WId)control; - - setWinId(id); - q->setAttribute(Qt::WA_WState_Created); int x, y, w, h; @@ -348,6 +347,7 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de control->SetRect(TRect(TPoint(x, y), TSize(w, h))); } else if (q->testAttribute(Qt::WA_NativeWindow) || paintOnScreen()) { // create native child widget QSymbianControl *control = new QSymbianControl(q); + setWinId(control); QT_TRAP_THROWING(control->ConstructL(!parentWidget)); TInt stackingFlags; @@ -358,7 +358,6 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de } control->ControlEnv()->AppUi()->AddToStackL(control, ECoeStackPriorityDefault, stackingFlags); - setWinId(control); WId parentw = parentWidget->effectiveWinId(); QT_TRAP_THROWING(control->SetContainerWindowL(*parentw)); @@ -852,7 +851,12 @@ void QWidgetPrivate::createSysExtra() void QWidgetPrivate::deleteSysExtra() { - + // this should only be non-zero if destroy() has not run due to constructor fail + if (data.winid) { + data.winid->ControlEnv()->AppUi()->RemoveFromStack(data.winid); + delete data.winid; + data.winid = 0; + } } QWindowSurface *QWidgetPrivate::createDefaultWindowSurface_sys() @@ -1079,6 +1083,7 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) if (!isWindow() && parentWidget()) parentWidget()->d_func()->invalidateBuffer(geometry()); d->deactivateWidgetCleanup(); + WId id = internalWinId(); if (testAttribute(Qt::WA_WState_Created)) { #ifndef QT_NO_IM @@ -1104,12 +1109,10 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) releaseMouse(); if (QWidgetPrivate::keyboardGrabber == this) releaseKeyboard(); - if (destroyWindow && !(windowType() == Qt::Desktop) && internalWinId()) { - WId id = internalWinId(); + if (destroyWindow && !(windowType() == Qt::Desktop) && id) { if(id->IsFocused()) // Avoid unnecessry calls to FocusChanged() id->SetFocus(false); id->ControlEnv()->AppUi()->RemoveFromStack(id); - CBase::Delete(id); // Hack to activate window under destroyed one. With this activation // the next visible window will get keyboard focus @@ -1117,17 +1120,22 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) if (wid) { QWidget *widget = QWidget::find(wid); QApplication::setActiveWindow(widget); - // Reset global window title for focusing window - widget->d_func()->setWindowTitle_sys(widget->windowTitle()); + if (widget) { + // Reset global window title for focusing window + widget->d_func()->setWindowTitle_sys(widget->windowTitle()); + } } - } + } - QT_TRY { - d->setWinId(0); - } QT_CATCH (const std::bad_alloc &) { - // swallow - destructors must not throw - } + QT_TRY { + d->setWinId(0); + } QT_CATCH (const std::bad_alloc &) { + // swallow - destructors must not throw + } + + if (destroyWindow) { + delete id; } } -- cgit v0.12 From 867bcdcce78acca9fde2ffc57e6a304cd2e25517 Mon Sep 17 00:00:00 2001 From: mread Date: Wed, 5 Aug 2009 09:37:51 +0100 Subject: memory leak fix in standardItemModel found during combo box testing --- src/gui/itemviews/qstandarditemmodel.cpp | 20 +++++++++----------- src/gui/itemviews/qstandarditemmodel_p.h | 4 ++-- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/gui/itemviews/qstandarditemmodel.cpp b/src/gui/itemviews/qstandarditemmodel.cpp index b960fae..25acbc4 100644 --- a/src/gui/itemviews/qstandarditemmodel.cpp +++ b/src/gui/itemviews/qstandarditemmodel.cpp @@ -329,7 +329,6 @@ QStandardItemModelPrivate::QStandardItemModelPrivate() */ QStandardItemModelPrivate::~QStandardItemModelPrivate() { - delete root; delete itemPrototype; qDeleteAll(columnHeaderItems); qDeleteAll(rowHeaderItems); @@ -554,7 +553,7 @@ void QStandardItemModelPrivate::rowsInserted(QStandardItem *parent, int row, int count) { Q_Q(QStandardItemModel); - if (parent == root) + if (parent == root.data()) rowHeaderItems.insert(row, count, 0); q->endInsertRows(); } @@ -566,7 +565,7 @@ void QStandardItemModelPrivate::columnsInserted(QStandardItem *parent, int column, int count) { Q_Q(QStandardItemModel); - if (parent == root) + if (parent == root.data()) columnHeaderItems.insert(column, count, 0); q->endInsertColumns(); } @@ -578,7 +577,7 @@ void QStandardItemModelPrivate::rowsRemoved(QStandardItem *parent, int row, int count) { Q_Q(QStandardItemModel); - if (parent == root) { + if (parent == root.data()) { for (int i = row; i < row + count; ++i) { QStandardItem *oldItem = rowHeaderItems.at(i); if (oldItem) @@ -597,7 +596,7 @@ void QStandardItemModelPrivate::columnsRemoved(QStandardItem *parent, int column, int count) { Q_Q(QStandardItemModel); - if (parent == root) { + if (parent == root.data()) { for (int i = column; i < column + count; ++i) { QStandardItem *oldItem = columnHeaderItems.at(i); if (oldItem) @@ -788,7 +787,7 @@ QStandardItem::~QStandardItem() QStandardItem *QStandardItem::parent() const { Q_D(const QStandardItem); - if (!d->model || (d->model->d_func()->root != d->parent)) + if (!d->model || (d->model->d_func()->root.data() != d->parent)) return d->parent; return 0; } @@ -2083,8 +2082,7 @@ QStandardItemModel::~QStandardItemModel() void QStandardItemModel::clear() { Q_D(QStandardItemModel); - delete d->root; - d->root = new QStandardItem; + d->root.reset(new QStandardItem); d->root->d_func()->setModel(this); qDeleteAll(d->columnHeaderItems); d->columnHeaderItems.clear(); @@ -2231,7 +2229,7 @@ QStandardItem *QStandardItemModel::item(int row, int column) const QStandardItem *QStandardItemModel::invisibleRootItem() const { Q_D(const QStandardItemModel); - return d->root; + return d->root.data(); } /*! @@ -2733,7 +2731,7 @@ QModelIndex QStandardItemModel::index(int row, int column, const QModelIndex &pa bool QStandardItemModel::insertColumns(int column, int count, const QModelIndex &parent) { Q_D(QStandardItemModel); - QStandardItem *item = parent.isValid() ? itemFromIndex(parent) : d->root; + QStandardItem *item = parent.isValid() ? itemFromIndex(parent) : d->root.data(); if (item == 0) return false; return item->d_func()->insertColumns(column, count, QList()); @@ -2745,7 +2743,7 @@ bool QStandardItemModel::insertColumns(int column, int count, const QModelIndex bool QStandardItemModel::insertRows(int row, int count, const QModelIndex &parent) { Q_D(QStandardItemModel); - QStandardItem *item = parent.isValid() ? itemFromIndex(parent) : d->root; + QStandardItem *item = parent.isValid() ? itemFromIndex(parent) : d->root.data(); if (item == 0) return false; return item->d_func()->insertRows(row, count, QList()); diff --git a/src/gui/itemviews/qstandarditemmodel_p.h b/src/gui/itemviews/qstandarditemmodel_p.h index b2b16d1..8be8e9e 100644 --- a/src/gui/itemviews/qstandarditemmodel_p.h +++ b/src/gui/itemviews/qstandarditemmodel_p.h @@ -152,7 +152,7 @@ public: inline QStandardItem *itemFromIndex(const QModelIndex &index) const { Q_Q(const QStandardItemModel); if (!index.isValid()) - return root; + return root.data(); if (index.model() != q) return 0; QStandardItem *parent = static_cast(index.internalPointer()); @@ -177,7 +177,7 @@ public: QVector columnHeaderItems; QVector rowHeaderItems; - QStandardItem *root; + QScopedPointer root; const QStandardItem *itemPrototype; int sortRole; }; -- cgit v0.12 From eaaf45c7b8b8d810bbd77e73b72771543dd31b1a Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Wed, 5 Aug 2009 16:25:34 +0200 Subject: refactor a bit, and add container testing --- .../tst_exceptionsafety_objects.cpp | 306 ++++++++++++++++++--- 1 file changed, 272 insertions(+), 34 deletions(-) diff --git a/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp b/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp index c2c0685..0a95e5a 100644 --- a/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp +++ b/tests/auto/exceptionsafety_objects/tst_exceptionsafety_objects.cpp @@ -71,49 +71,60 @@ private slots: void widgets_data(); void widgets(); + + void vector_data(); + void vector(); + + void list_data(); + void list(); + + void linkedList_data(); + void linkedList(); }; // helper structs to create an arbitrary widget -struct AbstractObjectCreator +struct AbstractTester { - virtual void test(QObject *parent) = 0; + virtual void operator()(QObject *parent) = 0; }; +Q_DECLARE_METATYPE(AbstractTester *) -Q_DECLARE_METATYPE(AbstractObjectCreator *) +typedef void (*TestFunction)(QObject*); +Q_DECLARE_METATYPE(TestFunction) template -struct ObjectCreator : public AbstractObjectCreator +struct ObjectCreator : public AbstractTester { - void test(QObject *) + void operator()(QObject *) { QScopedPointer ptr(new T); } }; -struct BitArrayCreator : public AbstractObjectCreator +struct BitArrayCreator : public AbstractTester { - void test(QObject *) + void operator()(QObject *) { QScopedPointer bitArray(new QBitArray(100, true)); } }; -struct ByteArrayMatcherCreator : public AbstractObjectCreator +struct ByteArrayMatcherCreator : public AbstractTester { - void test(QObject *) + void operator()(QObject *) { QScopedPointer ptr(new QByteArrayMatcher("ralf test",8)); } }; -struct CryptographicHashCreator : public AbstractObjectCreator +struct CryptographicHashCreator : public AbstractTester { - void test(QObject *) + void operator()(QObject *) { QScopedPointer ptr(new QCryptographicHash(QCryptographicHash::Sha1)); ptr->addData("ralf test",8); } }; -struct DataStreamCreator : public AbstractObjectCreator +struct DataStreamCreator : public AbstractTester { - void test(QObject *) + void operator()(QObject *) { QScopedPointer arr(new QByteArray("hallo, test")); QScopedPointer ptr(new QDataStream(arr.data(), QIODevice::ReadWrite)); @@ -121,9 +132,9 @@ struct DataStreamCreator : public AbstractObjectCreator } }; -struct DirCreator : public AbstractObjectCreator +struct DirCreator : public AbstractTester { - void test(QObject *) + void operator()(QObject *) { QDir::cleanPath("../////././"); QScopedPointer ptr(new QDir(".")); @@ -140,9 +151,9 @@ struct DirCreator : public AbstractObjectCreator void tst_ExceptionSafetyObjects::objects_data() { - QTest::addColumn("objectCreator"); + QTest::addColumn("objectCreator"); -#define NEWROW(T) QTest::newRow(#T) << static_cast(new ObjectCreator) +#define NEWROW(T) QTest::newRow(#T) << static_cast(new ObjectCreator) NEWROW(QObject); NEWROW(QBuffer); NEWROW(QFile); @@ -154,7 +165,7 @@ void tst_ExceptionSafetyObjects::objects_data() NEWROW(QTranslator); NEWROW(QFSFileEngine); -#define NEWROW2(T, CREATOR) QTest::newRow(#T) << static_cast(new CREATOR) +#define NEWROW2(T, CREATOR) QTest::newRow(#T) << static_cast(new CREATOR) NEWROW2(QBitArray, BitArrayCreator); NEWROW2(QByteArrayMatcher, ByteArrayMatcherCreator); NEWROW2(QCryptographicHash, CryptographicHashCreator); @@ -165,7 +176,8 @@ void tst_ExceptionSafetyObjects::objects_data() // create and destructs an object, and lets each and every allocation // during construction and destruction fail. -static void doOOMTest(AbstractObjectCreator *creator, QObject *parent, int start=0) +template +static void doOOMTest(T &testFunc, QObject *parent, int start=0) { int currentOOMIndex = start; bool caught = false; @@ -180,7 +192,7 @@ static void doOOMTest(AbstractObjectCreator *creator, QObject *parent, int start caught = false; try { - creator->test(parent); + testFunc(parent); } catch (const std::bad_alloc &) { caught = true; } catch (const std::exception &ex) { @@ -198,6 +210,10 @@ static void doOOMTest(AbstractObjectCreator *creator, QObject *parent, int start } } + // if we get a FAIL, stop executing now + if (QTest::currentTestFailed()) + done = true; + //#define REALLY_VERBOSE #ifdef REALLY_VERBOSE fprintf(stderr, " OOM Index: %d\n", currentOOMIndex); @@ -212,6 +228,8 @@ static void doOOMTest(AbstractObjectCreator *creator, QObject *parent, int start #ifdef VERBOSE fprintf(stderr, "OOM Test done, checked allocs: %d (range %d - %d)\n", currentOOMIndex, allocCountBefore, allocFailer.currentAllocIndex()); +#else + Q_UNUSED(allocCountBefore); #endif } @@ -279,7 +297,7 @@ void tst_ExceptionSafetyObjects::initTestCase() #endif ObjectCreator *selfTest = new ObjectCreator; - doOOMTest(selfTest, 0); + doOOMTest(*selfTest, 0); delete selfTest; QCOMPARE(alloc1Failed, 1); QCOMPARE(alloc2Failed, 1); @@ -291,17 +309,17 @@ void tst_ExceptionSafetyObjects::initTestCase() void tst_ExceptionSafetyObjects::objects() { - QFETCH(AbstractObjectCreator *, objectCreator); + QFETCH(AbstractTester *, objectCreator); - doOOMTest(objectCreator, 0); + doOOMTest(*objectCreator, 0); delete objectCreator; } template -struct WidgetCreator : public AbstractObjectCreator +struct WidgetCreator : public AbstractTester { - void test(QObject *parent) + void operator()(QObject *parent) { Q_ASSERT(!parent || parent->isWidgetType()); QScopedPointer ptr(parent ? new T(static_cast(parent)) : new T); @@ -309,9 +327,9 @@ struct WidgetCreator : public AbstractObjectCreator }; // QSizeGrip doesn't have a default constructor - always pass parent (even though it might be 0) -template <> struct WidgetCreator : public AbstractObjectCreator +template <> struct WidgetCreator : public AbstractTester { - void test(QObject *parent) + void operator()(QObject *parent) { Q_ASSERT(!parent || parent->isWidgetType()); QScopedPointer ptr(new QSizeGrip(static_cast(parent))); @@ -319,9 +337,9 @@ template <> struct WidgetCreator : public AbstractObjectCreator }; // QDesktopWidget doesn't need a parent. -template <> struct WidgetCreator : public AbstractObjectCreator +template <> struct WidgetCreator : public AbstractTester { - void test(QObject *parent) + void operator()(QObject *parent) { Q_ASSERT(!parent || parent->isWidgetType()); QScopedPointer ptr(new QDesktopWidget()); @@ -329,10 +347,10 @@ template <> struct WidgetCreator : public AbstractObjectCreator }; void tst_ExceptionSafetyObjects::widgets_data() { - QTest::addColumn("widgetCreator"); + QTest::addColumn("widgetCreator"); #undef NEWROW -#define NEWROW(T) QTest::newRow(#T) << static_cast(new WidgetCreator) +#define NEWROW(T) QTest::newRow(#T) << static_cast(new WidgetCreator) NEWROW(QWidget); @@ -393,12 +411,12 @@ void tst_ExceptionSafetyObjects::widgets_data() void tst_ExceptionSafetyObjects::widgets() { - QFETCH(AbstractObjectCreator *, widgetCreator); + QFETCH(AbstractTester *, widgetCreator); - doOOMTest(widgetCreator, 0, 00000); + doOOMTest(*widgetCreator, 0, 00000); QWidget parent; - doOOMTest(widgetCreator, &parent, 00000); + doOOMTest(*widgetCreator, &parent, 00000); delete widgetCreator; @@ -406,6 +424,226 @@ void tst_ExceptionSafetyObjects::widgets() QVERIFY(true); } +struct Integer +{ + Integer(int value = 42) + : ptr(new int(value)) + { + ++instanceCount; + } + + Integer(const Integer &other) + : ptr(new int(*other.ptr)) + { + ++instanceCount; + } + + Integer &operator=(const Integer &other) + { + int *newPtr = new int(*other.ptr); + delete ptr; + ptr = newPtr; + return *this; + } + + ~Integer() + { + --instanceCount; + delete ptr; + } + + int value() const + { + return *ptr; + } + + int *ptr; + static int instanceCount; +}; + +int Integer::instanceCount = 0; + +template class Container> +void containerInsertTest(QObject*) +{ + Container container; + + // insert an item in an empty container + try { + container.insert(container.begin(), 41); + } catch (...) { + QVERIFY(container.isEmpty()); + QCOMPARE(Integer::instanceCount, 0); + return; + } + + QCOMPARE(container.size(), 1); + QCOMPARE(Integer::instanceCount, 1); + + // insert an item before another item + try { + container.insert(container.begin(), 42); + } catch (...) { + QCOMPARE(container.size(), 1); + QCOMPARE(container.first().value(), 41); + QCOMPARE(Integer::instanceCount, 1); + return; + } + + QCOMPARE(Integer::instanceCount, 2); + + // insert an item in between + try { + container.insert(container.begin() + 1, 43); + } catch (...) { + QCOMPARE(container.size(), 2); + QCOMPARE(container.first().value(), 41); + QCOMPARE((container.begin() + 1)->value(), 42); + QCOMPARE(Integer::instanceCount, 2); + return; + } + + QCOMPARE(Integer::instanceCount, 3); +} + +template class Container> +void containerAppendTest(QObject*) +{ + Container container; + + // append to an empty container + try { + container.append(42); + } catch (...) { + QCOMPARE(container.size(), 0); + QCOMPARE(Integer::instanceCount, 0); + return; + } + + // append to a container with one item + try { + container.append(43); + } catch (...) { + QCOMPARE(container.size(), 1); + QCOMPARE(container.first().value(), 42); + QCOMPARE(Integer::instanceCount, 1); + return; + } +} + +template class Container> +void containerEraseTest(QObject*) +{ + Container container; + + try { + container.append(42); + container.append(43); + container.append(44); + container.append(45); + container.append(46); + } catch (...) { + // don't care + return; + } + + // sanity checks + QCOMPARE(container.size(), 5); + QCOMPARE(Integer::instanceCount, 5); + + // delete the first one + try { + container.erase(container.begin()); + } catch (...) { + QCOMPARE(container.size(), 5); + QCOMPARE(container.first().value(), 42); + QCOMPARE(Integer::instanceCount, 5); + return; + } + + QCOMPARE(container.size(), 4); + QCOMPARE(container.first().value(), 43); + QCOMPARE(Integer::instanceCount, 4); + + // delete the last one + try { + container.erase(container.end() - 1); + } catch (...) { + QCOMPARE(container.size(), 4); + QCOMPARE(Integer::instanceCount, 4); + return; + } + + QCOMPARE(container.size(), 3); + QCOMPARE(container.first().value(), 43); + QCOMPARE((container.begin() + 1)->value(), 44); + QCOMPARE((container.begin() + 2)->value(), 45); + QCOMPARE(Integer::instanceCount, 3); + + // delete the middle one + try { + container.erase(container.begin() + 1); + } catch (...) { + QCOMPARE(container.size(), 3); + QCOMPARE(container.first().value(), 43); + QCOMPARE((container.begin() + 1)->value(), 44); + QCOMPARE((container.begin() + 2)->value(), 45); + QCOMPARE(Integer::instanceCount, 3); + return; + } + + QCOMPARE(container.size(), 2); + QCOMPARE(container.first().value(), 43); + QCOMPARE((container.begin() + 1)->value(), 45); + QCOMPARE(Integer::instanceCount, 2); +} + +template class Container> +static void containerData() +{ + QTest::addColumn("testFunction"); + + QTest::newRow("insert") << static_cast(containerInsertTest); + QTest::newRow("append") << static_cast(containerAppendTest); + QTest::newRow("erase") << static_cast(containerEraseTest); +} + +void tst_ExceptionSafetyObjects::vector_data() +{ + containerData(); +} + +void tst_ExceptionSafetyObjects::vector() +{ + QFETCH(TestFunction, testFunction); + + doOOMTest(testFunction, 0); +} + +void tst_ExceptionSafetyObjects::list_data() +{ + containerData(); +} + +void tst_ExceptionSafetyObjects::list() +{ + QFETCH(TestFunction, testFunction); + + doOOMTest(testFunction, 0); +} + +void tst_ExceptionSafetyObjects::linkedList_data() +{ + containerData(); +} + +void tst_ExceptionSafetyObjects::linkedList() +{ + QFETCH(TestFunction, testFunction); + + doOOMTest(testFunction, 0); +} + QTEST_MAIN(tst_ExceptionSafetyObjects) #include "tst_exceptionsafety_objects.moc" #endif // QT_NO_EXCEPTIONS -- cgit v0.12