meekrosoft / fff

A testing micro framework for creating function test doubles
Other
766 stars 167 forks source link

Unable to mock ioctl #6

Closed jverce closed 10 years ago

jverce commented 10 years ago

Hello, I am trying to create a fake for the ioctl function, but I'm getting the following error when compiling (but not linking) my test.cpp file: $ g++ -c -I../ -I$GTEST_DIR/include/ test.cpp test.cpp:12:22: error: 'ioctl' has not been declared test.cpp:12:64: error: expected constructor, destructor, or type conversion before ';' token

Line 12 of the test.cpp file contains the following: FAKE_VALUE_FUNC(int, ioctl, int, unsigned long, unsigned long*);

Every other fake function has been declared successfully, except for ioctl. They have all been written in the same manner. These functions were implemented in another file of my own, the only "system" function mocked is ioctl.

Is there a special way to mock system or basic functions like this one?

Thank you. Regards,

jverce commented 10 years ago

There was a syntax error when calling the macro (wrote "FAVE_VALUE_FUNC" instead of "FAKE_VALUE_FUNC"). Thank you.