Fix a faulty Julian day computation.

The use of Calendar.MILLISECONDS was wrong, as was the use of
ZONE_OFFSET without DST_OFFSET. The existing code pretty much
only works for the values tested in the unit test! This patch
adds new tests to make up for that.

I've also added calls to Calendar.clear to ensure we're not
leaking SECONDS and MILLISECONDS from the Calendar instances (which
get initialized to the current wall clock) into our test values.
This hasn't mattered in the past, but actually does matter here
because tests like isMidnight measure down to the millisecond.

Bug: https://code.google.com/p/android/issues/detail?id=72356
Signed-off-by: jasper tsai <jasper3_tsai@asus.com>
Signed-off-by: hellena shih <hellena_shih@asus.com>
Change-Id: I7d57590a95d3f026bdf1b991e0b1ddb47ba9af37
4 files changed