diff options
Diffstat (limited to 'src/boost/libs/ratio/test/ratio_extensions/ratio_ext_pass.cpp')
-rw-r--r-- | src/boost/libs/ratio/test/ratio_extensions/ratio_ext_pass.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/boost/libs/ratio/test/ratio_extensions/ratio_ext_pass.cpp b/src/boost/libs/ratio/test/ratio_extensions/ratio_ext_pass.cpp new file mode 100644 index 000000000..a2fccff01 --- /dev/null +++ b/src/boost/libs/ratio/test/ratio_extensions/ratio_ext_pass.cpp @@ -0,0 +1,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(); +} |