diff options
author | Jonas Olsson <jonasolsson@webrtc.org> | 2018-09-06 13:41:30 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2018-09-06 12:53:19 +0000 |
commit | 366a50c4ef1111a32753302b47a5504fbc3212f5 (patch) | |
tree | e28f5339b211b39bb01fb73667d27e908f5709f4 /common_audio | |
parent | 96ede16a4e38efba5792cb69d1ad020b586da237 (diff) | |
download | webrtc-366a50c4ef1111a32753302b47a5504fbc3212f5.tar.gz |
Remove simple stringstream usages.
This CL replaces std::o?stringstream with rtc::StringBuilder where that's possible to do without changing any of the surrounding code. It also updates includes and build files as appropriate.
The CL was generated by running 'git grep -l -P std::o?stringstream | xargs perl -pi -e "s/std::o?stringstream/rtc::StringBuilder/g"'. Then I've manually updated the #includes and BUILD files, run 'git cl format' and unstaged any file that would need more complex fixes.
Bug: webrtc:8982
Change-Id: Ibc32153f4a3fd177e260b6ad05ce393972549357
Reviewed-on: https://webrtc-review.googlesource.com/98460
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24605}
Diffstat (limited to 'common_audio')
-rw-r--r-- | common_audio/resampler/resampler_unittest.cc | 9 | ||||
-rw-r--r-- | common_audio/signal_processing/signal_processing_unittest.cc | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/common_audio/resampler/resampler_unittest.cc b/common_audio/resampler/resampler_unittest.cc index fd636e2998..61be040468 100644 --- a/common_audio/resampler/resampler_unittest.cc +++ b/common_audio/resampler/resampler_unittest.cc @@ -11,6 +11,7 @@ #include <array> #include "common_audio/resampler/include/resampler.h" +#include "rtc_base/strings/string_builder.h" #include "test/gtest.h" // TODO(andrew): this is a work-in-progress. Many more tests are needed. @@ -64,7 +65,7 @@ void ResamplerTest::TearDown() {} void ResamplerTest::ResetIfNeededAndPush(int in_rate, int out_rate, int num_channels) { - std::ostringstream ss; + rtc::StringBuilder ss; ss << "Input rate: " << in_rate << ", output rate: " << out_rate << ", channel count: " << num_channels; SCOPED_TRACE(ss.str()); @@ -90,7 +91,7 @@ TEST_F(ResamplerTest, Reset) { for (size_t i = 0; i < kRatesSize; ++i) { for (size_t j = 0; j < kRatesSize; ++j) { for (size_t k = 0; k < kNumChannelsSize; ++k) { - std::ostringstream ss; + rtc::StringBuilder ss; ss << "Input rate: " << kRates[i] << ", output rate: " << kRates[j] << ", channels: " << kNumChannels[k]; SCOPED_TRACE(ss.str()); @@ -109,7 +110,7 @@ TEST_F(ResamplerTest, Mono) { const int kChannels = 1; for (size_t i = 0; i < kRatesSize; ++i) { for (size_t j = 0; j < kRatesSize; ++j) { - std::ostringstream ss; + rtc::StringBuilder ss; ss << "Input rate: " << kRates[i] << ", output rate: " << kRates[j]; SCOPED_TRACE(ss.str()); @@ -131,7 +132,7 @@ TEST_F(ResamplerTest, Stereo) { const int kChannels = 2; for (size_t i = 0; i < kRatesSize; ++i) { for (size_t j = 0; j < kRatesSize; ++j) { - std::ostringstream ss; + rtc::StringBuilder ss; ss << "Input rate: " << kRates[i] << ", output rate: " << kRates[j]; SCOPED_TRACE(ss.str()); diff --git a/common_audio/signal_processing/signal_processing_unittest.cc b/common_audio/signal_processing/signal_processing_unittest.cc index 8e65ebd2bc..aeaf97bdeb 100644 --- a/common_audio/signal_processing/signal_processing_unittest.cc +++ b/common_audio/signal_processing/signal_processing_unittest.cc @@ -9,9 +9,9 @@ */ #include <algorithm> -#include <sstream> #include "common_audio/signal_processing/include/signal_processing_library.h" +#include "rtc_base/strings/string_builder.h" #include "test/gtest.h" static const size_t kVector16Size = 9; @@ -134,7 +134,7 @@ TEST_F(SplTest, AddSubSatW32) { INT32_MIN, std::min<int64_t>(INT32_MAX, static_cast<int64_t>(a) + b)); const int64_t diff = std::max<int64_t>( INT32_MIN, std::min<int64_t>(INT32_MAX, static_cast<int64_t>(a) - b)); - std::ostringstream ss; + rtc::StringBuilder ss; ss << a << " +/- " << b << ": sum " << sum << ", diff " << diff; SCOPED_TRACE(ss.str()); EXPECT_EQ(sum, WebRtcSpl_AddSatW32(a, b)); |