]> source.dussan.org Git - poi.git/commitdiff
Tweak 'assertAlmostEquals' bast on Jenkins results
authorNick Burch <nick@apache.org>
Fri, 18 Apr 2014 23:44:08 +0000 (23:44 +0000)
committerNick Burch <nick@apache.org>
Fri, 18 Apr 2014 23:44:08 +0000 (23:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1588595 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java

index a4bd4a5cf3438a650d50e3e31432b84515a72186..6df39bbe29cb828a8805359821a261c79a8c13a4 100644 (file)
@@ -2493,7 +2493,7 @@ public final class TestBugs extends BaseTestBugzillaIssues {
         
         // How close the sizing should be, given that not all
         //  systems will have quite the same fonts on them
-        int fontAccuracy = 25;
+        float fontAccuracy = 0.15f;
         
         // x%
         CellStyle iPercent = wb.createCellStyle();
@@ -2527,7 +2527,6 @@ public final class TestBugs extends BaseTestBugzillaIssues {
         }
         for (int i=0; i<12; i++) {
             s.autoSizeColumn(i);
-            System.out.println(i + " => " + s.getColumnWidth(i));
         }
         
         // Check the 0(.00)% ones
index 9083b7048fc4f60772204d9203cda4c5b7296768..bc80b64fa9720d403732723dcb9d1b47f2b2e20b 100644 (file)
@@ -40,8 +40,9 @@ public abstract class BaseTestBugzillaIssues {
         _testDataProvider = testDataProvider;
     }
     
-    public static void assertAlmostEquals(double expected, double actual, double fuzz) {
+    public static void assertAlmostEquals(double expected, double actual, float factor) {
         double diff = Math.abs(expected - actual);
+        double fuzz = expected * factor;
         if (diff > fuzz)
             fail(actual + " not within " + fuzz + " of " + expected);
     }