Revert "Remove our stream << overloads from non-test build targets."

This reverts commit c841d18d257ba8e4ed7d77d105e3c46006bb1e7e.

Reason for revert: Breaks internal tests

Original change's description:
> Remove our stream << overloads from non-test build targets.
> 
> Most are removed entirely, but RtcErrorType, RtpTransceiverDirection, IPAddress and
> SocketAddress are kept behind gtest's #ifdef UNIT_TEST.
> 
> Bug: webrtc:8982
> Change-Id: I36db19891e7d25aeacb08b9a08aa2b4004765e70
> Reviewed-on: https://webrtc-review.googlesource.com/64143
> Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
> Reviewed-by: Benjamin Wright <benwright@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Åsa Persson <asapersson@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22916}

TBR=deadbeef@webrtc.org,kwiberg@webrtc.org,asapersson@webrtc.org,jonasolsson@webrtc.org,benwright@webrtc.org

Change-Id: Ia3a36cdbdb2a9648a2bce23c314e539124dc9e0d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8982
Reviewed-on: https://webrtc-review.googlesource.com/70640
Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22920}
This commit is contained in:
Jonas Olsson
2018-04-18 10:51:12 +00:00
committed by Commit Bot
parent 4736d4e524
commit 31ef5f0d1b
14 changed files with 107 additions and 34 deletions

View File

@ -11,9 +11,7 @@
#ifndef API_RTCERROR_H_
#define API_RTCERROR_H_
#ifdef UNIT_TEST
#include <ostream>
#endif // UNIT_TEST
#include <string>
#include <utility> // For std::move.
@ -145,15 +143,9 @@ class RTCError {
// error type.
//
// Only intended to be used for logging/disagnostics.
std::string ToString(RTCErrorType error);
std::ostream& operator<<(std::ostream& stream, RTCErrorType error);
#ifdef 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);
}
#endif // UNIT_TEST
std::string ToString(RTCErrorType error);
// 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