vendredi 8 juillet 2016

Should I check the input variables (pointers) in a mock function?

I am writing a series of mock functions in C using CMocka

Some of these take pointers as input variables and I am not sure whether I should check them (ptr != NULL) or not.

In general, is the mock function responsible to perform input checking?

If yes, how should it behave when an error is found? Should it use the assert functions provided by the framework?

Aucun commentaire:

Enregistrer un commentaire