mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
First simple test
This commit is contained in:
parent
341935d214
commit
09d6399b23
@ -119,4 +119,5 @@ ADD_QGIS_TEST(zoomtest testqgsmaptoolzoom.cpp)
|
||||
|
||||
ADD_QGIS_TEST(histogramtest testqgsrasterhistogram.cpp)
|
||||
ADD_QGIS_TEST(projectionissues testprojectionissues.cpp)
|
||||
ADD_QGIS_TEST(scalecombobox testqgsscalecombobox.cpp)
|
||||
|
||||
|
68
tests/src/gui/testqgsscalecombobox.cpp
Normal file
68
tests/src/gui/testqgsscalecombobox.cpp
Normal file
@ -0,0 +1,68 @@
|
||||
/***************************************************************************
|
||||
testqgsscalecombobox.cpp
|
||||
---------------------------
|
||||
begin : September 2012
|
||||
copyright : (C) 2012 by Magnus Homann
|
||||
email : magnus at homann dot se
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "qgsapplication.h"
|
||||
#include "qgsscalecombobox.h"
|
||||
#include <QObject>
|
||||
#include <QLineEdit>
|
||||
#include <QComboBox>
|
||||
#include <QtTest>
|
||||
|
||||
class TestQgsScaleComboBox: public QObject
|
||||
{
|
||||
Q_OBJECT;
|
||||
private slots:
|
||||
void initTestCase();// will be called before the first testfunction is executed.
|
||||
void cleanupTestCase();// will be called after the last testfunction was executed.
|
||||
void init();// will be called before each testfunction is executed.
|
||||
void cleanup();// will be called after every testfunction.
|
||||
void basic();
|
||||
private:
|
||||
QgsScaleComboBox *mScaleEdit;
|
||||
};
|
||||
|
||||
void TestQgsScaleComboBox::initTestCase()
|
||||
{
|
||||
QgsApplication::init();
|
||||
QgsApplication::initQgis();
|
||||
|
||||
// Create a combobox, and init with predefined scales.
|
||||
mScaleEdit = new QgsScaleComboBox();
|
||||
};
|
||||
|
||||
void TestQgsScaleComboBox::cleanupTestCase()
|
||||
{
|
||||
delete mScaleEdit;
|
||||
};
|
||||
|
||||
void TestQgsScaleComboBox::init()
|
||||
{
|
||||
};
|
||||
|
||||
void TestQgsScaleComboBox::basic()
|
||||
{
|
||||
mScaleEdit->lineEdit()->setText( "" );
|
||||
QTest::keyClicks( mScaleEdit->lineEdit(), "1:2345");
|
||||
QCOMPARE( mScaleEdit->lineEdit()->text(), QString("1:2345"));
|
||||
};
|
||||
|
||||
void TestQgsScaleComboBox::cleanup()
|
||||
{
|
||||
};
|
||||
|
||||
QTEST_MAIN( TestQgsScaleComboBox )
|
||||
#include "moc_testqgsscalecombobox.cxx"
|
Loading…
x
Reference in New Issue
Block a user