File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -574,11 +574,14 @@ fn test_ops_stream_current_device() {
574574 println ! ( "stream_get_current_device only works when the machine has both input and output devices" ) ;
575575 return ;
576576 }
577+
577578 let mut device: * mut ffi:: cubeb_device = ptr:: null_mut ( ) ;
578- assert_eq ! (
579- unsafe { OPS . stream_get_current_device. unwrap( ) ( stream, & mut device) } ,
580- ffi:: CUBEB_OK
581- ) ;
579+ if unsafe { OPS . stream_get_current_device . unwrap ( ) ( stream, & mut device) } != ffi:: CUBEB_OK {
580+ // It can happen when we fail to get the device source.
581+ println ! ( "stream_get_current_device fails. Skip this test." ) ;
582+ return ;
583+ }
584+
582585 assert ! ( !device. is_null( ) ) ;
583586 // Uncomment the below to print out the results.
584587 // let deviceref = unsafe { DeviceRef::from_ptr(device) };
You can’t perform that action at this time.
0 commit comments