Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74909 - trunk/libs/proto/test
From: eric_at_[hidden]
Date: 2011-10-11 01:24:48


Author: eric_niebler
Date: 2011-10-11 01:24:45 EDT (Tue, 11 Oct 2011)
New Revision: 74909
URL: http://svn.boost.org/trac/boost/changeset/74909

Log:
fix proto's tests broken by recent changes to boost.test
Text files modified:
   trunk/libs/proto/test/deduce_domain.cpp | 149 ++++++++++----------
   trunk/libs/proto/test/make_expr.cpp | 252 +++++++++++++++++-----------------
   trunk/libs/proto/test/matches.cpp | 283 ++++++++++++++++++++-------------------
   trunk/libs/proto/test/switch.cpp | 25 +-
   4 files changed, 355 insertions(+), 354 deletions(-)

Modified: trunk/libs/proto/test/deduce_domain.cpp
==============================================================================
--- trunk/libs/proto/test/deduce_domain.cpp (original)
+++ trunk/libs/proto/test/deduce_domain.cpp 2011-10-11 01:24:45 EDT (Tue, 11 Oct 2011)
@@ -13,41 +13,42 @@
 #include <boost/mpl/assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 
-using namespace boost::proto;
+namespace proto = boost::proto;
+using proto::_;
 
-struct D0 : domain<>
+struct D0 : proto::domain<>
 {
 };
 
-struct D1 : domain<default_generator, _, D0>
+struct D1 : proto::domain<proto::default_generator, _, D0>
 {
 };
 
-struct D2 : domain<default_generator, _, D0>
+struct D2 : proto::domain<proto::default_generator, _, D0>
 {
 };
 
-struct D3 : domain<>
+struct D3 : proto::domain<>
 {
 };
 
-struct DD0 : domain<default_generator, _, default_domain>
+struct DD0 : proto::domain<proto::default_generator, _, proto::default_domain>
 {
 };
 
-struct DD1 : domain<default_generator, _, default_domain>
+struct DD1 : proto::domain<proto::default_generator, _, proto::default_domain>
 {
 };
 
-struct DD2 : domain<default_generator, _, default_domain>
+struct DD2 : proto::domain<proto::default_generator, _, proto::default_domain>
 {
 };
 
-struct DD3 : domain<default_generator, _, DD2>
+struct DD3 : proto::domain<proto::default_generator, _, DD2>
 {
 };
 
-struct DD4 : domain<default_generator, _, DD2>
+struct DD4 : proto::domain<proto::default_generator, _, DD2>
 {
 };
 
@@ -56,74 +57,74 @@
     using boost::is_same;
 
     //*
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D0, D0, D0>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<default_domain, D0, D0>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D0, default_domain, D0>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D0, D0, default_domain>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D0, default_domain, default_domain>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<default_domain, D0, default_domain>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<default_domain, default_domain, D0>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<default_domain, default_domain, default_domain>::type, default_domain>));
-
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<DD0, D0, D0>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D0, DD0, D0>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D0, D0, DD0>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D0, DD0, DD0>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<DD0, D0, DD0>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<DD0, DD0, D0>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<default_domain, DD0, DD0>::type, DD0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<DD0, default_domain, DD0>::type, DD0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<DD0, DD0, default_domain>::type, DD0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<default_domain, default_domain, DD0>::type, DD0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<default_domain, DD0, default_domain>::type, DD0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<DD0, DD0, default_domain>::type, DD0>));
-
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D0, D0, D1>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D0, D1, D0>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D0, D1, D1>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D1, D0, D0>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D1, D0, D1>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D1, D1, D0>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D1, D1, D1>::type, D1>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D0, D0, D0>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<proto::default_domain, D0, D0>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D0, proto::default_domain, D0>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D0, D0, proto::default_domain>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D0, proto::default_domain, proto::default_domain>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<proto::default_domain, D0, proto::default_domain>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<proto::default_domain, proto::default_domain, D0>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<proto::default_domain, proto::default_domain, proto::default_domain>::type, proto::default_domain>));
+
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<DD0, D0, D0>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D0, DD0, D0>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D0, D0, DD0>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D0, DD0, DD0>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<DD0, D0, DD0>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<DD0, DD0, D0>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<proto::default_domain, DD0, DD0>::type, DD0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<DD0, proto::default_domain, DD0>::type, DD0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<DD0, DD0, proto::default_domain>::type, DD0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<proto::default_domain, proto::default_domain, DD0>::type, DD0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<proto::default_domain, DD0, proto::default_domain>::type, DD0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<DD0, DD0, proto::default_domain>::type, DD0>));
+
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D0, D0, D1>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D0, D1, D0>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D0, D1, D1>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D1, D0, D0>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D1, D0, D1>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D1, D1, D0>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D1, D1, D1>::type, D1>));
 
     // Very tricky to get right
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D2, D2, D1>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D2, D1, D2>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D2, D1, D1>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D1, D2, D2>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D1, D2, D1>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D1, D1, D2>::type, D0>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D1, D1, D1>::type, D1>));
-
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D3, D0, D0>::type, detail::not_a_domain>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D0, D3, D0>::type, detail::not_a_domain>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D0, D0, D3>::type, detail::not_a_domain>));
-
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D3, D1, D0>::type, detail::not_a_domain>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D3, D0, D1>::type, detail::not_a_domain>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D1, D3, D0>::type, detail::not_a_domain>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D0, D3, D1>::type, detail::not_a_domain>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D0, D1, D3>::type, detail::not_a_domain>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D1, D0, D3>::type, detail::not_a_domain>));
-
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D3, D1, D2>::type, detail::not_a_domain>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D3, D2, D1>::type, detail::not_a_domain>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D1, D3, D2>::type, detail::not_a_domain>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D2, D3, D1>::type, detail::not_a_domain>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D2, D1, D3>::type, detail::not_a_domain>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<D1, D2, D3>::type, detail::not_a_domain>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D2, D2, D1>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D2, D1, D2>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D2, D1, D1>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D1, D2, D2>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D1, D2, D1>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D1, D1, D2>::type, D0>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D1, D1, D1>::type, D1>));
+
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D3, D0, D0>::type, proto::detail::not_a_domain>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D0, D3, D0>::type, proto::detail::not_a_domain>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D0, D0, D3>::type, proto::detail::not_a_domain>));
+
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D3, D1, D0>::type, proto::detail::not_a_domain>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D3, D0, D1>::type, proto::detail::not_a_domain>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D1, D3, D0>::type, proto::detail::not_a_domain>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D0, D3, D1>::type, proto::detail::not_a_domain>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D0, D1, D3>::type, proto::detail::not_a_domain>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D1, D0, D3>::type, proto::detail::not_a_domain>));
+
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D3, D1, D2>::type, proto::detail::not_a_domain>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D3, D2, D1>::type, proto::detail::not_a_domain>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D1, D3, D2>::type, proto::detail::not_a_domain>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D2, D3, D1>::type, proto::detail::not_a_domain>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D2, D1, D3>::type, proto::detail::not_a_domain>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<D1, D2, D3>::type, proto::detail::not_a_domain>));
 
     // These should be ambiguous.
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<DD1, DD0, DD0>::type, detail::not_a_domain>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<DD0, DD1, DD0>::type, detail::not_a_domain>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<DD0, DD0, DD1>::type, detail::not_a_domain>));
-
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<DD3, DD2, DD2>::type, DD2>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<DD2, DD3, DD2>::type, DD2>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<DD2, DD2, DD3>::type, DD2>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<DD3, DD4, DD4>::type, DD2>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<DD4, DD3, DD4>::type, DD2>));
- BOOST_MPL_ASSERT((is_same<detail::common_domain3<DD4, DD4, DD3>::type, DD2>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<DD1, DD0, DD0>::type, proto::detail::not_a_domain>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<DD0, DD1, DD0>::type, proto::detail::not_a_domain>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<DD0, DD0, DD1>::type, proto::detail::not_a_domain>));
+
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<DD3, DD2, DD2>::type, DD2>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<DD2, DD3, DD2>::type, DD2>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<DD2, DD2, DD3>::type, DD2>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<DD3, DD4, DD4>::type, DD2>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<DD4, DD3, DD4>::type, DD2>));
+ BOOST_MPL_ASSERT((is_same<proto::detail::common_domain3<DD4, DD4, DD3>::type, DD2>));
     //*/
 }
 

