diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-05-29 15:04:38 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-05-29 16:28:13 +0200 |
commit | 7ac67ff82586cb9dd1afdf4c8030ace760b2a132 (patch) | |
tree | c0732ff45f2d85f5034de1ba4268fe05f0f84efd | |
parent | 6fbb74cc47202b05a961bf8825a6bd17815b8874 (diff) |
Fix test to not depend on internal rounding
Pick-to: 5.15
Change-Id: I3c66cb52b435a891d88a5e1c9d1db155d63e2481
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r-- | tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp index 7c75743311..f2e43571d8 100644 --- a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp +++ b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp @@ -1008,7 +1008,12 @@ void tst_qqmlvaluetypes::color() QQmlComponent component(&engine, testFileUrl("color_compare.qml")); MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create()); QVERIFY(object != nullptr); - QString colorString("#5733e199"); + QColor comparison; + comparison.setRedF(0.2); + comparison.setGreenF(0.88); + comparison.setBlueF(0.6); + comparison.setAlphaF(0.34); + QString colorString = comparison.name(QColor::HexArgb); QCOMPARE(object->property("colorToString").toString(), colorString); QCOMPARE(object->property("colorEqualsIdenticalRgba").toBool(), true); QCOMPARE(object->property("colorEqualsDifferentAlpha").toBool(), false); |