blob: 87852e84a2dc4099d8670a8fcc5b9373168f556c [file] [log] [blame]
bjornv@webrtc.orge6471ba2012-01-09 09:54:07 +00001/*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
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
11#ifndef WEBRTC_COMMONT_AUDIO_VAD_VAD_UNIT_TESTS_H
12#define WEBRTC_COMMONT_AUDIO_VAD_VAD_UNIT_TESTS_H
13
14#include <stddef.h> // size_t
15
16#include "gtest/gtest.h"
17#include "typedefs.h"
18
19namespace {
20
21// Modes we support
22const int16_t kModes[] = { 0, 1, 2, 3 };
23const size_t kModesSize = sizeof(kModes) / sizeof(*kModes);
24
25// Rates we support.
26const int16_t kRates[] = { 8000, 12000, 16000, 24000, 32000 };
27const size_t kRatesSize = sizeof(kRates) / sizeof(*kRates);
28
29// Frame lengths we support.
30const int16_t kMaxFrameLength = 960;
31const int16_t kFrameLengths[] = { 80, 120, 160, 240, 320, 480, 640,
32 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.
44 bool ValidRatesAndFrameLengths(int16_t rate, int16_t frame_length);
45};
46
47#endif // WEBRTC_COMMONT_AUDIO_VAD_VAD_UNIT_TESTS_H