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}
This commit is contained in:
@ -33,6 +33,7 @@
|
||||
#include "rtc_base/numerics/safe_conversions.h"
|
||||
#include "rtc_base/protobuf_utils.h"
|
||||
#include "rtc_base/stringencode.h"
|
||||
#include "rtc_base/strings/string_builder.h"
|
||||
#include "rtc_base/system/arch.h"
|
||||
#include "test/field_trial.h"
|
||||
#include "test/gtest.h"
|
||||
@ -386,7 +387,7 @@ void NetEqDecodingTest::DecodeAndCompare(
|
||||
uint64_t last_concealed_samples = 0;
|
||||
uint64_t last_total_samples_received = 0;
|
||||
while (packet_) {
|
||||
std::ostringstream ss;
|
||||
rtc::StringBuilder ss;
|
||||
ss << "Lap number " << i++ << " in DecodeAndCompare while loop";
|
||||
SCOPED_TRACE(ss.str()); // Print out the parameter values on failure.
|
||||
ASSERT_NO_FATAL_FAILURE(Process());
|
||||
@ -900,7 +901,7 @@ TEST_F(NetEqDecodingTest, MAYBE_DecoderError) {
|
||||
static const int kExpectedOutputLength = 160; // 10 ms at 16 kHz sample rate.
|
||||
const int16_t* const_out_frame_data = out_frame_.data();
|
||||
for (int i = 0; i < kExpectedOutputLength; ++i) {
|
||||
std::ostringstream ss;
|
||||
rtc::StringBuilder ss;
|
||||
ss << "i = " << i;
|
||||
SCOPED_TRACE(ss.str()); // Print out the parameter values on failure.
|
||||
EXPECT_EQ(0, const_out_frame_data[i]);
|
||||
@ -922,7 +923,7 @@ TEST_F(NetEqDecodingTest, GetAudioBeforeInsertPacket) {
|
||||
kInitSampleRateHz / 100; // 10 ms at initial sample rate.
|
||||
const int16_t* const_out_frame_data = out_frame_.data();
|
||||
for (int i = 0; i < kExpectedOutputLength; ++i) {
|
||||
std::ostringstream ss;
|
||||
rtc::StringBuilder ss;
|
||||
ss << "i = " << i;
|
||||
SCOPED_TRACE(ss.str()); // Print out the parameter values on failure.
|
||||
EXPECT_EQ(0, const_out_frame_data[i]);
|
||||
@ -1532,7 +1533,7 @@ TEST_F(NetEqDecodingTestTwoInstances, CompareMutedStateOnOff) {
|
||||
AudioFrame out_frame1, out_frame2;
|
||||
bool muted;
|
||||
for (int i = 0; i < 1000; ++i) {
|
||||
std::ostringstream ss;
|
||||
rtc::StringBuilder ss;
|
||||
ss << "i = " << i;
|
||||
SCOPED_TRACE(ss.str()); // Print out the loop iterator on failure.
|
||||
EXPECT_EQ(0, neteq_->GetAudio(&out_frame1, &muted));
|
||||
@ -1555,7 +1556,7 @@ TEST_F(NetEqDecodingTestTwoInstances, CompareMutedStateOnOff) {
|
||||
int counter = 0;
|
||||
while (out_frame1.speech_type_ != AudioFrame::kNormalSpeech) {
|
||||
ASSERT_LT(counter++, 1000) << "Test timed out";
|
||||
std::ostringstream ss;
|
||||
rtc::StringBuilder ss;
|
||||
ss << "counter = " << counter;
|
||||
SCOPED_TRACE(ss.str()); // Print out the loop iterator on failure.
|
||||
EXPECT_EQ(0, neteq_->GetAudio(&out_frame1, &muted));
|
||||
|
||||
Reference in New Issue
Block a user