From 6d811a2e72f3a04ca48a3fb6d6ccdb344461780a Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 7 Jan 2019 00:02:14 +0200 Subject: [PATCH] Add test/quick.cpp --- test/Jamfile.v2 | 2 ++ test/quick.cpp | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 test/quick.cpp diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 1d26356..b072b5e 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -71,3 +71,5 @@ run test_return_function.cpp return_function/0x : : : static : ret run test_return_function.cpp return_function/14 : : : shared $(check14) : return_function_shared_14 ; run test_return_function.cpp return_function/14 : : : static $(check14) : return_function_static_14 ; + +run quick.cpp ; diff --git a/test/quick.cpp b/test/quick.cpp new file mode 100644 index 0000000..d2d37d0 --- /dev/null +++ b/test/quick.cpp @@ -0,0 +1,21 @@ +// Copyright 2019 Peter Dimov + +// Use, modification and distribution is 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 +#include + +static int f( int x ) +{ + return x + 1; +} + +int main() +{ + boost::function fn( f ); + + BOOST_TEST_EQ( fn( 5 ), 6 ); + + return boost::report_errors(); +}