From e0b06b3510c52c863322c953ea1a6acd7b15d5b3 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Thu, 21 Feb 2008 16:22:18 +0000 Subject: [PATCH] Add a disabled test for a file with whacky StyleRecords that trigger an AIOOB git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@629849 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/hssf/data/OddStyleRecord.xls | Bin 0 -> 17408 bytes .../apache/poi/hssf/usermodel/TestBugs.java | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/testcases/org/apache/poi/hssf/data/OddStyleRecord.xls diff --git a/src/testcases/org/apache/poi/hssf/data/OddStyleRecord.xls b/src/testcases/org/apache/poi/hssf/data/OddStyleRecord.xls new file mode 100644 index 0000000000000000000000000000000000000000..dcaa79b5e1077145000128498fff0fba30dc08d8 GIT binary patch literal 17408 zcmeHPYiwM_6`omN@5{UESCX~k*WI-@yIzO2O@Q($#UYeOs6oUjP|>O;v6Db>f)j!w zQ8le-MXRdN77+e}KrL#2R8&x@swhe$eo%gd!VeHq1&Bw>&jJ#yPz$;JzBBjk-rc=^ ztwRxQ=4$TDoO|XwXU?2?+__%A^kVy)k3G5ZEmadPQBCTU6H{RyT_evZp-rg}GAy5R z9LErqLiSAf99iHK=*s?Mw9tvoi0tzSViYlk7)M-(m_SS-rVv{Z;R321u>-Lau?cZK z;s(StVi#gJ;zqrNE&xFs;0@tepxDKN)E?09%=had4%F4qAc#Nlg zd2U#&`ul(C|L6Sk+CN|1psrQdtLFKeOG!mW49iVIJzG^bjx9#Jx~YoRBD7yr(Go)YeibbVT2%E`>6a4P zRaLas0KPV%C9C+j*eO*lgNt8O9jW5uVi;G|`f&kmt*Oh!vQ^!Md&LGDP_wnhE?i7o zRkbc$T(KNi$>n0(T4U#puxYA>kBhOY(T|IBbB(R&0nIgjz{NYMs_n!JJe1<=SIveCl2|qp3lsBL@`RR{o)H3`Q_|tNk zr}Vfk*^uZ^7@HZ5(s9(H*LC62f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}1EcszPQGz`z+su6WX^<7$pZfYtJ|At literal 0 HcmV?d00001 diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java index 6dfdddad4..dc38824d3 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java @@ -1089,6 +1089,24 @@ extends TestCase { // "EmptyStackException" //assertEquals("=CHOOSE(2,A2,A3,A4)", c2.getCellFormula()); } + + /** + * Date: Tue, 19 Feb 2008 05:03:47 -0800 (PST) + * From: Setya + * Subject: Exception when parsing excel file + */ + public void BROKENtest20080219() throws Exception { + FileInputStream in = new FileInputStream(new File(cwd, "OddStyleRecord.xls")); + + // Blows up with an ArrayIndexOutOfBounds + // when creating a StyleRecord + // However, our code matches the latest Microsoft + // docs, so no idea what's wrong + HSSFWorkbook wb = new HSSFWorkbook(in); + in.close(); + + assertEquals(1, wb.getNumberOfSheets()); + } }