summaryrefslogtreecommitdiff
path: root/tests/dlext_test.cpp
diff options
context:
space:
mode:
authorSteven Laver <lavers@google.com>2019-11-14 08:37:29 -0800
committerSteven Laver <lavers@google.com>2019-11-14 08:37:29 -0800
commit8f54dd5edaa4ba55451f3602e5890b6f1ab807e6 (patch)
tree709208dd25e59100a8d3d9a7038a5c7ee1c8a50b /tests/dlext_test.cpp
parent19c0c9cd4892927004dac3252b67aac89e462c5c (diff)
parentcb88137aebba97024bee4fff130f131924556ee5 (diff)
Merge RP1A.191114.001
Change-Id: I19fb768a647d471d430af4b5c3f519d4125fdeee
Diffstat (limited to 'tests/dlext_test.cpp')
-rw-r--r--tests/dlext_test.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/dlext_test.cpp b/tests/dlext_test.cpp
index e98d66ffd..7e772b840 100644
--- a/tests/dlext_test.cpp
+++ b/tests/dlext_test.cpp
@@ -28,6 +28,7 @@
#include <android/dlext.h>
#include <android-base/file.h>
#include <android-base/strings.h>
+#include <android-base/test_utils.h>
#include <sys/mman.h>
#include <sys/types.h>
@@ -1374,7 +1375,10 @@ TEST(dlext, ns_isolated) {
void* handle2 = android_dlopen_ext(root_lib, RTLD_NOW, &extinfo);
ASSERT_TRUE(handle2 == nullptr);
- ASSERT_STREQ("dlopen failed: library \"libnstest_private_external.so\" not found", dlerror());
+ const char* error = dlerror();
+ ASSERT_MATCH(error,
+ R"(dlopen failed: library "libnstest_private_external.so" not found: needed by )"
+ R"(\S+libnstest_root_not_isolated.so in namespace private_isolated1)");
// Check dlopen by absolute path
handle2 = android_dlopen_ext(lib_private_external_path.c_str(), RTLD_NOW, &extinfo);
@@ -1502,7 +1506,9 @@ TEST(dlext, ns_shared) {
void* handle2 = android_dlopen_ext(root_lib, RTLD_NOW, &extinfo);
ASSERT_TRUE(handle2 == nullptr);
- ASSERT_STREQ("dlopen failed: library \"libnstest_private_external.so\" not found", dlerror());
+ ASSERT_MATCH(dlerror(),
+ R"(dlopen failed: library "libnstest_private_external.so" not found: needed by )"
+ R"(\S+libnstest_root_not_isolated.so in namespace private_isolated_shared)");
// Check dlopen by absolute path
handle2 = android_dlopen_ext(lib_private_external_path.c_str(), RTLD_NOW, &extinfo);
@@ -1762,7 +1768,10 @@ TEST(dlext, ns_isolated_rtld_global) {
handle1 = android_dlopen_ext(root_lib, RTLD_NOW, &extinfo);
ASSERT_TRUE(handle1 == nullptr);
- ASSERT_STREQ("dlopen failed: library \"libnstest_public.so\" not found", dlerror());
+ ASSERT_MATCH(
+ dlerror(),
+ R"(dlopen failed: library "libnstest_public.so" not found: needed by \S+libnstest_root.so)"
+ R"( in namespace isolated2)");
}
TEST(dlext, ns_inaccessible_error_message) {