зеркало из https://github.com/mozilla/cubeb.git
Skip a couple more tests when a backend can't use audio input
This commit is contained in:
Родитель
e518e2880e
Коммит
400dc652f6
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
@ -429,6 +433,10 @@ void run_loopback_silence_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;
|
||||
|
@ -489,13 +497,13 @@ void run_loopback_device_selection_test(bool is_float)
|
|||
r = common_init(&ctx, "Cubeb loopback example: device selection, separate streams");
|
||||
ASSERT_EQ(r, CUBEB_OK) << "Error initializing cubeb library";
|
||||
|
||||
std::unique_ptr<cubeb, decltype(&cubeb_destroy)>
|
||||
cleanup_cubeb_at_exit(ctx, cubeb_destroy);
|
||||
|
||||
if (!can_run_audio_input_test(ctx)) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::unique_ptr<cubeb, decltype(&cubeb_destroy)>
|
||||
cleanup_cubeb_at_exit(ctx, cubeb_destroy);
|
||||
|
||||
r = cubeb_enumerate_devices(ctx, CUBEB_DEVICE_TYPE_OUTPUT, &collection);
|
||||
if (r == CUBEB_ERROR_NOT_SUPPORTED) {
|
||||
fprintf(stderr, "Device enumeration not supported"
|
||||
|
|
Загрузка…
Ссылка в новой задаче