]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/dll/test/empty_library_info_test.cpp
1 // Copyright Antony Polukhin, 2020-2022
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt
5 // or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // For more information, see http://www.boost.org
9 #include "../example/b2_workarounds.hpp"
11 #include <boost/dll/library_info.hpp>
12 #include <boost/core/lightweight_test.hpp>
18 int main(int argc
, char* argv
[])
20 boost::dll::fs::path shared_library_path
= b2_workarounds::first_lib_from_argv(argc
, argv
);
21 BOOST_TEST(shared_library_path
.string().find("empty_library") != std::string::npos
);
23 boost::dll::library_info
lib_info(shared_library_path
);
24 std::vector
<std::string
> sec
= lib_info
.sections();
25 std::copy(sec
.begin(), sec
.end(), std::ostream_iterator
<std::string
>(std::cout
, ", "));
27 std::cout
<< "\n\n\n";
28 std::vector
<std::string
> symb
= lib_info
.symbols();
29 std::copy(symb
.begin(), symb
.end(), std::ostream_iterator
<std::string
>(std::cout
, "\n"));
31 symb
= lib_info
.symbols("boostdll");
32 BOOST_TEST(symb
.empty());
34 std::vector
<std::string
> empty
= lib_info
.symbols("empty");
35 BOOST_TEST(empty
.empty());
37 BOOST_TEST(lib_info
.symbols("section_that_does_not_exist").empty());
39 return boost::report_errors();