Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65476 - sandbox/chrono/libs/ratio/test
From: vicente.botet_at_[hidden]
Date: 2010-09-20 00:51:41


Author: viboes
Date: 2010-09-20 00:51:40 EDT (Mon, 20 Sep 2010)
New Revision: 65476
URL: http://svn.boost.org/trac/boost/changeset/65476

Log:
Add tests from llvm/libc++/test/ratio
Added:
   sandbox/chrono/libs/ratio/test/ratio_add_fail.cpp (contents, props changed)
   sandbox/chrono/libs/ratio/test/ratio_divide_fail.cpp (contents, props changed)
   sandbox/chrono/libs/ratio/test/ratio_fail_test2.cpp (contents, props changed)
   sandbox/chrono/libs/ratio/test/ratio_fail_test3.cpp (contents, props changed)
   sandbox/chrono/libs/ratio/test/ratio_fail_test4.cpp (contents, props changed)
   sandbox/chrono/libs/ratio/test/ratio_multiply_fail.cpp (contents, props changed)
   sandbox/chrono/libs/ratio/test/ratio_ope_test.cpp (contents, props changed)
   sandbox/chrono/libs/ratio/test/ratio_substract_fail.cpp (contents, props changed)
Text files modified:
   sandbox/chrono/libs/ratio/test/Jamfile.v2 | 18 ++++++-
   sandbox/chrono/libs/ratio/test/ratio_test.cpp | 92 +++++++++++++++++++++++++++++++++------
   2 files changed, 93 insertions(+), 17 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 00:51:40 EDT (Mon, 20 Sep 2010)
@@ -25,6 +25,7 @@
         #<include>../../..
         <toolset>msvc:<asynch-exceptions>on
         <define>BOOST_ENABLE_WARNINGS
+ <define>BOOST_RATIO_USES_MPL_ASSERT
         <warnings>all
         <toolset>gcc:<cxxflags>-Wextra
         <toolset>gcc:<cxxflags>-Wno-long-long
@@ -33,11 +34,22 @@
         <toolset>msvc:<cxxflags>/wd4127
     ;
 
- test-suite "ratio"
+ test-suite "ratio.ratio"
         :
+ [ compile-fail ratio_fail_test2.cpp ]
+ [ compile-fail ratio_fail_test3.cpp ]
+ [ compile-fail ratio_fail_test4.cpp ]
+ [ run ratio_test.cpp ]
+ ;
+
+ test-suite "ratio.ope"
+ :
+ [ run ratio_ope_test.cpp ]
         [ compile-fail ratio_fail_test1.cpp ]
- [ run ratio_test.cpp : : : <link>static ]
- [ run ratio_test.cpp : : : : ratio_test_dll ]
+ [ compile-fail ratio_add_fail.cpp ]
+ [ compile-fail ratio_substract_fail.cpp ]
+ [ compile-fail ratio_multiply_fail.cpp ]
+ [ compile-fail ratio_divide_fail.cpp ]
         ;
 
    test-suite "examples"

Added: sandbox/chrono/libs/ratio/test/ratio_add_fail.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio_add_fail.cpp 2010-09-20 00:51:40 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,22 @@
+// ratio_add_fail.cpp ----------------------------------------------------//
+
+// 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
+//===---------------------------- ratio_add_fail -----------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <boost/ratio.hpp>
+
+typedef boost::ratio<BOOST_INTMAX_C(0x7FFFFFFFFFFFFFFF), 1> R1;
+typedef boost::ratio<1, 1> R2;
+typedef boost::ratio_add<R1, R2>::type RT;

Added: sandbox/chrono/libs/ratio/test/ratio_divide_fail.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio_divide_fail.cpp 2010-09-20 00:51:40 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,22 @@
+// ratio_divide_fail.cpp ----------------------------------------------------//
+
+// 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
+//===---------------------------- ratio_multiply.fail -----------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <boost/ratio.hpp>
+
+typedef boost::ratio<BOOST_INTMAX_C(0x7FFFFFFFFFFFFFFF), 1> R1;
+typedef boost::ratio<1,2> R2;
+typedef boost::ratio_divide<R1, R2>::type RT;

