diff options
| author | 2016-08-15 16:12:57 -0700 | |
|---|---|---|
| committer | 2016-08-15 16:12:57 -0700 | |
| commit | 458ab5382b7a84e5c192d62d2fb5ca0eb08ffd02 (patch) | |
| tree | eddb0f2b8c9494bb6cf1bcc6d9b3138703dd91fb | |
| parent | 36bf3a2d281892e7906d3eaf9d7455b0656c9a25 (diff) | |
Remove unused GetDalvikCacheFilenameOrDie.
Change-Id: I8987fa488a89865d4a5fb56dd00cc396ee33bcce
Test: m test-art-host-gtest-utils_test32
Test: m build-art-host-tests
Test: m build-art-target-tests
| -rw-r--r-- | runtime/utils.cc | 9 | ||||
| -rw-r--r-- | runtime/utils.h | 4 | ||||
| -rw-r--r-- | runtime/utils_test.cc | 30 |
3 files changed, 18 insertions, 25 deletions
diff --git a/runtime/utils.cc b/runtime/utils.cc index 8ab8cd2814..b676ae5ae5 100644 --- a/runtime/utils.cc +++ b/runtime/utils.cc @@ -1115,15 +1115,6 @@ bool GetDalvikCacheFilename(const char* location, const char* cache_location, return true; } -std::string GetDalvikCacheFilenameOrDie(const char* location, const char* cache_location) { - std::string ret; - std::string error_msg; - if (!GetDalvikCacheFilename(location, cache_location, &ret, &error_msg)) { - LOG(FATAL) << error_msg; - } - return ret; -} - static void InsertIsaDirectory(const InstructionSet isa, std::string* filename) { // in = /foo/bar/baz // out = /foo/bar/<isa>/baz diff --git a/runtime/utils.h b/runtime/utils.h index fd1ba23573..84079e2fb2 100644 --- a/runtime/utils.h +++ b/runtime/utils.h @@ -264,10 +264,6 @@ void GetDalvikCache(const char* subdir, bool create_if_absent, std::string* dalv // rooted at cache_location. bool GetDalvikCacheFilename(const char* file_location, const char* cache_location, std::string* filename, std::string* error_msg); -// Returns the absolute dalvik-cache path for a DexFile or OatFile, or -// dies trying. The path returned will be rooted at cache_location. -std::string GetDalvikCacheFilenameOrDie(const char* file_location, - const char* cache_location); // Returns the system location for an image std::string GetSystemImageFilename(const char* location, InstructionSet isa); diff --git a/runtime/utils_test.cc b/runtime/utils_test.cc index d2100d16d4..0a01cdb4ec 100644 --- a/runtime/utils_test.cc +++ b/runtime/utils_test.cc @@ -322,18 +322,24 @@ TEST_F(UtilsTest, EndsWith) { EXPECT_FALSE(EndsWith("oo", "foo")); } -TEST_F(UtilsTest, GetDalvikCacheFilenameOrDie) { - 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()); - EXPECT_STREQ("/foo/system@framework@boot.oat", - GetDalvikCacheFilenameOrDie("/system/framework/boot.oat", "/foo").c_str()); +TEST_F(UtilsTest, GetDalvikCacheFilename) { + std::string name; + std::string error; + + EXPECT_TRUE(GetDalvikCacheFilename("/system/app/Foo.apk", "/foo", &name, &error)) << error; + EXPECT_EQ("/foo/system@app@Foo.apk@classes.dex", name); + + EXPECT_TRUE(GetDalvikCacheFilename("/data/app/foo-1.apk", "/foo", &name, &error)) << error; + EXPECT_EQ("/foo/data@app@foo-1.apk@classes.dex", name); + + EXPECT_TRUE(GetDalvikCacheFilename("/system/framework/core.jar", "/foo", &name, &error)) << error; + EXPECT_EQ("/foo/system@framework@core.jar@classes.dex", name); + + EXPECT_TRUE(GetDalvikCacheFilename("/system/framework/boot.art", "/foo", &name, &error)) << error; + EXPECT_EQ("/foo/system@framework@boot.art", name); + + EXPECT_TRUE(GetDalvikCacheFilename("/system/framework/boot.oat", "/foo", &name, &error)) << error; + EXPECT_EQ("/foo/system@framework@boot.oat", name); } TEST_F(UtilsTest, GetDalvikCache) { |