From e90d940699f288ddfef5923f38cb619f6d6259f4 Mon Sep 17 00:00:00 2001 From: Colin McCabe Date: Thu, 14 Aug 2014 01:36:12 +0000 Subject: [PATCH] HADOOP-10843. TestGridmixRecord unit tests failure on PowerPC (Jinghui Wang via Colin Patrick McCabe) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1617860 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../hadoop/mapred/gridmix/TestGridmixRecord.java | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 6a0fbc596e..362c83e8f4 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -578,6 +578,9 @@ Release 2.6.0 - UNRELEASED HADOOP-10966. Hadoop Common native compilation broken in windows. (David Villegas via Arpit Agarwal) + HADOOP-10843. TestGridmixRecord unit tests failure on PowerPC (Jinghui Wang + via Colin Patrick McCabe) + Release 2.5.0 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-tools/hadoop-gridmix/src/test/java/org/apache/hadoop/mapred/gridmix/TestGridmixRecord.java b/hadoop-tools/hadoop-gridmix/src/test/java/org/apache/hadoop/mapred/gridmix/TestGridmixRecord.java index 2f3ce701d6..b3b72778f7 100644 --- a/hadoop-tools/hadoop-gridmix/src/test/java/org/apache/hadoop/mapred/gridmix/TestGridmixRecord.java +++ b/hadoop-tools/hadoop-gridmix/src/test/java/org/apache/hadoop/mapred/gridmix/TestGridmixRecord.java @@ -140,10 +140,10 @@ static void binSortTest(GridmixRecord x, GridmixRecord y, int min, final int chk = WritableComparator.compareBytes( out1.getData(), 0, out1.getLength(), out2.getData(), 0, out2.getLength()); - assertEquals(chk, x.compareTo(y)); - assertEquals(chk, cmp.compare( + assertEquals(Integer.signum(chk), Integer.signum(x.compareTo(y))); + assertEquals(Integer.signum(chk), Integer.signum(cmp.compare( out1.getData(), 0, out1.getLength(), - out2.getData(), 0, out2.getLength())); + out2.getData(), 0, out2.getLength()))); // write second copy, compare eq final int s1 = out1.getLength(); x.write(out1); @@ -153,8 +153,8 @@ static void binSortTest(GridmixRecord x, GridmixRecord y, int min, y.write(out2); assertEquals(0, cmp.compare(out2.getData(), 0, s2, out2.getData(), s2, out2.getLength() - s2)); - assertEquals(chk, cmp.compare(out1.getData(), 0, s1, - out2.getData(), s2, out2.getLength() - s2)); + assertEquals(Integer.signum(chk), Integer.signum(cmp.compare(out1.getData(), 0, s1, + out2.getData(), s2, out2.getLength() - s2))); } }