diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 71a36cc..309181c 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -124,6 +124,15 @@ project [ run header_only_test.cpp : : : -/boost/system//boost_system BOOST_NO_ANSI_APIS : header_only_test_no_ansi ] + [ run single_instance_test.cpp single_instance_1.cpp single_instance_2.cpp + : : : static : single_instance_test_static + ] + [ run single_instance_test.cpp single_instance_1.cpp single_instance_2.cpp + : : : shared : single_instance_test_shared + ] + [ run single_instance_test.cpp single_instance_1.cpp single_instance_2.cpp + : : : -/boost/system//boost_system BOOST_ERROR_CODE_HEADER_ONLY : single_instance_test_header + ] ; # Quick (CI) test diff --git a/test/single_instance_1.cpp b/test/single_instance_1.cpp new file mode 100644 index 0000000..35a7240 --- /dev/null +++ b/test/single_instance_1.cpp @@ -0,0 +1,22 @@ + +// Copyright 2018 Peter Dimov. +// Distributed under the Boost Software License, Version 1.0. + +#include + +using namespace boost::system; + +namespace lib1 +{ + +error_code get_system_code() +{ + return error_code( 0, system_category() ); +} + +error_code get_generic_code() +{ + return error_code( 0, generic_category() ); +} + +} // namespace lib1 diff --git a/test/single_instance_2.cpp b/test/single_instance_2.cpp new file mode 100644 index 0000000..91cbe24 --- /dev/null +++ b/test/single_instance_2.cpp @@ -0,0 +1,22 @@ + +// Copyright 2018 Peter Dimov. +// Distributed under the Boost Software License, Version 1.0. + +#include + +using namespace boost::system; + +namespace lib2 +{ + +error_code get_system_code() +{ + return error_code( 0, system_category() ); +} + +error_code get_generic_code() +{ + return error_code( 0, generic_category() ); +} + +} // namespace lib2 diff --git a/test/single_instance_test.cpp b/test/single_instance_test.cpp new file mode 100644 index 0000000..d5b67cf --- /dev/null +++ b/test/single_instance_test.cpp @@ -0,0 +1,32 @@ + +// Copyright 2018 Peter Dimov. +// Distributed under the Boost Software License, Version 1.0. + +#include +#include + +using namespace boost::system; + +namespace lib1 +{ + +error_code get_system_code(); +error_code get_generic_code(); + +} // namespace lib1 + +namespace lib2 +{ + +error_code get_system_code(); +error_code get_generic_code(); + +} // namespace lib2 + +int main() +{ + BOOST_TEST_EQ( lib1::get_system_code(), lib2::get_system_code() ); + BOOST_TEST_EQ( lib1::get_generic_code(), lib2::get_generic_code() ); + + return boost::report_errors(); +}