Skip to content

Commit 262a5b2

Browse files
committed
test case for file filter formatter
1 parent 1e936df commit 262a5b2

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

tests/src/gui/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ ADD_QGIS_TEST(zoomtest testqgsmaptoolzoom.cpp)
117117

118118
#ADD_QGIS_TEST(histogramtest testqgsrasterhistogram.cpp)
119119
ADD_QGIS_TEST(projectionissues testprojectionissues.cpp)
120+
ADD_QGIS_TEST(qgsguitest testqgsgui.cpp)
120121
ADD_QGIS_TEST(scalecombobox testqgsscalecombobox.cpp)
121122
ADD_QGIS_TEST(dualviewtest testqgsdualview.cpp )
122123
ADD_QGIS_TEST(doublespinbox testqgsdoublespinbox.cpp)

tests/src/gui/testqgsgui.cpp

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/***************************************************************************
2+
testqgsgui.cpp
3+
--------------------------------------
4+
Date : 26.1.2015
5+
Copyright : (C) 2015 Michael Kirk
6+
Email : michael at jackpine dot me
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
16+
#include <QtTest/QtTest>
17+
#include <qgisgui.h>
18+
19+
class TestQgsGui : public QObject
20+
{
21+
Q_OBJECT
22+
private slots:
23+
void createFileFilter();
24+
25+
};
26+
27+
void TestQgsGui::createFileFilter()
28+
{
29+
QString expected = "FOO format (*.foo *.FOO)";
30+
QString actual = QgisGui::createFileFilter_("foo");;
31+
32+
QCOMPARE( actual, expected );
33+
}
34+
35+
QTEST_MAIN( TestQgsGui )
36+
#include "testqgsgui.moc"

0 commit comments

Comments
 (0)