2

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

Kevin Liang
  • 206
  • 2
  • 11

2 Answers2

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