diff options
Diffstat (limited to 'tests/auto/cpptest/q3dbars/tst_bars.cpp')
-rw-r--r-- | tests/auto/cpptest/q3dbars/tst_bars.cpp | 80 |
1 files changed, 27 insertions, 53 deletions
diff --git a/tests/auto/cpptest/q3dbars/tst_bars.cpp b/tests/auto/cpptest/q3dbars/tst_bars.cpp index 9c92cc84..96219cb0 100644 --- a/tests/auto/cpptest/q3dbars/tst_bars.cpp +++ b/tests/auto/cpptest/q3dbars/tst_bars.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> @@ -124,7 +98,7 @@ void tst_bars::initialProperties() QCOMPARE(m_graph->barSpacing(), QSizeF(1.0f, 1.0f)); QCOMPARE(m_graph->barSeriesMargin(), QSizeF(0.0f, 0.0f)); QCOMPARE(m_graph->isBarSpacingRelative(), true); - QCOMPARE(m_graph->seriesList().length(), 0); + QCOMPARE(m_graph->seriesList().size(), 0); QVERIFY(!m_graph->selectedSeries()); QVERIFY(!m_graph->primarySeries()); QCOMPARE(m_graph->floorLevel(), 0.0); @@ -212,9 +186,9 @@ void tst_bars::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")); } @@ -224,7 +198,7 @@ void tst_bars::addSeries() m_graph->addSeries(series); - QCOMPARE(m_graph->seriesList().length(), 1); + QCOMPARE(m_graph->seriesList().size(), 1); QVERIFY(!m_graph->selectedSeries()); QCOMPARE(m_graph->primarySeries(), series); } @@ -239,7 +213,7 @@ void tst_bars::addMultipleSeries() m_graph->addSeries(series2); m_graph->addSeries(series3); - QCOMPARE(m_graph->seriesList().length(), 3); + QCOMPARE(m_graph->seriesList().size(), 3); QCOMPARE(m_graph->primarySeries(), series); m_graph->setPrimarySeries(series2); @@ -254,7 +228,7 @@ void tst_bars::selectSeries() m_graph->addSeries(series); m_graph->primarySeries()->setSelectedBar(QPoint(0, 0)); - QCOMPARE(m_graph->seriesList().length(), 1); + QCOMPARE(m_graph->seriesList().size(), 1); QCOMPARE(m_graph->selectedSeries(), series); m_graph->clearSelection(); @@ -267,7 +241,7 @@ void tst_bars::removeSeries() m_graph->addSeries(series); m_graph->removeSeries(series); - QCOMPARE(m_graph->seriesList().length(), 0); + QCOMPARE(m_graph->seriesList().size(), 0); delete series; } @@ -285,16 +259,16 @@ void tst_bars::removeMultipleSeries() QCOMPARE(m_graph->selectedSeries(), series); m_graph->removeSeries(series); - QCOMPARE(m_graph->seriesList().length(), 2); + QCOMPARE(m_graph->seriesList().size(), 2); QCOMPARE(m_graph->primarySeries(), series2); QVERIFY(!m_graph->selectedSeries()); m_graph->removeSeries(series2); - QCOMPARE(m_graph->seriesList().length(), 1); + QCOMPARE(m_graph->seriesList().size(), 1); QCOMPARE(m_graph->primarySeries(), series3); m_graph->removeSeries(series3); - QCOMPARE(m_graph->seriesList().length(), 0); + QCOMPARE(m_graph->seriesList().size(), 0); delete series; delete series2; @@ -320,14 +294,14 @@ void tst_bars::addInputHandler() m_graph->addInputHandler(handler); m_graph->addInputHandler(handler2); - QCOMPARE(m_graph->inputHandlers().length(), 3); // Default, as it is still active, plus added ones + QCOMPARE(m_graph->inputHandlers().size(), 3); // Default, as it is still active, plus added ones QCOMPARE(m_graph->activeInputHandler(), initialHandler); m_graph->setActiveInputHandler(handler2); QCOMPARE(m_graph->activeInputHandler(), handler2); m_graph->setActiveInputHandler(NULL); QVERIFY(!m_graph->activeInputHandler()); - QCOMPARE(m_graph->inputHandlers().length(), 2); + QCOMPARE(m_graph->inputHandlers().size(), 2); } void tst_bars::removeInputHandler() @@ -339,12 +313,12 @@ void tst_bars::removeInputHandler() m_graph->addInputHandler(handler2); m_graph->setActiveInputHandler(handler2); - QCOMPARE(m_graph->inputHandlers().length(), 2); // Default handler removed by previous call + QCOMPARE(m_graph->inputHandlers().size(), 2); // Default handler removed by previous call QCOMPARE(m_graph->activeInputHandler(), handler2); m_graph->releaseInputHandler(handler2); - QCOMPARE(m_graph->inputHandlers().length(), 1); + QCOMPARE(m_graph->inputHandlers().size(), 1); m_graph->releaseInputHandler(handler); - QCOMPARE(m_graph->inputHandlers().length(), 0); + QCOMPARE(m_graph->inputHandlers().size(), 0); delete handler2; delete handler; @@ -358,7 +332,7 @@ void tst_bars::addTheme() m_graph->addTheme(theme); m_graph->addTheme(theme2); - QCOMPARE(m_graph->themes().length(), 3); // Default, plus added ones + QCOMPARE(m_graph->themes().size(), 3); // Default, plus added ones QCOMPARE(m_graph->activeTheme(), initialTheme); m_graph->setActiveTheme(theme2); QCOMPARE(m_graph->activeTheme(), theme2); @@ -374,9 +348,9 @@ void tst_bars::removeTheme() m_graph->setActiveTheme(theme2); QCOMPARE(m_graph->activeTheme(), theme2); m_graph->releaseTheme(theme2); - QCOMPARE(m_graph->themes().length(), 2); + QCOMPARE(m_graph->themes().size(), 2); m_graph->releaseTheme(theme); - QCOMPARE(m_graph->themes().length(), 1); // Default theme remains + QCOMPARE(m_graph->themes().size(), 1); // Default theme remains delete theme2; delete theme; @@ -388,9 +362,9 @@ void tst_bars::addCustomItem() QCustom3DItem *item2 = new QCustom3DItem(); m_graph->addCustomItem(item); - QCOMPARE(m_graph->customItems().length(), 1); + QCOMPARE(m_graph->customItems().size(), 1); m_graph->addCustomItem(item2); - QCOMPARE(m_graph->customItems().length(), 2); + QCOMPARE(m_graph->customItems().size(), 2); } void tst_bars::removeCustomItem() @@ -405,14 +379,14 @@ void tst_bars::removeCustomItem() m_graph->addCustomItem(item3); m_graph->releaseCustomItem(item); - QCOMPARE(m_graph->customItems().length(), 2); + QCOMPARE(m_graph->customItems().size(), 2); m_graph->removeCustomItem(item2); - QCOMPARE(m_graph->customItems().length(), 1); + QCOMPARE(m_graph->customItems().size(), 1); m_graph->addCustomItem(item); m_graph->removeCustomItemAt(QVector3D(1, 1, 1)); - QCOMPARE(m_graph->customItems().length(), 1); + QCOMPARE(m_graph->customItems().size(), 1); m_graph->removeCustomItems(); - QCOMPARE(m_graph->customItems().length(), 0); + QCOMPARE(m_graph->customItems().size(), 0); } void tst_bars::renderToImage() |