From a7e4879e55a54ff930e6f6ff2f48e5730df39632 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 21 Sep 2021 15:06:28 +0300 Subject: [PATCH] Fix message comparisons in std_interop_test --- test/std_interop_test.cpp | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/test/std_interop_test.cpp b/test/std_interop_test.cpp index 5e5fa9d..bc0e8ab 100644 --- a/test/std_interop_test.cpp +++ b/test/std_interop_test.cpp @@ -83,34 +83,13 @@ static void test_system_category() BOOST_TEST_CSTR_EQ( bt.name(), st.name() ); + for( int ev = 1; ev < 6; ++ev ) { - int ev = 5; - BOOST_TEST_EQ( bt.message( ev ), st.message( ev ) ); + std::string bm = bt.message( ev ); + std::string sm = st.message( ev ); - { - boost::system::error_code bc( ev, bt ); - - BOOST_TEST_EQ( bc.value(), ev ); - BOOST_TEST_EQ( &bc.category(), &bt ); - - std::error_code sc( bc ); - - BOOST_TEST_EQ( sc.value(), ev ); - BOOST_TEST_EQ( &sc.category(), &st ); - } - - { - boost::system::error_condition bn = bt.default_error_condition( ev ); - BOOST_TEST( bt.equivalent( ev, bn ) ); - - std::error_condition sn( bn ); - BOOST_TEST( st.equivalent( ev, sn ) ); - } - } - - { - int ev = 4; - BOOST_TEST_EQ( bt.message( ev ), st.message( ev ) ); + // We strip whitespace and the trailing dot, MSVC not so much + BOOST_TEST_EQ( bm, sm.substr( 0, bm.size() ) ); { boost::system::error_code bc( ev, bt );