blob: f982f52eb5a4d7fda95954b6d013abcf81746cfb [file] [log] [blame]
bjornv@webrtc.orge6471ba2012-01-09 09:54:07 +00001/*
bjornv@webrtc.orgf4b77fd2012-01-25 12:40:00 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
bjornv@webrtc.orge6471ba2012-01-09 09:54:07 +00003 *
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 Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef COMMON_AUDIO_VAD_VAD_UNITTEST_H_
12#define COMMON_AUDIO_VAD_VAD_UNITTEST_H_
bjornv@webrtc.orge6471ba2012-01-09 09:54:07 +000013
14#include <stddef.h> // size_t
15
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020016#include "test/gtest.h"
Mirko Bonadei71207422017-09-15 13:58:09 +020017#include "typedefs.h" // NOLINT(build/include)
bjornv@webrtc.orge6471ba2012-01-09 09:54:07 +000018
oprypin67fdb802017-03-09 06:25:06 -080019namespace webrtc {
20namespace test {
bjornv@webrtc.orge6471ba2012-01-09 09:54:07 +000021
22// Modes we support
bjornv@webrtc.orgf4b77fd2012-01-25 12:40:00 +000023const int kModes[] = { 0, 1, 2, 3 };
bjornv@webrtc.orge6471ba2012-01-09 09:54:07 +000024const size_t kModesSize = sizeof(kModes) / sizeof(*kModes);
25
26// Rates we support.
tina.legrand@webrtc.orgef433572012-10-15 17:46:19 +000027const int kRates[] = { 8000, 12000, 16000, 24000, 32000, 48000 };
bjornv@webrtc.orge6471ba2012-01-09 09:54:07 +000028const size_t kRatesSize = sizeof(kRates) / sizeof(*kRates);
29
30// Frame lengths we support.
Peter Kastingdce40cf2015-08-24 14:52:23 -070031const size_t kMaxFrameLength = 1440;
32const size_t kFrameLengths[] = { 80, 120, 160, 240, 320, 480, 640, 960,
bjornv@webrtc.orge6471ba2012-01-09 09:54:07 +000033 kMaxFrameLength };
34const size_t kFrameLengthsSize = sizeof(kFrameLengths) / sizeof(*kFrameLengths);
35
oprypin67fdb802017-03-09 06:25:06 -080036} // namespace test
37} // namespace webrtc
bjornv@webrtc.orge6471ba2012-01-09 09:54:07 +000038
39class 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 Kastingdce40cf2015-08-24 14:52:23 -070046 bool ValidRatesAndFrameLengths(int rate, size_t frame_length);
bjornv@webrtc.orge6471ba2012-01-09 09:54:07 +000047};
48
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020049#endif // COMMON_AUDIO_VAD_VAD_UNITTEST_H_