Skip to content

Commit f141088

Browse files
PropertyQueryTest: avg pos/neg overflow is [NaN -> (-)Infinity].
1 parent f3e547e commit f141088

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/objectbox-java-test/src/test/java/io/objectbox/query/PropertyQueryTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -603,8 +603,8 @@ public void avg_positiveOverflow() {
603603
putTestEntityFloat(1, 1);
604604

605605
Query<TestEntity> baseQuery = box.query().build();
606-
assertEquals(Float.NaN, baseQuery.property(simpleFloat).avg(), 0.001);
607-
assertEquals(Double.NaN, baseQuery.property(simpleDouble).avg(), 0.001);
606+
assertEquals(Float.POSITIVE_INFINITY, baseQuery.property(simpleFloat).avg(), 0.001);
607+
assertEquals(Double.POSITIVE_INFINITY, baseQuery.property(simpleDouble).avg(), 0.001);
608608
}
609609

610610
@Test
@@ -613,8 +613,8 @@ public void avg_negativeOverflow() {
613613
putTestEntityFloat(-1, -1);
614614

615615
Query<TestEntity> baseQuery = box.query().build();
616-
assertEquals(Float.NaN, baseQuery.property(simpleFloat).avg(), 0.001);
617-
assertEquals(Double.NaN, baseQuery.property(simpleDouble).avg(), 0.001);
616+
assertEquals(Float.NEGATIVE_INFINITY, baseQuery.property(simpleFloat).avg(), 0.001);
617+
assertEquals(Double.NEGATIVE_INFINITY, baseQuery.property(simpleDouble).avg(), 0.001);
618618
}
619619

620620
@Test

0 commit comments

Comments
 (0)