boostorg / boostorg/core

BOOST_TEST_EQ does not print C strings

Open
#91 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
156
Forks
116
PR merge metrics
No merged PRs in 30d

Description

`BOOST_TEST_EQ` that involve C-style strings do not output string contents. For example, `BOOST_TEST_EQ(*++itr, "foo");` shows this on failure:

```
libs\filesystem\test\path_test.cpp(341): test '*++itr == "foo"' ('"c:"' == '00007FF79AE87414') failed in function 'void __cdecl `anonymous-namespace'::iterator_tests(void)'
```

This seems to be caused by this `test_output_impl` overload:

https://github.com/boostorg/core/blob/e53393357f32078f55cdb291a536bb567895bc62/include/boost/core/lightweight_test.hpp#L167

Is this intended to return `const void*` instead of `const char*`?

If yes, then could we make this behavior optional?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.