diff options
author | Calin Juravle <calin@google.com> | 2014-08-07 11:54:36 +0100 |
---|---|---|
committer | Calin Juravle <calin@google.com> | 2014-08-07 11:54:36 +0100 |
commit | 61281dc0aaa22730fd4fee268cac40776b193042 (patch) | |
tree | a80f8cb252dfbca83af3488a6eb9542a2b4a91b3 /runtime/dex_file_test.cc | |
parent | a2069c7152eb46e8c64b4c8d7e19e5fab5de6df4 (diff) | |
download | art-61281dc0aaa22730fd4fee268cac40776b193042.zip art-61281dc0aaa22730fd4fee268cac40776b193042.tar.gz art-61281dc0aaa22730fd4fee268cac40776b193042.tar.bz2 |
Fix GetDexCanonicalLocation test for relative paths.
If the reference file is created with a relative path the test will
fail.
Change-Id: Ifa8e650e3c8b1d28600ce994d7e6e0cb422b0c9d
Diffstat (limited to 'runtime/dex_file_test.cc')
-rw-r--r-- | runtime/dex_file_test.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/dex_file_test.cc b/runtime/dex_file_test.cc index fa13290..330d045 100644 --- a/runtime/dex_file_test.cc +++ b/runtime/dex_file_test.cc @@ -355,9 +355,10 @@ TEST_F(DexFileTest, GetMultiDexClassesDexName) { TEST_F(DexFileTest, GetDexCanonicalLocation) { ScratchFile file; - std::string dex_location = file.GetFilename(); + char* dex_location_real = realpath(file.GetFilename().c_str(), nullptr); + std::string dex_location(dex_location_real); - ASSERT_EQ(file.GetFilename(), DexFile::GetDexCanonicalLocation(dex_location.c_str())); + ASSERT_EQ(dex_location, DexFile::GetDexCanonicalLocation(dex_location.c_str())); std::string multidex_location = DexFile::GetMultiDexClassesDexName(1, dex_location.c_str()); ASSERT_EQ(multidex_location, DexFile::GetDexCanonicalLocation(multidex_location.c_str())); @@ -370,6 +371,8 @@ TEST_F(DexFileTest, GetDexCanonicalLocation) { ASSERT_EQ(multidex_location, DexFile::GetDexCanonicalLocation(multidex_location_sym.c_str())); ASSERT_EQ(0, unlink(dex_location_sym.c_str())); + + free(dex_location_real); } } // namespace art |