aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/test_overload_callback.cpp
diff options
context:
space:
mode:
authorChun-Min Chang <[email protected]>2017-03-29 12:06:26 +0800
committerMatthew Gregan <[email protected]>2017-04-06 20:14:00 +1200
commit2612c2075b38e94756bea0c8c9941b834c08f26c (patch)
tree044fbca0824dd6dfcca1fbefe8a9f23944fc3dd4 /test/test_overload_callback.cpp
parent04826edb13c23a2b53732d63b09b24e05ca83d87 (diff)
downloadcubeb-2612c2075b38e94756bea0c8c9941b834c08f26c.tar.gz
cubeb-2612c2075b38e94756bea0c8c9941b834c08f26c.zip
Using RAII helpers for cubeb context and stream but leaving test_sanity for explicit flow control
Diffstat (limited to 'test/test_overload_callback.cpp')
-rw-r--r--test/test_overload_callback.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/test_overload_callback.cpp b/test/test_overload_callback.cpp
index fa23222..5a4d511 100644
--- a/test/test_overload_callback.cpp
+++ b/test/test_overload_callback.cpp
@@ -64,6 +64,8 @@ TEST(cubeb, overload_callback)
r = cubeb_init(&ctx, "Cubeb callback overload", NULL);
ASSERT_EQ(r, CUBEB_OK);
+ cubeb_cleaner cleanup_cubeb_at_exit(ctx);
+
output_params.format = STREAM_FORMAT;
output_params.rate = 48000;
output_params.channels = 2;
@@ -77,13 +79,12 @@ TEST(cubeb, overload_callback)
latency_frames, data_cb, state_cb, NULL);
ASSERT_EQ(r, CUBEB_OK);
+ cubeb_stream_cleaner cleanup_stream_at_exit(stream);
+
cubeb_stream_start(stream);
delay(500);
// This causes the callback to sleep for a large number of seconds.
load_callback = true;
delay(500);
cubeb_stream_stop(stream);
-
- cubeb_stream_destroy(stream);
- cubeb_destroy(ctx);
}