63 #ifndef GOOGLETEST_GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_NICE_STRICT_H_
64 #define GOOGLETEST_GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_NICE_STRICT_H_
66 #include <type_traits>
68 #include "gmock/gmock-spec-builders.h"
69 #include "gmock/internal/gmock-port.h"
72 template <
class MockClass>
74 template <
class MockClass>
76 template <
class MockClass>
100 #if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MINGW && \
101 (defined(_MSC_VER) || defined(__clang__))
104 #define GTEST_INTERNAL_EMPTY_BASE_CLASS __declspec(empty_bases)
106 #define GTEST_INTERNAL_EMPTY_BASE_CLASS
109 template <
typename Base>
117 template <
typename Base>
125 template <
typename Base>
135 template <
class MockClass>
137 :
private internal::NiceMockImpl<MockClass>,
141 !internal::HasStrictnessModifier<MockClass>(),
142 "Can't apply NiceMock to a class hierarchy that already has a "
143 "strictness modifier. See "
144 "https://github.com/google/googletest/blob/master/googlemock/docs/"
145 "cook_book.md#the-nice-the-strict-and-the-naggy-nicestrictnaggy");
147 static_assert(
sizeof(*
this) ==
sizeof(MockClass),
148 "The impl subclass shouldn't introduce any padding");
158 template <
typename A>
159 explicit NiceMock(A&& arg) : MockClass(std::forward<A>(arg)) {
160 static_assert(
sizeof(*
this) ==
sizeof(MockClass),
161 "The impl subclass shouldn't introduce any padding");
164 template <
typename TArg1,
typename TArg2,
typename... An>
166 : MockClass(std::forward<TArg1>(arg1), std::forward<TArg2>(arg2),
167 std::forward<An>(args)...) {
168 static_assert(
sizeof(*
this) ==
sizeof(MockClass),
169 "The impl subclass shouldn't introduce any padding");
176 template <
class MockClass>
178 :
private internal::NaggyMockImpl<MockClass>,
181 !internal::HasStrictnessModifier<MockClass>(),
182 "Can't apply NaggyMock to a class hierarchy that already has a "
183 "strictness modifier. See "
184 "https://github.com/google/googletest/blob/master/googlemock/docs/"
185 "cook_book.md#the-nice-the-strict-and-the-naggy-nicestrictnaggy");
189 static_assert(
sizeof(*
this) ==
sizeof(MockClass),
190 "The impl subclass shouldn't introduce any padding");
200 template <
typename A>
201 explicit NaggyMock(A&& arg) : MockClass(std::forward<A>(arg)) {
202 static_assert(
sizeof(*
this) ==
sizeof(MockClass),
203 "The impl subclass shouldn't introduce any padding");
206 template <
typename TArg1,
typename TArg2,
typename... An>
208 : MockClass(std::forward<TArg1>(arg1), std::forward<TArg2>(arg2),
209 std::forward<An>(args)...) {
210 static_assert(
sizeof(*
this) ==
sizeof(MockClass),
211 "The impl subclass shouldn't introduce any padding");
218 template <
class MockClass>
220 :
private internal::StrictMockImpl<MockClass>,
224 !internal::HasStrictnessModifier<MockClass>(),
225 "Can't apply StrictMock to a class hierarchy that already has a "
226 "strictness modifier. See "
227 "https://github.com/google/googletest/blob/master/googlemock/docs/"
228 "cook_book.md#the-nice-the-strict-and-the-naggy-nicestrictnaggy");
230 static_assert(
sizeof(*
this) ==
sizeof(MockClass),
231 "The impl subclass shouldn't introduce any padding");
241 template <
typename A>
242 explicit StrictMock(A&& arg) : MockClass(std::forward<A>(arg)) {
243 static_assert(
sizeof(*
this) ==
sizeof(MockClass),
244 "The impl subclass shouldn't introduce any padding");
247 template <
typename TArg1,
typename TArg2,
typename... An>
249 : MockClass(std::forward<TArg1>(arg1), std::forward<TArg2>(arg2),
250 std::forward<An>(args)...) {
251 static_assert(
sizeof(*
this) ==
sizeof(MockClass),
252 "The impl subclass shouldn't introduce any padding");
259 #undef GTEST_INTERNAL_EMPTY_BASE_CLASS
Definition: cmake-build-release/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:179
NaggyMock(TArg1 &&arg1, TArg2 &&arg2, An &&... args)
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:207
NaggyMock(A &&arg)
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:201
NaggyMock()
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:188
Definition: cmake-build-release/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:138
NiceMock()
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:146
NiceMock(A &&arg)
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:159
NiceMock(TArg1 &&arg1, TArg2 &&arg2, An &&... args)
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:165
Definition: cmake-build-release/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:221
StrictMock(A &&arg)
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:242
StrictMock(TArg1 &&arg1, TArg2 &&arg2, An &&... args)
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:248
StrictMock()
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:229
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:118
NaggyMockImpl()
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:120
~NaggyMockImpl()
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:122
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:110
NiceMockImpl()
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:112
~NiceMockImpl()
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:114
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:126
~StrictMockImpl()
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:130
StrictMockImpl()
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:128
#define GTEST_INTERNAL_EMPTY_BASE_CLASS
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:106
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
Definition: cmake-build-debug/googletest-src/googletest/include/gtest/internal/gtest-port.h:693
std::true_type StrictnessModifierProbe(const NiceMock< T > &)
constexpr bool HasStrictnessModifier()
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-nice-strict.h:89
Definition: cmake-build-debug/googletest-src/googlemock/include/gmock/gmock-actions.h:154