--- /dev/null
+\r
+/* ====================================================================\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+ contributor license agreements. See the NOTICE file distributed with\r
+ this work for additional information regarding copyright ownership.\r
+ The ASF licenses this file to You under the Apache License, Version 2.0\r
+ (the "License"); you may not use this file except in compliance with\r
+ the License. You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+==================================================================== */\r
+package org.apache.poi.hslf.usermodel;\r
+\r
+import junit.framework.TestCase;\r
+import org.apache.poi.hslf.HSLFSlideShow;\r
+import org.apache.poi.hslf.model.Picture;\r
+\r
+import java.io.*;\r
+\r
+/**\r
+ * Testcases for bugs entered in bugzilla\r
+ * the Test name contains the bugzilla bug id\r
+ *\r
+ * @author Yegor Kozlov\r
+ */\r
+public class TestBugs extends TestCase {\r
+ protected String cwd = System.getProperty("HSLF.testdata.path");\r
+\r
+ /**\r
+ * Bug 41384: Array index wrong in record creation\r
+ */\r
+ public void test41384() throws Exception {\r
+ FileInputStream is = new FileInputStream(new File(cwd, "41384.ppt"));\r
+ HSLFSlideShow hslf = new HSLFSlideShow(is);\r
+ is.close();\r
+\r
+ SlideShow ppt = new SlideShow(hslf);\r
+ assertTrue("No Exceptions while reading file", true);\r
+\r
+ assertEquals(1, ppt.getSlides().length);\r
+\r
+ PictureData[] pict = ppt.getPictureData();\r
+ assertEquals(2, pict.length);\r
+ assertEquals(Picture.JPEG, pict[0].getType());\r
+ assertEquals(Picture.JPEG, pict[1].getType());\r
+ }\r
+}\r