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

Unified Diff: ipc/ipc_tests.cc

Issue 277007: NOT TO COMMIT! Testing NDEBUG/DCHECK on different platforms.. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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: ipc/ipc_tests.cc
===================================================================
--- ipc/ipc_tests.cc (revision 28954)
+++ ipc/ipc_tests.cc (working copy)
@@ -61,6 +61,30 @@
MultiProcessTest::TearDown();
}
+#define PRINT_FOR_SURE(a) LOG(INFO) << a; printf("%s\n", a); fprintf(stderr, "%s\n", a);
+bool return_true() {
+ PRINT_FOR_SURE("return_true was called");
+ return true;
+}
+
+TEST_F(IPCChannelTest, DCHECK_TEST) {
+#ifdef NDEBUG
+ PRINT_FOR_SURE("NDEBUG is defined");
+#else
+ PRINT_FOR_SURE("NDEBUG is not defined");
+#endif
+ DCHECK(return_true());
+}
+
+void DeathFunction() {
+ DCHECK(!return_true());
+}
+
+TEST_F(IPCChannelTest, DeathTest) {
+ //::testing::FLAGS_gtest_death_test_style = "threadsafe";
+ ASSERT_DEATH_IF_SUPPORTED(DeathFunction(), "");
+}
+
#if defined(OS_WIN)
base::ProcessHandle IPCChannelTest::SpawnChild(ChildType child_type,
IPC::Channel *channel) {
« 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