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

Datasets
PrevUpHomeNext

To define properly datasets, the notion of sample should be introduced first. A sample is defined as polymorphic tuple. The size of the tuple will be by definition the arity of the sample itself.

A dataset is a collection of samples, that

  • is forward iterable,
  • can be queried for its size, which in turn can be infinite,
  • has an arity that is the arity of the samples it contains.

Hence the dataset implements the notion of sequence.

The descriptive power of the datasets in Unit Test Framework comes from

  • the interface for creating a custom datasets, which is quite simple,
  • the operations they provide for combining different datasets
  • their interface with other type of collections (stl containers, C arrays)
  • the available built-in dataset generators
[Tip] Tip

Only "monomorphic" datasets are supported, which means that all samples in a dataset have the same type and same arity [2] .

As we will see in the next sections, datasets representing collections of different types may be combined together (e.g.. zip or grid). These operations result in new datasets, in which the samples are of an augmented type.



[2] polymorphic datasets will be considered in the future. Their need is mainly driven by the replacement of the typed parametrized test cases by the dataset-like API.


PrevUpHomeNext