Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
testing::Message Class Reference

#include <gtest-message.h>

Public Member Functions

 Message ()
 
 Message (const Message &msg)
 
 Message (const char *str)
 
template<typename T >
Messageoperator<< (const T &val)
 
template<typename T >
Messageoperator<< (T *const &pointer)
 
Messageoperator<< (BasicNarrowIoManip val)
 
Messageoperator<< (bool b)
 
Messageoperator<< (const wchar_t *wide_c_str)
 
Messageoperator<< (wchar_t *wide_c_str)
 
std::string GetString () const
 

Detailed Description

Definition at line 85 of file gtest-message.h.

Constructor & Destructor Documentation

◆ Message() [1/3]

testing::Message::Message ( )

Definition at line 960 of file gtest.cc.

960 : ss_(new ::std::stringstream) {
961 // By default, we want there to be enough precision when printing
962 // a double to a Message.
963 *ss_ << std::setprecision(std::numeric_limits<double>::digits10 + 2);
964}

◆ Message() [2/3]

testing::Message::Message ( const Message & msg)
inline

Definition at line 96 of file gtest-message.h.

96 : ss_(new ::std::stringstream) { // NOLINT
97 *ss_ << msg.GetString();
98 }
Here is the call graph for this function:

◆ Message() [3/3]

testing::Message::Message ( const char * str)
inlineexplicit

Definition at line 101 of file gtest-message.h.

101 : ss_(new ::std::stringstream) {
102 *ss_ << str;
103 }
return str
Definition CLI11.hpp:1359

Member Function Documentation

◆ GetString()

std::string testing::Message::GetString ( ) const

Definition at line 995 of file gtest.cc.

995 {
997}
GTEST_API_ std::string StringStreamToString(::std::stringstream *stream)
Definition gtest.cc:1997
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator<<() [1/6]

Message & testing::Message::operator<< ( BasicNarrowIoManip val)
inline

Definition at line 165 of file gtest-message.h.

165 {
166 *ss_ << val;
167 return *this;
168 }

◆ operator<<() [2/6]

Message & testing::Message::operator<< ( bool b)
inline

Definition at line 171 of file gtest-message.h.

171 {
172 return *this << (b ? "true" : "false");
173 }

◆ operator<<() [3/6]

template<typename T >
Message & testing::Message::operator<< ( const T & val)
inline

Definition at line 115 of file gtest-message.h.

115 {
116 // Some libraries overload << for STL containers. These
117 // overloads are defined in the global namespace instead of ::std.
118 //
119 // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
120 // overloads are visible in either the std namespace or the global
121 // namespace, but not other namespaces, including the testing
122 // namespace which Google Test's Message class is in.
123 //
124 // To allow STL containers (and other types that has a << operator
125 // defined in the global namespace) to be used in Google Test
126 // assertions, testing::Message must access the custom << operator
127 // from the global namespace. With this using declaration,
128 // overloads of << defined in the global namespace and those
129 // visible via Koenig lookup are both exposed in this function.
130 using ::operator <<;
131 *ss_ << val;
132 return *this;
133 }

◆ operator<<() [4/6]

Message & testing::Message::operator<< ( const wchar_t * wide_c_str)

Definition at line 968 of file gtest.cc.

968 {
969 return *this << internal::String::ShowWideCString(wide_c_str);
970}
static std::string ShowWideCString(const wchar_t *wide_c_str)
Definition gtest.cc:1863
Here is the call graph for this function:

◆ operator<<() [5/6]

template<typename T >
Message & testing::Message::operator<< ( T *const & pointer)
inline

Definition at line 149 of file gtest-message.h.

149 { // NOLINT
150 if (pointer == NULL) {
151 *ss_ << "(null)";
152 } else {
153 *ss_ << pointer;
154 }
155 return *this;
156 }
const GenericPointer< typename T::ValueType > & pointer
Definition pointer.h:1181

◆ operator<<() [6/6]

Message & testing::Message::operator<< ( wchar_t * wide_c_str)

Definition at line 971 of file gtest.cc.

971 {
972 return *this << internal::String::ShowWideCString(wide_c_str);
973}
Here is the call graph for this function:

The documentation for this class was generated from the following files: