chromium/third_party/abseil-cpp/absl/memory/memory_test.cc

// Copyright 2017 The Abseil Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Tests for pointer utilities.

#include "absl/memory/memory.h"

#include <sys/types.h>

#include <cstddef>
#include <memory>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>

#include "gmock/gmock.h"
#include "gtest/gtest.h"

namespace {

ElementsAre;
Return;

// This class creates observable behavior to verify that a destructor has
// been called, via the instance_count variable.
class DestructorVerifier {};

int DestructorVerifier::instance_count_ =;

TEST(WrapUniqueTest, WrapUnique) {}

// InitializationVerifier fills in a pattern when allocated so we can
// distinguish between its default and value initialized states (without
// accessing truly uninitialized memory).
struct InitializationVerifier {};

struct ArrayWatch {};

TEST(RawPtrTest, RawPointer) {}

TEST(RawPtrTest, SmartPointer) {}

class IntPointerNonConstDeref {};

TEST(RawPtrTest, SmartPointerNonConstDereference) {}

TEST(RawPtrTest, NullValuedRawPointer) {}

TEST(RawPtrTest, NullValuedSmartPointer) {}

TEST(RawPtrTest, Nullptr) {}

TEST(RawPtrTest, Null) {}

TEST(RawPtrTest, Zero) {}

TEST(ShareUniquePtrTest, Share) {}

TEST(ShareUniquePtrTest, ShareNull) {}

TEST(WeakenPtrTest, Weak) {}

// Should not compile.
/*
TEST(RawPtrTest, NotAPointer) {
  absl::RawPtr(1.5);
}
*/

TEST(AllocatorNoThrowTest, DefaultAllocator) {}

TEST(AllocatorNoThrowTest, StdAllocator) {}

TEST(AllocatorNoThrowTest, CustomAllocator) {}

}  // namespace