Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2001-12-06 11:04:58


Here are some comments on the new Test Library:

) There is a problem with the macros like

  BOOST_TEST_SUITE_MESSAGE_END << end();

  What is 'end()'? Depends on the context in which the macro is *used*, not
defined.
  Therefore, this and every other identifier that appears in a macro MUST be
fully qualified.

) In "test_tools.hpp", there are macros (i.e: BOOST_CHECKPOINT) which appear
*before* the declaration of the objects they use. To me, this is confusing,
I recommend moving those macros to the bottom.

) I don't like the names of the macros 'BOOST_WARN_MESSAGE',
'BOOST_CHECK_MESSAGE', 'BOOST_REQUIRE_MESSAGE', they don't do what they are
sematically implying: That is, 'check message' implies: 'check *the*
message, not 'check *this* and eventually show a message'. I suggest....
something else :) [just couldn't come up with something]

) Also, I think the the 'message' in 'BOOST_CHECK_MESSAGE' (etc...) should
also contain the predicate, as in 'BOOST_CHECK'. In other words, the
MESSAGE should be *added* to the output.
This is useful, because instead of:

   BOOST_CHECK_MESSAGE(a!=0,"A isn't zero. Enter a different number")

you would write:

   BOOST_CHECK_MESSAGE(a!=0,"Enter a different number")

) I *strongly* disagree with having floating point and collection equlity
tools as part of the test library. They are orthogonal to the unit test
framework. There is an unbounded set of predicates that can be tested and
they shouln't be embebbed in the test library.
I would agree to provide, in the proper place, a floating point comparator
and a sequence matcher, but they should be outside the test suite.

) Just a question:

Why does wrapstrstream::operator << returns a 'const' reference? This
requires 'buf' to be mutable.

) "test_tools.hpp" should include <except>, since it is deriving a class
from std::exception.

) I couldn't understand the role of 'output_test_stream'. I'd like to see
more 'in-header' documentation.

Well, that's it for today, more to come later.

Regards,

Fernando Cacciola
Sierra s.r.l.
fcacciola_at_[hidden]
www.gosierra.com


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