]> source.dussan.org Git - poi.git/commitdiff
Add test to show that bug #44693 is incorrect
authorNick Burch <nick@apache.org>
Fri, 28 Mar 2008 13:35:37 +0000 (13:35 +0000)
committerNick Burch <nick@apache.org>
Fri, 28 Mar 2008 13:35:37 +0000 (13:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@642231 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/hssf/data/44693.xls [new file with mode: 0644]
src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java

diff --git a/src/testcases/org/apache/poi/hssf/data/44693.xls b/src/testcases/org/apache/poi/hssf/data/44693.xls
new file mode 100644 (file)
index 0000000..dd954c6
Binary files /dev/null and b/src/testcases/org/apache/poi/hssf/data/44693.xls differ
index 05ba29d09eab6aa01462ce1d21f817d11b77d534..94c19cbc04cd5a7982d4565d61ee0a4a275c91f3 100644 (file)
@@ -1218,6 +1218,30 @@ extends TestCase {
         
         assertEquals(1, wb.getNumberOfSheets());
     }
+    
+    /**
+     * User reported the wrong number of rows from the
+     *  iterator, but we can't replicate that
+     */
+    public void test44693() throws Exception {
+        FileInputStream in = new FileInputStream(new File(cwd, "44693.xls"));
+        
+        HSSFWorkbook wb = new HSSFWorkbook(in);
+        HSSFSheet s = wb.getSheetAt(0);
+
+        // Rows are 1 to 713
+        assertEquals(0, s.getFirstRowNum());
+        assertEquals(712, s.getLastRowNum());
+        assertEquals(713, s.getPhysicalNumberOfRows());
+        
+        // Now check the iterator
+        int rowsSeen = 0;
+        for(Iterator i = s.rowIterator(); i.hasNext(); ) {
+               HSSFRow r = (HSSFRow)i.next();
+               rowsSeen++;
+        }
+        assertEquals(713, rowsSeen);
+    }
 }