Boost logo

Boost :

Subject: Re: [boost] [Boost.Test] Assertion changes in trunk? [WAS: Call for Review: Boost.Test documentation rewrite]
From: Richard (legalize+jeeves_at_[hidden])
Date: 2014-02-19 14:21:15


[Please do not mail me a copy of your followup]

boost_at_[hidden] spake the secret code
<867g9pr6id.fsf_at_[hidden]> thusly:

>Tests cases should test one, and only one, logical concept each.
>Therefore, multiple assertions in the same tests case will all be
>testing the same concept. In other words, they are, together,
>constructing a report of the failure.
>
>Often this is possible using only one assertion, in which case CHECK and
>REQUIRE are equivalent, but sometimes more than one
>non-mutually-exlusive assertion is needed to give the full picture.

OK, I can see this point of view. I suppose if you wrote your own
custom assertion and it returned boost::test_tools::predicate_result
to build up a detailed expectation failure message this would also be
the case.

The reason I objected is because too often I see people getting the
wrong "take away message" and violating the assumption you stated in
your first paragraph while accepting the pattern in your second
paragraph. The end result is brittle tests the fail too often and
give unit testing in general a bad reputation.

-- 
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
     The Computer Graphics Museum <http://computergraphicsmuseum.org>
         The Terminals Wiki <http://terminals.classiccmp.org>
  Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>

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