34 #include "gtest/gtest-message.h" 36 #include "gtest/gtest.h" 45 TEST(MessageTest, DefaultConstructor) {
51 TEST(MessageTest, CopyConstructor) {
58 TEST(MessageTest, ConstructsFromCString) {
64 TEST(MessageTest, StreamsFloat) {
72 TEST(MessageTest, StreamsDouble) {
74 << 1260572265.1954534).GetString();
81 TEST(MessageTest, StreamsPointer) {
88 TEST(MessageTest, StreamsNullPointer) {
94 TEST(MessageTest, StreamsCString) {
99 TEST(MessageTest, StreamsNullCString) {
105 TEST(MessageTest, StreamsString) {
111 TEST(MessageTest, StreamsStringWithEmbeddedNUL) {
112 const char char_array_with_nul[] =
113 "Here's a NUL\0 and some more string";
115 sizeof(char_array_with_nul) - 1);
116 EXPECT_EQ(
"Here's a NUL\\0 and some more string",
117 (
Message() << string_with_nul).GetString());
121 TEST(MessageTest, StreamsNULChar) {
126 TEST(MessageTest, StreamsInt) {
132 TEST(MessageTest, StreamsBasicIoManip) {
133 EXPECT_EQ(
"Line 1.\nA NUL char \\0 in line 2.",
134 (
Message() <<
"Line 1." << std::endl
136 <<
" in line 2.").GetString());
140 TEST(MessageTest, GetString) {
147 TEST(MessageTest, StreamsToOStream) {
149 ::std::stringstream ss;
155 TEST(MessageTest, DoesNotTakeUpMuchStackSpace) {
std::string StringStreamToString(::std::stringstream *ss)
OStream< ChannelType > & flush(OStream< ChannelType > &os)
#define EXPECT_NE(expected, actual)
#define TEST(test_case_name, test_name)
AssertionResult IsSubstring(const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
#define EXPECT_LE(val1, val2)
#define EXPECT_PRED_FORMAT2(pred_format, v1, v2)
#define EXPECT_EQ(expected, actual)