From 43b3caaa018f9dd265ff47f756e07fb2bc7d1f2a Mon Sep 17 00:00:00 2001 From: Martin Stjernholm Date: Fri, 2 Sep 2022 21:33:04 +0100 Subject: [DO NOT MERGE] Make a CTS test more lenient to work with and without M-2022-10 ART module. Test: Download libnativeloader_test from android13-tests-dev and run with ART module at AOSP head. Bug: 244766714 Change-Id: Iccebb16398a409ece97d0d2fd8390538ef3c548c --- libnativeloader/native_loader_test.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'libnativeloader/native_loader_test.cpp') diff --git a/libnativeloader/native_loader_test.cpp b/libnativeloader/native_loader_test.cpp index 9648713e70..b1a7e3538a 100644 --- a/libnativeloader/native_loader_test.cpp +++ b/libnativeloader/native_loader_test.cpp @@ -379,9 +379,24 @@ TEST_P(NativeLoaderTest_Create, UnbundledProductApp) { expected_library_path = expected_library_path + ":/product/" LIB_DIR ":/system/product/" LIB_DIR; expected_permitted_path = expected_permitted_path + ":/product/" LIB_DIR ":/system/product/" LIB_DIR; - expected_shared_libs_to_platform_ns = - default_public_libraries() + ":" + llndk_libraries_product(); expected_link_with_vndk_product_ns = true; + + // The handling of extended libraries for product apps changed in the + // M-2022-10 release of the ART module (https://r.android.com/2194871). + // Since this test is in CTS for T, we need to accept both new and old + // behaviour, i.e. with and without the extended public libraries appended + // at the end. Skip the EXPECT_CALL in + // NativeLoaderTest_Create::SetExpectations and create a more lenient + // variant of it here. + expected_link_with_platform_ns = false; + expected_shared_libs_to_platform_ns = + expected_shared_libs_to_platform_ns + ":" + llndk_libraries_product(); + EXPECT_CALL(*mock, + mock_link_namespaces(Eq(IsBridged()), + _, + NsEq("system"), + ::testing::StartsWith(expected_shared_libs_to_platform_ns))) + .WillOnce(Return(true)); } SetExpectations(); RunTest(); -- cgit v1.2.3-59-g8ed1b