Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65478 - in sandbox/chrono/libs/ratio: doc doc/html test test/ratio.arithmetic test/ratio.comparison test/ratio.ratio
From: vicente.botet_at_[hidden]
Date: 2010-09-20 07:19:33


Author: viboes
Date: 2010-09-20 07:18:57 EDT (Mon, 20 Sep 2010)
New Revision: 65478
URL: http://svn.boost.org/trac/boost/changeset/65478

Log:
Adapt tests coming from llvm/libc++/test/ratio
Added:
   sandbox/chrono/libs/ratio/test/ratio.arithmetic/
   sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_add.fail.cpp (contents, props changed)
   sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_add.pass.cpp (contents, props changed)
   sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_divide.fail.cpp (contents, props changed)
   sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_divide.pass.cpp (contents, props changed)
   sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_multiply.fail.cpp (contents, props changed)
   sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_multiply.pass.cpp (contents, props changed)
   sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_subtract.fail.cpp (contents, props changed)
   sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_subtract.pass.cpp (contents, props changed)
   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)
   sandbox/chrono/libs/ratio/test/typedefs.pass.cpp (contents, props changed)
Text files modified:
   sandbox/chrono/libs/ratio/doc/html/index.html | 759 +++++++++++++++++++++++++++++++++++----
   sandbox/chrono/libs/ratio/doc/ratio.qbk | 48 ++
   sandbox/chrono/libs/ratio/test/Jamfile.v2 | 37 +
   sandbox/chrono/libs/ratio/test/ratio_ope_test.cpp | 469 ------------------------
   sandbox/chrono/libs/ratio/test/ratio_test.cpp | 51 --
   5 files changed, 755 insertions(+), 609 deletions(-)

Modified: sandbox/chrono/libs/ratio/doc/html/index.html
==============================================================================
--- sandbox/chrono/libs/ratio/doc/html/index.html (original)
+++ sandbox/chrono/libs/ratio/doc/html/index.html 2010-09-20 07:18:57 EDT (Mon, 20 Sep 2010)
@@ -1211,7 +1211,10 @@
 </h2></div></div></div>
 <div class="toc"><dl>
 <dt><span class="section"> Appendix A: History</span></dt>
-<dd><dl><dt><span class="section">Version 0.1.0, September 10, 2010 </span></dt></dl></dd>
+<dd><dl>
+<dt><span class="section">Version 0.1.1, September 20, 2010 </span></dt>
+<dt><span class="section">Version 0.1.0, September 10, 2010 </span></dt>
+</dl></dd>
 <dt><span class="section"> Appendix B: Rationale</span></dt>
 <dt><span class="section"><a href="index.html#boost_ratio.appendices.implementation"> Appendix C: Implementation
       Notes</a></span></dt>
@@ -1219,7 +1222,11 @@
 <dt><span class="section"><a href="index.html#boost_ratio.appendices.acknowledgements"> Appendix E:
       Acknowledgements</a></span></dt>
 <dt><span class="section"> Appendix F: Tests</span></dt>
-<dd><dl><dt><span class="section">ratio</span></dt></dl></dd>
+<dd><dl>
+<dt><span class="section">ratio</span></dt>
+<dt><span class="section">comparison</span></dt>
+<dt><span class="section">arithmetic</span></dt>
+</dl></dd>
 <dt><span class="section"> Appendix G: Tickets</span></dt>
 <dt><span class="section"> Appendix H: Future plans</span></dt>
 </dl></div>
@@ -1227,7 +1234,28 @@
 <div class="titlepage"><div><div><h3 class="title">
 <a name="boost_ratio.appendices.history"></a> Appendix A: History
 </h3></div></div></div>
-<div class="toc"><dl><dt><span class="section">Version 0.1.0, September 10, 2010 </span></dt></dl></div>
+<div class="toc"><dl>
+<dt><span class="section">Version 0.1.1, September 20, 2010 </span></dt>
+<dt><span class="section">Version 0.1.0, September 10, 2010 </span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_ratio.appendices.history.__version_0_1_1__september_20__2010__"></a>Version 0.1.1, September 20, 2010
+</h4></div></div></div>
+<p>
+ <span class="bold"><strong>Fixes:</strong></span>
+ </p>
+<div class="itemizedlist"><ul type="disc"><li>
+ ratio_less overflow avoided following the algorithm from libc++.
+ </li></ul></div>
+<p>
+ <span class="bold"><strong>Test:</strong></span>
+ </p>
+<div class="itemizedlist"><ul type="disc"><li>
+ A more complete test has been included adapted from the test of from
+ libc++/ratio.
+ </li></ul></div>
+</div>
 <div class="section" lang="en">
 <div class="titlepage"><div><div><h4 class="title">
 <a name="boost_ratio.appendices.history.__version_0_1_0__september_10__2010__"></a>Version 0.1.0, September 10, 2010
