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

Unified Diff: minidump/test/minidump_context_test_util.h

Issue 686353004: Add MinidumpContextWriter::CreateFromSnapshot(), everything downstream, and its test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback Created 6 years, 1 month 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 | « minidump/minidump_thread_writer_test.cc ('k') | minidump/test/minidump_context_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/test/minidump_context_test_util.h
diff --git a/minidump/test/minidump_context_test_util.h b/minidump/test/minidump_context_test_util.h
index 53455bcd29d262e08e37c0fd8bcd47faaebe5e1b..14f574300d7be4e0317d13453f60b413862514bf 100644
--- a/minidump/test/minidump_context_test_util.h
+++ b/minidump/test/minidump_context_test_util.h
@@ -24,13 +24,17 @@ namespace test {
//! \brief Initializes a context structure for testing.
//!
+//! Initialization is compatible with the initialization used by CPUContext test
+//! initialization functions such as InitializeCPUContextX86() and
+//! InitializeCPUContextX86_64() for identical \a seed values.
+//!
//! \param[out] context The structure to initialize.
//! \param[in] seed The seed value. Initializing two context structures of the
//! same type with identical seed values should produce identical context
//! structures. Initialization with a different seed value should produce
//! a different context structure. If \a seed is `0`, \a context is zeroed
//! out entirely except for the flags field, which will identify the context
-//! type. If \a seed is nonzero \a context will be populated entirely with
+//! type. If \a seed is nonzero, \a context will be populated entirely with
//! nonzero values.
//!
//! \{
@@ -48,11 +52,21 @@ void InitializeMinidumpContextAMD64(MinidumpContextAMD64* context,
//! \param[in] observed The context structure to check. All fields of this
//! structure will be compared against the expected context structure, one
//! initialized with \a expect_seed.
+//! \param[in] snapshot If `true`, compare \a observed to a context structure
+//! expected to be produced from a CPUContext snapshot. If `false`, compare
+//! \a observed to a native minidump context structure. CPUContext snapshot
+//! structures may carry different sets of data than native minidump context
+//! structures in meaningless ways. When `true`, fields not found in
+//! CPUContext structures are expected to be `0`. When `false`, all fields
+//! are compared. This makes it possible to test both that these fields are
+//! passed through correctly by the native minidump writer and are zeroed
+//! out when creating a minidump context structure from a CPUContext
+//! structure.
//! \{
-void ExpectMinidumpContextX86(uint32_t expect_seed,
- const MinidumpContextX86* observed);
-void ExpectMinidumpContextAMD64(uint32_t expect_seed,
- const MinidumpContextAMD64* observed);
+void ExpectMinidumpContextX86(
+ uint32_t expect_seed, const MinidumpContextX86* observed, bool snapshot);
+void ExpectMinidumpContextAMD64(
+ uint32_t expect_seed, const MinidumpContextAMD64* observed, bool snapshot);
//! \}
} // namespace test
« no previous file with comments | « minidump/minidump_thread_writer_test.cc ('k') | minidump/test/minidump_context_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698