aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCharles Karney <charles.karney@sri.com>2020-10-26 14:05:06 -0400
committerCharles Karney <charles.karney@sri.com>2020-10-26 14:05:06 -0400
commit1b484f853061e8577d95205f27e1ebbdbf80ec47 (patch)
treeeac66398f7e2c41ca6be9b5313f463dd727dd44e /test
parentb3a20c5b9c6efbeb0d6f528aad1d4e6bb4332bfa (diff)
downloadPROJ-1b484f853061e8577d95205f27e1ebbdbf80ec47.tar.gz
PROJ-1b484f853061e8577d95205f27e1ebbdbf80ec47.zip
Address comments by @schwehr
Diffstat (limited to 'test')
-rw-r--r--test/unit/pj_phi2_test.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/unit/pj_phi2_test.cpp b/test/unit/pj_phi2_test.cpp
index ac728306..f344a3d0 100644
--- a/test/unit/pj_phi2_test.cpp
+++ b/test/unit/pj_phi2_test.cpp
@@ -43,8 +43,8 @@ TEST(PjPhi2Test, Basic) {
// (and nan is here reckoned to be sane) are passed to pj_phi2. Thus the
// return value with other values of e is "implementation dependent".
- const auto inf = std::numeric_limits<double>::infinity();
- const auto nan = std::numeric_limits<double>::quiet_NaN();
+ constexpr auto inf = std::numeric_limits<double>::infinity();
+ constexpr auto nan = std::numeric_limits<double>::quiet_NaN();
// Use EXPECT_EQ instead of EXPECT_DOUBLE_EQ. Strict equality is demanded
// here.
@@ -58,7 +58,7 @@ TEST(PjPhi2Test, Basic) {
EXPECT_EQ( 0.0 , pj_phi2(ctx, -1.0, 0.0));
EXPECT_EQ(+M_PI_2, pj_phi2(ctx, -inf, 0.0));
- double e = 0.2;
+ constexpr double e = 0.2;
EXPECT_EQ( M_PI_2, pj_phi2(ctx, +0.0, e));
EXPECT_EQ( 0.0 , pj_phi2(ctx, 1.0, e));
EXPECT_EQ(-M_PI_2, pj_phi2(ctx, inf, e));
@@ -83,7 +83,7 @@ TEST(PjPhi2Test, Basic) {
EXPECT_DOUBLE_EQ(-M_PI/4, pj_phi2(ctx, sqrt(2.0)+1 , 0.0));
EXPECT_DOUBLE_EQ(-M_PI/6, pj_phi2(ctx, sqrt(3.0) , 0.0));
- // generate with exp(e * atanh(e * sin(phi))) / (tan(phi) + sec(phi))
+ // Generated with exp(e * atanh(e * sin(phi))) / (tan(phi) + sec(phi))
EXPECT_DOUBLE_EQ( M_PI/3, pj_phi2(ctx, 0.27749174377027023413, e));
EXPECT_DOUBLE_EQ( M_PI/4, pj_phi2(ctx, 0.42617788119104192995, e));
EXPECT_DOUBLE_EQ( M_PI/6, pj_phi2(ctx, 0.58905302448626726064, e));