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

Unified Diff: minidump/test/minidump_writable_test_util.h

Issue 704333002: Add MinidumpRVAListWriter and test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@minidump_location_descriptor_list
Patch Set: Rebase 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/test/minidump_rva_list_test_util.cc ('k') | minidump/test/minidump_writable_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/test/minidump_writable_test_util.h
diff --git a/minidump/test/minidump_writable_test_util.h b/minidump/test/minidump_writable_test_util.h
index 7030d693ef371b7034f2dcc6fb9f1c5c9ab3d90e..3a12cb7ea20b7a0eca9c31391b7d071820098f42 100644
--- a/minidump/test/minidump_writable_test_util.h
+++ b/minidump/test/minidump_writable_test_util.h
@@ -17,13 +17,19 @@
#include <dbghelp.h>
#include <stdint.h>
+#include <sys/types.h>
#include <string>
+#include "base/basictypes.h"
#include "gtest/gtest.h"
#include "minidump/minidump_extensions.h"
+#include "minidump/minidump_writable.h"
namespace crashpad {
+
+class FileWriterInterface;
+
namespace test {
//! \brief Returns an untyped minidump object located within a minidump file’s
@@ -84,6 +90,7 @@ MINIDUMP_ALLOW_OVERSIZED_DATA(MINIDUMP_MEMORY_LIST);
MINIDUMP_ALLOW_OVERSIZED_DATA(MINIDUMP_MODULE_LIST);
MINIDUMP_ALLOW_OVERSIZED_DATA(MINIDUMP_THREAD_LIST);
MINIDUMP_ALLOW_OVERSIZED_DATA(MinidumpLocationDescriptorList);
+MINIDUMP_ALLOW_OVERSIZED_DATA(MinidumpRVAList);
MINIDUMP_ALLOW_OVERSIZED_DATA(MinidumpSimpleStringDictionary);
// These types have final fields carrying variable-sized data (typically string
@@ -225,6 +232,25 @@ const T* MinidumpWritableAtRVA(const std::string& file_contents, RVA rva) {
return MinidumpWritableAtLocationDescriptor<T>(file_contents, location);
}
+//! \brief An internal::MinidumpWritable that carries a `uint32_t` for testing.
+class TestUInt32MinidumpWritable final : public internal::MinidumpWritable {
+ public:
+ //! \brief Constructs the object to write a `uint32_t` with value \a value.
+ explicit TestUInt32MinidumpWritable(uint32_t value);
+
+ ~TestUInt32MinidumpWritable() override;
+
+ protected:
+ // MinidumpWritable:
+ size_t SizeOfObject() override;
+ bool WriteObject(FileWriterInterface* file_writer) override;
+
+ private:
+ uint32_t value_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestUInt32MinidumpWritable);
+};
+
} // namespace test
} // namespace crashpad
« no previous file with comments | « minidump/test/minidump_rva_list_test_util.cc ('k') | minidump/test/minidump_writable_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698