-
Notifications
You must be signed in to change notification settings - Fork 3
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
[bug] deadlock in the setup of expectations for the mocked GetCurrentThreadId function #8
[bug] deadlock in the setup of expectations for the mocked GetCurrentThreadId function #8
Conversation
Yeah, optimization
even in Debug configuration, without any optimization. |
# Conflicts: # include/gmock-win32.h # src/gmock-win32.cpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done merging to current state.
For continue moving.
Conflict resolved here #11 |
After merging minor changes
Found my error in |
address bug fix
I didn't find any errors with
It might be a good idea to restore all hooks when exiting from current test.
Temporary, convenient. |
My test setup (where I need to use the ugly avoid_opt) was:
Then I retested it on a newer setup, and it works without
So, the problem exists only on my old setup: MSVC 2015 Update 3, v140, and I think that we can skip it (since it works properly on MSVC 2019, clang, MSVC 2022 /std:c++14, /std:c++17, /std:c++20). As it turns out, the issue is related to my older configuration MSVC 2015 Update 3 with the v140 toolchain. Given that the problem is not present when using MSVC 2019, Clang, or MSVC 2022 with the specified C++ standards (/std:c++14, /std:c++17, /std:c++20), I think we can skip (what do you think ?) that problem for older setup (maybe we should recheck MSVS 2017). So then, my next TODO list will be:
|
I agree, and we need to call |
…ines; minor changes in formatting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/O2 /Oi /GL for compilation and /OPT:REF /OPT:ICF for the linker.
.../std:c++14, /std:c++17, /std:c++20)
I think that we can skip it (since it works properly on MSVC 2019, clang, MSVC 2022 /std:c++14, /std:c++17, /std:c++20)
Msvc2019(v142) and its clang.
/O2 /Oi /GL for compilation, /OPT:REF /OPT:ICF for the linker.
- /std:c++14 passed
- /std:c++17 passed
- /std:c++20 error
Need declaremockModule_patchModuleFunc
before using it inpatchModuleFunc_
function.
After rewriting - /std:c++20 passed
- /std:c++latest passed
We can skip it, I agree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C++20 resolverd in #14
/std:c++20 function declaration
::patchModuleFunc_( &mock_module_##m::oldFn_, &::m, &mock_module_##m::stub ); \ | ||
} \ | ||
__pragma(optimize("", off)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to here
void mockModule_patchModuleFunc (void*, void*, void**); | ||
void mockModule_restoreModuleFunc (void*, void*, void**); | ||
#define MOCK_CDECL_FUNC(r, m, ...) \ | ||
MOCK_MODULE_OVERLOAD(MOCK_MODULE_FUNC, MOCK_MODULE_NBARG(__VA_ARGS__)##__CDECL_CONV)##(m, r(__VA_ARGS__)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved from here
Sample where the fix was tested:
Env:
Not solved problems:
avoid_opt
test codeRESTORE_MODULE_FUNC
call is required before expectations checksTo close the issue, the merging of this PR is also required:
#7