Skip to content

Commit

Permalink
Fix snapping test failing on 32-bit platforms (hopefully)
Browse files Browse the repository at this point in the history
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 be031c4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/src/core/testqgssnappingutils.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit be031c4

Please sign in to comment.