Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51380 - in trunk/libs/fusion/test: . functional
From: tschwinger_at_[hidden]
Date: 2009-02-22 01:24:39


Author: t_schwinger
Date: 2009-02-22 01:24:38 EST (Sun, 22 Feb 2009)
New Revision: 51380
URL: http://svn.boost.org/trac/boost/changeset/51380

Log:
updates functional module: only two unfused variants, now

Added:
   trunk/libs/fusion/test/functional/make_unfused.cpp (contents, props changed)
Removed:
   trunk/libs/fusion/test/functional/make_unfused_generic.cpp
   trunk/libs/fusion/test/functional/make_unfused_lvalue_args.cpp
   trunk/libs/fusion/test/functional/make_unfused_rvalue_args.cpp
   trunk/libs/fusion/test/functional/unfused_generic.cpp
   trunk/libs/fusion/test/functional/unfused_lvalue_args.cpp
   trunk/libs/fusion/test/functional/unfused_rvalue_args.cpp
Text files modified:
   trunk/libs/fusion/test/Jamfile | 8 ++------
   1 files changed, 2 insertions(+), 6 deletions(-)

Modified: trunk/libs/fusion/test/Jamfile
==============================================================================
--- trunk/libs/fusion/test/Jamfile (original)
+++ trunk/libs/fusion/test/Jamfile 2009-02-22 01:24:38 EST (Sun, 22 Feb 2009)
@@ -112,16 +112,12 @@
     [ run functional/fused.cpp : : : : ]
     [ run functional/fused_function_object.cpp : : : : ]
     [ run functional/fused_procedure.cpp : : : : ]
- [ run functional/unfused_generic.cpp : : : : ]
- [ run functional/unfused_lvalue_args.cpp : : : : ]
- [ run functional/unfused_rvalue_args.cpp : : : : ]
+ [ run functional/unfused.cpp : : : : ]
     [ run functional/unfused_typed.cpp : : : : ]
     [ run functional/make_fused.cpp : : : : ]
     [ run functional/make_fused_function_object.cpp : : : : ]
     [ run functional/make_fused_procedure.cpp : : : : ]
- [ run functional/make_unfused_generic.cpp : : : : ]
- [ run functional/make_unfused_lvalue_args.cpp : : : : ]
- [ run functional/make_unfused_rvalue_args.cpp : : : : ]
+ [ run functional/make_unfused.cpp : : : : ]
     [ run functional/invoke.cpp : : : : ]
     [ run functional/invoke_function_object.cpp : : : : ]
     [ run functional/invoke_procedure.cpp : : : : ]

