andrew@webrtc.org | 50b2efe | 2013-04-29 17:27:29 +0000 | [diff] [blame] | 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 | |
andrew@webrtc.org | c1eb560 | 2013-06-03 19:00:29 +0000 | [diff] [blame] | 18 | TEST(PushResamplerTest, VerifiesInputParameters) { |
andrew@webrtc.org | f5a33f1 | 2014-04-19 00:32:07 +0000 | [diff] [blame] | 19 | PushResampler<int16_t> resampler; |
andrew@webrtc.org | c1eb560 | 2013-06-03 19:00:29 +0000 | [diff] [blame] | 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)); |
andrew@webrtc.org | 50b2efe | 2013-04-29 17:27:29 +0000 | [diff] [blame] | 26 | } |
| 27 | |
andrew@webrtc.org | 50b2efe | 2013-04-29 17:27:29 +0000 | [diff] [blame] | 28 | } // namespace webrtc |