diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 7064eb9..77e7ca6 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -41,7 +41,11 @@ project { local result ; - if gcc in $(properties) || clang in $(properties) + if 4.6 in $(properties) + { + result = -std=c++0x ; + } + else if gcc in $(properties) || clang in $(properties) { result = -std=c++11 ; } @@ -105,4 +109,16 @@ project [ run std_interop_test.cpp : : : shared : std_interop_test_shared ] + [ run std_mismatch_test.cpp + : : : static @cxx03 : std_mismatch_test_03 + ] + [ run std_mismatch_test.cpp + : : : shared @cxx03 : std_mismatch_test_shared_03 + ] + [ run std_mismatch_test.cpp + : : : static @cxx11 : std_mismatch_test_11 + ] + [ run std_mismatch_test.cpp + : : : shared @cxx11 : std_mismatch_test_shared_11 + ] ; diff --git a/test/std_mismatch_test.cpp b/test/std_mismatch_test.cpp new file mode 100644 index 0000000..13f7091 --- /dev/null +++ b/test/std_mismatch_test.cpp @@ -0,0 +1,80 @@ + +// Copyright 2017 Peter Dimov. +// +// Distributed under the Boost Software License, Version 1.0. +// +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt + +// See library home page at http://www.boost.org/libs/system + +// Avoid spurious VC++ warnings +# define _CRT_SECURE_NO_WARNINGS + +#include +#include + +#if defined(BOOST_NO_CXX11_HDR_SYSTEM_ERROR) + +int main() +{ + std::cout + << "The version of the C++ standard library being used does not" + " support header so interoperation will not be tested.\n"; +} + +#else + +#include +#include +#include +#include +#include +#include + +static void test_generic_category() +{ + boost::system::error_category const & bt = boost::system::generic_category(); + std::error_category const & st = bt; + + BOOST_TEST_CSTR_EQ( bt.name(), st.name() ); + + int ev = ENOENT; + + BOOST_TEST_EQ( bt.message( ev ), st.message( ev ) ); + + boost::system::error_code bc( ev, bt ); + std::error_code sc( bc ); + + BOOST_TEST_EQ( bc.message(), sc.message() ); +} + +static void test_system_category() +{ + boost::system::error_category const & bt = boost::system::system_category(); + std::error_category const & st = bt; + + BOOST_TEST_CSTR_EQ( bt.name(), st.name() ); + + int ev = 5; + BOOST_TEST_EQ( bt.message( ev ), st.message( ev ) ); + + boost::system::error_code bc( ev, bt ); + std::error_code sc( bc ); + + BOOST_TEST_EQ( bc.message(), sc.message() ); +} + +int main() +{ + std::cout + << "The version of the C++ standard library being used" + " supports header so interoperation will be tested.\n"; + + test_generic_category(); + test_system_category(); + + return boost::report_errors(); +} + +#endif