Author: onealj
Date: Thu Sep 22 09:24:48 2016
New Revision: 1761873

URL: http://svn.apache.org/viewvc?rev=1761873&view=rev
Log:
bug 57843: add failing unit test: Word 6.0 (1993) fails with 
ArrayIndexOutOfBoundsException

Added:
    poi/trunk/test-data/document/57843.doc   (with props)
Modified:
    poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java
    
poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java

Modified: poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java?rev=1761873&r1=1761872&r2=1761873&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java (original)
+++ poi/trunk/src/integrationtest/org/apache/poi/TestAllFiles.java Thu Sep 22 
09:24:48 2016
@@ -232,6 +232,7 @@ public class TestAllFiles {
         EXPECTED_FAILURES.add("spreadsheet/43493.xls");
         EXPECTED_FAILURES.add("spreadsheet/46904.xls");
         EXPECTED_FAILURES.add("document/Bug50955.doc");
+        EXPECTED_FAILURES.add("document/57843.doc");
         EXPECTED_FAILURES.add("slideshow/PPT95.ppt");
         
EXPECTED_FAILURES.add("openxml4j/OPCCompliance_CoreProperties_DCTermsNamespaceLimitedUseFAIL.docx");
         
EXPECTED_FAILURES.add("openxml4j/OPCCompliance_CoreProperties_DoNotUseCompatibilityMarkupFAIL.docx");

Modified: 
poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java?rev=1761873&r1=1761872&r2=1761873&view=diff
==============================================================================
--- 
poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java 
(original)
+++ 
poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/usermodel/TestBugs.java 
Thu Sep 22 09:24:48 2016
@@ -32,11 +32,13 @@ import org.apache.poi.hwpf.model.PlexOfF
 import org.apache.poi.hwpf.model.SubdocumentType;
 import org.apache.poi.hwpf.model.io.HWPFOutputStream;
 import org.apache.poi.poifs.filesystem.NPOIFSFileSystem;
+import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.util.POILogFactory;
 import org.apache.poi.util.POILogger;
 
 import java.io.ByteArrayOutputStream;
+import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
@@ -901,4 +903,19 @@ public class TestBugs extends TestCase
         HWPFDocument hwpfDocument2 = 
HWPFTestDataSamples.writeOutAndReadBack(hwpfDocument);
         assertNotNull(hwpfDocument2);
     }
+    
+    public void test57843() throws IOException {
+        try {
+            File f = POIDataSamples.getDocumentInstance().getFile("57843.doc");
+            boolean readOnly = true;
+            POIFSFileSystem fs = new POIFSFileSystem(f, readOnly);
+            HWPFOldDocument doc = new HWPFOldDocument(fs);
+            assertNotNull(doc);
+            doc.close();
+            fs.close();
+            fixed("57843");
+        } catch (ArrayIndexOutOfBoundsException e) {
+            // expected until this bug is fixed
+        }
+    }
 }

Added: poi/trunk/test-data/document/57843.doc
URL: 
http://svn.apache.org/viewvc/poi/trunk/test-data/document/57843.doc?rev=1761873&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poi/trunk/test-data/document/57843.doc
------------------------------------------------------------------------------
    svn:mime-type = application/msword



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org
For additional commands, e-mail: commits-h...@poi.apache.org

Reply via email to