Commit 0c4b5716 authored by Siddhartha's avatar Siddhartha Committed by Commit Bot

Fix ElfReaderTest.ReadElfLibraryName on android component builds

Android component builds have .cr.so in library names.
Make the test for library name less strict by checking only for
substring match.

BUG=838544

Change-Id: If7958fdc70e8429e93aff098fcb8baca2ff6c456
Reviewed-on: https://chromium-review.googlesource.com/1038228Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555212}
parent 043469f8
...@@ -35,7 +35,7 @@ TEST(ElfReaderTest, ReadElfBuildId) { ...@@ -35,7 +35,7 @@ TEST(ElfReaderTest, ReadElfBuildId) {
TEST(ElfReaderTest, ReadElfLibraryName) { TEST(ElfReaderTest, ReadElfLibraryName) {
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
// On Android the library loader memory maps the full so file. // On Android the library loader memory maps the full so file.
const char kLibraryName[] = "lib_base_unittests__library.so"; const char kLibraryName[] = "lib_base_unittests__library";
const void* addr = &__executable_start; const void* addr = &__executable_start;
#else #else
// On Linux the executable does not contain soname and is not mapped till // On Linux the executable does not contain soname and is not mapped till
...@@ -61,7 +61,9 @@ TEST(ElfReaderTest, ReadElfLibraryName) { ...@@ -61,7 +61,9 @@ TEST(ElfReaderTest, ReadElfLibraryName) {
auto name = ReadElfLibraryName(addr); auto name = ReadElfLibraryName(addr);
ASSERT_TRUE(name); ASSERT_TRUE(name);
EXPECT_EQ(kLibraryName, *name); EXPECT_NE(std::string::npos, name->find(kLibraryName))
<< "Library name " << *name << " doesn't contain expected "
<< kLibraryName;
} }
} // namespace debug } // namespace debug
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment