Skip to content
Permalink
Browse files

test for original createFileFilter

  • Loading branch information
michaelkirk committed Jan 27, 2015
1 parent d7bef1c commit d6c969c02e30f8a6efc7245c0a90c7db81eed3cb
Showing with 13 additions and 4 deletions.
  1. +2 −2 src/gui/qgisgui.cpp
  2. +11 −2 tests/src/gui/testqgsgui.cpp
@@ -182,8 +182,8 @@ namespace QgisGui

QString createFileFilter_( QString const &format )
{
QString longName = format + " format";
QString glob = "*" + format;
QString longName = format.toUpper() + " format";
QString glob = "*." + format;
return createFileFilter_( longName, glob );
}

@@ -20,14 +20,23 @@ class TestQgsGui : public QObject
{
Q_OBJECT
private slots:
void createFileFilterForFormat();
void createFileFilter();

};

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

QCOMPARE( actual, expected );
}

void TestQgsGui::createFileFilter()
{
QString expected = "My Description (my_regex MY_REGEX)";
QString actual = QgisGui::createFileFilter_("My Description", "my_regex");

QCOMPARE( actual, expected );
}

0 comments on commit d6c969c

Please sign in to comment.
You can’t perform that action at this time.