Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [fake-function-framework]

Fake Function Framework (fff) is a micro-framework that creates fake C functions for writing tests.

fake-function-framework
-2 votes
1 answer
304 views

Undefined reference to 'fff' at linker [duplicate]

I'm getting the following linker error when I build a GoogleTest executable (with CMake) that uses FFF (Fake Function Framework): C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../...
upsidedownone's user avatar
1 vote
1 answer
162 views

fff: mocking a value returned by reference from another module

Working with the Fake Function Framework, I have this bit of code (paraphrased): void sched_step(void) { event_t event; int status; status = queue_fetch(&event); if (status == OK) ...
fearless_fool's user avatar
1 vote
1 answer
988 views

Fake Function Framework "one or more multiply defined symbold found"

I am using the Fake Function Framework to fake a function in a .c file and test it in my .cpp unit test file. #include "..\fff.h" extern "C" { #include "ioDigitalInput.h&...
Kasper's user avatar
  • 43
1 vote
1 answer
813 views

Fake Function Framework not working with STM32 HAL functions

I am using FFF - Fake Function Framework to stub out some calls in my unit tests. This is working fine in many instances. I can stub out any of the functions I have written myself, as well as any ...
Smoggie Tom's user avatar
5 votes
1 answer
6k views

How do you mock and test the same function in C/C++ with FFF and Google Test?

I am exploring TDD (Test Driven Development) to test the code that I am writing in C and C++. I have chosen to use Google Test as the unit test framework. I have chosen to use FFF as the mocking ...
Eyal Gerber's user avatar
  • 1,447
0 votes
1 answer
410 views

Error in mocking for embedded unit testing "Address of overloaded function does not match required type 'void()'

I am working on an Embedded C project for which I am currently writing unit tests. I am using the fff mocking framework, which essentially creates fake function calls which should overload hardware ...
Smoggie Tom's user avatar
2 votes
1 answer
2k views

C FFF mock redefinition

I'm trying to use the FFF mocking library for C (https://github.com/meekrosoft/fff) to unit test C code. The issue I'm running into is gcc is seeing my mock object as a redefinition of the original ...
Sundeep's user avatar
  • 33