Added: sandbox/chrono/libs/ratio/test/ratio_fail_test2.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio_fail_test2.cpp 2010-09-20 00:51:40 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,24 @@
+// ratio_fail_test2.cpp ----------------------------------------------------//
+
+// 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
+//===---------------------------- ratio -----------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <boost/ratio.hpp>
+
+int main()
+{
+ const boost::intmax_t t1 = boost::ratio<1, 0>::num;
+ (void)t1;
+}

Added: sandbox/chrono/libs/ratio/test/ratio_fail_test3.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio_fail_test3.cpp 2010-09-20 00:51:40 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,24 @@
+// ratio_fail_test3.cpp ----------------------------------------------------//
+
+// 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
+//===---------------------------- ratio -----------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+
+#include <boost/ratio.hpp>
+int main()
+{
+ const boost::intmax_t t1 = boost::ratio<0x8000000000000000ULL, 1>::num;
+ (void)t1;
+}

Added: sandbox/chrono/libs/ratio/test/ratio_fail_test4.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio_fail_test4.cpp 2010-09-20 00:51:40 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,23 @@
+// ratio_fail_test4.cpp ----------------------------------------------------//
+
+// 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
+//===---------------------------- ratio -----------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <boost/ratio.hpp>
+int main()
+{
+ const boost::intmax_t t1 = boost::ratio<1, 0x8000000000000000ULL>::num;
+ (void)t1;
+}

Added: sandbox/chrono/libs/ratio/test/ratio_multiply_fail.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio_multiply_fail.cpp 2010-09-20 00:51:40 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,22 @@
+// ratio_multiply_fail.cpp ----------------------------------------------------//
+
+// 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/ratio.hpp>
+
+// Taken from llvm/libcxx/test/utilities/ratio
+//===---------------------------- ratio_multiply.fail -----------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+typedef boost::ratio<BOOST_INTMAX_C(0x7FFFFFFFFFFFFFFF), 1> R1;
+typedef boost::ratio<2,1> R2;
+typedef boost::ratio_multiply<R1, R2>::type RT;

