]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/classic/test/actor/assign_test.cpp
1 /*=============================================================================
2 Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com)
3 http://spirit.sourceforge.net/
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 ///////////////////////////////////////////////////////////////////////////////
11 // Test suite for assign_actor
12 ///////////////////////////////////////////////////////////////////////////////
14 #include "action_tests.hpp"
15 #include <boost/spirit/include/classic_core.hpp>
16 #include <boost/spirit/include/classic_assign_actor.hpp>
20 using namespace BOOST_SPIRIT_CLASSIC_NS
;
22 const char* cp
= "63";
23 const char* cp_first
= cp
;
24 const char* cp_last
= cp
+ test_impl::string_length(cp
);
28 scanner
<char const*> scan( cp_first
, cp_last
);
31 hit
= int_p
[ assign_a(hm
)].parse(scan
);
33 BOOST_CHECK_EQUAL(scan
.first
, scan
.last
);
36 BOOST_CHECK_EQUAL( hm
,h
);
39 void assign_test_ref()
41 using namespace BOOST_SPIRIT_CLASSIC_NS
;
44 const char* cp
= "63";
45 const char* cp_first
= cp
;
46 const char* cp_last
= cp
+ test_impl::string_length(cp
);
50 scanner
<char const*> scan( cp_first
, cp_last
);
53 hit
= int_p
[ assign_a(h
,hm
)].parse(scan
);
55 BOOST_CHECK_EQUAL(scan
.first
, scan
.last
);
57 BOOST_CHECK_EQUAL( hm
,h
);
60 void assign_action_test()