Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2007-01-09 02:50:14


"Leo Jay" <python.leojay_at_[hidden]> wrote in message
news:4e307e0f0701082320x5353fcc4t94a9ec5912ed84b7_at_mail.gmail.com...
> here is my code:
>
> BOOST_AUTO_TEST_SUITE(myTestSuite)
>
> BOOST_AUTO_TEST_CASE(myFirstTestCase)
> {
> BOOST_CHECK_EQUAL(5, 2);
> }
>
> BOOST_AUTO_TEST_SUITE_END()
>
>
> the output is :
> Running 1 test case...
> d:/test/test.cpp(35): error in "myFirstTestCase":
> check 5 == 2 failed [5 != 2]
>
> *** 1 failure detected in test suite "Master Test Suite"
>
> so, my question is, why is the test case's name "myFirstTestCase",
> but the test suite's name changed into "Master Test Suite"?

The test suite name did not change. The master test suite is always present
and is the root of test tree hierarhy. Your test suite is it's child. To see
complete hierarhy you need to specify --report_level=detailed

> do i use the BOOST_AUTO_TEST_SUITE in a wrong way?
> if so, what's the correct usage?

You don't really need BOOST_AUTO_TEST_SUITE here (at least in an example
above). Here how it could look:

#define BOOST_TEST_MODULE myTestSuite
#include <boost/test/unit_test.hpp>

BOOST_AUTO_TEST_CASE(myFirstTestCase)
{
    BOOST_CHECK_EQUAL(5, 2);
}

Try to run this a tell me is an output is what you want.

Gennadiy


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