-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fake.callcount is always 0 when reuse a fake across multiple test-suites #118
Comments
@meekrosoft Hi, can you help to give a support? Thank you so much! |
@meekrosoft @michahoiting @zrax @wulfgarpro Anybody here can help this? This is urgent. Thanks! |
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
|
Thank you for your reply! Can we fix it since you know the root cause? |
This is not a FFF bug. You're declaring to declare a fake in a public header, you're getting a global
extern "C" {
DECLARE_FAKE_VOID_FUNC(foo, int);
}
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 |
Describe the bug
A clear and concise description of what the bug is.
When reuse a fake across multiple test-suites, Functions with parameters faked as the instruction described, but the callcount is always 0, however the functions without parameters callcount is normal.
To Reproduce
Steps to reproduce the behavior:
1.Fake a function with parameters as instruction described, with DECLARE_FAKE_VOID_FUNC in a public .h file;
2. use DEFINE_FAKE_VOID_FUNC in a private .c file
3. Reference faked function in a Google Test test suit TEST_F;
4. When I try to use the FUN_fake.callcount, it is always 0;
5. but if i fake the function directly in the test source file, the callcount is OK.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
Compiler, toolset, platform (please complete the following information):
gcc.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0
vscode V1.72
The text was updated successfully, but these errors were encountered: