aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_pcm_channels.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-31 22:58:27 +0100
committerMax Kellermann <max@duempel.org>2013-01-31 22:58:27 +0100
commite42734c3f3f669039f5e088371ab1ef8c7674bb5 (patch)
tree1f03b9b347f82e63ac6296b30d231345f21a0ef4 /test/test_pcm_channels.cxx
parenteab78ab99c497b01ef1d5ec2ad3be74d61527cd1 (diff)
downloadmpd-e42734c3f3f669039f5e088371ab1ef8c7674bb5.tar.gz
mpd-e42734c3f3f669039f5e088371ab1ef8c7674bb5.tar.xz
mpd-e42734c3f3f669039f5e088371ab1ef8c7674bb5.zip
test/test_pcm: merge source buffer generator
Diffstat (limited to '')
-rw-r--r--test/test_pcm_channels.cxx15
1 files changed, 5 insertions, 10 deletions
diff --git a/test/test_pcm_channels.cxx b/test/test_pcm_channels.cxx
index 38d030519..8e013d5af 100644
--- a/test/test_pcm_channels.cxx
+++ b/test/test_pcm_channels.cxx
@@ -19,6 +19,7 @@
#include "config.h"
#include "test_pcm_all.hxx"
+#include "test_pcm_util.hxx"
#include "PcmChannels.hxx"
#include "pcm_buffer.h"
@@ -27,11 +28,8 @@
void
test_pcm_channels_16()
{
- enum { N = 256 };
- int16_t src[N * 2];
-
- for (unsigned i = 0; i < G_N_ELEMENTS(src); ++i)
- src[i] = g_random_int();
+ constexpr unsigned N = 256;
+ const auto src = TestDataBuffer<int16_t, N * 2>();
struct pcm_buffer buffer;
pcm_buffer_init(&buffer);
@@ -65,11 +63,8 @@ test_pcm_channels_16()
void
test_pcm_channels_32()
{
- enum { N = 256 };
- int32_t src[N * 2];
-
- for (unsigned i = 0; i < G_N_ELEMENTS(src); ++i)
- src[i] = g_random_int();
+ constexpr unsigned N = 256;
+ const auto src = TestDataBuffer<int32_t, N * 2>();
struct pcm_buffer buffer;
pcm_buffer_init(&buffer);