@@ -1245,7 +1273,7 @@
 <a name="boost_ratio.appendices.rationale"></a> Appendix B: Rationale
 </h3></div></div></div>
 <a name="boost_ratio.appendices.rationale.why_ratio_needs_copyconstruction_and_assignment_from_ratios_having_the_same_normalized_form"></a><h4>
-<a name="id5009150"></a>
+<a name="id5009215"></a>
         <a href="index.html#boost_ratio.appendices.rationale.why_ratio_needs_copyconstruction_and_assignment_from_ratios_having_the_same_normalized_form">Why
         ratio needs CopyConstruction and Assignment from ratios having the same normalized
         form</a>
@@ -1280,7 +1308,7 @@
         succeeds.
       </p>
 <a name="boost_ratio.appendices.rationale.why_ratio_needs_the_nested_normalizer_typedef_type"></a><h4>
-<a name="id5009555"></a>
+<a name="id5009620"></a>
         <a href="index.html#boost_ratio.appendices.rationale.why_ratio_needs_the_nested_normalizer_typedef_type">Why
         ratio needs the nested normalizer typedef type</a>
       </h4>
@@ -1345,7 +1373,11 @@
 <div class="titlepage"><div><div><h3 class="title">
 <a name="boost_ratio.appendices.tests"></a> Appendix F: Tests
 </h3></div></div></div>
-<div class="toc"><dl><dt><span class="section">ratio</span></dt></dl></div>
+<div class="toc"><dl>
+<dt><span class="section">ratio</span></dt>
+<dt><span class="section">comparison</span></dt>
+<dt><span class="section">arithmetic</span></dt>
+</dl></div>
 <p>
         In order to test you need to do.
       </p>
@@ -1400,17 +1432,17 @@
 <tr>
 <td>
                   <p>
- ratio_fail_test1
+ typedefs.pass
                   </p>
                 </td>
 <td>
                   <p>
- compile-fails
+ run
                   </p>
                 </td>
 <td>
                   <p>
- ...
+ check the num/den are correct for the predefined typedefs
                   </p>
                 </td>
 <td>
@@ -1427,7 +1459,7 @@
 <tr>
 <td>
                   <p>
- ratio_test
+ ratio.pass
                   </p>
                 </td>
 <td>
@@ -1437,7 +1469,90 @@
                 </td>
 <td>
                   <p>
- ...
+ check the num/den are correctly simplified
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ ratio1.fail
+ </p>
+ </td>
+<td>
+ <p>
+ compile-fails
+ </p>
+ </td>
+<td>
+ <p>
+ The template argument D shall not be zero
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ ratio2.fail
+ </p>
+ </td>
+<td>
+ <p>
+ compile-fails
+ </p>
+ </td>
+<td>
+ <p>
+ the absolute values of the template arguments N and D shall be
+ representable by type intmax_t
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ ratio3.fail
+ </p>
+ </td>
+<td>
+ <p>
+ compile-fails
+ </p>
+ </td>
+<td>
+ <p>
+ the absolute values of the template arguments N and D shall be
+ representable by type intmax_t
                   </p>
                 </td>
 <td>
@@ -1454,103 +1569,589 @@
 </tbody>
 </table></div>
 </div>
-</div>
 <div class="section" lang="en">
-<div class="titlepage"><div><div><h3 class="title">
-<a name="boost_ratio.appendices.tickets"></a> Appendix G: Tickets
-</h3></div></div></div>
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_ratio.appendices.tests._comparison_"></a>comparison
+</h4></div></div></div>
 <div class="informaltable"><table class="table">
 <colgroup>
 <col>
 <col>
 <col>
 <col>
+<col>
 </colgroup>
 <thead><tr>
 <th>
- <p>
- Ticket
- </p>
- </th>
+ <p>
+ Name
+ </p>
+ </th>
 <th>
- <p>
- Description
- </p>
- </th>
+ <p>
+ kind
+ </p>
+ </th>
 <th>
- <p>
- Resolution
- </p>
- </th>
+ <p>
+ Description
+ </p>
+ </th>
 <th>
