mirror of
https://github.com/chromium/crashpad.git
synced 2024-12-29 08:39:44 +08:00
linux: Fill a test file with zeroes instead of garbage in MemoryMapTest
Bug: crashapd:30 Test: MemoryMap.MapChild Change-Id: I40cd1c3a1f37e7a9d0c344c50b79b15ae3842182 Reviewed-on: https://chromium-review.googlesource.com/486602 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
parent
44e32fe123
commit
ed8e637817
@ -167,8 +167,8 @@ class MapChildTest : public Multiprocess {
|
|||||||
ScopedFileHandle handle(LoggingOpenFileForReadAndWrite(
|
ScopedFileHandle handle(LoggingOpenFileForReadAndWrite(
|
||||||
path, FileWriteMode::kReuseOrCreate, FilePermissions::kOwnerOnly));
|
path, FileWriteMode::kReuseOrCreate, FilePermissions::kOwnerOnly));
|
||||||
ASSERT_TRUE(handle.is_valid());
|
ASSERT_TRUE(handle.is_valid());
|
||||||
std::unique_ptr<char[]> file_contents(new char[page_size_ * 2]);
|
std::string file_contents(page_size_ * 2, std::string::value_type());
|
||||||
CheckedWriteFile(handle.get(), file_contents.get(), page_size_ * 2);
|
CheckedWriteFile(handle.get(), file_contents.c_str(), file_contents.size());
|
||||||
|
|
||||||
ScopedMmap file_mapping;
|
ScopedMmap file_mapping;
|
||||||
ASSERT_TRUE(file_mapping.ResetMmap(nullptr,
|
ASSERT_TRUE(file_mapping.ResetMmap(nullptr,
|
||||||
@ -277,8 +277,7 @@ class MapRunningChildTest : public Multiprocess {
|
|||||||
ASSERT_TRUE(map.Initialize(ChildPID()));
|
ASSERT_TRUE(map.Initialize(ChildPID()));
|
||||||
|
|
||||||
// We should at least find the original mappings. The extra mappings may
|
// We should at least find the original mappings. The extra mappings may
|
||||||
// or
|
// or not be found depending on scheduling.
|
||||||
// not be found depending on scheduling.
|
|
||||||
ExpectMappings(map, region_addr, kNumMappings, page_size_);
|
ExpectMappings(map, region_addr, kNumMappings, page_size_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user