Boost logo

Boost Users :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2004-06-29 21:29:14

> I have a test program that looks like this, in stylized form:
> --------------------------
> #include <boost/test/auto_unit_test.hpp>
> using namespace boost::unit_test_framework;

You shouldn't need this.

> void validate(X args) {
> if (some tests)
> BOOST_ERROR("message");
> }
> BOOST_AUTO_UNIT_TEST(testfunction) {
> // set up arguments
> validate(args)
> }
> ----------------------------------
> When I run this with report-level detailed, it reports that there are 0
> assertions in testfunction. Furthermore, the assertions done in
> validate are not even added to the overall number of assertions reported
> for the run.

I couldn't reproduce it. And frankly it kinda hard to believe. There should
be absolutely no difference where your assertion is located: directly in
test function or in some other function you called from it.

> I know the checks are being run, because I have seen errors from them.
> Also, the error messages include the name "testfunction", so it is
> available at run time.

Could you post complete compilable example?

> It would be nice if the error reporting and logging functions got their
> info at run-time; apparently they are grabbing it from some
> pre-processor magic at the moment (I haven't examined the code in
> detail; that's just an inference from the behavior).
> Since the tests do seem to be run, this is basically a cosmetic problem,
> but it would be nice to fix.
> If any easy fixes occur to anyone, I'd love to know.
> Boost 1.31.0 on Debian.
> P.S. The module's author is listed as rogeeff_at_[hidden] in the
> documentation, but that address doesn't work.

Yes. This address is no more free and I don't use it anymore. Use rogeeff at
patmedia dot net.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at