Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-06-18 05:14:10


It appears that the error reporting is a little bit less helpfull when 'char'
 type is compared. I've just run the following program:

   #define BOOST_INCLUDE_MAIN
   #include <boost/test/test_tools.hpp>
   using namespace boost;

   int test_main(int, char*[])
   {
       char m1[] = {'a', 'b', '\0'};
       char m2[] = {'a', 'b', '\1'};

       BOOST_CHECK_EQUAL_COLLECTIONS(m1, m1 + 3, m2);
   }

using Boost CVS and recieved the following:

   a.cpp(11): error in "call_test_main": test {m1, m1 + 3} == {m2, ...} failed [ != ]

The '\0' and '\1' are not printed sensible by iostreams, so this message really does not tell
what values were different. I suspect that BOOST_CHECK_EQUAL has this problem also.
Is it possible to somehow adress this? E.g. by quoting characters that are not alphanumeric?

Of course, the example above is artifical. The real one where I found it is a code which
deals with byte arrays, so it's really needed to compare chars.

TIA,
Volodya


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk