4 #include <hippomocks.h> 10 void AddComExpectations(HM_NS MockRepository &mocks, T *m)
12 mocks.OnCall(m, T::AddRef)
14 mocks.OnCall(m, T::Release)
16 mocks.OnCallOverload(m, (
long(__stdcall T::*)(
const _GUID &,
void **))&T::QueryInterface)
17 .With(__uuidof(T), Out((
void **)m))
20 mocks.OnCallOverload(m, (
long(__stdcall T::*)(
const IID &,
void **))&T::QueryInterface)
21 .With(__uuidof(IUnknown), Out((
void **)m))
26 template <
typename T1,
typename T2>
27 void ConnectComInterfaces(HM_NS MockRepository &mocks, T1 *m1, T2 *m2)
30 mocks.OnCallOverload(m1, (
long(__stdcall T1::*)(
const _GUID &,
void **))&T1::QueryInterface)
31 .With(__uuidof(T2), Out((
void **)m2))
34 mocks.OnCallOverload(m2, (
long(__stdcall T2::*)(
const _GUID &,
void **))&T2::QueryInterface)
35 .With(__uuidof(T1), Out((
void **)m1))
38 AddComExpectations(mocks, m1);
39 AddComExpectations(mocks, m2);