Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55539 - sandbox/filesystem-v3/libs/filesystem/test
From: bdawes_at_[hidden]
Date: 2009-08-12 08:21:23


Author: bemandawes
Date: 2009-08-12 08:21:21 EDT (Wed, 12 Aug 2009)
New Revision: 55539
URL: http://svn.boost.org/trac/boost/changeset/55539

Log:
Apply lightweight_test changes before deleting file, so preserve changes in case deletion later reverted.
Text files modified:
   sandbox/filesystem-v3/libs/filesystem/test/wide_test.cpp | 57 +++++++++++++++++++--------------------
   1 files changed, 28 insertions(+), 29 deletions(-)

Modified: sandbox/filesystem-v3/libs/filesystem/test/wide_test.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/test/wide_test.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/test/wide_test.cpp 2009-08-12 08:21:21 EDT (Wed, 12 Aug 2009)
@@ -2,15 +2,14 @@
 
 // Copyright Beman Dawes 2005
 
-// Use, modification, and distribution is subject to the Boost Software
-// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
 
-// See library home page at http://www.boost.org/libs/filesystem
+// Library home page: http://www.boost.org/libs/filesystem
 
 //--------------------------------------------------------------------------------------//
 /*
- TO DO
+ TODO
 
    * Add test for scoped_path_locale.
                                                                                         */
@@ -29,7 +28,7 @@
 #include <boost/filesystem/operations.hpp>
 #include <boost/filesystem/fstream.hpp>
 #include <boost/scoped_array.hpp>
-#include <boost/test/minimal.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
 #include "../src/utf8_codecvt_facet.hpp"
 
@@ -68,37 +67,37 @@
   {
     Path tmp;
     tmp = file;
- BOOST_CHECK( tmp == file );
+ BOOST_TEST( tmp == file );
     tmp = file.string();
- BOOST_CHECK( tmp == file );
+ BOOST_TEST( tmp == file );
     tmp = file.string().c_str();
- BOOST_CHECK( tmp == file );
+ BOOST_TEST( tmp == file );
     fs::initial_path<Path>();
     fs::current_path<Path>();
     fs::remove( dir / file );
     fs::remove( dir );
- BOOST_CHECK( !fs::exists( dir / file ) );
- BOOST_CHECK( !fs::exists( dir ) );
- BOOST_CHECK( fs::create_directory( dir ) );
- BOOST_CHECK( fs::exists( dir ) );
- BOOST_CHECK( fs::is_directory( dir ) );
- BOOST_CHECK( fs::is_empty( dir ) );
+ BOOST_TEST( !fs::exists( dir / file ) );
+ BOOST_TEST( !fs::exists( dir ) );
+ BOOST_TEST( fs::create_directory( dir ) );
+ BOOST_TEST( fs::exists( dir ) );
+ BOOST_TEST( fs::is_directory( dir ) );
+ BOOST_TEST( fs::is_empty( dir ) );
     create_file( dir / file, "wide_test file contents" );
- BOOST_CHECK( fs::exists( dir / file ) );
- BOOST_CHECK( !fs::is_directory( dir / file ) );
- BOOST_CHECK( !fs::is_empty( dir / file ) );
- BOOST_CHECK( fs::file_size( dir / file ) == 23 || fs::file_size( dir / file ) == 24 );
- BOOST_CHECK( fs::equivalent( dir / file, dot / dir / file ) );
- BOOST_CHECK( fs::last_write_time( dir / file ) );
+ BOOST_TEST( fs::exists( dir / file ) );
+ BOOST_TEST( !fs::is_directory( dir / file ) );
+ BOOST_TEST( !fs::is_empty( dir / file ) );
+ BOOST_TEST( fs::file_size( dir / file ) == 23 || fs::file_size( dir / file ) == 24 );
+ BOOST_TEST( fs::equivalent( dir / file, dot / dir / file ) );
+ BOOST_TEST( fs::last_write_time( dir / file ) );
     typedef fs::basic_directory_iterator<Path> it_t;
     int count(0);
     for ( it_t it( dir ); it != it_t(); ++it )
     {
- BOOST_CHECK( it->path() == dir / file );
- BOOST_CHECK( !fs::is_empty( it->path() ) );
+ BOOST_TEST( it->path() == dir / file );
+ BOOST_TEST( !fs::is_empty( it->path() ) );
       ++count;
     }
- BOOST_CHECK( count == 1 );
+ BOOST_TEST( count == 1 );
     if ( cleanup )
     {
       fs::remove( dir / file );
@@ -128,11 +127,11 @@
 
   //------------------------------------------------------------------------------------//
   // //
- // test_main //
+ // main //
   // //
   //------------------------------------------------------------------------------------//
 
-int test_main( int argc, char * /*argv*/[] )
+int main( int argc, char * /*argv*/[] )
 {
 
   if ( argc > 1 ) cleanup = false;
@@ -146,8 +145,8 @@
   for (std::size_t i = 0; i < s.size(); ++i )
     std::cout << std::hex << int( static_cast<unsigned char>(s[i]) ) << " ";
   std::cout << std::dec << std::endl;
- BOOST_CHECK( to_external( L"\x2780" ).size() == 3 );
- BOOST_CHECK( to_external( L"\x2780" ) == "\xE2\x9E\x80" );
+ BOOST_TEST( to_external( L"\x2780" ).size() == 3 );
+ BOOST_TEST( to_external( L"\x2780" ) == "\xE2\x9E\x80" );
 
   // test fs::path
   std::cout << "begin path test..." << std::endl;
@@ -169,5 +168,5 @@
   test( ::user::lpath( dir ), ::user::lpath( file ), ::user::lpath( dot ) );
   std::cout << "complete\n\n";
 
- return 0;
+ return ::boost::report_errors();
 }


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