Added: trunk/libs/fusion/test/functional/make_unfused.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/fusion/test/functional/make_unfused.cpp 2009-02-22 01:24:38 EST (Sun, 22 Feb 2009)
@@ -0,0 +1,126 @@
+/*=============================================================================
+ Copyright (c) 2006-2007 Tobias Schwinger
+
+ Use modification and distribution are subject to the Boost Software
+ License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt).
+==============================================================================*/
+
+#include <boost/fusion/functional/generation/make_unfused.hpp>
+#include <boost/detail/lightweight_test.hpp>
+
+#include <boost/noncopyable.hpp>
+#include <boost/blank.hpp>
+
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/and.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/identity.hpp>
+
+#include <boost/utility/result_of.hpp>
+
+#include <boost/fusion/sequence/intrinsic/empty.hpp>
+#include <boost/fusion/algorithm/iteration/fold.hpp>
+
+#include <boost/ref.hpp>
+
+namespace fusion = boost::fusion;
+namespace mpl = boost::mpl;
+
+using boost::noncopyable;
+typedef mpl::true_ no_nullary_call;
+
+using boost::ref;
+using boost::cref;
+
+template <class Base = boost::blank, class RemoveNullary = mpl::false_>
+struct test_func
+ : Base
+{
+ template <typename Sig>
+ struct result;
+
+ template <class Self, class Seq>
+ struct result< Self(Seq &) >
+ : mpl::if_< mpl::and_< fusion::result_of::empty<Seq>, RemoveNullary >,
+ boost::blank, mpl::identity<long> >::type
+ { };
+
+ template <typename Seq>
+ long operator()(Seq const & seq) const
+ {
+ long state = 0;
+ return fusion::fold(seq, state, fold_op());
+ }
+
+ template < typename Seq >
+ long operator()(Seq const & seq)
+ {
+ long state = 100;
+ return fusion::fold(seq, state, fold_op());
+ }
+
+ private:
+
+ struct fold_op
+ {
+ typedef long result_type;
+
+ template <typename T>
+ long operator()(T & elem, long value) const
+ {
+ elem += sizeof(T);
+ return value + elem;
+ }
+ };
+};
+
+template <typename T>
+inline T const & const_(T const & t)
+{
+ return t;
+}
+
+int main()
+{
+ test_func<> f;
+ test_func<noncopyable> f_nc;
+
+ fusion::result_of::make_unfused< test_func<> >::type unfused_func =
+ fusion::make_unfused(f);
+
+ fusion::result_of::make_unfused< boost::reference_wrapper<
+ test_func<noncopyable> > >::type unfused_func_ref =
+ fusion::make_unfused(ref(f_nc));
+
+ fusion::result_of::make_unfused< boost::reference_wrapper<
+ test_func<noncopyable> const> >::type unfused_func_c_ref =
+ fusion::make_unfused(cref(f_nc));
+
+ BOOST_TEST(unfused_func() == 100);
+ BOOST_TEST(const_(unfused_func)() == 0);
+ BOOST_TEST(unfused_func_ref() == 100);
+ BOOST_TEST(unfused_func_c_ref() == 0);
+
+ long lv1 = 2; int lv2 = 3l; char lv3 = '\007';
+ long expected;
+
+ expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3);
+ BOOST_TEST(unfused_func(lv1,lv2,lv3) == 100 + expected);
+ BOOST_TEST(lv1 == 2+1*sizeof(lv1) && lv2 == 3+1*sizeof(lv2) && lv3 == 7+1*sizeof(lv3));
+
+ expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3);
+ BOOST_TEST(const_(unfused_func)(lv1,lv2,lv3) == 0 + expected);
+ BOOST_TEST(lv1 == 2+2*sizeof(lv1) && lv2 == 3+2*sizeof(lv2) && lv3 == 7+2*sizeof(lv3));
+
+ expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3);
+ BOOST_TEST(unfused_func_ref(lv1,lv2,lv3) == 100 + expected);
+ BOOST_TEST(lv1 == 2+3*sizeof(lv1) && lv2 == 3+3*sizeof(lv2) && lv3 == 7+3*sizeof(lv3));
+
+ expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3);
+ BOOST_TEST(unfused_func_c_ref(lv1,lv2,lv3) == 0 + expected);
+ BOOST_TEST(lv1 == 2+4*sizeof(lv1) && lv2 == 3+4*sizeof(lv2) && lv3 == 7+4*sizeof(lv3));
+
+ return boost::report_errors();
+}
+

