Skip to content
Permalink
Browse files
Expand tests
  • Loading branch information
nyalldawson committed Jun 23, 2021
1 parent 0998371 commit 2b384ce94bd91a2620337eaab82f44333a0273d3
Showing with 10 additions and 0 deletions.
  1. +10 −0 tests/src/core/testqgsmeshlayer.cpp
@@ -1608,6 +1608,11 @@ void TestQgsMeshLayer::testMdalProviderQuerySublayers()
QCOMPARE( res.at( 0 ).providerKey(), QStringLiteral( "mdal" ) );
QCOMPARE( res.at( 0 ).type(), QgsMapLayerType::MeshLayer );

// make sure result is valid to load layer from
QgsProviderSublayerDetails::LayerOptions options{ QgsCoordinateTransformContext() };
std::unique_ptr< QgsMeshLayer > ml( qgis::down_cast< QgsMeshLayer * >( res.at( 0 ).toLayer( options ) ) );
QVERIFY( ml->isValid() );

// mesh with two layers
res = mdalMetadata->querySublayers( mDataDir + "/manzese_1d2d_small_map.nc" );
QCOMPARE( res.count(), 2 );
@@ -1616,11 +1621,16 @@ void TestQgsMeshLayer::testMdalProviderQuerySublayers()
QCOMPARE( res.at( 0 ).uri(), QStringLiteral( "Ugrid:\"%1/manzese_1d2d_small_map.nc\":mesh1d" ).arg( mDataDir ) );
QCOMPARE( res.at( 0 ).providerKey(), QStringLiteral( "mdal" ) );
QCOMPARE( res.at( 0 ).type(), QgsMapLayerType::MeshLayer );
ml.reset( qgis::down_cast< QgsMeshLayer * >( res.at( 0 ).toLayer( options ) ) );
QVERIFY( ml->isValid() );
QCOMPARE( res.at( 1 ).layerNumber(), 1 );
QCOMPARE( res.at( 1 ).name(), QStringLiteral( "mesh2d" ) );
QCOMPARE( res.at( 1 ).uri(), QStringLiteral( "Ugrid:\"%1/manzese_1d2d_small_map.nc\":mesh2d" ).arg( mDataDir ) );
QCOMPARE( res.at( 1 ).providerKey(), QStringLiteral( "mdal" ) );
QCOMPARE( res.at( 1 ).type(), QgsMapLayerType::MeshLayer );
ml.reset( qgis::down_cast< QgsMeshLayer * >( res.at( 1 ).toLayer( options ) ) );
QVERIFY( ml->isValid() );

}

void TestQgsMeshLayer::test_temporal()

0 comments on commit 2b384ce

Please sign in to comment.