Skip to content

Commit

Permalink
Improve test output
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Nov 19, 2021
1 parent a998fea commit 8bbd270
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions tests/src/gui/testqgslistwidget.cpp
Expand Up @@ -145,6 +145,8 @@ class TestQgsListWidget : public QObject
{
//create pg layers
QgsVectorLayer *vl_array_int = new QgsVectorLayer( QStringLiteral( "%1 sslmode=disable key=\"pk\" table=\"qgis_test\".\"array_tbl\" sql=" ).arg( dbConn ), QStringLiteral( "json" ), QStringLiteral( "postgres" ) );

connect( vl_array_int, &QgsVectorLayer::raiseError, this, []( const QString & msg ) { qWarning() << msg; } );
QVERIFY( vl_array_int->isValid( ) );

QgsListWidgetWrapper w_array_int( vl_array_int, vl_array_int->fields().indexOf( QLatin1String( "location" ) ), nullptr, nullptr );
Expand All @@ -161,10 +163,8 @@ class TestQgsListWidget : public QObject
new_rec_997.setAttribute( 0, QVariant( 997 ) );
vl_array_int->addFeature( new_rec_997, QgsFeatureSink::RollBackOnErrors );
vl_array_int->commitChanges( false );
bool success = vl_array_int->changeAttributeValue( 997, 1, w_array_int.value(), QVariant(), false );
QVERIFY( success );
success = vl_array_int->commitChanges( false );
QVERIFY( success );
QVERIFY( vl_array_int->changeAttributeValue( 997, 1, w_array_int.value(), QVariant(), false ) );
QVERIFY( vl_array_int->commitChanges( false ) );

w_array_int.setFeature( vl_array_int->getFeature( 997 ) );
QCOMPARE( widget->list( ), QList<QVariant>( ) << 100 );
Expand Down Expand Up @@ -208,10 +208,8 @@ class TestQgsListWidget : public QObject
new_rec_997_str.setAttribute( 0, QVariant( 997 ) );
vl_array_str->addFeature( new_rec_997_str, QgsFeatureSink::RollBackOnErrors );
vl_array_str->commitChanges( false );
success = vl_array_str->changeAttributeValue( 997, 1, w_array_str.value(), QVariant(), false );
QVERIFY( success );
success = vl_array_str->commitChanges( false );
QVERIFY( success );
QVERIFY( vl_array_str->changeAttributeValue( 997, 1, w_array_str.value(), QVariant(), false ) );
QVERIFY( vl_array_str->commitChanges( false ) );

w_array_str.setFeature( vl_array_str->getFeature( 997 ) );
QCOMPARE( widget->list( ), QList<QVariant>( ) << QStringLiteral( "10\"0" ) );
Expand Down

0 comments on commit 8bbd270

Please sign in to comment.