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 TestReturnSetGet
@@ -16,12 +19,12 @@ boost::function<const std::string& (void)> get;
void action(void) {
// State `message` hidden behind access functions from here.
BOOST_CHECK( get() == "abc" );
BOOST_CHECK(get() == "abc");
set("xyz");
BOOST_CHECK( get() == "xyz" );
BOOST_CHECK(get() == "xyz");
}
BOOST_AUTO_TEST_CASE( test_return_setget ) {
BOOST_AUTO_TEST_CASE(test_return_setget) {
std::string message = "abc"; // Reference valid where closure used.
void BOOST_LOCAL_FUNCTION(bind& message, const std::string& text) {
@@ -37,3 +40,9 @@ BOOST_AUTO_TEST_CASE( test_return_setget ) {
action();
}
#else
int main(void) { return 0; } // Trivial test.
#endif