@@ -111,6 +111,14 @@ def test_basic_types():
111111 setattr (msg , 'uint%d_value' % i , - 1 )
112112 with pytest .raises (AssertionError ):
113113 setattr (msg , 'int%d_value' % i , 2 ** i )
114+ with pytest .raises (AssertionError ):
115+ setattr (msg , 'float32_value' , - 3.5e+38 )
116+ with pytest .raises (AssertionError ):
117+ setattr (msg , 'float32_value' , 3.5e+38 )
118+ with pytest .raises (AssertionError ):
119+ setattr (msg , 'float64_value' , 1.8e+308 )
120+ with pytest .raises (AssertionError ):
121+ setattr (msg , 'float64_value' , - 1.8e+308 )
114122
115123
116124def test_strings ():
@@ -450,6 +458,10 @@ def test_arrays():
450458 setattr (msg , 'uint64_values' , [2 ** 64 , 1 , 2 ])
451459 with pytest .raises (AssertionError ):
452460 setattr (msg , 'uint64_values' , [- 1 , 1 , 2 ])
461+ with pytest .raises (AssertionError ):
462+ setattr (msg , 'float32_values' , [- 3.5e+38 , 0.0 , 3.5e+38 ])
463+ with pytest .raises (AssertionError ):
464+ setattr (msg , 'float64_values' , [- 1.8e+308 , 0.0 , 1.8e+308 ])
453465
454466
455467def test_bounded_sequences ():
@@ -661,6 +673,10 @@ def test_bounded_sequences():
661673 setattr (msg , 'uint64_values' , [2 ** 64 , 1 , 2 ])
662674 with pytest .raises (AssertionError ):
663675 setattr (msg , 'uint64_values' , [- 1 , 1 , 2 ])
676+ with pytest .raises (AssertionError ):
677+ setattr (msg , 'float32_values' , [- 3.5e+38 , 0.0 , 3.5e+38 ])
678+ with pytest .raises (AssertionError ):
679+ setattr (msg , 'float64_values' , [- 1.8e+308 , 0.0 , 1.8e+308 ])
664680
665681
666682def test_unbounded_sequences ():
@@ -800,6 +816,10 @@ def test_unbounded_sequences():
800816 setattr (msg , 'uint64_values' , [2 ** 64 , 1 , 2 ])
801817 with pytest .raises (AssertionError ):
802818 setattr (msg , 'uint64_values' , [- 1 , 1 , 2 ])
819+ with pytest .raises (AssertionError ):
820+ setattr (msg , 'float32_values' , [- 3.5e+38 , 0.0 , 3.5e+38 ])
821+ with pytest .raises (AssertionError ):
822+ setattr (msg , 'float64_values' , [- 1.8e+308 , 0.0 , 1.8e+308 ])
803823
804824
805825def test_slot_attributes ():
0 commit comments