Skip to content

Commit

Permalink
Add test/quick.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Jan 6, 2019
1 parent 3f6b2b6 commit 6d811a2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,5 @@ run test_return_function.cpp return_function/<cxxstd>0x : : : <link>static : ret

run test_return_function.cpp return_function/<cxxstd>14 : : : <link>shared $(check14) : return_function_shared_14 ;
run test_return_function.cpp return_function/<cxxstd>14 : : : <link>static $(check14) : return_function_static_14 ;

run quick.cpp ;
21 changes: 21 additions & 0 deletions test/quick.cpp
Original file line number Diff line number Diff line change
@@ -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 <boost/function.hpp>
#include <boost/core/lightweight_test.hpp>

static int f( int x )
{
return x + 1;
}

int main()
{
boost::function<int(int)> fn( f );

BOOST_TEST_EQ( fn( 5 ), 6 );

return boost::report_errors();
}

0 comments on commit 6d811a2

Please sign in to comment.