diff options
author | Abseil Team <absl-team@google.com> | 2017-09-27T17·50-0700 |
---|---|---|
committer | Derek Mauro <dmauro@google.com> | 2017-09-27T20·03-0400 |
commit | cdf20caa491f59c0a35a8d8fbec0d948e4bc7e4c (patch) | |
tree | 1d3dc27123440a6745c85bc6ae8265da0891a56b /absl/time/duration_test.cc | |
parent | 7a64d73e1ef61b15971f8cc90876a5128729b0d4 (diff) |
Changes imported from Abseil "staging" branch:
- 43853019b439efb32c79d5d50e24508588e1bbe0 Undo the not applying qualifications to absl types in enc... by Derek Mauro <dmauro@google.com> - 06d62a10621c9864279ee57097069cfe3cb7b42a fix capitalization by Abseil Team <absl-team@google.com> - 22adbfee340bb452ba38b68975ade6f072859c4a Fix indices in str_split.h comments. by Derek Mauro <dmauro@google.com> - ae5143a559ad8633a78cd76620e30a781006d088 Fix the inconsistent licenses directives in the BUILD fil... by Derek Mauro <dmauro@google.com> - 0a76a3653b2ecfdad433d3e2f5b651c4ecdcf74b Remove strip.cc, fastmem.h, and fastmem_test.cc from the ... by Derek Mauro <dmauro@google.com> - 77908cfce5927aabca1f8d62481106f22cfc1936 Internal change. by Derek Mauro <dmauro@google.com> - d3277b4171f37e22ab346becb5e295c36c7a0219 Be consistent in (not) applying qualifications for enclos... by Abseil Team <absl-team@google.com> - 9ec7f8164e7d6a5f64288a7360a346628393cc50 Add std:: qualification to isnan and isinf in duration_te... by Derek Mauro <dmauro@google.com> - 9f7c87d7764ddba05286fabca1f4f15285f3250a Fix typos in string_view comments. by Abseil Team <absl-team@google.com> - 281860804f8053143d969b99876e3dbc6deb1236 Fix typo in container.h docs. by Abseil Team <absl-team@google.com> - 0b0a9388c7a9d7f72349d44b5b46132f45bde56c Add bazel-* symlinks to gitignore. by Michael Pratt <mpratt@google.com> GitOrigin-RevId: 43853019b439efb32c79d5d50e24508588e1bbe0 Change-Id: I9e74a5430816a34ecf1acb86486ed3b0bd12a1d6
Diffstat (limited to 'absl/time/duration_test.cc')
-rw-r--r-- | absl/time/duration_test.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/absl/time/duration_test.cc b/absl/time/duration_test.cc index ab98b02ac38f..7f4522874861 100644 --- a/absl/time/duration_test.cc +++ b/absl/time/duration_test.cc @@ -460,10 +460,10 @@ TEST(Duration, InfinityAddition) { // For reference: IEEE 754 behavior const double dbl_inf = std::numeric_limits<double>::infinity(); - EXPECT_TRUE(isinf(dbl_inf + dbl_inf)); - EXPECT_TRUE(isnan(dbl_inf + -dbl_inf)); // We return inf - EXPECT_TRUE(isnan(-dbl_inf + dbl_inf)); // We return inf - EXPECT_TRUE(isinf(-dbl_inf + -dbl_inf)); + EXPECT_TRUE(std::isinf(dbl_inf + dbl_inf)); + EXPECT_TRUE(std::isnan(dbl_inf + -dbl_inf)); // We return inf + EXPECT_TRUE(std::isnan(-dbl_inf + dbl_inf)); // We return inf + EXPECT_TRUE(std::isinf(-dbl_inf + -dbl_inf)); } TEST(Duration, InfinitySubtraction) { @@ -497,10 +497,10 @@ TEST(Duration, InfinitySubtraction) { // For reference: IEEE 754 behavior const double dbl_inf = std::numeric_limits<double>::infinity(); - EXPECT_TRUE(isnan(dbl_inf - dbl_inf)); // We return inf - EXPECT_TRUE(isinf(dbl_inf - -dbl_inf)); - EXPECT_TRUE(isinf(-dbl_inf - dbl_inf)); - EXPECT_TRUE(isnan(-dbl_inf - -dbl_inf)); // We return inf + EXPECT_TRUE(std::isnan(dbl_inf - dbl_inf)); // We return inf + EXPECT_TRUE(std::isinf(dbl_inf - -dbl_inf)); + EXPECT_TRUE(std::isinf(-dbl_inf - dbl_inf)); + EXPECT_TRUE(std::isnan(-dbl_inf - -dbl_inf)); // We return inf } TEST(Duration, InfinityMultiplication) { @@ -708,13 +708,13 @@ TEST(Duration, InfinityIDiv) { // IEEE 754 says inf / inf should be nan, but int64_t doesn't have // nan so we'll return kint64max/kint64min instead. - EXPECT_TRUE(isnan(dbl_inf / dbl_inf)); + EXPECT_TRUE(std::isnan(dbl_inf / dbl_inf)); EXPECT_EQ(kint64max, inf / inf); EXPECT_EQ(kint64max, -inf / -inf); EXPECT_EQ(kint64min, -inf / inf); EXPECT_EQ(kint64min, inf / -inf); - EXPECT_TRUE(isinf(dbl_inf / 2.0)); + EXPECT_TRUE(std::isinf(dbl_inf / 2.0)); EXPECT_EQ(kint64max, inf / any_dur); EXPECT_EQ(kint64max, -inf / -any_dur); EXPECT_EQ(kint64min, -inf / any_dur); @@ -763,8 +763,8 @@ TEST(Duration, DivisionByZero) { // IEEE 754 behavior double z = 0.0, two = 2.0; - EXPECT_TRUE(isinf(two / z)); - EXPECT_TRUE(isnan(z / z)); // We'll return inf + EXPECT_TRUE(std::isinf(two / z)); + EXPECT_TRUE(std::isnan(z / z)); // We'll return inf // Operator/(Duration, double) EXPECT_EQ(inf, zero / 0.0); |