2 ************************************************************************
3 * Copyright (c) 2007, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 ************************************************************************
8 /** C Utilities to aid in debugging **/
13 #include "unicode/testtype.h"
14 #include "unicode/utypes.h"
18 UDBG_UDebugEnumType
= 0, /* Self-referential, strings for UDebugEnumType. Count=ENUM_COUNT. */
19 UDBG_UCalendarDateFields
, /* UCalendarDateFields. Count=UCAL_FIELD_COUNT. Unsupported if UCONFIG_NO_FORMATTING. */
20 UDBG_UCalendarMonths
, /* UCalendarMonths. Count= (UCAL_UNDECIMBER+1) */
21 UDBG_UDateFormatStyle
, /* Count = UDAT_SHORT=1 */
25 typedef enum UDebugEnumType UDebugEnumType
;
28 * @param type the type of enum
29 * Print how many enums are contained for this type.
30 * Should be equal to the appropriate _COUNT constant or there is an error. Return -1 if unsupported.
32 T_CTEST_API
int32_t T_CTEST_EXPORT2
udbg_enumCount(UDebugEnumType type
);
35 * Convert an enum to a string
36 * @param type type of enum
37 * @param field field number
38 * @return string of the format "ERA", "YEAR", etc, or NULL if out of range or unsupported
40 T_CTEST_API
const char * T_CTEST_EXPORT2
udbg_enumName(UDebugEnumType type
, int32_t field
);
43 * for consistency checking
44 * @param type the type of enum
45 * Print how many enums should be contained for this type.
46 * This is equal to the appropriate _COUNT constant or there is an error. Returns -1 if unsupported.
48 T_CTEST_API
int32_t T_CTEST_EXPORT2
udbg_enumExpectedCount(UDebugEnumType type
);
51 * For consistency checking, returns the expected enum ordinal value for the given index value.
52 * @param type which type
53 * @param field field number
54 * @return should be equal to 'field' or -1 if out of range.
56 T_CTEST_API
int32_t T_CTEST_EXPORT2
udbg_enumArrayValue(UDebugEnumType type
, int32_t field
);