mirror of
https://github.com/boostorg/test.git
synced 2026-02-02 09:12:10 +00:00
Changing the examples to use BOOST_TEST
This commit is contained in:
@@ -6,24 +6,24 @@
|
||||
// See http://www.boost.org/libs/test for the library home page.
|
||||
|
||||
//[example_code
|
||||
#define BOOST_TEST_MAIN
|
||||
#define BOOST_TEST_MODULE example59
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
#include <boost/test/data/test_case.hpp>
|
||||
#include <boost/test/data/monomorphic.hpp>
|
||||
|
||||
namespace bdata = boost::unit_test::data;
|
||||
|
||||
BOOST_DATA_TEST_CASE( test_case_snippet_1, bdata::xrange(5) )
|
||||
BOOST_DATA_TEST_CASE( test1, bdata::xrange(5) )
|
||||
{
|
||||
std::cout << "test 1 " << sample << std::endl;
|
||||
BOOST_CHECK(sample <= 4 && sample >= 0);
|
||||
BOOST_TEST((sample <= 4 && sample >= 0));
|
||||
}
|
||||
|
||||
BOOST_DATA_TEST_CASE(
|
||||
test_case_snippet_2,
|
||||
test2,
|
||||
bdata::xrange<int>( (bdata::begin=1, bdata::end=10, bdata::step=3)) )
|
||||
{
|
||||
std::cout << "test 2 " << sample << std::endl;
|
||||
BOOST_CHECK(sample <= 4 && sample >= 0);
|
||||
BOOST_TEST((sample <= 4 && sample >= 0));
|
||||
}
|
||||
//]
|
||||
|
||||
Reference in New Issue
Block a user