summaryrefslogtreecommitdiff
path: root/cras/src/tests/audio_thread_unittest.cc
diff options
context:
space:
mode:
authorHsin-Yu Chao <hychao@chromium.org>2014-08-19 15:38:57 +0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-08-20 06:25:22 +0000
commitb20161c26d41425a86b84bd93a1876e15976e9d9 (patch)
treed8341ddd25643db74ea9b38df692d0d1fed7336a /cras/src/tests/audio_thread_unittest.cc
parentc3722294fb9d1775839d753e53c563512847d512 (diff)
downloadadhd-b20161c26d41425a86b84bd93a1876e15976e9d9.tar.gz
Revert "CRAS: unittest - write two streams one empty one full"
This reverts commit c3722294fb9d1775839d753e53c563512847d512. This unittest was added to test that when two streams added, should skip mix the empty stream. This turns out wrong and cause problem on two output streams of different cb_threshold, the correct solution is to skip write an empty stream only when it's empty after fetch. Correct unittest will be added in later change. BUG=chromium:404885 TEST=make check Change-Id: I34542cf9c96426719829bd3a12d65eee3b0726b4 Reviewed-on: https://chromium-review.googlesource.com/213043 Reviewed-by: Chinyue Chen <chinyue@chromium.org> Tested-by: Hsinyu Chao <hychao@chromium.org> Commit-Queue: Hsinyu Chao <hychao@chromium.org>
Diffstat (limited to 'cras/src/tests/audio_thread_unittest.cc')
-rw-r--r--cras/src/tests/audio_thread_unittest.cc35
1 files changed, 0 insertions, 35 deletions
diff --git a/cras/src/tests/audio_thread_unittest.cc b/cras/src/tests/audio_thread_unittest.cc
index ddfa4541..774f4f85 100644
--- a/cras/src/tests/audio_thread_unittest.cc
+++ b/cras/src/tests/audio_thread_unittest.cc
@@ -37,7 +37,6 @@ static uint32_t select_write_value;
static unsigned int cras_iodev_set_format_called;
static unsigned int cras_iodev_set_playback_timestamp_called;
static unsigned int cras_system_get_volume_return;
-static unsigned int cras_mix_add_stream_called;
static int cras_dsp_get_pipeline_called;
static int cras_dsp_get_pipeline_ret;
@@ -663,7 +662,6 @@ class WriteStreamSuite : public testing::Test {
cras_metrics_log_event_called = 0;
cras_rstream_request_audio_called = 0;
cras_rstream_destroy_called = 0;
- cras_mix_add_stream_called = 0;
cras_dsp_get_pipeline_called = 0;
is_open_ = 0;
close_dev_called_ = 0;
@@ -1057,7 +1055,6 @@ TEST_F(WriteStreamSuite, PossiblyFillGetFromTwoStreamsFull) {
is_open_ = 1;
rc = unified_io(thread_, &ts);
EXPECT_EQ(0, rc);
- EXPECT_EQ(2, cras_mix_add_stream_called);
EXPECT_EQ(0, ts.tv_sec);
EXPECT_GE(ts.tv_nsec, nsec_expected - 1000);
EXPECT_LE(ts.tv_nsec, nsec_expected + 1000);
@@ -1067,36 +1064,6 @@ TEST_F(WriteStreamSuite, PossiblyFillGetFromTwoStreamsFull) {
EXPECT_EQ(-1, select_max_fd);
}
-TEST_F(WriteStreamSuite, PossiblyFillGetFromTwoOneEmpty) {
- struct timespec ts;
- int rc;
-
- // Have cb_threshold samples left.
- frames_queued_ = cb_threshold_;
- audio_buffer_size_ = buffer_frames_ - frames_queued_;
-
- // First stream empty while the second stream full.
- shm_->area->write_offset[0] = 0;
- shm2_->area->write_offset[0] = cras_shm_used_size(shm2_);
-
- thread_add_stream(thread_, rstream2_);
-
- FD_ZERO(&select_out_fds);
- FD_SET(rstream_->fd, &select_out_fds);
- select_return_value = 1;
-
- is_open_ = 1;
- rc = unified_io(thread_, &ts);
-
- // Assert that the empty stream is skipped, only one stream mixed.
- EXPECT_EQ(0, rc);
- EXPECT_EQ(1, cras_mix_add_stream_called);
- EXPECT_EQ(buffer_frames_ - cb_threshold_, cras_mix_add_stream_count);
- EXPECT_EQ(1, cras_rstream_request_audio_called);
- EXPECT_NE(-1, select_max_fd);
- EXPECT_EQ(0, memcmp(&select_out_fds, &select_in_fds, sizeof(select_in_fds)));
-}
-
TEST_F(WriteStreamSuite, PossiblyFillGetFromTwoStreamsFullOneMixes) {
struct timespec ts;
int rc;
@@ -2161,8 +2128,6 @@ size_t cras_mix_add_stream(struct cras_audio_shm *shm,
size_t num_samples;
size_t frames = 0;
- cras_mix_add_stream_called++;
-
if (cras_mix_add_stream_dont_fill_next) {
cras_mix_add_stream_dont_fill_next = 0;
return 0;