aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi/hssf
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2008-03-28 13:35:37 +0000
committerNick Burch <nick@apache.org>2008-03-28 13:35:37 +0000
commit2346793e150deb3f0c9b6db9f58e5490c6e3c1d1 (patch)
treeae25685aa4c75c821be078cc4253dd97da415484 /src/testcases/org/apache/poi/hssf
parentb4b120060177029c274cd5ee8bbd09cc51e371d6 (diff)
downloadpoi-2346793e150deb3f0c9b6db9f58e5490c6e3c1d1.tar.gz
poi-2346793e150deb3f0c9b6db9f58e5490c6e3c1d1.zip
Add test to show that bug #44693 is incorrect
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@642231 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/hssf')
-rw-r--r--src/testcases/org/apache/poi/hssf/data/44693.xlsbin0 -> 40448 bytes
-rw-r--r--src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java24
2 files changed, 24 insertions, 0 deletions
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
index 0000000000..dd954c63d6
--- /dev/null
+++ b/src/testcases/org/apache/poi/hssf/data/44693.xls
Binary files differ
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
index 05ba29d09e..94c19cbc04 100644
--- a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
+++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
@@ -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);
+ }
}