Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67762 - in trunk/libs/chrono: example test test/clock
From: vicente.botet_at_[hidden]
Date: 2011-01-07 16:25:05


Author: viboes
Date: 2011-01-07 16:24:17 EST (Fri, 07 Jan 2011)
New Revision: 67762
URL: http://svn.boost.org/trac/boost/changeset/67762

Log:
Boost.Chrono: change monotonic by steady

Text files modified:
   trunk/libs/chrono/example/await_keystroke.cpp | 10 ++++----
   trunk/libs/chrono/example/chrono_accuracy_test.cpp | 10 ++++----
   trunk/libs/chrono/example/clock_name.cpp | 4 +-
   trunk/libs/chrono/example/clock_name.hpp | 12 ++++----
   trunk/libs/chrono/example/explore_limits.cpp | 6 ++--
   trunk/libs/chrono/example/io_ex1.cpp | 4 +-
   trunk/libs/chrono/example/io_ex4.cpp | 6 ++--
   trunk/libs/chrono/example/io_ex5.cpp | 4 +-
   trunk/libs/chrono/example/test_clock.cpp | 34 +++++++++++++-------------
   trunk/libs/chrono/example/test_clock2.cpp | 50 ++++++++++++++++++++--------------------
   trunk/libs/chrono/example/time2_demo.cpp | 32 ++++++++++++------------
   trunk/libs/chrono/test/Jamfile.v2 | 1
   trunk/libs/chrono/test/clock.h | 2
   trunk/libs/chrono/test/clock/clock_pass.cpp | 28 +++++++++++-----------
   trunk/libs/chrono/test/clock/errored_clock.hpp | 2
   trunk/libs/chrono/test/intmax_c.cpp | 11 ++++++++
   trunk/libs/chrono/test/run_timer_test.cpp | 10 ++++----
   17 files changed, 118 insertions(+), 108 deletions(-)

Modified: trunk/libs/chrono/example/await_keystroke.cpp
==============================================================================
--- trunk/libs/chrono/example/await_keystroke.cpp (original)
+++ trunk/libs/chrono/example/await_keystroke.cpp 2011-01-07 16:24:17 EST (Fri, 07 Jan 2011)
@@ -35,7 +35,7 @@
 int main()
 {
   timer<system_clock> t1;
- timer<monotonic_clock> t2;
+ timer<steady_clock> t2;
   timer<high_resolution_clock> t3;
 
   std::cout << "Strike any key: ";
@@ -44,7 +44,7 @@
   std::cout << std::fixed << std::setprecision(9);
   std::cout << "system_clock-----------: "
             << t1.seconds() << " seconds\n";
- std::cout << "monotonic_clock--------: "
+ std::cout << "steady_clock--------: "
             << t2.seconds() << " seconds\n";
   std::cout << "high_resolution_clock--: "
             << t3.seconds() << " seconds\n";
@@ -54,10 +54,10 @@
 
   std::cout << "\nsystem_clock latency-----------: " << (d5 - d4).count() << std::endl;
 
- monotonic_clock::time_point d6 = monotonic_clock::now();
- monotonic_clock::time_point d7 = monotonic_clock::now();
+ steady_clock::time_point d6 = steady_clock::now();
+ steady_clock::time_point d7 = steady_clock::now();
 
- std::cout << "monotonic_clock latency--------: " << (d7 - d6).count() << std::endl;
+ std::cout << "steady_clock latency--------: " << (d7 - d6).count() << std::endl;
 
   high_resolution_clock::time_point d8 = high_resolution_clock::now();
   high_resolution_clock::time_point d9 = high_resolution_clock::now();

Modified: trunk/libs/chrono/example/chrono_accuracy_test.cpp
==============================================================================
--- trunk/libs/chrono/example/chrono_accuracy_test.cpp (original)
+++ trunk/libs/chrono/example/chrono_accuracy_test.cpp 2011-01-07 16:24:17 EST (Fri, 07 Jan 2011)
@@ -37,8 +37,8 @@
     timeout_in_clock_t += (timeout_in_secs * CLOCKS_PER_SEC);
 
     boost::chrono::system_timer sys;
-#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
- boost::chrono::monotonic_timer mono;
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ boost::chrono::steady_timer mono;
 #endif
     boost::chrono::high_resolution_timer hires;
     boost::chrono::timer<boost::chrono::process_cpu_clock> process;
@@ -50,8 +50,8 @@
     } while ( now < timeout_in_clock_t );
 
     boost::chrono::system_timer::duration sys_dur = sys.elapsed();
