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_dither.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'test/test_pcm_dither.cxx') diff --git a/test/test_pcm_dither.cxx b/test/test_pcm_dither.cxx index 5694c17f8..5df64c2d1 100644 --- a/test/test_pcm_dither.cxx +++ b/test/test_pcm_dither.cxx @@ -21,10 +21,8 @@ #include "test_pcm_util.hxx" #include "pcm/PcmDither.hxx" -#include - void -test_pcm_dither_24() +PcmDitherTest::TestDither24() { constexpr unsigned N = 256; const auto src = TestDataBuffer(GlibRandomInt24()); @@ -34,13 +32,13 @@ test_pcm_dither_24() dither.Dither24To16(dest, src.begin(), src.end()); for (unsigned i = 0; i < N; ++i) { - g_assert_cmpint(dest[i], >=, (src[i] >> 8) - 8); - g_assert_cmpint(dest[i], <, (src[i] >> 8) + 8); + CPPUNIT_ASSERT(dest[i] >= (src[i] >> 8) - 8); + CPPUNIT_ASSERT(dest[i] < (src[i] >> 8) + 8); } } void -test_pcm_dither_32() +PcmDitherTest::TestDither32() { constexpr unsigned N = 256; const auto src = TestDataBuffer(); @@ -50,7 +48,7 @@ test_pcm_dither_32() dither.Dither32To16(dest, src.begin(), src.end()); for (unsigned i = 0; i < N; ++i) { - g_assert_cmpint(dest[i], >=, (src[i] >> 16) - 8); - g_assert_cmpint(dest[i], <, (src[i] >> 16) + 8); + CPPUNIT_ASSERT(dest[i] >= (src[i] >> 16) - 8); + CPPUNIT_ASSERT(dest[i] < (src[i] >> 16) + 8); } } -- cgit v1.2.3