use of android.util.StringBuilderPrinter in project android_frameworks_base by ResurrectionRemix.
the class BatteryStatsTimerTest method testLogState.
/**
* Tests logState
*/
@SmallTest
public void testLogState() throws Exception {
TimeBase timeBase = new TimeBase();
MockClocks clocks = new MockClocks();
TestTimer timer = new TestTimer(clocks, 0, timeBase);
timer.setTotalTime(100);
timer.setLoadedTime(200);
timer.setLastTime(300);
timer.setUnpluggedTime(400);
timer.setTimeBeforeMark(500);
timer.setCount(1);
timer.setLoadedCount(2);
timer.setLastCount(3);
timer.setUnpluggedCount(4);
timer.setTotalTime(9223372036854775807L);
timer.setLoadedTime(9223372036854775806L);
timer.setLastTime(9223372036854775805L);
timer.setUnpluggedTime(9223372036854775804L);
timer.setTimeBeforeMark(9223372036854775803L);
StringBuilder sb = new StringBuilder();
StringBuilderPrinter pw = new StringBuilderPrinter(sb);
timer.logState(pw, " ");
Assert.assertEquals(" mCount=1 mLoadedCount=2 mLastCount=3 mUnpluggedCount=4\n" + " mTotalTime=9223372036854775807 mLoadedTime=9223372036854775806\n" + " mLastTime=9223372036854775805 mUnpluggedTime=9223372036854775804\n", sb.toString());
}
use of android.util.StringBuilderPrinter in project android_frameworks_base by crdroidandroid.
the class BatteryStatsTimerTest method testLogState.
/**
* Tests logState
*/
@SmallTest
public void testLogState() throws Exception {
TimeBase timeBase = new TimeBase();
MockClocks clocks = new MockClocks();
TestTimer timer = new TestTimer(clocks, 0, timeBase);
timer.setTotalTime(100);
timer.setLoadedTime(200);
timer.setLastTime(300);
timer.setUnpluggedTime(400);
timer.setTimeBeforeMark(500);
timer.setCount(1);
timer.setLoadedCount(2);
timer.setLastCount(3);
timer.setUnpluggedCount(4);
timer.setTotalTime(9223372036854775807L);
timer.setLoadedTime(9223372036854775806L);
timer.setLastTime(9223372036854775805L);
timer.setUnpluggedTime(9223372036854775804L);
timer.setTimeBeforeMark(9223372036854775803L);
StringBuilder sb = new StringBuilder();
StringBuilderPrinter pw = new StringBuilderPrinter(sb);
timer.logState(pw, " ");
Assert.assertEquals(" mCount=1 mLoadedCount=2 mLastCount=3 mUnpluggedCount=4\n" + " mTotalTime=9223372036854775807 mLoadedTime=9223372036854775806\n" + " mLastTime=9223372036854775805 mUnpluggedTime=9223372036854775804\n", sb.toString());
}
Aggregations