]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/lexical_cast/test/typedefed_wchar_test_runtime.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / lexical_cast / test / typedefed_wchar_test_runtime.cpp
1 // Unit test for boost::lexical_cast.
2 //
3 // See http://www.boost.org for most recent version, including documentation.
4 //
5 // Copyright Antony Polukhin, 2011-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 <boost/config.hpp>
12
13 #if defined(__INTEL_COMPILER)
14 #pragma warning(disable: 193 383 488 981 1418 1419)
15 #elif defined(BOOST_MSVC)
16 #pragma warning(disable: 4097 4100 4121 4127 4146 4244 4245 4511 4512 4701 4800)
17 #endif
18
19 #include <boost/lexical_cast.hpp>
20
21 #include <boost/test/unit_test.hpp>
22 using namespace boost;
23
24 void test_typedefed_wchar_t(unsigned short) // wchar_t is a typedef for unsigned short
25 {
26 BOOST_CHECK(boost::lexical_cast<int>(L'A') == 65);
27 BOOST_CHECK(boost::lexical_cast<int>(L'B') == 66);
28
29 BOOST_CHECK(boost::lexical_cast<wchar_t>(L"65") == 65);
30 BOOST_CHECK(boost::lexical_cast<wchar_t>(L"66") == 66);
31 }
32
33 template <class T>
34 void test_typedefed_wchar_t(T)
35 {
36 BOOST_CHECK(1);
37 }
38
39
40
41 void test_typedefed_wchar_t_runtime()
42 {
43 test_typedefed_wchar_t(L'0');
44 }
45
46 unit_test::test_suite *init_unit_test_suite(int, char *[])
47 {
48 unit_test::test_suite *suite =
49 BOOST_TEST_SUITE("lexical_cast typedefed wchar_t runtime test");
50 suite->add(BOOST_TEST_CASE(&test_typedefed_wchar_t_runtime));
51
52 return suite;
53 }