Skip to content

Commit

Permalink
Update more test results
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 25, 2021
1 parent c3f538e commit a112e63
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/test/qgstest.h
Expand Up @@ -41,7 +41,7 @@
bool _xxxresult = qgsDoubleNear( value, expected, epsilon ); \
if ( !_xxxresult ) \
{ \
qDebug( "Expecting %f got %f (diff %f > %f)", static_cast< double >( expected ), static_cast< double >( value ), std::fabs( static_cast< double >( expected ) - value ), static_cast< double >( epsilon ) ); \
qDebug( "Expecting %.10f got %.10f (diff %.10f > %.10f)", static_cast< double >( expected ), static_cast< double >( value ), std::fabs( static_cast< double >( expected ) - value ), static_cast< double >( epsilon ) ); \
} \
QVERIFY( qgsDoubleNear( value, expected, epsilon ) ); \
}(void)(0)
Expand Down
2 changes: 1 addition & 1 deletion tests/src/analysis/testqgsprocessingalgs.cpp
Expand Up @@ -2133,7 +2133,7 @@ void TestQgsProcessingAlgs::lineDensity()
{
double expectedValue = expectedRasterBlock->value( row, column );
double outputValue = outputRasterBlock->value( row, column );
QGSCOMPARENEAR( outputValue, expectedValue, 0.000000000015 );
QGSCOMPARENEAR( outputValue, expectedValue, 0.0000000002 );
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/src/app/testqgsattributetable.cpp
Expand Up @@ -165,7 +165,7 @@ void TestQgsAttributeTable::testFieldCalculationArea()
QgsFeatureIterator fit = tempLayer->dataProvider()->getFeatures();
QgsFeature f;
QVERIFY( fit.nextFeature( f ) );
double expected = 1005721496.78008;
double expected = 1005755617.819130;
QGSCOMPARENEAR( f.attribute( "col1" ).toDouble(), expected, 1.0 );

// change project area unit, check calculation respects unit
Expand All @@ -177,7 +177,7 @@ void TestQgsAttributeTable::testFieldCalculationArea()
// check result
fit = tempLayer->dataProvider()->getFeatures();
QVERIFY( fit.nextFeature( f ) );
expected = 388.311240;
expected = 388.324420;
QGSCOMPARENEAR( f.attribute( "col1" ).toDouble(), expected, 0.001 );
}

Expand Down
4 changes: 2 additions & 2 deletions tests/src/app/testqgsfieldcalculator.cpp
Expand Up @@ -164,7 +164,7 @@ void TestQgsFieldCalculator::testAreaCalculations()
QgsFeatureIterator fit = tempLayer->dataProvider()->getFeatures();
QgsFeature f;
QVERIFY( fit.nextFeature( f ) );
double expected = 1005721496.780080;
double expected = 1005755617.819130;
QGSCOMPARENEAR( f.attribute( "col1" ).toDouble(), expected, 1.0 );

// change project area unit, check calculation respects unit
Expand All @@ -179,7 +179,7 @@ void TestQgsFieldCalculator::testAreaCalculations()
// check result
fit = tempLayer->dataProvider()->getFeatures();
QVERIFY( fit.nextFeature( f ) );
expected = 388.311240;
expected = 388.324420;
QGSCOMPARENEAR( f.attribute( "col1" ).toDouble(), expected, 0.001 );
}

Expand Down
6 changes: 3 additions & 3 deletions tests/src/app/testqgsmaptoolidentifyaction.cpp
Expand Up @@ -474,7 +474,7 @@ void TestQgsMapToolIdentifyAction::areaCalculation()
QCOMPARE( result.length(), 1 );
QString derivedArea = result.at( 0 ).mDerivedAttributes[tr( "Area (Ellipsoidal — WGS84)" )];
double area = derivedArea.remove( ',' ).split( ' ' ).at( 0 ).toDouble();
QGSCOMPARENEAR( area, 1005721496.780000, 1.0 );
QGSCOMPARENEAR( area, 1005755617.819000, 1.0 );
derivedArea = result.at( 0 ).mDerivedAttributes[tr( "Area (Cartesian)" )];
area = derivedArea.remove( ',' ).split( ' ' ).at( 0 ).toDouble();
QGSCOMPARENEAR( area, 1005640568.0, 1.0 );
Expand All @@ -485,7 +485,7 @@ void TestQgsMapToolIdentifyAction::areaCalculation()
QCOMPARE( result.length(), 1 );
derivedArea = result.at( 0 ).mDerivedAttributes[tr( "Area (Ellipsoidal — WGS84)" )];
area = derivedArea.remove( ',' ).split( ' ' ).at( 0 ).toDouble();
QGSCOMPARENEAR( area, 388.311000, 0.001 );
QGSCOMPARENEAR( area, 388.324000, 0.001 );
derivedArea = result.at( 0 ).mDerivedAttributes[tr( "Area (Cartesian)" )];
area = derivedArea.remove( ',' ).split( ' ' ).at( 0 ).toDouble();
QGSCOMPARENEAR( area, 388.280000, 0.001 );
Expand All @@ -497,7 +497,7 @@ void TestQgsMapToolIdentifyAction::areaCalculation()
QCOMPARE( result.length(), 1 );
derivedArea = result.at( 0 ).mDerivedAttributes[tr( "Area (Ellipsoidal — WGS84)" )];
area = derivedArea.remove( ',' ).split( ' ' ).at( 0 ).toDouble();
QGSCOMPARENEAR( area, 388.311000, 0.001 );
QGSCOMPARENEAR( area, 388.324000, 0.001 );
derivedArea = result.at( 0 ).mDerivedAttributes[tr( "Area (Cartesian)" )];
area = derivedArea.remove( ',' ).split( ' ' ).at( 0 ).toDouble();
QGSCOMPARENEAR( area, 388.280000, 0.001 );
Expand Down
4 changes: 2 additions & 2 deletions tests/src/core/testqgsexpression.cpp
Expand Up @@ -2957,7 +2957,7 @@ class TestQgsExpression: public QObject
QgsExpression expArea2( QStringLiteral( "$area" ) );
expArea2.setGeomCalculator( &da );
vArea = expArea2.evaluate( &context );
expected = 1005721496.780085;
expected = 1005755617.819134;
QGSCOMPARENEAR( vArea.toDouble(), expected, 1.0 );
// test unit conversion
expArea2.setAreaUnits( QgsUnitTypes::AreaSquareMeters ); //default units should be square meters
Expand All @@ -2967,7 +2967,7 @@ class TestQgsExpression: public QObject
vArea = expArea2.evaluate( &context );
QGSCOMPARENEAR( vArea.toDouble(), expected, 1.0 );
expArea2.setAreaUnits( QgsUnitTypes::AreaSquareMiles );
expected = 388.311241;
expected = 388.324415;
vArea = expArea2.evaluate( &context );
QGSCOMPARENEAR( vArea.toDouble(), expected, 0.001 );

Expand Down

0 comments on commit a112e63

Please sign in to comment.