summaryrefslogtreecommitdiffstats
path: root/tests/auto/other
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2012-01-16 17:52:29 +0100
committerJoão Abecasis <joao.abecasis@nokia.com>2012-01-16 17:53:41 +0100
commit5b250d497fd798c476765b22a2906e1c0ff1e432 (patch)
treefd4215ca375cc2402e536bf670c2977cf64ae2ef /tests/auto/other
parent2c52e9a5c1d6ef6cbf4577430e14027375465c96 (diff)
parent7a0099183a1c107126bda3b59a47651aac612426 (diff)
Merge remote-tracking branch 'gerrit/master' into containers
Diffstat (limited to 'tests/auto/other')
-rw-r--r--tests/auto/other/atwrapper/atWrapper.cpp2
-rw-r--r--tests/auto/other/atwrapper/atWrapper.h2
-rw-r--r--tests/auto/other/atwrapper/atWrapperAutotest.cpp2
-rw-r--r--tests/auto/other/baselineexample/tst_baselineexample.cpp2
-rw-r--r--tests/auto/other/collections/tst_collections.cpp2
-rw-r--r--tests/auto/other/compiler/baseclass.cpp2
-rw-r--r--tests/auto/other/compiler/baseclass.h2
-rw-r--r--tests/auto/other/compiler/derivedclass.cpp2
-rw-r--r--tests/auto/other/compiler/derivedclass.h2
-rw-r--r--tests/auto/other/compiler/tst_compiler.cpp2
-rw-r--r--tests/auto/other/exceptionsafety/tst_exceptionsafety.cpp2
-rw-r--r--tests/auto/other/exceptionsafety_objects/oomsimulator.h8
-rw-r--r--tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp2
-rw-r--r--tests/auto/other/gestures/tst_gestures.cpp2
-rw-r--r--tests/auto/other/headersclean/tst_headersclean.cpp2
-rw-r--r--tests/auto/other/lancelot/lancelot.pro3
-rw-r--r--tests/auto/other/lancelot/paintcommands.cpp2
-rw-r--r--tests/auto/other/lancelot/paintcommands.h2
-rw-r--r--tests/auto/other/lancelot/tst_lancelot.cpp13
-rw-r--r--tests/auto/other/languagechange/tst_languagechange.cpp84
-rw-r--r--tests/auto/other/macgui/guitest.cpp2
-rw-r--r--tests/auto/other/macgui/guitest.h2
-rw-r--r--tests/auto/other/macgui/tst_macgui.cpp2
-rw-r--r--tests/auto/other/macnativeevents/expectedeventlist.cpp2
-rw-r--r--tests/auto/other/macnativeevents/expectedeventlist.h2
-rw-r--r--tests/auto/other/macnativeevents/nativeeventlist.cpp2
-rw-r--r--tests/auto/other/macnativeevents/nativeeventlist.h2
-rw-r--r--tests/auto/other/macnativeevents/qnativeevents.cpp2
-rw-r--r--tests/auto/other/macnativeevents/qnativeevents.h2
-rw-r--r--tests/auto/other/macnativeevents/qnativeevents_mac.cpp2
-rw-r--r--tests/auto/other/macnativeevents/tst_macnativeevents.cpp2
-rw-r--r--tests/auto/other/macplist/app/main.cpp2
-rw-r--r--tests/auto/other/macplist/tst_macplist.cpp2
-rw-r--r--tests/auto/other/modeltest/modeltest.cpp2
-rw-r--r--tests/auto/other/modeltest/modeltest.h2
-rw-r--r--tests/auto/other/modeltest/tst_modeltest.cpp2
-rw-r--r--tests/auto/other/networkselftest/tst_networkselftest.cpp2
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp672
-rw-r--r--tests/auto/other/qcomplextext/bidireorderstring.h2
-rw-r--r--tests/auto/other/qcomplextext/tst_qcomplextext.cpp2
-rw-r--r--tests/auto/other/qdirectpainter/runDirectPainter/main.cpp2
-rw-r--r--tests/auto/other/qdirectpainter/tst_qdirectpainter.cpp2
-rw-r--r--tests/auto/other/qfocusevent/tst_qfocusevent.cpp22
-rw-r--r--tests/auto/other/qmultiscreen/tst_qmultiscreen.cpp2
-rw-r--r--tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp2
-rw-r--r--tests/auto/other/qobjectperformance/tst_qobjectperformance.cpp2
-rw-r--r--tests/auto/other/qobjectrace/tst_qobjectrace.cpp2
-rw-r--r--tests/auto/other/qsharedpointer_and_qwidget/tst_qsharedpointer_and_qwidget.cpp6
-rwxr-xr-xtests/auto/other/qtokenautomaton/generateTokenizers.sh2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/basic/basic.cpp2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/basic/basic.h2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/basicNamespace/basicNamespace.cpp2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/basicNamespace/basicNamespace.h2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.cpp2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.h2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.xml2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/noNamespace/noNamespace.cpp2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/noNamespace/noNamespace.h2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/noToString/noToString.cpp2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/noToString/noToString.h2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/withNamespace/withNamespace.cpp2
-rw-r--r--tests/auto/other/qtokenautomaton/tokenizers/withNamespace/withNamespace.h2
-rw-r--r--tests/auto/other/qtokenautomaton/tst_qtokenautomaton.cpp2
-rw-r--r--tests/auto/other/windowsmobile/test/ddhelper.cpp2
-rw-r--r--tests/auto/other/windowsmobile/test/ddhelper.h2
-rw-r--r--tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp2
-rw-r--r--tests/auto/other/windowsmobile/testQMenuBar/main.cpp2
67 files changed, 349 insertions, 579 deletions
diff --git a/tests/auto/other/atwrapper/atWrapper.cpp b/tests/auto/other/atwrapper/atWrapper.cpp
index 121f742201..5dc0cd599b 100644
--- a/tests/auto/other/atwrapper/atWrapper.cpp
+++ b/tests/auto/other/atwrapper/atWrapper.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/atwrapper/atWrapper.h b/tests/auto/other/atwrapper/atWrapper.h
index e325c087d8..48fe202267 100644
--- a/tests/auto/other/atwrapper/atWrapper.h
+++ b/tests/auto/other/atwrapper/atWrapper.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/atwrapper/atWrapperAutotest.cpp b/tests/auto/other/atwrapper/atWrapperAutotest.cpp
index 0c24286d6b..2ff3327349 100644
--- a/tests/auto/other/atwrapper/atWrapperAutotest.cpp
+++ b/tests/auto/other/atwrapper/atWrapperAutotest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/baselineexample/tst_baselineexample.cpp b/tests/auto/other/baselineexample/tst_baselineexample.cpp
index 73657bdf6d..7253082974 100644
--- a/tests/auto/other/baselineexample/tst_baselineexample.cpp
+++ b/tests/auto/other/baselineexample/tst_baselineexample.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/collections/tst_collections.cpp b/tests/auto/other/collections/tst_collections.cpp
index 3f96aa94d5..3c55897b46 100644
--- a/tests/auto/other/collections/tst_collections.cpp
+++ b/tests/auto/other/collections/tst_collections.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/compiler/baseclass.cpp b/tests/auto/other/compiler/baseclass.cpp
index 22ccba8f78..5eea58d1dc 100644
--- a/tests/auto/other/compiler/baseclass.cpp
+++ b/tests/auto/other/compiler/baseclass.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/compiler/baseclass.h b/tests/auto/other/compiler/baseclass.h
index e510112f2f..1cfa1079a4 100644
--- a/tests/auto/other/compiler/baseclass.h
+++ b/tests/auto/other/compiler/baseclass.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/compiler/derivedclass.cpp b/tests/auto/other/compiler/derivedclass.cpp
index 45ef6df3ee..e43e2f9b5b 100644
--- a/tests/auto/other/compiler/derivedclass.cpp
+++ b/tests/auto/other/compiler/derivedclass.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/compiler/derivedclass.h b/tests/auto/other/compiler/derivedclass.h
index c5fb61f46e..47227a95b5 100644
--- a/tests/auto/other/compiler/derivedclass.h
+++ b/tests/auto/other/compiler/derivedclass.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/compiler/tst_compiler.cpp b/tests/auto/other/compiler/tst_compiler.cpp
index b6fb391fb1..db57af63bb 100644
--- a/tests/auto/other/compiler/tst_compiler.cpp
+++ b/tests/auto/other/compiler/tst_compiler.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/exceptionsafety/tst_exceptionsafety.cpp b/tests/auto/other/exceptionsafety/tst_exceptionsafety.cpp
index ba384e0290..309f6b7d78 100644
--- a/tests/auto/other/exceptionsafety/tst_exceptionsafety.cpp
+++ b/tests/auto/other/exceptionsafety/tst_exceptionsafety.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/exceptionsafety_objects/oomsimulator.h b/tests/auto/other/exceptionsafety_objects/oomsimulator.h
index 15500f590b..0727723d47 100644
--- a/tests/auto/other/exceptionsafety_objects/oomsimulator.h
+++ b/tests/auto/other/exceptionsafety_objects/oomsimulator.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -173,17 +173,17 @@ static int qCrtAllocHook(int allocType, void * /*userData*/, size_t /*size*/,
const unsigned char * /*filename*/, int /*lineNumber*/)
{
if (blockType == _CRT_BLOCK)
- return TRUE; // ignore allocations from the C library
+ return true; // ignore allocations from the C library
switch (allocType) {
case _HOOK_ALLOC:
case _HOOK_REALLOC:
++mallocCount;
if (mallocFailActive && --mallocFailIndex < 0)
- return FALSE; // simulate OOM
+ return false; // simulate OOM
}
- return TRUE;
+ return true;
}
static struct QCrtDebugRegistrator
diff --git a/tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp b/tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp
index 304f834cac..7e569fe7f7 100644
--- a/tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp
+++ b/tests/auto/other/exceptionsafety_objects/tst_exceptionsafety_objects.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/gestures/tst_gestures.cpp b/tests/auto/other/gestures/tst_gestures.cpp
index 1a71f9170a..daa1893807 100644
--- a/tests/auto/other/gestures/tst_gestures.cpp
+++ b/tests/auto/other/gestures/tst_gestures.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/headersclean/tst_headersclean.cpp b/tests/auto/other/headersclean/tst_headersclean.cpp
index 4cc11caf71..807f97af69 100644
--- a/tests/auto/other/headersclean/tst_headersclean.cpp
+++ b/tests/auto/other/headersclean/tst_headersclean.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/lancelot/lancelot.pro b/tests/auto/other/lancelot/lancelot.pro
index bbb48c745e..ced8aceb99 100644
--- a/tests/auto/other/lancelot/lancelot.pro
+++ b/tests/auto/other/lancelot/lancelot.pro
@@ -10,7 +10,6 @@ RESOURCES += images.qrc
include($$PWD/../../../baselineserver/shared/qbaselinetest.pri)
-!wince*:DEFINES += SRCDIR=\\\"$$PWD\\\"
-linux-g++-maemo:DEFINES += USE_RUNTIME_DIR
+TESTDATA += scripts/*
CONFIG += insignificant_test # QTBUG-21402
diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp
index dc23575fc5..08c6918eb6 100644
--- a/tests/auto/other/lancelot/paintcommands.cpp
+++ b/tests/auto/other/lancelot/paintcommands.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/lancelot/paintcommands.h b/tests/auto/other/lancelot/paintcommands.h
index 925a867f2f..b22ab58b32 100644
--- a/tests/auto/other/lancelot/paintcommands.h
+++ b/tests/auto/other/lancelot/paintcommands.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/lancelot/tst_lancelot.cpp b/tests/auto/other/lancelot/tst_lancelot.cpp
index cbbd28dc82..50688ffa17 100644
--- a/tests/auto/other/lancelot/tst_lancelot.cpp
+++ b/tests/auto/other/lancelot/tst_lancelot.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -50,10 +50,6 @@
#include <QtOpenGL>
#endif
-#ifndef SRCDIR
-#define SRCDIR "."
-#endif
-
class tst_Lancelot : public QObject
{
Q_OBJECT
@@ -114,11 +110,8 @@ void tst_Lancelot::initTestCase()
if (!proto.connect(QLatin1String("tst_Lancelot"), &dryRunMode, clientInfo))
QSKIP(qPrintable(proto.errorMessage()));
-#if defined(USE_RUNTIME_DIR)
- scriptsDir = QCoreApplication::applicationDirPath() + "/scripts/";
-#else
- scriptsDir = SRCDIR "/scripts/";
-#endif
+ QString baseDir = QFINDTESTDATA("scripts/text.qps");
+ scriptsDir = baseDir.left(baseDir.lastIndexOf('/')) + '/';
QDir qpsDir(scriptsDir);
QStringList files = qpsDir.entryList(QStringList() << QLatin1String("*.qps"), QDir::Files | QDir::Readable);
if (files.isEmpty()) {
diff --git a/tests/auto/other/languagechange/tst_languagechange.cpp b/tests/auto/other/languagechange/tst_languagechange.cpp
index 3b77b13275..12b35795fe 100644
--- a/tests/auto/other/languagechange/tst_languagechange.cpp
+++ b/tests/auto/other/languagechange/tst_languagechange.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -46,6 +46,7 @@
#include <QtCore/QSet>
#include <QtCore/QFile>
#include <QtCore/QTranslator>
+#include <QtCore/QTemporaryDir>
#include <private/qthread_p.h>
#include <QtWidgets/QInputDialog>
#include <QtWidgets/QColorDialog>
@@ -116,16 +117,53 @@ public:
virtual bool isEmpty() const { return false; }
-public slots:
- void install() {
- QCoreApplication::installTranslator(this);
- QTest::qWait(2500);
- QApplication::closeAllWindows();
- }
public:
mutable QSet<QByteArray> m_translations;
};
+// Install the translator and close all application windows after a while to
+// quit the event loop.
+class LanguageTestStateMachine : public QObject
+{
+ Q_OBJECT
+public:
+ LanguageTestStateMachine(QTranslator *translator);
+ void start() { m_timer.start(); }
+
+private slots:
+ void timeout();
+
+private:
+ enum State { InstallTranslator, CloseDialog };
+
+ QTimer m_timer;
+ QTranslator *m_translator;
+ State m_state;
+};
+
+LanguageTestStateMachine::LanguageTestStateMachine(QTranslator *translator) :
+ m_translator(translator), m_state(InstallTranslator)
+{
+ m_timer.setInterval(500);
+ connect(&m_timer, SIGNAL(timeout()), this, SLOT(timeout()));
+}
+
+void LanguageTestStateMachine::timeout()
+{
+ switch (m_state) {
+ case InstallTranslator:
+ m_timer.stop();
+ QCoreApplication::installTranslator(m_translator);
+ m_timer.setInterval(2500);
+ m_timer.start();
+ m_state = CloseDialog;
+ break;
+ case CloseDialog: // Close repeatedly in case file dialog is slow.
+ QApplication::closeAllWindows();
+ break;
+ }
+}
+
enum DialogType {
InputDialog = 1,
ColorDialog,
@@ -208,17 +246,20 @@ void tst_languageChange::retranslatability()
"get proper widget layout.");
TransformTranslator translator;
- QTimer::singleShot(500, &translator, SLOT(install()));
+ LanguageTestStateMachine stateMachine(&translator);
+
switch (dialogType) {
case InputDialog:
- (void)QInputDialog::getInteger(0, QLatin1String("title"), QLatin1String("label"));
+ stateMachine.start();
+ QInputDialog::getInteger(0, QLatin1String("title"), QLatin1String("label"));
break;
case ColorDialog:
#ifdef Q_OS_MAC
QSKIP("The native color dialog is used on Mac OS");
#else
- (void)QColorDialog::getColor();
+ stateMachine.start();
+ QColorDialog::getColor();
#endif
break;
case FileDialog: {
@@ -227,29 +268,30 @@ void tst_languageChange::retranslatability()
#endif
QFileDialog dlg;
dlg.setOption(QFileDialog::DontUseNativeDialog);
- QString tmpParentDir = QDir::tempPath();
- if (!tmpParentDir.endsWith(QLatin1Char('/')))
- tmpParentDir += QLatin1Char('/');
- tmpParentDir += QStringLiteral("languagechangetestdir");
- const QString tmpDir = tmpParentDir + QStringLiteral("/finaldir");
- const QString fooName = tmpParentDir + QStringLiteral("/foo");
+ QString tempDirPattern = QDir::tempPath();
+ if (!tempDirPattern.endsWith(QLatin1Char('/')))
+ tempDirPattern += QLatin1Char('/');
+ tempDirPattern += QStringLiteral("languagechangetestdirXXXXXX");
+ QTemporaryDir temporaryDir(tempDirPattern);
+ temporaryDir.setAutoRemove(true);
+ QVERIFY(temporaryDir.isValid());
+ const QString finalDir = temporaryDir.path() + QStringLiteral("/finaldir");
+ const QString fooName = temporaryDir.path() + QStringLiteral("/foo");
QDir dir;
- QCOMPARE(dir.mkpath(tmpDir), true);
+ QVERIFY(dir.mkpath(finalDir));
QFile fooFile(fooName);
QVERIFY(fooFile.open(QIODevice::WriteOnly|QIODevice::Text));
fooFile.write("test");
fooFile.close();
- dlg.setDirectory(tmpParentDir);
+ dlg.setDirectory(temporaryDir.path());
#ifdef Q_OS_WINCE
dlg.setDirectory("\\Windows");
#endif
dlg.setFileMode(QFileDialog::ExistingFiles);
dlg.setViewMode(QFileDialog::Detail);
+ stateMachine.start();
dlg.exec();
QTest::qWait(3000);
- QCOMPARE(QFile::remove(fooName), true);
- QCOMPARE(dir.rmdir(tmpDir), true);
- QCOMPARE(dir.rmdir(tmpParentDir), true);
break; }
}
diff --git a/tests/auto/other/macgui/guitest.cpp b/tests/auto/other/macgui/guitest.cpp
index e5245528cb..6ab5a64a97 100644
--- a/tests/auto/other/macgui/guitest.cpp
+++ b/tests/auto/other/macgui/guitest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macgui/guitest.h b/tests/auto/other/macgui/guitest.h
index 170fc5c19c..39a63b0443 100644
--- a/tests/auto/other/macgui/guitest.h
+++ b/tests/auto/other/macgui/guitest.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macgui/tst_macgui.cpp b/tests/auto/other/macgui/tst_macgui.cpp
index 9ff2897aa8..8f66d54a2c 100644
--- a/tests/auto/other/macgui/tst_macgui.cpp
+++ b/tests/auto/other/macgui/tst_macgui.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macnativeevents/expectedeventlist.cpp b/tests/auto/other/macnativeevents/expectedeventlist.cpp
index d603f82f27..9067a38ec6 100644
--- a/tests/auto/other/macnativeevents/expectedeventlist.cpp
+++ b/tests/auto/other/macnativeevents/expectedeventlist.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macnativeevents/expectedeventlist.h b/tests/auto/other/macnativeevents/expectedeventlist.h
index e3fef2d56d..fb4c18d493 100644
--- a/tests/auto/other/macnativeevents/expectedeventlist.h
+++ b/tests/auto/other/macnativeevents/expectedeventlist.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macnativeevents/nativeeventlist.cpp b/tests/auto/other/macnativeevents/nativeeventlist.cpp
index 8c7f609d9f..781c3f5374 100644
--- a/tests/auto/other/macnativeevents/nativeeventlist.cpp
+++ b/tests/auto/other/macnativeevents/nativeeventlist.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macnativeevents/nativeeventlist.h b/tests/auto/other/macnativeevents/nativeeventlist.h
index 6bebca1613..f6493e56da 100644
--- a/tests/auto/other/macnativeevents/nativeeventlist.h
+++ b/tests/auto/other/macnativeevents/nativeeventlist.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macnativeevents/qnativeevents.cpp b/tests/auto/other/macnativeevents/qnativeevents.cpp
index b530d7bbe3..79667adcd0 100644
--- a/tests/auto/other/macnativeevents/qnativeevents.cpp
+++ b/tests/auto/other/macnativeevents/qnativeevents.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macnativeevents/qnativeevents.h b/tests/auto/other/macnativeevents/qnativeevents.h
index d303a55397..3a3e4f1590 100644
--- a/tests/auto/other/macnativeevents/qnativeevents.h
+++ b/tests/auto/other/macnativeevents/qnativeevents.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macnativeevents/qnativeevents_mac.cpp b/tests/auto/other/macnativeevents/qnativeevents_mac.cpp
index 8987a8d502..35028f9cf7 100644
--- a/tests/auto/other/macnativeevents/qnativeevents_mac.cpp
+++ b/tests/auto/other/macnativeevents/qnativeevents_mac.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macnativeevents/tst_macnativeevents.cpp b/tests/auto/other/macnativeevents/tst_macnativeevents.cpp
index ea30b0b5c2..c5131e19fc 100644
--- a/tests/auto/other/macnativeevents/tst_macnativeevents.cpp
+++ b/tests/auto/other/macnativeevents/tst_macnativeevents.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macplist/app/main.cpp b/tests/auto/other/macplist/app/main.cpp
index 90bf60ae38..c28c372f08 100644
--- a/tests/auto/other/macplist/app/main.cpp
+++ b/tests/auto/other/macplist/app/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/macplist/tst_macplist.cpp b/tests/auto/other/macplist/tst_macplist.cpp
index 5b48c586b5..f2b47c1d99 100644
--- a/tests/auto/other/macplist/tst_macplist.cpp
+++ b/tests/auto/other/macplist/tst_macplist.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/modeltest/modeltest.cpp b/tests/auto/other/modeltest/modeltest.cpp
index 76803dfbe5..118b4a8e1f 100644
--- a/tests/auto/other/modeltest/modeltest.cpp
+++ b/tests/auto/other/modeltest/modeltest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/modeltest/modeltest.h b/tests/auto/other/modeltest/modeltest.h
index e4ef478c5e..f70aebabde 100644
--- a/tests/auto/other/modeltest/modeltest.h
+++ b/tests/auto/other/modeltest/modeltest.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/modeltest/tst_modeltest.cpp b/tests/auto/other/modeltest/tst_modeltest.cpp
index e5c227d167..fa9b98acb6 100644
--- a/tests/auto/other/modeltest/tst_modeltest.cpp
+++ b/tests/auto/other/modeltest/tst_modeltest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/networkselftest/tst_networkselftest.cpp b/tests/auto/other/networkselftest/tst_networkselftest.cpp
index c768a29bf8..3129fd965d 100644
--- a/tests/auto/other/networkselftest/tst_networkselftest.cpp
+++ b/tests/auto/other/networkselftest/tst_networkselftest.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index 2a838c0e3d..90ab5b4c67 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -66,6 +66,8 @@ inline bool IsValidCEPlatform() {
}
#endif
+typedef QSharedPointer<QAccessibleInterface> QAIPtr;
+
static inline bool verifyChild(QWidget *child, QAccessibleInterface *interface,
int index, const QRect &domain)
{
@@ -89,7 +91,6 @@ static inline bool verifyChild(QWidget *child, QAccessibleInterface *interface,
// QAccessibleInterface::indexOfChild():
// Verify that indexOfChild() returns an index equal to the index passed in
int indexFromIndexOfChild = interface->indexOfChild(childInterface);
- delete childInterface;
if (indexFromIndexOfChild != index) {
qWarning("tst_QAccessibility::verifyChild (indexOfChild()):");
qWarning() << "Expected:" << index;
@@ -98,7 +99,7 @@ static inline bool verifyChild(QWidget *child, QAccessibleInterface *interface,
}
// Navigate to child, compare its object and role with the interface from queryAccessibleInterface(child).
- QAccessibleInterface *navigatedChildInterface = interface->child(index - 1);
+ QAccessibleInterface *navigatedChildInterface = interface->child(index);
if (navigatedChildInterface == 0)
return false;
@@ -109,13 +110,21 @@ static inline bool verifyChild(QWidget *child, QAccessibleInterface *interface,
// Calculate global child position and check that the interface
// returns the correct index for that position.
QPoint globalChildPos = child->mapToGlobal(QPoint(0, 0));
- int indexFromChildAt = interface->childAt(globalChildPos.x(), globalChildPos.y());
- if (indexFromChildAt != index) {
+ QAccessibleInterface *childAtInterface = interface->childAt(globalChildPos.x(), globalChildPos.y());
+ if (!childAtInterface) {
qWarning("tst_QAccessibility::verifyChild (childAt()):");
- qWarning() << "Expected:" << index;
- qWarning() << "Actual: " << indexFromChildAt;
+ qWarning() << "Expected:" << childInterface;
+ qWarning() << "Actual: no child";
return false;
}
+ if (childAtInterface->object() != childInterface->object()) {
+ qWarning("tst_QAccessibility::verifyChild (childAt()):");
+ qWarning() << "Expected:" << childInterface;
+ qWarning() << "Actual: " << childAtInterface;
+ return false;
+ }
+ delete childInterface;
+ delete childAtInterface;
// QAccessibleInterface::rect():
// Calculate global child geometry and check that the interface
@@ -221,7 +230,7 @@ private slots:
void customWidget();
void deletedWidget();
- void navigateGeometric();
+ void statesStructTest();
void navigateHierarchy();
void sliderTest();
void navigateCovered();
@@ -321,7 +330,7 @@ QAccessible::State state(QWidget * const widget)
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(widget);
if (!iface)
qWarning() << "Cannot get QAccessibleInterface for widget";
- QAccessible::State state = (iface ? iface->state() : static_cast<QAccessible::State>(0));
+ QAccessible::State state = (iface ? iface->state() : QAccessible::State());
delete iface;
return state;
}
@@ -454,100 +463,24 @@ void tst_QAccessibility::deletedWidget()
delete iface;
}
-void tst_QAccessibility::navigateGeometric()
+void tst_QAccessibility::statesStructTest()
{
- {
- static const int skip = 20; //speed the test up significantly
- static const double step = Q_PI / 180;
- QWidget *w = new QWidget(0);
- w->setObjectName(QString("Josef"));
- w->setFixedSize(400, 400);
-
- // center widget
- QtTestAccessibleWidget *center = new QtTestAccessibleWidget(w, "Sol");
- center->move(200, 200);
-
- // arrange 360 widgets around it in a circle
- QtTestAccessibleWidget *aw = 0;
- for (int i = 0; i < 360; i += skip) {
- aw = new QtTestAccessibleWidget(w, QString::number(i).toLatin1());
- aw->move( int(200.0 + 100.0 * sin(step * (double)i)), int(200.0 + 100.0 * cos(step * (double)i)) );
- }
-
- aw = new QtTestAccessibleWidget(w, "Earth");
- QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(center);
- QAccessibleInterface *target = 0;
- QVERIFY(iface != 0);
- QVERIFY(iface->isValid());
-
- w->show();
- QCoreApplication::processEvents();
- QTest::qWait(100);
-
- // let one widget rotate around center
- for (int i = 0; i < 360; i+=skip) {
- aw->move( int(200.0 + 75.0 * sin(step * (double)i)), int(200.0 + 75.0 * cos(step * (double)i)) );
-
- if (i < 45 || i > 315) {
- QCOMPARE(iface->navigate(QAccessible::Down, 0, &target), 0);
- } else if ( i < 135 ) {
- QCOMPARE(iface->navigate(QAccessible::Right, 0, &target), 0);
- } else if ( i < 225 ) {
- QCOMPARE(iface->navigate(QAccessible::Up, 0, &target), 0);
- } else {
- QCOMPARE(iface->navigate(QAccessible::Left, 0, &target), 0);
- }
-
- QVERIFY(target);
- QVERIFY(target->isValid());
- QVERIFY(target->object());
- QCOMPARE(target->object()->objectName(), aw->objectName());
- delete target; target = 0;
- }
-
- // test invisible widget
- target = QAccessible::queryAccessibleInterface(aw);
- QVERIFY(!(target->state() & QAccessible::Invisible));
- aw->hide();
- QVERIFY(target->state() & QAccessible::Invisible);
- delete target; target = 0;
-
- aw->move(center->x() + 10, center->y());
- QCOMPARE(iface->navigate(QAccessible::Right, 0, &target), 0);
- QVERIFY(target);
- QVERIFY(target->isValid());
- QVERIFY(target->object());
- QVERIFY(QString(target->object()->objectName()) != "Earth");
- delete target; target = 0;
-
- aw->move(center->x() - 10, center->y());
- QCOMPARE(iface->navigate(QAccessible::Left, 0, &target), 0);
- QVERIFY(target);
- QVERIFY(target->isValid());
- QVERIFY(target->object());
- QVERIFY(QString(target->object()->objectName()) != "Earth");
- delete target; target = 0;
-
- aw->move(center->x(), center->y() + 10);
- QCOMPARE(iface->navigate(QAccessible::Down, 0, &target), 0);
- QVERIFY(target);
- QVERIFY(target->isValid());
- QVERIFY(target->object());
- QVERIFY(QString(target->object()->objectName()) != "Earth");
- delete target; target = 0;
-
- aw->move(center->x(), center->y() - 10);
- QCOMPARE(iface->navigate(QAccessible::Up, 0, &target), 0);
- QVERIFY(target);
- QVERIFY(target->isValid());
- QVERIFY(target->object());
- QVERIFY(QString(target->object()->objectName()) != "Earth");
- delete target; target = 0;
-
- delete iface;
- delete w;
- }
- QTestAccessibility::clearEvents();
+ QAccessible::State s1;
+ QVERIFY(s1.disabled == 0);
+ QVERIFY(s1.focusable == 0);
+ QVERIFY(s1.modal == 0);
+
+ QAccessible::State s2;
+ QVERIFY(s2 == s1);
+ s2.busy = true;
+ QVERIFY(!(s2 == s1));
+ s1.busy = true;
+ QVERIFY(s2 == s1);
+ s1 = QAccessible::State();
+ QVERIFY(!(s2 == s1));
+ s1 = s2;
+ QVERIFY(s2 == s1);
+ QVERIFY(s1.busy == 1);
}
void tst_QAccessibility::sliderTest()
@@ -671,9 +604,9 @@ void tst_QAccessibility::navigateCovered()
w1->raise();
QVERIFY(iface1->relationTo(iface2) & QAccessible::Covers);
QVERIFY(iface2->relationTo(iface1) & QAccessible::Covered);
- QVERIFY(!(iface1->state() & QAccessible::Invisible));
+ QVERIFY(!iface1->state().invisible);
w1->hide();
- QVERIFY(iface1->state() & QAccessible::Invisible);
+ QVERIFY(iface1->state().invisible);
QVERIFY(!(iface1->relationTo(iface2) & QAccessible::Covers));
QVERIFY(!(iface2->relationTo(iface1) & QAccessible::Covered));
QCOMPARE(iface2->navigate(QAccessible::Covered, 1, &iface3), -1);
@@ -712,11 +645,6 @@ void tst_QAccessibility::navigateHierarchy()
QVERIFY(iface != 0);
QVERIFY(iface->isValid());
- QCOMPARE(iface->navigate(QAccessible::Sibling, -42, &target), -1);
- QVERIFY(target == 0);
- QCOMPARE(iface->navigate(QAccessible::Sibling, 42, &target), -1);
- QVERIFY(target == 0);
-
target = iface->child(14);
QVERIFY(target == 0);
target = iface->child(-1);
@@ -732,38 +660,27 @@ void tst_QAccessibility::navigateHierarchy()
delete interfaceW1;
delete iface; iface = 0;
- QCOMPARE(target->navigate(QAccessible::Sibling, 0, &iface), -1);
- QVERIFY(iface == 0);
- QCOMPARE(target->navigate(QAccessible::Sibling, 42, &iface), -1);
- QVERIFY(iface == 0);
- QCOMPARE(target->navigate(QAccessible::Sibling, -42, &iface), -1);
- QVERIFY(iface == 0);
- QCOMPARE(target->navigate(QAccessible::Sibling, 2, &iface), 0);
- QVERIFY(iface != 0);
- QVERIFY(iface->isValid());
- QCOMPARE(iface->object(), (QObject*)w2);
- delete target; target = 0;
- QCOMPARE(iface->navigate(QAccessible::Sibling, 3, &target), 0);
+ iface = QAccessible::queryAccessibleInterface(w);
+ target = iface->child(2);
QVERIFY(target != 0);
QVERIFY(target->isValid());
QCOMPARE(target->object(), (QObject*)w3);
delete iface; iface = 0;
+
+ iface = target->child(1);
+ QCOMPARE(iface, (QAccessibleInterface*)0);
iface = target->child(0);
QVERIFY(iface != 0);
QVERIFY(iface->isValid());
QCOMPARE(iface->object(), (QObject*)w31);
- delete target; target = 0;
- QCOMPARE(iface->navigate(QAccessible::Sibling, -1, &target), -1);
- QVERIFY(target == 0);
- QCOMPARE(iface->navigate(QAccessible::Sibling, 0, &target), -1);
- QVERIFY(target == 0);
- QCOMPARE(iface->navigate(QAccessible::Sibling, 1, &target), 0);
- QVERIFY(target != 0);
- QVERIFY(target->isValid());
+ iface = QAccessible::queryAccessibleInterface(w);
+ QAccessibleInterface *acc3 = iface->child(2);
+ target = acc3->child(0);
+ delete acc3;
+ delete iface;
QCOMPARE(target->object(), (QObject*)w31);
- delete iface; iface = 0;
iface = target->parent();
QVERIFY(iface != 0);
@@ -913,23 +830,23 @@ void tst_QAccessibility::hideShowTest()
QWidget * const window = new QWidget();
QWidget * const child = new QWidget(window);
- QVERIFY(state(window) & QAccessible::Invisible);
- QVERIFY(state(child) & QAccessible::Invisible);
+ QVERIFY(state(window).invisible);
+ QVERIFY(state(child).invisible);
QTestAccessibility::clearEvents();
// show() and veryfy that both window and child are not invisible and get ObjectShow events.
window->show();
- QVERIFY(state(window) ^ QAccessible::Invisible);
- QVERIFY(state(child) ^ QAccessible::Invisible);
+ QVERIFY(!state(window).invisible);
+ QVERIFY(!state(child).invisible);
QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(window, 0, QAccessible::ObjectShow)));
QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(child, 0, QAccessible::ObjectShow)));
QTestAccessibility::clearEvents();
// hide() and veryfy that both window and child are invisible and get ObjectHide events.
window->hide();
- QVERIFY(state(window) & QAccessible::Invisible);
- QVERIFY(state(child) & QAccessible::Invisible);
+ QVERIFY(state(window).invisible);
+ QVERIFY(state(child).invisible);
QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(window, 0, QAccessible::ObjectHide)));
QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(child, 0, QAccessible::ObjectHide)));
QTestAccessibility::clearEvents();
@@ -1053,7 +970,7 @@ void tst_QAccessibility::buttonTest()
// tristate checkbox
QCheckBox tristate("Tristate!", &window);
- tristate.setTristate(TRUE);
+ tristate.setTristate(true);
// radiobutton
QRadioButton radio("Radio me!", &window);
@@ -1091,12 +1008,12 @@ void tst_QAccessibility::buttonTest()
QCOMPARE(actionInterface->actionNames(), QStringList() << QAccessibleActionInterface::checkAction() << QAccessibleActionInterface::setFocusAction());
QCOMPARE(actionInterface->localizedActionDescription(QAccessibleActionInterface::checkAction()), QString("Checks the checkbox"));
QVERIFY(!toggleButton.isChecked());
- QVERIFY((interface->state() & QAccessible::Checked) == 0);
+ QVERIFY(!interface->state().checked);
actionInterface->doAction(QAccessibleActionInterface::checkAction());
QTest::qWait(500);
QVERIFY(toggleButton.isChecked());
QCOMPARE(actionInterface->actionNames().at(0), QAccessibleActionInterface::uncheckAction());
- QVERIFY(interface->state() & QAccessible::Checked);
+ QVERIFY(interface->state().checked);
delete interface;
{
@@ -1110,7 +1027,7 @@ void tst_QAccessibility::buttonTest()
menuButton.show();
QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(&menuButton);
QCOMPARE(interface->role(), QAccessible::ButtonMenu);
- QVERIFY(interface->state() & QAccessible::HasPopup);
+ QVERIFY(interface->state().hasPopup);
QCOMPARE(interface->actionInterface()->actionNames(), QStringList() << QAccessibleActionInterface::showMenuAction() << QAccessibleActionInterface::setFocusAction());
// showing the menu enters a new event loop...
// interface->actionInterface()->doAction(QAccessibleActionInterface::showMenuAction());
@@ -1124,11 +1041,11 @@ void tst_QAccessibility::buttonTest()
actionInterface = interface->actionInterface();
QCOMPARE(interface->role(), QAccessible::CheckBox);
QCOMPARE(actionInterface->actionNames(), QStringList() << QAccessibleActionInterface::checkAction() << QAccessibleActionInterface::setFocusAction());
- QVERIFY((interface->state() & QAccessible::Checked) == 0);
+ QVERIFY(!interface->state().checked);
actionInterface->doAction(QAccessibleActionInterface::checkAction());
QTest::qWait(500);
QCOMPARE(actionInterface->actionNames(), QStringList() << QAccessibleActionInterface::uncheckAction() << QAccessibleActionInterface::setFocusAction());
- QVERIFY(interface->state() & QAccessible::Checked);
+ QVERIFY(interface->state().checked);
QVERIFY(checkBox.isChecked());
delete interface;
@@ -1137,11 +1054,11 @@ void tst_QAccessibility::buttonTest()
actionInterface = interface->actionInterface();
QCOMPARE(interface->role(), QAccessible::RadioButton);
QCOMPARE(actionInterface->actionNames(), QStringList() << QAccessibleActionInterface::checkAction() << QAccessibleActionInterface::setFocusAction());
- QVERIFY((interface->state() & QAccessible::Checked) == 0);
+ QVERIFY(!interface->state().checked);
actionInterface->doAction(QAccessibleActionInterface::checkAction());
QTest::qWait(500);
QCOMPARE(actionInterface->actionNames(), QStringList() << QAccessibleActionInterface::checkAction() << QAccessibleActionInterface::setFocusAction());
- QVERIFY(interface->state() & QAccessible::Checked);
+ QVERIFY(interface->state().checked);
QVERIFY(checkBox.isChecked());
delete interface;
@@ -1202,15 +1119,15 @@ void tst_QAccessibility::scrollBarTest()
QScrollBar *scrollBar = new QScrollBar(Qt::Horizontal);
QAccessibleInterface * const scrollBarInterface = QAccessible::queryAccessibleInterface(scrollBar);
QVERIFY(scrollBarInterface);
- QVERIFY(scrollBarInterface->state() & QAccessible::Invisible);
+ QVERIFY(scrollBarInterface->state().invisible);
scrollBar->resize(200, 50);
scrollBar->show();
- QVERIFY(scrollBarInterface->state() ^ QAccessible::Invisible);
+ QVERIFY(!scrollBarInterface->state().invisible);
QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(scrollBar, 0, QAccessible::ObjectShow)));
QTestAccessibility::clearEvents();
scrollBar->hide();
- QVERIFY(scrollBarInterface->state() & QAccessible::Invisible);
+ QVERIFY(scrollBarInterface->state().invisible);
QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(scrollBar, 0, QAccessible::ObjectHide)));
QTestAccessibility::clearEvents();
@@ -1254,7 +1171,7 @@ void tst_QAccessibility::tabTest()
// and cleared correctly.
QAccessibleInterface *leftButton = interface->child(0);
QCOMPARE(leftButton->role(), QAccessible::PushButton);
- QVERIFY(leftButton->state() & QAccessible::Invisible);
+ QVERIFY(leftButton->state().invisible);
delete leftButton;
const int lots = 5;
@@ -1268,13 +1185,13 @@ void tst_QAccessibility::tabTest()
QVERIFY(child2);
QCOMPARE(child2->role(), QAccessible::PageTab);
- QVERIFY((child1->state() & QAccessible::Invisible) == false);
+ QVERIFY((child1->state().invisible) == false);
tabBar->hide();
QCoreApplication::processEvents();
QTest::qWait(100);
- QVERIFY(child1->state() & QAccessible::Invisible);
+ QVERIFY(child1->state().invisible);
tabBar->show();
tabBar->setCurrentIndex(0);
@@ -1533,7 +1450,6 @@ void tst_QAccessibility::menuTest()
QAccessibleInterface *iface2 = 0;
// traverse siblings with navigate(Sibling, ...)
- int entry;
iface = interface->child(0);
QVERIFY(iface);
QCOMPARE(iface->role(), QAccessible::MenuItem);
@@ -1546,44 +1462,13 @@ void tst_QAccessibility::menuTest()
QAccessible::MenuItem
};
for (int child = 0; child < 5; ++child) {
- entry = iface->navigate(QAccessible::Sibling, child + 1, &iface2);
- QCOMPARE(entry, 0);
+ iface2 = interface->child(child);
QVERIFY(iface2);
QCOMPARE(iface2->role(), fileRoles[child]);
delete iface2;
}
delete iface;
- // traverse menu items with navigate(Down, ...)
- iface = interface->child(0);
- QVERIFY(iface);
- QCOMPARE(iface->role(), QAccessible::MenuItem);
-
- for (int child = 0; child < 4; ++child) {
- entry = iface->navigate(QAccessible::Down, 1, &iface2);
- delete iface;
- iface = iface2;
- QCOMPARE(entry, 0);
- QVERIFY(iface);
- QCOMPARE(iface->role(), fileRoles[child + 1]);
- }
- delete iface;
-
- // traverse menu items with navigate(Up, ...)
- iface = interface->child(interface->childCount() - 1);
- QVERIFY(iface);
- QCOMPARE(iface->role(), QAccessible::MenuItem);
-
- for (int child = 3; child >= 0; --child) {
- entry = iface->navigate(QAccessible::Up, 1, &iface2);
- delete iface;
- iface = iface2;
- QCOMPARE(entry, 0);
- QVERIFY(iface);
- QCOMPARE(iface->role(), fileRoles[child]);
- }
- delete iface;
-
// "New" item
iface = interface->child(0);
QVERIFY(iface);
@@ -1593,7 +1478,6 @@ void tst_QAccessibility::menuTest()
iface2 = iface->child(0);
delete iface;
iface = iface2;
- QCOMPARE(entry, 0);
QVERIFY(iface);
QCOMPARE(iface->role(), QAccessible::PopupMenu);
@@ -1785,37 +1669,6 @@ void tst_QAccessibility::mdiAreaTest()
QVERIFY(interface);
QCOMPARE(interface->childCount(), subWindowCount);
- // Right, right, right, ...
- for (int i = 0; i < subWindowCount; ++i) {
- QAccessibleInterface *destination = 0;
- int index = interface->navigate(QAccessible::Right, i + 1, &destination);
- if (i == subWindowCount - 1) {
- QVERIFY(!destination);
- QCOMPARE(index, -1);
- } else {
- QVERIFY(destination);
- QCOMPARE(index, 0);
- QCOMPARE(destination->object(), (QObject*)subWindows.at(i + 1));
- delete destination;
- }
- }
-
- // Left, left, left, ...
- for (int i = subWindowCount; i > 0; --i) {
- QAccessibleInterface *destination = 0;
- int index = interface->navigate(QAccessible::Left, i, &destination);
- if (i == 1) {
- QVERIFY(!destination);
- QCOMPARE(index, -1);
- } else {
- QVERIFY(destination);
- QCOMPARE(index, 0);
- QCOMPARE(destination->object(), (QObject*)subWindows.at(i - 2));
- delete destination;
- }
- }
- // ### Add test for Up and Down.
-
}
QTestAccessibility::clearEvents();
}
@@ -1831,7 +1684,6 @@ void tst_QAccessibility::mdiSubWindowTest()
QTest::qWait(150);
#endif
- bool isSubWindowsPlacedNextToEachOther = false;
const int subWindowCount = 5;
for (int i = 0; i < subWindowCount; ++i) {
QMdiSubWindow *window = mdiArea.addSubWindow(new QPushButton("QAccessibilityTest"));
@@ -1846,8 +1698,6 @@ void tst_QAccessibility::mdiSubWindowTest()
QCoreApplication::processEvents();
QTest::qWait(100);
#endif
- if (mdiArea.width() >= minimumWidth)
- isSubWindowsPlacedNextToEachOther = true;
}
}
@@ -1872,47 +1722,34 @@ void tst_QAccessibility::mdiSubWindowTest()
mdiArea.setActiveSubWindow(testWindow);
// state
- QAccessible::State state = QAccessible::Normal | QAccessible::Focusable | QAccessible::Focused
- | QAccessible::Movable | QAccessible::Sizeable;
+ QAccessible::State state;
+ state.focusable = true;
+ state.focused = true;
+ state.movable = true;
+ state.sizeable = true;
+
QCOMPARE(interface->state(), state);
const QRect originalGeometry = testWindow->geometry();
testWindow->showMaximized();
- state &= (uint)~QAccessible::Sizeable;
- state &= (uint)~QAccessible::Movable;
+ state.sizeable = false;
+ state.movable = false;
QCOMPARE(interface->state(), state);
testWindow->showNormal();
testWindow->move(-10, 0);
- QVERIFY(interface->state() & QAccessible::Offscreen);
+ QVERIFY(interface->state().offscreen);
testWindow->setVisible(false);
- QVERIFY(interface->state() & QAccessible::Invisible);
+ QVERIFY(interface->state().invisible);
testWindow->setVisible(true);
testWindow->setEnabled(false);
- QVERIFY(interface->state() & QAccessible::Unavailable);
+ QVERIFY(interface->state().disabled);
testWindow->setEnabled(true);
qApp->setActiveWindow(&mdiArea);
mdiArea.setActiveSubWindow(testWindow);
testWindow->setFocus();
QVERIFY(testWindow->isAncestorOf(qApp->focusWidget()));
- QVERIFY(interface->state() & QAccessible::Focused);
+ QVERIFY(interface->state().focused);
testWindow->setGeometry(originalGeometry);
- if (isSubWindowsPlacedNextToEachOther) {
- // This part of the test can only be run if the sub windows are
- // placed next to each other.
- QAccessibleInterface *destination = interface->child(0);
- QVERIFY(destination);
- QCOMPARE(destination->object(), (QObject*)testWindow->widget());
- delete destination;
- QCOMPARE(interface->navigate(QAccessible::Left, 0, &destination), 0);
- QVERIFY(destination);
- QCOMPARE(destination->object(), (QObject*)subWindows.at(2));
- delete destination;
- QCOMPARE(interface->navigate(QAccessible::Right, 0, &destination), 0);
- QVERIFY(destination);
- QCOMPARE(destination->object(), (QObject*)subWindows.at(4));
- delete destination;
- }
-
// rect
const QPoint globalPos = testWindow->mapToGlobal(QPoint(0, 0));
QCOMPARE(interface->rect(), QRect(globalPos, testWindow->size()));
@@ -1931,11 +1768,14 @@ void tst_QAccessibility::mdiSubWindowTest()
QCOMPARE(childRect(interface), QRect(globalWidgetPos, widgetGeometry.size()));
// childAt
- QCOMPARE(interface->childAt(-10, 0), -1);
- QCOMPARE(interface->childAt(globalPos.x(), globalPos.y()), 0);
- QCOMPARE(interface->childAt(globalWidgetPos.x(), globalWidgetPos.y()), 1);
+ QCOMPARE(interface->childAt(-10, 0), static_cast<QAccessibleInterface*>(0));
+ QCOMPARE(interface->childAt(globalPos.x(), globalPos.y()), static_cast<QAccessibleInterface*>(0));
+ QAccessibleInterface *child = interface->childAt(globalWidgetPos.x(), globalWidgetPos.y());
+ QCOMPARE(child->role(), QAccessible::PushButton);
+ QCOMPARE(child->text(QAccessible::Name), QString("QAccessibilityTest"));
+ delete child;
testWindow->widget()->hide();
- QCOMPARE(interface->childAt(globalWidgetPos.x(), globalWidgetPos.y()), 0);
+ QCOMPARE(interface->childAt(globalWidgetPos.x(), globalWidgetPos.y()), static_cast<QAccessibleInterface*>(0));
}
QTestAccessibility::clearEvents();
@@ -1950,41 +1790,41 @@ void tst_QAccessibility::lineEditTest()
QApplication::processEvents();
QCOMPARE(iface->childCount(), 0);
- QVERIFY(iface->state() & QAccessible::Sizeable);
- QVERIFY(iface->state() & QAccessible::Movable);
- QCOMPARE(bool(iface->state() & QAccessible::Focusable), le->isActiveWindow());
- QVERIFY(iface->state() & QAccessible::Selectable);
- QVERIFY(iface->state() & QAccessible::HasPopup);
- QCOMPARE(bool(iface->state() & QAccessible::Focused), le->hasFocus());
+ QVERIFY(iface->state().sizeable);
+ QVERIFY(iface->state().movable);
+ QCOMPARE(bool(iface->state().focusable), le->isActiveWindow());
+ QVERIFY(iface->state().selectable);
+ QVERIFY(iface->state().hasPopup);
+ QCOMPARE(bool(iface->state().focused), le->hasFocus());
QString secret(QLatin1String("secret"));
le->setText(secret);
le->setEchoMode(QLineEdit::Normal);
- QVERIFY(!(iface->state() & QAccessible::Protected));
+ QVERIFY(!(iface->state().passwordEdit));
QCOMPARE(iface->text(QAccessible::Value), secret);
le->setEchoMode(QLineEdit::NoEcho);
- QVERIFY(iface->state() & QAccessible::Protected);
+ QVERIFY(iface->state().passwordEdit);
QVERIFY(iface->text(QAccessible::Value).isEmpty());
le->setEchoMode(QLineEdit::Password);
- QVERIFY(iface->state() & QAccessible::Protected);
+ QVERIFY(iface->state().passwordEdit);
QVERIFY(iface->text(QAccessible::Value).isEmpty());
le->setEchoMode(QLineEdit::PasswordEchoOnEdit);
- QVERIFY(iface->state() & QAccessible::Protected);
+ QVERIFY(iface->state().passwordEdit);
QVERIFY(iface->text(QAccessible::Value).isEmpty());
le->setEchoMode(QLineEdit::Normal);
- QVERIFY(!(iface->state() & QAccessible::Protected));
+ QVERIFY(!(iface->state().passwordEdit));
QCOMPARE(iface->text(QAccessible::Value), secret);
QWidget *toplevel = new QWidget;
le->setParent(toplevel);
toplevel->show();
QApplication::processEvents();
- QVERIFY(!(iface->state() & QAccessible::Sizeable));
- QVERIFY(!(iface->state() & QAccessible::Movable));
- QCOMPARE(bool(iface->state() & QAccessible::Focusable), le->isActiveWindow());
- QVERIFY(iface->state() & QAccessible::Selectable);
- QVERIFY(iface->state() & QAccessible::HasPopup);
- QCOMPARE(bool(iface->state() & QAccessible::Focused), le->hasFocus());
+ QVERIFY(!(iface->state().sizeable));
+ QVERIFY(!(iface->state().movable));
+ QCOMPARE(bool(iface->state().focusable), le->isActiveWindow());
+ QVERIFY(iface->state().selectable);
+ QVERIFY(iface->state().hasPopup);
+ QCOMPARE(bool(iface->state().focused), le->hasFocus());
QLineEdit *le2 = new QLineEdit(toplevel);
le2->show();
@@ -2086,39 +1926,18 @@ void tst_QAccessibility::workspaceTest()
QVERIFY(interface);
QCOMPARE(interface->childCount(), subWindowCount);
- // Right, right, right, ...
- for (int i = 0; i < subWindowCount; ++i) {
- QAccessibleInterface *destination = 0;
- int index = interface->navigate(QAccessible::Right, i + 1, &destination);
- if (i == subWindowCount - 1) {
- QVERIFY(!destination);
- QCOMPARE(index, -1);
- } else {
- QVERIFY(destination);
- QCOMPARE(index, 0);
- QCOMPARE(destination->object(), (QObject*)subWindows.at(i + 1));
- delete destination;
- }
}
+ QTestAccessibility::clearEvents();
+}
- // Left, left, left, ...
- for (int i = subWindowCount; i > 0; --i) {
- QAccessibleInterface *destination = 0;
- int index = interface->navigate(QAccessible::Left, i, &destination);
- if (i == 1) {
- QVERIFY(!destination);
- QCOMPARE(index, -1);
- } else {
- QVERIFY(destination);
- QCOMPARE(index, 0);
- QCOMPARE(destination->object(), (QObject*)subWindows.at(i - 2));
- delete destination;
- }
- }
- // ### Add test for Up and Down.
+bool accessibleInterfaceLeftOf(const QAccessibleInterface *a1, const QAccessibleInterface *a2)
+{
+ return a1->rect().x() < a2->rect().x();
+}
- }
- QTestAccessibility::clearEvents();
+bool accessibleInterfaceAbove(const QAccessibleInterface *a1, const QAccessibleInterface *a2)
+{
+ return a1->rect().y() < a2->rect().y();
}
void tst_QAccessibility::dialogButtonBoxTest()
@@ -2142,25 +1961,17 @@ void tst_QAccessibility::dialogButtonBoxTest()
QCOMPARE(iface->role(), QAccessible::Grouping);
QStringList actualOrder;
QAccessibleInterface *child;
- QAccessibleInterface *leftmost;
child = iface->child(0);
QCOMPARE(child->role(), QAccessible::PushButton);
- // first find the leftmost button
- while (child->navigate(QAccessible::Left, 1, &leftmost) != -1) {
- delete child;
- child = leftmost;
- }
- leftmost = child;
-
- // then traverse from left to right to find the correct order of the buttons
- int right = 0;
- while (right != -1) {
- actualOrder << leftmost->text(QAccessible::Name);
- right = leftmost->navigate(QAccessible::Right, 1, &child);
- delete leftmost;
- leftmost = child;
- }
+ QVector<QAccessibleInterface *> buttons;
+ for (int i = 0; i < iface->childCount(); ++i)
+ buttons << iface->child(i);
+
+ qSort(buttons.begin(), buttons.end(), accessibleInterfaceLeftOf);
+
+ for (int i = 0; i < buttons.count(); ++i)
+ actualOrder << buttons.at(i)->text(QAccessible::Name);
QStringList expectedOrder;
QDialogButtonBox::ButtonLayout btnlout =
@@ -2202,26 +2013,16 @@ void tst_QAccessibility::dialogButtonBoxTest()
#endif
QApplication::processEvents();
- QAccessibleInterface *child;
QStringList actualOrder;
- child = iface->child(0);
- // first find the topmost button
- QAccessibleInterface *other;
- while (child->navigate(QAccessible::Up, 1, &other) != -1) {
- delete child;
- child = other;
- }
- other = child;
-
- // then traverse from top to bottom to find the correct order of the buttons
- actualOrder.clear();
- int right = 0;
- while (right != -1) {
- actualOrder << other->text(QAccessible::Name);
- right = other->navigate(QAccessible::Down, 1, &child);
- delete other;
- other = child;
- }
+
+ QVector<QAccessibleInterface *> buttons;
+ for (int i = 0; i < iface->childCount(); ++i)
+ buttons << iface->child(i);
+
+ qSort(buttons.begin(), buttons.end(), accessibleInterfaceAbove);
+
+ for (int i = 0; i < buttons.count(); ++i)
+ actualOrder << buttons.at(i)->text(QAccessible::Name);
QStringList expectedOrder;
expectedOrder << QDialogButtonBox::tr("OK")
@@ -2288,7 +2089,7 @@ void tst_QAccessibility::abstractScrollAreaTest()
QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(&abstractScrollArea);
QVERIFY(interface);
QVERIFY(!interface->rect().isValid());
- QCOMPARE(interface->childAt(200, 200), -1);
+ QCOMPARE(interface->childAt(200, 200), static_cast<QAccessibleInterface*>(0));
abstractScrollArea.resize(400, 400);
abstractScrollArea.show();
@@ -2303,14 +2104,14 @@ void tst_QAccessibility::abstractScrollAreaTest()
QCOMPARE(interface->childCount(), 1);
QWidget *viewport = abstractScrollArea.viewport();
QVERIFY(viewport);
- QVERIFY(verifyChild(viewport, interface, 1, globalGeometry));
+ QVERIFY(verifyChild(viewport, interface, 0, globalGeometry));
// Horizontal scrollBar.
abstractScrollArea.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
QCOMPARE(interface->childCount(), 2);
QWidget *horizontalScrollBar = abstractScrollArea.horizontalScrollBar();
QWidget *horizontalScrollBarContainer = horizontalScrollBar->parentWidget();
- QVERIFY(verifyChild(horizontalScrollBarContainer, interface, 2, globalGeometry));
+ QVERIFY(verifyChild(horizontalScrollBarContainer, interface, 1, globalGeometry));
// Horizontal scrollBar widgets.
QLabel *secondLeftLabel = new QLabel(QLatin1String("L2"));
@@ -2334,7 +2135,7 @@ void tst_QAccessibility::abstractScrollAreaTest()
QCOMPARE(interface->childCount(), 3);
QWidget *verticalScrollBar = abstractScrollArea.verticalScrollBar();
QWidget *verticalScrollBarContainer = verticalScrollBar->parentWidget();
- QVERIFY(verifyChild(verticalScrollBarContainer, interface, 3, globalGeometry));
+ QVERIFY(verifyChild(verticalScrollBarContainer, interface, 2, globalGeometry));
// Vertical scrollBar widgets.
QLabel *secondTopLabel = new QLabel(QLatin1String("T2"));
@@ -2357,80 +2158,7 @@ void tst_QAccessibility::abstractScrollAreaTest()
abstractScrollArea.setCornerWidget(new QLabel(QLatin1String("C")));
QCOMPARE(interface->childCount(), 4);
QWidget *cornerWidget = abstractScrollArea.cornerWidget();
- QVERIFY(verifyChild(cornerWidget, interface, 4, globalGeometry));
-
- // Test navigate.
- QAccessibleInterface *target = 0;
-
- // viewport -> Up -> NOTHING
- const int viewportIndex = indexOfChild(interface, viewport);
- QVERIFY(viewportIndex != -1);
- QCOMPARE(interface->navigate(QAccessible::Up, viewportIndex, &target), -1);
- QVERIFY(!target);
-
- // viewport -> Left -> NOTHING
- QCOMPARE(interface->navigate(QAccessible::Left, viewportIndex, &target), -1);
- QVERIFY(!target);
-
- // viewport -> Down -> horizontalScrollBarContainer
- const int horizontalScrollBarContainerIndex = indexOfChild(interface, horizontalScrollBarContainer);
- QVERIFY(horizontalScrollBarContainerIndex != -1);
- QCOMPARE(interface->navigate(QAccessible::Down, viewportIndex, &target), 0);
- QVERIFY(target);
- QCOMPARE(target->object(), static_cast<QObject *>(horizontalScrollBarContainer));
- delete target;
- target = 0;
-
- // horizontalScrollBarContainer -> Left -> NOTHING
- QCOMPARE(interface->navigate(QAccessible::Left, horizontalScrollBarContainerIndex, &target), -1);
- QVERIFY(!target);
-
- // horizontalScrollBarContainer -> Down -> NOTHING
- QVERIFY(horizontalScrollBarContainerIndex != -1);
- QCOMPARE(interface->navigate(QAccessible::Down, horizontalScrollBarContainerIndex, &target), -1);
- QVERIFY(!target);
-
- // horizontalScrollBarContainer -> Right -> cornerWidget
- const int cornerWidgetIndex = indexOfChild(interface, cornerWidget);
- QVERIFY(cornerWidgetIndex != -1);
- QCOMPARE(interface->navigate(QAccessible::Right, horizontalScrollBarContainerIndex, &target), 0);
- QVERIFY(target);
- QCOMPARE(target->object(), static_cast<QObject *>(cornerWidget));
- delete target;
- target = 0;
-
- // cornerWidget -> Down -> NOTHING
- QCOMPARE(interface->navigate(QAccessible::Down, cornerWidgetIndex, &target), -1);
- QVERIFY(!target);
-
- // cornerWidget -> Right -> NOTHING
- QVERIFY(cornerWidgetIndex != -1);
- QCOMPARE(interface->navigate(QAccessible::Right, cornerWidgetIndex, &target), -1);
- QVERIFY(!target);
-
- // cornerWidget -> Up -> verticalScrollBarContainer
- const int verticalScrollBarContainerIndex = indexOfChild(interface, verticalScrollBarContainer);
- QVERIFY(verticalScrollBarContainerIndex != -1);
- QCOMPARE(interface->navigate(QAccessible::Up, cornerWidgetIndex, &target), 0);
- QVERIFY(target);
- QCOMPARE(target->object(), static_cast<QObject *>(verticalScrollBarContainer));
- delete target;
- target = 0;
-
- // verticalScrollBarContainer -> Right -> NOTHING
- QCOMPARE(interface->navigate(QAccessible::Right, verticalScrollBarContainerIndex, &target), -1);
- QVERIFY(!target);
-
- // verticalScrollBarContainer -> Up -> NOTHING
- QCOMPARE(interface->navigate(QAccessible::Up, verticalScrollBarContainerIndex, &target), -1);
- QVERIFY(!target);
-
- // verticalScrollBarContainer -> Left -> viewport
- QCOMPARE(interface->navigate(QAccessible::Left, verticalScrollBarContainerIndex, &target), 0);
- QVERIFY(target);
- QCOMPARE(target->object(), static_cast<QObject *>(viewport));
- delete target;
- target = 0;
+ QVERIFY(verifyChild(cornerWidget, interface, 3, globalGeometry));
QCOMPARE(verifyHierarchy(interface), 0);
@@ -2459,6 +2187,7 @@ void tst_QAccessibility::scrollAreaTest()
void tst_QAccessibility::listTest()
{
+ {
QListWidget *listView = new QListWidget;
listView->addItem("Oslo");
listView->addItem("Berlin");
@@ -2469,33 +2198,29 @@ void tst_QAccessibility::listTest()
QCoreApplication::processEvents();
QTest::qWait(100);
- QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(listView);
- QCOMPARE(verifyHierarchy(iface), 0);
+ QAIPtr iface = QAIPtr(QAccessible::queryAccessibleInterface(listView));
+ QCOMPARE(verifyHierarchy(iface.data()), 0);
QCOMPARE((int)iface->role(), (int)QAccessible::List);
QCOMPARE(iface->childCount(), 3);
- QAccessibleInterface *child1 = 0;
- child1 = iface->child(0);
+ {
+ QAIPtr child1 = QAIPtr(iface->child(0));
QVERIFY(child1);
- QCOMPARE(iface->indexOfChild(child1), 1);
+ QCOMPARE(iface->indexOfChild(child1.data()), 0);
QCOMPARE(child1->text(QAccessible::Name), QString("Oslo"));
QCOMPARE(child1->role(), QAccessible::ListItem);
- delete child1;
- QAccessibleInterface *child2 = 0;
- child2 = iface->child(1);
+ QAIPtr child2 = QAIPtr(iface->child(1));
QVERIFY(child2);
- QCOMPARE(iface->indexOfChild(child2), 2);
+ QCOMPARE(iface->indexOfChild(child2.data()), 1);
QCOMPARE(child2->text(QAccessible::Name), QString("Berlin"));
- delete child2;
- QAccessibleInterface *child3 = 0;
- child3 = iface->child(2);
+ QAIPtr child3 = QAIPtr(iface->child(2));
QVERIFY(child3);
- QCOMPARE(iface->indexOfChild(child3), 3);
+ QCOMPARE(iface->indexOfChild(child3.data()), 2);
QCOMPARE(child3->text(QAccessible::Name), QString("Brisbane"));
- delete child3;
+ }
QTestAccessibility::clearEvents();
// Check for events
@@ -2514,11 +2239,12 @@ void tst_QAccessibility::listTest()
QVERIFY(table2);
QCOMPARE(table2->columnCount(), 1);
QCOMPARE(table2->rowCount(), 4);
- QAccessibleInterface *cell1;
- QVERIFY(cell1 = table2->cellAt(0,0));
+ QAIPtr cell1 = QAIPtr(table2->cellAt(0,0));
+ QVERIFY(cell1);
QCOMPARE(cell1->text(QAccessible::Name), QString("Oslo"));
- QAccessibleInterface *cell4;
- QVERIFY(cell4 = table2->cellAt(3,0));
+
+ QAIPtr cell4 = QAIPtr(table2->cellAt(3,0));
+ QVERIFY(cell4);
QCOMPARE(cell4->text(QAccessible::Name), QString("Munich"));
QCOMPARE(cell4->role(), QAccessible::ListItem);
@@ -2526,12 +2252,30 @@ void tst_QAccessibility::listTest()
QVERIFY(cellInterface);
QCOMPARE(cellInterface->rowIndex(), 3);
QCOMPARE(cellInterface->columnIndex(), 0);
- QVERIFY(!(cell4->state() & QAccessible::Expandable));
+ QCOMPARE(cellInterface->rowExtent(), 1);
+ QCOMPARE(cellInterface->columnExtent(), 1);
+ QCOMPARE(cellInterface->rowHeaderCells(), QList<QAccessibleInterface*>());
+ QCOMPARE(cellInterface->columnHeaderCells(), QList<QAccessibleInterface*>());
+
+ QCOMPARE(QAIPtr(cellInterface->table())->object(), listView);
+
+ listView->clearSelection();
+ QVERIFY(!(cell4->state().expandable));
+ QVERIFY( (cell4->state().selectable));
+ QVERIFY(!(cell4->state().selected));
+ table2->selectRow(3);
+ QCOMPARE(listView->selectedItems().size(), 1);
+ QCOMPARE(listView->selectedItems().at(0)->text(), QLatin1String("Munich"));
+ QVERIFY(cell4->state().selected);
+ QVERIFY(cellInterface->isSelected());
+
+ QVERIFY(table2->cellAt(-1, 0) == 0);
+ QVERIFY(table2->cellAt(0, -1) == 0);
+ QVERIFY(table2->cellAt(0, 1) == 0);
+ QVERIFY(table2->cellAt(4, 0) == 0);
- delete cell4;
- delete cell1;
- delete iface;
delete listView;
+ }
QTestAccessibility::clearEvents();
}
@@ -2583,7 +2327,7 @@ void tst_QAccessibility::treeTest()
QAccessibleInterface *header1 = 0;
header1 = iface->child(0);
QVERIFY(header1);
- QCOMPARE(iface->indexOfChild(header1), 1);
+ QCOMPARE(iface->indexOfChild(header1), 0);
QCOMPARE(header1->text(QAccessible::Name), QString("Artist"));
QCOMPARE(header1->role(), QAccessible::ColumnHeader);
delete header1;
@@ -2591,16 +2335,16 @@ void tst_QAccessibility::treeTest()
QAccessibleInterface *child1 = 0;
child1 = iface->child(2);
QVERIFY(child1);
- QCOMPARE(iface->indexOfChild(child1), 3);
+ QCOMPARE(iface->indexOfChild(child1), 2);
QCOMPARE(child1->text(QAccessible::Name), QString("Spain"));
QCOMPARE(child1->role(), QAccessible::TreeItem);
- QVERIFY(!(child1->state() & QAccessible::Expanded));
+ QVERIFY(!(child1->state().expanded));
delete child1;
QAccessibleInterface *child2 = 0;
child2 = iface->child(4);
QVERIFY(child2);
- QCOMPARE(iface->indexOfChild(child2), 5);
+ QCOMPARE(iface->indexOfChild(child2), 4);
QCOMPARE(child2->text(QAccessible::Name), QString("Austria"));
delete child2;
@@ -2620,9 +2364,9 @@ void tst_QAccessibility::treeTest()
QCOMPARE(cell2->role(), QAccessible::TreeItem);
QCOMPARE(cell2->tableCellInterface()->rowIndex(), 1);
QCOMPARE(cell2->tableCellInterface()->columnIndex(), 0);
- QVERIFY(cell2->state() & QAccessible::Expandable);
- QCOMPARE(iface->indexOfChild(cell2), 5);
- QVERIFY(!(cell2->state() & QAccessible::Expanded));
+ QVERIFY(cell2->state().expandable);
+ QCOMPARE(iface->indexOfChild(cell2), 4);
+ QVERIFY(!(cell2->state().expanded));
QCOMPARE(table2->columnDescription(1), QString("Work"));
delete cell2;
delete cell1;
@@ -2637,15 +2381,15 @@ void tst_QAccessibility::treeTest()
QCOMPARE(table2->rowCount(), 5);
cell1 = table2->cellAt(1,0);
QCOMPARE(cell1->text(QAccessible::Name), QString("Picasso"));
- QCOMPARE(iface->indexOfChild(cell1), 5); // 1 based + 2 header + 2 for root item
+ QCOMPARE(iface->indexOfChild(cell1), 4); // 2 header + 2 for root item
cell2 = table2->cellAt(4,0);
QCOMPARE(cell2->text(QAccessible::Name), QString("Klimt"));
QCOMPARE(cell2->role(), QAccessible::TreeItem);
QCOMPARE(cell2->tableCellInterface()->rowIndex(), 4);
QCOMPARE(cell2->tableCellInterface()->columnIndex(), 0);
- QVERIFY(!(cell2->state() & QAccessible::Expandable));
- QCOMPARE(iface->indexOfChild(cell2), 11);
+ QVERIFY(!(cell2->state().expandable));
+ QCOMPARE(iface->indexOfChild(cell2), 10);
QCOMPARE(table2->columnDescription(0), QString("Artist"));
QCOMPARE(table2->columnDescription(1), QString("Work"));
@@ -2687,21 +2431,21 @@ void tst_QAccessibility::tableTest()
QAccessibleInterface *cornerButton = iface->child(0);
QVERIFY(cornerButton);
- QCOMPARE(iface->indexOfChild(cornerButton), 1);
+ QCOMPARE(iface->indexOfChild(cornerButton), 0);
QCOMPARE(cornerButton->role(), QAccessible::Pane);
delete cornerButton;
QAccessibleInterface *child1 = iface->child(2);
QVERIFY(child1);
- QCOMPARE(iface->indexOfChild(child1), 3);
+ QCOMPARE(iface->indexOfChild(child1), 2);
QCOMPARE(child1->text(QAccessible::Name), QString("h2"));
QCOMPARE(child1->role(), QAccessible::ColumnHeader);
- QVERIFY(!(child1->state() & QAccessible::Expanded));
+ QVERIFY(!(child1->state().expanded));
delete child1;
QAccessibleInterface *child2 = iface->child(10);
QVERIFY(child2);
- QCOMPARE(iface->indexOfChild(child2), 11);
+ QCOMPARE(iface->indexOfChild(child2), 10);
QCOMPARE(child2->text(QAccessible::Name), QString("1.1"));
QAccessibleTableCellInterface *cell2Iface = child2->tableCellInterface();
QCOMPARE(cell2Iface->rowIndex(), 1);
@@ -2709,7 +2453,7 @@ void tst_QAccessibility::tableTest()
delete child2;
QAccessibleInterface *child3 = iface->child(11);
- QCOMPARE(iface->indexOfChild(child3), 12);
+ QCOMPARE(iface->indexOfChild(child3), 11);
QCOMPARE(child3->text(QAccessible::Name), QString("1.2"));
delete child3;
@@ -2723,7 +2467,7 @@ void tst_QAccessibility::tableTest()
QAccessibleInterface *cell1;
QVERIFY(cell1 = table2->cellAt(0,0));
QCOMPARE(cell1->text(QAccessible::Name), QString("0.0"));
- QCOMPARE(iface->indexOfChild(cell1), 6);
+ QCOMPARE(iface->indexOfChild(cell1), 5);
QAccessibleInterface *cell2;
QVERIFY(cell2 = table2->cellAt(0,1));
@@ -2731,7 +2475,7 @@ void tst_QAccessibility::tableTest()
QCOMPARE(cell2->role(), QAccessible::Cell);
QCOMPARE(cell2->tableCellInterface()->rowIndex(), 0);
QCOMPARE(cell2->tableCellInterface()->columnIndex(), 1);
- QCOMPARE(iface->indexOfChild(cell2), 7);
+ QCOMPARE(iface->indexOfChild(cell2), 6);
delete cell2;
QAccessibleInterface *cell3;
@@ -2740,7 +2484,7 @@ void tst_QAccessibility::tableTest()
QCOMPARE(cell3->role(), QAccessible::Cell);
QCOMPARE(cell3->tableCellInterface()->rowIndex(), 1);
QCOMPARE(cell3->tableCellInterface()->columnIndex(), 2);
- QCOMPARE(iface->indexOfChild(cell3), 12);
+ QCOMPARE(iface->indexOfChild(cell3), 11);
delete cell3;
QCOMPARE(table2->columnDescription(0), QString("h1"));
@@ -2767,7 +2511,7 @@ void tst_QAccessibility::calendarWidgetTest()
QVERIFY(interface);
QCOMPARE(interface->role(), QAccessible::Table);
QVERIFY(!interface->rect().isValid());
- QCOMPARE(interface->childAt(200, 200), -1);
+ QCOMPARE(interface->childAt(200, 200), static_cast<QAccessibleInterface*>(0));
calendarWidget.resize(400, 300);
calendarWidget.show();
@@ -2791,7 +2535,7 @@ void tst_QAccessibility::calendarWidgetTest()
}
}
QVERIFY(navigationBar);
- QVERIFY(verifyChild(navigationBar, interface, 1, globalGeometry));
+ QVERIFY(verifyChild(navigationBar, interface, 0, globalGeometry));
QAbstractItemView *calendarView = 0;
foreach (QObject *child, calendarWidget.children()) {
@@ -2801,14 +2545,14 @@ void tst_QAccessibility::calendarWidgetTest()
}
}
QVERIFY(calendarView);
- QVERIFY(verifyChild(calendarView, interface, 2, globalGeometry));
+ QVERIFY(verifyChild(calendarView, interface, 1, globalGeometry));
// Hide navigation bar.
calendarWidget.setNavigationBarVisible(false);
QCOMPARE(interface->childCount(), 1);
QVERIFY(!navigationBar->isVisible());
- QVERIFY(verifyChild(calendarView, interface, 1, globalGeometry));
+ QVERIFY(verifyChild(calendarView, interface, 0, globalGeometry));
// Show navigation bar.
calendarWidget.setNavigationBarVisible(true);
@@ -2819,29 +2563,19 @@ void tst_QAccessibility::calendarWidgetTest()
QAccessibleInterface *navigationBarInterface = interface->child(0);
QVERIFY(navigationBarInterface);
QCOMPARE(navigationBarInterface->object(), (QObject*)navigationBar);
- delete navigationBarInterface;
- navigationBarInterface = 0;
// Navigate to the view via Child.
QAccessibleInterface *calendarViewInterface = interface->child(1);
QVERIFY(calendarViewInterface);
QCOMPARE(calendarViewInterface->object(), (QObject*)calendarView);
- delete calendarViewInterface;
- calendarViewInterface = 0;
QVERIFY(!interface->child(-1));
- // Navigate from navigation bar -> view (Down).
- QCOMPARE(interface->navigate(QAccessible::Down, 1, &calendarViewInterface), 0);
- QVERIFY(calendarViewInterface);
- QCOMPARE(calendarViewInterface->object(), (QObject*)calendarView);
+ // In order for geometric navigation to work they must share the same parent
+ QCOMPARE(navigationBarInterface->parent()->object(), calendarViewInterface->parent()->object());
+ QVERIFY(navigationBarInterface->rect().bottom() < calendarViewInterface->rect().top());
delete calendarViewInterface;
calendarViewInterface = 0;
-
- // Navigate from view -> navigation bar (Up).
- QCOMPARE(interface->navigate(QAccessible::Up, 2, &navigationBarInterface), 0);
- QVERIFY(navigationBarInterface);
- QCOMPARE(navigationBarInterface->object(), (QObject*)navigationBar);
delete navigationBarInterface;
navigationBarInterface = 0;
@@ -2903,12 +2637,14 @@ void tst_QAccessibility::dockWidgetTest()
QPoint globalPos = dock1->mapToGlobal(QPoint(0,0));
globalPos.rx()+=5; //### query style
globalPos.ry()+=5;
- int entry = accDock1->childAt(globalPos.x(), globalPos.y()); //###
- QCOMPARE(entry, 1);
- QAccessibleInterface *accTitleBar = accDock1->child(entry - 1);
+ QAccessibleInterface *childAt = accDock1->childAt(globalPos.x(), globalPos.y()); //###
+ QCOMPARE(childAt->role(), QAccessible::TitleBar);
+ int index = accDock1->indexOfChild(childAt);
+ delete childAt;
+ QAccessibleInterface *accTitleBar = accDock1->child(index);
QCOMPARE(accTitleBar->role(), QAccessible::TitleBar);
- QCOMPARE(accDock1->indexOfChild(accTitleBar), 1);
+ QCOMPARE(accDock1->indexOfChild(accTitleBar), 0);
QAccessibleInterface *acc;
acc = accTitleBar->parent();
QVERIFY(acc);
diff --git a/tests/auto/other/qcomplextext/bidireorderstring.h b/tests/auto/other/qcomplextext/bidireorderstring.h
index e0bbf6e80b..32f0c81e69 100644
--- a/tests/auto/other/qcomplextext/bidireorderstring.h
+++ b/tests/auto/other/qcomplextext/bidireorderstring.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qcomplextext/tst_qcomplextext.cpp b/tests/auto/other/qcomplextext/tst_qcomplextext.cpp
index ce45500e74..c741a76a7e 100644
--- a/tests/auto/other/qcomplextext/tst_qcomplextext.cpp
+++ b/tests/auto/other/qcomplextext/tst_qcomplextext.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qdirectpainter/runDirectPainter/main.cpp b/tests/auto/other/qdirectpainter/runDirectPainter/main.cpp
index af3dd90beb..475cb9c035 100644
--- a/tests/auto/other/qdirectpainter/runDirectPainter/main.cpp
+++ b/tests/auto/other/qdirectpainter/runDirectPainter/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qdirectpainter/tst_qdirectpainter.cpp b/tests/auto/other/qdirectpainter/tst_qdirectpainter.cpp
index f60f011a20..352dd96dd9 100644
--- a/tests/auto/other/qdirectpainter/tst_qdirectpainter.cpp
+++ b/tests/auto/other/qdirectpainter/tst_qdirectpainter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
index a0803b029c..9f82a72f65 100644
--- a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
+++ b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -73,14 +73,14 @@ protected:
QLineEdit::focusInEvent( e );
focusInEventReason = e->reason();
focusInEventGotFocus = e->gotFocus();
- focusInEventRecieved = TRUE;
+ focusInEventRecieved = true;
}
void focusOutEvent( QFocusEvent* e )
{
QLineEdit::focusOutEvent( e );
focusOutEventReason = e->reason();
focusOutEventLostFocus = !e->gotFocus();
- focusOutEventRecieved = TRUE;
+ focusOutEventRecieved = true;
}
};
@@ -173,17 +173,17 @@ void tst_QFocusEvent::initWidget()
// The first lineedit should have focus
QVERIFY( childFocusWidgetOne->hasFocus() );
- childFocusWidgetOne->focusInEventRecieved = FALSE;
- childFocusWidgetOne->focusInEventGotFocus = FALSE;
+ childFocusWidgetOne->focusInEventRecieved = false;
+ childFocusWidgetOne->focusInEventGotFocus = false;
childFocusWidgetOne->focusInEventReason = -1;
- childFocusWidgetOne->focusOutEventRecieved = FALSE;
- childFocusWidgetOne->focusOutEventLostFocus = FALSE;
+ childFocusWidgetOne->focusOutEventRecieved = false;
+ childFocusWidgetOne->focusOutEventLostFocus = false;
childFocusWidgetOne->focusOutEventReason = -1;
- childFocusWidgetTwo->focusInEventRecieved = FALSE;
- childFocusWidgetTwo->focusInEventGotFocus = FALSE;
+ childFocusWidgetTwo->focusInEventRecieved = false;
+ childFocusWidgetTwo->focusInEventGotFocus = false;
childFocusWidgetTwo->focusInEventReason = -1;
- childFocusWidgetTwo->focusOutEventRecieved = FALSE;
- childFocusWidgetTwo->focusOutEventLostFocus = FALSE;
+ childFocusWidgetTwo->focusOutEventRecieved = false;
+ childFocusWidgetTwo->focusOutEventLostFocus = false;
childFocusWidgetTwo->focusOutEventReason = -1;
}
diff --git a/tests/auto/other/qmultiscreen/tst_qmultiscreen.cpp b/tests/auto/other/qmultiscreen/tst_qmultiscreen.cpp
index 9f7411f3ab..e6f2432e64 100644
--- a/tests/auto/other/qmultiscreen/tst_qmultiscreen.cpp
+++ b/tests/auto/other/qmultiscreen/tst_qmultiscreen.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp b/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp
index 63506fed1d..6cf4147091 100644
--- a/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp
+++ b/tests/auto/other/qnetworkaccessmanager_and_qprogressdialog/tst_qnetworkaccessmanager_and_qprogressdialog.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qobjectperformance/tst_qobjectperformance.cpp b/tests/auto/other/qobjectperformance/tst_qobjectperformance.cpp
index 4403a3f57b..2533cfb55b 100644
--- a/tests/auto/other/qobjectperformance/tst_qobjectperformance.cpp
+++ b/tests/auto/other/qobjectperformance/tst_qobjectperformance.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qobjectrace/tst_qobjectrace.cpp b/tests/auto/other/qobjectrace/tst_qobjectrace.cpp
index 8cb7845e78..41e3001415 100644
--- a/tests/auto/other/qobjectrace/tst_qobjectrace.cpp
+++ b/tests/auto/other/qobjectrace/tst_qobjectrace.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qsharedpointer_and_qwidget/tst_qsharedpointer_and_qwidget.cpp b/tests/auto/other/qsharedpointer_and_qwidget/tst_qsharedpointer_and_qwidget.cpp
index 90b71c517c..3cda8ed1ee 100644
--- a/tests/auto/other/qsharedpointer_and_qwidget/tst_qsharedpointer_and_qwidget.cpp
+++ b/tests/auto/other/qsharedpointer_and_qwidget/tst_qsharedpointer_and_qwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -62,10 +62,10 @@ private slots:
void strong_sharedptrDelete();
public slots:
- void cleanup() { check(); }
+ void cleanup() { safetyCheck(); }
public:
- inline void check()
+ inline void safetyCheck()
{
#ifdef QT_BUILD_INTERNAL
QtSharedPointer::internalSafetyCheckCleanCheck();
diff --git a/tests/auto/other/qtokenautomaton/generateTokenizers.sh b/tests/auto/other/qtokenautomaton/generateTokenizers.sh
index 0fb602aae4..0a67a1dca0 100755
--- a/tests/auto/other/qtokenautomaton/generateTokenizers.sh
+++ b/tests/auto/other/qtokenautomaton/generateTokenizers.sh
@@ -1,7 +1,7 @@
#!/bin/bash
#############################################################################
##
-## Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+## Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation (qt-info@nokia.com)
##
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/basic/basic.cpp b/tests/auto/other/qtokenautomaton/tokenizers/basic/basic.cpp
index 7f96e41894..89e22719d1 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/basic/basic.cpp
+++ b/tests/auto/other/qtokenautomaton/tokenizers/basic/basic.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/basic/basic.h b/tests/auto/other/qtokenautomaton/tokenizers/basic/basic.h
index 2f0efa1ffc..8ff67a5b23 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/basic/basic.h
+++ b/tests/auto/other/qtokenautomaton/tokenizers/basic/basic.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/basicNamespace/basicNamespace.cpp b/tests/auto/other/qtokenautomaton/tokenizers/basicNamespace/basicNamespace.cpp
index 3874777d74..5eab3d972a 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/basicNamespace/basicNamespace.cpp
+++ b/tests/auto/other/qtokenautomaton/tokenizers/basicNamespace/basicNamespace.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/basicNamespace/basicNamespace.h b/tests/auto/other/qtokenautomaton/tokenizers/basicNamespace/basicNamespace.h
index 074bb304ba..147619604c 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/basicNamespace/basicNamespace.h
+++ b/tests/auto/other/qtokenautomaton/tokenizers/basicNamespace/basicNamespace.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.cpp b/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.cpp
index 5f374030bb..ba7cdfac91 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.cpp
+++ b/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.h b/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.h
index 735ca68e18..ec3631e272 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.h
+++ b/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.xml b/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.xml
index 604c147c43..c6f37a218b 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.xml
+++ b/tests/auto/other/qtokenautomaton/tokenizers/boilerplate/boilerplate.xml
@@ -23,7 +23,7 @@
<boilerplate>
<prolog>/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/noNamespace/noNamespace.cpp b/tests/auto/other/qtokenautomaton/tokenizers/noNamespace/noNamespace.cpp
index 2d349ad637..38f7ca90a3 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/noNamespace/noNamespace.cpp
+++ b/tests/auto/other/qtokenautomaton/tokenizers/noNamespace/noNamespace.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/noNamespace/noNamespace.h b/tests/auto/other/qtokenautomaton/tokenizers/noNamespace/noNamespace.h
index f922dfcb50..086a9a0ce4 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/noNamespace/noNamespace.h
+++ b/tests/auto/other/qtokenautomaton/tokenizers/noNamespace/noNamespace.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/noToString/noToString.cpp b/tests/auto/other/qtokenautomaton/tokenizers/noToString/noToString.cpp
index d45c7302cd..a62eab1da7 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/noToString/noToString.cpp
+++ b/tests/auto/other/qtokenautomaton/tokenizers/noToString/noToString.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/noToString/noToString.h b/tests/auto/other/qtokenautomaton/tokenizers/noToString/noToString.h
index 12142bc4f0..f551b46f47 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/noToString/noToString.h
+++ b/tests/auto/other/qtokenautomaton/tokenizers/noToString/noToString.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/withNamespace/withNamespace.cpp b/tests/auto/other/qtokenautomaton/tokenizers/withNamespace/withNamespace.cpp
index 235bd60501..fdff637450 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/withNamespace/withNamespace.cpp
+++ b/tests/auto/other/qtokenautomaton/tokenizers/withNamespace/withNamespace.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tokenizers/withNamespace/withNamespace.h b/tests/auto/other/qtokenautomaton/tokenizers/withNamespace/withNamespace.h
index 678b3a7903..627da4b93a 100644
--- a/tests/auto/other/qtokenautomaton/tokenizers/withNamespace/withNamespace.h
+++ b/tests/auto/other/qtokenautomaton/tokenizers/withNamespace/withNamespace.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/qtokenautomaton/tst_qtokenautomaton.cpp b/tests/auto/other/qtokenautomaton/tst_qtokenautomaton.cpp
index cbbf5a2a0d..789d2f6491 100644
--- a/tests/auto/other/qtokenautomaton/tst_qtokenautomaton.cpp
+++ b/tests/auto/other/qtokenautomaton/tst_qtokenautomaton.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/windowsmobile/test/ddhelper.cpp b/tests/auto/other/windowsmobile/test/ddhelper.cpp
index 55469f5901..7a8c9ea94e 100644
--- a/tests/auto/other/windowsmobile/test/ddhelper.cpp
+++ b/tests/auto/other/windowsmobile/test/ddhelper.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/windowsmobile/test/ddhelper.h b/tests/auto/other/windowsmobile/test/ddhelper.h
index 3d2f06aa36..de3f79afca 100644
--- a/tests/auto/other/windowsmobile/test/ddhelper.h
+++ b/tests/auto/other/windowsmobile/test/ddhelper.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp b/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp
index 4318de7991..b211f3e6e2 100644
--- a/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp
+++ b/tests/auto/other/windowsmobile/test/tst_windowsmobile.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
diff --git a/tests/auto/other/windowsmobile/testQMenuBar/main.cpp b/tests/auto/other/windowsmobile/testQMenuBar/main.cpp
index c2099a648b..2c39605f54 100644
--- a/tests/auto/other/windowsmobile/testQMenuBar/main.cpp
+++ b/tests/auto/other/windowsmobile/testQMenuBar/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**