Boost logo

Boost :

Subject: Re: [boost] Is there interest in unit testing both passing and failing BOOST_MPL_ASSERTs?
From: Dave Abrahams (dave_at_[hidden])
Date: 2011-09-13 12:10:45


on Tue Sep 13 2011, Ben Robinson <icaretaker-AT-gmail.com> wrote:

> This submission would make it possible to write a complete set of unit tests
> for meta-programs, to test both the positive, compiling statements, and the
> negative, non-compiling statements. These tests will all compile, and the
> negative tests can throw an exception instead of failing to compile.

> Is anybody interested in this capability, and/or my modifications to the
> single file boost/mpl/assert.hpp which have enabled this capability?

If you're just checking MPL assertions, then presumably there's a
predicate that can be evaluated without throwing. Why not just feed
those predicates' results to regular runtime assertions?

Doesn't seem like we need a new tool. The very point of
BOOST_MPL_ASSERT_* is to catch errors at compile time. If you want
something else, there are plenty of appropriate choices.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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