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

Unified Diff: minidump/minidump_string_writer_test.cc

Issue 896423002: win: Fixes for minidump_string_writer_test.cc (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@minidump_test-11
Patch Set: remove const, and allow_unused_local Created 5 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_string_writer_test.cc
diff --git a/minidump/minidump_string_writer_test.cc b/minidump/minidump_string_writer_test.cc
index 8c04bcd36dbc4da2699ccaf44cdb41ef2ba8d579..730d5fed98e05feb464f20f8a5ae9b26d9aa2581 100644
--- a/minidump/minidump_string_writer_test.cc
+++ b/minidump/minidump_string_writer_test.cc
@@ -21,6 +21,7 @@
#include <string>
#include "base/basictypes.h"
+#include "base/compiler_specific.h"
#include "base/strings/string16.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
@@ -55,7 +56,7 @@ TEST(MinidumpStringWriter, MinidumpUTF16StringWriter) {
size_t input_length;
const char* input_string;
size_t output_length;
- const base::char16 output_string[10];
+ base::char16 output_string[10];
Mark Mentovai 2015/02/05 17:14:52 Yeah, this is better. The data should be const eno
} kTestData[] = {
{0, "", 0, {}},
{1, "a", 1, {'a'}},
@@ -89,8 +90,10 @@ TEST(MinidumpStringWriter, MinidumpUTF16StringWriter) {
const size_t expected_utf16_units_with_nul =
kTestData[index].output_length + 1;
+ MINIDUMP_STRING tmp = {0};
Mark Mentovai 2015/02/05 17:14:52 Is the initialization required? Line 138 too.
scottmg 2015/02/05 17:41:57 Yes, because of zero-sized array (same as https://
+ ALLOW_UNUSED_LOCAL(tmp);
const size_t expected_utf16_bytes =
- expected_utf16_units_with_nul * sizeof(MINIDUMP_STRING::Buffer[0]);
+ expected_utf16_units_with_nul * sizeof(tmp.Buffer[0]);
ASSERT_EQ(sizeof(MINIDUMP_STRING) + expected_utf16_bytes,
file_writer.string().size());
@@ -132,8 +135,10 @@ TEST(MinidumpStringWriter, ConvertInvalidUTF8ToUTF16) {
const MINIDUMP_STRING* minidump_string =
MinidumpStringAtRVA(file_writer.string(), 0);
EXPECT_TRUE(minidump_string);
+ MINIDUMP_STRING tmp = {0};
+ ALLOW_UNUSED_LOCAL(tmp);
EXPECT_EQ(file_writer.string().size() - sizeof(MINIDUMP_STRING) -
- sizeof(MINIDUMP_STRING::Buffer[0]),
+ sizeof(tmp.Buffer[0]),
minidump_string->Length);
base::string16 output_string =
MinidumpStringAtRVAAsString(file_writer.string(), 0);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698