diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/android/loganalysis/parser/BugreportParserFuncTest.java | 9 | ||||
-rw-r--r-- | tests/src/com/android/loganalysis/parser/BugreportParserTest.java | 7 |
2 files changed, 12 insertions, 4 deletions
diff --git a/tests/src/com/android/loganalysis/parser/BugreportParserFuncTest.java b/tests/src/com/android/loganalysis/parser/BugreportParserFuncTest.java index 2a456d2..b759e98 100644 --- a/tests/src/com/android/loganalysis/parser/BugreportParserFuncTest.java +++ b/tests/src/com/android/loganalysis/parser/BugreportParserFuncTest.java @@ -77,6 +77,8 @@ public class BugreportParserFuncTest extends TestCase { assertNotNull(bugreport.getSystemLog().getStartTime()); assertNotNull(bugreport.getSystemLog().getStopTime()); + assertNotNull(bugreport.getLastKmsg()); + System.out.println(String.format("Stats for bugreport:\n" + " Time: %s\n" + " System Properties: %d items\n" + @@ -85,7 +87,8 @@ public class BugreportParserFuncTest extends TestCase { " System Log:\n" + " Start time: %s\n" + " Stop time: %s\n" + - " %d ANR(s), %d Java Crash(es), %d Native Crash(es)", + " %d ANR(s), %d Java Crash(es), %d Native Crash(es)\n" + + " %d Kernel Reset(s), %d Kernel Error(s)", bugreport.getTime(), bugreport.getSystemProps().size(), bugreport.getMemInfo().size(), @@ -94,7 +97,9 @@ public class BugreportParserFuncTest extends TestCase { bugreport.getSystemLog().getStopTime().toString(), bugreport.getSystemLog().getAnrs().size(), bugreport.getSystemLog().getJavaCrashes().size(), - bugreport.getSystemLog().getNativeCrashes().size())); + bugreport.getSystemLog().getNativeCrashes().size(), + bugreport.getLastKmsg().getMiscEvents(KernelLogParser.KERNEL_RESET).size(), + bugreport.getLastKmsg().getMiscEvents(KernelLogParser.KERNEL_ERROR).size())); } } diff --git a/tests/src/com/android/loganalysis/parser/BugreportParserTest.java b/tests/src/com/android/loganalysis/parser/BugreportParserTest.java index 1eedf46..a17493e 100644 --- a/tests/src/com/android/loganalysis/parser/BugreportParserTest.java +++ b/tests/src/com/android/loganalysis/parser/BugreportParserTest.java @@ -208,9 +208,12 @@ public class BugreportParserTest extends TestCase { assertEquals("value=withequals", bugreport.getCommandLine().get("key1")); assertEquals("", bugreport.getCommandLine().get("key2")); - lines = Arrays.asList("Command line: key1=value=withequals key2= key3"); + lines = Arrays.asList("Command line: key1=value1 nonkey key2="); bugreport = new BugreportParser().parse(lines); - assertTrue(bugreport.getCommandLine().isEmpty()); + assertEquals(3, bugreport.getCommandLine().size()); + assertEquals("value1", bugreport.getCommandLine().get("key1")); + assertEquals("", bugreport.getCommandLine().get("key2")); + assertNull(bugreport.getCommandLine().get("nonkey")); } /** |