]> source.dussan.org Git - poi.git/commitdiff
increase tolerance on rate test due to failures
authorPJ Fanning <fanningpj@apache.org>
Sat, 9 Apr 2022 11:37:36 +0000 (11:37 +0000)
committerPJ Fanning <fanningpj@apache.org>
Sat, 9 Apr 2022 11:37:36 +0000 (11:37 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1899679 13f79535-47bb-0310-9956-ffa450edef68

poi/src/test/java/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java

index 2e814d9c2b9b12d6833edbebbbf4b8d7d0be3fc5..98e10c0edc79066530d95a671af67a13163df066 100644 (file)
@@ -198,7 +198,9 @@ public final class TestFormulasFromSpreadsheet {
                    fail("Cannot expect formula as result of formula evaluation: " + msg);
                case NUMERIC:
                    assertEquals(CellType.NUMERIC, actValue.getCellType(), msg);
-                   TestMathX.assertDouble(msg, expValue.getNumericCellValue(), actValue.getNumberValue(), TestMathX.POS_ZERO, TestMathX.DIFF_TOLERANCE_FACTOR);
+                   final double tolerance = targetFunctionName.equalsIgnoreCase("RATE")
+                           ? 0.000001 : TestMathX.DIFF_TOLERANCE_FACTOR;
+                   TestMathX.assertDouble(msg, expValue.getNumericCellValue(), actValue.getNumberValue(), TestMathX.POS_ZERO, tolerance);
                    break;
                case STRING:
                    assertEquals(CellType.STRING, actValue.getCellType(), msg);