blob: 55ba5271f320f4a1194d7ec0a0785714129f346c [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
bjornv@webrtc.orgb1c32762012-06-12 08:19:24 +000011#ifndef WEBRTC_COMMON_AUDIO_VAD_VAD_UNITTEST_H
12#define WEBRTC_COMMON_AUDIO_VAD_VAD_UNITTEST_H
bjornv@webrtc.orge6471ba2012-01-09 09:54:07 +000013
14#include <stddef.h> // size_t
15
kwiberg77eab702016-09-28 17:42:01 -070016#include "webrtc/test/gtest.h"
pbos@webrtc.orgaa30bb72013-05-27 09:49:58 +000017#include "webrtc/typedefs.h"
bjornv@webrtc.orge6471ba2012-01-09 09:54:07 +000018
19namespace {
20
21// Modes we support
bjornv@webrtc.orgf4b77fd2012-01-25 12:40:00 +000022const int kModes[] = { 0, 1, 2, 3 };
bjornv@webrtc.orge6471ba2012-01-09 09:54:07 +000023const size_t kModesSize = sizeof(kModes) / sizeof(*kModes);
24
25// Rates we support.
tina.legrand@webrtc.orgef433572012-10-15 17:46:19 +000026const int kRates[] = { 8000, 12000, 16000, 24000, 32000, 48000 };
bjornv@webrtc.orge6471ba2012-01-09 09:54:07 +000027const size_t kRatesSize = sizeof(kRates) / sizeof(*kRates);
28
29// Frame lengths we support.
Peter Kastingdce40cf2015-08-24 14:52:23 -070030const size_t kMaxFrameLength = 1440;
31const size_t kFrameLengths[] = { 80, 120, 160, 240, 320, 480, 640, 960,
bjornv@webrtc.orge6471ba2012-01-09 09:54:07 +000032 kMaxFrameLength };
33const size_t kFrameLengthsSize = sizeof(kFrameLengths) / sizeof(*kFrameLengths);
34
35} // namespace
36
37class VadTest : public ::testing::Test {
38 protected:
39 VadTest();
40 virtual void SetUp();
41 virtual void TearDown();
42
43 // Returns true if the rate and frame length combination is valid.
Peter Kastingdce40cf2015-08-24 14:52:23 -070044 bool ValidRatesAndFrameLengths(int rate, size_t frame_length);
bjornv@webrtc.orge6471ba2012-01-09 09:54:07 +000045};
46
bjornv@webrtc.orgb1c32762012-06-12 08:19:24 +000047#endif // WEBRTC_COMMON_AUDIO_VAD_VAD_UNITTEST_H