// Copyright (c) 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "quiche/quic/core/quic_interval_deque.h" #include <cstdint> #include <ostream> #include "quiche/quic/core/quic_interval.h" #include "quiche/quic/platform/api/quic_expect_bug.h" #include "quiche/quic/platform/api/quic_test.h" #include "quiche/quic/test_tools/quic_interval_deque_peer.h" #include "quiche/quic/test_tools/quic_test_utils.h" namespace quic { namespace test { namespace { const int32_t kSize = …; const std::size_t kIntervalStep = …; } // namespace struct TestIntervalItem { … }; QID; class QuicIntervalDequeTest : public QuicTest { … }; // The goal of this test is to show insertion/push_back, iteration, and and // deletion/pop_front from the container. TEST_F(QuicIntervalDequeTest, InsertRemoveSize) { … } // The goal of this test is to push data into the container at specific // intervals and show how the |DataAt| method can move the |cached_index| as the // iterator moves through the data. TEST_F(QuicIntervalDequeTest, InsertIterateWhole) { … } // The goal of this test is to push data into the container at specific // intervals and show how the |DataAt| method can move the |cached_index| using // the off-by-one logic. TEST_F(QuicIntervalDequeTest, OffByOne) { … } // The goal of this test is to push data into the container at specific // intervals and show modify the structure with a live iterator. TEST_F(QuicIntervalDequeTest, IteratorInvalidation) { … } // The goal of this test is the same as |InsertIterateWhole| but to // skip certain intervals and show the |cached_index| is updated properly. TEST_F(QuicIntervalDequeTest, InsertIterateSkip) { … } // The goal of this test is the same as |InsertIterateWhole| but it has // |PopFront| calls interleaved to show the |cached_index| updates correctly. TEST_F(QuicIntervalDequeTest, InsertDeleteIterate) { … } // The goal of this test is to move the index to the end and then add more data // to show it can be reset to a valid index. TEST_F(QuicIntervalDequeTest, InsertIterateInsert) { … } // The goal of this test is to push data into the container at specific // intervals and show how the |DataAt| can iterate over already scanned data. TEST_F(QuicIntervalDequeTest, RescanData) { … } // The goal of this test is to show that popping from an empty container is a // bug. TEST_F(QuicIntervalDequeTest, PopEmpty) { … } // The goal of this test is to show that adding a zero-sized interval is a bug. TEST_F(QuicIntervalDequeTest, ZeroSizedInterval) { … } // The goal of this test is to show that an iterator to an empty container // returns |DataEnd|. TEST_F(QuicIntervalDequeTest, IteratorEmpty) { … } // Test various iterator methods. TEST_F(QuicIntervalDequeTest, IteratorMethods) { … } } // namespace test } // namespace quic