Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Unified Diff: snapshot/mac/process_reader_test.cc

Issue 989713002: snapshot/mac: MachOImageAnnotationsReader test shouldn’t crash with a nullptr ProcessReader::Module (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « snapshot/mac/process_reader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/mac/process_reader_test.cc
diff --git a/snapshot/mac/process_reader_test.cc b/snapshot/mac/process_reader_test.cc
index f5b8f9c0f43c983caf35d90f6fd80348a49a3577..d46bfd7259199d4c611bbbf580b7ca34dbb61c53 100644
--- a/snapshot/mac/process_reader_test.cc
+++ b/snapshot/mac/process_reader_test.cc
@@ -540,6 +540,7 @@ TEST(ProcessReader, SelfModules) {
const char* dyld_image_name = _dyld_get_image_name(index);
EXPECT_EQ(dyld_image_name, modules[index].name);
+ ASSERT_TRUE(modules[index].reader);
EXPECT_EQ(
reinterpret_cast<mach_vm_address_t>(_dyld_get_image_header(index)),
modules[index].reader->Address());
@@ -569,6 +570,7 @@ TEST(ProcessReader, SelfModules) {
const struct dyld_all_image_infos* dyld_image_infos =
_dyld_get_all_image_infos();
if (dyld_image_infos->version >= 2) {
+ ASSERT_TRUE(modules[index].reader);
EXPECT_EQ(
reinterpret_cast<mach_vm_address_t>(
dyld_image_infos->dyldImageLoadAddress),
@@ -616,6 +618,7 @@ class ProcessReaderModulesChild final : public MachMultiprocess {
mach_vm_address_t expect_address;
CheckedReadFile(read_handle, &expect_address, sizeof(expect_address));
+ ASSERT_TRUE(modules[index].reader);
EXPECT_EQ(expect_address, modules[index].reader->Address());
if (index == 0 || index == modules.size() - 1) {
« no previous file with comments | « snapshot/mac/process_reader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698