...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Declares and registers a data-driven test case, using a particular dataset.
Several forms of the macro are available.
BOOST_DATA_TEST_CASE(test_case_name, dataset) { BOOST_TEST(sample != 0); }
should be used for datasets with arity 1. In the body of the test case,
the samples of the dataset are taken by the variable sample
.
BOOST_DATA_TEST_CASE(test_case_name, dataset, var1) { BOOST_TEST(var1 != 0); }
same as the first form, but the samples are taken by the variable var1
instead of the variable sample
BOOST_DATA_TEST_CASE(test_case_name, dataset, var1, var2..., varN) { BOOST_TEST(var1 != 0); //... BOOST_TEST(varN != 0); }
same as the second form, but for dataset of arity N
.
For compilers lacking the variadic template
support, the maximal arity (the maximal value of N
)
is controlled by the macro BOOST_TEST_DATASET_MAX_ARITY
which is set to 10
by default.
If you need a greater value, define BOOST_TEST_DATASET_MAX_ARITY
to the desired value before including
the Unit Test Framework headers.
See here for more details.