current_function_test2.cpp 553 B

12345678910111213141516171819202122232425
  1. //
  2. // current_function_test2.cpp - a test for boost/current_function.hpp
  3. //
  4. // Copyright 2018 Peter Dimov
  5. //
  6. // Distributed under the Boost Software License, Version 1.0.
  7. // See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt
  9. //
  10. #include <boost/current_function.hpp>
  11. #include <boost/core/lightweight_test.hpp>
  12. #include <string>
  13. int f()
  14. {
  15. BOOST_TEST_EQ( std::string( BOOST_CURRENT_FUNCTION ).substr( 0, 4 ), std::string( "int " ) );
  16. return 0;
  17. }
  18. int main()
  19. {
  20. f();
  21. return boost::report_errors();
  22. }