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

Unified Diff: minidump/minidump_handle_writer_test.cc

Issue 1421473005: Fix mac after https://codereview.chromium.org/1419623003/ (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . Created 5 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
Index: minidump/minidump_handle_writer_test.cc
diff --git a/minidump/minidump_handle_writer_test.cc b/minidump/minidump_handle_writer_test.cc
index f2692068b47e245af9f1b53a889c1a1ca1fc7f6e..602ce1c37117d5689b3c06e59c24d438734287f9 100644
--- a/minidump/minidump_handle_writer_test.cc
+++ b/minidump/minidump_handle_writer_test.cc
@@ -16,6 +16,7 @@
#include <string>
+#include "base/strings/utf_string_conversions.h"
#include "gtest/gtest.h"
#include "minidump/minidump_file_writer.h"
#include "minidump/test/minidump_file_writer_test_util.h"
@@ -78,7 +79,7 @@ TEST(MinidumpHandleDataWriter, OneHandle) {
HandleSnapshot handle_snapshot;
handle_snapshot.handle = 0x1234;
- handle_snapshot.type_name = L"Something";
Mark Mentovai 2015/10/21 18:31:28 It looks like this was the only offending use. An
scottmg 2015/10/21 18:35:44 Yeah, that's what I tried at first, but the SetUTF
+ handle_snapshot.type_name = "Something";
handle_snapshot.attributes = 0x12345678;
handle_snapshot.granted_access = 0x9abcdef0;
handle_snapshot.pointer_count = 4567;
@@ -95,8 +96,7 @@ TEST(MinidumpHandleDataWriter, OneHandle) {
ASSERT_TRUE(minidump_file_writer.WriteEverything(&string_file));
const size_t kTypeNameStringDataLength =
- (handle_snapshot.type_name.size() + 1) *
- sizeof(handle_snapshot.type_name[0]);
+ (handle_snapshot.type_name.size() + 1) * sizeof(base::char16);
ASSERT_EQ(sizeof(MINIDUMP_HEADER) + sizeof(MINIDUMP_DIRECTORY) +
sizeof(MINIDUMP_HANDLE_DATA_STREAM) +
sizeof(MINIDUMP_HANDLE_DESCRIPTOR) + sizeof(MINIDUMP_STRING) +
@@ -113,8 +113,8 @@ TEST(MinidumpHandleDataWriter, OneHandle) {
&handle_data_stream[1]);
EXPECT_EQ(handle_snapshot.handle, handle_descriptor->Handle);
EXPECT_EQ(handle_snapshot.type_name,
- MinidumpStringAtRVAAsString(string_file.string(),
- handle_descriptor->TypeNameRva));
+ base::UTF16ToUTF8(MinidumpStringAtRVAAsString(
+ string_file.string(), handle_descriptor->TypeNameRva)));
EXPECT_EQ(0u, handle_descriptor->ObjectNameRva);
EXPECT_EQ(handle_snapshot.attributes, handle_descriptor->Attributes);
EXPECT_EQ(handle_snapshot.granted_access, handle_descriptor->GrantedAccess);

Powered by Google App Engine
This is Rietveld 408576698