]> source.dussan.org Git - poi.git/commitdiff
Add unit test for bug 37625 which verifies that this file can now be loaded
authorDominik Stadler <centic@apache.org>
Sun, 27 Jul 2014 19:57:57 +0000 (19:57 +0000)
committerDominik Stadler <centic@apache.org>
Sun, 27 Jul 2014 19:57:57 +0000 (19:57 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1613837 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java
test-data/slideshow/37625.ppt [new file with mode: 0644]

index 03724726325b220cd463d73a3cf8cc983a17645f..c233077d385ac88538f19b600b70e9f4bf6f860e 100644 (file)
@@ -22,6 +22,8 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Date;
@@ -509,7 +511,7 @@ public final class TestBugs {
         /* Iterate over slides and extract text */
         for( Slide slide : _slides ) {
             HeadersFooters hf = slide.getHeadersFooters();
-            boolean visible = hf.isHeaderVisible(); // exception happens here
+            /*boolean visible =*/ hf.isHeaderVisible(); // exception happens here
         }
         assertTrue("No Exceptions while reading headers", true);
     }
@@ -547,4 +549,19 @@ public final class TestBugs {
         }
         assertEquals(1, str);
     }
+    
+    @Test
+    public void bug37625() throws IOException {
+        InputStream inputStream = new FileInputStream(_slTests.getFile("37625.ppt"));
+        try {
+            SlideShow slideShow = new SlideShow(inputStream);
+            assertEquals(29, slideShow.getSlides().length);
+            
+            SlideShow slideBack = HSLFTestDataSamples.writeOutAndReadBack(slideShow);
+            assertNotNull(slideBack);
+            assertEquals(29, slideBack.getSlides().length);
+        } finally {
+            inputStream.close();
+        }
+    }
 }
diff --git a/test-data/slideshow/37625.ppt b/test-data/slideshow/37625.ppt
new file mode 100644 (file)
index 0000000..d157798
Binary files /dev/null and b/test-data/slideshow/37625.ppt differ