Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66337 - in sandbox/chrono/libs/chrono/test: time_point/cons time_point/nonmember time_point/special traits/duration_values traits/is_fp traits/specializations
From: vicente.botet_at_[hidden]
Date: 2010-11-01 17:48:21


Author: viboes
Date: 2010-11-01 17:48:20 EDT (Mon, 01 Nov 2010)
New Revision: 66337
URL: http://svn.boost.org/trac/boost/changeset/66337

Log:
Chrono: Refactor tests

Removed:
   sandbox/chrono/libs/chrono/test/time_point/cons/convert.fail.cpp
   sandbox/chrono/libs/chrono/test/time_point/cons/convert.pass.cpp
   sandbox/chrono/libs/chrono/test/time_point/cons/default.pass.cpp
   sandbox/chrono/libs/chrono/test/time_point/cons/duration.fail.cpp
   sandbox/chrono/libs/chrono/test/time_point/cons/duration.pass.cpp
   sandbox/chrono/libs/chrono/test/time_point/nonmember/op_minus_duration.pass.cpp
   sandbox/chrono/libs/chrono/test/time_point/nonmember/op_minus_time_point.pass.cpp
   sandbox/chrono/libs/chrono/test/time_point/nonmember/op_plus.pass.cpp
   sandbox/chrono/libs/chrono/test/time_point/special/max.pass.cpp
   sandbox/chrono/libs/chrono/test/time_point/special/min.pass.cpp
   sandbox/chrono/libs/chrono/test/traits/duration_values/max.pass.cpp
   sandbox/chrono/libs/chrono/test/traits/duration_values/min.pass.cpp
   sandbox/chrono/libs/chrono/test/traits/duration_values/zero.pass.cpp
   sandbox/chrono/libs/chrono/test/traits/is_fp/treat_as_floating_point.pass.cpp
   sandbox/chrono/libs/chrono/test/traits/specializations/duration.pass.cpp
   sandbox/chrono/libs/chrono/test/traits/specializations/time_point.pass.cpp

Deleted: sandbox/chrono/libs/chrono/test/time_point/cons/convert.fail.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/cons/convert.fail.cpp 2010-11-01 17:48:20 EDT (Mon, 01 Nov 2010)
+++ (empty file)
@@ -1,18 +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
-
-// Duration2 shall be implicitly convertible to duration.
-
-#include <boost/chrono.hpp>
-
-void test()
-{
- typedef boost::chrono::system_clock Clock;
- typedef boost::chrono::milliseconds Duration1;
- typedef boost::chrono::microseconds Duration2;
- {
- boost::chrono::time_point<Clock, Duration2> t2(Duration2(3));
- boost::chrono::time_point<Clock, Duration1> t1 = t2;
- }
-}

Deleted: sandbox/chrono/libs/chrono/test/time_point/cons/convert.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/cons/convert.pass.cpp 2010-11-01 17:48:20 EDT (Mon, 01 Nov 2010)
+++ (empty file)
@@ -1,20 +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
-
-#include <boost/chrono.hpp>
-#include <boost/detail/lightweight_test.hpp>
-
-int main()
-{
- typedef boost::chrono::system_clock Clock;
- typedef boost::chrono::microseconds Duration1;
- typedef boost::chrono::milliseconds Duration2;
- {
- boost::chrono::time_point<Clock, Duration2> t2(Duration2(3));
- boost::chrono::time_point<Clock, Duration1> t1 = t2;
- BOOST_TEST(t1.time_since_epoch() == Duration1(3000));
- }
-
- return boost::report_errors();
-}

Deleted: sandbox/chrono/libs/chrono/test/time_point/cons/default.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/cons/default.pass.cpp 2010-11-01 17:48:20 EDT (Mon, 01 Nov 2010)
+++ (empty file)
@@ -1,18 +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
-
-#include <boost/chrono.hpp>
-#include <boost/detail/lightweight_test.hpp>
-
-#include "../../rep.h"
-
-int main()
-{
- typedef boost::chrono::system_clock Clock;
- typedef boost::chrono::duration<Rep, boost::milli> Duration;
- boost::chrono::time_point<Clock, Duration> t;
- BOOST_TEST(t.time_since_epoch() == Duration::zero());
-
- return boost::report_errors();
-}

