diff options
author | Nick Burch <nick@apache.org> | 2015-02-08 15:17:47 +0000 |
---|---|---|
committer | Nick Burch <nick@apache.org> | 2015-02-08 15:17:47 +0000 |
commit | ff210628cc811e07f0b1476810fcd76526d17719 (patch) | |
tree | f77e2b80402f1b56293c8e667e16802e0501f387 | |
parent | dbe1ee7be6d4d837f65d6d087dad2a53054837f0 (diff) | |
download | poi-ff210628cc811e07f0b1476810fcd76526d17719.tar.gz poi-ff210628cc811e07f0b1476810fcd76526d17719.zip |
Add a unit test (disabled) for bug #57535 - "Unknown error type: -60" fetching formula error value
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1658186 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java | 21 | ||||
-rw-r--r-- | test-data/spreadsheet/57535.xlsx | bin | 0 -> 10175 bytes |
2 files changed, 21 insertions, 0 deletions
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 7ab9ff7d02..06af21cc85 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java @@ -2133,4 +2133,25 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { } } } + + /** + * "Unknown error type: -60" fetching formula error value + */ + @Test + public void bug57535() throws Exception { + Workbook wb = XSSFTestDataSamples.openSampleWorkbook("57535.xlsx"); + FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); + evaluator.clearAllCachedResultValues(); + + Sheet sheet = wb.getSheet("Sheet1"); + Cell cell = sheet.getRow(5).getCell(4); + assertEquals(Cell.CELL_TYPE_FORMULA, cell.getCellType()); + assertEquals("E4+E5", cell.getCellFormula()); + + CellValue value = evaluator.evaluate(cell); + assertEquals(Cell.CELL_TYPE_ERROR, value.getCellType()); + assertEquals(-60, value.getErrorValue()); + // TODO Fix this +// assertEquals("", FormulaError.forInt(value.getErrorValue()).toString()); + } } diff --git a/test-data/spreadsheet/57535.xlsx b/test-data/spreadsheet/57535.xlsx Binary files differnew file mode 100644 index 0000000000..897ef71ab0 --- /dev/null +++ b/test-data/spreadsheet/57535.xlsx |