From 52de8996066ff8b3130aa53ae4ce1527254b930b Mon Sep 17 00:00:00 2001
From: Wan-Teh Chang <[EMAIL REDACTED]>
Date: Thu, 1 Aug 2024 06:02:22 -0700
Subject: [PATCH] Remove third_party/googletest/src/googlemock
No tests are using GoogleMock now, so it can be removed.
Change-Id: I8000f5fe428a4df828a53715772059088f28d803
---
test/test.cmake | 10 -
third_party/googletest/README.libaom | 6 -
.../googletest/src/googlemock/CMakeLists.txt | 218 -
.../googletest/src/googlemock/README.md | 40 -
.../src/googlemock/cmake/gmock.pc.in | 10 -
.../src/googlemock/cmake/gmock_main.pc.in | 10 -
.../googlemock/include/gmock/gmock-actions.h | 2298 -------
.../include/gmock/gmock-cardinalities.h | 159 -
.../include/gmock/gmock-function-mocker.h | 514 --
.../googlemock/include/gmock/gmock-matchers.h | 5610 -----------------
.../include/gmock/gmock-more-actions.h | 662 --
.../include/gmock/gmock-more-matchers.h | 91 -
.../include/gmock/gmock-nice-strict.h | 277 -
.../include/gmock/gmock-spec-builders.h | 2083 ------
.../src/googlemock/include/gmock/gmock.h | 96 -
.../include/gmock/internal/custom/README.md | 18 -
.../internal/custom/gmock-generated-actions.h | 7 -
.../gmock/internal/custom/gmock-matchers.h | 37 -
.../gmock/internal/custom/gmock-port.h | 40 -
.../gmock/internal/gmock-internal-utils.h | 476 --
.../include/gmock/internal/gmock-port.h | 139 -
.../include/gmock/internal/gmock-pp.h | 279 -
.../src/googlemock/src/gmock-all.cc | 46 -
.../src/googlemock/src/gmock-cardinalities.cc | 155 -
.../googlemock/src/gmock-internal-utils.cc | 250 -
.../src/googlemock/src/gmock-matchers.cc | 462 --
.../src/googlemock/src/gmock-spec-builders.cc | 781 ---
.../googletest/src/googlemock/src/gmock.cc | 223 -
.../src/googlemock/src/gmock_main.cc | 72 -
29 files changed, 15069 deletions(-)
delete mode 100644 third_party/googletest/src/googlemock/CMakeLists.txt
delete mode 100644 third_party/googletest/src/googlemock/README.md
delete mode 100644 third_party/googletest/src/googlemock/cmake/gmock.pc.in
delete mode 100644 third_party/googletest/src/googlemock/cmake/gmock_main.pc.in
delete mode 100644 third_party/googletest/src/googlemock/include/gmock/gmock-actions.h
delete mode 100644 third_party/googletest/src/googlemock/include/gmock/gmock-cardinalities.h
delete mode 100644 third_party/googletest/src/googlemock/include/gmock/gmock-function-mocker.h
delete mode 100644 third_party/googletest/src/googlemock/include/gmock/gmock-matchers.h
delete mode 100644 third_party/googletest/src/googlemock/include/gmock/gmock-more-actions.h
delete mode 100644 third_party/googletest/src/googlemock/include/gmock/gmock-more-matchers.h
delete mode 100644 third_party/googletest/src/googlemock/include/gmock/gmock-nice-strict.h
delete mode 100644 third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h
delete mode 100644 third_party/googletest/src/googlemock/include/gmock/gmock.h
delete mode 100644 third_party/googletest/src/googlemock/include/gmock/internal/custom/README.md
delete mode 100644 third_party/googletest/src/googlemock/include/gmock/internal/custom/gmock-generated-actions.h
delete mode 100644 third_party/googletest/src/googlemock/include/gmock/internal/custom/gmock-matchers.h
delete mode 100644 third_party/googletest/src/googlemock/include/gmock/internal/custom/gmock-port.h
delete mode 100644 third_party/googletest/src/googlemock/include/gmock/internal/gmock-internal-utils.h
delete mode 100644 third_party/googletest/src/googlemock/include/gmock/internal/gmock-port.h
delete mode 100644 third_party/googletest/src/googlemock/include/gmock/internal/gmock-pp.h
delete mode 100644 third_party/googletest/src/googlemock/src/gmock-all.cc
delete mode 100644 third_party/googletest/src/googlemock/src/gmock-cardinalities.cc
delete mode 100644 third_party/googletest/src/googlemock/src/gmock-internal-utils.cc
delete mode 100644 third_party/googletest/src/googlemock/src/gmock-matchers.cc
delete mode 100644 third_party/googletest/src/googlemock/src/gmock-spec-builders.cc
delete mode 100644 third_party/googletest/src/googlemock/src/gmock.cc
delete mode 100644 third_party/googletest/src/googlemock/src/gmock_main.cc
diff --git a/test/test.cmake b/test/test.cmake
index a3e0d6abec..f697db1c9c 100644
--- a/test/test.cmake
+++ b/test/test.cmake
@@ -419,16 +419,6 @@ if(ENABLE_TESTS)
target_compile_definitions(aom_gtest PUBLIC GTEST_HAS_PTHREAD=0)
endif()
endif()
-
- add_library(
- aom_gmock STATIC
- "${AOM_ROOT}/third_party/googletest/src/googlemock/src/gmock-all.cc")
- set_property(TARGET aom_gmock PROPERTY FOLDER ${AOM_IDE_TEST_FOLDER})
- target_include_directories(
- aom_gmock
- PUBLIC "${AOM_ROOT}/third_party/googletest/src/googlemock/include"
- PRIVATE "${AOM_ROOT}/third_party/googletest/src/googlemock")
- target_link_libraries(aom_gmock ${AOM_LIB_LINK_TYPE} aom_gtest)
endif()
# Setup testdata download targets, test build targets, and test run targets. The
diff --git a/third_party/googletest/README.libaom b/third_party/googletest/README.libaom
index 5e429d4dae..3b21c8efca 100644
--- a/third_party/googletest/README.libaom
+++ b/third_party/googletest/README.libaom
@@ -16,12 +16,6 @@ Local Modifications:
.clang-format
CMakeLists.txt
CONTRIBUTORS
- googlemock/
- cmake
- CMakeLists.txt
- include
- README.md
- src
googletest/
cmake
CMakeLists.txt
diff --git a/third_party/googletest/src/googlemock/CMakeLists.txt b/third_party/googletest/src/googlemock/CMakeLists.txt
deleted file mode 100644
index 5c1f0dafea..0000000000
--- a/third_party/googletest/src/googlemock/CMakeLists.txt
+++ /dev/null
@@ -1,218 +0,0 @@
-########################################################################
-# Note: CMake support is community-based. The maintainers do not use CMake
-# internally.
-#
-# CMake build script for Google Mock.
-#
-# To run the tests for Google Mock itself on Linux, use 'make test' or
-# ctest. You can select which tests to run using 'ctest -R regex'.
-# For more options, run 'ctest --help'.
-
-option(gmock_build_tests "Build all of Google Mock's own tests." OFF)
-
-# A directory to find Google Test sources.
-if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/gtest/CMakeLists.txt")
- set(gtest_dir gtest)
-else()
- set(gtest_dir ../googletest)
-endif()
-
-# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().
-include("${gtest_dir}/cmake/hermetic_build.cmake" OPTIONAL)
-
-if (COMMAND pre_project_set_up_hermetic_build)
- # Google Test also calls hermetic setup functions from add_subdirectory,
- # although its changes will not affect things at the current scope.
- pre_project_set_up_hermetic_build()
-endif()
-
-########################################################################
-#
-# Project-wide settings
-
-# Name of the project.
-#
-# CMake files in this project can refer to the root source directory
-# as ${gmock_SOURCE_DIR} and to the root binary directory as
-# ${gmock_BINARY_DIR}.
-# Language "C" is required for find_package(Threads).
-cmake_minimum_required(VERSION 3.5)
-cmake_policy(SET CMP0048 NEW)
-project(gmock VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
-
-if (COMMAND set_up_hermetic_build)
- set_up_hermetic_build()
-endif()
-
-# Instructs CMake to process Google Test's CMakeLists.txt and add its
-# targets to the current scope. We are placing Google Test's binary
-# directory in a subdirectory of our own as VC compilation may break
-# if they are the same (the default).
-add_subdirectory("${gtest_dir}" "${gmock_BINARY_DIR}/${gtest_dir}")
-
-
-# These commands only run if this is the main project
-if(CMAKE_PROJECT_NAME STREQUAL "gmock" OR CMAKE_PROJECT_NAME STREQUAL "googletest-distribution")
- # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
- # make it prominent in the GUI.
- option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
-else()
- mark_as_advanced(gmock_build_tests)
-endif()
-
-# Although Google Test's CMakeLists.txt calls this function, the
-# changes there don't affect the current scope. Therefore we have to
-# call it again here.
-config_compiler_and_linker() # from ${gtest_dir}/cmake/internal_utils.cmake
-
-# Adds Google Mock's and Google Test's header directories to the search path.
-set(gmock_build_include_dirs
- "${gmock_SOURCE_DIR}/include"
- "${gmock_SOURCE_DIR}"
- "${gtest_SOURCE_DIR}/include"
- # This directory is needed to build directly from Google Test sources.
- "${gtest_SOURCE_DIR}")
-include_directories(${gmock_build_include_dirs})
-
-########################################################################
-#
-# Defines the gmock & gmock_main libraries. User tests should link
-# with one of them.
-
-# Google Mock libraries. We build them using more strict warnings than what
-# are used for other targets, to ensure that Google Mock can be compiled by
-# a user aggressive about warnings.
-if (MSVC)
- cxx_library(gmock
- "${cxx_strict}"
- "${gtest_dir}/src/gtest-all.cc"
- src/gmock-all.cc)
-
- cxx_library(gmock_main
- "${cxx_strict}"
- "${gtest_dir}/src/gtest-all.cc"
- src/gmock-all.cc
- src/gmock_main.cc)
-else()
- cxx_library(gmock "${cxx_strict}" src/gmock-all.cc)
- target_link_libraries(gmock PUBLIC gtest)
- set_target_properties(gmock PROPERTIES VERSION ${GOOGLETEST_VERSION})
- cxx_library(gmock_main "${cxx_strict}" src/gmock_main.cc)
- target_link_libraries(gmock_main PUBLIC gmock)
- set_target_properties(gmock_main PROPERTIES VERSION ${GOOGLETEST_VERSION})
-endif()
-# If the CMake version supports it, attach header directory information
-# to the targets for when we are part of a parent build (ie being pulled
-# in via add_subdirectory() rather than being a standalone build).
-if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
- string(REPLACE ";" "$<SEMICOLON>" dirs "${gmock_build_include_dirs}")
- target_include_directories(gmock SYSTEM INTERFACE
- "$<BUILD_INTERFACE:${dirs}>"
- "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
- target_include_directories(gmock_main SYSTEM INTERFACE
- "$<BUILD_INTERFACE:${dirs}>"
- "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
-endif()
-
-########################################################################
-#
-# Install rules
-install_project(gmock gmock_main)
-
-########################################################################
-#
-# Google Mock's own tests.
-#
-# You can skip this section if you aren't interested in testing
-# Google Mock itself.
-#
-# The tests are not built by default. To build them, set the
-# gmock_build_tests option to ON. You can do it by running ccmake
-# or specifying the -Dgmock_build_tests=ON flag when running cmake.
-
-if (gmock_build_tests)
- # This must be set in the root directory for the tests to be run by
- # 'make test' or ctest.
- enable_testing()
-
- if (MINGW OR CYGWIN)
- if (CMAKE_VERSION VERSION_LESS "2.8.12")
- add_compile_options("-Wa,-mbig-obj")
- else()
- add_definitions("-Wa,-mbig-obj")
- endif()
- endif()
-
- ############################################################
- # C++ tests built with standard compiler flags.
-
- cxx_test(gmock-actions_test gmock_main)
- cxx_test(gmock-cardinalities_test gmock_main)
- cxx_test(gmock_ex_test gmock_main)
- cxx_test(gmock-function-mocker_test gmock_main)
- cxx_test(gmock-internal-utils_test gmock_main)
- cxx_test(gmock-matchers-arithmetic_test gmock_main)
- cxx_test(gmock-matchers-comparisons_test gmock_main)
- cxx_test(gmock-matchers-containers_test gmock_main)
- cxx_test(gmock-matchers-misc_test gmock_main)
- cxx_test(gmock-more-actions_test gmock_main)
- cxx_test(gmock-nice-strict_test gmock_main)
- cxx_test(gmock-port_test gmock_main)
- cxx_test(gmock-spec-builders_test gmock_main)
- cxx_test(gmock_link_test gmock_main test/gmock_link2_test.cc)
- cxx_test(gmock_test gmock_main)
-
- if (DEFINED GTEST_HAS_PTHREAD)
- cxx_test(gmock_stress_test gmock)
- endif()
-
- # gmock_all_test is commented to save time building and running tests.
- # Uncomment if necessary.
- # cxx_test(gmock_all_test gmock_main)
-
- ############################################################
- # C++ tests built with non-standard compiler flags.
-
- if (MSVC)
- cxx_library(gmock_main_no_exception "${cxx_no_exception}"
- "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc)
-
- cxx_library(gmock_main_no_rtti "${cxx_no_rtti}"
- "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc)
-
- else()
- cxx_library(gmock_main_no_exception "${cxx_no_exception}" src/gmock_main.cc)
- target_link_libraries(gmock_main_no_exception PUBLIC gmock)
-
- cxx_library(gmock_main_no_rtti "${cxx_no_rtti}" src/gmock_main.cc)
- target_link_libraries(gmock_main_no_rtti PUBLIC gmock)
- endif()
- cxx_test_with_flags(gmock-more-actions_no_exception_test "${cxx_no_exception}"
- gmock_main_no_exception test/gmock-more-actions_test.cc)
-
- cxx_test_with_flags(gmock_no_rtti_test "${cxx_no_rtti}"
- gmock_main_no_rtti test/gmock-spec-builders_test.cc)
-
- cxx_shared_library(shared_gmock_main "${cxx_default}"
- "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc)
-
- # Tests that a binary can be built with Google Mock as a shared library. On
- # some system configurations, it may not possible to run the binary without
- # knowing more details about the system configurations. We do not try to run
- # this binary. To get a more robust shared library coverage, configure with
- # -DBUILD_SHARED_LIBS=ON.
- cxx_executable_with_flags(shared_gmock_test_ "${cxx_default}"
- shared_gmock_main test/gmock-spec-builders_test.cc)
- set_target_properties(shared_gmock_test_
- PROPERTIES
- COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
-
- ############################################################
- # Python tests.
-
- cxx_executable(gmock_leak_test_ test gmock_main)
- py_test(gmock_leak_test)
-
- cxx_executable(gmock_output_test_ test gmock)
- py_test(gmock_output_test)
-endif()
diff --git a/third_party/googletest/src/googlemock/README.md b/third_party/googletest/src/googlemock/README.md
deleted file mode 100644
index 7da60655db..0000000000
--- a/third_party/googletest/src/googlemock/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-# Googletest Mocking (gMock) Framework
-
-### Overview
-
-Google's framework for writing and using C++ mock classes. It can help you
-derive better designs of your system and write better tests.
-
-It is inspired by:
-
-* [jMock](http://www.jmock.org/)
-* [EasyMock](http://www.easymock.org/)
-* [Hamcrest](http://code.google.com/p/hamcrest/)
-
-It is designed with C++'s specifics in mind.
-
-gMock:
-
-- Provides a declarative syntax for defining mocks.
-- Can define partial (hybrid) mocks, which are a cross of real and mock
- objects.
-- Handles functions of arbitrary types and overloaded functions.
-- Comes with a rich set of matchers for validating function arguments.
-- Uses an intuitive syntax for controlling the behavior of a mock.
-- Does automatic verification of expectations (no record-and-replay needed).
-- Allows arbitrary (partial) ordering constraints on function calls to be
- expressed.
-- Lets a user extend it by defining new matchers and actions.
-- Does not use exceptions.
-- Is easy to learn and use.
-
-Details and examples can be found here:
-
-* [gMock for Dummies](https://google.github.io/googletest/gmock_for_dummies.html)
-* [Legacy gMock FAQ](https://google.github.io/googletest/gmock_faq.html)
-* [gMock Cookbook](https://google.github.io/googletest/gmock_cook_book.html)
-* [gMock Cheat Sheet](https://google.github.io/googletest/gmock_cheat_sheet.html)
-
-GoogleMock is a part of
-[GoogleTest C++ testing framework](http://github.com/google/googletest/) and a
-subject to the same requirements.
diff --git a/third_party/googletest/src/googlemock/cmake/gmock.pc.in b/third_party/googletest/src/googlemock/cmake/gmock.pc.in
deleted file mode 100644
index 23c67b5c88..0000000000
--- a/third_party/googletest/src/googlemock/cmake/gmock.pc.in
+++ /dev/null
@@ -1,10 +0,0 @@
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
-
-Name: gmock
-Description: GoogleMock (without main() function)
-Version: @PROJECT_VERSION@
-URL: https://github.com/google/googletest
-Requires: gtest = @PROJECT_VERSION@
-Libs: -L${libdir} -lgmock @CMAKE_THREAD_LIBS_INIT@
-Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@
diff --git a/third_party/googletest/src/googlemock/cmake/gmock_main.pc.in b/third_party/googletest/src/googlemock/cmake/gmock_main.pc.in
deleted file mode 100644
index 66ffea7f44..0000000000
--- a/third_party/googletest/src/googlemock/cmake/gmock_main.pc.in
+++ /dev/null
@@ -1,10 +0,0 @@
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
-
-Name: gmock_main
-Description: GoogleMock (with main() function)
-Version: @PROJECT_VERSION@
-URL: https://github.com/google/googletest
-Requires: gmock = @PROJECT_VERSION@
-Libs: -L${libdir} -lgmock_main @CMAKE_THREAD_LIBS_INIT@
-Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@
diff --git a/third_party/googletest/src/googlemock/include/gmock/gmock-actions.h b/third_party/googletest/src/googlemock/include/gmock/gmock-actions.h
deleted file mode 100644
index c785ad8abb..0000000000
--- a/third_party/googletest/src/googlemock/include/gmock/gmock-actions.h
+++ /dev/null
@@ -1,2298 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// The ACTION* family of macros can be used in a namespace scope to
-// define custom actions easily. The syntax:
-//
-// ACTION(name) { statements; }
-//
-// will define an action with the given name that executes the
-// statements. The value returned by the statements will be used as
-// the return value of the action. Inside the statements, you can
-// refer to the K-th (0-based) argument of the mock function by
-// 'argK', and refer to its type by 'argK_type'. For example:
-//
-// ACTION(IncrementArg1) {
-// arg1_type temp = arg1;
-// return ++(*temp);
-// }
-//
-// allows you to write
-//
-// ...WillOnce(IncrementArg1());
-//
-// You can also refer to the entire argument tuple and its type by
-// 'args' and 'args_type', and refer to the mock function type and its
-// return type by 'function_type' and 'return_type'.
-//
-// Note that you don't need to specify the types of the mock function
-// arguments. However rest assured that your code is still type-safe:
-// you'll get a compiler error if *arg1 doesn't support the ++
-// operator, or if the type of ++(*arg1) isn't compatible with the
-// mock function's return type, for example.
-//
-// Sometimes you'll want to parameterize the action. For that you can use
-// another macro:
-//
-// ACTION_P(name, param_name) { statements; }
-//
-// For example:
-//
-// ACTION_P(Add, n) { return arg0 + n; }
-//
-// will allow you to write:
-//
-// ...WillOnce(Add(5));
-//
-// Note that you don't need to provide the type of the parameter
-// either. If you need to reference the type of a parameter named
-// 'foo', you can write 'foo_type'. For example, in the body of
-// ACTION_P(Add, n) above, you can write 'n_type' to refer to the type
-// of 'n'.
-//
-// We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P10 to support
-// multi-parameter actions.
-//
-// For the purpose of typing, you can view
-//
-// ACTION_Pk(Foo, p1, ..., pk) { ... }
-//
-// as shorthand for
-//
-// template <typename p1_type, ..., typename pk_type>
-// FooActionPk<p1_type, ..., pk_type> Foo(p1_type p1, ..., pk_type pk) { ... }
-//
-// In particular, you can provide the template type arguments
-// explicitly when invoking Foo(), as in Foo<long, bool>(5, false);
-// although usually you can rely on the compiler to infer the types
-// for you automatically. You can assign the result of expression
-// Foo(p1, ..., pk) to a variable of type FooActionPk<p1_type, ...,
-// pk_type>. This can be useful when composing actions.
-//
-// You can also overload actions with different numbers of parameters:
-//
-// ACTION_P(Plus, a) { ... }
-// ACTION_P2(Plus, a, b) { ... }
-//
-// While it's tempting to always use the ACTION* macros when defining
-// a new action, you should also consider implementing ActionInterface
-// or using MakePolymorphicAction() instead, especially if you need to
-// use the action a lot. While these approaches require more work,
-// they give you more control on the types of the mock function
-// arguments and the action parameters, which in general leads to
-// better compiler error messages that pay off in the long run. They
-// also allow overloading actions based on parameter types (as opposed
-// to just based on the number of parameters).
-//
-// CAVEAT:
-//
-// ACTION*() can only be used in a namespace scope as templates cannot be
-// declared inside of a local class.
-// Users can, however, define any local functors (e.g. a lambda) that
-// can be used as actions.
-//
-// MORE INFORMATION:
-//
-// To learn more about using these macros, please search for 'ACTION' on
-// https://github.com/google/googletest/blob/master/docs/gmock_cook_book.md
-
-// IWYU pragma: private, include "gmock/gmock.h"
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
-#define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
-
-#ifndef _WIN32_WCE
-#include <errno.h>
-#endif
-
-#include <algorithm>
-#include <functional>
-#include <memory>
-#include <string>
-#include <tuple>
-#include <type_traits>
-#include <utility>
-
-#include "gmock/internal/gmock-internal-utils.h"
-#include "gmock/internal/gmock-port.h"
-#include "gmock/internal/gmock-pp.h"
-
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable : 4100)
-#endif
-
-namespace testing {
-
-// To implement an action Foo, define:
-// 1. a class FooAction that implements the ActionInterface interface, and
-// 2. a factory function that creates an Action object from a
-// const FooAction*.
-//
-// The two-level delegation design follows that of Matcher, providing
-// consistency for extension developers. It also eases ownership
-// management as Action objects can now be copied like plain values.
-
-namespace internal {
-
-// BuiltInDefaultValueGetter<T, true>::Get() returns a
-// default-constructed T value. BuiltInDefaultValueGetter<T,
-// false>::Get() crashes with an error.
-//
-// This primary template is used when kDefaultConstructible is true.
-template <typename T, bool kDefaultConstructible>
-struct BuiltInDefaultValueGetter {
- static T Get() { return T(); }
-};
-template <typename T>
-struct BuiltInDefaultValueGetter<T, false> {
- static T Get() {
- Assert(false, __FILE__, __LINE__,
- "Default action undefined for the function return type.");
- return internal::Invalid<T>();
- // The above statement will never be reached, but is required in
- // order for this function to compile.
- }
-};
-
-// BuiltInDefaultValue<T>::Get() returns the "built-in" default value
-// for type T, which is NULL when T is a raw pointer type, 0 when T is
-// a numeric type, false when T is bool, or "" when T is string or
-// std::string. In addition, in C++11 and above, it turns a
-// default-constructed T value if T is default constructible. For any
-// other type T, the built-in default T value is undefined, and the
-// function will abort the process.
-template <typename T>
-class BuiltInDefaultValue {
- public:
- // This function returns true if and only if type T has a built-in default
- // value.
- static bool Exists() { return ::std::is_default_constructible<T>::value; }
-
- static T Get() {
- return BuiltInDefaultValueGetter<
- T, ::std::is_default_constructible<T>::value>::Get();
- }
-};
-
-// This partial specialization says that we use the same built-in
-// default value for T and const T.
-template <typename T>
-class BuiltInDefaultValue<const T> {
- public:
- static bool Exists() { return BuiltInDefaultValue<T>::Exists(); }
- static T Get() { return BuiltInDefaultValue<T>::Get(); }
-};
-
-// This partial specialization defines the default values for pointer
-// types.
-template <typename T>
-class BuiltInDefaultValue<T*> {
- public:
- static bool Exists() { return true; }
- static T* Get() { return nullptr; }
-};
-
-// The following specializations define the default values for
-// specific types we care about.
-#define GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(type, value) \
- template <> \
- class BuiltInDefaultValue<type> { \
- public: \
- static bool Exists() { return true; } \
- static type Get() { return value; } \
- }
-
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(void, ); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(::std::string, "");
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(bool, false);
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned char, '\0');
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed char, '\0');
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(char, '\0');
-
-// There's no need for a default action for signed wchar_t, as that
-// type is the same as wchar_t for gcc, and invalid for MSVC.
-//
-// There's also no need for a default action for unsigned wchar_t, as
-// that type is the same as unsigned int for gcc, and invalid for
-// MSVC.
-#if GMOCK_WCHAR_T_IS_NATIVE_
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(wchar_t, 0U); // NOLINT
-#endif
-
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned short, 0U); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed short, 0); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned int, 0U);
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed int, 0);
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned long, 0UL); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed long, 0L); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned long long, 0); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed long long, 0); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(float, 0);
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(double, 0);
-
-#undef GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_
-
-// Partial implementations of metaprogramming types from the standard library
-// not available in C++11.
-
-template <typename P>
-struct negation
- // NOLINTNEXTLINE
- : std::integral_constant<bool, bool(!P::value)> {};
-
-// Base case: with zero predicates the answer is always true.
-template <typename...>
-struct conjunction : std::true_type {};
-
-// With a single predicate, the answer is that predicate.
-template <typename P1>
-struct conjunction<P1> : P1 {};
-
-// With multiple predicates the answer is the first predicate if that is false,
-// and we recurse otherwise.
-template <typename P1, typename... Ps>
-struct conjunction<P1, Ps...>
- : std::conditional<bool(P1::value), conjunction<Ps...>, P1>::type {};
-
-template <typename...>
-struct disjunction : std::false_type {};
-
-template <typename P1>
-struct disjunction<P1> : P1 {};
-
-template <typename P1, typename... Ps>
-struct disjunction<P1, Ps...>
- // NOLINTNEXTLINE
- : std::conditional<!bool(P1::value), disjunction<Ps...>, P1>::type {};
-
-template <typename...>
-using void_t = void;
-
-// Detects whether an expression of type `From` can be implicitly converted to
-// `To` according to [conv]. In C++17, [conv]/3 defines this as follows:
-//
-// An expression e can be implicitly converted to a type T if and only if
-// the declaration T t=e; is well-formed, for some invented temporary
-// variable t ([dcl.init]).
-//
-// [conv]/2 implies we can use function argument passing to detect whether this
-// initialization is valid.
-//
-// Note that this is distinct from is_convertible, which requires this be valid:
-//
-// To test() {
-// return declval<From>();
-// }
-//
-// In particular, is_convertible doesn't give the correct answer when `To` and
-// `From` are the same non-moveable type since `declval<From>` will be an rvalue
-// reference, defeating the guaranteed copy elision that would otherwise make
-// this function work.
-//
-// REQUIRES: `From` is not cv void.
-template <typename From, typename To>
-struct is_implicitly_convertible {
- private:
- // A function that accepts a parameter of type T. This can be called with type
- // U successfully only if U is implicitly convertible to T.
- template <typename T>
- static void Accept(T);
-
- // A function that creates a value of type T.
- template <typename T>
- static T Make();
-
- // An overload be selected when implicit conversion from T to To is possible.
- template <typename T, typename = decltype(Accept<To>(Make<T>()))>
- static std::true_type TestImplicitConversion(int);
-
- // A fallback overload selected in all other cases.
- template <typename T>
- static std::false_type TestImplicitConversion(...);
-
- public:
- using type = decltype(TestImplicitConversion<From>(0));
- static constexpr bool value = type::value;
-};
-
-// Like std::invoke_result_t from C++17, but works only for objects with call
-// operators (not e.g. member function pointers, which we don't need specific
-// support for in OnceAction because std::function deals with them).
-template <typename F, typename... Args>
-using call_result_t = decltype(std::declval<F>()(std::declval<Args>()...));
-
-template <typename Void, typename R, typename F, typename... Args>
-struct is_callable_r_impl : std::false_t
(Patch may be truncated, please check the link at the top of this post.)