Fix unit test failure
authorChris Adams <christopher.adams@nokia.com>
Fri, 19 Aug 2011 03:13:26 +0000 (13:13 +1000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 19 Aug 2011 04:18:52 +0000 (06:18 +0200)
Previously had hardcoded tostring comparison value for QFont, but on
some platforms the default styleHint may be different.  This commit
ensures that the comparison value is generated properly rather than
hardcoded.

Task-number: QTBUG-21003
Change-Id: I49229863b10bf5fb96248b9334b66d7b1ef46676
Reviewed-on: http://codereview.qt.nokia.com/3237
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
tests/auto/declarative/qdeclarativevaluetypes/tst_qdeclarativevaluetypes.cpp

index 89d0e7e..3ccd5cb 100644 (file)
@@ -794,7 +794,7 @@ void tst_qdeclarativevaluetypes::font()
         MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
         QVERIFY(object != 0);
 
-        QString tostring = QLatin1String("QFont(Arial,29,-1,0,63,1,1,1,0,0)");
+        QString tostring = QLatin1String("QFont(") + object->font().toString() + QLatin1Char(')');
         QCOMPARE(object->property("tostring").toString(), tostring);
         QCOMPARE(object->property("equalsString").toBool(), true);
         QCOMPARE(object->property("equalsColor").toBool(), false);