Boost C++ Libraries: Ticket #13237: BOOST_TEST comparing two char*/wchar_t* https://svn.boost.org/trac10/ticket/13237 <p> BOOST_TEST should compare pointers, not strings. </p> <p> Consider: </p> <pre class="wiki">char s[] = {65, 0, 65, 0}; char *c1 = &amp;s[0], *c2 = &amp;s[2]; if (c1 != c2) { BOOST_TEST(c1 != c2); } </pre><p> Error looks like this: </p> <pre class="wiki">check c1 != c2 has failed [A == A] </pre><p> With wchar_t: </p> <pre class="wiki">check c1 != c2 has failed [0x7ffc3b6d9bb0 == 0x7ffc3b6d9bb8] </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13237 Trac 1.4.3 Raffi Enficiaud Thu, 09 Nov 2017 22:24:18 GMT <link>https://svn.boost.org/trac10/ticket/13237#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13237#comment:1</guid> <description> <p> This is well explained in the documentation: <a href="http://www.boost.org/doc/libs/1_65_1/libs/test/doc/html/boost_test/testing_tools/extended_comparison/strings.html">http://www.boost.org/doc/libs/1_65_1/libs/test/doc/html/boost_test/testing_tools/extended_comparison/strings.html</a> </p> <p> If you want to compare pointers, maybe you can just use </p> <pre class="wiki">BOOST_TEST((void*)c1 != (void*)c2); </pre><p> instead? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Thu, 25 Jan 2018 22:07:38 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/13237#comment:2 https://svn.boost.org/trac10/ticket/13237#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">worksforme</span> </li> </ul> <p> Note that BOOST_TEST does not support wchar_t comparisons well, as mentioned in other bug reports. Closing this ticket. </p> Ticket