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

Unified Diff: base/numerics/safe_numerics_unittest.cc

Issue 2163023002: Unify usage of logging/assert macros in base/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix base/android/build_info.cc compile Created 4 years, 5 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 | « base/message_loop/incoming_task_queue.cc ('k') | base/sequence_checker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/numerics/safe_numerics_unittest.cc
diff --git a/base/numerics/safe_numerics_unittest.cc b/base/numerics/safe_numerics_unittest.cc
index 4be7ab59d722a63e6cf8508f71e3e61bf097febf..b602e65a86615897067f02c7015ca88052c7e52f 100644
--- a/base/numerics/safe_numerics_unittest.cc
+++ b/base/numerics/safe_numerics_unittest.cc
@@ -11,6 +11,7 @@
#include "base/compiler_specific.h"
#include "base/numerics/safe_conversions.h"
#include "base/numerics/safe_math.h"
+#include "base/test/gtest_util.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -650,18 +651,15 @@ TEST(SafeNumerics, CastTests) {
EXPECT_EQ(0, saturated_cast<int>(not_a_number));
}
-#if GTEST_HAS_DEATH_TEST
-
TEST(SafeNumerics, SaturatedCastChecks) {
float not_a_number = std::numeric_limits<float>::infinity() -
std::numeric_limits<float>::infinity();
EXPECT_TRUE(std::isnan(not_a_number));
- EXPECT_DEATH((saturated_cast<int, base::SaturatedCastNaNBehaviorCheck>(
- not_a_number)), "");
+ EXPECT_DCHECK_DEATH(
+ (saturated_cast<int, base::SaturatedCastNaNBehaviorCheck>(not_a_number)),
+ "");
}
-#endif // GTEST_HAS_DEATH_TEST
-
TEST(SafeNumerics, IsValueInRangeForNumericType) {
EXPECT_TRUE(IsValueInRangeForNumericType<uint32_t>(0));
EXPECT_TRUE(IsValueInRangeForNumericType<uint32_t>(1));
« no previous file with comments | « base/message_loop/incoming_task_queue.cc ('k') | base/sequence_checker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698