Deleted: trunk/libs/fusion/test/functional/make_unfused_generic.cpp
==============================================================================
--- trunk/libs/fusion/test/functional/make_unfused_generic.cpp 2009-02-22 01:24:38 EST (Sun, 22 Feb 2009)
+++ (empty file)
@@ -1,124 +0,0 @@
-/*=============================================================================
- Copyright (c) 2006-2007 Tobias Schwinger
-
- Use modification and distribution are subject to the Boost Software
- License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
- http://www.boost.org/LICENSE_1_0.txt).
-==============================================================================*/
-
-#include <boost/fusion/functional/generation/make_unfused_generic.hpp>
-#include <boost/detail/lightweight_test.hpp>
-
-#include <boost/type_traits/is_same.hpp>
-
-#include <boost/noncopyable.hpp>
-#include <boost/blank.hpp>
-
-#include <boost/mpl/if.hpp>
-#include <boost/mpl/and.hpp>
-#include <boost/mpl/bool.hpp>
-#include <boost/mpl/identity.hpp>
-
-#include <boost/fusion/sequence/intrinsic/empty.hpp>
-#include <boost/fusion/algorithm/iteration/fold.hpp>
-
-#include <boost/ref.hpp>
-
-namespace fusion = boost::fusion;
-namespace mpl = boost::mpl;
-
-using boost::noncopyable;
-typedef mpl::true_ no_nullary_call;
-
-using boost::ref;
-using boost::cref;
-
-template <class Base = boost::blank, class RemoveNullary = mpl::false_>
-struct test_func
- : Base
-{
- template <typename Sig>
- struct result;
-
- template <class Self, class Seq>
- struct result< Self(Seq &) >
- : mpl::if_< mpl::and_< fusion::result_of::empty<Seq>, RemoveNullary >,
- boost::blank, mpl::identity<long> >::type
- { };
-
- template <typename Seq>
- long operator()(Seq const & seq) const
- {
- long state = 0;
- return fusion::fold(seq, state, fold_op());
- }
-
- template < typename Seq >
- long operator()(Seq const & seq)
- {
- long state = 100;
- return fusion::fold(seq, state, fold_op());
- }
-
- private:
-
- struct fold_op
- {
- typedef long result_type;
-
- template <typename T>
- long operator()(T const & elem, long value) const
- {
- return value + sizeof(T) * elem;
- }
-
- template <typename T>
- long operator()(T & elem, long value) const
- {
- elem += sizeof(T);
- return value;
- }
- };
-};
-
-template <typename T>
-inline T const & const_(T const & t)
-{
- return t;
-}
-
-int main()
-{
- test_func<> f;
- test_func<noncopyable> f_nc;
-
- fusion::result_of::make_unfused_generic< test_func<> >::type unfused_func =
- fusion::make_unfused_generic(f);
-
- fusion::result_of::make_unfused_generic< boost::reference_wrapper<
- test_func<noncopyable> > >::type unfused_func_ref =
- fusion::make_unfused_generic(ref(f_nc));
-
- fusion::result_of::make_unfused_generic< boost::reference_wrapper<
- test_func<noncopyable> const> >::type unfused_func_c_ref =
- fusion::make_unfused_generic(cref(f_nc));
-
- BOOST_TEST(unfused_func() == 100);
- BOOST_TEST(const_(unfused_func)() == 0);
- BOOST_TEST(unfused_func_ref() == 100);
- BOOST_TEST(unfused_func_c_ref() == 0);
-
- long lvalue = 12;
- static const long expected = 1*sizeof(int) + 2*sizeof(long) + 7*sizeof(char);
- BOOST_TEST(unfused_func(lvalue,lvalue,1,2l,'\007') == 100 + expected);
- BOOST_TEST(lvalue == 12 + 2*sizeof(long));
- BOOST_TEST(const_(unfused_func)(lvalue,lvalue,1,2l,'\007') == 0 + expected);
- BOOST_TEST(lvalue == 12 + 4*sizeof(long));
- BOOST_TEST(unfused_func_ref(lvalue,lvalue,1,2l,'\007') == 100 + expected);
- BOOST_TEST(lvalue == 12 + 6*sizeof(long));
- BOOST_TEST(unfused_func_c_ref(lvalue,lvalue,1,2l,'\007') == 0 + expected);
- BOOST_TEST(lvalue == 12 + 8*sizeof(long));
-
- return boost::report_errors();
-}
-

