Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Unified Diff: webrtc/common_audio/fir_filter_unittest.cc

Issue 1712513002: Replace scoped_ptr with unique_ptr in webrtc/common_audio/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/common_audio/fir_filter_sse.cc ('k') | webrtc/common_audio/include/audio_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « webrtc/common_audio/fir_filter_sse.cc ('k') | webrtc/common_audio/include/audio_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698