19a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org/* 29a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 39a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org * 49a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org * Use of this source code is governed by a BSD-style license 59a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org * that can be found in the LICENSE file in the root of the source 69a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org * tree. An additional intellectual property rights grant can be found 79a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org * in the file PATENTS. All contributing project authors may 89a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org * be found in the AUTHORS file in the root of the source tree. 99a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org */ 109a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org 119a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org// Unit tests for Expand class. 129a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org 13e5abc854f3dc47de16067c2a41476c39b7626722henrik.lundin@webrtc.org#include "webrtc/modules/audio_coding/neteq/expand.h" 149a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org 159a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org#include "gtest/gtest.h" 16e5abc854f3dc47de16067c2a41476c39b7626722henrik.lundin@webrtc.org#include "webrtc/modules/audio_coding/neteq/background_noise.h" 17e5abc854f3dc47de16067c2a41476c39b7626722henrik.lundin@webrtc.org#include "webrtc/modules/audio_coding/neteq/random_vector.h" 18e5abc854f3dc47de16067c2a41476c39b7626722henrik.lundin@webrtc.org#include "webrtc/modules/audio_coding/neteq/sync_buffer.h" 199a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org 209a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.orgnamespace webrtc { 219a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org 229a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.orgTEST(Expand, CreateAndDestroy) { 239a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org int fs = 8000; 249a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org size_t channels = 1; 259a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org BackgroundNoise bgn(channels); 269a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org SyncBuffer sync_buffer(1, 1000); 279a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org RandomVector random_vector; 289a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org Expand expand(&bgn, &sync_buffer, &random_vector, fs, channels); 299a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org} 309a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org 3137fb66d3bde95c19f5c80ece459f5dd632077ff5henrik.lundin@webrtc.orgTEST(Expand, CreateUsingFactory) { 3237fb66d3bde95c19f5c80ece459f5dd632077ff5henrik.lundin@webrtc.org int fs = 8000; 3337fb66d3bde95c19f5c80ece459f5dd632077ff5henrik.lundin@webrtc.org size_t channels = 1; 3437fb66d3bde95c19f5c80ece459f5dd632077ff5henrik.lundin@webrtc.org BackgroundNoise bgn(channels); 3537fb66d3bde95c19f5c80ece459f5dd632077ff5henrik.lundin@webrtc.org SyncBuffer sync_buffer(1, 1000); 3637fb66d3bde95c19f5c80ece459f5dd632077ff5henrik.lundin@webrtc.org RandomVector random_vector; 3737fb66d3bde95c19f5c80ece459f5dd632077ff5henrik.lundin@webrtc.org ExpandFactory expand_factory; 3837fb66d3bde95c19f5c80ece459f5dd632077ff5henrik.lundin@webrtc.org Expand* expand = 3937fb66d3bde95c19f5c80ece459f5dd632077ff5henrik.lundin@webrtc.org expand_factory.Create(&bgn, &sync_buffer, &random_vector, fs, channels); 4037fb66d3bde95c19f5c80ece459f5dd632077ff5henrik.lundin@webrtc.org EXPECT_TRUE(expand != NULL); 4137fb66d3bde95c19f5c80ece459f5dd632077ff5henrik.lundin@webrtc.org delete expand; 4237fb66d3bde95c19f5c80ece459f5dd632077ff5henrik.lundin@webrtc.org} 4337fb66d3bde95c19f5c80ece459f5dd632077ff5henrik.lundin@webrtc.org 449a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org// TODO(hlundin): Write more tests. 459a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org 469a400812ca0006d12e538d465ab6728a8ecd07aahenrik.lundin@webrtc.org} // namespace webrtc 47