@@ -218,14 +218,16 void tst_ChartDataSet::axisY() | |||||
218 |
|
218 | |||
219 | QVERIFY2(defaultAxisY, "Missing axisY."); |
|
219 | QVERIFY2(defaultAxisY, "Missing axisY."); | |
220 |
|
220 | |||
221 | QLineChartSeries series1; |
|
221 | QLineChartSeries* series1 = new QLineChartSeries(); | |
222 |
dataSet.addSeries( |
|
222 | dataSet.addSeries(series1); | |
|
223 | ||||
|
224 | QLineChartSeries* series2 = new QLineChartSeries(); | |||
|
225 | dataSet.addSeries(series2, axisY); | |||
|
226 | ||||
|
227 | QVERIFY(dataSet.axisY(series1) == defaultAxisY); | |||
|
228 | QVERIFY(dataSet.axisY(series2) == axisY); | |||
223 |
|
229 | |||
224 | QLineChartSeries series2; |
|
|||
225 | dataSet.addSeries(&series2, axisY); |
|
|||
226 |
|
230 | |||
227 | QVERIFY(dataSet.axisY(&series1) == defaultAxisY); |
|
|||
228 | QVERIFY(dataSet.axisY(&series2) == axisY); |
|
|||
229 | } |
|
231 | } | |
230 |
|
232 | |||
231 | void tst_ChartDataSet::clearDomains_data() |
|
233 | void tst_ChartDataSet::clearDomains_data() | |
@@ -242,15 +244,15 void tst_ChartDataSet::clearDomains() | |||||
242 | QFETCH(int, indexCount); |
|
244 | QFETCH(int, indexCount); | |
243 |
|
245 | |||
244 | Domain domain1(0, 100, 0, 100); |
|
246 | Domain domain1(0, 100, 0, 100); | |
245 | QLineChartSeries series; |
|
247 | QLineChartSeries* series = new QLineChartSeries(); | |
246 |
series |
|
248 | series->add(0, 0); | |
247 |
series |
|
249 | series->add(100, 100); | |
248 |
|
250 | |||
249 | ChartDataSet dataSet; |
|
251 | ChartDataSet dataSet; | |
250 |
|
252 | |||
251 | QCOMPARE(dataSet.domainIndex(), 0); |
|
253 | QCOMPARE(dataSet.domainIndex(), 0); | |
252 |
|
254 | |||
253 |
dataSet.addSeries( |
|
255 | dataSet.addSeries(series); | |
254 |
|
256 | |||
255 | Domain domain2 = dataSet.domain(dataSet.axisY()); |
|
257 | Domain domain2 = dataSet.domain(dataSet.axisY()); | |
256 |
|
258 | |||
@@ -313,15 +315,15 void tst_ChartDataSet::domain() | |||||
313 | QFETCH(Domain, domain); |
|
315 | QFETCH(Domain, domain); | |
314 |
|
316 | |||
315 | ChartDataSet dataSet; |
|
317 | ChartDataSet dataSet; | |
316 | QLineChartSeries series1; |
|
318 | QLineChartSeries* series1 = new QLineChartSeries(); | |
317 |
series1 |
|
319 | series1->add(domain1.m_minX, domain1.m_minY); | |
318 |
series1 |
|
320 | series1->add(domain1.m_maxX, domain1.m_maxY); | |
319 | QLineChartSeries series2; |
|
321 | QLineChartSeries* series2 = new QLineChartSeries(); | |
320 |
series2 |
|
322 | series2->add(domain2.m_minX, domain2.m_minY); | |
321 |
series2 |
|
323 | series2->add(domain2.m_maxX, domain2.m_maxY); | |
322 | QLineChartSeries series3; |
|
324 | QLineChartSeries* series3 = new QLineChartSeries(); | |
323 |
series3 |
|
325 | series3->add(domain3.m_minX, domain3.m_minY); | |
324 |
series3 |
|
326 | series3->add(domain3.m_maxX, domain3.m_maxY); | |
325 |
|
327 | |||
326 | QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis*))); |
|
328 | QSignalSpy spy0(&dataSet, SIGNAL(axisAdded(QChartAxis*))); | |
327 | QSignalSpy spy1(&dataSet, |
|
329 | QSignalSpy spy1(&dataSet, | |
@@ -332,9 +334,9 void tst_ChartDataSet::domain() | |||||
332 | SIGNAL(seriesDomainChanged(QChartSeries*, Domain const&))); |
|
334 | SIGNAL(seriesDomainChanged(QChartSeries*, Domain const&))); | |
333 | QSignalSpy spy5(&dataSet, SIGNAL(seriesRemoved(QChartSeries*))); |
|
335 | QSignalSpy spy5(&dataSet, SIGNAL(seriesRemoved(QChartSeries*))); | |
334 |
|
336 | |||
335 |
dataSet.addSeries( |
|
337 | dataSet.addSeries(series1); | |
336 |
dataSet.addSeries( |
|
338 | dataSet.addSeries(series2); | |
337 |
dataSet.addSeries( |
|
339 | dataSet.addSeries(series3); | |
338 |
|
340 | |||
339 | QCOMPARE(dataSet.domainIndex(), 0); |
|
341 | QCOMPARE(dataSet.domainIndex(), 0); | |
340 | QVERIFY2(dataSet.domain(dataSet.axisY()) == domain, "Domain not equal"); |
|
342 | QVERIFY2(dataSet.domain(dataSet.axisY()) == domain, "Domain not equal"); | |
@@ -368,11 +370,11 void tst_ChartDataSet::nextpreviousDomain() | |||||
368 | ChartDataSet dataSet; |
|
370 | ChartDataSet dataSet; | |
369 |
|
371 | |||
370 | Domain domain1(0, 1000, 0, 1000); |
|
372 | Domain domain1(0, 1000, 0, 1000); | |
371 | QLineChartSeries series; |
|
373 | QLineChartSeries* series = new QLineChartSeries(); | |
372 |
series |
|
374 | series->add(0, 0); | |
373 |
series |
|
375 | series->add(1000, 1000); | |
374 |
|
376 | |||
375 |
dataSet.addSeries( |
|
377 | dataSet.addSeries(series); | |
376 |
|
378 | |||
377 | QCOMPARE(dataSet.domainIndex(), 0); |
|
379 | QCOMPARE(dataSet.domainIndex(), 0); | |
378 |
|
380 |
General Comments 0
You need to be logged in to leave comments.
Login now