Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(686)

Unified Diff: test/unittests/base/ieee754-unittest.cc

Issue 2083573002: [builtins] Unify Cosh, Sinh and Tanh as exports from flibm (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE and windows fix. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-serialize.cc ('k') | test/unittests/compiler/js-builtin-reducer-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « test/cctest/test-serialize.cc ('k') | test/unittests/compiler/js-builtin-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698