]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/serialization/test/test_singleton.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / serialization / test / test_singleton.cpp
1 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
2 // test_singleton.cpp: test implementation of run-time casting of void pointers
3
4 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
5 // Use, modification and distribution is subject to the Boost Software
6 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8 // <gennadiy.rozental@tfn.com>
9
10 #include "test_tools.hpp"
11 #include <boost/serialization/singleton.hpp>
12
13 class x {
14 };
15
16 void
17 test1(const x & x1, const x & x2){
18 BOOST_CHECK(& x1 == & x2);
19 }
20
21 int
22 test_main( int /* argc */, char* /* argv */[] )
23 {
24 const x & x1 = boost::serialization::singleton<x>::get_const_instance();
25 const x & x2 = boost::serialization::singleton<x>::get_const_instance();
26
27 BOOST_CHECK(& x1 == & x2);
28
29 test1(
30 boost::serialization::singleton<x>::get_const_instance(),
31 boost::serialization::singleton<x>::get_const_instance()
32 );
33
34 return EXIT_SUCCESS;
35 }