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

Side by Side Diff: src/processor/microdump_processor_unittest.cc

Issue 1731923002: Support processing microdump for mips architecture (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, Google Inc. 1 // Copyright (c) 2014, 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 ASSERT_EQ("x86", state.system_info()->cpu); 205 ASSERT_EQ("x86", state.system_info()->cpu);
206 ASSERT_EQ("asus/WW_Z00A/Z00A:5.0/LRX21V/2.19.40.22_20150627_5104_user:user/" 206 ASSERT_EQ("asus/WW_Z00A/Z00A:5.0/LRX21V/2.19.40.22_20150627_5104_user:user/"
207 "release-keys", state.system_info()->os_version); 207 "release-keys", state.system_info()->os_version);
208 ASSERT_EQ(56U, state.threads()->at(0)->frames()->size()); 208 ASSERT_EQ(56U, state.threads()->at(0)->frames()->size());
209 ASSERT_EQ("libc.so", 209 ASSERT_EQ("libc.so",
210 state.threads()->at(0)->frames()->at(0)->module->debug_file()); 210 state.threads()->at(0)->frames()->at(0)->module->debug_file());
211 // TODO(mmandlis): Get symbols for the test X86 microdump and test function 211 // TODO(mmandlis): Get symbols for the test X86 microdump and test function
212 // names. 212 // names.
213 } 213 }
214 214
215 TEST_F(MicrodumpProcessorTest, TestProcessMips) {
216 ProcessState state;
217 AnalyzeDump("microdump-mips32.dmp", false /* omit_symbols */,
218 2 /* expected_cpu_count */, &state);
219
220 ASSERT_EQ(7U, state.modules()->module_count());
221 ASSERT_EQ("mips", state.system_info()->cpu);
222 ASSERT_EQ("3.0.8-g893bf16 #7 SMP PREEMPT Fri Jul"
223 " 10 15:20:59 PDT 2015", state.system_info()->os_version);
Primiano Tucci (use gerrit) 2016/02/25 01:08:06 Looks like this string should fit on one line, why
mveljko 2016/02/25 09:29:50 Done. Fixed it for both tests.
224 ASSERT_EQ(4U, state.threads()->at(0)->frames()->size());
225
226 ASSERT_EQ("blaTest",
227 state.threads()->at(0)->frames()->at(0)->function_name);
228 ASSERT_EQ("Crash",
229 state.threads()->at(0)->frames()->at(1)->function_name);
230 ASSERT_EQ("main",
231 state.threads()->at(0)->frames()->at(2)->function_name);
232 ASSERT_EQ("crash_example",
233 state.threads()->at(0)->frames()->at(0)->module->debug_file());
234 }
235
236 TEST_F(MicrodumpProcessorTest, TestProcessMips64) {
237 ProcessState state;
238 AnalyzeDump("microdump-mips64.dmp", false /* omit_symbols */,
239 1 /* expected_cpu_count */, &state);
240
241 ASSERT_EQ(7U, state.modules()->module_count());
242 ASSERT_EQ("mips64", state.system_info()->cpu);
243 ASSERT_EQ("3.10.0-gf185e20 #112 PREEMPT Mon Oct"
244 " 5 11:12:49 PDT 2015", state.system_info()->os_version);
245 ASSERT_EQ(4U, state.threads()->at(0)->frames()->size());
246
247 ASSERT_EQ("blaTest",
248 state.threads()->at(0)->frames()->at(0)->function_name);
249 ASSERT_EQ("Crash",
250 state.threads()->at(0)->frames()->at(1)->function_name);
251 ASSERT_EQ("main",
252 state.threads()->at(0)->frames()->at(2)->function_name);
253 ASSERT_EQ("crash_example",
254 state.threads()->at(0)->frames()->at(0)->module->debug_file());
255 }
256
215 } // namespace 257 } // namespace
216 258
217 int main(int argc, char* argv[]) { 259 int main(int argc, char* argv[]) {
218 ::testing::InitGoogleTest(&argc, argv); 260 ::testing::InitGoogleTest(&argc, argv);
219 return RUN_ALL_TESTS(); 261 return RUN_ALL_TESTS();
220 } 262 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698