Modified: trunk/libs/proto/test/make_expr.cpp
==============================================================================
--- trunk/libs/proto/test/make_expr.cpp (original)
+++ trunk/libs/proto/test/make_expr.cpp 2011-10-11 01:24:45 EDT (Tue, 11 Oct 2011)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
-// make_expr.hpp
+// proto::make_expr.hpp
 //
 // Copyright 2008 Eric Niebler. Distributed under the Boost
 // Software License, Version 1.0. (See accompanying file
@@ -12,282 +12,282 @@
 #include <boost/fusion/tuple.hpp>
 #include <boost/test/unit_test.hpp>
 
-using namespace boost;
-using namespace proto;
+namespace fusion = boost::fusion;
+namespace proto = boost::proto;
 
 template<typename E> struct ewrap;
 
 struct mydomain
- : domain<generator<ewrap> >
+ : proto::domain<proto::generator<ewrap> >
 {};
 
 template<typename E> struct ewrap
- : extends<E, ewrap<E>, mydomain>
+ : proto::extends<E, ewrap<E>, mydomain>
 {
     explicit ewrap(E const &e = E())
- : extends<E, ewrap<E>, mydomain>(e)
+ : proto::extends<E, ewrap<E>, mydomain>(e)
     {}
 };
 
 void test_make_expr()
 {
     int i = 42;
- terminal<int>::type t1 = make_expr<tag::terminal>(1);
- terminal<int>::type t2 = make_expr<tag::terminal>(i);
- unary_plus<terminal<int>::type>::type p1 = make_expr<tag::unary_plus>(1);
- unary_plus<terminal<int>::type>::type p2 = make_expr<tag::unary_plus>(i);
+ proto::terminal<int>::type t1 = proto::make_expr<proto::tag::terminal>(1);
+ proto::terminal<int>::type t2 = proto::make_expr<proto::tag::terminal>(i);
+ proto::unary_plus<proto::terminal<int>::type>::type p1 = proto::make_expr<proto::tag::unary_plus>(1);
+ proto::unary_plus<proto::terminal<int>::type>::type p2 = proto::make_expr<proto::tag::unary_plus>(i);
     BOOST_CHECK_EQUAL(proto::value(proto::child(p2)), 42);
 
     typedef
         ewrap<
             proto::basic_expr<
- tag::unary_plus
+ proto::tag::unary_plus
               , proto::list1<
- ewrap<proto::basic_expr<tag::terminal, proto::term<int> > >
+ ewrap<proto::basic_expr<proto::tag::terminal, proto::term<int> > >
>
>
>
     p3_type;
- p3_type p3 = make_expr<tag::unary_plus, mydomain>(i);
+ p3_type p3 = proto::make_expr<proto::tag::unary_plus, mydomain>(i);
     BOOST_CHECK_EQUAL(proto::value(proto::child(p3)), 42);
 
     typedef
         ewrap<
             proto::basic_expr<
- tag::plus
+ proto::tag::plus
               , proto::list2<
                     p3_type
- , ewrap<proto::basic_expr<tag::terminal, proto::term<int> > >
+ , ewrap<proto::basic_expr<proto::tag::terminal, proto::term<int> > >
>
>
>
     p4_type;
- p4_type p4 = make_expr<tag::plus>(p3, 0);
+ p4_type p4 = proto::make_expr<proto::tag::plus>(p3, 0);
     BOOST_CHECK_EQUAL(proto::value(proto::child(proto::left(p4))), 42);
 }
 
 void test_make_expr_ref()
 {
     int i = 42;
- terminal<int const &>::type t1 = make_expr<tag::terminal>(boost::cref(1)); // DANGEROUS
- terminal<int &>::type t2 = make_expr<tag::terminal>(boost::ref(i));
+ proto::terminal<int const &>::type t1 = proto::make_expr<proto::tag::terminal>(boost::cref(1)); // DANGEROUS
+ proto::terminal<int &>::type t2 = proto::make_expr<proto::tag::terminal>(boost::ref(i));
     BOOST_CHECK_EQUAL(&i, &proto::value(t2));
- unary_plus<terminal<int const &>::type>::type p1 = make_expr<tag::unary_plus>(boost::cref(1)); // DANGEROUS
- unary_plus<terminal<int &>::type>::type p2 = make_expr<tag::unary_plus>(boost::ref(i));
+ proto::unary_plus<proto::terminal<int const &>::type>::type p1 = proto::make_expr<proto::tag::unary_plus>(boost::cref(1)); // DANGEROUS
+ proto::unary_plus<proto::terminal<int &>::type>::type p2 = proto::make_expr<proto::tag::unary_plus>(boost::ref(i));
     BOOST_CHECK_EQUAL(proto::value(proto::child(p2)), 42);
 
     typedef
         ewrap<
             proto::basic_expr<
- tag::unary_plus
+ proto::tag::unary_plus
               , proto::list1<
- ewrap<proto::basic_expr<tag::terminal, proto::term<int &> > >
+ ewrap<proto::basic_expr<proto::tag::terminal, proto::term<int &> > >
>
>
>
     p3_type;
- p3_type p3 = make_expr<tag::unary_plus, mydomain>(boost::ref(i));
+ p3_type p3 = proto::make_expr<proto::tag::unary_plus, mydomain>(boost::ref(i));
     BOOST_CHECK_EQUAL(proto::value(proto::child(p3)), 42);
 
     typedef
         ewrap<
             proto::basic_expr<
- tag::plus
+ proto::tag::plus
               , proto::list2<
                     p3_type &
- , ewrap<proto::basic_expr<tag::terminal, proto::term<int> > >
+ , ewrap<proto::basic_expr<proto::tag::terminal, proto::term<int> > >
>
>
>
     p4_type;
- p4_type p4 = make_expr<tag::plus>(boost::ref(p3), 0);
+ p4_type p4 = proto::make_expr<proto::tag::plus>(boost::ref(p3), 0);
     BOOST_CHECK_EQUAL(proto::value(proto::child(proto::left(p4))), 42);
 }
 
 void test_make_expr_functional()
 {
     int i = 42;
- terminal<int>::type t1 = functional::make_expr<tag::terminal>()(1);
- terminal<int>::type t2 = functional::make_expr<tag::terminal>()(i);
- unary_plus<terminal<int>::type>::type p1 = functional::make_expr<tag::unary_plus>()(1);
- unary_plus<terminal<int>::type>::type p2 = functional::make_expr<tag::unary_plus>()(i);
+ proto::terminal<int>::type t1 = proto::functional::make_expr<proto::tag::terminal>()(1);
+ proto::terminal<int>::type t2 = proto::functional::make_expr<proto::tag::terminal>()(i);
+ proto::unary_plus<proto::terminal<int>::type>::type p1 = proto::functional::make_expr<proto::tag::unary_plus>()(1);
+ proto::unary_plus<proto::terminal<int>::type>::type p2 = proto::functional::make_expr<proto::tag::unary_plus>()(i);
     BOOST_CHECK_EQUAL(proto::value(proto::child(p2)), 42);
 
     typedef
         ewrap<
             proto::basic_expr<
- tag::unary_plus
+ proto::tag::unary_plus
               , proto::list1<
- ewrap<proto::basic_expr<tag::terminal, proto::term<int> > >
+ ewrap<proto::basic_expr<proto::tag::terminal, proto::term<int> > >
>
>
>
     p3_type;
- p3_type p3 = functional::make_expr<tag::unary_plus, mydomain>()(i);
+ p3_type p3 = proto::functional::make_expr<proto::tag::unary_plus, mydomain>()(i);
     BOOST_CHECK_EQUAL(proto::value(proto::child(p3)), 42);
 
     typedef
         ewrap<
             proto::basic_expr<
- tag::plus
+ proto::tag::plus
               , proto::list2<
                     p3_type
- , ewrap<proto::basic_expr<tag::terminal, proto::term<int> > >
+ , ewrap<proto::basic_expr<proto::tag::terminal, proto::term<int> > >
>
>
>
     p4_type;
- p4_type p4 = functional::make_expr<tag::plus>()(p3, 0);
+ p4_type p4 = proto::functional::make_expr<proto::tag::plus>()(p3, 0);
 }
 
 void test_make_expr_functional_ref()
 {
     int i = 42;
- terminal<int const &>::type t1 = functional::make_expr<tag::terminal>()(boost::cref(1)); // DANGEROUS
- terminal<int &>::type t2 = functional::make_expr<tag::terminal>()(boost::ref(i));
+ proto::terminal<int const &>::type t1 = proto::functional::make_expr<proto::tag::terminal>()(boost::cref(1)); // DANGEROUS
+ proto::terminal<int &>::type t2 = proto::functional::make_expr<proto::tag::terminal>()(boost::ref(i));
     BOOST_CHECK_EQUAL(&i, &proto::value(t2));
- unary_plus<terminal<int const &>::type>::type p1 = functional::make_expr<tag::unary_plus>()(boost::cref(1)); // DANGEROUS
- unary_plus<terminal<int &>::type>::type p2 = functional::make_expr<tag::unary_plus>()(boost::ref(i));
+ proto::unary_plus<proto::terminal<int const &>::type>::type p1 = proto::functional::make_expr<proto::tag::unary_plus>()(boost::cref(1)); // DANGEROUS
+ proto::unary_plus<proto::terminal<int &>::type>::type p2 = proto::functional::make_expr<proto::tag::unary_plus>()(boost::ref(i));
     BOOST_CHECK_EQUAL(proto::value(proto::child(p2)), 42);
 
     typedef
         ewrap<
             proto::basic_expr<
- tag::unary_plus
+ proto::tag::unary_plus
               , proto::list1<
- ewrap<proto::basic_expr<tag::terminal, proto::term<int &> > >
+ ewrap<proto::basic_expr<proto::tag::terminal, proto::term<int &> > >
>
>
>
     p3_type;
- p3_type p3 = functional::make_expr<tag::unary_plus, mydomain>()(boost::ref(i));
+ p3_type p3 = proto::functional::make_expr<proto::tag::unary_plus, mydomain>()(boost::ref(i));
     BOOST_CHECK_EQUAL(proto::value(proto::child(p3)), 42);
 
     typedef
         ewrap<
             proto::basic_expr<
- tag::plus
+ proto::tag::plus
               , proto::list2<
                     p3_type &
- , ewrap<proto::basic_expr<tag::terminal, proto::term<int> > >
+ , ewrap<proto::basic_expr<proto::tag::terminal, proto::term<int> > >
>
>
>
     p4_type;
- p4_type p4 = functional::make_expr<tag::plus>()(boost::ref(p3), 0);
+ p4_type p4 = proto::functional::make_expr<proto::tag::plus>()(boost::ref(p3), 0);
     BOOST_CHECK_EQUAL(proto::value(proto::child(proto::left(p4))), 42);
 }
 
 void test_unpack_expr()
 {
     int i = 42;
- terminal<int>::type t1 = unpack_expr<tag::terminal>(fusion::make_tuple(1));
- terminal<int &>::type t2 = unpack_expr<tag::terminal>(fusion::make_tuple(boost::ref(i)));
- unary_plus<terminal<int>::type>::type p1 = unpack_expr<tag::unary_plus>(fusion::make_tuple(1));
- unary_plus<terminal<int &>::type>::type p2 = unpack_expr<tag::unary_plus>(fusion::make_tuple(boost::ref(i)));
+ proto::terminal<int>::type t1 = proto::unpack_expr<proto::tag::terminal>(fusion::make_tuple(1));
+ proto::terminal<int &>::type t2 = proto::unpack_expr<proto::tag::terminal>(fusion::make_tuple(boost::ref(i)));
+ proto::unary_plus<proto::terminal<int>::type>::type p1 = proto::unpack_expr<proto::tag::unary_plus>(fusion::make_tuple(1));
+ proto::unary_plus<proto::terminal<int &>::type>::type p2 = proto::unpack_expr<proto::tag::unary_plus>(fusion::make_tuple(boost::ref(i)));
     BOOST_CHECK_EQUAL(proto::value(proto::child(p2)), 42);
 
     typedef
         ewrap<
             proto::basic_expr<
- tag::unary_plus
+ proto::tag::unary_plus
               , proto::list1<
- ewrap<proto::basic_expr<tag::terminal, proto::term<int &> > >
+ ewrap<proto::basic_expr<proto::tag::terminal, proto::term<int &> > >
>
>
>
     p3_type;
- p3_type p3 = unpack_expr<tag::unary_plus, mydomain>(fusion::make_tuple(boost::ref(i)));
+ p3_type p3 = proto::unpack_expr<proto::tag::unary_plus, mydomain>(fusion::make_tuple(boost::ref(i)));
     BOOST_CHECK_EQUAL(proto::value(proto::child(p3)), 42);
 
     typedef
         ewrap<
             proto::basic_expr<
- tag::plus
+ proto::tag::plus
               , proto::list2<
                     p3_type &
- , ewrap<proto::basic_expr<tag::terminal, proto::term<int> > >
+ , ewrap<proto::basic_expr<proto::tag::terminal, proto::term<int> > >
>
>
>
     p4_type;
- p4_type p4 = unpack_expr<tag::plus>(fusion::make_tuple(boost::ref(p3), 0));
+ p4_type p4 = proto::unpack_expr<proto::tag::plus>(fusion::make_tuple(boost::ref(p3), 0));
     BOOST_CHECK_EQUAL(proto::value(proto::child(proto::left(p4))), 42);
 }
 
 void test_unpack_expr_functional()
 {
     int i = 42;
- terminal<int>::type t1 = functional::unpack_expr<tag::terminal>()(fusion::make_tuple(1));
- terminal<int &>::type t2 = functional::unpack_expr<tag::terminal>()(fusion::make_tuple(boost::ref(i)));
- unary_plus<terminal<int>::type>::type p1 = functional::unpack_expr<tag::unary_plus>()(fusion::make_tuple(1));
- unary_plus<terminal<int &>::type>::type p2 = functional::unpack_expr<tag::unary_plus>()(fusion::make_tuple(boost::ref(i)));
+ proto::terminal<int>::type t1 = proto::functional::unpack_expr<proto::tag::terminal>()(fusion::make_tuple(1));
+ proto::terminal<int &>::type t2 = proto::functional::unpack_expr<proto::tag::terminal>()(fusion::make_tuple(boost::ref(i)));
+ proto::unary_plus<proto::terminal<int>::type>::type p1 = proto::functional::unpack_expr<proto::tag::unary_plus>()(fusion::make_tuple(1));
+ proto::unary_plus<proto::terminal<int &>::type>::type p2 = proto::functional::unpack_expr<proto::tag::unary_plus>()(fusion::make_tuple(boost::ref(i)));
     BOOST_CHECK_EQUAL(proto::value(proto::child(p2)), 42);
 
     typedef
         ewrap<
             proto::basic_expr<
- tag::unary_plus
+ proto::tag::unary_plus
               , proto::list1<
- ewrap<proto::basic_expr<tag::terminal, proto::term<int &> > >
+ ewrap<proto::basic_expr<proto::tag::terminal, proto::term<int &> > >
>
>
>
     p3_type;
- p3_type p3 = functional::unpack_expr<tag::unary_plus, mydomain>()(fusion::make_tuple(boost::ref(i)));
+ p3_type p3 = proto::functional::unpack_expr<proto::tag::unary_plus, mydomain>()(fusion::make_tuple(boost::ref(i)));
     BOOST_CHECK_EQUAL(proto::value(proto::child(p3)), 42);
 
     typedef
         ewrap<
             proto::basic_expr<
- tag::plus
+ proto::tag::plus
               , proto::list2<
                     p3_type &
- , ewrap<proto::basic_expr<tag::terminal, proto::term<int> > >
+ , ewrap<proto::basic_expr<proto::tag::terminal, proto::term<int> > >
>
>
>
     p4_type;
- p4_type p4 = functional::unpack_expr<tag::plus>()(fusion::make_tuple(boost::ref(p3), 0));
+ p4_type p4 = proto::functional::unpack_expr<proto::tag::plus>()(fusion::make_tuple(boost::ref(p3), 0));
     BOOST_CHECK_EQUAL(proto::value(proto::child(proto::left(p4))), 42);
 }
 
 #if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
