]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/core/test/sp_typeinfo_test.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / core / test / sp_typeinfo_test.cpp
1 //
2 // sp_typeinfo_test.cpp
3 //
4 // Copyright (c) 2009 Peter Dimov
5 //
6 // Distributed under the Boost Software License, Version 1.0.
7 // See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt
9 //
10
11 #define BOOST_ALLOW_DEPRECATED_HEADERS
12
13 #include <boost/detail/sp_typeinfo.hpp>
14 #include <boost/detail/lightweight_test.hpp>
15 #include <iostream>
16
17 int main()
18 {
19 BOOST_TEST( BOOST_SP_TYPEID( int ) == BOOST_SP_TYPEID( int ) );
20 BOOST_TEST( BOOST_SP_TYPEID( int ) != BOOST_SP_TYPEID( long ) );
21 BOOST_TEST( BOOST_SP_TYPEID( int ) != BOOST_SP_TYPEID( void ) );
22
23 boost::detail::sp_typeinfo const & ti = BOOST_SP_TYPEID( int );
24
25 boost::detail::sp_typeinfo const * pti = &BOOST_SP_TYPEID( int );
26 BOOST_TEST( *pti == ti );
27
28 BOOST_TEST( ti == ti );
29 BOOST_TEST( !( ti != ti ) );
30 BOOST_TEST( !ti.before( ti ) );
31
32 char const * nti = ti.name();
33 std::cout << nti << std::endl;
34
35 boost::detail::sp_typeinfo const & tv = BOOST_SP_TYPEID( void );
36
37 boost::detail::sp_typeinfo const * ptv = &BOOST_SP_TYPEID( void );
38 BOOST_TEST( *ptv == tv );
39
40 BOOST_TEST( tv == tv );
41 BOOST_TEST( !( tv != tv ) );
42 BOOST_TEST( !tv.before( tv ) );
43
44 char const * ntv = tv.name();
45 std::cout << ntv << std::endl;
46
47 BOOST_TEST( ti != tv );
48 BOOST_TEST( !( ti == tv ) );
49
50 BOOST_TEST( ti.before( tv ) != tv.before( ti ) );
51
52 return boost::report_errors();
53 }