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

Side by Side Diff: third_party/WebKit/Source/wtf/AssertionsTest.cpp

Issue 1884023002: Implement Dump-on-DCHECK (via alternate DCHECK and DCHECK_OP macro implementations). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on cleanups Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/wtf/Assertions.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "wtf/Assertions.h" 5 #include "wtf/Assertions.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "wtf/text/StringBuilder.h" 8 #include "wtf/text/StringBuilder.h"
9 #include <stdio.h> 9 #include <stdio.h>
10 10
11 namespace WTF { 11 namespace WTF {
12 12
13 TEST(AssertionsTest, Assertions) { 13 TEST(AssertionsTest, Assertions) {
14 ASSERT(true); 14 ASSERT(true);
15 #if DCHECK_IS_ON() 15 #if DCHECK_IS_ON() && !defined(DCHECK_IS_DUMP_WITHOUT_CRASH)
16 EXPECT_DEATH_IF_SUPPORTED(ASSERT(false), ""); 16 EXPECT_DEATH_IF_SUPPORTED(ASSERT(false), "");
17 EXPECT_DEATH_IF_SUPPORTED(ASSERT_NOT_REACHED(), ""); 17 EXPECT_DEATH_IF_SUPPORTED(ASSERT_NOT_REACHED(), "");
18 EXPECT_DEATH_IF_SUPPORTED(DCHECK_AT(false, __FILE__, __LINE__), ""); 18 EXPECT_DEATH_IF_SUPPORTED(DCHECK_AT(false, __FILE__, __LINE__), "");
19 #else 19 #else
20 ASSERT(false); 20 ASSERT(false);
21 ASSERT_NOT_REACHED(); 21 ASSERT_NOT_REACHED();
22 DCHECK_AT(false, __FILE__, __LINE__); 22 DCHECK_AT(false, __FILE__, __LINE__);
23 #endif 23 #endif
24 24
25 RELEASE_ASSERT(true); 25 RELEASE_ASSERT(true);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 " ( c\n" 70 " ( c\n"
71 " ( d -1 hello )\n" 71 " ( d -1 hello )\n"
72 " )\n" 72 " )\n"
73 " a2 0.5\n" 73 " a2 0.5\n"
74 ")\n", 74 ")\n",
75 gBuilder.toString()); 75 gBuilder.toString());
76 }; 76 };
77 #endif // !LOG_DISABLED 77 #endif // !LOG_DISABLED
78 78
79 } // namespace WTF 79 } // namespace WTF
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/Assertions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698