Boost logo

Boost-Commit :

From: gennadiy.rozental_at_[hidden]
Date: 2007-11-24 14:49:25


Author: rogeeff
Date: 2007-11-24 14:49:24 EST (Sat, 24 Nov 2007)
New Revision: 41343
URL: http://svn.boost.org/trac/boost/changeset/41343

Log:
switch to nasic_cstring.hpp instead of fwd header
added failed expression to the system error
system_error is caught and reported in cpp_main.ipp
64 bit compatibility issue in debug.ipp fixed
missing headers in algorithm.hpp added
Text files modified:
   trunk/boost/test/debug.hpp | 2 +-
   trunk/boost/test/exception_safety.hpp | 2 +-
   trunk/boost/test/execution_monitor.hpp | 7 ++++---
   trunk/boost/test/impl/cpp_main.ipp | 13 +++++++++----
   trunk/boost/test/impl/debug.ipp | 2 +-
   trunk/boost/test/impl/execution_monitor.ipp | 7 +++++--
   trunk/boost/test/utils/algorithm.hpp | 3 +++
   trunk/boost/test/utils/runtime/cla/validation.ipp | 1 +
   trunk/boost/test/utils/runtime/config.hpp | 1 +
   9 files changed, 26 insertions(+), 12 deletions(-)

Modified: trunk/boost/test/debug.hpp
==============================================================================
--- trunk/boost/test/debug.hpp (original)
+++ trunk/boost/test/debug.hpp 2007-11-24 14:49:24 EST (Sat, 24 Nov 2007)
@@ -18,7 +18,7 @@
 // Boost.Test
 #include <boost/test/detail/config.hpp>
 #include <boost/test/utils/callback.hpp>
-#include <boost/test/utils/basic_cstring/basic_cstring_fwd.hpp>
+#include <boost/test/utils/basic_cstring/basic_cstring.hpp>
 
 // STL
 #include <string>

Modified: trunk/boost/test/exception_safety.hpp
==============================================================================
--- trunk/boost/test/exception_safety.hpp (original)
+++ trunk/boost/test/exception_safety.hpp 2007-11-24 14:49:24 EST (Sat, 24 Nov 2007)
@@ -19,7 +19,7 @@
 #include <boost/test/detail/config.hpp>
 
 #include <boost/test/utils/callback.hpp>
-#include <boost/test/utils/basic_cstring/basic_cstring_fwd.hpp>
+#include <boost/test/utils/basic_cstring/basic_cstring.hpp>
 
 // STL
 #include <memory>

Modified: trunk/boost/test/execution_monitor.hpp
==============================================================================
--- trunk/boost/test/execution_monitor.hpp (original)
+++ trunk/boost/test/execution_monitor.hpp 2007-11-24 14:49:24 EST (Sat, 24 Nov 2007)
@@ -237,12 +237,13 @@
 class system_error {
 public:
     // Constructor
- system_error();
+ explicit system_error( char const* exp );
 
- unit_test::readonly_property<long> p_errno;
+ unit_test::readonly_property<long> p_errno;
+ unit_test::readonly_property<char const*> p_failed_exp;
 };
 
-#define BOOST_TEST_SYS_ASSERT( exp ) if( (exp) ) ; else throw ::boost::system_error()
+#define BOOST_TEST_SYS_ASSERT( exp ) if( (exp) ) ; else throw ::boost::system_error( BOOST_STRINGIZE( exp ) )
 
 } // namespace boost
 

Modified: trunk/boost/test/impl/cpp_main.ipp
==============================================================================
--- trunk/boost/test/impl/cpp_main.ipp (original)
+++ trunk/boost/test/impl/cpp_main.ipp 2007-11-24 14:49:24 EST (Sat, 24 Nov 2007)
@@ -28,15 +28,14 @@
 // STL
 #include <iostream>
 #include <cstdlib> // std::getenv
-
-#include <boost/test/detail/suppress_warnings.hpp>
+#include <cstring> // std::strerror
 
 #include <boost/test/detail/suppress_warnings.hpp>
 
 //____________________________________________________________________________//
 
 #ifdef BOOST_NO_STDC_NAMESPACE
-namespace std { using ::getenv; }
+namespace std { using ::getenv; using ::strerror; }
 #endif
 
 namespace {
@@ -89,7 +88,13 @@
         std::cout << "\n**** exception(" << exex.code() << "): " << exex.what() << std::endl;
         result = ::boost::exit_exception_failure;
     }
