Index: test/cctest/test-utils.cc |
diff --git a/test/cctest/test-utils.cc b/test/cctest/test-utils.cc |
index df8ff72e4f3eafed1e85aad150b2ce0d0a93f409..6cd931da4e5822e9c9368b4f16741ebdbe53c296 100644 |
--- a/test/cctest/test-utils.cc |
+++ b/test/cctest/test-utils.cc |
@@ -55,6 +55,22 @@ TEST(Utils1) { |
CHECK_EQ(-2, -8 >> 2); |
CHECK_EQ(-2, static_cast<int8_t>(-8) >> 2); |
CHECK_EQ(-2, static_cast<int>(static_cast<intptr_t>(-8) >> 2)); |
+ |
+ CHECK_EQ(-1000000, FastD2IChecked(-1000000.0)); |
+ CHECK_EQ(-1, FastD2IChecked(-1.0)); |
+ CHECK_EQ(0, FastD2IChecked(0.0)); |
+ CHECK_EQ(1, FastD2IChecked(1.0)); |
+ CHECK_EQ(1000000, FastD2IChecked(1000000.0)); |
+ |
+ CHECK_EQ(-1000000, FastD2IChecked(-1000000.123)); |
+ CHECK_EQ(-1, FastD2IChecked(-1.234)); |
+ CHECK_EQ(0, FastD2IChecked(0.345)); |
+ CHECK_EQ(1, FastD2IChecked(1.234)); |
+ CHECK_EQ(1000000, FastD2IChecked(1000000.123)); |
+ |
+ CHECK_EQ(INT_MAX, FastD2IChecked(1.0e100)); |
+ CHECK_EQ(INT_MIN, FastD2IChecked(-1.0e100)); |
+ CHECK_EQ(INT_MIN, FastD2IChecked(NAN)); |
} |