summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Bugge Monsen <mmonsen@trolltech.com>2009-11-17 15:45:44 (GMT)
committerMarius Bugge Monsen <mmonsen@trolltech.com>2009-11-17 15:45:44 (GMT)
commita380c528344d35a20078c7cc37bcbac3b607e618 (patch)
tree2118d742274734c9ebee01b615b2143f22dbbb8a
parent89848ba3306c808bce412429a9d2539881cb4193 (diff)
downloadQt-a380c528344d35a20078c7cc37bcbac3b607e618.zip
Qt-a380c528344d35a20078c7cc37bcbac3b607e618.tar.gz
Qt-a380c528344d35a20078c7cc37bcbac3b607e618.tar.bz2
Fix compile issues on AIX with the XLC compiler.
The compiler is not smart enough to figure out the type of arguments in QCOMPARE, so we have to explicitly cast. This is also a problem with the Metrowerks compiler, and the cast is safe, so remove the #ifdef and always cast. Reviewer-by: Olivier Goffart
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp
index e903ab5..af71961 100644
--- a/tests/auto/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/qcombobox/tst_qcombobox.cpp
@@ -2290,11 +2290,8 @@ void tst_QComboBox::setItemDelegate()
QComboBox comboBox;
QStyledItemDelegate *itemDelegate = new QStyledItemDelegate;
comboBox.setItemDelegate(itemDelegate);
-#ifdef Q_CC_MWERKS
+ // the cast is a workaround for the XLC and Metrowerks compilers
QCOMPARE(static_cast<QStyledItemDelegate *>(comboBox.itemDelegate()), itemDelegate);
-#else
- QCOMPARE(comboBox.itemDelegate(), itemDelegate);
-#endif
}
void tst_QComboBox::task253944_itemDelegateIsReset()
@@ -2303,19 +2300,13 @@ void tst_QComboBox::task253944_itemDelegateIsReset()
QStyledItemDelegate *itemDelegate = new QStyledItemDelegate;
comboBox.setItemDelegate(itemDelegate);
+ // the casts are workarounds for the XLC and Metrowerks compilers
+
comboBox.setEditable(true);
-#ifdef Q_CC_MWERKS
QCOMPARE(static_cast<QStyledItemDelegate *>(comboBox.itemDelegate()), itemDelegate);
-#else
- QCOMPARE(comboBox.itemDelegate(), itemDelegate);
-#endif
comboBox.setStyleSheet("QComboBox { border: 1px solid gray; }");
-#ifdef Q_CC_MWERKS
QCOMPARE(static_cast<QStyledItemDelegate *>(comboBox.itemDelegate()), itemDelegate);
-#else
- QCOMPARE(comboBox.itemDelegate(), itemDelegate);
-#endif
}