summaryrefslogtreecommitdiff
path: root/runtime/common_runtime_test.cc
diff options
context:
space:
mode:
author Przemyslaw Szczepaniak <pszczepaniak@google.com> 2015-09-30 14:40:33 +0100
committer Narayan Kamath <narayan@google.com> 2015-11-12 10:15:58 +0000
commit5b8e6e36e96d6d1921dd356fa46191d1e6a18082 (patch)
tree33d66d1cb3377447aa687ee4625c5826370d1e85 /runtime/common_runtime_test.cc
parentbe26f77dac06fb02b0cc80914b740662bf8d0b26 (diff)
Fix for gtest missing core classes, attempt 2
common_runtime_test loads both core-libart and core-oj Change-Id: I8a4d5750b99aed2e500cad89b841a57fe9c1ca69
Diffstat (limited to 'runtime/common_runtime_test.cc')
-rw-r--r--runtime/common_runtime_test.cc16
1 files changed, 12 insertions, 4 deletions
diff --git a/runtime/common_runtime_test.cc b/runtime/common_runtime_test.cc
index c299210461..15ef489037 100644
--- a/runtime/common_runtime_test.cc
+++ b/runtime/common_runtime_test.cc
@@ -197,8 +197,16 @@ void CommonRuntimeTest::SetUp() {
MemMap::Init(); // For LoadExpectSingleDexFile
std::string error_msg;
- java_lang_dex_file_ = LoadExpectSingleDexFile(GetLibCoreDexFileName().c_str());
- boot_class_path_.push_back(java_lang_dex_file_);
+
+ java_lang_dex_file_ = nullptr;
+ for (const std::string &core_dex_file_name : GetLibCoreDexFileNames()) {
+ const DexFile* dex_file = LoadExpectSingleDexFile(core_dex_file_name.c_str());
+ boot_class_path_.push_back(dex_file);
+ // Store the first dex file in java_lang_dex_file_
+ if (java_lang_dex_file_ == nullptr) {
+ java_lang_dex_file_ = dex_file;
+ }
+ }
std::string min_heap_string(StringPrintf("-Xms%zdm", gc::Heap::kDefaultInitialSize / MB));
std::string max_heap_string(StringPrintf("-Xmx%zdm", gc::Heap::kDefaultMaximumSize / MB));
@@ -283,8 +291,8 @@ void CommonRuntimeTest::TearDown() {
Runtime::Current()->GetHeap()->VerifyHeap(); // Check for heap corruption after the test
}
-std::string CommonRuntimeTest::GetLibCoreDexFileName() {
- return GetDexFileName("core-libart");
+std::vector<std::string> CommonRuntimeTest::GetLibCoreDexFileNames() {
+ return std::vector<std::string>({GetDexFileName("core-oj"), GetDexFileName("core-libart")});
}
std::string CommonRuntimeTest::GetDexFileName(const std::string& jar_prefix) {