proxygen
CompressionTest.cpp File Reference
#include <folly/compression/Compression.h>
#include <algorithm>
#include <random>
#include <set>
#include <thread>
#include <unordered_map>
#include <utility>
#include <boost/noncopyable.hpp>
#include <glog/logging.h>
#include <folly/Random.h>
#include <folly/Varint.h>
#include <folly/hash/Hash.h>
#include <folly/io/IOBufQueue.h>
#include <folly/portability/GTest.h>

Go to the source code of this file.

Classes

class  folly::io::test::DataHolder
 
class  folly::io::test::RandomDataHolder
 
class  folly::io::test::ConstantDataHolder
 
class  folly::io::test::CompressionTest
 
class  folly::io::test::CompressionVarintTest
 
class  folly::io::test::CompressionCorruptionTest
 
class  folly::io::test::StreamingUnitTest
 
class  folly::io::test::StreamingCompressionTest
 
class  folly::io::test::AutomaticCodecTest
 
class  folly::io::test::TerminalCodecTest
 

Namespaces

 folly
 —— Concurrent Priority Queue Implementation ——
 
 folly::io
 
 folly::io::test
 

Macros

#define EXPECT_THROW_IF_DEBUG(statement, expected_exception)
 

Functions

uint64_t folly::io::test::hashIOBuf (const IOBuf *buf)
 
static std::vector< CodecType > folly::io::test::supportedCodecs (std::vector< CodecType > const &v)
 
static std::vector< CodecType > folly::io::test::availableCodecs ()
 
static std::vector< CodecType > folly::io::test::availableStreamCodecs ()
 
 folly::io::test::TEST (CompressionTestNeedsUncompressedLength, Simple)
 
 folly::io::test::TEST_P (CompressionTest, RandomData)
 
 folly::io::test::TEST_P (CompressionTest, ConstantData)
 
 folly::io::test::TEST_P (CompressionTest, RandomDataString)
 
 folly::io::test::TEST_P (CompressionTest, ConstantDataString)
 
 folly::io::test::INSTANTIATE_TEST_CASE_P (CompressionTest, CompressionTest, testing::Combine(testing::Values(-1, 0, 1, 12, 22, 25, 27), testing::Values(1, 2, 3, 8, 65), testing::ValuesIn(availableCodecs())))
 
uint64_t folly::io::test::oneBasedMsbPos (uint64_t number)
 
 folly::io::test::TEST_P (CompressionVarintTest, RandomData)
 
 folly::io::test::TEST_P (CompressionVarintTest, ConstantData)
 
 folly::io::test::INSTANTIATE_TEST_CASE_P (CompressionVarintTest, CompressionVarintTest, testing::Combine(testing::Values(0, 1, 12, 22, 25, 27), testing::ValuesIn(supportedCodecs({CodecType::LZ4_VARINT_SIZE, CodecType::LZMA2_VARINT_SIZE,}))))
 
 folly::io::test::TEST (LZMATest, UncompressBadVarint)
 
 folly::io::test::TEST_P (CompressionCorruptionTest, RandomData)
 
 folly::io::test::TEST_P (CompressionCorruptionTest, ConstantData)
 
 folly::io::test::INSTANTIATE_TEST_CASE_P (CompressionCorruptionTest, CompressionCorruptionTest, testing::ValuesIn(supportedCodecs({CodecType::SNAPPY, CodecType::ZLIB, CodecType::LZMA2, CodecType::ZSTD, CodecType::LZ4_FRAME, CodecType::BZIP2,})))
 
static bool folly::io::test::codecHasFlush (CodecType type)
 
 folly::io::test::TEST (StreamingUnitTest, needsDataLength)
 
 folly::io::test::TEST_P (StreamingUnitTest, maxCompressedLength)
 
 folly::io::test::TEST_P (StreamingUnitTest, getUncompressedLength)
 
 folly::io::test::TEST_P (StreamingUnitTest, emptyData)
 
 folly::io::test::TEST_P (StreamingUnitTest, noForwardProgress)
 
 folly::io::test::TEST_P (StreamingUnitTest, stateTransitions)
 
 folly::io::test::INSTANTIATE_TEST_CASE_P (StreamingUnitTest, StreamingUnitTest, testing::ValuesIn(availableStreamCodecs()))
 
static std::unique_ptr< IOBuf > folly::io::test::compressSome (StreamCodec *codec, ByteRange data, uint64_t bufferSize, StreamCodec::FlushOp flush)
 