Added: sandbox/chrono/libs/ratio/test/ratio_ope_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio_ope_test.cpp 2010-09-20 00:51:40 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,533 @@
+// ratio_test.cpp ----------------------------------------------------------//
+
+// Copyright 2008 Howard Hinnant
+// Copyright 2008 Beman Dawes
+// Copyright 2010 Vicente J. Botet Escriba
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// A lot of test are taken from llvm/libcxx/test/utilities/ratio
+//===---------------------------- ratio -----------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <boost/ratio.hpp>
+#include <iostream>
+
+#if !defined(BOOST_NO_STATIC_ASSERT) || !defined(BOOST_RATIO_USES_MPL_ASSERT)
+#define NOTHING ""
+#endif
+
+
+#ifndef BOOST_NO_STATIC_ASSERT
+#define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) static_assert(CND,MSG)
+#elif defined(BOOST_RATIO_USES_STATIC_ASSERT)
+#include <boost/static_assert.hpp>
+#define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) BOOST_STATIC_ASSERT(CND)
+#elif defined(BOOST_RATIO_USES_MPL_ASSERT)
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/bool.hpp>
+#define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) \
+ BOOST_MPL_ASSERT_MSG(boost::mpl::bool_< (CND) >::type::value, MSG, TYPES)
+#else
+//~ #elif defined(BOOST_RATIO_USES_ARRAY_ASSERT)
+#define BOOST_RATIO_CONCAT(A,B) A##B
+#define BOOST_RATIO_NAME(A,B) BOOST_RATIO_CONCAT(A,B)
+#define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) static char BOOST_RATIO_NAME(__boost_ratio_test_,__LINE__)[(CND)?1:-1]
+//~ #define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES)
+#endif
+
+
+typedef boost::ratio<5, 3> five_thirds; // five_thirds::num == 5, five_thirds::den == 3
+typedef boost::ratio<25, 15> also_five_thirds; // also_five_thirds::num == 5, also_five_thirds::den == 3
+typedef boost::ratio_divide<five_thirds, also_five_thirds>::type one; // one::num == 1, one::den == 1
+
+
+typedef boost::ratio_multiply<boost::ratio<5>, boost::giga>::type _5giga; // _5giga::num == 5000000000, _5giga::den == 1
+typedef boost::ratio_multiply<boost::ratio<5>, boost::nano>::type _5nano; // _5nano::num == 1, _5nano::den == 200000000
+
+// 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<8, 7> R2;
+typedef boost::ratio_multiply<R1, R2>::type RT;
+
+
+
+int main()
+{
+
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, 1> R2;
+ typedef boost::ratio_add<R1, R2>::type R;
+ BOOST_RATIO_STATIC_ASSERT(R::num == 2 && R::den == 1, NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 2> R1;
+ typedef boost::ratio<1, 1> R2;
+ typedef boost::ratio_add<R1, R2>::type R;
+ BOOST_RATIO_STATIC_ASSERT(R::num == 3 && R::den == 2, NOTHING, ());
+ }
+ {
+ typedef boost::ratio<-1, 2> R1;
+ typedef boost::ratio<1, 1> R2;
+ typedef boost::ratio_add<R1, R2>::type 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::ratio_add<R1, R2>::type 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::ratio_add<R1, R2>::type 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::ratio_add<R1, R2>::type 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::ratio_add<R1, R2>::type R;
+ BOOST_RATIO_STATIC_ASSERT(R::num == 127970191639601LL && R::den == 5177331081415LL, NOTHING, ());
+ }
+
+ {
+ typedef boost::ratio<8, BOOST_INTMAX_C(0x7FFFFFFFD)> R1;
+ typedef boost::ratio<3, BOOST_INTMAX_C(0x7FFFFFFFD)> R2;
+ typedef boost::ratio_subtract<R1, R2>::type RS;
+ std::cout << RS::num << '/' << RS::den << '\n';
+ }
+
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, 1> R2;
+ typedef boost::ratio_subtract<R1, R2>::type R;
+ BOOST_RATIO_STATIC_ASSERT(R::num == 0 && R::den == 1, NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 2> R1;
+ typedef boost::ratio<1, 1> R2;
+ typedef boost::ratio_subtract<R1, R2>::type 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::ratio_subtract<R1, R2>::type R;
+ BOOST_RATIO_STATIC_ASSERT(R::num == -3 && R::den == 2, NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, -2> R1;
+ typedef boost::ratio<1, 1> R2;
+ typedef boost::ratio_subtract<R1, R2>::type R;
+ BOOST_RATIO_STATIC_ASSERT(R::num == -3 && R::den == 2, NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 2> R1;
+ typedef boost::ratio<-1, 1> R2;
+ typedef boost::ratio_subtract<R1, R2>::type R;
+ BOOST_RATIO_STATIC_ASSERT(R::num == 3 && R::den == 2, NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 2> R1;
+ typedef boost::ratio<1, -1> R2;
+ typedef boost::ratio_subtract<R1, R2>::type R;
+ BOOST_RATIO_STATIC_ASSERT(R::num == 3 && R::den == 2, NOTHING, ());
+ }
+ {
+ typedef boost::ratio<56987354, 467584654> R1;
+ typedef boost::ratio<544668, 22145> R2;
+ typedef boost::ratio_subtract<R1, R2>::type R;
+ BOOST_RATIO_STATIC_ASSERT(R::num == -126708206685271LL && R::den == 5177331081415LL, NOTHING, ());
+ }
+
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, 1> R2;
+ typedef boost::ratio_multiply<R1, R2>::type R;
+ BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 1, NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 2> R1;
+ typedef boost::ratio<1, 1> R2;
+ typedef boost::ratio_multiply<R1, R2>::type 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::ratio_multiply<R1, R2>::type 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::ratio_multiply<R1, R2>::type 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::ratio_multiply<R1, R2>::type 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::ratio_multiply<R1, R2>::type 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::ratio_multiply<R1, R2>::type R;
+ BOOST_RATIO_STATIC_ASSERT(R::num == 15519594064236LL && R::den == 5177331081415LL, NOTHING, ());
+ }
+
+ {
+ typedef boost::ratio<1, 1> R1;
+ typedef boost::ratio<1, 1> R2;
+ typedef boost::ratio_divide<R1, R2>::type R;
+ BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 1, NOTHING, ());
+ }
+ {
+ typedef boost::ratio<1, 2> R1;
+ typedef boost::ratio<1, 1> R2;
+ typedef boost::ratio_divide<R1, R2>::type 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::ratio_divide<R1, R2>::type 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::ratio_divide<R1, R2>::type 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::ratio_divide<R1, R2>::type 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::ratio_divide<R1, R2>::type 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::ratio_divide<R1, R2>::type R;
+ BOOST_RATIO_STATIC_ASSERT(R::num == 630992477165LL && R::den == 127339199162436LL, NOTHING, ());
+ }
+
+ // test ratio_equal
+ {
+ 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, ());
+ }
+
+ // test ratio_not_equal
+
+ {
+ 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, ());
+ }
+
+ // test ratio_greater
+
+ {
+ 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, ());
+ }
+
+ // test ratio_greater_equal
+
+ {
+ 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, ());
+ }
+
+ // test ratio_less
+
+ {
+ 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, ());
+ }
+
+ // test ratio_less_equal
+
+ {
+ 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, ());
+ }
+
+ return 0;
+}

