blob: e87327a3983f0e2912b3218071c237c33bf1ca9a [file] [log] [blame]
Jeff Thompsonef2d5a42013-08-22 19:09:24 -07001// (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 <ndnboost/test/utils/basic_cstring/basic_cstring.hpp>
19#define BOOST_TEST_L( s ) ndnboost::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 <ndnboost/test/detail/suppress_warnings.hpp>
24
25//____________________________________________________________________________//
26
27namespace ndnboost {
28
29namespace unit_test {
30
31typedef unsigned long counter_t;
32
33//____________________________________________________________________________//
34
35enum report_level { INV_REPORT_LEVEL, CONFIRMATION_REPORT, SHORT_REPORT, DETAILED_REPORT, NO_REPORT };
36
37//____________________________________________________________________________//
38
39enum output_format { INV_OF, CLF /* compiler log format */, XML /* XML */ };
40
41//____________________________________________________________________________//
42
43enum test_unit_type { tut_case = 0x01, tut_suite = 0x10, tut_any = 0x11 };
44
45//____________________________________________________________________________//
46
47typedef unsigned long test_unit_id;
48
49const test_unit_id INV_TEST_UNIT_ID = 0xFFFFFFFF;
50const test_unit_id MAX_TEST_CASE_ID = 0xFFFFFFFE;
51const test_unit_id MIN_TEST_CASE_ID = 0x00010000;
52const test_unit_id MAX_TEST_SUITE_ID = 0x0000FF00;
53const test_unit_id MIN_TEST_SUITE_ID = 0x00000001;
54
55//____________________________________________________________________________//
56
57namespace ut_detail {
58
59inline test_unit_type
60test_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
68template<class T>
69struct static_constant {
70 static T value;
71};
72
73template<class T>
74T static_constant<T>::value;
75
76//____________________________________________________________________________//
77
78} // namespace ut_detail
79
80} // namespace unit_test
81
82} // namespace ndnboost
83
84//____________________________________________________________________________//
85
86#include <ndnboost/test/detail/enable_warnings.hpp>
87
88#endif // BOOST_TEST_GLOBAL_TYPEDEF_HPP_021005GER