@@ -31,12 +31,6 @@ impl<'a> ChiselModule<'a> for CheckFloat {
3131 }
3232}
3333
34- impl CheckFloat {
35- pub fn new ( ) -> Self {
36- CheckFloat { }
37- }
38- }
39-
4034impl ModuleValidator for CheckFloat {
4135 // NOTE: this will not check for SIMD instructions.
4236 fn validate ( & self , module : & Module ) -> Result < bool , ModuleError > {
@@ -147,7 +141,7 @@ mod tests {
147141 0x00 , 0x00 , 0x0a , 0x09 , 0x01 , 0x07 , 0x00 , 0x20 , 0x00 , 0x20 , 0x01 , 0x6a , 0x0b ,
148142 ] ;
149143 let module = Module :: from_bytes ( & wasm) . unwrap ( ) ;
150- let checker = CheckFloat :: new ( ) ;
144+ let checker = CheckFloat :: with_defaults ( ) . unwrap ( ) ;
151145 let result = checker. validate ( & module) . unwrap ( ) ;
152146 assert_eq ! ( true , result) ;
153147 }
@@ -167,7 +161,7 @@ mod tests {
167161 0x00 , 0x00 , 0x0a , 0x09 , 0x01 , 0x07 , 0x00 , 0x20 , 0x00 , 0x20 , 0x01 , 0x92 , 0x0b ,
168162 ] ;
169163 let module = Module :: from_bytes ( & wasm) . unwrap ( ) ;
170- let checker = CheckFloat :: new ( ) ;
164+ let checker = CheckFloat :: with_defaults ( ) . unwrap ( ) ;
171165 let result = checker. validate ( & module) . unwrap ( ) ;
172166 assert_eq ! ( false , result) ;
173167 }
@@ -187,15 +181,15 @@ mod tests {
187181 0x00 , 0x00 , 0x0a , 0x09 , 0x01 , 0x07 , 0x00 , 0x20 , 0x00 , 0x20 , 0x01 , 0xa0 , 0x0b ,
188182 ] ;
189183 let module = Module :: from_bytes ( & wasm) . unwrap ( ) ;
190- let checker = CheckFloat :: new ( ) ;
184+ let checker = CheckFloat :: with_defaults ( ) . unwrap ( ) ;
191185 let result = checker. validate ( & module) . unwrap ( ) ;
192186 assert_eq ! ( false , result) ;
193187 }
194188
195189 #[ test]
196190 fn no_code_section ( ) {
197191 let module = builder:: module ( ) . build ( ) ;
198- let checker = CheckFloat :: new ( ) ;
192+ let checker = CheckFloat :: with_defaults ( ) . unwrap ( ) ;
199193 let result = checker. validate ( & module) ;
200194 assert_eq ! ( true , result. is_err( ) ) ;
201195 assert_eq ! ( result. err( ) . unwrap( ) , ModuleError :: NotFound )
0 commit comments