]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/assert/test/source_location_test4.cpp
1 // Copyright 2022 Peter Dimov
2 // Distributed under the Boost Software License, Version 1.0.
3 // http://www.boost.org/LICENSE_1_0.txt
5 #include <boost/assert/source_location.hpp>
6 #include <boost/core/lightweight_test.hpp>
7 #include <boost/config.hpp>
9 boost::source_location s_loc
= BOOST_CURRENT_LOCATION
;
11 BOOST_STATIC_CONSTEXPR
boost::source_location c_loc
= BOOST_CURRENT_LOCATION
;
13 boost::source_location
f( boost::source_location
const& loc
= BOOST_CURRENT_LOCATION
)
21 BOOST_TEST_CSTR_EQ( s_loc
.file_name(), __FILE__
);
22 BOOST_TEST_EQ( s_loc
.line(), 9 );
24 #if defined(BOOST_GCC) && BOOST_GCC < 90000
25 // '__static_initialization_and_destruction_0'
27 BOOST_TEST_CSTR_EQ( s_loc
.function_name(), "" );
32 BOOST_TEST_CSTR_EQ( c_loc
.file_name(), __FILE__
);
33 BOOST_TEST_EQ( c_loc
.line(), 11 );
37 boost::source_location loc
= f();
39 BOOST_TEST_CSTR_EQ( loc
.file_name(), __FILE__
);
40 BOOST_TEST( loc
.line() == 13 || loc
.line() == 37 );
43 return boost::report_errors();