summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--runtime/dex_file_test.cc7
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