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. |
//! |