]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/test/qi/regression_float_fraction.cpp
1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
3 Copyright (c) 2001-2011 Hartmut Kaiser
4 Copyright (c) 2011 Bryce Lelbach
6 Use, modification and distribution is subject to the Boost Software
7 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8 http://www.boost.org/LICENSE_1_0.txt)
9 =============================================================================*/
11 #include <boost/detail/lightweight_test.hpp>
12 #include <boost/spirit/include/qi_numeric.hpp>
19 using spirit_test::test_attr
;
20 using boost::spirit::qi::float_
;
22 std::cerr
.precision(9);
26 // this should pass, but currently doesn't because of the way the real
27 // parser handles the fractional part of a number
28 BOOST_TEST(test_attr("123233.4124", float_
, f
));
29 BOOST_TEST_EQ(f
, 123233.4124f
);
30 BOOST_TEST(test_attr("987654.3219", float_
, f
));
31 BOOST_TEST_EQ(f
, 987654.3219f
);
33 return boost::report_errors();