From d1f113b2af85313bfe2852de5364b1a61eb7d70a 2012-07-16 14:20:31 From: Michal Klocek Date: 2012-07-16 14:20:31 Subject: [PATCH] Updates tst_qvaluesaxis test cases --- diff --git a/src/axis/valuesaxis/qvaluesaxis.cpp b/src/axis/valuesaxis/qvaluesaxis.cpp index 0bdfed8..4fa085e 100644 --- a/src/axis/valuesaxis/qvaluesaxis.cpp +++ b/src/axis/valuesaxis/qvaluesaxis.cpp @@ -200,7 +200,7 @@ void QValuesAxis::setRange(qreal min, qreal max) void QValuesAxis::setTicksCount(int count) { Q_D(QValuesAxis); - if (d->m_tickCount != count) { + if (d->m_tickCount != count && count >=2) { d->m_tickCount = count; d->emitUpdated(); } @@ -221,7 +221,7 @@ void QValuesAxis::setNiceNumbersEnabled(bool enable) Q_D(QValuesAxis); if (d->m_niceNumbers != enable){ d->m_niceNumbers = enable; - if(enable) setRange(d->min(),d->max()); + if(enable && !qFuzzyIsNull(d->m_max - d->m_min)) setRange(d->min(),d->max()); } } diff --git a/tests/auto/domain/tst_domain.cpp b/tests/auto/domain/tst_domain.cpp index 44bfbde..0bfe990 100644 --- a/tests/auto/domain/tst_domain.cpp +++ b/tests/auto/domain/tst_domain.cpp @@ -656,78 +656,6 @@ void tst_Domain::move() TRY_COMPARE(spy2.count(), (dy != 0 ? 1 : 0)); } -/* -void tst_Domain::handleAxisXChanged_data() -{ - QTest::addColumn("min"); - QTest::addColumn("max"); - QTest::addColumn("tickCount"); - QTest::addColumn("niceNumbers"); - QTest::addColumn("resultMin"); - QTest::addColumn("resultMax"); - QTest::addColumn("resultTickCount"); - QTest::newRow("0,100,5,false") << 0.0 << 100.0 << 5 << false << 0.0 << 100.0 << 5; - QTest::newRow("0,100,5,true") << 0.0 << 100.0 << 5 << true << 0.0 << 100.0 << 6; - QTest::newRow("0.1,99,5,true") << 0.1 << 99.0 << 5 << true << 0.0 << 100.0 << 6; - QTest::newRow("5,93.5,true") << 5.0 << 93.5 << 5 << true << 0.0 << 100.0 << 6; -} - -void tst_Domain::handleAxisXChanged() -{ - QFETCH(qreal, min); - QFETCH(qreal, max); - QFETCH(int, tickCount); - QFETCH(bool, niceNumbers); - QFETCH(qreal, resultMin); - QFETCH(qreal, resultMax); - QFETCH(int, resultTickCount); - - Domain domain; - QSignalSpy spy0(&domain, SIGNAL(updated())); - QSignalSpy spy1(&domain, SIGNAL(rangeXChanged(qreal,qreal))); - QSignalSpy spy2(&domain, SIGNAL(rangeYChanged(qreal,qreal))); - - // domain.handleAxisXChanged(min, max, tickCount, niceNumbers); - - QCOMPARE(resultMin, domain.minX()); - QCOMPARE(resultMax, domain.maxX()); - // QCOMPARE(resultTickCount, domain.tickXCount()); - TRY_COMPARE(spy0.count(), 1); - TRY_COMPARE(spy1.count(), 1); - TRY_COMPARE(spy2.count(), 0); - -} - -void tst_Domain::handleAxisYChanged_data() -{ - handleAxisXChanged_data(); -} - -void tst_Domain::handleAxisYChanged() -{ - QFETCH(qreal, min); - QFETCH(qreal, max); - QFETCH(int, tickCount); - QFETCH(bool, niceNumbers); - QFETCH(qreal, resultMin); - QFETCH(qreal, resultMax); - QFETCH(int, resultTickCount); - - Domain domain; - QSignalSpy spy0(&domain, SIGNAL(updated())); - QSignalSpy spy1(&domain, SIGNAL(rangeXChanged(qreal,qreal))); - QSignalSpy spy2(&domain, SIGNAL(rangeYChanged(qreal,qreal))); - - // domain.handleAxisYChanged(min, max, tickCount, niceNumbers); - - QCOMPARE(resultMin, domain.minY()); - QCOMPARE(resultMax, domain.maxY()); - // QCOMPARE(resultTickCount, domain.tickYCount()); - TRY_COMPARE(spy0.count(), 1); - TRY_COMPARE(spy1.count(), 0); - TRY_COMPARE(spy2.count(), 1); -} -*/ QTEST_MAIN(tst_Domain) #include "tst_domain.moc" diff --git a/tests/auto/qvaluesaxis/tst_qvaluesaxis.cpp b/tests/auto/qvaluesaxis/tst_qvaluesaxis.cpp index 71ff05f..cb2fc71 100644 --- a/tests/auto/qvaluesaxis/tst_qvaluesaxis.cpp +++ b/tests/auto/qvaluesaxis/tst_qvaluesaxis.cpp @@ -1,30 +1,30 @@ /**************************************************************************** -** -** Copyright (C) 2012 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the Qt Commercial Charts Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ + ** + ** Copyright (C) 2012 Digia Plc + ** All rights reserved. + ** For any questions to Digia, please use contact form at http://qt.digia.com + ** + ** This file is part of the Qt Commercial Charts Add-on. + ** + ** $QT_BEGIN_LICENSE$ + ** Licensees holding valid Qt Commercial licenses may use this file in + ** accordance with the Qt Commercial License Agreement provided with the + ** Software or, alternatively, in accordance with the terms contained in + ** a written agreement between you and Digia. + ** + ** If you have questions regarding the use of this file, please use + ** contact form at http://qt.digia.com + ** $QT_END_LICENSE$ + ** + ****************************************************************************/ #include "../qabstractaxis/tst_qabstractaxis.h" #include "qvaluesaxis.h" #include -class tst_QValuesAxis : public tst_QAbstractAxis +class tst_QValuesAxis: public tst_QAbstractAxis { - Q_OBJECT +Q_OBJECT public slots: void initTestCase(); @@ -36,51 +36,48 @@ private slots: void qvaluesaxis_data(); void qvaluesaxis(); + void max_raw_data(); + void max_raw(); void max_data(); void max(); + void max_animation_data(); + void max_animation(); + void min_raw_data(); + void min_raw(); void min_data(); void min(); + void min_animation_data(); + void min_animation(); void niceNumbersEnabled_data(); void niceNumbersEnabled(); - void setNiceNumbersEnabled_data(); - void setNiceNumbersEnabled(); - void setRange_data(); - void setRange(); - void setTicksCount_data(); - void setTicksCount(); + void range_raw_data(); + void range_raw(); + void range_data(); + void range(); + void range_animation_data(); + void range_animation(); void ticksCount_data(); void ticksCount(); - void type_data(); - void type(); - void maxChanged_data(); - void maxChanged(); - void minChanged_data(); - void minChanged(); - void rangeChanged_data(); - void rangeChanged(); private: QValuesAxis* m_valuesaxis; QLineSeries* m_series; }; - void tst_QValuesAxis::initTestCase() { } - void tst_QValuesAxis::cleanupTestCase() { } - void tst_QValuesAxis::init() { m_valuesaxis = new QValuesAxis(); tst_QAbstractAxis::init(m_valuesaxis); m_series = new QLineSeries(); - *m_series << QPointF(-100,-100) << QPointF(0,0) << QPointF(100,100); + *m_series << QPointF(-100, -100) << QPointF(0, 0) << QPointF(100, 100); m_chart->addSeries(m_series); m_chart->createDefaultAxes(); } @@ -90,7 +87,7 @@ void tst_QValuesAxis::cleanup() delete m_series; delete m_valuesaxis; m_series = 0; - m_valuesaxis = 0 ; + m_valuesaxis = 0; tst_QAbstractAxis::cleanup(); } @@ -108,7 +105,7 @@ void tst_QValuesAxis::qvaluesaxis() QCOMPARE(m_valuesaxis->ticksCount(), 5); QCOMPARE(m_valuesaxis->type(), QAbstractAxis::AxisTypeValues); - m_chart->setAxisX(m_valuesaxis,m_series); + m_chart->setAxisX(m_valuesaxis, m_series); m_view->show(); QTest::qWaitForWindowShown(m_view); @@ -118,313 +115,235 @@ void tst_QValuesAxis::qvaluesaxis() QCOMPARE(m_valuesaxis->ticksCount(), 5); } -void tst_QValuesAxis::max_data() +void tst_QValuesAxis::max_raw_data() { QTest::addColumn("max"); - QTest::newRow("null") << 0.0; + QTest::newRow("1.0") << 1.0; + QTest::newRow("50.0") << 50.0; + QTest::newRow("101.0") << 101.0; } -// public qreal max() const -void tst_QValuesAxis::max() +void tst_QValuesAxis::max_raw() { -#if 0 QFETCH(qreal, max); - SubQValuesAxis axis; - - QSignalSpy spy0(&axis, SIGNAL(maxChanged(qreal))); - QSignalSpy spy1(&axis, SIGNAL(minChanged(qreal))); - QSignalSpy spy2(&axis, SIGNAL(rangeChanged(qreal, qreal))); + QSignalSpy spy0(m_valuesaxis, SIGNAL(maxChanged(qreal))); + QSignalSpy spy1(m_valuesaxis, SIGNAL(minChanged(qreal))); + QSignalSpy spy2(m_valuesaxis, SIGNAL(rangeChanged(qreal, qreal))); - QCOMPARE(axis.max(), max); + m_valuesaxis->setMax(max); + QVERIFY2(qFuzzyIsNull(m_valuesaxis->max() - max), "Not equal"); - QCOMPARE(spy0.count(), 0); + QCOMPARE(spy0.count(), 1); QCOMPARE(spy1.count(), 0); - QCOMPARE(spy2.count(), 0); -#endif - QSKIP("Test is not implemented.", SkipAll); -} - -void tst_QValuesAxis::min_data() -{ - QTest::addColumn("min"); - QTest::newRow("null") << 0.0; -} - -// public qreal min() const -void tst_QValuesAxis::min() -{ -#if 0 - QFETCH(qreal, min); - - SubQValuesAxis axis; + QCOMPARE(spy2.count(), 1); - QSignalSpy spy0(&axis, SIGNAL(maxChanged(qreal))); - QSignalSpy spy1(&axis, SIGNAL(minChanged(qreal))); - QSignalSpy spy2(&axis, SIGNAL(rangeChanged(qreal, qreal))); - - QCOMPARE(axis.min(), min); - - QCOMPARE(spy0.count(), 0); - QCOMPARE(spy1.count(), 0); - QCOMPARE(spy2.count(), 0); -#endif - QSKIP("Test is not implemented.", SkipAll); } -void tst_QValuesAxis::niceNumbersEnabled_data() +void tst_QValuesAxis::max_data() { - QTest::addColumn("niceNumbersEnabled"); - QTest::newRow("true") << true; - QTest::newRow("false") << false; + max_raw_data(); } -// public bool niceNumbersEnabled() const -void tst_QValuesAxis::niceNumbersEnabled() +void tst_QValuesAxis::max() { -#if 0 - QFETCH(bool, niceNumbersEnabled); - - SubQValuesAxis axis; - - QSignalSpy spy0(&axis, SIGNAL(maxChanged(qreal))); - QSignalSpy spy1(&axis, SIGNAL(minChanged(qreal))); - QSignalSpy spy2(&axis, SIGNAL(rangeChanged(qreal, qreal))); - - QCOMPARE(axis.niceNumbersEnabled(), niceNumbersEnabled); - - QCOMPARE(spy0.count(), 0); - QCOMPARE(spy1.count(), 0); - QCOMPARE(spy2.count(), 0); -#endif - QSKIP("Test is not implemented.", SkipAll); + m_chart->setAxisX(m_valuesaxis, m_series); + m_view->show(); + QTest::qWaitForWindowShown(m_view); + max_raw(); } - -void tst_QValuesAxis::setNiceNumbersEnabled_data() +void tst_QValuesAxis::max_animation_data() { - QTest::addColumn("enable"); - QTest::newRow("true") << true; - QTest::newRow("false") << false; + max_data(); } -// public void setNiceNumbersEnabled(bool enable = true) -void tst_QValuesAxis::setNiceNumbersEnabled() +void tst_QValuesAxis::max_animation() { -#if 0 - QFETCH(bool, enable); - - SubQValuesAxis axis; - - QSignalSpy spy0(&axis, SIGNAL(maxChanged(qreal))); - QSignalSpy spy1(&axis, SIGNAL(minChanged(qreal))); - QSignalSpy spy2(&axis, SIGNAL(rangeChanged(qreal, qreal))); - - axis.setNiceNumbersEnabled(enable); - - QCOMPARE(spy0.count(), 0); - QCOMPARE(spy1.count(), 0); - QCOMPARE(spy2.count(), 0); -#endif - QSKIP("Test is not implemented.", SkipAll); + m_chart->setAnimationOptions(QChart::GridAxisAnimations); + max(); } -void tst_QValuesAxis::setRange_data() +void tst_QValuesAxis::min_raw_data() { QTest::addColumn("min"); - QTest::addColumn("max"); - QTest::newRow("null") << 0.0 << 0.0; + QTest::newRow("-1.0") << -1.0; + QTest::newRow("-50.0") << -50.0; + QTest::newRow("-101.0") << -101.0; } -// public void setRange(qreal min, qreal max) -void tst_QValuesAxis::setRange() +void tst_QValuesAxis::min_raw() { -#if 0 QFETCH(qreal, min); - QFETCH(qreal, max); - SubQValuesAxis axis; + QSignalSpy spy0(m_valuesaxis, SIGNAL(maxChanged(qreal))); + QSignalSpy spy1(m_valuesaxis, SIGNAL(minChanged(qreal))); + QSignalSpy spy2(m_valuesaxis, SIGNAL(rangeChanged(qreal, qreal))); - QSignalSpy spy0(&axis, SIGNAL(maxChanged(qreal))); - QSignalSpy spy1(&axis, SIGNAL(minChanged(qreal))); - QSignalSpy spy2(&axis, SIGNAL(rangeChanged(qreal, qreal))); - - axis.setRange(min, max); + m_valuesaxis->setMin(min); + QVERIFY2(qFuzzyIsNull(m_valuesaxis->min() - min), "Not equal"); QCOMPARE(spy0.count(), 0); - QCOMPARE(spy1.count(), 0); - QCOMPARE(spy2.count(), 0); -#endif - QSKIP("Test is not implemented.", SkipAll); + QCOMPARE(spy1.count(), 1); + QCOMPARE(spy2.count(), 1); } -void tst_QValuesAxis::setTicksCount_data() +void tst_QValuesAxis::min_data() { - QTest::addColumn("count"); - QTest::newRow("0") << 0; - QTest::newRow("-1") << -1; + min_raw_data(); } -// public void setTicksCount(int count) -void tst_QValuesAxis::setTicksCount() +void tst_QValuesAxis::min() { -#if 0 - QFETCH(int, count); - - SubQValuesAxis axis; - - QSignalSpy spy0(&axis, SIGNAL(maxChanged(qreal))); - QSignalSpy spy1(&axis, SIGNAL(minChanged(qreal))); - QSignalSpy spy2(&axis, SIGNAL(rangeChanged(qreal, qreal))); - - axis.setTicksCount(count); - - QCOMPARE(spy0.count(), 0); - QCOMPARE(spy1.count(), 0); - QCOMPARE(spy2.count(), 0); -#endif - QSKIP("Test is not implemented.", SkipAll); + m_chart->setAxisX(m_valuesaxis, m_series); + m_view->show(); + QTest::qWaitForWindowShown(m_view); + min_raw(); } -void tst_QValuesAxis::ticksCount_data() +void tst_QValuesAxis::min_animation_data() { - QTest::addColumn("ticksCount"); - QTest::newRow("0") << 0; - QTest::newRow("-1") << -1; + min_data(); } -// public int ticksCount() const -void tst_QValuesAxis::ticksCount() +void tst_QValuesAxis::min_animation() { -#if 0 - QFETCH(int, ticksCount); - - SubQValuesAxis axis; - - QSignalSpy spy0(&axis, SIGNAL(maxChanged(qreal))); - QSignalSpy spy1(&axis, SIGNAL(minChanged(qreal))); - QSignalSpy spy2(&axis, SIGNAL(rangeChanged(qreal, qreal))); - - QCOMPARE(axis.ticksCount(), ticksCount); - - QCOMPARE(spy0.count(), 0); - QCOMPARE(spy1.count(), 0); - QCOMPARE(spy2.count(), 0); -#endif - QSKIP("Test is not implemented.", SkipAll); + m_chart->setAnimationOptions(QChart::GridAxisAnimations); + min(); } -Q_DECLARE_METATYPE(QAbstractAxis::AxisType) -void tst_QValuesAxis::type_data() +void tst_QValuesAxis::niceNumbersEnabled_data() { -#if 0 - QTest::addColumn("type"); - QTest::newRow("null") << AxisType(); -#endif + QTest::addColumn("niceNumbersEnabled"); + QTest::addColumn("min"); + QTest::addColumn("max"); + QTest::addColumn("ticks"); + QTest::addColumn("expectedMin"); + QTest::addColumn("expectedMax"); + QTest::addColumn("expectedTicks"); + QTest::newRow("true 0.1 , 99.0 , 5") << true << 0.1 << 99.0 << 5 << 0.0 << 100.0 << 6; + QTest::newRow("true 1 , 10.0 , 5") << true << 1.0 << 10.0 << 5 << 0.0 << 10.0 << 6; + QTest::newRow("true 0.1 , 6.6 , 5") << true << 0.1 << 6.6 << 5 << 0.0 << 8.0 << 5; + QTest::newRow("false 0.1 , 6.6 , 5") << false << 0.1 << 6.6 << 5 << 0.1 << 6.6 << 5; + QTest::newRow("true 0.1, 99, 5") << true << 0.1 << 99.0 << 5 << 0.0 << 100.0 << 6; + QTest::newRow("true 5, 93.5 , 5") << true << 5.0 << 93.5 << 5 << 0.0 << 100.0 << 6; } -// public AxisType type() const -void tst_QValuesAxis::type() +void tst_QValuesAxis::niceNumbersEnabled() { -#if 0 - QFETCH(AxisType, type); - - SubQValuesAxis axis; + QFETCH(bool, niceNumbersEnabled); + QFETCH(qreal, min); + QFETCH(qreal, max); + QFETCH(int, ticks); + QFETCH(qreal, expectedMin); + QFETCH(qreal, expectedMax); + QFETCH(int, expectedTicks); - QSignalSpy spy0(&axis, SIGNAL(maxChanged(qreal))); - QSignalSpy spy1(&axis, SIGNAL(minChanged(qreal))); - QSignalSpy spy2(&axis, SIGNAL(rangeChanged(qreal, qreal))); + QSignalSpy spy0(m_valuesaxis, SIGNAL(maxChanged(qreal))); + QSignalSpy spy1(m_valuesaxis, SIGNAL(minChanged(qreal))); + QSignalSpy spy2(m_valuesaxis, SIGNAL(rangeChanged(qreal, qreal))); - QCOMPARE(axis.type(), type); + m_valuesaxis->setNiceNumbersEnabled(niceNumbersEnabled); + QCOMPARE(m_valuesaxis->niceNumbersEnabled(), niceNumbersEnabled); QCOMPARE(spy0.count(), 0); QCOMPARE(spy1.count(), 0); QCOMPARE(spy2.count(), 0); -#endif - QSKIP("Test is not implemented.", SkipAll); + + m_valuesaxis->setTicksCount(ticks); + m_valuesaxis->setRange(min, max); + QVERIFY2(qFuzzyIsNull(m_valuesaxis->min() - expectedMin), "Min not equal"); + QVERIFY2(qFuzzyIsNull(m_valuesaxis->max() - expectedMax), "Max not equal"); + QCOMPARE(m_valuesaxis->ticksCount(), expectedTicks); + + QCOMPARE(spy0.count(), 1); + QCOMPARE(spy1.count(), 1); + QCOMPARE(spy2.count(), 1); + } -void tst_QValuesAxis::maxChanged_data() +void tst_QValuesAxis::range_raw_data() { + QTest::addColumn("min"); QTest::addColumn("max"); - QTest::newRow("null") << 0.0; + QTest::newRow("1.0 - 101.0") << -1.0 << 101.0; + QTest::newRow("25.0 - 75.0") << 25.0 << 75.0; + QTest::newRow("101.0") << 40.0 << 60.0; } -// protected void maxChanged(qreal max) -void tst_QValuesAxis::maxChanged() +void tst_QValuesAxis::range_raw() { -#if 0 + QFETCH(qreal, min); QFETCH(qreal, max); - SubQValuesAxis axis; - - QSignalSpy spy0(&axis, SIGNAL(maxChanged(qreal))); - QSignalSpy spy1(&axis, SIGNAL(minChanged(qreal))); - QSignalSpy spy2(&axis, SIGNAL(rangeChanged(qreal, qreal))); + QSignalSpy spy0(m_valuesaxis, SIGNAL(maxChanged(qreal))); + QSignalSpy spy1(m_valuesaxis, SIGNAL(minChanged(qreal))); + QSignalSpy spy2(m_valuesaxis, SIGNAL(rangeChanged(qreal, qreal))); - axis.call_maxChanged(max); + m_valuesaxis->setRange(min, max); + QVERIFY2(qFuzzyIsNull(m_valuesaxis->min() - min), "Min not equal"); + QVERIFY2(qFuzzyIsNull(m_valuesaxis->max() - max), "Max not equal"); - QCOMPARE(spy0.count(), 0); - QCOMPARE(spy1.count(), 0); - QCOMPARE(spy2.count(), 0); -#endif - QSKIP("Test is not implemented.", SkipAll); + QCOMPARE(spy0.count(), 1); + QCOMPARE(spy1.count(), 1); + QCOMPARE(spy2.count(), 1); } -void tst_QValuesAxis::minChanged_data() +void tst_QValuesAxis::range_data() { - QTest::addColumn("min"); - QTest::newRow("null") << 0.0; + range_raw_data(); } -// protected void minChanged(qreal min) -void tst_QValuesAxis::minChanged() +void tst_QValuesAxis::range() { -#if 0 - QFETCH(qreal, min); - - SubQValuesAxis axis; - - QSignalSpy spy0(&axis, SIGNAL(maxChanged(qreal))); - QSignalSpy spy1(&axis, SIGNAL(minChanged(qreal))); - QSignalSpy spy2(&axis, SIGNAL(rangeChanged(qreal, qreal))); - - axis.call_minChanged(min); + m_chart->setAxisX(m_valuesaxis, m_series); + m_view->show(); + QTest::qWaitForWindowShown(m_view); + range_raw(); +} - QCOMPARE(spy0.count(), 0); - QCOMPARE(spy1.count(), 0); - QCOMPARE(spy2.count(), 0); -#endif - QSKIP("Test is not implemented.", SkipAll); +void tst_QValuesAxis::range_animation_data() +{ + range_data(); } -void tst_QValuesAxis::rangeChanged_data() +void tst_QValuesAxis::range_animation() { - QTest::addColumn("min"); - QTest::addColumn("max"); - QTest::newRow("null") << 0.0 << 0.0; + m_chart->setAnimationOptions(QChart::GridAxisAnimations); + range(); } -// protected void rangeChanged(qreal min, qreal max) -void tst_QValuesAxis::rangeChanged() +void tst_QValuesAxis::ticksCount_data() { -#if 0 - QFETCH(qreal, min); - QFETCH(qreal, max); + QTest::addColumn("ticksCount"); + QTest::addColumn("expectedCount"); + QTest::newRow("0") << 2; + QTest::newRow("1") << 2; + QTest::newRow("2") << 2; + QTest::newRow("3") << 3; + QTest::newRow("-1") << 2; +} - SubQValuesAxis axis; +void tst_QValuesAxis::ticksCount() +{ + QFETCH(int, ticksCount); - QSignalSpy spy0(&axis, SIGNAL(maxChanged(qreal))); - QSignalSpy spy1(&axis, SIGNAL(minChanged(qreal))); - QSignalSpy spy2(&axis, SIGNAL(rangeChanged(qreal, qreal))); + QSignalSpy spy0(m_valuesaxis, SIGNAL(maxChanged(qreal))); + QSignalSpy spy1(m_valuesaxis, SIGNAL(minChanged(qreal))); + QSignalSpy spy2(m_valuesaxis, SIGNAL(rangeChanged(qreal, qreal))); - axis.call_rangeChanged(min, max); + m_valuesaxis->setTicksCount(ticksCount); + QCOMPARE(m_valuesaxis->ticksCount(), ticksCount); QCOMPARE(spy0.count(), 0); QCOMPARE(spy1.count(), 0); QCOMPARE(spy2.count(), 0); -#endif - QSKIP("Test is not implemented.", SkipAll); + + m_chart->setAxisX(m_valuesaxis, m_series); + m_view->show(); + QTest::qWaitForWindowShown(m_view); + + QCOMPARE(m_valuesaxis->ticksCount(), ticksCount); } QTEST_MAIN(tst_QValuesAxis)