]> source.dussan.org Git - poi.git/commitdiff
Update bug reference numbers, and bring over part of a test from unfixed that is...
authorNick Burch <nick@apache.org>
Fri, 18 Jul 2014 17:27:37 +0000 (17:27 +0000)
committerNick Burch <nick@apache.org>
Fri, 18 Jul 2014 17:27:37 +0000 (17:27 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1611728 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/hssf/HSSFTestDataSamples.java
src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
src/testcases/org/apache/poi/hssf/usermodel/TestHSSFFormulaEvaluator.java
src/testcases/org/apache/poi/hssf/usermodel/TestUnfixedBugs.java

index f684676e9154557fe7bdc7886b301345f910ec78..ecbf890ab198a545307b107b9cf53fdaa69a9a22 100644 (file)
@@ -58,7 +58,6 @@ public final class HSSFTestDataSamples {
         * Useful for verifying that the serialisation round trip
         */
        public static HSSFWorkbook writeOutAndReadBack(HSSFWorkbook original) {
-
                try {
                        ByteArrayOutputStream baos = new ByteArrayOutputStream(4096);
                        original.write(baos);
index c4c024a7e3f4b13741ca9330a6756814c5046f54..9421b5634800f98b8b09acb5711614142d3188bc 100644 (file)
@@ -2383,6 +2383,31 @@ public final class TestBugs extends BaseTestBugzillaIssues {
         writeOutAndReadBack(workbook);
     }
     
+    /**
+     * Note - part of this test is still failing, see
+     * {@link TestUnfixedBugs#test49612()}
+     */
+    @Test
+    public void bug49612_part() throws IOException {
+        HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("49612.xls");
+        HSSFSheet sh = wb.getSheetAt(0);
+        HSSFRow row = sh.getRow(0);
+        HSSFCell c1 = row.getCell(2);
+        HSSFCell d1 = row.getCell(3);
+        HSSFCell e1 = row.getCell(2);
+
+        assertEquals("SUM(BOB+JIM)", c1.getCellFormula());
+
+        // Problem 1: See TestUnfixedBugs#test49612()
+        // Problem 2: TestUnfixedBugs#test49612()
+
+        // Problem 3: These used to fail, now pass
+        HSSFFormulaEvaluator eval = new HSSFFormulaEvaluator(wb);
+        assertEquals("evaluating c1", 30.0, eval.evaluate(c1).getNumberValue(), 0.001);
+        assertEquals("evaluating d1", 30.0, eval.evaluate(d1).getNumberValue(), 0.001);
+        assertEquals("evaluating e1", 30.0, eval.evaluate(e1).getNumberValue(), 0.001);
+    }
+    
     @Test
     public void bug51675(){
         final List<Short> list = new ArrayList<Short>();
@@ -2640,7 +2665,7 @@ public final class TestBugs extends BaseTestBugzillaIssues {
         
         assertEquals("Defines!NR_To_A1", cRefSName.getCellFormula());
         
-        // TODO How does Excel know to prefix this with the filename?
+        // TODO Correct this, so that the filename is shown too, see bug #56742
         // This is what Excel itself shows
         //assertEquals("'56737.xls'!NR_Global_B2", cRefWName.getCellFormula());
         // TODO This isn't right, but it's what we currently generate....
index 20ce8fa8063079ca6e22a828c6a783c8fe1ce1bc..2388f88aed425d9d8ef998bdec89499a6f1d38b5 100644 (file)
@@ -197,9 +197,8 @@ public final class TestHSSFFormulaEvaluator extends BaseTestFormulaEvaluator {
       assertEquals(Cell.CELL_TYPE_FORMULA, cell.getCellType());
       assertEquals(Cell.CELL_TYPE_NUMERIC, cell.getCachedFormulaResultType());
       assertEquals(36.90, cell.getNumericCellValue(), 0.0001);
-      // WARNING - this is wrong!
-      // The file name should be showing, but bug #45970 is fixed
-      //  we seem to loose it
+      // TODO Correct this!
+      // The file name should be shown too, see bug #56742
       assertEquals("Cost*Markup_Cost", cell.getCellFormula());
       
       
index e62909eddf02ebecc76453bd88e7b873f0d91bff..7b101affeb769f77ee502d67851b3091f4f50e68 100644 (file)
@@ -18,7 +18,6 @@
 package org.apache.poi.hssf.usermodel;
 
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 
 import junit.framework.AssertionFailedError;
 import junit.framework.TestCase;
@@ -50,6 +49,10 @@ public final class TestUnfixedBugs extends TestCase {
                }
        }
 
+       /**
+        * Note - some parts of this bug have been fixed, and have been
+        * transfered over to {@link TestBugs#bug49612_part()}
+        */
     public void test49612() throws IOException {
         HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("49612.xls");
         HSSFSheet sh = wb.getSheetAt(0);
@@ -60,21 +63,15 @@ public final class TestUnfixedBugs extends TestCase {
 
         assertEquals("SUM(BOB+JIM)", c1.getCellFormula());
 
-        // Problem 1: java.lang.ArrayIndexOutOfBoundsException in org.apache.poi.hssf.model.LinkTable$ExternalBookBlock.getNameText
+        // Problem 1: Filename missing, see bug #56742
         assertEquals("SUM('49612.xls'!BOB+'49612.xls'!JIM)", d1.getCellFormula());
 
-        //Problem 2
+        //Problem 2: Filename missing, see bug #56742
         //junit.framework.ComparisonFailure:
         //Expected :SUM('49612.xls'!BOB+'49612.xls'!JIM)
         //Actual   :SUM(BOB+JIM)
         assertEquals("SUM('49612.xls'!BOB+'49612.xls'!JIM)", e1.getCellFormula());
-
-        HSSFFormulaEvaluator eval = new HSSFFormulaEvaluator(wb);
-        assertEquals("evaluating c1", 30., eval.evaluate(c1).getNumberValue());
-
-        //Problem 3:  java.lang.RuntimeException: Unexpected arg eval type (org.apache.poi.hssf.record.formula.eval.NameXEval)
-        assertEquals("evaluating d1", 30., eval.evaluate(d1).getNumberValue());
-
-        assertEquals("evaluating e1", 30., eval.evaluate(e1).getNumberValue());
+        
+        // Problem 3 - fixed and transfered
     }
 }