Definition at line 197 of file CompressionTest.cpp.
void folly::io::test::CompressionTest::runSimpleIOBufTest |
( |
const DataHolder & |
dh | ) |
|
|
protected |
Definition at line 221 of file CompressionTest.cpp.
References codec_, folly::io::test::DataHolder::data(), EXPECT_EQ, EXPECT_LE, folly::io::test::DataHolder::hash(), folly::io::test::hashIOBuf(), folly::split(), and folly::IOBuf::wrapBuffer().
223 const auto compressed =
split(
codec_->compress(original.get()));
225 compressed->computeChainDataLength(),
227 if (!
codec_->needsUncompressedLength()) {
228 auto uncompressed =
codec_->uncompress(compressed.get());
#define EXPECT_LE(val1, val2)
static std::unique_ptr< IOBuf > wrapBuffer(const void *buf, std::size_t capacity)
#define EXPECT_EQ(val1, val2)
std::unique_ptr< Codec > codec_
uint64_t uncompressedLength_
uint64_t hashIOBuf(const IOBuf *buf)
std::unique_ptr< IOBuf > split(std::unique_ptr< IOBuf > data) const
void folly::io::test::CompressionTest::runSimpleStringTest |
( |
const DataHolder & |
dh | ) |
|
|
protected |
void folly::io::test::CompressionTest::SetUp |
( |
| ) |
|
|
inlineoverrideprotected |
std::unique_ptr< IOBuf > folly::io::test::CompressionTest::split |
( |
std::unique_ptr< IOBuf > |
data | ) |
const |
|
private |
Definition at line 261 of file CompressionTest.cpp.
References folly::IOBufQueue::append(), folly::IOBuf::copyBuffer(), i, folly::IOBufQueue::move(), folly::Random::rand64(), folly::size(), and folly::split().
263 if (data->isChained()) {
267 const size_t size = data->computeChainDataLength();
269 std::multiset<size_t> splits;
277 for (
size_t split : splits) {
283 return result.
move();
void append(std::unique_ptr< folly::IOBuf > &&buf, bool pack=false)
std::unique_ptr< folly::IOBuf > move()
constexpr auto size(C const &c) -> decltype(c.size())
std::unique_ptr< IOBuf > split(std::unique_ptr< IOBuf > data) const
static std::unique_ptr< IOBuf > copyBuffer(const void *buf, std::size_t size, std::size_t headroom=0, std::size_t minTailroom=0)
size_t folly::io::test::CompressionTest::chunks_ |
|
private |
std::unique_ptr<Codec> folly::io::test::CompressionTest::codec_ |
|
private |
uint64_t folly::io::test::CompressionTest::uncompressedLength_ |
|
private |
The documentation for this class was generated from the following file: