Skip to content

Commit cbca7c9

Browse files
committedSep 22, 2017
Boost test coverage of geometry classes
1 parent 395ed93 commit cbca7c9

File tree

7 files changed

+1486
-310
lines changed

7 files changed

+1486
-310
lines changed
 

‎src/core/geometry/qgscurvepolygon.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -626,12 +626,12 @@ void QgsCurvePolygon::removeInteriorRings( double minimumAllowedArea )
626626

627627
void QgsCurvePolygon::draw( QPainter &p ) const
628628
{
629+
if ( !mExteriorRing )
630+
return;
631+
629632
if ( mInteriorRings.empty() )
630633
{
631-
if ( mExteriorRing )
632-
{
633-
mExteriorRing->drawAsPolygon( p );
634-
}
634+
mExteriorRing->drawAsPolygon( p );
635635
}
636636
else
637637
{

‎tests/src/core/testqgsgeometry.cpp

Lines changed: 1468 additions & 305 deletions
Large diffs are not rendered by default.

‎tests/src/python/test_qgsgeometry.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4304,7 +4304,20 @@ def testGeometryDraw(self):
43044304
'wkt': 'CircularString (20 30, 50 30, 50 90)',
43054305
'reference_image': 'circularstring',
43064306
'as_polygon_reference_image': 'circularstring_aspolygon',
4307-
'use_pen': True}
4307+
'use_pen': True},
4308+
{'name': 'CurvePolygon',
4309+
'wkt': 'CurvePolygon(CircularString (20 30, 50 30, 50 90, 10 50, 20 30))',
4310+
'reference_image': 'curvepolygon_circularstring',
4311+
'use_pen': False},
4312+
{'name': 'CurvePolygonInteriorRings',
4313+
'wkt': 'CurvePolygon(CircularString (20 30, 50 30, 50 90, 10 50, 20 30),LineString(30 45, 55 45, 30 75, 30 45))',
4314+
'reference_image': 'curvepolygon_circularstring_interiorrings',
4315+
'use_pen': False},
4316+
{'name': 'CompoundCurve',
4317+
'wkt': 'CompoundCurve(CircularString (20 30, 50 30, 50 90),LineString(50 90, 10 90))',
4318+
'reference_image': 'compoundcurve',
4319+
'use_pen': True,
4320+
'as_polygon_reference_image': 'compoundcurve_aspolygon', }
43084321
]
43094322

43104323
for test in tests:
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.