Skip to content
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

Rethink type the way arguments of mock functions are handled #48

Open
c8y3 opened this issue Nov 27, 2020 · 1 comment
Open

Rethink type the way arguments of mock functions are handled #48

c8y3 opened this issue Nov 27, 2020 · 1 comment

Comments

@c8y3
Copy link
Collaborator

c8y3 commented Nov 27, 2020

Type mock_argument_t is generic. It is not appropriate to store va_list parameters.
When we store parameters, we have lost the type. We should do something earlier, maybe some macro magic.
There is a aum_parameter_type in aum/assert.h and also in aum/mock.h, they should be unified.
Maybe we need to store the type as a string and parse it ? Maybe we should convert the type into a structure with all the function pointers appropriate to handle the type, as soon as possible in the code.
Anyway, as of today, this is hacky.
Also, I am not really happy that the user has to specify AUM_PARAMETER_STRING or AUM_PARAMETER_RAW when using AUM_ASSERT_WAS_CALLED_WITH.

@c8y3
Copy link
Collaborator Author

c8y3 commented Nov 27, 2020

Since, we know the mock arguments type, it should not be necessary for the user to specify them again when doing its assert with aum_mock_was_called_with. Look, how the code of aum_mock_was_called_with could depend on an information stored with the mock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant