aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/test_loopback.cpp
diff options
context:
space:
mode:
authorPaul Adenot <[email protected]>2023-04-25 16:15:16 +0200
committerPaul Adenot <[email protected]>2023-04-26 14:28:46 +0200
commit0e7f41d6ef4579901faac04662780d1855b6b2ff (patch)
treea562e9b7ac76578ef627e63e737c0e3a69c29558 /test/test_loopback.cpp
parentd478bff5fb4f44616dd620d27a2e80b5ca8464ed (diff)
downloadcubeb-0e7f41d6ef4579901faac04662780d1855b6b2ff.tar.gz
cubeb-0e7f41d6ef4579901faac04662780d1855b6b2ff.zip
Don't run test_loopback and test_duplex on backends that can't open audio input
Diffstat (limited to 'test/test_loopback.cpp')
-rw-r--r--test/test_loopback.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_loopback.cpp b/test/test_loopback.cpp
index ce29d6e..e2c8343 100644
--- a/test/test_loopback.cpp
+++ b/test/test_loopback.cpp
@@ -267,6 +267,12 @@ void run_loopback_duplex_test(bool is_float)
std::unique_ptr<cubeb, decltype(&cubeb_destroy)>
cleanup_cubeb_at_exit(ctx, cubeb_destroy);
+ /* This test needs an available input device, skip it if this host does not
+ * have one. */
+ if (!can_run_audio_input_test(ctx)) {
+ return;
+ }
+
input_params.format = is_float ? CUBEB_SAMPLE_FLOAT32NE : CUBEB_SAMPLE_S16LE;
input_params.rate = SAMPLE_FREQUENCY;
input_params.channels = 1;