Skip to content

Commit be031c4

Browse files
committed
Fix snapping test failing on 32-bit platforms (hopefully)
The discrepancy between the results seems to come from floating point arithmetics (-mfpmath option in GCC) which defaults to different values: - '387' for i386 - 'sse' for x86-64 The 387 coprocessor temporarily uses 80-bit precision so the results of arithmetic operations may be a bit different
1 parent 0a643ce commit be031c4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/src/core/testqgssnappingutils.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ class TestQgsSnappingUtils : public QObject
110110
QVERIFY( !m2.isValid() );
111111
QVERIFY( !m2.hasVertex() );
112112

113+
// do not consider edges in the following test - on 32-bit platforms
114+
// result was an edge match very close to (1,0) instead of being exactly (1,0)
115+
u.setDefaultSettings( QgsPointLocator::Vertex, 10, QgsTolerance::Pixels );
116+
113117
// test with filtering
114118
FilterExcludePoint myFilter( QgsPoint( 1, 0 ) );
115119
QgsPointLocator::Match m3 = u.snapToMap( QPoint( 100, 100 ), &myFilter );

0 commit comments

Comments
 (0)