Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74748 - trunk/libs/chrono/test/stopwatch
From: vicente.botet_at_[hidden]
Date: 2011-10-05 23:46:01


Author: viboes
Date: 2011-10-05 23:46:00 EDT (Wed, 05 Oct 2011)
New Revision: 74748
URL: http://svn.boost.org/trac/boost/changeset/74748

Log:
Chrono: elapsed takes in account the elapsed time stored on the LapsCollector.
Text files modified:
   trunk/libs/chrono/test/stopwatch/basic_stopwatch_laps_accumulator_set_pass.cpp | 10 +++++-----
   trunk/libs/chrono/test/stopwatch/basic_stopwatch_laps_container_pass.cpp | 10 +++++-----
   trunk/libs/chrono/test/stopwatch/basic_stopwatch_reporter_laps_accumulator_set_pass.cpp | 6 +++---
   3 files changed, 13 insertions(+), 13 deletions(-)

Modified: trunk/libs/chrono/test/stopwatch/basic_stopwatch_laps_accumulator_set_pass.cpp
==============================================================================
--- trunk/libs/chrono/test/stopwatch/basic_stopwatch_laps_accumulator_set_pass.cpp (original)
+++ trunk/libs/chrono/test/stopwatch/basic_stopwatch_laps_accumulator_set_pass.cpp 2011-10-05 23:46:00 EDT (Wed, 05 Oct 2011)
@@ -132,7 +132,7 @@
   BOOST_TEST(!sw.is_running());
   typename Stopwatch::duration d=sw.elapsed();
   BOOST_TEST(!sw.is_running());
- BOOST_TEST(d == boost::chrono::milliseconds(0));
+ BOOST_TEST(d == boost::chrono::milliseconds(100));
   BOOST_TEST(sw.get_laps_collector().last()==boost::chrono::milliseconds(100));
   BOOST_TEST(boost::accumulators::count(sw.get_laps_collector().accumulator_set())==1);
 }
@@ -150,7 +150,7 @@
   BOOST_TEST(!sw.is_running());
   typename Stopwatch::duration d=sw.elapsed();
   BOOST_TEST(!sw.is_running());
- BOOST_TEST(d == boost::chrono::milliseconds(0));
+ BOOST_TEST(d == boost::chrono::milliseconds(100));
   BOOST_TEST(boost::accumulators::count(sw.get_laps_collector().accumulator_set())==1);
 }
 
@@ -164,7 +164,7 @@
   BOOST_TEST(!sw.is_running());
   typename Stopwatch::duration d=sw.elapsed();
   BOOST_TEST(!sw.is_running());
- BOOST_TEST(d == boost::chrono::milliseconds(0));
+ BOOST_TEST(d == boost::chrono::milliseconds(100));
   BOOST_TEST(sw.get_laps_collector().last()==boost::chrono::milliseconds(100));
   BOOST_TEST(boost::accumulators::count(sw.get_laps_collector().accumulator_set())==1);
 }
@@ -179,14 +179,14 @@
   BOOST_TEST(!sw.is_running());
   typename Stopwatch::duration d=sw.elapsed();
   BOOST_TEST(!sw.is_running());
- BOOST_TEST(d == boost::chrono::milliseconds(0));
+ BOOST_TEST(d == boost::chrono::milliseconds(100));
   BOOST_TEST(sw.get_laps_collector().last()==boost::chrono::milliseconds(100));
   ex::sleep_for<typename Stopwatch::clock>(boost::chrono::milliseconds(100));
   sw.stop();
   BOOST_TEST(!sw.is_running());
   d=sw.elapsed();
   BOOST_TEST(!sw.is_running());
- BOOST_TEST(d == boost::chrono::milliseconds(0));
+ BOOST_TEST(d == boost::chrono::milliseconds(100));
   BOOST_TEST(sw.get_laps_collector().last()==boost::chrono::milliseconds(100));
   BOOST_TEST(boost::accumulators::count(sw.get_laps_collector().accumulator_set())==1);
 }

