#include "quiche/quic/core/quic_stream_sequencer_buffer.h"
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <list>
#include <map>
#include <memory>
#include <string>
#include <utility>
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "quiche/quic/platform/api/quic_logging.h"
#include "quiche/quic/platform/api/quic_test.h"
#include "quiche/quic/test_tools/quic_stream_sequencer_buffer_peer.h"
#include "quiche/quic/test_tools/quic_test_utils.h"
namespace quic {
namespace test {
absl::string_view IovecToStringPiece(iovec iov) { … }
char GetCharFromIOVecs(size_t offset, iovec iov[], size_t count) { … }
const size_t kMaxNumGapsAllowed = …;
static const size_t kBlockSizeBytes = …;
BufferBlock;
namespace {
class QuicStreamSequencerBufferTest : public QuicTest { … };
TEST_F(QuicStreamSequencerBufferTest, InitializeWithMaxRecvWindowSize) { … }
TEST_F(QuicStreamSequencerBufferTest, InitializationWithDifferentSizes) { … }
TEST_F(QuicStreamSequencerBufferTest, ClearOnEmpty) { … }
TEST_F(QuicStreamSequencerBufferTest, OnStreamData0length) { … }
TEST_F(QuicStreamSequencerBufferTest, OnStreamDataWithinBlock) { … }
TEST_F(QuicStreamSequencerBufferTest, Move) { … }
TEST_F(QuicStreamSequencerBufferTest, DISABLED_OnStreamDataInvalidSource) { … }
TEST_F(QuicStreamSequencerBufferTest, OnStreamDataWithOverlap) { … }
TEST_F(QuicStreamSequencerBufferTest,
OnStreamDataOverlapAndDuplicateCornerCases) { … }
TEST_F(QuicStreamSequencerBufferTest, OnStreamDataWithoutOverlap) { … }
TEST_F(QuicStreamSequencerBufferTest, OnStreamDataInLongStreamWithOverlap) { … }
TEST_F(QuicStreamSequencerBufferTest, OnStreamDataTillEnd) { … }
TEST_F(QuicStreamSequencerBufferTest, OnStreamDataTillEndCorner) { … }
TEST_F(QuicStreamSequencerBufferTest, OnStreamDataBeyondCapacity) { … }
TEST_F(QuicStreamSequencerBufferTest, Readv100Bytes) { … }
TEST_F(QuicStreamSequencerBufferTest, ReadvAcrossBlocks) { … }
TEST_F(QuicStreamSequencerBufferTest, ClearAfterRead) { … }
TEST_F(QuicStreamSequencerBufferTest,
OnStreamDataAcrossLastBlockAndFillCapacity) { … }
TEST_F(QuicStreamSequencerBufferTest,
OnStreamDataAcrossLastBlockAndExceedCapacity) { … }
TEST_F(QuicStreamSequencerBufferTest, ReadvAcrossLastBlock) { … }
TEST_F(QuicStreamSequencerBufferTest, ReadvEmpty) { … }
TEST_F(QuicStreamSequencerBufferTest, GetReadableRegionsEmpty) { … }
TEST_F(QuicStreamSequencerBufferTest, ReleaseWholeBuffer) { … }
TEST_F(QuicStreamSequencerBufferTest, GetReadableRegionsBlockedByGap) { … }
TEST_F(QuicStreamSequencerBufferTest, GetReadableRegionsTillEndOfBlock) { … }
TEST_F(QuicStreamSequencerBufferTest, GetReadableRegionsWithinOneBlock) { … }
TEST_F(QuicStreamSequencerBufferTest,
GetReadableRegionsAcrossBlockWithLongIOV) { … }
TEST_F(QuicStreamSequencerBufferTest,
GetReadableRegionsWithMultipleIOVsAcrossEnd) { … }
TEST_F(QuicStreamSequencerBufferTest, GetReadableRegionEmpty) { … }
TEST_F(QuicStreamSequencerBufferTest, GetReadableRegionBeforeGap) { … }
TEST_F(QuicStreamSequencerBufferTest, GetReadableRegionTillEndOfBlock) { … }
TEST_F(QuicStreamSequencerBufferTest, GetReadableRegionTillGap) { … }
TEST_F(QuicStreamSequencerBufferTest, PeekEmptyBuffer) { … }
TEST_F(QuicStreamSequencerBufferTest, PeekSingleBlock) { … }
TEST_F(QuicStreamSequencerBufferTest, PeekTwoWritesInSingleBlock) { … }
TEST_F(QuicStreamSequencerBufferTest, PeekBufferWithMultipleBlocks) { … }
TEST_F(QuicStreamSequencerBufferTest, PeekAfterConsumed) { … }
TEST_F(QuicStreamSequencerBufferTest, PeekContinously) { … }
TEST_F(QuicStreamSequencerBufferTest, PeekRegionWithBufferWrapsAround) { … }
TEST_F(QuicStreamSequencerBufferTest, MarkConsumedInOneBlock) { … }
TEST_F(QuicStreamSequencerBufferTest, MarkConsumedNotEnoughBytes) { … }
TEST_F(QuicStreamSequencerBufferTest, MarkConsumedAcrossBlock) { … }
TEST_F(QuicStreamSequencerBufferTest, MarkConsumedAcrossEnd) { … }
TEST_F(QuicStreamSequencerBufferTest, FlushBufferedFrames) { … }
TEST_F(QuicStreamSequencerBufferTest, TooManyGaps) { … }
class QuicStreamSequencerBufferRandomIOTest
: public QuicStreamSequencerBufferTest { … };
TEST_F(QuicStreamSequencerBufferRandomIOTest, RandomWriteAndReadv) { … }
TEST_F(QuicStreamSequencerBufferRandomIOTest, RandomWriteAndConsumeInPlace) { … }
TEST_F(QuicStreamSequencerBufferTest, GrowBlockSizeOnDemand) { … }
}
}
}