- <p>
- State
- </p>
- </th>
+ <p>
+ Result
+ </p>
+ </th>
+<th>
+ <p>
+ Ticket
+ </p>
+ </th>
 </tr></thead>
 <tbody>
 <tr>
 <td>
- <p>
- 1
- </p>
- </td>
+ <p>
+ ratio_equal.pass
+ </p>
+ </td>
 <td>
- <p>
- result of metafunctions ratio_multiply and ratio_divide were not
- normalized ratios
- </p>
- </td>
+ <p>
+ run
+ </p>
+ </td>
 <td>
- <p>
- Use of the nested ratio typedef type on ratio arithmetic operations.
- </p>
- </td>
+ <p>
+ check ratio_equal metafunction class
+ </p>
+ </td>
 <td>
- <p>
- Closed
- </p>
- </td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
 </tr>
 <tr>
 <td>
- <p>
- 2
- </p>
- </td>
+ <p>
+ ratio_not_equal.pass
+ </p>
+ </td>
 <td>
- <p>
- INTMAX_C is not always defined
- </p>
- </td>
+ <p>
+ run
+ </p>
+ </td>
 <td>
- <p>
- Replace INTMAX_C by BOOST_INTMAX_C until boost/cstdint.hpp ensures
- INTMAX_C is always defined.
- </p>
- </td>
+ <p>
+ check ratio_not_equal metafunction class
+ </p>
+ </td>
 <td>
- <p>
- Closed
- </p>
- </td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
 </tr>
 <tr>
 <td>
- <p>
- 3
- </p>
- </td>
+ <p>
+ ratio_less.pass
+ </p>
+ </td>
 <td>
- <p>
- MSVC reports a warning instead of an error when there is an integral
- constant overflow
- </p>
- </td>
+ <p>
+ run
+ </p>
+ </td>
 <td>
- <p>
- manage with MSVC reporting a warning instead of an error when there
- is an integral constant overflow
+ <p>
+ check ratio_less metafunction class
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ ratio_less_equal.pass
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check ratio_less_equal metafunction class
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ ratio_greater.pass
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check ratio_greater metafunction class
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ ratio_greater_equal.pass
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check ratio_greater_equal metafunction class
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_ratio.appendices.tests._arithmetic_"></a>arithmetic
+</h4></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Name
+ </p>
+ </th>
+<th>
+ <p>
+ kind
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+<th>
+ <p>
+ Result
+ </p>
+ </th>
+<th>
+ <p>
+ Ticket
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ ratio_add.pass
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check ratio_add metafunction class
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ ratio_substract.pass
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check ratio_substract metafunction class
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ ratio_multiply.pass
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check ratio_multiply metafunction class
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ ratio_divide.pass
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ check ratio_divide metafunction class
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ ratio_add.fail
+ </p>
+ </td>
+<td>
+ <p>
+ compile-fails
+ </p>
+ </td>
+<td>
+ <p>
+ check ratio_add overflow metafunction class
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ ratio_substract.fail
+ </p>
+ </td>
+<td>
+ <p>
+ compile-fails
+ </p>
+ </td>
+<td>
+ <p>
+ check ratio_substract underflow metafunction class
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ ratio_multiply.fail
+ </p>
+ </td>
+<td>
+ <p>
+ compile-fails
+ </p>
+ </td>
+<td>
+ <p>
+ check ratio_multiply overflow metafunction class
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ ratio_divide.fail
+ </p>
+ </td>
+<td>
+ <p>
+ compile-fails
+ </p>
+ </td>
+<td>
+ <p>
+ check ratio_divide overflow metafunction class
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_ratio.appendices.tickets"></a> Appendix G: Tickets
+</h3></div></div></div>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Ticket
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+<th>
+ <p>
+ Resolution
+ </p>
+ </th>
+<th>
+ <p>
+ State
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ 1
+ </p>
+ </td>
+<td>
+ <p>
+ result of metafunctions ratio_multiply and ratio_divide were not
+ normalized ratios
+ </p>
+ </td>
+<td>
+ <p>
+ Use of the nested ratio typedef type on ratio arithmetic operations.
+ </p>
+ </td>
+<td>
+ <p>
+ Closed
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 2
+ </p>
+ </td>
+<td>
+ <p>
+ INTMAX_C is not always defined
+ </p>
+ </td>
+<td>
+ <p>
+ Replace INTMAX_C by BOOST_INTMAX_C until boost/cstdint.hpp ensures
+ INTMAX_C is always defined.
+ </p>
+ </td>
+<td>
+ <p>
+ Closed
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 3
+ </p>
+ </td>
+<td>
+ <p>
+ MSVC reports a warning instead of an error when there is an integral
+ constant overflow
+ </p>
+ </td>
+<td>
+ <p>
+ manage with MSVC reporting a warning instead of an error when there
+ is an integral constant overflow
+ </p>
+ </td>
+<td>
+ <p>
+ Closed
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ 4
+ </p>
+ </td>
+<td>
+ <p>
+ ration_less overflow on cases where it can be avoided
+ </p>
+ </td>
+<td>
+ <p>
+ Change the algorithm as implemented in libc++
                 </p>
               </td>
 <td>
