From: Nick Burch Date: Fri, 25 Jan 2008 16:33:59 +0000 (+0000) Subject: Add a test to show the bug #42618 appears to be incorrect X-Git-Tag: REL_3_0_3_BETA1~171 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9a7ef6ef753556eac12820b5759baa62fb6e0e73;p=poi.git Add a test to show the bug #42618 appears to be incorrect git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@615259 13f79535-47bb-0310-9956-ffa450edef68 --- 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 index 0000000000..96a8e743a8 Binary files /dev/null and b/src/testcases/org/apache/poi/hssf/data/SimpleWithChoose.xls differ diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java index d0dc7203e1..824715bf24 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java @@ -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); + } }