diff options
author | Chun-Min Chang <[email protected]> | 2019-06-10 17:22:33 -0700 |
---|---|---|
committer | Matthew Gregan <[email protected]> | 2019-06-11 12:22:33 +1200 |
commit | 03eb237c3bd484d53c34c0cb55f95b65f95ec965 (patch) | |
tree | e6bb9ead40385b919cd7e24cf2f622695bb294ab /test | |
parent | acbed7de511e94df95c8ca8d15628d8403dfdcbc (diff) | |
download | cubeb-03eb237c3bd484d53c34c0cb55f95b65f95ec965.tar.gz cubeb-03eb237c3bd484d53c34c0cb55f95b65f95ec965.zip |
Fix tests warnings (#512)
* Using unsigned long-long modifier in fprintf
* Remove unnecessary lambda captures
* Align naming conventions among the functions
* Replace llu by PRIu64
* Define __STDC_FORMAT_MACROS
* Using default capture
Diffstat (limited to 'test')
-rw-r--r-- | test/test_ring_buffer.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/test_ring_buffer.cpp b/test/test_ring_buffer.cpp index cf38c72..7c011ba 100644 --- a/test/test_ring_buffer.cpp +++ b/test/test_ring_buffer.cpp @@ -96,7 +96,7 @@ void test_ring_multi(lock_free_audio_ring_buffer<T>& buf, int channels, int capa const int block_size = 128; - std::thread t([&buf, capacity_frames, channels, block_size] { + std::thread t([=, &buf] { int iterations = 1002; std::unique_ptr<T[]> in_buffer(new T[capacity_frames * channels]); sequence_generator<T> gen(channels); @@ -156,13 +156,13 @@ void basic_api_test(T& ring) } void test_reset_api() { - const size_t RING_BUFFER_SIZE = 128; - const size_t ENQUEUE_SIZE = RING_BUFFER_SIZE / 2; + const size_t ring_buffer_size = 128; + const size_t enqueue_size = ring_buffer_size / 2; - lock_free_queue<float> ring(RING_BUFFER_SIZE); - std::thread t([&ring, ENQUEUE_SIZE] { - std::unique_ptr<float[]> in_buffer(new float[ENQUEUE_SIZE]); - ring.enqueue(in_buffer.get(), ENQUEUE_SIZE); + lock_free_queue<float> ring(ring_buffer_size); + std::thread t([=, &ring] { + std::unique_ptr<float[]> in_buffer(new float[enqueue_size]); + ring.enqueue(in_buffer.get(), enqueue_size); }); t.join(); @@ -171,9 +171,9 @@ void test_reset_api() { // Enqueue with a different thread. We have reset the thread ID // in the ring buffer, this should work. - std::thread t2([&ring, ENQUEUE_SIZE] { - std::unique_ptr<float[]> in_buffer(new float[ENQUEUE_SIZE]); - ring.enqueue(in_buffer.get(), ENQUEUE_SIZE); + std::thread t2([=, &ring] { + std::unique_ptr<float[]> in_buffer(new float[enqueue_size]); + ring.enqueue(in_buffer.get(), enqueue_size); }); t2.join(); |