blob: 5fb726d47f260759b458090dbd374f2e209cb2cb [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
pbos@webrtc.orgaa30bb72013-05-27 09:49:58 +000016#include "testing/gtest/include/gtest/gtest.h"
bjornv@webrtc.orgb1c32762012-06-12 08:19:24 +000017
pbos@webrtc.orgaa30bb72013-05-27 09:49:58 +000018#include "webrtc/typedefs.h"
bjornv@webrtc.orge6471ba2012-01-09 09:54:07 +000019
20namespace {
21
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.
tina.legrand@webrtc.orgef433572012-10-15 17:46:19 +000031const int kMaxFrameLength = 1440;
32const int 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
36} // namespace
37
38class VadTest : public ::testing::Test {
39 protected:
40 VadTest();
41 virtual void SetUp();
42 virtual void TearDown();
43
44 // Returns true if the rate and frame length combination is valid.
bjornv@webrtc.orgb38fca12012-06-19 11:03:32 +000045 bool ValidRatesAndFrameLengths(int rate, int frame_length);
bjornv@webrtc.orge6471ba2012-01-09 09:54:07 +000046};
47
bjornv@webrtc.orgb1c32762012-06-12 08:19:24 +000048#endif // WEBRTC_COMMON_AUDIO_VAD_VAD_UNITTEST_H