From 5af718b8bcbbaa8864b85aa635eb3d2187247c20 Mon Sep 17 00:00:00 2001 From: Martin Stjernholm Date: Wed, 24 Aug 2022 23:17:09 +0100 Subject: Fix UnbundledProductApp test to allow extendend public libraries. This fixes the test to conform with the change in https://r.android.com/2165025. The test only broke on devices that do have extended public libraries, in particular wembley. Test: atest libnativeloader_test Bug: 242016740 Bug: 237572732 Change-Id: I1400a701a622f9f35b3ce0781575134faca679ae --- libnativeloader/native_loader_test.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'libnativeloader/native_loader_test.cpp') diff --git a/libnativeloader/native_loader_test.cpp b/libnativeloader/native_loader_test.cpp index 85cb36d540..7bf4cb754a 100644 --- a/libnativeloader/native_loader_test.cpp +++ b/libnativeloader/native_loader_test.cpp @@ -167,13 +167,16 @@ INSTANTIATE_TEST_SUITE_P(NativeLoaderTests, NativeLoaderTest, testing::Bool()); ///////////////////////////////////////////////////////////////// -std::string default_public_and_extended_libraries() { - std::string public_libs = default_public_libraries(); +std::string append_extended_libraries(const std::string& libs) { const std::string& ext_libs = extended_public_libraries(); if (!ext_libs.empty()) { - public_libs = public_libs + ":" + ext_libs; + return libs + ":" + ext_libs; } - return public_libs; + return libs; +} + +std::string default_public_and_extended_libraries() { + return append_extended_libraries(default_public_libraries()); } class NativeLoaderTest_Create : public NativeLoaderTest { @@ -380,7 +383,7 @@ TEST_P(NativeLoaderTest_Create, UnbundledProductApp) { 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(); + append_extended_libraries(default_public_libraries() + ":" + llndk_libraries_product()); expected_link_with_vndk_product_ns = true; } SetExpectations(); -- cgit v1.2.3-59-g8ed1b