In the Boost.Test documentation, the following example is given
#define BOOST_TEST_MODULE dataset_example62
#include <boost/test/included/unit_test.hpp>
#include <boost/test/data/test_case.hpp>
#include <boost/test/data/monomorphic.hpp>
namespace data = boost::unit_test::data;
int samples1[] = {1, 2};
int samples2[] = {8, 9, 10};
BOOST_DATA_TEST_CASE(
test1,
data::make(samples1) + samples2,
var)
{
std::cout << var << std::endl;
}
and this compiles fine from the (Win10) command line with g++. Based on this example, I wrote my own test case, but instead of var
, I've used t
, and compilation failed. To my surprise, even in the example above, when var
is replaced by t
in both places like so:
BOOST_DATA_TEST_CASE(
test1,
data::make(samples1) + samples2,
t)
{
std::cout << t << std::endl;
}
470 lines of errors appear after compiling. If I replace t
with u
, everything is ok again. Am I missing something crucial here, or is this a bug?