]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/test/qi/regression_float_fraction.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / 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
5
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 =============================================================================*/
10
11 #include <boost/detail/lightweight_test.hpp>
12 #include <boost/spirit/include/qi_numeric.hpp>
13
14 #include "test.hpp"
15
16 int
17 main()
18 {
19 using spirit_test::test_attr;
20 using boost::spirit::qi::float_;
21
22 std::cerr.precision(9);
23
24 float f = 0.0f;
25
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);
32
33 return boost::report_errors();
34 }
35