Philippe A.
unread,Jul 26, 2010, 5:46:52 PM7/26/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Cmockery
Hello,
I have been looking at how I could integrate cmockery with an existing
C project. I am looking for ideas on how to solve the following
problems.
- What do I need to generate mocks automatically? Is a C parser what I
need (ex pycparser)? Are there better or simpler choices? Has someone
written a script for this already?
- I was a bit surprised at first when I saw that expectations have to
be set up with each individual parameter. I guess there's no other way
around this as far as a pure C framework is concerned. I would like a
lot more setting expectations a la cmock (my other contender)? Ex:
addFunc_ExpectAndReturn(int a, int b, int toReturn);
Once I have a script generating mocks, I guess nothing would stop me
from generating functions that facilitates expectation setup.
// generated
void addFunc_ExpectAndReturn(int _a, int _b, int _toReturn) {
expect_value(addFunc, a, _a);
expect_value(addFunc, b, _b);
will_return(addFunc, _toReturn);
}
Thanks!