Imported Upstream version 1.57.0
[platform/upstream/boost.git] / libs / ratio / test / ratio_extensions / mpl_greater_equal_pass.cpp
1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //  Adaptation to Boost of the libcxx
10 //  Copyright 2010 Vicente J. Botet Escriba
11 //  Distributed under the Boost Software License, Version 1.0.
12 //  See http://www.boost.org/LICENSE_1_0.txt
13
14 #define BOOST_RATIO_EXTENSIONS
15
16 #include <boost/ratio/mpl/greater_equal.hpp>
17 #if !defined(BOOST_NO_CXX11_STATIC_ASSERT)
18 #define NOTHING ""
19 #endif
20
21
22 void test()
23 {
24     {
25     typedef boost::ratio<1, 1> R1;
26     typedef boost::ratio<1, 1> R2;
27     BOOST_RATIO_STATIC_ASSERT((boost::mpl::greater_equal<R1, R2>::value), NOTHING, ());
28     }
29     {
30     typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R1;
31     typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R2;
32     BOOST_RATIO_STATIC_ASSERT((boost::mpl::greater_equal<R1, R2>::value), NOTHING, ());
33     }
34     {
35     typedef boost::ratio<1,BOOST_RATIO_INTMAX_T_MAX> R1;
36     typedef boost::ratio<1,BOOST_RATIO_INTMAX_T_MAX> R2;
37     BOOST_RATIO_STATIC_ASSERT((boost::mpl::greater_equal<R1, R2>::value), NOTHING, ());
38     }
39     {
40     typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R1;
41     typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R2;
42     BOOST_RATIO_STATIC_ASSERT((boost::mpl::greater_equal<R1, R2>::value), NOTHING, ());
43     }
44     {
45     typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R1;
46     typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R2;
47     BOOST_RATIO_STATIC_ASSERT((boost::mpl::greater_equal<R1, R2>::value), NOTHING, ());
48     }
49     {
50     typedef boost::ratio<1, 1> R1;
51     typedef boost::ratio<1, -1> R2;
52     BOOST_RATIO_STATIC_ASSERT((boost::mpl::greater_equal<R1, R2>::value), NOTHING, ());
53     }
54     {
55     typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R1;
56     typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R2;
57     BOOST_RATIO_STATIC_ASSERT((boost::mpl::greater_equal<R1, R2>::value), NOTHING, ());
58     }
59     {
60     typedef boost::ratio<-BOOST_RATIO_INTMAX_T_MAX, 1> R1;
61     typedef boost::ratio<BOOST_RATIO_INTMAX_T_MAX, 1> R2;
62     BOOST_RATIO_STATIC_ASSERT((!boost::mpl::greater_equal<R1, R2>::value), NOTHING, ());
63     }
64     {
65     typedef boost::ratio<1, BOOST_RATIO_INTMAX_T_MAX> R1;
66     typedef boost::ratio<1, -BOOST_RATIO_INTMAX_T_MAX> R2;
67     BOOST_RATIO_STATIC_ASSERT((boost::mpl::greater_equal<R1, R2>::value), NOTHING, ());
68     }
69 }