@@ -1570,7 +2171,7 @@
 <a name="boost_ratio.appendices.todo"></a> Appendix H: Future plans
 </h3></div></div></div>
 <a name="boost_ratio.appendices.todo.for_later_releases"></a><h4>
-<a name="id5010332"></a>
+<a name="id5011285"></a>
         <a href="index.html#boost_ratio.appendices.todo.for_later_releases">For later
         releases</a>
       </h4>
@@ -1582,7 +2183,7 @@
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: September 11, 2010 at 09:03:26 GMT</small></p></td>
+<td align="left"><p><small>Last revised: September 20, 2010 at 09:53:32 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>

Modified: sandbox/chrono/libs/ratio/doc/ratio.qbk
==============================================================================
--- sandbox/chrono/libs/ratio/doc/ratio.qbk (original)
+++ sandbox/chrono/libs/ratio/doc/ratio.qbk 2010-09-20 07:18:57 EDT (Mon, 20 Sep 2010)
@@ -906,6 +906,18 @@
 [section:history Appendix A: History]
 [/==================================]
 
+[section [*Version 0.1.1, September 20, 2010] ]
+
+[*Fixes:]
+
+* ratio_less overflow avoided following the algorithm from libc++.
+
+[*Test:]
+
+* A more complete test has been included adapted from the test of from libc++/ratio.
+
+[endsect]
+
 [section [*Version 0.1.0, September 10, 2010] ]
 
 [*Features:]