Modified: trunk/libs/chrono/test/stopwatch/basic_stopwatch_laps_container_pass.cpp
==============================================================================
--- trunk/libs/chrono/test/stopwatch/basic_stopwatch_laps_container_pass.cpp (original)
+++ trunk/libs/chrono/test/stopwatch/basic_stopwatch_laps_container_pass.cpp 2011-10-05 23:46:00 EDT (Wed, 05 Oct 2011)
@@ -132,7 +132,7 @@
   BOOST_TEST(!sw.is_running());
   typename Stopwatch::duration d=sw.elapsed();
   BOOST_TEST(!sw.is_running());
- BOOST_TEST(d == boost::chrono::milliseconds(0));
+ BOOST_TEST(d == boost::chrono::milliseconds(100));
   BOOST_TEST(sw.get_laps_collector().last()==boost::chrono::milliseconds(100));
   BOOST_TEST(sw.get_laps_collector().container().size()==1);
 }
@@ -150,7 +150,7 @@
   BOOST_TEST(!sw.is_running());
   typename Stopwatch::duration d=sw.elapsed();
   BOOST_TEST(!sw.is_running());
- BOOST_TEST(d == boost::chrono::milliseconds(0));
+ BOOST_TEST(d == boost::chrono::milliseconds(100));
   BOOST_TEST(sw.get_laps_collector().container().size()==1);
 }
 
@@ -164,7 +164,7 @@
   BOOST_TEST(!sw.is_running());
   typename Stopwatch::duration d=sw.elapsed();
   BOOST_TEST(!sw.is_running());
- BOOST_TEST(d == boost::chrono::milliseconds(0));
+ BOOST_TEST(d == boost::chrono::milliseconds(100));
   BOOST_TEST(sw.get_laps_collector().last()==boost::chrono::milliseconds(100));
   BOOST_TEST(sw.get_laps_collector().container().size()==1);
 }
@@ -179,14 +179,14 @@
   BOOST_TEST(!sw.is_running());
   typename Stopwatch::duration d=sw.elapsed();
   BOOST_TEST(!sw.is_running());
- BOOST_TEST(d == boost::chrono::milliseconds(0));
+ BOOST_TEST(d == boost::chrono::milliseconds(100));
   BOOST_TEST(sw.get_laps_collector().last()==boost::chrono::milliseconds(100));
   ex::sleep_for<typename Stopwatch::clock>(boost::chrono::milliseconds(100));
   sw.stop();
   BOOST_TEST(!sw.is_running());
   d=sw.elapsed();
   BOOST_TEST(!sw.is_running());
- BOOST_TEST(d == boost::chrono::milliseconds(0));
+ BOOST_TEST(d == boost::chrono::milliseconds(100));
   BOOST_TEST(sw.get_laps_collector().last()==boost::chrono::milliseconds(100));
   BOOST_TEST(sw.get_laps_collector().container().size()==1);
 }

Modified: trunk/libs/chrono/test/stopwatch/basic_stopwatch_reporter_laps_accumulator_set_pass.cpp
==============================================================================
--- trunk/libs/chrono/test/stopwatch/basic_stopwatch_reporter_laps_accumulator_set_pass.cpp (original)
+++ trunk/libs/chrono/test/stopwatch/basic_stopwatch_reporter_laps_accumulator_set_pass.cpp 2011-10-05 23:46:00 EDT (Wed, 05 Oct 2011)
@@ -155,7 +155,7 @@
   BOOST_TEST(!sw.is_running());
   typename Stopwatch::duration d=sw.elapsed();
   BOOST_TEST(!sw.is_running());
- BOOST_TEST(d == boost::chrono::milliseconds(0));
+ BOOST_TEST(d == boost::chrono::milliseconds(100));
 }
 
 template <typename Stopwatch>
@@ -168,12 +168,12 @@
   BOOST_TEST(!sw.is_running());
   typename Stopwatch::duration d=sw.elapsed();
   BOOST_TEST(!sw.is_running());
- BOOST_TEST(d == boost::chrono::milliseconds(0));
+ BOOST_TEST(d == boost::chrono::milliseconds(100));
   sw.stop();
   BOOST_TEST(!sw.is_running());
   d=sw.elapsed();
   BOOST_TEST(!sw.is_running());
- BOOST_TEST(d == boost::chrono::milliseconds(0));
+ BOOST_TEST(d == boost::chrono::milliseconds(100));
 }
 
 


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