Deleted: trunk/libs/fusion/test/functional/make_unfused_lvalue_args.cpp
==============================================================================
--- trunk/libs/fusion/test/functional/make_unfused_lvalue_args.cpp 2009-02-22 01:24:38 EST (Sun, 22 Feb 2009)
+++ (empty file)
@@ -1,126 +0,0 @@
-/*=============================================================================
- Copyright (c) 2006-2007 Tobias Schwinger
-
- Use modification and distribution are subject to the Boost Software
- License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
- http://www.boost.org/LICENSE_1_0.txt).
-==============================================================================*/
-
-#include <boost/fusion/functional/generation/make_unfused_lvalue_args.hpp>
-#include <boost/detail/lightweight_test.hpp>
-
-#include <boost/noncopyable.hpp>
-#include <boost/blank.hpp>
-
-#include <boost/mpl/if.hpp>
-#include <boost/mpl/and.hpp>
-#include <boost/mpl/bool.hpp>
-#include <boost/mpl/identity.hpp>
-
-#include <boost/utility/result_of.hpp>
-
-#include <boost/fusion/sequence/intrinsic/empty.hpp>
-#include <boost/fusion/algorithm/iteration/fold.hpp>
-
-#include <boost/ref.hpp>
-
-namespace fusion = boost::fusion;
-namespace mpl = boost::mpl;
-
-using boost::noncopyable;
-typedef mpl::true_ no_nullary_call;
-
-using boost::ref;
-using boost::cref;
-
-template <class Base = boost::blank, class RemoveNullary = mpl::false_>
-struct test_func
- : Base
-{
- template <typename Sig>
- struct result;
-
- template <class Self, class Seq>
- struct result< Self(Seq &) >
- : mpl::if_< mpl::and_< fusion::result_of::empty<Seq>, RemoveNullary >,
- boost::blank, mpl::identity<long> >::type
- { };
-
- template <typename Seq>
- long operator()(Seq const & seq) const
- {
- long state = 0;
- return fusion::fold(seq, state, fold_op());
- }
-
- template < typename Seq >
- long operator()(Seq const & seq)
- {
- long state = 100;
- return fusion::fold(seq, state, fold_op());
- }
-
- private:
-
- struct fold_op
- {
- typedef long result_type;
-
- template <typename T>
- long operator()(T & elem, long value) const
- {
- elem += sizeof(T);
- return value + elem;
- }
- };
-};
-
-template <typename T>
-inline T const & const_(T const & t)
-{
- return t;
-}
-
-int main()
-{
- test_func<> f;
- test_func<noncopyable> f_nc;
-
- fusion::result_of::make_unfused_lvalue_args< test_func<> >::type unfused_func =
- fusion::make_unfused_lvalue_args(f);
-
- fusion::result_of::make_unfused_lvalue_args< boost::reference_wrapper<
- test_func<noncopyable> > >::type unfused_func_ref =
- fusion::make_unfused_lvalue_args(ref(f_nc));
-
- fusion::result_of::make_unfused_lvalue_args< boost::reference_wrapper<
- test_func<noncopyable> const> >::type unfused_func_c_ref =
- fusion::make_unfused_lvalue_args(cref(f_nc));
-
- BOOST_TEST(unfused_func() == 100);
- BOOST_TEST(const_(unfused_func)() == 0);
- BOOST_TEST(unfused_func_ref() == 100);
- BOOST_TEST(unfused_func_c_ref() == 0);
-
- long lv1 = 2; int lv2 = 3l; char lv3 = '\007';
- long expected;
-
- expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3);
- BOOST_TEST(unfused_func(lv1,lv2,lv3) == 100 + expected);
- BOOST_TEST(lv1 == 2+1*sizeof(lv1) && lv2 == 3+1*sizeof(lv2) && lv3 == 7+1*sizeof(lv3));
-
- expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3);
- BOOST_TEST(const_(unfused_func)(lv1,lv2,lv3) == 0 + expected);
- BOOST_TEST(lv1 == 2+2*sizeof(lv1) && lv2 == 3+2*sizeof(lv2) && lv3 == 7+2*sizeof(lv3));
-
- expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3);
- BOOST_TEST(unfused_func_ref(lv1,lv2,lv3) == 100 + expected);
- BOOST_TEST(lv1 == 2+3*sizeof(lv1) && lv2 == 3+3*sizeof(lv2) && lv3 == 7+3*sizeof(lv3));
-
- expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3);
- BOOST_TEST(unfused_func_c_ref(lv1,lv2,lv3) == 0 + expected);
- BOOST_TEST(lv1 == 2+4*sizeof(lv1) && lv2 == 3+4*sizeof(lv2) && lv3 == 7+4*sizeof(lv3));
-
- return boost::report_errors();
-}
-

