proxygen
fizz::test::PlaintextRecordTest Class Reference
Inheritance diagram for fizz::test::PlaintextRecordTest:
testing::Test

Protected Member Functions

Buf getBuf (const std::string &hex)
 
void addToQueue (const std::string &hex)
 
void expectSame (const Buf &buf, const std::string &hex)
 
- Protected Member Functions inherited from testing::Test
 Test ()
 
virtual void SetUp ()
 
virtual void TearDown ()
 
 Test ()
 
virtual void SetUp ()
 
virtual void TearDown ()
 
 Test ()
 
virtual void SetUp ()
 
virtual void TearDown ()
 

Protected Attributes

PlaintextReadRecordLayer read_
 
PlaintextWriteRecordLayer write_
 
IOBufQueue queue_ {IOBufQueue::cacheChainLength()}
 
IOBufEqualTo eq_
 

Additional Inherited Members

- Public Types inherited from testing::Test
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc
 
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc
 
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc
 
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc
 
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc
 
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc
 
- Public Member Functions inherited from testing::Test
virtual ~Test ()
 
virtual ~Test ()
 
virtual ~Test ()
 
- Static Public Member Functions inherited from testing::Test
static void SetUpTestCase ()
 
static void TearDownTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 
static void SetUpTestCase ()
 
static void TearDownTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 
static void SetUpTestCase ()
 
static void TearDownTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 

Detailed Description

Definition at line 25 of file PlaintextRecordTest.cpp.

Member Function Documentation

void fizz::test::PlaintextRecordTest::addToQueue ( const std::string hex)
inlineprotected

Definition at line 39 of file PlaintextRecordTest.cpp.

39  {
40  queue_.append(getBuf(hex));
41  }
Buf getBuf(const std::string &hex)
void append(std::unique_ptr< folly::IOBuf > &&buf, bool pack=false)
Definition: IOBufQueue.cpp:143
void fizz::test::PlaintextRecordTest::expectSame ( const Buf buf,
const std::string hex 
)
inlineprotected

Definition at line 43 of file PlaintextRecordTest.cpp.

References EXPECT_EQ, and folly::hexlify().

43  {
44  auto str = buf->moveToFbString().toStdString();
45  EXPECT_EQ(hexlify(str), hex);
46  }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
bool hexlify(const InputString &input, OutputString &output, bool append_output)
Definition: String-inl.h:596
Buf fizz::test::PlaintextRecordTest::getBuf ( const std::string hex)
inlineprotected

Definition at line 34 of file PlaintextRecordTest.cpp.

References folly::IOBuf::copyBuffer(), folly::data(), and folly::unhexlify().

34  {
35  auto data = unhexlify(hex);
36  return IOBuf::copyBuffer(data.data(), data.size());
37  }
bool unhexlify(const InputString &input, OutputString &output)
Definition: String-inl.h:616
static std::unique_ptr< IOBuf > copyBuffer(const void *buf, std::size_t size, std::size_t headroom=0, std::size_t minTailroom=0)
Definition: IOBuf.h:1587
static constexpr uint64_t data[1]
Definition: Fingerprint.cpp:43

Member Data Documentation

IOBufEqualTo fizz::test::PlaintextRecordTest::eq_
protected

Definition at line 32 of file PlaintextRecordTest.cpp.

IOBufQueue fizz::test::PlaintextRecordTest::queue_ {IOBufQueue::cacheChainLength()}
protected

Definition at line 30 of file PlaintextRecordTest.cpp.

PlaintextReadRecordLayer fizz::test::PlaintextRecordTest::read_
protected

Definition at line 27 of file PlaintextRecordTest.cpp.

PlaintextWriteRecordLayer fizz::test::PlaintextRecordTest::write_
protected

Definition at line 28 of file PlaintextRecordTest.cpp.


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