Adds debug printing of units in unit tests.

Bug: webrtc:9656
Change-Id: I643b79bc214643f47b2b64967ce713665dbef5c9
Reviewed-on: https://webrtc-review.googlesource.com/95652
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24436}
This commit is contained in:
Sebastian Jansson
2018-08-23 14:44:05 +02:00
committed by Commit Bot
parent 1946a3f0fe
commit 2afd281ec4
8 changed files with 70 additions and 3 deletions

View File

@ -11,6 +11,10 @@
#ifndef API_UNITS_TIMESTAMP_H_
#define API_UNITS_TIMESTAMP_H_
#ifdef UNIT_TEST
#include <ostream> // no-presubmit-check TODO(webrtc:8982)
#endif // UNIT_TEST
#include <stdint.h>
#include <limits>
#include <string>
@ -203,6 +207,14 @@ class Timestamp {
std::string ToString(const Timestamp& value);
#ifdef 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 // UNIT_TEST
} // namespace webrtc
#endif // API_UNITS_TIMESTAMP_H_