Writing and invoking tests with Boost.Test
The library provides both an automatic and manual way of registering test cases and test suites to be executed by the test runner. Automatic registration is the simplest way because it enables you to construct a test tree just by declaring test units. In this recipe, we will see how to create test suites and test cases using the single-header version of the library, as well as how to run tests.
Getting ready
To exemplify the creation of test suites and test cases, we will use the following class, which represents a three-dimensional point. This implementation contains methods for accessing the properties of a point, comparison operators, a stream output operator, and a method for modifying the position of a point:
class point3d
{
int x_;
int y_;
int z_;
public:
point3d(int const x = 0,
int const y = 0,
int const z = 0):x_(x), y_(y), z_(z) {}
int x() const { return x_; }
point3d& x(int const...