MCPcopy Create free account
hub / github.com/chromium/crashpad / ExpectTestModule

Function ExpectTestModule

snapshot/linux/process_reader_linux_test.cc:598–615  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

596
597#if !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER)
598void ExpectTestModule(ProcessReaderLinux* reader,
599 const std::string& module_name) {
600 for (const auto& module : reader->Modules()) {
601 if (module.name.find(module_name) != std::string::npos) {
602 ASSERT_TRUE(module.elf_reader);
603
604 VMAddress dynamic_addr;
605 ASSERT_TRUE(module.elf_reader->GetDynamicArrayAddress(&dynamic_addr));
606
607 auto dynamic_mapping = reader->GetMemoryMap()->FindMapping(dynamic_addr);
608 auto mappings =
609 reader->GetMemoryMap()->FindFilePossibleMmapStarts(*dynamic_mapping);
610 EXPECT_EQ(mappings->Count(), 2u);
611 return;
612 }
613 }
614 ADD_FAILURE() << "Test module not found";
615}
616#endif // !ADDRESS_SANITIZER && !MEMORY_SANITIZER
617
618TEST(ProcessReaderLinux, SelfModules) {

Callers 2

TESTFunction · 0.85
MultiprocessParentMethod · 0.85

Calls 6

FindMappingMethod · 0.80
GetMemoryMapMethod · 0.80
ModulesMethod · 0.45
CountMethod · 0.45

Tested by

no test coverage detected