[
https://issues.apache.org/jira/browse/HADOOP-10843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14089957#comment-14089957
]
Jinghui Wang commented on HADOOP-10843:
---------------------------------------
The problem was found long before filing this JIRA, so the information was
incorrect. I have updated the information.
> TestGridmixRecord unit tests failure on PowerPC
> -----------------------------------------------
>
> Key: HADOOP-10843
> URL: https://issues.apache.org/jira/browse/HADOOP-10843
> Project: Hadoop Common
> Issue Type: Bug
> Components: io
> Affects Versions: 2.2.0, 2.3.0, 2.4.0, 2.4.1
> Reporter: Jinghui Wang
> Assignee: Jinghui Wang
> Attachments: HADOOP-10843.patch
>
>
> 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
> {code}
> 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()));
> {code}
> The code snippet below shows the Unsafe comparator behavior for
> non-little-endian machines.
> {code}
> if (!littleEndian) {
> return lessThanUnsigned(lw, rw) ? -1 : 1;
> }
> {code}
> Also, for non-little-endian, UnsafeComparer does not return 0 when the byte
> arrays are equal.
--
This message was sent by Atlassian JIRA
(v6.2#6252)