OLD | NEW |
1 /******************************************************************** | 1 /******************************************************************** |
2 * COPYRIGHT: | 2 * COPYRIGHT: |
3 * Copyright (c) 1997-2014, International Business Machines Corporation and | 3 * Copyright (c) 1997-2015, International Business Machines Corporation and |
4 * others. All Rights Reserved. | 4 * others. All Rights Reserved. |
5 ********************************************************************/ | 5 ********************************************************************/ |
6 | 6 |
7 | 7 |
8 /** | 8 /** |
9 * IntlTest is a base class for tests. */ | 9 * IntlTest is a base class for tests. */ |
10 | 10 |
11 #ifndef _INTLTEST | 11 #ifndef _INTLTEST |
12 #define _INTLTEST | 12 #define _INTLTEST |
13 | 13 |
14 // The following includes utypes.h, uobject.h and unistr.h | 14 // The following includes utypes.h, uobject.h and unistr.h |
15 #include "unicode/fmtable.h" | 15 #include "unicode/fmtable.h" |
16 #include "unicode/testlog.h" | 16 #include "unicode/testlog.h" |
17 | 17 |
18 | 18 |
19 #if U_NO_DEFAULT_INCLUDE_UTF_HEADERS | 19 #if U_NO_DEFAULT_INCLUDE_UTF_HEADERS |
20 /* deprecated - make tests pass with U_NO_DEFAULT_INCLUDE_UTF_HEADERS */ | 20 /* deprecated - make tests pass with U_NO_DEFAULT_INCLUDE_UTF_HEADERS */ |
21 #include "unicode/utf_old.h" | 21 #include "unicode/utf_old.h" |
22 #endif | 22 #endif |
23 | 23 |
24 /** | |
25 * \def ICU_USE_THREADS | |
26 * | |
27 * Enables multi-threaded testing. Moved here from uconfig.h. | |
28 * Default: enabled | |
29 * | |
30 * This switch used to allow thread support (use of mutexes) to be compiled out
of ICU. | |
31 */ | |
32 #ifdef ICU_USE_THREADS | |
33 /* Use the predefined value. */ | |
34 #elif defined(APP_NO_THREADS) | |
35 /* APP_NO_THREADS is an old symbol. We'll honour it if present. */ | |
36 # define ICU_USE_THREADS 0 | |
37 #else | |
38 # define ICU_USE_THREADS 1 | |
39 #endif | |
40 | |
41 U_NAMESPACE_USE | 24 U_NAMESPACE_USE |
42 | 25 |
43 #if U_PLATFORM == U_PF_OS390 | 26 #if U_PLATFORM == U_PF_OS390 |
44 // avoid collision with math.h/log() | 27 // avoid collision with math.h/log() |
45 // this must be after including utypes.h so that U_PLATFORM is actually defined | 28 // this must be after including utypes.h so that U_PLATFORM is actually defined |
46 #pragma map(IntlTest::log( const UnicodeString &message ),"logos390") | 29 #pragma map(IntlTest::log( const UnicodeString &message ),"logos390") |
47 #endif | 30 #endif |
48 | 31 |
49 //----------------------------------------------------------------------------- | 32 //----------------------------------------------------------------------------- |
50 //convenience classes to ease porting code that uses the Java | 33 //convenience classes to ease porting code that uses the Java |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 */ | 268 */ |
286 UBool assertSuccess(const char* message, UErrorCode ec, UBool possibleDataEr
ror=FALSE, const char *file=NULL, int line=0); | 269 UBool assertSuccess(const char* message, UErrorCode ec, UBool possibleDataEr
ror=FALSE, const char *file=NULL, int line=0); |
287 UBool assertEquals(const char* message, const UnicodeString& expected, | 270 UBool assertEquals(const char* message, const UnicodeString& expected, |
288 const UnicodeString& actual, UBool possibleDataError=FALS
E); | 271 const UnicodeString& actual, UBool possibleDataError=FALS
E); |
289 UBool assertEquals(const char* message, const char* expected, | 272 UBool assertEquals(const char* message, const char* expected, |
290 const char* actual); | 273 const char* actual); |
291 UBool assertEquals(const char* message, UBool expected, | 274 UBool assertEquals(const char* message, UBool expected, |
292 UBool actual); | 275 UBool actual); |
293 UBool assertEquals(const char* message, int32_t expected, int32_t actual); | 276 UBool assertEquals(const char* message, int32_t expected, int32_t actual); |
294 UBool assertEquals(const char* message, int64_t expected, int64_t actual); | 277 UBool assertEquals(const char* message, int64_t expected, int64_t actual); |
| 278 UBool assertEquals(const char* message, double expected, double actual); |
295 #if !UCONFIG_NO_FORMATTING | 279 #if !UCONFIG_NO_FORMATTING |
296 UBool assertEquals(const char* message, const Formattable& expected, | 280 UBool assertEquals(const char* message, const Formattable& expected, |
297 const Formattable& actual, UBool possibleDataError=FALSE)
; | 281 const Formattable& actual, UBool possibleDataError=FALSE)
; |
298 UBool assertEquals(const UnicodeString& message, const Formattable& expected
, | 282 UBool assertEquals(const UnicodeString& message, const Formattable& expected
, |
299 const Formattable& actual); | 283 const Formattable& actual); |
300 #endif | 284 #endif |
301 UBool assertTrue(const UnicodeString& message, UBool condition, UBool quiet=
FALSE); | 285 UBool assertTrue(const UnicodeString& message, UBool condition, UBool quiet=
FALSE); |
302 UBool assertFalse(const UnicodeString& message, UBool condition, UBool quiet
=FALSE); | 286 UBool assertFalse(const UnicodeString& message, UBool condition, UBool quiet
=FALSE); |
303 UBool assertSuccess(const UnicodeString& message, UErrorCode ec); | 287 UBool assertSuccess(const UnicodeString& message, UErrorCode ec); |
304 UBool assertEquals(const UnicodeString& message, const UnicodeString& expect
ed, | 288 UBool assertEquals(const UnicodeString& message, const UnicodeString& expect
ed, |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 * This is a variant of cintltst/ccolltst.c:CharsToUChars(). | 380 * This is a variant of cintltst/ccolltst.c:CharsToUChars(). |
397 * It converts a character string into a UnicodeString, with | 381 * It converts a character string into a UnicodeString, with |
398 * unescaping \u sequences. | 382 * unescaping \u sequences. |
399 */ | 383 */ |
400 extern UnicodeString CharsToUnicodeString(const char* chars); | 384 extern UnicodeString CharsToUnicodeString(const char* chars); |
401 | 385 |
402 /* alias for CharsToUnicodeString */ | 386 /* alias for CharsToUnicodeString */ |
403 extern UnicodeString ctou(const char* chars); | 387 extern UnicodeString ctou(const char* chars); |
404 | 388 |
405 #endif // _INTLTEST | 389 #endif // _INTLTEST |
OLD | NEW |