Make valgrind happy; just a test bug.
Change-Id: Ia9217517551546f3de695733adf33d1592bec0f2
diff --git a/src/common_test.h b/src/common_test.h
index b3fafe4..0456c35 100644
--- a/src/common_test.h
+++ b/src/common_test.h
@@ -222,7 +222,7 @@
int mkdir_result = mkdir(art_cache_.c_str(), 0700);
ASSERT_EQ(mkdir_result, 0);
- java_lang_dex_file_.reset(GetLibCoreDex());
+ java_lang_dex_file_.reset(DexFile::Open(GetLibCoreDexFileName(), ""));
std::string boot_class_path;
boot_class_path += "-Xbootclasspath:";
@@ -320,11 +320,6 @@
return std::string("/system/framework/core.jar");
}
- const DexFile* GetLibCoreDex() {
- std::string libcore_dex_file_name(GetLibCoreDexFileName());
- return DexFile::Open(libcore_dex_file_name, "");
- }
-
const DexFile* OpenTestDexFile(const char* name) {
CHECK(name != NULL);
std::string filename;
diff --git a/src/image_test.cc b/src/image_test.cc
index 950ca92..6976787 100644
--- a/src/image_test.cc
+++ b/src/image_test.cc
@@ -19,7 +19,7 @@
TEST_F(ImageTest, WriteRead) {
ScratchFile tmp_oat;
std::vector<const DexFile*> dex_files;
- dex_files.push_back(GetLibCoreDex());
+ dex_files.push_back(java_lang_dex_file_.get());
bool success_oat = OatWriter::Create(tmp_oat.GetFile(), NULL, dex_files, *compiler_.get());
ASSERT_TRUE(success_oat);
@@ -59,7 +59,7 @@
// lucky by pointers that happen to work referencing the earlier
// dex.
delete java_lang_dex_file_.release();
- UniquePtr<const DexFile> dex(GetLibCoreDex());
+ UniquePtr<const DexFile> dex(DexFile::Open(GetLibCoreDexFileName(), ""));
ASSERT_TRUE(dex.get() != NULL);
Runtime::Options options;