fwd.hpp 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. inline bool dummy_cond() { return false; }
  32. // ************************************************************************** //
  33. // ************** types of supported assertions ************** //
  34. // ************************************************************************** //
  35. //____________________________________________________________________________//
  36. enum check_type {
  37. CHECK_PRED,
  38. CHECK_MSG,
  39. CHECK_EQUAL,
  40. CHECK_NE,
  41. CHECK_LT,
  42. CHECK_LE,
  43. CHECK_GT,
  44. CHECK_GE,
  45. CHECK_CLOSE,
  46. CHECK_CLOSE_FRACTION,
  47. CHECK_SMALL,
  48. CHECK_BITWISE_EQUAL,
  49. CHECK_PRED_WITH_ARGS,
  50. CHECK_EQUAL_COLL,
  51. CHECK_BUILT_ASSERTION
  52. };
  53. //____________________________________________________________________________//
  54. // ************************************************************************** //
  55. // ************** levels of supported assertions ************** //
  56. // ************************************************************************** //
  57. enum tool_level {
  58. WARN, CHECK, REQUIRE, PASS
  59. };
  60. //____________________________________________________________________________//
  61. // ************************************************************************** //
  62. // ************** Tools offline implementation ************** //
  63. // ************************************************************************** //
  64. BOOST_TEST_DECL bool
  65. report_assertion( assertion_result const& pr, unit_test::lazy_ostream const& assertion_descr,
  66. const_string file_name, std::size_t line_num,
  67. tool_level tl, check_type ct,
  68. std::size_t num_args, ... );
  69. //____________________________________________________________________________//
  70. BOOST_TEST_DECL assertion_result
  71. format_assertion_result( const_string expr_val, const_string details );
  72. //____________________________________________________________________________//
  73. BOOST_TEST_DECL assertion_result
  74. format_fpc_report( const_string expr_val, const_string details );
  75. //____________________________________________________________________________//
  76. BOOST_TEST_DECL bool
  77. is_defined_impl( const_string symbol_name, const_string symbol_value );
  78. //____________________________________________________________________________//
  79. BOOST_TEST_DECL assertion_result
  80. equal_impl( char const* left, char const* right );
  81. //____________________________________________________________________________//
  82. } // namespace tt_detail
  83. } // namespace test_tools
  84. } // namespace boost
  85. #include <boost/test/detail/enable_warnings.hpp>
  86. #endif // BOOST_TEST_TOOLS_DETAIL_FWD_HPP_012705GER