From 943dabce28ab5d0533f389a0d0fdc85c7dc3650e Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Thu, 6 Mar 2008 18:13:47 +0000 Subject: [PATCH] Add broken test for bug #43901 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@634372 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/hssf/usermodel/TestBugs.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java index 04c729b3be..0c48dfad04 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java @@ -1104,6 +1104,29 @@ extends TestCase { assertEquals(1, wb.getNumberOfSheets()); } + + /** + * POI is producing files with the wrong last-column + * number on the row + */ + public void BROKENtest43901() { + HSSFWorkbook book = new HSSFWorkbook(); + HSSFSheet sheet = book.createSheet("test"); + + // New row has last col -1 + HSSFRow row = sheet.createRow(0); + assertEquals(-1, row.getLastCellNum()); + if(row.getLastCellNum() == 0) { + fail("Identified bug 43901"); + } + + // Create two cells, will return one higher + // than that for the last number + row.createCell((short) 0); + assertEquals(1, row.getLastCellNum()); + row.createCell((short) 255); + assertEquals(256, row.getLastCellNum()); + } } -- 2.39.5