Index: webrtc/common_audio/fir_filter_unittest.cc |
diff --git a/webrtc/common_audio/fir_filter_unittest.cc b/webrtc/common_audio/fir_filter_unittest.cc |
index 13f79d9482e6ba2d0014024de166a2611217f8e3..9dffcb615ff85e8710939f714007f95e63bb9675 100644 |
--- a/webrtc/common_audio/fir_filter_unittest.cc |
+++ b/webrtc/common_audio/fir_filter_unittest.cc |
@@ -12,8 +12,9 @@ |
#include <string.h> |
+#include <memory> |
+ |
#include "testing/gtest/include/gtest/gtest.h" |
-#include "webrtc/base/scoped_ptr.h" |
namespace webrtc { |
namespace { |
@@ -40,7 +41,7 @@ void VerifyOutput(const float* expected_output, |
TEST(FIRFilterTest, FilterAsIdentity) { |
const float kCoefficients[] = {1.f, 0.f, 0.f, 0.f, 0.f}; |
float output[kInputLength]; |
- rtc::scoped_ptr<FIRFilter> filter( |
+ std::unique_ptr<FIRFilter> filter( |
FIRFilter::Create(kCoefficients, kCoefficientsLength, kInputLength)); |
filter->Filter(kInput, kInputLength, output); |
@@ -50,7 +51,7 @@ TEST(FIRFilterTest, FilterAsIdentity) { |
TEST(FIRFilterTest, FilterUsedAsScalarMultiplication) { |
const float kCoefficients[] = {5.f, 0.f, 0.f, 0.f, 0.f}; |
float output[kInputLength]; |
- rtc::scoped_ptr<FIRFilter> filter( |
+ std::unique_ptr<FIRFilter> filter( |
FIRFilter::Create(kCoefficients, kCoefficientsLength, kInputLength)); |
filter->Filter(kInput, kInputLength, output); |
@@ -63,7 +64,7 @@ TEST(FIRFilterTest, FilterUsedAsScalarMultiplication) { |
TEST(FIRFilterTest, FilterUsedAsInputShifting) { |
const float kCoefficients[] = {0.f, 0.f, 0.f, 0.f, 1.f}; |
float output[kInputLength]; |
- rtc::scoped_ptr<FIRFilter> filter( |
+ std::unique_ptr<FIRFilter> filter( |
FIRFilter::Create(kCoefficients, kCoefficientsLength, kInputLength)); |
filter->Filter(kInput, kInputLength, output); |
@@ -76,7 +77,7 @@ TEST(FIRFilterTest, FilterUsedAsInputShifting) { |
TEST(FIRFilterTest, FilterUsedAsArbitraryWeighting) { |
float output[kInputLength]; |
- rtc::scoped_ptr<FIRFilter> filter( |
+ std::unique_ptr<FIRFilter> filter( |
FIRFilter::Create(kCoefficients, kCoefficientsLength, kInputLength)); |
filter->Filter(kInput, kInputLength, output); |
@@ -89,7 +90,7 @@ TEST(FIRFilterTest, FilterUsedAsArbitraryWeighting) { |
TEST(FIRFilterTest, FilterInLengthLesserOrEqualToCoefficientsLength) { |
float output[kInputLength]; |
- rtc::scoped_ptr<FIRFilter> filter( |
+ std::unique_ptr<FIRFilter> filter( |
FIRFilter::Create(kCoefficients, kCoefficientsLength, 2)); |
filter->Filter(kInput, 2, output); |
@@ -106,7 +107,7 @@ TEST(FIRFilterTest, FilterInLengthLesserOrEqualToCoefficientsLength) { |
TEST(FIRFilterTest, MultipleFilterCalls) { |
float output[kInputLength]; |
- rtc::scoped_ptr<FIRFilter> filter( |
+ std::unique_ptr<FIRFilter> filter( |
FIRFilter::Create(kCoefficients, kCoefficientsLength, 3)); |
filter->Filter(kInput, 2, output); |
EXPECT_FLOAT_EQ(0.2f, output[0]); |
@@ -137,7 +138,7 @@ TEST(FIRFilterTest, MultipleFilterCalls) { |
TEST(FIRFilterTest, VerifySampleBasedVsBlockBasedFiltering) { |
float output_block_based[kInputLength]; |
- rtc::scoped_ptr<FIRFilter> filter( |
+ std::unique_ptr<FIRFilter> filter( |
FIRFilter::Create(kCoefficients, kCoefficientsLength, kInputLength)); |
filter->Filter(kInput, kInputLength, output_block_based); |
@@ -162,7 +163,7 @@ TEST(FIRFilterTest, SimplestHighPassFilter) { |
sizeof(kConstantInput[0]); |
float output[kConstantInputLength]; |
- rtc::scoped_ptr<FIRFilter> filter(FIRFilter::Create( |
+ std::unique_ptr<FIRFilter> filter(FIRFilter::Create( |
kCoefficients, kCoefficientsLength, kConstantInputLength)); |
filter->Filter(kConstantInput, kConstantInputLength, output); |
EXPECT_FLOAT_EQ(1.f, output[0]); |
@@ -181,7 +182,7 @@ TEST(FIRFilterTest, SimplestLowPassFilter) { |
sizeof(kHighFrequencyInput[0]); |
float output[kHighFrequencyInputLength]; |
- rtc::scoped_ptr<FIRFilter> filter(FIRFilter::Create( |
+ std::unique_ptr<FIRFilter> filter(FIRFilter::Create( |
kCoefficients, kCoefficientsLength, kHighFrequencyInputLength)); |
filter->Filter(kHighFrequencyInput, kHighFrequencyInputLength, output); |
EXPECT_FLOAT_EQ(-1.f, output[0]); |
@@ -193,7 +194,7 @@ TEST(FIRFilterTest, SimplestLowPassFilter) { |
TEST(FIRFilterTest, SameOutputWhenSwapedCoefficientsAndInput) { |
float output[kCoefficientsLength]; |
float output_swaped[kCoefficientsLength]; |
- rtc::scoped_ptr<FIRFilter> filter(FIRFilter::Create( |
+ std::unique_ptr<FIRFilter> filter(FIRFilter::Create( |
kCoefficients, kCoefficientsLength, kCoefficientsLength)); |
// Use kCoefficientsLength for in_length to get same-length outputs. |
filter->Filter(kInput, kCoefficientsLength, output); |