Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71376 - in trunk: boost/filesystem/v3 libs/filesystem/v3/src
From: bdawes_at_[hidden]
Date: 2011-04-18 22:05:56


Author: bemandawes
Date: 2011-04-18 22:05:55 EDT (Mon, 18 Apr 2011)
New Revision: 71376
URL: http://svn.boost.org/trac/boost/changeset/71376

Log:
Change BOOST_ASSERT to BOOST_ASSERT_MSG when there was a && "..."
Text files modified:
   trunk/boost/filesystem/v3/operations.hpp | 34 +++++++++++++++++++++-------------
   trunk/libs/filesystem/v3/src/operations.cpp | 4 ++--
   trunk/libs/filesystem/v3/src/path.cpp | 9 +++++----
   3 files changed, 28 insertions(+), 19 deletions(-)

Modified: trunk/boost/filesystem/v3/operations.hpp
==============================================================================
--- trunk/boost/filesystem/v3/operations.hpp (original)
+++ trunk/boost/filesystem/v3/operations.hpp 2011-04-18 22:05:55 EDT (Mon, 18 Apr 2011)
@@ -623,7 +623,7 @@
       directory_entry,
       boost::single_pass_traversal_tag >::reference dereference() const
     {
- BOOST_ASSERT(m_imp.get() && "attempt to dereference end iterator");
+ BOOST_ASSERT_MSG(m_imp.get(), "attempt to dereference end iterator");
       return m_imp->dir_entry;
     }
 
@@ -706,7 +706,8 @@
     inline
     void recur_dir_itr_imp::pop()
     {
- BOOST_ASSERT(m_level > 0 && "pop() on recursive_directory_iterator with level < 1");
+ BOOST_ASSERT_MSG(m_level > 0,
+ "pop() on recursive_directory_iterator with level < 1");
 
       do
       {
@@ -766,20 +767,23 @@
 
     recursive_directory_iterator& increment(system::error_code& ec)
     {
- BOOST_ASSERT(m_imp.get() && "increment() on end recursive_directory_iterator");
+ BOOST_ASSERT_MSG(m_imp.get(),
+ "increment() on end recursive_directory_iterator");
       m_imp->increment(&ec);
       return *this;
     }
 
     int level() const
     {
- BOOST_ASSERT(m_imp.get() && "level() on end recursive_directory_iterator");
+ BOOST_ASSERT_MSG(m_imp.get(),
+ "level() on end recursive_directory_iterator");
       return m_imp->m_level;
     }
 
     bool no_push_pending() const
     {
- BOOST_ASSERT(m_imp.get() && "is_no_push_requested() on end recursive_directory_iterator");
+ BOOST_ASSERT_MSG(m_imp.get(),
+ "is_no_push_requested() on end recursive_directory_iterator");
       return (m_imp->m_options & symlink_option::_detail_no_push)
         == symlink_option::_detail_no_push;
     }
@@ -790,14 +794,16 @@
 
     void pop()
     {
- BOOST_ASSERT(m_imp.get() && "pop() on end recursive_directory_iterator");
+ BOOST_ASSERT_MSG(m_imp.get(),
+ "pop() on end recursive_directory_iterator");
       m_imp->pop();
       if (m_imp->m_stack.empty()) m_imp.reset(); // done, so make end iterator
     }
 
     void no_push(bool value=true)
     {
- BOOST_ASSERT(m_imp.get() && "no_push() on end recursive_directory_iterator");
+ BOOST_ASSERT_MSG(m_imp.get(),
+ "no_push() on end recursive_directory_iterator");
       if (value)
         m_imp->m_options |= symlink_option::_detail_no_push;
       else
@@ -806,15 +812,15 @@
 
     file_status status() const
     {
- BOOST_ASSERT(m_imp.get()
- && "status() on end recursive_directory_iterator");
+ BOOST_ASSERT_MSG(m_imp.get(),
+ "status() on end recursive_directory_iterator");
       return m_imp->m_stack.top()->status();
     }
 
     file_status symlink_status() const
     {
- BOOST_ASSERT(m_imp.get()
- && "symlink_status() on end recursive_directory_iterator");
+ BOOST_ASSERT_MSG(m_imp.get(),
+ "symlink_status() on end recursive_directory_iterator");
       return m_imp->m_stack.top()->symlink_status();
     }
 
@@ -832,13 +838,15 @@
       boost::single_pass_traversal_tag >::reference
     dereference() const
     {
- BOOST_ASSERT(m_imp.get() && "dereference of end recursive_directory_iterator");
+ BOOST_ASSERT_MSG(m_imp.get(),
+ "dereference of end recursive_directory_iterator");
       return *m_imp->m_stack.top();
     }
 
     void increment()
     {
- BOOST_ASSERT(m_imp.get() && "increment of end recursive_directory_iterator");
+ BOOST_ASSERT_MSG(m_imp.get(),
+ "increment of end recursive_directory_iterator");
       m_imp->increment(0);
       if (m_imp->m_stack.empty())
         m_imp.reset(); // done, so make end iterator

Modified: trunk/libs/filesystem/v3/src/operations.cpp
==============================================================================
--- trunk/libs/filesystem/v3/src/operations.cpp (original)
+++ trunk/libs/filesystem/v3/src/operations.cpp 2011-04-18 22:05:55 EDT (Mon, 18 Apr 2011)
@@ -1926,8 +1926,8 @@
   void directory_iterator_increment(directory_iterator& it,
     system::error_code* ec)
   {
- BOOST_ASSERT(it.m_imp.get() && "attempt to increment end iterator");
- BOOST_ASSERT(it.m_imp->handle != 0 && "internal program error");
+ BOOST_ASSERT_MSG(it.m_imp.get(), "attempt to increment end iterator");
+ BOOST_ASSERT_MSG(it.m_imp->handle != 0, "internal program error");
     
     path::string_type filename;
     file_status file_stat, symlink_file_stat;

Modified: trunk/libs/filesystem/v3/src/path.cpp
==============================================================================
--- trunk/libs/filesystem/v3/src/path.cpp (original)
+++ trunk/libs/filesystem/v3/src/path.cpp 2011-04-18 22:05:55 EDT (Mon, 18 Apr 2011)
@@ -428,8 +428,8 @@
   bool is_non_root_separator(const string_type & str, size_type pos)
     // pos is position of the separator
   {
- BOOST_ASSERT(!str.empty() && is_separator(str[pos])
- && "precondition violation");
+ BOOST_ASSERT_MSG(!str.empty() && is_separator(str[pos]),
+ "precondition violation");
 
     // subsequent logic expects pos to be for leftmost slash of a set
     while (pos > 0 && is_separator(str[pos-1]))
@@ -621,7 +621,8 @@
 
   void path::m_path_iterator_increment(path::iterator & it)
   {
- BOOST_ASSERT(it.m_pos < it.m_path_ptr->m_pathname.size() && "path::basic_iterator increment past end()");
+ BOOST_ASSERT_MSG(it.m_pos < it.m_path_ptr->m_pathname.size(),
+ "path::basic_iterator increment past end()");
 
     // increment to position past current element
     it.m_pos += it.m_element.m_pathname.size();
@@ -677,7 +678,7 @@
 
   void path::m_path_iterator_decrement(path::iterator & it)
   {
- BOOST_ASSERT(it.m_pos && "path::iterator decrement past begin()");
+ BOOST_ASSERT_MSG(it.m_pos, "path::iterator decrement past begin()");
 
     size_type end_pos(it.m_pos);
 


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