-#define _byref(x) call<_byref(x)>
-#define _byval(x) call<_byval(x)>
-#define Minus(x) call<Minus(x)>
+#define _byref(x) call<proto::_byref(x)>
+#define _byval(x) call<proto::_byval(x)>
+#define Minus(x) proto::call<Minus(x)>
 #endif
 
 // Turn all terminals held by reference into ones held by value
 struct ByVal
- : or_<
- when<terminal<_>, _make_terminal(_byval(_value))>
- , when<nary_expr<_, vararg<ByVal> > >
+ : proto::or_<
+ proto::when<proto::terminal<proto::_>, proto::_make_terminal(proto::_byval(proto::_value))>
+ , proto::when<proto::nary_expr<proto::_, proto::vararg<ByVal> > >
>
 {};
 
 // Turn all terminals held by value into ones held by reference (not safe in general)
 struct ByRef
- : or_<
- when<terminal<_>, _make_terminal(_byref(_value))>
- , when<nary_expr<_, vararg<ByRef> > >
+ : proto::or_<
+ proto::when<proto::terminal<proto::_>, proto::_make_terminal(proto::_byref(proto::_value))>
+ , proto::when<proto::nary_expr<proto::_, proto::vararg<ByRef> > >
>
 {};
 
-// turn all plus nodes to minus nodes:
+// turn all proto::plus nodes to minus nodes:
 struct Minus
