• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //  (C) Copyright Raffi Enficiaud 2019.
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 #define BOOST_TEST_MODULE basic_smoke_test4
9 #include <boost/test/included/unit_test.hpp>
10 #include <boost/type_traits/is_same.hpp>
11 #include <boost/mpl/list.hpp>
12 
13 template <class U, class V>
14 struct my_struct {
15     typedef typename boost::is_same<U, V>::type type;
16 };
17 
18 typedef boost::mpl::list<
19     my_struct<int, int>,
20     my_struct<int, float>,
21     my_struct<float, float>,
22     my_struct<char, float>
23     > test_types;
24 
BOOST_AUTO_TEST_CASE_TEMPLATE(test,T,test_types)25 BOOST_AUTO_TEST_CASE_TEMPLATE(test, T, test_types)
26 {
27     BOOST_TEST((T::type::value));
28 }
29 
30 BOOST_AUTO_TEST_SUITE(some_suite)
31 
32 typedef boost::mpl::list<
33     my_struct<float, int>,
34     my_struct<int, float>,
35     my_struct<float, float>,
36     my_struct<char, char>
37     > test_types2;
38 
BOOST_AUTO_TEST_CASE_TEMPLATE(test,T,test_types2)39 BOOST_AUTO_TEST_CASE_TEMPLATE(test, T, test_types2)
40 {
41     BOOST_TEST((T::type::value));
42 }
43 
44 BOOST_AUTO_TEST_SUITE_END();