Boost.Ratio: Added ratio extension test

[SVN r67583]
This commit is contained in:
Vicente J. Botet Escriba 2011-01-02 19:38:41 +00:00
parent a0a2133a9c
commit 30adfec795
2 changed files with 28 additions and 0 deletions

View File

@ -81,3 +81,7 @@ project
[ run ../example/display_ex.cpp ]
;
test-suite "ratio.ext"
:
[ run ratio_extensions/ratio_ext_pass.cpp ]
;

View File

@ -0,0 +1,24 @@
// 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.hpp>
#include <boost/detail/lightweight_test.hpp>
boost::intmax_t func(boost::ratio<5,6> s) {
return s.num;
}
void test() {
BOOST_TEST((
func(boost::ratio<10,12>() )==5
));
}
int main()
{
test();
}