// Tests for the Message class.
#include "gtest/gtest-message.h"
-
#include "gtest/gtest.h"
namespace {
// Tests streaming a double.
TEST(MessageTest, StreamsDouble) {
- const std::string s = (Message() << 1260570880.4555497 << " "
- << 1260572265.1954534).GetString();
+ const std::string s =
+ (Message() << 1260570880.4555497 << " " << 1260572265.1954534)
+ .GetString();
// Both numbers should be printed with enough precision.
EXPECT_PRED_FORMAT2(testing::IsSubstring, "1260570880.45", s.c_str());
EXPECT_PRED_FORMAT2(testing::IsSubstring, " 1260572265.19", s.c_str());
// Tests that we can output strings containing embedded NULs.
TEST(MessageTest, StreamsStringWithEmbeddedNUL) {
- const char char_array_with_nul[] =
- "Here's a NUL\0 and some more string";
+ const char char_array_with_nul[] = "Here's a NUL\0 and some more string";
const ::std::string string_with_nul(char_array_with_nul,
sizeof(char_array_with_nul) - 1);
EXPECT_EQ("Here's a NUL\\0 and some more string",
// Tests that basic IO manipulators (endl, ends, and flush) can be
// streamed to Message.
TEST(MessageTest, StreamsBasicIoManip) {
- EXPECT_EQ("Line 1.\nA NUL char \\0 in line 2.",
- (Message() << "Line 1." << std::endl
- << "A NUL char " << std::ends << std::flush
- << " in line 2.").GetString());
+ EXPECT_EQ(
+ "Line 1.\nA NUL char \\0 in line 2.",
+ (Message() << "Line 1." << std::endl
+ << "A NUL char " << std::ends << std::flush << " in line 2.")
+ .GetString());
}
// Tests Message::GetString()