proxygen
|
#include <folly/io/IOBuf.h>
#include <folly/Format.h>
#include <folly/Range.h>
#include <folly/io/Cursor.h>
#include <folly/portability/GTest.h>
#include <numeric>
#include <vector>
Go to the source code of this file.
Functions | |
TEST (IOBuf, RWCursor) | |
TEST (IOBuf, skip) | |
TEST (IOBuf, reset) | |
TEST (IOBuf, copy_assign_convert) | |
TEST (IOBuf, arithmetic) | |
TEST (IOBuf, endian) | |
TEST (IOBuf, Cursor) | |
TEST (IOBuf, UnshareCursor) | |
TEST (IOBuf, PullAndPeek) | |
TEST (IOBuf, pushCursorData) | |
TEST (IOBuf, Gather) | |
TEST (IOBuf, cloneAndInsert) | |
TEST (IOBuf, cloneWithEmptyBufAtStart) | |
TEST (IOBuf, Appender) | |
TEST (IOBuf, Printf) | |
TEST (IOBuf, Format) | |
TEST (IOBuf, QueueAppender) | |
TEST (IOBuf, QueueAppenderPushAtMostFillBuffer) | |
TEST (IOBuf, QueueAppenderInsertOwn) | |
TEST (IOBuf, QueueAppenderInsertClone) | |
TEST (IOBuf, CursorOperators) | |
TEST (IOBuf, StringOperations) | |
TEST (IOBuf, ReadWhileTrue) | |
TEST (IOBuf, TestAdvanceToEndSingle) | |
TEST (IOBuf, TestAdvanceToEndMulti) | |
TEST (IOBuf, TestRetreatSingle) | |
TEST (IOBuf, TestRetreatMulti) | |
TEST (IOBuf, TestRetreatOperators) | |
TEST (IOBuf, tryRead) | |
TEST (IOBuf, tryReadLE) | |
TEST (IOBuf, tryReadBE) | |
TEST (IOBuf, tryReadConsumesAllInputOnFailure) | |
TEST (IOBuf, readConsumesAllInputOnFailure) | |
TEST (IOBuf, pushEmptyByteRange) | |
TEST (IOBuf, positionTracking) | |
Definition at line 32 of file IOBufCursorTest.cpp.
References folly::IOBuf::append(), folly::IOBuf::create(), EXPECT_EQ, EXPECT_TRUE, folly::IOBuf::isChained(), folly::gen::move, folly::IOBuf::prependChain(), uint32_t, uint64_t, and uint8_t.
TEST | ( | IOBuf | , |
skip | |||
) |
Definition at line 61 of file IOBufCursorTest.cpp.
References folly::IOBuf::append(), folly::IOBuf::create(), EXPECT_EQ, folly::io::detail::CursorBase< Derived, BufType >::skip(), uint8_t, and folly::io::detail::Writable< Derived >::write().
TEST | ( | IOBuf | , |
reset | |||
) |
Definition at line 72 of file IOBufCursorTest.cpp.
References folly::IOBuf::append(), folly::IOBuf::create(), EXPECT_EQ, uint8_t, and folly::io::detail::Writable< Derived >::write().
TEST | ( | IOBuf | , |
copy_assign_convert | |||
) |
Definition at line 82 of file IOBufCursorTest.cpp.
References folly::IOBuf::append(), folly::IOBuf::create(), EXPECT_EQ, folly::io::detail::CursorBase< Derived, BufType >::read(), uint8_t, and folly::io::detail::Writable< Derived >::write().
TEST | ( | IOBuf | , |
arithmetic | |||
) |
Definition at line 101 of file IOBufCursorTest.cpp.
References folly::IOBuf::append(), folly::IOBuf::CREATE, EXPECT_EQ, EXPECT_NE, folly::io::detail::CursorBase< Derived, BufType >::read(), start, uint8_t, and folly::io::detail::Writable< Derived >::write().
TEST | ( | IOBuf | , |
endian | |||
) |
Definition at line 120 of file IOBufCursorTest.cpp.
References folly::IOBuf::append(), folly::IOBuf::create(), EXPECT_EQ, int16_t, and uint16_t.
Definition at line 137 of file IOBufCursorTest.cpp.
References ADD_FAILURE, folly::IOBuf::append(), c, folly::IOBuf::create(), and uint8_t.
TEST | ( | IOBuf | , |
UnshareCursor | |||
) |
Definition at line 149 of file IOBufCursorTest.cpp.
References append(), folly::IOBuf::append(), b, folly::data(), folly::Range< Iter >::data(), folly::empty(), EXPECT_EQ, EXPECT_LE, folly::io::detail::CursorBase< Derived, BufType >::peekBytes(), folly::io::detail::Writable< Derived >::push(), folly::Range< Iter >::size(), folly::io::detail::CursorBase< Derived, BufType >::skip(), string, folly::pushmi::detail::t, folly::IOBuf::tailroom(), fizz::toString(), uint8_t, folly::IOBuf::wrapBuffer(), folly::IOBuf::writableData(), and folly::io::detail::Writable< Derived >::write().
TEST | ( | IOBuf | , |
PullAndPeek | |||
) |
Definition at line 194 of file IOBufCursorTest.cpp.
References append(), b, folly::IOBuf::computeChainDataLength(), folly::IOBuf::countChainElements(), folly::IOBuf::create(), EXPECT_EQ, EXPECT_THROW, folly::io::RWCursor< access >::gather(), folly::gen::move, folly::IOBuf::prependChain(), and string.
TEST | ( | IOBuf | , |
pushCursorData | |||
) |
Definition at line 242 of file IOBufCursorTest.cpp.
References folly::IOBuf::append(), folly::IOBuf::create(), EXPECT_EQ, EXPECT_FALSE, EXPECT_THROW, EXPECT_TRUE, folly::IOBuf::isChained(), folly::gen::move, folly::IOBuf::prependChain(), folly::io::detail::Writable< Derived >::push(), folly::IOBuf::trimStart(), uint32_t, and uint64_t.
TEST | ( | IOBuf | , |
Gather | |||
) |
Definition at line 289 of file IOBufCursorTest.cpp.
References append(), folly::IOBuf::computeChainDataLength(), folly::IOBuf::countChainElements(), folly::IOBuf::create(), EXPECT_EQ, EXPECT_FALSE, EXPECT_THROW, folly::gen::move, and folly::IOBuf::prependChain().
TEST | ( | IOBuf | , |
cloneAndInsert | |||
) |
Definition at line 333 of file IOBufCursorTest.cpp.
References append(), folly::IOBuf::computeChainDataLength(), folly::IOBuf::countChainElements(), folly::IOBuf::create(), EXPECT_EQ, EXPECT_THROW, EXPECT_TRUE, folly::gen::move, folly::IOBuf::prependChain(), and uint8_t.
TEST | ( | IOBuf | , |
cloneWithEmptyBufAtStart | |||
) |
Definition at line 444 of file IOBufCursorTest.cpp.
References append(), folly::IOBuf::create(), folly::data(), folly::empty(), EXPECT_EQ, EXPECT_TRUE, and string.
Definition at line 485 of file IOBufCursorTest.cpp.
References append(), folly::IOBuf::capacity(), folly::IOBuf::create(), EXPECT_EQ, EXPECT_LE, and fizz::toString().
TEST | ( | IOBuf | , |
Printf | |||
) |
Definition at line 502 of file IOBufCursorTest.cpp.
References folly::IOBuf::CREATE, folly::IOBuf::data(), EXPECT_EQ, EXPECT_GE, folly::IOBuf::length(), folly::IOBuf::moveToFbString(), folly::IOBuf::prev(), folly::io::Appender::printf(), folly::IOBuf::tail(), folly::IOBuf::tailroom(), and folly::basic_fbstring< E, T, A, Storage >::toStdString().
TEST | ( | IOBuf | , |
Format | |||
) |
Definition at line 528 of file IOBufCursorTest.cpp.
References folly::IOBuf::CREATE, folly::IOBuf::data(), EXPECT_EQ, folly::format(), folly::IOBuf::length(), folly::IOBuf::moveToFbString(), and folly::basic_fbstring< E, T, A, Storage >::toStdString().
TEST | ( | IOBuf | , |
QueueAppender | |||
) |
Definition at line 551 of file IOBufCursorTest.cpp.
References folly::IOBuf::countChainElements(), EXPECT_EQ, EXPECT_LE, EXPECT_LT, EXPECT_THROW, folly::IOBufQueue::front(), i, uint32_t, and folly::io::detail::Writable< Derived >::writeBE().
TEST | ( | IOBuf | , |
QueueAppenderPushAtMostFillBuffer | |||
) |
Definition at line 577 of file IOBufCursorTest.cpp.
References folly::data(), EXPECT_EQ, EXPECT_LE, folly::IOBufQueue::front(), fizz::toString(), and uint8_t.
TEST | ( | IOBuf | , |
QueueAppenderInsertOwn | |||
) |
Definition at line 598 of file IOBufCursorTest.cpp.
References folly::IOBuf::countChainElements(), folly::IOBuf::create(), folly::data(), EXPECT_EQ, EXPECT_LE, folly::IOBufQueue::front(), folly::gen::move, folly::range(), folly::IOBuf::tailroom(), and fizz::toString().
TEST | ( | IOBuf | , |
QueueAppenderInsertClone | |||
) |
Definition at line 615 of file IOBufCursorTest.cpp.
References folly::IOBuf::countChainElements(), folly::IOBuf::CREATE, folly::IOBuf::data(), EXPECT_EQ, EXPECT_LT, folly::IOBufQueue::front(), folly::IOBuf::length(), folly::IOBuf::next(), folly::IOBuf::tailroom(), and uint8_t.
TEST | ( | IOBuf | , |
CursorOperators | |||
) |
Definition at line 630 of file IOBufCursorTest.cpp.
References folly::IOBuf::append(), folly::IOBuf::appendChain(), c, folly::IOBuf::clone(), folly::IOBuf::computeChainDataLength(), folly::IOBuf::create(), EXPECT_EQ, EXPECT_FALSE, EXPECT_THROW, EXPECT_TRUE, i, and folly::io::detail::CursorBase< Derived, BufType >::skip().
TEST | ( | IOBuf | , |
StringOperations | |||
) |
Definition at line 728 of file IOBufCursorTest.cpp.
References folly::IOBuf::append(), folly::IOBuf::create(), EXPECT_EQ, EXPECT_STREQ, EXPECT_THROW, folly::gen::move, folly::IOBuf::next(), folly::IOBuf::prependChain(), folly::io::detail::Writable< Derived >::push(), and uint8_t.
TEST | ( | IOBuf | , |
ReadWhileTrue | |||
) |
Definition at line 868 of file IOBufCursorTest.cpp.
References ch, folly::IOBuf::create(), EXPECT_STREQ, EXPECT_TRUE, folly::gen::move, folly::IOBuf::prependChain(), folly::io::detail::Writable< Derived >::push(), and uint8_t.
TEST | ( | IOBuf | , |
TestAdvanceToEndSingle | |||
) |
Definition at line 961 of file IOBufCursorTest.cpp.
References folly::io::detail::CursorBase< Derived, BufType >::advanceToEnd(), folly::IOBuf::append(), folly::IOBuf::create(), EXPECT_EQ, and EXPECT_TRUE.
TEST | ( | IOBuf | , |
TestAdvanceToEndMulti | |||
) |
Definition at line 971 of file IOBufCursorTest.cpp.
References folly::io::detail::CursorBase< Derived, BufType >::advanceToEnd(), folly::IOBuf::append(), folly::IOBuf::create(), EXPECT_EQ, EXPECT_TRUE, folly::gen::move, and folly::IOBuf::prependChain().
TEST | ( | IOBuf | , |
TestRetreatSingle | |||
) |
Definition at line 994 of file IOBufCursorTest.cpp.
References folly::IOBuf::append(), folly::IOBuf::create(), EXPECT_EQ, and EXPECT_THROW.
TEST | ( | IOBuf | , |
TestRetreatMulti | |||
) |
Definition at line 1029 of file IOBufCursorTest.cpp.
References folly::IOBuf::append(), folly::IOBuf::create(), EXPECT_EQ, EXPECT_THROW, folly::gen::move, and folly::IOBuf::prependChain().
TEST | ( | IOBuf | , |
TestRetreatOperators | |||
) |
Definition at line 1061 of file IOBufCursorTest.cpp.
References folly::io::detail::CursorBase< Derived, BufType >::advanceToEnd(), folly::IOBuf::append(), folly::IOBuf::create(), and EXPECT_EQ.
TEST | ( | IOBuf | , |
tryRead | |||
) |
Definition at line 1076 of file IOBufCursorTest.cpp.
References folly::IOBuf::append(), folly::IOBuf::create(), EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, folly::IOBuf::isChained(), folly::gen::move, folly::IOBuf::prependChain(), uint16_t, uint32_t, uint64_t, and val.
TEST | ( | IOBuf | , |
tryReadLE | |||
) |
Definition at line 1112 of file IOBufCursorTest.cpp.
References folly::IOBuf::CREATE, EXPECT_EQ, EXPECT_TRUE, folly::io::detail::CursorBase< Derived, BufType >::tryReadLE(), uint32_t, and folly::io::detail::Writable< Derived >::writeLE().
TEST | ( | IOBuf | , |
tryReadBE | |||
) |
Definition at line 1126 of file IOBufCursorTest.cpp.
References folly::IOBuf::CREATE, EXPECT_EQ, EXPECT_TRUE, folly::io::detail::CursorBase< Derived, BufType >::tryReadBE(), uint32_t, and folly::io::detail::Writable< Derived >::writeBE().
TEST | ( | IOBuf | , |
tryReadConsumesAllInputOnFailure | |||
) |
Definition at line 1140 of file IOBufCursorTest.cpp.
References folly::IOBuf::CREATE, EXPECT_EQ, EXPECT_FALSE, folly::io::detail::CursorBase< Derived, BufType >::totalLength(), folly::io::detail::CursorBase< Derived, BufType >::tryRead(), uint32_t, and val.
TEST | ( | IOBuf | , |
readConsumesAllInputOnFailure | |||
) |
Definition at line 1150 of file IOBufCursorTest.cpp.
References folly::IOBuf::CREATE, EXPECT_EQ, EXPECT_THROW, folly::io::detail::CursorBase< Derived, BufType >::read(), folly::io::detail::CursorBase< Derived, BufType >::totalLength(), and uint32_t.
TEST | ( | IOBuf | , |
pushEmptyByteRange | |||
) |
Definition at line 1159 of file IOBufCursorTest.cpp.
References folly::IOBuf::CREATE, EXPECT_EQ, and folly::io::detail::Writable< Derived >::push().
TEST | ( | IOBuf | , |
positionTracking | |||
) |
Definition at line 1177 of file IOBufCursorTest.cpp.
References folly::IOBuf::append(), folly::IOBuf::create(), EXPECT_EQ, folly::gen::move, and folly::IOBuf::prependChain().