|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67497 - in trunk: boost/filesystem/v2 boost/filesystem/v3 libs/filesystem/v2/src libs/filesystem/v3/test
From: bdawes_at_[hidden]
Date: 2010-12-29 21:05:36
Author: bemandawes
Date: 2010-12-29 21:05:34 EST (Wed, 29 Dec 2010)
New Revision: 67497
URL: http://svn.boost.org/trac/boost/changeset/67497
Log:
Clean up tabs, replace C-style assert with BOOST_ASSERT
Text files modified:
trunk/boost/filesystem/v2/convenience.hpp | 8 +++---
trunk/boost/filesystem/v2/path.hpp | 8 +++---
trunk/boost/filesystem/v3/operations.hpp | 3 +
trunk/libs/filesystem/v2/src/v2_operations.cpp | 6 ++--
trunk/libs/filesystem/v3/test/operations_test.cpp | 6 ++--
trunk/libs/filesystem/v3/test/path_unit_test.cpp | 42 ++++++++++++++++++++--------------------
6 files changed, 37 insertions(+), 36 deletions(-)
Modified: trunk/boost/filesystem/v2/convenience.hpp
==============================================================================
--- trunk/boost/filesystem/v2/convenience.hpp (original)
+++ trunk/boost/filesystem/v2/convenience.hpp 2010-12-29 21:05:34 EST (Wed, 29 Dec 2010)
@@ -86,11 +86,11 @@
# if !defined(_STLPORT_VERSION)
return ph.parent_path() / (basename(ph) + new_extension);
# else
- typedef BOOST_FS_TYPENAME Path::string_type string_type;
- string_type filename = basename(ph) + new_extension;
- return ph.parent_path() / filename;
+ typedef BOOST_FS_TYPENAME Path::string_type string_type;
+ string_type filename = basename(ph) + new_extension;
+ return ph.parent_path() / filename;
# endif
- }
+ }
# endif
# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
Modified: trunk/boost/filesystem/v2/path.hpp
==============================================================================
--- trunk/boost/filesystem/v2/path.hpp (original)
+++ trunk/boost/filesystem/v2/path.hpp 2010-12-29 21:05:34 EST (Wed, 29 Dec 2010)
@@ -24,12 +24,12 @@
#include <boost/shared_ptr.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/static_assert.hpp>
+#include <boost/assert.hpp>
#include <string>
#include <algorithm> // for lexicographical_compare
#include <iosfwd> // needed by basic_path inserter and extractor
#include <stdexcept>
-#include <cassert>
# ifndef BOOST_FILESYSTEM2_NARROW_ONLY
# include <locale>
@@ -916,7 +916,7 @@
boost::BOOST_FILESYSTEM2_NAMESPACE::basic_path<String, Traits>
path_type;
- assert( !str.empty() && str[pos] == slash<path_type>::value
+ BOOST_ASSERT( !str.empty() && str[pos] == slash<path_type>::value
&& "precondition violation" );
// subsequent logic expects pos to be for leftmost slash of a set
@@ -1380,7 +1380,7 @@
typedef typename Path::string_type string_type;
typedef typename Path::traits_type traits_type;
- assert( itr.m_pos < itr.m_path_ptr->m_path.size() && "basic_path::iterator increment past end()" );
+ BOOST_ASSERT( itr.m_pos < itr.m_path_ptr->m_path.size() && "basic_path::iterator increment past end()" );
bool was_net( itr.m_name.size() > 2
&& itr.m_name[0] == slash<Path>::value
@@ -1439,7 +1439,7 @@
template<class Path>
void iterator_helper<Path>::do_decrement( iterator & itr )
{
- assert( itr.m_pos && "basic_path::iterator decrement past begin()" );
+ BOOST_ASSERT( itr.m_pos && "basic_path::iterator decrement past begin()" );
typedef typename Path::string_type string_type;
typedef typename Path::traits_type traits_type;
Modified: trunk/boost/filesystem/v3/operations.hpp
==============================================================================
--- trunk/boost/filesystem/v3/operations.hpp (original)
+++ trunk/boost/filesystem/v3/operations.hpp 2010-12-29 21:05:34 EST (Wed, 29 Dec 2010)
@@ -807,7 +807,8 @@
{
BOOST_ASSERT(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
+ if (m_imp->m_stack.empty())
+ m_imp.reset(); // done, so make end iterator
}
bool equal(const recursive_directory_iterator& rhs) const
Modified: trunk/libs/filesystem/v2/src/v2_operations.cpp
==============================================================================
--- trunk/libs/filesystem/v2/src/v2_operations.cpp (original)
+++ trunk/libs/filesystem/v2/src/v2_operations.cpp 2010-12-29 21:05:34 EST (Wed, 29 Dec 2010)
@@ -45,6 +45,7 @@
#include <boost/filesystem/v2/operations.hpp>
#include <boost/scoped_array.hpp>
#include <boost/throw_exception.hpp>
+#include <boost/assert.hpp>
#include <boost/detail/workaround.hpp>
#include <cstdlib> // for malloc, free
@@ -93,7 +94,6 @@
#include <cstring>
#include <cstdio> // for remove, rename
#include <cerrno>
-#include <cassert>
// #include <iostream> // for debugging only; comment out when not in use
#ifdef BOOST_NO_STDC_NAMESPACE
@@ -294,7 +294,7 @@
if ( p1.handle != INVALID_HANDLE_VALUE
|| p2.handle != INVALID_HANDLE_VALUE )
{ return std::make_pair( ok, false ); }
- assert( p1.handle == INVALID_HANDLE_VALUE
+ BOOST_ASSERT( p1.handle == INVALID_HANDLE_VALUE
&& p2.handle == INVALID_HANDLE_VALUE );
{ return std::make_pair( error_code( error1, system_category()), false ); }
}
@@ -724,7 +724,7 @@
|| ((mode&~std::ios_base::binary)
== (std::ios_base::in|std::ios_base::out|std::ios_base::trunc)) )
disposition = CREATE_ALWAYS;
- else assert( 0 && "invalid mode argument" );
+ else BOOST_ASSERT( 0 && "invalid mode argument" );
HANDLE handle ( ::CreateFileW( ph.c_str(), access,
FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, 0,
Modified: trunk/libs/filesystem/v3/test/operations_test.cpp
==============================================================================
--- trunk/libs/filesystem/v3/test/operations_test.cpp (original)
+++ trunk/libs/filesystem/v3/test/operations_test.cpp 2010-12-29 21:05:34 EST (Wed, 29 Dec 2010)
@@ -632,7 +632,7 @@
BOOST_TEST(fs::is_symlink(from_ph));
BOOST_TEST(fs::exists(f1));
BOOST_TEST(fs::equivalent(from_ph, f1));
- BOOST_TEST(fs::read_symlink(from_ph) == f1);
+ BOOST_TEST(fs::read_symlink(from_ph) == f1);
fs::file_status stat = fs::symlink_status(from_ph);
BOOST_TEST(fs::exists(stat));
@@ -648,9 +648,9 @@
BOOST_TEST(!fs::is_other(stat));
BOOST_TEST(!fs::is_symlink(stat));
- // since create_symlink worked, copy_symlink should also work
+ // since create_symlink worked, copy_symlink should also work
fs::path symlink2_ph(dir / "symlink2");
- fs::copy_symlink(from_ph, symlink2_ph);
+ fs::copy_symlink(from_ph, symlink2_ph);
stat = fs::symlink_status(symlink2_ph);
BOOST_TEST(fs::is_symlink(stat));
BOOST_TEST(fs::exists(stat));
Modified: trunk/libs/filesystem/v3/test/path_unit_test.cpp
==============================================================================
--- trunk/libs/filesystem/v3/test/path_unit_test.cpp (original)
+++ trunk/libs/filesystem/v3/test/path_unit_test.cpp 2010-12-29 21:05:34 EST (Wed, 29 Dec 2010)
@@ -106,13 +106,13 @@
++::boost::detail::test_errors();
- std::cout << file << '(' << line << "): native() is not equal expected\n"
+ std::cout << file << '(' << line << "): native() is not equal expected\n"
" native---: " << std::hex;
- path::string_type nat(p.native());
- for (path::string_type::const_iterator it = nat.begin(); it != nat.end(); ++it)
+ path::string_type nat(p.native());
+ for (path::string_type::const_iterator it = nat.begin(); it != nat.end(); ++it)
std::cout << long(*it) << ' ';
std::cout << "\n expected-: ";
- for (path::string_type::const_iterator it = expected.begin(); it != expected.end(); ++it)
+ for (path::string_type::const_iterator it = expected.begin(); it != expected.end(); ++it)
std::cout << long(*it) << ' ';
std::cout << std::dec << std::endl;
}
@@ -682,22 +682,22 @@
test_codecvt cvt; // produces off-by-one values that will always differ from
// the system's default locale codecvt facet
- int t = 0;
+ int t = 0;
// constructors
- std::cout << " constructors test " << ++t << std::endl;
+ std::cout << " constructors test " << ++t << std::endl;
path p(c1, cvt);
NATIVE_IS(p, s1, ws1);
- std::cout << " test " << ++t << std::endl;
+ std::cout << " test " << ++t << std::endl;
path p1(s1.begin(), s1.end(), cvt);
NATIVE_IS(p1, s1, ws1);
- std::cout << " test " << ++t << std::endl;
+ std::cout << " test " << ++t << std::endl;
path p2(ws2, cvt);
NATIVE_IS(p2, s2, ws2);
- std::cout << " test " << ++t << std::endl;
+ std::cout << " test " << ++t << std::endl;
path p3(ws2.begin(), ws2.end(), cvt);
NATIVE_IS(p3, s2, ws2);
@@ -705,44 +705,44 @@
// assigns
p1.clear();
- std::cout << " assigns test " << ++t << std::endl;
+ std::cout << " assigns test " << ++t << std::endl;
p1.assign(s1,cvt);
NATIVE_IS(p1, s1, ws1);
p1.clear();
- std::cout << " test " << ++t << std::endl;
+ std::cout << " test " << ++t << std::endl;
p1.assign(s1.begin(), s1.end(), cvt);
NATIVE_IS(p1, s1, ws1);
// p1.assign(p, cvt); // fails to compile, and that is OK
// appends
p1.clear();
- std::cout << " appends test " << ++t << std::endl;
+ std::cout << " appends test " << ++t << std::endl;
p1.append(s1,cvt);
NATIVE_IS(p1, s1, ws1);
p1.clear();
- std::cout << " test " << ++t << std::endl;
+ std::cout << " test " << ++t << std::endl;
p1.append(s1.begin(), s1.end(), cvt);
NATIVE_IS(p1, s1, ws1);
// p1.append(p, cvt); // fails to compile, and that is OK
// native observers
- std::cout << " native observers test " << ++t << std::endl;
+ std::cout << " native observers test " << ++t << std::endl;
CHECK(p.string<std::string>(cvt) == s1);
- std::cout << " test " << ++t << std::endl;
+ std::cout << " test " << ++t << std::endl;
CHECK(p.string(cvt) == s1);
- std::cout << " test " << ++t << std::endl;
+ std::cout << " test " << ++t << std::endl;
CHECK(p.string<std::wstring>(cvt) == ws1);
- std::cout << " test " << ++t << std::endl;
+ std::cout << " test " << ++t << std::endl;
CHECK(p.wstring(cvt) == ws1);
// generic observers
- std::cout << " generic observers test " << ++t << std::endl;
+ std::cout << " generic observers test " << ++t << std::endl;
CHECK(p.generic_string<std::string>(cvt) == s1);
- std::cout << " test " << ++t << std::endl;
+ std::cout << " test " << ++t << std::endl;
CHECK(p.generic_string(cvt) == s1);
- std::cout << " test " << ++t << std::endl;
+ std::cout << " test " << ++t << std::endl;
CHECK(p.generic_string<std::wstring>(cvt) == ws1);
- std::cout << " test " << ++t << std::endl;
+ std::cout << " test " << ++t << std::endl;
CHECK(p.generic_wstring(cvt) == ws1);
std::cout << " codecvt arguments testing complete" << std::endl;
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