aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-02-18 22:50:16 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-02-18 22:50:16 +0100
commit2b1cf12bf36e536cd29994951b46f180e81e1179 (patch)
tree9e49a7b998f27b5a11bff304461baa836212420a /test
parent97016c7f7b74bd473c446ee128d1774209eddfc0 (diff)
downloadPROJ-2b1cf12bf36e536cd29994951b46f180e81e1179.tar.gz
PROJ-2b1cf12bf36e536cd29994951b46f180e81e1179.zip
Fix a few issues with i386 builds
Relax tolerances in a few unit test, and in laea code. Seen with gcc 5.3 and also 7.1 Related to the use of the 387 floating-point math, since they disappear with gcc 7.1 if using non-default -mfpmath=sse -msse
Diffstat (limited to 'test')
-rw-r--r--test/gie/builtins.gie7
-rw-r--r--test/unit/gie_self_tests.cpp15
-rw-r--r--test/unit/pj_phi2_test.cpp4
-rw-r--r--test/unit/test_io.cpp2
4 files changed, 13 insertions, 15 deletions
diff --git a/test/gie/builtins.gie b/test/gie/builtins.gie
index 930ca71f..37bdfc69 100644
--- a/test/gie/builtins.gie
+++ b/test/gie/builtins.gie
@@ -897,7 +897,7 @@ Chamberlin Trimetric
-------------------------------------------------------------------------------
operation +proj=chamb +R=6400000 +lat_1=0.5 +lat_2=2
-------------------------------------------------------------------------------
-tolerance 0.5 mm
+tolerance 2.5 mm
accept 2 1
expect -27864.779586801 -223364.324593274
accept 2 -1
@@ -5236,12 +5236,9 @@ van der Grinten (I)
-------------------------------------------------------------------------------
operation +proj=vandg +a=6400000 +lat_1=0.5 +lat_2=2
-------------------------------------------------------------------------------
-tolerance 0.1 mm
+tolerance 0.15 mm
accept 2 1
expect 223395.249543407 111704.596633675
-rem 223395.249543407 111704.596633675 osgeo
-rem 223395.249543407 111704.596633675 debug/bin
-
accept 2 -1
expect 223395.249543407 -111704.596633675
diff --git a/test/unit/gie_self_tests.cpp b/test/unit/gie_self_tests.cpp
index 5936791e..ad637786 100644
--- a/test/unit/gie_self_tests.cpp
+++ b/test/unit/gie_self_tests.cpp
@@ -256,8 +256,8 @@ TEST_F(gieTest, proj_create_crs_to_crs) {
b.xy.y = 5999669.3036037628;
a = proj_trans(P, PJ_FWD, a);
- EXPECT_NEAR(a.xy.x, b.xy.x, 1e-9);
- EXPECT_NEAR(a.xy.y, b.xy.y, 1e-9);
+ EXPECT_NEAR(a.xy.x, b.xy.x, 1e-8);
+ EXPECT_NEAR(a.xy.y, b.xy.y, 1e-8);
auto src = proj_get_source_crs(PJ_DEFAULT_CTX, P);
ASSERT_TRUE(src != nullptr);
@@ -419,11 +419,12 @@ TEST(gie, info_functions) {
ASSERT_FALSE(proj_errno(P)); /* factors not created correctly */
/* check a few key characteristics of the Mercator projection */
- ASSERT_EQ(factors.angular_distortion,
- 0.0); /* angular distortion should be 0 */
- ASSERT_EQ(factors.meridian_parallel_angle,
- M_PI_2); /* Meridian/parallel angle should be 90 deg */
- ASSERT_EQ(factors.meridian_convergence,
+ EXPECT_NEAR(factors.angular_distortion, 0.0, 1e-7)
+ << factors.angular_distortion; /* angular distortion should be 0 */
+ EXPECT_NEAR(factors.meridian_parallel_angle, M_PI_2, 1e-7)
+ << factors.meridian_parallel_angle; /* Meridian/parallel angle should be
+ 90 deg */
+ EXPECT_EQ(factors.meridian_convergence,
0.0); /* meridian convergence should be 0 */
proj_destroy(P);
diff --git a/test/unit/pj_phi2_test.cpp b/test/unit/pj_phi2_test.cpp
index 5fc84600..c4db6e52 100644
--- a/test/unit/pj_phi2_test.cpp
+++ b/test/unit/pj_phi2_test.cpp
@@ -41,12 +41,12 @@ TEST(PjPhi2Test, Basic) {
EXPECT_DOUBLE_EQ(M_PI_2, pj_phi2(ctx, 0.0, 0.0));
- EXPECT_DOUBLE_EQ(0.0, pj_phi2(ctx, 1.0, 0.0));
+ EXPECT_NEAR(0.0, pj_phi2(ctx, 1.0, 0.0), 1e-16);
EXPECT_DOUBLE_EQ(M_PI_2, pj_phi2(ctx, 0.0, 1.0));
EXPECT_DOUBLE_EQ(M_PI, pj_phi2(ctx, -1.0, 0.0));
EXPECT_DOUBLE_EQ(M_PI_2, pj_phi2(ctx, 0.0, -1.0));
- EXPECT_DOUBLE_EQ(0.0, pj_phi2(ctx, 1.0, 1.0));
+ EXPECT_NEAR(0.0, pj_phi2(ctx, 1.0, 1.0), 1e-16);
EXPECT_DOUBLE_EQ(M_PI, pj_phi2(ctx, -1.0, -1.0));
// TODO(schwehr): M_PI_4, M_PI_2, M_PI, M_E
diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp
index 2cc05aad..3d015e0c 100644
--- a/test/unit/test_io.cpp
+++ b/test/unit/test_io.cpp
@@ -6773,7 +6773,7 @@ TEST(io, projparse_longlat_a_es) {
ASSERT_TRUE(crs != nullptr);
EXPECT_EQ(crs->ellipsoid()->semiMajorAxis().getSIValue(), 2);
auto rf = crs->ellipsoid()->computedInverseFlattening();
- EXPECT_EQ(rf, 3.4142135623730958) << rf;
+ EXPECT_NEAR(rf, 3.4142135623730958, 1e-14) << rf;
}
// ---------------------------------------------------------------------------