Skip to content

Commit

Permalink
Add QGSCOMPARENOTNEAR(value,not_expected,epsilon) macro
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Dec 16, 2016
1 parent aaeaf97 commit cad7a8f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/qgstestutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@
QVERIFY( qgsDoubleNear( value, expected, epsilon ) ); \
}

#define QGSCOMPARENOTNEAR(value,not_expected,epsilon) { \
bool _xxxresult = qgsDoubleNear( value, not_expected, epsilon ); \
if ( _xxxresult ) \
{ \
qDebug( "Expecting %f to be differerent from %f (diff %f > %f)", static_cast< double >( value ), static_cast< double >( not_expected ), qAbs( static_cast< double >( not_expected ) - value ), static_cast< double >( epsilon ) ); \
} \
QVERIFY( !qgsDoubleNear( value, not_expected, epsilon ) ); \
}

#define QGSCOMPARENEARPOINT(point1,point2,epsilon) { \
QGSCOMPARENEAR( point1.x(), point2.x(), epsilon ); \
QGSCOMPARENEAR( point1.y(), point2.y(), epsilon ); \
Expand Down

0 comments on commit cad7a8f

Please sign in to comment.