bjornv@webrtc.org | e6471ba | 2012-01-09 09:54:07 +0000 | [diff] [blame] | 1 | /* |
bjornv@webrtc.org | f4b77fd | 2012-01-25 12:40:00 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
bjornv@webrtc.org | e6471ba | 2012-01-09 09:54:07 +0000 | [diff] [blame] | 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 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef COMMON_AUDIO_VAD_VAD_UNITTEST_H_ |
| 12 | #define COMMON_AUDIO_VAD_VAD_UNITTEST_H_ |
bjornv@webrtc.org | e6471ba | 2012-01-09 09:54:07 +0000 | [diff] [blame] | 13 | |
| 14 | #include <stddef.h> // size_t |
| 15 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 16 | #include "test/gtest.h" |
Mirko Bonadei | 7120742 | 2017-09-15 13:58:09 +0200 | [diff] [blame^] | 17 | #include "typedefs.h" // NOLINT(build/include) |
bjornv@webrtc.org | e6471ba | 2012-01-09 09:54:07 +0000 | [diff] [blame] | 18 | |
oprypin | 67fdb80 | 2017-03-09 06:25:06 -0800 | [diff] [blame] | 19 | namespace webrtc { |
| 20 | namespace test { |
bjornv@webrtc.org | e6471ba | 2012-01-09 09:54:07 +0000 | [diff] [blame] | 21 | |
| 22 | // Modes we support |
bjornv@webrtc.org | f4b77fd | 2012-01-25 12:40:00 +0000 | [diff] [blame] | 23 | const int kModes[] = { 0, 1, 2, 3 }; |
bjornv@webrtc.org | e6471ba | 2012-01-09 09:54:07 +0000 | [diff] [blame] | 24 | const size_t kModesSize = sizeof(kModes) / sizeof(*kModes); |
| 25 | |
| 26 | // Rates we support. |
tina.legrand@webrtc.org | ef43357 | 2012-10-15 17:46:19 +0000 | [diff] [blame] | 27 | const int kRates[] = { 8000, 12000, 16000, 24000, 32000, 48000 }; |
bjornv@webrtc.org | e6471ba | 2012-01-09 09:54:07 +0000 | [diff] [blame] | 28 | const size_t kRatesSize = sizeof(kRates) / sizeof(*kRates); |
| 29 | |
| 30 | // Frame lengths we support. |
Peter Kasting | dce40cf | 2015-08-24 14:52:23 -0700 | [diff] [blame] | 31 | const size_t kMaxFrameLength = 1440; |
| 32 | const size_t kFrameLengths[] = { 80, 120, 160, 240, 320, 480, 640, 960, |
bjornv@webrtc.org | e6471ba | 2012-01-09 09:54:07 +0000 | [diff] [blame] | 33 | kMaxFrameLength }; |
| 34 | const size_t kFrameLengthsSize = sizeof(kFrameLengths) / sizeof(*kFrameLengths); |
| 35 | |
oprypin | 67fdb80 | 2017-03-09 06:25:06 -0800 | [diff] [blame] | 36 | } // namespace test |
| 37 | } // namespace webrtc |
bjornv@webrtc.org | e6471ba | 2012-01-09 09:54:07 +0000 | [diff] [blame] | 38 | |
| 39 | class VadTest : public ::testing::Test { |
| 40 | protected: |
| 41 | VadTest(); |
| 42 | virtual void SetUp(); |
| 43 | virtual void TearDown(); |
| 44 | |
| 45 | // Returns true if the rate and frame length combination is valid. |
Peter Kasting | dce40cf | 2015-08-24 14:52:23 -0700 | [diff] [blame] | 46 | bool ValidRatesAndFrameLengths(int rate, size_t frame_length); |
bjornv@webrtc.org | e6471ba | 2012-01-09 09:54:07 +0000 | [diff] [blame] | 47 | }; |
| 48 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 49 | #endif // COMMON_AUDIO_VAD_VAD_UNITTEST_H_ |