Merge "Add test for empty symbol lookup" am: 22ef13ff9d

am: c0c74cb7dd

Change-Id: Ia51b0d333f381996cad50a1223805b4cc80377e2
This commit is contained in:
Dimitry Ivanov 2016-12-15 18:41:16 +00:00 committed by android-build-merger
commit b54a98abd2

View file

@ -172,6 +172,16 @@ TEST(dlfcn, dlsym_handle_global_sym) {
dlclose(handle);
}
TEST(dlfcn, dlsym_handle_empty_symbol) {
// check that dlsym of an empty symbol fails (see http://b/33530622)
void* handle = dlopen("libtest_dlsym_from_this.so", RTLD_NOW);
ASSERT_TRUE(handle != nullptr) << dlerror();
void* sym = dlsym(handle, "");
ASSERT_TRUE(sym == nullptr);
ASSERT_SUBSTR("undefined symbol: ", dlerror());
dlclose(handle);
}
TEST(dlfcn, dlsym_with_dependencies) {
void* handle = dlopen("libtest_with_dependency.so", RTLD_NOW);
ASSERT_TRUE(handle != nullptr);