-
+ catch( ::boost::system_error const& ex ) {
+ std::cout << "\n**** failed to initialize execution monitor."
+ << "\n**** expression at fault: " << ex.p_failed_exp
+ << "\n**** error(" << ex.p_errno << "): " << std::strerror( ex.p_errno ) << std::endl;
+ result = ::boost::exit_exception_failure;
+ }
+
     if( result != ::boost::exit_success ) {
         std::cerr << "******** errors detected; see standard output for details ********" << std::endl;
     }

Modified: trunk/boost/test/impl/debug.ipp
==============================================================================
--- trunk/boost/test/impl/debug.ipp (original)
+++ trunk/boost/test/impl/debug.ipp 2007-11-24 14:49:24 EST (Sat, 24 Nov 2007)
@@ -315,7 +315,7 @@
     else
         ++it;
 
- ::snprintf( title_str, sizeof(title_str), "%*s %ld", dsi.binary_path.end()-it, it, dsi.pid );
+ ::snprintf( title_str, sizeof(title_str), "%*s %ld", (int)(dsi.binary_path.end()-it), it, dsi.pid );
 
     return title_str;
 }

Modified: trunk/boost/test/impl/execution_monitor.ipp
==============================================================================
--- trunk/boost/test/impl/execution_monitor.ipp (original)
+++ trunk/boost/test/impl/execution_monitor.ipp 2007-11-24 14:49:24 EST (Sat, 24 Nov 2007)
@@ -1108,7 +1108,9 @@
     catch( std::exception const& ex )
       { detail::report_error( execution_exception::cpp_exception_error, "std::exception: %s", ex.what() ); }
     catch( system_error const& ex )
- { detail::report_error( execution_exception::cpp_exception_error, "system_error: %s", std::strerror( ex.p_errno ) ); }
+ { detail::report_error( execution_exception::cpp_exception_error, "system_error produced by: %s: %s",
+ ex.p_failed_exp.get(),
+ std::strerror( ex.p_errno ) ); }
     catch( detail::system_signal_exception const& ex )
       { ex.report(); }
     catch( execution_aborted const& )
@@ -1128,12 +1130,13 @@
 // ************** system_error ************** //
 // ************************************************************************** //
 
-system_error::system_error()
+system_error::system_error( char const* exp )
 #ifdef UNDER_CE
 : p_errno( GetLastError() )
 #else
 : p_errno( errno )
 #endif
+, p_failed_exp( exp )
 {}
 
 

Modified: trunk/boost/test/utils/algorithm.hpp
==============================================================================
--- trunk/boost/test/utils/algorithm.hpp (original)
+++ trunk/boost/test/utils/algorithm.hpp 2007-11-24 14:49:24 EST (Sat, 24 Nov 2007)
@@ -16,6 +16,8 @@
 #define BOOST_ALGORITHM_HPP_062304GER
 
 #include <utility>
+#include <algorithm> // std::find
+#include <functional> // std::bind1st
 
 #include <boost/test/detail/suppress_warnings.hpp>
 
@@ -223,3 +225,4 @@
 
 #endif // BOOST_ALGORITHM_HPP_062304GER
 
+

Modified: trunk/boost/test/utils/runtime/cla/validation.ipp
==============================================================================
--- trunk/boost/test/utils/runtime/cla/validation.ipp (original)
+++ trunk/boost/test/utils/runtime/cla/validation.ipp 2007-11-24 14:49:24 EST (Sat, 24 Nov 2007)
@@ -20,6 +20,7 @@
 
 #include <boost/test/utils/runtime/cla/argv_traverser.hpp>
 #include <boost/test/utils/runtime/cla/validation.hpp>
+#include <boost/test/utils/runtime/validation.hpp> // BOOST_RT_PARAM_NAMESPACE::logic_error
 
 // Boost
 #include <boost/test/utils/basic_cstring/io.hpp>

Modified: trunk/boost/test/utils/runtime/config.hpp
==============================================================================
--- trunk/boost/test/utils/runtime/config.hpp (original)
+++ trunk/boost/test/utils/runtime/config.hpp 2007-11-24 14:49:24 EST (Sat, 24 Nov 2007)
@@ -28,6 +28,7 @@
 #include <boost/test/detail/config.hpp>
 #include <boost/test/utils/basic_cstring/basic_cstring.hpp>
 #include <boost/test/utils/wrap_stringstream.hpp>
+#include <boost/test/utils/basic_cstring/io.hpp> // operator<<(boost::runtime::cstring)
 
 // STL
 #include <string>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk