From: Nick Burch Date: Wed, 19 Mar 2008 11:57:38 +0000 (+0000) Subject: Added test to show that bug #41546 is already fixed. Also rename a test file to be... X-Git-Tag: REL_3_0_3_BETA1~87 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=12120b87326d37304e1c23b415314f10312928c2;p=poi.git Added test to show that bug #41546 is already fixed. Also rename a test file to be more consistent git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@638803 13f79535-47bb-0310-9956-ffa450edef68 --- 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 0000000000..1332f3eef5 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/44593.xls b/src/testcases/org/apache/poi/hssf/data/44593.xls new file mode 100644 index 0000000000..84d1311441 Binary files /dev/null and b/src/testcases/org/apache/poi/hssf/data/44593.xls differ diff --git a/src/testcases/org/apache/poi/hssf/data/Bug44593.xls b/src/testcases/org/apache/poi/hssf/data/Bug44593.xls deleted file mode 100644 index 84d1311441..0000000000 Binary files a/src/testcases/org/apache/poi/hssf/data/Bug44593.xls and /dev/null differ diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java index f06f591c42..e7eff83e62 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