Deleted: trunk/libs/fusion/test/functional/make_unfused_rvalue_args.cpp
==============================================================================
--- trunk/libs/fusion/test/functional/make_unfused_rvalue_args.cpp 2009-02-22 01:24:38 EST (Sun, 22 Feb 2009)
+++ (empty file)
@@ -1,110 +0,0 @@
-/*=============================================================================
- Copyright (c) 2006-2007 Tobias Schwinger
-
- Use modification and distribution are subject to the Boost Software
- License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
- http://www.boost.org/LICENSE_1_0.txt).
-==============================================================================*/
-
-#include <boost/fusion/functional/generation/make_unfused_rvalue_args.hpp>
-#include <boost/detail/lightweight_test.hpp>
-
-#include <boost/noncopyable.hpp>
-#include <boost/blank.hpp>
-
-#include <boost/mpl/if.hpp>
-#include <boost/mpl/and.hpp>
-#include <boost/mpl/bool.hpp>
-#include <boost/mpl/identity.hpp>
-
-#include <boost/fusion/sequence/intrinsic/empty.hpp>
-#include <boost/fusion/algorithm/iteration/fold.hpp>
-
-#include <boost/ref.hpp>
-
-namespace fusion = boost::fusion;
-namespace mpl = boost::mpl;
-
-using boost::noncopyable;
-typedef mpl::true_ no_nullary_call;
-
-using boost::ref;
-using boost::cref;
-
-template <class Base = boost::blank, class RemoveNullary = mpl::false_>
-struct test_func
- : Base
-{
- template <typename Sig>
- struct result;
-
- template <class Self, class Seq>
- struct result< Self(Seq &) >
- : mpl::if_< mpl::and_< fusion::result_of::empty<Seq>, RemoveNullary >,
- boost::blank, mpl::identity<long> >::type
- { };
-
- template <typename Seq>
- long operator()(Seq const & seq) const
- {
- long state = 0;
- return fusion::fold(seq, state, fold_op());
- }
-
- template < typename Seq >
- long operator()(Seq const & seq)
- {
- long state = 100;
- return fusion::fold(seq, state, fold_op());
- }
-
- private:
-
- struct fold_op
- {
- typedef long result_type;
-
- template <typename T>
- long operator()(T const & elem, long value) const
- {
- return value + sizeof(T) * elem;
- }
- };
-};
-
-template <typename T>
-inline T const & const_(T const & t)
-{
- return t;
-}
-
-int main()
-{
- test_func<> f;
- test_func<noncopyable> f_nc;
-
- fusion::result_of::make_unfused_rvalue_args< test_func<> >::type unfused_func =
- fusion::make_unfused_rvalue_args(f);
-
- fusion::result_of::make_unfused_rvalue_args< boost::reference_wrapper<
- test_func<noncopyable> > >::type unfused_func_ref =
- fusion::make_unfused_rvalue_args(ref(f_nc));
-
- fusion::result_of::make_unfused_rvalue_args< boost::reference_wrapper<
- test_func<noncopyable> const> >::type unfused_func_c_ref =
- fusion::make_unfused_rvalue_args(cref(f_nc));
-
- BOOST_TEST(unfused_func() == 100);
- BOOST_TEST(const_(unfused_func)() == 0);
- BOOST_TEST(unfused_func_ref() == 100);
- BOOST_TEST(unfused_func_c_ref() == 0);
-
- static const long expected = 1*sizeof(int) + 2*sizeof(long) + 7*sizeof(char);
- BOOST_TEST(unfused_func(1,2l,'\007') == 100 + expected);
- BOOST_TEST(const_(unfused_func)(1,2l,'\007') == 0 + expected);
- BOOST_TEST(unfused_func_ref(1,2l,'\007') == 100 + expected);
- BOOST_TEST(unfused_func_c_ref(1,2l,'\007') == 0 + expected);
-
- return boost::report_errors();
-}
-

