From 401a799a1b5de5d70a6b4c1d49235af0d5618f37 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 16 Oct 2013 21:55:00 +0200 Subject: test: use the CPPUNIT framework for unit tests --- test/test_pcm_mix.cxx | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'test/test_pcm_mix.cxx') 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 - template> -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(); } void -test_pcm_mix_16() +PcmMixTest::TestMix16() { TestPcmMix(); } void -test_pcm_mix_24() +PcmMixTest::TestMix24() { TestPcmMix(GlibRandomInt24()); } void -test_pcm_mix_32() +PcmMixTest::TestMix32() { TestPcmMix(); } -- cgit v1.2.3