Boost.Test > Examples > unit_test_example1
Boost Test logo

The Unit Test Framework example 1

Rationale: this simple introductory example demonstrate several basic concepts of the Unit Test Framework:
  • usage of init_unit_test_framework to create and initialize test suite
  • test case creation based on free function
  • usage of basic test tools in test case
  • usage of "number of expected failures" feature
Input: This example does not require any input
Output: Running 1 test case...
.../unit_test_example1.cpp(17): error in "free_test_function": test 2 == 1 failed

*** No errors detected
Source: unit_test_example_01.cpp