summaryrefslogtreecommitdiff
path: root/test/test_pcm_export.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-01-10 23:48:26 +0100
committerMax Kellermann <max@musicpd.org>2017-01-10 23:48:26 +0100
commitc143adba914b2ffad4e773531d301fdc687622c9 (patch)
treebe42a4fc7a753365bee9bac67164802413c38c74 /test/test_pcm_export.cxx
parent142fdc8d86d26ebf478d87fc751181fd578e8c70 (diff)
pcm/Export: add CalcOutputSampleRate(), CalcInputSampleRate()
Prepare for DSD sample rate fixups.
Diffstat (limited to 'test/test_pcm_export.cxx')
-rw-r--r--test/test_pcm_export.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test_pcm_export.cxx b/test/test_pcm_export.cxx
index 6d64bb765..2c2e32013 100644
--- a/test/test_pcm_export.cxx
+++ b/test/test_pcm_export.cxx
@@ -35,6 +35,9 @@ PcmExportTest::TestShift8()
PcmExport::Params params;
params.shift8 = true;
+ CPPUNIT_ASSERT_EQUAL(params.CalcOutputSampleRate(42u), 42u);
+ CPPUNIT_ASSERT_EQUAL(params.CalcInputSampleRate(42u), 42u);
+
PcmExport e;
e.Open(SampleFormat::S24_P32, 2, params);
@@ -71,6 +74,9 @@ PcmExportTest::TestPack24()
PcmExport::Params params;
params.pack24 = true;
+ CPPUNIT_ASSERT_EQUAL(params.CalcOutputSampleRate(42u), 42u);
+ CPPUNIT_ASSERT_EQUAL(params.CalcInputSampleRate(42u), 42u);
+
PcmExport e;
e.Open(SampleFormat::S24_P32, 2, params);
@@ -97,6 +103,9 @@ PcmExportTest::TestReverseEndian()
PcmExport::Params params;
params.reverse_endian = true;
+ CPPUNIT_ASSERT_EQUAL(params.CalcOutputSampleRate(42u), 42u);
+ CPPUNIT_ASSERT_EQUAL(params.CalcInputSampleRate(42u), 42u);
+
PcmExport e;
e.Open(SampleFormat::S8, 2, params);
@@ -192,6 +201,9 @@ TestAlsaChannelOrder51()
PcmExport::Params params;
params.alsa_channel_order = true;
+ CPPUNIT_ASSERT_EQUAL(params.CalcOutputSampleRate(42u), 42u);
+ CPPUNIT_ASSERT_EQUAL(params.CalcInputSampleRate(42u), 42u);
+
PcmExport e;
e.Open(F, 6, params);
@@ -219,6 +231,9 @@ TestAlsaChannelOrder71()
PcmExport::Params params;
params.alsa_channel_order = true;
+ CPPUNIT_ASSERT_EQUAL(params.CalcOutputSampleRate(42u), 42u);
+ CPPUNIT_ASSERT_EQUAL(params.CalcInputSampleRate(42u), 42u);
+
PcmExport e;
e.Open(F, 8, params);