Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65492 - in sandbox/chrono/libs/chrono/test: . clock clock/hires clock/monotonic clock/system duration duration/cast
From: vicente.botet_at_[hidden]
Date: 2010-09-20 16:40:52


Author: viboes
Date: 2010-09-20 16:40:47 EDT (Mon, 20 Sep 2010)
New Revision: 65492
URL: http://svn.boost.org/trac/boost/changeset/65492

Log:
Adapt tests from llvm/libc++/test/chrono clock
Added:
   sandbox/chrono/libs/chrono/test/clock/
   sandbox/chrono/libs/chrono/test/clock/hires/
   sandbox/chrono/libs/chrono/test/clock/hires/consistency.pass.cpp (contents, props changed)
   sandbox/chrono/libs/chrono/test/clock/hires/now.pass.cpp (contents, props changed)
   sandbox/chrono/libs/chrono/test/clock/monotonic/
   sandbox/chrono/libs/chrono/test/clock/monotonic/consistency.pass.cpp (contents, props changed)
   sandbox/chrono/libs/chrono/test/clock/monotonic/now.pass.cpp (contents, props changed)
   sandbox/chrono/libs/chrono/test/clock/nothing_to_do.pass.cpp (contents, props changed)
   sandbox/chrono/libs/chrono/test/clock/system/
   sandbox/chrono/libs/chrono/test/clock/system/consistency.pass.cpp (contents, props changed)
   sandbox/chrono/libs/chrono/test/clock/system/from_time_t.pass.cpp (contents, props changed)
   sandbox/chrono/libs/chrono/test/clock/system/now.pass.cpp (contents, props changed)
   sandbox/chrono/libs/chrono/test/clock/system/rep_signed.pass.cpp (contents, props changed)
   sandbox/chrono/libs/chrono/test/clock/system/to_time_t.pass.cpp (contents, props changed)
Text files modified:
   sandbox/chrono/libs/chrono/test/Jamfile.v2 | 95 +++++++++++++++++++++++----------------
   sandbox/chrono/libs/chrono/test/clock.h | 6 +-
   sandbox/chrono/libs/chrono/test/duration/cast/duration_cast.pass.cpp | 6 ++
   sandbox/chrono/libs/chrono/test/duration/cast/toduration.fail.cpp | 6 ++
   sandbox/chrono/libs/chrono/test/duration/duration.fail.cpp | 1
   5 files changed, 72 insertions(+), 42 deletions(-)

Modified: sandbox/chrono/libs/chrono/test/Jamfile.v2
==============================================================================
--- sandbox/chrono/libs/chrono/test/Jamfile.v2 (original)
+++ sandbox/chrono/libs/chrono/test/Jamfile.v2 2010-09-20 16:40:47 EDT (Mon, 20 Sep 2010)
@@ -24,7 +24,7 @@
         <library>/boost/system//boost_system
         #<library>/boost/thread//boost_thread/<link>shared
         # uncomment the line above if you build outside the Boost release
- #<include>$(BOOST_ROOT)
+ #<include>$(BOOST_ROOT)
         # uncomment the line above if you build outside the Boost release
         #<include>../../..
         <toolset>msvc:<asynch-exceptions>on
@@ -32,8 +32,8 @@
         <define>BOOST_CHRONO_USES_MPL_ASSERT
         <warnings>all
         <toolset>gcc:<cxxflags>-Wextra
- <toolset>gcc:<cxxflags>-Wno-long-long
- <toolset>gcc-mingw-4.5.0:<cxxflags>-Wno-missing-field-initializers
+ <toolset>gcc:<cxxflags>-Wno-long-long
+ <toolset>gcc-mingw-4.5.0:<cxxflags>-Wno-missing-field-initializers
         <toolset>gcc-mingw-4.5.0:<cxxflags>-fdiagnostics-show-option
         <toolset>msvc:<cxxflags>/wd4127
     ;
@@ -97,7 +97,7 @@
         [ run test_thread_clock.cpp : : : <link>static ]
         [ run test_thread_clock.cpp : : : : test_thread_clock_dll ]
         ;
-
+
     test-suite "typedefs"
         :
         [ run hours.pass.cpp : : : <link>static ]
@@ -108,7 +108,7 @@
         [ run nanoseconds.pass.cpp : : : <link>static ]
         #[ run milliseconds.pass.cpp : : : : milliseconds.pass.dll ]
         ;
