From a308a327884920cbb1e3e62964c4b5a01c29af8c Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Tue, 18 Jul 2017 16:51:51 -0700 Subject: Change kMultiDexSeparator from ':' to '!' The ':' separator is commonly used to separate class path elements. That means that we cannot easily encode multidex location in a classpath without complicating the parsing logic unnecessarily (e.g. when encoding classpaths in the oat file). For easy parsing and understanding kMultiDexSeparator and kClassPathSeparator should have different values. ':' is a wide spread classpath separator so this CL changes the value of kMultiDexSeparator to '!' which is also commonly used to denote an object inside a given container. Test: m test-art-host Bug: 38138251 Change-Id: I30995c553d9131478c6c071b27327df6d2de06a7 --- runtime/dex_file_test.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'runtime/dex_file_test.cc') diff --git a/runtime/dex_file_test.cc b/runtime/dex_file_test.cc index 78d5c5f4ba..1a73062068 100644 --- a/runtime/dex_file_test.cc +++ b/runtime/dex_file_test.cc @@ -535,9 +535,9 @@ TEST_F(DexFileTest, GetMultiDexLocation) { std::string dex_location_str = "/system/app/framework.jar"; const char* dex_location = dex_location_str.c_str(); ASSERT_EQ("/system/app/framework.jar", DexFile::GetMultiDexLocation(0, dex_location)); - ASSERT_EQ("/system/app/framework.jar:classes2.dex", + ASSERT_EQ("/system/app/framework.jar!classes2.dex", DexFile::GetMultiDexLocation(1, dex_location)); - ASSERT_EQ("/system/app/framework.jar:classes101.dex", + ASSERT_EQ("/system/app/framework.jar!classes101.dex", DexFile::GetMultiDexLocation(100, dex_location)); } @@ -563,11 +563,11 @@ TEST_F(DexFileTest, GetDexCanonicalLocation) { TEST(DexFileUtilsTest, GetBaseLocationAndMultiDexSuffix) { EXPECT_EQ("/foo/bar/baz.jar", DexFile::GetBaseLocation("/foo/bar/baz.jar")); - EXPECT_EQ("/foo/bar/baz.jar", DexFile::GetBaseLocation("/foo/bar/baz.jar:classes2.dex")); - EXPECT_EQ("/foo/bar/baz.jar", DexFile::GetBaseLocation("/foo/bar/baz.jar:classes8.dex")); + EXPECT_EQ("/foo/bar/baz.jar", DexFile::GetBaseLocation("/foo/bar/baz.jar!classes2.dex")); + EXPECT_EQ("/foo/bar/baz.jar", DexFile::GetBaseLocation("/foo/bar/baz.jar!classes8.dex")); EXPECT_EQ("", DexFile::GetMultiDexSuffix("/foo/bar/baz.jar")); - EXPECT_EQ(":classes2.dex", DexFile::GetMultiDexSuffix("/foo/bar/baz.jar:classes2.dex")); - EXPECT_EQ(":classes8.dex", DexFile::GetMultiDexSuffix("/foo/bar/baz.jar:classes8.dex")); + EXPECT_EQ("!classes2.dex", DexFile::GetMultiDexSuffix("/foo/bar/baz.jar!classes2.dex")); + EXPECT_EQ("!classes8.dex", DexFile::GetMultiDexSuffix("/foo/bar/baz.jar!classes8.dex")); } TEST_F(DexFileTest, ZipOpenClassesPresent) { -- cgit v1.2.3-59-g8ed1b