]> git.proxmox.com Git - ceph.git/blame - 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
CommitLineData
7c673cae
FG
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
13class x {
14};
15
16void
17test1(const x & x1, const x & x2){
18 BOOST_CHECK(& x1 == & x2);
19}
20
21int
22test_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}