aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_pcm_mix.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-16 21:55:00 +0200
committerMax Kellermann <max@duempel.org>2013-10-16 23:36:36 +0200
commit401a799a1b5de5d70a6b4c1d49235af0d5618f37 (patch)
tree503db86df98400dac818fa3bbfbe20e2055a1fa4 /test/test_pcm_mix.cxx
parentba98518c69d0501e67ef707f0d718cc678851415 (diff)
downloadmpd-401a799a1b5de5d70a6b4c1d49235af0d5618f37.tar.gz
mpd-401a799a1b5de5d70a6b4c1d49235af0d5618f37.tar.xz
mpd-401a799a1b5de5d70a6b4c1d49235af0d5618f37.zip
test: use the CPPUNIT framework for unit tests
Diffstat (limited to 'test/test_pcm_mix.cxx')
-rw-r--r--test/test_pcm_mix.cxx18
1 files changed, 8 insertions, 10 deletions
diff --git a/test/test_pcm_mix.cxx b/test/test_pcm_mix.cxx
index b0e89639c..9c78399dc 100644
--- a/test/test_pcm_mix.cxx
+++ b/test/test_pcm_mix.cxx
@@ -22,10 +22,8 @@
#include "test_pcm_util.hxx"
#include "pcm/PcmMix.hxx"
-#include <glib.h>
-
template<typename T, SampleFormat format, typename G=GlibRandomInt<T>>
-void
+static void
TestPcmMix(G g=G())
{
constexpr unsigned N = 256;
@@ -36,21 +34,21 @@ TestPcmMix(G g=G())
auto result = src1;
bool success = pcm_mix(result.begin(), src2.begin(), sizeof(result),
format, 1.0);
- g_assert(success);
+ CPPUNIT_ASSERT(success);
AssertEqualWithTolerance(result, src1, 1);
/* portion1=0.0: result must be equal to src2 */
result = src1;
success = pcm_mix(result.begin(), src2.begin(), sizeof(result),
format, 0.0);
- g_assert(success);
+ CPPUNIT_ASSERT(success);
AssertEqualWithTolerance(result, src2, 1);
/* portion1=0.5 */
result = src1;
success = pcm_mix(result.begin(), src2.begin(), sizeof(result),
format, 0.5);
- g_assert(success);
+ CPPUNIT_ASSERT(success);
auto expected = src1;
for (unsigned i = 0; i < N; ++i)
@@ -60,25 +58,25 @@ TestPcmMix(G g=G())
}
void
-test_pcm_mix_8()
+PcmMixTest::TestMix8()
{
TestPcmMix<int8_t, SampleFormat::S8>();
}
void
-test_pcm_mix_16()
+PcmMixTest::TestMix16()
{
TestPcmMix<int16_t, SampleFormat::S16>();
}
void
-test_pcm_mix_24()
+PcmMixTest::TestMix24()
{
TestPcmMix<int32_t, SampleFormat::S24_P32>(GlibRandomInt24());
}
void
-test_pcm_mix_32()
+PcmMixTest::TestMix32()
{
TestPcmMix<int32_t, SampleFormat::S32>();
}