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

Unified Diff: test/unittests/base/logging-unittest.cc

Issue 2642383002: Fix CHECK_OP implementation in Release builds (Closed)
Patch Set: Add tests Created 3 years, 11 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 | « src/base/logging.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/base/logging-unittest.cc
diff --git a/test/unittests/base/logging-unittest.cc b/test/unittests/base/logging-unittest.cc
index 5c0ca007c4d0524722194d468bff9aaaec733437..e59456f4fc61bd04ade8550a7cf6bef8d16c0ae2 100644
--- a/test/unittests/base/logging-unittest.cc
+++ b/test/unittests/base/logging-unittest.cc
@@ -63,5 +63,24 @@ TEST(LoggingTest, CompareAgainstStaticConstPointer) {
CHECK_SUCCEED(GT, 0, v8::internal::Smi::kMinValue);
}
+TEST(LoggingTest, CompareWithDifferentSignedness) {
+#define CHECK_BOTH(name, lhs, rhs) \
+ CHECK_##name(lhs, rhs); \
+ DCHECK_##name(lhs, rhs)
+
+ int32_t i32 = 10;
+ uint32_t u32 = 20;
+ int64_t i64 = 30;
+ uint64_t u64 = 40;
+
+ // All these checks should compile (!) and succeed.
+ CHECK_BOTH(EQ, i32 + 10, u32);
+ CHECK_BOTH(LT, i32, u64);
+ CHECK_BOTH(LE, u32, i64);
+ CHECK_BOTH(IMPLIES, i32, i64);
+ CHECK_BOTH(IMPLIES, u32, i64);
+ CHECK_BOTH(IMPLIES, !u32, !i64);
+}
+
} // namespace base
} // namespace v8
« no previous file with comments | « src/base/logging.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698