Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
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