Skip to content

Commit

Permalink
Adjust test, make it extra-clear when we're missing something
Browse files Browse the repository at this point in the history
  • Loading branch information
padenot committed Apr 25, 2024
1 parent ee8a6a2 commit 4ca174c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,11 @@ impl From<CAChannelLabel> for mixer::Channel {
sys::kAudioChannelLabel_TopBackCenter => mixer::Channel::TopBackCenter,
sys::kAudioChannelLabel_TopBackRight => mixer::Channel::TopBackRight,
sys::kAudioChannelLabel_Unknown => mixer::Channel::Discrete,
_ => panic!("Label not handled"),
sys::kAudioChannelLabel_Unused => mixer::Channel::Silence,
v => {
eprintln!("Warning: channel label value {} isn't handled", v);
mixer::Channel::Silence
}
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/backend/tests/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,6 @@ fn test_get_default_device_id_with_inout_type() {
#[test]
fn test_convert_channel_layout() {
let pairs = [
(vec![kAudioObjectUnknown], vec![mixer::Channel::Silence]),
(
vec![kAudioChannelLabel_Mono],
vec![mixer::Channel::FrontCenter],
Expand All @@ -398,7 +397,7 @@ fn test_convert_channel_layout() {
vec![
mixer::Channel::FrontLeft,
mixer::Channel::FrontRight,
mixer::Channel::Silence,
mixer::Channel::Discrete,
],
),
(
Expand Down

0 comments on commit 4ca174c

Please sign in to comment.