From 4682903e6ace561155a667e240b4736f89ab4805 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Sat, 9 Apr 2022 13:38:27 +0000 Subject: [PATCH] more test issues with rate change git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1899685 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java index bb7df1b287..9d478cedc6 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java @@ -213,10 +213,9 @@ public final class TestFormulaEvaluatorOnXSSF { fail("Cannot expect formula as result of formula evaluation: " + msg); case NUMERIC: assertEquals(CellType.NUMERIC, actValue.getCellType(), msg); - BaseTestNumeric.assertDouble(msg, expValue.getNumericCellValue(), actValue.getNumberValue(), BaseTestNumeric.POS_ZERO, BaseTestNumeric.DIFF_TOLERANCE_FACTOR); -// double delta = Math.abs(expValue.getNumericCellValue()-actValue.getNumberValue()); -// double pctExpValue = Math.abs(0.00001*expValue.getNumericCellValue()); -// assertTrue(msg, delta <= pctExpValue); + final double tolerance = targetFunctionName.equalsIgnoreCase("RATE") + ? 0.000001 : BaseTestNumeric.DIFF_TOLERANCE_FACTOR; + BaseTestNumeric.assertDouble(msg, expValue.getNumericCellValue(), actValue.getNumberValue(), BaseTestNumeric.POS_ZERO, tolerance); break; case STRING: assertEquals(CellType.STRING, actValue.getCellType(), msg);