mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-14 17:24:01 +00:00
ICU-2248 modularize ICU
X-SVN-Rev: 9903
This commit is contained in:
parent
2a19dd8701
commit
44707c157b
60 changed files with 325 additions and 66 deletions
|
@ -28,11 +28,16 @@
|
|||
* a customized collator object. For example, number 1 to be sorted
|
||||
* equlivalent to word 'one'.
|
||||
*/
|
||||
#ifndef INCLUDE_CALLCOLL_C
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#ifndef INCLUDE_CALLCOLL_C
|
||||
|
||||
#include "unicode/ucol.h"
|
||||
#include "unicode/uloc.h"
|
||||
#include "cstring.h"
|
||||
|
@ -851,3 +856,5 @@ TestJitterbug1098(){
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
|
|
@ -20,6 +20,10 @@
|
|||
#ifndef _CALLCOLLTST
|
||||
#define _CALLCOLLTST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
|
||||
|
@ -28,5 +32,6 @@
|
|||
void doTest(UCollator*, const UChar* source, const UChar* target, UCollationResult result);
|
||||
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -46,11 +46,19 @@ void addAllTests(TestNode** root)
|
|||
addUCharTransformTest(root);
|
||||
addStandardNamesTest(root);
|
||||
addCompactArrayTest(root);
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
addFormatTest(root);
|
||||
#endif
|
||||
#if !UCONFIG_NO_BREAK_ITERATION
|
||||
addBreakIter(root);
|
||||
#endif
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
addCollTest(root);
|
||||
#endif
|
||||
addComplexTest(root);
|
||||
#if !UCONFIG_NO_TRANSLITERATION
|
||||
addUTransTest(root);
|
||||
#endif
|
||||
addUSetTest(root);
|
||||
addTestDeprecatedAPI(root);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,11 @@
|
|||
* Madhu Katragadda Ported for C API
|
||||
*********************************************************************************
|
||||
*//* C API TEST For COLLATOR */
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "ucol_imp.h"
|
||||
#include "unicode/uloc.h"
|
||||
#include "cintltst.h"
|
||||
|
@ -1539,3 +1543,5 @@ void TestGetTailoredSet() {
|
|||
ucol_close(coll);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
#ifndef _CCOLLAPITST
|
||||
#define _CCOLLAPITST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "cintltst.h"
|
||||
#define MAX_TOKEN_LEN 16
|
||||
|
@ -91,4 +94,6 @@
|
|||
*/
|
||||
void TestGetTailoredSet(void);
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -17,9 +17,13 @@
|
|||
* try to test the full functionality. It just calls each function in the class and
|
||||
* verifies that it works on a basic level.
|
||||
**/
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_BREAK_ITERATION
|
||||
|
||||
#include "unicode/uloc.h"
|
||||
#include "unicode/ubrk.h"
|
||||
#include "unicode/utypes.h"
|
||||
#include "unicode/ustring.h"
|
||||
#include "unicode/ucnv.h"
|
||||
#include "ustr_imp.h"
|
||||
|
@ -557,5 +561,4 @@ static void TestBreakIteratorRuleError() {
|
|||
freeToUCharStrings(&freeHook);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* #if !UCONFIG_NO_BREAK_ITERATION */
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
#ifndef _CBRKITRAPITST
|
||||
#define _CBRKITRAPITST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_BREAK_ITERATION
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
/**
|
||||
|
@ -26,4 +30,6 @@
|
|||
/* The function used to test the BreakIterator API*/
|
||||
static void TestBreakIteratorCAPI(void);
|
||||
|
||||
#endif /* #if !UCONFIG_NO_BREAK_ITERATION */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -12,6 +12,11 @@
|
|||
* Madhu Katragadda Creation
|
||||
*********************************************************************************
|
||||
*/
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_BREAK_ITERATION
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
void addBrkIterAPITest(TestNode**);
|
||||
|
@ -24,3 +29,5 @@ void addBreakIter(TestNode** root)
|
|||
addBrkIterAPITest(root);
|
||||
addBrkIterRegrTest(root);
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_BREAK_ITERATION */
|
||||
|
|
|
@ -14,8 +14,11 @@
|
|||
|
||||
/* C API AND FUNCTIONALITY TEST FOR CALENDAR (ucol.h)*/
|
||||
|
||||
#include "unicode/uloc.h"
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
|
||||
#include "unicode/uloc.h"
|
||||
#include "unicode/ucal.h"
|
||||
#include "unicode/udat.h"
|
||||
#include "unicode/ustring.h"
|
||||
|
@ -1171,4 +1174,4 @@ static void verify2(const char* msg, UCalendar* c, UDateFormat* dat, int32_t yea
|
|||
|
||||
}
|
||||
|
||||
/*--------------------------------------------- */
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
|
|
@ -15,6 +15,10 @@
|
|||
#ifndef _CCALTST
|
||||
#define _CCALTST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
|
||||
|
@ -71,7 +75,6 @@
|
|||
static void verify2(const char* msg, UCalendar* c, UDateFormat* dat, int32_t year, int32_t month, int32_t day,
|
||||
int32_t hour, int32_t min, int32_t sec, int32_t am_pm);
|
||||
|
||||
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -13,6 +13,11 @@
|
|||
*********************************************************************************
|
||||
*/
|
||||
#include <stdio.h>
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "cintltst.h"
|
||||
#include "ccolltst.h"
|
||||
#include "unicode/ucol.h"
|
||||
|
@ -152,16 +157,6 @@ UChar* appendCompareResult(UCollationResult result, UChar* target)
|
|||
return target;
|
||||
}
|
||||
|
||||
UChar* CharsToUChars(const char* str) {
|
||||
/* Might be faster to just use uprv_strlen() as the preflight len - liu */
|
||||
int32_t len = u_unescape(str, 0, 0); /* preflight */
|
||||
/* Do NOT use malloc() - we are supposed to be acting like user code! */
|
||||
UChar *buf = (UChar*) malloc(sizeof(UChar) * (len + 1));
|
||||
u_unescape(str, buf, len + 1);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
/* Support for testing incremental strcoll */
|
||||
typedef struct {
|
||||
const UChar *start;
|
||||
|
@ -177,4 +172,4 @@ UChar U_CALLCONV testInc(void *context) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
|
|
@ -15,6 +15,10 @@
|
|||
#ifndef _CCOLLTST
|
||||
#define _CCOLLTST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "cintltst.h"
|
||||
#include "unicode/ucol.h"
|
||||
|
||||
|
@ -29,9 +33,6 @@ void reportCResult( const UChar source[], const UChar target[],
|
|||
|
||||
UChar* appendCompareResult(UCollationResult result, UChar* target);
|
||||
|
||||
|
||||
UChar* CharsToUChars(const char* chars);
|
||||
|
||||
void addCollAPITest(TestNode**);
|
||||
void addCurrencyTest(TestNode**);
|
||||
void addNormTest(TestNode**);
|
||||
|
@ -50,4 +51,6 @@ void addAllCollTest(TestNode**);
|
|||
void addMiscCollTest(TestNode**);
|
||||
void addSearchTest(TestNode**);
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -14,7 +14,11 @@
|
|||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
|
||||
#include "unicode/ucol.h"
|
||||
#include "unicode/uloc.h"
|
||||
#include "cintltst.h"
|
||||
|
@ -160,5 +164,4 @@ void currTest()
|
|||
ucol_close(c);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
|
|
@ -20,10 +20,16 @@
|
|||
#ifndef _CCURRCOLLTST
|
||||
#define _CCURRCOLLTST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
#define MAX_TOKEN_LEN 16
|
||||
/* Perform Collation Currency Test */
|
||||
void currTest(void);
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -20,7 +20,11 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "unicode/ucol.h"
|
||||
#include "unicode/uloc.h"
|
||||
#include "cintltst.h"
|
||||
|
@ -238,3 +242,4 @@ static void TestPrimary()
|
|||
ucol_close(myCollation);
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
#ifndef _CDANCOLLTST
|
||||
#define _CDANCOLLTST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
|
@ -34,5 +37,6 @@ static void TestPrimary(void);
|
|||
static void TestTertiary(void);
|
||||
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -15,8 +15,11 @@
|
|||
|
||||
/* C API TEST FOR DATE FORMAT */
|
||||
|
||||
#include "unicode/uloc.h"
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
|
||||
#include "unicode/uloc.h"
|
||||
#include "unicode/udat.h"
|
||||
#include "unicode/ucal.h"
|
||||
#include "unicode/unum.h"
|
||||
|
@ -779,3 +782,5 @@ static UChar* myNumformat(const UNumberFormat* numfor, double d)
|
|||
|
||||
return result2;
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
#ifndef _CDATFRMTST
|
||||
#define _CDATFRMTST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
/**
|
||||
|
@ -45,4 +49,6 @@
|
|||
**/
|
||||
static UChar* myNumformat(const UNumberFormat* numfor, double d);
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -19,7 +19,11 @@
|
|||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "unicode/ucol.h"
|
||||
#include "unicode/uloc.h"
|
||||
#include "cintltst.h"
|
||||
|
@ -131,3 +135,5 @@ static void TestPrimary()
|
|||
}
|
||||
ucol_close(myCollation);
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
#ifndef _CGERCOLLTST
|
||||
#define _CGERCOLLTST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
|
@ -34,6 +37,6 @@ static void TestPrimary(void);
|
|||
static void TestTertiary(void);
|
||||
|
||||
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -14,8 +14,11 @@
|
|||
*/
|
||||
/* INDEPTH TEST FOR DATE FORMAT */
|
||||
|
||||
#include "unicode/uloc.h"
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
|
||||
#include "unicode/uloc.h"
|
||||
#include "unicode/udat.h"
|
||||
#include "unicode/ucal.h"
|
||||
#include "unicode/unum.h"
|
||||
|
@ -314,3 +317,5 @@ void TestQuotePattern161()
|
|||
free(pattern);
|
||||
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
#ifndef _CDTFRRGSTST
|
||||
#define _CDTFRRGSTST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
/**
|
||||
|
@ -48,4 +52,6 @@ void TestQuotePattern161(void);
|
|||
/*Internal functions used*/
|
||||
void tryPat994(UDateFormat* format, const char* pat, const char* s, UDate expected);
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -15,8 +15,11 @@
|
|||
*/
|
||||
/* REGRESSION TEST FOR DATE FORMAT */
|
||||
|
||||
#include "unicode/uloc.h"
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
|
||||
#include "unicode/uloc.h"
|
||||
#include "unicode/udat.h"
|
||||
#include "unicode/ucal.h"
|
||||
#include "unicode/unum.h"
|
||||
|
@ -510,4 +513,6 @@ UChar* myFormatit(UDateFormat* datdef, UDate d1)
|
|||
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
||||
/*eof*/
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
#ifndef _CDTFRRGSTST
|
||||
#define _CDTFRRGSTST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
/**
|
||||
|
@ -41,4 +45,6 @@
|
|||
**/
|
||||
UChar* myFormatit(UDateFormat* datdef, UDate d1);
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -19,7 +19,11 @@
|
|||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "unicode/ucol.h"
|
||||
#include "unicode/uloc.h"
|
||||
#include "cintltst.h"
|
||||
|
@ -116,3 +120,4 @@ static void TestPrimary()
|
|||
ucol_close(myCollation);
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
#ifndef _CESCOLLTST
|
||||
#define _CESCOLLTST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
|
@ -35,6 +38,7 @@
|
|||
static void TestTertiary(void);
|
||||
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -19,7 +19,11 @@
|
|||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "unicode/ucol.h"
|
||||
#include "unicode/uloc.h"
|
||||
#include "cintltst.h"
|
||||
|
@ -105,3 +109,4 @@ static void TestPrimary()
|
|||
ucol_close(myCollation);
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
#ifndef _CFINCOLLTST
|
||||
#define _CFINCOLLTST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
|
@ -35,5 +38,6 @@ static void TestPrimary(void);
|
|||
static void TestTertiary(void);
|
||||
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -15,6 +15,10 @@
|
|||
|
||||
/* FormatTest is a medium top level test for everything in the C FORMAT API */
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
|
||||
#include "cintltst.h"
|
||||
#include "cformtst.h"
|
||||
|
||||
|
@ -65,3 +69,5 @@ UChar* myDateFormat(UDateFormat* dat, UDate d1)
|
|||
return result1;
|
||||
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
|
|
@ -17,14 +17,17 @@
|
|||
#ifndef _CFORMATTST
|
||||
#define _CFORMATTST
|
||||
|
||||
#include "cintltst.h"
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
|
||||
#include "cintltst.h"
|
||||
#include "unicode/udat.h"
|
||||
|
||||
|
||||
/* Internal fucntion used by all the test format files */
|
||||
UChar* myDateFormat(UDateFormat *dat, UDate d);
|
||||
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -19,7 +19,11 @@
|
|||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "unicode/ucol.h"
|
||||
#include "unicode/uloc.h"
|
||||
#include "cintltst.h"
|
||||
|
@ -214,3 +218,5 @@ static void TestExtra()
|
|||
}
|
||||
ucol_close(myCollation);
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
#ifndef _CFRCOLLTST
|
||||
#define _CFRCOLLTST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
|
@ -36,5 +39,6 @@
|
|||
static void TestTertiary(void);
|
||||
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -37,7 +37,11 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "unicode/ucol.h"
|
||||
#include "unicode/uloc.h"
|
||||
#include "cintltst.h"
|
||||
|
@ -302,3 +306,5 @@ static void TestDemo4()
|
|||
ucol_close(myCollation);
|
||||
free(temp);
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
|
|
@ -38,6 +38,10 @@
|
|||
#ifndef _CG7COLLTST
|
||||
#define _CG7COLLTST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
#define MAX_TOKEN_LEN 16
|
||||
|
@ -62,4 +66,6 @@
|
|||
/* " & aa ; a'-' & ee ; e'-' & ii ; i'-' & oo ; o'-' & uu ; u'-' " */
|
||||
static void TestDemo4(void);
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -339,8 +339,14 @@ void ctest_setICU_DATA() {
|
|||
u_setDataDirectory(ctest_dataOutDir());
|
||||
}
|
||||
|
||||
|
||||
|
||||
UChar* CharsToUChars(const char* str) {
|
||||
/* Might be faster to just use uprv_strlen() as the preflight len - liu */
|
||||
int32_t len = u_unescape(str, 0, 0); /* preflight */
|
||||
/* Do NOT use malloc() - we are supposed to be acting like user code! */
|
||||
UChar *buf = (UChar*) malloc(sizeof(UChar) * (len + 1));
|
||||
u_unescape(str, buf, len + 1);
|
||||
return buf;
|
||||
}
|
||||
|
||||
char *austrdup(const UChar* unichars)
|
||||
{
|
||||
|
|
|
@ -42,6 +42,8 @@ U_CFUNC const char* ctest_dataOutDir(void);
|
|||
*/
|
||||
U_CFUNC void ctest_pathnameInContext(char* fullname, int32_t maxsize, const char* relPath ) ;
|
||||
|
||||
UChar* CharsToUChars(const char* chars);
|
||||
|
||||
/**
|
||||
* Convert a const UChar* into a char*
|
||||
* Caller owns storage, but in practice this function
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
*/
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "unicode/ucol.h"
|
||||
#include "unicode/uloc.h"
|
||||
#include "unicode/uchar.h"
|
||||
|
@ -1979,3 +1982,5 @@ static void TestSortKeyValidity(void)
|
|||
}
|
||||
T_FileStream_close(file);
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
|
|
@ -20,10 +20,13 @@
|
|||
#ifndef _CITERCOLLTST
|
||||
#define _CITERCOLLTST
|
||||
|
||||
#include "cintltst.h"
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "unicode/ucol.h"
|
||||
#include "unicode/ucoleitr.h"
|
||||
#include "cintltst.h"
|
||||
|
||||
#define MAX_TOKEN_LEN 16
|
||||
|
||||
|
@ -118,6 +121,6 @@
|
|||
static UChar *test1;
|
||||
static UChar *test2;
|
||||
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -22,7 +22,11 @@
|
|||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "unicode/ucol.h"
|
||||
#include "unicode/uloc.h"
|
||||
#include "cintltst.h"
|
||||
|
@ -247,3 +251,5 @@ static void TestChooonKigoo(void)
|
|||
|
||||
ucol_close(myCollation);
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
|
|
@ -24,6 +24,9 @@
|
|||
#ifndef _CJACOLLTST
|
||||
#define _CJACOLLTST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
|
@ -55,4 +58,6 @@ static void TestKatakanaHiragana(void);
|
|||
*/
|
||||
static void TestChooonKigoo(void);
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -14,7 +14,11 @@
|
|||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "unicode/ucol.h"
|
||||
#include "unicode/ucoleitr.h"
|
||||
#include "unicode/uloc.h"
|
||||
|
@ -3661,3 +3665,5 @@ void addMiscCollTest(TestNode** root)
|
|||
/*addTest(root, &PrintMarkDavis, "tscoll/cmsccoll/PrintMarkDavis");*/ /* this test doesn't test - just prints sortkeys */
|
||||
/*addTest(root, &TestGetCaseBit, "tscoll/cmsccoll/TestGetCaseBit");*/ /*this one requires internal things to be exported */
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
|
|
@ -14,8 +14,11 @@
|
|||
*/
|
||||
/* C API TEST FOR MESSAGE FORMAT */
|
||||
|
||||
#include "unicode/uloc.h"
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
|
||||
#include "unicode/uloc.h"
|
||||
#include "unicode/umsg.h"
|
||||
#include "unicode/udat.h"
|
||||
#include "unicode/umsg.h"
|
||||
|
@ -978,3 +981,5 @@ void addMsgForTest(TestNode** root)
|
|||
addTest(root, &TestJ904, "tsformat/cmsgtst/TestJ904");
|
||||
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
#ifndef _CMSGFRMTST
|
||||
#define _CMSGFRMTST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
|
||||
|
@ -51,4 +55,6 @@
|
|||
*/
|
||||
static void TestJ904(void);
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -17,8 +17,11 @@
|
|||
|
||||
/* C DEPTH TEST FOR NUMBER FORMAT */
|
||||
|
||||
#include "unicode/uloc.h"
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
|
||||
#include "unicode/uloc.h"
|
||||
#include "unicode/unum.h"
|
||||
#include "unicode/ustring.h"
|
||||
#include "cintltst.h"
|
||||
|
@ -754,3 +757,5 @@ static void TestSecondaryGrouping(void) {
|
|||
unum_close(f);
|
||||
unum_close(us);
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
|
|
@ -17,6 +17,10 @@
|
|||
#ifndef _CNUMDEPTST
|
||||
#define _CNUMDEPTST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
/* The function used to test differnet format patterns*/
|
||||
|
@ -45,4 +49,6 @@ static void TestSecondaryGrouping(void);
|
|||
/*Internal functions used*/
|
||||
static void roundingTest(UNumberFormat*, double, int32_t, const char*);
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -19,14 +19,12 @@
|
|||
#include <time.h>
|
||||
#include "unicode/uchar.h"
|
||||
#include "unicode/ustring.h"
|
||||
#include "unicode/unorm.h"
|
||||
#include "cintltst.h"
|
||||
#include "cnormtst.h"
|
||||
#include "ccolltst.h"
|
||||
|
||||
#define ARRAY_LENGTH(array) (sizeof (array) / sizeof (*array))
|
||||
|
||||
static UCollator *myCollation;
|
||||
|
||||
static void
|
||||
TestAPI(void);
|
||||
|
||||
|
@ -126,11 +124,6 @@ void TestDecomp()
|
|||
int32_t x, neededLen, resLen;
|
||||
UChar *source=NULL, *result=NULL;
|
||||
status = U_ZERO_ERROR;
|
||||
myCollation = ucol_open("en_US", &status);
|
||||
if(U_FAILURE(status)){
|
||||
log_err("ERROR: in creation of rule based collator: %s\n", myErrorName(status));
|
||||
return;
|
||||
}
|
||||
resLen=0;
|
||||
log_verbose("Testing unorm_normalize with Decomp canonical\n");
|
||||
for(x=0; x < ARRAY_LENGTH(canonTests); x++)
|
||||
|
@ -151,7 +144,6 @@ void TestDecomp()
|
|||
free(result);
|
||||
free(source);
|
||||
}
|
||||
ucol_close(myCollation);
|
||||
}
|
||||
|
||||
void TestCompatDecomp()
|
||||
|
@ -160,11 +152,6 @@ void TestCompatDecomp()
|
|||
int32_t x, neededLen, resLen;
|
||||
UChar *source=NULL, *result=NULL;
|
||||
status = U_ZERO_ERROR;
|
||||
myCollation = ucol_open("en_US", &status);
|
||||
if(U_FAILURE(status)){
|
||||
log_err("ERROR: in creation of rule based collator: %s\n", myErrorName(status));
|
||||
return;
|
||||
}
|
||||
resLen=0;
|
||||
log_verbose("Testing unorm_normalize with Decomp compat\n");
|
||||
for(x=0; x < ARRAY_LENGTH(compatTests); x++)
|
||||
|
@ -185,7 +172,6 @@ void TestCompatDecomp()
|
|||
free(result);
|
||||
free(source);
|
||||
}
|
||||
ucol_close(myCollation);
|
||||
}
|
||||
|
||||
void TestCanonDecompCompose()
|
||||
|
@ -194,11 +180,6 @@ void TestCanonDecompCompose()
|
|||
int32_t x, neededLen, resLen;
|
||||
UChar *source=NULL, *result=NULL;
|
||||
status = U_ZERO_ERROR;
|
||||
myCollation = ucol_open("en_US", &status);
|
||||
if(U_FAILURE(status)){
|
||||
log_err("ERROR: in creation of rule based collator: %s\n", myErrorName(status));
|
||||
return;
|
||||
}
|
||||
resLen=0;
|
||||
log_verbose("Testing unorm_normalize with Decomp can compose compat\n");
|
||||
for(x=0; x < ARRAY_LENGTH(canonTests); x++)
|
||||
|
@ -219,7 +200,6 @@ void TestCanonDecompCompose()
|
|||
free(result);
|
||||
free(source);
|
||||
}
|
||||
ucol_close(myCollation);
|
||||
}
|
||||
|
||||
void TestCompatDecompCompose()
|
||||
|
@ -228,11 +208,6 @@ void TestCompatDecompCompose()
|
|||
int32_t x, neededLen, resLen;
|
||||
UChar *source=NULL, *result=NULL;
|
||||
status = U_ZERO_ERROR;
|
||||
myCollation = ucol_open("en_US", &status);
|
||||
if(U_FAILURE(status)){
|
||||
log_err("ERROR: in creation of rule based collator: %s\n", myErrorName(status));
|
||||
return;
|
||||
}
|
||||
resLen=0;
|
||||
log_verbose("Testing unorm_normalize with compat decomp compose can\n");
|
||||
for(x=0; x < ARRAY_LENGTH(compatTests); x++)
|
||||
|
@ -253,7 +228,6 @@ void TestCompatDecompCompose()
|
|||
free(result);
|
||||
free(source);
|
||||
}
|
||||
ucol_close(myCollation);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -19,8 +19,11 @@
|
|||
|
||||
/* C API TEST FOR NUMBER FORMAT */
|
||||
|
||||
#include "unicode/uloc.h"
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
|
||||
#include "unicode/uloc.h"
|
||||
#include "unicode/unum.h"
|
||||
#include "unicode/ustring.h"
|
||||
#include "cintltst.h"
|
||||
|
@ -783,3 +786,4 @@ free(result);
|
|||
unum_close(pattern);
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
|
|
@ -16,6 +16,10 @@
|
|||
#ifndef _CNUMFRMTST
|
||||
#define _CNUMFRMTST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_FORMATTING
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
|
||||
|
@ -29,4 +33,6 @@
|
|||
**/
|
||||
static void TestNumberFormatPadding(void);
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -16,11 +16,14 @@
|
|||
/* C FUNCTIONALITY AND REGRESSION TEST FOR BREAKITERATOR */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_BREAK_ITERATION
|
||||
|
||||
#include "unicode/uloc.h"
|
||||
#include "unicode/ubrk.h"
|
||||
#include "unicode/uchar.h"
|
||||
#include "unicode/utypes.h"
|
||||
#include "unicode/utypes.h"
|
||||
#include "unicode/ustring.h"
|
||||
#include "cintltst.h"
|
||||
#include "cregrtst.h"
|
||||
|
@ -1797,3 +1800,5 @@ void addBrkIterRegrTest(TestNode** root)
|
|||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_BREAK_ITERATION */
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
#ifndef _CBRKITREGTEST
|
||||
#define _CBRKITREGTEST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_BREAK_ITERATION
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
|
@ -214,5 +217,6 @@ UChar* testCharacterText;
|
|||
|
||||
static UChar *cannedTestChars;
|
||||
|
||||
#endif /* #if !UCONFIG_NO_BREAK_ITERATION */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -219,6 +219,8 @@ TestCaseUpper() {
|
|||
}
|
||||
}
|
||||
|
||||
#if !UCONFIG_NO_BREAK_ITERATION
|
||||
|
||||
U_CFUNC void
|
||||
TestCaseTitle() {
|
||||
static const UChar
|
||||
|
@ -323,6 +325,8 @@ TestCaseTitle() {
|
|||
ubrk_close(titleIterChars);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* test case folding and case-insensitive string compare -------------------- */
|
||||
|
||||
U_CFUNC void
|
||||
|
|
|
@ -19,7 +19,11 @@
|
|||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "unicode/ucol.h"
|
||||
#include "unicode/uloc.h"
|
||||
#include "cintltst.h"
|
||||
|
@ -124,3 +128,4 @@ static void TestPrimary()
|
|||
ucol_close(myCollation);
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
#ifndef _CTRCOLLTST
|
||||
#define _CTRCOLLTST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
|
@ -33,4 +36,6 @@ static void TestPrimary(void);
|
|||
static void TestTertiary(void);
|
||||
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -148,7 +148,9 @@ void addUnicodeTest(TestNode** root)
|
|||
addTest(root, &TestUnescape, "tsutil/cucdtst/TestUnescape");
|
||||
addTest(root, &TestCaseLower, "tsutil/cucdtst/TestCaseLower");
|
||||
addTest(root, &TestCaseUpper, "tsutil/cucdtst/TestCaseUpper");
|
||||
#if !UCONFIG_NO_BREAK_ITERATION
|
||||
addTest(root, &TestCaseTitle, "tsutil/cucdtst/TestCaseTitle");
|
||||
#endif
|
||||
addTest(root, &TestCaseFolding, "tsutil/cucdtst/TestCaseFolding");
|
||||
addTest(root, &TestCaseCompare, "tsutil/cucdtst/TestCaseCompare");
|
||||
addTest(root, &TestUScriptCodeAPI, "tsutil/cucdtst/TestUScriptCodeAPI");
|
||||
|
|
|
@ -20,7 +20,11 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "unicode/ucol.h"
|
||||
#include "unicode/uloc.h"
|
||||
#include "cintltst.h"
|
||||
|
@ -349,3 +353,5 @@ static void TestSecondary()
|
|||
}
|
||||
ucol_close(myCollation);
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
#ifndef _CENCOLLTST
|
||||
#define _CENCOLLTST
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "cintltst.h"
|
||||
|
||||
|
@ -36,5 +39,6 @@ static void TestSecondary(void);
|
|||
static void TestTertiary(void);
|
||||
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -25,7 +25,9 @@
|
|||
|
||||
static void TestNextUChar(UConverter* cnv, const char* source, const char* limit, const uint32_t results[], const char* message);
|
||||
static void TestNextUCharError(UConverter* cnv, const char* source, const char* limit, UErrorCode expected, const char* message);
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
static void TestJitterbug981(void);
|
||||
#endif
|
||||
static void TestJitterbug1293(void);
|
||||
static void TestNewConvertWithBufferSizes(int32_t osize, int32_t isize) ;
|
||||
static void TestConverterTypesAndStarters(void);
|
||||
|
@ -238,7 +240,9 @@ void addTestNewConvert(TestNode** root)
|
|||
addTest(root, &TestJitterbug792, "tsconv/nucnvtst/TestJitterbug792");
|
||||
addTest(root, &TestEBCDICUS4XML, "tsconv/nucnvtst/TestEBCDICUS4XML");
|
||||
addTest(root, &TestISCII, "tsconv/nucnvtst/TestISCII");
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
addTest(root, &TestJitterbug981, "tsconv/nucnvtst/TestJitterbug981");
|
||||
#endif
|
||||
addTest(root, &TestJitterbug1293, "tsconv/nucnvtst/TestJitterbug1293");
|
||||
addTest(root, &TestCoverageMBCS, "tsconv/nucnvtst/TestCoverageMBCS");
|
||||
addTest(root, &TestRoundTrippingAllUTF, "tsconv/nucnvtst/TestRoundTrippingAllUTF");
|
||||
|
@ -5012,6 +5016,8 @@ static void TestEBCDICUS4XML()
|
|||
ucnv_close(cnv);
|
||||
}
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
static void TestJitterbug981(){
|
||||
const UChar* rules;
|
||||
int32_t rules_length, target_cap, bytes_needed;
|
||||
|
@ -5047,6 +5053,8 @@ static void TestJitterbug981(){
|
|||
ucnv_close(utf8cnv);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void TestJitterbug1293(){
|
||||
UChar src[] = {0x30DE, 0x30A4, 0x5E83, 0x544A, 0x30BF, 0x30A4, 0x30D7,0x000};
|
||||
char target[256];
|
||||
|
|
|
@ -12,6 +12,10 @@
|
|||
#ifndef USRCHDAT_C
|
||||
#define USRCHDAT_C
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "unicode/ucol.h"
|
||||
|
||||
struct SearchData {
|
||||
|
@ -456,4 +460,6 @@ static const SearchData CONTRACTIONCANONICAL[] = {
|
|||
{NULL, NULL, NULL, UCOL_TERTIARY, NULL, {-1}, {0}}
|
||||
};
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -9,6 +9,10 @@
|
|||
* synwee July 19 2001 creation
|
||||
********************************************************************/
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_COLLATION
|
||||
|
||||
#include "unicode/usearch.h"
|
||||
#include "unicode/ustring.h"
|
||||
#include "ccolltst.h"
|
||||
|
@ -2043,3 +2047,4 @@ void addSearchTest(TestNode** root)
|
|||
addTest(root, &TestEnd, "tscoll/usrchtst/TestEnd");
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_COLLATION */
|
||||
|
|
|
@ -8,6 +8,10 @@
|
|||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#include "unicode/utypes.h"
|
||||
|
||||
#if !UCONFIG_NO_TRANSLITERATION
|
||||
|
||||
#include "unicode/utrans.h"
|
||||
#include "cmemory.h"
|
||||
#include "cstring.h"
|
||||
|
@ -585,3 +589,5 @@ static void _expect(const UTransliterator* trans,
|
|||
}
|
||||
FreeXReplaceable(&xrep);
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_TRANSLITERATION */
|
||||
|
|
Loading…
Add table
Reference in a new issue