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

Unified Diff: media/base/sinc_resampler_unittest.cc

Issue 1906423005: Replace scoped_ptr with std::unique_ptr in //media/base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-media-base: . Created 4 years, 8 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
Index: media/base/sinc_resampler_unittest.cc
diff --git a/media/base/sinc_resampler_unittest.cc b/media/base/sinc_resampler_unittest.cc
index 37e2649f6edabf50273bb56a827b5436f9cacba3..8dd346ee467cbed086acf78272d1c846fcd8c533 100644
--- a/media/base/sinc_resampler_unittest.cc
+++ b/media/base/sinc_resampler_unittest.cc
@@ -6,6 +6,7 @@
#define _USE_MATH_DEFINES
#include <cmath>
+#include <memory>
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -53,7 +54,7 @@ TEST(SincResamplerTest, ChunkedResample) {
static const int kChunks = 2;
int max_chunk_size = resampler.ChunkSize() * kChunks;
- scoped_ptr<float[]> resampled_destination(new float[max_chunk_size]);
+ std::unique_ptr<float[]> resampled_destination(new float[max_chunk_size]);
// Verify requesting ChunkSize() frames causes a single callback.
EXPECT_CALL(mock_source, ProvideInput(_, _))
@@ -96,7 +97,7 @@ TEST(SincResamplerTest, PrimedResample) {
const int kChunks = 2;
const int kMaxFrames = max_chunk_size * kChunks;
- scoped_ptr<float[]> resampled_destination(new float[kMaxFrames]);
+ std::unique_ptr<float[]> resampled_destination(new float[kMaxFrames]);
// Verify requesting ChunkSize() frames causes a single callback.
EXPECT_CALL(mock_source, ProvideInput(_, _))
@@ -118,7 +119,8 @@ TEST(SincResamplerTest, Flush) {
SincResampler resampler(
kSampleRateRatio, SincResampler::kDefaultRequestSize,
base::Bind(&MockSource::ProvideInput, base::Unretained(&mock_source)));
- scoped_ptr<float[]> resampled_destination(new float[resampler.ChunkSize()]);
+ std::unique_ptr<float[]> resampled_destination(
+ new float[resampler.ChunkSize()]);
// Fill the resampler with junk data.
EXPECT_CALL(mock_source, ProvideInput(_, _))
@@ -290,7 +292,7 @@ TEST_P(SincResamplerTest, Resample) {
// Force an update to the sample rate ratio to ensure dyanmic sample rate
// changes are working correctly.
- scoped_ptr<float[]> kernel(new float[SincResampler::kKernelStorageSize]);
+ std::unique_ptr<float[]> kernel(new float[SincResampler::kKernelStorageSize]);
memcpy(kernel.get(), resampler.get_kernel_for_testing(),
SincResampler::kKernelStorageSize);
resampler.SetRatio(M_PI);
@@ -302,8 +304,8 @@ TEST_P(SincResamplerTest, Resample) {
// TODO(dalecurtis): If we switch to AVX/SSE optimization, we'll need to
// allocate these on 32-byte boundaries and ensure they're sized % 32 bytes.
- scoped_ptr<float[]> resampled_destination(new float[output_samples]);
- scoped_ptr<float[]> pure_destination(new float[output_samples]);
+ std::unique_ptr<float[]> resampled_destination(new float[output_samples]);
+ std::unique_ptr<float[]> pure_destination(new float[output_samples]);
// Generate resampled signal.
resampler.Resample(output_samples, resampled_destination.get());

Powered by Google App Engine
This is Rietveld 408576698