proxygen
|
#include <folly/Conv.h>
#include <glog/logging.h>
#include <folly/portability/GTest.h>
#include <memory>
#include <proxygen/lib/http/codec/compress/HPACKContext.h>
#include <proxygen/lib/http/codec/compress/HPACKDecoder.h>
#include <proxygen/lib/http/codec/compress/HPACKEncoder.h>
#include <proxygen/lib/http/codec/compress/QPACKDecoder.h>
#include <proxygen/lib/http/codec/compress/QPACKEncoder.h>
#include <proxygen/lib/http/codec/compress/Logging.h>
#include <proxygen/lib/http/codec/compress/test/TestUtil.h>
Go to the source code of this file.
Classes | |
class | HPACKContextTests |
class | TestContext |
Functions | |
TEST_F (HPACKContextTests, GetIndex) | |
TEST_F (HPACKContextTests, IsStatic) | |
TEST_F (HPACKContextTests, StaticTable) | |
TEST_F (HPACKContextTests, StaticTableHeaderNamesAreCommon) | |
TEST_F (HPACKContextTests, static_table_is_header_code_in_table_with_non_empty_value) | |
TEST_F (HPACKContextTests, StaticIndex) | |
TEST_F (HPACKContextTests, EncoderMultipleValues) | |
TEST_F (HPACKContextTests, DecoderLargeHeader) | |
TEST_F (HPACKContextTests, DecoderInvalidPeek) | |
TEST_F (HPACKContextTests, DecoderInvalidLiteralPeek) | |
void | checkError (const IOBuf *buf, const HPACK::DecodeError err) |
TEST_F (HPACKContextTests, DecodeErrors) | |
TEST_F (HPACKContextTests, ExcludeHeadersLargerThanTable) | |
TEST_P (HPACKContextTests, ContextUpdate) | |
INSTANTIATE_TEST_CASE_P (Context, HPACKContextTests,::testing::Values(true, false)) | |
void checkError | ( | const IOBuf * | buf, |
const HPACK::DecodeError | err | ||
) |
testing various error cases in HPACKDecoder::decodeLiterHeader()
Definition at line 187 of file HPACKContextTests.cpp.
References proxygen::hpack::decode(), EXPECT_EQ, EXPECT_TRUE, proxygen::HPACKDecoderBase::getError(), and proxygen::HPACKDecoderBase::hasError().
Referenced by TEST_F().
INSTANTIATE_TEST_CASE_P | ( | Context | , |
HPACKContextTests | , | ||
::testing::Values(true, false) | |||
) |
Referenced by TEST_P().
TEST_F | ( | HPACKContextTests | , |
GetIndex | |||
) |
Definition at line 41 of file HPACKContextTests.cpp.
References context, proxygen::HPACKContext::getIndex(), and proxygen::HPACK::kTableSize.
TEST_F | ( | HPACKContextTests | , |
IsStatic | |||
) |
Definition at line 49 of file HPACKContextTests.cpp.
References TestContext::add(), context, EXPECT_EQ, proxygen::HPACKContext::getTable(), i, proxygen::HPACKContext::isStatic(), proxygen::HPACK::kTableSize, folly::gen::move, and proxygen::HeaderTable::size().
TEST_F | ( | HPACKContextTests | , |
StaticTable | |||
) |
Definition at line 67 of file HPACKContextTests.cpp.
References folly::gen::first, proxygen::HPACKHeaderName::get(), folly::pushmi::operators::get, and proxygen::HPACKHeader::name.
TEST_F | ( | HPACKContextTests | , |
StaticTableHeaderNamesAreCommon | |||
) |
Definition at line 80 of file HPACKContextTests.cpp.
References EXPECT_TRUE, and folly::pushmi::operators::get.
TEST_F | ( | HPACKContextTests | , |
static_table_is_header_code_in_table_with_non_empty_value | |||
) |
Definition at line 87 of file HPACKContextTests.cpp.
References folly::basic_fbstring< E, T, A, Storage >::empty(), EXPECT_TRUE, folly::pushmi::operators::get, proxygen::HPACKHeaderName::getHeaderCode(), i, proxygen::HPACKHeader::name, uint32_t, and proxygen::HPACKHeader::value.
TEST_F | ( | HPACKContextTests | , |
StaticIndex | |||
) |
Definition at line 99 of file HPACKContextTests.cpp.
References context, EXPECT_EQ, proxygen::HPACKContext::getHeader(), and proxygen::HPACK::kTableSize.
TEST_F | ( | HPACKContextTests | , |
EncoderMultipleValues | |||
) |
Definition at line 111 of file HPACKContextTests.cpp.
References folly::IOBuf::computeChainDataLength(), proxygen::HPACKEncoder::encode(), EXPECT_EQ, EXPECT_GT, EXPECT_LT, EXPECT_TRUE, proxygen::HPACKContext::getTable(), folly::IOBuf::length(), and proxygen::HeaderTable::size().
TEST_F | ( | HPACKContextTests | , |
DecoderLargeHeader | |||
) |
Definition at line 127 of file HPACKContextTests.cpp.
References proxygen::hpack::decode(), proxygen::HPACKEncoder::encode(), EXPECT_EQ, proxygen::HPACKContext::getTable(), folly::size(), proxygen::HeaderTable::size(), and uint32_t.
TEST_F | ( | HPACKContextTests | , |
DecoderInvalidPeek | |||
) |
testing invalid memory access in the decoder; it has to always call peek()
Definition at line 146 of file HPACKContextTests.cpp.
References folly::IOBuf::appendChain(), proxygen::HPACK::Instruction::code, folly::IOBuf::create(), proxygen::hpack::decode(), proxygen::HPACKEncoder::encode(), EXPECT_EQ, EXPECT_FALSE, folly::gen::first, proxygen::HPACKDecoderBase::hasError(), proxygen::HPACK::INDEX_REF, folly::gen::move, and folly::IOBuf::writableData().
TEST_F | ( | HPACKContextTests | , |
DecoderInvalidLiteralPeek | |||
) |
similar with the one above, but slightly different code paths
Definition at line 167 of file HPACKContextTests.cpp.
References folly::IOBuf::appendChain(), folly::IOBuf::create(), proxygen::hpack::decode(), proxygen::HPACKEncoder::encode(), EXPECT_EQ, EXPECT_FALSE, folly::gen::first, proxygen::HPACKDecoderBase::hasError(), folly::gen::move, and folly::IOBuf::writableData().
TEST_F | ( | HPACKContextTests | , |
DecodeErrors | |||
) |
Definition at line 194 of file HPACKContextTests.cpp.
References folly::IOBuf::append(), checkError(), folly::IOBuf::create(), and folly::IOBuf::writableData().
TEST_F | ( | HPACKContextTests | , |
ExcludeHeadersLargerThanTable | |||
) |
Definition at line 255 of file HPACKContextTests.cpp.
References proxygen::HPACKHeader::bytes(), folly::gen::move, and string.
TEST_P | ( | HPACKContextTests | , |
ContextUpdate | |||
) |
Definition at line 274 of file HPACKContextTests.cpp.
References folly::IOBuf::appendChain(), folly::IOBuf::create(), proxygen::hpack::decode(), proxygen::HPACKEncoder::encode(), EXPECT_EQ, folly::gen::first, proxygen::HPACKDecoderBase::getError(), proxygen::HPACKDecoderBase::hasError(), INSTANTIATE_TEST_CASE_P(), folly::gen::move, proxygen::HPACKDecoderBase::setHeaderTableMaxSize(), and proxygen::HPACKEncoder::setHeaderTableSize().