##// END OF EJS Templates
QAbstractAxis: fixed tests after renaming
Marek Rosa -
r1845:0282556dc0a1
parent child
Show More
@@ -34,7 +34,7 class QTCOMMERCIALCHART_EXPORT QAbstractAxis : public QObject
34 {
34 {
35 Q_OBJECT
35 Q_OBJECT
36 Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
36 Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
37 Q_PROPERTY(bool arrowVisible READ isLineVisible WRITE setLineVisible NOTIFY lineVisibleChanged)
37 Q_PROPERTY(bool lineVisible READ isLineVisible WRITE setLineVisible NOTIFY lineVisibleChanged)
38 Q_PROPERTY(QColor color READ linePenColor WRITE setLinePenColor NOTIFY colorChanged)
38 Q_PROPERTY(QColor color READ linePenColor WRITE setLinePenColor NOTIFY colorChanged)
39 Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged)
39 Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged)
40 Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle)
40 Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle)
@@ -104,7 +104,7 void tst_QAbstractAxis::axisPen()
104 {
104 {
105 QFETCH(QPen, axisPen);
105 QFETCH(QPen, axisPen);
106
106
107 QSignalSpy spy0(m_axis, SIGNAL(arrowVisibleChanged(bool)));
107 QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool)));
108 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
108 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
109 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
109 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
110 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
110 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
@@ -157,7 +157,7 void tst_QAbstractAxis::gridLinePen()
157 {
157 {
158 QFETCH(QPen, gridLinePen);
158 QFETCH(QPen, gridLinePen);
159
159
160 QSignalSpy spy0(m_axis, SIGNAL(arrowVisibleChanged(bool)));
160 QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool)));
161 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
161 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
162 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
162 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
163 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
163 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
@@ -186,20 +186,20 void tst_QAbstractAxis::gridLinePen()
186 //TODO QCOMPARE(m_axis->gridLinePen(), gridLinePen);
186 //TODO QCOMPARE(m_axis->gridLinePen(), gridLinePen);
187 }
187 }
188
188
189 void tst_QAbstractAxis::arrowVisible_data()
189 void tst_QAbstractAxis::lineVisible_data()
190 {
190 {
191 QTest::addColumn<bool>("arrowVisible");
191 QTest::addColumn<bool>("lineVisible");
192 QTest::newRow("true") << true;
192 QTest::newRow("true") << true;
193 QTest::newRow("false") << false;
193 QTest::newRow("false") << false;
194 }
194 }
195
195
196 void tst_QAbstractAxis::arrowVisible()
196 void tst_QAbstractAxis::lineVisible()
197 {
197 {
198 QFETCH(bool, arrowVisible);
198 QFETCH(bool, lineVisible);
199
199
200 m_axis->setLineVisible(!arrowVisible);
200 m_axis->setLineVisible(!lineVisible);
201
201
202 QSignalSpy spy0(m_axis, SIGNAL(arrowVisibleChanged(bool)));
202 QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool)));
203 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
203 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
204 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
204 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
205 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
205 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
@@ -209,8 +209,8 void tst_QAbstractAxis::arrowVisible()
209 QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool)));
209 QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool)));
210 QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool)));
210 QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool)));
211
211
212 m_axis->setLineVisible(arrowVisible);
212 m_axis->setLineVisible(lineVisible);
213 QCOMPARE(m_axis->isLineVisible(), arrowVisible);
213 QCOMPARE(m_axis->isLineVisible(), lineVisible);
214
214
215 QCOMPARE(spy0.count(), 1);
215 QCOMPARE(spy0.count(), 1);
216 QCOMPARE(spy1.count(), 0);
216 QCOMPARE(spy1.count(), 0);
@@ -225,7 +225,7 void tst_QAbstractAxis::arrowVisible()
225 m_chart->setAxisX(m_axis, m_series);
225 m_chart->setAxisX(m_axis, m_series);
226 m_view->show();
226 m_view->show();
227 QTest::qWaitForWindowShown(m_view);
227 QTest::qWaitForWindowShown(m_view);
228 QCOMPARE(m_axis->isLineVisible(), arrowVisible);
228 QCOMPARE(m_axis->isLineVisible(), lineVisible);
229 }
229 }
230
230
231 void tst_QAbstractAxis::gridLineVisible_data()
231 void tst_QAbstractAxis::gridLineVisible_data()
@@ -241,7 +241,7 void tst_QAbstractAxis::gridLineVisible()
241
241
242 m_axis->setGridLineVisible(!gridLineVisible);
242 m_axis->setGridLineVisible(!gridLineVisible);
243
243
244 QSignalSpy spy0(m_axis, SIGNAL(arrowVisibleChanged(bool)));
244 QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool)));
245 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
245 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
246 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
246 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
247 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
247 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
@@ -284,7 +284,7 void tst_QAbstractAxis::visible()
284
284
285 m_axis->setVisible(!visible);
285 m_axis->setVisible(!visible);
286
286
287 QSignalSpy spy0(m_axis, SIGNAL(arrowVisibleChanged(bool)));
287 QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool)));
288 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
288 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
289 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
289 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
290 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
290 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
@@ -325,7 +325,7 void tst_QAbstractAxis::labelsAngle()
325 {
325 {
326 QFETCH(int, labelsAngle);
326 QFETCH(int, labelsAngle);
327
327
328 QSignalSpy spy0(m_axis, SIGNAL(arrowVisibleChanged(bool)));
328 QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool)));
329 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
329 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
330 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
330 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
331 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
331 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
@@ -368,7 +368,7 void tst_QAbstractAxis::labelsBrush()
368
368
369 QFETCH(QBrush, labelsBrush);
369 QFETCH(QBrush, labelsBrush);
370
370
371 QSignalSpy spy0(m_axis, SIGNAL(arrowVisibleChanged(bool)));
371 QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool)));
372 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
372 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
373 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
373 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
374 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
374 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
@@ -419,7 +419,7 void tst_QAbstractAxis::labelsFont()
419
419
420 QFETCH(QFont, labelsFont);
420 QFETCH(QFont, labelsFont);
421
421
422 QSignalSpy spy0(m_axis, SIGNAL(arrowVisibleChanged(bool)));
422 QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool)));
423 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
423 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
424 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
424 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
425 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
425 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
@@ -461,7 +461,7 void tst_QAbstractAxis::labelsPen()
461 {
461 {
462 QFETCH(QPen, labelsPen);
462 QFETCH(QPen, labelsPen);
463
463
464 QSignalSpy spy0(m_axis, SIGNAL(arrowVisibleChanged(bool)));
464 QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool)));
465 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
465 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
466 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
466 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
467 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
467 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
@@ -503,7 +503,7 void tst_QAbstractAxis::labelsVisible()
503
503
504 m_axis->setLabelsVisible(!labelsVisible);
504 m_axis->setLabelsVisible(!labelsVisible);
505
505
506 QSignalSpy spy0(m_axis, SIGNAL(arrowVisibleChanged(bool)));
506 QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool)));
507 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
507 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
508 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
508 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
509 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
509 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
@@ -543,7 +543,7 void tst_QAbstractAxis::orientation()
543 {
543 {
544 QFETCH(Qt::Orientation, orientation);
544 QFETCH(Qt::Orientation, orientation);
545
545
546 QSignalSpy spy0(m_axis, SIGNAL(arrowVisibleChanged(bool)));
546 QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool)));
547 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
547 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
548 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
548 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
549 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
549 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
@@ -644,7 +644,7 void tst_QAbstractAxis::shadesBrush()
644 {
644 {
645 QFETCH(QBrush, shadesBrush);
645 QFETCH(QBrush, shadesBrush);
646
646
647 QSignalSpy spy0(m_axis, SIGNAL(arrowVisibleChanged(bool)));
647 QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool)));
648 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
648 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
649 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
649 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
650 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
650 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
@@ -695,7 +695,7 void tst_QAbstractAxis::shadesPen()
695 {
695 {
696 QFETCH(QPen, shadesPen);
696 QFETCH(QPen, shadesPen);
697
697
698 QSignalSpy spy0(m_axis, SIGNAL(arrowVisibleChanged(bool)));
698 QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool)));
699 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
699 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
700 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
700 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
701 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
701 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
@@ -737,7 +737,7 void tst_QAbstractAxis::shadesVisible()
737
737
738 m_axis->setShadesVisible(!shadesVisible);
738 m_axis->setShadesVisible(!shadesVisible);
739
739
740 QSignalSpy spy0(m_axis, SIGNAL(arrowVisibleChanged(bool)));
740 QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool)));
741 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
741 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
742 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
742 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
743 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
743 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
@@ -776,7 +776,7 void tst_QAbstractAxis::show()
776 m_axis->hide();
776 m_axis->hide();
777 QCOMPARE(m_axis->isVisible(), false);
777 QCOMPARE(m_axis->isVisible(), false);
778
778
779 QSignalSpy spy0(m_axis, SIGNAL(arrowVisibleChanged(bool)));
779 QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool)));
780 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
780 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
781 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
781 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
782 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
782 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
@@ -810,7 +810,7 void tst_QAbstractAxis::hide()
810 m_axis->show();
810 m_axis->show();
811 QCOMPARE(m_axis->isVisible(),true);
811 QCOMPARE(m_axis->isVisible(),true);
812
812
813 QSignalSpy spy0(m_axis, SIGNAL(arrowVisibleChanged(bool)));
813 QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool)));
814 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
814 QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor)));
815 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
815 QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool)));
816 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
816 QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor)));
@@ -45,8 +45,8 private slots:
45 void axisPenColor();
45 void axisPenColor();
46 void gridLinePen_data();
46 void gridLinePen_data();
47 void gridLinePen();
47 void gridLinePen();
48 void arrowVisible_data();
48 void lineVisible_data();
49 void arrowVisible();
49 void lineVisible();
50 void gridLineVisible_data();
50 void gridLineVisible_data();
51 void gridLineVisible();
51 void gridLineVisible();
52 void visible_data();
52 void visible_data();
General Comments 0
You need to be logged in to leave comments. Login now