From 76052c676e63d80fe9aae08aabd3272c80c3ff2e Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 19 Aug 2015 00:44:26 +0200 Subject: unittest fix: compare floats/doubles rather than strings-made-from-floats/doubles. Qt 5.5 writes out "123.567001" for 123.567f. No matter, what we want is the roundtrip float-string-float to work, and it does. --- autotests/kconfigtest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'autotests/kconfigtest.cpp') diff --git a/autotests/kconfigtest.cpp b/autotests/kconfigtest.cpp index 9e1c09e3..9a299864 100644 --- a/autotests/kconfigtest.cpp +++ b/autotests/kconfigtest.cpp @@ -614,8 +614,8 @@ void KConfigTest::testEntryMap() QCOMPARE(entryMap.value("boolEntry2"), QString(BOOLENTRY2 ? "true" : "false")); QCOMPARE(entryMap.value("keywith=equalsign"), QString(STRINGENTRY1)); QCOMPARE(entryMap.value("byteArrayEntry1"), QString(STRINGENTRY1)); - QCOMPARE(entryMap.value("doubleEntry1"), QString::number(DOUBLEENTRY, 'g', 15)); - QCOMPARE(entryMap.value("floatEntry1"), QString::number(FLOATENTRY, 'g', 8)); + QCOMPARE(entryMap.value("doubleEntry1").toDouble(), DOUBLEENTRY); + QCOMPARE(entryMap.value("floatEntry1").toFloat(), FLOATENTRY); } void KConfigTest::testInvalid() -- cgit v1.2.1