New user comments

13 views
Skip to first unread message

Philippe A.

unread,
Jul 26, 2010, 5:46:52 PM7/26/10
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!

Bob Gong

unread,
Jul 27, 2010, 3:11:42 AM7/27/10
to Cmockery
I have integrated cmockery with our existing C & C++ mixed project, it
worked well.

We developed a script to generate mocks automatically. It doesn't
always work, people need to fix it manually sometimes.

http://groups.google.com/group/cmockery/browse_thread/thread/c5840f0b4060c2e6
Reply all
Reply to author
Forward
0 new messages