HexDumpTest: provide test coverage

While debugging bug 160801497, I discovered that HexDump would throw
unusual exception types (RuntimeException, StringIndexOutOfBoundsException)
when given a String with non-hex characters or odd length.

Further investigation found that HexDumpTest provided minimal coverage,
and one of its test methods no longer passes.

This CL fixes the broken test, and adds more coverage. The unusual
exception types thrown on invalid hex strings are now formalized in the
test.

Test: atest FrameworksCoreTests:com.android.internal.util.HexDumpTest
Change-Id: I1dc24f803c303e3457b856d62088e09c046e31e3
1 file changed