@@ -994,9 +1006,38 @@
 
 [section `ratio`]
 [table
- [[Name] [kind] [Description] [Result] [Ticket]]
- [[ratio_fail_test1] [compile-fails] [...] [Pass] [#]]
- [[ratio_test] [run] [...] [Pass] [#]]
+ [[Name] [kind] [Description] [Result] [Ticket]]
+ [[typedefs.pass] [run] [check the num/den are correct for the predefined typedefs] [Pass] [#]]
+ [[ratio.pass] [run] [check the num/den are correctly simplified] [Pass] [#]]
+ [[ratio1.fail] [compile-fails] [The template argument D shall not be zero] [Pass] [#]]
+ [[ratio2.fail] [compile-fails] [the absolute values of the template arguments N and D shall be representable by type intmax_t] [Pass] [#]]
+ [[ratio3.fail] [compile-fails] [the absolute values of the template arguments N and D shall be representable by type intmax_t] [Pass] [#]]
+]
+[endsect]
+
+[section `comparison`]
+[table
+ [[Name] [kind] [Description] [Result] [Ticket]]
+ [[ratio_equal.pass] [run] [check ratio_equal metafunction class] [Pass] [#]]
+ [[ratio_not_equal.pass] [run] [check ratio_not_equal metafunction class] [Pass] [#]]
+ [[ratio_less.pass] [run] [check ratio_less metafunction class] [Pass] [#]]
+ [[ratio_less_equal.pass] [run] [check ratio_less_equal metafunction class] [Pass] [#]]
+ [[ratio_greater.pass] [run] [check ratio_greater metafunction class] [Pass] [#]]
+ [[ratio_greater_equal.pass] [run] [check ratio_greater_equal metafunction class] [Pass] [#]]
+]
+[endsect]
+
+[section `arithmetic`]
+[table
+ [[Name] [kind] [Description] [Result] [Ticket]]
+ [[ratio_add.pass] [run] [check ratio_add metafunction class] [Pass] [#]]
+ [[ratio_substract.pass] [run] [check ratio_substract metafunction class] [Pass] [#]]
+ [[ratio_multiply.pass] [run] [check ratio_multiply metafunction class] [Pass] [#]]
+ [[ratio_divide.pass] [run] [check ratio_divide metafunction class] [Pass] [#]]
+ [[ratio_add.fail] [compile-fails] [check ratio_add overflow metafunction class] [Pass] [#]]
+ [[ratio_substract.fail] [compile-fails] [check ratio_substract underflow metafunction class] [Pass] [#]]
+ [[ratio_multiply.fail] [compile-fails] [check ratio_multiply overflow metafunction class] [Pass] [#]]
+ [[ratio_divide.fail] [compile-fails] [check ratio_divide overflow metafunction class] [Pass] [#]]
 ]
 [endsect]
 
@@ -1011,6 +1052,7 @@
     [[2] [INTMAX_C is not always defined] [Replace INTMAX_C by BOOST_INTMAX_C until boost/cstdint.hpp ensures INTMAX_C is always defined.] [Closed]]
     
     [[3] [MSVC reports a warning instead of an error when there is an integral constant overflow] [manage with MSVC reporting a warning instead of an error when there is an integral constant overflow] [Closed]]
+ [[4] [ration_less overflow on cases where it can be avoided] [Change the algorithm as implemented in libc++] [Closed]]
     [/[#] [XXXX] [XXXX] [Closed]]
 ]
 

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:18:57 EDT (Mon, 20 Sep 2010)
@@ -36,23 +36,38 @@
 
     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 ]
+ [ 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 ]
         ;
 
- test-suite "ratio.ope"
+ test-suite "ratio.arithmetic"
         :
- [ run ratio_ope_test.cpp ]
+ #[ run ratio_ope_test.cpp ]
         [ compile-fail ratio_fail_test1.cpp ]
- [ compile-fail ratio_add_fail.cpp ]
- [ compile-fail ratio_substract_fail.cpp ]
- [ compile-fail ratio_multiply_fail.cpp ]
- [ compile-fail 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 "examples"
+ 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 ]
+ ;
+
+ test-suite "examples"
         :
         [ run ../example/si_physics.cpp ]
         ;

Added: sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_add.fail.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_add.fail.cpp 2010-09-20 07:18:57 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,21 @@
+// 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_add
+
+#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.arithmetic/ratio_add.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_add.pass.cpp 2010-09-20 07:18:57 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,66 @@
+// 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_add
+
+#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;
+ 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, ());
+ }
+}

Added: sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_divide.fail.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_divide.fail.cpp 2010-09-20 07:18:57 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,21 @@
+// 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_divide
+
+#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.arithmetic/ratio_divide.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_divide.pass.cpp 2010-09-20 07:18:57 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,66 @@
+// 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_divide
+
+#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;
+ 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, ());
+ }
+}

Added: sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_multiply.fail.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_multiply.fail.cpp 2010-09-20 07:18:57 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,21 @@
+// 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_multiply
+
+#include <boost/ratio.hpp>
+
+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.arithmetic/ratio_multiply.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_multiply.pass.cpp 2010-09-20 07:18:57 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,66 @@
+// 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_multiply
+
+#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;
+ 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, ());
+ }
+}

Added: sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_subtract.fail.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_subtract.fail.cpp 2010-09-20 07:18:57 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,21 @@
+// 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_subtract
+
+#include <boost/ratio.hpp>
+
+typedef boost::ratio<BOOST_INTMAX_C(-0x7FFFFFFFFFFFFFFF), 1> R1;
+typedef boost::ratio<1,1> R2;
+typedef boost::ratio_subtract<R1, R2>::type RT;

Added: sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_subtract.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/ratio.arithmetic/ratio_subtract.pass.cpp 2010-09-20 07:18:57 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,67 @@
+// 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_subtract
+
+#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;
+ 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, ());
+ }
+}

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:18:57 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:18:57 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:18:57 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:18:57 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:18:57 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:18:57 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, ());
+ }
+}

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:18:57 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:18:57 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:18:57 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:18:57 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;
+}

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:18:57 EDT (Mon, 20 Sep 2010)
@@ -61,473 +61,8 @@
 
 
 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;
 }

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 07:18:57 EDT (Mon, 20 Sep 2010)
@@ -19,7 +19,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
 
@@ -42,56 +42,9 @@
 //~ #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;

Added: sandbox/chrono/libs/ratio/test/typedefs.pass.cpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/libs/ratio/test/typedefs.pass.cpp 2010-09-20 07:18:57 EDT (Mon, 20 Sep 2010)
@@ -0,0 +1,39 @@
+// 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 typedef's
+
+#include <boost/ratio.hpp>
+
+#if !defined(BOOST_NO_STATIC_ASSERT)
+#define NOTHING ""
+#endif
+
+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, ());
+


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