Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost.Test] What's the best way to make custom assertions?
From: Richard (legalize+jeeves_at_[hidden])
Date: 2012-10-23 16:47:20


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

boost-users_at_[hidden] spake the secret code
<loom.20121023T224235-110_at_[hidden]> thusly:

>Vicente J. Botet Escriba <vicente.botet <at> wanadoo.fr> writes:
>
>> Would this works as well?
>> void check_op1()
>> {
>> BOOST_REQUIRE( expr );
>> }
>> BOOST_AUTO_TEST_CASE( t1 )
>> {
>> BOOST_TEST_CONTEXT( "
>> Testing invoked from: " << __FILE__ << "(" << __LINE__ << ")" );
>> check_op1( );
>> }
>
>Yes. It will, but in my case this statement needs to be written once.

What I'm proposing wouldn't require even this one statement to be written
and reuses the existing mechanisms in Boost.Test instead of burdening the
author/user of a custom assertion with even more code that they have to
write.

-- 
"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-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net