summaryrefslogtreecommitdiff
path: root/cras/src/tests/audio_thread_unittest.cc
diff options
context:
space:
mode:
authorDylan Reid <dgreid@chromium.org>2014-07-13 19:55:55 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-07-14 23:00:49 +0000
commitd13ae5ade516dacf440258eb04c6bd6bef983d37 (patch)
tree83de3fc4d9909029dc9686864a4a5810bcd91d89 /cras/src/tests/audio_thread_unittest.cc
parentfc9fe26b9b69443463524834a9232c4d59437d05 (diff)
downloadadhd-d13ae5ade516dacf440258eb04c6bd6bef983d37.tar.gz
CRAS: audio_thread_ut - Fix audio_area_copy for idx == 0 case.
Make the stub behave the same as the implementation. This probably should be tested differently now, but fix what we have for now. BUG=none TEST=none Change-Id: Id76797150ee75dce0542b0da4a2dbb3424ef3406 Signed-off-by: Dylan Reid <dgreid@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/207736 Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Diffstat (limited to 'cras/src/tests/audio_thread_unittest.cc')
-rw-r--r--cras/src/tests/audio_thread_unittest.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/cras/src/tests/audio_thread_unittest.cc b/cras/src/tests/audio_thread_unittest.cc
index fb57d827..fe0f2010 100644
--- a/cras/src/tests/audio_thread_unittest.cc
+++ b/cras/src/tests/audio_thread_unittest.cc
@@ -2361,6 +2361,10 @@ void cras_audio_area_copy(const struct cras_audio_area *dst,
{
unsigned count, i;
int16_t *dchan, *schan;
+
+ if (src_index == 0)
+ memset(dst->channels[0].buf, 0, src->frames * dst_format_bytes);
+
dchan = (int16_t *)(dst->channels[0].buf +
dst_offset * dst->channels[0].step_bytes);
schan = (int16_t *)src->channels[0].buf;