|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r83254 - sandbox/type_erasure/libs/type_erasure/test
From: steven_at_[hidden]
Date: 2013-03-02 17:14:02
Author: steven_watanabe
Date: 2013-03-02 17:14:01 EST (Sat, 02 Mar 2013)
New Revision: 83254
URL: http://svn.boost.org/trac/boost/changeset/83254
Log:
Test const member functions w/ rvalues as well.
Text files modified:
sandbox/type_erasure/libs/type_erasure/test/test_callable.cpp | 28 ++++++++++++++++++++++++++++
sandbox/type_erasure/libs/type_erasure/test/test_member.cpp | 9 +++++++++
2 files changed, 37 insertions(+), 0 deletions(-)
Modified: sandbox/type_erasure/libs/type_erasure/test/test_callable.cpp
==============================================================================
--- sandbox/type_erasure/libs/type_erasure/test/test_callable.cpp (original)
+++ sandbox/type_erasure/libs/type_erasure/test/test_callable.cpp 2013-03-02 17:14:01 EST (Sat, 02 Mar 2013)
@@ -409,4 +409,32 @@
BOOST_CHECK_EQUAL(f_rv_value, 4);
}
+BOOST_AUTO_TEST_CASE(test_const_rvalue_int)
+{
+ typedef ::boost::mpl::vector<
+ common<>,
+ callable<void(int&&), const _self>
+ > test_concept;
+ const any<test_concept> f(&f_rv);
+
+ f_rv_value = 1;
+ f(2);
+ BOOST_CHECK_EQUAL(f_rv_value, 3);
+}
+
+BOOST_AUTO_TEST_CASE(test_const_rvalue_any)
+{
+ typedef ::boost::mpl::vector<
+ common<>,
+ common<_a>,
+ callable<void(_a&&), const _self>
+ > test_concept;
+
+ tuple<test_concept, _self, _a> t1(&f_rv, 3);
+ const any<test_concept> x1(get<0>(t1));
+ f_rv_value = 1;
+ x1(std::move(get<1>(t1)));
+ BOOST_CHECK_EQUAL(f_rv_value, 4);
+}
+
#endif
Modified: sandbox/type_erasure/libs/type_erasure/test/test_member.cpp
==============================================================================
--- sandbox/type_erasure/libs/type_erasure/test/test_member.cpp (original)
+++ sandbox/type_erasure/libs/type_erasure/test/test_member.cpp 2013-03-02 17:14:01 EST (Sat, 02 Mar 2013)
@@ -109,4 +109,13 @@
BOOST_CHECK_EQUAL(x.f1(5), 15);
}
+BOOST_AUTO_TEST_CASE(test_global_has_f1_rv_const) {
+ typedef ::boost::mpl::vector<
+ global_has_f1_1<int(int&&), const _self>,
+ copy_constructible<> > concept_type;
+ model_const m(10);
+ const any<concept_type> x(m);
+ BOOST_CHECK_EQUAL(x.f1(5), 15);
+}
+
#endif
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