chromium/base/memory/safe_ref_unittest.cc

// Copyright 2021 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/memory/safe_ref.h"

#include <optional>
#include <utility>

#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/raw_ptr_exclusion.h"
#include "base/memory/weak_ptr.h"
#include "base/test/gtest_util.h"
#include "base/test/memory/dangling_ptr_instrumentation.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace base {
namespace {

struct ReallyBaseClass {};
struct BaseClass : ReallyBaseClass {};
struct OtherBaseClass {};

struct WithWeak final : BaseClass, OtherBaseClass {};

TEST(SafeRefTest, FromWeakPtrFactory) {}

TEST(SafeRefTest, Operators) {}

TEST(SafeRefTest, ThreeWayComparison) {}

TEST(SafeRefTest, CanCopyAndMove) {}

TEST(SafeRefTest, AssignCopyAndMove) {}

TEST(SafeRefDeathTest, ArrowOperatorCrashIfBadPointer) {}

TEST(SafeRefDeathTest, StarOperatorCrashIfBadPointer) {}

TEST(SafeRefTest, ConversionToBaseClassFromCopyConstruct) {}

TEST(SafeRefTest, ConversionToBaseClassFromMoveConstruct) {}

TEST(SafeRefTest, ConversionToBaseClassFromCopyAssign) {}

TEST(SafeRefTest, ConversionToBaseClassFromMoveAssign) {}

TEST(SafeRefTest, CanDerefConst) {}

TEST(SafeRefTest, InvalidAfterMoveConstruction) {}

TEST(SafeRefTest, InvalidAfterMoveAssignment) {}

TEST(SafeRefTest, InvalidAfterMoveConversionConstruction) {}

TEST(SafeRefTest, InvalidAfterMoveConversionAssignment) {}

TEST(SafeRefTest, Bind) {}

TEST(SafeRefTest, DanglingPointerDetector) {}

TEST(SafeRefTest, DanglingUntriaged) {}

}  // namespace
}  // namespace base