Skip to content

Commit

Permalink
Skip two more tests when a backend can't use audio input
Browse files Browse the repository at this point in the history
  • Loading branch information
padenot committed Apr 25, 2023
1 parent 245f669 commit 4281c4b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/test_duplex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,17 @@ TEST(cubeb, duplex_collection_change_no_unregister)

r = common_init(&ctx, "Cubeb duplex example with collection change");
ASSERT_EQ(r, CUBEB_OK) << "Error initializing cubeb library";
std::unique_ptr<cubeb, decltype(&cubeb_destroy)> cleanup_cubeb_at_exit(
ctx, [](cubeb * p) noexcept { EXPECT_DEATH(cubeb_destroy(p), ""); });

/* This test needs an available input device, skip it if this host does not
* have one. */
if (!can_run_audio_input_test(ctx)) {
cubeb_destroy(ctx);
return;
}

std::unique_ptr<cubeb, decltype(&cubeb_destroy)> cleanup_cubeb_at_exit(
ctx, [](cubeb * p) noexcept { EXPECT_DEATH(cubeb_destroy(p), ""); });

duplex_collection_change_impl(ctx);
}

Expand Down
4 changes: 4 additions & 0 deletions test/test_loopback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,10 @@ void run_loopback_separate_streams_test(bool is_float)
std::unique_ptr<cubeb, decltype(&cubeb_destroy)>
cleanup_cubeb_at_exit(ctx, cubeb_destroy);

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;
Expand Down

0 comments on commit 4281c4b

Please sign in to comment.