Comments (5)
@meekrosoft Hi, can you help to give a support? Thank you so much!
from fff.
@meekrosoft @michahoiting @zrax @wulfgarpro Anybody here can help this? This is urgent. Thanks!
from fff.
use g++ -E , u will see its a simple Preprocessing Seams, just define a function the same name, then link call it.
the reset just memset value 0. Cannot change called func
void checkSkipList_reset(void)
{
memset((void *)&checkSkipList_fake, 0, sizeof(checkSkipList_fake) - sizeof(checkSkipList_fake.custom_fake) - sizeof(checkSkipList_fake.custom_fake_seq));
checkSkipList_fake.custom_fake =
# 6 ".\\fff_test.cpp" 3 4
__null
# 6 ".\\fff_test.cpp"
;
checkSkipList_fake.custom_fake_seq =
# 6 ".\\fff_test.cpp" 3 4
__null
# 6 ".\\fff_test.cpp"
;
checkSkipList_fake.arg_history_len = (50u);
};
from fff.
et value 0. Cannot change called func
Thank you for your reply!
Can we fix it since you know the root cause?
from fff.
This is not a FFF bug.
You're declaring to declare a fake in a public header, you're getting a global struct
. It's expected that they'll interfere with each other, so declaring a fake in a global header is generally not a good idea. Your problem is the test code structure that you created.
- Use
DECLARE_FAKE_VOID_FUNC
in your private, GTest (C++) file (extern "C"
is required otherwise you get a linker error):
extern "C" {
DECLARE_FAKE_VOID_FUNC(foo, int);
}
- Call
RESET_FAKE
from your test fixtureSetUp()
method, not from your test (DRY)
I have dozens of tests that use the temple described above and they work perfectly.
See an example here
Note that in that example, I am calling RESET_FAKE
from TEST
because that's a simple example. It's better if you use a test fixture (like you're doing), so you can call RESET_FAKE
from SetUp()
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
- FFF generated reset functions have mangled names HOT 2
- C++ Support for FFF Framework HOT 1
- Question: Releases and project maintenance
- Mocking static methods of the class HOT 3
- Is there a forum or fff community page for answering questions? HOT 2
- Automatically generate mocks: fff-mock-gen HOT 1
- include fff.h once
- Ddf
- 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.