Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66919 - trunk/libs/spirit/test/support
From: hartmut.kaiser_at_[hidden]
Date: 2010-11-30 15:36:10


Author: hkaiser
Date: 2010-11-30 15:36:09 EST (Tue, 30 Nov 2010)
New Revision: 66919
URL: http://svn.boost.org/trac/boost/changeset/66919

Log:
Spirit: test fixes...
Text files modified:
   trunk/libs/spirit/test/support/utree_test.cpp | 23 ++++++++++++++++++++---
   1 files changed, 20 insertions(+), 3 deletions(-)

Modified: trunk/libs/spirit/test/support/utree_test.cpp
==============================================================================
--- trunk/libs/spirit/test/support/utree_test.cpp (original)
+++ trunk/libs/spirit/test/support/utree_test.cpp 2010-11-30 15:36:09 EST (Tue, 30 Nov 2010)
@@ -15,17 +15,25 @@
 #include <sstream>
 #include <cstdlib>
 
-using boost::spirit::utree;
-
-inline bool check(utree const& val, std::string expected)
+inline bool check(boost::spirit::utree const& val, std::string expected)
 {
     std::stringstream s;
     s << val;
     return (s.str() == expected + " ") ? true : false;
 }
 
+struct one_two_three
+{
+ boost::spirit::utree operator()(boost::spirit::scope) const
+ {
+ return boost::spirit::utree(123);
+ }
+};
+
 int main()
 {
+ using boost::spirit::utree;
+
     {
         // test the size
         std::cout << "size of utree is: "
@@ -279,6 +287,15 @@
     }
 
     {
+ // test functions
+ using boost::spirit::stored_function;
+ using boost::spirit::scope;
+
+ utree f = stored_function<one_two_three>();
+ f.eval(scope());
+ }
+
+ {
         // shallow ranges
         using boost::spirit::shallow;
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk