unit_test_example_15.cpp 1017 B

1234567891011121314151617181920212223242526272829303132
  1. // (C) Copyright Gennadiy Rozental 2015.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/test for the library home page.
  6. //
  7. // ***************************************************************************
  8. // Boost.Test
  9. #define BOOST_TEST_MODULE data driven test example
  10. #include <boost/test/included/unit_test.hpp>
  11. #include <boost/test/data/test_case.hpp>
  12. #include <boost/test/data/monomorphic.hpp>
  13. namespace data=boost::unit_test::data;
  14. namespace bt=boost::unit_test;
  15. //____________________________________________________________________________//
  16. double x_samples[] = {1.1,2.1,3.1,4.1};
  17. double y_samples[] = {10.1,9.1,8.1};
  18. auto& D = * bt::tolerance(1e-1);
  19. BOOST_DATA_TEST_CASE( data_driven_test, data::make(x_samples) * y_samples, x, y )
  20. {
  21. BOOST_TEST( x*y < 32.4 );
  22. }
  23. //____________________________________________________________________________//
  24. // EOF