Return-Path: X-Original-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F15F411ACA for ; Wed, 13 Aug 2014 00:00:17 +0000 (UTC) Received: (qmail 74398 invoked by uid 500); 13 Aug 2014 00:00:17 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 74356 invoked by uid 500); 13 Aug 2014 00:00:17 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 74282 invoked by uid 99); 13 Aug 2014 00:00:17 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Aug 2014 00:00:17 +0000 Date: Wed, 13 Aug 2014 00:00:17 +0000 (UTC) From: "Jinghui Wang (JIRA)" To: common-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HADOOP-10843) TestGridmixRecord unit tests failure on PowerPC MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HADOOP-10843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14094920#comment-14094920 ] Jinghui Wang commented on HADOOP-10843: --------------------------------------- Hi Colin, Thanks for the suggestion. I have attached a new patch. Yes, using Math.signum is much clearer. Only thing is that had to cast floats to ints (precision should not cause problems though) since assertEquals(float a, float b) was deprecated and causing run time errors. > 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: test, tools > Affects Versions: 2.2.0, 2.3.0, 2.4.0, 2.4.1 > Reporter: Jinghui Wang > Assignee: Jinghui Wang > Attachments: HADOOP-10843.1.patch, HADOOP-10843.2.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} -- This message was sent by Atlassian JIRA (v6.2#6252)