[Boost-bugs] [Boost C++ Libraries] #11043: test test_tools_test fails if char is unsigned

Subject: [Boost-bugs] [Boost C++ Libraries] #11043: test test_tools_test fails if char is unsigned
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-02-17 23:00:38


#11043: test test_tools_test fails if char is unsigned
---------------------------------------+---------------------
 Reporter: Ed Vogel <edward.vogel@…> | Owner: rogeeff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: test
  Version: Boost 1.56.0 | Severity: Problem
 Keywords: |
---------------------------------------+---------------------
 Greetings,

 (I hope it's OK to report this kind of thing)

 I believe there is a problem with the boost test library test
 test_tools_test.

 Part of that test is:

     char ch1 = -2;
     char ch2 = -3;
     BOOST_CHECK_EQUAL(ch1, ch2);

 The line in the .pattern file that corresponds to this is:

 376: error in "test_BOOST_CHECK_EQUAL": check ch1 == ch2 failed
 [0xfffffffe != 0
 xfffffffd]

 While this is fine if char is a signed type, I believe it is wrong if
 char is unsigned. In this case the output should be:

 ......check ch1 == ch2 failed [0xfe != 0xfd]

 Not a big deal, but the test could be updated to use a different
 pattern file (as the errors_handling_test does) in this case.


 It's interesting I did not find any general boost configuration macros
 for systems that chose char to be unsigned.

 Thank you for your time,

 Ed Vogel

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11043>
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-02-16 18:50:17 UTC