From c2dd137a1b6288862073be7fc589f31500151034 Mon Sep 17 00:00:00 2001 From: Brandon Taylor Date: Sat, 23 Jul 2022 15:26:19 -0400 Subject: [PATCH] fix tests --- .github/workflows/Tests.yml | 2 +- Project.toml | 2 +- src/PortAudio.jl | 9 ++++----- test/runtests.jl | 18 +++++++++--------- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index f1d472d..f21b7bc 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: version: - - '1.3' + - '1.6' - '1' - 'nightly' os: diff --git a/Project.toml b/Project.toml index cf1b455..3229196 100644 --- a/Project.toml +++ b/Project.toml @@ -11,7 +11,7 @@ SampledSignals = "bd7594eb-a658-542f-9e75-4c4d8908c167" Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb" [compat] -julia = "1.3" +julia = "1.6" alsa_plugins_jll = "1.2.2" libportaudio_jll = "19.6.0" SampledSignals = "2.1.1" diff --git a/src/PortAudio.jl b/src/PortAudio.jl index 30c4e0d..7e9e93f 100644 --- a/src/PortAudio.jl +++ b/src/PortAudio.jl @@ -133,7 +133,7 @@ function __init__() config_folder = "ALSA_CONFIG_DIR" if config_folder ∉ keys(ENV) ENV[config_folder] = - seek_alsa_conf(["/usr/share/alsa", "/usr/local/share/alsa", "/etc/alsa"]) + seek_alsa_conf(("/usr/share/alsa", "/usr/local/share/alsa", "/etc/alsa")) end # the plugin folder will contain plugins for, critically, PulseAudio plugin_folder = "ALSA_PLUGIN_DIR" @@ -604,10 +604,9 @@ function combine_default_sample_rates( ) if input_sample_rate != output_sample_rate throw( - ArgumentError( - """ -Default sample rate $input_sample_rate for input $(name(input_device)) disagrees with -default sample rate $output_sample_rate for output $(name(output_device)). + ArgumentError(""" +Default sample rate $input_sample_rate for input \"$(name(input_device))\" disagrees with +default sample rate $output_sample_rate for output \"$(name(output_device))\". Please specify a sample rate. """, ), diff --git a/test/runtests.jl b/test/runtests.jl index ee2e5ac..a597519 100755 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -134,11 +134,11 @@ if !isempty(devices()) source = stream.source @test sprint(show, stream) == """ PortAudioStream{Float32} - Samplerate: 44100.0Hz - 2 channel sink: $(repr(input_name)) - 2 channel source: $(repr(output_name))""" - @test sprint(show, source) == "2 channel source: $(repr(output_name))" - @test sprint(show, sink) == "2 channel sink: $(repr(input_name))" + Samplerate: 44100Hz + 2 channel sink: $(repr(output_name)) + 2 channel source: $(repr(input_name))""" + @test sprint(show, source) == "2 channel source: $(repr(input_name))" + @test sprint(show, sink) == "2 channel sink: $(repr(output_name))" write(stream, stream, 5s) @test PaErrorCode(handle_status(Pa_StopStream(stream.pointer_to))) == paNoError @test isopen(stream) @@ -209,8 +209,8 @@ if !isempty(devices()) big = typemax(Int) @test_throws DomainError( typemax(Int), - "$big exceeds maximum input channels for $output_name", - ) PortAudioStream(input_name, output_name, big, 0) + "$big exceeds maximum output channels for $output_name", + ) PortAudioStream(input_name, output_name, 0, big) @test_throws ArgumentError("Input or output must have at least 1 channel") PortAudioStream( input_name, output_name, @@ -219,8 +219,8 @@ if !isempty(devices()) adjust_channels = true, ) @test_throws ArgumentError(""" - Default sample rate 0 for input $output_name disagrees with - default sample rate 1 for output $input_name. + Default sample rate 0 for input \"$input_name\" disagrees with + default sample rate 1 for output \"$output_name\". Please specify a sample rate. """) combine_default_sample_rates( get_device(input_name),