Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65948 - in sandbox/chrono/libs/chrono: src/mac test
From: vicente.botet_at_[hidden]
Date: 2010-10-13 19:41:43


Author: viboes
Date: 2010-10-13 19:41:33 EDT (Wed, 13 Oct 2010)
New Revision: 65948
URL: http://svn.boost.org/trac/boost/changeset/65948

Log:
Chrono:
* Fix mac original error_code
* Don't use Boost.test to avoid warnings
Text files modified:
   sandbox/chrono/libs/chrono/src/mac/process_clock.cpp | 4 ----
   sandbox/chrono/libs/chrono/test/chrono_accuracy_test.cpp | 1 -
   sandbox/chrono/libs/chrono/test/run_timer_test.cpp | 32 ++++++++++++++++----------------
   3 files changed, 16 insertions(+), 21 deletions(-)

Modified: sandbox/chrono/libs/chrono/src/mac/process_clock.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/src/mac/process_clock.cpp (original)
+++ sandbox/chrono/libs/chrono/src/mac/process_clock.cpp 2010-10-13 19:41:33 EDT (Wed, 13 Oct 2010)
@@ -42,10 +42,6 @@
   }
 }
 
-#else
-# error unknown API
-#endif
-
 namespace boost
 {
   namespace chrono

Modified: sandbox/chrono/libs/chrono/test/chrono_accuracy_test.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/chrono_accuracy_test.cpp (original)
+++ sandbox/chrono/libs/chrono/test/chrono_accuracy_test.cpp 2010-10-13 19:41:33 EDT (Wed, 13 Oct 2010)
@@ -20,7 +20,6 @@
 using boost::chrono::run_timer;
 using boost::system::error_code;
 
-//#include <boost/test/minimal.hpp>
 #include <boost/detail/lightweight_test.hpp>
 
 namespace

Modified: sandbox/chrono/libs/chrono/test/run_timer_test.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/run_timer_test.cpp (original)
+++ sandbox/chrono/libs/chrono/test/run_timer_test.cpp 2010-10-13 19:41:33 EDT (Wed, 13 Oct 2010)
@@ -20,9 +20,9 @@
 using boost::chrono::run_timer;
 using boost::system::error_code;
 
-#include <boost/test/minimal.hpp>
+#include <boost/detail/lightweight_test.hpp>
 
-//#define BOOST_CHECK(expr) if (!(expr)) std::cout << "*****ERROR*****\n"
+//#define BOOST_TEST(expr) if (!(expr)) std::cout << "*****ERROR*****\n"
 
 #define CHECK_REPORT(Timer,String_Stream,R,U,S,Expected_String) \
   check_report(Timer, String_Stream, R, U, S, Expected_String, __LINE__)
@@ -128,24 +128,24 @@
 
     std::cout << sys_dur.count() << " sys_dur\n";
 
- BOOST_CHECK( sys_dur > timeout_in_nanoseconds - maximum_delta
+ BOOST_TEST( sys_dur > timeout_in_nanoseconds - maximum_delta
       && sys_dur < timeout_in_nanoseconds + maximum_delta );
 
 #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
     std::cout << mono_dur.count() << " mono_dur\n";
 
- BOOST_CHECK( mono_dur > timeout_in_nanoseconds - maximum_delta
+ BOOST_TEST( mono_dur > timeout_in_nanoseconds - maximum_delta
       && mono_dur < timeout_in_nanoseconds + maximum_delta );
 #endif
 
     std::cout << hires_dur.count() << " hires_dur\n";
 
- BOOST_CHECK( hires_dur > timeout_in_nanoseconds - maximum_delta
+ BOOST_TEST( hires_dur > timeout_in_nanoseconds - maximum_delta
       && hires_dur < timeout_in_nanoseconds + maximum_delta );
 
     std::cout << times.real.count() << " times.real\n";
 
- BOOST_CHECK( times.real > timeout_in_nanoseconds - maximum_delta
+ BOOST_TEST( times.real > timeout_in_nanoseconds - maximum_delta
       && times.real < timeout_in_nanoseconds + maximum_delta );
   }
 
@@ -156,21 +156,21 @@
     {
       std::stringstream ss;
       run_timer t(ss);
- BOOST_CHECK( CHECK_REPORT(t, ss, ns(0), ns(0), ns(0),
+ BOOST_TEST( CHECK_REPORT(t, ss, ns(0), ns(0), ns(0),
         "\nreal 0.000s, cpu 0.000s (0.0%), user 0.000s, system 0.000s\n" ) );
     }
 
     {
       std::stringstream ss;
       run_timer t(ss);
- BOOST_CHECK( CHECK_REPORT(t, ss, ns(3000000000LL), ns(2000000000LL), ns(1000000000LL),
+ BOOST_TEST( CHECK_REPORT(t, ss, ns(3000000000LL), ns(2000000000LL), ns(1000000000LL),
         "\nreal 3.000s, cpu 3.000s (100.0%), user 2.000s, system 1.000s\n" ) );
     }
 
     {
       std::stringstream ss;
       run_timer t( ss, "9 places: r %r, c %c, p %p, u %u, s %s", 9 );
- BOOST_CHECK( CHECK_REPORT(t, ss, ns(3000000003LL), ns(2000000002LL), ns(1000000001LL),
+ BOOST_TEST( CHECK_REPORT(t, ss, ns(3000000003LL), ns(2000000002LL), ns(1000000001LL),
         "9 places: "
         "r 3.000000003, c 3.000000003, p 100.0, u 2.000000002, s 1.000000001" ) );
     }
@@ -192,9 +192,9 @@
     boost::chrono::process_times times;
     times.real = times.system = times.user = ns(0);
 
- BOOST_CHECK( times.real == ns(0) );
- BOOST_CHECK( times.user == ns(0) );
- BOOST_CHECK( times.system == ns(0) );
+ BOOST_TEST( times.real == ns(0) );
+ BOOST_TEST( times.user == ns(0) );
+ BOOST_TEST( times.system == ns(0) );
 
     t.elapsed( times );
     std::cout << "\n";
@@ -203,15 +203,15 @@
     std::cout << times.user.count() << " times.user\n";
     std::cout << times.system.count() << " times.system\n";
     std::cout << (times.user+times.system).count() << " times.user+system\n";
- BOOST_CHECK( times.real > ns(1) );
+ BOOST_TEST( times.real > ns(1) );
 
- BOOST_CHECK( times.user+times.system > ns(1) );
+ BOOST_TEST( times.user+times.system > ns(1) );
 
     std::cout << "complete " << res << std::endl;
   }
 }
 
-int test_main( int argc, char * argv[] )
+int main( int argc, char * argv[] )
 {
   std::locale loc( "" ); // test with appropriate locale
   std::cout.imbue( loc );
@@ -221,6 +221,6 @@
   process_timer_test();
   report_test();
   
- 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