Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

BOOST_DATA_TEST_CASE_F

Declares and registers a data-driven test case, using a particular dataset and a fixture. This is basically the same as BOOST_DATA_TEST_CASE with fixture support added.

struct my_fixture {
  my_fixture() : some_string("environment X") {
  }
  std::string some_string;
};

BOOST_DATA_TEST_CASE_F(my_fixture, test_case_name, dataset, var1, var2..., varN)
{
  BOOST_TEST(var1 != 0);
  //...
  BOOST_TEST(varN != 0);
}

The fixture should implement the appropriate interface. As any fixture, it is possible to have test assertions in the fixture class.

See here for more details on fixtures and here for more details on datasets declaration.


PrevUpHomeNext