Remove obsolete test_isolated wrapper function
We already run all of our tests in isolated mode.
Change-Id: I8236baa302b1026a9b4a1c33a4aa65e223771bc7
diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp
index 3b1001a..dfb5e54 100644
--- a/tests/dlfcn_test.cpp
+++ b/tests/dlfcn_test.cpp
@@ -22,7 +22,6 @@
#include <stdio.h>
#include <stdint.h>
-#include "gtest_ex.h"
#include "private/ScopeGuard.h"
#include <string>
@@ -376,33 +375,31 @@
// Test dlopens parent1 which loads and relocates libtest_two_parents_child.so
// as a second step it dlopens parent2 and dlcloses parent1...
- test_isolated([] {
- void* handle = dlopen("libtest_two_parents_parent1.so", RTLD_NOW | RTLD_LOCAL);
- ASSERT_TRUE(handle != nullptr) << dlerror();
+ void* handle = dlopen("libtest_two_parents_parent1.so", RTLD_NOW | RTLD_LOCAL);
+ ASSERT_TRUE(handle != nullptr) << dlerror();
- void* handle2 = dlopen("libtest_two_parents_parent2.so", RTLD_NOW | RTLD_LOCAL);
- ASSERT_TRUE(handle2 != nullptr) << dlerror();
+ void* handle2 = dlopen("libtest_two_parents_parent2.so", RTLD_NOW | RTLD_LOCAL);
+ ASSERT_TRUE(handle2 != nullptr) << dlerror();
- typedef int (*fn_t) (void);
- fn_t fn = reinterpret_cast<fn_t>(dlsym(handle2, "check_order_reloc_get_answer"));
- ASSERT_TRUE(fn != nullptr) << dlerror();
- ASSERT_EQ(42, fn());
+ typedef int (*fn_t) (void);
+ fn_t fn = reinterpret_cast<fn_t>(dlsym(handle2, "check_order_reloc_get_answer"));
+ ASSERT_TRUE(fn != nullptr) << dlerror();
+ ASSERT_EQ(42, fn());
- ASSERT_EQ(0, dlclose(handle));
+ ASSERT_EQ(0, dlclose(handle));
- handle = dlopen("libtest_two_parents_parent1.so", RTLD_NOW | RTLD_LOCAL | RTLD_NOLOAD);
- ASSERT_TRUE(handle != nullptr);
- ASSERT_EQ(0, dlclose(handle));
+ handle = dlopen("libtest_two_parents_parent1.so", RTLD_NOW | RTLD_LOCAL | RTLD_NOLOAD);
+ ASSERT_TRUE(handle != nullptr);
+ ASSERT_EQ(0, dlclose(handle));
- fn = reinterpret_cast<fn_t>(dlsym(handle2, "check_order_reloc_get_answer"));
- ASSERT_TRUE(fn != nullptr) << dlerror();
- ASSERT_EQ(42, fn());
+ fn = reinterpret_cast<fn_t>(dlsym(handle2, "check_order_reloc_get_answer"));
+ ASSERT_TRUE(fn != nullptr) << dlerror();
+ ASSERT_EQ(42, fn());
- ASSERT_EQ(0, dlclose(handle2));
+ ASSERT_EQ(0, dlclose(handle2));
- handle = dlopen("libtest_two_parents_parent1.so", RTLD_NOW | RTLD_LOCAL | RTLD_NOLOAD);
- ASSERT_TRUE(handle == nullptr);
- });
+ handle = dlopen("libtest_two_parents_parent1.so", RTLD_NOW | RTLD_LOCAL | RTLD_NOLOAD);
+ ASSERT_TRUE(handle == nullptr);
}
extern "C" int check_order_reloc_root_get_answer_impl() {
@@ -485,25 +482,23 @@
// libtest_with_dependency_loop_b.so -> libtest_with_dependency_loop_c.so ->
// libtest_with_dependency_loop_a.so
TEST(dlfcn, dlopen_check_loop) {
- test_isolated([] {
- void* handle = dlopen("libtest_with_dependency_loop.so", RTLD_NOW);
- ASSERT_TRUE(handle != nullptr) << dlerror();
- void* f = dlsym(handle, "dlopen_test_loopy_function");
- ASSERT_TRUE(f != nullptr) << dlerror();
- EXPECT_TRUE(reinterpret_cast<bool (*)(void)>(f)());
- ASSERT_EQ(0, dlclose(handle));
+ void* handle = dlopen("libtest_with_dependency_loop.so", RTLD_NOW);
+ ASSERT_TRUE(handle != nullptr) << dlerror();
+ void* f = dlsym(handle, "dlopen_test_loopy_function");
+ ASSERT_TRUE(f != nullptr) << dlerror();
+ EXPECT_TRUE(reinterpret_cast<bool (*)(void)>(f)());
+ ASSERT_EQ(0, dlclose(handle));
- // dlopen second time to make sure that the library was unloaded correctly
- handle = dlopen("libtest_with_dependency_loop.so", RTLD_NOW | RTLD_NOLOAD);
- ASSERT_TRUE(handle == nullptr);
+ // dlopen second time to make sure that the library was unloaded correctly
+ handle = dlopen("libtest_with_dependency_loop.so", RTLD_NOW | RTLD_NOLOAD);
+ ASSERT_TRUE(handle == nullptr);
#ifdef __BIONIC__
- // TODO: glibc returns nullptr on dlerror() here. Is it bug?
- ASSERT_STREQ("dlopen failed: library \"libtest_with_dependency_loop.so\" wasn't loaded and RTLD_NOLOAD prevented it", dlerror());
+ // TODO: glibc returns nullptr on dlerror() here. Is it bug?
+ ASSERT_STREQ("dlopen failed: library \"libtest_with_dependency_loop.so\" wasn't loaded and RTLD_NOLOAD prevented it", dlerror());
#endif
- handle = dlopen("libtest_with_dependency_a.so", RTLD_NOW | RTLD_NOLOAD);
- ASSERT_TRUE(handle == nullptr);
- });
+ handle = dlopen("libtest_with_dependency_a.so", RTLD_NOW | RTLD_NOLOAD);
+ ASSERT_TRUE(handle == nullptr);
}
TEST(dlfcn, dlopen_nodelete) {
@@ -830,15 +825,13 @@
}
TEST(dlfcn, dlopen_undefined_weak_func) {
- test_isolated([] {
- void* handle = dlopen("libtest_dlopen_weak_undefined_func.so", RTLD_NOW);
- ASSERT_TRUE(handle != nullptr) << dlerror();
- int (*weak_func)();
- weak_func = reinterpret_cast<int (*)()>(dlsym(handle, "use_weak_undefined_func"));
- ASSERT_TRUE(weak_func != nullptr) << dlerror();
- EXPECT_EQ(6551, weak_func());
- dlclose(handle);
- });
+ void* handle = dlopen("libtest_dlopen_weak_undefined_func.so", RTLD_NOW);
+ ASSERT_TRUE(handle != nullptr) << dlerror();
+ int (*weak_func)();
+ weak_func = reinterpret_cast<int (*)()>(dlsym(handle, "use_weak_undefined_func"));
+ ASSERT_TRUE(weak_func != nullptr) << dlerror();
+ EXPECT_EQ(6551, weak_func());
+ dlclose(handle);
}
TEST(dlfcn, dlopen_symlink) {