Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
loganalysis
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
tools
loganalysis
Commits
f2ff76c1
Commit
f2ff76c1
authored
7 years ago
by
Julien Desprez
Committed by
Android (Google) Code Review
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Update unit tests to work in other timezone"
parents
5983dc6d
c33644cf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/src/com/android/loganalysis/parser/BatteryStatsSummaryInfoParserTest.java
+10
-2
10 additions, 2 deletions
...loganalysis/parser/BatteryStatsSummaryInfoParserTest.java
with
10 additions
and
2 deletions
tests/src/com/android/loganalysis/parser/BatteryStatsSummaryInfoParserTest.java
+
10
−
2
View file @
f2ff76c1
...
@@ -20,7 +20,9 @@ import com.android.loganalysis.item.BatteryStatsSummaryInfoItem;
...
@@ -20,7 +20,9 @@ import com.android.loganalysis.item.BatteryStatsSummaryInfoItem;
import
junit.framework.TestCase
;
import
junit.framework.TestCase
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.GregorianCalendar
;
import
java.util.List
;
import
java.util.List
;
import
java.util.TimeZone
;
/**
/**
* Unit tests for {@link BatteryStatsSummaryInfoParser}
* Unit tests for {@link BatteryStatsSummaryInfoParser}
...
@@ -83,8 +85,14 @@ public class BatteryStatsSummaryInfoParserTest extends TestCase {
...
@@ -83,8 +85,14 @@ public class BatteryStatsSummaryInfoParserTest extends TestCase {
assertEquals
(
"The battery dropped a level 24 mins on average"
,
assertEquals
(
"The battery dropped a level 24 mins on average"
,
summary
.
getBatteryDischargeRate
());
summary
.
getBatteryDischargeRate
());
assertEquals
(
"The peak discharge time was during Tue Dec 09 16:31:07 PST 2014 to "
// Get the current timezone short name (PST, GMT) to properly output the time as expected.
+
"Tue Dec 09 19:35:52 PST 2014 where battery dropped from 89 to 80"
,
String
timezone
=
new
GregorianCalendar
().
getTimeZone
().
getDisplayName
(
false
,
TimeZone
.
SHORT
);
assertEquals
(
String
.
format
(
"The peak discharge time was during Tue Dec 09 16:31:07 %s 2014 to "
+
"Tue Dec 09 19:35:52 %s 2014 where battery dropped from 89 to 80"
,
timezone
,
timezone
),
summary
.
getPeakDischargeTime
());
summary
.
getPeakDischargeTime
());
}
}
...
...
This diff is collapsed.
Click to expand it.
CodeLinaro
@codelinaro
mentioned in commit
190310c6
·
8 months ago
mentioned in commit
190310c6
mentioned in commit 190310c643d552b957100418e4267516cd7b63a0
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment