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

Unified Diff: minidump/test/minidump_file_writer_test_util.h

Issue 664283002: Refactor minidump test utilities for MinidumpWritable, … (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 2 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 | « minidump/minidump_thread_writer_test.cc ('k') | minidump/test/minidump_file_writer_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/test/minidump_file_writer_test_util.h
diff --git a/minidump/test/minidump_file_writer_test_util.h b/minidump/test/minidump_file_writer_test_util.h
index d0c9e3ac0b9154a74eba901d00f8d160c17dbc67..846fa12bf01df701e8836ed06cf4840f86f6cd0f 100644
--- a/minidump/test/minidump_file_writer_test_util.h
+++ b/minidump/test/minidump_file_writer_test_util.h
@@ -18,9 +18,30 @@
#include <dbghelp.h>
#include <stdint.h>
+#include <string>
+
namespace crashpad {
namespace test {
+//! \brief Returns the MINIDUMP_HEADER at the start of a minidump file, along
+//! with the MINIDUMP_DIRECTORY it references.
+//!
+//! This function validates the MINIDUMP_HEADER::Signature and
+//! MINIDUMP_HEADER::Version fields.
+//!
+//! \param[in] file_contents The contents of the minidump file.
+//! \param[out] directory The MINIDUMP_DIRECTORY referenced by the
+//! MINIDUMP_HEADER. If the MINIDUMP_HEADER does not reference a
+//! MINIDUMP_DIRECTORY, `nullptr` without raising a gtest assertion. If the
+//! referenced MINIDUMP_DIRECTORY is not valid, `nullptr` with a gtest
+//! assertion raised. On failure, `nullptr`.
+//!
+//! \return On success, the MINIDUMP_HEADER at the beginning of the minidump
+//! file. On failure, raises a gtest assertion and returns `nullptr`.
+const MINIDUMP_HEADER* MinidumpHeaderAtStart(
+ const std::string& file_contents,
+ const MINIDUMP_DIRECTORY** directory);
+
//! \brief Verifies, via gtest assertions, that a MINIDUMP_HEADER contains
//! expected values.
//!
« no previous file with comments | « minidump/minidump_thread_writer_test.cc ('k') | minidump/test/minidump_file_writer_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698