summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/ratio/test/ratio_extensions/ratio_ext_pass.cpp
blob: a2fccff0142505d6c342816b1639459439924815 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//  Copyright 2011 Vicente J. Botet Escriba
//  Distributed under the Boost Software License, Version 1.0.
//  See http://www.boost.org/LICENSE_1_0.txt

// test ratio:  equivalent ratios convert with BOOST_RATIO_EXTENSIONS

#define BOOST_RATIO_EXTENSIONS
#include <boost/ratio/ratio.hpp>
#include <boost/core/lightweight_test.hpp>

boost::intmax_t func(boost::ratio<5,6>  s);

boost::intmax_t func(boost::ratio<5,6>  s) {
    return s.num;    
}

void test();

void test() {
    boost::ratio<10,12> r;
    BOOST_TEST((
        func(r)==5
    ));
}

int main()
{
    test();
    return boost::report_errors();
}