]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/classic/phoenix/test/iostream_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 ==============================================================================*/
13 #include <boost/detail/lightweight_test.hpp>
15 #include <boost/config.hpp>
16 #ifdef BOOST_NO_STRINGSTREAM
18 #define SSTREAM strstream
19 std::string
GETSTRING(std::strstream
& ss
)
22 std::string rval
= ss
.str();
28 #define GETSTRING(ss) ss.str()
29 #define SSTREAM stringstream
32 //#define PHOENIX_LIMIT 15
33 #include <boost/spirit/include/phoenix1_primitives.hpp>
34 #include <boost/spirit/include/phoenix1_composite.hpp>
35 #include <boost/spirit/include/phoenix1_operators.hpp>
36 #include <boost/spirit/include/phoenix1_special_ops.hpp>
38 using namespace phoenix
;
41 ///////////////////////////////////////////////////////////////////////////////
46 string hello
= "hello";
47 const char* world
= " world";
49 ///////////////////////////////////////////////////////////////////////////////
53 ///////////////////////////////////////////////////////////////////////////////
61 char const* msg
= "cout assert\n";
63 (cout
<< val(hello
) << world
<< ", you da man!\n")();
64 for_each(v
.begin(), v
.end(), cout
<< arg1
<< ',');
67 #ifdef __BORLANDC__ // *** See special_ops.hpp why ***
68 (cout
<< arg1
<< "this is it, shukz:" << hex_
<< arg2
<< endl_
<< endl_
)(msg
, i100
);
70 (cout
<< arg1
<< "this is it, shukz:" << hex
<< arg2
<< endl
<< endl
)(msg
, i100
);
77 BOOST_TEST(in
== out
);
79 ///////////////////////////////////////////////////////////////////////////////
83 ///////////////////////////////////////////////////////////////////////////////
85 return boost::report_errors();