Skip to content
Permalink
Browse files

Trivial tests for ept provider encode/decode uri

  • Loading branch information
nyalldawson committed Nov 4, 2020
1 parent 4e1df35 commit a092a8228925cb10a92aa42b928c0e7a6ec61e51
Showing with 21 additions and 0 deletions.
  1. +21 −0 tests/src/providers/testqgseptprovider.cpp
@@ -44,6 +44,8 @@ class TestQgsEptProvider : public QObject
void cleanup() {}// will be called after every testfunction.

void filters();
void encodeUri();
void decodeUri();

private:
QString mTestDataDir;
@@ -87,6 +89,25 @@ void TestQgsEptProvider::filters()
QVERIFY( registryPointCloudFilters.contains( "(ept.json EPT.JSON)" ) );
}

void TestQgsEptProvider::encodeUri()
{
QgsProviderMetadata *metadata = QgsProviderRegistry::instance()->providerMetadata( QStringLiteral( "ept" ) );
QVERIFY( metadata );

QVariantMap parts;
parts.insert( QStringLiteral( "path" ), QStringLiteral( "/home/point_clouds/ept.json" ) );
QCOMPARE( metadata->encodeUri( parts ), QStringLiteral( "/home/point_clouds/ept.json" ) );
}

void TestQgsEptProvider::decodeUri()
{
QgsProviderMetadata *metadata = QgsProviderRegistry::instance()->providerMetadata( QStringLiteral( "ept" ) );
QVERIFY( metadata );

const QVariantMap parts = metadata->decodeUri( QStringLiteral( "/home/point_clouds/ept.json" ) );
QCOMPARE( parts.value( QStringLiteral( "path" ) ).toString(), QStringLiteral( "/home/point_clouds/ept.json" ) );
}


QGSTEST_MAIN( TestQgsEptProvider )
#include "testqgseptprovider.moc"

0 comments on commit a092a82

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