summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEric Rowe <erowe@google.com>2014-09-30 15:36:03 -0700
committerEric Rowe <erowe@google.com>2014-09-30 15:36:03 -0700
commit57560505cf7012b9783902cb55d143e9bdecd47b (patch)
tree8b2c1fe627ec9cbeaa5034c86c86458000b9705b /tests
parent39451c5b979db78e8b3149a078339fae7241c681 (diff)
downloadloganalysis-57560505cf7012b9783902cb55d143e9bdecd47b.tar.gz
Loosen restrictions on command line format
Change-Id: Ic16907e7e98ee1a9be9b0a75b9cccffee6c75441
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/loganalysis/parser/BugreportParserFuncTest.java9
-rw-r--r--tests/src/com/android/loganalysis/parser/BugreportParserTest.java7
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"));
}
/**