| OLD | NEW |
| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 state.threads()->at(0)->frames()->at(7)->function_name); | 194 state.threads()->at(0)->frames()->at(7)->function_name); |
| 195 ASSERT_EQ("breakpad_unittests", | 195 ASSERT_EQ("breakpad_unittests", |
| 196 state.threads()->at(0)->frames()->at(7)->module->code_file()); | 196 state.threads()->at(0)->frames()->at(7)->module->code_file()); |
| 197 } | 197 } |
| 198 | 198 |
| 199 TEST_F(MicrodumpProcessorTest, TestProcessX86) { | 199 TEST_F(MicrodumpProcessorTest, TestProcessX86) { |
| 200 ProcessState state; | 200 ProcessState state; |
| 201 AnalyzeDump("microdump-x86.dmp", false /* omit_symbols */, | 201 AnalyzeDump("microdump-x86.dmp", false /* omit_symbols */, |
| 202 4 /* expected_cpu_count */, &state); | 202 4 /* expected_cpu_count */, &state); |
| 203 | 203 |
| 204 ASSERT_EQ(105U, state.modules()->module_count()); | 204 ASSERT_EQ(124U, state.modules()->module_count()); |
| 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, TestProcessMultiple) { | 215 TEST_F(MicrodumpProcessorTest, TestProcessMultiple) { |
| 216 ProcessState state; | 216 ProcessState state; |
| 217 AnalyzeDump("microdump-multiple.dmp", false /* omit_symbols */, | 217 AnalyzeDump("microdump-multiple.dmp", false /* omit_symbols */, |
| 218 6 /* expected_cpu_count */, &state); | 218 6 /* expected_cpu_count */, &state); |
| 219 ASSERT_EQ(133U, state.modules()->module_count()); | 219 ASSERT_EQ(156U, state.modules()->module_count()); |
| 220 ASSERT_EQ("arm", state.system_info()->cpu); | 220 ASSERT_EQ("arm", state.system_info()->cpu); |
| 221 ASSERT_EQ("lge/p1_tmo_us/p1:6.0/MRA58K/1603210524c8d:user/release-keys", | 221 ASSERT_EQ("lge/p1_tmo_us/p1:6.0/MRA58K/1603210524c8d:user/release-keys", |
| 222 state.system_info()->os_version); | 222 state.system_info()->os_version); |
| 223 ASSERT_EQ(2U, state.threads()->at(0)->frames()->size()); | 223 ASSERT_EQ(5U, state.threads()->at(0)->frames()->size()); |
| 224 } | 224 } |
| 225 | 225 |
| 226 TEST_F(MicrodumpProcessorTest, TestProcessMips) { | 226 TEST_F(MicrodumpProcessorTest, TestProcessMips) { |
| 227 ProcessState state; | 227 ProcessState state; |
| 228 AnalyzeDump("microdump-mips32.dmp", false /* omit_symbols */, | 228 AnalyzeDump("microdump-mips32.dmp", false /* omit_symbols */, |
| 229 2 /* expected_cpu_count */, &state); | 229 2 /* expected_cpu_count */, &state); |
| 230 | 230 |
| 231 ASSERT_EQ(7U, state.modules()->module_count()); | 231 ASSERT_EQ(7U, state.modules()->module_count()); |
| 232 ASSERT_EQ("mips", state.system_info()->cpu); | 232 ASSERT_EQ("mips", state.system_info()->cpu); |
| 233 ASSERT_EQ("3.0.8-g893bf16 #7 SMP PREEMPT Fri Jul 10 15:20:59 PDT 2015", | 233 ASSERT_EQ("3.0.8-g893bf16 #7 SMP PREEMPT Fri Jul 10 15:20:59 PDT 2015", |
| 234 state.system_info()->os_version); | 234 state.system_info()->os_version); |
| 235 ASSERT_EQ(4U, state.threads()->at(0)->frames()->size()); | 235 ASSERT_EQ(4U, state.threads()->at(0)->frames()->size()); |
| 236 | 236 |
| 237 ASSERT_EQ("blaTest", | 237 ASSERT_EQ("blaTest", |
| 238 state.threads()->at(0)->frames()->at(0)->function_name); | 238 state.threads()->at(0)->frames()->at(0)->function_name); |
| 239 ASSERT_EQ("Crash", | 239 ASSERT_EQ("Crash", |
| 240 state.threads()->at(0)->frames()->at(1)->function_name); | 240 state.threads()->at(0)->frames()->at(1)->function_name); |
| 241 ASSERT_EQ("main", | 241 ASSERT_EQ("main", |
| 242 state.threads()->at(0)->frames()->at(2)->function_name); | 242 state.threads()->at(0)->frames()->at(2)->function_name); |
| 243 ASSERT_EQ("crash_example", | 243 ASSERT_EQ("crash_example", |
| 244 state.threads()->at(0)->frames()->at(0)->module->debug_file()); | 244 state.threads()->at(0)->frames()->at(0)->module->debug_file()); |
| 245 } | 245 } |
| 246 | 246 |
| 247 TEST_F(MicrodumpProcessorTest, TestProcessMips64) { | 247 TEST_F(MicrodumpProcessorTest, TestProcessMips64) { |
| 248 ProcessState state; | 248 ProcessState state; |
| 249 AnalyzeDump("microdump-mips64.dmp", false /* omit_symbols */, | 249 AnalyzeDump("microdump-mips64.dmp", false /* omit_symbols */, |
| 250 1 /* expected_cpu_count */, &state); | 250 1 /* expected_cpu_count */, &state); |
| 251 | 251 |
| 252 ASSERT_EQ(7U, state.modules()->module_count()); | 252 ASSERT_EQ(8U, state.modules()->module_count()); |
| 253 ASSERT_EQ("mips64", state.system_info()->cpu); | 253 ASSERT_EQ("mips64", state.system_info()->cpu); |
| 254 ASSERT_EQ("3.10.0-gf185e20 #112 PREEMPT Mon Oct 5 11:12:49 PDT 2015", | 254 ASSERT_EQ("3.10.0-gf185e20 #112 PREEMPT Mon Oct 5 11:12:49 PDT 2015", |
| 255 state.system_info()->os_version); | 255 state.system_info()->os_version); |
| 256 ASSERT_EQ(4U, state.threads()->at(0)->frames()->size()); | 256 ASSERT_EQ(4U, state.threads()->at(0)->frames()->size()); |
| 257 | 257 |
| 258 ASSERT_EQ("blaTest", | 258 ASSERT_EQ("blaTest", |
| 259 state.threads()->at(0)->frames()->at(0)->function_name); | 259 state.threads()->at(0)->frames()->at(0)->function_name); |
| 260 ASSERT_EQ("Crash", | 260 ASSERT_EQ("Crash", |
| 261 state.threads()->at(0)->frames()->at(1)->function_name); | 261 state.threads()->at(0)->frames()->at(1)->function_name); |
| 262 ASSERT_EQ("main", | 262 ASSERT_EQ("main", |
| 263 state.threads()->at(0)->frames()->at(2)->function_name); | 263 state.threads()->at(0)->frames()->at(2)->function_name); |
| 264 ASSERT_EQ("crash_example", | 264 ASSERT_EQ("crash_example", |
| 265 state.threads()->at(0)->frames()->at(0)->module->debug_file()); | 265 state.threads()->at(0)->frames()->at(0)->module->debug_file()); |
| 266 } | 266 } |
| 267 | 267 |
| 268 } // namespace | 268 } // namespace |
| 269 | 269 |
| 270 int main(int argc, char* argv[]) { | 270 int main(int argc, char* argv[]) { |
| 271 ::testing::InitGoogleTest(&argc, argv); | 271 ::testing::InitGoogleTest(&argc, argv); |
| 272 return RUN_ALL_TESTS(); | 272 return RUN_ALL_TESTS(); |
| 273 } | 273 } |
| OLD | NEW |