diff options
Diffstat (limited to 'android/guava-tests/test/com/google/common/math/StatsTesting.java')
-rw-r--r-- | android/guava-tests/test/com/google/common/math/StatsTesting.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/android/guava-tests/test/com/google/common/math/StatsTesting.java b/android/guava-tests/test/com/google/common/math/StatsTesting.java index dddf20f94..1dc0235f9 100644 --- a/android/guava-tests/test/com/google/common/math/StatsTesting.java +++ b/android/guava-tests/test/com/google/common/math/StatsTesting.java @@ -17,6 +17,7 @@ package com.google.common.math; import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.truth.Truth.assertThat; import static java.lang.Double.NEGATIVE_INFINITY; import static java.lang.Double.NaN; @@ -39,8 +40,8 @@ import java.util.List; * @author Pete Gillin */ class StatsTesting { - - static final double ALLOWED_ERROR = 1e-10; + // TODO(cpovirk): Convince myself that this larger error makes sense. + static final double ALLOWED_ERROR = isAndroid() ? .25 : 1e-10; // Inputs and their statistics: @@ -501,5 +502,9 @@ class StatsTesting { return accumulator; } + private static boolean isAndroid() { + return checkNotNull(System.getProperty("java.runtime.name", "")).contains("Android"); + } + private StatsTesting() {} } |