#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "cc/base/list_container.h"
#include <stddef.h>
#include <algorithm>
#include <vector>
#include "base/memory/raw_ptr.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cc {
namespace {
class DerivedElement { … };
class DerivedElement1 : public DerivedElement { … };
class DerivedElement2 : public DerivedElement { … };
class DerivedElement3 : public DerivedElement { … };
const size_t kLargestDerivedElementSize = …;
const size_t kLargestDerivedElementAlign = …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
class NonDerivedElement { … };
bool isConstNonDerivedElementPointer(const NonDerivedElement* ptr) { … }
bool isConstNonDerivedElementPointer(NonDerivedElement* ptr) { … }
const int kMagicNumberToUseForSimpleDerivedElementOne = …;
const int kMagicNumberToUseForSimpleDerivedElementTwo = …;
const int kMagicNumberToUseForSimpleDerivedElementThree = …;
class SimpleDerivedElement : public DerivedElement { … };
class SimpleDerivedElementConstructMagicNumberOne
: public SimpleDerivedElement { … };
class SimpleDerivedElementConstructMagicNumberTwo
: public SimpleDerivedElement { … };
class SimpleDerivedElementConstructMagicNumberThree
: public SimpleDerivedElement { … };
class MockDerivedElement : public SimpleDerivedElementConstructMagicNumberOne { … };
class MockDerivedElementSubclass : public MockDerivedElement { … };
const size_t kCurrentLargestDerivedElementSize = …;
const size_t kCurrentLargestDerivedElementAlign = …;
TEST(ListContainerTest, ConstructorCalledInAllocateAndConstruct) { … }
TEST(ListContainerTest, DestructorCalled) { … }
TEST(ListContainerTest, DestructorCalledOnceWhenClear) { … }
TEST(ListContainerTest, ClearDoesNotMalloc) { … }
TEST(ListContainerTest, ReplaceExistingElement) { … }
TEST(ListContainerTest, DestructorCalledOnceWhenErase) { … }
TEST(ListContainerTest, SimpleIndexAccessNonDerivedElement) { … }
TEST(ListContainerTest, SimpleInsertionNonDerivedElement) { … }
TEST(ListContainerTest, SimpleInsertionAndClearNonDerivedElement) { … }
TEST(ListContainerTest, SimpleInsertionClearAndInsertAgainNonDerivedElement) { … }
TEST(ListContainerTest,
SimpleInsertionTriggerMoreThanOneAllocationNonDerivedElement) { … }
TEST(ListContainerTest,
CorrectAllocationSizeForMoreThanOneAllocationNonDerivedElement) { … }
TEST(ListContainerTest, SimpleIterationNonDerivedElement) { … }
TEST(ListContainerTest, SimpleConstIteratorIterationNonDerivedElement) { … }
TEST(ListContainerTest, SimpleReverseInsertionNonDerivedElement) { … }
TEST(ListContainerTest, SimpleDeletion) { … }
TEST(ListContainerTest, DeletionAllInAllocation) { … }
TEST(ListContainerTest, DeletionAllInAllocationReversed) { … }
TEST(ListContainerTest, DeletionWhileIterating) { … }
TEST(ListContainerTest, InsertCopyBeforeBegin) { … }
TEST(ListContainerTest, InsertCopyBeforeEnd) { … }
TEST(ListContainerTest, InsertCopyBeforeEmpty) { … }
TEST(ListContainerTest, InsertCopyBeforeMany) { … }
TEST(ListContainerTest, InsertBeforeBegin) { … }
TEST(ListContainerTest, InsertBeforeEnd) { … }
TEST(ListContainerTest, InsertBeforeEmpty) { … }
TEST(ListContainerTest, InsertBeforeMany) { … }
TEST(ListContainerTest, InsertAfterBegin) { … }
TEST(ListContainerTest, InsertAfterEnd) { … }
TEST(ListContainerTest, InsertAfterEmpty) { … }
TEST(ListContainerTest, InsertAfterMany) { … }
TEST(ListContainerTest, SimpleManipulationWithIndexSimpleDerivedElement) { … }
TEST(ListContainerTest,
SimpleManipulationWithIndexMoreThanOneAllocationSimpleDerivedElement) { … }
TEST(ListContainerTest,
SimpleIterationAndReverseIterationWithIndexNonDerivedElement) { … }
class InstanceCounter { … };
TEST(ListContainerTest, RemoveLastDestruction) { … }
template <typename It1, typename It2>
bool Equal(It1 it1, const It1& end1, It2 it2) { … }
TEST(ListContainerTest, RemoveLastIteration) { … }
TEST(ListContainerTest, Swap) { … }
TEST(ListContainerTest, GetCapacityInBytes) { … }
}
}