From abd5fcd9392c25059d4c53468b61ccdb8ca881c2 Mon Sep 17 00:00:00 2001 From: Yegor Kozlov Date: Sun, 2 Jun 2013 23:32:24 +0000 Subject: [PATCH] missing tests for Bug 55041 - CODE formula support git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1488810 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/ss/formula/eval/FunctionEval.java | 1 + .../TestCodeFunctionsFromSpreadsheet.java | 31 ++++++++++++++++++ .../spreadsheet/CodeFunctionTestCaseData.xls | Bin 0 -> 27648 bytes 3 files changed, 32 insertions(+) create mode 100644 src/testcases/org/apache/poi/ss/formula/functions/TestCodeFunctionsFromSpreadsheet.java create mode 100644 test-data/spreadsheet/CodeFunctionTestCaseData.xls diff --git a/src/java/org/apache/poi/ss/formula/eval/FunctionEval.java b/src/java/org/apache/poi/ss/formula/eval/FunctionEval.java index 1bae7ed2d..3ce3fe277 100644 --- a/src/java/org/apache/poi/ss/formula/eval/FunctionEval.java +++ b/src/java/org/apache/poi/ss/formula/eval/FunctionEval.java @@ -151,6 +151,7 @@ public final class FunctionEval { retval[118] = TextFunction.TRIM; retval[119] = new Replace(); retval[120] = new Substitute(); + retval[121] = new Code(); retval[124] = TextFunction.FIND; diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestCodeFunctionsFromSpreadsheet.java b/src/testcases/org/apache/poi/ss/formula/functions/TestCodeFunctionsFromSpreadsheet.java new file mode 100644 index 000000000..ade50d9d9 --- /dev/null +++ b/src/testcases/org/apache/poi/ss/formula/functions/TestCodeFunctionsFromSpreadsheet.java @@ -0,0 +1,31 @@ +/* ==================================================================== + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +==================================================================== */ + +package org.apache.poi.ss.formula.functions; + +/** + * Tests CODE() as loaded from a test data spreadsheet.

+ * + * @author cedric dot walter @ gmail dot com + */ +public class TestCodeFunctionsFromSpreadsheet extends BaseTestFunctionsFromSpreadsheet { + + @Override + protected String getFilename() { + return "CodeFunctionTestCaseData.xls"; + } +} \ No newline at end of file diff --git a/test-data/spreadsheet/CodeFunctionTestCaseData.xls b/test-data/spreadsheet/CodeFunctionTestCaseData.xls new file mode 100644 index 0000000000000000000000000000000000000000..1d31768e1a946f73afd47164742bdc9482ac45ee GIT binary patch literal 27648 zcmeHQ4RBo5bw0aVNh|*#%NW~$v7hB1NwzGEBpZW&Wc}FKjr=pV7)V3Ld0IVLTd#JN z{jqTd4@wKuPN8XH6PSYA{1B$oB;~(Ar?kMdlcXJ!mK27DdQ#FMluk0uK$B^c0^9Gq z_r2Y>Z{I%chD?%9_wL-?ch5WboO91P_uQX%pY#uZ-}d?!9=qbZ;z_%tLEg`|NRta5 z!gaq>UL?4m&$HWbelclC$zX;k!}D;wouLRkGA!qj+vIX3+hX;7srr6IVLq$AcgkY?U4Ie=k8eMgrbt)^?#hS09&oKQsZ>V4W^}Ini zM{WiGk#nmK{~-Ed-H;fX1i!-`eLiX5ihQnA{{{G;R)BxG0{r0$@CPcuAE^NUY6bWo zR)F7C0bWU-O7x#lbef?S<%b15{80tCmZuzF%To^jQUyAXRe(QP0sdDN;J;e|{^u3o zwaW8nicYjlKiW@P9QZwLZTHQ;Z@xtCRrvD?@X5*NRz0^$B2O!L6Jm(c^M3 zAM~|dw7r@zH}bQ~QU~87KSoohy{5>nf_|1ea1TDf;9&4aCp#{&5Ry(2Dv-$wX9JmR zcq1-Ve4|6Er1dEnnG`%?gKhi}ivIW>IPh`bV=t1`Rm_KOq_{sk~1Z6-V4h@ zj9(47A`cG!7&bRtf|*9RyaG{bs-P#-HE^IH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