diff options
Diffstat (limited to 'libnativeloader/native_loader_test.cpp')
-rw-r--r-- | libnativeloader/native_loader_test.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/libnativeloader/native_loader_test.cpp b/libnativeloader/native_loader_test.cpp index 3ce3ca9573..7fdb0c08e3 100644 --- a/libnativeloader/native_loader_test.cpp +++ b/libnativeloader/native_loader_test.cpp @@ -38,6 +38,12 @@ using ::testing::_; using internal::ConfigEntry; using internal::ParseConfig; +#if defined(__LP64__) +#define LIB_DIR "lib64" +#else +#define LIB_DIR "lib" +#endif + // gmock interface that represents interested platform APIs on libdl and libnativebridge class Platform { public: @@ -331,8 +337,8 @@ class NativeLoaderTest_Create : public NativeLoaderTest { std::string class_loader = "my_classloader"; bool is_shared = false; std::string dex_path = "/data/app/foo/classes.dex"; - std::string library_path = "/data/app/foo/lib/arm"; - std::string permitted_path = "/data/app/foo/lib"; + std::string library_path = "/data/app/foo/" LIB_DIR "/arm"; + std::string permitted_path = "/data/app/foo/" LIB_DIR; // expected output (.. for the default test inputs) std::string expected_namespace_name = "classloader-namespace"; @@ -457,8 +463,8 @@ TEST_P(NativeLoaderTest_Create, UnbundledVendorApp) { is_shared = false; expected_namespace_name = "vendor-classloader-namespace"; - expected_library_path = expected_library_path + ":/vendor/lib"; - expected_permitted_path = expected_permitted_path + ":/vendor/lib"; + expected_library_path = expected_library_path + ":/vendor/" LIB_DIR; + expected_permitted_path = expected_permitted_path + ":/vendor/" LIB_DIR; expected_shared_libs_to_platform_ns = expected_shared_libs_to_platform_ns + ":" + llndk_libraries(); expected_link_with_vndk_ns = true; @@ -498,8 +504,9 @@ TEST_P(NativeLoaderTest_Create, UnbundledProductApp_post30) { target_sdk_version = 30; expected_namespace_name = "vendor-classloader-namespace"; - expected_library_path = expected_library_path + ":/product/lib:/system/product/lib"; - expected_permitted_path = expected_permitted_path + ":/product/lib:/system/product/lib"; + 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 = expected_shared_libs_to_platform_ns + ":" + llndk_libraries(); expected_link_with_vndk_ns = true; @@ -529,8 +536,8 @@ TEST_P(NativeLoaderTest_Create, TwoApks) { const std::string second_app_class_loader = "second_app_classloader"; const bool second_app_is_shared = false; const std::string second_app_dex_path = "/data/app/bar/classes.dex"; - const std::string second_app_library_path = "/data/app/bar/lib/arm"; - const std::string second_app_permitted_path = "/data/app/bar/lib"; + const std::string second_app_library_path = "/data/app/bar/" LIB_DIR "/arm"; + const std::string second_app_permitted_path = "/data/app/bar/" LIB_DIR; const std::string expected_second_app_permitted_path = std::string("/data:/mnt/expand:") + second_app_permitted_path; const std::string expected_second_app_parent_namespace = "classloader-namespace"; |