diff options
Diffstat (limited to 'tests/auto/cpptest/q3dscatter/tst_scatter.cpp')
-rw-r--r-- | tests/auto/cpptest/q3dscatter/tst_scatter.cpp | 62 |
1 files changed, 23 insertions, 39 deletions
diff --git a/tests/auto/cpptest/q3dscatter/tst_scatter.cpp b/tests/auto/cpptest/q3dscatter/tst_scatter.cpp index 502c2923..f6ac402e 100644 --- a/tests/auto/cpptest/q3dscatter/tst_scatter.cpp +++ b/tests/auto/cpptest/q3dscatter/tst_scatter.cpp @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtTest/QtTest> @@ -54,6 +28,7 @@ private slots: void selectSeries(); void removeSeries(); void removeMultipleSeries(); + void hasSeries(); private: Q3DScatter *m_graph; @@ -103,7 +78,7 @@ void tst_scatter::construct() void tst_scatter::initialProperties() { QVERIFY(m_graph); - QCOMPARE(m_graph->seriesList().length(), 0); + QCOMPARE(m_graph->seriesList().size(), 0); QVERIFY(!m_graph->selectedSeries()); QCOMPARE(m_graph->axisX()->orientation(), QAbstract3DAxis::AxisOrientationX); QCOMPARE(m_graph->axisY()->orientation(), QAbstract3DAxis::AxisOrientationY); @@ -173,9 +148,9 @@ void tst_scatter::invalidProperties() m_graph->setLocale(QLocale("XX")); QCOMPARE(m_graph->selectionMode(), QAbstract3DGraph::SelectionItem); - QCOMPARE(m_graph->aspectRatio(), -1.0/*2.0*/); // TODO: Fix once QTRD-3367 is done - QCOMPARE(m_graph->horizontalAspectRatio(), -1.0/*0.0*/); // TODO: Fix once QTRD-3367 is done - QCOMPARE(m_graph->reflectivity(), -1.0/*0.5*/); // TODO: Fix once QTRD-3367 is done + QCOMPARE(m_graph->aspectRatio(), 2.0); + QCOMPARE(m_graph->horizontalAspectRatio(), 0.0); + QCOMPARE(m_graph->reflectivity(), 0.5); QCOMPARE(m_graph->locale(), QLocale("C")); } @@ -183,7 +158,7 @@ void tst_scatter::addSeries() { m_graph->addSeries(newSeries()); - QCOMPARE(m_graph->seriesList().length(), 1); + QCOMPARE(m_graph->seriesList().size(), 1); QVERIFY(!m_graph->selectedSeries()); } @@ -197,7 +172,7 @@ void tst_scatter::addMultipleSeries() m_graph->addSeries(series2); m_graph->addSeries(series3); - QCOMPARE(m_graph->seriesList().length(), 3); + QCOMPARE(m_graph->seriesList().size(), 3); } void tst_scatter::selectSeries() @@ -207,7 +182,7 @@ void tst_scatter::selectSeries() m_graph->addSeries(series); m_graph->seriesList()[0]->setSelectedItem(1); - QCOMPARE(m_graph->seriesList().length(), 1); + QCOMPARE(m_graph->seriesList().size(), 1); QCOMPARE(m_graph->selectedSeries(), series); m_graph->clearSelection(); @@ -220,7 +195,7 @@ void tst_scatter::removeSeries() m_graph->addSeries(series); m_graph->removeSeries(series); - QCOMPARE(m_graph->seriesList().length(), 0); + QCOMPARE(m_graph->seriesList().size(), 0); delete series; } @@ -239,19 +214,28 @@ void tst_scatter::removeMultipleSeries() QCOMPARE(m_graph->selectedSeries(), series); m_graph->removeSeries(series); - QCOMPARE(m_graph->seriesList().length(), 2); + QCOMPARE(m_graph->seriesList().size(), 2); QVERIFY(!m_graph->selectedSeries()); m_graph->removeSeries(series2); - QCOMPARE(m_graph->seriesList().length(), 1); + QCOMPARE(m_graph->seriesList().size(), 1); m_graph->removeSeries(series3); - QCOMPARE(m_graph->seriesList().length(), 0); + QCOMPARE(m_graph->seriesList().size(), 0); delete series; delete series2; delete series3; } +void tst_scatter::hasSeries() +{ + QScatter3DSeries *series1 = newSeries(); + m_graph->addSeries(series1); + QCOMPARE(m_graph->hasSeries(series1), true); + QScatter3DSeries *series2 = newSeries(); + QCOMPARE(m_graph->hasSeries(series2), false); +} + QTEST_MAIN(tst_scatter) #include "tst_scatter.moc" |