summaryrefslogtreecommitdiff
path: root/test/test_pcm_export.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2016-02-26 18:17:11 +0100
committerMax Kellermann <max@duempel.org>2016-02-27 07:42:09 +0100
commitfb4f02cd388c13093deebc4d7168600f259845a5 (patch)
tree7f6d9ec7923e22f7f5d0e68198bb91bdb51b3c66 /test/test_pcm_export.cxx
parentd1be643c0de70c865043127edb042a02f51d3c6d (diff)
pcm/PcmExport: add flag to export to DSD_U32
Diffstat (limited to 'test/test_pcm_export.cxx')
-rw-r--r--test/test_pcm_export.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/test_pcm_export.cxx b/test/test_pcm_export.cxx
index cea0de634..bd4deb42a 100644
--- a/test/test_pcm_export.cxx
+++ b/test/test_pcm_export.cxx
@@ -116,6 +116,30 @@ PcmExportTest::TestReverseEndian()
}
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()
{
static constexpr uint8_t src[] = {