##// END OF EJS Templates
Remove qFuzzyXXX functions from pie tests...
Jani Honkonen -
r1125:c9748473060a
parent child
Show More
@@ -81,12 +81,12 void tst_qpieseries::construction()
81 QVERIFY(s.type() == QAbstractSeries::SeriesTypePie);
81 QVERIFY(s.type() == QAbstractSeries::SeriesTypePie);
82 QVERIFY(s.count() == 0);
82 QVERIFY(s.count() == 0);
83 QVERIFY(s.isEmpty());
83 QVERIFY(s.isEmpty());
84 QVERIFY(qFuzzyIsNull(s.sum()));
84 QCOMPARE(s.sum(), 0.0);
85 QVERIFY(qFuzzyCompare(s.horizontalPosition(), 0.5));
85 QCOMPARE(s.horizontalPosition(), 0.5);
86 QVERIFY(qFuzzyCompare(s.verticalPosition(), 0.5));
86 QCOMPARE(s.verticalPosition(), 0.5);
87 QVERIFY(qFuzzyCompare(s.pieSize(), 0.7));
87 QCOMPARE(s.pieSize(), 0.7);
88 QVERIFY(qFuzzyIsNull(s.pieStartAngle()));
88 QCOMPARE(s.pieStartAngle(), 0.0);
89 QVERIFY(qFuzzyCompare(s.pieEndAngle(), 360));
89 QCOMPARE(s.pieEndAngle(), 360.0);
90 }
90 }
91
91
92 void tst_qpieseries::append()
92 void tst_qpieseries::append()
@@ -121,14 +121,14 void tst_qpieseries::append()
121 // append with params
121 // append with params
122 QPieSlice *slice5 = s.append(5, "slice 5");
122 QPieSlice *slice5 = s.append(5, "slice 5");
123 QVERIFY(slice5 != 0);
123 QVERIFY(slice5 != 0);
124 QVERIFY(qFuzzyCompare(slice5->value(), 5.0));
124 QCOMPARE(slice5->value(), 5.0);
125 QCOMPARE(slice5->label(), QString("slice 5"));
125 QCOMPARE(slice5->label(), QString("slice 5"));
126 QCOMPARE(s.count(), 5);
126 QCOMPARE(s.count(), 5);
127
127
128 // check slices
128 // check slices
129 QVERIFY(!s.isEmpty());
129 QVERIFY(!s.isEmpty());
130 for (int i=0; i<s.count(); i++) {
130 for (int i=0; i<s.count(); i++) {
131 QVERIFY(qFuzzyCompare(s.slices().at(i)->value(), (qreal) i+1));
131 QCOMPARE(s.slices().at(i)->value(), (qreal) i+1);
132 QCOMPARE(s.slices().at(i)->label(), QString("slice ") + QString::number(i+1));
132 QCOMPARE(s.slices().at(i)->label(), QString("slice ") + QString::number(i+1));
133 }
133 }
134 }
134 }
@@ -158,7 +158,7 void tst_qpieseries::insert()
158
158
159 // check slices
159 // check slices
160 for (int i=0; i<s.count(); i++) {
160 for (int i=0; i<s.count(); i++) {
161 QVERIFY(qFuzzyCompare(s.slices().at(i)->value(), (qreal) i+1));
161 QCOMPARE(s.slices().at(i)->value(), (qreal) i+1);
162 QCOMPARE(s.slices().at(i)->label(), QString("slice ") + QString::number(i+1));
162 QCOMPARE(s.slices().at(i)->label(), QString("slice ") + QString::number(i+1));
163 }
163 }
164 }
164 }
@@ -73,7 +73,7 void tst_qpieslice::construction()
73 {
73 {
74 // no params
74 // no params
75 QPieSlice slice1;
75 QPieSlice slice1;
76 QVERIFY(qFuzzyIsNull(slice1.value()));
76 QCOMPARE(slice1.value(), 0.0);
77 QVERIFY(slice1.label().isEmpty());
77 QVERIFY(slice1.label().isEmpty());
78 QVERIFY(!slice1.isLabelVisible());
78 QVERIFY(!slice1.isLabelVisible());
79 QVERIFY(!slice1.isExploded());
79 QVERIFY(!slice1.isExploded());
@@ -81,15 +81,15 void tst_qpieslice::construction()
81 QCOMPARE(slice1.brush(), QBrush());
81 QCOMPARE(slice1.brush(), QBrush());
82 QCOMPARE(slice1.labelPen(), QPen());
82 QCOMPARE(slice1.labelPen(), QPen());
83 QCOMPARE(slice1.labelFont(), QFont());
83 QCOMPARE(slice1.labelFont(), QFont());
84 QVERIFY(qFuzzyCompare(slice1.labelArmLengthFactor(), 0.15)); // default value
84 QCOMPARE(slice1.labelArmLengthFactor(), 0.15); // default value
85 QVERIFY(qFuzzyCompare(slice1.explodeDistanceFactor(), 0.15)); // default value
85 QCOMPARE(slice1.explodeDistanceFactor(), 0.15); // default value
86 QVERIFY(qFuzzyIsNull(slice1.percentage()));
86 QCOMPARE(slice1.percentage(), 0.0);
87 QVERIFY(qFuzzyIsNull(slice1.startAngle()));
87 QCOMPARE(slice1.startAngle(), 0.0);
88 QVERIFY(qFuzzyIsNull(slice1.endAngle()));
88 QCOMPARE(slice1.endAngle(), 0.0);
89
89
90 // value and label params
90 // value and label params
91 QPieSlice slice2(1.0, "foobar");
91 QPieSlice slice2(1.0, "foobar");
92 QVERIFY(qFuzzyCompare(slice2.value(), 1.0));
92 QCOMPARE(slice2.value(), 1.0);
93 QCOMPARE(slice2.label(), QString("foobar"));
93 QCOMPARE(slice2.label(), QString("foobar"));
94 QVERIFY(!slice2.isLabelVisible());
94 QVERIFY(!slice2.isLabelVisible());
95 QVERIFY(!slice2.isExploded());
95 QVERIFY(!slice2.isExploded());
@@ -97,11 +97,11 void tst_qpieslice::construction()
97 QCOMPARE(slice2.brush(), QBrush());
97 QCOMPARE(slice2.brush(), QBrush());
98 QCOMPARE(slice2.labelPen(), QPen());
98 QCOMPARE(slice2.labelPen(), QPen());
99 QCOMPARE(slice2.labelFont(), QFont());
99 QCOMPARE(slice2.labelFont(), QFont());
100 QVERIFY(qFuzzyCompare(slice2.labelArmLengthFactor(), 0.15)); // default value
100 QCOMPARE(slice2.labelArmLengthFactor(), 0.15); // default value
101 QVERIFY(qFuzzyCompare(slice2.explodeDistanceFactor(), 0.15)); // default value
101 QCOMPARE(slice2.explodeDistanceFactor(), 0.15); // default value
102 QVERIFY(qFuzzyIsNull(slice2.percentage()));
102 QCOMPARE(slice2.percentage(), 0.0);
103 QVERIFY(qFuzzyIsNull(slice2.startAngle()));
103 QCOMPARE(slice2.startAngle(), 0.0);
104 QVERIFY(qFuzzyIsNull(slice2.endAngle()));
104 QCOMPARE(slice2.endAngle(), 0.0);
105 }
105 }
106
106
107 void tst_qpieslice::changedSignals()
107 void tst_qpieslice::changedSignals()
General Comments 0
You need to be logged in to leave comments. Login now