summaryrefslogtreecommitdiff
path: root/runtime/class_linker_test.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2018-05-24 11:09:38 +0100
committer Vladimir Marko <vmarko@google.com> 2018-05-25 11:32:31 +0100
commitb4eb1b19e1dd35d12a408358656c1421f507d231 (patch)
tree03ba65d206b5e6222dcca0f62a973bcbb1bf8a50 /runtime/class_linker_test.cc
parentff7ff426e136aa8fd6e33d873f6259311982f6bb (diff)
Refactor ClassRoot/GetClassRoot().
Move it outside the ClassLinker, into its own header file, and add retrieval based on a mirror class template argument. Keep the SetClassRoot() as a private member of ClassLinker. Make the new GetClassRoot()s return ObjPtr<>. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: Icbc6b62b41f6ffd65b437297a21eadbb0454e2b7
Diffstat (limited to 'runtime/class_linker_test.cc')
-rw-r--r--runtime/class_linker_test.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc
index 6ed029ceb1..48ec6b6c27 100644
--- a/runtime/class_linker_test.cc
+++ b/runtime/class_linker_test.cc
@@ -25,6 +25,7 @@
#include "art_method-inl.h"
#include "base/enums.h"
#include "class_linker-inl.h"
+#include "class_root.h"
#include "common_runtime_test.h"
#include "dex/dex_file_types.h"
#include "dex/standard_dex_file.h"
@@ -1387,11 +1388,10 @@ TEST_F(ClassLinkerTest, FinalizableBit) {
TEST_F(ClassLinkerTest, ClassRootDescriptors) {
ScopedObjectAccess soa(Thread::Current());
std::string temp;
- for (int i = 0; i < ClassLinker::kClassRootsMax; i++) {
- ObjPtr<mirror::Class> klass = class_linker_->GetClassRoot(ClassLinker::ClassRoot(i));
+ for (size_t i = 0; i < static_cast<size_t>(ClassRoot::kMax); i++) {
+ ObjPtr<mirror::Class> klass = GetClassRoot(ClassRoot(i), class_linker_);
EXPECT_GT(strlen(klass->GetDescriptor(&temp)), 0U);
- EXPECT_STREQ(klass->GetDescriptor(&temp),
- class_linker_->GetClassRootDescriptor(ClassLinker::ClassRoot(i))) << " i = " << i;
+ EXPECT_STREQ(klass->GetDescriptor(&temp), GetClassRootDescriptor(ClassRoot(i))) << " i = " << i;
}
}