Skip to content
Permalink
Browse files
Improve test output
  • Loading branch information
m-kuhn committed Nov 19, 2021
1 parent a998fea commit 8bbd27049bda75223aad3073cdd90edc0b44c37e
Showing with 6 additions and 8 deletions.
  1. +6 −8 tests/src/gui/testqgslistwidget.cpp
@@ -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 );
@@ -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 );
@@ -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" ) );

0 comments on commit 8bbd270

Please sign in to comment.