Deleted: sandbox/chrono/libs/chrono/test/time_point/cons/duration.fail.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/cons/duration.fail.cpp 2010-11-01 17:48:20 EDT (Mon, 01 Nov 2010)
+++ (empty file)
@@ -1,14 +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
-
-// test for explicit
-
-#include <boost/chrono.hpp>
-
-void test()
-{
- typedef boost::chrono::system_clock Clock;
- typedef boost::chrono::milliseconds Duration;
- boost::chrono::time_point<Clock, Duration> t = Duration(3);
-}

Deleted: sandbox/chrono/libs/chrono/test/time_point/cons/duration.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/cons/duration.pass.cpp 2010-11-01 17:48:20 EDT (Mon, 01 Nov 2010)
+++ (empty file)
@@ -1,22 +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
-
-#include <boost/chrono.hpp>
-#include <boost/detail/lightweight_test.hpp>
-
-int main()
-{
- typedef boost::chrono::system_clock Clock;
- typedef boost::chrono::milliseconds Duration;
- {
- boost::chrono::time_point<Clock, Duration> t(Duration(3));
- BOOST_TEST(t.time_since_epoch() == Duration(3));
- }
- {
- boost::chrono::time_point<Clock, Duration> t(boost::chrono::seconds(3));
- BOOST_TEST(t.time_since_epoch() == Duration(3000));
- }
-
- return boost::report_errors();
-}

Deleted: 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 2010-11-01 17:48:20 EDT (Mon, 01 Nov 2010)
+++ (empty file)
@@ -1,18 +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
-
-#include <boost/chrono.hpp>
-#include <boost/detail/lightweight_test.hpp>
-
-int main()
-{
- typedef boost::chrono::system_clock Clock;
- typedef boost::chrono::milliseconds Duration1;
- typedef boost::chrono::microseconds Duration2;
- boost::chrono::time_point<Clock, Duration1> t1(Duration1(3));
- boost::chrono::time_point<Clock, Duration2> t2 = t1 - Duration2(5);
- BOOST_TEST(t2.time_since_epoch() == Duration2(2995));
-
- return boost::report_errors();
-}

Deleted: 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 2010-11-01 17:48:20 EDT (Mon, 01 Nov 2010)
+++ (empty file)
@@ -1,18 +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
-
-#include <boost/chrono.hpp>
-#include <boost/detail/lightweight_test.hpp>
-
-int main()
-{
- typedef boost::chrono::system_clock Clock;
- typedef boost::chrono::milliseconds Duration1;
- typedef boost::chrono::microseconds Duration2;
- boost::chrono::time_point<Clock, Duration1> t1(Duration1(3));
- boost::chrono::time_point<Clock, Duration2> t2(Duration2(5));
- BOOST_TEST((t1 - t2) == Duration2(2995));
-
- return boost::report_errors();
-}

Deleted: sandbox/chrono/libs/chrono/test/time_point/nonmember/op_plus.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/nonmember/op_plus.pass.cpp 2010-11-01 17:48:20 EDT (Mon, 01 Nov 2010)
+++ (empty file)
@@ -1,20 +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
-
-#include <boost/chrono.hpp>
-#include <boost/detail/lightweight_test.hpp>
-
-int main()
-{
- typedef boost::chrono::system_clock Clock;
- typedef boost::chrono::milliseconds Duration1;
- typedef boost::chrono::microseconds Duration2;
- boost::chrono::time_point<Clock, Duration1> t1(Duration1(3));
- boost::chrono::time_point<Clock, Duration2> t2 = t1 + Duration2(5);
- BOOST_TEST(t2.time_since_epoch() == Duration2(3005));
- t2 = Duration2(6) + t1;
- BOOST_TEST(t2.time_since_epoch() == Duration2(3006));
-
- return boost::report_errors();
-}

