tst_qlineseries.cpp
102 lines
| 2.2 KiB
| text/x-c
|
CppLexer
Michal Klocek
|
r1064 | /**************************************************************************** | ||
** | ||||
** 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$ | ||||
** | ||||
****************************************************************************/ | ||||
Michal Klocek
|
r1266 | #include "../qxyseries/tst_qxyseries.h" | ||
Michal Klocek
|
r1058 | #include <qlineseries.h> | ||
Michal Klocek
|
r1064 | |||
Michal Klocek
|
r1058 | |||
Michal Klocek
|
r1266 | Q_DECLARE_METATYPE(QList<QPointF>) | ||
Michal Klocek
|
r1058 | |||
Michal Klocek
|
r1266 | class tst_QLineSeries : public tst_QXYSeries | ||
Michal Klocek
|
r1058 | { | ||
Q_OBJECT | ||||
Michal Klocek
|
r1266 | public slots: | ||
Michal Klocek
|
r1058 | void initTestCase(); | ||
void cleanupTestCase(); | ||||
void init(); | ||||
void cleanup(); | ||||
Michal Klocek
|
r1266 | private slots: | ||
Michal Klocek
|
r1064 | void qlineseries_data(); | ||
void qlineseries(); | ||||
Michal Klocek
|
r1266 | protected: | ||
Michal Klocek
|
r1070 | void pointsVisible_data(); | ||
Michal Klocek
|
r1058 | }; | ||
void tst_QLineSeries::initTestCase() | ||||
{ | ||||
} | ||||
void tst_QLineSeries::cleanupTestCase() | ||||
{ | ||||
} | ||||
void tst_QLineSeries::init() | ||||
{ | ||||
Michal Klocek
|
r1266 | tst_QXYSeries::init(); | ||
Marek Rosa
|
r1072 | m_series = new QLineSeries(); | ||
Michal Klocek
|
r1058 | } | ||
void tst_QLineSeries::cleanup() | ||||
{ | ||||
Michal Klocek
|
r1070 | delete m_series; | ||
Michal Klocek
|
r1699 | m_series=0; | ||
Michal Klocek
|
r1266 | tst_QXYSeries::cleanup(); | ||
Michal Klocek
|
r1058 | } | ||
Michal Klocek
|
r1064 | void tst_QLineSeries::qlineseries_data() | ||
Michal Klocek
|
r1058 | { | ||
Michal Klocek
|
r1070 | |||
Michal Klocek
|
r1058 | } | ||
Michal Klocek
|
r1064 | void tst_QLineSeries::qlineseries() | ||
Michal Klocek
|
r1058 | { | ||
Marek Rosa
|
r1178 | QLineSeries series; | ||
Michal Klocek
|
r1064 | |||
Marek Rosa
|
r1178 | QCOMPARE(series.count(),0); | ||
QCOMPARE(series.brush(), QBrush()); | ||||
QCOMPARE(series.points(), QList<QPointF>()); | ||||
QCOMPARE(series.pen(), QPen()); | ||||
QCOMPARE(series.pointsVisible(), false); | ||||
Michal Klocek
|
r1064 | |||
Marek Rosa
|
r1178 | series.append(QList<QPointF>()); | ||
series.append(0.0,0.0); | ||||
series.append(QPointF()); | ||||
Michal Klocek
|
r1064 | |||
Marek Rosa
|
r1178 | series.remove(0.0,0.0); | ||
series.remove(QPointF()); | ||||
Jani Honkonen
|
r1374 | series.clear(); | ||
Michal Klocek
|
r1064 | |||
Marek Rosa
|
r1178 | series.replace(QPointF(),QPointF()); | ||
series.replace(0,0,0,0); | ||||
series.setBrush(QBrush()); | ||||
Michal Klocek
|
r1064 | |||
Marek Rosa
|
r1178 | series.setPen(QPen()); | ||
series.setPointsVisible(false); | ||||
Michal Klocek
|
r1070 | |||
Marek Rosa
|
r1178 | m_chart->addSeries(&series); | ||
m_view->show(); | ||||
QTest::qWaitForWindowShown(m_view); | ||||
Michal Klocek
|
r1058 | } | ||
QTEST_MAIN(tst_QLineSeries) | ||||
#include "tst_qlineseries.moc" | ||||