@@ -37,6 +37,8 private slots: | |||
|
37 | 37 | void qbarcategoryaxis_data(); |
|
38 | 38 | void qbarcategoryaxis(); |
|
39 | 39 | |
|
40 | void append2_data(); | |
|
41 | void append2(); | |
|
40 | 42 | void append_data(); |
|
41 | 43 | void append(); |
|
42 | 44 | void at_data(); |
@@ -113,7 +115,8 void tst_QBarCategoriesAxis::init() | |||
|
113 | 115 | QStringList categories; |
|
114 | 116 | categories << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun"; |
|
115 | 117 | |
|
116 | m_baraxis->append(categories); | |
|
118 | foreach(QString category, categories) | |
|
119 | m_baraxis->append(category); | |
|
117 | 120 | |
|
118 | 121 | tst_QAbstractAxis::init(m_baraxis, m_series); |
|
119 | 122 | m_chart->addSeries(m_series); |
@@ -192,6 +195,43 void tst_QBarCategoriesAxis::append() | |||
|
192 | 195 | QCOMPARE(spy3.count(), 1); |
|
193 | 196 | } |
|
194 | 197 | |
|
198 | void tst_QBarCategoriesAxis::append2_data() | |
|
199 | { | |
|
200 | QTest::addColumn<QStringList>("categories"); | |
|
201 | QTest::newRow("Jan Feb Mar Apr") << (QStringList() << "Jan" << "Feb" << "Mar" << "Apr"); | |
|
202 | QTest::newRow("Jul Aug Sep") << (QStringList() << "Jul" << "Aug" << "Sep"); | |
|
203 | } | |
|
204 | ||
|
205 | void tst_QBarCategoriesAxis::append2() | |
|
206 | { | |
|
207 | QFETCH(QStringList, categories); | |
|
208 | ||
|
209 | QBarCategoryAxis axis; | |
|
210 | ||
|
211 | QSignalSpy spy0(&axis, SIGNAL(categoriesChanged())); | |
|
212 | QSignalSpy spy1(&axis, SIGNAL(maxChanged(QString))); | |
|
213 | QSignalSpy spy2(&axis, SIGNAL(minChanged(QString))); | |
|
214 | QSignalSpy spy3(&axis, SIGNAL(rangeChanged(QString,QString))); | |
|
215 | ||
|
216 | foreach(QString category, categories) | |
|
217 | axis.append(category); | |
|
218 | ||
|
219 | QCOMPARE(spy0.count(), categories.count()); | |
|
220 | QCOMPARE(spy1.count(), categories.count()); | |
|
221 | QCOMPARE(spy2.count(), 1); | |
|
222 | QCOMPARE(spy3.count(), categories.count()); | |
|
223 | ||
|
224 | m_chart->setAxisX(&axis, m_series); | |
|
225 | m_view->show(); | |
|
226 | QTest::qWaitForWindowShown(m_view); | |
|
227 | QCOMPARE(axis.categories(), categories); | |
|
228 | ||
|
229 | QCOMPARE(spy0.count(), categories.count()); | |
|
230 | QCOMPARE(spy1.count(), categories.count()); | |
|
231 | QCOMPARE(spy2.count(), 1); | |
|
232 | QCOMPARE(spy3.count(), categories.count()); | |
|
233 | } | |
|
234 | ||
|
195 | 235 | void tst_QBarCategoriesAxis::at_data() |
|
196 | 236 | { |
|
197 | 237 | QTest::addColumn<QStringList>("categories"); |
@@ -509,10 +549,11 void tst_QBarCategoriesAxis::min_data() | |||
|
509 | 549 | |
|
510 | 550 | void tst_QBarCategoriesAxis::min() |
|
511 | 551 | { |
|
552 | min_raw(); | |
|
512 | 553 | m_chart->setAxisX(m_baraxis, m_series); |
|
513 | 554 | m_view->show(); |
|
514 | 555 | QTest::qWaitForWindowShown(m_view); |
|
515 | min_raw(); | |
|
556 | ||
|
516 | 557 | } |
|
517 | 558 | |
|
518 | 559 | void tst_QBarCategoriesAxis::min_animation_data() |
@@ -564,10 +605,11 void tst_QBarCategoriesAxis::range_data() | |||
|
564 | 605 | |
|
565 | 606 | void tst_QBarCategoriesAxis::range() |
|
566 | 607 | { |
|
608 | range_raw(); | |
|
567 | 609 | m_chart->setAxisX(m_baraxis, m_series); |
|
568 | 610 | m_view->show(); |
|
569 | 611 | QTest::qWaitForWindowShown(m_view); |
|
570 | range_raw(); | |
|
612 | ||
|
571 | 613 | } |
|
572 | 614 | |
|
573 | 615 | void tst_QBarCategoriesAxis::range_animation_data() |
General Comments 0
You need to be logged in to leave comments.
Login now