]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/type_traits/test/check_type.hpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / type_traits / test / check_type.hpp
1
2 // (C) Copyright John Maddock 2000.
3 // Use, modification and distribution are subject to the
4 // Boost Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
7 #ifndef BOOST_CHECK_TYPE_HPP
8 #define BOOST_CHECK_TYPE_HPP
9
10 #include "test.hpp"
11 #include <boost/type_traits/is_same.hpp>
12
13 /*
14 macro:
15 BOOST_CHECK_TYPE(type_expression, expected_type)
16
17 type_expression: an expression that evaluates to a typename.
18 expected_value: the type we expect to find.
19 */
20
21 #ifdef __BORLANDC__
22 #pragma option -w-8008 -w-8066 -w-8019
23 #endif
24
25
26 #define BOOST_CHECK_TYPE(type_expression, expected_type)\
27 do{\
28 if(!::boost::is_same< type_expression, expected_type >::value){\
29 BOOST_CHECK_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression)\
30 << "\" did not have the expected type:\n\tevaluating: boost::is_same<"\
31 << BOOST_STRINGIZE(type_expression) << ", " << BOOST_STRINGIZE(expected_type)\
32 << ">" << "\n\tfound: "\
33 << typeid(::boost::is_same< type_expression, expected_type >).name());\
34 }else\
35 BOOST_CHECK_MESSAGE(true, "Validating Type Expression: \""\
36 << BOOST_STRINGIZE(expression) << "\"");\
37 }while(0)
38
39 #define BOOST_CHECK_TYPE3(type_expression, type_expression_suffix, expected_type)\
40 do{\
41 if(!::boost::is_same< type_expression, type_expression_suffix, expected_type >::value){\
42 BOOST_CHECK_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression)\
43 << "\" did not have the expected type:\n\tevaluating: boost::is_same<"\
44 << BOOST_STRINGIZE((type_expression, type_expression_suffix)) << ", " << BOOST_STRINGIZE(expected_type)\
45 << ">" << "\n\tfound: "\
46 << typeid(::boost::is_same< type_expression, type_expression_suffix, expected_type >).name());\
47 }else\
48 BOOST_CHECK_MESSAGE(true, "Validating Type Expression: \""\
49 << BOOST_STRINGIZE(expression) << "\"");\
50 }while(0)
51
52 #define BOOST_CHECK_TYPE4(type_expression, suffix1, suffix2, expected_type)\
53 do{\
54 if(!::boost::is_same< type_expression, suffix1, suffix2, expected_type >::value){\
55 BOOST_CHECK_MESSAGE(false, "The expression: \"" << BOOST_STRINGIZE(expression)\
56 << "\" did not have the expected type:\n\tevaluating: boost::is_same<"\
57 << BOOST_STRINGIZE((type_expression, suffix1, suffix2)) << ", " << BOOST_STRINGIZE(expected_type)\
58 << ">" << "\n\tfound: "\
59 << typeid(::boost::is_same< type_expression, suffix1, suffix2, expected_type >).name());\
60 }else\
61 BOOST_CHECK_MESSAGE(true, "Validating Type Expression: \""\
62 << BOOST_STRINGIZE(expression) << "\"");\
63 }while(0)
64
65 #endif
66
67