33 table_.add(accept.
copy());
39 EXPECT_EQ(table_.getIndex(accept,
true), 1);
41 EXPECT_EQ(table_.getIndex(accept,
false), 1);
42 table_.add(agent.
copy());
44 EXPECT_EQ(table_.getIndex(agent,
true), 1);
45 EXPECT_EQ(table_.getIndex(accept,
true), 2);
53 table_.setCapacity(capacity);
55 for (
auto i = 0;
i <
max;
i++) {
58 for (
auto i = 1;
i <=
max;
i++) {
61 table_.setMaxAcked(max);
79 table_.setCapacity(capacity);
81 for (
auto i = 0;
i <
max;
i++) {
89 table_.setMaxAcked(max);
104 for (
auto i = 0;
i < 10;
i++) {
106 table_.setMaxAcked(
i + 1);
112 EXPECT_EQ(table_.getIndex(agent,
true), 1);
113 EXPECT_EQ(table_.getIndex(cookie,
true), 2);
114 EXPECT_EQ(table_.getIndex(accept,
true), 3);
115 EXPECT_EQ(table_.getHeader(1, table_.getBaseIndex()), agent);
116 EXPECT_EQ(table_.getHeader(2, table_.getBaseIndex()), cookie);
117 EXPECT_EQ(table_.getHeader(table_.size(), table_.getBaseIndex()), accept);
142 auto res = table_.maybeDuplicate(1,
true);
146 for (
auto i = 0;
i < 6;
i++) {
149 table_.setMaxAcked(
std::min(3u, table_.getBaseIndex()));
154 res = table_.maybeDuplicate(table_.size(),
true);
161 res = table_.maybeDuplicate(table_.size(),
false);
167 res = table_.maybeDuplicate(QPACKHeaderTable::UNACKED,
true);
174 auto oldestAbsolute = table_.getBaseIndex() - table_.size() + 1;
175 table_.addRef(oldestAbsolute);
180 res = table_.maybeDuplicate(table_.size(),
true);
188 HPACKHeader fortySevenBytes(
"abcd",
"efghijklmno");
189 for (
auto i = 0;
i < 8;
i++) {
192 table_.setMaxAcked(table_.getBaseIndex());
206 table_.setCapacity(220);
213 table_.setMaxAcked(3);
#define EXPECT_EQ(val1, val2)
#define EXPECT_TRUE(condition)
TEST_F(QPACKHeaderTableTests, BadSync)
#define EXPECT_FALSE(condition)
NetworkSocket accept(NetworkSocket s, sockaddr *addr, socklen_t *addrlen)