| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 // Expect to find this function as well. | 116 // Expect to find this function as well. |
| 117 // Note: This will fail if not linked with -rdynamic (aka -export_dynamic) | 117 // Note: This will fail if not linked with -rdynamic (aka -export_dynamic) |
| 118 EXPECT_TRUE(backtrace_message.find(__func__) != std::string::npos) | 118 EXPECT_TRUE(backtrace_message.find(__func__) != std::string::npos) |
| 119 << "Expected to find " << __func__ << " in backtrace:\n" | 119 << "Expected to find " << __func__ << " in backtrace:\n" |
| 120 << backtrace_message; | 120 << backtrace_message; |
| 121 | 121 |
| 122 #endif // define(OS_MACOSX) | 122 #endif // define(OS_MACOSX) |
| 123 } | 123 } |
| 124 | 124 |
| 125 #if !defined(OFFICIAL_BUILD) | 125 #if !defined(OFFICIAL_BUILD) && !defined(NO_UNWIND_TABLES) |
| 126 // Disabled in Official builds, where Link-Time Optimization can result in two | 126 // Disabled in Official builds, where Link-Time Optimization can result in two |
| 127 // or fewer stack frames being available, causing the test to fail. | 127 // or fewer stack frames being available, causing the test to fail. |
| 128 TEST_F(StackTraceTest, TruncatedTrace) { | 128 TEST_F(StackTraceTest, TruncatedTrace) { |
| 129 StackTrace trace; | 129 StackTrace trace; |
| 130 | 130 |
| 131 size_t count = 0; | 131 size_t count = 0; |
| 132 trace.Addresses(&count); | 132 trace.Addresses(&count); |
| 133 ASSERT_LT(2u, count); | 133 ASSERT_LT(2u, count); |
| 134 | 134 |
| 135 StackTrace truncated(2); | 135 StackTrace truncated(2); |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 #endif | 312 #endif |
| 313 | 313 |
| 314 TEST_F(StackTraceTest, MAYBE_StackEnd) { | 314 TEST_F(StackTraceTest, MAYBE_StackEnd) { |
| 315 EXPECT_NE(0u, GetStackEnd()); | 315 EXPECT_NE(0u, GetStackEnd()); |
| 316 } | 316 } |
| 317 | 317 |
| 318 #endif // HAVE_TRACE_STACK_FRAME_POINTERS && !defined(OS_WIN) | 318 #endif // HAVE_TRACE_STACK_FRAME_POINTERS && !defined(OS_WIN) |
| 319 | 319 |
| 320 } // namespace debug | 320 } // namespace debug |
| 321 } // namespace base | 321 } // namespace base |
| OLD | NEW |