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

source code of boost/boost/test/detail/global_typedef.hpp