diff options
author | Chun-Min Chang <[email protected]> | 2018-12-17 10:59:21 -0800 |
---|---|---|
committer | Matthew Gregan <[email protected]> | 2018-12-17 15:25:45 -0500 |
commit | 008732ef72f61a8b72e31e3bb0844dd572818e07 (patch) | |
tree | 5996192a2dd67dba3ef64a824ad1c5d968b9c9c5 /test | |
parent | 5f025918a87524edc26ce7c7e806683e3286baeb (diff) | |
download | cubeb-008732ef72f61a8b72e31e3bb0844dd572818e07.tar.gz cubeb-008732ef72f61a8b72e31e3bb0844dd572818e07.zip |
trivial test to check if cubeb_stream_get_latency is callable (for Rust implementation)
Diffstat (limited to 'test')
-rw-r--r-- | test/test_sanity.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/test/test_sanity.cpp b/test/test_sanity.cpp index 06d9daf..caebe1b 100644 --- a/test/test_sanity.cpp +++ b/test/test_sanity.cpp @@ -400,6 +400,7 @@ TEST(cubeb, basic_stream_operations) cubeb_stream * stream; cubeb_stream_params params; uint64_t position; + uint32_t latency; r = common_init(&ctx, "test_sanity"); ASSERT_EQ(r, CUBEB_OK); @@ -416,25 +417,34 @@ TEST(cubeb, basic_stream_operations) ASSERT_EQ(r, CUBEB_OK); ASSERT_NE(stream, nullptr); - /* position before stream has started */ + /* position and latency before stream has started */ r = cubeb_stream_get_position(stream, &position); ASSERT_EQ(r, CUBEB_OK); ASSERT_EQ(position, 0u); + r = cubeb_stream_get_latency(stream, &latency); + ASSERT_EQ(r, CUBEB_OK); + r = cubeb_stream_start(stream); ASSERT_EQ(r, CUBEB_OK); - /* position after while stream running */ + /* position and latency after while stream running */ r = cubeb_stream_get_position(stream, &position); ASSERT_EQ(r, CUBEB_OK); + r = cubeb_stream_get_latency(stream, &latency); + ASSERT_EQ(r, CUBEB_OK); + r = cubeb_stream_stop(stream); ASSERT_EQ(r, CUBEB_OK); - /* position after stream has stopped */ + /* position and latency after stream has stopped */ r = cubeb_stream_get_position(stream, &position); ASSERT_EQ(r, CUBEB_OK); + r = cubeb_stream_get_latency(stream, &latency); + ASSERT_EQ(r, CUBEB_OK); + cubeb_stream_destroy(stream); cubeb_destroy(ctx); } |