]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/lexical_cast/test/no_comp_time_prcision.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / lexical_cast / test / no_comp_time_prcision.cpp
1 // Unit test for boost::lexical_cast for https://svn.boost.org/trac/boost/ticket/11669.
2 //
3 // See http://www.boost.org for most recent version, including documentation.
4 //
5 // Copyright Antony Polukhin, 2015-2022.
6 //
7 // Distributed under the Boost
8 // Software License, Version 1.0. (See accompanying file
9 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt).
10
11 #include <string>
12 #define BOOST_LCAST_NO_COMPILE_TIME_PRECISION
13 #include <boost/lexical_cast.hpp>
14
15 #include <boost/test/unit_test.hpp>
16
17 void main_check() {
18 BOOST_CHECK(!boost::lexical_cast<std::string>(2.12345).empty());
19 BOOST_CHECK(!boost::lexical_cast<std::string>(2.12345678).empty());
20 }
21
22 boost::unit_test::test_suite *init_unit_test_suite(int, char *[])
23 {
24 boost::unit_test::test_suite *suite =
25 BOOST_TEST_SUITE("lexical_cast no-compile-time-precision check");
26 suite->add(BOOST_TEST_CASE(main_check));
27 return suite;
28 }