// For more information, see http://www.boost.org
-#include <boost/test/minimal.hpp>
#include <boost/function.hpp>
+#include <boost/core/lightweight_test.hpp>
#include <functional>
#include <string>
#include <utility>
+#define BOOST_CHECK BOOST_TEST
+
using boost::function;
using std::string;
boost::function<int (int, int)> f(boost::ref(atc));
BOOST_CHECK(f(1, 3) == 4);
}
- catch(std::runtime_error e) {
+ catch(std::runtime_error const&) {
BOOST_ERROR("Nonthrowing constructor threw an exception");
}
}
f2();
BOOST_ERROR("Exception didn't throw for reference to empty function.");
}
- catch(std::runtime_error e) {}
+ catch(std::runtime_error const&) {}
f1 = dummy;
try {
f2();
}
- catch(std::runtime_error e) {
+ catch(std::runtime_error const&) {
BOOST_ERROR("Error calling referenced function.");
}
}
f(5, 4);
BOOST_CHECK(false);
}
- catch(boost::bad_function_call) {
+ catch(boost::bad_function_call const&) {
// okay
}
}
#endif
}
-int test_main(int, char* [])
+int main()
{
test_zero_args();
test_one_arg();
test_move_semantics<function<void()> >();
test_move_semantics<boost::function0<void> >();
- return 0;
+ return boost::report_errors();
}