How do I mock a custom c-lib function using ocmock? Couldn't find anything on google, and any method stubbing functions from OCMock doesn't work
Asked
Active
Viewed 1,908 times
2 Answers
2
One solution could be to encapsulate that functions inside an static class and mock it. In this way you can test the functions itself and mock his usage (using the static class).

Víctor B.
- 1,630
- 2
- 14
- 21
1
You cannot mock C functions with OCMock. You will need to use another framework.

Ben Flynn
- 18,524
- 20
- 97
- 142
-
1do you have another framework that you suggest to mock C functions? – Kevin Liang Feb 11 '14 at 23:26
-
I haven't used any, so I hesitate to make a recommendation. – Ben Flynn Feb 11 '14 at 23:37
-
You can use fishhook(https://github.com/facebook/fishhook) from Facebook – Omkar Mar 05 '18 at 06:29