Comments (3)
You can by using a custom fake fuction: For instance:
FAKE_VALUE_FUNC_VARARG(int, fprintf, FILE *, const char*, ...);
In order to access the variadic parameters from your custom fake function, declare a va_list parameter. For instance, a custom fake for fprintf() could call the real fprintf() like this:
int fprintf_custom(FILE *stream, const char *format, va_list ap) {
if (fprintf0_fake.return_val < 0) // should we fail?
return fprintf0_fake.return_val;
return vfprintf(stream, format, ap);
}
from fff.
Yes, I realized that afterwards, but I would prefer the other way since I could validate βafterβ running the function.
from fff.
You're talking about the call history, right? The problem is the variadic arg types are not known, so there's no way to declare an array to automatically store them. But if you can predict the types you can create you're own history using the custom fake.
from fff.
Related Issues (20)
- fatal error: 'tr1/tuple' file not found HOT 1
- SET_RETURN_SEQ should reset return_val_seq_idx HOT 1
- Can FFF be used to generate the actual fake implementation?
- Argument history storing derefenced pointers HOT 1
- warning: ISO C99 requires at least one argument for the "..." in a variadic macro HOT 1
- Is it possible to mock static functions? HOT 1
- #pragma pack(1) breaks Function Return Value Sequences HOT 1
- How to install and to use? HOT 3
- Allow support for std::function as the `custom_fake` type HOT 1
- Linking issue in the example project HOT 1
- fake.callcount is always 0 when reuse a fake across multiple test-suites HOT 5
- FFF generated reset functions have mangled names HOT 2
- C++ Support for FFF Framework HOT 1
- Question: Releases and project maintenance
- Suggestion about improving idea: dump the call history at the tear down of each test fixture
- Bump to v1.1? HOT 2
- Unable to reuse fakes across multiple test modules HOT 1
- MVSC linking error multiple modules - How do I reuse a fake across multiple test-suites? HOT 2
- Alternating fff with real functions to access the hardware HOT 2
- Use of fff to mock c++ class member functions HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fff.