From 2612c2075b38e94756bea0c8c9941b834c08f26c Mon Sep 17 00:00:00 2001 From: Chun-Min Chang Date: Wed, 29 Mar 2017 12:06:26 +0800 Subject: Using RAII helpers for cubeb context and stream but leaving test_sanity for explicit flow control --- test/test_tone.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/test_tone.cpp') diff --git a/test/test_tone.cpp b/test/test_tone.cpp index 2881c09..22c5be2 100644 --- a/test/test_tone.cpp +++ b/test/test_tone.cpp @@ -107,6 +107,8 @@ TEST(cubeb, tone) ASSERT_EQ(r, CUBEB_OK); } + cubeb_cleaner cleanup_cubeb_at_exit(ctx); + params.format = STREAM_FORMAT; params.rate = SAMPLE_FREQUENCY; params.channels = 1; @@ -126,13 +128,12 @@ TEST(cubeb, tone) ASSERT_EQ(r, CUBEB_OK); } + cubeb_stream_cleaner cleanup_stream_at_exit(stream); + cubeb_stream_start(stream); delay(500); cubeb_stream_stop(stream); - cubeb_stream_destroy(stream); - cubeb_destroy(ctx); - ASSERT_TRUE(user_data->position); free(user_data); -- cgit v1.2.3