Skip to content

Added unit tests for get_audio_device_ids and bump version to 0.11.3 #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/coreaudio-rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ jobs:
# - name: cargo test - all features
# run: cargo test --all-features --verbose

security-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: rustsec/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}

ios-build:
runs-on: macOS-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "coreaudio-rs"
version = "0.11.2"
version = "0.11.3"
authors = ["mitchmindtree <[email protected]>", "yupferris <[email protected]>"]
description = "A friendly rust interface for Apple's CoreAudio API."
keywords = ["core", "audio", "unit", "osx", "ios"]
Expand Down
21 changes: 21 additions & 0 deletions src/audio_unit/macos_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,27 @@ pub fn get_audio_device_ids() -> Result<Vec<AudioDeviceID>, Error> {
get_audio_device_ids_for_scope(Scope::Global)
}

#[test]
fn test_get_audio_device_ids() {
let _ = get_audio_device_ids().expect("Failed to get audio device ids");
}

#[test]
fn test_get_audio_device_ids_for_scope() {
for scope in &[
Scope::Global,
Scope::Input,
Scope::Output,
Scope::Group,
Scope::Part,
Scope::Note,
Scope::Layer,
Scope::LayerItem,
] {
let _ = get_audio_device_ids_for_scope(*scope).expect("Failed to get audio device ids");
}
}

/// does this device support input / ouptut?
pub fn get_audio_device_supports_scope(devid: AudioDeviceID, scope: Scope) -> Result<bool, Error> {
let dev_scope: AudioObjectPropertyScope = match scope {
Expand Down