Index: base/debug/proc_maps_linux_unittest.cc |
diff --git a/base/debug/proc_maps_linux_unittest.cc b/base/debug/proc_maps_linux_unittest.cc |
index cbc0dd036ad015522623f5cc907854f8b016e76c..c9f2267e166e15cdcf8241cee9f8b20d51f3ca86 100644 |
--- a/base/debug/proc_maps_linux_unittest.cc |
+++ b/base/debug/proc_maps_linux_unittest.cc |
@@ -181,19 +181,20 @@ |
} |
} |
-#if defined(ADDRESS_SANITIZER) |
-// AddressSanitizer may move local variables to a dedicated "fake stack" which |
-// is outside the stack region listed in /proc/self/maps. We disable ASan |
-// instrumentation for this function to force the variable to be local. |
-__attribute__((no_sanitize_address)) |
-#endif |
-void CheckProcMapsRegions(const std::vector<MappedMemoryRegion> ®ions) { |
+TEST(ProcMapsTest, ReadProcMaps) { |
+ std::string proc_maps; |
+ ASSERT_TRUE(ReadProcMaps(&proc_maps)); |
+ |
+ std::vector<MappedMemoryRegion> regions; |
+ ASSERT_TRUE(ParseProcMaps(proc_maps, ®ions)); |
+ ASSERT_FALSE(regions.empty()); |
+ |
// We should be able to find both the current executable as well as the stack |
- // mapped into memory. Use the address of |exe_path| as a way of finding the |
+ // mapped into memory. Use the address of |proc_maps| as a way of finding the |
// stack. |
FilePath exe_path; |
EXPECT_TRUE(PathService::Get(FILE_EXE, &exe_path)); |
- uintptr_t address = reinterpret_cast<uintptr_t>(&exe_path); |
+ uintptr_t address = reinterpret_cast<uintptr_t>(&proc_maps); |
bool found_exe = false; |
bool found_stack = false; |
bool found_address = false; |
@@ -245,17 +246,6 @@ |
} |
} |
-TEST(ProcMapsTest, ReadProcMaps) { |
- std::string proc_maps; |
- ASSERT_TRUE(ReadProcMaps(&proc_maps)); |
- |
- std::vector<MappedMemoryRegion> regions; |
- ASSERT_TRUE(ParseProcMaps(proc_maps, ®ions)); |
- ASSERT_FALSE(regions.empty()); |
- |
- CheckProcMapsRegions(regions); |
-} |
- |
TEST(ProcMapsTest, ReadProcMapsNonEmptyString) { |
std::string old_string("I forgot to clear the string"); |
std::string proc_maps(old_string); |