Remove the redundant QTEST_ACCESSIBILITY define.
authorJason McDonald <jason.mcdonald@nokia.com>
Mon, 23 May 2011 07:08:04 +0000 (17:08 +1000)
committerQt Continuous Integration System <qt-info@nokia.com>
Thu, 26 May 2011 07:30:03 +0000 (09:30 +0200)
QTEST_ACCESSIBILITY was always defined and only used in one autotest.
Code that uses accessibility features should be excluded if Qt was built
without accessibility rather than based on a define in the test
framework.

Change-Id: I3a517a579a51f536a0983b43bd99e86292026552
Reviewed-by: pending
Reviewed-on: http://codereview.qt.nokia.com/129
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
src/testlib/qtestaccessible.h
tests/auto/qaccessibility/tst_qaccessibility.cpp

index d304a6f..9cec1a6 100644 (file)
@@ -49,8 +49,6 @@
 
 #ifndef QT_NO_ACCESSIBILITY
 
-#define QTEST_ACCESSIBILITY
-
 #define QVERIFY_EVENT(object, child, event) \
     QVERIFY(QTestAccessibility::verifyEvent(object, child, (int)event))
 
@@ -131,9 +129,9 @@ private:
         if (object) {
             QApplication* app = qobject_cast<QApplication*>(object);
             if ( !app )
-                qWarning("QTEST_ACCESSIBILITY: root Object is not a QApplication!");
+                qWarning("%s: root Object is not a QApplication!", Q_FUNC_INFO);
         } else {
-            qWarning("QTEST_ACCESSIBILITY: root Object called with 0 pointer");
+            qWarning("%s: root Object called with 0 pointer", Q_FUNC_INFO);
         }
     }
 
index 6c0e261..03b2d79 100644 (file)
@@ -947,21 +947,16 @@ void tst_QAccessibility::doAction()
 
 void tst_QAccessibility::applicationTest()
 {
-#ifdef QTEST_ACCESSIBILITY
     QLatin1String name = QLatin1String("My Name");
     qApp->setApplicationName(name);
     QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(qApp);
     QCOMPARE(interface->text(QAccessible::Name, 0), name);
     QCOMPARE(interface->role(0), QAccessible::Application);
     delete interface;
-#else
-    QSKIP("Test needs accessibility support.", SkipAll);
-#endif
 }
 
 void tst_QAccessibility::mainWindowTest()
 {
-#ifdef QTEST_ACCESSIBILITY
     QMainWindow mw;
     mw.resize(300, 200);
     mw.show(); // triggers layout
@@ -974,10 +969,6 @@ void tst_QAccessibility::mainWindowTest()
     QCOMPARE(interface->text(QAccessible::Name, 0), name);
     QCOMPARE(interface->role(0), QAccessible::Window);
     delete interface;
-
-#else
-    QSKIP("Test needs accessibility support.", SkipAll);
-#endif
 }
 
 class CounterButton : public QPushButton {
@@ -1295,7 +1286,6 @@ void tst_QAccessibility::tabTest()
 
 void tst_QAccessibility::tabWidgetTest()
 {
-#ifdef QTEST_ACCESSIBILITY
     QTabWidget *tabWidget = new QTabWidget();
     tabWidget->show();
 
@@ -1381,9 +1371,6 @@ void tst_QAccessibility::tabWidgetTest()
     delete interface;
     delete tabWidget;
     QTestAccessibility::clearEvents();
-#else
-    QSKIP("Test needs accessibility support.", SkipAll);
-#endif
 }
 
 void tst_QAccessibility::menuTest()