From 337e0ddc59e1f20b62bb8df505139b6026add140 Mon Sep 17 00:00:00 2001 From: Gennadiy Rozental Date: Wed, 5 Oct 2011 09:34:51 +0000 Subject: [PATCH 1/5] eliminated unit_test_framework and BOOST_MESSAGE [SVN r74724] --- test/ios_state_unit_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/ios_state_unit_test.cpp b/test/ios_state_unit_test.cpp index 72ce7b5..6a2451d 100644 --- a/test/ios_state_unit_test.cpp +++ b/test/ios_state_unit_test.cpp @@ -639,14 +639,14 @@ ios_word_saver_unit_test // Unit test program -boost::unit_test_framework::test_suite * +boost::unit_test::test_suite * init_unit_test_suite ( int , // "argc" is unused char * [] // "argv" is unused ) { - boost::unit_test_framework::test_suite * test + boost::unit_test::test_suite * test = BOOST_TEST_SUITE( "I/O state saver test" ); test->add( BOOST_TEST_CASE(ios_flags_saver_unit_test) ); From 6e3e9c2ce71cd4dac020f80a6eb517ae199a9934 Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Thu, 14 Mar 2013 12:53:24 +0000 Subject: [PATCH 2/5] Editorial. Tweak spacing. [SVN r83424] --- doc/quoted_manip.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/quoted_manip.html b/doc/quoted_manip.html index c3e7362..14a3380 100644 --- a/doc/quoted_manip.html +++ b/doc/quoted_manip.html @@ -83,17 +83,20 @@ be preceded by an escape character, as will the escape character itself:

// manipulator for const std::basic_string& template <class Char, class Traits, class Alloc> - unspecified-type1 quoted(const std::basic_string<Char, Traits, Alloc>& string, Char escape='\\', Char delim='\"'); + unspecified-type1 quoted(const std::basic_string<Char, Traits, Alloc>& string, + Char escape='\\', Char delim='\"'); // manipulator for const C-string* template <class Char> - unspecified-type2 quoted(const Char* string, Char escape='\\', Char delim='\"'); + unspecified-type2 quoted(const Char* string, + Char escape='\\', Char delim='\"'); // manipulator for non-const std::basic_string& template <class Char, class Traits, class Alloc> - unspecified-type3 quoted(std::basic_string<Char, Traits, Alloc>& string, Char escape='\\', Char delim='\"'); + unspecified-type3 quoted(std::basic_string<Char, Traits, Alloc>& string, + Char escape='\\', Char delim='\"'); } }

unspecified_type1, unspecified_type2, @@ -155,7 +158,7 @@ form of the templates.

Distributed under the Boost Software License, Version 1.0. See www.boost.org/LICENSE_1_0.txt

Revised -20 June 2010

+08 March 2013

