-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add throw/catch test for bad_function_call
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
// Copyright 2018 Peter Dimov. | ||
// Distributed under the Boost Software License, Version 1.0. | ||
|
||
#include <boost/function.hpp> | ||
#include <boost/core/lightweight_test.hpp> | ||
|
||
void throw_bad_function_call(); | ||
|
||
int main() | ||
{ | ||
BOOST_TEST_THROWS( throw_bad_function_call(), boost::bad_function_call ); | ||
return boost::report_errors(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
// Copyright 2018 Peter Dimov. | ||
// Distributed under the Boost Software License, Version 1.0. | ||
|
||
#include <boost/function.hpp> | ||
#include <boost/config.hpp> | ||
|
||
#if defined(THROW_BAD_FUNCTION_CALL_DYN_LINK) | ||
# define EXPORT BOOST_SYMBOL_EXPORT | ||
#else | ||
# define EXPORT | ||
#endif | ||
|
||
EXPORT void throw_bad_function_call() | ||
{ | ||
throw boost::bad_function_call(); | ||
} |