diff options
author | 2017-08-03 17:07:13 +0000 | |
---|---|---|
committer | 2017-08-03 17:07:13 +0000 | |
commit | cda934e3f8c24d76cc3b1b64e24dd9b865cb500f (patch) | |
tree | ab8b7b8539a7f3fafc56a42242bf88ac3653441a /runtime/class_loader_context_test.cc | |
parent | 9a19be9c170e094c3e5ef991d018b476008112c5 (diff) | |
parent | 84f82b9972ec29bd05b1575ae6d638255be2f285 (diff) |
Merge changes Iba4cb348,I51c43230,Iae90c4a1,Ica43ee8a
* changes:
Stop using the runtime classpath in dex2oat
Do not pass --runtime-arg -classpath in dex2oat_test
Do not pass --runtime-arg -classpath to dex2oat in dex fuzz
Pass the class loader context to dex2oat when optimizing at runtime
Diffstat (limited to 'runtime/class_loader_context_test.cc')
-rw-r--r-- | runtime/class_loader_context_test.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/runtime/class_loader_context_test.cc b/runtime/class_loader_context_test.cc index 2b85188e38..d4688c1904 100644 --- a/runtime/class_loader_context_test.cc +++ b/runtime/class_loader_context_test.cc @@ -455,6 +455,20 @@ TEST_F(ClassLoaderContextTest, EncodeInOatFile) { ASSERT_EQ(expected_encoding, context->EncodeContextForOatFile("")); } +TEST_F(ClassLoaderContextTest, EncodeForDex2oat) { + std::string dex1_name = GetTestDexFileName("Main"); + std::string dex2_name = GetTestDexFileName("MultiDex"); + std::unique_ptr<ClassLoaderContext> context = + ClassLoaderContext::Create("PCL[" + dex1_name + ":" + dex2_name + "]"); + ASSERT_TRUE(context->OpenDexFiles(InstructionSet::kArm, "")); + + std::vector<std::unique_ptr<const DexFile>> dex1 = OpenTestDexFiles("Main"); + std::vector<std::unique_ptr<const DexFile>> dex2 = OpenTestDexFiles("MultiDex"); + std::string encoding = context->EncodeContextForDex2oat(""); + std::string expected_encoding = "PCL[" + dex1_name + ":" + dex2_name + "]"; + ASSERT_EQ(expected_encoding, context->EncodeContextForDex2oat("")); +} + // TODO(calin) add a test which creates the context for a class loader together with dex_elements. TEST_F(ClassLoaderContextTest, CreateContextForClassLoader) { // The chain is |