]> source.dussan.org Git - poi.git/commitdiff
Add a unit test (disabled) for bug #57535 - "Unknown error type: -60" fetching formul...
authorNick Burch <nick@apache.org>
Sun, 8 Feb 2015 15:17:47 +0000 (15:17 +0000)
committerNick Burch <nick@apache.org>
Sun, 8 Feb 2015 15:17:47 +0000 (15:17 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1658186 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
test-data/spreadsheet/57535.xlsx [new file with mode: 0644]

index 7ab9ff7d02443b304eafb7abe8a7e1583fc10486..06af21cc85df3530e487f10f9b5c2878a0114bbe 100644 (file)
@@ -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
new file mode 100644 (file)
index 0000000..897ef71
Binary files /dev/null and b/test-data/spreadsheet/57535.xlsx differ