Skip to content
Permalink
Browse files

Fix expected test results on gdal 3

While the tests have a ifdef for gdal 3, the gdal 3 branches don't
actually reflect the results given by a gdal 3 build (which are the
same as gdal 2 results)
  • Loading branch information
nyalldawson committed Jan 27, 2020
1 parent 490414f commit a959ce2f5905b40f90d5fba5bcd7e3fec17f7ceb
Showing with 0 additions and 22 deletions.
  1. +0 −22 tests/src/gui/testqgsvaluerelationwidgetwrapper.cpp
@@ -287,11 +287,7 @@ void TestQgsValueRelationWidgetWrapper::testDrillDownMulti()

QCOMPARE( w_municipality.mTableWidget->rowCount(), 1 );
QCOMPARE( w_municipality.mTableWidget->item( 0, 0 )->text(), QStringLiteral( "Some Place By The River" ) );
#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,4,0)
QCOMPARE( w_municipality.value(), QVariant( QVariantList( { 1 } ) ) );
#else
QCOMPARE( w_municipality.value(), QVariant( QStringLiteral( "{1}" ) ) );
#endif

// Filter by geometry
cfg_municipality[ QStringLiteral( "FilterExpression" ) ] = QStringLiteral( "contains(buffer(@current_geometry, 1 ), $geometry)" );
@@ -315,29 +311,17 @@ void TestQgsValueRelationWidgetWrapper::testDrillDownMulti()
QCOMPARE( w_municipality.mTableWidget->item( 0, 0 )->data( Qt::UserRole ).toString(), QStringLiteral( "2" ) );
QCOMPARE( w_municipality.mTableWidget->item( 1, 0 )->text(), QStringLiteral( "Some Place By The River" ) );
QCOMPARE( w_municipality.mTableWidget->item( 1, 0 )->data( Qt::UserRole ).toString(), QStringLiteral( "1" ) );
#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,4,0)
QCOMPARE( w_municipality.value(), QVariant( QVariantList( { 1 } ) ) );
#else
QCOMPARE( w_municipality.value(), QVariant( QStringLiteral( "{1}" ) ) );
#endif
QCOMPARE( w_municipality.mTableWidget->item( 0, 0 )->checkState(), Qt::Unchecked );
QCOMPARE( w_municipality.mTableWidget->item( 1, 0 )->checkState(), Qt::Checked );
w_municipality.setValues( QStringLiteral( "{1,2}" ), QVariantList() );
#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,4,0)
QCOMPARE( w_municipality.value(), QVariant( QVariantList( { 2, 1 } ) ) );
#else
QCOMPARE( w_municipality.value(), QVariant( QStringLiteral( "{2,1}" ) ) );
#endif
QCOMPARE( w_municipality.mTableWidget->item( 0, 0 )->checkState(), Qt::Checked );
QCOMPARE( w_municipality.mTableWidget->item( 1, 0 )->checkState(), Qt::Checked );

// Check with passing a variant list
w_municipality.setValues( QVariantList( {1, 2} ), QVariantList() );
#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,4,0)
QCOMPARE( w_municipality.value(), QVariant( QVariantList( { 2, 1 } ) ) );
#else
QCOMPARE( w_municipality.value(), QVariant( QStringLiteral( "{2,1}" ) ) );
#endif

// Check values are checked
f3.setAttribute( QStringLiteral( "fk_municipality" ), QStringLiteral( "{1,2}" ) );
@@ -347,13 +331,7 @@ void TestQgsValueRelationWidgetWrapper::testDrillDownMulti()
QCOMPARE( w_municipality.mTableWidget->item( 1, 0 )->text(), QStringLiteral( "Some Place By The River" ) );
QCOMPARE( w_municipality.mTableWidget->item( 0, 0 )->checkState(), Qt::Checked );
QCOMPARE( w_municipality.mTableWidget->item( 1, 0 )->checkState(), Qt::Checked );
#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,4,0)
QCOMPARE( w_municipality.value(), QVariant( QVariantList( { 2, 1 } ) ) );
#else
QCOMPARE( w_municipality.value(), QVariant( QStringLiteral( "{2,1}" ) ) );
#endif


}

void TestQgsValueRelationWidgetWrapper::testZeroIndexInRelatedTable()

0 comments on commit a959ce2

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