Improve QWidget autotest
authorJason McDonald <jason.mcdonald@nokia.com>
Mon, 31 Oct 2011 07:44:11 +0000 (17:44 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 1 Nov 2011 03:58:51 +0000 (04:58 +0100)
There are two cases where a QCOMPARE may fail on some platforms. Rather
than disabling the QCOMPAREs with "#if 0", use QEXPECT_FAIL so that we
can look in the CI logs to see which platforms fail.

Change-Id: Ife93c8032e01a04e8068bf213e2040778c12f711
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp

index c508c15..3cd656d 100644 (file)
@@ -1932,10 +1932,10 @@ void tst_QWidget::showMaximized()
     QVERIFY(!(layouted.windowState() & Qt::WindowMaximized));
 
     // ### fixme: embedded may choose a different size to fit on the screen.
-    // Check platforms (QTBUG-22326)
-#if 0
+    if (layouted.size() != layouted.sizeHint())
+        QEXPECT_FAIL("", "QTBUG-22326", Continue);
     QCOMPARE(layouted.size(), layouted.sizeHint());
-#endif
+
     layouted.showMaximized();
     QVERIFY(layouted.isMaximized());
     QVERIFY(layouted.isVisible());
@@ -2009,10 +2009,10 @@ void tst_QWidget::showFullScreen()
     layouted.showNormal();
     QVERIFY(!(layouted.windowState() & Qt::WindowFullScreen));
 
-    // ### fixme: embedded may choose a different size to fit on the screen. (QTBUG-22326)
-#if 0
+    // ### fixme: embedded may choose a different size to fit on the screen.
+    if (layouted.size() != layouted.sizeHint())
+        QEXPECT_FAIL("", "QTBUG-22326", Continue);
     QCOMPARE(layouted.size(), layouted.sizeHint());
-#endif
 
     layouted.showFullScreen();
     QVERIFY(layouted.isFullScreen());