Deleted: trunk/libs/fusion/test/functional/unfused_generic.cpp
==============================================================================
--- trunk/libs/fusion/test/functional/unfused_generic.cpp 2009-02-22 01:24:38 EST (Sun, 22 Feb 2009)
+++ (empty file)
@@ -1,126 +0,0 @@
-/*=============================================================================
- Copyright (c) 2006-2007 Tobias Schwinger
-
- Use modification and distribution are subject to the Boost Software
- License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
- http://www.boost.org/LICENSE_1_0.txt).
-==============================================================================*/
-
-#include <boost/fusion/functional/adapter/unfused_generic.hpp>
-#include <boost/detail/lightweight_test.hpp>
-
-#include <boost/type_traits/is_same.hpp>
-
-#include <boost/noncopyable.hpp>
-#include <boost/blank.hpp>
-
-#include <boost/mpl/identity.hpp>
-
-#include <boost/utility/result_of.hpp>
-
-#include <boost/fusion/algorithm/iteration/fold.hpp>
-
-namespace fusion = boost::fusion;
-namespace mpl = boost::mpl;
-
-using boost::noncopyable;
-typedef mpl::true_ no_nullary_call;
-
-template <class Base = boost::blank>
-struct test_func
- : Base
-{
- template <typename Sig>
- struct result;
-
- template <class Self, class Seq>
- struct result< Self (Seq) >
- : mpl::identity<long>
- { };
-
- template <typename Seq>
- long operator()(Seq const & seq) const
- {
- long state = 0;
- return fusion::fold(seq, state, fold_op());
- }
-
- template <typename Seq>
- long operator()(Seq const & seq)
- {
- long state = 100;
- return fusion::fold(seq, state, fold_op());
- }
-
- private:
-
- struct fold_op
- {
- template <typename T>
- long operator()(T const & elem, long value) const
- {
- return value + sizeof(T) * elem;
- }
-
- template <typename T>
- long operator()(T & elem, long value) const
- {
- elem += sizeof(T);
- return value;
- }
-
- template <typename Sig>
- struct result;
-
- template <class Self, typename T0, typename T1> struct result< Self(T0,T1) >
- : mpl::identity<long>
- { };
- };
-};
-
-void result_type_tests()
-{
- using boost::is_same;
-
- typedef fusion::unfused_generic< test_func<> > t;
- BOOST_TEST(( is_same< boost::result_of< t () >::type, long >::value ));
- BOOST_TEST(( is_same< boost::result_of< t (int) >::type, long >::value ));
-}
-
-int main()
-{
- result_type_tests();
-
- test_func<noncopyable> f;
- fusion::unfused_generic< test_func<> > unfused_func;
- fusion::unfused_generic< test_func<noncopyable> & > unfused_func_ref(f);
- fusion::unfused_generic< test_func<> const > unfused_func_c;
- fusion::unfused_generic< test_func<> > const unfused_func_c2;
- fusion::unfused_generic< test_func<noncopyable> const & > unfused_func_c_ref(f);
-
- BOOST_TEST(unfused_func() == 100);
- BOOST_TEST(unfused_func_ref() == 100);
- BOOST_TEST(unfused_func_c() == 0);
- BOOST_TEST(unfused_func_c2() == 0);
- BOOST_TEST(unfused_func_c_ref() == 0);
-
- long lvalue = 12;
- // also test const lvalues to pick up compiler deficiencies in that area
- int const clvalue_1 = 1;
- long const clvalue_2 = 2;
-
- static const long expected = 1*sizeof(int) + 2*sizeof(long) + 7*sizeof(char);
- BOOST_TEST(unfused_func(lvalue,lvalue,clvalue_1,clvalue_2,'\007') == 100 + expected);
- BOOST_TEST(lvalue == 12 + 2*sizeof(long));
- BOOST_TEST(unfused_func_ref(lvalue,lvalue,1,2l,'\007') == 100 + expected);
- BOOST_TEST(lvalue == 12 + 4*sizeof(long));
- BOOST_TEST(unfused_func_c(lvalue,lvalue,1,2l,'\007') == 0 + expected);
- BOOST_TEST(lvalue == 12 + 6*sizeof(long));
- BOOST_TEST(unfused_func_c2(lvalue,lvalue,1,2l,'\007') == 0 + expected);
- BOOST_TEST(lvalue == 12 + 8*sizeof(long));
- BOOST_TEST(unfused_func_c_ref(lvalue,lvalue,1,2l,'\007') == 0 + expected);
- BOOST_TEST(lvalue == 12 + 10*sizeof(long));
-
- return boost::report_errors();
-}
-

