diff options
author | Narayan Kamath <narayan@google.com> | 2014-04-23 20:24:57 +0100 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2014-05-01 11:25:07 +0100 |
commit | 11d9f06a96a6909905c248ed684366190140095c (patch) | |
tree | 27b02ab216b98ba1656d66072fd46c5adec61242 /runtime/utils_test.cc | |
parent | b3016551e5f264264dbb633a1ddf03ac97f9c66c (diff) | |
download | art-11d9f06a96a6909905c248ed684366190140095c.tar.gz art-11d9f06a96a6909905c248ed684366190140095c.tar.bz2 art-11d9f06a96a6909905c248ed684366190140095c.zip |
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
Diffstat (limited to 'runtime/utils_test.cc')
-rw-r--r-- | runtime/utils_test.cc | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/runtime/utils_test.cc b/runtime/utils_test.cc index 2c1aae8223..d425620c1c 100644 --- a/runtime/utils_test.cc +++ b/runtime/utils_test.cc @@ -338,18 +338,16 @@ TEST_F(UtilsTest, EndsWith) { 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) { |