"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/src/core/testqgsgeopdfexport.cpp" between
QGIS-final-3_10_11.tar.gz and QGIS-final-3_10_12.tar.gz

About: QGIS (Quantum GIS) is a Geographic Information System that supports vector, raster, and database formats. Long-term release (3.10.x series).

testqgsgeopdfexport.cpp  (QGIS-final-3_10_11):testqgsgeopdfexport.cpp  (QGIS-final-3_10_12)
skipping to change at line 335 skipping to change at line 335
section.controlPoints.append( QgsAbstractGeoPdfExporter::ControlPoint( QgsPoin tXY( 253.2, 0 ), QgsPointXY( -78, 53.6 ) ) ); section.controlPoints.append( QgsAbstractGeoPdfExporter::ControlPoint( QgsPoin tXY( 253.2, 0 ), QgsPointXY( -78, 53.6 ) ) );
section.controlPoints.append( QgsAbstractGeoPdfExporter::ControlPoint( QgsPoin tXY( 253.2, 222.25 ), QgsPointXY( -78, 14.6 ) ) ); section.controlPoints.append( QgsAbstractGeoPdfExporter::ControlPoint( QgsPoin tXY( 253.2, 222.25 ), QgsPointXY( -78, 14.6 ) ) );
section.controlPoints.append( QgsAbstractGeoPdfExporter::ControlPoint( QgsPoin tXY( 0, 222.25 ), QgsPointXY( -122.4, 14.6 ) ) ); section.controlPoints.append( QgsAbstractGeoPdfExporter::ControlPoint( QgsPoin tXY( 0, 222.25 ), QgsPointXY( -122.4, 14.6 ) ) );
details.georeferencedSections << section; details.georeferencedSections << section;
composition = geoPdfExporter.createCompositionXml( renderedLayers, details ); composition = geoPdfExporter.createCompositionXml( renderedLayers, details );
QgsDebugMsg( composition ); QgsDebugMsg( composition );
doc.setContent( composition ); doc.setContent( composition );
QCOMPARE( doc.elementsByTagName( QStringLiteral( "SRS" ) ).at( 0 ).toElement() .text(), QStringLiteral( "EPSG:4283" ) ); QCOMPARE( doc.elementsByTagName( QStringLiteral( "SRS" ) ).at( 0 ).toElement() .text(), QStringLiteral( "EPSG:4283" ) );
QCOMPARE( doc.elementsByTagName( QStringLiteral( "BoundingBox" ) ).at( 0 ).toE lement().attribute( QStringLiteral( "x1" ) ), QStringLiteral( "0" ) ); QCOMPARE( doc.elementsByTagName( QStringLiteral( "BoundingBox" ) ).at( 0 ).toE lement().attribute( QStringLiteral( "x1" ) ), QStringLiteral( "0" ) );
QCOMPARE( doc.elementsByTagName( QStringLiteral( "BoundingBox" ) ).at( 0 ).toE lement().attribute( QStringLiteral( "x2" ) ), QStringLiteral( "717.732" ) ); QCOMPARE( doc.elementsByTagName( QStringLiteral( "BoundingBox" ) ).at( 0 ).toE lement().attribute( QStringLiteral( "x2" ) ).left( 9 ), QStringLiteral( "717.732 28" ) );
QCOMPARE( doc.elementsByTagName( QStringLiteral( "BoundingBox" ) ).at( 0 ).toE lement().attribute( QStringLiteral( "y1" ) ), QStringLiteral( "0" ) ); QCOMPARE( doc.elementsByTagName( QStringLiteral( "BoundingBox" ) ).at( 0 ).toE lement().attribute( QStringLiteral( "y1" ) ), QStringLiteral( "0" ) );
QCOMPARE( doc.elementsByTagName( QStringLiteral( "BoundingBox" ) ).at( 0 ).toE lement().attribute( QStringLiteral( "y2" ) ), QStringLiteral( "630" ) ); QCOMPARE( doc.elementsByTagName( QStringLiteral( "BoundingBox" ) ).at( 0 ).toE lement().attribute( QStringLiteral( "y2" ) ), QStringLiteral( "630" ) );
QDomNodeList cps = doc.elementsByTagName( QStringLiteral( "ControlPoint" ) ); QDomNodeList cps = doc.elementsByTagName( QStringLiteral( "ControlPoint" ) );
QCOMPARE( cps.count(), 4 ); QCOMPARE( cps.count(), 4 );
QDomElement cp1; QDomElement cp1;
for ( int i = 0; i < 4; ++i ) for ( int i = 0; i < 4; ++i )
{ {
if ( cps.at( i ).toElement().attribute( QStringLiteral( "GeoX" ) ) == QStrin const QString x = cps.at( i ).toElement().attribute( QStringLiteral( "GeoX"
gLiteral( "-122.4" ) ) ).left( 10 );
&& cps.at( i ).toElement().attribute( QStringLiteral( "GeoY" ) ) == QSt const QString y = cps.at( i ).toElement().attribute( QStringLiteral( "GeoY"
ringLiteral( "53.6" ) ) ) ).left( 10 );
if ( x == QStringLiteral( "-122.40000" ) && y == QStringLiteral( "53.6000000
" ) )
{ {
cp1 = cps.at( i ).toElement(); cp1 = cps.at( i ).toElement();
break; break;
} }
} }
QVERIFY( !cp1.isNull() ); QVERIFY( !cp1.isNull() );
QCOMPARE( cp1.attribute( QStringLiteral( "x" ) ), QStringLiteral( "0" ) ); QCOMPARE( cp1.attribute( QStringLiteral( "x" ) ), QStringLiteral( "0" ) );
QCOMPARE( cp1.attribute( QStringLiteral( "y" ) ), QStringLiteral( "-2.83465" ) ); QCOMPARE( cp1.attribute( QStringLiteral( "y" ) ).left( 10 ), QStringLiteral( " -2.8346456" ) );
} }
void TestQgsGeoPdfExport::testGeorefPolygon() void TestQgsGeoPdfExport::testGeorefPolygon()
{ {
// test georeferencing a region using polygon bounds // test georeferencing a region using polygon bounds
TestGeoPdfExporter geoPdfExporter; TestGeoPdfExporter geoPdfExporter;
QList< QgsAbstractGeoPdfExporter::ComponentLayerDetail > renderedLayers; QList< QgsAbstractGeoPdfExporter::ComponentLayerDetail > renderedLayers;
QgsAbstractGeoPdfExporter::ExportDetails details; QgsAbstractGeoPdfExporter::ExportDetails details;
skipping to change at line 389 skipping to change at line 390
QDomDocument doc; QDomDocument doc;
doc.setContent( composition ); doc.setContent( composition );
QCOMPARE( doc.elementsByTagName( QStringLiteral( "SRS" ) ).at( 0 ).toElement() .text(), QStringLiteral( "EPSG:4283" ) ); QCOMPARE( doc.elementsByTagName( QStringLiteral( "SRS" ) ).at( 0 ).toElement() .text(), QStringLiteral( "EPSG:4283" ) );
QCOMPARE( doc.elementsByTagName( QStringLiteral( "BoundingPolygon" ) ).at( 0 ) .toElement().text(), QStringLiteral( "Polygon ((60 -12, 500 -32, 480 -402, 100 - 382, 60 -12))" ) ); QCOMPARE( doc.elementsByTagName( QStringLiteral( "BoundingPolygon" ) ).at( 0 ) .toElement().text(), QStringLiteral( "Polygon ((60 -12, 500 -32, 480 -402, 100 - 382, 60 -12))" ) );
QDomNodeList cps = doc.elementsByTagName( QStringLiteral( "ControlPoint" ) ); QDomNodeList cps = doc.elementsByTagName( QStringLiteral( "ControlPoint" ) );
QCOMPARE( cps.count(), 4 ); QCOMPARE( cps.count(), 4 );
QDomElement cp1; QDomElement cp1;
for ( int i = 0; i < 4; ++i ) for ( int i = 0; i < 4; ++i )
{ {
if ( cps.at( i ).toElement().attribute( QStringLiteral( "GeoX" ) ) == QStrin const QString x = cps.at( i ).toElement().attribute( QStringLiteral( "GeoX"
gLiteral( "-122.4" ) ) ).left( 10 );
&& cps.at( i ).toElement().attribute( QStringLiteral( "GeoY" ) ) == QSt const QString y = cps.at( i ).toElement().attribute( QStringLiteral( "GeoY"
ringLiteral( "53.6" ) ) ) ).left( 10 );
if ( x == QStringLiteral( "-122.40000" ) && y == QStringLiteral( "53.6000000
" ) )
{ {
cp1 = cps.at( i ).toElement(); cp1 = cps.at( i ).toElement();
break; break;
} }
} }
QVERIFY( !cp1.isNull() ); QVERIFY( !cp1.isNull() );
QCOMPARE( cp1.attribute( QStringLiteral( "x" ) ), QStringLiteral( "0" ) ); QCOMPARE( cp1.attribute( QStringLiteral( "x" ) ), QStringLiteral( "0" ) );
QCOMPARE( cp1.attribute( QStringLiteral( "y" ) ), QStringLiteral( "-2.83465" ) ); QCOMPARE( cp1.attribute( QStringLiteral( "y" ) ).left( 10 ), QStringLiteral( " -2.8346456" ) );
} }
void TestQgsGeoPdfExport::testGroups() void TestQgsGeoPdfExport::testGroups()
{ {
TestGeoPdfExporter geoPdfExporter; TestGeoPdfExporter geoPdfExporter;
// no features, no crash // no features, no crash
QVERIFY( geoPdfExporter.saveTemporaryLayers() ); QVERIFY( geoPdfExporter.saveTemporaryLayers() );
QCOMPARE( geoPdfExporter.mVectorComponents.count(), 0 ); QCOMPARE( geoPdfExporter.mVectorComponents.count(), 0 );
QgsFields fields; QgsFields fields;
 End of changes. 5 change blocks. 
11 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)