|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67573 - in sandbox/chrono/libs/ratio/test: . ratio_arithmetic ratio_comparison
From: vicente.botet_at_[hidden]
Date: 2011-01-02 11:06:46
Author: viboes
Date: 2011-01-02 11:06:43 EST (Sun, 02 Jan 2011)
New Revision: 67573
URL: http://svn.boost.org/trac/boost/changeset/67573
Log:
Ratio: update test with BOOST_RATIO_INTMAX_C
Text files modified:
sandbox/chrono/libs/ratio/test/Jamfile.v2 | 1 +
sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_add_2_fail.cpp | 5 +++--
sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_add_3_fail.cpp | 4 +---
sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_add_fail.cpp | 2 +-
sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_add_pass.cpp | 15 ++++++++++++---
sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_divide_fail.cpp | 2 +-
sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_multiply_fail.cpp | 2 +-
sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_subtract_fail.cpp | 2 +-
sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_equal_pass.cpp | 2 +-
sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_greater_equal_pass.cpp | 2 +-
sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_greater_pass.cpp | 2 +-
sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_less_equal_pass.cpp | 2 +-
sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_less_pass.cpp | 2 +-
sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_not_equal_pass.cpp | 2 +-
sandbox/chrono/libs/ratio/test/ratio_test.cpp | 6 +++---
15 files changed, 30 insertions(+), 21 deletions(-)
Modified: sandbox/chrono/libs/ratio/test/Jamfile.v2
==============================================================================
--- sandbox/chrono/libs/ratio/test/Jamfile.v2 (original)
+++ sandbox/chrono/libs/ratio/test/Jamfile.v2 2011-01-02 11:06:43 EST (Sun, 02 Jan 2011)
@@ -26,6 +26,7 @@
<toolset>msvc:<asynch-exceptions>on
<define>BOOST_ENABLE_WARNINGS
<define>BOOST_RATIO_USES_MPL_ASSERT
+ <define>BOOST_MPL_NEXT_PRIOR_EXT
<warnings>all
<toolset>gcc:<cxxflags>-Wextra
<toolset>gcc:<cxxflags>-Wno-long-long
Modified: sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_add_2_fail.cpp
==============================================================================
--- sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_add_2_fail.cpp (original)
+++ sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_add_2_fail.cpp 2011-01-02 11:06:43 EST (Sun, 02 Jan 2011)
@@ -13,6 +13,7 @@
#include <boost/ratio.hpp>
+
template <typename R>
struct numerator;
@@ -22,6 +23,6 @@
};
-BOOST_RATIO_STATIC_ASSERT(
- numerator<boost::ratio_add<ratio<1,2>,ratio<1,3> >::value == 1
+BOOST_RATIO_STATIC_ASSERT((
+ numerator<boost::ratio_add<boost::ratio<1,2>,boost::ratio<1,3> > >::value == 1)
, NOTHING, ());
Modified: sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_add_3_fail.cpp
==============================================================================
--- sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_add_3_fail.cpp (original)
+++ sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_add_3_fail.cpp 2011-01-02 11:06:43 EST (Sun, 02 Jan 2011)
@@ -11,8 +11,6 @@
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
-//#define BOOST_RATIO_EXTENSIONS
-
#include <boost/ratio.hpp>
template <typename T, typename R>
@@ -31,7 +29,7 @@
boost::ratio<1,2>,
boost::ratio<1,3>
>
-// ::type
+ //~ ::type
>()
);
}
Modified: sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_add_fail.cpp
==============================================================================
--- sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_add_fail.cpp (original)
+++ sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_add_fail.cpp 2011-01-02 11:06:43 EST (Sun, 02 Jan 2011)
@@ -13,6 +13,6 @@
#include <boost/ratio.hpp>
-typedef boost::ratio<BOOST_INTMAX_C(0x7FFFFFFFFFFFFFFF), 1> R1;
+typedef boost::ratio<BOOST_RATIO_INTMAX_C(0x7FFFFFFFFFFFFFFF), 1> R1;
typedef boost::ratio<1, 1> R2;
typedef boost::ratio_add<R1, R2>::type RT;
Modified: sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_add_pass.cpp
==============================================================================
--- sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_add_pass.cpp (original)
+++ sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_add_pass.cpp 2011-01-02 11:06:43 EST (Sun, 02 Jan 2011)
@@ -64,10 +64,19 @@
typedef boost::ratio_add<R1, R2> R;
BOOST_RATIO_STATIC_ASSERT(R::num == 127970191639601LL && R::den == 5177331081415LL, NOTHING, ());
}
+ {
+ typedef boost::mpl::integral_c<boost::intmax_t, 0x7FFFFFFFFFFFFFFF> T;
+ BOOST_RATIO_STATIC_ASSERT(T::value == 0x7FFFFFFFFFFFFFFF, NOTHING, ());
+
+ typedef boost::ratio<BOOST_RATIO_INTMAX_C(0x7FFFFFFFFFFFFFFF), 1> R1;
+ typedef boost::ratio<-1, 1> R2;
+ typedef boost::ratio_add<R1, R2>::type RT;
+ }
+
}
boost::intmax_t func(boost::ratio<5,6> s) {
- return s.num;
+ return s.num;
}
@@ -75,9 +84,9 @@
return func(
boost::ratio_add<
boost::ratio<1,2>,
- boost::ratio<1,3>
+ boost::ratio<1,3>
>
- ()
+ ()
);
}
Modified: sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_divide_fail.cpp
==============================================================================
--- sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_divide_fail.cpp (original)
+++ sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_divide_fail.cpp 2011-01-02 11:06:43 EST (Sun, 02 Jan 2011)
@@ -15,6 +15,6 @@
#include <boost/ratio.hpp>
-typedef boost::ratio<BOOST_INTMAX_C(0x7FFFFFFFFFFFFFFF), 1> R1;
+typedef boost::ratio<BOOST_RATIO_INTMAX_C(0x7FFFFFFFFFFFFFFF), 1> R1;
typedef boost::ratio<1,2> R2;
typedef boost::ratio_divide<R1, R2>::type RT;
Modified: sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_multiply_fail.cpp
==============================================================================
--- sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_multiply_fail.cpp (original)
+++ sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_multiply_fail.cpp 2011-01-02 11:06:43 EST (Sun, 02 Jan 2011)
@@ -15,6 +15,6 @@
#include <boost/ratio.hpp>
-typedef boost::ratio<BOOST_INTMAX_C(0x7FFFFFFFFFFFFFFF), 1> R1;
+typedef boost::ratio<BOOST_RATIO_INTMAX_C(0x7FFFFFFFFFFFFFFF), 1> R1;
typedef boost::ratio<2,1> R2;
typedef boost::ratio_multiply<R1, R2>::type RT;
Modified: sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_subtract_fail.cpp
==============================================================================
--- sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_subtract_fail.cpp (original)
+++ sandbox/chrono/libs/ratio/test/ratio_arithmetic/ratio_subtract_fail.cpp 2011-01-02 11:06:43 EST (Sun, 02 Jan 2011)
@@ -15,6 +15,6 @@
#include <boost/ratio.hpp>
-typedef boost::ratio<BOOST_INTMAX_C(-0x7FFFFFFFFFFFFFFF), 1> R1;
+typedef boost::ratio<BOOST_RATIO_INTMAX_C(-0x7FFFFFFFFFFFFFFF), 1> R1;
typedef boost::ratio<1,1> R2;
typedef boost::ratio_subtract<R1, R2>::type RT;
Modified: sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_equal_pass.cpp
==============================================================================
--- sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_equal_pass.cpp (original)
+++ sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_equal_pass.cpp 2011-01-02 11:06:43 EST (Sun, 02 Jan 2011)
@@ -18,7 +18,7 @@
#define NOTHING ""
#endif
-#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFFLL-1)
+#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFFLL)
void test()
{
Modified: sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_greater_equal_pass.cpp
==============================================================================
--- sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_greater_equal_pass.cpp (original)
+++ sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_greater_equal_pass.cpp 2011-01-02 11:06:43 EST (Sun, 02 Jan 2011)
@@ -16,7 +16,7 @@
#define NOTHING ""
#endif
-#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFFLL-1)
+#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFFLL)
void test()
{
Modified: sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_greater_pass.cpp
==============================================================================
--- sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_greater_pass.cpp (original)
+++ sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_greater_pass.cpp 2011-01-02 11:06:43 EST (Sun, 02 Jan 2011)
@@ -15,7 +15,7 @@
#if !defined(BOOST_NO_STATIC_ASSERT)
#define NOTHING ""
#endif
-#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFFLL-1)
+#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFFLL)
void test()
{
Modified: sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_less_equal_pass.cpp
==============================================================================
--- sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_less_equal_pass.cpp (original)
+++ sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_less_equal_pass.cpp 2011-01-02 11:06:43 EST (Sun, 02 Jan 2011)
@@ -15,7 +15,7 @@
#if !defined(BOOST_NO_STATIC_ASSERT)
#define NOTHING ""
#endif
-#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFFLL-1)
+#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFFLL)
void test()
{
Modified: sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_less_pass.cpp
==============================================================================
--- sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_less_pass.cpp (original)
+++ sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_less_pass.cpp 2011-01-02 11:06:43 EST (Sun, 02 Jan 2011)
@@ -16,7 +16,7 @@
#define NOTHING ""
#endif
-#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFFLL-1)
+#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFFLL)
void test()
{
{
Modified: sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_not_equal_pass.cpp
==============================================================================
--- sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_not_equal_pass.cpp (original)
+++ sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_not_equal_pass.cpp 2011-01-02 11:06:43 EST (Sun, 02 Jan 2011)
@@ -15,7 +15,7 @@
#if !defined(BOOST_NO_STATIC_ASSERT)
#define NOTHING ""
#endif
-#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFFLL-1)
+#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFFLL)
void test()
{
Modified: sandbox/chrono/libs/ratio/test/ratio_test.cpp
==============================================================================
--- sandbox/chrono/libs/ratio/test/ratio_test.cpp (original)
+++ sandbox/chrono/libs/ratio/test/ratio_test.cpp 2011-01-02 11:06:43 EST (Sun, 02 Jan 2011)
@@ -19,7 +19,7 @@
// Test the case described in library working group issue 948.
-typedef boost::ratio<BOOST_INTMAX_C(0x7FFFFFFFFFFFFFFF), BOOST_INTMAX_C(0x7FFFFFFFFFFFFFF0)> R1;
+typedef boost::ratio<BOOST_RATIO_INTMAX_C(0x7FFFFFFFFFFFFFFF), BOOST_RATIO_INTMAX_C(0x7FFFFFFFFFFFFFF0)> R1;
typedef boost::ratio<8, 7> R2;
typedef boost::ratio_multiply<R1, R2>::type RT;
@@ -27,8 +27,8 @@
int main()
{
- typedef boost::ratio<8, BOOST_INTMAX_C(0x7FFFFFFFD)> R1;
- typedef boost::ratio<3, BOOST_INTMAX_C(0x7FFFFFFFD)> R2;
+ typedef boost::ratio<8, BOOST_RATIO_INTMAX_C(0x7FFFFFFFD)> R1;
+ typedef boost::ratio<3, BOOST_RATIO_INTMAX_C(0x7FFFFFFFD)> R2;
typedef boost::ratio_subtract<R1, R2>::type RS;
std::cout << RS::num << '/' << RS::den << '\n';
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