proxygen
proxygen::HeaderTableTests Class Reference
Inheritance diagram for proxygen::HeaderTableTests:
testing::Test

Protected Member Functions

void xcheck (uint32_t internal, uint32_t external)
 
void resizeTable (HeaderTable &table, uint32_t newCapacity, uint32_t newMax)
 
void resizeAndFillTable (HeaderTable &table, HPACKHeader &header, uint32_t newMax, uint32_t fillCount)
 
- 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

uint32_t head_ {0}
 
uint32_t length_ {0}
 

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 22 of file HeaderTableTests.cpp.

Member Function Documentation

void proxygen::HeaderTableTests::resizeAndFillTable ( HeaderTable table,
HPACKHeader header,
uint32_t  newMax,
uint32_t  fillCount 
)
inlineprotected

Definition at line 36 of file HeaderTableTests.cpp.

References proxygen::HeaderTable::add(), proxygen::HPACKHeader::bytes(), proxygen::HeaderTable::bytes(), proxygen::HPACKHeader::copy(), EXPECT_EQ, i, proxygen::HeaderTable::size(), and uint32_t.

38  {
39  uint32_t newCapacity = header.bytes() * newMax;
40  resizeTable(table, newCapacity, newMax);
41  // Fill the table (with one extra) and make sure we haven't violated our
42  // size (bytes) limits (expected one entry to be evicted)
43  for (size_t i = 0; i <= fillCount; ++i) {
44  EXPECT_EQ(table.add(header.copy()), true);
45  }
46  EXPECT_EQ(table.size(), newMax);
47  EXPECT_EQ(table.bytes(), newCapacity);
48  }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
void resizeTable(HeaderTable &table, uint32_t newCapacity, uint32_t newMax)
void proxygen::HeaderTableTests::resizeTable ( HeaderTable table,
uint32_t  newCapacity,
uint32_t  newMax 
)
inlineprotected

Definition at line 29 of file HeaderTableTests.cpp.

References EXPECT_LE, proxygen::HeaderTable::setCapacity(), and proxygen::HeaderTable::size().

29  {
30  table.setCapacity(newCapacity);
31  // On resizing the table size (count of headers) remains the same or sizes
32  // down; can not size up
33  EXPECT_LE(table.size(), newMax);
34  }
#define EXPECT_LE(val1, val2)
Definition: gtest.h:1928
void proxygen::HeaderTableTests::xcheck ( uint32_t  internal,
uint32_t  external 
)
inlineprotected

Definition at line 24 of file HeaderTableTests.cpp.

References EXPECT_EQ, and length_.

24  {
25  EXPECT_EQ(HeaderTable::toExternal(head_, length_, internal), external);
26  EXPECT_EQ(HeaderTable::toInternal(head_, length_, external), internal);
27  }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
static uint32_t toExternal(uint32_t head, uint32_t length, uint32_t internalIndex)
static uint32_t toInternal(uint32_t head, uint32_t length, uint32_t externalIndex)

Member Data Documentation

uint32_t proxygen::HeaderTableTests::head_ {0}
protected

Definition at line 50 of file HeaderTableTests.cpp.

uint32_t proxygen::HeaderTableTests::length_ {0}
protected

Definition at line 51 of file HeaderTableTests.cpp.


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