\ No newline at end of file From 9b8b326ecc403228ce9cf16dda0fceb686dc0a51 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Mon, 18 Aug 2014 15:00:09 +0100 Subject: [PATCH 3/5] Add metadata file. --- meta/libraries.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 meta/libraries.json diff --git a/meta/libraries.json b/meta/libraries.json new file mode 100644 index 0000000..1e2b3e9 --- /dev/null +++ b/meta/libraries.json @@ -0,0 +1,15 @@ +{ + "key": "io", + "name": "IO State Savers", + "authors": [ + "Daryle Walker" + ], + "description": "The I/O sub-library of Boost helps segregate the large number of Boost headers. This sub-library should contain various items to use with/for the standard I/O library.", + "documentation": "doc/ios_state.html", + "category": [ + "IO" + ], + "maintainers": [ + "Daryle Walker " + ] +} From 820699b385204c74dc338d7617bc8bdea7b77c7c Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Thu, 27 Oct 2016 11:25:27 -0400 Subject: [PATCH 4/5] Fix for gcc and clang. Right now gcc throws an old ABI version of std::ios_base::failure even when the version being used is the newer ABI version of std::ios_base::failure. I have been told that this will be fixed in gcc-7. --- test/ios_state_test.cpp | 15 +++++++++++++-- test/ios_state_unit_test.cpp | 14 ++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/test/ios_state_test.cpp b/test/ios_state_test.cpp index 1f7fa84..ea0701f 100644 --- a/test/ios_state_test.cpp +++ b/test/ios_state_test.cpp @@ -10,6 +10,7 @@ // 15 Jun 2003 Adjust to changes in Boost.Test (Daryle Walker) // 26 Feb 2002 Initial version (Daryle Walker) +#include #include // main, BOOST_CHECK, etc. #include // for boost::exit_success @@ -24,7 +25,9 @@ #include // for std::endl, std::ostream #include // for std::streambuf #include // for std::string - +#if defined(BOOST_GCC) +#include +#endif // Facet with the bool names spelled backwards class backward_bool_names @@ -181,11 +184,15 @@ saver_tests_1 boost::io::ios_exception_saver const ies( output ); boost::io::ios_iostate_saver const iis( output ); - output.exceptions( ios_base::eofbit ); + output.exceptions( ios_base::eofbit | ios_base::badbit ); output.setstate( ios_base::eofbit ); BOOST_ERROR( "previous line should have thrown" ); } +#if defined(BOOST_GCC) || (defined(BOOST_CLANG) && defined(BOOST_GNU_STDLIB)) + catch ( std::exception &f ) +#else catch ( ios_base::failure &f ) +#endif { err << "Got the expected I/O failure: \"" << f.what() << "\".\n"; BOOST_CHECK( output.exceptions() == ios_base::goodbit ); @@ -243,7 +250,11 @@ saver_tests_2 BOOST_ERROR( "previous line should have thrown" ); } +#if defined(BOOST_GCC) || (defined(BOOST_CLANG) && defined(BOOST_GNU_STDLIB)) + catch ( std::exception &f ) +#else catch ( ios_base::failure &f ) +#endif { err << "Got the expected I/O failure: \"" << f.what() << "\".\n"; BOOST_CHECK( output.exceptions() == ios_base::goodbit ); diff --git a/test/ios_state_unit_test.cpp b/test/ios_state_unit_test.cpp index 6a2451d..d2de756 100644 --- a/test/ios_state_unit_test.cpp +++ b/test/ios_state_unit_test.cpp @@ -9,6 +9,7 @@ // Revision History // 12 Sep 2003 Initial version (Daryle Walker) +#include #include // for boost::io::ios_flags_saver, etc. #include // for main, BOOST_CHECK, etc. @@ -19,6 +20,9 @@ #include // for std::iostream #include // for std::locale, std::numpunct #include // for std::stringstream, etc. +#if defined(BOOST_GCC) +#include +#endif // Global constants @@ -226,9 +230,14 @@ ios_exception_saver_unit_test { boost::io::ios_iostate_saver iis( ss ); + ss.exceptions( ios_base::failbit | ios_base::badbit ); char c; +#if defined(BOOST_GCC) || (defined(BOOST_CLANG) && defined(BOOST_GNU_STDLIB)) + BOOST_CHECK_THROW( ss >> c, std::exception ); +#else BOOST_CHECK_THROW( ss >> c, std::ios_base::failure ); +#endif } } @@ -575,9 +584,14 @@ ios_all_saver_unit_test { boost::io::ios_iostate_saver iis( ss ); + ss.exceptions( ios_base::failbit | ios_base::badbit ); char c; +#if defined(BOOST_GCC) || (defined(BOOST_CLANG) && defined(BOOST_GNU_STDLIB)) + BOOST_CHECK_THROW( ss >> c, std::exception ); +#else BOOST_CHECK_THROW( ss >> c, std::ios_base::failure ); +#endif } ss.tie( &clog ); From 436e153c3e304dbbd003351c79ea9fe5cfe6ec88 Mon Sep 17 00:00:00 2001 From: Edward Diener Date: Thu, 10 Nov 2016 13:08:08 -0500 Subject: [PATCH 5/5] Updated code for inclusion of stdexcept --- test/ios_state_test.cpp | 2 +- test/ios_state_unit_test.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/ios_state_test.cpp b/test/ios_state_test.cpp index ea0701f..79975f0 100644 --- a/test/ios_state_test.cpp +++ b/test/ios_state_test.cpp @@ -25,7 +25,7 @@ #include // for std::endl, std::ostream #include // for std::streambuf #include // for std::string -#if defined(BOOST_GCC) +#if defined(BOOST_GCC) || (defined(BOOST_CLANG) && defined(BOOST_GNU_STDLIB)) #include #endif diff --git a/test/ios_state_unit_test.cpp b/test/ios_state_unit_test.cpp index d2de756..6aa2011 100644 --- a/test/ios_state_unit_test.cpp +++ b/test/ios_state_unit_test.cpp @@ -20,7 +20,7 @@ #include // for std::iostream #include // for std::locale, std::numpunct #include // for std::stringstream, etc. -#if defined(BOOST_GCC) +#if defined(BOOST_GCC) || (defined(BOOST_CLANG) && defined(BOOST_GNU_STDLIB)) #include #endif