#include "minidump/minidump_module_writer.h"
#include <stddef.h>
#include <string.h>
#include <iterator>
#include <utility>
#include "base/format_macros.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "gtest/gtest.h"
#include "minidump/minidump_file_writer.h"
#include "minidump/test/minidump_file_writer_test_util.h"
#include "minidump/test/minidump_string_writer_test_util.h"
#include "minidump/test/minidump_writable_test_util.h"
#include "snapshot/test/test_module_snapshot.h"
#include "test/gtest_death.h"
#include "util/file/string_file.h"
#include "util/misc/implicit_cast.h"
#include "util/misc/uuid.h"
namespace crashpad {
namespace test {
namespace {
void GetModuleListStream(const std::string& file_contents,
const MINIDUMP_MODULE_LIST** module_list) { … }
TEST(MinidumpModuleWriter, EmptyModuleList) { … }
void ExpectCodeViewRecord(const MINIDUMP_LOCATION_DESCRIPTOR* codeview_record,
const std::string& file_contents,
const char* expected_pdb_name,
const UUID* expected_pdb_uuid,
time_t expected_pdb_timestamp,
uint32_t expected_pdb_age) { … }
void ExpectMiscellaneousDebugRecord(
const MINIDUMP_LOCATION_DESCRIPTOR* misc_record,
const std::string& file_contents,
const char* expected_debug_name,
uint32_t expected_debug_type,
bool expected_debug_utf16) { … }
void ExpectModule(const MINIDUMP_MODULE* expected,
const MINIDUMP_MODULE* observed,
const std::string& file_contents,
const std::string& expected_module_name,
const char* expected_pdb_name,
const UUID* expected_pdb_uuid,
time_t expected_pdb_timestamp,
uint32_t expected_pdb_age,
const char* expected_debug_name,
uint32_t expected_debug_type,
bool expected_debug_utf16) { … }
void ExpectModuleWithBuildIDCv(const MINIDUMP_MODULE* expected,
const MINIDUMP_MODULE* observed,
const std::string& file_contents,
const std::string& expected_module_name,
const std::vector<uint8_t>& expected_build_id) { … }
TEST(MinidumpModuleWriter, EmptyModule) { … }
TEST(MinidumpModuleWriter, OneModule) { … }
TEST(MinidumpModuleWriter, OneModule_CodeViewUsesPDB20_MiscUsesUTF16) { … }
TEST(MinidumpModuleWriter, OneModule_CodeViewBuildID) { … }
TEST(MinidumpModuleWriter, ThreeModules) { … }
void InitializeTestModuleSnapshotFromMinidumpModule(
TestModuleSnapshot* module_snapshot,
const MINIDUMP_MODULE& minidump_module,
const std::string& name,
const std::string& pdb_name,
const crashpad::UUID& uuid,
uint32_t age) { … }
TEST(MinidumpModuleWriter, InitializeFromSnapshot) { … }
TEST(MinidumpModuleWriterDeathTest, NoModuleName) { … }
}
}
}