|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r65481 - in sandbox/chrono/libs/ratio/test: . ratio_comparison ratio_ratio
From: vicente.botet_at_[hidden]
Date: 2010-09-20 07:57:29
Author: viboes
Date: 2010-09-20 07:57:26 EDT (Mon, 20 Sep 2010)
New Revision: 65481
URL: http://svn.boost.org/trac/boost/changeset/65481
Log:
Adapt tests coming from llvm/libc++/test/ratio
Added:
sandbox/chrono/libs/ratio/test/ratio_comparison/
sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_equal.pass.cpp (contents, props changed)
sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_greater.pass.cpp (contents, props changed)
sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_greater_equal.pass.cpp (contents, props changed)
sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_less.pass.cpp (contents, props changed)
sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_less_equal.pass.cpp (contents, props changed)
sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_not_equal.pass.cpp (contents, props changed)
sandbox/chrono/libs/ratio/test/ratio_ratio/
sandbox/chrono/libs/ratio/test/ratio_ratio/ratio.pass.cpp (contents, props changed)
sandbox/chrono/libs/ratio/test/ratio_ratio/ratio1.fail.cpp (contents, props changed)
sandbox/chrono/libs/ratio/test/ratio_ratio/ratio2.fail.cpp (contents, props changed)
sandbox/chrono/libs/ratio/test/ratio_ratio/ratio3.fail.cpp (contents, props changed)
Text files modified:
sandbox/chrono/libs/ratio/test/Jamfile.v2 | 36 ++++++++++++++++++------------------
sandbox/chrono/libs/ratio/test/ratio_ope_test.cpp | 2 +-
2 files changed, 19 insertions(+), 19 deletions(-)
Modified: sandbox/chrono/libs/ratio/test/Jamfile.v2
==============================================================================
--- sandbox/chrono/libs/ratio/test/Jamfile.v2 (original)
+++ sandbox/chrono/libs/ratio/test/Jamfile.v2 2010-09-20 07:57:26 EDT (Mon, 20 Sep 2010)
@@ -37,34 +37,34 @@
test-suite "ratio.ratio"
:
[ compile typedefs.pass.cpp ]
- [ compile ratio.ratio/ratio.pass.cpp ]
- [ compile-fail ratio.ratio/ratio1.fail.cpp ]
- [ compile-fail ratio.ratio/ratio2.fail.cpp ]
- [ compile-fail ratio.ratio/ratio3.fail.cpp ]
+ [ compile ratio_ratio/ratio.pass.cpp ]
+ [ compile-fail ratio_ratio/ratio1.fail.cpp ]
+ [ compile-fail ratio_ratio/ratio2.fail.cpp ]
+ [ compile-fail ratio_ratio/ratio3.fail.cpp ]
;
test-suite "ratio.arithmetic"
:
#[ run ratio_ope_test.cpp ]
[ compile-fail ratio_fail_test1.cpp ]
- [ compile ratio.arithmetic/ratio_add.pass.cpp ]
- [ compile ratio.arithmetic/ratio_subtract.pass.cpp ]
- [ compile ratio.arithmetic/ratio_multiply.pass.cpp ]
- [ compile ratio.arithmetic/ratio_divide.pass.cpp ]
- [ compile-fail ratio.arithmetic/ratio_add.fail.cpp ]
- [ compile-fail ratio.arithmetic/ratio_subtract.fail.cpp ]
- [ compile-fail ratio.arithmetic/ratio_multiply.fail.cpp ]
- [ compile-fail ratio.arithmetic/ratio_divide.fail.cpp ]
+ [ compile ratio_arithmetic/ratio_add.pass.cpp ]
+ [ compile ratio_arithmetic/ratio_subtract.pass.cpp ]
+ [ compile ratio_arithmetic/ratio_multiply.pass.cpp ]
+ [ compile ratio_arithmetic/ratio_divide.pass.cpp ]
+ [ compile-fail ratio_arithmetic/ratio_add.fail.cpp ]
+ [ compile-fail ratio_arithmetic/ratio_subtract.fail.cpp ]
+ [ compile-fail ratio_arithmetic/ratio_multiply.fail.cpp ]
+ [ compile-fail ratio_arithmetic/ratio_divide.fail.cpp ]
;
test-suite "ratio.comparison"
:
- [ compile ratio.comparison/ratio_equal.pass.cpp ]
- [ compile ratio.comparison/ratio_not_equal.pass.cpp ]
- [ compile ratio.comparison/ratio_less.pass.cpp ]
- [ compile ratio.comparison/ratio_less_equal.pass.cpp ]
- [ compile ratio.comparison/ratio_greater.pass.cpp ]
- [ compile ratio.comparison/ratio_greater_equal.pass.cpp ]
+ [ compile ratio_comparison/ratio_equal.pass.cpp ]
+ [ compile ratio_comparison/ratio_not_equal.pass.cpp ]
+ [ compile ratio_comparison/ratio_less.pass.cpp ]
+ [ compile ratio_comparison/ratio_less_equal.pass.cpp ]
+ [ compile ratio_comparison/ratio_greater.pass.cpp ]
+ [ compile ratio_comparison/ratio_greater_equal.pass.cpp ]
;
test-suite "examples"
Added: sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_equal.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_equal.pass.cpp 2010-09-20 07:57:26 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,64 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Taken from llvm/libcxx/test/utilities/ratio
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// test ratio_equal
+
+#include <boost/ratio.hpp>
+#if !defined(BOOST_NO_STATIC_ASSERT)
+#define NOTHING ""
+#endif
+
+int main()
+{
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
+ typedef boost::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, -1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
+ typedef boost::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_equal<R1, R2>::value), NOTHING, ());
+ }
+}
Added: sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_greater.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_greater.pass.cpp 2010-09-20 07:57:26 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,64 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Taken from llvm/libcxx/test/utilities/ratio
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// test ratio_greater
+
+#include <boost/ratio.hpp>
+#if !defined(BOOST_NO_STATIC_ASSERT)
+#define NOTHING ""
+#endif
+
+int main()
+{
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_greater<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_greater<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_greater<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
+ typedef boost::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_greater<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, -1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_greater<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_greater<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_greater<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
+ typedef boost::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_greater<R1, R2>::value), NOTHING, ());
+ }
+}
Added: sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_greater_equal.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_greater_equal.pass.cpp 2010-09-20 07:57:26 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,64 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Taken from llvm/libcxx/test/utilities/ratio
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// test ratio_greater_equal
+
+#include <boost/ratio.hpp>
+#if !defined(BOOST_NO_STATIC_ASSERT)
+#define NOTHING ""
+#endif
+
+int main()
+{
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_greater_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_greater_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_greater_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
+ typedef boost::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_greater_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, -1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_greater_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_greater_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_greater_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
+ typedef boost::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_greater_equal<R1, R2>::value), NOTHING, ());
+ }
+}
Added: sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_less.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_less.pass.cpp 2010-09-20 07:57:26 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,94 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Taken from llvm/libcxx/test/utilities/ratio
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// test ratio_less
+
+#include <boost/ratio.hpp>
+#if !defined(BOOST_NO_STATIC_ASSERT)
+#define NOTHING ""
+#endif
+
+int main()
+{
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
+ typedef boost::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, -1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
+ typedef boost::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFELL> R1;
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFDLL, 0x7FFFFFFFFFFFFFFCLL> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFDLL, 0x7FFFFFFFFFFFFFFCLL> R1;
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFELL> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFDLL, 0x7FFFFFFFFFFFFFFCLL> R1;
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFELL> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 0x7FFFFFFFFFFFFFFELL> R1;
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFELL, 0x7FFFFFFFFFFFFFFDLL> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<641981, 1339063> R1;
+ typedef boost::ratio<1291640, 2694141LL> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_less<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1291640, 2694141LL> R1;
+ typedef boost::ratio<641981, 1339063> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_less<R1, R2>::value), NOTHING, ());
+ }
+}
Added: sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_less_equal.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_less_equal.pass.cpp 2010-09-20 07:57:26 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,64 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Taken from llvm/libcxx/test/utilities/ratio
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// test ratio_less_equal
+
+#include <boost/ratio.hpp>
+#if !defined(BOOST_NO_STATIC_ASSERT)
+#define NOTHING ""
+#endif
+
+int main()
+{
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_less_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_less_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_less_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
+ typedef boost::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_less_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, -1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_less_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_less_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_less_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
+ typedef boost::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_less_equal<R1, R2>::value), NOTHING, ());
+ }
+}
Added: sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_not_equal.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio_comparison/ratio_not_equal.pass.cpp 2010-09-20 07:57:26 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,64 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Taken from llvm/libcxx/test/utilities/ratio
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// test ratio_not_equal
+
+#include <boost/ratio.hpp>
+#if !defined(BOOST_NO_STATIC_ASSERT)
+#define NOTHING ""
+#endif
+
+int main()
+{
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_not_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_not_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_not_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
+ typedef boost::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2;
+ BOOST_RATIO_STATIC_ASSERT((!boost::ratio_not_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, -1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_not_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_not_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1;
+ typedef boost::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_not_equal<R1, R2>::value), NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1;
+ typedef boost::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2;
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio_not_equal<R1, R2>::value), NOTHING, ());
+ }
+}
Modified: sandbox/chrono/libs/ratio/test/ratio_ope_test.cpp
==============================================================================
--- sandbox/chrono/libs/ratio/test/ratio_ope_test.cpp (original)
+++ sandbox/chrono/libs/ratio/test/ratio_ope_test.cpp 2010-09-20 07:57:26 EDT (Mon, 20 Sep 2010)
@@ -20,7 +20,7 @@
#include <boost/ratio.hpp>
#include <iostream>
-#if !defined(BOOST_NO_STATIC_ASSERT) || !defined(BOOST_RATIO_USES_MPL_ASSERT)
+#if !defined(BOOST_NO_STATIC_ASSERT)
#define NOTHING ""
#endif
Added: sandbox/chrono/libs/ratio/test/ratio_ratio/ratio.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio_ratio/ratio.pass.cpp 2010-09-20 07:57:26 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,53 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Taken from llvm/libcxx/test/utilities/ratio
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// test ratio: The static data members num and den shall have thcommon
+// divisor of the absolute values of N and D:
+
+#include <boost/ratio.hpp>
+
+#if !defined(BOOST_NO_STATIC_ASSERT)
+#define NOTHING ""
+#endif
+
+template <long long N, long long D, long long eN, long long eD>
+void test()
+{
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio<N, D>::num == eN), NOTHING, ());
+ BOOST_RATIO_STATIC_ASSERT((boost::ratio<N, D>::den == eD), NOTHING, ());
+}
+
+int main()
+{
+ test<1, 1, 1, 1>();
+ test<1, 10, 1, 10>();
+ test<10, 10, 1, 1>();
+ test<10, 1, 10, 1>();
+ test<12, 4, 3, 1>();
+ test<12, -4, -3, 1>();
+ test<-12, 4, -3, 1>();
+ test<-12, -4, 3, 1>();
+ test<4, 12, 1, 3>();
+ test<4, -12, -1, 3>();
+ test<-4, 12, -1, 3>();
+ test<-4, -12, 1, 3>();
+ test<222, 333, 2, 3>();
+ test<222, -333, -2, 3>();
+ test<-222, 333, -2, 3>();
+ test<-222, -333, 2, 3>();
+ test<0x7FFFFFFFFFFFFFFFLL, 127, 72624976668147841LL, 1>();
+ test<-0x7FFFFFFFFFFFFFFFLL, 127, -72624976668147841LL, 1>();
+ test<0x7FFFFFFFFFFFFFFFLL, -127, -72624976668147841LL, 1>();
+ test<-0x7FFFFFFFFFFFFFFFLL, -127, 72624976668147841LL, 1>();
+}
Added: sandbox/chrono/libs/ratio/test/ratio_ratio/ratio1.fail.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio_ratio/ratio1.fail.cpp 2010-09-20 07:57:26 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,24 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Taken from llvm/libcxx/test/utilities/ratio
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// test ratio: The template argument D shall not be zero
+
+#include <boost/ratio.hpp>
+#include <boost/cstdint.hpp>
+
+int main()
+{
+ const boost::intmax_t t1 = boost::ratio<1, 0>::num;
+ (void)t1;
+}
Added: sandbox/chrono/libs/ratio/test/ratio_ratio/ratio2.fail.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio_ratio/ratio2.fail.cpp 2010-09-20 07:57:26 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,25 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Taken from llvm/libcxx/test/utilities/ratio
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// test ratio: the absolute values of the template arguments N and D
+// shall be representable by type intmax_t.
+
+#include <boost/ratio.hpp>
+#include <cstdint>
+
+int main()
+{
+ const boost::intmax_t t1 = boost::ratio<0x8000000000000000ULL, 1>::num;
+ (void)t1;
+}
Added: sandbox/chrono/libs/ratio/test/ratio_ratio/ratio3.fail.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio_ratio/ratio3.fail.cpp 2010-09-20 07:57:26 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,25 @@
+// Copyright 2010 Vicente J. Botet Escriba
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Taken from llvm/libcxx/test/utilities/ratio
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// test ratio: the absolute values of the template arguments N and D
+// shall be representable by type intmax_t.
+
+#include <boost/ratio.hpp>
+#include <boost/cstdint.hpp>
+
+int main()
+{
+ const boost::intmax_t t1 = boost::ratio<1, 0x8000000000000000ULL>::num;
+ (void)t1;
+}
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