-#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
- boost::chrono::monotonic_timer::duration mono_dur = mono.elapsed();
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ boost::chrono::steady_timer::duration mono_dur = mono.elapsed();
 #endif
     boost::chrono::high_resolution_timer::duration hires_dur = hires.elapsed();
     boost::chrono::process_cpu_clock::duration times;
@@ -73,7 +73,7 @@
     BOOST_TEST( sys_dur > timeout_in_nanoseconds - maximum_delta
       && sys_dur < timeout_in_nanoseconds + maximum_delta );
 
-#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
     std::cout << mono_dur.count() << " mono_dur\n";
 
     BOOST_TEST( mono_dur > timeout_in_nanoseconds - maximum_delta

Modified: trunk/libs/chrono/example/clock_name.cpp
==============================================================================
--- trunk/libs/chrono/example/clock_name.cpp (original)
+++ trunk/libs/chrono/example/clock_name.cpp 2011-01-07 16:24:17 EST (Fri, 07 Jan 2011)
@@ -13,8 +13,8 @@
 int main()
 {
     std::cout << name<boost::chrono::system_clock>::apply() << '\n';
-#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
- std::cout << name<boost::chrono::monotonic_clock>::apply() << '\n';
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ std::cout << name<boost::chrono::steady_clock>::apply() << '\n';
 #endif
     std::cout << name<boost::chrono::high_resolution_clock>::apply() << '\n';
 }

Modified: trunk/libs/chrono/example/clock_name.hpp
==============================================================================
--- trunk/libs/chrono/example/clock_name.hpp (original)
+++ trunk/libs/chrono/example/clock_name.hpp 2011-01-07 16:24:17 EST (Fri, 07 Jan 2011)
@@ -16,8 +16,8 @@
 
 template <typename Clock,
           bool = boost::is_same<Clock, boost::chrono::system_clock>::value,
-#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
- bool = boost::is_same<Clock, boost::chrono::monotonic_clock>::value,
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ bool = boost::is_same<Clock, boost::chrono::steady_clock>::value,
 #else
     bool = false,
 #endif
@@ -37,7 +37,7 @@
 
 template <typename Clock>
 struct name<Clock, false, true, false> {
- static const char* apply() { return "monotonic_clock";}
+ static const char* apply() { return "steady_clock";}
 };
 
 template <typename Clock>
@@ -47,7 +47,7 @@
 
 template <typename Clock>
 struct name<Clock, false, true, true> {
- static const char* apply() { return "monotonic_clock and high_resolution_clock";}
+ static const char* apply() { return "steady_clock and high_resolution_clock";}
 };
 
 template <typename Clock>
@@ -57,12 +57,12 @@
 
 template <typename Clock>
 struct name<Clock, true, true, false> {
- static const char* apply() { return "system_clock and monotonic_clock";}
+ static const char* apply() { return "system_clock and steady_clock";}
 };
 
 template <typename Clock>
 struct name<Clock, true, true, true> {
- static const char* apply() { return "system_clock, monotonic_clock and high_resolution_clock";}
+ static const char* apply() { return "system_clock, steady_clock and high_resolution_clock";}
 };
 
 #endif

Modified: trunk/libs/chrono/example/explore_limits.cpp
==============================================================================
--- trunk/libs/chrono/example/explore_limits.cpp (original)
+++ trunk/libs/chrono/example/explore_limits.cpp 2011-01-07 16:24:17 EST (Fri, 07 Jan 2011)
@@ -38,9 +38,9 @@
 {
     typedef duration<long long, boost::ratio_multiply<boost::ratio<24*3652425,10000>,
       hours::period>::type> Years;
-#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
- monotonic_clock::time_point t1( Years(250));
- monotonic_clock::time_point t2(-Years(250));
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ steady_clock::time_point t1( Years(250));
+ steady_clock::time_point t2(-Years(250));
 #else
     system_clock::time_point t1( Years(250));
     system_clock::time_point t2(-Years(250));

Modified: trunk/libs/chrono/example/io_ex1.cpp
==============================================================================
--- trunk/libs/chrono/example/io_ex1.cpp (original)
+++ trunk/libs/chrono/example/io_ex1.cpp 2011-01-07 16:24:17 EST (Fri, 07 Jan 2011)
@@ -45,8 +45,8 @@
          << ClockTick(3) + nanoseconds(10) << '\n';
 
     cout << "\nsystem_clock::now() = " << system_clock::now() << '\n';
-#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
- cout << "monotonic_clock::now() = " << monotonic_clock::now() << '\n';
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ cout << "steady_clock::now() = " << steady_clock::now() << '\n';
 #endif
     cout << "\nSet cout to use long names:\n" << duration_long
          << "high_resolution_clock::now() = " << high_resolution_clock::now() << '\n';

Modified: trunk/libs/chrono/example/io_ex4.cpp
==============================================================================
--- trunk/libs/chrono/example/io_ex4.cpp (original)
+++ trunk/libs/chrono/example/io_ex4.cpp 2011-01-07 16:24:17 EST (Fri, 07 Jan 2011)
@@ -21,9 +21,9 @@
     using namespace boost;
     using namespace boost::chrono;
 
-#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
- typedef time_point<monotonic_clock, duration<double, ratio<3600> > > T;
- T tp = monotonic_clock::now();
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef time_point<steady_clock, duration<double, ratio<3600> > > T;
+ T tp = steady_clock::now();
     std::cout << tp << '\n';
 #endif
     return 0;

Modified: trunk/libs/chrono/example/io_ex5.cpp
==============================================================================
--- trunk/libs/chrono/example/io_ex5.cpp (original)
+++ trunk/libs/chrono/example/io_ex5.cpp 2011-01-07 16:24:17 EST (Fri, 07 Jan 2011)
@@ -75,8 +75,8 @@
     using namespace boost;
     using namespace boost::chrono;
 
-#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
- display(cout, monotonic_clock::now().time_since_epoch()
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ display(cout, steady_clock::now().time_since_epoch()
                   + duration<long, mega>(1)) << '\n';
 #endif
     display(cout, -milliseconds(6)) << '\n';

Modified: trunk/libs/chrono/example/test_clock.cpp
==============================================================================
--- trunk/libs/chrono/example/test_clock.cpp (original)
+++ trunk/libs/chrono/example/test_clock.cpp 2011-01-07 16:24:17 EST (Fri, 07 Jan 2011)
@@ -90,20 +90,20 @@
     std::cout << "system_clock resolution estimate: " << nanoseconds(stop-start).count() << " nanoseconds\n";
 }
 
-void test_monotonic_clock()
+void test_steady_clock()
 {
-#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
- std::cout << "monotonic_clock test" << std::endl;
- monotonic_clock::duration delay = milliseconds(5);
- monotonic_clock::time_point start = monotonic_clock::now();
- while (monotonic_clock::now() - start <= delay)
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ std::cout << "steady_clock test" << std::endl;
+ steady_clock::duration delay = milliseconds(5);
+ steady_clock::time_point start = steady_clock::now();
+ while (steady_clock::now() - start <= delay)
         ;
- monotonic_clock::time_point stop = monotonic_clock::now();
- monotonic_clock::duration elapsed = stop - start;
+ steady_clock::time_point stop = steady_clock::now();
+ steady_clock::duration elapsed = stop - start;
     std::cout << "paused " << nanoseconds(elapsed).count() << " nanoseconds\n";
- start = monotonic_clock::now();
- stop = monotonic_clock::now();
- std::cout << "monotonic_clock resolution estimate: " << nanoseconds(stop-start).count() << " nanoseconds\n";
+ start = steady_clock::now();
+ stop = steady_clock::now();
+ std::cout << "steady_clock resolution estimate: " << nanoseconds(stop-start).count() << " nanoseconds\n";
 #endif
 }
 void test_hi_resolution_clock()
@@ -126,12 +126,12 @@
 // std::cout << "mixed clock test" << std::endl;
 // high_resolution_clock::time_point hstart = high_resolution_clock::now();
 // std::cout << "Add 5 milliseconds to a high_resolution_clock::time_point\n";
-// monotonic_clock::time_point mend = hstart + milliseconds(5);
+// steady_clock::time_point mend = hstart + milliseconds(5);
 // bool b = hstart == mend;
 // system_clock::time_point sstart = system_clock::now();
-// std::cout << "Subtracting system_clock::time_point from monotonic_clock::time_point doesn't compile\n";
+// std::cout << "Subtracting system_clock::time_point from steady_clock::time_point doesn't compile\n";
 //// mend - sstart; // doesn't compile
-// std::cout << "subtract high_resolution_clock::time_point from monotonic_clock::time_point"
+// std::cout << "subtract high_resolution_clock::time_point from steady_clock::time_point"
 // " and add that to a system_clock::time_point\n";
 // system_clock::time_point send = sstart + duration_cast<system_clock::duration>(mend - hstart);
 // std::cout << "subtract two system_clock::time_point's and output that in microseconds:\n";
@@ -158,12 +158,12 @@
 int main()
 {
     test_system_clock();
- test_monotonic_clock();
+ test_steady_clock();
     test_hi_resolution_clock();
     //test_mixed_clock();
     test_clock<system_clock>();
-#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
- test_clock<monotonic_clock>();
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ test_clock<steady_clock>();
 #endif
     test_clock<high_resolution_clock>();
 

Modified: trunk/libs/chrono/example/test_clock2.cpp
==============================================================================
--- trunk/libs/chrono/example/test_clock2.cpp (original)
+++ trunk/libs/chrono/example/test_clock2.cpp 2011-01-07 16:24:17 EST (Fri, 07 Jan 2011)
@@ -35,17 +35,17 @@
 
 namespace boost {
     namespace detail_chrono {
- class monotonic_clock {};
+ class steady_clock {};
         class system_clock {};
     }
     namespace chrono {
         namespace chrono_detail {
             using namespace detail_chrono;
- struct has_monotonic_clock {
+ struct has_steady_clock {
                 template< class T > static char sfinae( typename T::rep );
                 template< class > static int sfinae( ... );
 
- enum { value = sizeof sfinae< monotonic_clock >( 0 ) == sizeof(char) };
+ enum { value = sizeof sfinae< steady_clock >( 0 ) == sizeof(char) };
             };
             struct has_system_clock {
                 template< class T > static char sfinae( typename T::rep );
@@ -54,8 +54,8 @@
                 enum { value = sizeof sfinae< system_clock >( 0 ) == sizeof(char) };
             };
         }
- struct has_monotonic_clock
- : integral_constant<bool, chrono_detail::has_monotonic_clock::value> {};
+ struct has_steady_clock
+ : integral_constant<bool, chrono_detail::has_steady_clock::value> {};
         struct has_system_clock
             : integral_constant<bool, chrono_detail::has_system_clock::value> {};
     }
@@ -63,10 +63,10 @@
 }
 
 BOOST_STATIC_ASSERT(boost::chrono::has_system_clock::value);
-#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
-BOOST_STATIC_ASSERT(boost::chrono::has_monotonic_clock::value);
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+BOOST_STATIC_ASSERT(boost::chrono::has_steady_clock::value);
 #else
-BOOST_STATIC_ASSERT(!boost::chrono::has_monotonic_clock::value);
+BOOST_STATIC_ASSERT(!boost::chrono::has_steady_clock::value);
 #endif
 
 using namespace boost::chrono;
@@ -126,20 +126,20 @@
     std::cout << "system_clock resolution estimate: " << nanoseconds(stop-start).count() << " nanoseconds\n";
 }
 
-void test_monotonic_clock()
+void test_steady_clock()
 {
-#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
- std::cout << "monotonic_clock test" << std::endl;
- monotonic_clock::duration delay = milliseconds(5);
- monotonic_clock::time_point start = monotonic_clock::now();
- while (monotonic_clock::now() - start <= delay)
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ std::cout << "steady_clock test" << std::endl;
+ steady_clock::duration delay = milliseconds(5);
+ steady_clock::time_point start = steady_clock::now();
+ while (steady_clock::now() - start <= delay)
         ;
- monotonic_clock::time_point stop = monotonic_clock::now();
- monotonic_clock::duration elapsed = stop - start;
+ steady_clock::time_point stop = steady_clock::now();
+ steady_clock::duration elapsed = stop - start;
     std::cout << "paused " << nanoseconds(elapsed).count() << " nanoseconds\n";
- start = monotonic_clock::now();
- stop = monotonic_clock::now();
- std::cout << "monotonic_clock resolution estimate: " << nanoseconds(stop-start).count() << " nanoseconds\n";
+ start = steady_clock::now();
+ stop = steady_clock::now();
+ std::cout << "steady_clock resolution estimate: " << nanoseconds(stop-start).count() << " nanoseconds\n";
 #endif
 }
 void test_hi_resolution_clock()
@@ -162,12 +162,12 @@
 // std::cout << "mixed clock test" << std::endl;
 // high_resolution_clock::time_point hstart = high_resolution_clock::now();
 // std::cout << "Add 5 milliseconds to a high_resolution_clock::time_point\n";
-// monotonic_clock::time_point mend = hstart + milliseconds(5);
+// steady_clock::time_point mend = hstart + milliseconds(5);
 // bool b = hstart == mend;
 // system_clock::time_point sstart = system_clock::now();
-// std::cout << "Subtracting system_clock::time_point from monotonic_clock::time_point doesn't compile\n";
+// std::cout << "Subtracting system_clock::time_point from steady_clock::time_point doesn't compile\n";
 //// mend - sstart; // doesn't compile
-// std::cout << "subtract high_resolution_clock::time_point from monotonic_clock::time_point"
+// std::cout << "subtract high_resolution_clock::time_point from steady_clock::time_point"
 // " and add that to a system_clock::time_point\n";
 // system_clock::time_point send = sstart + duration_cast<system_clock::duration>(mend - hstart);
 // std::cout << "subtract two system_clock::time_point's and output that in microseconds:\n";
@@ -194,12 +194,12 @@
 int main()
 {
     test_system_clock();
- test_monotonic_clock();
+ test_steady_clock();
     test_hi_resolution_clock();
     //test_mixed_clock();
     test_clock<system_clock>();
-#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
- test_clock<monotonic_clock>();
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ test_clock<steady_clock>();
 #endif
     test_clock<high_resolution_clock>();
 

Modified: trunk/libs/chrono/example/time2_demo.cpp
==============================================================================
--- trunk/libs/chrono/example/time2_demo.cpp (original)
+++ trunk/libs/chrono/example/time2_demo.cpp 2011-01-07 16:24:17 EST (Fri, 07 Jan 2011)
@@ -1325,19 +1325,19 @@
     cout << "system_clock resolution estimate: " << nanoseconds(stop-start).count() << " nanoseconds\n";
 }
 
-void test_monotonic_clock()
+void test_steady_clock()
 {
- cout << "monotonic_clock test" << endl;
- monotonic_clock::duration delay = milliseconds(5);
- monotonic_clock::time_point start = monotonic_clock::now();
- while (monotonic_clock::now() - start <= delay)
+ cout << "steady_clock test" << endl;
+ steady_clock::duration delay = milliseconds(5);
+ steady_clock::time_point start = steady_clock::now();
+ while (steady_clock::now() - start <= delay)
         ;
- monotonic_clock::time_point stop = monotonic_clock::now();
- monotonic_clock::duration elapsed = stop - start;
+ steady_clock::time_point stop = steady_clock::now();
+ steady_clock::duration elapsed = stop - start;
     cout << "paused " << nanoseconds(elapsed).count() << " nanoseconds\n";
- start = monotonic_clock::now();
- stop = monotonic_clock::now();
- cout << "monotonic_clock resolution estimate: " << nanoseconds(stop-start).count() << " nanoseconds\n";
+ start = steady_clock::now();
+ stop = steady_clock::now();
+ cout << "steady_clock resolution estimate: " << nanoseconds(stop-start).count() << " nanoseconds\n";
 }
 
 void test_hi_resolution_clock()
@@ -1360,12 +1360,12 @@
 // cout << "mixed clock test" << endl;
 // high_resolution_clock::time_point hstart = high_resolution_clock::now();
 // cout << "Add 5 milliseconds to a high_resolution_clock::time_point\n";
-// monotonic_clock::time_point mend = hstart + milliseconds(5);
+// steady_clock::time_point mend = hstart + milliseconds(5);
 // bool b = hstart == mend;
 // system_clock::time_point sstart = system_clock::now();
-// std::cout << "Subtracting system_clock::time_point from monotonic_clock::time_point doesn't compile\n";
+// std::cout << "Subtracting system_clock::time_point from steady_clock::time_point doesn't compile\n";
 //// mend - sstart; // doesn't compile
-// cout << "subtract high_resolution_clock::time_point from monotonic_clock::time_point"
+// cout << "subtract high_resolution_clock::time_point from steady_clock::time_point"
 // " and add that to a system_clock::time_point\n";
 // system_clock::time_point send = sstart + duration_cast<system_clock::duration>(mend - hstart);
 // cout << "subtract two system_clock::time_point's and output that in microseconds:\n";
@@ -1490,8 +1490,8 @@
 {
     typedef duration<long long, boost::ratio_multiply<boost::ratio<24*3652425,10000>,
       hours::period>::type> Years;
- monotonic_clock::time_point t1( Years(250));
- monotonic_clock::time_point t2(-Years(250));
+ steady_clock::time_point t1( Years(250));
+ steady_clock::time_point t2(-Years(250));
     // nanosecond resolution is likely to overflow. "up cast" to microseconds.
     // The "up cast" trades precision for range.
     microseconds d = time_point_cast<microseconds>(t1) - time_point_cast<microseconds>(t2);
@@ -1630,7 +1630,7 @@
     test_milliseconds();
     test_with_xtime();
     test_system_clock();
- test_monotonic_clock();
+ test_steady_clock();
     test_hi_resolution_clock();
     //test_mixed_clock();
     timeval_demo::test_xtime_clock();

Modified: trunk/libs/chrono/test/Jamfile.v2
==============================================================================
--- trunk/libs/chrono/test/Jamfile.v2 (original)
+++ trunk/libs/chrono/test/Jamfile.v2 2011-01-07 16:24:17 EST (Fri, 07 Jan 2011)
@@ -246,7 +246,6 @@
     test-suite "win32"
         :
         [ chrono-run win32_test.cpp ]
- [ compile intmax_c.cpp ]
         ;
 
 # test-suite "static_string"

Modified: trunk/libs/chrono/test/clock.h
==============================================================================
--- trunk/libs/chrono/test/clock.h (original)
+++ trunk/libs/chrono/test/clock.h 2011-01-07 16:24:17 EST (Fri, 07 Jan 2011)
@@ -22,7 +22,7 @@
     typedef duration::rep rep;
     typedef duration::period period;
     typedef boost::chrono::time_point<Clock, duration> time_point;
- static const bool is_monotonic = false;
+ static const bool is_steady = false;
 
     static time_point now();
 };

Modified: trunk/libs/chrono/test/clock/clock_pass.cpp
==============================================================================
--- trunk/libs/chrono/test/clock/clock_pass.cpp (original)
+++ trunk/libs/chrono/test/clock/clock_pass.cpp 2011-01-07 16:24:17 EST (Fri, 07 Jan 2011)
@@ -28,8 +28,8 @@
     BOOST_CHRONO_STATIC_ASSERT((boost::is_same<typename Clock::rep, typename Clock::duration::rep>::value), NOTHING, ());
     BOOST_CHRONO_STATIC_ASSERT((boost::is_same<typename Clock::period, typename Clock::duration::period>::value), NOTHING, ());
     BOOST_CHRONO_STATIC_ASSERT((boost::is_same<typename Clock::duration, typename Clock::time_point::duration>::value), NOTHING, ());
- BOOST_CHRONO_STATIC_ASSERT(Clock::is_monotonic || !Clock::is_monotonic, NOTHING, ());
- // to be replaced by has static member bool is_monotonic
+ BOOST_CHRONO_STATIC_ASSERT(Clock::is_steady || !Clock::is_steady, NOTHING, ());
+ // to be replaced by has static member bool is_steady
 }
 
 template <typename Clock>
@@ -99,16 +99,16 @@
     check_clock_now_ec<boost::chrono::high_resolution_clock>();
     check_clock_now_throws<boost::chrono::high_resolution_clock>();
     
-#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
- check_clock_invariants<boost::chrono::monotonic_clock>();
- BOOST_CHRONO_STATIC_ASSERT(boost::chrono::monotonic_clock::is_monotonic, NOTHING, ());
- check_clock_now<boost::chrono::monotonic_clock>();
- check_clock_now_ec<boost::chrono::monotonic_clock>();
- check_clock_now_throws<boost::chrono::monotonic_clock>();
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ check_clock_invariants<boost::chrono::steady_clock>();
+ BOOST_CHRONO_STATIC_ASSERT(boost::chrono::steady_clock::is_steady, NOTHING, ());
+ check_clock_now<boost::chrono::steady_clock>();
+ check_clock_now_ec<boost::chrono::steady_clock>();
+ check_clock_now_throws<boost::chrono::steady_clock>();
 #endif
     
     check_clock_invariants<boost::chrono::system_clock>();
- BOOST_CHRONO_STATIC_ASSERT(!boost::chrono::system_clock::is_monotonic, NOTHING, ());
+ BOOST_CHRONO_STATIC_ASSERT(!boost::chrono::system_clock::is_steady, NOTHING, ());
     check_clock_now<boost::chrono::system_clock>();
     check_clock_now_ec<boost::chrono::system_clock>();
     check_clock_now_throws<boost::chrono::system_clock>();
@@ -131,32 +131,32 @@
 
 #if defined(BOOST_CHRONO_HAS_THREAD_CLOCK)
     check_clock_invariants<boost::chrono::thread_clock>();
- BOOST_CHRONO_STATIC_ASSERT(boost::chrono::thread_clock::is_monotonic, NOTHING, ());
+ BOOST_CHRONO_STATIC_ASSERT(boost::chrono::thread_clock::is_steady, NOTHING, ());
     check_clock_now<boost::chrono::thread_clock>();
     check_clock_now_ec<boost::chrono::thread_clock>();
     check_clock_now_throws<boost::chrono::thread_clock>();
 #endif
     
     check_clock_invariants<boost::chrono::process_real_cpu_clock>();
- BOOST_CHRONO_STATIC_ASSERT(boost::chrono::process_real_cpu_clock::is_monotonic, NOTHING, ());
+ BOOST_CHRONO_STATIC_ASSERT(boost::chrono::process_real_cpu_clock::is_steady, NOTHING, ());
     check_clock_now<boost::chrono::process_real_cpu_clock>();
     check_clock_now_ec<boost::chrono::process_real_cpu_clock>();
     check_clock_now_throws<boost::chrono::process_real_cpu_clock>();
 
     check_clock_invariants<boost::chrono::process_user_cpu_clock>();
- BOOST_CHRONO_STATIC_ASSERT(boost::chrono::process_user_cpu_clock::is_monotonic, NOTHING, ());
+ BOOST_CHRONO_STATIC_ASSERT(boost::chrono::process_user_cpu_clock::is_steady, NOTHING, ());
     check_clock_now<boost::chrono::process_user_cpu_clock>();
     check_clock_now_ec<boost::chrono::process_user_cpu_clock>();
     check_clock_now_throws<boost::chrono::process_user_cpu_clock>();
 
     check_clock_invariants<boost::chrono::process_system_cpu_clock>();
- BOOST_CHRONO_STATIC_ASSERT(boost::chrono::process_system_cpu_clock::is_monotonic, NOTHING, ());
+ BOOST_CHRONO_STATIC_ASSERT(boost::chrono::process_system_cpu_clock::is_steady, NOTHING, ());
     check_clock_now<boost::chrono::process_system_cpu_clock>();
     check_clock_now_ec<boost::chrono::process_system_cpu_clock>();
     check_clock_now_throws<boost::chrono::process_system_cpu_clock>();
 
     check_clock_invariants<boost::chrono::process_cpu_clock>();
- BOOST_CHRONO_STATIC_ASSERT(boost::chrono::process_cpu_clock::is_monotonic, NOTHING, ());
+ BOOST_CHRONO_STATIC_ASSERT(boost::chrono::process_cpu_clock::is_steady, NOTHING, ());
     check_clock_now<boost::chrono::process_cpu_clock>();
     check_clock_now_ec<boost::chrono::process_cpu_clock>();
     check_clock_now_throws<boost::chrono::process_cpu_clock>();

Modified: trunk/libs/chrono/test/clock/errored_clock.hpp
==============================================================================
--- trunk/libs/chrono/test/clock/errored_clock.hpp (original)
+++ trunk/libs/chrono/test/clock/errored_clock.hpp 2011-01-07 16:24:17 EST (Fri, 07 Jan 2011)
@@ -23,7 +23,7 @@
       typedef duration::rep rep;
       typedef duration::period period;
       typedef boost::chrono::time_point<errored_clock> time_point;
- static const bool is_monotonic = true;
+ static const bool is_steady = true;
       static int errno_;
 
       static void set_errno(int err) {

Modified: trunk/libs/chrono/test/intmax_c.cpp
==============================================================================
--- trunk/libs/chrono/test/intmax_c.cpp (original)
+++ trunk/libs/chrono/test/intmax_c.cpp 2011-01-07 16:24:17 EST (Fri, 07 Jan 2011)
@@ -5,6 +5,7 @@
 // Distributed under the Boost Software License, Version 1.0.
 // See http://www.boost.org/LICENSE_1_0.txt
 
+#if 0
 #include <boost/cstdint.hpp>
 
 #ifdef INTMAX_C
@@ -17,3 +18,13 @@
 int main() {
     return (i);
 }
+
+#endif
+#include <windows.h>
+#include <algorithm>
+
+
+int main() {
+ LONGLONG i = std::max(2,3);
+ return i;
+}

Modified: trunk/libs/chrono/test/run_timer_test.cpp
==============================================================================
--- trunk/libs/chrono/test/run_timer_test.cpp (original)
+++ trunk/libs/chrono/test/run_timer_test.cpp 2011-01-07 16:24:17 EST (Fri, 07 Jan 2011)
@@ -95,8 +95,8 @@
     timeout_in_clock_t += (timeout_in_secs * CLOCKS_PER_SEC);
 
     boost::chrono::system_timer sys;
-#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
- boost::chrono::monotonic_timer mono;
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ boost::chrono::steady_timer mono;
 #endif
     boost::chrono::high_resolution_timer hires;
     boost::chrono::process_timer process;
@@ -108,8 +108,8 @@
     } while ( now < timeout_in_clock_t );
 
     boost::chrono::system_timer::duration sys_dur = sys.elapsed();
-#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
- boost::chrono::monotonic_timer::duration mono_dur = mono.elapsed();
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ boost::chrono::steady_timer::duration mono_dur = mono.elapsed();
 #endif
     boost::chrono::high_resolution_timer::duration hires_dur = hires.elapsed();
     boost::chrono::process_times times;
@@ -131,7 +131,7 @@
     BOOST_TEST( sys_dur > timeout_in_nanoseconds - maximum_delta
       && sys_dur < timeout_in_nanoseconds + maximum_delta );
 
-#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
     std::cout << mono_dur.count() << " mono_dur\n";
 
     BOOST_TEST( mono_dur > timeout_in_nanoseconds - maximum_delta


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