Skip to content

Commit cea1f1b

Browse files
PropertyQuery: test sumDouble with no data for integers.
1 parent c605460 commit cea1f1b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,16 @@ public void sum_noData() {
624624
@Test
625625
public void sumDouble_noData() {
626626
Query<TestEntity> baseQuery = box.query().build();
627+
// Integer.
628+
assertEquals(0, baseQuery.property(simpleByte).sumDouble(), 0.0001);
629+
assertEquals(0, baseQuery.property(simpleInt).sumDouble(), 0.0001);
630+
assertEquals(0, baseQuery.property(simpleShort).sumDouble(), 0.0001);
631+
assertEquals(0, baseQuery.property(simpleLong).sumDouble(), 0.0001);
632+
// Integer treated as unsigned.
633+
assertEquals(0, baseQuery.property(simpleIntU).sumDouble(), 0.0001);
634+
assertEquals(0, baseQuery.property(simpleShortU).sumDouble(), 0.0001);
635+
assertEquals(0, baseQuery.property(simpleLongU).sumDouble(), 0.0001);
636+
// Floating point.
627637
assertEquals(0, baseQuery.property(simpleFloat).sumDouble(), 0.0001);
628638
assertEquals(0, baseQuery.property(simpleDouble).sumDouble(), 0.0001);
629639
}

0 commit comments

Comments
 (0)