]> source.dussan.org Git - poi.git/commitdiff
Add a disabled test for a file with whacky StyleRecords that trigger an AIOOB
authorNick Burch <nick@apache.org>
Thu, 21 Feb 2008 16:22:18 +0000 (16:22 +0000)
committerNick Burch <nick@apache.org>
Thu, 21 Feb 2008 16:22:18 +0000 (16:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@629849 13f79535-47bb-0310-9956-ffa450edef68

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

diff --git a/src/testcases/org/apache/poi/hssf/data/OddStyleRecord.xls b/src/testcases/org/apache/poi/hssf/data/OddStyleRecord.xls
new file mode 100644 (file)
index 0000000..dcaa79b
Binary files /dev/null and b/src/testcases/org/apache/poi/hssf/data/OddStyleRecord.xls differ
index 6dfdddad44f8042a3425ea6f771314f9164177dc..dc38824d39aca5c8f70e487e9de491205926bf35 100644 (file)
@@ -1089,6 +1089,24 @@ extends TestCase {
         //  "EmptyStackException"
         //assertEquals("=CHOOSE(2,A2,A3,A4)", c2.getCellFormula());
     }
+    
+    /**
+     * Date: Tue, 19 Feb 2008 05:03:47 -0800 (PST)
+     * From: Setya <jsetya@gmail.com>
+     * Subject: Exception when parsing excel file
+     */
+    public void BROKENtest20080219() throws Exception {
+        FileInputStream in = new FileInputStream(new File(cwd, "OddStyleRecord.xls"));
+        
+        // Blows up with an ArrayIndexOutOfBounds
+        //  when creating a StyleRecord
+        // However, our code matches the latest Microsoft
+        //  docs, so no idea what's wrong
+        HSSFWorkbook wb = new HSSFWorkbook(in);
+        in.close();
+        
+        assertEquals(1, wb.getNumberOfSheets());
+    }
 }