From: Dominik Stadler Date: Sun, 27 Jul 2014 19:57:57 +0000 (+0000) Subject: Add unit test for bug 37625 which verifies that this file can now be loaded X-Git-Tag: REL_3_11_BETA1~29 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=70695de82eb90adeaa3ea71fe7973749f2786578;p=poi.git Add unit test for bug 37625 which verifies that this file can now be loaded git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1613837 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java index 0372472632..c233077d38 100644 --- a/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java +++ b/src/scratchpad/testcases/org/apache/poi/hslf/usermodel/TestBugs.java @@ -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 index 0000000000..d157798671 Binary files /dev/null and b/test-data/slideshow/37625.ppt differ