Deleted: sandbox/chrono/libs/chrono/test/time_point/special/max.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/special/max.pass.cpp 2010-11-01 17:48:20 EDT (Mon, 01 Nov 2010)
+++ (empty file)
@@ -1,16 +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
-
-#include <boost/chrono.hpp>
-#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;
- BOOST_TEST((TP::max)() == TP((Duration::max)()));
-
- return boost::report_errors();
-}

Deleted: sandbox/chrono/libs/chrono/test/time_point/special/min.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/time_point/special/min.pass.cpp 2010-11-01 17:48:20 EDT (Mon, 01 Nov 2010)
+++ (empty file)
@@ -1,16 +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
-
-#include <boost/chrono.hpp>
-#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;
- BOOST_TEST((TP::min)() == TP((Duration::min)()));
-
- return boost::report_errors();
-}

Deleted: sandbox/chrono/libs/chrono/test/traits/duration_values/max.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/traits/duration_values/max.pass.cpp 2010-11-01 17:48:20 EDT (Mon, 01 Nov 2010)
+++ (empty file)
@@ -1,22 +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
-
-#include <boost/chrono.hpp>
-#include <boost/type_traits.hpp>
-#include <limits>
-#include <boost/detail/lightweight_test.hpp>
-
-#include "../../rep.h"
-
-int main()
-{
- BOOST_TEST((boost::chrono::duration_values<int>::max)() ==
- (std::numeric_limits<int>::max)());
- BOOST_TEST((boost::chrono::duration_values<double>::max)() ==
- (std::numeric_limits<double>::max)());
- BOOST_TEST((boost::chrono::duration_values<Rep>::max)() ==
- (std::numeric_limits<Rep>::max)());
-
- return boost::report_errors();
-}

Deleted: sandbox/chrono/libs/chrono/test/traits/duration_values/min.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/traits/duration_values/min.pass.cpp 2010-11-01 17:48:20 EDT (Mon, 01 Nov 2010)
+++ (empty file)
@@ -1,23 +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
-
-#include <boost/chrono.hpp>
-#include <limits>
-#include <boost/detail/lightweight_test.hpp>
-#include <iostream>
-
-#include "../../rep.h"
-
-int main()
-{
- BOOST_TEST((boost::chrono::duration_values<int>::min)() ==
- (std::numeric_limits<int>::min)());
- BOOST_TEST((boost::chrono::duration_values<double>::min)() ==
- -(std::numeric_limits<double>::max)());
- BOOST_TEST((boost::chrono::duration_values<Rep>::min)() ==
- (std::numeric_limits<Rep>::min)());
-
-
- return boost::report_errors();
-}

Deleted: sandbox/chrono/libs/chrono/test/traits/duration_values/zero.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/traits/duration_values/zero.pass.cpp 2010-11-01 17:48:20 EDT (Mon, 01 Nov 2010)
+++ (empty file)
@@ -1,16 +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
-
-#include <boost/chrono.hpp>
-#include <boost/detail/lightweight_test.hpp>
-
-#include "../../rep.h"
-
-int main()
-{
- BOOST_TEST(boost::chrono::duration_values<int>::zero() == 0);
- BOOST_TEST(boost::chrono::duration_values<Rep>::zero() == 0);
-
- return boost::report_errors();
-}

Deleted: 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 2010-11-01 17:48:20 EDT (Mon, 01 Nov 2010)
+++ (empty file)
@@ -1,32 +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
-
-#include <boost/chrono.hpp>
-#include <boost/type_traits.hpp>
-
-#if !defined(BOOST_NO_STATIC_ASSERT)
-#define NOTHING ""
-#endif
-
-template <class T>
-void
-test()
-{
- BOOST_CHRONO_STATIC_ASSERT((boost::is_base_of<boost::is_floating_point<T>,
- boost::chrono::treat_as_floating_point<T> >::value), NOTHING, ());
-}
-
-struct A {};
-
-void testall()
-{
- test<int>();
- test<unsigned>();
- test<char>();
- test<bool>();
- test<float>();
- test<double>();
- test<long double>();
- test<A>();
-}

