From 054519db29a29b58ec1d786aa0241c6680fdaed5 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Thu, 3 Jul 2014 14:30:47 +0000 Subject: [PATCH] Add a disabled unit test for bug #56420 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1607661 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/xssf/usermodel/TestXSSFBugs.java | 17 +++++++++++++++++ test-data/spreadsheet/56420.xlsx | Bin 0 -> 9201 bytes 2 files changed, 17 insertions(+) create mode 100644 test-data/spreadsheet/56420.xlsx diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java index 71f462361c..13e6629b77 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java @@ -1565,6 +1565,23 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { File xlsOutput = TempFile.createTempFile("testBug53798", ".xls"); bug53798Work(wb, xlsOutput); } + + /** + * SUMIF was throwing a NPE on some formulas + */ + @Test + @Ignore("This bug is still to be fixed") + public void testBug56420SumIfNPE() throws Exception { + XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("56420.xlsx"); + + FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); + + Sheet sheet = wb.getSheetAt(0); + Row r = sheet.getRow(2); + Cell c = r.getCell(2); + assertEquals("SUMIF($A$1:$A$4,A3,$B$1:$B$4)", c.getCellFormula()); + evaluator.evaluateInCell(c); + } private void bug53798Work(Workbook wb, File xlsOutput) throws IOException { Sheet testSheet = wb.getSheetAt(0); diff --git a/test-data/spreadsheet/56420.xlsx b/test-data/spreadsheet/56420.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..bd1ceff966880ccc5b2182b2bb3a39c57eef099c GIT binary patch literal 9201 zcmeHNWmHsa+a9_bL>Rgb9fGvffD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