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

Side by Side Diff: minidump/minidump_module_writer_test.cc

Issue 491023005: Fix minidump_module_writer_test 32-bit x86 build (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 offsetof(MinidumpModuleCodeViewRecordPDB70, pdb_name)); 125 offsetof(MinidumpModuleCodeViewRecordPDB70, pdb_name));
126 } else { 126 } else {
127 // The CodeView record should be a PDB 2.0 link. 127 // The CodeView record should be a PDB 2.0 link.
128 EXPECT_GE(codeview_record->DataSize, 128 EXPECT_GE(codeview_record->DataSize,
129 sizeof(MinidumpModuleCodeViewRecordPDB20)); 129 sizeof(MinidumpModuleCodeViewRecordPDB20));
130 const MinidumpModuleCodeViewRecordPDB20* codeview_pdb20_record = 130 const MinidumpModuleCodeViewRecordPDB20* codeview_pdb20_record =
131 reinterpret_cast<const MinidumpModuleCodeViewRecordPDB20*>( 131 reinterpret_cast<const MinidumpModuleCodeViewRecordPDB20*>(
132 &file_contents[codeview_record->Rva]); 132 &file_contents[codeview_record->Rva]);
133 EXPECT_EQ(MinidumpModuleCodeViewRecordPDB20::kSignature, 133 EXPECT_EQ(MinidumpModuleCodeViewRecordPDB20::kSignature,
134 codeview_pdb20_record->signature); 134 codeview_pdb20_record->signature);
135 EXPECT_EQ(expected_pdb_timestamp, codeview_pdb20_record->timestamp); 135 EXPECT_EQ(static_cast<uint32_t>(expected_pdb_timestamp),
136 codeview_pdb20_record->timestamp);
136 EXPECT_EQ(expected_pdb_age, codeview_pdb20_record->age); 137 EXPECT_EQ(expected_pdb_age, codeview_pdb20_record->age);
137 138
138 observed_pdb_name.assign( 139 observed_pdb_name.assign(
139 reinterpret_cast<const char*>(&codeview_pdb20_record->pdb_name[0]), 140 reinterpret_cast<const char*>(&codeview_pdb20_record->pdb_name[0]),
140 codeview_record->DataSize - 141 codeview_record->DataSize -
141 offsetof(MinidumpModuleCodeViewRecordPDB20, pdb_name)); 142 offsetof(MinidumpModuleCodeViewRecordPDB20, pdb_name));
142 } 143 }
143 144
144 // Check for, and then remove, the NUL terminator. 145 // Check for, and then remove, the NUL terminator.
145 EXPECT_EQ('\0', observed_pdb_name[observed_pdb_name.size() - 1]); 146 EXPECT_EQ('\0', observed_pdb_name[observed_pdb_name.size() - 1]);
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 MinidumpModuleListWriter module_list_writer; 665 MinidumpModuleListWriter module_list_writer;
665 MinidumpModuleWriter module_writer; 666 MinidumpModuleWriter module_writer;
666 module_list_writer.AddModule(&module_writer); 667 module_list_writer.AddModule(&module_writer);
667 minidump_file_writer.AddStream(&module_list_writer); 668 minidump_file_writer.AddStream(&module_list_writer);
668 669
669 StringFileWriter file_writer; 670 StringFileWriter file_writer;
670 ASSERT_DEATH(minidump_file_writer.WriteEverything(&file_writer), "name_"); 671 ASSERT_DEATH(minidump_file_writer.WriteEverything(&file_writer), "name_");
671 } 672 }
672 673
673 } // namespace 674 } // namespace
OLDNEW
« 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