Deleted: sandbox/chrono/libs/chrono/test/traits/specializations/duration.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/traits/specializations/duration.pass.cpp 2010-11-01 17:48:20 EDT (Mon, 01 Nov 2010)
+++ (empty file)
@@ -1,34 +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
-
-#include <boost/chrono.hpp>
-#include <boost/type_traits/is_same.hpp>
-
-#if !defined(BOOST_NO_STATIC_ASSERT)
-#define NOTHING ""
-#endif
-
-template <class D1, class D2, class De>
-void
-test()
-{
- typedef typename boost::common_type<D1, D2>::type Dc;
- BOOST_CHRONO_STATIC_ASSERT((boost::is_same<Dc, De>::value), NOTHING, ());
-}
-
-void testall()
-{
- test<boost::chrono::duration<int, boost::ratio<1, 100> >,
- boost::chrono::duration<long, boost::ratio<1, 1000> >,
- boost::chrono::duration<long, boost::ratio<1, 1000> > >();
- test<boost::chrono::duration<long, boost::ratio<1, 100> >,
- boost::chrono::duration<int, boost::ratio<1, 1000> >,
- boost::chrono::duration<long, boost::ratio<1, 1000> > >();
- test<boost::chrono::duration<char, boost::ratio<1, 30> >,
- boost::chrono::duration<short, boost::ratio<1, 1000> >,
- boost::chrono::duration<int, boost::ratio<1, 3000> > >();
- test<boost::chrono::duration<double, boost::ratio<21, 1> >,
- boost::chrono::duration<short, boost::ratio<15, 1> >,
- boost::chrono::duration<double, boost::ratio<3, 1> > >();
-}

Deleted: sandbox/chrono/libs/chrono/test/traits/specializations/time_point.pass.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/traits/specializations/time_point.pass.cpp 2010-11-01 17:48:20 EDT (Mon, 01 Nov 2010)
+++ (empty file)
@@ -1,38 +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
-
-#include <boost/chrono.hpp>
-#include <boost/type_traits.hpp>
-
-#if !defined(BOOST_NO_STATIC_ASSERT)
-#define NOTHING ""
-#endif
-
-template <class D1, class D2, class De>
-void
-test()
-{
- typedef boost::chrono::system_clock C;
- typedef boost::chrono::time_point<C, D1> T1;
- typedef boost::chrono::time_point<C, D2> T2;
- typedef boost::chrono::time_point<C, De> Te;
- typedef typename boost::common_type<T1, T2>::type Tc;
- BOOST_CHRONO_STATIC_ASSERT((boost::is_same<Tc, Te>::value), NOTHING, ());
-}
-
-void testall()
-{
- test<boost::chrono::duration<int, boost::ratio<1, 100> >,
- boost::chrono::duration<long, boost::ratio<1, 1000> >,
- boost::chrono::duration<long, boost::ratio<1, 1000> > >();
- test<boost::chrono::duration<long, boost::ratio<1, 100> >,
- boost::chrono::duration<int, boost::ratio<1, 1000> >,
- boost::chrono::duration<long, boost::ratio<1, 1000> > >();
- test<boost::chrono::duration<char, boost::ratio<1, 30> >,
- boost::chrono::duration<short, boost::ratio<1, 1000> >,
- boost::chrono::duration<int, boost::ratio<1, 3000> > >();
- test<boost::chrono::duration<double, boost::ratio<21, 1> >,
- boost::chrono::duration<short, boost::ratio<15, 1> >,
- boost::chrono::duration<double, boost::ratio<3, 1> > >();
-}


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