Added test for sequence syntax (to run with and without variadic macro support) and disabled variadic syntax test when variadic macros are not supported.

Updated docs.

[SVN r77078]
This commit is contained in:
Lorenzo Caminiti
2012-02-20 20:07:29 +00:00
parent 8b05032051
commit b84f29c030
82 changed files with 1381 additions and 216 deletions

View File

@@ -5,6 +5,9 @@
// http://www.boost.org/LICENSE_1_0.txt)
// Home at http://www.boost.org/libs/local_function
#include <boost/config.hpp>
#ifndef BOOST_NO_VARIADIC_MACROS
#include <boost/local_function.hpp>
#include <boost/function.hpp>
#define BOOST_TEST_MODULE TestReturnThis
@@ -24,15 +27,21 @@ private:
int value_;
};
BOOST_AUTO_TEST_CASE( test_return_this ) {
BOOST_AUTO_TEST_CASE(test_return_this) {
number n1 = 0; // Object valid in scope where closure is used.
boost::function<int (void)> inc1 = n1.inc();
number n2 = 0;
boost::function<int (void)> inc2 = n2.inc();
BOOST_CHECK( inc1() == 1 );
BOOST_CHECK( inc1() == 2 );
BOOST_CHECK( inc2() == 1 );
BOOST_CHECK( inc1() == 3 );
BOOST_CHECK(inc1() == 1);
BOOST_CHECK(inc1() == 2);
BOOST_CHECK(inc2() == 1);
BOOST_CHECK(inc1() == 3);
}
#else
int main(void) { return 0; } // Trivial test.
#endif