63#ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_NICE_STRICT_H_
64#define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_NICE_STRICT_H_
73template <
class MockClass>
75template <
class MockClass>
77template <
class MockClass>
101#if defined(GTEST_OS_WINDOWS) && !defined(GTEST_OS_WINDOWS_MINGW) && \
102 (defined(_MSC_VER) || defined(__clang__))
105#define GTEST_INTERNAL_EMPTY_BASE_CLASS __declspec(empty_bases)
107#define GTEST_INTERNAL_EMPTY_BASE_CLASS
110template <
typename Base>
114 ::testing::Mock::AllowUninterestingCalls(
reinterpret_cast<uintptr_t
>(
this));
118 ::testing::Mock::UnregisterCallReaction(
reinterpret_cast<uintptr_t
>(
this));
122template <
typename Base>
126 ::testing::Mock::WarnUninterestingCalls(
reinterpret_cast<uintptr_t
>(
this));
130 ::testing::Mock::UnregisterCallReaction(
reinterpret_cast<uintptr_t
>(
this));
134template <
typename Base>
138 ::testing::Mock::FailUninterestingCalls(
reinterpret_cast<uintptr_t
>(
this));
142 ::testing::Mock::UnregisterCallReaction(
reinterpret_cast<uintptr_t
>(
this));
148template <
class MockClass>
153 static_assert(!internal::HasStrictnessModifier<MockClass>(),
154 "Can't apply NiceMock to a class hierarchy that already has a "
155 "strictness modifier. See "
156 "https://google.github.io/googletest/"
157 "gmock_cook_book.html#NiceStrictNaggy");
159 static_assert(
sizeof(*this) ==
sizeof(MockClass),
160 "The impl subclass shouldn't introduce any padding");
170 template <
typename A>
172 static_assert(
sizeof(*this) ==
sizeof(MockClass),
173 "The impl subclass shouldn't introduce any padding");
176 template <
typename TArg1,
typename TArg2,
typename... An>
178 : MockClass(
std::forward<TArg1>(arg1),
std::forward<TArg2>(arg2),
179 std::forward<An>(args)...) {
180 static_assert(
sizeof(*this) ==
sizeof(MockClass),
181 "The impl subclass shouldn't introduce any padding");
189template <
class MockClass>
193 static_assert(!internal::HasStrictnessModifier<MockClass>(),
194 "Can't apply NaggyMock to a class hierarchy that already has a "
195 "strictness modifier. See "
196 "https://google.github.io/googletest/"
197 "gmock_cook_book.html#NiceStrictNaggy");
201 static_assert(
sizeof(*this) ==
sizeof(MockClass),
202 "The impl subclass shouldn't introduce any padding");
212 template <
typename A>
214 static_assert(
sizeof(*this) ==
sizeof(MockClass),
215 "The impl subclass shouldn't introduce any padding");
218 template <
typename TArg1,
typename TArg2,
typename... An>
220 : MockClass(
std::forward<TArg1>(arg1),
std::forward<TArg2>(arg2),
221 std::forward<An>(args)...) {
222 static_assert(
sizeof(*this) ==
sizeof(MockClass),
223 "The impl subclass shouldn't introduce any padding");
231template <
class MockClass>
237 !internal::HasStrictnessModifier<MockClass>(),
238 "Can't apply StrictMock to a class hierarchy that already has a "
239 "strictness modifier. See "
240 "https://google.github.io/googletest/"
241 "gmock_cook_book.html#NiceStrictNaggy");
243 static_assert(
sizeof(*this) ==
sizeof(MockClass),
244 "The impl subclass shouldn't introduce any padding");
254 template <
typename A>
256 static_assert(
sizeof(*this) ==
sizeof(MockClass),
257 "The impl subclass shouldn't introduce any padding");
260 template <
typename TArg1,
typename TArg2,
typename... An>
262 : MockClass(
std::forward<TArg1>(arg1),
std::forward<TArg2>(arg2),
263 std::forward<An>(args)...) {
264 static_assert(
sizeof(*this) ==
sizeof(MockClass),
265 "The impl subclass shouldn't introduce any padding");
273#undef GTEST_INTERNAL_EMPTY_BASE_CLASS
Definition gmock-nice-strict.h:192
NaggyMock(TArg1 &&arg1, TArg2 &&arg2, An &&... args)
Definition gmock-nice-strict.h:219
NaggyMock(A &&arg)
Definition gmock-nice-strict.h:213
NaggyMock()
Definition gmock-nice-strict.h:200
Definition gmock-nice-strict.h:151
NiceMock()
Definition gmock-nice-strict.h:158
NiceMock(A &&arg)
Definition gmock-nice-strict.h:171
NiceMock(TArg1 &&arg1, TArg2 &&arg2, An &&... args)
Definition gmock-nice-strict.h:177
Definition gmock-nice-strict.h:234
StrictMock(A &&arg)
Definition gmock-nice-strict.h:255
StrictMock(TArg1 &&arg1, TArg2 &&arg2, An &&... args)
Definition gmock-nice-strict.h:261
StrictMock()
Definition gmock-nice-strict.h:242
Definition gmock-nice-strict.h:123
NaggyMockImpl()
Definition gmock-nice-strict.h:125
~NaggyMockImpl()
Definition gmock-nice-strict.h:129
Definition gmock-nice-strict.h:111
NiceMockImpl()
Definition gmock-nice-strict.h:113
~NiceMockImpl()
Definition gmock-nice-strict.h:117
Definition gmock-nice-strict.h:135
~StrictMockImpl()
Definition gmock-nice-strict.h:141
StrictMockImpl()
Definition gmock-nice-strict.h:137
int value
Definition gmock-actions_test.cc:1714
#define GTEST_INTERNAL_EMPTY_BASE_CLASS
Definition gmock-nice-strict.h:107
std::true_type StrictnessModifierProbe(const NiceMock< T > &)
constexpr bool HasStrictnessModifier()
Definition gmock-nice-strict.h:90
Definition gmock-actions.h:151