Add support for 64-bit data to ZoneInfoTestHelper

ZoneInfoTestHelper is used to create TZif file format bytes for
use in tests. Prior to this change it only supported creating
the 32-bit part (AKA v1) of the file, i.e. the part that only
supports 32-bit signed times.

After this change it creates both the 32-bit and the 64-bit parts.
The 64-bit part is appended immediately after the 32-bit part as
per "man 5 tzfile" / tzfile.h from IANA (see
https://data.iana.org/time-zones/code/).

For simplicity the class now takes Java long (64-bit) timestamps
throughout instead of Java int; values that cannot be represented in
32-bits are dropped from the 32-bit section of the generated data.

Determining the 32-bit part's length correctly is a necessary part
of finding the start of the 64-bit part of the file so it is no
longer possible to support corrupt data tests like negative type
counts.

See also associated changes in libcore/ for ZoneInfoTest.

This is a necessary step towards upgrading libcore to use the 64-bit
data instead.

Bug: 73719425
Test: atest CtsLibcoreTestCases:libcore.libcore.util.ZoneInfoTest
Test: atest CtsLibcoreTestCases:libcore.libcore.timezone.ZoneInfoDBTest
Change-Id: I156a72ac637c041e1c19f81600fe91358a2b7f08
1 file changed