From 3d73fac22ef495681895712d668afc492c5fe52c Mon Sep 17 00:00:00 2001 From: Avik Sengupta Date: Fri, 22 Apr 2005 13:04:42 +0000 Subject: [PATCH] new tests git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353646 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/hssf/data/15573.xls | Bin 0 -> 14336 bytes .../apache/poi/hssf/usermodel/TestBugs.java | 46 ++++++++++++++++-- 2 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 src/testcases/org/apache/poi/hssf/data/15573.xls diff --git a/src/testcases/org/apache/poi/hssf/data/15573.xls b/src/testcases/org/apache/poi/hssf/data/15573.xls new file mode 100644 index 0000000000000000000000000000000000000000..172f255030ecd524bf3eec5bb557bd49f9ca9503 GIT binary patch literal 14336 zcmeHOYit}>75-*+*4}kedu-=H8fUXvr^N9iN*ib+l4duMSgjzBmQ+;WYV+D+Q`1DL z!&9_dN+g6pDy_srsst5}CXJL*kiwrzaS%d5s8B(p3jUDts3K^Ei$GA6Wcj``GrK$6 zxG@N-Lg%jT>)dnBJ@>ok-aB_Ze&%Q0=N^6X>gUlCHX(&ewJh42=nl(QM|B@;uhmqI z@+B;jl!X5w1hN@UWLp}S`krq8afwAv^7C-<9q%+#;5Uq8IEV~z=hXPbp^3^={`Cm& zG#mCfvSFGw-RO8MIe3KhPAoCodMxd=^a~*Y0~z&d!i_HscT`um_WPW47kJKBTc2=pXLyUptmBj21SG zjWjAbZv|IzU#$HDw^sJw5oao(9m_(dHEZK~qI%9-MMo&Kay4sfux`L0t_R8^gZYLr z9$wo#s%Qw+N9mQgc z2_+0+L#vv&6{e-x5GiRkr4QfK+!R(8421IP4PygQWo)(P=3APZh{W~)%@|Vw-`3nj zOzbqKM@CT9Dm=-*8l6V+^?oB^>$)L%4hw7*|FxF4 zJV>VVqHBR0{V!3|Ytyw8U5BnZFKRyfn=q&W? ztLP8A9{g&mro6k_W_eH5v%I(3ZaJ#3d_gr`+ihpS5p?4p?Xoh9yDJ~f-!opROda8I zv#&$MHjGvdPfT9>d3adC-w7T`JV3m~+f|vEnyl2&L55#&bQEKmW3-dskDdJU++e-1nP&=ck~+_@_p3Be zO1jw3!KmDA#`@HG;n>SR-?n#Wv264~qYqj7X`@ulFlhv?;e7CP#rd_>_$W&dRK8;&9zgW0B>KjWOd2ES2p+mBlWI zrV+H#QkS85EwqcK)zO491hq74GEp_@l`T;%YP;7}TUK(_cbCMe-Wr@Kq8(@vXDY@i z8ycKmjMJ-gK1VG6z813>ZB-Bb-_T zF*Z5+yLrPVw+AQfLQraAT_$}C&GW*U!k_Hga08iUceHqiOXt1bP9`@DoJ=kWd~Vss z3m5PGbur4j5I9-nRK{e#s3lJ56urCmo9<# z4ekURS-cOP<2liOu#Kz!0cShYQ-r*m56CM2#1Z~ACK(j98gPo6i4^&^n*_TjvUyd2f7*(bO_|l1AFH^!%hpBMVYV;e{9Z1|`o+FB-7hf~ zxNM@(g@u&)3ZDeN%jOrTOf!*kme*%N%Q9F{@&gV_{?`R>OH_X<08g`jCw!tF-E)<(~ZhN`Bv-$$f_>`3@=2!7K?00to^M0to^M0to^M z0to^M0to^M0to^M0&gk=bdT4)T6bgpU0)xg>1z|+taZ=V|Muw4t$Vrd?z+eGV;=i> zOm}^?>q{VAxucK5bm!N50e!2X_KS?llkmnv;8q;qZwh&A#of#g;p3dOxrask51D9G z@}qo4DKKp*MuRL!4?gkS=FR-(L%tBv-^bn$;Vyn8Ej#Xt$aBv5v0%M_*)dl^C-}~h z{{CJZ#)tXaV`IOWDBNi_i896i{5e3%>|ucYYYl1r%(Z`g55tdgEu{I?%mM5(8!9#f Q|C&AP|Bdn6(8K=!2{k$w;Q#;t 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 6f530233c..bcb2b0b1f 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java @@ -133,7 +133,6 @@ extends TestCase { /** test rewriting a file with large number of unique strings *open resulting file in Excel to check results!*/ public void test15375() { - try { String filename = System.getProperty("HSSF.testdata.path"); filename=filename+"/15375.xls"; @@ -177,8 +176,6 @@ extends TestCase { *open resulting file in Excel to check results!*/ public void test15375_2() throws Exception{ - - HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet(); @@ -263,7 +260,7 @@ extends TestCase { } - /*Double byte strings */ + /**Double byte strings */ public void test22742() throws java.io.IOException { String filename = System.getProperty("HSSF.testdata.path"); filename=filename+"/22742.xls"; @@ -420,7 +417,20 @@ extends TestCase { HSSFCell c2 = w.getSheetAt(0).getRow(2).getCell((short) 1); HSSFCell d1 = w.getSheetAt(0).getRow(3).getCell((short) 0); HSSFCell d2 = w.getSheetAt(0).getRow(3).getCell((short) 1); - + + /* // THAI code page + System.out.println("a1="+unicodeString(a1.getStringCellValue())); + System.out.println("a2="+unicodeString(a2.getStringCellValue())); + // US code page + System.out.println("b1="+unicodeString(b1.getStringCellValue())); + System.out.println("b2="+unicodeString(b2.getStringCellValue())); + // THAI+US + System.out.println("c1="+unicodeString(c1.getStringCellValue())); + System.out.println("c2="+unicodeString(c2.getStringCellValue())); + // US+THAI + System.out.println("d1="+unicodeString(d1.getStringCellValue())); + System.out.println("d2="+unicodeString(d2.getStringCellValue())); +*/ assertEquals("String Cell value", a1.getStringCellValue(), a2.getStringCellValue()); assertEquals("String Cell value", b1.getStringCellValue(), b2.getStringCellValue()); assertEquals("String Cell value", c1.getStringCellValue(), c2.getStringCellValue()); @@ -454,6 +464,32 @@ extends TestCase { assertEquals("Re-Written Formula String Cell value", d1.getStringCellValue(), rd2.getStringCellValue()); } + + private static String unicodeString(String ss) { + char s[] = ss.toCharArray(); + java.lang.StringBuffer sb=new java.lang.StringBuffer(); + for (int x=0;x