Definition at line 780 of file CompressionTest.cpp.
bool folly::io::test::StreamingCompressionTest::hasFlush |
( |
| ) |
const |
|
inlineprotected |
void folly::io::test::StreamingCompressionTest::runCompressStreamTest |
( |
DataHolder const & |
dh | ) |
|
|
protected |
Definition at line 882 of file CompressionTest.cpp.
References codec_, folly::io::test::compressSome(), folly::io::test::DataHolder::data(), folly::empty(), folly::io::StreamCodec::END, EXPECT_EQ, folly::io::test::DataHolder::hash(), folly::io::test::hashIOBuf(), folly::io::StreamCodec::NONE, and folly::split().
889 for (
auto const input : inputs) {
898 auto const uncompressed =
codec_->uncompress(queue.front());
static std::unique_ptr< IOBuf > compressSome(StreamCodec *codec, ByteRange data, uint64_t bufferSize, StreamCodec::FlushOp flush)
std::vector< ByteRange > split(ByteRange data) const
#define EXPECT_EQ(val1, val2)
std::unique_ptr< StreamCodec > codec_
constexpr auto empty(C const &c) -> decltype(c.empty())
uint64_t hashIOBuf(const IOBuf *buf)
Range< const unsigned char * > ByteRange
uint64_t uncompressedLength_
void folly::io::test::StreamingCompressionTest::runFlushTest |
( |
DataHolder const & |
dh | ) |
|
|
protected |
Definition at line 948 of file CompressionTest.cpp.
References codec_, folly::io::test::compressSome(), folly::io::test::DataHolder::data(), EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, folly::io::StreamCodec::FLUSH, folly::io::getStreamCodec(), folly::io::test::hashIOBuf(), folly::split(), folly::io::test::uncompressSome(), and folly::IOBuf::wrapBuffer().
952 if (
codec_->needsDataLength()) {
957 for (
auto input : inputs) {
961 auto compressedRange = compressed->coalesce();
973 EXPECT_EQ(input.size(), result.second->computeChainDataLength());
static std::unique_ptr< IOBuf > compressSome(StreamCodec *codec, ByteRange data, uint64_t bufferSize, StreamCodec::FlushOp flush)
static std::unique_ptr< IOBuf > wrapBuffer(const void *buf, std::size_t capacity)
std::vector< ByteRange > split(ByteRange data) const
#define EXPECT_EQ(val1, val2)
std::unique_ptr< StreamCodec > codec_
static std::pair< bool, std::unique_ptr< IOBuf > > uncompressSome(StreamCodec *codec, ByteRange &data, uint64_t bufferSize, StreamCodec::FlushOp flush)
uint64_t hashIOBuf(const IOBuf *buf)
std::unique_ptr< StreamCodec > getStreamCodec(CodecType type, int level)
constexpr auto data(C &c) -> decltype(c.data())
#define EXPECT_TRUE(condition)
#define EXPECT_FALSE(condition)
uint64_t uncompressedLength_
void folly::io::test::StreamingCompressionTest::runResetStreamTest |
( |
DataHolder const & |
dh | ) |
|
|
protected |
Definition at line 860 of file CompressionTest.cpp.
References codec_, folly::io::test::compressSome(), folly::io::test::DataHolder::data(), folly::io::StreamCodec::END, EXPECT_EQ, folly::io::test::DataHolder::hash(), folly::io::test::hashIOBuf(), and folly::io::StreamCodec::NONE.
866 if (
codec_->needsDataLength()) {
873 auto const uncompressed =
codec_->uncompress(compressed.get(), input.size());
static std::unique_ptr< IOBuf > compressSome(StreamCodec *codec, ByteRange data, uint64_t bufferSize, StreamCodec::FlushOp flush)
#define EXPECT_EQ(val1, val2)
std::unique_ptr< StreamCodec > codec_
uint64_t hashIOBuf(const IOBuf *buf)
uint64_t uncompressedLength_
void folly::io::test::StreamingCompressionTest::runUncompressStreamTest |
( |
DataHolder const & |
dh | ) |
|
|
protected |
Definition at line 907 of file CompressionTest.cpp.
References ASSERT_EQ, ASSERT_TRUE, codec_, folly::io::test::DataHolder::data(), folly::io::StreamCodec::END, EXPECT_TRUE, folly::io::StreamCodec::FLUSH, folly::io::test::hashIOBuf(), folly::io::StreamCodec::NONE, folly::io::test::uncompressSome(), and folly::IOBuf::wrapBuffer().
913 auto compressed =
codec_->compress(
data.get());
914 compressed->prependChain(
codec_->compress(
data.get()));
915 compressed->prependChain(
codec_->compress(
data.get()));
917 auto input = compressed->coalesce();
919 codec_->resetStream(
data->computeChainDataLength());
#define ASSERT_EQ(val1, val2)
static std::unique_ptr< IOBuf > wrapBuffer(const void *buf, std::size_t capacity)
std::unique_ptr< StreamCodec > codec_
static std::pair< bool, std::unique_ptr< IOBuf > > uncompressSome(StreamCodec *codec, ByteRange &data, uint64_t bufferSize, StreamCodec::FlushOp flush)
uint64_t hashIOBuf(const IOBuf *buf)
constexpr auto data(C &c) -> decltype(c.data())
#define EXPECT_TRUE(condition)
uint64_t uncompressedLength_
#define ASSERT_TRUE(condition)
void folly::io::test::StreamingCompressionTest::SetUp |
( |
| ) |
|
|
inlineoverrideprotected |
std::vector< ByteRange > folly::io::test::StreamingCompressionTest::split |
( |
ByteRange |
data | ) |
const |
|
private |
size_t folly::io::test::StreamingCompressionTest::chunkSize_ |
|
private |
std::unique_ptr<StreamCodec> folly::io::test::StreamingCompressionTest::codec_ |
|
private |
uint64_t folly::io::test::StreamingCompressionTest::uncompressedLength_ |
|
private |
The documentation for this class was generated from the following file: