From dfb12d4e20c3c239cec1274f13df8ff08f38f7ac Mon Sep 17 00:00:00 2001 From: Sebastian Imlay Date: Thu, 12 Oct 2023 22:28:29 -0400 Subject: [PATCH 1/3] Added a simple unit test for get_audio_device_ids --- src/audio_unit/macos_helpers.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/audio_unit/macos_helpers.rs b/src/audio_unit/macos_helpers.rs index bd7c9815a..2cb997b70 100644 --- a/src/audio_unit/macos_helpers.rs +++ b/src/audio_unit/macos_helpers.rs @@ -173,6 +173,11 @@ pub fn get_audio_device_ids() -> Result, 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"); +} + /// does this device support input / ouptut? pub fn get_audio_device_supports_scope(devid: AudioDeviceID, scope: Scope) -> Result { let dev_scope: AudioObjectPropertyScope = match scope { From 67ed732b402681a591205190077734e85f2dc0a4 Mon Sep 17 00:00:00 2001 From: Sebastian Imlay Date: Sat, 14 Oct 2023 13:41:58 -0400 Subject: [PATCH 2/3] Add another unit test and bump minor version --- Cargo.toml | 2 +- src/audio_unit/macos_helpers.rs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 822ca6ea4..a5bdcde79 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "coreaudio-rs" -version = "0.11.2" +version = "0.11.3" authors = ["mitchmindtree ", "yupferris "] description = "A friendly rust interface for Apple's CoreAudio API." keywords = ["core", "audio", "unit", "osx", "ios"] diff --git a/src/audio_unit/macos_helpers.rs b/src/audio_unit/macos_helpers.rs index 2cb997b70..9e9fc38e6 100644 --- a/src/audio_unit/macos_helpers.rs +++ b/src/audio_unit/macos_helpers.rs @@ -178,6 +178,22 @@ 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 { let dev_scope: AudioObjectPropertyScope = match scope { From 6a4a30f52bf09ccfd0fe6da5426571df2b5ed6b5 Mon Sep 17 00:00:00 2001 From: Sebastian Imlay Date: Sat, 14 Oct 2023 13:47:02 -0400 Subject: [PATCH 3/3] Added security audit --- .github/workflows/coreaudio-rs.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/coreaudio-rs.yml b/.github/workflows/coreaudio-rs.yml index e2fe11cc5..c0ed68b1a 100644 --- a/.github/workflows/coreaudio-rs.yml +++ b/.github/workflows/coreaudio-rs.yml @@ -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/audit-check@v1.4.1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + ios-build: runs-on: macOS-latest steps: