]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/core/test/sp_typeinfo_test.cpp
e29e576b4f8ffd3c955118cbf212643e3aabd21d
2 // sp_typeinfo_test.cpp
4 // Copyright (c) 2009 Peter Dimov
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
11 #include <boost/detail/sp_typeinfo.hpp>
12 #include <boost/detail/lightweight_test.hpp>
17 BOOST_TEST( BOOST_SP_TYPEID( int ) == BOOST_SP_TYPEID( int ) );
18 BOOST_TEST( BOOST_SP_TYPEID( int ) != BOOST_SP_TYPEID( long ) );
19 BOOST_TEST( BOOST_SP_TYPEID( int ) != BOOST_SP_TYPEID( void ) );
21 boost::detail::sp_typeinfo
const & ti
= BOOST_SP_TYPEID( int );
23 boost::detail::sp_typeinfo
const * pti
= &BOOST_SP_TYPEID( int );
24 BOOST_TEST( *pti
== ti
);
26 BOOST_TEST( ti
== ti
);
27 BOOST_TEST( !( ti
!= ti
) );
28 BOOST_TEST( !ti
.before( ti
) );
30 char const * nti
= ti
.name();
31 std::cout
<< nti
<< std::endl
;
33 boost::detail::sp_typeinfo
const & tv
= BOOST_SP_TYPEID( void );
35 boost::detail::sp_typeinfo
const * ptv
= &BOOST_SP_TYPEID( void );
36 BOOST_TEST( *ptv
== tv
);
38 BOOST_TEST( tv
== tv
);
39 BOOST_TEST( !( tv
!= tv
) );
40 BOOST_TEST( !tv
.before( tv
) );
42 char const * ntv
= tv
.name();
43 std::cout
<< ntv
<< std::endl
;
45 BOOST_TEST( ti
!= tv
);
46 BOOST_TEST( !( ti
== tv
) );
48 BOOST_TEST( ti
.before( tv
) != tv
.before( ti
) );
50 return boost::report_errors();