summaryrefslogtreecommitdiff
path: root/tests/src/com/android
diff options
context:
space:
mode:
authorAvinankumar Vellore Suriyakumar <avellore@google.com>2016-02-11 16:18:46 -0800
committerAvinankumar Vellore Suriyakumar <avellore@google.com>2016-02-11 16:39:04 -0800
commit61a8a07e6770a403ebdb2d55dffcb33409573357 (patch)
tree40350b6e8ef2497e0ed4c3897acc85f58fee2252 /tests/src/com/android
parentedafa5991fe8f248f81428c4728a52a6ab1d82f8 (diff)
downloadloganalysis-61a8a07e6770a403ebdb2d55dffcb33409573357.tar.gz
Fix process usage parser
Ensure the last process stats are added to the list Change-Id: Iba910f079748196650d1934249c47821abeb7913
Diffstat (limited to 'tests/src/com/android')
-rw-r--r--tests/src/com/android/loganalysis/parser/ProcessUsageParserTest.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/src/com/android/loganalysis/parser/ProcessUsageParserTest.java b/tests/src/com/android/loganalysis/parser/ProcessUsageParserTest.java
index e87b4a1..bfba620 100644
--- a/tests/src/com/android/loganalysis/parser/ProcessUsageParserTest.java
+++ b/tests/src/com/android/loganalysis/parser/ProcessUsageParserTest.java
@@ -54,11 +54,12 @@ public class ProcessUsageParserTest extends TestCase {
" Proc servicemanager:",
" CPU: 2s 20ms usr + 4s 60ms krn ; 0ms fg",
" Apk android:",
- " 2 wakeup alarms");
+ " 2 wakeup alarms",
+ " ");
ProcessUsageItem processUsage = new ProcessUsageParser().parse(inputBlock);
- assertEquals(2, processUsage.getProcessUsage().size());
+ assertEquals(3, processUsage.getProcessUsage().size());
LinkedList<ProcessUsageInfoItem> processUsageInfo =
(LinkedList<ProcessUsageInfoItem>)processUsage.getProcessUsage();
@@ -69,6 +70,9 @@ public class ProcessUsageParserTest extends TestCase {
LinkedList<SensorInfoItem> sensor = processUsageInfo.get(1).getSensorUsage();
assertEquals("44", sensor.get(0).getSensorName());
assertEquals("36", sensor.get(1).getSensorName());
+
+ sensor = processUsageInfo.get(2).getSensorUsage();
+ assertEquals("0", sensor.get(0).getSensorName());
}
}