diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2011-11-15 11:36:18 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-18 01:51:57 +0100 |
commit | a8fd0c3654f8352773638633778cd8003680cbc7 (patch) | |
tree | 4815cca9daf879b96a92a3de95621b56ac5ba868 /tests/auto/integrationtests | |
parent | d90d57bb8b995c7a66e7f9b7b2515447fbe11de0 (diff) |
Don't depend on moc to disable test functions.
The moc tool is not aware of all defines (particularly those that are
compiler builtins) and does not correctly evaluate others that depend
on compiler builtins, such as Q_OS_FOO.
This commit reverts parts of the following commits, but is not a
complete fix as there were many instances of this problem in the tests
prior to those commits:
924d810dbdcd5b5b0fa860922b2487ea9062d002
8aaff6751038b88d17e23be6fcee945771297c5b
338d3f11973412047c2c9cd41cbd0c961d738ef3
a55034062ba2bf73a9f1ed3d9cf31745b38149e3
253497b7446c7d723aa3bdd7152e25d6852f2604
7cfad460c56319ba89c4a3a0bbcb2e54ab1cdbc6
9d2ff58f3642828e494e7e9b2df7dbb8e2cd408f
0cf6baa2d61ebaad2a2a0530c37f27e719b68f4b
Change-Id: I947d797fe3ec76139ba1b55561cea569895662c5
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/integrationtests')
3 files changed, 39 insertions, 20 deletions
diff --git a/tests/auto/integrationtests/collections/tst_collections.cpp b/tests/auto/integrationtests/collections/tst_collections.cpp index a4901942bf..39017781d1 100644 --- a/tests/auto/integrationtests/collections/tst_collections.cpp +++ b/tests/auto/integrationtests/collections/tst_collections.cpp @@ -152,9 +152,7 @@ private slots: void qtimerList(); void containerTypedefs(); void forwardDeclared(); -#if defined(Q_ALIGNOF) && defined(Q_DECL_ALIGN) void alignment(); -#endif void QTBUG13079_collectionInsideCollection(); void foreach_2(); @@ -3397,6 +3395,12 @@ void tst_Collections::alignment() testAssociativeContainerAlignment<QHash<Aligned128, Aligned4> >(); testAssociativeContainerAlignment<QHash<Aligned128, Aligned128> >(); } + +#else +void tst_Collections::alignment() +{ + QSKIP("Compiler doesn't support necessary extension keywords"); +} #endif #ifndef QT_NO_TEMPLATE_TEMPLATE_PARAMETERS diff --git a/tests/auto/integrationtests/qaccessibility/tst_qaccessibility.cpp b/tests/auto/integrationtests/qaccessibility/tst_qaccessibility.cpp index 6f41bc0f61..9b2d015005 100644 --- a/tests/auto/integrationtests/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/integrationtests/qaccessibility/tst_qaccessibility.cpp @@ -247,18 +247,14 @@ private slots: void abstractScrollAreaTest(); void scrollAreaTest(); - // Accessible table1 interface is no longer supported on X11, - // where it has been replaced by table2 interface. -#ifndef Q_OS_UNIX void listViewTest(); void treeWidgetTest(); void tableWidgetTest(); void tableViewTest(); -#else + void table2ListTest(); void table2TreeTest(); void table2TableTest(); -#endif void calendarWidgetTest(); void dockWidgetTest(); @@ -2469,12 +2465,11 @@ void tst_QAccessibility::scrollAreaTest() QTestAccessibility::clearEvents(); } -// Accessible table1 interface is no longer supported on X11, -// where it has been replaced by table2 interface. -#ifndef Q_OS_UNIX - void tst_QAccessibility::listViewTest() { +#if defined(Q_OS_UNIX) + QSKIP( "Accessible table1 interface is no longer supported on X11."); +#else { QListView listView; QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(&listView); @@ -2535,10 +2530,14 @@ void tst_QAccessibility::listViewTest() delete iface; } QTestAccessibility::clearEvents(); +#endif } void tst_QAccessibility::treeWidgetTest() { +#if defined(Q_OS_UNIX) + QSKIP( "Accessible table1 interface is no longer supported on X11."); +#else QWidget *w = new QWidget; QTreeWidget *tree = new QTreeWidget(w); QHBoxLayout *l = new QHBoxLayout(w); @@ -2591,10 +2590,14 @@ void tst_QAccessibility::treeWidgetTest() delete w; QTestAccessibility::clearEvents(); +#endif } void tst_QAccessibility::tableWidgetTest() { +#if defined(Q_OS_UNIX) + QSKIP( "Accessible table1 interface is no longer supported on X11."); +#else { QWidget *topLevel = new QWidget; QTableWidget *w = new QTableWidget(8,4,topLevel); @@ -2631,6 +2634,7 @@ void tst_QAccessibility::tableWidgetTest() delete topLevel; } QTestAccessibility::clearEvents(); +#endif } class QtTestTableModel: public QAbstractTableModel @@ -2713,6 +2717,9 @@ public: void tst_QAccessibility::tableViewTest() { +#if defined(Q_OS_UNIX) + QSKIP( "Accessible table1 interface is no longer supported on X11."); +#else { QtTestTableModel *model = new QtTestTableModel(3, 4); QTableView *w = new QTableView(); @@ -2789,13 +2796,14 @@ void tst_QAccessibility::tableViewTest() delete model; } QTestAccessibility::clearEvents(); +#endif } -#else -// Test accessible table2 interface on unix - void tst_QAccessibility::table2ListTest() { +#if !defined(Q_OS_UNIX) + QSKIP( "Accessible table2 interface is currently only supported on X11."); +#else QListWidget *listView = new QListWidget; listView->addItem("Oslo"); listView->addItem("Berlin"); @@ -2867,10 +2875,14 @@ void tst_QAccessibility::table2ListTest() delete iface; delete listView; QTestAccessibility::clearEvents(); +#endif } void tst_QAccessibility::table2TreeTest() { +#if !defined(Q_OS_UNIX) + QSKIP( "Accessible table2 interface is currently only supported on X11."); +#else QTreeWidget *treeView = new QTreeWidget; treeView->setColumnCount(2); QTreeWidgetItem *header = new QTreeWidgetItem; @@ -2986,10 +2998,14 @@ void tst_QAccessibility::table2TreeTest() delete iface; QTestAccessibility::clearEvents(); +#endif } void tst_QAccessibility::table2TableTest() { +#if !defined(Q_OS_UNIX) + QSKIP( "Accessible table2 interface is currently only supported on X11."); +#else QTableWidget *tableView = new QTableWidget(3, 3); tableView->setColumnCount(3); QStringList hHeader; @@ -3089,8 +3105,8 @@ void tst_QAccessibility::table2TableTest() delete tableView; QTestAccessibility::clearEvents(); -} #endif +} void tst_QAccessibility::calendarWidgetTest() { diff --git a/tests/auto/integrationtests/qfocusevent/tst_qfocusevent.cpp b/tests/auto/integrationtests/qfocusevent/tst_qfocusevent.cpp index 931059b211..cc58b6212c 100644 --- a/tests/auto/integrationtests/qfocusevent/tst_qfocusevent.cpp +++ b/tests/auto/integrationtests/qfocusevent/tst_qfocusevent.cpp @@ -106,9 +106,7 @@ public slots: private slots: void checkReason_Tab(); void checkReason_ShiftTab(); -#ifndef Q_OS_WIN32 void checkReason_BackTab(); -#endif void checkReason_Popup(); void checkReason_focusWidget(); void checkReason_Shortcut(); @@ -230,10 +228,11 @@ void tst_QFocusEvent::checkReason_ShiftTab() /*! In this test we verify that the Qt::KeyBacktab key is handled in a qfocusevent */ -// Backtab is not supported on Windows. -#ifndef Q_OS_WIN32 void tst_QFocusEvent::checkReason_BackTab() { +#ifdef Q_OS_WIN32 // key is not supported on Windows + QSKIP( "Backtab is not supported on Windows"); +#else initWidget(); QVERIFY( childFocusWidgetOne->hasFocus() ); @@ -249,8 +248,8 @@ void tst_QFocusEvent::checkReason_BackTab() QVERIFY( childFocusWidgetTwo->hasFocus() ); QCOMPARE( childFocusWidgetOne->focusOutEventReason, int(Qt::BacktabFocusReason) ); QCOMPARE( childFocusWidgetTwo->focusInEventReason, int(Qt::BacktabFocusReason) ); -} #endif +} void tst_QFocusEvent::checkReason_Popup() { |