[Boost-bugs] [Boost C++ Libraries] #13237: BOOST_TEST comparing two char*/wchar_t*

Subject: [Boost-bugs] [Boost C++ Libraries] #13237: BOOST_TEST comparing two char*/wchar_t*
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-09-30 20:02:38


#13237: BOOST_TEST comparing two char*/wchar_t*
----------------------------------+-------------------------------
 Reporter: mikhail.strelnikov@… | Owner: Gennadiy Rozental
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: test
  Version: Boost 1.65.0 | Severity: Problem
 Keywords: |
----------------------------------+-------------------------------
 BOOST_TEST should compare pointers, not strings.

 Consider:

 {{{
 char s[] = {65, 0, 65, 0};
 char *c1 = &s[0], *c2 = &s[2];
 if (c1 != c2)
 {
     BOOST_TEST(c1 != c2);
 }
 }}}

 Error looks like this:

 {{{
 check c1 != c2 has failed [A == A]
 }}}

 With wchar_t:

 {{{
 check c1 != c2 has failed [0x7ffc3b6d9bb0 == 0x7ffc3b6d9bb8]
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13237>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-09-30 20:08:31 UTC