]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/cintltst/cintltst.h
1 /********************************************************************
3 * Copyright (c) 1997-2005, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 ********************************************************************/
6 /********************************************************************************
10 * Madhu Katragadda Creation
11 * Modification History:
12 * Date Name Description
13 * 07/13/99 helena HPUX 11 CC port.
14 *********************************************************************************
16 The main root for C API tests
22 #include "unicode/utypes.h"
23 #include "unicode/putil.h"
24 #include "unicode/ctest.h"
27 #ifndef U_USE_DEPRECATED_API
28 #define U_USE_DEPRECATED_API 1
31 U_CFUNC
void addAllTests(TestNode
** root
);
34 * Return the path to the icu/source/data/out directory
36 U_CFUNC
const char* ctest_dataOutDir(void);
39 * Return the path to the icu/source/data/ directory
40 * for out of source builds too returns the source directory
42 U_CFUNC
const char* ctest_dataSrcDir(void);
44 U_CFUNC UChar
* CharsToUChars(const char* chars
);
47 * Convert a const UChar* into a char*
48 * Caller owns storage, but in practice this function
49 * LEAKS so be aware of that.
50 * @param unichars UChars (null terminated) to be converted
51 * @return new char* to the unichars in host format
54 U_CFUNC
char *austrdup(const UChar
* unichars
);
55 U_CFUNC
char *aescstrdup(const UChar
* unichars
, int32_t length
);
56 U_CFUNC
void *ctst_malloc(size_t size
);
57 U_CFUNC
void ctst_freeAll(void);
59 U_CFUNC
const char* loadTestData(UErrorCode
* err
);
62 * function used to specify the error
63 * converts the errorcode to an error descriptive string(const char*)
64 * @param status the error code
66 #define myErrorName(errorCode) u_errorName(errorCode)
70 * Call this once to get a consistent timezone. Use ctest_resetTimeZone to set it back to the original value.
71 * @param optionalTimeZone Set this to a requested timezone.
72 * Set to NULL to use the standard test timezone (Pacific Time)
74 U_CFUNC
void ctest_setTimeZone(const char *optionalTimeZone
, UErrorCode
*status
);
76 * Call this once get back the original timezone
78 U_CFUNC
void ctest_resetTimeZone(void);
81 * Call this once get ICU back to its original state with test arguments.
82 * This function calls u_cleanup.
84 U_CFUNC UBool
ctest_resetICU(void);
87 * Assert that the given UErrorCode succeeds, and return TRUE if it does.
89 U_CFUNC UBool
assertSuccess(const char* msg
, UErrorCode
* ec
);
92 * Assert that the UBool is TRUE, and return TRUE if it does.
94 * NOTE: Use 'int condition' rather than 'UBool condition' so the
95 * compiler doesn't complain about integral conversion of expressions
98 U_CFUNC UBool
assertTrue(const char* msg
, int condition
);
101 * Assert that the actualString equals the expectedString, and return
104 U_CFUNC UBool
assertEquals(const char* msg
, const char* expectedString
,
105 const char* actualString
);
108 * Time bomb - allows temporary behavior that expires at a given
112 U_CFUNC UBool
isICUVersionAtLeast(const UVersionInfo x
);