summaryrefslogtreecommitdiff
path: root/runtime/dex_file_test.cc
diff options
context:
space:
mode:
author Calin Juravle <calin@google.com> 2017-07-18 16:51:51 -0700
committer Calin Juravle <calin@google.com> 2017-07-18 17:02:27 -0700
commita308a327884920cbb1e3e62964c4b5a01c29af8c (patch)
tree4bd09065c52f18685dc9e10d9eabdcdb29a51539 /runtime/dex_file_test.cc
parentbacafb19fa654fb6c7ad610305bed45c2e4682e8 (diff)
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
Diffstat (limited to 'runtime/dex_file_test.cc')
-rw-r--r--runtime/dex_file_test.cc12
1 files changed, 6 insertions, 6 deletions
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) {