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

Unified Diff: webrtc/common_audio/resampler/sinc_resampler_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/resampler/sinc_resampler.h ('k') | webrtc/common_audio/ring_buffer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_audio/resampler/sinc_resampler_unittest.cc
diff --git a/webrtc/common_audio/resampler/sinc_resampler_unittest.cc b/webrtc/common_audio/resampler/sinc_resampler_unittest.cc
index b8d6c341a2cd421dab665e9e2f5add50a5152c5d..42172ebdda7fae7da51d37e50ff9a9e169d5a7da 100644
--- a/webrtc/common_audio/resampler/sinc_resampler_unittest.cc
+++ b/webrtc/common_audio/resampler/sinc_resampler_unittest.cc
@@ -16,9 +16,10 @@
#include <math.h>
+#include <memory>
+
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/common_audio/resampler/sinc_resampler.h"
#include "webrtc/common_audio/resampler/sinusoidal_linear_chirp_source.h"
#include "webrtc/system_wrappers/include/cpu_features_wrapper.h"
@@ -62,7 +63,7 @@ TEST(SincResamplerTest, ChunkedResample) {
static const int kChunks = 2;
size_t max_chunk_size = resampler.ChunkSize() * kChunks;
- rtc::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, Run(_, _))
@@ -81,7 +82,7 @@ TEST(SincResamplerTest, Flush) {
MockSource mock_source;
SincResampler resampler(kSampleRateRatio, SincResampler::kDefaultRequestSize,
&mock_source);
- rtc::scoped_ptr<float[]> resampled_destination(
+ std::unique_ptr<float[]> resampled_destination(
new float[resampler.ChunkSize()]);
// Fill the resampler with junk data.
@@ -269,7 +270,7 @@ TEST_P(SincResamplerTest, Resample) {
// Force an update to the sample rate ratio to ensure dyanmic sample rate
// changes are working correctly.
- rtc::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);
@@ -281,8 +282,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.
- rtc::scoped_ptr<float[]> resampled_destination(new float[output_samples]);
- rtc::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());
« no previous file with comments | « webrtc/common_audio/resampler/sinc_resampler.h ('k') | webrtc/common_audio/ring_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698