diff --git a/src/testcases/org/apache/poi/hssf/data/41546.xls b/src/testcases/org/apache/poi/hssf/data/41546.xls new file mode 100644 index 000000000..1332f3eef Binary files /dev/null and b/src/testcases/org/apache/poi/hssf/data/41546.xls differ diff --git a/src/testcases/org/apache/poi/hssf/data/Bug44593.xls b/src/testcases/org/apache/poi/hssf/data/44593.xls similarity index 100% rename from src/testcases/org/apache/poi/hssf/data/Bug44593.xls rename to src/testcases/org/apache/poi/hssf/data/44593.xls diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java index f06f591c4..e7eff83e6 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java @@ -1034,6 +1034,28 @@ extends TestCase { assertTrue("No Exceptions while reading file", true); } + /** + * Bug 41546: Constructing HSSFWorkbook is failed, + * Unknown Ptg in Formula: 0x1a (26) + */ + public void test41546() throws Exception { + FileInputStream in = new FileInputStream(new File(cwd, "41546.xls")); + HSSFWorkbook wb = new HSSFWorkbook(in); + in.close(); + + assertTrue("No Exceptions while reading file", true); + assertEquals(1, wb.getNumberOfSheets()); + + //serialize and read again + ByteArrayOutputStream out = new ByteArrayOutputStream(); + wb.write(out); + out.close(); + + wb = new HSSFWorkbook(new ByteArrayInputStream(out.toByteArray())); + assertTrue("No Exceptions while reading file", true); + assertEquals(1, wb.getNumberOfSheets()); + } + /** * Bug 42564: Some files from Access were giving a RecordFormatException * when reading the BOFRecord @@ -1157,7 +1179,7 @@ extends TestCase { * probably due to dropdowns */ public void test44593() throws Exception { - FileInputStream in = new FileInputStream(new File(cwd, "Bug44593.xls")); + FileInputStream in = new FileInputStream(new File(cwd, "44593.xls")); // Used to blow up with an IllegalArgumentException // when creating a DVRecord