@@ -86,10 +86,10 @@ public void testReadingNumbersWithOverflow() throws IOException {
8686 ByteArrayOutputStream out = new ByteArrayOutputStream ();
8787
8888 String [] names = new String []{ "a" , "b" , "c" , "d" , "e" , "f" , "g" , "h" , "i" , "j" , "k" , "l" , "m" , "n" , "o" , "p" ,
89- "q" , "r" };
89+ "q" , "r" , "s" };
9090 String [] types = new String []{"Int8" , "Int16" , "Int32" , "Int64" , "UInt8" , "UInt16" , "UInt32" , "UInt64" ,
9191 "Int128" , "Int256" , "UInt128" , "UInt256" , "Float32" , "Float64" ,
92- "Decimal32(3)" , "Decimal64(3)" , "Decimal128(4)" , "Decimal256(4)" };
92+ "Decimal32(3)" , "Decimal64(3)" , "Decimal128(4)" , "Decimal256(4)" , "Float64" };
9393
9494 BinaryStreamUtils .writeVarInt (out , names .length );
9595 for (String name : names ) {
@@ -117,7 +117,7 @@ public void testReadingNumbersWithOverflow() throws IOException {
117117 BinaryStreamUtils .writeDecimal64 (out , BigDecimal .valueOf (10000000.10000 ), 3 ); // p
118118 BinaryStreamUtils .writeDecimal128 (out , BigDecimal .valueOf (1000000000.1000000 ), 4 ); // q
119119 BinaryStreamUtils .writeDecimal256 (out , BigDecimal .valueOf (1000000000.1000000 ), 4 ); // r
120-
120+ BinaryStreamUtils . writeFloat64 ( out , 123.456 ); // s
121121
122122 InputStream in = new ByteArrayInputStream (out .toByteArray ());
123123 QuerySettings querySettings = new QuerySettings ().setUseTimeZone (TimeZone .getTimeZone ("UTC" ).toZoneId ().getId ());
@@ -130,15 +130,23 @@ public void testReadingNumbersWithOverflow() throws IOException {
130130 Consumer <String > shortConsumer = name -> Assert .expectThrows (ArithmeticException .class , () -> reader .getShort (name ));
131131 Consumer <String > integerConsumer = name -> Assert .expectThrows (ArithmeticException .class , () -> reader .getInteger (name ));
132132 Consumer <String > longConsumer = name -> Assert .expectThrows (ArithmeticException .class , () -> reader .getLong (name ));
133- Consumer <String > floatConsumer = name -> Assert .expectThrows (ArithmeticException .class , () -> reader .getFloat (name ));
134- Consumer <String > doubleConsumer = name -> Assert .expectThrows (ArithmeticException .class , () -> reader .getDouble (name ));
133+ // Consumer<String> floatConsumer = name -> Assert.expectThrows(ArithmeticException.class, () -> reader.getFloat(name));
134+ // Consumer<String> doubleConsumer = name -> Assert.expectThrows(ArithmeticException.class, () -> reader.getDouble(name));
135135
136136 Arrays .stream ("b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r" .split ("," )).forEach (byteConsumer );
137137 Arrays .stream ("c,d,f,g,h,i,j,k,l,m,n,o,p,q,r" .split ("," )).forEach (shortConsumer );
138138 Arrays .stream ("d,g,h,i,j,k,l" .split ("," )).forEach (integerConsumer );
139139 Arrays .stream ("h,i,j,k,l" .split ("," )).forEach (longConsumer );
140- Arrays .stream ("h,i,j,k,l,n,p,q,r" .split ("," )).forEach (floatConsumer );
141- Arrays .stream ("h,i,j,k,l,p,q,r" .split ("," )).forEach (doubleConsumer );
140+ // Arrays.stream("h,i,j,k,l,n,p,q,r".split(",")).forEach(floatConsumer);
141+ // Arrays.stream("h,i,j,k,l,p,q,r".split(",")).forEach(doubleConsumer);
142+
143+ Assert .assertEquals (reader .getFloat ("m" ), 900000.123f );
144+ Assert .assertEquals (reader .getDouble ("m" ), 900000.123f );
145+
146+ Assert .assertEquals (reader .getBigDecimal ("n" ), BigDecimal .valueOf (1000000.333 ));
147+ Assert .assertEquals (reader .getBigDecimal ("n" ), BigDecimal .valueOf (1000000.333 ));
148+
149+ Assert .assertEquals (reader .getFloat ("s" ), 123.456f );
142150 }
143151
144152 @ Test
0 commit comments