Use instruction specific dalvik cache dirs.
- All oat & art files are now placed under /data/dalvik-cache/<isa>/.
- GetDalvikCacheOrDie now requires a mandatory subdirectory argument,
and is implicitly rooted under /data/.
- Added helper methods to convert InstructionSet enums into strings
and vice versa.
(cherry picked from commit 2974bc3d8a5d161d449dd66826d668d87bdc3cbe)
Change-Id: Ic7986938e6a7091a2af675ebafec768f7b5fb8cd
diff --git a/runtime/utils_test.cc b/runtime/utils_test.cc
index 2c1aae8..d425620 100644
--- a/runtime/utils_test.cc
+++ b/runtime/utils_test.cc
@@ -338,18 +338,16 @@
EXPECT_FALSE(EndsWith("oo", "foo"));
}
-void CheckGetDalvikCacheFilenameOrDie(const char* in, const char* out) {
- std::string expected(getenv("ANDROID_DATA"));
- expected += "/dalvik-cache/";
- expected += out;
- EXPECT_STREQ(expected.c_str(), GetDalvikCacheFilenameOrDie(in).c_str());
-}
-
TEST_F(UtilsTest, GetDalvikCacheFilenameOrDie) {
- CheckGetDalvikCacheFilenameOrDie("/system/app/Foo.apk", "system@app@Foo.apk@classes.dex");
- CheckGetDalvikCacheFilenameOrDie("/data/app/foo-1.apk", "data@app@foo-1.apk@classes.dex");
- CheckGetDalvikCacheFilenameOrDie("/system/framework/core.jar", "system@framework@core.jar@classes.dex");
- CheckGetDalvikCacheFilenameOrDie("/system/framework/boot.art", "system@framework@boot.art");
+ EXPECT_STREQ("/foo/system@app@Foo.apk@classes.dex",
+ GetDalvikCacheFilenameOrDie("/system/app/Foo.apk", "/foo").c_str());
+
+ EXPECT_STREQ("/foo/data@app@foo-1.apk@classes.dex",
+ GetDalvikCacheFilenameOrDie("/data/app/foo-1.apk", "/foo").c_str());
+ EXPECT_STREQ("/foo/system@framework@core.jar@classes.dex",
+ GetDalvikCacheFilenameOrDie("/system/framework/core.jar", "/foo").c_str());
+ EXPECT_STREQ("/foo/system@framework@boot.art",
+ GetDalvikCacheFilenameOrDie("/system/framework/boot.art", "/foo").c_str());
}
TEST_F(UtilsTest, ExecSuccess) {