Skip to content
Permalink
Browse files

Add QGSCOMPARENOTNEAR(value,not_expected,epsilon) macro

  • Loading branch information
rouault committed Dec 16, 2016
1 parent aaeaf97 commit cad7a8fd885a652b41b6ed96acc9ae8624e3596e
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/core/qgstestutils.h
@@ -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 ); \

0 comments on commit cad7a8f

Please sign in to comment.
You can’t perform that action at this time.