Details
Description
In TestGridmixRecord#binSortTest, the test expects the comparison result of WritableComparator.compareBytes, which uses UnsafeComparer, to be the integer difference rather than the documented "@return 0 if equal, < 0 if left is less than right, etc.".
TestGridmixRecord#binSortTest code snippet
final int chk = WritableComparator.compareBytes( out1.getData(), 0, out1.getLength(), out2.getData(), 0, out2.getLength()); assertEquals(chk, x.compareTo(y)); assertEquals(chk, cmp.compare( out1.getData(), 0, out1.getLength(), out2.getData(), 0, out2.getLength()));
The code snippet below shows the Unsafe comparator behavior for non-little-endian machines.
if (!littleEndian) { return lessThanUnsigned(lw, rw) ? -1 : 1; }