trompeloeil
trompeloeil copied to clipboard
Better diagnistics message for IMPLEMENT_MOCKN macros
IMPLEMENT_MOCK are great addition, especially when dealing with auto-generated heavily templated signatures like
::grpc::ClientAsyncResponseReaderInterface<::etcdserverpb::LeaseGrantResponse> * AsyncLeaseGrantRaw(::grpc::ClientContext * context, const ::etcdserverpb::LeaseGrantRequest & request, ::grpc::CompletionQueue * cq)
However wrapping into mock_interface destroys conversion of signature to string leading to obscure messages:
No match for call of create with signature decltype(::trompeloeil::nonconst_member_signature(&trompeloeil_interface_name::AsyncLeaseGrantRaw))::type with.
...
I think this can be improved by splitting adding signature text as an extra parameter to TROMPELOEIL_MAKE_MOCK_ and combining in runtime with method name (wither from typeid or wrapping trompeloeil::mock_interface<T> into a macro which stringizes T into a static member).
Or something similar.