Deleted: trunk/libs/fusion/test/functional/unfused_lvalue_args.cpp
==============================================================================
--- trunk/libs/fusion/test/functional/unfused_lvalue_args.cpp 2009-02-22 01:24:38 EST (Sun, 22 Feb 2009)
+++ (empty file)
@@ -1,119 +0,0 @@
-/*=============================================================================
- Copyright (c) 2006-2007 Tobias Schwinger
-
- Use modification and distribution are subject to the Boost Software
- License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
- http://www.boost.org/LICENSE_1_0.txt).
-==============================================================================*/
-
-#include <boost/fusion/functional/adapter/unfused_lvalue_args.hpp>
-#include <boost/detail/lightweight_test.hpp>
-
-#include <boost/noncopyable.hpp>
-#include <boost/blank.hpp>
-
-#include <boost/mpl/identity.hpp>
-
-#include <boost/utility/result_of.hpp>
-
-#include <boost/fusion/sequence/intrinsic/empty.hpp>
-#include <boost/fusion/algorithm/iteration/fold.hpp>
-
-namespace fusion = boost::fusion;
-namespace mpl = boost::mpl;
-
-using boost::noncopyable;
-
-template <class Base = boost::blank>
-struct test_func
- : Base
-{
- template <typename Sig>
- struct result;
-
- template <class Self, class Seq>
- struct result< Self(Seq) >
- : mpl::identity<long>
- { };
-
- template <typename Seq>
- long operator()(Seq const & seq) const
- {
- long state = 0;
- return fusion::fold(seq, state, fold_op());
- }
-
- template <typename Seq>
- long operator()(Seq const & seq)
- {
- long state = 100;
- return fusion::fold(seq, state, fold_op());
- }
-
- private:
-
- struct fold_op
- {
- typedef long result_type;
-
- template <typename T>
- long operator()(T & elem, long value) const
- {
- elem += sizeof(T);
- return value + elem;
- }
- };
-};
-
-void result_type_tests()
-{
- using boost::is_same;
-
- typedef fusion::unfused_lvalue_args< test_func<> > t;
- BOOST_TEST(( is_same< boost::result_of< t () >::type, long >::value ));
- BOOST_TEST(( is_same< boost::result_of< t (int) >::type, long >::value ));
-}
-
-int main()
-{
- result_type_tests();
-
- test_func<noncopyable> f;
- fusion::unfused_lvalue_args< test_func<> > unfused_func;
- fusion::unfused_lvalue_args< test_func<noncopyable> & > unfused_func_ref(f);
- fusion::unfused_lvalue_args< test_func<> const > unfused_func_c;
- fusion::unfused_lvalue_args< test_func<> > const unfused_func_c2;
- fusion::unfused_lvalue_args< test_func<noncopyable> const & > unfused_func_c_ref(f);
-
- BOOST_TEST(unfused_func() == 100);
- BOOST_TEST(unfused_func_ref() == 100);
- BOOST_TEST(unfused_func_c() == 0);
- BOOST_TEST(unfused_func_c2() == 0);
- BOOST_TEST(unfused_func_c_ref() == 0);
-
- long lv1 = 2; int lv2 = 3l; char lv3 = '\007';
- long expected;
-
- expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3);
- BOOST_TEST(unfused_func(lv1,lv2,lv3) == 100 + expected);
- BOOST_TEST(lv1 == 2+1*sizeof(lv1) && lv2 == 3+1*sizeof(lv2) && lv3 == 7+1*sizeof(lv3));
-
- expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3);
- BOOST_TEST(unfused_func_ref(lv1,lv2,lv3) == 100 + expected);
- BOOST_TEST(lv1 == 2+2*sizeof(lv1) && lv2 == 3+2*sizeof(lv2) && lv3 == 7+2*sizeof(lv3));
-
- expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3);
- BOOST_TEST(unfused_func_c(lv1,lv2,lv3) == 0 + expected);
- BOOST_TEST(lv1 == 2+3*sizeof(lv1) && lv2 == 3+3*sizeof(lv2) && lv3 == 7+3*sizeof(lv3));
-
- expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3);
- BOOST_TEST(unfused_func_c2(lv1,lv2,lv3) == 0 + expected);
- BOOST_TEST(lv1 == 2+4*sizeof(lv1) && lv2 == 3+4*sizeof(lv2) && lv3 == 7+4*sizeof(lv3));
-
- expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3);
- BOOST_TEST(unfused_func_c_ref(lv1,lv2,lv3) == 0 + expected);
- BOOST_TEST(lv1 == 2+5*sizeof(lv1) && lv2 == 3+5*sizeof(lv2) && lv3 == 7+5*sizeof(lv3));
-
- return boost::report_errors();
-}
-

