]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/classic/phoenix/test/primitives_tests.cpp
1 /*=============================================================================
3 Copyright (c) 2001-2003 Joel de Guzman
5 Use, modification and distribution is subject to the Boost Software
6 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 http://www.boost.org/LICENSE_1_0.txt)
8 ==============================================================================*/
10 #include <boost/detail/lightweight_test.hpp>
12 #define PHOENIX_LIMIT 15
13 #include <boost/spirit/include/phoenix1_primitives.hpp>
15 using namespace phoenix
;
18 ///////////////////////////////////////////////////////////////////////////////
23 int i1
= 1, i2
= 2, i
= 4;
26 ///////////////////////////////////////////////////////////////////////////////
28 // Values, variables and arguments
30 ///////////////////////////////////////////////////////////////////////////////
31 cout
<< val("Hello")() << val(' ')() << val("World")() << endl
;
33 BOOST_TEST(arg1(c1
) == c1
);
34 BOOST_TEST(arg1(i1
, i2
) == i1
);
35 BOOST_TEST(arg2(i1
, s2
) == s2
);
37 BOOST_TEST(val(3)() == 3);
38 BOOST_TEST(var(i
)() == 4);
39 BOOST_TEST(var(++i
)() == 5);
41 return boost::report_errors();