Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use a valid polygon in attr-table test
  • Loading branch information
elpaso committed May 10, 2017
1 parent 58a8478 commit 55cb855
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/src/app/testqgsattributetable.cpp
Expand Up @@ -257,11 +257,14 @@ void TestQgsAttributeTable::testRegression15974()
QgsVectorFileWriter::writeAsVectorFormat( tempLayer.get( ), path, "system", QgsCoordinateReferenceSystem( 4326 ), "ESRI Shapefile" );
std::unique_ptr< QgsVectorLayer> shpLayer( new QgsVectorLayer( path, QStringLiteral( "test" ), QStringLiteral( "ogr" ) ) );
QgsFeature f1( shpLayer->dataProvider()->fields(), 1 );
f1.setGeometry( QgsGeometry().fromWkt( QStringLiteral( "polygon(0 0, 1 1, 1 2, 1 0, 0 0))" ) ) );
QgsGeometry geom;
geom = QgsGeometry().fromWkt( QStringLiteral( "polygon((0 0, 0 1, 1 1, 1 0, 0 0))" ) );
Q_ASSERT( geom.isGeosValid( ) );
f1.setGeometry( geom );
QgsFeature f2( shpLayer->dataProvider()->fields(), 2 );
f2.setGeometry( QgsGeometry().fromWkt( QStringLiteral( "polygon(0 0, 1 1, 1 2, 1 0, 0 0))" ) ) );
f2.setGeometry( geom );
QgsFeature f3( shpLayer->dataProvider()->fields(), 3 );
f3.setGeometry( QgsGeometry().fromWkt( QStringLiteral( "polygon(0 0, 1 1, 1 2, 1 0, 0 0))" ) ) );
f3.setGeometry( geom );
QVERIFY( shpLayer->startEditing( ) );
QVERIFY( shpLayer->addFeatures( QgsFeatureList() << f1 << f2 << f3 ) );
std::unique_ptr< QgsAttributeTableDialog > dlg( new QgsAttributeTableDialog( shpLayer.get() ) );
Expand Down

0 comments on commit 55cb855

Please sign in to comment.