mock_wavreader.cc (1219B)
1 /* 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #include "modules/audio_processing/test/conversational_speech/mock_wavreader.h" 12 13 #include <cstddef> 14 15 #include "test/gmock.h" 16 17 namespace webrtc { 18 namespace test { 19 namespace conversational_speech { 20 21 using ::testing::Return; 22 23 MockWavReader::MockWavReader(int sample_rate, 24 size_t num_channels, 25 size_t num_samples) 26 : sample_rate_(sample_rate), 27 num_channels_(num_channels), 28 num_samples_(num_samples) { 29 ON_CALL(*this, SampleRate()).WillByDefault(Return(sample_rate_)); 30 ON_CALL(*this, NumChannels()).WillByDefault(Return(num_channels_)); 31 ON_CALL(*this, NumSamples()).WillByDefault(Return(num_samples_)); 32 } 33 34 MockWavReader::~MockWavReader() = default; 35 36 } // namespace conversational_speech 37 } // namespace test 38 } // namespace webrtc