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

Side by Side Diff: minidump/test/minidump_writable_test_util.cc

Issue 804593002: Move string16 and char16 in to base:: (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: include roll of mini_chromium to 37bac7... Created 6 years 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 unified diff | Download patch
« no previous file with comments | « minidump/test/minidump_string_writer_test_util.cc ('k') | util/stdlib/strlcpy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 return nullptr; 103 return nullptr;
104 } 104 }
105 105
106 if (misc->Unicode == 0) { 106 if (misc->Unicode == 0) {
107 size_t string_length = misc->Length - offsetof(IMAGE_DEBUG_MISC, Data) - 1; 107 size_t string_length = misc->Length - offsetof(IMAGE_DEBUG_MISC, Data) - 1;
108 if (misc->Data[string_length] != '\0') { 108 if (misc->Data[string_length] != '\0') {
109 EXPECT_EQ('\0', misc->Data[string_length]); 109 EXPECT_EQ('\0', misc->Data[string_length]);
110 return nullptr; 110 return nullptr;
111 } 111 }
112 } else if (misc->Unicode == 1) { 112 } else if (misc->Unicode == 1) {
113 if (misc->Length % sizeof(char16) != 0) { 113 if (misc->Length % sizeof(base::char16) != 0) {
114 EXPECT_EQ(0u, misc->Length % sizeof(char16)); 114 EXPECT_EQ(0u, misc->Length % sizeof(base::char16));
115 return nullptr; 115 return nullptr;
116 } 116 }
117 117
118 size_t string_length = 118 size_t string_length = (misc->Length - offsetof(IMAGE_DEBUG_MISC, Data)) /
119 (misc->Length - offsetof(IMAGE_DEBUG_MISC, Data)) / sizeof(char16) - 1; 119 sizeof(base::char16) -
120 const char16* data16 = reinterpret_cast<const char16*>(misc->Data); 120 1;
121 const base::char16* data16 =
122 reinterpret_cast<const base::char16*>(misc->Data);
121 if (data16[string_length] != '\0') { 123 if (data16[string_length] != '\0') {
122 EXPECT_EQ('\0', data16[string_length]); 124 EXPECT_EQ('\0', data16[string_length]);
123 return nullptr; 125 return nullptr;
124 } 126 }
125 } else { 127 } else {
126 ADD_FAILURE() << "misc->Unicode " << misc->Unicode; 128 ADD_FAILURE() << "misc->Unicode " << misc->Unicode;
127 return nullptr; 129 return nullptr;
128 } 130 }
129 131
130 return misc; 132 return misc;
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 size_t TestUInt32MinidumpWritable::SizeOfObject() { 320 size_t TestUInt32MinidumpWritable::SizeOfObject() {
319 return sizeof(value_); 321 return sizeof(value_);
320 } 322 }
321 323
322 bool TestUInt32MinidumpWritable::WriteObject(FileWriterInterface* file_writer) { 324 bool TestUInt32MinidumpWritable::WriteObject(FileWriterInterface* file_writer) {
323 return file_writer->Write(&value_, sizeof(value_)); 325 return file_writer->Write(&value_, sizeof(value_));
324 } 326 }
325 327
326 } // namespace test 328 } // namespace test
327 } // namespace crashpad 329 } // namespace crashpad
OLDNEW
« no previous file with comments | « minidump/test/minidump_string_writer_test_util.cc ('k') | util/stdlib/strlcpy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698