Fix tests
This commit is contained in:
Родитель
7ff946e644
Коммит
ddee380301
|
@ -271,6 +271,8 @@ fn test_aggregate_set_aggregate_sub_device_list_for_unknown_input_devices() {
|
|||
.unwrap_err(),
|
||||
Error::error()
|
||||
);
|
||||
} else {
|
||||
panic!("Need a output device!");
|
||||
}
|
||||
|
||||
assert!(audiounit_destroy_aggregate_device(plugin_id, &mut aggregate_device_id).is_ok());
|
||||
|
@ -306,6 +308,8 @@ fn test_aggregate_set_aggregate_sub_device_list_for_unknown_output_devices() {
|
|||
.unwrap_err(),
|
||||
Error::error()
|
||||
);
|
||||
} else {
|
||||
panic!("Need a input device!");
|
||||
}
|
||||
|
||||
assert!(audiounit_destroy_aggregate_device(plugin_id, &mut aggregate_device_id).is_ok());
|
||||
|
@ -397,14 +401,10 @@ fn test_aggregate_set_master_aggregate_device_for_a_blank_aggregate_device() {
|
|||
assert_ne!(plugin_id, kAudioObjectUnknown);
|
||||
assert_ne!(aggregate_device_id, kAudioObjectUnknown);
|
||||
|
||||
// TODO: If there is no available device, we will set master device
|
||||
// to a device whose name is a NULL CFStringRef (see implementation)
|
||||
// but surprisingly it's ok! On the other hand, it's also ok to set
|
||||
// the default ouput device(if any) for a blank aggregate device.
|
||||
// That is, it's ok to set the default ouput device to an aggregate
|
||||
// device whose sub devices list doesn't include default ouput device!
|
||||
// This is weird to me. Maybe we should return errors when above
|
||||
// conditions are met.
|
||||
let output_id = audiounit_get_default_device_id(DeviceType::OUTPUT);
|
||||
if !valid_id(output_id) {
|
||||
return;
|
||||
}
|
||||
assert!(audiounit_set_master_aggregate_device(aggregate_device_id).is_ok());
|
||||
|
||||
// Make sure this blank aggregate device owns nothing.
|
||||
|
|
|
@ -1228,8 +1228,7 @@ fn test_set_aggregate_sub_device_list_for_an_unknown_aggregate_device() {
|
|||
let default_input = test_get_default_device(Scope::Input);
|
||||
let default_output = test_get_default_device(Scope::Output);
|
||||
if default_input.is_none() || default_output.is_none() {
|
||||
println!("No input or output device.");
|
||||
return;
|
||||
panic!("No input or output device.");
|
||||
}
|
||||
|
||||
let default_input = default_input.unwrap();
|
||||
|
@ -1869,9 +1868,7 @@ fn test_configure_input_with_zero_latency_frames() {
|
|||
Scope::Input,
|
||||
StreamParams::from(params),
|
||||
|stream| {
|
||||
// TODO: The buffer frames size won't be 0 even it's ok to set that!
|
||||
check_buffer_frame_size(stream, Scope::Input);
|
||||
// TODO: The frames per slice won't be 0 even it's ok to set that!
|
||||
check_frames_per_slice(stream, Scope::Input);
|
||||
},
|
||||
);
|
||||
|
@ -1944,9 +1941,7 @@ fn test_configure_output_with_zero_latency_frames() {
|
|||
Scope::Output,
|
||||
StreamParams::from(params),
|
||||
|stream| {
|
||||
// TODO: The buffer frames size won't be 0 even it's ok to set that!
|
||||
check_buffer_frame_size(stream, Scope::Output);
|
||||
// TODO: The frames per slice won't be 0 even it's ok to set that!
|
||||
check_frames_per_slice(stream, Scope::Output);
|
||||
},
|
||||
);
|
||||
|
@ -2018,7 +2013,7 @@ where
|
|||
callback(stream);
|
||||
});
|
||||
} else {
|
||||
println!("No audiounit for {:?}.", scope);
|
||||
panic!("No audiounit for {:?}.", scope);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -172,6 +172,7 @@ fn test_plug_and_unplug_device_in_scope(scope: Scope) {
|
|||
let default_device = test_get_default_device(scope.clone());
|
||||
if default_device.is_none() {
|
||||
println!("No device for {:?} to test", scope);
|
||||
return;
|
||||
}
|
||||
|
||||
println!("Run test for {:?}", scope);
|
||||
|
|
Загрузка…
Ссылка в новой задаче