1 // (C) Copyright Gennadiy Rozental 2001-2008. 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 6 // See http://www.boost.org/libs/test for the library home page. 7 // 8 // File : $RCSfile$ 9 // 10 // Version : $Revision: 54633 $ 11 // 12 // Description : some trivial global typedefs 13 // *************************************************************************** 14 15 #ifndef BOOST_TEST_GLOBAL_TYPEDEF_HPP_021005GER 16 #define BOOST_TEST_GLOBAL_TYPEDEF_HPP_021005GER 17 18 #include <boost/test/utils/basic_cstring/basic_cstring.hpp> 19 #define BOOST_TEST_L( s ) boost::unit_test::const_string( s, sizeof( s ) - 1 ) 20 #define BOOST_TEST_STRINGIZE( s ) BOOST_TEST_L( BOOST_STRINGIZE( s ) ) 21 #define BOOST_TEST_EMPTY_STRING BOOST_TEST_L( "" ) 22 23 #include <boost/test/detail/suppress_warnings.hpp> 24 25 //____________________________________________________________________________// 26 27 namespace boost { 28 29 namespace unit_test { 30 31 typedef unsigned long counter_t; 32 33 //____________________________________________________________________________// 34 35 enum report_level { INV_REPORT_LEVEL, CONFIRMATION_REPORT, SHORT_REPORT, DETAILED_REPORT, NO_REPORT }; 36 37 //____________________________________________________________________________// 38 39 enum output_format { INV_OF, CLF /* compiler log format */, XML /* XML */ }; 40 41 //____________________________________________________________________________// 42 43 enum test_unit_type { tut_case = 0x01, tut_suite = 0x10, tut_any = 0x11 }; 44 45 //____________________________________________________________________________// 46 47 typedef unsigned long test_unit_id; 48 49 const test_unit_id INV_TEST_UNIT_ID = 0xFFFFFFFF; 50 const test_unit_id MAX_TEST_CASE_ID = 0xFFFFFFFE; 51 const test_unit_id MIN_TEST_CASE_ID = 0x00010000; 52 const test_unit_id MAX_TEST_SUITE_ID = 0x0000FF00; 53 const test_unit_id MIN_TEST_SUITE_ID = 0x00000001; 54 55 //____________________________________________________________________________// 56 57 namespace ut_detail { 58 59 inline test_unit_type 60 test_id_2_unit_type( test_unit_id id ) 61 { 62 return (id & 0xFFFF0000) != 0 ? tut_case : tut_suite; 63 } 64 65 //____________________________________________________________________________// 66 67 // helper templates to prevent ODR violations 68 template<class T> 69 struct static_constant { 70 static T value; 71 }; 72 73 template<class T> 74 T static_constant<T>::value; 75 76 //____________________________________________________________________________// 77 78 } // namespace ut_detail 79 80 } // namespace unit_test 81 82 } // namespace boost 83 84 //____________________________________________________________________________// 85 86 #include <boost/test/detail/enable_warnings.hpp> 87 88 #endif // BOOST_TEST_GLOBAL_TYPEDEF_HPP_021005GER 89