| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/base/logging.h" | 5 #include "src/base/logging.h" |
| 6 #include "testing/gtest-support.h" | 6 #include "testing/gtest-support.h" |
| 7 | 7 |
| 8 #ifdef DEBUG |
| 9 #define DISABLE_IN_RELEASE(Name) Name |
| 10 #else |
| 11 #define DISABLE_IN_RELEASE(Name) DISABLED_##Name |
| 12 #endif |
| 13 |
| 8 namespace v8 { | 14 namespace v8 { |
| 9 namespace base { | 15 namespace base { |
| 16 namespace logging { |
| 17 |
| 18 TEST(LoggingDeathTest, DISABLE_IN_RELEASE(CheckFailureWithMessage)) { |
| 19 ASSERT_DEATH_IF_SUPPORTED({ CHECK(false) << "This is a message"; }, |
| 20 "This is a message"); |
| 21 ASSERT_DEATH_IF_SUPPORTED({ CHECK_EQ(0, 1) << "This is stupid"; }, |
| 22 "This is stupid"); |
| 23 } |
| 24 |
| 10 | 25 |
| 11 TEST(LoggingTest, CheckEQImpl) { | 26 TEST(LoggingTest, CheckEQImpl) { |
| 12 EXPECT_EQ(nullptr, CheckEQImpl(0.0, 0.0, "")); | 27 EXPECT_EQ(nullptr, CheckEQImpl(0.0, 0.0, "")); |
| 13 EXPECT_EQ(nullptr, CheckEQImpl(0.0, -0.0, "")); | 28 EXPECT_EQ(nullptr, CheckEQImpl(0.0, -0.0, "")); |
| 14 EXPECT_EQ(nullptr, CheckEQImpl(-0.0, 0.0, "")); | 29 EXPECT_EQ(nullptr, CheckEQImpl(-0.0, 0.0, "")); |
| 15 EXPECT_EQ(nullptr, CheckEQImpl(-0.0, -0.0, "")); | 30 EXPECT_EQ(nullptr, CheckEQImpl(-0.0, -0.0, "")); |
| 16 } | 31 } |
| 17 | 32 |
| 33 } // namespace logging |
| 18 } // namespace base | 34 } // namespace base |
| 19 } // namespace v8 | 35 } // namespace v8 |
| OLD | NEW |