- : or_<
- when<terminal<_> >
- , when<plus<Minus, Minus>, _make_minus(Minus(_left), Minus(_right)) >
+ : proto::or_<
+ proto::when<proto::terminal<proto::_> >
+ , proto::when<proto::plus<Minus, Minus>, proto::_make_minus(Minus(proto::_left), Minus(proto::_right)) >
>
 {};
 
 struct Square
- : or_<
- // Not creating new terminal nodes here,
+ : proto::or_<
+ // Not creating new proto::terminal nodes here,
         // so hold the existing terminals by reference:
- when<terminal<_>, _make_multiplies(_, _)>
- , when<plus<Square, Square> >
+ proto::when<proto::terminal<proto::_>, proto::_make_multiplies(proto::_, proto::_)>
+ , proto::when<proto::plus<Square, Square> >
>
 {};
 
@@ -299,61 +299,61 @@
 
 void test_make_expr_transform()
 {
- plus<
- terminal<int>::type
- , terminal<int>::type
- >::type t1 = ByVal()(as_expr(1) + 1);
-
- plus<
- terminal<int const &>::type
- , terminal<int const &>::type
- >::type t2 = ByRef()(as_expr(1) + 1);
-
- minus<
- terminal<int>::type const &
- , terminal<int const &>::type const &
- >::type t3 = Minus()(as_expr(1) + 1);
-
- plus<
- multiplies<terminal<int>::type const &, terminal<int>::type const &>::type
- , multiplies<terminal<int const &>::type const &, terminal<int const &>::type const &>::type
- >::type t4 = Square()(as_expr(1) + 1);
+ proto::plus<
+ proto::terminal<int>::type
+ , proto::terminal<int>::type
+ >::type t1 = ByVal()(proto::as_expr(1) + 1);
+
+ proto::plus<
+ proto::terminal<int const &>::type
+ , proto::terminal<int const &>::type
+ >::type t2 = ByRef()(proto::as_expr(1) + 1);
+
+ proto::minus<
+ proto::terminal<int>::type const &
+ , proto::terminal<int const &>::type const &
+ >::type t3 = Minus()(proto::as_expr(1) + 1);
+
+ proto::plus<
+ proto::multiplies<proto::terminal<int>::type const &, proto::terminal<int>::type const &>::type
+ , proto::multiplies<proto::terminal<int const &>::type const &, proto::terminal<int const &>::type const &>::type
+ >::type t4 = Square()(proto::as_expr(1) + 1);
 }
 
 
 struct length_impl {};
 struct dot_impl {};
 
