summaryrefslogtreecommitdiff
path: root/runtime/common_runtime_test.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2016-10-28 14:45:48 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2016-10-29 22:09:28 +0100
commitd01f60cbed4ba360b84f1310d2e0d422d6a16534 (patch)
treed9511ce632d9ae32a0447a9bfd50c1cb8821fcbf /runtime/common_runtime_test.cc
parentb9b8cab87a275fad382fefbddd18daf495a58772 (diff)
Add a VerifierDeps::Dump method.
Also, fix the Encode/Decode logic around dex file order: iterating over a std::map doesn't guarantee insertion order. test: verifier_deps_test bug: 30937355 Change-Id: Id3efd703b3c8ca21ab49c2600c612c132fb021cd
Diffstat (limited to 'runtime/common_runtime_test.cc')
-rw-r--r--runtime/common_runtime_test.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/runtime/common_runtime_test.cc b/runtime/common_runtime_test.cc
index 5409fcbf2f..d929812d57 100644
--- a/runtime/common_runtime_test.cc
+++ b/runtime/common_runtime_test.cc
@@ -572,6 +572,29 @@ const DexFile* CommonRuntimeTestImpl::GetFirstDexFile(jobject jclass_loader) {
return ret;
}
+jobject CommonRuntimeTestImpl::LoadMultiDex(const char* first_dex_name,
+ const char* second_dex_name) {
+ std::vector<std::unique_ptr<const DexFile>> first_dex_files = OpenTestDexFiles(first_dex_name);
+ std::vector<std::unique_ptr<const DexFile>> second_dex_files = OpenTestDexFiles(second_dex_name);
+ std::vector<const DexFile*> class_path;
+ CHECK_NE(0U, first_dex_files.size());
+ CHECK_NE(0U, second_dex_files.size());
+ for (auto& dex_file : first_dex_files) {
+ class_path.push_back(dex_file.get());
+ loaded_dex_files_.push_back(std::move(dex_file));
+ }
+ for (auto& dex_file : second_dex_files) {
+ class_path.push_back(dex_file.get());
+ loaded_dex_files_.push_back(std::move(dex_file));
+ }
+
+ Thread* self = Thread::Current();
+ jobject class_loader = Runtime::Current()->GetClassLinker()->CreatePathClassLoader(self,
+ class_path);
+ self->SetClassLoaderOverride(class_loader);
+ return class_loader;
+}
+
jobject CommonRuntimeTestImpl::LoadDex(const char* dex_name) {
std::vector<std::unique_ptr<const DexFile>> dex_files = OpenTestDexFiles(dex_name);
std::vector<const DexFile*> class_path;