@@ -1,585 +1,585 | |||||
1 | #include <QtTest/QtTest> |
|
1 | #include <QtTest/QtTest> | |
2 | #include <qchartview.h> |
|
2 | #include <qchartview.h> | |
3 | #include <qlineseries.h> |
|
3 | #include <qlineseries.h> | |
4 | #include <qareaseries.h> |
|
4 | #include <qareaseries.h> | |
5 | #include <qscatterseries.h> |
|
5 | #include <qscatterseries.h> | |
6 | #include <qsplineseries.h> |
|
6 | #include <qsplineseries.h> | |
7 | #include <qpieseries.h> |
|
7 | #include <qpieseries.h> | |
8 | #include <qbarseries.h> |
|
8 | #include <qbarseries.h> | |
9 | #include <qpercentbarseries.h> |
|
9 | #include <qpercentbarseries.h> | |
10 | #include <qstackedbarseries.h> |
|
10 | #include <qstackedbarseries.h> | |
11 |
|
11 | |||
12 | QTCOMMERCIALCHART_USE_NAMESPACE |
|
12 | QTCOMMERCIALCHART_USE_NAMESPACE | |
13 |
|
13 | |||
14 | Q_DECLARE_METATYPE(QAxis *) |
|
14 | Q_DECLARE_METATYPE(QAxis *) | |
15 | Q_DECLARE_METATYPE(QAbstractSeries *) |
|
15 | Q_DECLARE_METATYPE(QAbstractSeries *) | |
16 | Q_DECLARE_METATYPE(QChart::AnimationOption) |
|
16 | Q_DECLARE_METATYPE(QChart::AnimationOption) | |
17 | Q_DECLARE_METATYPE(QBrush) |
|
17 | Q_DECLARE_METATYPE(QBrush) | |
18 | Q_DECLARE_METATYPE(QPen) |
|
18 | Q_DECLARE_METATYPE(QPen) | |
19 | Q_DECLARE_METATYPE(QChart::ChartTheme) |
|
19 | Q_DECLARE_METATYPE(QChart::ChartTheme) | |
20 |
|
20 | |||
21 | class tst_QChart : public QObject |
|
21 | class tst_QChart : public QObject | |
22 | { |
|
22 | { | |
23 | Q_OBJECT |
|
23 | Q_OBJECT | |
24 |
|
24 | |||
25 | public slots: |
|
25 | public slots: | |
26 | void initTestCase(); |
|
26 | void initTestCase(); | |
27 | void cleanupTestCase(); |
|
27 | void cleanupTestCase(); | |
28 | void init(); |
|
28 | void init(); | |
29 | void cleanup(); |
|
29 | void cleanup(); | |
30 |
|
30 | |||
31 | private slots: |
|
31 | private slots: | |
32 | void qchart_data(); |
|
32 | void qchart_data(); | |
33 | void qchart(); |
|
33 | void qchart(); | |
34 |
|
34 | |||
35 | void addSeries_data(); |
|
35 | void addSeries_data(); | |
36 | void addSeries(); |
|
36 | void addSeries(); | |
37 | void animationOptions_data(); |
|
37 | void animationOptions_data(); | |
38 | void animationOptions(); |
|
38 | void animationOptions(); | |
39 | void axisX_data(); |
|
39 | void axisX_data(); | |
40 | void axisX(); |
|
40 | void axisX(); | |
41 | void axisY_data(); |
|
41 | void axisY_data(); | |
42 | void axisY(); |
|
42 | void axisY(); | |
43 | void backgroundBrush_data(); |
|
43 | void backgroundBrush_data(); | |
44 | void backgroundBrush(); |
|
44 | void backgroundBrush(); | |
45 | void backgroundPen_data(); |
|
45 | void backgroundPen_data(); | |
46 | void backgroundPen(); |
|
46 | void backgroundPen(); | |
47 | void isBackgroundVisible_data(); |
|
47 | void isBackgroundVisible_data(); | |
48 | void isBackgroundVisible(); |
|
48 | void isBackgroundVisible(); | |
49 | void legend_data(); |
|
49 | void legend_data(); | |
50 | void legend(); |
|
50 | void legend(); | |
51 | void margins_data(); |
|
51 | void margins_data(); | |
52 | void margins(); |
|
52 | void margins(); | |
53 | void removeAllSeries_data(); |
|
53 | void removeAllSeries_data(); | |
54 | void removeAllSeries(); |
|
54 | void removeAllSeries(); | |
55 | void removeSeries_data(); |
|
55 | void removeSeries_data(); | |
56 | void removeSeries(); |
|
56 | void removeSeries(); | |
57 | void scrollDown_data(); |
|
57 | void scrollDown_data(); | |
58 | void scrollDown(); |
|
58 | void scrollDown(); | |
59 | void scrollLeft_data(); |
|
59 | void scrollLeft_data(); | |
60 | void scrollLeft(); |
|
60 | void scrollLeft(); | |
61 | void scrollRight_data(); |
|
61 | void scrollRight_data(); | |
62 | void scrollRight(); |
|
62 | void scrollRight(); | |
63 | void scrollUp_data(); |
|
63 | void scrollUp_data(); | |
64 | void scrollUp(); |
|
64 | void scrollUp(); | |
65 | void theme_data(); |
|
65 | void theme_data(); | |
66 | void theme(); |
|
66 | void theme(); | |
67 | void title_data(); |
|
67 | void title_data(); | |
68 | void title(); |
|
68 | void title(); | |
69 | void titleBrush_data(); |
|
69 | void titleBrush_data(); | |
70 | void titleBrush(); |
|
70 | void titleBrush(); | |
71 | void titleFont_data(); |
|
71 | void titleFont_data(); | |
72 | void titleFont(); |
|
72 | void titleFont(); | |
73 | void zoomIn_data(); |
|
73 | void zoomIn_data(); | |
74 | void zoomIn(); |
|
74 | void zoomIn(); | |
75 | void zoomOut_data(); |
|
75 | void zoomOut_data(); | |
76 | void zoomOut(); |
|
76 | void zoomOut(); | |
77 |
|
77 | |||
78 | private: |
|
78 | private: | |
79 | void createTestData(); |
|
79 | void createTestData(); | |
80 |
|
80 | |||
81 | private: |
|
81 | private: | |
82 | QChartView* m_view; |
|
82 | QChartView* m_view; | |
83 | QChart* m_chart; |
|
83 | QChart* m_chart; | |
84 | }; |
|
84 | }; | |
85 |
|
85 | |||
86 | void tst_QChart::initTestCase() |
|
86 | void tst_QChart::initTestCase() | |
87 | { |
|
87 | { | |
88 |
|
88 | |||
89 | } |
|
89 | } | |
90 |
|
90 | |||
91 | void tst_QChart::cleanupTestCase() |
|
91 | void tst_QChart::cleanupTestCase() | |
92 | { |
|
92 | { | |
93 |
|
93 | |||
94 | } |
|
94 | } | |
95 |
|
95 | |||
96 | void tst_QChart::init() |
|
96 | void tst_QChart::init() | |
97 | { |
|
97 | { | |
98 | m_view = new QChartView(new QChart()); |
|
98 | m_view = new QChartView(new QChart()); | |
99 | m_chart = m_view->chart(); |
|
99 | m_chart = m_view->chart(); | |
100 | } |
|
100 | } | |
101 |
|
101 | |||
102 | void tst_QChart::createTestData() |
|
102 | void tst_QChart::createTestData() | |
103 | { |
|
103 | { | |
104 | QLineSeries* series0 = new QLineSeries(this); |
|
104 | QLineSeries* series0 = new QLineSeries(this); | |
105 | *series0 << QPointF(0, 0) << QPointF(100, 100); |
|
105 | *series0 << QPointF(0, 0) << QPointF(100, 100); | |
106 | m_chart->addSeries(series0); |
|
106 | m_chart->addSeries(series0); | |
107 | m_view->show(); |
|
107 | m_view->show(); | |
108 | QTest::qWaitForWindowShown(m_view); |
|
108 | QTest::qWaitForWindowShown(m_view); | |
109 | } |
|
109 | } | |
110 |
|
110 | |||
111 | void tst_QChart::cleanup() |
|
111 | void tst_QChart::cleanup() | |
112 | { |
|
112 | { | |
113 | delete m_view; |
|
113 | delete m_view; | |
114 | m_view = 0; |
|
114 | m_view = 0; | |
115 | m_chart = 0; |
|
115 | m_chart = 0; | |
116 | } |
|
116 | } | |
117 |
|
117 | |||
118 | void tst_QChart::qchart_data() |
|
118 | void tst_QChart::qchart_data() | |
119 | { |
|
119 | { | |
120 | } |
|
120 | } | |
121 |
|
121 | |||
122 | void tst_QChart::qchart() |
|
122 | void tst_QChart::qchart() | |
123 | { |
|
123 | { | |
124 | QVERIFY(m_chart); |
|
124 | QVERIFY(m_chart); | |
125 | QVERIFY(m_chart->legend()); |
|
125 | QVERIFY(m_chart->legend()); | |
126 |
QVERIFY( |
|
126 | QVERIFY(m_chart->legend()->isVisible()); | |
127 |
|
127 | |||
128 | QCOMPARE(m_chart->animationOptions(), QChart::NoAnimation); |
|
128 | QCOMPARE(m_chart->animationOptions(), QChart::NoAnimation); | |
129 | QVERIFY(m_chart->axisX()); |
|
129 | QVERIFY(m_chart->axisX()); | |
130 | QVERIFY(m_chart->axisY()); |
|
130 | QVERIFY(m_chart->axisY()); | |
131 | QVERIFY(m_chart->backgroundBrush()!=QBrush()); |
|
131 | QVERIFY(m_chart->backgroundBrush()!=QBrush()); | |
132 | QVERIFY(m_chart->backgroundPen()!=QPen()); |
|
132 | QVERIFY(m_chart->backgroundPen()!=QPen()); | |
133 | QCOMPARE(m_chart->isBackgroundVisible(), true); |
|
133 | QCOMPARE(m_chart->isBackgroundVisible(), true); | |
134 |
|
134 | |||
135 | QVERIFY(m_chart->margins().top()>0); |
|
135 | QVERIFY(m_chart->margins().top()>0); | |
136 | QVERIFY(m_chart->margins().left()>0); |
|
136 | QVERIFY(m_chart->margins().left()>0); | |
137 | QVERIFY(m_chart->margins().right()>0); |
|
137 | QVERIFY(m_chart->margins().right()>0); | |
138 | QVERIFY(m_chart->margins().bottom()>0); |
|
138 | QVERIFY(m_chart->margins().bottom()>0); | |
139 |
|
139 | |||
140 | QCOMPARE(m_chart->theme(), QChart::ChartThemeLight); |
|
140 | QCOMPARE(m_chart->theme(), QChart::ChartThemeLight); | |
141 | QCOMPARE(m_chart->title(), QString()); |
|
141 | QCOMPARE(m_chart->title(), QString()); | |
142 |
|
142 | |||
143 | //QCOMPARE(m_chart->titleBrush(),QBrush()); |
|
143 | //QCOMPARE(m_chart->titleBrush(),QBrush()); | |
144 | //QCOMPARE(m_chart->titleFont(),QFont()); |
|
144 | //QCOMPARE(m_chart->titleFont(),QFont()); | |
145 |
|
145 | |||
146 | m_chart->removeAllSeries(); |
|
146 | m_chart->removeAllSeries(); | |
147 | m_chart->scrollDown(); |
|
147 | m_chart->scrollDown(); | |
148 | m_chart->scrollLeft(); |
|
148 | m_chart->scrollLeft(); | |
149 | m_chart->scrollRight(); |
|
149 | m_chart->scrollRight(); | |
150 | m_chart->scrollUp(); |
|
150 | m_chart->scrollUp(); | |
151 |
|
151 | |||
152 | m_chart->zoomIn(); |
|
152 | m_chart->zoomIn(); | |
153 | m_chart->zoomIn(QRectF()); |
|
153 | m_chart->zoomIn(QRectF()); | |
154 | m_chart->zoomOut(); |
|
154 | m_chart->zoomOut(); | |
155 | } |
|
155 | } | |
156 |
|
156 | |||
157 | void tst_QChart::addSeries_data() |
|
157 | void tst_QChart::addSeries_data() | |
158 | { |
|
158 | { | |
159 | QTest::addColumn<QAbstractSeries *>("series"); |
|
159 | QTest::addColumn<QAbstractSeries *>("series"); | |
160 | QTest::addColumn<QAxis *>("axis"); |
|
160 | QTest::addColumn<QAxis *>("axis"); | |
161 |
|
161 | |||
162 | QAbstractSeries* series0 = new QLineSeries(this); |
|
162 | QAbstractSeries* series0 = new QLineSeries(this); | |
163 | QAbstractSeries* series1 = new QAreaSeries(static_cast<QLineSeries*>(series0)); |
|
163 | QAbstractSeries* series1 = new QAreaSeries(static_cast<QLineSeries*>(series0)); | |
164 | QAbstractSeries* series2 = new QScatterSeries(this); |
|
164 | QAbstractSeries* series2 = new QScatterSeries(this); | |
165 | QAbstractSeries* series3 = new QSplineSeries(this); |
|
165 | QAbstractSeries* series3 = new QSplineSeries(this); | |
166 | QAbstractSeries* series4 = new QPieSeries(this); |
|
166 | QAbstractSeries* series4 = new QPieSeries(this); | |
167 | QAbstractSeries* series5 = new QBarSeries(this); |
|
167 | QAbstractSeries* series5 = new QBarSeries(this); | |
168 | QAbstractSeries* series6 = new QPercentBarSeries(this); |
|
168 | QAbstractSeries* series6 = new QPercentBarSeries(this); | |
169 | QAbstractSeries* series7 = new QStackedBarSeries(this); |
|
169 | QAbstractSeries* series7 = new QStackedBarSeries(this); | |
170 |
|
170 | |||
171 | QBarSeries* s5 = static_cast<QBarSeries*> (series5); |
|
171 | QBarSeries* s5 = static_cast<QBarSeries*> (series5); | |
172 | s5->setCategories(QBarCategories()); |
|
172 | s5->setCategories(QBarCategories()); | |
173 | QPercentBarSeries* s6 = static_cast<QPercentBarSeries*> (series6); |
|
173 | QPercentBarSeries* s6 = static_cast<QPercentBarSeries*> (series6); | |
174 | s6->setCategories(QBarCategories()); |
|
174 | s6->setCategories(QBarCategories()); | |
175 | QStackedBarSeries* s7 = static_cast<QStackedBarSeries*> (series7); |
|
175 | QStackedBarSeries* s7 = static_cast<QStackedBarSeries*> (series7); | |
176 | s7->setCategories(QBarCategories()); |
|
176 | s7->setCategories(QBarCategories()); | |
177 |
|
177 | |||
178 | QAxis* axis = new QAxis(this); |
|
178 | QAxis* axis = new QAxis(this); | |
179 |
|
179 | |||
180 | QTest::newRow("default axis: lineSeries") << series0 << (QAxis*) 0; |
|
180 | QTest::newRow("default axis: lineSeries") << series0 << (QAxis*) 0; | |
181 | QTest::newRow("axis0: lineSeries") << series0 << axis; |
|
181 | QTest::newRow("axis0: lineSeries") << series0 << axis; | |
182 | QTest::newRow("default axis: areaSeries") << series1 << (QAxis*) 0; |
|
182 | QTest::newRow("default axis: areaSeries") << series1 << (QAxis*) 0; | |
183 | QTest::newRow("axis: areaSeries") << series1 << axis; |
|
183 | QTest::newRow("axis: areaSeries") << series1 << axis; | |
184 | QTest::newRow("default axis: scatterSeries") << series2 << (QAxis*) 0; |
|
184 | QTest::newRow("default axis: scatterSeries") << series2 << (QAxis*) 0; | |
185 | QTest::newRow("axis1: scatterSeries") << series2 << axis; |
|
185 | QTest::newRow("axis1: scatterSeries") << series2 << axis; | |
186 | QTest::newRow("default axis: splineSeries") << series3 << (QAxis*) 0; |
|
186 | QTest::newRow("default axis: splineSeries") << series3 << (QAxis*) 0; | |
187 | QTest::newRow("axis: splineSeries") << series3 << axis; |
|
187 | QTest::newRow("axis: splineSeries") << series3 << axis; | |
188 | QTest::newRow("default axis: pieSeries") << series4 << (QAxis*) 0; |
|
188 | QTest::newRow("default axis: pieSeries") << series4 << (QAxis*) 0; | |
189 | QTest::newRow("axis: pieSeries") << series4 << axis; |
|
189 | QTest::newRow("axis: pieSeries") << series4 << axis; | |
190 | QTest::newRow("default axis: barSeries") << series5 << (QAxis*) 0; |
|
190 | QTest::newRow("default axis: barSeries") << series5 << (QAxis*) 0; | |
191 | QTest::newRow("axis: barSeries") << series5 << axis; |
|
191 | QTest::newRow("axis: barSeries") << series5 << axis; | |
192 | QTest::newRow("default axis: percentBarSeries") << series6 << (QAxis*) 0; |
|
192 | QTest::newRow("default axis: percentBarSeries") << series6 << (QAxis*) 0; | |
193 | QTest::newRow("axis: barSeries") << series6 << axis; |
|
193 | QTest::newRow("axis: barSeries") << series6 << axis; | |
194 | QTest::newRow("default axis: stackedBarSeries") << series7 << (QAxis*) 0; |
|
194 | QTest::newRow("default axis: stackedBarSeries") << series7 << (QAxis*) 0; | |
195 | QTest::newRow("axis: barSeries") << series7 << axis; |
|
195 | QTest::newRow("axis: barSeries") << series7 << axis; | |
196 |
|
196 | |||
197 | } |
|
197 | } | |
198 |
|
198 | |||
199 | void tst_QChart::addSeries() |
|
199 | void tst_QChart::addSeries() | |
200 | { |
|
200 | { | |
201 | QFETCH(QAbstractSeries *, series); |
|
201 | QFETCH(QAbstractSeries *, series); | |
202 | QFETCH(QAxis *, axis); |
|
202 | QFETCH(QAxis *, axis); | |
203 | m_view->show(); |
|
203 | m_view->show(); | |
204 | QTest::qWaitForWindowShown(m_view); |
|
204 | QTest::qWaitForWindowShown(m_view); | |
205 | if(!axis) axis = m_chart->axisY(); |
|
205 | if(!axis) axis = m_chart->axisY(); | |
206 | m_chart->addSeries(series,axis); |
|
206 | m_chart->addSeries(series,axis); | |
207 | QCOMPARE(m_chart->axisY(series),axis); |
|
207 | QCOMPARE(m_chart->axisY(series),axis); | |
208 | m_chart->removeSeries(series); |
|
208 | m_chart->removeSeries(series); | |
209 |
|
209 | |||
210 | } |
|
210 | } | |
211 |
|
211 | |||
212 | void tst_QChart::animationOptions_data() |
|
212 | void tst_QChart::animationOptions_data() | |
213 | { |
|
213 | { | |
214 | QTest::addColumn<QChart::AnimationOption>("animationOptions"); |
|
214 | QTest::addColumn<QChart::AnimationOption>("animationOptions"); | |
215 | QTest::newRow("AllAnimations") << QChart::AllAnimations; |
|
215 | QTest::newRow("AllAnimations") << QChart::AllAnimations; | |
216 | QTest::newRow("NoAnimation") << QChart::NoAnimation; |
|
216 | QTest::newRow("NoAnimation") << QChart::NoAnimation; | |
217 | QTest::newRow("GridAxisAnimations") << QChart::GridAxisAnimations; |
|
217 | QTest::newRow("GridAxisAnimations") << QChart::GridAxisAnimations; | |
218 | QTest::newRow("SeriesAnimations") << QChart::SeriesAnimations; |
|
218 | QTest::newRow("SeriesAnimations") << QChart::SeriesAnimations; | |
219 | } |
|
219 | } | |
220 |
|
220 | |||
221 | void tst_QChart::animationOptions() |
|
221 | void tst_QChart::animationOptions() | |
222 | { |
|
222 | { | |
223 | createTestData(); |
|
223 | createTestData(); | |
224 | QFETCH(QChart::AnimationOption, animationOptions); |
|
224 | QFETCH(QChart::AnimationOption, animationOptions); | |
225 | m_chart->setAnimationOptions(animationOptions); |
|
225 | m_chart->setAnimationOptions(animationOptions); | |
226 | QCOMPARE(m_chart->animationOptions(), animationOptions); |
|
226 | QCOMPARE(m_chart->animationOptions(), animationOptions); | |
227 | } |
|
227 | } | |
228 |
|
228 | |||
229 | void tst_QChart::axisX_data() |
|
229 | void tst_QChart::axisX_data() | |
230 | { |
|
230 | { | |
231 |
|
231 | |||
232 | } |
|
232 | } | |
233 |
|
233 | |||
234 | void tst_QChart::axisX() |
|
234 | void tst_QChart::axisX() | |
235 | { |
|
235 | { | |
236 | QVERIFY(m_chart->axisX()); |
|
236 | QVERIFY(m_chart->axisX()); | |
237 | QAxis* axis = m_chart->axisX(); |
|
237 | QAxis* axis = m_chart->axisX(); | |
238 | createTestData(); |
|
238 | createTestData(); | |
239 | //it should be the same axis |
|
239 | //it should be the same axis | |
240 | QCOMPARE(axis,m_chart->axisX()); |
|
240 | QCOMPARE(axis,m_chart->axisX()); | |
241 | } |
|
241 | } | |
242 |
|
242 | |||
243 | void tst_QChart::axisY_data() |
|
243 | void tst_QChart::axisY_data() | |
244 | { |
|
244 | { | |
245 | QTest::addColumn<QAxis*>("axis0"); |
|
245 | QTest::addColumn<QAxis*>("axis0"); | |
246 | QTest::addColumn<QAxis*>("axis1"); |
|
246 | QTest::addColumn<QAxis*>("axis1"); | |
247 | QTest::addColumn<QAxis*>("axis2"); |
|
247 | QTest::addColumn<QAxis*>("axis2"); | |
248 | QTest::newRow("1 defualt, 2 optional") << (QAxis*)0 << new QAxis() << new QAxis(); |
|
248 | QTest::newRow("1 defualt, 2 optional") << (QAxis*)0 << new QAxis() << new QAxis(); | |
249 | QTest::newRow("3 optional") << new QAxis() << new QAxis() << new QAxis(); |
|
249 | QTest::newRow("3 optional") << new QAxis() << new QAxis() << new QAxis(); | |
250 | } |
|
250 | } | |
251 |
|
251 | |||
252 |
|
252 | |||
253 | void tst_QChart::axisY() |
|
253 | void tst_QChart::axisY() | |
254 | { |
|
254 | { | |
255 | QFETCH(QAxis*, axis0); |
|
255 | QFETCH(QAxis*, axis0); | |
256 | QFETCH(QAxis*, axis1); |
|
256 | QFETCH(QAxis*, axis1); | |
257 | QFETCH(QAxis*, axis2); |
|
257 | QFETCH(QAxis*, axis2); | |
258 |
|
258 | |||
259 | QAxis* defaultAxisY = m_chart->axisY(); |
|
259 | QAxis* defaultAxisY = m_chart->axisY(); | |
260 |
|
260 | |||
261 | QVERIFY2(defaultAxisY, "Missing axisY."); |
|
261 | QVERIFY2(defaultAxisY, "Missing axisY."); | |
262 |
|
262 | |||
263 | QLineSeries* series0 = new QLineSeries(); |
|
263 | QLineSeries* series0 = new QLineSeries(); | |
264 | m_chart->addSeries(series0, axis0); |
|
264 | m_chart->addSeries(series0, axis0); | |
265 |
|
265 | |||
266 | QLineSeries* series1 = new QLineSeries(); |
|
266 | QLineSeries* series1 = new QLineSeries(); | |
267 | m_chart->addSeries(series1, axis1); |
|
267 | m_chart->addSeries(series1, axis1); | |
268 |
|
268 | |||
269 | QLineSeries* series2 = new QLineSeries(); |
|
269 | QLineSeries* series2 = new QLineSeries(); | |
270 | m_chart->addSeries(series2, axis2); |
|
270 | m_chart->addSeries(series2, axis2); | |
271 |
|
271 | |||
272 | if (!axis0) |
|
272 | if (!axis0) | |
273 | axis0 = defaultAxisY; |
|
273 | axis0 = defaultAxisY; | |
274 | if (!axis1) |
|
274 | if (!axis1) | |
275 | axis1 = defaultAxisY; |
|
275 | axis1 = defaultAxisY; | |
276 | if (!axis2) |
|
276 | if (!axis2) | |
277 | axis2 = defaultAxisY; |
|
277 | axis2 = defaultAxisY; | |
278 |
|
278 | |||
279 | QVERIFY(m_chart->axisY(series0) == axis0); |
|
279 | QVERIFY(m_chart->axisY(series0) == axis0); | |
280 | QVERIFY(m_chart->axisY(series1) == axis1); |
|
280 | QVERIFY(m_chart->axisY(series1) == axis1); | |
281 | QVERIFY(m_chart->axisY(series2) == axis2); |
|
281 | QVERIFY(m_chart->axisY(series2) == axis2); | |
282 | } |
|
282 | } | |
283 |
|
283 | |||
284 | void tst_QChart::backgroundBrush_data() |
|
284 | void tst_QChart::backgroundBrush_data() | |
285 | { |
|
285 | { | |
286 | QTest::addColumn<QBrush>("backgroundBrush"); |
|
286 | QTest::addColumn<QBrush>("backgroundBrush"); | |
287 | QTest::newRow("null") << QBrush(); |
|
287 | QTest::newRow("null") << QBrush(); | |
288 | QTest::newRow("blue") << QBrush(Qt::blue); |
|
288 | QTest::newRow("blue") << QBrush(Qt::blue); | |
289 | QTest::newRow("white") << QBrush(Qt::white); |
|
289 | QTest::newRow("white") << QBrush(Qt::white); | |
290 | QTest::newRow("black") << QBrush(Qt::black); |
|
290 | QTest::newRow("black") << QBrush(Qt::black); | |
291 | } |
|
291 | } | |
292 |
|
292 | |||
293 | void tst_QChart::backgroundBrush() |
|
293 | void tst_QChart::backgroundBrush() | |
294 | { |
|
294 | { | |
295 | QFETCH(QBrush, backgroundBrush); |
|
295 | QFETCH(QBrush, backgroundBrush); | |
296 | m_chart->setBackgroundBrush(backgroundBrush); |
|
296 | m_chart->setBackgroundBrush(backgroundBrush); | |
297 | QCOMPARE(m_chart->backgroundBrush(), backgroundBrush); |
|
297 | QCOMPARE(m_chart->backgroundBrush(), backgroundBrush); | |
298 | } |
|
298 | } | |
299 |
|
299 | |||
300 | void tst_QChart::backgroundPen_data() |
|
300 | void tst_QChart::backgroundPen_data() | |
301 | { |
|
301 | { | |
302 | QTest::addColumn<QPen>("backgroundPen"); |
|
302 | QTest::addColumn<QPen>("backgroundPen"); | |
303 | QTest::newRow("null") << QPen(); |
|
303 | QTest::newRow("null") << QPen(); | |
304 | QTest::newRow("blue") << QPen(Qt::blue); |
|
304 | QTest::newRow("blue") << QPen(Qt::blue); | |
305 | QTest::newRow("white") << QPen(Qt::white); |
|
305 | QTest::newRow("white") << QPen(Qt::white); | |
306 | QTest::newRow("black") << QPen(Qt::black); |
|
306 | QTest::newRow("black") << QPen(Qt::black); | |
307 | } |
|
307 | } | |
308 |
|
308 | |||
309 |
|
309 | |||
310 | void tst_QChart::backgroundPen() |
|
310 | void tst_QChart::backgroundPen() | |
311 | { |
|
311 | { | |
312 | QFETCH(QPen, backgroundPen); |
|
312 | QFETCH(QPen, backgroundPen); | |
313 | m_chart->setBackgroundPen(backgroundPen); |
|
313 | m_chart->setBackgroundPen(backgroundPen); | |
314 | QCOMPARE(m_chart->backgroundPen(), backgroundPen); |
|
314 | QCOMPARE(m_chart->backgroundPen(), backgroundPen); | |
315 | } |
|
315 | } | |
316 |
|
316 | |||
317 | void tst_QChart::isBackgroundVisible_data() |
|
317 | void tst_QChart::isBackgroundVisible_data() | |
318 | { |
|
318 | { | |
319 | QTest::addColumn<bool>("isBackgroundVisible"); |
|
319 | QTest::addColumn<bool>("isBackgroundVisible"); | |
320 | QTest::newRow("true") << true; |
|
320 | QTest::newRow("true") << true; | |
321 | QTest::newRow("false") << false; |
|
321 | QTest::newRow("false") << false; | |
322 | } |
|
322 | } | |
323 |
|
323 | |||
324 | void tst_QChart::isBackgroundVisible() |
|
324 | void tst_QChart::isBackgroundVisible() | |
325 | { |
|
325 | { | |
326 | QFETCH(bool, isBackgroundVisible); |
|
326 | QFETCH(bool, isBackgroundVisible); | |
327 | m_chart->setBackgroundVisible(isBackgroundVisible); |
|
327 | m_chart->setBackgroundVisible(isBackgroundVisible); | |
328 | QCOMPARE(m_chart->isBackgroundVisible(), isBackgroundVisible); |
|
328 | QCOMPARE(m_chart->isBackgroundVisible(), isBackgroundVisible); | |
329 | } |
|
329 | } | |
330 |
|
330 | |||
331 | void tst_QChart::legend_data() |
|
331 | void tst_QChart::legend_data() | |
332 | { |
|
332 | { | |
333 |
|
333 | |||
334 | } |
|
334 | } | |
335 |
|
335 | |||
336 | void tst_QChart::legend() |
|
336 | void tst_QChart::legend() | |
337 | { |
|
337 | { | |
338 | QVERIFY(m_chart->legend()); |
|
338 | QVERIFY(m_chart->legend()); | |
339 | } |
|
339 | } | |
340 |
|
340 | |||
341 | void tst_QChart::margins_data() |
|
341 | void tst_QChart::margins_data() | |
342 | { |
|
342 | { | |
343 |
|
343 | |||
344 | } |
|
344 | } | |
345 |
|
345 | |||
346 | void tst_QChart::margins() |
|
346 | void tst_QChart::margins() | |
347 | { |
|
347 | { | |
348 | createTestData(); |
|
348 | createTestData(); | |
349 | QRectF rect = m_chart->geometry(); |
|
349 | QRectF rect = m_chart->geometry(); | |
350 |
|
350 | |||
351 | QVERIFY(m_chart->margins().top()+m_chart->margins().bottom() < rect.height()); |
|
351 | QVERIFY(m_chart->margins().top()+m_chart->margins().bottom() < rect.height()); | |
352 | QVERIFY(m_chart->margins().left()+m_chart->margins().right() < rect.width()); |
|
352 | QVERIFY(m_chart->margins().left()+m_chart->margins().right() < rect.width()); | |
353 | } |
|
353 | } | |
354 |
|
354 | |||
355 | void tst_QChart::removeAllSeries_data() |
|
355 | void tst_QChart::removeAllSeries_data() | |
356 | { |
|
356 | { | |
357 |
|
357 | |||
358 | } |
|
358 | } | |
359 |
|
359 | |||
360 | void tst_QChart::removeAllSeries() |
|
360 | void tst_QChart::removeAllSeries() | |
361 | { |
|
361 | { | |
362 | QLineSeries* series0 = new QLineSeries(this); |
|
362 | QLineSeries* series0 = new QLineSeries(this); | |
363 | QLineSeries* series1 = new QLineSeries(this); |
|
363 | QLineSeries* series1 = new QLineSeries(this); | |
364 | QLineSeries* series2 = new QLineSeries(this); |
|
364 | QLineSeries* series2 = new QLineSeries(this); | |
365 |
|
365 | |||
366 | m_chart->addSeries(series0); |
|
366 | m_chart->addSeries(series0); | |
367 | m_chart->addSeries(series1); |
|
367 | m_chart->addSeries(series1); | |
368 | m_chart->addSeries(series2); |
|
368 | m_chart->addSeries(series2); | |
369 | m_view->show(); |
|
369 | m_view->show(); | |
370 | QTest::qWaitForWindowShown(m_view); |
|
370 | QTest::qWaitForWindowShown(m_view); | |
371 |
|
371 | |||
372 | QVERIFY(m_chart->axisY(series0)!=0); |
|
372 | QVERIFY(m_chart->axisY(series0)!=0); | |
373 | QVERIFY(m_chart->axisY(series1)!=0); |
|
373 | QVERIFY(m_chart->axisY(series1)!=0); | |
374 | QVERIFY(m_chart->axisY(series2)!=0); |
|
374 | QVERIFY(m_chart->axisY(series2)!=0); | |
375 |
|
375 | |||
376 | m_chart->removeAllSeries(); |
|
376 | m_chart->removeAllSeries(); | |
377 |
|
377 | |||
378 | QVERIFY(m_chart->axisY(series0)==0); |
|
378 | QVERIFY(m_chart->axisY(series0)==0); | |
379 | QVERIFY(m_chart->axisY(series1)==0); |
|
379 | QVERIFY(m_chart->axisY(series1)==0); | |
380 | QVERIFY(m_chart->axisY(series2)==0); |
|
380 | QVERIFY(m_chart->axisY(series2)==0); | |
381 | } |
|
381 | } | |
382 |
|
382 | |||
383 | void tst_QChart::removeSeries_data() |
|
383 | void tst_QChart::removeSeries_data() | |
384 | { |
|
384 | { | |
385 | addSeries_data(); |
|
385 | addSeries_data(); | |
386 | } |
|
386 | } | |
387 |
|
387 | |||
388 | void tst_QChart::removeSeries() |
|
388 | void tst_QChart::removeSeries() | |
389 | { |
|
389 | { | |
390 | QFETCH(QAbstractSeries *, series); |
|
390 | QFETCH(QAbstractSeries *, series); | |
391 | QFETCH(QAxis *, axis); |
|
391 | QFETCH(QAxis *, axis); | |
392 | m_view->show(); |
|
392 | m_view->show(); | |
393 | QTest::qWaitForWindowShown(m_view); |
|
393 | QTest::qWaitForWindowShown(m_view); | |
394 | if(!axis) axis = m_chart->axisY(); |
|
394 | if(!axis) axis = m_chart->axisY(); | |
395 | m_chart->addSeries(series,axis); |
|
395 | m_chart->addSeries(series,axis); | |
396 | QCOMPARE(m_chart->axisY(series),axis); |
|
396 | QCOMPARE(m_chart->axisY(series),axis); | |
397 | m_chart->removeSeries(series); |
|
397 | m_chart->removeSeries(series); | |
398 | QVERIFY(m_chart->axisY(series)==0); |
|
398 | QVERIFY(m_chart->axisY(series)==0); | |
399 | } |
|
399 | } | |
400 |
|
400 | |||
401 | void tst_QChart::scrollDown_data() |
|
401 | void tst_QChart::scrollDown_data() | |
402 | { |
|
402 | { | |
403 |
|
403 | |||
404 | } |
|
404 | } | |
405 |
|
405 | |||
406 | void tst_QChart::scrollDown() |
|
406 | void tst_QChart::scrollDown() | |
407 | { |
|
407 | { | |
408 | createTestData(); |
|
408 | createTestData(); | |
409 | qreal min = m_chart->axisY()->min(); |
|
409 | qreal min = m_chart->axisY()->min(); | |
410 | m_chart->scrollDown(); |
|
410 | m_chart->scrollDown(); | |
411 | QVERIFY(m_chart->axisY()->min()<min); |
|
411 | QVERIFY(m_chart->axisY()->min()<min); | |
412 | } |
|
412 | } | |
413 |
|
413 | |||
414 | void tst_QChart::scrollLeft_data() |
|
414 | void tst_QChart::scrollLeft_data() | |
415 | { |
|
415 | { | |
416 |
|
416 | |||
417 | } |
|
417 | } | |
418 |
|
418 | |||
419 | void tst_QChart::scrollLeft() |
|
419 | void tst_QChart::scrollLeft() | |
420 | { |
|
420 | { | |
421 | createTestData(); |
|
421 | createTestData(); | |
422 | qreal min = m_chart->axisX()->min(); |
|
422 | qreal min = m_chart->axisX()->min(); | |
423 | m_chart->scrollLeft(); |
|
423 | m_chart->scrollLeft(); | |
424 | QVERIFY(m_chart->axisX()->min()<min); |
|
424 | QVERIFY(m_chart->axisX()->min()<min); | |
425 | } |
|
425 | } | |
426 |
|
426 | |||
427 | void tst_QChart::scrollRight_data() |
|
427 | void tst_QChart::scrollRight_data() | |
428 | { |
|
428 | { | |
429 |
|
429 | |||
430 | } |
|
430 | } | |
431 |
|
431 | |||
432 | void tst_QChart::scrollRight() |
|
432 | void tst_QChart::scrollRight() | |
433 | { |
|
433 | { | |
434 | createTestData(); |
|
434 | createTestData(); | |
435 | qreal min = m_chart->axisX()->min(); |
|
435 | qreal min = m_chart->axisX()->min(); | |
436 | m_chart->scrollRight(); |
|
436 | m_chart->scrollRight(); | |
437 | QVERIFY(m_chart->axisX()->min()>min); |
|
437 | QVERIFY(m_chart->axisX()->min()>min); | |
438 | } |
|
438 | } | |
439 |
|
439 | |||
440 | void tst_QChart::scrollUp_data() |
|
440 | void tst_QChart::scrollUp_data() | |
441 | { |
|
441 | { | |
442 |
|
442 | |||
443 | } |
|
443 | } | |
444 |
|
444 | |||
445 | void tst_QChart::scrollUp() |
|
445 | void tst_QChart::scrollUp() | |
446 | { |
|
446 | { | |
447 | createTestData(); |
|
447 | createTestData(); | |
448 | qreal min = m_chart->axisY()->min(); |
|
448 | qreal min = m_chart->axisY()->min(); | |
449 | m_chart->scrollUp(); |
|
449 | m_chart->scrollUp(); | |
450 | QVERIFY(m_chart->axisY()->min()>min); |
|
450 | QVERIFY(m_chart->axisY()->min()>min); | |
451 | } |
|
451 | } | |
452 |
|
452 | |||
453 | void tst_QChart::theme_data() |
|
453 | void tst_QChart::theme_data() | |
454 | { |
|
454 | { | |
455 | QTest::addColumn<QChart::ChartTheme>("theme"); |
|
455 | QTest::addColumn<QChart::ChartTheme>("theme"); | |
456 | QTest::newRow("ChartThemeBlueCerulean") << QChart::ChartThemeBlueCerulean; |
|
456 | QTest::newRow("ChartThemeBlueCerulean") << QChart::ChartThemeBlueCerulean; | |
457 | QTest::newRow("ChartThemeBlueIcy") << QChart::ChartThemeBlueIcy; |
|
457 | QTest::newRow("ChartThemeBlueIcy") << QChart::ChartThemeBlueIcy; | |
458 | QTest::newRow("ChartThemeBlueNcs") << QChart::ChartThemeBlueNcs; |
|
458 | QTest::newRow("ChartThemeBlueNcs") << QChart::ChartThemeBlueNcs; | |
459 | QTest::newRow("ChartThemeBrownSand") << QChart::ChartThemeBrownSand; |
|
459 | QTest::newRow("ChartThemeBrownSand") << QChart::ChartThemeBrownSand; | |
460 | QTest::newRow("ChartThemeDark") << QChart::ChartThemeDark; |
|
460 | QTest::newRow("ChartThemeDark") << QChart::ChartThemeDark; | |
461 | QTest::newRow("hartThemeHighContrast") << QChart::ChartThemeHighContrast; |
|
461 | QTest::newRow("hartThemeHighContrast") << QChart::ChartThemeHighContrast; | |
462 | QTest::newRow("ChartThemeLight") << QChart::ChartThemeLight; |
|
462 | QTest::newRow("ChartThemeLight") << QChart::ChartThemeLight; | |
463 | } |
|
463 | } | |
464 |
|
464 | |||
465 | void tst_QChart::theme() |
|
465 | void tst_QChart::theme() | |
466 | { |
|
466 | { | |
467 | QFETCH(QChart::ChartTheme, theme); |
|
467 | QFETCH(QChart::ChartTheme, theme); | |
468 | createTestData(); |
|
468 | createTestData(); | |
469 | m_chart->setTheme(theme); |
|
469 | m_chart->setTheme(theme); | |
470 | QVERIFY(m_chart->theme()==theme); |
|
470 | QVERIFY(m_chart->theme()==theme); | |
471 | } |
|
471 | } | |
472 |
|
472 | |||
473 | void tst_QChart::title_data() |
|
473 | void tst_QChart::title_data() | |
474 | { |
|
474 | { | |
475 | QTest::addColumn<QString>("title"); |
|
475 | QTest::addColumn<QString>("title"); | |
476 | QTest::newRow("null") << QString(); |
|
476 | QTest::newRow("null") << QString(); | |
477 | QTest::newRow("foo") << QString("foo"); |
|
477 | QTest::newRow("foo") << QString("foo"); | |
478 | } |
|
478 | } | |
479 |
|
479 | |||
480 | void tst_QChart::title() |
|
480 | void tst_QChart::title() | |
481 | { |
|
481 | { | |
482 | QFETCH(QString, title); |
|
482 | QFETCH(QString, title); | |
483 | m_chart->setTitle(title); |
|
483 | m_chart->setTitle(title); | |
484 | QCOMPARE(m_chart->title(), title); |
|
484 | QCOMPARE(m_chart->title(), title); | |
485 | } |
|
485 | } | |
486 |
|
486 | |||
487 | void tst_QChart::titleBrush_data() |
|
487 | void tst_QChart::titleBrush_data() | |
488 | { |
|
488 | { | |
489 | QTest::addColumn<QBrush>("titleBrush"); |
|
489 | QTest::addColumn<QBrush>("titleBrush"); | |
490 | QTest::newRow("null") << QBrush(); |
|
490 | QTest::newRow("null") << QBrush(); | |
491 | QTest::newRow("blue") << QBrush(Qt::blue); |
|
491 | QTest::newRow("blue") << QBrush(Qt::blue); | |
492 | QTest::newRow("white") << QBrush(Qt::white); |
|
492 | QTest::newRow("white") << QBrush(Qt::white); | |
493 | QTest::newRow("black") << QBrush(Qt::black); |
|
493 | QTest::newRow("black") << QBrush(Qt::black); | |
494 | } |
|
494 | } | |
495 |
|
495 | |||
496 | void tst_QChart::titleBrush() |
|
496 | void tst_QChart::titleBrush() | |
497 | { |
|
497 | { | |
498 | QFETCH(QBrush, titleBrush); |
|
498 | QFETCH(QBrush, titleBrush); | |
499 | m_chart->setTitleBrush(titleBrush); |
|
499 | m_chart->setTitleBrush(titleBrush); | |
500 | QCOMPARE(m_chart->titleBrush(), titleBrush); |
|
500 | QCOMPARE(m_chart->titleBrush(), titleBrush); | |
501 | } |
|
501 | } | |
502 |
|
502 | |||
503 | void tst_QChart::titleFont_data() |
|
503 | void tst_QChart::titleFont_data() | |
504 | { |
|
504 | { | |
505 | QTest::addColumn<QFont>("titleFont"); |
|
505 | QTest::addColumn<QFont>("titleFont"); | |
506 | QTest::newRow("null") << QFont(); |
|
506 | QTest::newRow("null") << QFont(); | |
507 | QTest::newRow("courier") << QFont("Courier", 8, QFont::Bold, true); |
|
507 | QTest::newRow("courier") << QFont("Courier", 8, QFont::Bold, true); | |
508 | } |
|
508 | } | |
509 |
|
509 | |||
510 | void tst_QChart::titleFont() |
|
510 | void tst_QChart::titleFont() | |
511 | { |
|
511 | { | |
512 | QFETCH(QFont, titleFont); |
|
512 | QFETCH(QFont, titleFont); | |
513 | m_chart->setTitleFont(titleFont); |
|
513 | m_chart->setTitleFont(titleFont); | |
514 | QCOMPARE(m_chart->titleFont(), titleFont); |
|
514 | QCOMPARE(m_chart->titleFont(), titleFont); | |
515 | } |
|
515 | } | |
516 |
|
516 | |||
517 | void tst_QChart::zoomIn_data() |
|
517 | void tst_QChart::zoomIn_data() | |
518 | { |
|
518 | { | |
519 | QTest::addColumn<QRectF>("rect"); |
|
519 | QTest::addColumn<QRectF>("rect"); | |
520 | QTest::newRow("null") << QRectF(); |
|
520 | QTest::newRow("null") << QRectF(); | |
521 | QTest::newRow("100x100") << QRectF(10,10,100,100); |
|
521 | QTest::newRow("100x100") << QRectF(10,10,100,100); | |
522 | QTest::newRow("200x200") << QRectF(10,10,200,200); |
|
522 | QTest::newRow("200x200") << QRectF(10,10,200,200); | |
523 | } |
|
523 | } | |
524 |
|
524 | |||
525 |
|
525 | |||
526 | void tst_QChart::zoomIn() |
|
526 | void tst_QChart::zoomIn() | |
527 | { |
|
527 | { | |
528 | QFETCH(QRectF, rect); |
|
528 | QFETCH(QRectF, rect); | |
529 | createTestData(); |
|
529 | createTestData(); | |
530 | QRectF marigns = m_chart->margins(); |
|
530 | QRectF marigns = m_chart->margins(); | |
531 | rect.adjust(marigns.left(),marigns.top(),-marigns.right(),-marigns.bottom()); |
|
531 | rect.adjust(marigns.left(),marigns.top(),-marigns.right(),-marigns.bottom()); | |
532 | qreal minX = m_chart->axisX()->min(); |
|
532 | qreal minX = m_chart->axisX()->min(); | |
533 | qreal minY = m_chart->axisY()->min(); |
|
533 | qreal minY = m_chart->axisY()->min(); | |
534 | qreal maxX = m_chart->axisX()->max(); |
|
534 | qreal maxX = m_chart->axisX()->max(); | |
535 | qreal maxY = m_chart->axisY()->max(); |
|
535 | qreal maxY = m_chart->axisY()->max(); | |
536 | m_chart->zoomIn(rect); |
|
536 | m_chart->zoomIn(rect); | |
537 | if(rect.isValid()){ |
|
537 | if(rect.isValid()){ | |
538 | QVERIFY(minX<m_chart->axisX()->min()); |
|
538 | QVERIFY(minX<m_chart->axisX()->min()); | |
539 | QVERIFY(maxX>m_chart->axisX()->max()); |
|
539 | QVERIFY(maxX>m_chart->axisX()->max()); | |
540 | QVERIFY(minY<m_chart->axisY()->min()); |
|
540 | QVERIFY(minY<m_chart->axisY()->min()); | |
541 | QVERIFY(maxY>m_chart->axisY()->max()); |
|
541 | QVERIFY(maxY>m_chart->axisY()->max()); | |
542 | } |
|
542 | } | |
543 | } |
|
543 | } | |
544 |
|
544 | |||
545 | void tst_QChart::zoomOut_data() |
|
545 | void tst_QChart::zoomOut_data() | |
546 | { |
|
546 | { | |
547 |
|
547 | |||
548 | } |
|
548 | } | |
549 |
|
549 | |||
550 | void tst_QChart::zoomOut() |
|
550 | void tst_QChart::zoomOut() | |
551 | { |
|
551 | { | |
552 | createTestData(); |
|
552 | createTestData(); | |
553 | qreal minX = m_chart->axisX()->min(); |
|
553 | qreal minX = m_chart->axisX()->min(); | |
554 | qreal minY = m_chart->axisY()->min(); |
|
554 | qreal minY = m_chart->axisY()->min(); | |
555 | qreal maxX = m_chart->axisX()->max(); |
|
555 | qreal maxX = m_chart->axisX()->max(); | |
556 | qreal maxY = m_chart->axisY()->max(); |
|
556 | qreal maxY = m_chart->axisY()->max(); | |
557 |
|
557 | |||
558 | m_chart->zoomIn(); |
|
558 | m_chart->zoomIn(); | |
559 |
|
559 | |||
560 | QVERIFY(minX < m_chart->axisX()->min()); |
|
560 | QVERIFY(minX < m_chart->axisX()->min()); | |
561 | QVERIFY(maxX > m_chart->axisX()->max()); |
|
561 | QVERIFY(maxX > m_chart->axisX()->max()); | |
562 | QVERIFY(minY < m_chart->axisY()->min()); |
|
562 | QVERIFY(minY < m_chart->axisY()->min()); | |
563 | QVERIFY(maxY > m_chart->axisY()->max()); |
|
563 | QVERIFY(maxY > m_chart->axisY()->max()); | |
564 |
|
564 | |||
565 | m_chart->zoomOut(); |
|
565 | m_chart->zoomOut(); | |
566 |
|
566 | |||
567 | // min x may be a zero value |
|
567 | // min x may be a zero value | |
568 | if (qFuzzyIsNull(minX)) |
|
568 | if (qFuzzyIsNull(minX)) | |
569 | QVERIFY(qFuzzyIsNull(m_chart->axisX()->min())); |
|
569 | QVERIFY(qFuzzyIsNull(m_chart->axisX()->min())); | |
570 | else |
|
570 | else | |
571 | QCOMPARE(minX, m_chart->axisX()->min()); |
|
571 | QCOMPARE(minX, m_chart->axisX()->min()); | |
572 |
|
572 | |||
573 | // min y may be a zero value |
|
573 | // min y may be a zero value | |
574 | if (qFuzzyIsNull(minY)) |
|
574 | if (qFuzzyIsNull(minY)) | |
575 | QVERIFY(qFuzzyIsNull(m_chart->axisY()->min())); |
|
575 | QVERIFY(qFuzzyIsNull(m_chart->axisY()->min())); | |
576 | else |
|
576 | else | |
577 | QCOMPARE(minY, m_chart->axisY()->min()); |
|
577 | QCOMPARE(minY, m_chart->axisY()->min()); | |
578 |
|
578 | |||
579 | QVERIFY(maxX == m_chart->axisX()->max()); |
|
579 | QVERIFY(maxX == m_chart->axisX()->max()); | |
580 | QVERIFY(maxY == m_chart->axisY()->max()); |
|
580 | QVERIFY(maxY == m_chart->axisY()->max()); | |
581 | } |
|
581 | } | |
582 |
|
582 | |||
583 | QTEST_MAIN(tst_QChart) |
|
583 | QTEST_MAIN(tst_QChart) | |
584 | #include "tst_qchart.moc" |
|
584 | #include "tst_qchart.moc" | |
585 |
|
585 |
General Comments 0
You need to be logged in to leave comments.
Login now