static std::pair< bool, std::unique_ptr< IOBuf > > folly::io::test::uncompressSome (StreamCodec *codec, ByteRange &data, uint64_t bufferSize, StreamCodec::FlushOp flush)
 
 folly::io::test::TEST_P (StreamingCompressionTest, resetStream)
 
 folly::io::test::TEST_P (StreamingCompressionTest, compressStream)
 
 folly::io::test::TEST_P (StreamingCompressionTest, uncompressStream)
 
 folly::io::test::TEST_P (StreamingCompressionTest, testFlush)
 
 folly::io::test::INSTANTIATE_TEST_CASE_P (StreamingCompressionTest, StreamingCompressionTest, testing::Combine(testing::Values(0, 1, 12, 22, 27), testing::Values(12, 17, 20), testing::ValuesIn(availableStreamCodecs())))
 
 folly::io::test::TEST_P (AutomaticCodecTest, RandomData)
 
 folly::io::test::TEST_P (AutomaticCodecTest, ConstantData)
 
 folly::io::test::TEST_P (AutomaticCodecTest, ValidPrefixes)
 
 folly::io::test::TEST_P (AutomaticCodecTest, NeedsUncompressedLength)
 
 folly::io::test::TEST_P (AutomaticCodecTest, maxUncompressedLength)
 
 folly::io::test::TEST_P (AutomaticCodecTest, DefaultCodec)
 
 folly::io::test::TEST_P (AutomaticCodecTest, CustomCodec)
 
 folly::io::test::TEST_P (AutomaticCodecTest, CustomDefaultCodec)
 
 folly::io::test::TEST_P (AutomaticCodecTest, canUncompressOneBytes)
 
 folly::io::test::INSTANTIATE_TEST_CASE_P (AutomaticCodecTest, AutomaticCodecTest, testing::ValuesIn(availableCodecs()))
 
 folly::io::test::TEST_P (TerminalCodecTest, uncompressIfDefaultThrows)
 
 folly::io::test::TEST_P (TerminalCodecTest, terminalOverridesDefaults)
 
 folly::io::test::INSTANTIATE_TEST_CASE_P (TerminalCodecTest, TerminalCodecTest, testing::ValuesIn(autoUncompressionCodecTypes))
 
 folly::io::test::TEST (ValidPrefixesTest, CustomCodec)
 
 folly::io::test::TEST (CheckCompatibleTest, SimplePrefixSecond)
 
 folly::io::test::TEST (CheckCompatibleTest, SimplePrefixFirst)
 
 folly::io::test::TEST (CheckCompatibleTest, Empty)
 
 folly::io::test::TEST (CheckCompatibleTest, ZstdPrefix)
 
 folly::io::test::TEST (CheckCompatibleTest, ZstdDuplicate)
 
 folly::io::test::TEST (CheckCompatibleTest, ZlibIsPrefix)
 

Variables

constexpr size_t folly::io::test::dataSizeLog2 = 27
 
RandomDataHolder folly::io::test::randomDataHolder (dataSizeLog2)
 
ConstantDataHolder folly::io::test::constantDataHolder (dataSizeLog2)
 

Macro Definition Documentation

#define EXPECT_THROW_IF_DEBUG (   statement,
  expected_exception 
)
Value:
do { \
EXPECT_THROW((statement), expected_exception); \
} else { \
EXPECT_NO_THROW((statement)); \
} \
} while (false)
#define EXPECT_NO_THROW(statement)
Definition: gtest.h:1845
#define EXPECT_THROW(statement, expected_exception)
Definition: gtest.h:1843
constexpr auto kIsDebug
Definition: Portability.h:264
if(FOLLY_USE_SYMBOLIZER) add_library(folly_exception_tracer_base ExceptionTracer.cpp StackTrace.cpp) apply_folly_compile_options_to_target(folly_exception_tracer_base) target_link_libraries(folly_exception_tracer_base PUBLIC folly) add_library(folly_exception_tracer ExceptionStackTraceLib.cpp ExceptionTracerLib.cpp) apply_folly_compile_options_to_target(folly_exception_tracer) target_link_libraries(folly_exception_tracer PUBLIC folly_exception_tracer_base) add_library(folly_exception_counter ExceptionCounterLib.cpp) apply_folly_compile_options_to_target(folly_exception_counter) target_link_libraries(folly_exception_counter PUBLIC folly_exception_tracer) install(FILES ExceptionAbi.h ExceptionCounterLib.h ExceptionTracer.h ExceptionTracerLib.h StackTrace.h DESTINATION $
Definition: CMakeLists.txt:1

Definition at line 1334 of file CompressionTest.cpp.

Referenced by folly::io::test::TEST().

Variable Documentation

std::unique_ptr<Codec> codec_
private

Definition at line 1160 of file CompressionTest.cpp.

Referenced by proxygen::HTTPSessionBase::addCodecFilter(), FilterTest::FilterTest(), proxygen::HTTPSessionBase::getCodecProtocol(), MockCodecDownstreamTest::MockCodecDownstreamTest(), MockCodecDownstreamTest::onIngressImpl(), proxygen::RFC1867Base::parse(), folly::io::test::StreamingCompressionTest::runCompressStreamTest(), folly::io::test::StreamingCompressionTest::runFlushTest(), folly::io::test::StreamingCompressionTest::runResetStreamTest(), folly::io::test::CompressionTest::runSimpleIOBufTest(), folly::io::test::CompressionTest::runSimpleStringTest(), folly::io::test::CompressionVarintTest::runSimpleTest(), folly::io::test::CompressionCorruptionTest::runSimpleTest(), folly::io::test::AutomaticCodecTest::runSimpleTest(), folly::io::test::StreamingCompressionTest::runUncompressStreamTest(), FlowControlFilterTest< initSize >::SetUp(), fizz::server::test::AeadTicketCipherTest::SetUp(), proxygen::RFC1867Base::SetUp(), folly::io::test::CompressionTest::SetUp(), folly::io::test::CompressionVarintTest::SetUp(), folly::io::test::CompressionCorruptionTest::SetUp(), folly::io::test::StreamingUnitTest::SetUp(), folly::io::test::StreamingCompressionTest::SetUp(), folly::io::test::AutomaticCodecTest::SetUp(), folly::io::test::TerminalCodecTest::SetUp(), folly::io::test::TEST(), fizz::server::test::TEST_F(), TEST_F(), folly::io::test::TEST_P(), MockCodecDownstreamTest::testConnFlowControlBlocked(), and MockCodecDownstreamTest::testGoaway().

std::string uncompressed_
private

Definition at line 1267 of file CompressionTest.cpp.

Referenced by folly::io::test::TEST_P().