-
+
     test-suite "traits"
         :
         [ run traits/specializations/duration.pass.cpp : : : <link>static ]
@@ -118,7 +118,7 @@
         [ run traits/duration_values/zero.pass.cpp : : : <link>static ]
         [ run traits/duration_values/min.pass.cpp : : : <link>static ]
         ;
-
+
     test-suite "duration"
         :
         [ compile-fail duration/duration.fail.cpp ]
@@ -126,6 +126,7 @@
         [ compile-fail duration/positive_num.fail.cpp ]
         [ run duration/default_ratio.pass.cpp : : : <link>static ]
         [ run duration/types.pass.cpp : : : <link>static ]
+
         [ run duration/arithmetic/op_divide_ass.pass.cpp : : : <link>static ]
         [ run duration/arithmetic/op_minusminusint.pass.cpp : : : <link>static ]
         [ run duration/arithmetic/op_plus_ass.pass.cpp : : : <link>static ]
@@ -138,11 +139,13 @@
         [ run duration/arithmetic/op_minusminus.pass.cpp : : : <link>static ]
         [ run duration/arithmetic/op_plus.pass.cpp : : : <link>static ]
         [ run duration/arithmetic/op_times_ass.pass.cpp : : : <link>static ]
+
         [ run duration/cast/duration_cast.pass.cpp : : : <link>static ]
         [ compile-fail duration/cast/toduration.fail.cpp ]
+
         [ run duration/comparisons/op_equal.pass.cpp : : : <link>static ]
         [ run duration/comparisons/op_less.pass.cpp : : : <link>static ]
-
+
         [ run duration/cons/convert_exact.pass.cpp : : : <link>static ]
         [ compile-fail duration/cons/convert_float_to_int.fail.cpp ]
         [ compile-fail duration/cons/convert_inexact.fail.cpp ]
@@ -166,40 +169,54 @@
         [ run duration/nonmember/op_times_rep.pass.cpp : : : <link>static : nonmember_op_times_rep.pass ]
         [ compile-fail duration/nonmember/op_times_rep1.fail.cpp : : nonmember_op_times_rep1.fail ]
         [ compile-fail duration/nonmember/op_times_rep2.fail.cpp : : nonmember_op_times_rep2.fail ]
-
+
         [ run duration/special/max.pass.cpp : : : <link>static : duration_special_max.pass ]
         [ run duration/special/min.pass.cpp : : : <link>static : duration_special_min.pass ]
         [ run duration/special/zero.pass.cpp : : : <link>static : duration_special_zero.pass ]
         ;
-
-
 
