pcm/PcmExport: add flag to export to DSD_U32

This commit is contained in:
Max Kellermann
2016-02-26 18:17:11 +01:00
parent d1be643c0d
commit fb4f02cd38
4 changed files with 49 additions and 0 deletions

View File

@@ -115,6 +115,30 @@ PcmExportTest::TestReverseEndian()
CPPUNIT_ASSERT(memcmp(dest.data, expected4, dest.size) == 0);
}
void
PcmExportTest::TestDsdU32()
{
static constexpr uint8_t src[] = {
0x01, 0x23, 0x45, 0x67,
0x89, 0xab, 0xcd, 0xef,
};
static constexpr uint32_t expected[] = {
0xcd894501,
0xefab6723,
};
PcmExport::Params params;
params.dsd_u32 = true;
PcmExport e;
e.Open(SampleFormat::DSD, 2, params);
auto dest = e.Export({src, sizeof(src)});
CPPUNIT_ASSERT_EQUAL(sizeof(expected), dest.size);
CPPUNIT_ASSERT(memcmp(dest.data, expected, dest.size) == 0);
}
void
PcmExportTest::TestDop()
{