-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to call real function with CMOCK_MOCK_FUNCTIONn macros #17
Comments
@devesh25427 please take a look at section Specifying expectations. The botom line is:
If not mocked, the real function will be called. |
@hjagodzinski thanks for reply. I understood that real function is called when there is no mock class instance. Earlier I was able to call real function using Invoke(<mock_class_name>::real) because there was a static member in class pointing to real function. I can still see static real function pointer created by CMOCK_MOCK_FUNCTIONn macro but don't know how to call it. |
I see now what you're after. Unfortunately there is no support for calling a real function while specifying expectations. Internally C Mock keeps pointer to a real function and you could use that but it's far from being ideal. I will look into ways to expose a real function so it can be used in cases like yours. |
Thanks @hjagodzinski |
@devesh25427 in case you are still interested I have created pull request #22 which provides the means to call a real function when using the |
I am trying to use new style CMOCK_MOCK_FUNCTIONn macros and want to invoke real function in expectation. I am unable to figure out how to do that?
The text was updated successfully, but these errors were encountered: