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

Unified Diff: base/debug/stack_trace_unittest.cc

Issue 2632643004: Remove WTFReportAssertionFailure and WTFReportBacktrace. (Closed)
Patch Set: Add Truncate() helper 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
Index: base/debug/stack_trace_unittest.cc
diff --git a/base/debug/stack_trace_unittest.cc b/base/debug/stack_trace_unittest.cc
index e716bf740d81cbd795e4b879eaf1096e0acd91e3..fe427b1ba3b997706ba65346b547310f26c89eb0 100644
--- a/base/debug/stack_trace_unittest.cc
+++ b/base/debug/stack_trace_unittest.cc
@@ -122,6 +122,21 @@ TEST_F(StackTraceTest, MAYBE_OutputToStream) {
#endif // define(OS_MACOSX)
}
+TEST_F(StackTraceTest, TruncateTrace) {
+ StackTrace trace;
+
+ size_t count = 0;
+ const void* const* trace_ptrs = trace.Addresses(&count);
+ ASSERT_LT(2u, count);
+
+ StackTrace truncated = trace.Truncate(2);
+ const void* const* truncated_ptrs = truncated.Addresses(&count);
+ EXPECT_EQ(2u, count);
+
+ EXPECT_EQ(trace_ptrs[0], truncated_ptrs[0]);
+ EXPECT_EQ(trace_ptrs[1], truncated_ptrs[1]);
+}
+
// The test is used for manual testing, e.g., to see the raw output.
TEST_F(StackTraceTest, DebugOutputToStream) {
StackTrace trace;

Powered by Google App Engine
This is Rietveld 408576698