File indexing completed on 2025-01-18 09:52:40
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef BOOST_TEST_TOOLS_CSTRING_COMPARISON_OP_HPP_050815GER
0013 #define BOOST_TEST_TOOLS_CSTRING_COMPARISON_OP_HPP_050815GER
0014
0015
0016 #include <boost/test/tools/assertion.hpp>
0017
0018 #include <boost/test/utils/is_cstring.hpp>
0019 #include <boost/test/utils/basic_cstring/compare.hpp>
0020
0021
0022 #include <boost/utility/enable_if.hpp>
0023
0024 #include <boost/test/detail/suppress_warnings.hpp>
0025
0026
0027
0028 namespace boost {
0029 namespace test_tools {
0030 namespace assertion {
0031 namespace op {
0032
0033
0034
0035
0036
0037 #define DEFINE_CSTRING_COMPARISON( oper, name, rev, name_inverse ) \
0038 template<typename Lhs,typename Rhs> \
0039 struct name<Lhs,Rhs,typename boost::enable_if_c< \
0040 ( unit_test::is_cstring_comparable<Lhs>::value \
0041 && unit_test::is_cstring_comparable<Rhs>::value) \
0042 >::type > \
0043 { \
0044 typedef typename unit_test::deduce_cstring_transform<Lhs>::type lhs_char_type; \
0045 typedef typename unit_test::deduce_cstring_transform<Rhs>::type rhs_char_type; \
0046 public: \
0047 typedef assertion_result result_type; \
0048 typedef name_inverse<Lhs, Rhs> inverse; \
0049 \
0050 typedef name< \
0051 typename lhs_char_type::value_type, \
0052 typename rhs_char_type::value_type> elem_op; \
0053 \
0054 static bool \
0055 eval( Lhs const& lhs, Rhs const& rhs) \
0056 { \
0057 return lhs_char_type(lhs) oper rhs_char_type(rhs); \
0058 } \
0059 \
0060 template<typename PrevExprType> \
0061 static void \
0062 report( std::ostream& ostr, \
0063 PrevExprType const& lhs, \
0064 Rhs const& rhs) \
0065 { \
0066 lhs.report( ostr ); \
0067 ostr << revert() \
0068 << tt_detail::print_helper( rhs ); \
0069 } \
0070 \
0071 static char const* forward() \
0072 { return " " #oper " "; } \
0073 static char const* revert() \
0074 { return " " #rev " "; } \
0075 }; \
0076
0077
0078 BOOST_TEST_FOR_EACH_COMP_OP( DEFINE_CSTRING_COMPARISON )
0079 #undef DEFINE_CSTRING_COMPARISON
0080
0081
0082
0083 }
0084 }
0085 }
0086 }
0087
0088 #include <boost/test/detail/enable_warnings.hpp>
0089
0090 #endif
0091