| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_MOCK_WAVREADE
R_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_MOCK_WAVREADE
R_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_MOCK_WAVREADE
R_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_MOCK_WAVREADE
R_H_ |
| 13 | 13 |
| 14 #include <cstddef> | 14 #include <cstddef> |
| 15 #include <string> | 15 #include <string> |
| 16 | 16 |
| 17 #include "webrtc/modules/audio_processing/test/conversational_speech/wavreader_i
nterface.h" | 17 #include "webrtc/modules/audio_processing/test/conversational_speech/wavreader_i
nterface.h" |
| 18 #include "webrtc/test/gmock.h" | 18 #include "webrtc/test/gmock.h" |
| 19 #include "webrtc/typedefs.h" | 19 #include "webrtc/typedefs.h" |
| 20 | 20 |
| 21 namespace webrtc { | 21 namespace webrtc { |
| 22 namespace test { | 22 namespace test { |
| 23 namespace conversational_speech { | 23 namespace conversational_speech { |
| 24 | 24 |
| 25 class MockWavReader : public WavReaderInterface { | 25 class MockWavReader : public WavReaderInterface { |
| 26 public: | 26 public: |
| 27 MockWavReader( | 27 MockWavReader(int sample_rate, size_t num_channels, size_t num_samples); |
| 28 int sample_rate, size_t num_channels, size_t num_samples) | 28 ~MockWavReader(); |
| 29 : sample_rate_(sample_rate), num_channels_(num_channels), | |
| 30 num_samples_(num_samples) {} | |
| 31 ~MockWavReader() = default; | |
| 32 | 29 |
| 33 // TOOD(alessiob): use ON_CALL to return random samples. | 30 // TODO(alessiob): use ON_CALL to return random samples. |
| 34 MOCK_METHOD2(ReadFloatSamples, size_t(size_t, float*)); | 31 MOCK_METHOD2(ReadFloatSamples, size_t(size_t, float*)); |
| 35 MOCK_METHOD2(ReadInt16Samples, size_t(size_t, int16_t*)); | 32 MOCK_METHOD2(ReadInt16Samples, size_t(size_t, int16_t*)); |
| 36 | 33 |
| 37 // TOOD(alessiob): use ON_CALL to return properties. | |
| 38 MOCK_CONST_METHOD0(sample_rate, int()); | 34 MOCK_CONST_METHOD0(sample_rate, int()); |
| 39 MOCK_CONST_METHOD0(num_channels, size_t()); | 35 MOCK_CONST_METHOD0(num_channels, size_t()); |
| 40 MOCK_CONST_METHOD0(num_samples, size_t()); | 36 MOCK_CONST_METHOD0(num_samples, size_t()); |
| 41 | 37 |
| 42 private: | 38 private: |
| 43 const int sample_rate_; | 39 const int sample_rate_; |
| 44 const size_t num_channels_; | 40 const size_t num_channels_; |
| 45 const size_t num_samples_; | 41 const size_t num_samples_; |
| 46 }; | 42 }; |
| 47 | 43 |
| 48 } // namespace conversational_speech | 44 } // namespace conversational_speech |
| 49 } // namespace test | 45 } // namespace test |
| 50 } // namespace webrtc | 46 } // namespace webrtc |
| 51 | 47 |
| 52 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_MOCK_WAVRE
ADER_H_ | 48 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_MOCK_WAVRE
ADER_H_ |
| OLD | NEW |