|
Boost Users : |
From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2004-05-22 23:35:58
Use this example for now. I will fix docs:
#include <boost/test/unit_test_suite_ex.hpp>
#include <boost/test/unit_test.hpp>
using boost::unit_test::test_suite;
#include <boost/bind.hpp>
#include <list>
void test_mask( int arg, int mask )
{
BOOST_MESSAGE( arg << " " << mask );
BOOST_CHECK( (arg & mask) != 0 );
}
struct sub_test_suite : public test_suite {
sub_test_suite()
{
parameters_list.push_back( 1 );
parameters_list.push_back( 5 );
parameters_list.push_back( 6 );
parameters_list.push_back( 7 );
parameters_list.push_back( 140 );
boost::function1<void,int> f = bind( &test_mask, _1, 0x80 );
add( BOOST_PARAM_TEST_CASE( f, parameters_list.begin(),
parameters_list.end() ) );
}
std::list<int> parameters_list;
};
//__________________________________________________________________________
__//
test_suite*
init_unit_test_suite( int argc, char* argv[] ) {
test_suite* test = BOOST_TEST_SUITE( "Example" );
test->add( new sub_test_suite );
return test;
}
Thanks for report.
Gennadiy.
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