@@ -176,11 +176,39 @@ class vtable {
176
176
177
177
using CallReactionType = internal::CallReaction (*)(const void *);
178
178
template <CallReactionType Ptr>
179
- struct GetAccess {
179
+ struct GetAccessCallReactionType {
180
180
friend CallReactionType GetCallReaction () { return Ptr; }
181
181
};
182
182
CallReactionType GetCallReaction ();
183
- template struct GetAccess <&Mock::GetReactionOnUninterestingCalls>;
183
+ template struct GetAccessCallReactionType <
184
+ &Mock::GetReactionOnUninterestingCalls>;
185
+
186
+ using UnregisterCallReactionType = internal::CallReaction (*)(const void *);
187
+ template <UnregisterCallReactionType Ptr>
188
+ struct GetAccessUnregisterCallReactionType {
189
+ friend UnregisterCallReactionType UnregisterCallReaction () { return Ptr; }
190
+ };
191
+ UnregisterCallReactionType UnregisterCallReaction ();
192
+ template struct GetAccessUnregisterCallReactionType <
193
+ &Mock::GetReactionOnUninterestingCalls>;
194
+
195
+ using AllowUninterestingCallsType = void (*)(const void *);
196
+ template <AllowUninterestingCallsType Ptr>
197
+ struct GetAccessAllowUninterestingCallsType {
198
+ friend AllowUninterestingCallsType AllowUninterestingCalls () { return Ptr; }
199
+ };
200
+ AllowUninterestingCallsType AllowUninterestingCalls ();
201
+ template struct GetAccessAllowUninterestingCallsType <
202
+ &Mock::AllowUninterestingCalls>;
203
+
204
+ using FailUninterestingCallsType = void (*)(const void *);
205
+ template <FailUninterestingCallsType Ptr>
206
+ struct GetAccessFailUninterestingCallsType {
207
+ friend FailUninterestingCallsType FailUninterestingCalls () { return Ptr; }
208
+ };
209
+ FailUninterestingCallsType FailUninterestingCalls ();
210
+ template struct GetAccessFailUninterestingCallsType <
211
+ &Mock::FailUninterestingCalls>;
184
212
185
213
} // namespace detail
186
214
@@ -331,16 +359,18 @@ class NiceMock<GMock<T>> final : public GMock<T> {
331
359
public:
332
360
template <class ... Ts>
333
361
NiceMock (Ts &&... ts) : GMock<T>{std::forward<Ts>(ts)...} {
334
- Mock::AllowUninterestingCalls (internal::ImplicitCast_<GMock<T> *>(this ));
362
+ detail::AllowUninterestingCalls ()(
363
+ internal::ImplicitCast_<GMock<T> *>(this ));
335
364
}
336
365
337
366
NiceMock (NiceMock &&) = default ;
338
367
NiceMock (const NiceMock &) = delete ;
339
368
NiceMock () {
340
- Mock::AllowUninterestingCalls (internal::ImplicitCast_<GMock<T> *>(this ));
369
+ detail::AllowUninterestingCalls ()(
370
+ internal::ImplicitCast_<GMock<T> *>(this ));
341
371
}
342
372
~NiceMock () {
343
- Mock ::UnregisterCallReaction (internal::ImplicitCast_<GMock<T> *>(this ));
373
+ detail ::UnregisterCallReaction() (internal::ImplicitCast_<GMock<T> *>(this ));
344
374
}
345
375
};
346
376
@@ -349,15 +379,15 @@ class StrictMock<GMock<T>> final : public GMock<T> {
349
379
public:
350
380
template <class ... Ts>
351
381
StrictMock (Ts &&... ts) : GMock<T>{std::forward<Ts>(ts)...} {
352
- Mock ::FailUninterestingCalls (internal::ImplicitCast_<GMock<T> *>(this ));
382
+ detail ::FailUninterestingCalls() (internal::ImplicitCast_<GMock<T> *>(this ));
353
383
}
354
384
StrictMock (StrictMock &&) = default ;
355
385
StrictMock (const StrictMock &) = delete ;
356
386
StrictMock () {
357
- Mock ::FailUninterestingCalls (internal::ImplicitCast_<GMock<T> *>(this ));
387
+ detail ::FailUninterestingCalls() (internal::ImplicitCast_<GMock<T> *>(this ));
358
388
}
359
389
~StrictMock () {
360
- Mock ::UnregisterCallReaction (internal::ImplicitCast_<GMock<T> *>(this ));
390
+ detail ::UnregisterCallReaction() (internal::ImplicitCast_<GMock<T> *>(this ));
361
391
}
362
392
};
363
393
0 commit comments