Skip to content
Permalink
Browse files

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
  • Loading branch information
wonder-sk committed Jun 18, 2015
1 parent 0a643ce commit be031c451de501ea796ac4ed5271a9cce30ea43a
Showing with 4 additions and 0 deletions.
  1. +4 −0 tests/src/core/testqgssnappingutils.cpp
@@ -110,6 +110,10 @@ class TestQgsSnappingUtils : public QObject
QVERIFY( !m2.isValid() );
QVERIFY( !m2.hasVertex() );

// do not consider edges in the following test - on 32-bit platforms
// result was an edge match very close to (1,0) instead of being exactly (1,0)
u.setDefaultSettings( QgsPointLocator::Vertex, 10, QgsTolerance::Pixels );

// test with filtering
FilterExcludePoint myFilter( QgsPoint( 1, 0 ) );
QgsPointLocator::Match m3 = u.snapToMap( QPoint( 100, 100 ), &myFilter );

0 comments on commit be031c4

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