From 5b291578bcc37418b47c3a9149a87909e1c96c36 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Fri, 10 Feb 2012 15:03:03 +0000 Subject: [PATCH] Disabled unit tests for bug #48703 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1242807 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/xssf/usermodel/TestXSSFBugs.java | 30 ++++++++++++++++++ .../apache/poi/hssf/usermodel/TestBugs.java | 23 ++++++++++++++ test-data/spreadsheet/48703.xls | Bin 0 -> 23040 bytes test-data/spreadsheet/48703.xlsx | Bin 0 -> 9349 bytes 4 files changed, 53 insertions(+) create mode 100644 test-data/spreadsheet/48703.xls create mode 100644 test-data/spreadsheet/48703.xlsx diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java index d163221d52..0a781748f9 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java @@ -1255,4 +1255,34 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { assertEquals(1, ref.getLastCell().getRow()); assertEquals(0, ref.getLastCell().getCol()); } + + /** + * Sum across multiple workbooks + * eg =SUM($Sheet1.C1:$Sheet4.C1) + * DISABLED As we can't currently evaluate these + */ + public void DISABLEDtest48703() throws Exception { + XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("48703.xlsx"); + XSSFSheet sheet = wb.getSheetAt(0); + + // Contains two forms, one with a range and one a list + XSSFRow r1 = sheet.getRow(0); + XSSFRow r2 = sheet.getRow(1); + XSSFCell c1 = r1.getCell(1); + XSSFCell c2 = r2.getCell(1); + + assertEquals(20.0, c1.getNumericCellValue()); + assertEquals("SUM(Sheet1!C1,Sheet2!C1,Sheet3!C1,Sheet4!C1)", c1.getCellFormula()); + + assertEquals(20.0, c2.getNumericCellValue()); + assertEquals("SUM(Sheet1:Sheet4!C1)", c2.getCellFormula()); + + // Try evaluating both + XSSFFormulaEvaluator eval = new XSSFFormulaEvaluator(wb); + eval.evaluateFormulaCell(c1); + eval.evaluateFormulaCell(c2); + + assertEquals(20.0, c1.getNumericCellValue()); + assertEquals(20.0, c2.getNumericCellValue()); + } } diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java index 63ae641a8a..5499af4a3f 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java @@ -2180,6 +2180,29 @@ if(1==2) { HSSFWorkbook wb = openSample("51670.xls"); writeOutAndReadBack(wb); } + + /** + * Sum across multiple workbooks + * eg =SUM($Sheet2.A1:$Sheet3.A1) + * DISABLED - We currently get the formula wrong, and mis-evaluate + */ + public void DISABLEDtest48703() { + HSSFWorkbook wb = openSample("48703.xls"); + assertEquals(3, wb.getNumberOfSheets()); + + // Check reading the formula + Sheet sheet = wb.getSheetAt(0); + Row r = sheet.getRow(0); + Cell c = r.getCell(0); + + assertEquals("SUM(Sheet2!A1:Sheet3!A1)", c.getCellFormula()); + assertEquals(4.0, c.getNumericCellValue()); + + // Check the evaluated result + HSSFFormulaEvaluator eval = new HSSFFormulaEvaluator(wb); + eval.evaluateFormulaCell(c); + assertEquals(4.0, c.getNumericCellValue()); + } /** * Normally encrypted files have BOF then FILEPASS, but diff --git a/test-data/spreadsheet/48703.xls b/test-data/spreadsheet/48703.xls new file mode 100644 index 0000000000000000000000000000000000000000..95f19eb0f12d26f1a185f8c35994ad6edcac48e4 GIT binary patch literal 23040 zcmeHPdu$xV8UOZtXRqTt>^z*evvJ})9NQ#!P6*_2PRu*bLl6`ypuw@vv1MaN&Y30^ zCWgX4g;H=Jw8Sk?KvfInT|!mbBoYFtI%rjhC}~8YN+~T>E7DdiC~*CKv$uD%vk%{u zrY*2z&ED>}Gr#YfZ@&3<=G$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4p38F3WVU zal4?QGI;83;Lwk8WqB<(x5^K3q2b&0E9iD9NOA{SSAoB+0NEj0dl^LDE6z5e?d%K( zV0Teyv5T$~7L+T&BWNd{q8v_HLDz^a#|Um}h-3CfVv zrW#m2QJr=p?i>v>uPMl15v6Yy#|0?eA<{eXh0^(=EXup_#nSl$SR62-2Kh8-nY9oT z>D9RPo1_s;Ge#60pjtMq<|mLymqQ8^#Dk0z>%ctfA%4%p=XDw41X#mdLE~K&oXVSE zAqJf;Bi?dAbYwc}ypCf0?iPEL5TJXOgX+}8hfKN^-E*r=v=GgPlJTtKWHKY#sZT{V zX?#R~@G80Jy!<=!5}5GK$e*6hBo5d6^nVwUl<&WH{(~^Zx zzroL`=a4bG6Rx5OzwBZ!LS}E#jyw^02pNxO`UWzhcJvVPB;+TM*^!?_C4Mc)F4^%> z5on{`W9PWBtF6CpcV9=+IDb!DqQ~@dci-@=ep5ppml*Z(gd^ID(d z1HA6%ebZZz`Gd79ka=x>4KlCyJCQkrybGD*0DF)*F7N=d6$dca=i^0vkUf8^0L*1M z_F#t2bEnbVX^h6AAcJ!dfrZ-E*WbOHW9_>|{U9CyodhY+K%jv@1Aztt4FnnpG!SSY z&_JMpKm&mWK6e`6bv!SZd0mXx^1N#gyHU(_Hm~#f+d|%}!b@phyYo7pw=40^6<+IC zAoDwaUhi95ta#1Oae-;b{Jkvye^~w=l0O;ePo#NiJ_p%Ao{P-)=izrgat$(n*}4#U z5%OYWzW)(2{|4zltAR_gZIO3k8rX`?-+uD;^FmT3Ma14PmWu7j(D{h%XyVBKU(uPk zA1&%OaPP-w20Mft-4;3TU;GEyEPs|E--`ERmlLN5T_!eh^7jSYcHV{EA!K4o?t=`o twDY(K{CN!V_{o<)e=jWt4}Kza9=P!bAlG6`Dfd8O@~r$f+Fvd4{}=nd@~Qv; literal 0 HcmV?d00001 diff --git a/test-data/spreadsheet/48703.xlsx b/test-data/spreadsheet/48703.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..258995345333c93e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