test_sanity: move stream configuration (vol, pan) to its own test. Use a 2-channel stream for this one.

This commit is contained in:
Sebastien Alaiwan 2014-10-14 07:21:49 +02:00
Родитель dd728569d3
Коммит a0aa1de448
1 изменённых файлов: 33 добавлений и 6 удалений

Просмотреть файл

@ -144,12 +144,6 @@ test_init_destroy_stream(void)
test_data_callback, test_state_callback, &dummy);
assert(r == 0 && stream);
r = cubeb_stream_set_volume(stream, 1.0f);
assert(r == 0);
r = cubeb_stream_set_panning(stream, 0.0f);
assert(r == 0);
cubeb_stream_destroy(stream);
cubeb_destroy(ctx);
@ -190,6 +184,38 @@ test_init_destroy_multiple_streams(void)
END_TEST
}
static void
test_configure_stream(void)
{
int ret;
cubeb * ctx;
cubeb_stream * stream;
cubeb_stream_params params;
BEGIN_TEST
ret = cubeb_init(&ctx, "test_sanity");
assert(ret == 0 && ctx);
params.format = STREAM_FORMAT;
params.rate = STREAM_RATE;
params.channels = 2; // panning
ret = cubeb_stream_init(ctx, &stream, "test", params, STREAM_LATENCY,
test_data_callback, test_state_callback, &dummy);
assert(ret == 0 && stream);
ret = cubeb_stream_set_volume(stream, 1.0f);
assert(ret == 0);
ret = cubeb_stream_set_panning(stream, 0.0f);
assert(ret == 0);
cubeb_stream_destroy(stream);
cubeb_destroy(ctx);
END_TEST
}
static void
test_init_start_stop_destroy_multiple_streams(int early, int delay_ms)
{
@ -544,6 +570,7 @@ main(int argc, char * argv[])
test_context_variables();
test_init_destroy_stream();
test_init_destroy_multiple_streams();
test_configure_stream();
test_basic_stream_operations();
test_stream_position();