@@ -4127,9 +4127,9 @@ void TestQgsGeometry::circle()
4127
4127
4128
4128
// test conversion
4129
4129
QgsPointSequence ptsPol;
4130
- QgsPolygonV2 * pol = new QgsPolygonV2 ();
4130
+ std::unique_ptr< QgsPolygonV2 > pol ( new QgsPolygonV2 () );
4131
4131
// polygon
4132
- pol = QgsCircle ( QgsPointV2 ( 0 , 0 ), 5 ).toPolygon ( 4 );
4132
+ pol. reset ( QgsCircle ( QgsPointV2 ( 0 , 0 ), 5 ).toPolygon ( 4 ) );
4133
4133
QCOMPARE ( pol->numInteriorRings (), 0 );
4134
4134
QCOMPARE ( pol->exteriorRing ()->numPoints (), 5 );
4135
4135
@@ -4144,7 +4144,7 @@ void TestQgsGeometry::circle()
4144
4144
// oriented
4145
4145
// 45
4146
4146
double val = 5 * sin ( M_PI / 4 );
4147
- pol = QgsCircle ( QgsPointV2 ( 0 , 0 ), 5 , 45 ).toPolygon ( 4 );
4147
+ pol. reset ( QgsCircle ( QgsPointV2 ( 0 , 0 ), 5 , 45 ).toPolygon ( 4 ) );
4148
4148
QCOMPARE ( pol->numInteriorRings (), 0 );
4149
4149
QCOMPARE ( pol->exteriorRing ()->numPoints (), 5 );
4150
4150
pol->exteriorRing ()->points ( ptsPol );
@@ -4155,7 +4155,7 @@ void TestQgsGeometry::circle()
4155
4155
QVERIFY ( ptsPol.at ( 3 ) == QgsPointV2 ( -val, val ) );
4156
4156
QVERIFY ( ptsPol.at ( 4 ) == QgsPointV2 ( val, val ) );
4157
4157
// 135
4158
- pol = QgsCircle ( QgsPointV2 ( 0 , 0 ), 5 , 135 ).toPolygon ( 4 );
4158
+ pol. reset ( QgsCircle ( QgsPointV2 ( 0 , 0 ), 5 , 135 ).toPolygon ( 4 ) );
4159
4159
QCOMPARE ( pol->numInteriorRings (), 0 );
4160
4160
QCOMPARE ( pol->exteriorRing ()->numPoints (), 5 );
4161
4161
pol->exteriorRing ()->points ( ptsPol );
@@ -4166,7 +4166,7 @@ void TestQgsGeometry::circle()
4166
4166
QVERIFY ( ptsPol.at ( 3 ) == QgsPointV2 ( val, val ) );
4167
4167
QVERIFY ( ptsPol.at ( 4 ) == QgsPointV2 ( val, -val ) );
4168
4168
// 225
4169
- pol = QgsCircle ( QgsPointV2 ( 0 , 0 ), 5 , 225 ).toPolygon ( 4 );
4169
+ pol. reset ( QgsCircle ( QgsPointV2 ( 0 , 0 ), 5 , 225 ).toPolygon ( 4 ) );
4170
4170
QCOMPARE ( pol->numInteriorRings (), 0 );
4171
4171
QCOMPARE ( pol->exteriorRing ()->numPoints (), 5 );
4172
4172
pol->exteriorRing ()->points ( ptsPol );
@@ -4177,7 +4177,7 @@ void TestQgsGeometry::circle()
4177
4177
QVERIFY ( ptsPol.at ( 3 ) == QgsPointV2 ( val, -val ) );
4178
4178
QVERIFY ( ptsPol.at ( 4 ) == QgsPointV2 ( -val, -val ) );
4179
4179
// 315
4180
- pol = QgsCircle ( QgsPointV2 ( 0 , 0 ), 5 , 315 ).toPolygon ( 4 );
4180
+ pol. reset ( QgsCircle ( QgsPointV2 ( 0 , 0 ), 5 , 315 ).toPolygon ( 4 ) );
4181
4181
QCOMPARE ( pol->numInteriorRings (), 0 );
4182
4182
QCOMPARE ( pol->exteriorRing ()->numPoints (), 5 );
4183
4183
pol->exteriorRing ()->points ( ptsPol );
0 commit comments