@@ -188,12 +188,14 @@ pub struct DeviceToUninstall {
188188 manufacturer : Option < String > ,
189189 hardware_id : Option < String > ,
190190 class_uuid : Option < Uuid > ,
191+ inf_provider : Option < String > ,
191192}
192193
193194impl ToUninstall < Device > for DeviceToUninstall {
194195 fn matches ( & self , other : & Device ) -> bool {
195196 regex_cache:: cached_match ( other. description ( ) , self . device_desc . as_deref ( ) )
196197 && regex_cache:: cached_match ( other. manufacturer ( ) , self . manufacturer . as_deref ( ) )
198+ && regex_cache:: cached_match ( other. inf_provider ( ) , self . inf_provider . as_deref ( ) )
197199 && match self . class_uuid {
198200 Some ( uuid) => * other. class_guid ( ) == uuid,
199201 None => true ,
@@ -224,3 +226,22 @@ fn is_of_interest(device: &Device) -> bool {
224226
225227 candidate_iter ( strings)
226228}
229+
230+ #[ tokio:: test]
231+ async fn test_init ( ) {
232+ let mut module = DeviceCleanupModule :: new ( ) ;
233+ let state = State {
234+ dry_run : true ,
235+ interactive : false ,
236+ use_cache : true ,
237+ allow_updates : false ,
238+ current_path : Default :: default ( ) ,
239+ } ;
240+ module. initialize ( & state) . await . unwrap ( ) ;
241+ module. get_objects_to_uninstall ( ) . iter ( ) . for_each ( |d| {
242+ regex_cache:: cached_match ( Some ( "" ) , d. device_desc . as_deref ( ) ) ;
243+ regex_cache:: cached_match ( Some ( "" ) , d. manufacturer . as_deref ( ) ) ;
244+ regex_cache:: cached_match ( Some ( "" ) , d. hardware_id . as_deref ( ) ) ;
245+ regex_cache:: cached_match ( Some ( "" ) , d. inf_provider . as_deref ( ) ) ;
246+ } ) ;
247+ }
0 commit comments