Fix tst_QStyleSheetStyle::qproperty to not implicitly rely on QHash ordering.
authorRobin Burchell <robin+qt@viroteck.net>
Mon, 5 Mar 2012 11:31:03 +0000 (12:31 +0100)
committerQt by Nokia <qt-info@nokia.com>
Mon, 5 Mar 2012 13:09:24 +0000 (14:09 +0100)
Changing qHash() for string data affected the order of properties to be set,
causing 'checkable' to be set after 'checked'.

As 'checkable' state affects 'checked' as well (setting it to false), this means
that the test was unreliable, a bug, which was exposed by the qHash change.

Change-Id: I03a8dd7d07609683d99f0b2a40012a147d409c6e
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp

index 1201b0f..8f18719 100644 (file)
@@ -555,11 +555,11 @@ void tst_QStyleSheetStyle::layoutSpacing()
 void tst_QStyleSheetStyle::qproperty()
 {
     QPushButton pb;
-    pb.setStyleSheet("QPushButton { qproperty-text: hello; qproperty-checkable: true; qproperty-checked: 1}");
+    pb.setStyleSheet("QPushButton { qproperty-text: hello; qproperty-checkable: 1; qproperty-checked: false}");
     pb.ensurePolished();
     QCOMPARE(pb.text(), QString("hello"));
     QCOMPARE(pb.isCheckable(), true);
-    QCOMPARE(pb.isChecked(), true);
+    QCOMPARE(pb.isChecked(), false);
 }
 
 namespace ns {