-#time_point/arithmetic/op_+=.pass.cpp
-#time_point/arithmetic/op_-=.pass.cpp
-#time_point/cast/time_point_cast.pass.cpp
-#time_point/cast/toduration.fail.cpp
-#time_point/comparisons/op_equal.fail.cpp
-#time_point/comparisons/op_equal.pass.cpp
-#time_point/comparisons/op_less.fail.cpp
-#time_point/comparisons/op_less.pass.cpp
-#time_point/cons/convert.fail.cpp
-#time_point/cons/convert.pass.cpp
-#time_point/cons/default.pass.cpp
-#time_point/cons/duration.fail.cpp
-#time_point/cons/duration.pass.cpp
-#time_point/nonmember/op_+.pass.cpp
-#time_point/nonmember/op_-duration.pass.cpp
-#time_point/nonmember/op_-time_point.pass.cpp
-#time_point/observer/tested_elsewhere.pass.cpp
-#time_point/special/max.pass.cpp
-#time_point/special/min.pass.cpp
-#clock/hires/consistency.pass.cpp
-#clock/hires/now.pass.cpp
-#clock/monotonic/consistency.pass.cpp
-#clock/monotonic/now.pass.cpp
-#clock/system/consistency.pass.cpp
-#clock/system/from_time_t.pass.cpp
-#clock/system/now.pass.cpp
-#clock/system/rep_signed.pass.cpp
-#clock/system/to_time_t.pass.cpp
-
+ test-suite "time_point"
+ :
+ [ run time_point/default_duration.pass.cpp : : : <link>static : time_point.default_duration.pass ]
+ [ compile-fail time_point/duration.fail.cpp : : time_point.duration.fail ]
+
+ [ run time_point/arithmetic/op_plus_ass.pass.cpp : : : <link>static : time_point.op_plus_ass.pass ]
+ [ run time_point/arithmetic/op_minus_ass.pass.cpp : : : <link>static : time_point.op_minus_ass.pass ]
+
+ [ run time_point/cast/time_point_cast.pass.cpp : : : <link>static : time_point.time_point_cast.pass ]
+ [ compile-fail time_point/cast/toduration.fail.cpp : : time_point.toduration.fail ]
+
+ [ compile-fail time_point/comparisons/op_equal.fail.cpp : : time_point.op_equal.fail ]
+ [ run time_point/comparisons/op_equal.pass.cpp : : : <link>static : time_point.op_equal.pass ]
+ [ compile-fail time_point/comparisons/op_less.fail.cpp : : time_point.op_less.fail ]
+ [ run time_point/comparisons/op_less.pass.cpp : : : <link>static : time_point.op_less.pass ]
+
+ [ compile-fail time_point/cons/convert.fail.cpp : : time_point.convert.fail ]
+ [ run time_point/cons/convert.pass.cpp : : : <link>static : time_point.convert.pass ]
+ [ run time_point/cons/default.pass.cpp : : : <link>static : time_point.default.pass ]
+ [ compile-fail time_point/cons/duration.fail.cpp : : time_point.cons.duration.fail ]
+ [ run time_point/cons/duration.pass.cpp : : : <link>static : time_point.duration.pass ]
+
+ [ run time_point/nonmember/op_plus.pass.cpp : : : <link>static : time_point.op_plus.pass ]
+ [ run time_point/nonmember/op_minus_time_point.pass.cpp : : : <link>static : time_point.op_minus_time_point.pass ]
+ [ run time_point/nonmember/op_minus_duration.pass.cpp : : : <link>static : time_point.op_minus_duration.pass ]
+
+ [ run time_point/special/max.pass.cpp : : : <link>static : time_point.max.pass ]
+ [ run time_point/special/min.pass.cpp : : : <link>static : time_point.min.pass ]
+ ;
+
+ test-suite "clock"
+ :
+ [ run clock/hires/consistency.pass.cpp : : : <link>static : clock.hires.consistency.pass ]
+ [ run clock/hires/now.pass.cpp : : : <link>static : clock.hires.now.pass ]
+
+ [ run clock/monotonic/consistency.pass.cpp : : : <link>static : clock.monotonic.consistency.pass ]
+ [ run clock/monotonic/now.pass.cpp : : : <link>static : clock.monotonic.now.pass ]
+
+ [ run clock/system/consistency.pass.cpp : : : <link>static : clock.system.consistency.pass ]
+ [ run clock/system/now.pass.cpp : : : <link>static : clock.system.now.pass ]
+ [ run clock/system/from_time_t.pass.cpp : : : <link>static : clock.system.from_time_t.pass ]
+ [ run clock/system/rep_signed.pass.cpp : : : <link>static : clock.system.rep_signed.pass ]
+ [ run clock/system/to_time_t.pass.cpp : : : <link>static : clock.system.to_time_t.pass ]
+ ;
+

Modified: sandbox/chrono/libs/chrono/test/clock.h
==============================================================================
--- sandbox/chrono/libs/chrono/test/clock.h (original)
+++ sandbox/chrono/libs/chrono/test/clock.h 2010-09-20 16:40:47 EDT (Mon, 20 Sep 2010)
@@ -5,11 +5,11 @@
 
 class Clock
 {
- typedef std::chrono::nanoseconds duration;
+ typedef boost::chrono::nanoseconds duration;
     typedef duration::rep rep;
     typedef duration::period period;
- typedef std::chrono::time_point<Clock, duration> time_point;
- static const bool is_monotonic = false;
+ typedef boost::chrono::time_point<Clock, duration> time_point;
+ static const bool is_monotonic = false;
 
     static time_point now();
 };

