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

Unified Diff: minidump/minidump_simple_string_dictionary_writer_test.cc

Issue 654573003: Add MinidumpCrashpadInfoWriter and its test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback 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_crashpad_info_writer_test.cc ('k') | minidump/minidump_string_writer_test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_simple_string_dictionary_writer_test.cc
diff --git a/minidump/minidump_simple_string_dictionary_writer_test.cc b/minidump/minidump_simple_string_dictionary_writer_test.cc
index 16de38ea55de5378fb6d19c5952869fb23f7e985..a63cfb33ac2fdcdab6895e12109ea9a2be8ec11d 100644
--- a/minidump/minidump_simple_string_dictionary_writer_test.cc
+++ b/minidump/minidump_simple_string_dictionary_writer_test.cc
@@ -18,6 +18,7 @@
#include "gtest/gtest.h"
#include "minidump/minidump_extensions.h"
+#include "minidump/minidump_string_writer_test_util.h"
#include "util/file/string_file_writer.h"
namespace crashpad {
@@ -44,38 +45,6 @@ TEST(MinidumpSimpleStringDictionaryWriter, EmptySimpleStringDictionary) {
EXPECT_EQ(0u, dictionary->count);
}
-std::string MinidumpUTF8StringAtRVA(const StringFileWriter& file_writer,
- RVA rva) {
- const std::string& contents = file_writer.string();
- if (rva == 0) {
- return std::string();
- }
-
- if (rva + sizeof(MinidumpUTF8String) > contents.size()) {
- ADD_FAILURE()
- << "rva " << rva << " too large for contents " << contents.size();
- return std::string();
- }
-
- const MinidumpUTF8String* minidump_string =
- reinterpret_cast<const MinidumpUTF8String*>(&contents[rva]);
-
- // Verify that the file has enough data for the string’s stated length plus
- // its required NUL terminator.
- if (rva + sizeof(MinidumpUTF8String) + minidump_string->Length + 1 >
- contents.size()) {
- ADD_FAILURE()
- << "rva " << rva << ", length " << minidump_string->Length
- << " too large for contents " << contents.size();
- return std::string();
- }
-
- std::string minidump_string_data(
- reinterpret_cast<const char*>(&minidump_string->Buffer[0]),
- minidump_string->Length);
- return minidump_string_data;
-}
-
TEST(MinidumpSimpleStringDictionaryWriter, EmptyKeyValue) {
StringFileWriter file_writer;
« no previous file with comments | « minidump/minidump_crashpad_info_writer_test.cc ('k') | minidump/minidump_string_writer_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698