From ab9c6b1c6ab7c62a3fcc620d1eca7a24e0bad349 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Thu, 22 Jun 2023 18:01:25 -0700 Subject: [PATCH] Format parameter for MemtagNoteTest Test: atest bionic-unit-tests Change-Id: I8b8e6fb0146f600431cbf043cf212a69ecf6b648 --- tests/heap_tagging_level_test.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/heap_tagging_level_test.cpp b/tests/heap_tagging_level_test.cpp index 917be3786..a5abb7b2a 100644 --- a/tests/heap_tagging_level_test.cpp +++ b/tests/heap_tagging_level_test.cpp @@ -221,6 +221,8 @@ TEST(heap_tagging_level, tagging_level_transition_sync_none) { enum class MemtagNote { NONE, ASYNC, SYNC }; class MemtagNoteTest : public testing::TestWithParam> {}; +static const char* kNoteSuffix[] = {"disabled", "async", "sync"}; + TEST_P(MemtagNoteTest, SEGV) { #if defined(__BIONIC__) && defined(__aarch64__) SKIP_WITH_NATIVE_BRIDGE; // http://b/242170715 @@ -232,7 +234,6 @@ TEST_P(MemtagNoteTest, SEGV) { bool withHWASAN = __has_feature(hwaddress_sanitizer); bool withMTE = getauxval(AT_HWCAP2) & HWCAP2_MTE; - const char* kNoteSuffix[] = {"disabled", "async", "sync"}; const char* kExpectedOutputHWASAN[] = {".*tag-mismatch.*", ".*tag-mismatch.*", ".*tag-mismatch.*"}; // Note that we do not check the exact si_code of the "async" variant, as it may be auto-upgraded @@ -261,4 +262,10 @@ TEST_P(MemtagNoteTest, SEGV) { INSTANTIATE_TEST_SUITE_P(, MemtagNoteTest, testing::Combine(testing::Values(MemtagNote::NONE, MemtagNote::ASYNC, MemtagNote::SYNC), - testing::Bool())); + testing::Bool()), + [](const ::testing::TestParamInfo& info) { + MemtagNote note = std::get<0>(info.param); + std::string s = kNoteSuffix[static_cast(note)]; + if (std::get<1>(info.param)) s += "_static"; + return s; + });