Warning, file /include/boost/test/detail/global_typedef.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef BOOST_TEST_GLOBAL_TYPEDEF_HPP_021005GER
0013 #define BOOST_TEST_GLOBAL_TYPEDEF_HPP_021005GER
0014
0015 #include <boost/test/utils/basic_cstring/basic_cstring.hpp>
0016
0017 #define BOOST_TEST_L( s ) ::boost::unit_test::const_string( s, sizeof( s ) - 1 )
0018 #define BOOST_TEST_STRINGIZE( s ) BOOST_TEST_L( BOOST_STRINGIZE( s ) )
0019 #define BOOST_TEST_EMPTY_STRING BOOST_TEST_L( "" )
0020
0021 #include <boost/test/detail/suppress_warnings.hpp>
0022
0023
0024
0025 namespace boost {
0026 namespace unit_test {
0027
0028 typedef unsigned long counter_t;
0029
0030
0031
0032 enum BOOST_SYMBOL_VISIBLE report_level { INV_REPORT_LEVEL,
0033 CONFIRMATION_REPORT,
0034 SHORT_REPORT,
0035 DETAILED_REPORT,
0036 NO_REPORT };
0037
0038
0039
0040
0041 enum BOOST_SYMBOL_VISIBLE output_format { OF_INVALID,
0042 OF_CLF,
0043 OF_XML,
0044 OF_JUNIT,
0045 OF_CUSTOM_LOGGER,
0046 OF_DOT
0047 };
0048
0049
0050
0051 enum test_unit_type { TUT_CASE = 0x01, TUT_SUITE = 0x10, TUT_ANY = 0x11 };
0052
0053
0054
0055 enum assertion_result { AR_FAILED, AR_PASSED, AR_TRIGGERED };
0056
0057
0058
0059 typedef unsigned long test_unit_id;
0060
0061 const test_unit_id INV_TEST_UNIT_ID = 0xFFFFFFFF;
0062 const test_unit_id MAX_TEST_CASE_ID = 0xFFFFFFFE;
0063 const test_unit_id MIN_TEST_CASE_ID = 0x00010000;
0064 const test_unit_id MAX_TEST_SUITE_ID = 0x0000FF00;
0065 const test_unit_id MIN_TEST_SUITE_ID = 0x00000001;
0066
0067
0068
0069 namespace ut_detail {
0070
0071 inline test_unit_type
0072 test_id_2_unit_type( test_unit_id id )
0073 {
0074 return (id & 0xFFFF0000) != 0 ? TUT_CASE : TUT_SUITE;
0075 }
0076
0077
0078 struct test_unit_id_restore {
0079 test_unit_id_restore(test_unit_id& to_restore_, test_unit_id new_value)
0080 : to_restore(to_restore_)
0081 , bkup(to_restore_) {
0082 to_restore = new_value;
0083 }
0084 ~test_unit_id_restore() {
0085 to_restore = bkup;
0086 }
0087 private:
0088 test_unit_id& to_restore;
0089 test_unit_id bkup;
0090 };
0091
0092
0093
0094 }
0095
0096
0097 template<class T>
0098 struct static_constant {
0099 static T value;
0100 };
0101
0102 template<class T>
0103 T static_constant<T>::value;
0104
0105
0106
0107
0108
0109
0110
0111
0112 #define BOOST_TEST_SINGLETON_CONS_NO_CTOR( type ) \
0113 public: \
0114 static type& instance(); \
0115 private: \
0116 BOOST_DELETED_FUNCTION(type(type const&)) \
0117 BOOST_DELETED_FUNCTION(type& operator=(type const&)) \
0118 BOOST_DEFAULTED_FUNCTION(~type(), {}) \
0119
0120
0121 #define BOOST_TEST_SINGLETON_CONS( type ) \
0122 BOOST_TEST_SINGLETON_CONS_NO_CTOR(type) \
0123 private: \
0124 BOOST_DEFAULTED_FUNCTION(type(), {}) \
0125
0126
0127 #define BOOST_TEST_SINGLETON_CONS_IMPL( type ) \
0128 type& type::instance() { \
0129 static type the_inst; return the_inst; \
0130 } \
0131
0132
0133
0134
0135 #if defined(__APPLE_CC__) && defined(__GNUC__) && __GNUC__ < 4
0136 #define BOOST_TEST_SINGLETON_INST( inst ) \
0137 static BOOST_JOIN( inst, _t)& inst BOOST_ATTRIBUTE_UNUSED = BOOST_JOIN (inst, _t)::instance();
0138
0139 #else
0140
0141 #define BOOST_TEST_SINGLETON_INST( inst ) \
0142 namespace { BOOST_JOIN( inst, _t)& inst BOOST_ATTRIBUTE_UNUSED = BOOST_JOIN( inst, _t)::instance(); }
0143
0144 #endif
0145
0146 }
0147 }
0148
0149
0150
0151 #include <boost/test/detail/enable_warnings.hpp>
0152
0153 #endif