aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi/ss/formula/eval
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2018-12-25 10:00:21 +0000
committerDominik Stadler <centic@apache.org>2018-12-25 10:00:21 +0000
commitaccfb5a678dc1d4ca224659f0443ce2b9b0de1e5 (patch)
treea89fb585f282322e10bb2616fd4983b8f4a339c5 /src/testcases/org/apache/poi/ss/formula/eval
parent49f4ad6aba1afdcdf95845165501d66a87d429ec (diff)
downloadpoi-accfb5a678dc1d4ca224659f0443ce2b9b0de1e5.tar.gz
poi-accfb5a678dc1d4ca224659f0443ce2b9b0de1e5.zip
JavaDoc fixes/additions and some IDE warnings removed
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1849718 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/ss/formula/eval')
-rw-r--r--src/testcases/org/apache/poi/ss/formula/eval/TestOperandResolver.java32
1 files changed, 10 insertions, 22 deletions
diff --git a/src/testcases/org/apache/poi/ss/formula/eval/TestOperandResolver.java b/src/testcases/org/apache/poi/ss/formula/eval/TestOperandResolver.java
index 4e24f84e70..72fb29ca63 100644
--- a/src/testcases/org/apache/poi/ss/formula/eval/TestOperandResolver.java
+++ b/src/testcases/org/apache/poi/ss/formula/eval/TestOperandResolver.java
@@ -28,31 +28,23 @@ import junit.framework.TestCase;
public final class TestOperandResolver extends TestCase {
public void testParseDouble_bug48472() {
-
- String value = "-";
-
- Double resolvedValue = null;
+ final Double resolvedValue;
try {
- resolvedValue = OperandResolver.parseDouble(value);
+ resolvedValue = OperandResolver.parseDouble("-");
} catch (StringIndexOutOfBoundsException e) {
throw new AssertionFailedError("Identified bug 48472");
}
-
- assertEquals(null, resolvedValue);
-
+
+ assertNull(resolvedValue);
}
public void testParseDouble_bug49723() {
-
String value = ".1";
- Double resolvedValue = null;
-
- resolvedValue = OperandResolver.parseDouble(value);
+ Double resolvedValue = OperandResolver.parseDouble(value);
assertNotNull("Identified bug 49723", resolvedValue);
-
}
/**
@@ -61,14 +53,13 @@ public final class TestOperandResolver extends TestCase {
*
*/
public void testParseDoubleValidStrings() {
-
- String[] values = new String[]{".19", "0.19", "1.9", "1E4", "-.19", "-0.19", "8.5","-1E4", ".5E6","+1.5","+1E5", " +1E5 "};
-
+ String[] values = new String[]{".19", "0.19", "1.9", "1E4", "-.19", "-0.19",
+ "8.5","-1E4", ".5E6","+1.5","+1E5", " +1E5 ", " 123 ", "1E4", "-123" };
+
for (String value : values) {
- assertTrue(OperandResolver.parseDouble(value) != null);
+ assertNotNull(OperandResolver.parseDouble(value));
assertEquals(OperandResolver.parseDouble(value), Double.parseDouble(value));
}
-
}
/**
@@ -77,13 +68,10 @@ public final class TestOperandResolver extends TestCase {
*
*/
public void testParseDoubleInvalidStrings() {
-
String[] values = new String[]{"-", "ABC", "-X", "1E5a", "Infinity", "NaN", ".5F", "1,000"};
for (String value : values) {
- assertEquals(null, OperandResolver.parseDouble(value));
+ assertNull(OperandResolver.parseDouble(value));
}
-
}
-
}