aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2015-06-20 11:29:14 +0000
committerDominik Stadler <centic@apache.org>2015-06-20 11:29:14 +0000
commitd8edfc6e370f0ba54ae13a7c78d6486e465a8dde (patch)
tree9adcd088759a1675fbb2f677f06daa5ed6a0a6bc /src/testcases
parent5562f55c778d87e674cce40b1ea72d2511849ce5 (diff)
downloadpoi-d8edfc6e370f0ba54ae13a7c78d6486e465a8dde.tar.gz
poi-d8edfc6e370f0ba54ae13a7c78d6486e465a8dde.zip
Bug 56420: Fix possible NullPointerException when empty cell is included in Sumif calculation
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1686564 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases')
-rw-r--r--src/testcases/org/apache/poi/ss/formula/functions/TestSumif.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestSumif.java b/src/testcases/org/apache/poi/ss/formula/functions/TestSumif.java
index 6cee5eab7c..c761d22f1a 100644
--- a/src/testcases/org/apache/poi/ss/formula/functions/TestSumif.java
+++ b/src/testcases/org/apache/poi/ss/formula/functions/TestSumif.java
@@ -21,6 +21,8 @@ import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
import org.apache.poi.ss.formula.eval.AreaEval;
+import org.apache.poi.ss.formula.eval.BlankEval;
+import org.apache.poi.ss.formula.eval.ErrorEval;
import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.NumericValueEval;
import org.apache.poi.ss.formula.eval.StringEval;
@@ -107,4 +109,11 @@ public final class TestSumif extends TestCase {
confirmDouble(60, ve);
}
+
+ public void testEvaluateException() {
+ assertEquals(ErrorEval.VALUE_INVALID, invokeSumif(-1, -1, BlankEval.instance, new NumberEval(30.0)));
+ assertEquals(ErrorEval.VALUE_INVALID, invokeSumif(-1, -1, BlankEval.instance, new NumberEval(30.0), new NumberEval(30.0)));
+ assertEquals(ErrorEval.VALUE_INVALID, invokeSumif(-1, -1, new NumberEval(30.0), BlankEval.instance, new NumberEval(30.0)));
+ assertEquals(ErrorEval.VALUE_INVALID, invokeSumif(-1, -1, new NumberEval(30.0), new NumberEval(30.0), BlankEval.instance));
+ }
}