-
Notifications
You must be signed in to change notification settings - Fork 501
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
Met different access of __xfer_bufptrs while setting GoogleTest under CppUTest #1652
Comments
Thanks. I do not know if CppUTest works with the latest version of gtest, so that might be the problem. Which GTest version did you use here ? |
I followed the instructions from here: https://github.com/google/googletest/tree/main/googletest
|
Yes, at the moment, we've only tested CppUTest with max gtest 1.8. @thetic was checking if he can also get other version to work (and add it to the CppUTest automated build) but I suspect it might still need some work. |
I was able to work around this by building with gtest 1.8 and C++ 98. I'm starting to doubt that this can be made to work reliably across gtest and C++ versions. |
I tried to set up GoogleTest under CppUTest framework in order to support parameterized tests (https://groups.google.com/g/cpputest/c/FuPTZm5_nqg). So I followed the description from the manual (https://cpputest.github.io/manual.html#gtest), but it failed to compile even for only the easiest TEST_GROUP HelloWorld in the example directory in CppUTest. I got stuck in the error:
After a little bit of explorations about the problem, I guessed that this problem seemed to be caused by the #define access hack in the include/CppUTestExt/GTestConvertor.h: 92
#define private public
#define protected public
which makes the __xfer_bufptrs public, but it is defined as private in class basic_stringbuf. The action of #define access hack maybe cause the problem in GoogleTest because that GoogleTest used sstream (Not sure, just as my guess...).
I have tried some suggestions from others discussions, ex: changing the #include order in examples/AllTests/AllTests.cpp, but it doesn't work (which make sense in my opinion). something like:
I also tried to use some more ugly hacks like
#undef private
#define private private
somewhere in GTestConvertor.h, but I still failed.
I would like to know what should I do to handle this problem?
Some refs:
Not sure if these helps:
The text was updated successfully, but these errors were encountered: