aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorAlex Chronopoulos <[email protected]>2017-07-06 12:35:47 +0300
committerAlex Chronopoulos <[email protected]>2017-07-12 09:27:20 +0300
commitbb189841de715214d88e1fa0093dc390bbf95ff4 (patch)
tree178585bbaf0c8a1e1e8f015a6288ac90623df1c4 /test
parent7590a1e232bc3c1c2d97e2c5c517404cc3c73388 (diff)
downloadcubeb-bb189841de715214d88e1fa0093dc390bbf95ff4.tar.gz
cubeb-bb189841de715214d88e1fa0093dc390bbf95ff4.zip
New test for undefined layout on output
Diffstat (limited to 'test')
-rw-r--r--test/test_sanity.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/test_sanity.cpp b/test/test_sanity.cpp
index 753da66..f7f4567 100644
--- a/test/test_sanity.cpp
+++ b/test/test_sanity.cpp
@@ -244,6 +244,42 @@ TEST(cubeb, configure_stream)
cubeb_destroy(ctx);
}
+TEST(cubeb, configure_stream_undefined_layout)
+{
+ int r;
+ cubeb * ctx;
+ cubeb_stream * stream;
+ cubeb_stream_params params;
+
+ r = common_init(&ctx, "test_sanity");
+ ASSERT_EQ(r, CUBEB_OK);
+ ASSERT_NE(ctx, nullptr);
+
+ params.format = STREAM_FORMAT;
+ params.rate = STREAM_RATE;
+ params.channels = 2; // panning
+ params.layout = CUBEB_LAYOUT_UNDEFINED;
+#if defined(__ANDROID__)
+ params.stream_type = CUBEB_STREAM_TYPE_MUSIC;
+#endif
+
+ r = cubeb_stream_init(ctx, &stream, "test", NULL, NULL, NULL, &params, STREAM_LATENCY,
+ test_data_callback, test_state_callback, &dummy);
+ ASSERT_EQ(r, CUBEB_OK);
+ ASSERT_NE(stream, nullptr);
+
+ r = cubeb_stream_start(stream);
+ ASSERT_EQ(r, CUBEB_OK);
+
+ delay(100);
+
+ r = cubeb_stream_stop(stream);
+ ASSERT_EQ(r, CUBEB_OK);
+
+ cubeb_stream_destroy(stream);
+ cubeb_destroy(ctx);
+}
+
static void
test_init_start_stop_destroy_multiple_streams(int early, int delay_ms)
{