Merge "Format parameter for MemtagNoteTest" am: 8d21eac241 am: 6982631986 am: b8e77f0c78 am: ef35880271 am: 995ff22fe9 am: e97188194d

Original change: https://android-review.googlesource.com/c/platform/bionic/+/2636750

Change-Id: If5ad7e7aed555fba2e646629f425fde0f63cddad
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2023-06-24 00:10:18 +00:00 committed by Automerger Merge Worker
commit 87bcf9961f

View file

@ -221,6 +221,8 @@ TEST(heap_tagging_level, tagging_level_transition_sync_none) {
enum class MemtagNote { NONE, ASYNC, SYNC };
class MemtagNoteTest : public testing::TestWithParam<std::tuple<MemtagNote, bool>> {};
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<MemtagNoteTest::ParamType>& info) {
MemtagNote note = std::get<0>(info.param);
std::string s = kNoteSuffix[static_cast<int>(note)];
if (std::get<1>(info.param)) s += "_static";
return s;
});