chromium/third_party/abseil-cpp/absl/functional/function_ref_test.cc

// Copyright 2019 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.

#include "absl/functional/function_ref.h"

#include <functional>
#include <memory>

#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "absl/container/internal/test_instance_tracker.h"
#include "absl/functional/any_invocable.h"
#include "absl/memory/memory.h"

namespace absl {
ABSL_NAMESPACE_BEGIN
namespace {

void RunFun(FunctionRef<void()> f) {}

TEST(FunctionRefTest, Lambda) {}

int Function() {}

TEST(FunctionRefTest, Function1) {}

TEST(FunctionRefTest, Function2) {}

TEST(FunctionRefTest, ConstFunction) {}

int NoExceptFunction() noexcept {}

// TODO(jdennett): Add a test for noexcept member functions.
TEST(FunctionRefTest, NoExceptFunction) {}

TEST(FunctionRefTest, ForwardsArgs) {}

TEST(FunctionRef, ReturnMoveOnly) {}

TEST(FunctionRef, ManyArgs) {}

TEST(FunctionRef, VoidResultFromNonVoidFunctor) {}

TEST(FunctionRef, CastFromDerived) {}

TEST(FunctionRef, VoidResultFromNonVoidFuncton) {}

TEST(FunctionRef, MemberPtr) {}

TEST(FunctionRef, MemberFun) {}

TEST(FunctionRef, MemberFunRefqualified) {}

#if !defined(_WIN32) && defined(GTEST_HAS_DEATH_TEST)

TEST(FunctionRef, MemberFunRefqualifiedNull) {}

TEST(FunctionRef, NullMemberPtrAssertFails) {}

TEST(FunctionRef, NullStdFunctionAssertPasses) {}

TEST(FunctionRef, NullStdFunctionAssertFails) {}

TEST(FunctionRef, NullAnyInvocableAssertPasses) {}
TEST(FunctionRef, NullAnyInvocableAssertFails) {}

#endif  // GTEST_HAS_DEATH_TEST

TEST(FunctionRef, CopiesAndMovesPerPassByValue) {}

TEST(FunctionRef, CopiesAndMovesPerPassByRef) {}

TEST(FunctionRef, CopiesAndMovesPerPassByValueCallByMove) {}

TEST(FunctionRef, CopiesAndMovesPerPassByValueToRef) {}

TEST(FunctionRef, PassByValueTypes) {}

TEST(FunctionRef, ReferenceToIncompleteType) {}

}  // namespace
ABSL_NAMESPACE_END
}  // namespace absl