summaryrefslogtreecommitdiff
path: root/runtime/class_linker_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/class_linker_test.cc')
-rw-r--r--runtime/class_linker_test.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc
index ef851910bf..c677601c0d 100644
--- a/runtime/class_linker_test.cc
+++ b/runtime/class_linker_test.cc
@@ -1528,13 +1528,10 @@ TEST_F(ClassLinkerTest, RegisterDexFileName) {
}
ASSERT_TRUE(dex_cache != nullptr);
}
- // Make a copy of the dex cache and change the name.
- dex_cache.Assign(mirror::Object::Clone(dex_cache, soa.Self())->AsDexCache());
const uint16_t data[] = { 0x20AC, 0x20A1 };
Handle<mirror::String> location(hs.NewHandle(mirror::String::AllocFromUtf16(soa.Self(),
arraysize(data),
data)));
- dex_cache->SetLocation(location.Get());
const DexFile* old_dex_file = dex_cache->GetDexFile();
std::unique_ptr<DexFile> dex_file(new StandardDexFile(old_dex_file->Begin(),
@@ -1543,6 +1540,10 @@ TEST_F(ClassLinkerTest, RegisterDexFileName) {
0u,
nullptr,
nullptr));
+ // Make a copy of the dex cache with changed name.
+ LinearAlloc* alloc = Runtime::Current()->GetLinearAlloc();
+ dex_cache.Assign(class_linker->AllocAndInitializeDexCache(Thread::Current(), *dex_file, alloc));
+ DCHECK_EQ(dex_cache->GetLocation()->CompareTo(location.Get()), 0);
{
WriterMutexLock mu(soa.Self(), *Locks::dex_lock_);
// Check that inserting with a UTF16 name works.