diff options
author | Max Kellermann <max@duempel.org> | 2013-01-31 20:45:19 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-31 21:11:06 +0100 |
commit | 0307801d5164b3119a0da6eec83e9616665e6511 (patch) | |
tree | 544b1955a4a57a7188fd2a90ed87b3175b4d61ed /test | |
parent | 72cf8dd8a0451a4d9dae14a68483dc31adc61b09 (diff) | |
download | mpd-0307801d5164b3119a0da6eec83e9616665e6511.tar.gz mpd-0307801d5164b3119a0da6eec83e9616665e6511.tar.xz mpd-0307801d5164b3119a0da6eec83e9616665e6511.zip |
test/test_pcm: convert to C++
Diffstat (limited to 'test')
-rw-r--r-- | test/test_pcm_all.hxx (renamed from test/test_pcm_all.h) | 28 | ||||
-rw-r--r-- | test/test_pcm_channels.cxx (renamed from test/test_pcm_channels.c) | 10 | ||||
-rw-r--r-- | test/test_pcm_dither.cxx (renamed from test/test_pcm_dither.c) | 13 | ||||
-rw-r--r-- | test/test_pcm_main.cxx (renamed from test/test_pcm_main.c) | 4 | ||||
-rw-r--r-- | test/test_pcm_pack.cxx (renamed from test/test_pcm_pack.c) | 13 | ||||
-rw-r--r-- | test/test_pcm_volume.cxx (renamed from test/test_pcm_volume.c) | 26 |
6 files changed, 51 insertions, 43 deletions
diff --git a/test/test_pcm_all.h b/test/test_pcm_all.hxx index 493619b55..16157d76f 100644 --- a/test/test_pcm_all.h +++ b/test/test_pcm_all.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2011 The Music Player Daemon Project + * Copyright (C) 2003-2013 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -17,40 +17,40 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MPD_TEST_PCM_ALL_H -#define MPD_TEST_PCM_ALL_H +#ifndef MPD_TEST_PCM_ALL_HXX +#define MPD_TEST_PCM_ALL_HXX void -test_pcm_dither_24(void); +test_pcm_dither_24(); void -test_pcm_dither_32(void); +test_pcm_dither_32(); void -test_pcm_pack_24(void); +test_pcm_pack_24(); void -test_pcm_unpack_24(void); +test_pcm_unpack_24(); void -test_pcm_channels_16(void); +test_pcm_channels_16(); void -test_pcm_channels_32(void); +test_pcm_channels_32(); void -test_pcm_volume_8(void); +test_pcm_volume_8(); void -test_pcm_volume_16(void); +test_pcm_volume_16(); void -test_pcm_volume_24(void); +test_pcm_volume_24(); void -test_pcm_volume_32(void); +test_pcm_volume_32(); void -test_pcm_volume_float(void); +test_pcm_volume_float(); #endif diff --git a/test/test_pcm_channels.c b/test/test_pcm_channels.cxx index fb3ec5c3e..66f4bc63c 100644 --- a/test/test_pcm_channels.c +++ b/test/test_pcm_channels.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2011 The Music Player Daemon Project + * Copyright (C) 2003-2013 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -18,14 +18,16 @@ */ #include "config.h" -#include "test_pcm_all.h" +#include "test_pcm_all.hxx" +extern "C" { #include "pcm_channels.h" +} #include "pcm_buffer.h" #include <glib.h> void -test_pcm_channels_16(void) +test_pcm_channels_16() { enum { N = 256 }; int16_t src[N * 2]; @@ -63,7 +65,7 @@ test_pcm_channels_16(void) } void -test_pcm_channels_32(void) +test_pcm_channels_32() { enum { N = 256 }; int32_t src[N * 2]; diff --git a/test/test_pcm_dither.c b/test/test_pcm_dither.cxx index 44d105207..47b94764d 100644 --- a/test/test_pcm_dither.c +++ b/test/test_pcm_dither.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2011 The Music Player Daemon Project + * Copyright (C) 2003-2013 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -17,8 +17,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "test_pcm_all.h" +#include "test_pcm_all.hxx" + +extern "C" { #include "pcm_dither.h" +} #include <glib.h> @@ -26,7 +29,7 @@ * Generate a random 24 bit PCM sample. */ static int32_t -random24(void) +random24() { int32_t x = g_random_int() & 0xffffff; if (x & 0x800000) @@ -35,7 +38,7 @@ random24(void) } void -test_pcm_dither_24(void) +test_pcm_dither_24() { struct pcm_dither dither; @@ -57,7 +60,7 @@ test_pcm_dither_24(void) } void -test_pcm_dither_32(void) +test_pcm_dither_32() { struct pcm_dither dither; diff --git a/test/test_pcm_main.c b/test/test_pcm_main.cxx index a483baaab..5a49a339f 100644 --- a/test/test_pcm_main.c +++ b/test/test_pcm_main.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2011 The Music Player Daemon Project + * Copyright (C) 2003-2013 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "test_pcm_all.h" +#include "test_pcm_all.hxx" #include <glib.h> diff --git a/test/test_pcm_pack.c b/test/test_pcm_pack.cxx index 5127536fb..61acf81ed 100644 --- a/test/test_pcm_pack.c +++ b/test/test_pcm_pack.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2011 The Music Player Daemon Project + * Copyright (C) 2003-2013 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -17,8 +17,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "test_pcm_all.h" +#include "test_pcm_all.hxx" + +extern "C" { #include "pcm_pack.h" +} #include <glib.h> @@ -26,7 +29,7 @@ * Generate a random 24 bit PCM sample. */ static int32_t -random24(void) +random24() { int32_t x = g_random_int() & 0xffffff; if (x & 0x800000) @@ -35,7 +38,7 @@ random24(void) } void -test_pcm_pack_24(void) +test_pcm_pack_24() { enum { N = 256 }; int32_t src[N * 3]; @@ -62,7 +65,7 @@ test_pcm_pack_24(void) } void -test_pcm_unpack_24(void) +test_pcm_unpack_24() { enum { N = 256 }; uint8_t src[N * 3]; diff --git a/test/test_pcm_volume.c b/test/test_pcm_volume.cxx index 713645cf1..ab8444411 100644 --- a/test/test_pcm_volume.c +++ b/test/test_pcm_volume.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2012 The Music Player Daemon Project + * Copyright (C) 2003-2013 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "test_pcm_all.h" +#include "test_pcm_all.hxx" #include "pcm_volume.h" #include <glib.h> @@ -25,10 +25,10 @@ #include <string.h> void -test_pcm_volume_8(void) +test_pcm_volume_8() { enum { N = 256 }; - static const int8_t zero[N]; + static int8_t zero[N]; int8_t src[N]; for (unsigned i = 0; i < N; ++i) src[i] = g_random_int(); @@ -56,10 +56,10 @@ test_pcm_volume_8(void) } void -test_pcm_volume_16(void) +test_pcm_volume_16() { enum { N = 256 }; - static const int16_t zero[N]; + static int16_t zero[N]; int16_t src[N]; for (unsigned i = 0; i < N; ++i) src[i] = g_random_int(); @@ -90,7 +90,7 @@ test_pcm_volume_16(void) * Generate a random 24 bit PCM sample. */ static int32_t -random24(void) +random24() { int32_t x = g_random_int() & 0xffffff; if (x & 0x800000) @@ -99,10 +99,10 @@ random24(void) } void -test_pcm_volume_24(void) +test_pcm_volume_24() { enum { N = 256 }; - static const int32_t zero[N]; + static int32_t zero[N]; int32_t src[N]; for (unsigned i = 0; i < N; ++i) src[i] = random24(); @@ -130,10 +130,10 @@ test_pcm_volume_24(void) } void -test_pcm_volume_32(void) +test_pcm_volume_32() { enum { N = 256 }; - static const int32_t zero[N]; + static int32_t zero[N]; int32_t src[N]; for (unsigned i = 0; i < N; ++i) src[i] = g_random_int(); @@ -161,10 +161,10 @@ test_pcm_volume_32(void) } void -test_pcm_volume_float(void) +test_pcm_volume_float() { enum { N = 256 }; - static const float zero[N]; + static float zero[N]; float src[N]; for (unsigned i = 0; i < N; ++i) src[i] = g_random_double_range(-1.0, 1.0); |