Make the RuntimeTest use Runtime instances instead of its constituents.
Change-Id: I1005f279259917ff07d24e3bcd3643992ec8e3bd
diff --git a/src/common_test.h b/src/common_test.h
index e7b4f30..237939b 100644
--- a/src/common_test.h
+++ b/src/common_test.h
@@ -173,25 +173,19 @@
class RuntimeTest : public testing::Test {
protected:
virtual void SetUp() {
- ASSERT_TRUE(Thread::Init());
- ASSERT_TRUE(Thread::Attach() != NULL);
- ASSERT_TRUE(Heap::Init());
-
java_lang_dex_file_.reset(OpenDexFileBase64(kJavaLangDex));
std::vector<DexFile*> boot_class_path;
boot_class_path.push_back(java_lang_dex_file_.get());
- class_linker_.reset(ClassLinker::Create(boot_class_path));
- CHECK(class_linker_ != NULL);
- }
-
- virtual void TearDown() {
- Heap::Destroy();
+ runtime_.reset(Runtime::Create(boot_class_path));
+ ASSERT_TRUE(runtime_ != NULL);
+ class_linker_ = runtime_->GetClassLinker();
}
scoped_ptr<DexFile> java_lang_dex_file_;
- scoped_ptr<ClassLinker> class_linker_;
+ scoped_ptr<Runtime> runtime_;
+ ClassLinker* class_linker_;
};
} // namespace art