From 739fbefe2df8a9dead4cb08f57b484861e41814d Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Sat, 24 Sep 2022 18:07:38 -0700 Subject: [PATCH] Fix out-of-memory error. Bug: 248637663 Test: atest android.hardware.audio.common@7.0-util_tests android.hardware.audio.common@7.1-util_tests Change-Id: Ifb41ddc3fbfa8c9db7f3e10cede2155d28d3c8c4 --- .../common/all-versions/default/tests/hidlutils_tests.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/audio/common/all-versions/default/tests/hidlutils_tests.cpp b/audio/common/all-versions/default/tests/hidlutils_tests.cpp index e5ed8449d9..83bb8a994e 100644 --- a/audio/common/all-versions/default/tests/hidlutils_tests.cpp +++ b/audio/common/all-versions/default/tests/hidlutils_tests.cpp @@ -1105,8 +1105,12 @@ TYPED_TEST(FilterTest, FilterOutNonVendorTags) { TypeParam emptyTags; EXPECT_EQ(emptyTags, HidlUtils::filterOutNonVendorTags(emptyTags)); - TypeParam allVendorTags = {{"VX_GOOGLE_VR_42", "VX_GOOGLE_1E100"}}; - EXPECT_EQ(allVendorTags, HidlUtils::filterOutNonVendorTags(allVendorTags)); + // b/248421569, allocate two vendor tags at a time can run out of memory + // TypeParam allVendorTags = {{"VX_GOOGLE_VR_42", "VX_GOOGLE_1E100"}}; + TypeParam allVendorTags1 = {{"VX_GOOGLE_VR_42"}}; + EXPECT_EQ(allVendorTags1, HidlUtils::filterOutNonVendorTags(allVendorTags1)); + TypeParam allVendorTags2 = {{"VX_GOOGLE_1E100"}}; + EXPECT_EQ(allVendorTags2, HidlUtils::filterOutNonVendorTags(allVendorTags2)); TypeParam oneVendorTag = {{"", "VX_GOOGLE_VR", "random_string"}}; TypeParam oneVendorTagOnly = HidlUtils::filterOutNonVendorTags(oneVendorTag);