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

Protected Member Functions

void addToQueue (const std::string &hex)
 
- Protected Member Functions inherited from testing::Test
 Test ()
 
virtual void TearDown ()
 
 Test ()
 
virtual void TearDown ()
 
 Test ()
 
virtual void TearDown ()
 

Static Protected Member Functions

static Buf getBuf (const std::string &hex, size_t headroom=0, size_t tailroom=0)
 
static void expectSame (const Buf &buf, const std::string &hex)
 

Protected Attributes

EncryptedReadRecordLayer read_ {EncryptionLevel::AppTraffic}
 
EncryptedWriteRecordLayer write_ {EncryptionLevel::AppTraffic}
 
MockAeadreadAead_
 
MockAeadwriteAead_
 
IOBufQueue queue_ {IOBufQueue::cacheChainLength()}
 
IOBufEqualTo eq_
 

Private Member Functions

void SetUp () override
 

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 26 of file EncryptedRecordTest.cpp.

Member Function Documentation

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

Definition at line 52 of file EncryptedRecordTest.cpp.

52  {
53  queue_.append(getBuf(hex));
54  }
void append(std::unique_ptr< folly::IOBuf > &&buf, bool pack=false)
Definition: IOBufQueue.cpp:143
static Buf getBuf(const std::string &hex, size_t headroom=0, size_t tailroom=0)
static void fizz::test::EncryptedRecordTest::expectSame ( const Buf buf,
const std::string hex 
)
inlinestaticprotected

Definition at line 56 of file EncryptedRecordTest.cpp.

References EXPECT_EQ, and folly::hexlify().

56  {
57  auto str = buf->moveToFbString().toStdString();
58  EXPECT_EQ(hexlify(str), hex);
59  }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
bool hexlify(const InputString &input, OutputString &output, bool append_output)
Definition: String-inl.h:596
static Buf fizz::test::EncryptedRecordTest::getBuf ( const std::string hex,
size_t  headroom = 0,
size_t  tailroom = 0 
)
inlinestaticprotected

Definition at line 47 of file EncryptedRecordTest.cpp.

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

47  {
48  auto data = unhexlify(hex);
49  return IOBuf::copyBuffer(data.data(), data.size(), headroom, tailroom);
50  }
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
void fizz::test::EncryptedRecordTest::SetUp ( )
inlineoverrideprivatevirtual

Reimplemented from testing::Test.

Definition at line 27 of file EncryptedRecordTest.cpp.

References folly::gen::move.

27  {
28  auto readAead = std::make_unique<MockAead>();
29  readAead_ = readAead.get();
31  auto writeAead = std::make_unique<MockAead>();
32  writeAead_ = writeAead.get();
34  }
EncryptedWriteRecordLayer write_
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
virtual void setAead(folly::ByteRange, std::unique_ptr< Aead > aead)
virtual void setAead(folly::ByteRange, std::unique_ptr< Aead > aead)

Member Data Documentation

IOBufEqualTo fizz::test::EncryptedRecordTest::eq_
protected

Definition at line 44 of file EncryptedRecordTest.cpp.

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

Definition at line 42 of file EncryptedRecordTest.cpp.

EncryptedReadRecordLayer fizz::test::EncryptedRecordTest::read_ {EncryptionLevel::AppTraffic}
protected

Definition at line 37 of file EncryptedRecordTest.cpp.

MockAead* fizz::test::EncryptedRecordTest::readAead_
protected

Definition at line 39 of file EncryptedRecordTest.cpp.

EncryptedWriteRecordLayer fizz::test::EncryptedRecordTest::write_ {EncryptionLevel::AppTraffic}
protected

Definition at line 38 of file EncryptedRecordTest.cpp.

MockAead* fizz::test::EncryptedRecordTest::writeAead_
protected

Definition at line 40 of file EncryptedRecordTest.cpp.


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