9 #include <gmock/gmock.h> 10 #include <gtest/gtest.h> 17 using namespace folly;
54 auto str = buf->moveToFbString().toStdString();
70 auto param = read_.readEvent(queue_);
71 auto& appData = boost::get<AppData>(*param);
77 return TLSMessage{ContentType::alert, getBuf(
"0202")};
79 auto param = read_.readEvent(queue_);
80 boost::get<Alert>(*param);
85 return TLSMessage{ContentType::handshake, getBuf(
"140000023232")};
87 auto param = read_.readEvent(queue_);
88 auto&
finished = boost::get<Finished>(*param);
89 expectSame(
finished.verify_data,
"3232");
90 expectSame(*
finished.originalEncoding,
"140000023232");
95 return TLSMessage{ContentType::handshake, getBuf(
"14400000")};
103 return TLSMessage{ContentType::handshake, getBuf(
"14000008aabbccdd")};
106 return TLSMessage{ContentType::handshake, getBuf(
"11223344")};
108 auto param = read_.readEvent(queue_);
110 auto&
finished = boost::get<Finished>(*param);
111 expectSame(finished.verify_data,
"aabbccdd11223344");
117 return TLSMessage{ContentType::handshake, getBuf(
"14000008aabbccdd")};
123 return TLSMessage{ContentType::handshake, getBuf(
"11223344")};
125 auto param = read_.readEvent(queue_);
126 auto&
finished = boost::get<Finished>(*param);
127 expectSame(
finished.verify_data,
"aabbccdd11223344");
133 getBuf(
"14000002aabb14000002ccdd")};
135 auto param = read_.readEvent(queue_);
136 auto&
finished = boost::get<Finished>(*param);
137 expectSame(
finished.verify_data,
"aabb");
139 param = read_.readEvent(queue_);
140 auto& finished2 = boost::get<Finished>(*param);
141 expectSame(finished2.verify_data,
"ccdd");
148 return TLSMessage{ContentType::handshake, getBuf(
"01000010abcd")};
151 return TLSMessage{ContentType::application_data,
162 content.
data =
nullptr;
175 content.
data =
nullptr;
178 write_.writeAlert(
Alert());
187 content.
data =
nullptr;
#define EXPECT_ANY_THROW(statement)
bool unhexlify(const InputString &input, OutputString &output)
#define MOCK_CONST_METHOD1(m,...)
#define EXPECT_EQ(val1, val2)
static void expectSame(const Buf &buf, const std::string &hex)
—— Concurrent Priority Queue Implementation ——
PolymorphicAction< internal::InvokeWithoutArgsAction< FunctionImpl > > InvokeWithoutArgs(FunctionImpl function_impl)
StrictMock< ConcreteWriteRecordLayer > write_
StrictMock< ConcreteReadRecordLayer > read_
static Options cacheChainLength()
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
size_t read(T &out, folly::io::Cursor &cursor)
constexpr auto data(C &c) -> decltype(c.data())
static Buf getBuf(const std::string &hex)
EncryptionLevel encryptionLevel
TEST_F(AsyncSSLSocketWriteTest, write_coalescing1)
TLSContent write(TLSMessage &&msg) const override
#define EXPECT_TRUE(condition)
#define MOCK_METHOD1(m,...)
std::unique_ptr< folly::IOBuf > Buf
#define EXPECT_CALL(obj, call)
const internal::AnythingMatcher _
#define EXPECT_FALSE(condition)
bool hexlify(const InputString &input, OutputString &output, bool append_output)
static std::unique_ptr< IOBuf > copyBuffer(const void *buf, std::size_t size, std::size_t headroom=0, std::size_t minTailroom=0)