-
Notifications
You must be signed in to change notification settings - Fork 85
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
BOOST_TEST_EQ does not print C strings #91
Comments
There's also a similar overload for |
We have a separate macro for C strings, which is |
In Boost.Filesystem case we are comparing |
Yes, I understand that, but how are we supposed to distinguish the two cases? In general we have no idea what |
I think, the special case is comparing two pointers and the rest can be assumed to operate as intended (i.e. there must be a user-defined comparison or conversion operator for the comparison to compile). |
Also, the comparison logic is unrelated to output formatting, which is what this issue about. |
Not entirely unrelated; when the test fails the values need to tell us why.
This might be a good heuristic, yes (we also need to take arrays into account). Still a bit dangerous for my taste because misinterpreting a |
I'd prefer not assuming (by default) that |
This works around lightweight_test bug that it doesn't print C strings in case of test failures. Related to boostorg/core#91.
BOOST_TEST_EQ
that involve C-style strings do not output string contents. For example,BOOST_TEST_EQ(*++itr, "foo");
shows this on failure:This seems to be caused by this
test_output_impl
overload:core/include/boost/core/lightweight_test.hpp
Line 167 in e533933
Is this intended to return
const void*
instead ofconst char*
?If yes, then could we make this behavior optional?
The text was updated successfully, but these errors were encountered: