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

Unified Diff: base/check_example.cc

Issue 2532513002: base: Make CHECK great again
Patch Set: . Created 4 years 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 | base/logging.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/check_example.cc
diff --git a/base/check_example.cc b/base/check_example.cc
index 4b3f4287dbf1455257dc067c4cda057d481e2e89..e695d4f49f1c7e823d8992f3748d0321f196c09d 100644
--- a/base/check_example.cc
+++ b/base/check_example.cc
@@ -11,7 +11,13 @@
// the CHECK* macros, nor should it have the strings in the
// executable.
-void DoCheck(bool b) {
+// TODO remove this crap before landing, adding only to see the effect on a real build target.
+
+#define BLINK_IMMEDIATE_CRASH() ((void)(*(volatile char*)0 = 0))
+#define BLINK_RELEASE_ASSERT(condition) !(condition) ? IMMEDIATE_CRASH() : (void) 0;
+
+
+void __declspec(dllexport) DoCheck(bool b) {
CHECK(b) << "DoCheck " << b;
}
@@ -19,6 +25,14 @@ void DoCheckEq(int x, int y) {
CHECK_EQ(x, y);
}
+void __declspec(dllexport) DoBlinkCheck(bool b) {
+ BLINK_RELEASE_ASSERT(b);
+}
+
+void __declspec(dllexport) DoBaseCheck(bool b) {
+ CHECK(b) << "DoCheck " << b;
+}
+
int main(int argc, const char* argv[]) {
DoCheck(argc > 1);
DoCheckEq(argc, 1);
« no previous file with comments | « no previous file | base/logging.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698