Skip to content

Commit

Permalink
Add test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Feb 2, 2025
1 parent 00d52f0 commit 28b03a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/src/core/testqgsvectortilelayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class TestQgsVectorTileLayer : public QgsTest
void testMbtilesProviderMetadata();
void test_relativePathsMbTiles();
void test_absoluteRelativeUriMbTiles();
void test_mbtilesZoom16();

void test_relativePathsXyz();
void test_absoluteRelativeUriXyz();
Expand Down Expand Up @@ -371,6 +372,17 @@ void TestQgsVectorTileLayer::test_absoluteRelativeUriMbTiles()
QCOMPARE( vectorTileMetadata->relativeToAbsoluteUri( relativeUri, context ), absoluteUri );
}

void TestQgsVectorTileLayer::test_mbtilesZoom16()
{
const QString srcMbtiles = QStringLiteral( "type=mbtiles&url=%1/vector_tile/z16.mbtiles" ).arg( TEST_DATA_DIR );

std::unique_ptr<QgsVectorTileLayer> layer = std::make_unique<QgsVectorTileLayer>( srcMbtiles );
QVERIFY( layer->isValid() );
QCOMPARE( layer->providerType(), QStringLiteral( "mbtilesvectortiles" ) );
QCOMPARE( layer->sourceMinZoom(), 16 );
QCOMPARE( layer->sourceMaxZoom(), 16 );
}

void TestQgsVectorTileLayer::test_relativePathsXyz()
{
QgsReadWriteContext contextRel;
Expand Down
Binary file added tests/testdata/vector_tile/z16.mbtiles
Binary file not shown.

0 comments on commit 28b03a8

Please sign in to comment.