test: use GTest instead of cppunit
This commit is contained in:
@@ -18,12 +18,12 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "test_pcm_all.hxx"
|
||||
#include "test_pcm_util.hxx"
|
||||
#include "pcm/PcmDither.cxx"
|
||||
|
||||
void
|
||||
PcmDitherTest::TestDither24()
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
TEST(PcmTest, Dither24)
|
||||
{
|
||||
constexpr unsigned N = 509;
|
||||
const auto src = TestDataBuffer<int32_t, N>(RandomInt24());
|
||||
@@ -33,13 +33,12 @@ PcmDitherTest::TestDither24()
|
||||
dither.Dither24To16(dest, src.begin(), src.end());
|
||||
|
||||
for (unsigned i = 0; i < N; ++i) {
|
||||
CPPUNIT_ASSERT(dest[i] >= (src[i] >> 8) - 8);
|
||||
CPPUNIT_ASSERT(dest[i] < (src[i] >> 8) + 8);
|
||||
EXPECT_GE(dest[i], (src[i] >> 8) - 8);
|
||||
EXPECT_LT(dest[i], (src[i] >> 8) + 8);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
PcmDitherTest::TestDither32()
|
||||
TEST(PcmTest, Dither32)
|
||||
{
|
||||
constexpr unsigned N = 509;
|
||||
const auto src = TestDataBuffer<int32_t, N>();
|
||||
@@ -49,7 +48,7 @@ PcmDitherTest::TestDither32()
|
||||
dither.Dither32To16(dest, src.begin(), src.end());
|
||||
|
||||
for (unsigned i = 0; i < N; ++i) {
|
||||
CPPUNIT_ASSERT(dest[i] >= (src[i] >> 16) - 8);
|
||||
CPPUNIT_ASSERT(dest[i] < (src[i] >> 16) + 8);
|
||||
EXPECT_GE(dest[i], (src[i] >> 16) - 8);
|
||||
EXPECT_LT(dest[i], (src[i] >> 16) + 8);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user