Exclude a QCOMPARE in tst_QListWidget instead of excluding the whole class.
authorStephen Kelly <stephen.kelly@kdab.com>
Tue, 9 Oct 2012 14:24:52 +0000 (16:24 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 16 Oct 2012 06:41:48 +0000 (08:41 +0200)
The original bug was reported as a different test failing. Looking
through the CI logs, that test now always passes, but fastScroll fails
unstably. The fastScroll test is already excluded on Mac, but the patch and
reason for that predates the public git history.

This is a regression since marking the entire test as insignificant,
and shows why insignification of tests should be as narrow as possible.

Narrow this one now.

Task-number: QTBUG-21098
Change-Id: I0d6c22e422af190c9e6331e123db38022af28e4b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
tests/auto/widgets/itemviews/qlistwidget/qlistwidget.pro
tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp

index de077c1..f1e2bbf 100644 (file)
@@ -4,5 +4,4 @@ QT += widgets widgets-private testlib
 QT += core-private gui-private
 SOURCES  += tst_qlistwidget.cpp
 
-contains(QT_CONFIG,xcb):CONFIG+=insignificant_test  # QTBUG-21098, fails unstably
 DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
index 79014fc..b882b56 100644 (file)
@@ -1534,8 +1534,12 @@ void tst_QListWidget::fastScroll()
     sbar->setValue(sbar->value() + sbar->singleStep());
     QApplication::processEvents();
 
+    const QSize actualItemSize = widget.painted.boundingRect().size();
+    if (actualItemSize != itemSize)
+        QEXPECT_FAIL("", "QTBUG-21098", Continue);
+
     // only one item should be repainted, the rest should be scrolled in memory
-    QCOMPARE(widget.painted.boundingRect().size(), itemSize);
+    QCOMPARE(actualItemSize, itemSize);
 }
 #endif // Q_OS_MAC