Hi all the C experts,
We are developing the Test Engine for an avionics application.
The library API a.h: contains external definition of function A().
The application app.c: include "a.h", calls function A()
The Test Engine test.c: include "a.h", also calls function A()
We want the application to run on our Test environment, so we want to stub function A() of the library and replace it with our version A() in stub.c. So now both app.c and test.c are calling our re-defined A(). It works ok.
stub.c: include "a.h", defines A().
However, now we just realize we still want test.c to call the original A() of the library, and app.c still calls the stubbed A().
app.c: include "a.h", calls function A() of the stub.c.
test.c: include "a.h", calls function A() of the library.
stub.c: include "a.h", defines A().
Note that app.c is the application to be tested so we cannot make any change to it. We are free to change test.c. What can we change to test.c, or what can we do to the makefile so that the A() in test.c can link to the library?
We really appreciate your help.