diff options
Diffstat (limited to 'absl/random')
-rw-r--r-- | absl/random/internal/mock_helpers.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/absl/random/internal/mock_helpers.h b/absl/random/internal/mock_helpers.h index 9af27ab3..a412ff2f 100644 --- a/absl/random/internal/mock_helpers.h +++ b/absl/random/internal/mock_helpers.h @@ -80,6 +80,13 @@ class MockHelpers { } public: + // InvokeMock is private; this provides access for some specialized use cases. + template <typename URBG> + static inline bool PrivateInvokeMock(URBG* urbg, IdType type, + void* args_tuple, void* result) { + return urbg->InvokeMock(type, args_tuple, result); + } + // Invoke a mock for the KeyT (may or may not be a signature). // // KeyT is used to generate a typeid-based lookup key for the mock. @@ -109,11 +116,11 @@ class MockHelpers { // The mocked function signature will be composed from KeyT as: // result_type(args...) template <typename KeyT, typename MockURBG> - static auto MockFor(MockURBG& m) -> decltype( - std::declval<MockURBG>() - .template RegisterMock<typename KeySignature<KeyT>::result_type, - typename KeySignature<KeyT>::arg_tuple_type>( - std::declval<IdType>())) { + static auto MockFor(MockURBG& m) + -> decltype(m.template RegisterMock< + typename KeySignature<KeyT>::result_type, + typename KeySignature<KeyT>::arg_tuple_type>( + std::declval<IdType>())) { return m.template RegisterMock<typename KeySignature<KeyT>::result_type, typename KeySignature<KeyT>::arg_tuple_type>( ::absl::base_internal::FastTypeId<KeyT>()); |