chromium/base/containers/circular_deque_unittest.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/containers/circular_deque.h"

#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/test/copy_only_int.h"
#include "base/test/gtest_util.h"
#include "base/test/move_only_int.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

VectorBuffer;
ElementsAre;

namespace base {

namespace {

circular_deque<int> MakeSequence(size_t max) {}

// Cycles through the queue, popping items from the back and pushing items
// at the front to validate behavior across different configurations of the
// queue in relation to the underlying buffer. The tester closure is run for
// each cycle.
template <class QueueT, class Tester>
void CycleTest(circular_deque<QueueT>& queue, const Tester& tester) {}

class DestructorCounter {};

// This class implements the interface that scoped_refptr expects, but actually
// just counts the number of reference count changes that are attempted.
class RefCountChangeCounter {};

}  // namespace

TEST(CircularDeque, FillConstructor) {}

TEST(CircularDeque, IteratorConstructor) {}

TEST(CircularDeque, MoveConstructor) {}

TEST(CircularDeque, InitializerListConstructor) {}

TEST(CircularDeque, RangeConstructor) {}

TEST(CircularDeque, Destructor) {}

TEST(CircularDeque, EqualsCopy) {}

TEST(CircularDeque, EqualsMove) {}

// Tests that self-assignment is a no-op.
TEST(CircularDeque, EqualsSelf) {}

TEST(CircularDeque, EqualsInitializerList) {}

TEST(CircularDeque, AssignCountValue) {}

TEST(CircularDeque, AssignIterator) {}

TEST(CircularDeque, AssignInitializerList) {}

TEST(CircularDeque, AssignRange) {}

// Tests [] and .at().
TEST(CircularDeque, At) {}

// This also tests the copy constructor with lots of different types of
// input configurations.
TEST(CircularDeque, FrontBackPushPop) {}

TEST(CircularDeque, ReallocateWithSplitBuffer) {}

TEST(CircularDeque, Swap) {}

TEST(CircularDeque, Iteration) {}

TEST(CircularDeque, IteratorComparisons) {}

TEST(CircularDeque, IteratorIncDec) {}

TEST(CircularDeque, IteratorIntegerOps) {}

TEST(CircularDeque, IteratorArrayAccess) {}

TEST(CircularDeque, ReverseIterator) {}

TEST(CircularDeque, CapacityReserveShrink) {}

TEST(CircularDeque, CapacityAutoShrink) {}

TEST(CircularDeque, ClearAndEmpty) {}

TEST(CircularDeque, Resize) {}

// Tests destructor behavior of resize.
TEST(CircularDeque, ResizeDelete) {}

TEST(CircularDeque, InsertEraseSingle) {}

TEST(CircularDeque, InsertFill) {}

TEST(CircularDeque, InsertFromPointers) {}

TEST(CircularDeque, InsertEraseRange) {}

TEST(CircularDeque, EmplaceMoveOnly) {}

TEST(CircularDeque, EmplaceFrontBackReturnsReference) {}

// This test tries to dereference an iterator after mutating the container.
TEST(CircularDeque, UseIteratorAfterMutate) {}

// This test verifies that a scoped_refptr specifically is moved rather than
// copied when a circular_deque is resized. It would be extremely inefficient if
// it was copied in this case.
TEST(CircularDeque, DoesntChurnRefCount) {}

TEST(CircularDeque, EraseBoundaryConditions) {}

TEST(CircularDeque, InsertBoundaryConditions) {}

}  // namespace base