Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66120 - in sandbox/chrono/libs/chrono: build test test/clock
From: vicente.botet_at_[hidden]
Date: 2010-10-20 13:05:53


Author: viboes
Date: 2010-10-20 13:05:51 EDT (Wed, 20 Oct 2010)
New Revision: 66120
URL: http://svn.boost.org/trac/boost/changeset/66120

Log:
Chrono:
* Build with BOOST_SYSTEL_NO_DEPRECATED
* Fix link with system
* Adapt to split of time.hpp
Text files modified:
   sandbox/chrono/libs/chrono/build/Jamfile.v2 | 2 ++
   sandbox/chrono/libs/chrono/test/Jamfile.v2 | 3 ++-
   sandbox/chrono/libs/chrono/test/clock/check_clock_now.hpp | 40 ++++++++++++++++++++++++++++++----------
   sandbox/chrono/libs/chrono/test/win32_test.cpp | 1 +
   4 files changed, 35 insertions(+), 11 deletions(-)

Modified: sandbox/chrono/libs/chrono/build/Jamfile.v2
==============================================================================
--- sandbox/chrono/libs/chrono/build/Jamfile.v2 (original)
+++ sandbox/chrono/libs/chrono/build/Jamfile.v2 2010-10-20 13:05:51 EDT (Wed, 20 Oct 2010)
@@ -37,6 +37,7 @@
         #<define>BOOST_RATIO_USES_ARRAY_ASSERT
         #<define>BOOST_CHRONO_USES_ARRAY_ASSERT
         #<define>BOOST_COMMON_TYPE_DONT_USE_TYPEOF
+ <define>BOOST_SYSTEM_NO_DEPRECATED
         <toolset>gcc:<linkflags>--enable-auto-import
         <warnings>all
         <toolset>gcc:<cxxflags>-Wextra
@@ -56,6 +57,7 @@
         #<define>BOOST_RATIO_USES_ARRAY_ASSERT
         #<define>BOOST_CHRONO_USES_ARRAY_ASSERT
         #<define>BOOST_COMMON_TYPE_DONT_USE_TYPEOF
+ <define>BOOST_SYSTEM_NO_DEPRECATED
         <link>shared:<define>BOOST_CHRONO_DYN_LINK=1
         <link>static:<define>BOOST_CHRONO_STATIC_LINK=1
         <toolset>gcc:<linkflags>--enable-auto-import

Modified: sandbox/chrono/libs/chrono/test/Jamfile.v2
==============================================================================
--- sandbox/chrono/libs/chrono/test/Jamfile.v2 (original)
+++ sandbox/chrono/libs/chrono/test/Jamfile.v2 2010-10-20 13:05:51 EDT (Wed, 20 Oct 2010)
@@ -27,7 +27,7 @@
 project
     : requirements
         <os>LINUX:<threading>multi
- <library>/boost/system//boost_system/<link>static
+ <library>/boost/system//boost_system
 
         # uncomment the line above if you build outside the Boost release
         #<include>$(BOOST_ROOT)
@@ -37,6 +37,7 @@
         <toolset>msvc:<asynch-exceptions>on
         <define>BOOST_ENABLE_WARNINGS
         <define>BOOST_CHRONO_USES_MPL_ASSERT
+ <define>BOOST_SYSTEM_NO_DEPRECATED
         <warnings>all
         <toolset>gcc:<cxxflags>-Wextra
         <toolset>gcc:<cxxflags>-Wno-long-long

Modified: sandbox/chrono/libs/chrono/test/clock/check_clock_now.hpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/clock/check_clock_now.hpp (original)
+++ sandbox/chrono/libs/chrono/test/clock/check_clock_now.hpp 2010-10-20 13:05:51 EDT (Wed, 20 Oct 2010)
@@ -18,9 +18,15 @@
 template <typename Clock>
 void check_clock_now_ec()
 {
- boost::system::error_code ec;
- typename Clock::time_point t1 = Clock::now(ec);
- BOOST_TEST(ec.value()==0);
+ boost::system::error_code ec;
+ typename Clock::time_point t1 = Clock::now(ec);
+ BOOST_TEST(ec.value()==0);
+}
+
+template <typename Clock>
+void check_clock_now_throws()
+{
+ typename Clock::time_point t1 = Clock::now(boost::throws());
 }
 
 template <typename Clock>
@@ -28,7 +34,7 @@
 {
         Clock::set_errno(err);
         try {
- typename Clock::time_point t1 = Clock::now();
+ typename Clock::time_point t1 = Clock::now();
         } catch (boost::system::system_error& ex) {
                 BOOST_TEST(ex.code().value()==err);
 // BOOST_TEST(ex.code().category() == BOOST_CHRONO_SYSTEM_CATEGORY);
@@ -40,12 +46,26 @@
 template <typename Clock>
 void check_clock_now_ec_err(int err)
 {
- Clock::set_errno(err);
- boost::system::error_code ec;
- typename Clock::time_point t1 = Clock::now(ec);
- BOOST_TEST(ec.value()==err);
-// BOOST_TEST(ec.category() == BOOST_CHRONO_SYSTEM_CATEGORY);
- Clock::set_errno(0);
+ Clock::set_errno(err);
+ boost::system::error_code ec;
+ typename Clock::time_point t1 = Clock::now(ec);
+ BOOST_TEST(ec.value()==err);
+// BOOST_TEST(ec.category() == BOOST_CHRONO_SYSTEM_CATEGORY);
+ Clock::set_errno(0);
+}
+
+template <typename Clock>
+void check_clock_now_throws_err(int err)
+{
+ Clock::set_errno(err);
+ try {
+ typename Clock::time_point t1 = Clock::now(boost::throws());
+ } catch (boost::system::system_error& ex) {
+ BOOST_TEST(ex.code().value()==err);
+// BOOST_TEST(ex.code().category() == BOOST_CHRONO_SYSTEM_CATEGORY);
+// BOOST_TEST(std::string(ex.what()) == std::string("errored_clock"));
+ }
+ Clock::set_errno(0);
 }
 
 #endif

Modified: sandbox/chrono/libs/chrono/test/win32_test.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/win32_test.cpp (original)
+++ sandbox/chrono/libs/chrono/test/win32_test.cpp 2010-10-20 13:05:51 EDT (Wed, 20 Oct 2010)
@@ -16,6 +16,7 @@
 #endif
 
 #include <boost/detail/win/basic_types.hpp>
+#include <boost/detail/win/time.hpp>
 #include <windows.h>
 #include <boost/type_traits.hpp>
 #include <boost/typeof/typeof.hpp>


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