diff --git a/test/auto/qpieseries/tst_qpieseries.cpp b/test/auto/qpieseries/tst_qpieseries.cpp index 0866911..ad6486d 100644 --- a/test/auto/qpieseries/tst_qpieseries.cpp +++ b/test/auto/qpieseries/tst_qpieseries.cpp @@ -81,12 +81,12 @@ void tst_qpieseries::construction() QVERIFY(s.type() == QAbstractSeries::SeriesTypePie); QVERIFY(s.count() == 0); QVERIFY(s.isEmpty()); - QVERIFY(qFuzzyIsNull(s.sum())); - QVERIFY(qFuzzyCompare(s.horizontalPosition(), 0.5)); - QVERIFY(qFuzzyCompare(s.verticalPosition(), 0.5)); - QVERIFY(qFuzzyCompare(s.pieSize(), 0.7)); - QVERIFY(qFuzzyIsNull(s.pieStartAngle())); - QVERIFY(qFuzzyCompare(s.pieEndAngle(), 360)); + QCOMPARE(s.sum(), 0.0); + QCOMPARE(s.horizontalPosition(), 0.5); + QCOMPARE(s.verticalPosition(), 0.5); + QCOMPARE(s.pieSize(), 0.7); + QCOMPARE(s.pieStartAngle(), 0.0); + QCOMPARE(s.pieEndAngle(), 360.0); } void tst_qpieseries::append() @@ -121,14 +121,14 @@ void tst_qpieseries::append() // append with params QPieSlice *slice5 = s.append(5, "slice 5"); QVERIFY(slice5 != 0); - QVERIFY(qFuzzyCompare(slice5->value(), 5.0)); + QCOMPARE(slice5->value(), 5.0); QCOMPARE(slice5->label(), QString("slice 5")); QCOMPARE(s.count(), 5); // check slices QVERIFY(!s.isEmpty()); for (int i=0; ivalue(), (qreal) i+1)); + QCOMPARE(s.slices().at(i)->value(), (qreal) i+1); QCOMPARE(s.slices().at(i)->label(), QString("slice ") + QString::number(i+1)); } } @@ -158,7 +158,7 @@ void tst_qpieseries::insert() // check slices for (int i=0; ivalue(), (qreal) i+1)); + QCOMPARE(s.slices().at(i)->value(), (qreal) i+1); QCOMPARE(s.slices().at(i)->label(), QString("slice ") + QString::number(i+1)); } } diff --git a/test/auto/qpieslice/tst_qpieslice.cpp b/test/auto/qpieslice/tst_qpieslice.cpp index eae950d..31464eb 100644 --- a/test/auto/qpieslice/tst_qpieslice.cpp +++ b/test/auto/qpieslice/tst_qpieslice.cpp @@ -73,7 +73,7 @@ void tst_qpieslice::construction() { // no params QPieSlice slice1; - QVERIFY(qFuzzyIsNull(slice1.value())); + QCOMPARE(slice1.value(), 0.0); QVERIFY(slice1.label().isEmpty()); QVERIFY(!slice1.isLabelVisible()); QVERIFY(!slice1.isExploded()); @@ -81,15 +81,15 @@ void tst_qpieslice::construction() QCOMPARE(slice1.brush(), QBrush()); QCOMPARE(slice1.labelPen(), QPen()); QCOMPARE(slice1.labelFont(), QFont()); - QVERIFY(qFuzzyCompare(slice1.labelArmLengthFactor(), 0.15)); // default value - QVERIFY(qFuzzyCompare(slice1.explodeDistanceFactor(), 0.15)); // default value - QVERIFY(qFuzzyIsNull(slice1.percentage())); - QVERIFY(qFuzzyIsNull(slice1.startAngle())); - QVERIFY(qFuzzyIsNull(slice1.endAngle())); + QCOMPARE(slice1.labelArmLengthFactor(), 0.15); // default value + QCOMPARE(slice1.explodeDistanceFactor(), 0.15); // default value + QCOMPARE(slice1.percentage(), 0.0); + QCOMPARE(slice1.startAngle(), 0.0); + QCOMPARE(slice1.endAngle(), 0.0); // value and label params QPieSlice slice2(1.0, "foobar"); - QVERIFY(qFuzzyCompare(slice2.value(), 1.0)); + QCOMPARE(slice2.value(), 1.0); QCOMPARE(slice2.label(), QString("foobar")); QVERIFY(!slice2.isLabelVisible()); QVERIFY(!slice2.isExploded()); @@ -97,11 +97,11 @@ void tst_qpieslice::construction() QCOMPARE(slice2.brush(), QBrush()); QCOMPARE(slice2.labelPen(), QPen()); QCOMPARE(slice2.labelFont(), QFont()); - QVERIFY(qFuzzyCompare(slice2.labelArmLengthFactor(), 0.15)); // default value - QVERIFY(qFuzzyCompare(slice2.explodeDistanceFactor(), 0.15)); // default value - QVERIFY(qFuzzyIsNull(slice2.percentage())); - QVERIFY(qFuzzyIsNull(slice2.startAngle())); - QVERIFY(qFuzzyIsNull(slice2.endAngle())); + QCOMPARE(slice2.labelArmLengthFactor(), 0.15); // default value + QCOMPARE(slice2.explodeDistanceFactor(), 0.15); // default value + QCOMPARE(slice2.percentage(), 0.0); + QCOMPARE(slice2.startAngle(), 0.0); + QCOMPARE(slice2.endAngle(), 0.0); } void tst_qpieslice::changedSignals()