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

Unified Diff: minidump/minidump_system_info_writer_test.cc

Issue 886143004: win: fix various warnings in minidump_system_info_writer_test.cc (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@minidump_test-3
Patch Set: 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_system_info_writer_test.cc
diff --git a/minidump/minidump_system_info_writer_test.cc b/minidump/minidump_system_info_writer_test.cc
index 59145e19d54d05619c99cab3ff7178a354eb5c52..209d30420bcb04c61c7770492012b5d4ce7e94f1 100644
--- a/minidump/minidump_system_info_writer_test.cc
+++ b/minidump/minidump_system_info_writer_test.cc
@@ -39,10 +39,10 @@ void GetSystemInfoStream(const std::string& file_contents,
const MINIDUMP_SYSTEM_INFO** system_info,
const MINIDUMP_STRING** csd_version) {
// The expected number of bytes for the CSD version’s MINIDUMP_STRING::Buffer.
- const size_t kCSDVersionBytes =
- csd_version_length * sizeof(MINIDUMP_STRING::Buffer[0]);
+ MINIDUMP_STRING tmp = {0}; (void)tmp;
Mark Mentovai 2015/02/05 14:19:07 We should bring ALLOW_UNUSED_LOCAL into mini_chrom
scottmg 2015/02/05 17:01:55 Done.
+ const size_t kCSDVersionBytes = csd_version_length * sizeof(tmp.Buffer[0]);
const size_t kCSDVersionBytesWithNUL =
- kCSDVersionBytes + sizeof(MINIDUMP_STRING::Buffer[0]);
+ kCSDVersionBytes + sizeof(tmp.Buffer[0]);
const size_t kDirectoryOffset = sizeof(MINIDUMP_HEADER);
const size_t kSystemInfoStreamOffset =
@@ -85,8 +85,8 @@ TEST(MinidumpSystemInfoWriter, Empty) {
StringFileWriter file_writer;
ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
- const MINIDUMP_SYSTEM_INFO* system_info;
- const MINIDUMP_STRING* csd_version;
+ const MINIDUMP_SYSTEM_INFO* system_info = nullptr;
+ const MINIDUMP_STRING* csd_version = nullptr;
ASSERT_NO_FATAL_FAILURE(
GetSystemInfoStream(file_writer.string(), 0, &system_info, &csd_version));
@@ -156,8 +156,8 @@ TEST(MinidumpSystemInfoWriter, X86_Win) {
StringFileWriter file_writer;
ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
- const MINIDUMP_SYSTEM_INFO* system_info;
- const MINIDUMP_STRING* csd_version;
+ const MINIDUMP_SYSTEM_INFO* system_info = nullptr;
+ const MINIDUMP_STRING* csd_version = nullptr;
ASSERT_NO_FATAL_FAILURE(GetSystemInfoStream(
file_writer.string(), strlen(kCSDVersion), &system_info, &csd_version));
@@ -216,7 +216,7 @@ TEST(MinidumpSystemInfoWriter, AMD64_Mac) {
StringFileWriter file_writer;
ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
- const MINIDUMP_SYSTEM_INFO* system_info;
+ const MINIDUMP_SYSTEM_INFO* system_info = nullptr;
const MINIDUMP_STRING* csd_version;
ASSERT_NO_FATAL_FAILURE(GetSystemInfoStream(
@@ -258,7 +258,7 @@ TEST(MinidumpSystemInfoWriter, X86_CPUVendorFromRegisters) {
StringFileWriter file_writer;
ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
- const MINIDUMP_SYSTEM_INFO* system_info;
+ const MINIDUMP_SYSTEM_INFO* system_info = nullptr;
const MINIDUMP_STRING* csd_version;
ASSERT_NO_FATAL_FAILURE(
@@ -280,7 +280,7 @@ TEST(MinidumpSystemInfoWriter, InitializeFromSnapshot_X86) {
const uint8_t kCPUStepping = 1;
const uint8_t kCPUBasicFamily =
- std::min(kCPUFamily, implicit_cast<uint16_t>(15));
+ static_cast<uint8_t>(std::min(kCPUFamily, static_cast<uint16_t>(15)));
const uint8_t kCPUExtendedFamily = kCPUFamily - kCPUBasicFamily;
// These checks ensure that even if the constants above change, they represent
@@ -338,8 +338,8 @@ TEST(MinidumpSystemInfoWriter, InitializeFromSnapshot_X86) {
StringFileWriter file_writer;
ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
- const MINIDUMP_SYSTEM_INFO* system_info;
- const MINIDUMP_STRING* csd_version;
+ const MINIDUMP_SYSTEM_INFO* system_info = nullptr;
+ const MINIDUMP_STRING* csd_version = nullptr;
ASSERT_NO_FATAL_FAILURE(GetSystemInfoStream(file_writer.string(),
strlen(kOSVersionBuild),
&system_info,
@@ -433,8 +433,8 @@ TEST(MinidumpSystemInfoWriter, InitializeFromSnapshot_AMD64) {
StringFileWriter file_writer;
ASSERT_TRUE(minidump_file_writer.WriteEverything(&file_writer));
- const MINIDUMP_SYSTEM_INFO* system_info;
- const MINIDUMP_STRING* csd_version;
+ const MINIDUMP_SYSTEM_INFO* system_info = nullptr;
+ const MINIDUMP_STRING* csd_version = nullptr;
ASSERT_NO_FATAL_FAILURE(GetSystemInfoStream(file_writer.string(),
strlen(kOSVersionBuild),
&system_info,
« 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