Boost logo

Boost :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2002-12-02 04:57:12


Gennadiy Rozental wrote:

> Test library is all about usability and only then generocity or
> "standart purity". Would you be working with c strings I wonder how
> long it will take until you became tired adding std::string on both
> sides of comparison:

Actually I'm testing a C program with boost.test, so yes, I'm working
with C strings.

> BOOST_CHECK_EQUAL( std::string( s ), std::string( t ) ); ...
> BOOST_CHECK_EQUAL( std::string( s ), std::string( t ) ); ...
> BOOST_CHECK_EQUAL( std::string( s ), std::string( t ) );
>
> and will introduce simple forwarding macro
>
> #define M_CHECK_EQUAL_STR( s, t ) \
> BOOST_CHECK_EQUAL( std::string( s ), std::string( t ) );
>
> Boost.Test is doing this for you now. There is a very little
> posibility of misuse (comparison of pointers as check for
> correctness is very strange things in general IMO).

Why? I was testing some parser functions that work on char const * and
I had to check that the parser moves the pointers to where I expect
them to be. Comparision of pointers is nothing else than comparision
of iterators, after all.

Markus


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