aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2019-12-14 13:10:12 +0000
committerDominik Stadler <centic@apache.org>2019-12-14 13:10:12 +0000
commit57b0576f63fffcbc55afc58e3e9d186d2d8c4e72 (patch)
tree526b31670569a1071223c717a81b2f56e500ea11 /src/testcases/org/apache
parent4c034f0e202ab6c3a56a2c30716d2c56f9be3311 (diff)
downloadpoi-57b0576f63fffcbc55afc58e3e9d186d2d8c4e72.tar.gz
poi-57b0576f63fffcbc55afc58e3e9d186d2d8c4e72.zip
Adjust some JavaDoc and fix some IDE warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1871505 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache')
-rw-r--r--src/testcases/org/apache/poi/ss/formula/eval/TestMinusZeroResult.java12
-rw-r--r--src/testcases/org/apache/poi/util/TestIOUtils.java9
2 files changed, 12 insertions, 9 deletions
diff --git a/src/testcases/org/apache/poi/ss/formula/eval/TestMinusZeroResult.java b/src/testcases/org/apache/poi/ss/formula/eval/TestMinusZeroResult.java
index 8e7af0312d..8ddead517f 100644
--- a/src/testcases/org/apache/poi/ss/formula/eval/TestMinusZeroResult.java
+++ b/src/testcases/org/apache/poi/ss/formula/eval/TestMinusZeroResult.java
@@ -68,19 +68,19 @@ public final class TestMinusZeroResult extends TestCase {
}
public void testTextRendering() {
- confirmTextRendering("-0", MINUS_ZERO);
+ confirmTextRendering(MINUS_ZERO);
// sub-normal negative numbers also display as '-0'
- confirmTextRendering("-0", Double.longBitsToDouble(0x8000100020003000L));
+ confirmTextRendering(Double.longBitsToDouble(0x8000100020003000L));
}
/**
* Uses {@link ConcatEval} to force number-to-text conversion
*/
- private static void confirmTextRendering(String expRendering, double d) {
+ private static void confirmTextRendering(double d) {
ValueEval[] args = { StringEval.EMPTY_INSTANCE, new NumberEval(d), };
StringEval se = (StringEval) EvalInstances.Concat.evaluate(args, -1, (short)-1);
String result = se.getStringValue();
- assertEquals(expRendering, result);
+ assertEquals("-0", result);
}
private static void checkEval(double expectedResult, Function instance, double... dArgs) {
@@ -104,12 +104,14 @@ public final class TestMinusZeroResult extends TestCase {
* Not really a POI test - just shows similar behaviour of '-0.0' in Java.
*/
public void testJava() {
-
assertEquals(0x8000000000000000L, Double.doubleToLongBits(MINUS_ZERO));
// The simple operators consider all zeros to be the same
+ //noinspection SimplifiableJUnitAssertion,ConstantConditions
assertTrue(MINUS_ZERO == MINUS_ZERO);
+ //noinspection SimplifiableJUnitAssertion,ConstantConditions
assertTrue(MINUS_ZERO == +0.0);
+ //noinspection ConstantConditions
assertFalse(MINUS_ZERO < +0.0);
// Double.compare() considers them different
diff --git a/src/testcases/org/apache/poi/util/TestIOUtils.java b/src/testcases/org/apache/poi/util/TestIOUtils.java
index a8e9bbfa37..1445cb9978 100644
--- a/src/testcases/org/apache/poi/util/TestIOUtils.java
+++ b/src/testcases/org/apache/poi/util/TestIOUtils.java
@@ -31,6 +31,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.io.PushbackInputStream;
import java.nio.ByteBuffer;
+import java.nio.charset.StandardCharsets;
import java.util.Random;
import org.apache.poi.EmptyFileException;
@@ -65,14 +66,14 @@ public final class TestIOUtils {
@Test
public void testPeekFirst8Bytes() throws Exception {
- assertArrayEquals("01234567".getBytes("UTF-8"),
- IOUtils.peekFirst8Bytes(new ByteArrayInputStream("0123456789".getBytes("UTF-8"))));
+ assertArrayEquals("01234567".getBytes(StandardCharsets.UTF_8),
+ IOUtils.peekFirst8Bytes(new ByteArrayInputStream("0123456789".getBytes(StandardCharsets.UTF_8))));
}
@Test
public void testPeekFirst8BytesWithPushbackInputStream() throws Exception {
- assertArrayEquals("01234567".getBytes("UTF-8"),
- IOUtils.peekFirst8Bytes(new PushbackInputStream(new ByteArrayInputStream("0123456789".getBytes("UTF-8")), 8)));
+ assertArrayEquals("01234567".getBytes(StandardCharsets.UTF_8),
+ IOUtils.peekFirst8Bytes(new PushbackInputStream(new ByteArrayInputStream("0123456789".getBytes(StandardCharsets.UTF_8)), 8)));
}
@Test