Skip to content

Commit

Permalink
Fix assertion test in AggregationTestUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
dain committed May 27, 2022
1 parent 61d6268 commit 25424a8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ public static void assertAggregation(TestingFunctionResolution functionResolutio
public static BiFunction<Object, Object, Boolean> makeValidityAssertion(Object expectedValue)
{
if (expectedValue instanceof Double && !expectedValue.equals(Double.NaN)) {
return (actual, expected) -> Precision.equals((double) actual, (double) expected, 1.0e-10);
return (actual, expected) -> actual != null && expected != null && Precision.equals((double) actual, (double) expected, 1.0e-10);
}
if (expectedValue instanceof Float && !expectedValue.equals(Float.NaN)) {
return (actual, expected) -> Precision.equals((float) actual, (float) expected, 1.0e-10f);
return (actual, expected) -> actual != null && expected != null && Precision.equals((float) actual, (float) expected, 1.0e-10f);
}
return Objects::equals;
}
Expand Down

0 comments on commit 25424a8

Please sign in to comment.