aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2020-10-20 16:08:29 +0000
committerPJ Fanning <fanningpj@apache.org>2020-10-20 16:08:29 +0000
commit02da9fd353991497d8e56dac5f5396f5df2ad78d (patch)
treed65c742f0103bf0c4a472aa3e335e0fc925f2f56 /src
parentdd9f132c232c24d939adba5065280fbba0e4ed42 (diff)
downloadpoi-02da9fd353991497d8e56dac5f5396f5df2ad78d.tar.gz
poi-02da9fd353991497d8e56dac5f5396f5df2ad78d.zip
reformat
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1882708 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/testcases/org/apache/poi/ss/formula/functions/TestTrunc.java82
1 files changed, 41 insertions, 41 deletions
diff --git a/src/testcases/org/apache/poi/ss/formula/functions/TestTrunc.java b/src/testcases/org/apache/poi/ss/formula/functions/TestTrunc.java
index c8f4d90f5f..50d0adabc9 100644
--- a/src/testcases/org/apache/poi/ss/formula/functions/TestTrunc.java
+++ b/src/testcases/org/apache/poi/ss/formula/functions/TestTrunc.java
@@ -30,56 +30,56 @@ import org.junit.Test;
* @author Stephen Wolke (smwolke at geistig.com)
*/
public final class TestTrunc extends BaseTestNumeric {
- private static final NumericFunction F = null;
+ private static final NumericFunction F = null;
- @Test
- public void testTruncWithStringArg() {
+ @Test
+ public void testTruncWithStringArg() {
- ValueEval strArg = new StringEval("abc");
- ValueEval[] args = { strArg, new NumberEval(2) };
- ValueEval result = NumericFunction.TRUNC.evaluate(args, -1, (short)-1);
- Assert.assertEquals(ErrorEval.VALUE_INVALID, result);
- }
+ ValueEval strArg = new StringEval("abc");
+ ValueEval[] args = { strArg, new NumberEval(2) };
+ ValueEval result = NumericFunction.TRUNC.evaluate(args, -1, (short)-1);
+ Assert.assertEquals(ErrorEval.VALUE_INVALID, result);
+ }
- @Test
- public void testTruncWithWholeNumber() {
- ValueEval[] args = { new NumberEval(200), new NumberEval(2) };
- @SuppressWarnings("static-access")
- ValueEval result = F.TRUNC.evaluate(args, -1, (short)-1);
- assertEquals("TRUNC", (new NumberEval(200d)).getNumberValue(), ((NumberEval)result).getNumberValue());
- }
+ @Test
+ public void testTruncWithWholeNumber() {
+ ValueEval[] args = { new NumberEval(200), new NumberEval(2) };
+ @SuppressWarnings("static-access")
+ ValueEval result = F.TRUNC.evaluate(args, -1, (short)-1);
+ assertEquals("TRUNC", (new NumberEval(200d)).getNumberValue(), ((NumberEval)result).getNumberValue());
+ }
- @Test
- public void testTruncWithDecimalNumber() {
- ValueEval[] args = { new NumberEval(2.612777), new NumberEval(3) };
- @SuppressWarnings("static-access")
- ValueEval result = F.TRUNC.evaluate(args, -1, (short)-1);
- assertEquals("TRUNC", (new NumberEval(2.612d)).getNumberValue(), ((NumberEval)result).getNumberValue());
- }
+ @Test
+ public void testTruncWithDecimalNumber() {
+ ValueEval[] args = { new NumberEval(2.612777), new NumberEval(3) };
+ @SuppressWarnings("static-access")
+ ValueEval result = F.TRUNC.evaluate(args, -1, (short)-1);
+ assertEquals("TRUNC", (new NumberEval(2.612d)).getNumberValue(), ((NumberEval)result).getNumberValue());
+ }
- @Test
- public void testTruncWithProblematicDecimalNumber() {
- ValueEval[] args = { new NumberEval(0.29), new NumberEval(2) };
- ValueEval result = NumericFunction.TRUNC.evaluate(args, -1, (short)-1);
- assertEquals("TRUNC", (new NumberEval(0.29d)).getNumberValue(), ((NumberEval)result).getNumberValue());
- }
+ @Test
+ public void testTruncWithProblematicDecimalNumber() {
+ ValueEval[] args = { new NumberEval(0.29), new NumberEval(2) };
+ ValueEval result = NumericFunction.TRUNC.evaluate(args, -1, (short)-1);
+ assertEquals("TRUNC", (new NumberEval(0.29d)).getNumberValue(), ((NumberEval)result).getNumberValue());
+ }
- @Test
- public void testTruncWithProblematicCalculationResult() {
+ @Test
+ public void testTruncWithProblematicCalculationResult() {
- ValueEval[] args = { new NumberEval(21.624d / 24d + .009d), new NumberEval(2) };
- ValueEval result = NumericFunction.TRUNC.evaluate(args, -1, (short)-1);
- assertEquals("TRUNC", (new NumberEval(0.91d)).getNumberValue(), ((NumberEval)result).getNumberValue());
- }
+ ValueEval[] args = { new NumberEval(21.624d / 24d + .009d), new NumberEval(2) };
+ ValueEval result = NumericFunction.TRUNC.evaluate(args, -1, (short)-1);
+ assertEquals("TRUNC", (new NumberEval(0.91d)).getNumberValue(), ((NumberEval)result).getNumberValue());
+ }
- @Test
- public void testTruncWithDecimalNumberOneArg() {
- ValueEval[] args = { new NumberEval(2.612777) };
- ValueEval result = NumericFunction.TRUNC.evaluate(args, -1, (short)-1);
- assertEquals("TRUNC", (new NumberEval(2d)).getNumberValue(), ((NumberEval)result).getNumberValue());
- }
+ @Test
+ public void testTruncWithDecimalNumberOneArg() {
+ ValueEval[] args = { new NumberEval(2.612777) };
+ ValueEval result = NumericFunction.TRUNC.evaluate(args, -1, (short)-1);
+ assertEquals("TRUNC", (new NumberEval(2d)).getNumberValue(), ((NumberEval)result).getNumberValue());
+ }
- @Test
+ @Test
public void testNegative() {
ValueEval[] args = { new NumberEval(-8.9), new NumberEval(0) };
@SuppressWarnings("static-access")