#include "absl/container/internal/layout.h"
#include <stddef.h>
#include <cstdint>
#include <cstring>
#include <initializer_list>
#include <memory>
#include <ostream>
#include <string>
#include <tuple>
#include <type_traits>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "absl/base/config.h"
#include "absl/log/check.h"
#include "absl/types/span.h"
#include "absl/utility/utility.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace container_internal {
namespace {
Span;
ElementsAre;
size_t Distance(const void* from, const void* to) { … }
template <class Expected, class Actual>
Expected Type(Actual val) { … }
struct alignas(8) Int128 { … };
struct alignas(8) Int64 { … };
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
static_assert …;
template <class Expected, class Actual>
void SameType() { … }
TEST(Layout, ElementType) { … }
TEST(Layout, ElementTypes) { … }
TEST(Layout, OffsetByIndex) { … }
TEST(Layout, OffsetByType) { … }
TEST(Layout, Offsets) { … }
TEST(Layout, StaticOffsets) { … }
TEST(Layout, AllocSize) { … }
TEST(Layout, StaticAllocSize) { … }
TEST(Layout, SizeByIndex) { … }
TEST(Layout, SizeByType) { … }
TEST(Layout, Sizes) { … }
TEST(Layout, StaticSize) { … }
TEST(Layout, PointerByIndex) { … }
TEST(Layout, PointerByType) { … }
TEST(Layout, MutablePointerByIndex) { … }
TEST(Layout, MutablePointerByType) { … }
TEST(Layout, Pointers) { … }
TEST(Layout, MutablePointers) { … }
TEST(Layout, StaticPointers) { … }
TEST(Layout, SliceByIndexSize) { … }
TEST(Layout, SliceByTypeSize) { … }
TEST(Layout, MutableSliceByIndexSize) { … }
TEST(Layout, MutableSliceByTypeSize) { … }
TEST(Layout, StaticSliceSize) { … }
TEST(Layout, SliceByIndexData) { … }
TEST(Layout, SliceByTypeData) { … }
TEST(Layout, MutableSliceByIndexData) { … }
TEST(Layout, MutableSliceByTypeData) { … }
TEST(Layout, StaticSliceData) { … }
MATCHER_P(IsSameSlice, slice, "") { … }
template <typename... M>
class TupleMatcher { … };
template <typename... M>
testing::PolymorphicMatcher<TupleMatcher<M...>> Tuple(M... matchers) { … }
TEST(Layout, Slices) { … }
TEST(Layout, MutableSlices) { … }
TEST(Layout, StaticSlices) { … }
TEST(Layout, UnalignedTypes) { … }
TEST(Layout, CustomAlignment) { … }
TEST(Layout, OverAligned) { … }
TEST(Layout, Alignment) { … }
TEST(Layout, StaticAlignment) { … }
TEST(Layout, ConstexprPartial) { … }
TEST(Layout, StaticConstexpr) { … }
struct Region { … };
void ExpectRegionPoisoned(const unsigned char* p, size_t n, bool poisoned) { … }
template <size_t N>
void ExpectPoisoned(const unsigned char (&buf)[N],
std::initializer_list<Region> reg) { … }
TEST(Layout, PoisonPadding) { … }
TEST(Layout, StaticPoisonPadding) { … }
TEST(Layout, DebugString) { … }
TEST(Layout, StaticDebugString) { … }
TEST(Layout, CharTypes) { … }
TEST(Layout, ConstElementType) { … }
namespace example {
class CompactString { … };
TEST(CompactString, Works) { … }
class StaticCompactString { … };
TEST(StaticCompactString, Works) { … }
}
}
}
ABSL_NAMESPACE_END
}