diff --git a/examples/legend/mainwidget.cpp b/examples/legend/mainwidget.cpp index 5964cb2..8e60a4d 100644 --- a/examples/legend/mainwidget.cpp +++ b/examples/legend/mainwidget.cpp @@ -178,8 +178,8 @@ void MainWidget::attachLegend() void MainWidget::addBarset() { - QBarSet *barSet = new QBarSet(QString("set ") + QString::number(m_series->barsetCount())); - qreal delta = m_series->barsetCount() * 0.1; + QBarSet *barSet = new QBarSet(QString("set ") + QString::number(m_series->count())); + qreal delta = m_series->count() * 0.1; *barSet << QPointF(0.0 + delta, 1 + delta) << QPointF(1.0 + delta, 2 + delta) << QPointF(2.0 + delta, 3 + delta) << QPointF(3.0 + delta, 4 + delta); m_series->append(barSet); } diff --git a/tests/auto/qbarmodelmapper/tst_qbarmodelmapper.cpp b/tests/auto/qbarmodelmapper/tst_qbarmodelmapper.cpp index a4156f6..64d1e23 100644 --- a/tests/auto/qbarmodelmapper/tst_qbarmodelmapper.cpp +++ b/tests/auto/qbarmodelmapper/tst_qbarmodelmapper.cpp @@ -181,7 +181,7 @@ void tst_qbarmodelmapper::verticalMapper() m_chart->addSeries(m_series); - QCOMPARE(m_series->barsetCount(), expectedBarSetCount); + QCOMPARE(m_series->count(), expectedBarSetCount); QCOMPARE(mapper->firstBarSetColumn(), qMax(-1, firstBarSetColumn)); QCOMPARE(mapper->lastBarSetColumn(), qMax(-1, lastBarSetColumn)); @@ -216,7 +216,7 @@ void tst_qbarmodelmapper::verticalMapperCustomMapping() m_series = new QGroupedBarSeries; - QCOMPARE(m_series->barsetCount(), 0); + QCOMPARE(m_series->count(), 0); QVBarModelMapper *mapper = new QVBarModelMapper; mapper->setFirstBarSetColumn(0); @@ -227,7 +227,7 @@ void tst_qbarmodelmapper::verticalMapperCustomMapping() mapper->setCount(countLimit); m_chart->addSeries(m_series); - QCOMPARE(m_series->barsetCount(), expectedBarSetCount); + QCOMPARE(m_series->count(), expectedBarSetCount); if (expectedBarSetCount > 0) QCOMPARE(m_series->barSets().first()->count(), expectedCount); @@ -236,7 +236,7 @@ void tst_qbarmodelmapper::verticalMapperCustomMapping() mapper->setFirstBarSetColumn(-1); mapper->setLastBarSetColumn(1); - QCOMPARE(m_series->barsetCount(), 0); + QCOMPARE(m_series->count(), 0); delete mapper; mapper = 0; @@ -271,7 +271,7 @@ void tst_qbarmodelmapper::horizontalMapper() m_chart->addSeries(m_series); - QCOMPARE(m_series->barsetCount(), expectedBarSetCount); + QCOMPARE(m_series->count(), expectedBarSetCount); QCOMPARE(mapper->firstBarSetRow(), qMax(-1, firstBarSetRow)); QCOMPARE(mapper->lastBarSetRow(), qMax(-1, lastBarSetRow)); @@ -306,7 +306,7 @@ void tst_qbarmodelmapper::horizontalMapperCustomMapping() m_series = new QGroupedBarSeries; - QCOMPARE(m_series->barsetCount(), 0); + QCOMPARE(m_series->count(), 0); QHBarModelMapper *mapper = new QHBarModelMapper; mapper->setFirstBarSetRow(0); @@ -317,7 +317,7 @@ void tst_qbarmodelmapper::horizontalMapperCustomMapping() mapper->setCount(countLimit); m_chart->addSeries(m_series); - QCOMPARE(m_series->barsetCount(), expectedBarSetCount); + QCOMPARE(m_series->count(), expectedBarSetCount); if (expectedBarSetCount > 0) QCOMPARE(m_series->barSets().first()->count(), expectedCount); @@ -326,7 +326,7 @@ void tst_qbarmodelmapper::horizontalMapperCustomMapping() mapper->setFirstBarSetRow(-1); mapper->setLastBarSetRow(1); - QCOMPARE(m_series->barsetCount(), 0); + QCOMPARE(m_series->count(), 0); delete mapper; mapper = 0; @@ -379,39 +379,39 @@ void tst_qbarmodelmapper::verticalModelInsertRows() { // setup the mapper createVerticalMapper(); - QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); + QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount); QVERIFY(m_vMapper->model() != 0); int insertCount = 4; m_model->insertRows(3, insertCount); - QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); + QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount + insertCount); int first = 3; m_vMapper->setFirst(3); - QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); + QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount + insertCount - first); m_model->insertRows(3, insertCount); - QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); + QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount + 2 * insertCount - first); int countLimit = 6; m_vMapper->setCount(countLimit); - QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); + QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelRowCount + 2 * insertCount - first)); m_model->insertRows(3, insertCount); - QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); + QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelRowCount + 3 * insertCount - first)); m_vMapper->setFirst(0); - QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); + QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelRowCount + 3 * insertCount)); m_vMapper->setCount(-1); - QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); + QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount + 3 * insertCount); } @@ -419,39 +419,39 @@ void tst_qbarmodelmapper::verticalModelRemoveRows() { // setup the mapper createVerticalMapper(); - QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); + QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount); QVERIFY(m_vMapper->model() != 0); int removeCount = 2; m_model->removeRows(1, removeCount); - QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); + QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount - removeCount); int first = 1; m_vMapper->setFirst(first); - QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); + QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount - removeCount - first); m_model->removeRows(1, removeCount); - QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); + QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount - 2 * removeCount - first); int countLimit = 3; m_vMapper->setCount(countLimit); - QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); + QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelRowCount - 2 * removeCount - first)); m_model->removeRows(1, removeCount); - QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); + QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelRowCount - 3 * removeCount - first)); m_vMapper->setFirst(0); - QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); + QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelRowCount - 3 * removeCount)); m_vMapper->setCount(-1); - QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); + QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount - 3 * removeCount); } @@ -459,13 +459,13 @@ void tst_qbarmodelmapper::verticalModelInsertColumns() { // setup the mapper createVerticalMapper(); - QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); + QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount); QVERIFY(m_vMapper->model() != 0); int insertCount = 4; m_model->insertColumns(3, insertCount); - QCOMPARE(m_series->barsetCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); + QCOMPARE(m_series->count(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount); } @@ -473,31 +473,31 @@ void tst_qbarmodelmapper::verticalModelRemoveColumns() { // setup the mapper createVerticalMapper(); - QCOMPARE(m_series->barsetCount(), qMin(m_model->columnCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1)); + QCOMPARE(m_series->count(), qMin(m_model->columnCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1)); QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount); QVERIFY(m_vMapper->model() != 0); int removeCount = m_modelColumnCount - 2; m_model->removeColumns(0, removeCount); - QCOMPARE(m_series->barsetCount(), qMin(m_model->columnCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1)); + QCOMPARE(m_series->count(), qMin(m_model->columnCount(), m_vMapper->lastBarSetColumn() - m_vMapper->firstBarSetColumn() + 1)); QCOMPARE(m_series->barSets().first()->count(), m_modelRowCount); // leave all the columns m_model->removeColumns(0, m_modelColumnCount - removeCount); - QCOMPARE(m_series->barsetCount(), 0); + QCOMPARE(m_series->count(), 0); } void tst_qbarmodelmapper::horizontalModelInsertRows() { // setup the mapper createHorizontalMapper(); - QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); + QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount); QVERIFY(m_hMapper->model() != 0); int insertCount = 4; m_model->insertRows(3, insertCount); - QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); + QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount); } @@ -505,57 +505,57 @@ void tst_qbarmodelmapper::horizontalModelRemoveRows() { // setup the mapper createHorizontalMapper(); - QCOMPARE(m_series->barsetCount(), qMin(m_model->rowCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1)); + QCOMPARE(m_series->count(), qMin(m_model->rowCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1)); QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount); QVERIFY(m_hMapper->model() != 0); int removeCount = m_modelRowCount - 2; m_model->removeRows(0, removeCount); - QCOMPARE(m_series->barsetCount(), qMin(m_model->rowCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1)); + QCOMPARE(m_series->count(), qMin(m_model->rowCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1)); QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount); // leave all the columns m_model->removeRows(0, m_modelRowCount - removeCount); - QCOMPARE(m_series->barsetCount(), 0); + QCOMPARE(m_series->count(), 0); } void tst_qbarmodelmapper::horizontalModelInsertColumns() { // setup the mapper createHorizontalMapper(); - QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); + QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount); QVERIFY(m_hMapper->model() != 0); int insertCount = 4; m_model->insertColumns(3, insertCount); - QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); + QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount + insertCount); int first = 3; m_hMapper->setFirst(3); - QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); + QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount + insertCount - first); m_model->insertColumns(3, insertCount); - QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); + QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount + 2 * insertCount - first); int countLimit = 6; m_hMapper->setCount(countLimit); - QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); + QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelColumnCount + 2 * insertCount - first)); m_model->insertColumns(3, insertCount); - QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); + QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelColumnCount + 3 * insertCount - first)); m_hMapper->setFirst(0); - QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); + QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelColumnCount + 3 * insertCount)); m_hMapper->setCount(-1); - QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); + QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount + 3 * insertCount); } @@ -563,39 +563,39 @@ void tst_qbarmodelmapper::horizontalModelRemoveColumns() { // setup the mapper createHorizontalMapper(); - QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); + QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount); QVERIFY(m_hMapper->model() != 0); int removeCount = 2; m_model->removeColumns(1, removeCount); - QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); + QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount - removeCount); int first = 1; m_hMapper->setFirst(first); - QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); + QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount - removeCount - first); m_model->removeColumns(1, removeCount); - QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); + QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount - 2 * removeCount - first); int countLimit = 3; m_hMapper->setCount(countLimit); - QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); + QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelColumnCount - 2 * removeCount - first)); m_model->removeColumns(1, removeCount); - QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); + QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelColumnCount - 3 * removeCount - first)); m_hMapper->setFirst(0); - QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); + QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), qMin(countLimit, m_modelColumnCount - 3 * removeCount)); m_hMapper->setCount(-1); - QCOMPARE(m_series->barsetCount(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); + QCOMPARE(m_series->count(), m_hMapper->lastBarSetRow() - m_hMapper->firstBarSetRow() + 1); QCOMPARE(m_series->barSets().first()->count(), m_modelColumnCount - 3 * removeCount); } diff --git a/tests/auto/qbarseries/tst_qbarseries.cpp b/tests/auto/qbarseries/tst_qbarseries.cpp index 72c5aed..2a3137b 100644 --- a/tests/auto/qbarseries/tst_qbarseries.cpp +++ b/tests/auto/qbarseries/tst_qbarseries.cpp @@ -49,8 +49,8 @@ private slots: void remove(); void appendList_data(); void appendList(); - void barsetCount_data(); - void barsetCount(); + void count_data(); + void count(); void barSets_data(); void barSets(); void setLabelsVisible_data(); @@ -129,7 +129,7 @@ void tst_QBarSeries::append_data() void tst_QBarSeries::append() { - QVERIFY(m_barseries->barsetCount() == 0); + QVERIFY(m_barseries->count() == 0); bool ret = false; @@ -138,24 +138,24 @@ void tst_QBarSeries::append() ret = m_barseries->append(barset); QVERIFY(ret == true); - QVERIFY(m_barseries->barsetCount() == 1); + QVERIFY(m_barseries->count() == 1); // Try adding another set QBarSet *barset2 = new QBarSet("testset2"); ret = m_barseries->append(barset2); QVERIFY(ret == true); - QVERIFY(m_barseries->barsetCount() == 2); + QVERIFY(m_barseries->count() == 2); // Try adding same set again ret = m_barseries->append(barset2); QVERIFY(ret == false); - QVERIFY(m_barseries->barsetCount() == 2); + QVERIFY(m_barseries->count() == 2); // Try adding null set ret = m_barseries->append(0); QVERIFY(ret == false); - QVERIFY(m_barseries->barsetCount() == 2); + QVERIFY(m_barseries->count() == 2); } @@ -166,18 +166,18 @@ void tst_QBarSeries::remove_data() void tst_QBarSeries::remove() { int count = m_testSets.count(); - QVERIFY(m_barseries_with_sets->barsetCount() == count); + QVERIFY(m_barseries_with_sets->count() == count); // Try to remove null pointer (should not remove, should not crash) bool ret = false; ret = m_barseries_with_sets->remove(0); QVERIFY(ret == false); - QVERIFY(m_barseries_with_sets->barsetCount() == count); + QVERIFY(m_barseries_with_sets->count() == count); // Try to remove invalid pointer (should not remove, should not crash) ret = m_barseries_with_sets->remove((QBarSet*) (m_testSets.at(0) + 1) ); QVERIFY(ret == false); - QVERIFY(m_barseries_with_sets->barsetCount() == count); + QVERIFY(m_barseries_with_sets->count() == count); // remove some sets ret = m_barseries_with_sets->remove(m_testSets.at(2)); @@ -187,7 +187,7 @@ void tst_QBarSeries::remove() ret = m_barseries_with_sets->remove(m_testSets.at(4)); QVERIFY(ret == true); - QVERIFY(m_barseries_with_sets->barsetCount() == 2); + QVERIFY(m_barseries_with_sets->count() == 2); QList verifysets = m_barseries_with_sets->barSets(); @@ -201,7 +201,7 @@ void tst_QBarSeries::remove() } QVERIFY(ret == true); - QVERIFY(m_barseries_with_sets->barsetCount() == 0); + QVERIFY(m_barseries_with_sets->count() == 0); } void tst_QBarSeries::appendList_data() @@ -212,7 +212,7 @@ void tst_QBarSeries::appendList_data() void tst_QBarSeries::appendList() { int count = 5; - QVERIFY(m_barseries->barsetCount() == 0); + QVERIFY(m_barseries->count() == 0); QList sets; for (int i=0; iappend(sets); QVERIFY(ret == true); - QVERIFY(m_barseries->barsetCount() == count); + QVERIFY(m_barseries->count() == count); // Append same sets again (should fail, count should remain same) ret = m_barseries->append(sets); QVERIFY(ret == false); - QVERIFY(m_barseries->barsetCount() == count); + QVERIFY(m_barseries->count() == count); // Try append empty list (should succeed, but count should remain same) QList invalidList; ret = m_barseries->append(invalidList); QVERIFY(ret == true); - QVERIFY(m_barseries->barsetCount() == count); + QVERIFY(m_barseries->count() == count); // Try append list with one new and one existing set (should fail, count remains same) invalidList.append(new QBarSet("ok set")); invalidList.append(sets.at(0)); ret = m_barseries->append(invalidList); QVERIFY(ret == false); - QVERIFY(m_barseries->barsetCount() == count); + QVERIFY(m_barseries->count() == count); // Try append list with null pointers (should fail, count remains same) QList invalidList2; @@ -250,18 +250,18 @@ void tst_QBarSeries::appendList() invalidList2.append(0); ret = m_barseries->append(invalidList2); QVERIFY(ret == false); - QVERIFY(m_barseries->barsetCount() == count); + QVERIFY(m_barseries->count() == count); } -void tst_QBarSeries::barsetCount_data() +void tst_QBarSeries::count_data() { } -void tst_QBarSeries::barsetCount() +void tst_QBarSeries::count() { - QVERIFY(m_barseries->barsetCount() == 0); - QVERIFY(m_barseries_with_sets->barsetCount() == m_testSets.count()); + QVERIFY(m_barseries->count() == 0); + QVERIFY(m_barseries_with_sets->count() == m_testSets.count()); } void tst_QBarSeries::barSets_data()