|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r65889 - in sandbox/chrono/libs/chrono/test: . time_point time_point/arithmetic time_point/cast time_point/comparisons time_point/cons time_point/nonmember time_point/observer time_point/special traits/duration_values traits/is_fp traits/specializations
From: vicente.botet_at_[hidden]
Date: 2010-10-10 15:15:06
Author: viboes
Date: 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
New Revision: 65889
URL: http://svn.boost.org/trac/boost/changeset/65889
Log:
Chrono:
* Use the detail/lightweight_test.hpp
Removed:
sandbox/chrono/libs/chrono/test/time_point/observer/tested_elsewhere.pass.cpp
Text files modified:
sandbox/chrono/libs/chrono/test/Jamfile.v2 | 21 ++++++------
sandbox/chrono/libs/chrono/test/chrono_accuracy_test.cpp | 15 ++++----
sandbox/chrono/libs/chrono/test/clock.h | 4 ++
sandbox/chrono/libs/chrono/test/hours.pass.cpp | 17 +---------
sandbox/chrono/libs/chrono/test/intmax_c.cpp | 2 -
sandbox/chrono/libs/chrono/test/microseconds.pass.cpp | 17 +---------
sandbox/chrono/libs/chrono/test/milliseconds.pass.cpp | 17 +---------
sandbox/chrono/libs/chrono/test/minutes.pass.cpp | 17 +---------
sandbox/chrono/libs/chrono/test/nanoseconds.pass.cpp | 17 +---------
sandbox/chrono/libs/chrono/test/rep.h | 4 ++
sandbox/chrono/libs/chrono/test/seconds.pass.cpp | 17 +---------
sandbox/chrono/libs/chrono/test/time_point/arithmetic/op_minus_ass.pass.cpp | 22 ++----------
sandbox/chrono/libs/chrono/test/time_point/arithmetic/op_plus_ass.pass.cpp | 22 ++----------
sandbox/chrono/libs/chrono/test/time_point/cast/time_point_cast.pass.cpp | 25 +++------------
sandbox/chrono/libs/chrono/test/time_point/cast/toduration.fail.cpp | 20 -----------
sandbox/chrono/libs/chrono/test/time_point/comparisons/op_equal.fail.cpp | 24 -------------
sandbox/chrono/libs/chrono/test/time_point/comparisons/op_equal.pass.cpp | 42 ++++++------------------
sandbox/chrono/libs/chrono/test/time_point/comparisons/op_less.fail.cpp | 32 ------------------
sandbox/chrono/libs/chrono/test/time_point/comparisons/op_less.pass.cpp | 66 +++++++++++----------------------------
sandbox/chrono/libs/chrono/test/time_point/cons/convert.fail.cpp | 19 ----------
sandbox/chrono/libs/chrono/test/time_point/cons/convert.pass.cpp | 23 ++-----------
sandbox/chrono/libs/chrono/test/time_point/cons/default.pass.cpp | 22 ++----------
sandbox/chrono/libs/chrono/test/time_point/cons/duration.fail.cpp | 18 ----------
sandbox/chrono/libs/chrono/test/time_point/cons/duration.pass.cpp | 24 +++-----------
sandbox/chrono/libs/chrono/test/time_point/default_duration.pass.cpp | 21 ------------
sandbox/chrono/libs/chrono/test/time_point/duration.fail.cpp | 16 ---------
sandbox/chrono/libs/chrono/test/time_point/nonmember/op_minus_duration.pass.cpp | 24 ++------------
sandbox/chrono/libs/chrono/test/time_point/nonmember/op_minus_time_point.pass.cpp | 24 ++------------
sandbox/chrono/libs/chrono/test/time_point/nonmember/op_plus.pass.cpp | 30 +++---------------
sandbox/chrono/libs/chrono/test/time_point/special/max.pass.cpp | 22 ++----------
sandbox/chrono/libs/chrono/test/time_point/special/min.pass.cpp | 22 ++----------
sandbox/chrono/libs/chrono/test/traits/duration_values/max.pass.cpp | 25 ++++----------
sandbox/chrono/libs/chrono/test/traits/duration_values/min.pass.cpp | 38 ++++------------------
sandbox/chrono/libs/chrono/test/traits/duration_values/zero.pass.cpp | 23 +++----------
sandbox/chrono/libs/chrono/test/traits/is_fp/treat_as_floating_point.pass.cpp | 17 +---------
sandbox/chrono/libs/chrono/test/traits/specializations/duration.pass.cpp | 21 +-----------
sandbox/chrono/libs/chrono/test/traits/specializations/time_point.pass.cpp | 21 +-----------
37 files changed, 148 insertions(+), 663 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-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -103,20 +103,19 @@
test-suite "typedefs"
:
- [ run hours.pass.cpp : : : <link>static ]
- [ run minutes.pass.cpp : : : <link>static ]
- [ run seconds.pass.cpp : : : <link>static ]
- [ run milliseconds.pass.cpp : : : <link>static ]
- [ run microseconds.pass.cpp : : : <link>static ]
- [ run nanoseconds.pass.cpp : : : <link>static ]
- #[ run milliseconds.pass.cpp : : : : milliseconds.pass.dll ]
+ [ compile hours.pass.cpp : : ]
+ [ compile minutes.pass.cpp : : ]
+ [ compile seconds.pass.cpp : : ]
+ [ compile milliseconds.pass.cpp : : ]
+ [ compile microseconds.pass.cpp : : ]
+ [ compile nanoseconds.pass.cpp : : ]
;
test-suite "traits"
:
- [ run traits/specializations/duration.pass.cpp : : : <link>static ]
- [ run traits/specializations/time_point.pass.cpp : : : <link>static ]
- [ run traits/is_fp/treat_as_floating_point.pass.cpp : : : <link>static ]
+ [ compile traits/specializations/duration.pass.cpp : : ]
+ [ compile traits/specializations/time_point.pass.cpp : : ]
+ [ compile traits/is_fp/treat_as_floating_point.pass.cpp : : ]
[ run traits/duration_values/max.pass.cpp : : : <link>static ]
[ run traits/duration_values/zero.pass.cpp : : : <link>static ]
[ run traits/duration_values/min.pass.cpp : : : <link>static ]
@@ -180,7 +179,7 @@
test-suite "time_point"
:
- [ run time_point/default_duration.pass.cpp : : : <link>static : time_point.default_duration.pass ]
+ [ compile time_point/default_duration.pass.cpp : : 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 ]
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-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -20,7 +20,8 @@
using boost::chrono::run_timer;
using boost::system::error_code;
-#include <boost/test/minimal.hpp>
+//#include <boost/test/minimal.hpp>
+#include <boost/detail/lightweight_test.hpp>
namespace
{
@@ -70,33 +71,33 @@
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 );
}
}
-int test_main( int argc, char * argv[] )
+int main( int argc, char * argv[] )
{
accuracy_test( argc, argv );
- return 0;
+ return boost::report_errors();
}
Modified: sandbox/chrono/libs/chrono/test/clock.h
==============================================================================
--- sandbox/chrono/libs/chrono/test/clock.h (original)
+++ sandbox/chrono/libs/chrono/test/clock.h 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -1,3 +1,7 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
#ifndef CLOCK_H
#define CLOCK_H
Modified: sandbox/chrono/libs/chrono/test/hours.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/hours.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/hours.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -1,19 +1,6 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-// Adapted by Vicente J. Botet Escriba test Boost.Chrono
+// Copyright 2010 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
-//
-//===----------------------------------------------------------------------===//
-
-// <chrono>
-
-// typedef duration<signed integral type of at least 23 bits, ratio<3600>> hours;
#include <boost/chrono.hpp>
#include <boost/type_traits.hpp>
@@ -23,7 +10,7 @@
#define NOTHING ""
#endif
-int main()
+void test()
{
typedef boost::chrono::hours D;
typedef D::rep Rep;
Modified: sandbox/chrono/libs/chrono/test/intmax_c.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/intmax_c.cpp (original)
+++ sandbox/chrono/libs/chrono/test/intmax_c.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -1,4 +1,3 @@
-//#include <iostream>
#include <boost/cstdint.hpp>
#ifdef INTMAX_C
@@ -9,6 +8,5 @@
boost::intmax_t i = BOOST_INTMAX_C(1000000000);
int main() {
- //std::cout << i << std::endl;
return (i);
}
Modified: sandbox/chrono/libs/chrono/test/microseconds.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/microseconds.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/microseconds.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -1,19 +1,6 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-// Adapted by Vicente J. Botet Escriba test Boost.Chrono
+// Copyright 2010 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
-//
-//===----------------------------------------------------------------------===//
-
-// <chrono>
-
-// typedef duration<signed integral type of at least 55 bits, micro> microseconds;
#include <boost/chrono.hpp>
#include <boost/type_traits.hpp>
@@ -23,7 +10,7 @@
#define NOTHING ""
#endif
-int main()
+void test()
{
typedef boost::chrono::microseconds D;
typedef D::rep Rep;
Modified: sandbox/chrono/libs/chrono/test/milliseconds.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/milliseconds.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/milliseconds.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -1,19 +1,6 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-// Adapted by Vicente J. Botet Escriba test Boost.Chrono
+// Copyright 2010 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
-//
-//===----------------------------------------------------------------------===//
-
-// <chrono>
-
-// typedef duration<signed integral type of at least 45 bits, milli> milliseconds;
#include <boost/chrono.hpp>
#include <boost/type_traits.hpp>
@@ -23,7 +10,7 @@
#define NOTHING ""
#endif
-int main()
+void test()
{
typedef boost::chrono::milliseconds D;
typedef D::rep Rep;
Modified: sandbox/chrono/libs/chrono/test/minutes.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/minutes.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/minutes.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -1,19 +1,6 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-// Adapted by Vicente J. Botet Escriba test Boost.Chrono
+// Copyright 2010 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
-//
-//===----------------------------------------------------------------------===//
-
-// <chrono>
-
-// typedef duration<signed integral type of at least 29 bits, ratio< 60>> minutes;
#include <boost/chrono.hpp>
#include <boost/type_traits.hpp>
@@ -23,7 +10,7 @@
#define NOTHING ""
#endif
-int main()
+void test()
{
typedef boost::chrono::minutes D;
typedef D::rep Rep;
Modified: sandbox/chrono/libs/chrono/test/nanoseconds.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/nanoseconds.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/nanoseconds.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -1,19 +1,6 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-// Adapted by Vicente J. Botet Escriba test Boost.Chrono
+// Copyright 2010 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
-//
-//===----------------------------------------------------------------------===//
-
-// <chrono>
-
-// typedef duration<signed integral type of at least 64 bits, nano> nanoseconds;
#include <boost/chrono.hpp>
#include <boost/type_traits.hpp>
@@ -23,7 +10,7 @@
#define NOTHING ""
#endif
-int main()
+void test()
{
typedef boost::chrono::nanoseconds D;
typedef D::rep Rep;
Modified: sandbox/chrono/libs/chrono/test/rep.h
==============================================================================
--- sandbox/chrono/libs/chrono/test/rep.h (original)
+++ sandbox/chrono/libs/chrono/test/rep.h 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -1,3 +1,7 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
#ifndef REP_H
#define REP_H
Modified: sandbox/chrono/libs/chrono/test/seconds.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/seconds.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/seconds.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -1,19 +1,6 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-// Adapted by Vicente J. Botet Escriba test Boost.Chrono
+// Copyright 2010 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
-//
-//===----------------------------------------------------------------------===//
-
-// <chrono>
-
-// typedef duration<signed integral type of at least 35 bits > seconds;
#include <boost/chrono.hpp>
#include <boost/type_traits.hpp>
@@ -23,7 +10,7 @@
#define NOTHING ""
#endif
-int main()
+void test()
{
typedef boost::chrono::seconds D;
typedef D::rep Rep;
Modified: sandbox/chrono/libs/chrono/test/time_point/arithmetic/op_minus_ass.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/arithmetic/op_minus_ass.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/time_point/arithmetic/op_minus_ass.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -2,24 +2,8 @@
// 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>
-
-// time_point
-
-// time_point& operator-=(const duration& d);
-
#include <boost/chrono.hpp>
-#include <cassert>
+#include <boost/detail/lightweight_test.hpp>
int main()
{
@@ -27,5 +11,7 @@
typedef boost::chrono::milliseconds Duration;
boost::chrono::time_point<Clock, Duration> t(Duration(3));
t -= Duration(2);
- assert(t.time_since_epoch() == Duration(1));
+ BOOST_TEST(t.time_since_epoch() == Duration(1));
+
+ return boost::report_errors();
}
Modified: sandbox/chrono/libs/chrono/test/time_point/arithmetic/op_plus_ass.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/arithmetic/op_plus_ass.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/time_point/arithmetic/op_plus_ass.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -2,24 +2,8 @@
// 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>
-
-// time_point
-
-// time_point& operator+=(const duration& d);
-
#include <boost/chrono.hpp>
-#include <cassert>
+#include <boost/detail/lightweight_test.hpp>
int main()
{
@@ -27,5 +11,7 @@
typedef boost::chrono::milliseconds Duration;
boost::chrono::time_point<Clock, Duration> t(Duration(3));
t += Duration(2);
- assert(t.time_since_epoch() == Duration(5));
+ BOOST_TEST(t.time_since_epoch() == Duration(5));
+
+ return boost::report_errors();
}
Modified: sandbox/chrono/libs/chrono/test/time_point/cast/time_point_cast.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/cast/time_point_cast.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/time_point/cast/time_point_cast.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -2,27 +2,10 @@
// 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>
-
-// time_point
-
-// template <class ToDuration, class Clock, class Duration>
-// time_point<Clock, ToDuration>
-// time_point_cast(const time_point<Clock, Duration>& t);
-
#include <boost/chrono.hpp>
#include <boost/type_traits.hpp>
-#include <cassert>
+#include <boost/detail/lightweight_test.hpp>
+
#if !defined(BOOST_NO_STATIC_ASSERT)
#define NOTHING ""
#endif
@@ -42,7 +25,7 @@
typedef decltype(boost::chrono::time_point_cast<ToDuration>(f)) R;
#endif
BOOST_CHRONO_STATIC_ASSERT((boost::is_same<R, ToTimePoint>::value), NOTHING, ());
- assert(boost::chrono::time_point_cast<ToDuration>(f) == t);
+ BOOST_TEST(boost::chrono::time_point_cast<ToDuration>(f) == t);
}
int main()
@@ -57,4 +40,6 @@
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 boost::report_errors();
}
Modified: sandbox/chrono/libs/chrono/test/time_point/cast/toduration.fail.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/cast/toduration.fail.cpp (original)
+++ sandbox/chrono/libs/chrono/test/time_point/cast/toduration.fail.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -2,29 +2,11 @@
// 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>
-
-// time_point
-
-// template <class ToDuration, class Clock, class Duration>
-// time_point<Clock, ToDuration>
-// time_point_cast(const time_point<Clock, Duration>& t);
-
// ToDuration shall be an instantiation of duration.
#include <boost/chrono.hpp>
-int main()
+void test()
{
typedef boost::chrono::system_clock Clock;
typedef boost::chrono::time_point<Clock, boost::chrono::milliseconds> FromTimePoint;
Modified: sandbox/chrono/libs/chrono/test/time_point/comparisons/op_equal.fail.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/comparisons/op_equal.fail.cpp (original)
+++ sandbox/chrono/libs/chrono/test/time_point/comparisons/op_equal.fail.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -2,35 +2,13 @@
// 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>
-
-// time_point
-
-// template <class Clock, class Duration1, class Duration2>
-// bool
-// operator==(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
-
-// template <class Clock, class Duration1, class Duration2>
-// bool
-// operator!=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
-
// time_points with different clocks should not compare
#include <boost/chrono.hpp>
#include "../../clock.h"
-int main()
+void test()
{
typedef boost::chrono::system_clock Clock1;
typedef Clock Clock2;
Modified: sandbox/chrono/libs/chrono/test/time_point/comparisons/op_equal.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/comparisons/op_equal.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/time_point/comparisons/op_equal.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -2,30 +2,8 @@
// 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>
-
-// time_point
-
-// template <class Clock, class Duration1, class Duration2>
-// bool
-// operator==(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
-
-// template <class Clock, class Duration1, class Duration2>
-// bool
-// operator!=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
-
#include <boost/chrono.hpp>
-#include <cassert>
+#include <boost/detail/lightweight_test.hpp>
int main()
{
@@ -38,25 +16,27 @@
{
T1 t1(Duration1(3));
T1 t2(Duration1(3));
- assert( (t1 == t2));
- assert(!(t1 != t2));
+ BOOST_TEST( (t1 == t2));
+ BOOST_TEST(!(t1 != t2));
}
{
T1 t1(Duration1(3));
T1 t2(Duration1(4));
- assert(!(t1 == t2));
- assert( (t1 != t2));
+ BOOST_TEST(!(t1 == t2));
+ BOOST_TEST( (t1 != t2));
}
{
T1 t1(Duration1(3));
T2 t2(Duration2(3000));
- assert( (t1 == t2));
- assert(!(t1 != t2));
+ BOOST_TEST( (t1 == t2));
+ BOOST_TEST(!(t1 != t2));
}
{
T1 t1(Duration1(3));
T2 t2(Duration2(3001));
- assert(!(t1 == t2));
- assert( (t1 != t2));
+ BOOST_TEST(!(t1 == t2));
+ BOOST_TEST( (t1 != t2));
}
+
+ return boost::report_errors();
}
Modified: sandbox/chrono/libs/chrono/test/time_point/comparisons/op_less.fail.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/comparisons/op_less.fail.cpp (original)
+++ sandbox/chrono/libs/chrono/test/time_point/comparisons/op_less.fail.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -2,43 +2,13 @@
// 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>
-
-// time_point
-
-// template <class Clock, class Duration1, class Duration2>
-// bool
-// operator< (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
-
-// template <class Clock, class Duration1, class Duration2>
-// bool
-// operator> (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
-
-// template <class Clock, class Duration1, class Duration2>
-// bool
-// operator<=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
-
-// template <class Clock, class Duration1, class Duration2>
-// bool
-// operator>=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
-
// time_points with different clocks should not compare
#include <boost/chrono.hpp>
#include "../../clock.h"
-int main()
+void test()
{
typedef boost::chrono::system_clock Clock1;
typedef Clock Clock2;
Modified: sandbox/chrono/libs/chrono/test/time_point/comparisons/op_less.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/comparisons/op_less.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/time_point/comparisons/op_less.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -2,38 +2,8 @@
// 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>
-
-// time_point
-
-// template <class Clock, class Duration1, class Duration2>
-// bool
-// operator< (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
-
-// template <class Clock, class Duration1, class Duration2>
-// bool
-// operator> (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
-
-// template <class Clock, class Duration1, class Duration2>
-// bool
-// operator<=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
-
-// template <class Clock, class Duration1, class Duration2>
-// bool
-// operator>=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
-
#include <boost/chrono.hpp>
-#include <cassert>
+#include <boost/detail/lightweight_test.hpp>
int main()
{
@@ -46,33 +16,35 @@
{
T1 t1(Duration1(3));
T1 t2(Duration1(3));
- assert(!(t1 < t2));
- assert(!(t1 > t2));
- assert( (t1 <= t2));
- assert( (t1 >= t2));
+ BOOST_TEST(!(t1 < t2));
+ BOOST_TEST(!(t1 > t2));
+ BOOST_TEST( (t1 <= t2));
+ BOOST_TEST( (t1 >= t2));
}
{
T1 t1(Duration1(3));
T1 t2(Duration1(4));
- assert( (t1 < t2));
- assert(!(t1 > t2));
- assert( (t1 <= t2));
- assert(!(t1 >= t2));
+ BOOST_TEST( (t1 < t2));
+ BOOST_TEST(!(t1 > t2));
+ BOOST_TEST( (t1 <= t2));
+ BOOST_TEST(!(t1 >= t2));
}
{
T1 t1(Duration1(3));
T2 t2(Duration2(3000));
- assert(!(t1 < t2));
- assert(!(t1 > t2));
- assert( (t1 <= t2));
- assert( (t1 >= t2));
+ BOOST_TEST(!(t1 < t2));
+ BOOST_TEST(!(t1 > t2));
+ BOOST_TEST( (t1 <= t2));
+ BOOST_TEST( (t1 >= t2));
}
{
T1 t1(Duration1(3));
T2 t2(Duration2(3001));
- assert( (t1 < t2));
- assert(!(t1 > t2));
- assert( (t1 <= t2));
- assert(!(t1 >= t2));
+ BOOST_TEST( (t1 < t2));
+ BOOST_TEST(!(t1 > t2));
+ BOOST_TEST( (t1 <= t2));
+ BOOST_TEST(!(t1 >= t2));
}
+
+ return boost::report_errors();
}
Modified: sandbox/chrono/libs/chrono/test/time_point/cons/convert.fail.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/cons/convert.fail.cpp (original)
+++ sandbox/chrono/libs/chrono/test/time_point/cons/convert.fail.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -2,28 +2,11 @@
// 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>
-
-// time_point
-
-// template <class Duration2>
-// time_point(const time_point<clock, Duration2>& t);
-
// Duration2 shall be implicitly convertible to duration.
#include <boost/chrono.hpp>
-int main()
+void test()
{
typedef boost::chrono::system_clock Clock;
typedef boost::chrono::milliseconds Duration1;
Modified: sandbox/chrono/libs/chrono/test/time_point/cons/convert.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/cons/convert.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/time_point/cons/convert.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -2,25 +2,8 @@
// 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>
-
-// time_point
-
-// template <class Duration2>
-// time_point(const time_point<clock, Duration2>& t);
-
#include <boost/chrono.hpp>
-#include <cassert>
+#include <boost/detail/lightweight_test.hpp>
int main()
{
@@ -30,6 +13,8 @@
{
boost::chrono::time_point<Clock, Duration2> t2(Duration2(3));
boost::chrono::time_point<Clock, Duration1> t1 = t2;
- assert(t1.time_since_epoch() == Duration1(3000));
+ BOOST_TEST(t1.time_since_epoch() == Duration1(3000));
}
+
+ return boost::report_errors();
}
Modified: sandbox/chrono/libs/chrono/test/time_point/cons/default.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/cons/default.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/time_point/cons/default.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -2,24 +2,8 @@
// 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>
-
-// time_point
-
-// time_point();
-
#include <boost/chrono.hpp>
-#include <cassert>
+#include <boost/detail/lightweight_test.hpp>
#include "../../rep.h"
@@ -28,5 +12,7 @@
typedef boost::chrono::system_clock Clock;
typedef boost::chrono::duration<Rep, boost::milli> Duration;
boost::chrono::time_point<Clock, Duration> t;
- assert(t.time_since_epoch() == Duration::zero());
+ BOOST_TEST(t.time_since_epoch() == Duration::zero());
+
+ return boost::report_errors();
}
Modified: sandbox/chrono/libs/chrono/test/time_point/cons/duration.fail.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/cons/duration.fail.cpp (original)
+++ sandbox/chrono/libs/chrono/test/time_point/cons/duration.fail.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -2,27 +2,11 @@
// 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>
-
-// time_point
-
-// explicit time_point(const duration& d);
-
// test for explicit
#include <boost/chrono.hpp>
-int main()
+void test()
{
typedef boost::chrono::system_clock Clock;
typedef boost::chrono::milliseconds Duration;
Modified: sandbox/chrono/libs/chrono/test/time_point/cons/duration.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/cons/duration.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/time_point/cons/duration.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -2,24 +2,8 @@
// 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>
-
-// time_point
-
-// explicit time_point(const duration& d);
-
#include <boost/chrono.hpp>
-#include <cassert>
+#include <boost/detail/lightweight_test.hpp>
int main()
{
@@ -27,10 +11,12 @@
typedef boost::chrono::milliseconds Duration;
{
boost::chrono::time_point<Clock, Duration> t(Duration(3));
- assert(t.time_since_epoch() == Duration(3));
+ BOOST_TEST(t.time_since_epoch() == Duration(3));
}
{
boost::chrono::time_point<Clock, Duration> t(boost::chrono::seconds(3));
- assert(t.time_since_epoch() == Duration(3000));
+ BOOST_TEST(t.time_since_epoch() == Duration(3000));
}
+
+ return boost::report_errors();
}
Modified: sandbox/chrono/libs/chrono/test/time_point/default_duration.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/default_duration.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/time_point/default_duration.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -2,32 +2,13 @@
// 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>
-
-// time_point
-
-// Test default template arg:
-
-// template <class Clock, class Duration = typename Clock::duration>
-// class time_point;
-
#include <boost/chrono.hpp>
#include <boost/type_traits.hpp>
#if !defined(BOOST_NO_STATIC_ASSERT)
#define NOTHING ""
#endif
-int main()
+void test()
{
BOOST_CHRONO_STATIC_ASSERT((boost::is_same<boost::chrono::system_clock::duration,
boost::chrono::time_point<boost::chrono::system_clock>::duration>::value), NOTHING, ());
Modified: sandbox/chrono/libs/chrono/test/time_point/duration.fail.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/duration.fail.cpp (original)
+++ sandbox/chrono/libs/chrono/test/time_point/duration.fail.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -2,25 +2,11 @@
// 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>
-
-// time_point
-
// Duration shall be an instance of duration.
#include <boost/chrono.hpp>
-int main()
+void test()
{
typedef boost::chrono::time_point<boost::chrono::system_clock, int> T;
T t;
Modified: sandbox/chrono/libs/chrono/test/time_point/nonmember/op_minus_duration.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/nonmember/op_minus_duration.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/time_point/nonmember/op_minus_duration.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -2,26 +2,8 @@
// 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>
-
-// time_point
-
-// template <class Clock, class Duration1, class Rep2, class Period2>
-// time_point<Clock, typename common_type<Duration1, duration<Rep2, Period2>>::type>
-// operator-(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs);
-
#include <boost/chrono.hpp>
-#include <cassert>
+#include <boost/detail/lightweight_test.hpp>
int main()
{
@@ -30,5 +12,7 @@
typedef boost::chrono::microseconds Duration2;
boost::chrono::time_point<Clock, Duration1> t1(Duration1(3));
boost::chrono::time_point<Clock, Duration2> t2 = t1 - Duration2(5);
- assert(t2.time_since_epoch() == Duration2(2995));
+ BOOST_TEST(t2.time_since_epoch() == Duration2(2995));
+
+ return boost::report_errors();
}
Modified: sandbox/chrono/libs/chrono/test/time_point/nonmember/op_minus_time_point.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/nonmember/op_minus_time_point.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/time_point/nonmember/op_minus_time_point.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -2,26 +2,8 @@
// 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>
-
-// time_point
-
-// template <class Clock, class Duration1, class Duration2>
-// typename common_type<Duration1, Duration2>::type
-// operator-(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
-
#include <boost/chrono.hpp>
-#include <cassert>
+#include <boost/detail/lightweight_test.hpp>
int main()
{
@@ -30,5 +12,7 @@
typedef boost::chrono::microseconds Duration2;
boost::chrono::time_point<Clock, Duration1> t1(Duration1(3));
boost::chrono::time_point<Clock, Duration2> t2(Duration2(5));
- assert((t1 - t2) == Duration2(2995));
+ BOOST_TEST((t1 - t2) == Duration2(2995));
+
+ return boost::report_errors();
}
Modified: sandbox/chrono/libs/chrono/test/time_point/nonmember/op_plus.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/nonmember/op_plus.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/time_point/nonmember/op_plus.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -2,30 +2,8 @@
// 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>
-
-// time_point
-
-// template <class Clock, class Duration1, class Rep2, class Period2>
-// time_point<Clock, typename common_type<Duration1, duration<Rep2, Period2>>::type>
-// operator+(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs);
-
-// template <class Rep1, class Period1, class Clock, class Duration2>
-// time_point<Clock, typename common_type<duration<Rep1, Period1>, Duration2>::type>
-// operator+(const duration<Rep1, Period1>& lhs, const time_point<Clock, Duration2>& rhs);
-
#include <boost/chrono.hpp>
-#include <cassert>
+#include <boost/detail/lightweight_test.hpp>
int main()
{
@@ -34,7 +12,9 @@
typedef boost::chrono::microseconds Duration2;
boost::chrono::time_point<Clock, Duration1> t1(Duration1(3));
boost::chrono::time_point<Clock, Duration2> t2 = t1 + Duration2(5);
- assert(t2.time_since_epoch() == Duration2(3005));
+ BOOST_TEST(t2.time_since_epoch() == Duration2(3005));
t2 = Duration2(6) + t1;
- assert(t2.time_since_epoch() == Duration2(3006));
+ BOOST_TEST(t2.time_since_epoch() == Duration2(3006));
+
+ return boost::report_errors();
}
Deleted: sandbox/chrono/libs/chrono/test/time_point/observer/tested_elsewhere.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/observer/tested_elsewhere.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
+++ (empty file)
@@ -1,17 +0,0 @@
-// 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.
-//
-//===----------------------------------------------------------------------===//
-
-int main()
-{
-}
Modified: sandbox/chrono/libs/chrono/test/time_point/special/max.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/special/max.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/time_point/special/max.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -2,29 +2,15 @@
// 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>
-
-// time_point
-
-// static constexpr time_point max();
-
#include <boost/chrono.hpp>
-#include <cassert>
+#include <boost/detail/lightweight_test.hpp>
int main()
{
typedef boost::chrono::system_clock Clock;
typedef boost::chrono::milliseconds Duration;
typedef boost::chrono::time_point<Clock, Duration> TP;
- assert(TP::max() == TP(Duration::max()));
+ BOOST_TEST(TP::max() == TP(Duration::max()));
+
+ return boost::report_errors();
}
Modified: sandbox/chrono/libs/chrono/test/time_point/special/min.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/special/min.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/time_point/special/min.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -2,29 +2,15 @@
// 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>
-
-// time_point
-
-// static constexpr time_point min();
-
#include <boost/chrono.hpp>
-#include <cassert>
+#include <boost/detail/lightweight_test.hpp>
int main()
{
typedef boost::chrono::system_clock Clock;
typedef boost::chrono::milliseconds Duration;
typedef boost::chrono::time_point<Clock, Duration> TP;
- assert(TP::min() == TP(Duration::min()));
+ BOOST_TEST(TP::min() == TP(Duration::min()));
+
+ return boost::report_errors();
}
Modified: sandbox/chrono/libs/chrono/test/traits/duration_values/max.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/traits/duration_values/max.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/traits/duration_values/max.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -1,24 +1,11 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-// Adapted by Vicente J. Botet Escriba test Boost.Chrono
+// Copyright 2010 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
-//
-//===----------------------------------------------------------------------===//
-
-// <chrono>
-
-// duration_values::max
#include <boost/chrono.hpp>
#include <boost/type_traits.hpp>
#include <limits>
-#include <cassert>
+#include <boost/detail/lightweight_test.hpp>
#include "../../rep.h"
@@ -28,10 +15,12 @@
int main()
{
- assert(boost::chrono::duration_values<int>::max() ==
+ BOOST_TEST(boost::chrono::duration_values<int>::max() ==
std::numeric_limits<int>::max());
- assert(boost::chrono::duration_values<double>::max() ==
+ BOOST_TEST(boost::chrono::duration_values<double>::max() ==
std::numeric_limits<double>::max());
- assert(boost::chrono::duration_values<Rep>::max() ==
+ BOOST_TEST(boost::chrono::duration_values<Rep>::max() ==
std::numeric_limits<Rep>::max());
+
+ return boost::report_errors();
}
Modified: sandbox/chrono/libs/chrono/test/traits/duration_values/min.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/traits/duration_values/min.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/traits/duration_values/min.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -1,23 +1,10 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-// Adapted by Vicente J. Botet Escriba test Boost.Chrono
+// Copyright 2010 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
-//
-//===----------------------------------------------------------------------===//
-
-// <chrono>
-
-// duration_values::min
#include <boost/chrono.hpp>
#include <limits>
-#include <cassert>
+#include <boost/detail/lightweight_test.hpp>
#include <iostream>
#include "../../rep.h"
@@ -28,24 +15,13 @@
int main()
{
- assert(boost::chrono::duration_values<int>::min() ==
+ BOOST_TEST(boost::chrono::duration_values<int>::min() ==
std::numeric_limits<int>::min());
- assert(boost::chrono::duration_values<double>::min() ==
+ BOOST_TEST(boost::chrono::duration_values<double>::min() ==
-std::numeric_limits<double>::max());
- assert(boost::chrono::duration_values<Rep>::min() ==
+ BOOST_TEST(boost::chrono::duration_values<Rep>::min() ==
std::numeric_limits<Rep>::min());
- //~ std::cout << boost::chrono::duration_values<int>::min() << std::endl;
- //~ std::cout << std::numeric_limits<int>::min() << std::endl;
- //~ std::cout << std::numeric_limits<int>::lowest() << std::endl;
- //~ std::cout << boost::chrono::duration_values<double>::min() << std::endl;
- //~ std::cout << std::numeric_limits<double>::min() << std::endl;
- //~ std::cout << -std::numeric_limits<double>::max() << std::endl;
- //~ std::cout << std::numeric_limits<double>::lowest() << std::endl;
- //~ std::cout << boost::chrono::duration_values<Rep>::max() << std::endl;
- std::cout << (boost::chrono::duration_values<Rep>::min)().data_ << std::endl;
- std::cout << (std::numeric_limits<Rep>::min)().data_ << std::endl;
- std::cout << (std::numeric_limits<Rep>::max)().data_ << std::endl;
- //~ std::numeric_limits<int>::min());
- return 0;
+
+ return boost::report_errors();
}
Modified: sandbox/chrono/libs/chrono/test/traits/duration_values/zero.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/traits/duration_values/zero.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/traits/duration_values/zero.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -1,22 +1,9 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-// Adapted by Vicente J. Botet Escriba test Boost.Chrono
+// Copyright 2010 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
-//
-//===----------------------------------------------------------------------===//
-
-// <chrono>
-
-// duration_values::zero
#include <boost/chrono.hpp>
-#include <cassert>
+#include <boost/detail/lightweight_test.hpp>
#include "../../rep.h"
@@ -26,6 +13,8 @@
int main()
{
- assert(boost::chrono::duration_values<int>::zero() == 0);
- assert(boost::chrono::duration_values<Rep>::zero() == 0);
+ BOOST_TEST(boost::chrono::duration_values<int>::zero() == 0);
+ BOOST_TEST(boost::chrono::duration_values<Rep>::zero() == 0);
+
+ return boost::report_errors();
}
Modified: sandbox/chrono/libs/chrono/test/traits/is_fp/treat_as_floating_point.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/traits/is_fp/treat_as_floating_point.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/traits/is_fp/treat_as_floating_point.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -1,19 +1,6 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-// Adapted by Vicente J. Botet Escriba test Boost.Chrono
+// Copyright 2010 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
-//
-//===----------------------------------------------------------------------===//
-
-// <chrono>
-
-// treat_as_floating_point
#include <boost/chrono.hpp>
#include <boost/type_traits.hpp>
@@ -32,7 +19,7 @@
struct A {};
-int main()
+void testall()
{
test<int>();
test<unsigned>();
Modified: sandbox/chrono/libs/chrono/test/traits/specializations/duration.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/traits/specializations/duration.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/traits/specializations/duration.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -1,23 +1,6 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-// Adapted by Vicente J. Botet Escriba test Boost.Chrono
+// Copyright 2010 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
-//
-//===----------------------------------------------------------------------===//
-
-// <chrono>
-
-// template <class Rep1, class Period1, class Rep2, class Period2>
-// struct common_type<chrono::duration<Rep1, Period1>, chrono::duration<Rep2, Period2>>
-// {
-// typedef chrono::duration<typename common_type<Rep1, Rep2>::type, see below }> type;
-// };
#include <boost/chrono.hpp>
#include <boost/type_traits/is_same.hpp>
@@ -34,7 +17,7 @@
BOOST_CHRONO_STATIC_ASSERT((boost::is_same<Dc, De>::value), NOTHING, ());
}
-int main()
+void testall()
{
test<boost::chrono::duration<int, boost::ratio<1, 100> >,
boost::chrono::duration<long, boost::ratio<1, 1000> >,
Modified: sandbox/chrono/libs/chrono/test/traits/specializations/time_point.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/traits/specializations/time_point.pass.cpp (original)
+++ sandbox/chrono/libs/chrono/test/traits/specializations/time_point.pass.cpp 2010-10-10 15:14:52 EDT (Sun, 10 Oct 2010)
@@ -1,23 +1,6 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-// Adapted by Vicente J. Botet Escriba test Boost.Chrono
+// Copyright 2010 Vicente J. Botet Escriba
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
-//
-//===----------------------------------------------------------------------===//
-
-// <chrono>
-
-// template <class Clock, class Duration1, class Duration2>
-// struct common_type<chrono::time_point<Clock, Duration1>, chrono::time_point<Clock, Duration2>>
-// {
-// typedef chrono::time_point<Clock, typename common_type<Duration1, Duration2>::type> type;
-// };
#include <boost/chrono.hpp>
#include <boost/type_traits.hpp>
@@ -38,7 +21,7 @@
BOOST_CHRONO_STATIC_ASSERT((boost::is_same<Tc, Te>::value), NOTHING, ());
}
-int main()
+void testall()
{
test<boost::chrono::duration<int, boost::ratio<1, 100> >,
boost::chrono::duration<long, boost::ratio<1, 1000> >,
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