Added: sandbox/chrono/libs/chrono/test/clock/hires/consistency.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/clock/hires/consistency.pass.cpp 2010-09-20 16:40:47 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,36 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Adapted from llvm/libcxx/test/utilities/chrono
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <chrono>
+
+// high_resolution_clock
+
+// check clock invariants
+
+#include <boost/chrono.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+#if !defined(BOOST_NO_STATIC_ASSERT)
+#define NOTHING ""
+#endif
+
+int main()
+{
+ typedef boost::chrono::high_resolution_clock C;
+ BOOST_CHRONO_STATIC_ASSERT((boost::is_same<C::rep, C::duration::rep>::value), NOTHING, ());
+ BOOST_CHRONO_STATIC_ASSERT((boost::is_same<C::period, C::duration::period>::value), NOTHING, ());
+ BOOST_CHRONO_STATIC_ASSERT((boost::is_same<C::duration, C::time_point::duration>::value), NOTHING, ());
+ BOOST_CHRONO_STATIC_ASSERT(C::is_monotonic || !C::is_monotonic, NOTHING, ());
+ return 0;
+}

Added: sandbox/chrono/libs/chrono/test/clock/hires/now.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/clock/hires/now.pass.cpp 2010-09-20 16:40:47 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,28 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Adapted from llvm/libcxx/test/utilities/chrono
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <chrono>
+
+// high_resolution_clock
+
+// static time_point now();
+
+#include <boost/chrono.hpp>
+
+int main()
+{
+ typedef boost::chrono::high_resolution_clock C;
+ C::time_point t1 = C::now();
+ return 0;
+}

Added: sandbox/chrono/libs/chrono/test/clock/monotonic/consistency.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/clock/monotonic/consistency.pass.cpp 2010-09-20 16:40:47 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,37 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Adapted from llvm/libcxx/test/utilities/chrono
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <chrono>
+
+// monotonic_clock
+
+// check clock invariants
+
+#include <boost/chrono.hpp>
+#include <boost/type_traits/is_same.hpp>
+#if !defined(BOOST_NO_STATIC_ASSERT)
+#define NOTHING ""
+#endif
+
+int main()
+{
+#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ typedef boost::chrono::monotonic_clock C;
+ BOOST_CHRONO_STATIC_ASSERT((boost::is_same<C::rep, C::duration::rep>::value), NOTHING, ());
+ BOOST_CHRONO_STATIC_ASSERT((boost::is_same<C::period, C::duration::period>::value), NOTHING, ());
+ BOOST_CHRONO_STATIC_ASSERT((boost::is_same<C::duration, C::time_point::duration>::value), NOTHING, ());
+ BOOST_CHRONO_STATIC_ASSERT(C::is_monotonic, NOTHING, ());
+#endif
+ return 0;
+}

Added: sandbox/chrono/libs/chrono/test/clock/monotonic/now.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/clock/monotonic/now.pass.cpp 2010-09-20 16:40:47 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,33 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Adapted from llvm/libcxx/test/utilities/chrono
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <chrono>
+
+// monotonic_clock
+
+// static time_point now();
+
+#include <boost/chrono.hpp>
+#include <cassert>
+
+int main()
+{
+#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ typedef boost::chrono::monotonic_clock C;
+ C::time_point t1 = C::now();
+ C::time_point t2 = C::now();
+ assert(t2 >= t1);
+#endif
+ return 0;
+}

Added: sandbox/chrono/libs/chrono/test/clock/nothing_to_do.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/clock/nothing_to_do.pass.cpp 2010-09-20 16:40:47 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,12 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}

Added: sandbox/chrono/libs/chrono/test/clock/system/consistency.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/clock/system/consistency.pass.cpp 2010-09-20 16:40:47 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,36 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Adapted from llvm/libcxx/test/utilities/chrono
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <chrono>
+
+// system_clock
+
+// check clock invariants
+
+#include <boost/chrono.hpp>
+#include <boost/type_traits/is_same.hpp>
+#if !defined(BOOST_NO_STATIC_ASSERT)
+#define NOTHING ""
+#endif
+
+int main()
+{
+ typedef boost::chrono::system_clock C;
+ BOOST_CHRONO_STATIC_ASSERT((boost::is_same<C::rep, C::duration::rep>::value), NOTHING, ());
+ BOOST_CHRONO_STATIC_ASSERT((boost::is_same<C::period, C::duration::period>::value), NOTHING, ());
+ BOOST_CHRONO_STATIC_ASSERT((boost::is_same<C::duration, C::time_point::duration>::value), NOTHING, ());
+ BOOST_CHRONO_STATIC_ASSERT((boost::is_same<C::time_point::clock, C>::value), NOTHING, ());
+ BOOST_CHRONO_STATIC_ASSERT((C::is_monotonic || !C::is_monotonic), NOTHING, ());
+ return 0;
+}

