diff options
author | Josh Micich <josh@apache.org> | 2008-06-15 22:26:06 +0000 |
---|---|---|
committer | Josh Micich <josh@apache.org> | 2008-06-15 22:26:06 +0000 |
commit | 3572e116275ecf81331a594c5d473c62136296f8 (patch) | |
tree | 697621412803cf3f23b925d8aa5840c875f97e07 /src/testcases/org/apache/poi/hssf | |
parent | 0c30e98366627d72b504e4fcf038f593cc3166df (diff) | |
download | poi-3572e116275ecf81331a594c5d473c62136296f8.tar.gz poi-3572e116275ecf81331a594c5d473c62136296f8.zip |
added extra RVA test case (for bug 45206)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@668014 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/hssf')
-rw-r--r-- | src/testcases/org/apache/poi/hssf/data/testRVA.xls | bin | 32768 -> 32256 bytes | |||
-rw-r--r-- | src/testcases/org/apache/poi/hssf/model/TestRVA.java | 11 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/testcases/org/apache/poi/hssf/data/testRVA.xls b/src/testcases/org/apache/poi/hssf/data/testRVA.xls Binary files differindex 327edbb4cb..f23821117e 100644 --- a/src/testcases/org/apache/poi/hssf/data/testRVA.xls +++ b/src/testcases/org/apache/poi/hssf/data/testRVA.xls diff --git a/src/testcases/org/apache/poi/hssf/model/TestRVA.java b/src/testcases/org/apache/poi/hssf/model/TestRVA.java index f8c70eb7b8..ca74c6e2db 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestRVA.java +++ b/src/testcases/org/apache/poi/hssf/model/TestRVA.java @@ -23,7 +23,6 @@ import junit.framework.TestCase; import org.apache.poi.hssf.HSSFTestDataSamples; import org.apache.poi.hssf.record.formula.AttrPtg; import org.apache.poi.hssf.record.formula.Ptg; -import org.apache.poi.hssf.record.formula.RefPtgBase; import org.apache.poi.hssf.usermodel.FormulaExtractor; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFRow; @@ -60,7 +59,7 @@ public final class TestRVA extends TestCase { } String formula = cell.getCellFormula(); try { - confirmCell(cell, formula); + confirmCell(cell, formula, wb); } catch (AssertionFailedError e) { System.err.println("Problem with row[" + rowIx + "] formula '" + formula + "'"); System.err.println(e.getMessage()); @@ -79,9 +78,9 @@ public final class TestRVA extends TestCase { } } - private void confirmCell(HSSFCell formulaCell, String formula) { + private void confirmCell(HSSFCell formulaCell, String formula, HSSFWorkbook wb) { Ptg[] excelPtgs = FormulaExtractor.getPtgs(formulaCell); - Ptg[] poiPtgs = FormulaParser.parse(formula, null); + Ptg[] poiPtgs = FormulaParser.parse(formula, wb); int nExcelTokens = excelPtgs.length; int nPoiTokens = poiPtgs.length; if (nExcelTokens != nPoiTokens) { @@ -122,6 +121,10 @@ public final class TestRVA extends TestCase { } sb.append(NEW_LINE); } + if (false) { // set 'true' to see trace of RVA values + System.out.println(formula); + System.out.println(sb.toString()); + } if (hasMismatch) { throw new AssertionFailedError(sb.toString()); } |