Snaipe / Mimick

A KISS, cross-platform C mocking library
MIT License
152 stars 43 forks source link

No examples of mmk_stub_create and using context #2

Closed brandoncazander closed 7 years ago

brandoncazander commented 7 years ago

Sorry to create this as an issue: I'm not sure if there's a more appropriate channel to ask for this.

I'm trying to mock out send using mmk_stub_create. It works great, but I can't wrap my head around how to get access to the context within my mock function. I was wondering if you could provide an example.

Snaipe commented 7 years ago

Typically, accessing the user context within a stub is done by using:

void *user = mmk_stub_context(mmk_ctx());

I recently created a gitter community for diacritic projects, you can @mention me on the Mimick channel if you need help. I should probably add a link for that in the readme.

brandoncazander commented 7 years ago

Thanks for the example. I'll try it out and if I have any issues I'll head over to gitter for more support.