1 /*
2  *  Copyright (c) 2013 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 #include "testing/gtest/include/gtest/gtest.h"
12 #include "webrtc/common_audio/resampler/include/push_resampler.h"
13 
14 // Quality testing of PushResampler is handled through output_mixer_unittest.cc.
15 
16 namespace webrtc {
17 
TEST(PushResamplerTest,VerifiesInputParameters)18 TEST(PushResamplerTest, VerifiesInputParameters) {
19   PushResampler<int16_t> resampler;
20   EXPECT_EQ(-1, resampler.InitializeIfNeeded(-1, 16000, 1));
21   EXPECT_EQ(-1, resampler.InitializeIfNeeded(16000, -1, 1));
22   EXPECT_EQ(-1, resampler.InitializeIfNeeded(16000, 16000, 0));
23   EXPECT_EQ(-1, resampler.InitializeIfNeeded(16000, 16000, 3));
24   EXPECT_EQ(0, resampler.InitializeIfNeeded(16000, 16000, 1));
25   EXPECT_EQ(0, resampler.InitializeIfNeeded(16000, 16000, 2));
26 }
27 
28 }  // namespace webrtc
29