Boost logo

Boost :

From: Stefan Slapeta (stefan_at_[hidden])
Date: 2005-03-21 08:54:51


attached are the test cases for BOOST_CHECK_EQUAL on strings. I don't
know which of the combinations are actually supported, but as you can
see in the comments, it's quite mixed at the moment what does work and
what not for Intel and VC. (the comments show failing test cases)

Gennadiy, shall I add these test cases or are there some we definitely
don't support?

BTW, the (commented) results are for 1.32 as the code still doesn't work
for Intel at all because of the numeric_limits problem! I tested with VC
7.1 and Intel 8.1.



#include <boost/test/test_tools.hpp>

int test_main( int, char *[] )
    char const *buf_ptr_cch = "abc";
    char const buf_array_cch[] = "abc";
    char *buf_ptr_ch = "abc";
    char buf_array_ch[] = "abc";
    std::string buf_str("abc");

    BOOST_CHECK_EQUAL(buf_ptr_cch, buf_ptr_cch);
    BOOST_CHECK_EQUAL(buf_ptr_cch, buf_array_cch);
    BOOST_CHECK_EQUAL(buf_ptr_cch, buf_ptr_ch); // VC
    BOOST_CHECK_EQUAL(buf_ptr_cch, buf_array_ch);
    BOOST_CHECK_EQUAL(buf_ptr_cch, buf_str);

    BOOST_CHECK_EQUAL(buf_array_cch, buf_ptr_cch);
    BOOST_CHECK_EQUAL(buf_array_cch, buf_array_cch);
    BOOST_CHECK_EQUAL(buf_array_cch, buf_ptr_ch); // VC+Intel
    BOOST_CHECK_EQUAL(buf_array_cch, buf_array_ch); // Intel
    BOOST_CHECK_EQUAL(buf_array_cch, buf_str);

    BOOST_CHECK_EQUAL(buf_ptr_ch, buf_ptr_cch); // VC
    BOOST_CHECK_EQUAL(buf_ptr_ch, buf_array_cch); // VC+Intel
    BOOST_CHECK_EQUAL(buf_ptr_ch, buf_ptr_ch);
    BOOST_CHECK_EQUAL(buf_ptr_ch, buf_array_ch); // VC+Intel
    BOOST_CHECK_EQUAL(buf_ptr_ch, buf_str);

    BOOST_CHECK_EQUAL(buf_array_ch, buf_ptr_cch); // Intel
    BOOST_CHECK_EQUAL(buf_array_ch, buf_array_cch); // Intel
    BOOST_CHECK_EQUAL(buf_array_ch, buf_ptr_ch); // VC+Intel
    BOOST_CHECK_EQUAL(buf_array_ch, buf_array_ch);
    BOOST_CHECK_EQUAL(buf_array_ch, buf_str);

    BOOST_CHECK_EQUAL(buf_str, buf_ptr_cch);
    BOOST_CHECK_EQUAL(buf_str, buf_array_cch);
    BOOST_CHECK_EQUAL(buf_str, buf_ptr_ch);
    BOOST_CHECK_EQUAL(buf_str, buf_array_ch);
    BOOST_CHECK_EQUAL(buf_str, buf_str);

        return 0;

Boost list run by bdawes at, gregod at, cpdaniel at, john at