summaryrefslogtreecommitdiffstats
path: root/runtime/class_linker_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/class_linker_test.cc')
-rw-r--r--runtime/class_linker_test.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc
index 3e727e7408..3f6c5a0ac2 100644
--- a/runtime/class_linker_test.cc
+++ b/runtime/class_linker_test.cc
@@ -358,7 +358,8 @@ class ClassLinkerTest : public CommonRuntimeTest {
const char* descriptor = dex.GetTypeDescriptor(type_id);
AssertDexFileClass(class_loader, descriptor);
}
- class_linker_->VisitRoots(TestRootVisitor, nullptr, kVisitRootFlagAllRoots);
+ TestRootVisitor visitor;
+ class_linker_->VisitRoots(&visitor, kVisitRootFlagAllRoots);
// Verify the dex cache has resolution methods in all resolved method slots
mirror::DexCache* dex_cache = class_linker_->FindDexCache(dex);
mirror::ObjectArray<mirror::ArtMethod>* resolved_methods = dex_cache->GetResolvedMethods();
@@ -367,9 +368,12 @@ class ClassLinkerTest : public CommonRuntimeTest {
}
}
- static void TestRootVisitor(mirror::Object** root, void*, const RootInfo&) {
- EXPECT_TRUE(*root != nullptr);
- }
+ class TestRootVisitor : public SingleRootVisitor {
+ public:
+ void VisitRoot(mirror::Object* root, const RootInfo& info ATTRIBUTE_UNUSED) OVERRIDE {
+ EXPECT_TRUE(root != nullptr);
+ }
+ };
};
struct CheckOffset {