Added: sandbox/chrono/libs/ratio/test/ratio_substract_fail.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio_substract_fail.cpp 2010-09-20 00:51:40 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,22 @@
+// ratio_substract_fail.cpp ----------------------------------------------------//
+
+// 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
+//===---------------------------- ratio_substract.fail -----------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <boost/ratio.hpp>
+
+typedef boost::ratio<BOOST_INTMAX_C(-0x7FFFFFFFFFFFFFFF), 1> R1;
+typedef boost::ratio<1,1> R2;
+typedef boost::ratio_substract<R1, R2>::type RT;

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 2010-09-20 00:51:40 EDT (Mon, 20 Sep 2010)
@@ -2,32 +2,96 @@
 
 // Copyright 2008 Howard Hinnant
 // Copyright 2008 Beman Dawes
+// Copyright 2010 Vicente J. Botet Escriba
 
 // Distributed under the Boost Software License, Version 1.0.
 // See http://www.boost.org/LICENSE_1_0.txt
 
+// A lot of test are taken from llvm/libcxx/test/utilities/ratio
+//===---------------------------- ratio -----------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
 #include <boost/ratio.hpp>
-#include <boost/chrono/duration.hpp>
 #include <iostream>
 
-typedef boost::ratio<5, 3> five_thirds; // five_thirds::num == 5, five_thirds::den == 3
-typedef boost::ratio<25, 15> also_five_thirds; // also_five_thirds::num == 5, also_five_thirds::den == 3
-typedef boost::ratio_divide<five_thirds, also_five_thirds>::type one; // one::num == 1, one::den == 1
-
-
-typedef boost::ratio_multiply<boost::ratio<5>, boost::giga>::type _5giga; // _5giga::num == 5000000000, _5giga::den == 1
-typedef boost::ratio_multiply<boost::ratio<5>, boost::nano>::type _5nano; // _5nano::num == 1, _5nano::den == 200000000
-
-// 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<8, 7> R2;
-typedef boost::ratio_multiply<R1, R2>::type RT;
+#if !defined(BOOST_NO_STATIC_ASSERT) || !defined(BOOST_RATIO_USES_MPL_ASSERT)
+#define NOTHING ""
+#endif
+
+
+#ifndef BOOST_NO_STATIC_ASSERT
+#define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) static_assert(CND,MSG)
+#elif defined(BOOST_RATIO_USES_STATIC_ASSERT)
+#include <boost/static_assert.hpp>
+#define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) BOOST_STATIC_ASSERT(CND)
+#elif defined(BOOST_RATIO_USES_MPL_ASSERT)
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/bool.hpp>
+#define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) \
+ BOOST_MPL_ASSERT_MSG(boost::mpl::bool_< (CND) >::type::value, MSG, TYPES)
+#else
+//~ #elif defined(BOOST_RATIO_USES_ARRAY_ASSERT)
+#define BOOST_RATIO_CONCAT(A,B) A##B
+#define BOOST_RATIO_NAME(A,B) BOOST_RATIO_CONCAT(A,B)
+#define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES) static char BOOST_RATIO_NAME(__boost_ratio_test_,__LINE__)[(CND)?1:-1]
+//~ #define BOOST_RATIO_STATIC_ASSERT(CND, MSG, TYPES)
+#endif
+
+// typedefs
+BOOST_RATIO_STATIC_ASSERT(boost::atto::num == 1 && boost::atto::den == 1000000000000000000ULL, NOTHING, ());
+BOOST_RATIO_STATIC_ASSERT(boost::femto::num == 1 && boost::femto::den == 1000000000000000ULL, NOTHING, ());
+BOOST_RATIO_STATIC_ASSERT(boost::pico::num == 1 && boost::pico::den == 1000000000000ULL, NOTHING, ());
+BOOST_RATIO_STATIC_ASSERT(boost::nano::num == 1 && boost::nano::den == 1000000000ULL, NOTHING, ());
+BOOST_RATIO_STATIC_ASSERT(boost::micro::num == 1 && boost::micro::den == 1000000ULL, NOTHING, ());
+BOOST_RATIO_STATIC_ASSERT(boost::milli::num == 1 && boost::milli::den == 1000ULL, NOTHING, ());
+BOOST_RATIO_STATIC_ASSERT(boost::centi::num == 1 && boost::centi::den == 100ULL, NOTHING, ());
+BOOST_RATIO_STATIC_ASSERT(boost::deci::num == 1 && boost::deci::den == 10ULL, NOTHING, ());
+BOOST_RATIO_STATIC_ASSERT(boost::deca::num == 10ULL && boost::deca::den == 1, NOTHING, ());
+BOOST_RATIO_STATIC_ASSERT(boost::hecto::num == 100ULL && boost::hecto::den == 1, NOTHING, ());
+BOOST_RATIO_STATIC_ASSERT(boost::kilo::num == 1000ULL && boost::kilo::den == 1, NOTHING, ());
+BOOST_RATIO_STATIC_ASSERT(boost::mega::num == 1000000ULL && boost::mega::den == 1, NOTHING, ());
+BOOST_RATIO_STATIC_ASSERT(boost::giga::num == 1000000000ULL && boost::giga::den == 1, NOTHING, ());
+BOOST_RATIO_STATIC_ASSERT(boost::tera::num == 1000000000000ULL && boost::tera::den == 1, NOTHING, ());
+BOOST_RATIO_STATIC_ASSERT(boost::peta::num == 1000000000000000ULL && boost::peta::den == 1, NOTHING, ());
+BOOST_RATIO_STATIC_ASSERT(boost::exa::num == 1000000000000000000ULL && boost::exa::den == 1, NOTHING, ());
 
 
+template <long long N, long long D, long long eN, long long eD>
+void test_simplification()
+{
+ 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_simplification<1, 1, 1, 1>();
+ test_simplification<1, 10, 1, 10>();
+ test_simplification<10, 10, 1, 1>();
+ test_simplification<10, 1, 10, 1>();
+ test_simplification<12, 4, 3, 1>();
+ test_simplification<12, -4, -3, 1>();
+ test_simplification<-12, 4, -3, 1>();
+ test_simplification<-12, -4, 3, 1>();
+ test_simplification<4, 12, 1, 3>();
+ test_simplification<4, -12, -1, 3>();
+ test_simplification<-4, 12, -1, 3>();
+ test_simplification<-4, -12, 1, 3>();
+ test_simplification<222, 333, 2, 3>();
+ test_simplification<222, -333, -2, 3>();
+ test_simplification<-222, 333, -2, 3>();
+ test_simplification<-222, -333, 2, 3>();
+ test_simplification<0x7FFFFFFFFFFFFFFFLL, 127, 72624976668147841LL, 1>();
+ test_simplification<-0x7FFFFFFFFFFFFFFFLL, 127, -72624976668147841LL, 1>();
+ test_simplification<0x7FFFFFFFFFFFFFFFLL, -127, -72624976668147841LL, 1>();
+ test_simplification<-0x7FFFFFFFFFFFFFFFLL, -127, 72624976668147841LL, 1>();
+
     typedef boost::ratio<8, BOOST_INTMAX_C(0x7FFFFFFFD)> R1;
     typedef boost::ratio<3, BOOST_INTMAX_C(0x7FFFFFFFD)> R2;
     typedef boost::ratio_subtract<R1, R2>::type RS;


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