fwd.hpp 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. // (C) Copyright Gennadiy Rozental 2001.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/test for the library home page.
  6. //
  7. // File : $RCSfile$
  8. //
  9. // Version : $Revision: 74248 $
  10. //
  11. // Description : toolbox implementation types and forward declarations
  12. // ***************************************************************************
  13. #ifndef BOOST_TEST_TOOLS_DETAIL_FWD_HPP_012705GER
  14. #define BOOST_TEST_TOOLS_DETAIL_FWD_HPP_012705GER
  15. // Boost.Test
  16. #include <boost/test/detail/config.hpp>
  17. #include <boost/test/utils/basic_cstring/io.hpp>
  18. // STL
  19. #include <cstddef> // for std::size_t
  20. #include <boost/test/detail/suppress_warnings.hpp>
  21. //____________________________________________________________________________//
  22. namespace boost {
  23. namespace unit_test {
  24. class lazy_ostream;
  25. } // namespace unit_test
  26. namespace test_tools {
  27. using unit_test::const_string;
  28. class assertion_result;
  29. //____________________________________________________________________________//
  30. namespace tt_detail {
  31. // ************************************************************************** //
  32. // ************** types of supported assertions ************** //
  33. // ************************************************************************** //
  34. //____________________________________________________________________________//
  35. enum check_type {
  36. CHECK_PRED,
  37. CHECK_MSG,
  38. CHECK_EQUAL,
  39. CHECK_NE,
  40. CHECK_LT,
  41. CHECK_LE,
  42. CHECK_GT,
  43. CHECK_GE,
  44. CHECK_CLOSE,
  45. CHECK_CLOSE_FRACTION,
  46. CHECK_SMALL,
  47. CHECK_BITWISE_EQUAL,
  48. CHECK_PRED_WITH_ARGS,
  49. CHECK_EQUAL_COLL,
  50. CHECK_BUILT_ASSERTION
  51. };
  52. //____________________________________________________________________________//
  53. // ************************************************************************** //
  54. // ************** levels of supported assertions ************** //
  55. // ************************************************************************** //
  56. enum tool_level {
  57. WARN, CHECK, REQUIRE, PASS
  58. };
  59. //____________________________________________________________________________//
  60. // ************************************************************************** //
  61. // ************** Tools offline implementation ************** //
  62. // ************************************************************************** //
  63. BOOST_TEST_DECL bool
  64. report_assertion( assertion_result const& pr, unit_test::lazy_ostream const& assertion_descr,
  65. const_string file_name, std::size_t line_num,
  66. tool_level tl, check_type ct,
  67. std::size_t num_args, ... );
  68. //____________________________________________________________________________//
  69. BOOST_TEST_DECL assertion_result
  70. format_assertion_result( const_string expr_val, const_string details );
  71. //____________________________________________________________________________//
  72. BOOST_TEST_DECL assertion_result
  73. format_fpc_report( const_string expr_val, const_string details );
  74. //____________________________________________________________________________//
  75. BOOST_TEST_DECL bool
  76. is_defined_impl( const_string symbol_name, const_string symbol_value );
  77. //____________________________________________________________________________//
  78. BOOST_TEST_DECL assertion_result
  79. equal_impl( char const* left, char const* right );
  80. //____________________________________________________________________________//
  81. } // namespace tt_detail
  82. } // namespace test_tools
  83. } // namespace boost
  84. #include <boost/test/detail/enable_warnings.hpp>
  85. #endif // BOOST_TEST_TOOLS_DETAIL_FWD_HPP_012705GER