Skip to content

Commit

Permalink
test case for file filter formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkirk committed Jan 26, 2015
1 parent 1e936df commit 262a5b2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/src/gui/CMakeLists.txt
Expand Up @@ -117,6 +117,7 @@ ADD_QGIS_TEST(zoomtest testqgsmaptoolzoom.cpp)

#ADD_QGIS_TEST(histogramtest testqgsrasterhistogram.cpp)
ADD_QGIS_TEST(projectionissues testprojectionissues.cpp)
ADD_QGIS_TEST(qgsguitest testqgsgui.cpp)
ADD_QGIS_TEST(scalecombobox testqgsscalecombobox.cpp)
ADD_QGIS_TEST(dualviewtest testqgsdualview.cpp )
ADD_QGIS_TEST(doublespinbox testqgsdoublespinbox.cpp)
Expand Down
36 changes: 36 additions & 0 deletions tests/src/gui/testqgsgui.cpp
@@ -0,0 +1,36 @@
/***************************************************************************
testqgsgui.cpp
--------------------------------------
Date : 26.1.2015
Copyright : (C) 2015 Michael Kirk
Email : michael at jackpine dot me
***************************************************************************
* *
* 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 <QtTest/QtTest>
#include <qgisgui.h>

class TestQgsGui : public QObject
{
Q_OBJECT
private slots:
void createFileFilter();

};

void TestQgsGui::createFileFilter()
{
QString expected = "FOO format (*.foo *.FOO)";
QString actual = QgisGui::createFileFilter_("foo");;

QCOMPARE( actual, expected );
}

QTEST_MAIN( TestQgsGui )
#include "testqgsgui.moc"

0 comments on commit 262a5b2

Please sign in to comment.