]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/log/test/compile/src_logger_get_attributes.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / log / test / compile / src_logger_get_attributes.cpp
1 /*
2 * Copyright Andrey Semashev 2007 - 2015.
3 * Distributed under the Boost Software License, Version 1.0.
4 * (See accompanying file LICENSE_1_0.txt or copy at
5 * http://www.boost.org/LICENSE_1_0.txt)
6 */
7 /*!
8 * \file src_logger_get_attributes.cpp
9 * \author Andrey Semashev
10 * \date 01.03.2014
11 *
12 * \brief This header contains a test for logger \c get_attributes method.
13 */
14
15 #include <boost/log/sources/logger.hpp>
16 #include <boost/log/sources/severity_logger.hpp>
17 #include <boost/log/sources/channel_logger.hpp>
18 #include <boost/log/sources/severity_channel_logger.hpp>
19
20 template< typename LoggerT >
21 void test()
22 {
23 LoggerT lg;
24
25 // Test that get_attributes(), which is a const method, can acquire the internal mutex in the threading model.
26 lg.get_attributes();
27 }
28
29 int main(int, char*[])
30 {
31 test< boost::log::sources::logger >();
32 test< boost::log::sources::severity_logger< > >();
33 test< boost::log::sources::channel_logger< > >();
34 test< boost::log::sources::severity_channel_logger< > >();
35
36 #if !defined(BOOST_LOG_NO_THREADS)
37 test< boost::log::sources::logger_mt >();
38 test< boost::log::sources::severity_logger_mt< > >();
39 test< boost::log::sources::channel_logger_mt< > >();
40 test< boost::log::sources::severity_channel_logger_mt< > >();
41 #endif
42
43 return 0;
44 }