-terminal<length_impl>::type const length = {{}};
-terminal<dot_impl>::type const dot = {{}};
+proto::terminal<length_impl>::type const length = {{}};
+proto::terminal<dot_impl>::type const dot = {{}};
 
 // work around msvc bugs...
 #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
-#define _byref(a) call<_byref(a)>
-#define _byval(a) call<_byval(a)>
-#define _child1(a) call<_child1(a)>
-#define _make_terminal(a) call<_make_terminal(a)>
-#define _make_function(a,b,c) call<_make_function(a,b,c)>
-#define dot_impl() make<dot_impl()>
+#define _byref(a) call<proto::_byref(a)>
+#define _byval(a) call<proto::_byval(a)>
+#define _child1(a) call<proto::_child1(a)>
+#define _make_terminal(a) call<proto::_make_terminal(a)>
+#define _make_function(a,b,c) call<proto::_make_function(a,b,c)>
+#define dot_impl() proto::make<dot_impl()>
 #endif
 
 // convert length(a) < length(b) to dot(a,a) < dot(b,b)
 struct Convert
- : when<
- less<
- function<terminal<length_impl>, _>
- , function<terminal<length_impl>, _>
- >
- , _make_less(
- _make_function(
- _make_terminal(dot_impl())
- , _child1(_child0)
- , _child1(_child0)
+ : proto::when<
+ proto::less<
+ proto::function<proto::terminal<length_impl>, proto::_>
+ , proto::function<proto::terminal<length_impl>, proto::_>
+ >
+ , proto::_make_less(
+ proto::_make_function(
+ proto::_make_terminal(dot_impl())
+ , proto::_child1(proto::_child0)
+ , proto::_child1(proto::_child0)
             )
- , _make_function(
- _make_terminal(dot_impl())
- , _child1(_child1)
- , _child1(_child1)
+ , proto::_make_function(
+ proto::_make_terminal(dot_impl())
+ , proto::_child1(proto::_child1)
+ , proto::_child1(proto::_child1)
             )
         )
>
@@ -384,13 +384,13 @@
 #undef dot_impl
 #endif
 
-using namespace unit_test;
+using namespace boost::unit_test;
 ///////////////////////////////////////////////////////////////////////////////
 // init_unit_test_suite
 //
 test_suite* init_unit_test_suite( int argc, char* argv[] )
 {
- test_suite *test = BOOST_TEST_SUITE("test make_expr, unpack_expr and friends");
+ test_suite *test = BOOST_TEST_SUITE("test proto::make_expr, proto::unpack_expr and friends");
 
     test->add(BOOST_TEST_CASE(&test_make_expr));
     test->add(BOOST_TEST_CASE(&test_make_expr_ref));

Modified: trunk/libs/proto/test/matches.cpp
==============================================================================
--- trunk/libs/proto/test/matches.cpp (original)
+++ trunk/libs/proto/test/matches.cpp 2011-10-11 01:24:45 EDT (Tue, 11 Oct 2011)
@@ -17,8 +17,9 @@
 #include <boost/proto/transform/arg.hpp>
 #include <boost/test/unit_test.hpp>
 
-using namespace boost;
-using namespace proto;
+namespace mpl = boost::mpl;
+namespace proto = boost::proto;
+namespace fusion = boost::fusion;
 
 struct int_convertible
 {
@@ -27,26 +28,26 @@
 };
 
 struct Input
- : or_<
- shift_right< terminal< std::istream & >, _ >
- , shift_right< Input, _ >
+ : proto::or_<
+ proto::shift_right< proto::terminal< std::istream & >, proto::_ >
+ , proto::shift_right< Input, proto::_ >
>
 {};
 
 struct Output
- : or_<
- shift_left< terminal< std::ostream & >, _ >
- , shift_left< Output, _ >
+ : proto::or_<
+ proto::shift_left< proto::terminal< std::ostream & >, proto::_ >
+ , proto::shift_left< Output, proto::_ >
>
 {};
 
-terminal< std::istream & >::type const cin_ = {std::cin};
-terminal< std::ostream & >::type const cout_ = {std::cout};
+proto::terminal< std::istream & >::type const cin_ = {std::cin};
+proto::terminal< std::ostream & >::type const cout_ = {std::cout};
 
 struct Anything
- : or_<
- terminal<_>
- , nary_expr<_, vararg<Anything> >
+ : proto::or_<
+ proto::terminal<proto::_>
+ , proto::nary_expr<proto::_, proto::vararg<Anything> >
>
 {};
 
@@ -117,92 +118,92 @@
 
 void test_matches()
 {
- assert_matches< _ >( lit(1) );
- assert_matches< _ >( as_child(1) );
- assert_matches< _ >( as_expr(1) );
-
- assert_matches< terminal<int> >( lit(1) );
- assert_matches< terminal<int> >( as_child(1) );
- assert_matches< terminal<int> >( as_expr(1) );
-
- assert_matches_not< terminal<int> >( lit('a') );
- assert_matches_not< terminal<int> >( as_child('a') );
- assert_matches_not< terminal<int> >( as_expr('a') );
-
- assert_matches< terminal<convertible_to<int> > >( lit('a') );
- assert_matches< terminal<convertible_to<int> > >( as_child('a') );
- assert_matches< terminal<convertible_to<int> > >( as_expr('a') );
-
- assert_matches_not< terminal<int> >( lit((int_convertible())) );
- assert_matches_not< terminal<int> >( as_child((int_convertible())) );
- assert_matches_not< terminal<int> >( as_expr((int_convertible())) );
-
- assert_matches< terminal<convertible_to<int> > >( lit((int_convertible())) );
- assert_matches< terminal<convertible_to<int> > >( as_child((int_convertible())) );
- assert_matches< terminal<convertible_to<int> > >( as_expr((int_convertible())) );
-
- assert_matches< if_<is_same<_value, int>() > >( lit(1) );
- assert_matches_not< if_<is_same<_value, int>() > >( lit('a') );
-
- assert_matches<
- and_<
- terminal<_>
- , if_<is_same<_value, int>() >
+ proto::assert_matches< proto::_ >( proto::lit(1) );
+ proto::assert_matches< proto::_ >( proto::as_child(1) );
+ proto::assert_matches< proto::_ >( proto::as_expr(1) );
+
+ proto::assert_matches< proto::terminal<int> >( proto::lit(1) );
+ proto::assert_matches< proto::terminal<int> >( proto::as_child(1) );
+ proto::assert_matches< proto::terminal<int> >( proto::as_expr(1) );
+
+ proto::assert_matches_not< proto::terminal<int> >( proto::lit('a') );
+ proto::assert_matches_not< proto::terminal<int> >( proto::as_child('a') );
+ proto::assert_matches_not< proto::terminal<int> >( proto::as_expr('a') );
+
+ proto::assert_matches< proto::terminal<proto::convertible_to<int> > >( proto::lit('a') );
+ proto::assert_matches< proto::terminal<proto::convertible_to<int> > >( proto::as_child('a') );
+ proto::assert_matches< proto::terminal<proto::convertible_to<int> > >( proto::as_expr('a') );
+
+ proto::assert_matches_not< proto::terminal<int> >( proto::lit((int_convertible())) );
+ proto::assert_matches_not< proto::terminal<int> >( proto::as_child((int_convertible())) );
+ proto::assert_matches_not< proto::terminal<int> >( proto::as_expr((int_convertible())) );
+
+ proto::assert_matches< proto::terminal<proto::convertible_to<int> > >( proto::lit((int_convertible())) );
+ proto::assert_matches< proto::terminal<proto::convertible_to<int> > >( proto::as_child((int_convertible())) );
+ proto::assert_matches< proto::terminal<proto::convertible_to<int> > >( proto::as_expr((int_convertible())) );
+
+ proto::assert_matches< proto::if_<boost::is_same<proto::_value, int>() > >( proto::lit(1) );
+ proto::assert_matches_not< proto::if_<boost::is_same<proto::_value, int>() > >( proto::lit('a') );
+
+ proto::assert_matches<
+ proto::and_<
+ proto::terminal<proto::_>
+ , proto::if_<boost::is_same<proto::_value, int>() >
>
- >( lit(1) );
+ >( proto::lit(1) );
 
- assert_matches_not<
- and_<
- terminal<_>
- , if_<is_same<_value, int>() >
+ proto::assert_matches_not<
+ proto::and_<
+ proto::terminal<proto::_>
+ , proto::if_<boost::is_same<proto::_value, int>() >
>
- >( lit('a') );
+ >( proto::lit('a') );
 
- assert_matches< terminal<char const *> >( lit("hello") );
- assert_matches< terminal<char const *> >( as_child("hello") );
- assert_matches< terminal<char const *> >( as_expr("hello") );
+ proto::assert_matches< proto::terminal<char const *> >( proto::lit("hello") );
+ proto::assert_matches< proto::terminal<char const *> >( proto::as_child("hello") );
+ proto::assert_matches< proto::terminal<char const *> >( proto::as_expr("hello") );
 
- assert_matches< terminal<char const[6]> >( lit("hello") );
- assert_matches< terminal<char const (&)[6]> >( as_child("hello") );
- assert_matches< terminal<char const[6]> >( as_expr("hello") );
+ proto::assert_matches< proto::terminal<char const[6]> >( proto::lit("hello") );
+ proto::assert_matches< proto::terminal<char const (&)[6]> >( proto::as_child("hello") );
+ proto::assert_matches< proto::terminal<char const[6]> >( proto::as_expr("hello") );
 
- assert_matches< terminal<char [6]> >( lit("hello") );
- assert_matches< terminal<char [6]> >( as_child("hello") );
- assert_matches< terminal<char [6]> >( as_expr("hello") );
+ proto::assert_matches< proto::terminal<char [6]> >( proto::lit("hello") );
+ proto::assert_matches< proto::terminal<char [6]> >( proto::as_child("hello") );
+ proto::assert_matches< proto::terminal<char [6]> >( proto::as_expr("hello") );
 
- assert_matches< terminal<char const[N]> >( lit("hello") );
- assert_matches< terminal<char const (&)[N]> >( as_child("hello") );
- assert_matches< terminal<char const[N]> >( as_expr("hello") );
+ proto::assert_matches< proto::terminal<char const[proto::N]> >( proto::lit("hello") );
+ proto::assert_matches< proto::terminal<char const (&)[proto::N]> >( proto::as_child("hello") );
+ proto::assert_matches< proto::terminal<char const[proto::N]> >( proto::as_expr("hello") );
 
- assert_matches< terminal<char [N]> >( lit("hello") );
- assert_matches< terminal<char [N]> >( as_child("hello") );
- assert_matches< terminal<char [N]> >( as_expr("hello") );
+ proto::assert_matches< proto::terminal<char [proto::N]> >( proto::lit("hello") );
+ proto::assert_matches< proto::terminal<char [proto::N]> >( proto::as_child("hello") );
+ proto::assert_matches< proto::terminal<char [proto::N]> >( proto::as_expr("hello") );
 
- assert_matches< terminal<wchar_t const[N]> >( lit(L"hello") );
- assert_matches< terminal<wchar_t const (&)[N]> >( as_child(L"hello") );
- assert_matches< terminal<wchar_t const[N]> >( as_expr(L"hello") );
+ proto::assert_matches< proto::terminal<wchar_t const[proto::N]> >( proto::lit(L"hello") );
+ proto::assert_matches< proto::terminal<wchar_t const (&)[proto::N]> >( proto::as_child(L"hello") );
+ proto::assert_matches< proto::terminal<wchar_t const[proto::N]> >( proto::as_expr(L"hello") );
 
- assert_matches< terminal<wchar_t [N]> >( lit(L"hello") );
- assert_matches< terminal<wchar_t [N]> >( as_child(L"hello") );
- assert_matches< terminal<wchar_t [N]> >( as_expr(L"hello") );
+ proto::assert_matches< proto::terminal<wchar_t [proto::N]> >( proto::lit(L"hello") );
+ proto::assert_matches< proto::terminal<wchar_t [proto::N]> >( proto::as_child(L"hello") );
+ proto::assert_matches< proto::terminal<wchar_t [proto::N]> >( proto::as_expr(L"hello") );
 
- assert_matches_not< if_<is_same<_value, int>()> >( lit("hello") );
+ proto::assert_matches_not< proto::if_<boost::is_same<proto::_value, int>()> >( proto::lit("hello") );
 
- assert_matches< terminal<std::string> >( lit(std::string("hello")) );
- assert_matches< terminal<std::string> >( as_child(std::string("hello")) );
- assert_matches< terminal<std::string> >( as_expr(std::string("hello")) );
+ proto::assert_matches< proto::terminal<std::string> >( proto::lit(std::string("hello")) );
+ proto::assert_matches< proto::terminal<std::string> >( proto::as_child(std::string("hello")) );
+ proto::assert_matches< proto::terminal<std::string> >( proto::as_expr(std::string("hello")) );
 
- assert_matches< terminal<std::basic_string<_> > >( lit(std::string("hello")) );
- assert_matches< terminal<std::basic_string<_> > >( as_child(std::string("hello")) );
- assert_matches< terminal<std::basic_string<_> > >( as_expr(std::string("hello")) );
+ proto::assert_matches< proto::terminal<std::basic_string<proto::_> > >( proto::lit(std::string("hello")) );
+ proto::assert_matches< proto::terminal<std::basic_string<proto::_> > >( proto::as_child(std::string("hello")) );
+ proto::assert_matches< proto::terminal<std::basic_string<proto::_> > >( proto::as_expr(std::string("hello")) );
 
- assert_matches_not< terminal<std::basic_string<_> > >( lit(1) );
- assert_matches_not< terminal<std::basic_string<_> > >( as_child(1) );
- assert_matches_not< terminal<std::basic_string<_> > >( as_expr(1) );
+ proto::assert_matches_not< proto::terminal<std::basic_string<proto::_> > >( proto::lit(1) );
+ proto::assert_matches_not< proto::terminal<std::basic_string<proto::_> > >( proto::as_child(1) );
+ proto::assert_matches_not< proto::terminal<std::basic_string<proto::_> > >( proto::as_expr(1) );
 
- assert_matches_not< terminal<std::basic_string<_,_,_> > >( lit(1) );
- assert_matches_not< terminal<std::basic_string<_,_,_> > >( as_child(1) );
- assert_matches_not< terminal<std::basic_string<_,_,_> > >( as_expr(1) );
+ proto::assert_matches_not< proto::terminal<std::basic_string<proto::_,proto::_,proto::_> > >( proto::lit(1) );
+ proto::assert_matches_not< proto::terminal<std::basic_string<proto::_,proto::_,proto::_> > >( proto::as_child(1) );
+ proto::assert_matches_not< proto::terminal<std::basic_string<proto::_,proto::_,proto::_> > >( proto::as_expr(1) );
 
     #if BOOST_WORKAROUND(__HP_aCC, BOOST_TESTED_AT(61700))
     typedef std::string const const_string;
@@ -210,100 +211,100 @@
     typedef std::string const_string;
     #endif
     
- assert_matches< terminal<std::basic_string<_> const & > >( lit(const_string("hello")) );
- assert_matches< terminal<std::basic_string<_> const & > >( as_child(const_string("hello")) );
- assert_matches_not< terminal<std::basic_string<_> const & > >( as_expr(const_string("hello")) );
-
- assert_matches< terminal< void(&)() > >( lit(a_function) );
- assert_matches< terminal< void(&)() > >( as_child(a_function) );
- assert_matches< terminal< void(&)() > >( as_expr(a_function) );
-
- assert_matches_not< terminal< void(*)() > >( lit(a_function) );
- assert_matches_not< terminal< void(*)() > >( as_child(a_function) );
- assert_matches_not< terminal< void(*)() > >( as_expr(a_function) );
-
- assert_matches< terminal< convertible_to<void(*)()> > >( lit(a_function) );
- assert_matches< terminal< convertible_to<void(*)()> > >( as_child(a_function) );
- assert_matches< terminal< convertible_to<void(*)()> > >( as_expr(a_function) );
-
- assert_matches< terminal< void(*)() > >( lit(&a_function) );
- assert_matches< terminal< void(*)() > >( as_child(&a_function) );
- assert_matches< terminal< void(*)() > >( as_expr(&a_function) );
-
- assert_matches< terminal< void(* const &)() > >( lit(&a_function) );
- assert_matches< terminal< void(* const &)() > >( as_child(&a_function) );
- assert_matches_not< terminal< void(* const &)() > >( as_expr(&a_function) );
-
- assert_matches<
- or_<
- if_<is_same<_value, char>() >
- , if_<is_same<_value, int>() >
+ proto::assert_matches< proto::terminal<std::basic_string<proto::_> const & > >( proto::lit(const_string("hello")) );
+ proto::assert_matches< proto::terminal<std::basic_string<proto::_> const & > >( proto::as_child(const_string("hello")) );
+ proto::assert_matches_not< proto::terminal<std::basic_string<proto::_> const & > >( proto::as_expr(const_string("hello")) );
+
+ proto::assert_matches< proto::terminal< void(&)() > >( proto::lit(a_function) );
+ proto::assert_matches< proto::terminal< void(&)() > >( proto::as_child(a_function) );
+ proto::assert_matches< proto::terminal< void(&)() > >( proto::as_expr(a_function) );
+
+ proto::assert_matches_not< proto::terminal< void(*)() > >( proto::lit(a_function) );
+ proto::assert_matches_not< proto::terminal< void(*)() > >( proto::as_child(a_function) );
+ proto::assert_matches_not< proto::terminal< void(*)() > >( proto::as_expr(a_function) );
+
+ proto::assert_matches< proto::terminal< proto::convertible_to<void(*)()> > >( proto::lit(a_function) );
+ proto::assert_matches< proto::terminal< proto::convertible_to<void(*)()> > >( proto::as_child(a_function) );
+ proto::assert_matches< proto::terminal< proto::convertible_to<void(*)()> > >( proto::as_expr(a_function) );
+
+ proto::assert_matches< proto::terminal< void(*)() > >( proto::lit(&a_function) );
+ proto::assert_matches< proto::terminal< void(*)() > >( proto::as_child(&a_function) );
+ proto::assert_matches< proto::terminal< void(*)() > >( proto::as_expr(&a_function) );
+
+ proto::assert_matches< proto::terminal< void(* const &)() > >( proto::lit(&a_function) );
+ proto::assert_matches< proto::terminal< void(* const &)() > >( proto::as_child(&a_function) );
+ proto::assert_matches_not< proto::terminal< void(* const &)() > >( proto::as_expr(&a_function) );
+
+ proto::assert_matches<
+ proto::or_<
+ proto::if_<boost::is_same<proto::_value, char>() >
+ , proto::if_<boost::is_same<proto::_value, int>() >
>
- >( lit(1) );
+ >( proto::lit(1) );
 
- assert_matches_not<
- or_<
- if_<is_same<_value, char>() >
- , if_<is_same<_value, int>() >
+ proto::assert_matches_not<
+ proto::or_<
+ proto::if_<boost::is_same<proto::_value, char>() >
+ , proto::if_<boost::is_same<proto::_value, int>() >
>
- >( lit(1u) );
+ >( proto::lit(1u) );
 
- assert_matches< Input >( cin_ >> 1 >> 2 >> 3 );
- assert_matches_not< Output >( cin_ >> 1 >> 2 >> 3 );
+ proto::assert_matches< Input >( cin_ >> 1 >> 2 >> 3 );
+ proto::assert_matches_not< Output >( cin_ >> 1 >> 2 >> 3 );
 
- assert_matches< Output >( cout_ << 1 << 2 << 3 );
- assert_matches_not< Input >( cout_ << 1 << 2 << 3 );
+ proto::assert_matches< Output >( cout_ << 1 << 2 << 3 );
+ proto::assert_matches_not< Input >( cout_ << 1 << 2 << 3 );
 
- assert_matches< function< terminal<int>, vararg< terminal<char> > > >( lit(1)('a','b','c','d') );
- assert_matches_not< function< terminal<int>, vararg< terminal<char> > > >( lit(1)('a','b','c',"d") );
+ proto::assert_matches< proto::function< proto::terminal<int>, proto::vararg< proto::terminal<char> > > >( proto::lit(1)('a','b','c','d') );
+ proto::assert_matches_not< proto::function< proto::terminal<int>, proto::vararg< proto::terminal<char> > > >( proto::lit(1)('a','b','c',"d") );
 
- assert_matches< Anything >( cout_ << 1 << +lit('a') << lit(1)('a','b','c',"d") );
+ proto::assert_matches< Anything >( cout_ << 1 << +proto::lit('a') << proto::lit(1)('a','b','c',"d") );
 
- assert_matches< proto::switch_<MyCases> >( lit(1) >> 'a' );
- assert_matches< proto::switch_<MyCases> >( lit(1) + 'a' );
- assert_matches_not< proto::switch_<MyCases> >( lit(1) << 'a' );
+ proto::assert_matches< proto::switch_<MyCases> >( proto::lit(1) >> 'a' );
+ proto::assert_matches< proto::switch_<MyCases> >( proto::lit(1) + 'a' );
+ proto::assert_matches_not< proto::switch_<MyCases> >( proto::lit(1) << 'a' );
 
     number<int, two_complement_c> num;
- assert_matches<NumberGrammar>(proto::as_expr(num));
+ proto::assert_matches<NumberGrammar>(proto::as_expr(num));
 
     // check custom terminal types
     {
         proto::nullary_expr<my_terminal, int>::type i = {0};
 
- assert_matches<proto::nullary_expr<my_terminal, _> >( i );
- assert_matches_not<proto::terminal<_> >( i );
+ proto::assert_matches<proto::nullary_expr<my_terminal, proto::_> >( i );
+ proto::assert_matches_not<proto::terminal<proto::_> >( i );
 
         proto::terminal<int>::type j = {0};
- assert_matches<proto::terminal<_> >( j );
- assert_matches_not<proto::nullary_expr<my_terminal, _> >( j );
+ proto::assert_matches<proto::terminal<proto::_> >( j );
+ proto::assert_matches_not<proto::nullary_expr<my_terminal, proto::_> >( j );
 
- assert_matches<proto::nullary_expr<_, _> >( i );
+ proto::assert_matches<proto::nullary_expr<proto::_, proto::_> >( i );
     }
 
     // check 0 and 1 arg forms or or_ and and_
     {
- assert_matches< proto::and_<> >( lit(1) );
- assert_matches_not< proto::or_<> >( lit(1) );
+ proto::assert_matches< proto::and_<> >( proto::lit(1) );
+ proto::assert_matches_not< proto::or_<> >( proto::lit(1) );
 
- assert_matches< proto::and_<proto::terminal<int> > >( lit(1) );
- assert_matches< proto::or_<proto::terminal<int> > >( lit(1) );
+ proto::assert_matches< proto::and_<proto::terminal<int> > >( proto::lit(1) );
+ proto::assert_matches< proto::or_<proto::terminal<int> > >( proto::lit(1) );
     }
 
     // Test lambda matches with arrays, a corner case that had
     // a bug that was reported by Antoine de Maricourt on boost_at_[hidden]
     {
         a_template<int[3]> a;
- assert_matches< proto::terminal< a_template<_> > >( lit(a) );
+ proto::assert_matches< proto::terminal< a_template<proto::_> > >( proto::lit(a) );
     }
 
     // Test that the actual derived expression type makes it through to proto::if_
     {
         my_expr<proto::terminal<int>::type> e = {{1}};
- assert_matches< proto::if_<boost::is_same<domain_of<_>, my_domain>()> >( e );
+ proto::assert_matches< proto::if_<boost::is_same<proto::domain_of<proto::_>, my_domain>()> >( e );
     }
 }
 
-using namespace unit_test;
+using namespace boost::unit_test;
 ///////////////////////////////////////////////////////////////////////////////
 // init_unit_test_suite
 //

Modified: trunk/libs/proto/test/switch.cpp
==============================================================================
--- trunk/libs/proto/test/switch.cpp (original)
+++ trunk/libs/proto/test/switch.cpp 2011-10-11 01:24:45 EDT (Tue, 11 Oct 2011)
@@ -15,8 +15,7 @@
 #include <boost/mpl/long.hpp>
 #include <boost/mpl/bool.hpp>
 
-using namespace boost;
-using namespace proto;
+namespace proto = boost::proto;
 
 struct MyCases
 {
@@ -41,7 +40,7 @@
 struct ArityOfCases
 {
     template<typename ArityOf>
- struct case_
+ struct case_
       : proto::not_<proto::_>
     {};
 };
@@ -49,7 +48,7 @@
 
 template<>
 struct ArityOfCases::case_<boost::mpl::long_<1> >
-: boost::proto::when<boost::proto::_, boost::mpl::false_()>
+ : boost::proto::when<boost::proto::_, boost::mpl::false_()>
 {};
 
 template<>
@@ -67,21 +66,21 @@
 void test_switch()
 {
     // Tests for backward compatibility
- assert_matches<proto::switch_<MyCases> >(lit(1) >> 'a');
- assert_matches<proto::switch_<MyCases> >(lit(1) + 'a');
- assert_matches_not<proto::switch_<MyCases> >(lit(1) << 'a');
+ proto::assert_matches<proto::switch_<MyCases> >(proto::lit(1) >> 'a');
+ proto::assert_matches<proto::switch_<MyCases> >(proto::lit(1) + 'a');
+ proto::assert_matches_not<proto::switch_<MyCases> >(proto::lit(1) << 'a');
 
     //Test new matching on the Transform result type
     ArityOf ar;
 
- assert_matches_not<ArityOf>(lit(1));
- assert_matches<ArityOf>(lit(1) + 2);
- assert_matches<ArityOf>(!lit(1));
- BOOST_CHECK_EQUAL(ar(!lit(1)), false);
- BOOST_CHECK_EQUAL(ar(lit(1) + 2), true);
+ proto::assert_matches_not<ArityOf>(proto::lit(1));
+ proto::assert_matches<ArityOf>(proto::lit(1) + 2);
+ proto::assert_matches<ArityOf>(!proto::lit(1));
+ BOOST_CHECK_EQUAL(ar(!proto::lit(1)), false);
+ BOOST_CHECK_EQUAL(ar(proto::lit(1) + 2), true);
 }
 
-using namespace unit_test;
+using namespace boost::unit_test;
 ///////////////////////////////////////////////////////////////////////////////
 // init_unit_test_suite
 //


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