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

Unified Diff: util/numeric/in_range_cast_test.cc

Issue 1300403002: Add a few more expectations to crashpad_util_test InRangeCast (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5ed9b17295ad5ce41625325c52c58ba51e56370d..3ce4459f197a946d11dbdae8eea28d3043fcad96 100644
--- a/util/numeric/in_range_cast_test.cc
+++ b/util/numeric/in_range_cast_test.cc
@@ -39,6 +39,7 @@ TEST(InRangeCast, Uint32) {
EXPECT_EQ(1u, InRangeCast<uint32_t>(UINT64_C(0x100000000), 1));
EXPECT_EQ(1u, InRangeCast<uint32_t>(UINT64_C(0x100000001), 1));
EXPECT_EQ(1u, InRangeCast<uint32_t>(kInt32Min, 1));
+ EXPECT_EQ(1u, InRangeCast<uint32_t>(kInt64Min, 1));
EXPECT_EQ(0xffffffffu, InRangeCast<uint32_t>(-1, 0xffffffffu));
}
@@ -58,6 +59,7 @@ TEST(InRangeCast, Int32) {
EXPECT_EQ(kInt32Min,
InRangeCast<int32_t>(implicit_cast<int64_t>(kInt32Min), 1));
EXPECT_EQ(1, InRangeCast<int32_t>(implicit_cast<int64_t>(kInt32Min) - 1, 1));
+ EXPECT_EQ(1, InRangeCast<int32_t>(kInt64Min, 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));
@@ -79,7 +81,6 @@ TEST(InRangeCast, Uint64) {
InRangeCast<uint64_t>(UINT64_C(0x100000001), 1));
EXPECT_EQ(1u, InRangeCast<uint64_t>(kInt32Min, 1));
EXPECT_EQ(1u, InRangeCast<uint64_t>(INT64_C(-1), 1));
- EXPECT_EQ(1u, InRangeCast<uint64_t>(kInt32Min, 1));
Mark Mentovai 2015/08/20 15:52:59 This was a duplicate.
EXPECT_EQ(1u, InRangeCast<uint64_t>(kInt64Min, 1));
EXPECT_EQ(UINT64_C(0xffffffffffffffff),
InRangeCast<uint64_t>(-1, UINT64_C(0xffffffffffffffff)));
@@ -100,11 +101,14 @@ TEST(InRangeCast, Int64) {
InRangeCast<int64_t>(INT64_C(0x100000000), 1));
EXPECT_EQ(INT64_C(0x7fffffffffffffff),
InRangeCast<int64_t>(INT64_C(0x7fffffffffffffff), 1));
+ EXPECT_EQ(INT64_C(0x7fffffffffffffff),
+ InRangeCast<int64_t>(UINT64_C(0x7fffffffffffffff), 1));
EXPECT_EQ(1, InRangeCast<int64_t>(UINT64_C(0x8000000000000000), 1));
EXPECT_EQ(1, InRangeCast<int64_t>(UINT64_C(0xffffffffffffffff), 1));
EXPECT_EQ(kInt32Min, InRangeCast<int64_t>(kInt32Min, 1));
EXPECT_EQ(kInt32Min,
InRangeCast<int64_t>(implicit_cast<int64_t>(kInt32Min), 1));
+ EXPECT_EQ(kInt64Min, InRangeCast<int64_t>(kInt64Min, 1));
EXPECT_EQ(0, InRangeCast<int64_t>(UINT64_C(0xffffffffffffffff), 0));
EXPECT_EQ(-1, InRangeCast<int64_t>(UINT64_C(0xffffffffffffffff), -1));
EXPECT_EQ(kInt64Min,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698