Remove <ostream> dependencies
Some dependencies still exist but are a bit more complex to remove. This CL removes either unused or easily replaced with ToString() instances of ostream usage. In one case, moving the operator<< implementation to the one test file that requires it. Bug: webrtc:8982 Change-Id: Ia5c840b12a42893494af401317a3daf2fe50ba9b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/356240 Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42582}
This commit is contained in:
parent
32c3398e1a
commit
55c3600781
@ -11,9 +11,6 @@
|
|||||||
#ifndef API_RTC_ERROR_H_
|
#ifndef API_RTC_ERROR_H_
|
||||||
#define API_RTC_ERROR_H_
|
#define API_RTC_ERROR_H_
|
||||||
|
|
||||||
#ifdef WEBRTC_UNIT_TEST
|
|
||||||
#include <ostream>
|
|
||||||
#endif // WEBRTC_UNIT_TEST
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -164,20 +161,6 @@ class RTC_EXPORT RTCError {
|
|||||||
RTC_EXPORT absl::string_view ToString(RTCErrorType error);
|
RTC_EXPORT absl::string_view ToString(RTCErrorType error);
|
||||||
RTC_EXPORT absl::string_view ToString(RTCErrorDetailType error);
|
RTC_EXPORT absl::string_view ToString(RTCErrorDetailType error);
|
||||||
|
|
||||||
#ifdef WEBRTC_UNIT_TEST
|
|
||||||
inline std::ostream& operator<<( // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
std::ostream& stream, // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
RTCErrorType error) {
|
|
||||||
return stream << ToString(error);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline std::ostream& operator<<( // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
std::ostream& stream, // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
RTCErrorDetailType error) {
|
|
||||||
return stream << ToString(error);
|
|
||||||
}
|
|
||||||
#endif // WEBRTC_UNIT_TEST
|
|
||||||
|
|
||||||
// Helper macro that can be used by implementations to create an error with a
|
// Helper macro that can be used by implementations to create an error with a
|
||||||
// message and log it. `message` should be a string literal or movable
|
// message and log it. `message` should be a string literal or movable
|
||||||
// std::string.
|
// std::string.
|
||||||
|
|||||||
@ -11,10 +11,6 @@
|
|||||||
#ifndef API_UNITS_DATA_RATE_H_
|
#ifndef API_UNITS_DATA_RATE_H_
|
||||||
#define API_UNITS_DATA_RATE_H_
|
#define API_UNITS_DATA_RATE_H_
|
||||||
|
|
||||||
#ifdef WEBRTC_UNIT_TEST
|
|
||||||
#include <ostream> // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
#endif // WEBRTC_UNIT_TEST
|
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
@ -142,14 +138,6 @@ inline std::string ToLogString(DataRate value) {
|
|||||||
return ToString(value);
|
return ToString(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WEBRTC_UNIT_TEST
|
|
||||||
inline std::ostream& operator<<( // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
std::ostream& stream, // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
DataRate value) {
|
|
||||||
return stream << ToString(value);
|
|
||||||
}
|
|
||||||
#endif // WEBRTC_UNIT_TEST
|
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
#endif // API_UNITS_DATA_RATE_H_
|
#endif // API_UNITS_DATA_RATE_H_
|
||||||
|
|||||||
@ -11,10 +11,6 @@
|
|||||||
#ifndef API_UNITS_DATA_SIZE_H_
|
#ifndef API_UNITS_DATA_SIZE_H_
|
||||||
#define API_UNITS_DATA_SIZE_H_
|
#define API_UNITS_DATA_SIZE_H_
|
||||||
|
|
||||||
#ifdef WEBRTC_UNIT_TEST
|
|
||||||
#include <ostream> // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
#endif // WEBRTC_UNIT_TEST
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
@ -53,14 +49,6 @@ inline std::string ToLogString(DataSize value) {
|
|||||||
return ToString(value);
|
return ToString(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WEBRTC_UNIT_TEST
|
|
||||||
inline std::ostream& operator<<( // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
std::ostream& stream, // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
DataSize value) {
|
|
||||||
return stream << ToString(value);
|
|
||||||
}
|
|
||||||
#endif // WEBRTC_UNIT_TEST
|
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
#endif // API_UNITS_DATA_SIZE_H_
|
#endif // API_UNITS_DATA_SIZE_H_
|
||||||
|
|||||||
@ -10,10 +10,6 @@
|
|||||||
#ifndef API_UNITS_FREQUENCY_H_
|
#ifndef API_UNITS_FREQUENCY_H_
|
||||||
#define API_UNITS_FREQUENCY_H_
|
#define API_UNITS_FREQUENCY_H_
|
||||||
|
|
||||||
#ifdef WEBRTC_UNIT_TEST
|
|
||||||
#include <ostream> // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
#endif // WEBRTC_UNIT_TEST
|
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -89,13 +85,5 @@ inline std::string ToLogString(Frequency value) {
|
|||||||
return ToString(value);
|
return ToString(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WEBRTC_UNIT_TEST
|
|
||||||
inline std::ostream& operator<<( // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
std::ostream& stream, // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
Frequency value) {
|
|
||||||
return stream << ToString(value);
|
|
||||||
}
|
|
||||||
#endif // WEBRTC_UNIT_TEST
|
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
#endif // API_UNITS_FREQUENCY_H_
|
#endif // API_UNITS_FREQUENCY_H_
|
||||||
|
|||||||
@ -11,10 +11,6 @@
|
|||||||
#ifndef API_UNITS_TIME_DELTA_H_
|
#ifndef API_UNITS_TIME_DELTA_H_
|
||||||
#define API_UNITS_TIME_DELTA_H_
|
#define API_UNITS_TIME_DELTA_H_
|
||||||
|
|
||||||
#ifdef WEBRTC_UNIT_TEST
|
|
||||||
#include <ostream> // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
#endif // WEBRTC_UNIT_TEST
|
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
@ -97,14 +93,6 @@ inline std::string ToLogString(TimeDelta value) {
|
|||||||
return ToString(value);
|
return ToString(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WEBRTC_UNIT_TEST
|
|
||||||
inline std::ostream& operator<<( // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
std::ostream& stream, // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
TimeDelta value) {
|
|
||||||
return stream << ToString(value);
|
|
||||||
}
|
|
||||||
#endif // WEBRTC_UNIT_TEST
|
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
#endif // API_UNITS_TIME_DELTA_H_
|
#endif // API_UNITS_TIME_DELTA_H_
|
||||||
|
|||||||
@ -11,10 +11,6 @@
|
|||||||
#ifndef API_UNITS_TIMESTAMP_H_
|
#ifndef API_UNITS_TIMESTAMP_H_
|
||||||
#define API_UNITS_TIMESTAMP_H_
|
#define API_UNITS_TIMESTAMP_H_
|
||||||
|
|
||||||
#ifdef WEBRTC_UNIT_TEST
|
|
||||||
#include <ostream> // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
#endif // WEBRTC_UNIT_TEST
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
@ -126,14 +122,6 @@ inline std::string ToLogString(Timestamp value) {
|
|||||||
return ToString(value);
|
return ToString(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WEBRTC_UNIT_TEST
|
|
||||||
inline std::ostream& operator<<( // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
std::ostream& stream, // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
Timestamp value) {
|
|
||||||
return stream << ToString(value);
|
|
||||||
}
|
|
||||||
#endif // WEBRTC_UNIT_TEST
|
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
#endif // API_UNITS_TIMESTAMP_H_
|
#endif // API_UNITS_TIMESTAMP_H_
|
||||||
|
|||||||
@ -99,7 +99,7 @@ static std::string ToStringIfSet(const char* key,
|
|||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
static std::string VectorToString(const std::vector<T>& vals) {
|
static std::string VectorToString(const std::vector<T>& vals) {
|
||||||
rtc::StringBuilder ost; // no-presubmit-check TODO(webrtc:8982)
|
rtc::StringBuilder ost;
|
||||||
ost << "[";
|
ost << "[";
|
||||||
for (size_t i = 0; i < vals.size(); ++i) {
|
for (size_t i = 0; i < vals.size(); ++i) {
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
|
|||||||
@ -38,30 +38,37 @@ MATCHER(HasConsistentVideoDelayTimings, "") {
|
|||||||
// Delays should be internally consistent.
|
// Delays should be internally consistent.
|
||||||
bool m1 = arg.minimum_delay <= arg.target_delay;
|
bool m1 = arg.minimum_delay <= arg.target_delay;
|
||||||
if (!m1) {
|
if (!m1) {
|
||||||
*result_listener << "\nminimum_delay: " << arg.minimum_delay << ", "
|
*result_listener << "\nminimum_delay: " << ToString(arg.minimum_delay)
|
||||||
<< "target_delay: " << arg.target_delay << "\n";
|
<< ", " << "target_delay: " << ToString(arg.target_delay)
|
||||||
|
<< "\n";
|
||||||
}
|
}
|
||||||
bool m2 = arg.minimum_delay <= arg.current_delay;
|
bool m2 = arg.minimum_delay <= arg.current_delay;
|
||||||
if (!m2) {
|
if (!m2) {
|
||||||
*result_listener << "\nminimum_delay: " << arg.minimum_delay << ", "
|
*result_listener << "\nminimum_delay: " << ToString(arg.minimum_delay)
|
||||||
<< "current_delay: " << arg.current_delay;
|
<< ", "
|
||||||
|
<< "current_delay: " << ToString(arg.current_delay);
|
||||||
}
|
}
|
||||||
bool m3 = arg.target_delay >= arg.min_playout_delay;
|
bool m3 = arg.target_delay >= arg.min_playout_delay;
|
||||||
if (!m3) {
|
if (!m3) {
|
||||||
*result_listener << "\ntarget_delay: " << arg.target_delay << ", "
|
*result_listener << "\ntarget_delay: " << ToString(arg.target_delay) << ", "
|
||||||
<< "min_playout_delay: " << arg.min_playout_delay << "\n";
|
<< "min_playout_delay: " << ToString(arg.min_playout_delay)
|
||||||
|
<< "\n";
|
||||||
}
|
}
|
||||||
// TODO(crbug.com/webrtc/15197): Uncomment when this is guaranteed.
|
// TODO(crbug.com/webrtc/15197): Uncomment when this is guaranteed.
|
||||||
// bool m4 = arg.target_delay <= arg.max_playout_delay;
|
// bool m4 = arg.target_delay <= arg.max_playout_delay;
|
||||||
bool m5 = arg.current_delay >= arg.min_playout_delay;
|
bool m5 = arg.current_delay >= arg.min_playout_delay;
|
||||||
if (!m5) {
|
if (!m5) {
|
||||||
*result_listener << "\ncurrent_delay: " << arg.current_delay << ", "
|
*result_listener << "\ncurrent_delay: " << ToString(arg.current_delay)
|
||||||
<< "min_playout_delay: " << arg.min_playout_delay << "\n";
|
<< ", "
|
||||||
|
<< "min_playout_delay: " << ToString(arg.min_playout_delay)
|
||||||
|
<< "\n";
|
||||||
}
|
}
|
||||||
bool m6 = arg.current_delay <= arg.max_playout_delay;
|
bool m6 = arg.current_delay <= arg.max_playout_delay;
|
||||||
if (!m6) {
|
if (!m6) {
|
||||||
*result_listener << "\ncurrent_delay: " << arg.current_delay << ", "
|
*result_listener << "\ncurrent_delay: " << ToString(arg.current_delay)
|
||||||
<< "max_playout_delay: " << arg.max_playout_delay << "\n";
|
<< ", "
|
||||||
|
<< "max_playout_delay: " << ToString(arg.max_playout_delay)
|
||||||
|
<< "\n";
|
||||||
}
|
}
|
||||||
bool m = m1 && m2 && m3 && m5 && m6;
|
bool m = m1 && m2 && m3 && m5 && m6;
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,6 @@
|
|||||||
#include "p2p/client/basic_port_allocator.h"
|
#include "p2p/client/basic_port_allocator.h"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <ostream> // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
|
|
||||||
#include "absl/algorithm/container.h"
|
#include "absl/algorithm/container.h"
|
||||||
#include "absl/strings/string_view.h"
|
#include "absl/strings/string_view.h"
|
||||||
@ -134,22 +133,6 @@ void CheckStunKeepaliveIntervalOfAllReadyPorts(
|
|||||||
|
|
||||||
namespace cricket {
|
namespace cricket {
|
||||||
|
|
||||||
// Helper for dumping candidates
|
|
||||||
std::ostream& operator<<(std::ostream& os,
|
|
||||||
const std::vector<Candidate>& candidates) {
|
|
||||||
os << '[';
|
|
||||||
bool first = true;
|
|
||||||
for (const Candidate& c : candidates) {
|
|
||||||
if (!first) {
|
|
||||||
os << ", ";
|
|
||||||
}
|
|
||||||
os << c.ToString();
|
|
||||||
first = false;
|
|
||||||
}
|
|
||||||
os << ']';
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
|
|
||||||
class BasicPortAllocatorTestBase : public ::testing::Test,
|
class BasicPortAllocatorTestBase : public ::testing::Test,
|
||||||
public sigslot::has_slots<> {
|
public sigslot::has_slots<> {
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -11,8 +11,6 @@
|
|||||||
#ifndef PC_RTP_MEDIA_UTILS_H_
|
#ifndef PC_RTP_MEDIA_UTILS_H_
|
||||||
#define PC_RTP_MEDIA_UTILS_H_
|
#define PC_RTP_MEDIA_UTILS_H_
|
||||||
|
|
||||||
#include <ostream> // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
|
|
||||||
#include "api/rtp_transceiver_direction.h"
|
#include "api/rtp_transceiver_direction.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
@ -51,14 +49,6 @@ RtpTransceiverDirection RtpTransceiverDirectionIntersection(
|
|||||||
RtpTransceiverDirection lhs,
|
RtpTransceiverDirection lhs,
|
||||||
RtpTransceiverDirection rhs);
|
RtpTransceiverDirection rhs);
|
||||||
|
|
||||||
#ifdef WEBRTC_UNIT_TEST
|
|
||||||
inline std::ostream& operator<<( // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
std::ostream& os, // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
RtpTransceiverDirection direction) {
|
|
||||||
return os << RtpTransceiverDirectionToString(direction);
|
|
||||||
}
|
|
||||||
#endif // WEBRTC_UNIT_TEST
|
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
#endif // PC_RTP_MEDIA_UTILS_H_
|
#endif // PC_RTP_MEDIA_UTILS_H_
|
||||||
|
|||||||
@ -75,7 +75,7 @@ TEST(BitrateTrackerTest, MeasuresConstantRate) {
|
|||||||
DataSize total_size = kPacketSize;
|
DataSize total_size = kPacketSize;
|
||||||
DataRate last_error = DataRate::PlusInfinity();
|
DataRate last_error = DataRate::PlusInfinity();
|
||||||
for (TimeDelta i = TimeDelta::Zero(); i < kWindow; i += kInterval) {
|
for (TimeDelta i = TimeDelta::Zero(); i < kWindow; i += kInterval) {
|
||||||
SCOPED_TRACE(i);
|
SCOPED_TRACE(ToString(i));
|
||||||
now += kInterval;
|
now += kInterval;
|
||||||
total_size += kPacketSize;
|
total_size += kPacketSize;
|
||||||
stats.Update(kPacketSize, now);
|
stats.Update(kPacketSize, now);
|
||||||
@ -95,7 +95,7 @@ TEST(BitrateTrackerTest, MeasuresConstantRate) {
|
|||||||
// Once window is full, bitrate measurment should be stable.
|
// Once window is full, bitrate measurment should be stable.
|
||||||
for (TimeDelta i = TimeDelta::Zero(); i < kInterval;
|
for (TimeDelta i = TimeDelta::Zero(); i < kInterval;
|
||||||
i += TimeDelta::Millis(1)) {
|
i += TimeDelta::Millis(1)) {
|
||||||
SCOPED_TRACE(i);
|
SCOPED_TRACE(ToString(i));
|
||||||
EXPECT_EQ(stats.Rate(now + i), kConstantRate);
|
EXPECT_EQ(stats.Rate(now + i), kConstantRate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -111,7 +111,7 @@ TEST(BitrateTrackerTest, IncreasingThenDecreasingBitrate) {
|
|||||||
|
|
||||||
stats.Update(kLargePacketSize, now);
|
stats.Update(kLargePacketSize, now);
|
||||||
for (TimeDelta i = TimeDelta::Zero(); i < kWindow; i += kLargeInterval) {
|
for (TimeDelta i = TimeDelta::Zero(); i < kWindow; i += kLargeInterval) {
|
||||||
SCOPED_TRACE(i);
|
SCOPED_TRACE(ToString(i));
|
||||||
now += kLargeInterval;
|
now += kLargeInterval;
|
||||||
stats.Update(kLargePacketSize, now);
|
stats.Update(kLargePacketSize, now);
|
||||||
}
|
}
|
||||||
@ -120,7 +120,7 @@ TEST(BitrateTrackerTest, IncreasingThenDecreasingBitrate) {
|
|||||||
|
|
||||||
// Decrease bitrate with smaller measurments.
|
// Decrease bitrate with smaller measurments.
|
||||||
for (TimeDelta i = TimeDelta::Zero(); i < kWindow; i += kLargeInterval) {
|
for (TimeDelta i = TimeDelta::Zero(); i < kWindow; i += kLargeInterval) {
|
||||||
SCOPED_TRACE(i);
|
SCOPED_TRACE(ToString(i));
|
||||||
now += kLargeInterval;
|
now += kLargeInterval;
|
||||||
stats.Update(kSmallPacketSize, now);
|
stats.Update(kSmallPacketSize, now);
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ TEST(BitrateTrackerTest, IncreasingThenDecreasingBitrate) {
|
|||||||
|
|
||||||
// Increase bitrate with more frequent measurments.
|
// Increase bitrate with more frequent measurments.
|
||||||
for (TimeDelta i = TimeDelta::Zero(); i < kWindow; i += kSmallInterval) {
|
for (TimeDelta i = TimeDelta::Zero(); i < kWindow; i += kSmallInterval) {
|
||||||
SCOPED_TRACE(i);
|
SCOPED_TRACE(ToString(i));
|
||||||
now += kSmallInterval;
|
now += kSmallInterval;
|
||||||
stats.Update(kSmallPacketSize, now);
|
stats.Update(kSmallPacketSize, now);
|
||||||
|
|
||||||
@ -230,7 +230,7 @@ TEST(BitrateTrackerTest, HandlesZeroCounts) {
|
|||||||
EXPECT_GT(last_bitrate, DataRate::Zero());
|
EXPECT_GT(last_bitrate, DataRate::Zero());
|
||||||
now += kInterval;
|
now += kInterval;
|
||||||
while (now < start + kWindow) {
|
while (now < start + kWindow) {
|
||||||
SCOPED_TRACE(now - start);
|
SCOPED_TRACE(ToString(now - start));
|
||||||
stats.Update(0, now);
|
stats.Update(0, now);
|
||||||
|
|
||||||
absl::optional<DataRate> bitrate = stats.Rate(now);
|
absl::optional<DataRate> bitrate = stats.Rate(now);
|
||||||
|
|||||||
@ -70,7 +70,7 @@ TEST(FrequencyTrackerTest, MeasuresConstantRate) {
|
|||||||
stats.Update(now);
|
stats.Update(now);
|
||||||
Frequency last_error = Frequency::PlusInfinity();
|
Frequency last_error = Frequency::PlusInfinity();
|
||||||
for (TimeDelta i = TimeDelta::Zero(); i < kWindow; i += kInterval) {
|
for (TimeDelta i = TimeDelta::Zero(); i < kWindow; i += kInterval) {
|
||||||
SCOPED_TRACE(i);
|
SCOPED_TRACE(ToString(i));
|
||||||
now += kInterval;
|
now += kInterval;
|
||||||
stats.Update(now);
|
stats.Update(now);
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ TEST(FrequencyTrackerTest, MeasuresConstantRate) {
|
|||||||
// Once window is full, rate measurment should be stable.
|
// Once window is full, rate measurment should be stable.
|
||||||
for (TimeDelta i = TimeDelta::Zero(); i < kInterval;
|
for (TimeDelta i = TimeDelta::Zero(); i < kInterval;
|
||||||
i += TimeDelta::Millis(1)) {
|
i += TimeDelta::Millis(1)) {
|
||||||
SCOPED_TRACE(i);
|
SCOPED_TRACE(ToString(i));
|
||||||
EXPECT_EQ(stats.Rate(now + i), kConstantRate);
|
EXPECT_EQ(stats.Rate(now + i), kConstantRate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,7 +123,7 @@ TEST(FrequencyTrackerTest, IncreasingThenDecreasingRate) {
|
|||||||
|
|
||||||
stats.Update(kLargeSize, now);
|
stats.Update(kLargeSize, now);
|
||||||
for (TimeDelta i = TimeDelta::Zero(); i < kWindow; i += kLargeInterval) {
|
for (TimeDelta i = TimeDelta::Zero(); i < kWindow; i += kLargeInterval) {
|
||||||
SCOPED_TRACE(i);
|
SCOPED_TRACE(ToString(i));
|
||||||
now += kLargeInterval;
|
now += kLargeInterval;
|
||||||
stats.Update(kLargeSize, now);
|
stats.Update(kLargeSize, now);
|
||||||
}
|
}
|
||||||
@ -132,7 +132,7 @@ TEST(FrequencyTrackerTest, IncreasingThenDecreasingRate) {
|
|||||||
|
|
||||||
// Decrease rate with smaller measurments.
|
// Decrease rate with smaller measurments.
|
||||||
for (TimeDelta i = TimeDelta::Zero(); i < kWindow; i += kLargeInterval) {
|
for (TimeDelta i = TimeDelta::Zero(); i < kWindow; i += kLargeInterval) {
|
||||||
SCOPED_TRACE(i);
|
SCOPED_TRACE(ToString(i));
|
||||||
now += kLargeInterval;
|
now += kLargeInterval;
|
||||||
stats.Update(kSmallSize, now);
|
stats.Update(kSmallSize, now);
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ TEST(FrequencyTrackerTest, IncreasingThenDecreasingRate) {
|
|||||||
|
|
||||||
// Increase rate with more frequent measurments.
|
// Increase rate with more frequent measurments.
|
||||||
for (TimeDelta i = TimeDelta::Zero(); i < kWindow; i += kSmallInterval) {
|
for (TimeDelta i = TimeDelta::Zero(); i < kWindow; i += kSmallInterval) {
|
||||||
SCOPED_TRACE(i);
|
SCOPED_TRACE(ToString(i));
|
||||||
now += kSmallInterval;
|
now += kSmallInterval;
|
||||||
stats.Update(kSmallSize, now);
|
stats.Update(kSmallSize, now);
|
||||||
|
|
||||||
|
|||||||
@ -82,13 +82,6 @@ class RTC_EXPORT IPAddress {
|
|||||||
bool operator<(const IPAddress& other) const;
|
bool operator<(const IPAddress& other) const;
|
||||||
bool operator>(const IPAddress& other) const;
|
bool operator>(const IPAddress& other) const;
|
||||||
|
|
||||||
#ifdef WEBRTC_UNIT_TEST
|
|
||||||
inline std::ostream& operator<<( // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
std::ostream& os) { // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
return os << ToString();
|
|
||||||
}
|
|
||||||
#endif // WEBRTC_UNIT_TEST
|
|
||||||
|
|
||||||
int family() const { return family_; }
|
int family() const { return family_; }
|
||||||
in_addr ipv4_address() const;
|
in_addr ipv4_address() const;
|
||||||
in6_addr ipv6_address() const;
|
in6_addr ipv6_address() const;
|
||||||
|
|||||||
@ -15,18 +15,6 @@
|
|||||||
#include "api/video/video_frame_type.h"
|
#include "api/video/video_frame_type.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
void PrintTo(const EncodedFrame& frame,
|
|
||||||
std::ostream* os) /* no-presubmit-check TODO(webrtc:8982) */ {
|
|
||||||
*os << "EncodedFrame with id=" << frame.Id()
|
|
||||||
<< " rtp=" << frame.RtpTimestamp() << " size=" << frame.size()
|
|
||||||
<< " refs=[";
|
|
||||||
for (size_t ref = 0; ref < frame.num_references; ++ref) {
|
|
||||||
*os << frame.references[ref] << ",";
|
|
||||||
}
|
|
||||||
*os << "]";
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
int64_t FakeEncodedFrame::ReceivedTime() const {
|
int64_t FakeEncodedFrame::ReceivedTime() const {
|
||||||
|
|||||||
@ -12,7 +12,6 @@
|
|||||||
#define TEST_FAKE_ENCODED_FRAME_H_
|
#define TEST_FAKE_ENCODED_FRAME_H_
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <ostream> // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "api/rtp_packet_infos.h"
|
#include "api/rtp_packet_infos.h"
|
||||||
@ -21,11 +20,6 @@
|
|||||||
#include "test/gmock.h"
|
#include "test/gmock.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
// For test printing.
|
|
||||||
void PrintTo(const EncodedFrame& frame,
|
|
||||||
std::ostream* os); // no-presubmit-check TODO(webrtc:8982)
|
|
||||||
|
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
class FakeEncodedFrame : public EncodedFrame {
|
class FakeEncodedFrame : public EncodedFrame {
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <ostream>
|
#include <ostream> // no-presubmit-check bugs.webrtc.org/8982
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
@ -68,6 +68,10 @@ void PrintTo(const RecordableEncodedFrame::EncodedResolution& value,
|
|||||||
*os << value.width << "x" << value.height;
|
*os << value.width << "x" << value.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline std::ostream& operator<<(std::ostream& stream, Timestamp value) {
|
||||||
|
return stream << ToString(value);
|
||||||
|
}
|
||||||
|
|
||||||
void PrintTo(const RecordableEncodedFrame& value, std::ostream* os) {
|
void PrintTo(const RecordableEncodedFrame& value, std::ostream* os) {
|
||||||
*os << "RecordableEncodedFrame(render_time=" << value.render_time()
|
*os << "RecordableEncodedFrame(render_time=" << value.render_time()
|
||||||
<< " resolution=" << ::testing::PrintToString(value.resolution()) << ")";
|
<< " resolution=" << ::testing::PrintToString(value.resolution()) << ")";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user