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

Unified Diff: util/numeric/in_range_cast_test.cc

Issue 700383007: Use implicit_cast<> instead of static_cast<> whenever possible (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 1 month 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
Index: util/numeric/in_range_cast_test.cc
diff --git a/util/numeric/in_range_cast_test.cc b/util/numeric/in_range_cast_test.cc
index 52eeedf5d2a942a5204011c63b20593695ae92a6..5ed9b17295ad5ce41625325c52c58ba51e56370d 100644
--- a/util/numeric/in_range_cast_test.cc
+++ b/util/numeric/in_range_cast_test.cc
@@ -56,8 +56,8 @@ TEST(InRangeCast, Int32) {
EXPECT_EQ(1, InRangeCast<int32_t>(INT64_C(0x100000000), 1));
EXPECT_EQ(kInt32Min, InRangeCast<int32_t>(kInt32Min, 1));
EXPECT_EQ(kInt32Min,
- InRangeCast<int32_t>(static_cast<int64_t>(kInt32Min), 1));
- EXPECT_EQ(1, InRangeCast<int32_t>(static_cast<int64_t>(kInt32Min) - 1, 1));
+ InRangeCast<int32_t>(implicit_cast<int64_t>(kInt32Min), 1));
+ EXPECT_EQ(1, InRangeCast<int32_t>(implicit_cast<int64_t>(kInt32Min) - 1, 1));
EXPECT_EQ(0, InRangeCast<int32_t>(0xffffffffu, 0));
EXPECT_EQ(-1, InRangeCast<int32_t>(0xffffffffu, -1));
EXPECT_EQ(kInt32Min, InRangeCast<int32_t>(0xffffffffu, kInt32Min));
@@ -104,7 +104,7 @@ TEST(InRangeCast, Int64) {
EXPECT_EQ(1, InRangeCast<int64_t>(UINT64_C(0xffffffffffffffff), 1));
EXPECT_EQ(kInt32Min, InRangeCast<int64_t>(kInt32Min, 1));
EXPECT_EQ(kInt32Min,
- InRangeCast<int64_t>(static_cast<int64_t>(kInt32Min), 1));
+ InRangeCast<int64_t>(implicit_cast<int64_t>(kInt32Min), 1));
EXPECT_EQ(0, InRangeCast<int64_t>(UINT64_C(0xffffffffffffffff), 0));
EXPECT_EQ(-1, InRangeCast<int64_t>(UINT64_C(0xffffffffffffffff), -1));
EXPECT_EQ(kInt64Min,

Powered by Google App Engine
This is Rietveld 408576698