]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/classic/phoenix/test/mixed_binary_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 ==============================================================================*/
12 #define PHOENIX_LIMIT 15
13 #include <boost/spirit/include/phoenix1_primitives.hpp>
14 #include <boost/spirit/include/phoenix1_operators.hpp>
16 #include <boost/core/lightweight_test.hpp>
18 using namespace phoenix
;
21 ///////////////////////////////////////////////////////////////////////////////
25 int i1
= 1, i2
= 2, i50
= 50, i100
= 100;
27 string hello
= "hello";
28 const char* world
= " world";
30 ///////////////////////////////////////////////////////////////////////////////
32 // Mixed type operators
34 ///////////////////////////////////////////////////////////////////////////////
35 BOOST_TEST((arg1
+ arg2
)(i100
, i50
) == (i100
+ i50
));
36 BOOST_TEST((arg1
+ 3)(i100
) == (3 + i100
));
37 BOOST_TEST((arg1
+ arg2
)(hello
, world
) == "hello world");
38 BOOST_TEST((arg1
+ arg2
)(i1
, d2_5
) == (i1
+ d2_5
));
40 BOOST_TEST((*(arg1
+ arg2
))(world
, i2
) == *(world
+ i2
));
41 BOOST_TEST((*(arg1
+ arg2
))(i2
, world
) == *(i2
+ world
));
42 BOOST_TEST((*(val(world
+i2
) - arg1
))(i2
) == *world
);
44 ///////////////////////////////////////////////////////////////////////////////
48 ///////////////////////////////////////////////////////////////////////////////
50 return boost::report_errors();