poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r675734 - /poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
Date Thu, 10 Jul 2008 21:03:53 GMT
Author: nick
Date: Thu Jul 10 14:03:52 2008
New Revision: 675734

URL: http://svn.apache.org/viewvc?rev=675734&view=rev
Log:
Add test for bug #43623, currently disabled as it makes FormulaParser unhappy

Modified:
    poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java

Modified: poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java?rev=675734&r1=675733&r2=675734&view=diff
==============================================================================
--- poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java (original)
+++ poi/trunk/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java Thu Jul 10 14:03:52
2008
@@ -1235,10 +1235,41 @@
     }
     
     /**
-     * Problem with "Vector Rows"
-     * @throws Exception
+     * Problem with "Vector Rows", eg a whole
+     *  column which is set to the result of
+     *  {=sin(B1:B9)}(9,1), so that each cell is
+     *  shown to have the contents
+     *  {=sin(B1:B9){9,1)[rownum][0]
+     * In this sample file, the vector column
+     *  is C, and the data column is B.
+     *  
+     * For now, blows up with an exception from ExtPtg
+     *  Expected ExpPtg to be converted from Shared to Non-Shared...
      */
-    public void test43623() throws Exception {
-    	
+    public void DISABLEDtest43623() throws Exception {
+        HSSFWorkbook wb = openSample("43623.xls");
+        assertEquals(1, wb.getNumberOfSheets());
+        
+        HSSFSheet s1 = wb.getSheetAt(0);
+        
+        HSSFCell c1 = s1.getRow(0).getCell(2);
+        HSSFCell c2 = s1.getRow(1).getCell(2);
+        HSSFCell c3 = s1.getRow(2).getCell(2);
+        
+        // These formula contents are a guess...
+        assertEquals("{=sin(B1:B9){9,1)[0][0]", c1.getCellFormula());
+        assertEquals("{=sin(B1:B9){9,1)[1][0]", c2.getCellFormula());
+        assertEquals("{=sin(B1:B9){9,1)[2][0]", c3.getCellFormula());
+        
+        // Save and re-open, ensure it still works
+    	HSSFWorkbook nwb = writeOutAndReadBack(wb);
+    	HSSFSheet ns1 = nwb.getSheetAt(0);
+        HSSFCell nc1 = ns1.getRow(0).getCell(2);
+        HSSFCell nc2 = ns1.getRow(1).getCell(2);
+        HSSFCell nc3 = ns1.getRow(2).getCell(2);
+        
+        assertEquals("{=sin(B1:B9){9,1)[0][0]", nc1.getCellFormula());
+        assertEquals("{=sin(B1:B9){9,1)[1][0]", nc2.getCellFormula());
+        assertEquals("{=sin(B1:B9){9,1)[2][0]", nc3.getCellFormula());
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message