]> source.dussan.org Git - poi.git/commitdiff
Add a test to show the bug #42618 appears to be incorrect
authorNick Burch <nick@apache.org>
Fri, 25 Jan 2008 16:33:59 +0000 (16:33 +0000)
committerNick Burch <nick@apache.org>
Fri, 25 Jan 2008 16:33:59 +0000 (16:33 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@615259 13f79535-47bb-0310-9956-ffa450edef68

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

diff --git a/src/testcases/org/apache/poi/hssf/data/SimpleWithChoose.xls b/src/testcases/org/apache/poi/hssf/data/SimpleWithChoose.xls
new file mode 100755 (executable)
index 0000000..96a8e74
Binary files /dev/null and b/src/testcases/org/apache/poi/hssf/data/SimpleWithChoose.xls differ
index d0dc7203e1f127ee18b15cc86723e8f31093673c..824715bf24ed69b4c12ef526f766f6a1dbec696c 100644 (file)
@@ -1008,9 +1008,27 @@ extends TestCase {
 
         wb = new HSSFWorkbook(new ByteArrayInputStream(out.toByteArray()));
         assertTrue("No Exceptions while reading file", true);
-
     }
 
+       /**
+        * Bug 42618: RecordFormatException reading a file containing
+        *      =CHOOSE(2,A2,A3,A4)
+        */
+    public void test42618() throws Exception {
+        FileInputStream in = new FileInputStream(new File(cwd, "SimpleWithChoose.xls"));
+        HSSFWorkbook wb = new HSSFWorkbook(in);
+        in.close();
+
+        assertTrue("No Exceptions while reading file", true);
+
+        //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);
+    }
 }