Deleted: trunk/libs/fusion/test/functional/unfused_rvalue_args.cpp
==============================================================================
--- trunk/libs/fusion/test/functional/unfused_rvalue_args.cpp 2009-02-22 01:24:38 EST (Sun, 22 Feb 2009)
+++ (empty file)
@@ -1,102 +0,0 @@
-/*=============================================================================
- Copyright (c) 2006-2007 Tobias Schwinger
-
- Use modification and distribution are subject to the Boost Software
- License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
- http://www.boost.org/LICENSE_1_0.txt).
-==============================================================================*/
-
-#include <boost/fusion/functional/adapter/unfused_rvalue_args.hpp>
-#include <boost/detail/lightweight_test.hpp>
-
-#include <boost/noncopyable.hpp>
-#include <boost/blank.hpp>
-
-#include <boost/mpl/identity.hpp>
-
-#include <boost/utility/result_of.hpp>
-
-#include <boost/fusion/algorithm/iteration/fold.hpp>
-
-namespace fusion = boost::fusion;
-namespace mpl = boost::mpl;
-
-using boost::noncopyable;
-typedef mpl::true_ no_nullary_call;
-
-template <class Base = boost::blank>
-struct test_func
- : Base
-{
- template <typename Sig>
- struct result;
-
- template <class Self, class Seq>
- struct result< Self(Seq) >
- : mpl::identity<long>
- { };
-
- template <typename Seq>
- long operator()(Seq const & seq) const
- {
- long state = 0;
- return fusion::fold(seq, state, fold_op());
- }
-
- template < typename Seq >
- long operator()(Seq const & seq)
- {
- long state = 100;
- return fusion::fold(seq, state, fold_op());
- }
-
- private:
-
- struct fold_op
- {
- typedef long result_type;
-
- template <typename T>
- long operator()(T const & elem, long value) const
- {
- return value + sizeof(T) * elem;
- }
- };
-};
-
-void result_type_tests()
-{
- using boost::is_same;
-
- typedef fusion::unfused_rvalue_args< test_func<> > t;
- BOOST_TEST(( is_same< boost::result_of< t () >::type, long >::value ));
- BOOST_TEST(( is_same< boost::result_of< t (int) >::type, long >::value ));
-}
-
-int main()
-{
- result_type_tests();
-
- test_func<noncopyable> f;
- fusion::unfused_rvalue_args< test_func<> > unfused_func;
- fusion::unfused_rvalue_args< test_func<noncopyable> & > unfused_func_ref(f);
- fusion::unfused_rvalue_args< test_func<> const > unfused_func_c;
- fusion::unfused_rvalue_args< test_func<> > const unfused_func_c2;
- fusion::unfused_rvalue_args< test_func<noncopyable> const & > unfused_func_c_ref(f);
-
- BOOST_TEST(unfused_func() == 100);
- BOOST_TEST(unfused_func_ref() == 100);
- BOOST_TEST(unfused_func_c() == 0);
- BOOST_TEST(unfused_func_c2() == 0);
- BOOST_TEST(unfused_func_c_ref() == 0);
-
- static const long expected = 1*sizeof(int) + 2*sizeof(long) + 7*sizeof(char);
- BOOST_TEST(unfused_func(1,2l,'\007') == 100 + expected);
- BOOST_TEST(unfused_func_ref(1,2l,'\007') == 100 + expected);
- BOOST_TEST(unfused_func_c(1,2l,'\007') == 0 + expected);
- BOOST_TEST(unfused_func_c2(1,2l,'\007') == 0 + expected);
- BOOST_TEST(unfused_func_c_ref(1,2l,'\007') == 0 + expected);
-
- return boost::report_errors();
-}
-


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