use of com.google.common.annotations.GwtIncompatible in project guava by google.
the class DoubleMathTest method testNullPointers.
// NullPointerTester
@GwtIncompatible
public void testNullPointers() {
NullPointerTester tester = new NullPointerTester();
tester.setDefault(double.class, 3.0);
tester.testAllPublicStaticMethods(DoubleMath.class);
}
use of com.google.common.annotations.GwtIncompatible in project guava by google.
the class DoubleMathTest method testRoundNaNToIntAlwaysFails.
// DoubleMath.roundToInt(double, RoundingMode)
@GwtIncompatible
public void testRoundNaNToIntAlwaysFails() {
for (RoundingMode mode : ALL_ROUNDING_MODES) {
try {
DoubleMath.roundToInt(Double.NaN, mode);
fail("Expected ArithmeticException");
} catch (ArithmeticException expected) {
}
}
}
use of com.google.common.annotations.GwtIncompatible in project guava by google.
the class DoubleMathTest method testRoundFractionalDoubleToInt.
// DoubleMath.roundToInt(double, RoundingMode)
@GwtIncompatible
public void testRoundFractionalDoubleToInt() {
for (double d : FRACTIONAL_DOUBLE_CANDIDATES) {
for (RoundingMode mode : ALL_SAFE_ROUNDING_MODES) {
BigDecimal expected = new BigDecimal(d).setScale(0, mode);
boolean isInBounds = expected.compareTo(MAX_INT_AS_BIG_DECIMAL) <= 0 & expected.compareTo(MIN_INT_AS_BIG_DECIMAL) >= 0;
try {
assertEquals("Rounding " + d + " with mode " + mode, expected.intValue(), DoubleMath.roundToInt(d, mode));
assertTrue(isInBounds);
} catch (ArithmeticException e) {
assertFalse(isInBounds);
}
}
}
}
use of com.google.common.annotations.GwtIncompatible in project guava by google.
the class DoubleMathTest method testRoundNaNToBigIntegerAlwaysFails.
// DoubleMath.roundToBigInteger(double, RoundingMode)
@GwtIncompatible
public void testRoundNaNToBigIntegerAlwaysFails() {
for (RoundingMode mode : ALL_ROUNDING_MODES) {
try {
DoubleMath.roundToBigInteger(Double.NaN, mode);
fail("Expected ArithmeticException");
} catch (ArithmeticException expected) {
}
}
}
use of com.google.common.annotations.GwtIncompatible in project guava by google.
the class DoubleMathTest method testRoundInfiniteToBigIntegerAlwaysFails.
// DoubleMath.roundToBigInteger(double, RoundingMode)
@GwtIncompatible
public void testRoundInfiniteToBigIntegerAlwaysFails() {
for (RoundingMode mode : ALL_ROUNDING_MODES) {
try {
DoubleMath.roundToBigInteger(Double.POSITIVE_INFINITY, mode);
fail("Expected ArithmeticException");
} catch (ArithmeticException expected) {
}
try {
DoubleMath.roundToBigInteger(Double.NEGATIVE_INFINITY, mode);
fail("Expected ArithmeticException");
} catch (ArithmeticException expected) {
}
}
}
Aggregations