Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Unified Diff: media/base/audio_bus_unittest.cc

Issue 11098031: Get PulseAudio implementation working. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/audio_bus.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_bus_unittest.cc
diff --git a/media/base/audio_bus_unittest.cc b/media/base/audio_bus_unittest.cc
index 476c82ed155d399824d3b0ccaf1943a150f4c805..8fad49dbc2edfcb3b32d91c6bf12b4a900e7b7ed 100644
--- a/media/base/audio_bus_unittest.cc
+++ b/media/base/audio_bus_unittest.cc
@@ -334,4 +334,26 @@ TEST_F(AudioBusTest, ToInterleaved) {
}
}
+// Verify ToInterleavedPartial() interleaves audio correctly.
+TEST_F(AudioBusTest, ToInterleavedPartial) {
+ // Only interleave the middle two frames in each channel.
+ static const int kPartialStart = 1;
+ static const int kPartialFrames = 2;
+ ASSERT_LE(kPartialStart + kPartialFrames, kTestVectorFrames);
+
+ scoped_ptr<AudioBus> expected = AudioBus::Create(
+ kTestVectorChannels, kTestVectorFrames);
+ for (int ch = 0; ch < kTestVectorChannels; ++ch) {
+ memcpy(expected->channel(ch), kTestVectorResult[ch],
+ kTestVectorFrames * sizeof(*expected->channel(ch)));
+ }
+
+ int16 test_array[arraysize(kTestVectorInt16)];
+ expected->ToInterleavedPartial(
+ kPartialStart, kPartialFrames, sizeof(*kTestVectorInt16), test_array);
+ ASSERT_EQ(memcmp(
+ test_array, kTestVectorInt16 + kPartialStart * kTestVectorChannels,
+ kPartialFrames * sizeof(*kTestVectorInt16)), 0);
+}
+
} // namespace media
« no previous file with comments | « media/base/audio_bus.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698