|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67594 - in trunk/libs/ratio/test: . ratio_extensions
From: vicente.botet_at_[hidden]
Date: 2011-01-02 15:47:32
Author: viboes
Date: 2011-01-02 15:47:30 EST (Sun, 02 Jan 2011)
New Revision: 67594
URL: http://svn.boost.org/trac/boost/changeset/67594
Log:
Boost.Ratio: Added test for mpl comparison operations + test plus with 3 parameters
Added:
trunk/libs/ratio/test/ratio_extensions/mpl_equal_to_pass.cpp (contents, props changed)
trunk/libs/ratio/test/ratio_extensions/mpl_greater_equal_pass.cpp (contents, props changed)
trunk/libs/ratio/test/ratio_extensions/mpl_greater_pass.cpp (contents, props changed)
trunk/libs/ratio/test/ratio_extensions/mpl_less_equal_pass.cpp (contents, props changed)
trunk/libs/ratio/test/ratio_extensions/mpl_less_pass.cpp (contents, props changed)
trunk/libs/ratio/test/ratio_extensions/mpl_not_equal_to_pass.cpp (contents, props changed)
Text files modified:
trunk/libs/ratio/test/Jamfile.v2 | 7 +++++++
trunk/libs/ratio/test/ratio_extensions/mpl_plus_pass.cpp | 18 ++++++++++++------
2 files changed, 19 insertions(+), 6 deletions(-)
Modified: trunk/libs/ratio/test/Jamfile.v2
==============================================================================
--- trunk/libs/ratio/test/Jamfile.v2 (original)
+++ trunk/libs/ratio/test/Jamfile.v2 2011-01-02 15:47:30 EST (Sun, 02 Jan 2011)
@@ -88,4 +88,11 @@
[ compile ratio_extensions/mpl_minus_pass.cpp ]
[ compile ratio_extensions/mpl_times_pass.cpp ]
[ compile ratio_extensions/mpl_divides_pass.cpp ]
+ [ compile ratio_extensions/mpl_equal_to_pass.cpp ]
+ [ compile ratio_extensions/mpl_not_equal_to_pass.cpp ]
+ [ compile ratio_extensions/mpl_less_pass.cpp ]
+ [ compile ratio_extensions/mpl_less_equal_pass.cpp ]
+ [ compile ratio_extensions/mpl_greater_pass.cpp ]
+ [ compile ratio_extensions/mpl_greater_equal_pass.cpp ]
+
;
Added: trunk/libs/ratio/test/ratio_extensions/mpl_equal_to_pass.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/ratio/test/ratio_extensions/mpl_equal_to_pass.cpp 2011-01-02 15:47:30 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,67 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// Adaptation to Boost of the libcxx
+// 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 mpl::equal_to
+
+#define BOOST_RATIO_EXTENSIONS
+
+#include <boost/ratio/mpl/equal_to.hpp>
+#if !defined(BOOST_NO_STATIC_ASSERT)
+#define NOTHING ""
+#endif
+
+#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFFLL)
+
+void test()
+{
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::equal_to<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::equal_to<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::equal_to<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R1;
+ typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::equal_to<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, -1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::equal_to<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::equal_to<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::equal_to<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R1;
+ typedef boost::ratio<1, -BOOST_RATIO_INTMAX_T_MAX> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::equal_to<R1, R2>::value), NOTHING, ());
+ }
+}
Added: trunk/libs/ratio/test/ratio_extensions/mpl_greater_equal_pass.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/ratio/test/ratio_extensions/mpl_greater_equal_pass.cpp 2011-01-02 15:47:30 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// Adaptation to Boost of the libcxx
+// Copyright 2010 Vicente J. Botet Escriba
+// 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/mpl/greater_equal.hpp>
+#if !defined(BOOST_NO_STATIC_ASSERT)
+#define NOTHING ""
+#endif
+
+#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFFLL)
+
+void test()
+{
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::greater_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::greater_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1,BOOST_RATIO_INTMAX_T_MAX> R1;
+ typedef boost::ratio<1,BOOST_RATIO_INTMAX_T_MAX> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::greater_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::greater_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R1;
+ typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::greater_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, -1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::greater_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::greater_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::greater_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R1;
+ typedef boost::ratio<1, -BOOST_RATIO_INTMAX_T_MAX> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::greater_equal<R1, R2>::value), NOTHING, ());
+ }
+}
Added: trunk/libs/ratio/test/ratio_extensions/mpl_greater_pass.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/ratio/test/ratio_extensions/mpl_greater_pass.cpp 2011-01-02 15:47:30 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,64 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// Adaptation to Boost of the libcxx
+// Copyright 2010 Vicente J. Botet Escriba
+// 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/mpl/greater.hpp>
+#if !defined(BOOST_NO_STATIC_ASSERT)
+#define NOTHING ""
+#endif
+#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFFLL)
+
+void test()
+{
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::greater<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::greater<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::greater<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R1;
+ typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::greater<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, -1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::greater<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::greater<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::greater<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R1;
+ typedef boost::ratio<1, -BOOST_RATIO_INTMAX_T_MAX> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::greater<R1, R2>::value), NOTHING, ());
+ }
+}
Added: trunk/libs/ratio/test/ratio_extensions/mpl_less_equal_pass.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/ratio/test/ratio_extensions/mpl_less_equal_pass.cpp 2011-01-02 15:47:30 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,64 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// Adaptation to Boost of the libcxx
+// Copyright 2010 Vicente J. Botet Escriba
+// 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/mpl/less_equal.hpp>
+#if !defined(BOOST_NO_STATIC_ASSERT)
+#define NOTHING ""
+#endif
+#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFFLL)
+
+void test()
+{
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::less_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::less_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::less_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R1;
+ typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::less_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, -1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::less_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::less_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::less_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R1;
+ typedef boost::ratio<1, -BOOST_RATIO_INTMAX_T_MAX> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::less_equal<R1, R2>::value), NOTHING, ());
+ }
+}
Added: trunk/libs/ratio/test/ratio_extensions/mpl_less_pass.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/ratio/test/ratio_extensions/mpl_less_pass.cpp 2011-01-02 15:47:30 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,94 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// Adaptation to Boost of the libcxx
+// Copyright 2010 Vicente J. Botet Escriba
+// 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/mpl/less.hpp>
+#if !defined(BOOST_NO_STATIC_ASSERT)
+#define NOTHING ""
+#endif
+
+#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFFLL)
+void test()
+{
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R1;
+ typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, -1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R1;
+ typedef boost::ratio<1, -BOOST_RATIO_INTMAX_T_MAX> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 0x7FFFFFFFFFFFFFFELL> R1;
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFDLL, 0x7FFFFFFFFFFFFFFCLL> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFDLL, 0x7FFFFFFFFFFFFFFCLL> R1;
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 0x7FFFFFFFFFFFFFFELL> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFDLL, 0x7FFFFFFFFFFFFFFCLL> R1;
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 0x7FFFFFFFFFFFFFFELL> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 0x7FFFFFFFFFFFFFFELL> R1;
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFELL, 0x7FFFFFFFFFFFFFFDLL> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<641981, 1339063> R1;
+ typedef boost::ratio<1291640, 2694141LL> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1291640, 2694141LL> R1;
+ typedef boost::ratio<641981, 1339063> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::less<R1, R2>::value), NOTHING, ());
+ }
+}
Added: trunk/libs/ratio/test/ratio_extensions/mpl_not_equal_to_pass.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/ratio/test/ratio_extensions/mpl_not_equal_to_pass.cpp 2011-01-02 15:47:30 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,64 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// Adaptation to Boost of the libcxx
+// Copyright 2010 Vicente J. Botet Escriba
+// 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/mpl/not_equal_to.hpp>
+#if !defined(BOOST_NO_STATIC_ASSERT)
+#define NOTHING ""
+#endif
+#define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFFLL)
+
+void test()
+{
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::not_equal_to<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::not_equal_to<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::not_equal_to<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R1;
+ typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::mpl::not_equal_to<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, -1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::not_equal_to<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::not_equal_to<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R1;
+ typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::not_equal_to<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R1;
+ typedef boost::ratio<1, -BOOST_RATIO_INTMAX_T_MAX> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::mpl::not_equal_to<R1, R2>::value), NOTHING, ());
+ }
+}
Modified: trunk/libs/ratio/test/ratio_extensions/mpl_plus_pass.cpp
==============================================================================
--- trunk/libs/ratio/test/ratio_extensions/mpl_plus_pass.cpp (original)
+++ trunk/libs/ratio/test/ratio_extensions/mpl_plus_pass.cpp 2011-01-02 15:47:30 EST (Sun, 02 Jan 2011)
@@ -39,37 +39,43 @@
{
typedef boost::ratio<-1, 2> R1;
typedef boost::ratio<1, 1> R2;
- typedef boost::mpl::plus<R1, R2> R;
+ typedef boost::mpl::int_<0> R3;
+ typedef boost::mpl::plus<R1, R2, R3> R;
BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ());
}
{
typedef boost::ratio<1, -2> R1;
typedef boost::ratio<1, 1> R2;
- typedef boost::mpl::plus<R1, R2> R;
+ typedef boost::mpl::int_<0> R3;
+ typedef boost::mpl::plus<R1, R2, R3> R;
BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ());
}
{
typedef boost::ratio<1, 2> R1;
typedef boost::ratio<-1, 1> R2;
- typedef boost::mpl::plus<R1, R2> R;
+ typedef boost::mpl::int_<0> R3;
+ typedef boost::mpl::plus<R1, R2, R3> R;
BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ());
}
{
typedef boost::ratio<1, 2> R1;
typedef boost::ratio<1, -1> R2;
- typedef boost::mpl::plus<R1, R2> R;
+ typedef boost::mpl::int_<0> R3;
+ typedef boost::mpl::plus<R1, R2, R3> R;
BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ());
}
{
typedef boost::ratio<56987354, 467584654> R1;
typedef boost::ratio<544668, 22145> R2;
- typedef boost::mpl::plus<R1, R2> R;
+ typedef boost::mpl::int_<0> R3;
+ typedef boost::mpl::plus<R1, R2, R3> R;
BOOST_RATIO_STATIC_ASSERT(R::num == 127970191639601LL && R::den == 5177331081415LL, NOTHING, ());
}
{
typedef boost::ratio<BOOST_RATIO_INTMAX_C(0x7FFFFFFFFFFFFFFF), 1> R1;
typedef boost::ratio<-1, 1> R2;
- typedef boost::mpl::plus<R1, R2>::type RT;
+ typedef boost::mpl::int_<0> R3;
+ typedef boost::mpl::plus<R1, R2, R3>::type RT;
}
}
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