Added: sandbox/chrono/libs/chrono/test/clock/system/from_time_t.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/clock/system/from_time_t.pass.cpp 2010-09-20 16:40:47 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,29 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Adapted from llvm/libcxx/test/utilities/chrono
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <chrono>
+
+// system_clock
+
+// static time_point from_time_t(time_t t);
+
+#include <boost/chrono.hpp>
+#include <ctime>
+
+int main()
+{
+ typedef boost::chrono::system_clock C;
+ C::time_point t1 = C::from_time_t(C::to_time_t(C::now()));
+ return 0;
+}

Added: sandbox/chrono/libs/chrono/test/clock/system/now.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/clock/system/now.pass.cpp 2010-09-20 16:40:47 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,28 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Adapted from llvm/libcxx/test/utilities/chrono
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <chrono>
+
+// system_clock
+
+// static time_point now();
+
+#include <boost/chrono.hpp>
+
+int main()
+{
+ typedef boost::chrono::system_clock C;
+ C::time_point t1 = C::now();
+ return 0;
+}

Added: sandbox/chrono/libs/chrono/test/clock/system/rep_signed.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/clock/system/rep_signed.pass.cpp 2010-09-20 16:40:47 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,29 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Adapted from llvm/libcxx/test/utilities/chrono
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <chrono>
+
+// system_clock
+
+// rep should be signed
+
+#include <boost/chrono.hpp>
+#include <cassert>
+
+int main()
+{
+ assert(boost::chrono::system_clock::duration::min() <
+ boost::chrono::system_clock::duration::zero());
+ return 0;
+}

Added: sandbox/chrono/libs/chrono/test/clock/system/to_time_t.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/chrono/test/clock/system/to_time_t.pass.cpp 2010-09-20 16:40:47 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,29 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Adapted from llvm/libcxx/test/utilities/chrono
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <chrono>
+
+// system_clock
+
+// time_t to_time_t(const time_point& t);
+
+#include <boost/chrono.hpp>
+#include <ctime>
+
+int main()
+{
+ typedef boost::chrono::system_clock C;
+ std::time_t t1 = C::to_time_t(C::now());
+ return 0;
+}

Modified: sandbox/chrono/libs/chrono/test/duration/cast/duration_cast.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/duration/cast/duration_cast.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/duration/cast/duration_cast.pass.cpp 2010-09-20 16:40:47 EDT (Mon, 20 Sep 2010)
@@ -1,3 +1,8 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Adapted from llvm/libcxx/test/utilities/chrono
 //===----------------------------------------------------------------------===//
 //
 // The LLVM Compiler Infrastructure
@@ -47,4 +52,5 @@
          boost::chrono::duration<double, boost::ratio<3600> >(7265./3600));
     test(boost::chrono::duration<int, boost::ratio<2, 3> >(9),
          boost::chrono::duration<int, boost::ratio<3, 5> >(10));
+ return 0;
 }

Modified: sandbox/chrono/libs/chrono/test/duration/cast/toduration.fail.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/duration/cast/toduration.fail.cpp (original)
+++ sandbox/chrono/libs/chrono/test/duration/cast/toduration.fail.cpp 2010-09-20 16:40:47 EDT (Mon, 20 Sep 2010)
@@ -1,3 +1,8 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Adapted from llvm/libcxx/test/utilities/chrono
 //===----------------------------------------------------------------------===//
 //
 // The LLVM Compiler Infrastructure
@@ -20,4 +25,5 @@
 int main()
 {
     boost::chrono::duration_cast<int>(boost::chrono::milliseconds(3));
+ return 0;
 }

Modified: sandbox/chrono/libs/chrono/test/duration/duration.fail.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/duration/duration.fail.cpp (original)
+++ sandbox/chrono/libs/chrono/test/duration/duration.fail.cpp 2010-09-20 16:40:47 EDT (Mon, 20 Sep 2010)
@@ -23,4 +23,5 @@
 {
     typedef boost::chrono::duration<boost::chrono::milliseconds> D;
     D d;
+ return 0;
 }


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