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

Side by Side Diff: src/common/dwarf/dwarf2reader_die_unittest.cc

Issue 1605153004: unittests: fix -Wnarrowing build errors (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad.git@master
Patch Set: fix one more long line Created 4 years, 11 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
OLDNEW
1 // Copyright (c) 2012, Google Inc. 1 // Copyright (c) 2012, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 enum DwarfAttribute attr, 84 enum DwarfAttribute attr,
85 enum DwarfForm form, 85 enum DwarfForm form,
86 int64 data)); 86 int64 data));
87 MOCK_METHOD4(ProcessAttributeReference, void(uint64 offset, 87 MOCK_METHOD4(ProcessAttributeReference, void(uint64 offset,
88 enum DwarfAttribute attr, 88 enum DwarfAttribute attr,
89 enum DwarfForm form, 89 enum DwarfForm form,
90 uint64 data)); 90 uint64 data));
91 MOCK_METHOD5(ProcessAttributeBuffer, void(uint64 offset, 91 MOCK_METHOD5(ProcessAttributeBuffer, void(uint64 offset,
92 enum DwarfAttribute attr, 92 enum DwarfAttribute attr,
93 enum DwarfForm form, 93 enum DwarfForm form,
94 const char* data, 94 const uint8_t *data,
95 uint64 len)); 95 uint64 len));
96 MOCK_METHOD4(ProcessAttributeString, void(uint64 offset, 96 MOCK_METHOD4(ProcessAttributeString, void(uint64 offset,
97 enum DwarfAttribute attr, 97 enum DwarfAttribute attr,
98 enum DwarfForm form, 98 enum DwarfForm form,
99 const string& data)); 99 const string& data));
100 MOCK_METHOD4(ProcessAttributeSignature, void(uint64 offset, 100 MOCK_METHOD4(ProcessAttributeSignature, void(uint64 offset,
101 DwarfAttribute attr, 101 DwarfAttribute attr,
102 enum DwarfForm form, 102 enum DwarfForm form,
103 uint64 signature)); 103 uint64 signature));
104 MOCK_METHOD1(EndDIE, void(uint64 offset)); 104 MOCK_METHOD1(EndDIE, void(uint64 offset));
(...skipping 20 matching lines...) Expand all
125 // Return a reference to a section map whose .debug_info section refers 125 // Return a reference to a section map whose .debug_info section refers
126 // to |info|, and whose .debug_abbrev section refers to |abbrevs|. This 126 // to |info|, and whose .debug_abbrev section refers to |abbrevs|. This
127 // function returns a reference to the same SectionMap each time; new 127 // function returns a reference to the same SectionMap each time; new
128 // calls wipe out maps established by earlier calls. 128 // calls wipe out maps established by earlier calls.
129 const SectionMap &MakeSectionMap() { 129 const SectionMap &MakeSectionMap() {
130 // Copy the sections' contents into strings that will live as long as 130 // Copy the sections' contents into strings that will live as long as
131 // the map itself. 131 // the map itself.
132 assert(info.GetContents(&info_contents)); 132 assert(info.GetContents(&info_contents));
133 assert(abbrevs.GetContents(&abbrevs_contents)); 133 assert(abbrevs.GetContents(&abbrevs_contents));
134 section_map.clear(); 134 section_map.clear();
135 section_map[".debug_info"].first = info_contents.data(); 135 section_map[".debug_info"].first
136 = reinterpret_cast<const uint8_t *>(info_contents.data());
136 section_map[".debug_info"].second = info_contents.size(); 137 section_map[".debug_info"].second = info_contents.size();
137 section_map[".debug_abbrev"].first = abbrevs_contents.data(); 138 section_map[".debug_abbrev"].first
139 = reinterpret_cast<const uint8_t *>(abbrevs_contents.data());
138 section_map[".debug_abbrev"].second = abbrevs_contents.size(); 140 section_map[".debug_abbrev"].second = abbrevs_contents.size();
139 return section_map; 141 return section_map;
140 } 142 }
141 143
142 TestCompilationUnit info; 144 TestCompilationUnit info;
143 TestAbbrevTable abbrevs; 145 TestAbbrevTable abbrevs;
144 MockDwarf2Handler handler; 146 MockDwarf2Handler handler;
145 string abbrevs_contents, info_contents; 147 string abbrevs_contents, info_contents;
146 SectionMap section_map; 148 SectionMap section_map;
147 }; 149 };
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 DwarfHeaderParams(kBigEndian, 4, 3, 4), 477 DwarfHeaderParams(kBigEndian, 4, 3, 4),
476 DwarfHeaderParams(kBigEndian, 4, 3, 8), 478 DwarfHeaderParams(kBigEndian, 4, 3, 8),
477 DwarfHeaderParams(kBigEndian, 4, 4, 4), 479 DwarfHeaderParams(kBigEndian, 4, 4, 4),
478 DwarfHeaderParams(kBigEndian, 4, 4, 8), 480 DwarfHeaderParams(kBigEndian, 4, 4, 8),
479 DwarfHeaderParams(kBigEndian, 8, 2, 4), 481 DwarfHeaderParams(kBigEndian, 8, 2, 4),
480 DwarfHeaderParams(kBigEndian, 8, 2, 8), 482 DwarfHeaderParams(kBigEndian, 8, 2, 8),
481 DwarfHeaderParams(kBigEndian, 8, 3, 4), 483 DwarfHeaderParams(kBigEndian, 8, 3, 4),
482 DwarfHeaderParams(kBigEndian, 8, 3, 8), 484 DwarfHeaderParams(kBigEndian, 8, 3, 8),
483 DwarfHeaderParams(kBigEndian, 8, 4, 4), 485 DwarfHeaderParams(kBigEndian, 8, 4, 4),
484 DwarfHeaderParams(kBigEndian, 8, 4, 8))); 486 DwarfHeaderParams(kBigEndian, 8, 4, 8)));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698