Move scopeguard into android::base
Test: boot bullhead, bionic unit tests
Change-Id: I223249684867655ecb53713b10da41d3014f96ae
diff --git a/tests/dlfcn_test.cpp b/tests/dlfcn_test.cpp
index ad8444e..4ff324e 100644
--- a/tests/dlfcn_test.cpp
+++ b/tests/dlfcn_test.cpp
@@ -22,11 +22,11 @@
#include <stdint.h>
#include <string.h>
-#include "private/ScopeGuard.h"
-
#include <string>
#include <thread>
+#include <android-base/scopeguard.h>
+
#include "gtest_globals.h"
#include "dlfcn_symlink_support.h"
#include "utils.h"
@@ -330,9 +330,7 @@
// in both dt_needed libraries, the correct relocation should
// use the function defined in libtest_relo_check_dt_needed_order_1.so
void* handle = nullptr;
- auto guard = make_scope_guard([&]() {
- dlclose(handle);
- });
+ auto guard = android::base::make_scope_guard([&]() { dlclose(handle); });
handle = dlopen("libtest_relo_check_dt_needed_order.so", RTLD_NOW);
ASSERT_TRUE(handle != nullptr) << dlerror();
@@ -986,9 +984,7 @@
dlerror(); // Clear any pending errors.
void* handle = dlopen("libgnu-hash-table-library.so", RTLD_NOW);
ASSERT_TRUE(handle != nullptr) << dlerror();
- auto guard = make_scope_guard([&]() {
- dlclose(handle);
- });
+ auto guard = android::base::make_scope_guard([&]() { dlclose(handle); });
void* sym = dlsym(handle, "getRandomNumber");
ASSERT_TRUE(sym != nullptr) << dlerror();
int (*fn)(void);
@@ -1009,9 +1005,7 @@
TEST(dlfcn, dlopen_library_with_only_sysv_hash) {
void* handle = dlopen("libsysv-hash-table-library.so", RTLD_NOW);
ASSERT_TRUE(handle != nullptr) << dlerror();
- auto guard = make_scope_guard([&]() {
- dlclose(handle);
- });
+ auto guard = android::base::make_scope_guard([&]() { dlclose(handle); });
void* sym = dlsym(handle, "getRandomNumber");
ASSERT_TRUE(sym != nullptr) << dlerror();
int (*fn)(void);