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

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

Issue 2065503002: [builtins] Introduce proper Float64Atan and Float64Atan2 operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: [WIP] Fix GCC/Win32. 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/compiler/value-helper.h ('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 7a84f6256579eb45ef7fe76dcea46a7c237501ae..bfe2082e8a4a9bb258a900fd4488e43fd626caa1 100644
--- a/test/unittests/base/ieee754-unittest.cc
+++ b/test/unittests/base/ieee754-unittest.cc
@@ -9,12 +9,51 @@
#include "testing/gmock-support.h"
#include "testing/gtest-support.h"
+using testing::BitEq;
using testing::IsNaN;
namespace v8 {
namespace base {
namespace ieee754 {
+TEST(Ieee754, Atan) {
+ EXPECT_THAT(atan(std::numeric_limits<double>::quiet_NaN()), IsNaN());
+ EXPECT_THAT(atan(std::numeric_limits<double>::signaling_NaN()), IsNaN());
+ EXPECT_THAT(atan(-0.0), BitEq(-0.0));
+ EXPECT_THAT(atan(0.0), BitEq(0.0));
+ EXPECT_DOUBLE_EQ(1.5707963267948966,
+ atan(std::numeric_limits<double>::infinity()));
+ EXPECT_DOUBLE_EQ(-1.5707963267948966,
+ atan(-std::numeric_limits<double>::infinity()));
+}
+
+TEST(Ieee754, Atan2) {
+ EXPECT_THAT(atan2(std::numeric_limits<double>::quiet_NaN(),
+ std::numeric_limits<double>::quiet_NaN()),
+ IsNaN());
+ EXPECT_THAT(atan2(std::numeric_limits<double>::quiet_NaN(),
+ std::numeric_limits<double>::signaling_NaN()),
+ IsNaN());
+ EXPECT_THAT(atan2(std::numeric_limits<double>::signaling_NaN(),
+ std::numeric_limits<double>::quiet_NaN()),
+ IsNaN());
+ EXPECT_THAT(atan2(std::numeric_limits<double>::signaling_NaN(),
+ std::numeric_limits<double>::signaling_NaN()),
+ IsNaN());
+ EXPECT_DOUBLE_EQ(0.7853981633974483,
+ atan2(std::numeric_limits<double>::infinity(),
+ std::numeric_limits<double>::infinity()));
+ EXPECT_DOUBLE_EQ(2.356194490192345,
+ atan2(std::numeric_limits<double>::infinity(),
+ -std::numeric_limits<double>::infinity()));
+ EXPECT_DOUBLE_EQ(-0.7853981633974483,
+ atan2(-std::numeric_limits<double>::infinity(),
+ std::numeric_limits<double>::infinity()));
+ EXPECT_DOUBLE_EQ(-2.356194490192345,
+ atan2(-std::numeric_limits<double>::infinity(),
+ -std::numeric_limits<double>::infinity()));
+}
+
TEST(Ieee754, Log) {
EXPECT_THAT(log(std::numeric_limits<double>::quiet_NaN()), IsNaN());
EXPECT_THAT(log(std::numeric_limits<double>::signaling_NaN()), IsNaN());
« no previous file with comments | « test/cctest/compiler/value-helper.h ('k') | test/unittests/compiler/js-builtin-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698