Guidance about binary / data files for JTREG tests

Wang Weijun at
Tue Apr 29 10:31:26 UTC 2014

On Apr 29, 2014, at 1:53, Brian Burkhalter <brian.burkhalter at> wrote:

> 1 - Binary test data files are in fact illegal to check in, correct?

They should be avoided as much as you can, but it's not illegal.

> Meanwhile I suppose that I could convert my test file and use the sun.misc.UU{En,De}coder classes to handle it in the test.

If I understand correctly, the reason why binary data is not preferable is not because they are not printable, but not human readable. Encoding them to BASE64 or HEX does not really solve the problem. What you need to do is precisely describing how to create the file so that a reader is able to recreate it.

Said that, I prefer HEX much more than binary, because it's Mercurial friendly, you can add comment, and HEX strings can be easily embedded inside a program so you can use ByteArrayInputStream instead of FileInputStream.


More information about the core-libs-dev mailing list