11 #include <glog/logging.h> 15 using namespace folly;
25 EXPECT_EQ(IOBufPrinter::printHexFolly(buf.get()),
"");
26 EXPECT_EQ(IOBufPrinter::printHex16(buf.get()),
"");
34 EXPECT_TRUE(IOBufPrinter::printHexFolly(buf.get()) !=
"");
35 EXPECT_EQ(IOBufPrinter::printHex16(buf.get()),
"0cff 0010 ");
38 for (
int i = 0;
i < 16;
i++) {
42 EXPECT_TRUE(IOBufPrinter::printHexFolly(buf.get()) !=
"");
43 string info = IOBufPrinter::printChainInfo(buf.get());
44 EXPECT_TRUE(info.find(
"iobuf of size 20 tailroom ") != string::npos);
45 EXPECT_EQ(IOBufPrinter::printHex16(buf.get()),
46 "0cff 0010 fefe fefe fefe fefe fefe fefe \nfefe fefe ");
51 0x03, 0x04, 0x11, 0x22, 0xBB, 0xAA
53 string s((
const char *)buf,
sizeof(buf));
59 EXPECT_EQ(IOBufPrinter::printBin(
nullptr),
"");
69 EXPECT_EQ(IOBufPrinter::printBin(b1.get()),
70 "00110011 3 01110111 w \n11111111 \n");
72 EXPECT_EQ(IOBufPrinter::printBin(b1.get(),
true),
73 "00110011 3 01110111 w 11111111 \n");
78 string tmpfile(
"/tmp/test.bin");
80 unlink(tmpfile.c_str());
85 EXPECT_EQ(stat(tmpfile.c_str(), &fstat), 0);
90 EXPECT_EQ(stat(tmpfile.c_str(), &fstat), 0);
92 unlink(tmpfile.c_str());
103 <<
"Test log and exception message";
107 <<
"This should not be logged";
114 <<
"Test log and exception message";
118 <<
"This should not be logged";
125 <<
"Test log and exception message";
129 <<
"This should not be logged";
133 <<
"This should not be logged";
140 <<
"Test log and exception message";
144 <<
"This should not be logged";
151 <<
"Test log and exception message";
155 <<
"This should not be logged";
159 <<
"This should not be logged";
166 <<
"Test log and exception message";
170 <<
"This should not be logged";
177 <<
"Test log and exception message";
181 <<
"This should not be logged";
188 <<
"Test log and exception message";
192 <<
"This should not be logged";
199 <<
"Test log and exception message";
203 <<
"This should not be logged";
#define CHECK_LOG_AND_THROW_LT(X, Y, LOG_LEVEL, EXCEPTION)
void dumpBinToFile(const string &filename, const IOBuf *buf)
#define EXPECT_NO_THROW(statement)
#define EXPECT_THROW(statement, expected_exception)
static std::unique_ptr< IOBuf > create(std::size_t capacity)
string hexStr(StringPiece sp)
#define CHECK_LOG_AND_THROW_GT(X, Y, LOG_LEVEL, EXCEPTION)
#define EXPECT_EQ(val1, val2)
void appendChain(std::unique_ptr< IOBuf > &&iobuf)
constexpr detail::Map< Move > move
#define CHECK_LOG_AND_THROW_NOT_NULL(X, LOG_LEVEL, EXCEPTION)
—— Concurrent Priority Queue Implementation ——
#define CHECK_LOG_AND_THROW_NULL(X, LOG_LEVEL, EXCEPTION)
constexpr auto data(C &c) -> decltype(c.data())
#define CHECK_LOG_AND_THROW_NE(X, Y, LOG_LEVEL, EXCEPTION)
#define CHECK_LOG_AND_THROW_GE(X, Y, LOG_LEVEL, EXCEPTION)
TEST_F(AsyncSSLSocketWriteTest, write_coalescing1)
#define EXPECT_TRUE(condition)
#define CHECK_LOG_AND_THROW(CONDITION, LOG_LEVEL, EXCEPTION)
#define CHECK_LOG_AND_THROW_EQ(X, Y, LOG_LEVEL, EXCEPTION)
#define CHECK_LOG_AND_THROW_LE(X, Y, LOG_LEVEL, EXCEPTION)
void append(std::size_t amount)