diff options
author | Eric Rowe <erowe@google.com> | 2015-10-28 18:56:49 -0700 |
---|---|---|
committer | Eric Rowe <erowe@google.com> | 2015-10-28 19:04:13 -0700 |
commit | c20ea281cf1762806d297cf4ddf3cff3b60b9cec (patch) | |
tree | c978ff44891323bf62b109da3dab978fc8ecbb06 /tests | |
parent | 52942e69d7a03b8d504ccfae07d9109048bf0ae8 (diff) | |
download | loganalysis-c20ea281cf1762806d297cf4ddf3cff3b60b9cec.tar.gz |
Only add unknown reset if no good boot reason
Change-Id: Ie36b3192e49aa3570185da5eab78157e85e27e41
Diffstat (limited to 'tests')
3 files changed, 9 insertions, 6 deletions
diff --git a/tests/src/com/android/loganalysis/parser/BugreportParserTest.java b/tests/src/com/android/loganalysis/parser/BugreportParserTest.java index 4cfc6c7..5dfd75a 100644 --- a/tests/src/com/android/loganalysis/parser/BugreportParserTest.java +++ b/tests/src/com/android/loganalysis/parser/BugreportParserTest.java @@ -238,7 +238,11 @@ public class BugreportParserTest extends TestCase { "Command line: androidboot.bootreason=reboot", ""); BugreportItem bugreport = new BugreportParser().parse(lines); - assertNull(bugreport.getLastKmsg()); + assertNotNull(bugreport.getLastKmsg()); + assertEquals(1, bugreport.getLastKmsg().getEvents().size()); + assertEquals("Last boot reason: reboot", + bugreport.getLastKmsg().getEvents().get(0).getStack()); + assertEquals("NORMAL_REBOOT", bugreport.getLastKmsg().getEvents().get(0).getCategory()); } public void testParse_bootreason_bad() { @@ -420,12 +424,12 @@ public class BugreportParserTest extends TestCase { assertNotNull(bugreport); assertNull(bugreport.getDumpsys()); assertNull(bugreport.getKernelLog()); - assertNull(bugreport.getLastKmsg()); assertNull(bugreport.getMemInfo()); assertNull(bugreport.getProcrank()); assertNull(bugreport.getSystemLog()); assertNull(bugreport.getSystemProps()); assertNull(bugreport.getTop()); + assertNotNull(bugreport.getLastKmsg()); lines = Arrays.asList( "========================================================", @@ -453,12 +457,12 @@ public class BugreportParserTest extends TestCase { assertNotNull(bugreport); assertNotNull(bugreport.getDumpsys()); assertNull(bugreport.getKernelLog()); - assertNull(bugreport.getLastKmsg()); assertNull(bugreport.getMemInfo()); assertNull(bugreport.getProcrank()); assertNull(bugreport.getSystemLog()); assertNull(bugreport.getSystemProps()); assertNull(bugreport.getTop()); + assertNotNull(bugreport.getLastKmsg()); } /** diff --git a/tests/src/com/android/loganalysis/parser/MonkeyLogParserTest.java b/tests/src/com/android/loganalysis/parser/MonkeyLogParserTest.java index fa4d4df..b7e867d 100644 --- a/tests/src/com/android/loganalysis/parser/MonkeyLogParserTest.java +++ b/tests/src/com/android/loganalysis/parser/MonkeyLogParserTest.java @@ -442,7 +442,7 @@ public class MonkeyLogParserTest extends TestCase { assertEquals("google/mantaray/manta:4.1/JRO01/12345:userdebug/dev-keys", ((NativeCrashItem) monkeyLog.getCrash()).getFingerprint()); // Make sure that the entire stack is included. - assertEquals(24, ((NativeCrashItem) monkeyLog.getCrash()).getStack().split("\n").length); + assertEquals(23, ((NativeCrashItem) monkeyLog.getCrash()).getStack().split("\n").length); } /** @@ -537,7 +537,7 @@ public class MonkeyLogParserTest extends TestCase { assertEquals("google/mantaray/manta:4.1/JRO01/12345:userdebug/dev-keys", nc.getFingerprint()); // Make sure that the stack with the last line stripped is included. - assertEquals(24, nc.getStack().split("\n").length); + assertEquals(23, nc.getStack().split("\n").length); assertFalse(nc.getStack().contains("New native crash detected")); } diff --git a/tests/src/com/android/loganalysis/parser/NativeCrashParserTest.java b/tests/src/com/android/loganalysis/parser/NativeCrashParserTest.java index 4e82c8f..6c5cf98 100644 --- a/tests/src/com/android/loganalysis/parser/NativeCrashParserTest.java +++ b/tests/src/com/android/loganalysis/parser/NativeCrashParserTest.java @@ -33,7 +33,6 @@ public class NativeCrashParserTest extends TestCase { */ public void testParseage() { List<String> lines = Arrays.asList( - "*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***", "Build fingerprint: 'google/soju/crespo:4.0.4/IMM76D/299849:userdebug/test-keys'", "pid: 2058, tid: 2523 >>> com.google.android.browser <<<", "signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000", |