]> source.dussan.org Git - poi.git/commitdiff
Added test to show that bug #41546 is already fixed. Also rename a test file to be...
authorNick Burch <nick@apache.org>
Wed, 19 Mar 2008 11:57:38 +0000 (11:57 +0000)
committerNick Burch <nick@apache.org>
Wed, 19 Mar 2008 11:57:38 +0000 (11:57 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@638803 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/hssf/data/41546.xls [new file with mode: 0644]
src/testcases/org/apache/poi/hssf/data/44593.xls [new file with mode: 0644]
src/testcases/org/apache/poi/hssf/data/Bug44593.xls [deleted file]
src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java

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 (file)
index 0000000..1332f3e
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 (file)
index 0000000..84d1311
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 (file)
index 84d1311..0000000
Binary files a/src/testcases/org/apache/poi/hssf/data/Bug44593.xls and /dev/null differ
index f06f591c425241aaa0dc70bb12251b53e73b8324..e7eff83e627a2f9f2d45e50696791022d479c7b3 100644 (file)
@@ -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