• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //  (C) Copyright Gennadiy Rozental 2001-2006.
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 
6 //  See http://www.boost.org/libs/test for the library home page.
7 
8 // Boost.Test
9 #ifdef BOOST_MSVC
10 # pragma warning(disable: C4345)
11 #endif
12 
13 #include <boost/test/unit_test.hpp>
14 using boost::unit_test::test_suite;
15 
16 // Boost.MPL
17 #include <boost/mpl/range_c.hpp>
18 
BOOST_TEST_CASE_TEMPLATE_FUNCTION(free_test_function,Number)19 BOOST_TEST_CASE_TEMPLATE_FUNCTION( free_test_function, Number )
20 {
21   BOOST_CHECK_EQUAL( 2, static_cast<int>(Number::value) );
22 }
23 
init_unit_test_suite(int,char * [])24 test_suite* init_unit_test_suite( int, char* [] )
25 {
26   test_suite* test= BOOST_TEST_SUITE( "Test case template example" );
27 
28   typedef boost::mpl::range_c<int,0,10> numbers;
29 
30   test->add( BOOST_TEST_CASE_TEMPLATE( free_test_function, numbers ) );
31 
32   return test;
33 }
34 
35 // EOF
36