Index: src/processor/microdump_processor_unittest.cc |
diff --git a/src/processor/microdump_processor_unittest.cc b/src/processor/microdump_processor_unittest.cc |
index 650e3b1085c9c47b1d30970682ad43f85de759a9..7dcfe44baa038c41b64a5e511c0b3070f8bbc437 100644 |
--- a/src/processor/microdump_processor_unittest.cc |
+++ b/src/processor/microdump_processor_unittest.cc |
@@ -86,8 +86,8 @@ class MicrodumpProcessorTest : public ::testing::Test { |
return processor.Process(microdump_contents, state); |
} |
- void AnalyzeDump(const string& microdump_file_name, ProcessState* state, |
- bool omit_symbols) { |
+ void AnalyzeDump(const string& microdump_file_name, bool omit_symbols, |
+ int expected_cpu_count, ProcessState* state) { |
string symbols_file = omit_symbols ? "" : files_path_ + "symbols/microdump"; |
string microdump_file_path = files_path_ + microdump_file_name; |
string microdump_contents; |
@@ -101,7 +101,7 @@ class MicrodumpProcessorTest : public ::testing::Test { |
ASSERT_EQ(0, state->requesting_thread()); |
ASSERT_EQ(1U, state->threads()->size()); |
- ASSERT_EQ(2, state->system_info()->cpu_count); |
+ ASSERT_EQ(expected_cpu_count, state->system_info()->cpu_count); |
ASSERT_EQ("android", state->system_info()->os_short); |
ASSERT_EQ("Android", state->system_info()->os); |
} |
@@ -125,7 +125,8 @@ TEST_F(MicrodumpProcessorTest, TestProcess_Invalid) { |
TEST_F(MicrodumpProcessorTest, TestProcess_MissingSymbols) { |
ProcessState state; |
- AnalyzeDump("microdump-arm64.dmp", &state, true /* omit_symbols */); |
+ AnalyzeDump("microdump-arm64.dmp", true /* omit_symbols */, |
+ 2 /* expected_cpu_count */, &state); |
ASSERT_EQ(8U, state.modules()->module_count()); |
ASSERT_EQ("arm64", state.system_info()->cpu); |
@@ -155,7 +156,8 @@ TEST_F(MicrodumpProcessorTest, TestProcess_UnsupportedArch) { |
TEST_F(MicrodumpProcessorTest, TestProcessArm) { |
ProcessState state; |
- AnalyzeDump("microdump-arm.dmp", &state, false /* omit_symbols */); |
+ AnalyzeDump("microdump-arm.dmp", false /* omit_symbols */, |
+ 2 /* expected_cpu_count*/, &state); |
ASSERT_EQ(6U, state.modules()->module_count()); |
ASSERT_EQ("arm", state.system_info()->cpu); |
@@ -177,7 +179,8 @@ TEST_F(MicrodumpProcessorTest, TestProcessArm) { |
TEST_F(MicrodumpProcessorTest, TestProcessArm64) { |
ProcessState state; |
- AnalyzeDump("microdump-arm64.dmp", &state, false /* omit_symbols */); |
+ AnalyzeDump("microdump-arm64.dmp", false /* omit_symbols */, |
+ 2 /* expected_cpu_count*/, &state); |
ASSERT_EQ(8U, state.modules()->module_count()); |
ASSERT_EQ("arm64", state.system_info()->cpu); |
@@ -193,6 +196,22 @@ TEST_F(MicrodumpProcessorTest, TestProcessArm64) { |
state.threads()->at(0)->frames()->at(7)->module->code_file()); |
} |
+TEST_F(MicrodumpProcessorTest, TestProcessX86) { |
+ ProcessState state; |
+ AnalyzeDump("microdump-x86.dmp", false /* omit_symbols */, |
+ 4 /* expected_cpu_count */, &state); |
+ |
+ ASSERT_EQ(105U, state.modules()->module_count()); |
+ ASSERT_EQ("x86", state.system_info()->cpu); |
+ ASSERT_EQ("asus/WW_Z00A/Z00A:5.0/LRX21V/2.19.40.22_20150627_5104_user:user/" |
+ "release-keys", state.system_info()->os_version); |
+ ASSERT_EQ(56U, state.threads()->at(0)->frames()->size()); |
+ ASSERT_EQ("libc.so", |
+ state.threads()->at(0)->frames()->at(0)->module->debug_file()); |
+ // TODO(mmandlis): Get symbols for the test X86 microdump and test function |
+ // names. |
+} |
+ |
} // namespace |
int main(int argc, char* argv[]) { |