Index: test/unittests/base/ieee754-unittest.cc |
diff --git a/test/unittests/base/ieee754-unittest.cc b/test/unittests/base/ieee754-unittest.cc |
index 8c71b579ed9facdc4a835602a0b0087f37e2eea8..dc30105e166f00cb7731e716e491015342c8ccc0 100644 |
--- a/test/unittests/base/ieee754-unittest.cc |
+++ b/test/unittests/base/ieee754-unittest.cc |
@@ -117,6 +117,18 @@ TEST(Ieee754, Cos) { |
EXPECT_EQ(-0.9258790228548379e0, cos(-kTwo120)); |
} |
+TEST(Ieee754, Cosh) { |
+ // Test values mentioned in the EcmaScript spec. |
+ EXPECT_THAT(cosh(std::numeric_limits<double>::quiet_NaN()), IsNaN()); |
+ EXPECT_THAT(cosh(std::numeric_limits<double>::signaling_NaN()), IsNaN()); |
+ EXPECT_THAT(cosh(std::numeric_limits<double>::infinity()), |
+ std::numeric_limits<double>::infinity()); |
+ EXPECT_THAT(cosh(-std::numeric_limits<double>::infinity()), |
+ std::numeric_limits<double>::infinity()); |
+ EXPECT_EQ(1, cosh(0.0)); |
+ EXPECT_EQ(1, cosh(-0.0)); |
+} |
+ |
TEST(Ieee754, Exp) { |
EXPECT_THAT(exp(std::numeric_limits<double>::quiet_NaN()), IsNaN()); |
EXPECT_THAT(exp(std::numeric_limits<double>::signaling_NaN()), IsNaN()); |
@@ -281,6 +293,18 @@ TEST(Ieee754, Sin) { |
EXPECT_EQ(-0.377820109360752e0, sin(-kTwo120)); |
} |
+TEST(Ieee754, Sinh) { |
+ // Test values mentioned in the EcmaScript spec. |
+ EXPECT_THAT(sinh(std::numeric_limits<double>::quiet_NaN()), IsNaN()); |
+ EXPECT_THAT(sinh(std::numeric_limits<double>::signaling_NaN()), IsNaN()); |
+ EXPECT_THAT(sinh(std::numeric_limits<double>::infinity()), |
+ std::numeric_limits<double>::infinity()); |
+ EXPECT_THAT(sinh(-std::numeric_limits<double>::infinity()), |
+ -std::numeric_limits<double>::infinity()); |
+ EXPECT_EQ(0.0, sinh(0.0)); |
+ EXPECT_EQ(-0.0, sinh(-0.0)); |
+} |
+ |
TEST(Ieee754, Tan) { |
// Test values mentioned in the EcmaScript spec. |
EXPECT_THAT(tan(std::numeric_limits<double>::quiet_NaN()), IsNaN()); |
@@ -318,6 +342,16 @@ TEST(Ieee754, Tan) { |
EXPECT_EQ(0.40806638884180424e0, tan(-kTwo120)); |
} |
+TEST(Ieee754, Tanh) { |
+ // Test values mentioned in the EcmaScript spec. |
+ EXPECT_THAT(tanh(std::numeric_limits<double>::quiet_NaN()), IsNaN()); |
+ EXPECT_THAT(tanh(std::numeric_limits<double>::signaling_NaN()), IsNaN()); |
+ EXPECT_THAT(tanh(std::numeric_limits<double>::infinity()), 1); |
+ EXPECT_THAT(tanh(-std::numeric_limits<double>::infinity()), -1); |
+ EXPECT_EQ(0.0, tanh(0.0)); |
+ EXPECT_EQ(-0.0, tanh(-0.0)); |
+} |
+ |
} // namespace ieee754 |
} // namespace base |
} // namespace v8 |