mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
Fix failing test
This commit is contained in:
parent
ec49c407a4
commit
724d3e0832
@ -23,7 +23,14 @@
|
||||
* @note added in QGIS 2.16
|
||||
*/
|
||||
|
||||
#define QGSCOMPARENEAR(a,b,epsilon) { bool _xxxresult = qgsDoubleNear( a, b, epsilon ); if ( !_xxxresult ) { qDebug( "Expecting %f got %f (diff %f > %f)", static_cast< double >( a ), static_cast< double >( b ), qAbs( static_cast< double >( a ) - b ), static_cast< double >( epsilon ) ); } QVERIFY( _xxxresult ); }
|
||||
#define QGSCOMPARENEAR(a,b,epsilon) { \
|
||||
bool _xxxresult = qgsDoubleNear( a, b, epsilon ); \
|
||||
if ( !_xxxresult ) \
|
||||
{ \
|
||||
qDebug( "Expecting %f got %f (diff %f > %f)", static_cast< double >( a ), static_cast< double >( b ), qAbs( static_cast< double >( a ) - b ), static_cast< double >( epsilon ) ); \
|
||||
} \
|
||||
QVERIFY( qgsDoubleNear( a, b, epsilon ) ); \
|
||||
}
|
||||
|
||||
|
||||
#endif // QGSTESTUTILS_H
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "qgslinestringv2.h"
|
||||
#include "qgspolygonv2.h"
|
||||
#include "qgsmultipolygonv2.h"
|
||||
#include "qgstestutils.h"
|
||||
|
||||
class TestQgsGeometryUtils: public QObject
|
||||
{
|
||||
@ -413,8 +414,7 @@ void TestQgsGeometryUtils::testSqrDistToLine()
|
||||
p1.x(), p1.y(),
|
||||
p2.x(), p2.y(),
|
||||
rx, ry, epsilon );
|
||||
sqrDist = qRound( sqrDist * 100 ) / 100;
|
||||
QCOMPARE( sqrDist, 11.83 );
|
||||
QGSCOMPARENEAR( sqrDist, 11.83, 0.01 );
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user