Googletest export

Merge CONTRIBUTORS, delete LICENSEs in googletest/ and googlemock/

PiperOrigin-RevId: 352558822
This commit is contained in:
Abseil Team
2021-01-19 09:57:06 -05:00
committed by CJ Johnson
parent d128fc8252
commit 14098f2015
23 changed files with 916 additions and 149 deletions

View File

@@ -33,4 +33,39 @@
#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_
#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_
#include <memory>
#include "gmock/internal/gmock-port.h"
#if GTEST_GOOGLE3_MODE_
#include "base/callback.h"
// Realistically this file should be included from gmock-matchers.h
#include "gmock/gmock-matchers.h"
namespace testing {
namespace internal {
// Specialization for permanent callbacks.
template <typename ArgType, typename ResType>
struct CallableTraits<ResultCallback1<ResType, ArgType>*> {
typedef ResType ResultType;
using StorageType = std::shared_ptr<ResultCallback1<ResType, ArgType>>;
typedef ResultCallback1<ResType, ArgType> Callback;
static void CheckIsValid(const StorageType& callback) {
GTEST_CHECK_(callback != nullptr)
<< "NULL callback is passed into ResultOf().";
callback->CheckIsRepeatable();
}
template <typename T>
static ResType Invoke(const StorageType& callback, T arg) {
return callback->Run(arg);
}
};
} // namespace internal
} // namespace testing
#endif // GTEST_GOOGLE3_MODE_
#endif // GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_