From 530963925e6aff39572dd36cc5f309085329a162 Mon Sep 17 00:00:00 2001 From: "bjornv@webrtc.org" Date: Tue, 7 Feb 2012 08:10:46 +0000 Subject: [PATCH] Solves buffer overrun crash on Windows [issue 258]. Removed function calls not tested. Added a TODO on activating them when refactoring signal_processing. Review URL: https://webrtc-codereview.appspot.com/379012 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1620 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../signal_processing_unittest.cc | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/common_audio/signal_processing/signal_processing_unittest.cc b/src/common_audio/signal_processing/signal_processing_unittest.cc index 4394bbd6a..606b2694b 100644 --- a/src/common_audio/signal_processing/signal_processing_unittest.cc +++ b/src/common_audio/signal_processing/signal_processing_unittest.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -394,8 +394,8 @@ TEST_F(SplTest, RandTest) { TEST_F(SplTest, SignalProcessingTest) { const int kVectorSize = 4; int A[] = {1, 2, 33, 100}; + const WebRtc_Word16 kHanning[4] = { 2399, 8192, 13985, 16384 }; WebRtc_Word16 b16[kVectorSize]; - WebRtc_Word32 b32[kVectorSize]; WebRtc_Word16 bTmp16[kVectorSize]; WebRtc_Word32 bTmp32[kVectorSize]; @@ -404,26 +404,27 @@ TEST_F(SplTest, SignalProcessingTest) { for (int kk = 0; kk < kVectorSize; ++kk) { b16[kk] = A[kk]; - b32[kk] = A[kk]; } EXPECT_EQ(2, WebRtcSpl_AutoCorrelation(b16, kVectorSize, 1, bTmp32, &bScale)); - WebRtcSpl_ReflCoefToLpc(b16, kVectorSize, bTmp16); -// for (int kk = 0; kk < kVectorSize; ++kk) { -// EXPECT_EQ(aTmp16[kk], bTmp16[kk]); -// } - WebRtcSpl_LpcToReflCoef(bTmp16, kVectorSize, b16); -// for (int kk = 0; kk < kVectorSize; ++kk) { -// EXPECT_EQ(a16[kk], b16[kk]); -// } - WebRtcSpl_AutoCorrToReflCoef(b32, kVectorSize, bTmp16); -// for (int kk = 0; kk < kVectorSize; ++kk) { -// EXPECT_EQ(aTmp16[kk], bTmp16[kk]); -// } + // TODO(bjornv): Activate the Reflection Coefficient tests when refactoring. +// WebRtcSpl_ReflCoefToLpc(b16, kVectorSize, bTmp16); +//// for (int kk = 0; kk < kVectorSize; ++kk) { +//// EXPECT_EQ(aTmp16[kk], bTmp16[kk]); +//// } +// WebRtcSpl_LpcToReflCoef(bTmp16, kVectorSize, b16); +//// for (int kk = 0; kk < kVectorSize; ++kk) { +//// EXPECT_EQ(a16[kk], b16[kk]); +//// } +// WebRtcSpl_AutoCorrToReflCoef(b32, kVectorSize, bTmp16); +//// for (int kk = 0; kk < kVectorSize; ++kk) { +//// EXPECT_EQ(aTmp16[kk], bTmp16[kk]); +//// } + WebRtcSpl_GetHanningWindow(bTmp16, kVectorSize); -// for (int kk = 0; kk < kVectorSize; ++kk) { -// EXPECT_EQ(aTmp16[kk], bTmp16[kk]); -// } + for (int kk = 0; kk < kVectorSize; ++kk) { + EXPECT_EQ(kHanning[kk], bTmp16[kk]); + } for (int kk = 0; kk < kVectorSize; ++kk) { b16[kk] = A[kk];