From 1b484f853061e8577d95205f27e1ebbdbf80ec47 Mon Sep 17 00:00:00 2001 From: Charles Karney Date: Mon, 26 Oct 2020 14:05:06 -0400 Subject: Address comments by @schwehr --- test/unit/pj_phi2_test.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test') 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::infinity(); - const auto nan = std::numeric_limits::quiet_NaN(); + constexpr auto inf = std::numeric_limits::infinity(); + constexpr auto nan = std::numeric_limits::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)); -- cgit v1.2.3