diff options
author | Ryan Prichard <rprichard@google.com> | 2024-03-16 01:18:19 -0700 |
---|---|---|
committer | Ryan Prichard <rprichard@google.com> | 2024-03-16 01:18:36 -0700 |
commit | 0aa5cee99136b9ff5137e51981576529fbd6f00e (patch) | |
tree | 1e15a5eeb169c2c909eb89f8925d1fe275f9871d | |
parent | fb76a84de4ad61b62bdc92cbd179cfa07b5a66bb (diff) | |
download | unwinding-0aa5cee99136b9ff5137e51981576529fbd6f00e.tar.gz |
UnwindOfflineTest: replace "> >" with ">>"
Accept either output from the C++ demangler (__cxa_demangle):
* Foo<Bar<Baz> >
* Foo<Bar<Baz>>
Bug: 175635923
Bug: 329940638
Test: libunwindstack_unit_test
Change-Id: I4277e73e8a3f7010b6e72d7ab30a6931d767e0eb
-rw-r--r-- | libunwindstack/tests/UnwindOfflineTest.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libunwindstack/tests/UnwindOfflineTest.cpp b/libunwindstack/tests/UnwindOfflineTest.cpp index 7f7dee3..f8ee566 100644 --- a/libunwindstack/tests/UnwindOfflineTest.cpp +++ b/libunwindstack/tests/UnwindOfflineTest.cpp @@ -16,6 +16,7 @@ #include <sys/mman.h> +#include <android-base/strings.h> #include <gtest/gtest.h> #include <cstddef> @@ -88,6 +89,15 @@ class UnwindOfflineTest : public ::testing::Test { std::string actual_frame_info = DumpFrames(unwinder); ASSERT_EQ(expected_num_frames, unwinder.NumFrames()) << "Unwind:\n" << actual_frame_info; + + // The old demangler in external/libcxx adds an extra space when closing + // multiple sets of template args (e.g. "Foo<Bar<Baz> >"), but the new + // libc++ demangler omits it. Replace "> >" with ">>" to work with either + // demangler until libc++ is upgraded. + // TODO(b/329940638). Remove this workaround and fix the tests. + actual_frame_info = android::base::StringReplace(actual_frame_info, "> >", ">>", true); + expected_frame_info = android::base::StringReplace(expected_frame_info, "> >", ">>", true); + EXPECT_EQ(expected_frame_info, actual_frame_info); } } |