From 65a52c8e7c0cb6100f8e0015d28fe57c38a08ea1 Mon Sep 17 00:00:00 2001 From: Suresh Srinivas Date: Fri, 19 Oct 2012 22:55:20 +0000 Subject: [PATCH] HDFS-8948. Merging change 1400324 from trunk. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1400327 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../src/test/java/org/apache/hadoop/fs/TestFileUtil.java | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index fd2c05645b9..2d4c7b86661 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -107,6 +107,9 @@ Release 2.0.3-alpha - Unreleased HADOOP-8900. BuiltInGzipDecompressor throws IOException - stored gzip size doesn't match decompressed size. (Slavik Krassovsky via suresh) + HADOOP-8948. TestFileUtil.testGetDU fails on Windows due to incorrect + assumption of line separator. (Chris Nauroth via suresh) + Release 2.0.2-alpha - 2012-09-07 INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFileUtil.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFileUtil.java index 0b74baeb6e7..90db2d0526b 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFileUtil.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFileUtil.java @@ -472,7 +472,9 @@ public class TestFileUtil { setupDirs(); long du = FileUtil.getDU(TEST_DIR); - //Only two files (in partitioned) have 4 bytes each - Assert.assertEquals(du, 8); + // Only two files (in partitioned). Each has 3 characters + system-specific + // line separator. + long expected = 2 * (3 + System.getProperty("line.separator").length()); + Assert.assertEquals(expected, du); } }