]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/cintltst/cintltst.h
1 /********************************************************************
3 * Copyright (c) 1997-2004, 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"
26 #ifndef U_USE_DEPRECATED_API
27 #define U_USE_DEPRECATED_API 1
30 U_CFUNC
void addAllTests(TestNode
** root
);
33 * Return the path to the icu/source/data/out directory
35 U_CFUNC
const char* ctest_dataOutDir(void);
38 * Return the path to the icu/source/data/ directory
39 * for out of source builds too returns the source directory
41 U_CFUNC
const char* ctest_dataSrcDir(void);
44 *complete a relative path to a full pathname, and convert to platform-specific syntax.
45 * The character seperating directories for the relative path is '|'.
46 * @fullname the full path name
47 * @maxsize the maximum size of the string
48 * @relPath the relative path name
50 U_CFUNC
void ctest_pathnameInContext(char* fullname
, int32_t maxsize
, const char* relPath
) ;
52 U_CFUNC UChar
* CharsToUChars(const char* chars
);
55 * Convert a const UChar* into a char*
56 * Caller owns storage, but in practice this function
57 * LEAKS so be aware of that.
58 * @param unichars UChars (null terminated) to be converted
59 * @return new char* to the unichars in host format
62 U_CFUNC
char *austrdup(const UChar
* unichars
);
63 U_CFUNC
char *aescstrdup(const UChar
* unichars
, int32_t length
);
64 U_CFUNC
void *ctst_malloc(size_t size
);
65 U_CFUNC
void ctst_freeAll(void);
67 U_CFUNC
const char* loadTestData(UErrorCode
* err
);
70 * function used to specify the error
71 * converts the errorcode to an error descriptive string(const char*)
72 * @param status the error code
74 #define myErrorName(errorCode) u_errorName(errorCode)
78 * Call this once to get a consistent timezone. Use ctest_resetTimeZone to set it back to the original value.
79 * @param optionalTimeZone Set this to a requested timezone.
80 * Set to NULL to use the standard test timezone (Pacific Time)
82 U_CFUNC
void ctest_setTimeZone(const char *optionalTimeZone
, UErrorCode
*status
);
84 * Call this once get back the original timezone
86 U_CFUNC
void ctest_resetTimeZone(void);
89 * Assert that the given UErrorCode succeeds, and return TRUE if it does.
91 U_CFUNC UBool
assertSuccess(const char* msg
, UErrorCode
* ec
);
94 * Assert that the UBool is TRUE, and return TRUE if it does.
96 * NOTE: Use 'int condition' rather than 'UBool condition' so the
97 * compiler doesn't complain about integral conversion of expressions
100 U_CFUNC UBool
assertTrue(const char* msg
, int condition
);
103 * Assert that the actualString equals the expectedString, and return
106 U_CFUNC UBool
assertEquals(const char* msg
, const char* expectedString
,
107 const char* actualString
);